forked from xxhjsb/hbt-prevention-ui
feat:流程重构
parent
453c33e629
commit
dbdc809a99
|
@ -17,9 +17,9 @@ export default class IntegralExchangeService extends BaseService<any>{
|
||||||
}
|
}
|
||||||
|
|
||||||
//作废
|
//作废
|
||||||
public invalidByIds(params?):Promise<AxiosResponse<ActionResult<any>>>{
|
public invalidByIds(params: any):Promise<AxiosResponse<ActionResult<any>>>{
|
||||||
const url = this.prefix.prevention+'/point/exchange/invalid/' +params.id;
|
const url = this.prefix.prevention + '/point/exchange/invalid';
|
||||||
return this.post(url)
|
return this.post(url, params, {}, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 新增或更新
|
// 新增或更新
|
||||||
|
|
|
@ -43,4 +43,10 @@ export default class ManagerService extends BaseService<any>{
|
||||||
const url = this.prefix.file+'/getSysFiles';
|
const url = this.prefix.file+'/getSysFiles';
|
||||||
return this.get(url,params,false)
|
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)
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -22,6 +22,10 @@
|
||||||
color: rgba(0, 0, 0, 0.5);
|
color: rgba(0, 0, 0, 0.5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.color_6{
|
||||||
|
color: rgba(0,0,0,0.3)
|
||||||
|
}
|
||||||
|
|
||||||
.color_level_1 {
|
.color_level_1 {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
background-color: #116ff5;
|
background-color: #116ff5;
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
|
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
|
||||||
@selection-change="handleSelectionChange" style="width: 100%" @sort-change="sortChange($event)">
|
@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">
|
fixed label="全选" width="40">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="序号" width="60">
|
<el-table-column label="序号" width="60">
|
||||||
|
@ -46,12 +46,12 @@
|
||||||
@click="deleteData([scope.row.id])">删除</el-button>
|
@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" @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"
|
<el-button type="text" v-if="isManager && params.type===3 && scope.row.taskInfo.processStatus === 1"
|
||||||
@click="changeStatus(scope.row,60+scope.row.status)">中断</el-button>
|
@click="changeStatus(scope.row, 1)">中断</el-button>
|
||||||
<el-button type="text" v-if="isManager && params.type===4 && scope.row.status>10"
|
<el-button type="text" v-if="isManager && params.type===3 && scope.row.taskInfo.processStatus === 2"
|
||||||
@click="changeStatus(scope.row,scope.row.status-60)">恢复</el-button>
|
@click="changeStatus(scope.row, 2)">恢复</el-button>
|
||||||
<el-button type="text" v-if="isManager && params.type===4 && scope.row.status<5"
|
<el-button type="text" v-if="isManager && params.type===3 && scope.row.taskInfo.processStatus === 1"
|
||||||
@click="changeStatus(scope.row,7)">作废</el-button>
|
@click="changeStatus(scope.row, 3)">作废</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> -->
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
|
@ -114,21 +114,18 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
|
||||||
updateTime: "update_time",
|
updateTime: "update_time",
|
||||||
} as any;
|
} as any;
|
||||||
|
|
||||||
public statusMap = { 0: "草稿", 1: "隐患上报", 2: "隐患确认", 3: "隐患治理", 4: "隐患验收", 5: "已闭环", 6: "流程中断", 7: "已作废" };
|
public statusMap = { 0: "草稿", 1: "隐患上报", 2: "隐患确认", 3: "隐患治理", 4: "隐患验收", 5: "结束", 6: "中断", 7: "作废" };
|
||||||
public tabs = [{
|
public tabs = [{
|
||||||
name: "草稿",
|
name: "待办",
|
||||||
value: 1
|
value: 1
|
||||||
}, {
|
}, {
|
||||||
name: "待办",
|
name: "已办",
|
||||||
value: 2
|
value: 2
|
||||||
}, {
|
|
||||||
name: "已办",
|
|
||||||
value: 3
|
|
||||||
}, {
|
}, {
|
||||||
name: "我发起的",
|
name: "我发起的",
|
||||||
value: 4
|
value: 3
|
||||||
}, { name: "作废", value: 5 }]
|
}, { name: "作废", value: 4 },
|
||||||
|
{ name: "全部", value: 5 }]
|
||||||
|
|
||||||
public updateActions = [] as any;
|
public updateActions = [] as any;
|
||||||
|
|
||||||
|
@ -176,24 +173,17 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
|
||||||
value: "add",
|
value: "add",
|
||||||
icon: "el-icon-plus",
|
icon: "el-icon-plus",
|
||||||
type: "primary"
|
type: "primary"
|
||||||
}, {
|
|
||||||
name: "批量删除",
|
|
||||||
value: "delete",
|
|
||||||
plain: true,
|
|
||||||
hide: this.params.type !== 1,
|
|
||||||
icon: "el-icon-delete",
|
|
||||||
type: "danger"
|
|
||||||
}] as any
|
}] as any
|
||||||
this.footerActions = [{
|
// this.footerActions = [{
|
||||||
name: "选择全部",
|
// name: "选择全部",
|
||||||
value: "selectAll",
|
// value: "selectAll",
|
||||||
hide: this.params.type !== 1,
|
// hide: this.params.type !== 1,
|
||||||
type: "primary"
|
// type: "primary"
|
||||||
}, {
|
// }, {
|
||||||
name: "反向选择",
|
// name: "反向选择",
|
||||||
hide: this.params.type !== 1,
|
// hide: this.params.type !== 1,
|
||||||
value: "reverse"
|
// value: "reverse"
|
||||||
}];
|
// }];
|
||||||
this.updateActions = [{
|
this.updateActions = [{
|
||||||
name: "取消",
|
name: "取消",
|
||||||
value: "cancel"
|
value: "cancel"
|
||||||
|
@ -695,20 +685,21 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
|
||||||
|
|
||||||
public buildTable() {
|
public buildTable() {
|
||||||
this.tableColumn.push({
|
this.tableColumn.push({
|
||||||
name: '状态', render: (data) => {
|
name: '当前节点', width: "100", render: (data) => {
|
||||||
if (data.status === 5) {
|
if (data.taskInfo.processStatus === 2) {
|
||||||
return `<span class="color_1">${this.statusMap[data.status]}</span>`
|
|
||||||
} else if (data.status > 60) {
|
|
||||||
return `<span class="color_0">中断</span></span>`
|
return `<span class="color_0">中断</span></span>`
|
||||||
} else if (data.status === 0 || data.status === 7) {
|
} else if(data.taskInfo.processStatus === 3){
|
||||||
return `<span>${this.statusMap[data.status]}</span>`
|
return `<span class="color_6">作废</span></span>`
|
||||||
|
} else if(data.taskInfo.processStatus === 4){
|
||||||
|
return `<span class="color_1">结束</span>`
|
||||||
} else {
|
} else {
|
||||||
return `<span class="color_2">${this.statusMap[data.status]}</span>`
|
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: "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: "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: "100", key: "reportUserName", render: (data) => data.reportUserName || "--" });
|
||||||
this.tableColumn.push({ name: '上报时间', width: "120", key: "reportTime", render: (data) => data.reportTime || "--" });
|
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) {
|
public changeStatus(data, newStatus) {
|
||||||
this.$confirm("确认要" + (newStatus > 60 ? "中断数据?" : newStatus === 7 ? "作废数据?" : "恢复数据"), "操作确认", {
|
this.$confirm("确认要" + (newStatus === 1 ? "中断数据?" : newStatus === 3 ? "作废数据?" : "恢复数据?"), "操作确认", {
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
data.status = newStatus;
|
this.tableService.operateProcess({
|
||||||
this.tableService.addOrUpdate(data, false).then(res => {
|
id: data.id,
|
||||||
this.$message.success(newStatus > 60 ? "中断成功" : "作废成功");
|
type: newStatus,
|
||||||
|
processInstanceId: data.taskInfo.processInstanceId,
|
||||||
|
reason: newStatus === 3 ? '作废' : null
|
||||||
|
}).then(res => {
|
||||||
|
this.$message.success(newStatus === 1 ? "中断成功" : newStatus === 3 ? "作废成功" : "恢复成功");
|
||||||
this.getTableData()
|
this.getTableData()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public change(data, item) {
|
public change(data, item) {
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
<el-table-column label="操作" fixed="right" :width="tableActionWidth">
|
<el-table-column label="操作" fixed="right" :width="tableActionWidth">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="text" @click="changeStatus(scope.row)">查看</el-button>
|
<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>
|
@click="changeStatus(scope.row,5)">作废</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
|
@ -147,20 +147,22 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public tabs = [{
|
public tabs = [{
|
||||||
name: "待办",
|
name: "待办",
|
||||||
value: 2
|
value: 1
|
||||||
}, {
|
}, {
|
||||||
name: "已办",
|
name: "已办",
|
||||||
value: 3
|
value: 2
|
||||||
}, {
|
}, {
|
||||||
name: "我发起的",
|
name: "我发起的",
|
||||||
value: 4
|
value: 3
|
||||||
}, {
|
}, {
|
||||||
name: "作废",
|
name: "作废",
|
||||||
|
value: 4
|
||||||
|
}, {
|
||||||
|
name: "全部",
|
||||||
value: 5
|
value: 5
|
||||||
},
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
public updateOptions: FormOption<BtnOption>[] = [] as any;
|
public updateOptions: FormOption<BtnOption>[] = [] as any;
|
||||||
|
@ -368,27 +370,31 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
|
||||||
|
|
||||||
public buildTable() {
|
public buildTable() {
|
||||||
this.tableColumn.push({
|
this.tableColumn.push({
|
||||||
name: '当前节点', key: "status", render: (data) => {
|
name: '当前节点', width: "100", render: (data) => {
|
||||||
if (data.status === 3) {
|
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>`
|
return `<span class="color_1">结束</span>`
|
||||||
} else if (data.status === 4) {
|
|
||||||
return `<span class="color_0">作废</span></span>`
|
|
||||||
} 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) {
|
|
||||||
return `<span class="link applicantName">${data.applicantName}</span>`
|
|
||||||
} else {
|
} else {
|
||||||
return data.applicantName
|
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: '当前执行人', 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: "applyTime", });
|
||||||
this.tableColumn.push({
|
this.tableColumn.push({
|
||||||
name: '兑换清单', key: "goodsNumber", render: (data) => {
|
name: '兑换清单', key: "goodsNumber", render: (data) => {
|
||||||
|
@ -530,7 +536,7 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
|
||||||
public tabTableChange(type) {
|
public tabTableChange(type) {
|
||||||
this.params.type = type;
|
this.params.type = type;
|
||||||
this.getTableData()
|
this.getTableData()
|
||||||
if (type === 4) {
|
if (type === 3) {
|
||||||
this.isRepeal = true
|
this.isRepeal = true
|
||||||
} else {
|
} else {
|
||||||
this.isRepeal = false
|
this.isRepeal = false
|
||||||
|
@ -601,8 +607,9 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else if (this.updateParams.id) {
|
} else if (this.updateParams.id) {
|
||||||
|
debugger
|
||||||
let tmpParam = {
|
let tmpParam = {
|
||||||
"taskId": this.updateParams.taskId,
|
"taskId": this.updateParams.taskInfo?.taskId ?? "",
|
||||||
"type": this.updateParams.approvalResult === 0 ? "reject" : 'agree',
|
"type": this.updateParams.approvalResult === 0 ? "reject" : 'agree',
|
||||||
"bizData": [{
|
"bizData": [{
|
||||||
"bizId": this.updateParams.id,
|
"bizId": this.updateParams.id,
|
||||||
|
@ -774,7 +781,7 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
|
||||||
this.tableService.getListDetail({ id: data.id }).then((res: any) => {
|
this.tableService.getListDetail({ id: data.id }).then((res: any) => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.updateParams = res.data
|
this.updateParams = res.data
|
||||||
this.updateParams.taskId = data.taskId
|
this.updateParams.taskInfo = data.taskInfo
|
||||||
this.updateParams.pointExchangeDetails.forEach((item, index) => {
|
this.updateParams.pointExchangeDetails.forEach((item, index) => {
|
||||||
item.index = index + 1
|
item.index = index + 1
|
||||||
})
|
})
|
||||||
|
@ -870,13 +877,18 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).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) {
|
if (res.code === 200) {
|
||||||
this.$message.success("作废成功!");
|
this.$message.success("作废成功!");
|
||||||
this.getTableData();
|
this.getTableData();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
//
|
//
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue