diff --git a/src/service/integralExchange.service.ts b/src/service/integralExchange.service.ts index cba9aff..5eff7c7 100644 --- a/src/service/integralExchange.service.ts +++ b/src/service/integralExchange.service.ts @@ -17,9 +17,9 @@ export default class IntegralExchangeService extends BaseService{ } //作废 - public invalidByIds(params?):Promise>>{ - const url = this.prefix.prevention+'/point/exchange/invalid/' +params.id; - return this.post(url) + public invalidByIds(params: any):Promise>>{ + const url = this.prefix.prevention + '/point/exchange/invalid'; + return this.post(url, params, {}, true) } // 新增或更新 diff --git a/src/service/manager.service.ts b/src/service/manager.service.ts index 591a025..6f45e2d 100644 --- a/src/service/manager.service.ts +++ b/src/service/manager.service.ts @@ -43,4 +43,10 @@ export default class ManagerService extends BaseService{ const url = this.prefix.file+'/getSysFiles'; return this.get(url,params,false) } + + // 1:中断、2:恢复、3:作废 + public operateProcess(params: any): Promise>>{ + const url = this.prefix.prevention+'/danger/manage/operate'; + return this.post(url, params, {}, true) + } } \ No newline at end of file diff --git a/src/views/common.component.scss b/src/views/common.component.scss index 6561fb5..1b6da0a 100644 --- a/src/views/common.component.scss +++ b/src/views/common.component.scss @@ -21,6 +21,10 @@ .color_5 { color: rgba(0, 0, 0, 0.5); } + + .color_6{ + color: rgba(0,0,0,0.3) + } .color_level_1 { color: #fff; diff --git a/src/views/hiddenDanger/common.component.html b/src/views/hiddenDanger/common.component.html index 77249fb..d4a7ac7 100644 --- a/src/views/hiddenDanger/common.component.html +++ b/src/views/hiddenDanger/common.component.html @@ -18,7 +18,7 @@ - @@ -46,12 +46,12 @@ @click="deleteData([scope.row.id])">删除 - 中断 - 恢复 - 作废 + 中断 + 恢复 + 作废 diff --git a/src/views/hiddenDanger/manager.component.vue b/src/views/hiddenDanger/manager.component.vue index 1c7c77d..254c303 100644 --- a/src/views/hiddenDanger/manager.component.vue +++ b/src/views/hiddenDanger/manager.component.vue @@ -114,21 +114,18 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent { - if (data.status === 5) { - return `${this.statusMap[data.status]}` - } else if (data.status > 60) { + name: '当前节点', width: "100", render: (data) => { + if (data.taskInfo.processStatus === 2) { return `中断` - } else if (data.status === 0 || data.status === 7) { - return `${this.statusMap[data.status]}` + } else if(data.taskInfo.processStatus === 3){ + return `作废` + } else if(data.taskInfo.processStatus === 4){ + return `结束` } else { return `${this.statusMap[data.status]}` } } }); - this.tableColumn.push({ name: '当前执行人', width: "100", key: "executor", render: (data) => data.taskInfo.executor || "--" }); + this.tableColumn.push({ name: '当前执行人', width: "100", key: "executor", render: (data) => data.taskInfo.executors || "--" }); this.tableColumn.push({ name: '最新提交时间', width: "180", key: "updateTime", sortable: 'custom' }); + this.tableColumn.push({ name: '发起人', width: "100", key: "startUser", render: (data) => data.taskInfo.startUser || "--" }); this.tableColumn.push({ name: '隐患来源', width: "150", render: (data) => this.$store.getters.prevention_danger_resource_map[data.source] }); this.tableColumn.push({ name: '上报人', width: "100", key: "reportUserName", render: (data) => data.reportUserName || "--" }); this.tableColumn.push({ name: '上报时间', width: "120", key: "reportTime", render: (data) => data.reportTime || "--" }); @@ -765,16 +756,19 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent 60 ? "中断数据?" : newStatus === 7 ? "作废数据?" : "恢复数据"), "操作确认", { + this.$confirm("确认要" + (newStatus === 1 ? "中断数据?" : newStatus === 3 ? "作废数据?" : "恢复数据?"), "操作确认", { type: 'warning' }).then(() => { - data.status = newStatus; - this.tableService.addOrUpdate(data, false).then(res => { - this.$message.success(newStatus > 60 ? "中断成功" : "作废成功"); + this.tableService.operateProcess({ + id: data.id, + type: newStatus, + processInstanceId: data.taskInfo.processInstanceId, + reason: newStatus === 3 ? '作废' : null + }).then(res => { + this.$message.success(newStatus === 1 ? "中断成功" : newStatus === 3 ? "作废成功" : "恢复成功"); this.getTableData() }) }) - } public change(data, item) { diff --git a/src/views/integral/exchange/exchangeFlow/exchange.component.html b/src/views/integral/exchange/exchangeFlow/exchange.component.html index 21c0f30..0855265 100644 --- a/src/views/integral/exchange/exchangeFlow/exchange.component.html +++ b/src/views/integral/exchange/exchangeFlow/exchange.component.html @@ -34,7 +34,7 @@ diff --git a/src/views/integral/exchange/exchangeFlow/exchange.component.vue b/src/views/integral/exchange/exchangeFlow/exchange.component.vue index 7ac98ca..09aaf1e 100644 --- a/src/views/integral/exchange/exchangeFlow/exchange.component.vue +++ b/src/views/integral/exchange/exchangeFlow/exchange.component.vue @@ -147,20 +147,22 @@ export default class IntegralExchange extends BaseRecordComponent { }]; } - public tabs = [{ name: "待办", - value: 2 + value: 1 }, { name: "已办", - value: 3 + value: 2 }, { name: "我发起的", - value: 4 + value: 3 }, { name: "作废", + value: 4 + }, { + name: "全部", value: 5 - }, + } ] public updateOptions: FormOption[] = [] as any; @@ -368,27 +370,31 @@ export default class IntegralExchange extends BaseRecordComponent { public buildTable() { this.tableColumn.push({ - name: '当前节点', key: "status", render: (data) => { - if (data.status === 3) { + name: '当前节点', width: "100", render: (data) => { + if (data.taskInfo.processStatus === 2) { + return `中断` + } else if(data.taskInfo.processStatus === 3){ + return `作废` + } else if(data.taskInfo.processStatus === 4){ return `结束` - } else if (data.status === 4) { - return `作废` - } else if (data.status === 1) { - return `申请` - } else if (data.status === 2) { - return `审批中` - } - } - }); - this.tableColumn.push({ - name: '申请人', key: "applicantName", render: (data) => { - if (this.params.type === 2) { - return `${data.applicantName}` } else { - return data.applicantName + if (data.status === 1) { + return `申请` + } else if (data.status === 2) { + return `审批中` + } } } }); + this.tableColumn.push({ name: '当前执行人', width: "100", key: "executor", render: (data) => data.taskInfo.executors || "--" }); + this.tableColumn.push({ name: '最新提交时间', width: "180", key: "updateTime", sortable: 'custom' }); + this.tableColumn.push({ name: '发起人', width: "100", key: "startUser", render: (data) => { + if (this.params.type === 1) { + return `${data.applicantName}` + } else { + return data.applicantName + } + }}); this.tableColumn.push({ name: '发起时间', key: "applyTime", }); this.tableColumn.push({ name: '兑换清单', key: "goodsNumber", render: (data) => { @@ -530,7 +536,7 @@ export default class IntegralExchange extends BaseRecordComponent { public tabTableChange(type) { this.params.type = type; this.getTableData() - if (type === 4) { + if (type === 3) { this.isRepeal = true } else { this.isRepeal = false @@ -601,8 +607,9 @@ export default class IntegralExchange extends BaseRecordComponent { } }) } else if (this.updateParams.id) { + debugger let tmpParam = { - "taskId": this.updateParams.taskId, + "taskId": this.updateParams.taskInfo?.taskId ?? "", "type": this.updateParams.approvalResult === 0 ? "reject" : 'agree', "bizData": [{ "bizId": this.updateParams.id, @@ -774,7 +781,7 @@ export default class IntegralExchange extends BaseRecordComponent { this.tableService.getListDetail({ id: data.id }).then((res: any) => { if (res.code === 200) { this.updateParams = res.data - this.updateParams.taskId = data.taskId + this.updateParams.taskInfo = data.taskInfo this.updateParams.pointExchangeDetails.forEach((item, index) => { item.index = index + 1 }) @@ -870,13 +877,18 @@ export default class IntegralExchange extends BaseRecordComponent { cancelButtonText: '取消', type: 'warning' }).then(() => { - this.tableService.invalidByIds({ id: data.id }).then((res: any) => { + this.tableService.invalidByIds({ + id: data.id, + type: 3, + processInstanceId: data.taskInfo.processInstanceId, + reason: '作废' + }).then((res: any) => { if (res.code === 200) { this.$message.success("作废成功!"); this.getTableData(); } }) - }).catch(() => { + }).catch(() => { // }); }