From 4be20f665bd0e88a31aaf07b727862b3b326f62a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=87=AA=E5=B8=A6=E5=A4=A7=E4=BD=AC=E6=B0=94=E5=9C=BA?= <188633308@qq.com> Date: Fri, 21 May 2021 14:04:05 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E5=AE=8C=E6=88=90=E6=88=BF=E5=B1=8B?= =?UTF-8?q?=E7=BC=96=E7=A0=81=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/HouseCode/HouseCodeService.cs | 2 +- Web/src/assets/style/lib/width-height.less | 8 +- .../business/house/houseCode/form/part.vue | 42 +++-- .../pages/business/house/houseCode/index.vue | 164 +++++++++++++----- 4 files changed, 158 insertions(+), 58 deletions(-) diff --git a/Api/Ewide.Application/Service/HouseCode/HouseCodeService.cs b/Api/Ewide.Application/Service/HouseCode/HouseCodeService.cs index 9dbb16d..56b00c9 100644 --- a/Api/Ewide.Application/Service/HouseCode/HouseCodeService.cs +++ b/Api/Ewide.Application/Service/HouseCode/HouseCodeService.cs @@ -66,7 +66,7 @@ namespace Ewide.Application.Service.HouseCode [HttpPost("/houseCode/page")] public async Task QueryPage([FromBody] QueryHouseCodeInput input) { - var sql = @"SELECT HC.*,HP.Note,AA.Name AreaName,RA.Name RoadName,CA.Name CommName FROM bs_house_code HC + var sql = @"SELECT HC.*,HP.AreaCode,HP.Note,AA.Name AreaName,RA.Name RoadName,CA.Name CommName FROM bs_house_code HC LEFT JOIN bs_house_projectinfo HP ON HP.Id=HC.ProjectId LEFT JOIN sys_area_code CA ON CA.Code = HP.AreaCode LEFT JOIN sys_area_code RA ON RA.AdCode = SUBSTR(CA.AdCode,1,9) diff --git a/Web/src/assets/style/lib/width-height.less b/Web/src/assets/style/lib/width-height.less index 6746e2e..caaedcf 100644 --- a/Web/src/assets/style/lib/width-height.less +++ b/Web/src/assets/style/lib/width-height.less @@ -5,19 +5,19 @@ @n : @i * 50; .w-@{n} { - width: @n * 1px; + width: @n * 1px !important; } .h-@{n} { - height: @n * 1px; + height: @n * 1px !important; } .w-@{n}-p { - width: @n * 1%; + width: @n * 1% !important; } .h-@{n}-p { - height: @n * 1%; + height: @n * 1% !important; } .width-height(@i + 1); diff --git a/Web/src/pages/business/house/houseCode/form/part.vue b/Web/src/pages/business/house/houseCode/form/part.vue index e52d7e3..665ae22 100644 --- a/Web/src/pages/business/house/houseCode/form/part.vue +++ b/Web/src/pages/business/house/houseCode/form/part.vue @@ -17,10 +17,15 @@ - + {{ item.value }} @@ -29,23 +34,20 @@ {{ item.value }} - - 宁波市 - - p.id === this.form.projectId); houseCode.push(...`000${project.sort}`.slice(-3).split('')); } else { @@ -265,12 +268,27 @@ export default { /** 将默认数据覆盖到form */ const record = this.param && this.param.record; + let areaCode = []; + if (record) { + areaCode = [ + record.areaCode.substr(0, 4), + record.areaCode.substr(0, 6), + record.areaCode.substr(0, 9), + record.areaCode, + ]; + } + this.form = this.$_.cloneDeep({ ...defaultForm, ...record, /** 在此处添加其他默认数据转换 */ /* ... */ + areaCode, }); + + if (this.form.id) { + this.onAreaCodeChange(true); + } }, /** @@ -458,16 +476,16 @@ export default { /** * 切换区域 */ - onAreaCodeChange() { + onAreaCodeChange(autoChange = false) { if (this.form.areaCode.length != 4) { this.form.areaCode = []; } - this.getProjects(); + this.getProjects(autoChange); }, - async getProjects() { - if (this.form.projectId) { + async getProjects(autoChange = false) { + if (this.form.projectId && !autoChange) { this.form.projectId = undefined; } if (this.form.areaCode && this.form.areaCode.length === 4) { diff --git a/Web/src/pages/business/house/houseCode/index.vue b/Web/src/pages/business/house/houseCode/index.vue index 76abf34..122ca14 100644 --- a/Web/src/pages/business/house/houseCode/index.vue +++ b/Web/src/pages/business/house/houseCode/index.vue @@ -18,23 +18,67 @@ + + + + + + + + + 全部 + {{ item.value }} + + + + + {{ item.value }} + + + + + - 新增编码 + 新增编码 + + - 编辑 + 编辑 @@ -47,16 +91,6 @@ - - - - - - - - - - \ No newline at end of file