Browse Source

优化分配任务接口

master
李磊 3 years ago
parent
commit
f663aa49e0
  1. 60
      src/views/allot/components/chengya_list.vue

60
src/views/allot/components/chengya_list.vue

@ -187,9 +187,9 @@ export default {
pageNum: 1, // pageNum: 1, //
pageSize: 20, // pageSize: 20, //
orderBy: 'shouliriqi desc', orderBy: 'shouliriqi desc',
shiyongdanwei: undefined, shiyongdanwei: undefined,
shebeizhongleidaima: '', shebeizhongleidaima: '',
bjState: '2' bjState: '2'
}, },
renwudan: { renwudan: {
teamId: '', teamId: '',
@ -214,7 +214,7 @@ export default {
showLoading: true, showLoading: true,
allotSbzl: '', allotSbzl: '',
teams: [], teams: [],
bjdids: '', bjdIds: [],
dialogXianchangVisible: false, dialogXianchangVisible: false,
dialogXcjyVisible: false, dialogXcjyVisible: false,
bjdZhongjian: { bjdZhongjian: {
@ -298,13 +298,8 @@ export default {
this.$message({ message: '请在列表选择要操作的数据。', type: 'warning' }) this.$message({ message: '请在列表选择要操作的数据。', type: 'warning' })
return false return false
} }
for (let i = 0; i < this.multipleSelection.length; i++) { this.bjdIds.length = 0
if (i === 0) { this.bjdIds = this.$refs.list.selection.map(rw => rw.bjdId)
this.bjdIds = this.multipleSelection[i].bjdId
} else {
this.bjdIds = this.bjdIds + ',' + this.multipleSelection[i].bjdId
}
}
this.apibjd({ this.apibjd({
url: '/renwu/getAllotBaseList', url: '/renwu/getAllotBaseList',
method: 'post', method: 'post',
@ -333,14 +328,8 @@ export default {
this.$message({ message: '请在列表选择要退回的数据。', type: 'warning' }) this.$message({ message: '请在列表选择要退回的数据。', type: 'warning' })
return false return false
} }
let bjdIds = '' this.bjdIds.length = 0
for (let i = 0; i < this.multipleSelection.length; i++) { this.bjdIds = this.$refs.list.selection.map(rw => rw.bjdId)
if (i === 0) {
bjdIds = this.multipleSelection[i].bjdId
} else {
bjdIds = bjdIds + ',' + this.multipleSelection[i].bjdId
}
}
// //
for (let i = 0; i < this.multipleSelection.length; i++) { for (let i = 0; i < this.multipleSelection.length; i++) {
if (this.multipleSelection[i].allotNum !== this.multipleSelection[i].totalNum) { if (this.multipleSelection[i].allotNum !== this.multipleSelection[i].totalNum) {
@ -356,7 +345,7 @@ export default {
url: '/bjd/returnToBjd', url: '/bjd/returnToBjd',
method: 'get', method: 'get',
params: { params: {
bjdIds: bjdIds, bjdIds: this.bjdIds,
reason: value reason: value
} }
}).then(data => { }).then(data => {
@ -378,15 +367,13 @@ export default {
this.$message({ message: '请在列表选择要作废的数据。', type: 'warning' }) this.$message({ message: '请在列表选择要作废的数据。', type: 'warning' })
return false return false
} }
let bjdIds = '' if (this.multipleSelection.length > 1) {
for (let i = 0; i < this.multipleSelection.length; i++) { this.$message({ message: '请选择单条报检单进行作废。', type: 'warning' })
if (i === 0) { return false
bjdIds = this.multipleSelection[i].bjdId
} else {
bjdIds = bjdIds + ',' + this.multipleSelection[i].bjdId
}
} }
this.$prompt('共选择了' + this.multipleSelection.length + '台设备进行作废,请输入作废原因!', '提示', { this.bjdIds.length = 0
this.bjdIds = this.$refs.list.selection[0].bjdId
this.$prompt('请输入作废原因!', '提示', {
inputType: 'textarea', inputType: 'textarea',
confirmButtonText: '确定', confirmButtonText: '确定',
cancelButtonText: '取消' cancelButtonText: '取消'
@ -399,9 +386,7 @@ export default {
url: '/bjd/zfDbRenwuByBjdId', url: '/bjd/zfDbRenwuByBjdId',
method: 'get', method: 'get',
params: { params: {
bjdIds: this.$refs.list.selection.map(rw => { bjdIds: this.bjdIds[0],
return rw.bjdId
}).join(','),
reason: value reason: value
} }
}).then(data => { }).then(data => {
@ -434,12 +419,12 @@ export default {
return false return false
} }
this.allotList = [] this.allotList = []
this.bjdIds = bjdid this.bjdIds = [bjdid]
this.apibjd({ this.apibjd({
url: '/renwu/getAllotBaseList', url: '/renwu/getAllotBaseList',
method: 'post', method: 'post',
data: { data: {
bjdIds: bjdid bjdIds: this.bjdIds
} }
}).then(data => { }).then(data => {
this.allotList = data.list this.allotList = data.list
@ -452,7 +437,7 @@ export default {
}) })
}, },
clearSearch() { clearSearch() {
this.listQuery.bjState="2" this.listQuery.bjState="2"
this.getList() this.getList()
}, },
// getAllotListByBjdId // getAllotListByBjdId
@ -526,7 +511,7 @@ export default {
url: '/renwu/getAllotBaseList', url: '/renwu/getAllotBaseList',
method: 'post', method: 'post',
data: { data: {
bjdIds: this.multipleSelection[0].bjdId bjdIds: [this.multipleSelection[0].bjdId]
} }
}).then(data => { }).then(data => {
this.allotList = data.list this.allotList = data.list
@ -594,7 +579,10 @@ export default {
renwuList: this.selection, renwuList: this.selection,
renlingren: this.renlingren, renlingren: this.renlingren,
renwudan: this.renwudan, renwudan: this.renwudan,
bjdids: this.bjdIds bjdIds: this.bjdIds
},
paramsSerializer: function(data) {
return require('qs').stringify(data, { indices: false })
} }
}).then(() => { }).then(() => {
this.multipleSelection = [] this.multipleSelection = []

Loading…
Cancel
Save