feat:流程重构

dev
zhushengzhe 2023-09-14 15:56:29 +08:00
parent 453c33e629
commit dbdc809a99
7 changed files with 91 additions and 75 deletions

View File

@ -17,9 +17,9 @@ export default class IntegralExchangeService extends BaseService<any>{
}
//作废
public invalidByIds(params?):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/point/exchange/invalid/' +params.id;
return this.post(url)
public invalidByIds(params: any):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention + '/point/exchange/invalid';
return this.post(url, params, {}, true)
}
// 新增或更新

View File

@ -43,4 +43,10 @@ export default class ManagerService extends BaseService<any>{
const url = this.prefix.file+'/getSysFiles';
return this.get(url,params,false)
}
// 1:中断、2:恢复、3:作废
public operateProcess(params: any): Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/danger/manage/operate';
return this.post(url, params, {}, true)
}
}

View File

@ -22,6 +22,10 @@
color: rgba(0, 0, 0, 0.5);
}
.color_6{
color: rgba(0,0,0,0.3)
}
.color_level_1 {
color: #fff;
background-color: #116ff5;

View File

@ -18,7 +18,7 @@
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
@selection-change="handleSelectionChange" style="width: 100%" @sort-change="sortChange($event)">
<el-table-column v-if="!(isManager && params.type>1)" type="selection" :selectable="selectable"
<el-table-column v-if="!(isManager)" type="selection" :selectable="selectable"
fixed label="全选" width="40">
</el-table-column>
<el-table-column label="序号" width="60">
@ -46,12 +46,12 @@
@click="deleteData([scope.row.id])">删除</el-button>
<!-- <el-button type="text" v-if="isManager" @click="showUpdateModel(0)">抄送</el-button>
<el-button type="text" v-if="isManager" @click="showUpdateModel(0)">移交</el-button> -->
<el-button type="text" v-if="isManager && params.type===4 && scope.row.status<5"
@click="changeStatus(scope.row,60+scope.row.status)">中断</el-button>
<el-button type="text" v-if="isManager && params.type===4 && scope.row.status>10"
@click="changeStatus(scope.row,scope.row.status-60)">恢复</el-button>
<el-button type="text" v-if="isManager && params.type===4 && scope.row.status<5"
@click="changeStatus(scope.row,7)">作废</el-button>
<el-button type="text" v-if="isManager && params.type===3 && scope.row.taskInfo.processStatus === 1"
@click="changeStatus(scope.row, 1)">中断</el-button>
<el-button type="text" v-if="isManager && params.type===3 && scope.row.taskInfo.processStatus === 2"
@click="changeStatus(scope.row, 2)">恢复</el-button>
<el-button type="text" v-if="isManager && params.type===3 && scope.row.taskInfo.processStatus === 1"
@click="changeStatus(scope.row, 3)">作废</el-button>
<!-- <el-button type="text" v-if="isManager" @click="showUpdateModel(0)">处理</el-button> -->
</template>
</el-table-column>

View File

@ -114,21 +114,18 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
updateTime: "update_time",
} as any;
public statusMap = { 0: "草稿", 1: "隐患上报", 2: "隐患确认", 3: "隐患治理", 4: "隐患验收", 5: "已闭环", 6: "流程中断", 7: "作废" };
public statusMap = { 0: "草稿", 1: "隐患上报", 2: "隐患确认", 3: "隐患治理", 4: "隐患验收", 5: "结束", 6: "中断", 7: "作废" };
public tabs = [{
name: "草稿",
name: "待办",
value: 1
}, {
name: "办",
name: "办",
value: 2
}, {
name: "已办",
value: 3
}, {
name: "我发起的",
value: 4
}, { name: "作废", value: 5 }]
value: 3
}, { name: "作废", value: 4 },
{ name: "全部", value: 5 }]
public updateActions = [] as any;
@ -176,24 +173,17 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
value: "add",
icon: "el-icon-plus",
type: "primary"
}, {
name: "批量删除",
value: "delete",
plain: true,
hide: this.params.type !== 1,
icon: "el-icon-delete",
type: "danger"
}] as any
this.footerActions = [{
name: "选择全部",
value: "selectAll",
hide: this.params.type !== 1,
type: "primary"
}, {
name: "反向选择",
hide: this.params.type !== 1,
value: "reverse"
}];
// this.footerActions = [{
// name: "",
// value: "selectAll",
// hide: this.params.type !== 1,
// type: "primary"
// }, {
// name: "",
// hide: this.params.type !== 1,
// value: "reverse"
// }];
this.updateActions = [{
name: "取消",
value: "cancel"
@ -695,20 +685,21 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
public buildTable() {
this.tableColumn.push({
name: '状态', render: (data) => {
if (data.status === 5) {
return `<span class="color_1">${this.statusMap[data.status]}</span>`
} else if (data.status > 60) {
name: '当前节点', width: "100", render: (data) => {
if (data.taskInfo.processStatus === 2) {
return `<span class="color_0">中断</span></span>`
} else if (data.status === 0 || data.status === 7) {
return `<span>${this.statusMap[data.status]}</span>`
} else if(data.taskInfo.processStatus === 3){
return `<span class="color_6">作废</span></span>`
} else if(data.taskInfo.processStatus === 4){
return `<span class="color_1">结束</span>`
} else {
return `<span class="color_2">${this.statusMap[data.status]}</span>`
}
}
});
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<an
}
public changeStatus(data, newStatus) {
this.$confirm("确认要" + (newStatus > 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) {

View File

@ -34,7 +34,7 @@
<el-table-column label="操作" fixed="right" :width="tableActionWidth">
<template slot-scope="scope">
<el-button type="text" @click="changeStatus(scope.row)">查看</el-button>
<el-button v-if="isRepeal && (scope.row.status !=3) " type="text"
<el-button v-if="isRepeal && scope.row.taskInfo.processStatus === 1 " type="text"
@click="changeStatus(scope.row,5)">作废</el-button>
</template>
</el-table-column>

View File

@ -147,20 +147,22 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
}];
}
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<BtnOption>[] = [] as any;
@ -368,27 +370,31 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
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 `<span class="color_0">中断</span></span>`
} else if(data.taskInfo.processStatus === 3){
return `<span class="color_6">作废</span></span>`
} else if(data.taskInfo.processStatus === 4){
return `<span class="color_1">结束</span>`
} else if (data.status === 4) {
return `<span class="color_0">作废</span></span>`
} else if (data.status === 1) {
} else {
if (data.status === 1) {
return `<span class="color_3">申请</span>`
} else if (data.status === 2) {
return `<span class="color_3">审批中</span>`
}
}
}
});
this.tableColumn.push({
name: '申请人', key: "applicantName", render: (data) => {
if (this.params.type === 2) {
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 `<span class="link applicantName">${data.applicantName}</span>`
} 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<any> {
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<any> {
}
})
} 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<any> {
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,7 +877,12 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
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();