From ba1a751ee4b00e70a3a6fe39d4212ecb941a0043 Mon Sep 17 00:00:00 2001 From: qq787203167 <787203167@qq.com> Date: Tue, 5 Jul 2022 16:19:55 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=A6=85=E9=81=93bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/PersonnelSelection/index.vue | 26 ++++++------ .../components/engineeringConfirmation.vue | 40 ++++++++++++++----- 2 files changed, 44 insertions(+), 22 deletions(-) diff --git a/jero-web/src/views/processCenter/components/PersonnelSelection/index.vue b/jero-web/src/views/processCenter/components/PersonnelSelection/index.vue index fb8bcc291..23f3160b7 100644 --- a/jero-web/src/views/processCenter/components/PersonnelSelection/index.vue +++ b/jero-web/src/views/processCenter/components/PersonnelSelection/index.vue @@ -58,7 +58,7 @@ export default { name: 'index', - props: ['query', 'value', 'personneQuery', 'isSingleChoice', 'isInput', 'isClass','isDelete','distributionEngineerList'], + props: ['query', 'value', 'personneQuery', 'isSingleChoice', 'isInput', 'isClass', 'isDelete', 'distributionEngineerList'], data() { return { loading: true, @@ -90,10 +90,10 @@ this.queryDepartUserTreeList() this.visible = true }, - standardDelete(){ + standardDelete() { this.$emit('input', null) this.$forceUpdate() - this.$emit('deleteData',this.query.db_field_name) + this.$emit('deleteData', this.query.db_field_name) }, // onSelect(selectedKeys, info) { // console.log(selectedKeys) @@ -155,23 +155,23 @@ for (var i = 0; i < arr.length - 1; i++) { for (var j = i + 1; j < arr.length; j++) { if (arr[i] === arr[j]) { - arr.splice(j, 1); - j--; + arr.splice(j, 1) + j-- } } } - return arr; + return arr } - if (this.distributionEngineerList && this.distributionEngineerList.length > 0){ - this.distributionEngineerList.forEach(res=>{ - userIds.shift(res.userId) - userName.shift(res.name) + if (this.distributionEngineerList && this.distributionEngineerList.length > 0) { + this.distributionEngineerList.forEach(res => { + userIds.unshift(res.userId) + userName.unshift(res.name) }) } userIds = noRepeat1(userIds) userName = noRepeat1(userName) this.$emit('input', userName.join(',')) - this.$emit('change', this.query.db_field_name, userIds.join(','),this.query.subscript) + this.$emit('change', this.query.db_field_name, userIds.join(','), this.query.subscript) this.visible = false this.treeVisible = false // } else { @@ -198,8 +198,8 @@ }, getUserAndDepart() { getAction('sys/user/getUserAndDepart', { name: this.searchModel }).then((res) => { - if (res){ - this.gData = res.filter(ele => ele.flag === 'DEPART'); + if (res) { + this.gData = res.filter(ele => ele.flag === 'DEPART') } else { this.gData = [] } diff --git a/jero-web/src/views/processCenter/components/engineeringConfirmation.vue b/jero-web/src/views/processCenter/components/engineeringConfirmation.vue index 662e0e33f..f298ae329 100644 --- a/jero-web/src/views/processCenter/components/engineeringConfirmation.vue +++ b/jero-web/src/views/processCenter/components/engineeringConfirmation.vue @@ -691,15 +691,37 @@ this.formInline = { ...this.formInline } }, deleteText(num) { - this.distributionEngineerList.splice(num, 1) - this.distributionEngineerList = [...this.distributionEngineerList] - this.formInline.userName = this.formInline.userName.split(',') - this.formInline.userName.splice(num, 1) - this.formInline.userName = this.formInline.userName.join(',') - this.formInline.userId = this.formInline.userId.split(',') - this.formInline.userId.splice(num, 1) - this.formInline.userId = this.formInline.userId.join(',') - this.formInline = { ...this.formInline } + let _this = this + this.$confirm({ + content: _this.$t('ConfirmDelete'), + onOk() { + let id = '' + _this.dataSourceTable.forEach(res => { + if (res.userName == _this.distributionEngineerList[num].name) { + id = res.id + } + }) + _this.distributionEngineerList.splice(num, 1) + _this.distributionEngineerList = [..._this.distributionEngineerList] + _this.formInline.userName = _this.formInline.userName.split(',') + _this.formInline.userName.splice(num, 1) + _this.formInline.userName = _this.formInline.userName.join(',') + _this.formInline.userId = _this.formInline.userId.split(',') + _this.formInline.userId.splice(num, 1) + _this.formInline.userId = _this.formInline.userId.join(',') + _this.formInline = { ..._this.formInline } + if (id){ + deleteAction('/project/projectTaskInventoryDetailEO/delete', { id: id }).then((res) => { + if (res.success) { + _this.$message.success(_this.$t('OperationSuccessful')) + _this.getList() + } else { + _this.$message.warning(res.message) + } + }) + } + } + }) }, edit(val, title) { this.title = title