From ca1d5df75053fc5e968bdde8cc1cb80e747a121f Mon Sep 17 00:00:00 2001 From: limingyu Date: Wed, 31 Jan 2024 10:30:24 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9B=91=E7=AE=A1=E7=AB=AFbug=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=EF=BC=9A13754=E3=80=8113714?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../commonly/components/companiesList.vue | 169 ++++++++++-------- .../promise_book_issued/components/add.vue | 128 +++++++------ .../promise_book_issued/components/see.vue | 9 +- 3 files changed, 172 insertions(+), 134 deletions(-) diff --git a/src/views/hidden/commonly/commonly/components/companiesList.vue b/src/views/hidden/commonly/commonly/components/companiesList.vue index 6bf5042..71606b7 100644 --- a/src/views/hidden/commonly/commonly/components/companiesList.vue +++ b/src/views/hidden/commonly/commonly/components/companiesList.vue @@ -2,78 +2,93 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + ).then(async(data) => { const DETAIL = data.promistDetail.map(item => ({ value: item.COLLATERAL, id: item.PROMISEDETAIL_ID })) - this.form = { ...data.varList, DISTRIBUTIONOBJECT: data.varList.RELEASE_PLATFORM, DETAIL, people: [], coverpeople: [] } + this.form = { + ...data.varList, + DISTRIBUTIONOBJECT: data.varList.RELEASE_PLATFORM, + DETAIL, + people: [], + coverpeople: [] + } this.isSelectTemplate = true for (let i = 0; i < data.people.length; i++) { this.form.people.push({ @@ -426,15 +432,15 @@ export default { for (let j = 0; j < this.form.people.length; j++) { if (this.form.DISTRIBUTIONOBJECT === '1') { if (data.people[i].POST_ID === this.form.people[j].POST_ID) { - this.form.people[j].USER_ID.push(data.people[i].USER_ID) + this.form.people[j].USER_ID = data.people[i].USER_ID this.form.people.splice(j + 1, 1) - this.getUserList(this.form.people[j].DEPARTMENT_ID, this.form.people[j].POST_ID, j, 'created', 'people') + await this.getUserList(this.form.people[j].DEPARTMENT_ID, this.form.people[j].POST_ID, j, 'created', 'people') } } else { if (data.people[i].DEPARTMENT_ID === this.form.people[j].DEPARTMENT_ID) { - this.form.people[j].USER_ID.push(data.people[i].USER_ID) + this.form.people[j].USER_ID = data.people[i].USER_ID this.form.people.splice(j + 1, 1) - this.getUserList1({ id: this.form.people[j].DEPARTMENT_ID }, j, 'created', 'people') + await this.getUserList1({ id: this.form.people[j].DEPARTMENT_ID }, j, 'created', 'people') } } } @@ -458,9 +464,9 @@ export default { }) for (let j = 0; j < this.form.coverpeople.length; j++) { if (data.coverpeople[i].DEPARTMENT_ID === this.form.coverpeople[j].DEPARTMENT_ID) { - this.form.coverpeople[j].USER_ID.push(data.coverpeople[i].USER_ID) + this.form.coverpeople[j].USER_ID = data.coverpeople[i].USER_ID this.form.coverpeople.splice(j + 1, 1) - this.getUserList1({ id: this.form.coverpeople[j].DEPARTMENT_ID }, j, 'created', 'coverpeople') + await this.getUserList1({ id: this.form.coverpeople[j].DEPARTMENT_ID }, j, 'created', 'coverpeople') } } } @@ -517,64 +523,70 @@ export default { }, // 人员 getUserList(DEPARTMENT_ID, POST_ID, index, type, list) { - if (type !== 'created') { - let flag = false - for (let i = 0; i < this.form[list].length; i++) { - if (this.form[list][i].POST_ID === POST_ID) { - flag = true - break + return new Promise((resolve) => { + if (type !== 'created') { + let flag = false + for (let i = 0; i < this.form[list].length; i++) { + if (this.form[list][i].POST_ID === POST_ID) { + flag = true + break + } + } + if (flag) { + this.$message.warning('不能选择相同的岗位') + return + } else { + this.form[list][index].POST_ID = POST_ID } } - if (flag) { - this.$message.warning('不能选择相同的岗位') - return - } else { - this.form[list][index].POST_ID = POST_ID - } - } - requestFN( - '/corppromise/userlistAll', - { - DEPARTMENT_ID, - POST_ID - } - ).then((data) => { - this.form[list][index].userList = data.userList - if (type !== 'created') { - this.form[list][index].USER_ID = '' - } - }).catch((e) => { + requestFN( + '/corppromise/userlistAll', + { + DEPARTMENT_ID, + POST_ID + } + ).then((data) => { + this.form[list][index].userList = data.userList + if (type !== 'created') { + this.form[list][index].USER_ID = '' + } + resolve() + }).catch((e) => { + }) }) }, // 人员 getUserList1({ id: DEPARTMENT_ID }, index, type, list) { - if (type !== 'created') { - let flag = false - for (let i = 0; i < this.form[list].length; i++) { - if (this.form[list][i].DEPARTMENT_ID === DEPARTMENT_ID) { - flag = true - break + return new Promise((resolve) => { + if (type !== 'created') { + let flag = false + for (let i = 0; i < this.form[list].length; i++) { + if (this.form[list][i].DEPARTMENT_ID === DEPARTMENT_ID) { + flag = true + break + } + } + if (flag) { + this.$message.warning('不能选择相同的部门') + this.$refs.Treeselect[index].clear() + return + } else { + this.form[list][index].DEPARTMENT_ID = DEPARTMENT_ID } } - if (flag) { - this.$message.warning('不能选择相同的部门') - this.$refs.Treeselect[index].clear() - return - } else { - this.form[list][index].DEPARTMENT_ID = DEPARTMENT_ID - } - } - requestFN( - '/user/listAll', - { - DEPARTMENT_ID - } - ).then((data) => { - this.form[list][index].userList = data.userList - if (type !== 'created') { - this.form[list][index].USER_ID = '' - } - }).catch((e) => { + requestFN( + '/user/listAll', + { + DEPARTMENT_ID + } + ).then((data) => { + this.form[list][index].userList = data.userList + if (type !== 'created') { + this.form[list][index].USER_ID = '' + } + resolve() + }).catch((e) => { + }) }) }, addPeople() { diff --git a/src/views/security_commitment/promise_book_issued/components/see.vue b/src/views/security_commitment/promise_book_issued/components/see.vue index b9cdf62..a38c235 100644 --- a/src/views/security_commitment/promise_book_issued/components/see.vue +++ b/src/views/security_commitment/promise_book_issued/components/see.vue @@ -23,7 +23,8 @@ {{ form.PROMISE_TERM_END }} - 承诺人 + 承诺人 + 受状人 @@ -36,7 +37,8 @@
{{ '单位' + (index + 1) }}{{ item.USERNAME && item.USERNAME.join('、') }}
- 被承诺人 + 被承诺人 + 发状人 @@ -45,7 +47,8 @@
{{ '部门' + (index + 1) }}{{ item.USERNAME && item.USERNAME.join('、') }}
- 承诺内容 + 承诺内容 + 责任状内容
正文