|
|
@@ -42,12 +42,16 @@
|
|
|
<select-user :multiple="false" :name="approvePerson.name" :callback="selectCallback"></select-user>
|
|
|
<!-- <select-dialog-user :id="approvePerson.id" :name="approvePerson.name" :ehr="approvePerson.ehr" :disabled="false" :callback="selectCallback"></select-dialog-user>-->
|
|
|
</template>
|
|
|
-
|
|
|
+ <template slot="historyForm" slot-scope="{row}">
|
|
|
+ <approve-history :data="row"></approve-history>
|
|
|
+ </template>
|
|
|
<template slot-scope="{row, index}" slot="menu">
|
|
|
<el-button size="small" class="el-button--text" v-if="userInfo.user_id == row.createUser && tableEditBtn && ((approveType == 1 && (row.processStatus == '已退回' || (row.processStatus == '待審核' && !row.approveHistory))) || (approveType == 2 && !row.approveHistory))"
|
|
|
@click="formEdit(row, index)"><i class="el-icon-edit"></i> 編 輯</el-button>
|
|
|
<el-button type="text" icon="el-icon-download" size="small" v-if="row.file" @click="handleDownload(row)">下載</el-button>
|
|
|
- <el-button type="text" icon="el-icon-check" size="small" v-if="approveSwitch == 1 && ( (approveType == 1 && row.process > 0 && row.process <= approveNum) || approveType == 2 ) && row.receiverId.indexOf(userInfo.user_id) > -1 && userInfo.user_id != row.createUser"
|
|
|
+ <el-button type="text" icon="el-icon-check" size="small"
|
|
|
+ v-if="approveSwitch == 1 && ( (approveType == 1 && row.process > 0 && row.process <= approveNum) || approveType == 2 ) && row.receiverId.indexOf(userInfo.user_id) > -1
|
|
|
+ && userInfo.user_id != row.createUser && (!row.approveId || row.approveId.indexOf(userInfo.user_id) == -1) && row.processStatus == '待審核'"
|
|
|
@click.native="approveShow(row)">審批</el-button>
|
|
|
|
|
|
</template>
|
|
|
@@ -62,8 +66,12 @@
|
|
|
<!-- <select-dialog-user :id="approvePerson.id" :name="approvePerson.name" :ehr="approvePerson.ehr" :disabled="false" :callback="selectCallback"></select-dialog-user>-->
|
|
|
</template>
|
|
|
|
|
|
+ <template slot="history">
|
|
|
+ <approve-history :data="approveForm"></approve-history>
|
|
|
+ </template>
|
|
|
+
|
|
|
<template slot-scope="scope" slot="menuForm">
|
|
|
- <el-button type="warning" size="small" v-if="bohuiBtn" icon="el-icon-close" @click="approveReject">退回</el-button>
|
|
|
+ <el-button type="warning" size="small" v-if="bohuiBtn" icon="el-icon-close" @click="toReject">退回</el-button>
|
|
|
<el-button type="danger" size="small"
|
|
|
v-if="approveSwitch == 1 && approveType == 2"
|
|
|
icon="el-icon-close" @click="approveNo">不通過</el-button>
|
|
|
@@ -84,9 +92,10 @@
|
|
|
import {downloadFileBase64, downloadFileBlob} from "@/util/util";
|
|
|
import SelectDialogUser from "../../components/select-dialog/select-dialog-user";
|
|
|
import SelectUser from "../../components/select-dialog/select-user";
|
|
|
+ import ApproveHistory from "../../components/process/approve-history";
|
|
|
|
|
|
export default {
|
|
|
- components: {SelectUser, SelectDialogUser},
|
|
|
+ components: {ApproveHistory, SelectUser, SelectDialogUser},
|
|
|
data() {
|
|
|
return {
|
|
|
|
|
|
@@ -122,6 +131,7 @@
|
|
|
tableEditBtn: false,
|
|
|
approveSwitch: false,
|
|
|
approveType: '',
|
|
|
+ settingType: '',
|
|
|
bohuiBtn: false,
|
|
|
approveNum: 0,
|
|
|
approveVisible: false,
|
|
|
@@ -190,8 +200,8 @@
|
|
|
label: "審批人",
|
|
|
prop: "receiverName",
|
|
|
viewDisplay: false,
|
|
|
- addDisplay: true,
|
|
|
- editDisplay: true,
|
|
|
+ addDisplay: false,
|
|
|
+ editDisplay: false,
|
|
|
formslot: true,
|
|
|
rules: [{
|
|
|
required: true,
|
|
|
@@ -204,7 +214,23 @@
|
|
|
prop: "remark",
|
|
|
type: "textarea",
|
|
|
span: 24,
|
|
|
- }
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "狀態",
|
|
|
+ prop: "processStatus",
|
|
|
+ addDisplay: false,
|
|
|
+ editDisplay: false
|
|
|
+ },
|
|
|
+ {
|
|
|
+ label: "審批記錄",
|
|
|
+ prop: "history",
|
|
|
+ span: 24,
|
|
|
+ hide: true,
|
|
|
+ formslot: true,
|
|
|
+ viewDisplay: true,
|
|
|
+ addDisplay: false,
|
|
|
+ editDisplay: false
|
|
|
+ },
|
|
|
]
|
|
|
};
|
|
|
},
|
|
|
@@ -242,7 +268,7 @@
|
|
|
},
|
|
|
approveYes(data, done){
|
|
|
let row = this.deepClone(this.approveForm);
|
|
|
- delete row.createTime,delete row.createUser,delete row.createUserName;
|
|
|
+ delete row.createTime,delete row.createUser,delete row.createUserName,delete row.history;
|
|
|
let form = this.beforeSave(row);
|
|
|
form.id = row.id, form.remark = row.remark;
|
|
|
approveYes(form).then(res => {
|
|
|
@@ -255,19 +281,36 @@
|
|
|
})
|
|
|
done();
|
|
|
},
|
|
|
+ toReject(){
|
|
|
+ // 串行 && 逐級設置
|
|
|
+ /*if (this.approveType == 1 && this.settingType == 2){
|
|
|
+ let $receiver = this.findObject(this.approveOption.column, "receiverName");
|
|
|
+ if ($receiver){
|
|
|
+ $receiver.rules[0].required = false;
|
|
|
+ }
|
|
|
+ }*/
|
|
|
+ this.$confirm("確定要退回到發起人?", {
|
|
|
+ confirmButtonText: "確定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ this.approveReject();
|
|
|
+ })
|
|
|
+ },
|
|
|
approveReject(){
|
|
|
let row = this.deepClone(this.approveForm);
|
|
|
delete row.createTime,delete row.createUser,delete row.createUserName;
|
|
|
let form = this.beforeSave(row);
|
|
|
form.id = row.id, form.remark = row.remark;
|
|
|
- approveReject(form).then(res => {
|
|
|
+ /*approveReject(form).then(res => {
|
|
|
this.approveVisible = false;
|
|
|
this.onLoad(this.page);
|
|
|
this.$message({
|
|
|
type: "success",
|
|
|
message: "退回成功!"
|
|
|
});
|
|
|
- })
|
|
|
+ })*/
|
|
|
},
|
|
|
approveNo(){
|
|
|
let row = this.deepClone(this.approveForm);
|
|
|
@@ -284,6 +327,12 @@
|
|
|
})
|
|
|
},
|
|
|
approveShow(row){
|
|
|
+ if (this.approveType == 1 && this.settingType == 2 && row.process == this.approveNum){
|
|
|
+ let $receiver = this.findObject(this.approveOption.column, "receiverName");
|
|
|
+ if ($receiver){
|
|
|
+ $receiver.display = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
this.bohuiBtn = row.process > 1;
|
|
|
this.approveForm = row;
|
|
|
delete this.approveForm.receiverName;
|
|
|
@@ -334,6 +383,7 @@
|
|
|
let tableStruct = this.getItemById(value);
|
|
|
this.approveSwitch = tableStruct.approveSwitch;
|
|
|
this.approveType = tableStruct.approveType;
|
|
|
+ this.settingType = tableStruct.settingType;
|
|
|
this.approveNum = tableStruct.num;
|
|
|
let option = opStr2opObj(tableStruct.columns);
|
|
|
option.addBtn = tableStruct.canWrite;
|
|
|
@@ -359,9 +409,13 @@
|
|
|
});
|
|
|
option.column.push(this.defaultColumn[0]);
|
|
|
option.column.push(this.defaultColumn[1]);
|
|
|
+ option.column.push(this.defaultColumn[4]);
|
|
|
+ option.column.push(this.defaultColumn[5]);
|
|
|
//開流程 && 串行 && 逐級審批
|
|
|
- if (tableStruct.approveSwitch == 1 && tableStruct.approveType == 1 && tableStruct.settingType == 2){
|
|
|
+ if (tableStruct.approveSwitch == 1 ){
|
|
|
// 增加審批人選擇
|
|
|
+ this.defaultColumn[2].addDisplay = tableStruct.approveType == 1 && tableStruct.settingType == 2;
|
|
|
+ this.defaultColumn[2].editDisplay = tableStruct.approveType == 1 && tableStruct.settingType == 2;
|
|
|
option.column.push(this.defaultColumn[2])
|
|
|
}
|
|
|
this.option = option;
|
|
|
@@ -370,6 +424,7 @@
|
|
|
item.disabled = true;
|
|
|
if (item.prop == 'receiverName'){
|
|
|
item.disabled = false;
|
|
|
+ item.display = tableStruct.approveType == 1 && tableStruct.settingType == 2;
|
|
|
}
|
|
|
})
|
|
|
this.approveOption.column.push(this.defaultColumn[3])
|
|
|
@@ -580,7 +635,6 @@
|
|
|
let key = keys[j];
|
|
|
if (key.indexOf("params") != -1){
|
|
|
let value = row['' + key];
|
|
|
- console.log('value' + value)
|
|
|
if (value != ''){
|
|
|
let item = JSON.parse(value);
|
|
|
item.key = key;
|
|
|
@@ -602,7 +656,6 @@
|
|
|
const data = res.data.data;
|
|
|
this.page.total = data.total;
|
|
|
this.data = this.initData(data.records);
|
|
|
- console.log(this.data)
|
|
|
this.loading = false;
|
|
|
this.selectionClear();
|
|
|
});
|