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字") }