|
|
|
|
@ -32,6 +32,8 @@ |
|
|
|
|
@click="batchTestFn(scope.row, 'receive')">转派</el-button> |
|
|
|
|
<el-button type="text" v-show="scope.row.status == 6 && permission.tankSolutionTaskDispose_withdraw" |
|
|
|
|
@click="revocationReview(scope.row, 'receive')">撤回</el-button> |
|
|
|
|
<el-button type="text" v-show="(scope.row.status == 11 || scope.row.status == 10) && permission.tankSolutionTaskDispose_withdraw" |
|
|
|
|
@click="deleteReview(scope.row, 'receive')">删除</el-button> |
|
|
|
|
|
|
|
|
|
</template> |
|
|
|
|
<template #normValueLimit="{row}"> |
|
|
|
|
@ -93,7 +95,7 @@ import dispatchTestDialog from './components/dispatchTestDialog.vue' |
|
|
|
|
import checkDialog from './components/checkDialog.vue' |
|
|
|
|
import getMedicineDialog from './components/getMedicineDialog.vue' |
|
|
|
|
import catchInfoDialog from './components/catchInfoDialog.vue' |
|
|
|
|
import {getDealList,receiveTask,revokeDrug} from '@/api/tankSolutionSystem/tankSolutionTaskAssignment' |
|
|
|
|
import {getDealList,receiveTask,revokeDrug,deleteTask} from '@/api/tankSolutionSystem/tankSolutionTaskAssignment' |
|
|
|
|
import { mapGetters } from 'vuex'; |
|
|
|
|
export default { |
|
|
|
|
components: { |
|
|
|
|
@ -133,7 +135,7 @@ export default { |
|
|
|
|
calcHeight: 32, |
|
|
|
|
// simplePage: true, |
|
|
|
|
searchShow: true, |
|
|
|
|
searchMenuSpan: 12, |
|
|
|
|
searchMenuSpan: 6, |
|
|
|
|
searchIcon: true, |
|
|
|
|
searchIndex: 3, |
|
|
|
|
columnSort: true, |
|
|
|
|
@ -485,14 +487,18 @@ export default { |
|
|
|
|
{ |
|
|
|
|
label: '任务下发时间', |
|
|
|
|
prop: 'createTime', |
|
|
|
|
search: false, |
|
|
|
|
type:'date', |
|
|
|
|
search: true, |
|
|
|
|
searchRange: true, |
|
|
|
|
sortable: 'custom', |
|
|
|
|
editDisplay: false, |
|
|
|
|
filter: true, |
|
|
|
|
addDisplay: false, |
|
|
|
|
span: 24, |
|
|
|
|
width: 160, |
|
|
|
|
|
|
|
|
|
searchLabelWidth:110, |
|
|
|
|
format:"YYYY-MM-DD", |
|
|
|
|
valueFormat:"YYYY-MM-DD", |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '任务完成时间', |
|
|
|
|
@ -596,20 +602,66 @@ export default { |
|
|
|
|
this.$message.error('至少选择一条数据') |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
let tmp = this.selectionList.find(item => item.status != 2 && item.status != 8 && item.status != 4) |
|
|
|
|
console.log('tmp-------------',tmp) |
|
|
|
|
if(tmp){ |
|
|
|
|
this.$message.error('请选择状态均为【待填报】/【待复检】/【加药量待修改】的数据') |
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
// 获取所有选中项的状态集合 |
|
|
|
|
const statusSet = new Set(this.selectionList.map(item => item.status)); |
|
|
|
|
|
|
|
|
|
// 定义允许的业务状态 |
|
|
|
|
const allowedStatuses = [2, 12, 8, 4]; |
|
|
|
|
|
|
|
|
|
// 1. 检查是否存在非允许的状态 |
|
|
|
|
const hasInvalidStatus = Array.from(statusSet).some(status => !allowedStatuses.includes(status)); |
|
|
|
|
if (hasInvalidStatus) { |
|
|
|
|
this.$message.error('请选择状态均为【暂存】/【待填报】/【待复检】/【加药量待修改】的数据'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
let tmp1 = this.allStatusEqual(this.selectionList) |
|
|
|
|
console.log('tmp1-------------',tmp1) |
|
|
|
|
// 2. 检查状态互斥逻辑 |
|
|
|
|
|
|
|
|
|
if(!tmp1){ |
|
|
|
|
this.$message.error('请选择状态均为【待填报】/【待复检】/【加药量待修改】的数据') |
|
|
|
|
return |
|
|
|
|
// 情况A: 包含状态 8 |
|
|
|
|
if (statusSet.has(8)) { |
|
|
|
|
// 如果包含8,则集合中只能有8 (不能混入2, 12, 4) |
|
|
|
|
if (statusSet.size > 1 || !statusSet.has(8)) { // size>1 意味着混入了其他状态 |
|
|
|
|
this.$message.error('请选择状态均为【待复检】的数据'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 情况B: 包含状态 4 |
|
|
|
|
else if (statusSet.has(4)) { |
|
|
|
|
// 如果包含4,则集合中只能有4 (不能混入2, 12, 8) |
|
|
|
|
if (statusSet.size > 1) { |
|
|
|
|
this.$message.error('请选择状态均为【加药量待修改】的数据'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 情况C: 包含状态 2 或 12 |
|
|
|
|
else if (statusSet.has(2) || statusSet.has(12)) { |
|
|
|
|
// 如果包含2或12,则集合中不能有 8 或 4 (前面已经排除了8和4的独占情况,这里主要防止逻辑漏网,其实上面两个if已经覆盖了大部分互斥) |
|
|
|
|
// 更严谨的写法:如果既有(2或12) 又有 (8或4),上面已经拦截。 |
|
|
|
|
// 这里只需要确保没有混入其他非法状态即可,由于第一步已经校验了非法状态, |
|
|
|
|
// 且第二步拦截了8和4的混选,剩下的自然就是纯(2,12)组合,或者纯8,或者纯4。 |
|
|
|
|
|
|
|
|
|
// 额外检查:确保没有混入 8 或 4 (虽然上面的 if-else 结构已经隐含了这个逻辑,但为了清晰可以显式判断) |
|
|
|
|
if (statusSet.has(8) || statusSet.has(4)) { |
|
|
|
|
this.$message.error('请选择状态为【暂存】或【待填报】的数据'); |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// let tmp = this.selectionList.find(item => (item.status != 2 && item.status != 12) && item.status != 8 && item.status != 4) |
|
|
|
|
// console.log('tmp-------------',tmp) |
|
|
|
|
// if(tmp){ |
|
|
|
|
// this.$message.error('请选择状态均为【待填报】/【待复检】/【加药量待修改】的数据') |
|
|
|
|
// return |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
// let tmp1 = this.allStatusEqual(this.selectionList) |
|
|
|
|
// console.log('tmp1-------------',tmp1) |
|
|
|
|
|
|
|
|
|
// if(!tmp1){ |
|
|
|
|
// this.$message.error('请选择状态均为【待填报】/【待复检】/【加药量待修改】的数据') |
|
|
|
|
// return |
|
|
|
|
// } |
|
|
|
|
|
|
|
|
|
this.batchList = this.selectionList |
|
|
|
|
console.log('this.batchList',this.batchList) |
|
|
|
|
@ -726,6 +778,22 @@ export default { |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
deleteReview(row){ |
|
|
|
|
this.$confirm('确认是否删除该条数据?', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
cancelButtonText: '取消', |
|
|
|
|
type: 'warning', |
|
|
|
|
}).then(() => { |
|
|
|
|
deleteTask({ |
|
|
|
|
ids:row.id |
|
|
|
|
}).then(res =>{ |
|
|
|
|
if(res.data.code == 200){ |
|
|
|
|
this.$message.success('删除成功') |
|
|
|
|
this.onLoad(this.page, { ...this.search, id: this.taskId ,}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
reportFn() { |
|
|
|
|
this.$confirm('是否下载检验报告?', { |
|
|
|
|
confirmButtonText: '确定', |
|
|
|
|
@ -764,14 +832,18 @@ export default { |
|
|
|
|
onLoad(page, params) { |
|
|
|
|
console.log('sear-------------', this.search) |
|
|
|
|
this.loading = true |
|
|
|
|
getDealList({ |
|
|
|
|
let searchParams = { |
|
|
|
|
current: page?.currentPage || this.page.currentPage, |
|
|
|
|
size: page?.pageSize || this.page.pageSize, |
|
|
|
|
...this.query, |
|
|
|
|
status: params?.statusValue || this.search.statusValue, |
|
|
|
|
workCenterId: params?.workCenterId || this.search.workCenterId, |
|
|
|
|
id: params?.id || this.taskId, // 添加 id 参数 |
|
|
|
|
}).then(res =>{ |
|
|
|
|
createTimeStart:this.query && this.query.createTime && this.query.createTime.length > 0 ? this.query.createTime[0].length == 10 ? this.query.createTime[0] + ' 00:00:00' : this.query.createTime[0] : '', |
|
|
|
|
createTimeEnd:this.query && this.query.createTime && this.query.createTime.length > 0 ? this.query.createTime[1].length == 10 ? this.query.createTime[1] + ' 23:59:59' : this.query.createTime[1] : '', |
|
|
|
|
} |
|
|
|
|
if(searchParams.createTime) delete searchParams.createTime |
|
|
|
|
getDealList(searchParams).then(res =>{ |
|
|
|
|
// res.data.data.records.map(item =>{ |
|
|
|
|
// item.liquidTank = null |
|
|
|
|
// }) |
|
|
|
|
|