From 25cb56ddd3031144630d1e9d2e534ae8aa2d4a49 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Mon, 15 Aug 2022 10:59:06 +0800 Subject: [PATCH 1/5] good --- .../worklog/icworklog-add-or-update.vue | 26 ++++++++++++------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/views/modules/worklog/icworklog-add-or-update.vue b/src/views/modules/worklog/icworklog-add-or-update.vue index 0b28978eb..acbc195fc 100644 --- a/src/views/modules/worklog/icworklog-add-or-update.vue +++ b/src/views/modules/worklog/icworklog-add-or-update.vue @@ -13,6 +13,7 @@ :key="item.value" :label="item.label" :value="item.value" + :disabled="item.disabled" > @@ -69,7 +70,6 @@ --> { this.$refs['dataForm'].resetFields() this.dataForm.fileList = [] @@ -171,6 +166,15 @@ export default { ...this.dataForm, ...res.data } + + const grid = this.optionsG.filter(item => item.value === res.data.gridId) + if (grid.length < 1) { + this.gridState = false + this.optionsG.push({label:res.data.gridName, value:res.data.gridId, disabled: true}) + } else { + this.gridState = true + } + const { id } = this.$store.state.user if (this.dataForm.createdBy == id) { // 是本人可以修改 this.formType = 'update' @@ -197,6 +201,7 @@ export default { } }, getGridList() { + this.optionsG = [] const { user } = this.$store.state this.$http .post('/gov/org/customergrid/gridoption', { agencyId: user.agencyId, purpose: 'query' }) @@ -327,6 +332,9 @@ export default { }, // 表单提交 dataFormSubmitHandle: debounce(function () { + if (!this.gridState) { + return this.$message.error("请重新选择网格") + } if (this.dataForm.content.length < 70) { return this.$message.error("内容不能少于70字") } From c255bb14d15fcf6d672ef76d339b7eb7fa865c33 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Mon, 15 Aug 2022 13:34:43 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=9B=B4=E6=8D=A2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/worklog/icworklog-add-or-update.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/views/modules/worklog/icworklog-add-or-update.vue b/src/views/modules/worklog/icworklog-add-or-update.vue index acbc195fc..c0af91597 100644 --- a/src/views/modules/worklog/icworklog-add-or-update.vue +++ b/src/views/modules/worklog/icworklog-add-or-update.vue @@ -202,9 +202,8 @@ export default { }, getGridList() { this.optionsG = [] - const { user } = this.$store.state this.$http - .post('/gov/org/customergrid/gridoption', { agencyId: user.agencyId, purpose: 'query' }) + .post('/gov/mine/agency/getmygrids') .then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) @@ -333,6 +332,8 @@ export default { // 表单提交 dataFormSubmitHandle: debounce(function () { if (!this.gridState) { + this.dataForm.gridId = '' + this.gridState = true return this.$message.error("请重新选择网格") } if (this.dataForm.content.length < 70) { From acff3a6edda93171d1719df9826c29f53f9d0f64 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Mon, 15 Aug 2022 13:39:52 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E9=87=8D=E6=96=B0=E6=8B=89=E5=8F=96?= =?UTF-8?q?=E5=88=86=E6=94=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../worklog/icworklog-add-or-update.vue | 31 ++++++++++++------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/src/views/modules/worklog/icworklog-add-or-update.vue b/src/views/modules/worklog/icworklog-add-or-update.vue index 0b28978eb..c0af91597 100644 --- a/src/views/modules/worklog/icworklog-add-or-update.vue +++ b/src/views/modules/worklog/icworklog-add-or-update.vue @@ -13,6 +13,7 @@ :key="item.value" :label="item.label" :value="item.value" + :disabled="item.disabled" > @@ -69,7 +70,6 @@ --> { this.$refs['dataForm'].resetFields() this.dataForm.fileList = [] @@ -171,6 +166,15 @@ export default { ...this.dataForm, ...res.data } + + const grid = this.optionsG.filter(item => item.value === res.data.gridId) + if (grid.length < 1) { + this.gridState = false + this.optionsG.push({label:res.data.gridName, value:res.data.gridId, disabled: true}) + } else { + this.gridState = true + } + const { id } = this.$store.state.user if (this.dataForm.createdBy == id) { // 是本人可以修改 this.formType = 'update' @@ -197,9 +201,9 @@ export default { } }, getGridList() { - const { user } = this.$store.state + this.optionsG = [] this.$http - .post('/gov/org/customergrid/gridoption', { agencyId: user.agencyId, purpose: 'query' }) + .post('/gov/mine/agency/getmygrids') .then(({ data: res }) => { if (res.code !== 0) { return this.$message.error(res.msg) @@ -327,6 +331,11 @@ export default { }, // 表单提交 dataFormSubmitHandle: debounce(function () { + if (!this.gridState) { + this.dataForm.gridId = '' + this.gridState = true + return this.$message.error("请重新选择网格") + } if (this.dataForm.content.length < 70) { return this.$message.error("内容不能少于70字") } From 3678f109e149dd335584d1d280ac353b9cec5ab2 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Mon, 15 Aug 2022 13:53:16 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=90=8D=E7=A7=B0=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/worklog/icworklog-add-or-update.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/views/modules/worklog/icworklog-add-or-update.vue b/src/views/modules/worklog/icworklog-add-or-update.vue index c0af91597..be6427e3f 100644 --- a/src/views/modules/worklog/icworklog-add-or-update.vue +++ b/src/views/modules/worklog/icworklog-add-or-update.vue @@ -10,9 +10,9 @@ > @@ -170,7 +170,7 @@ export default { const grid = this.optionsG.filter(item => item.value === res.data.gridId) if (grid.length < 1) { this.gridState = false - this.optionsG.push({label:res.data.gridName, value:res.data.gridId, disabled: true}) + this.optionsG.push({gridName:res.data.gridName, gridId:res.data.gridId, disabled: true}) } else { this.gridState = true } From e96196bd170c2163f438ee825dea8bafb9c6b9e5 Mon Sep 17 00:00:00 2001 From: zhangyuan Date: Mon, 15 Aug 2022 15:51:44 +0800 Subject: [PATCH 5/5] bug --- src/views/modules/worklog/icworklog-add-or-update.vue | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/views/modules/worklog/icworklog-add-or-update.vue b/src/views/modules/worklog/icworklog-add-or-update.vue index be6427e3f..bacf3a21e 100644 --- a/src/views/modules/worklog/icworklog-add-or-update.vue +++ b/src/views/modules/worklog/icworklog-add-or-update.vue @@ -167,8 +167,8 @@ export default { ...res.data } - const grid = this.optionsG.filter(item => item.value === res.data.gridId) - if (grid.length < 1) { + const grid = this.optionsG.filter(item => item.gridId === res.data.gridId) + if (grid.length < 1 && res.data.gridId !== '') { this.gridState = false this.optionsG.push({gridName:res.data.gridName, gridId:res.data.gridId, disabled: true}) } else { @@ -201,7 +201,6 @@ export default { } }, getGridList() { - this.optionsG = [] this.$http .post('/gov/mine/agency/getmygrids') .then(({ data: res }) => {