|
@@ -35,10 +35,20 @@
|
|
|
class="flex-justify-between padding-right-20 padding-left-20"
|
|
|
>
|
|
|
<div>
|
|
|
- <el-button type="primary">转派</el-button>
|
|
|
- <el-button type="primary" @click="handleApprove"
|
|
|
- >审批</el-button
|
|
|
- >
|
|
|
+ <template v-if="edit_visible">
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ v-if="edit_form.department_status === '待处理'"
|
|
|
+ @click="handleTransfer"
|
|
|
+ >转派</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ v-if="edit_form.department_status === '待审批'"
|
|
|
+ @click="handleApprove"
|
|
|
+ >审批</el-button
|
|
|
+ >
|
|
|
+ </template>
|
|
|
<el-button type="primary" @click="handleTrack"
|
|
|
>流程跟踪</el-button
|
|
|
>
|
|
@@ -65,10 +75,7 @@
|
|
|
props="approve_visible"
|
|
|
@cancel="handleCancel('approve_visible')"
|
|
|
>
|
|
|
- <el-form
|
|
|
- :model="approveForm"
|
|
|
- :rules="approverules"
|
|
|
- ref="approveForm"
|
|
|
+ <el-form :model="approveForm" ref="approveForm"
|
|
|
><el-form-item
|
|
|
label="审批意见"
|
|
|
prop="comments"
|
|
@@ -100,10 +107,8 @@
|
|
|
>
|
|
|
</div>
|
|
|
<div v-else>
|
|
|
- <el-button @click="handleCancel('approve_visible')"
|
|
|
- >打回</el-button
|
|
|
- >
|
|
|
- <el-button @click="handleTurn(type)" type="primary"
|
|
|
+ <el-button @click="handleBack">打回</el-button>
|
|
|
+ <el-button @click="handleAgree" type="primary"
|
|
|
>同意</el-button
|
|
|
>
|
|
|
</div>
|
|
@@ -161,11 +166,13 @@ export default {
|
|
|
total: 5,
|
|
|
// dialog 参数
|
|
|
visible: false,
|
|
|
+ edit_visible: false,
|
|
|
approve_visible: false,
|
|
|
track_visible: false,
|
|
|
+ edit_form: {},
|
|
|
reload: 0,
|
|
|
// 判断类型
|
|
|
- type: "2",
|
|
|
+ type: "3",
|
|
|
approverules: {
|
|
|
comments: [
|
|
|
{
|
|
@@ -177,13 +184,7 @@ export default {
|
|
|
},
|
|
|
// 审批意见
|
|
|
approveForm: { comments: "" },
|
|
|
- trackList: [
|
|
|
- {
|
|
|
- link: "发起工单",
|
|
|
- creatperson: "XXX 2021-06-08",
|
|
|
- explain: "",
|
|
|
- },
|
|
|
- ],
|
|
|
+ trackList: [],
|
|
|
// 顶部form
|
|
|
table_form: [
|
|
|
{
|
|
@@ -287,6 +288,7 @@ export default {
|
|
|
methods: {
|
|
|
// 初始化
|
|
|
handleInit() {
|
|
|
+ this.trackList = JSON.parse(sessionStorage.global_process);
|
|
|
this.table_list = JSON.parse(sessionStorage.global_data).filter(
|
|
|
(element) => element.issue_status
|
|
|
);
|
|
@@ -303,10 +305,13 @@ export default {
|
|
|
handleEdit(row) {
|
|
|
console.log(row, "row");
|
|
|
this.visible = true;
|
|
|
+ this.edit_visible = true;
|
|
|
+ this.edit_form = row;
|
|
|
},
|
|
|
handleCheck(row) {
|
|
|
console.log(row, "row");
|
|
|
this.visible = true;
|
|
|
+ this.edit_visible = false;
|
|
|
},
|
|
|
handleDelete() {},
|
|
|
// dialog事件
|
|
@@ -317,6 +322,29 @@ export default {
|
|
|
handleTrack() {
|
|
|
this.track_visible = true;
|
|
|
},
|
|
|
+ handleTransfer() {
|
|
|
+ const object = {
|
|
|
+ ...JSON.parse(sessionStorage.global_data)[0],
|
|
|
+ department_status: "待审批",
|
|
|
+ };
|
|
|
+ sessionStorage.setItem("global_data", JSON.stringify([object]));
|
|
|
+ const process_array = JSON.parse(sessionStorage.global_process);
|
|
|
+ process_array.push({
|
|
|
+ link: "转派工单",
|
|
|
+ creatperson: `ADMIN ${this.$formatDate(
|
|
|
+ new Date(),
|
|
|
+ "YYYY-MM-DD"
|
|
|
+ )}`,
|
|
|
+ explain: "",
|
|
|
+ });
|
|
|
+ sessionStorage.setItem(
|
|
|
+ "global_process",
|
|
|
+ JSON.stringify(process_array)
|
|
|
+ );
|
|
|
+ this.handleInit();
|
|
|
+ this.handleCancel("visible");
|
|
|
+ this.$message.success("转派成功");
|
|
|
+ },
|
|
|
handleTurn(type) {
|
|
|
this.handleCancel("approve_visible");
|
|
|
console.log(type);
|
|
@@ -340,6 +368,54 @@ export default {
|
|
|
break;
|
|
|
}
|
|
|
},
|
|
|
+ handleBack() {
|
|
|
+ const object = {
|
|
|
+ ...JSON.parse(sessionStorage.global_data)[0],
|
|
|
+ department_status: "待处理",
|
|
|
+ };
|
|
|
+ sessionStorage.setItem("global_data", JSON.stringify([object]));
|
|
|
+ const process_array = JSON.parse(sessionStorage.global_process);
|
|
|
+ process_array.push({
|
|
|
+ link: "审批驳回",
|
|
|
+ creatperson: `ADMIN ${this.$formatDate(
|
|
|
+ new Date(),
|
|
|
+ "YYYY-MM-DD"
|
|
|
+ )}`,
|
|
|
+ explain: this.approveForm.comments,
|
|
|
+ });
|
|
|
+ sessionStorage.setItem(
|
|
|
+ "global_process",
|
|
|
+ JSON.stringify(process_array)
|
|
|
+ );
|
|
|
+ this.handleInit();
|
|
|
+ this.$message.success("打回成功");
|
|
|
+ this.handleCancel("visible");
|
|
|
+ this.handleCancel("approve_visible");
|
|
|
+ },
|
|
|
+ handleAgree() {
|
|
|
+ const object = {
|
|
|
+ ...JSON.parse(sessionStorage.global_data)[0],
|
|
|
+ department_status: "已完成",
|
|
|
+ };
|
|
|
+ sessionStorage.setItem("global_data", JSON.stringify([object]));
|
|
|
+ const process_array = JSON.parse(sessionStorage.global_process);
|
|
|
+ process_array.push({
|
|
|
+ link: "审批通过",
|
|
|
+ creatperson: `ADMIN ${this.$formatDate(
|
|
|
+ new Date(),
|
|
|
+ "YYYY-MM-DD"
|
|
|
+ )}`,
|
|
|
+ explain: this.approveForm.comments,
|
|
|
+ });
|
|
|
+ sessionStorage.setItem(
|
|
|
+ "global_process",
|
|
|
+ JSON.stringify(process_array)
|
|
|
+ );
|
|
|
+ this.handleInit();
|
|
|
+ this.$message.success("审批成功");
|
|
|
+ this.handleCancel("visible");
|
|
|
+ this.handleCancel("approve_visible");
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|