From fe1f2fb821805c7573e4bb61ab1c8fa24ba192a2 Mon Sep 17 00:00:00 2001 From: ky_yusj <2655568377@qq.com> Date: Wed, 9 Jun 2021 16:36:37 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E8=A1=A8=E5=8D=95=E7=BB=86=E8=8A=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../business/houseSafety/houseTask.js | 1 + Web/src/main.js | 4 +++ .../house/info/form/base/attachments.vue | 12 ++++--- .../house/info/form/base/building.vue | 16 ++++----- .../business/house/info/form/base/index.vue | 5 --- .../business/house/info/form/patrol/grade.vue | 25 ++++++++++--- .../business/house/info/form/patrol/index.vue | 3 +- .../house/info/form/patrol/inspection.vue | 36 +++++++------------ 8 files changed, 55 insertions(+), 47 deletions(-) diff --git a/Web/src/common/api/requests/business/houseSafety/houseTask.js b/Web/src/common/api/requests/business/houseSafety/houseTask.js index 7ab3648..d5dc7b8 100644 --- a/Web/src/common/api/requests/business/houseSafety/houseTask.js +++ b/Web/src/common/api/requests/business/houseSafety/houseTask.js @@ -1,4 +1,5 @@ export default { houseTaskPage: ['/houseTask/page', 'post'], houseTaskEdit: ['/houseTask/edit', 'post'], + houseTaskSubmit: ['/houseTask/submit', 'post'] } \ No newline at end of file diff --git a/Web/src/main.js b/Web/src/main.js index e35f5b2..bf96d27 100644 --- a/Web/src/main.js +++ b/Web/src/main.js @@ -150,6 +150,10 @@ const app = new Vue({ */ siderCollapsed: false } + }, + + transfer: { + } }, mounted() { diff --git a/Web/src/pages/business/house/info/form/base/attachments.vue b/Web/src/pages/business/house/info/form/base/attachments.vue index b33fbc7..42fe7e2 100644 --- a/Web/src/pages/business/house/info/form/base/attachments.vue +++ b/Web/src/pages/business/house/info/form/base/attachments.vue @@ -163,12 +163,15 @@ export default { // await this.onLoadCodes(); /** 将默认数据覆盖到form */ const record = this.param && this.param.record; + const form = this.$_.cloneDeep(defaultForm); if (record) { - // this.$_.giveDeep(form, record); - for (var key in defaultForm.houseInfo) { + this.$_.giveDeep(form, record); + + for (var key in form.houseInfo) { const fileValue = []; - const fileList = !!record.houseInfo[key] ? record.houseInfo[key].split(',') : []; + const fileList = + !form.houseInfo[key] || form.houseInfo[key].length == 0 ? [] : form.houseInfo[key].split(','); for (let i = 0; i < fileList.length; i++) { const file = await PreviewFile(fileList[i]); const base64 = await BlobToBase64(file); @@ -180,10 +183,9 @@ export default { status: 'done', }); } - defaultForm.houseInfo[key] = fileValue; + form.houseInfo[key] = fileValue; } } - const form = this.$_.cloneDeep(defaultForm); this.form = form; } this.loading = false; diff --git a/Web/src/pages/business/house/info/form/base/building.vue b/Web/src/pages/business/house/info/form/base/building.vue index 68a22ee..544863f 100644 --- a/Web/src/pages/business/house/info/form/base/building.vue +++ b/Web/src/pages/business/house/info/form/base/building.vue @@ -198,6 +198,7 @@ { await this.onMapInit(); if (this.form.houseCode.lng && this.form.houseCode.lat) { diff --git a/Web/src/pages/business/house/info/form/base/index.vue b/Web/src/pages/business/house/info/form/base/index.vue index ac677c3..1dd53ef 100644 --- a/Web/src/pages/business/house/info/form/base/index.vue +++ b/Web/src/pages/business/house/info/form/base/index.vue @@ -13,7 +13,6 @@ :is="part.component" :key="index" :param="param" - @completedDateChanged="completedDateChanged" ref="forms" v-if="part.component" /> @@ -114,10 +113,6 @@ export default { } }); }, - completedDateChanged(value) { - console.log(value); - this.$emit('completedDateChanged', value); - }, }, }; \ No newline at end of file diff --git a/Web/src/pages/business/house/info/form/patrol/grade.vue b/Web/src/pages/business/house/info/form/patrol/grade.vue index 3cba2ef..2c87c1a 100644 --- a/Web/src/pages/business/house/info/form/patrol/grade.vue +++ b/Web/src/pages/business/house/info/form/patrol/grade.vue @@ -19,7 +19,11 @@ - + 1999) { + this.form.patrolInfo.initGrade = 1; + } + if (year > 1994 && year < 2000) { + this.form.patrolInfo.initGrade = 2; + } + if (year > 1979 && year < 1995) { + this.form.patrolInfo.initGrade = 3; + } + if (year < 1980) { + this.form.patrolInfo.initGrade = 4; + } }, }, async created() { this.onFillData(); - console.log(this.param); }, methods: { diff --git a/Web/src/pages/business/house/info/form/patrol/index.vue b/Web/src/pages/business/house/info/form/patrol/index.vue index e744a3f..b0422c2 100644 --- a/Web/src/pages/business/house/info/form/patrol/index.vue +++ b/Web/src/pages/business/house/info/form/patrol/index.vue @@ -9,7 +9,6 @@
{{part.title}}
export default { - props: ['id', 'param', 'frame', 'completedYear'], + props: ['id', 'param', 'frame'], data() { return { diff --git a/Web/src/pages/business/house/info/form/patrol/inspection.vue b/Web/src/pages/business/house/info/form/patrol/inspection.vue index 7eafea1..e431f49 100644 --- a/Web/src/pages/business/house/info/form/patrol/inspection.vue +++ b/Web/src/pages/business/house/info/form/patrol/inspection.vue @@ -122,6 +122,11 @@ export default { fileFieldArr: ['settlementTiltFiles', 'otherInfoFiles'], }; }, + + async created() { + this.onFillData(); + }, + methods: { /** * 必要的方法 @@ -130,33 +135,19 @@ export default { async onFillData() { this.loading = true; { - await this.onLoadCodes(); - + // await this.onLoadCodes(); /** 将默认数据覆盖到form */ const record = this.param && this.param.record; + const form = this.$_.cloneDeep(defaultForm); if (record) { - // this.$_.giveDeep(form, record); - // this.fileFieldArr.forEach((key) => { - // const fileValue = []; - // const fileList = !!record.patrolInfo[key] ? record.patrolInfo[key].split(',') : []; - // for (let i = 0; i < fileList.length; i++) { - // const file = await PreviewFile(fileList[i]); - // const base64 = await BlobToBase64(file); - // fileValue.push({ - // uid: fileList[i], - // response: fileList[i], // 用于和新上传的文件一同回传 - // name: file.name, - // url: base64, - // status: 'done', - // }); - // } - // defaultForm.patrolInfo[key] = fileValue; - // }); - for (var key in defaultForm.patrolInfo) { + this.$_.giveDeep(form, record); + + for (var key in form.patrolInfo) { if (key.indexOf('Files') > -1) { const fileValue = []; - const fileList = !!record.patrolInfo[key] ? record.patrolInfo[key].split(',') : []; + const fileList = + !form.patrolInfo[key] || form.patrolInfo[key].length == 0 ? [] : form.patrolInfo[key].split(','); for (let i = 0; i < fileList.length; i++) { const file = await PreviewFile(fileList[i]); const base64 = await BlobToBase64(file); @@ -168,11 +159,10 @@ export default { status: 'done', }); } - defaultForm.patrolInfo[key] = fileValue; + form.patrolInfo[key] = fileValue; } } } - const form = this.$_.cloneDeep(defaultForm); this.form = form; } this.loading = false;