From f663aa49e01e41bb687533b6459c7750de75c626 Mon Sep 17 00:00:00 2001 From: zichen1019 <1510748736@qq.com> Date: Fri, 13 Aug 2021 21:28:23 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=88=86=E9=85=8D=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/allot/components/chengya_list.vue | 60 +++++++++------------ 1 file changed, 24 insertions(+), 36 deletions(-) diff --git a/src/views/allot/components/chengya_list.vue b/src/views/allot/components/chengya_list.vue index 2005b29..5371c21 100644 --- a/src/views/allot/components/chengya_list.vue +++ b/src/views/allot/components/chengya_list.vue @@ -187,9 +187,9 @@ export default { pageNum: 1, // 页码 pageSize: 20, // 每页条数 orderBy: 'shouliriqi desc', - shiyongdanwei: undefined, - shebeizhongleidaima: '', - bjState: '2' + shiyongdanwei: undefined, + shebeizhongleidaima: '', + bjState: '2' }, renwudan: { teamId: '', @@ -214,7 +214,7 @@ export default { showLoading: true, allotSbzl: '', teams: [], - bjdids: '', + bjdIds: [], dialogXianchangVisible: false, dialogXcjyVisible: false, bjdZhongjian: { @@ -298,13 +298,8 @@ export default { this.$message({ message: '请在列表选择要操作的数据。', type: 'warning' }) return false } - for (let i = 0; i < this.multipleSelection.length; i++) { - if (i === 0) { - this.bjdIds = this.multipleSelection[i].bjdId - } else { - this.bjdIds = this.bjdIds + ',' + this.multipleSelection[i].bjdId - } - } + this.bjdIds.length = 0 + this.bjdIds = this.$refs.list.selection.map(rw => rw.bjdId) this.apibjd({ url: '/renwu/getAllotBaseList', method: 'post', @@ -333,14 +328,8 @@ export default { this.$message({ message: '请在列表选择要退回的数据。', type: 'warning' }) return false } - let bjdIds = '' - for (let i = 0; i < this.multipleSelection.length; i++) { - if (i === 0) { - bjdIds = this.multipleSelection[i].bjdId - } else { - bjdIds = bjdIds + ',' + this.multipleSelection[i].bjdId - } - } + this.bjdIds.length = 0 + this.bjdIds = this.$refs.list.selection.map(rw => rw.bjdId) // 查询任务的分配状态 for (let i = 0; i < this.multipleSelection.length; i++) { if (this.multipleSelection[i].allotNum !== this.multipleSelection[i].totalNum) { @@ -356,7 +345,7 @@ export default { url: '/bjd/returnToBjd', method: 'get', params: { - bjdIds: bjdIds, + bjdIds: this.bjdIds, reason: value } }).then(data => { @@ -378,15 +367,13 @@ export default { this.$message({ message: '请在列表选择要作废的数据。', type: 'warning' }) return false } - let bjdIds = '' - for (let i = 0; i < this.multipleSelection.length; i++) { - if (i === 0) { - bjdIds = this.multipleSelection[i].bjdId - } else { - bjdIds = bjdIds + ',' + this.multipleSelection[i].bjdId - } + if (this.multipleSelection.length > 1) { + this.$message({ message: '请选择单条报检单进行作废。', type: 'warning' }) + return false } - this.$prompt('共选择了' + this.multipleSelection.length + '台设备进行作废,请输入作废原因!', '提示', { + this.bjdIds.length = 0 + this.bjdIds = this.$refs.list.selection[0].bjdId + this.$prompt('请输入作废原因!', '提示', { inputType: 'textarea', confirmButtonText: '确定', cancelButtonText: '取消' @@ -399,9 +386,7 @@ export default { url: '/bjd/zfDbRenwuByBjdId', method: 'get', params: { - bjdIds: this.$refs.list.selection.map(rw => { - return rw.bjdId - }).join(','), + bjdIds: this.bjdIds[0], reason: value } }).then(data => { @@ -434,12 +419,12 @@ export default { return false } this.allotList = [] - this.bjdIds = bjdid + this.bjdIds = [bjdid] this.apibjd({ url: '/renwu/getAllotBaseList', method: 'post', data: { - bjdIds: bjdid + bjdIds: this.bjdIds } }).then(data => { this.allotList = data.list @@ -452,7 +437,7 @@ export default { }) }, clearSearch() { - this.listQuery.bjState="2" + this.listQuery.bjState="2" this.getList() }, // 表格单击选中行 getAllotListByBjdId @@ -526,7 +511,7 @@ export default { url: '/renwu/getAllotBaseList', method: 'post', data: { - bjdIds: this.multipleSelection[0].bjdId + bjdIds: [this.multipleSelection[0].bjdId] } }).then(data => { this.allotList = data.list @@ -594,7 +579,10 @@ export default { renwuList: this.selection, renlingren: this.renlingren, renwudan: this.renwudan, - bjdids: this.bjdIds + bjdIds: this.bjdIds + }, + paramsSerializer: function(data) { + return require('qs').stringify(data, { indices: false }) } }).then(() => { this.multipleSelection = []