|
|
|
@ -0,0 +1,289 @@
|
|
|
|
|
<template>
|
|
|
|
|
<a-spin :spinning="spinning">
|
|
|
|
|
<vue-scroll :ops="listScroll" class="leave-info-box-style" style="height:450px">
|
|
|
|
|
<div class="info-row-style">
|
|
|
|
|
<div class="info-left">申请人:</div>
|
|
|
|
|
<div class="info-right">{{applyInfo.person_name}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="info-row-style">
|
|
|
|
|
<div class="info-left">申请时间:</div>
|
|
|
|
|
<div class="info-right">{{applyInfo.create_time}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="info-row-style">
|
|
|
|
|
<div class="info-left">请假类型:</div>
|
|
|
|
|
<div class="info-right">{{typeStr}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="info-row-style">
|
|
|
|
|
<div class="info-left">开始时间:</div>
|
|
|
|
|
<div class="info-right">
|
|
|
|
|
{{applyInfo.start_time}}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="info-row-style">
|
|
|
|
|
<div class="info-left">结束时间:</div>
|
|
|
|
|
<div class="info-right">
|
|
|
|
|
<div class="left-style">{{applyInfo.end_time}}</div>
|
|
|
|
|
<div class="right-style">
|
|
|
|
|
<div class="part-left">合计:</div>
|
|
|
|
|
<div class="part-right">{{applyInfo.total_hours + '小时' + '('+applyInfo.total_days+'工作日'+')'}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="info-row-style">
|
|
|
|
|
<div class="info-left">请假事由:</div>
|
|
|
|
|
<div class="info-right">{{applyInfo.content}}</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="info-row-style">
|
|
|
|
|
<div class="info-left">附件:</div>
|
|
|
|
|
<div class="info-right">
|
|
|
|
|
<div v-if="fileList.length == 0">暂无附件</div>
|
|
|
|
|
<div v-else>
|
|
|
|
|
<Uploader :type="1" :fileData="fileList" :canUpload="false" :option="{}" :multiple="false"></Uploader>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<a-divider>审批内容</a-divider>
|
|
|
|
|
<ApproveCom
|
|
|
|
|
:hasNext="hasNext"
|
|
|
|
|
:checkPersonList="checkPersonList"
|
|
|
|
|
:openCopyFlag="openCopyFlag"
|
|
|
|
|
:copyPersonType="copyPersonType"
|
|
|
|
|
:copyPersonList="copyPersonList"
|
|
|
|
|
@changeCheckPerson="changeCheckPerson"
|
|
|
|
|
@changeCopyPerson="changeCopyPerson"
|
|
|
|
|
@submit="submit"
|
|
|
|
|
/>
|
|
|
|
|
</vue-scroll>
|
|
|
|
|
</a-spin>
|
|
|
|
|
</template>
|
|
|
|
|
<script>
|
|
|
|
|
/*
|
|
|
|
|
* 请假审批
|
|
|
|
|
* */
|
|
|
|
|
import {Spin, Divider, Modal} from 'ant-design-vue';
|
|
|
|
|
import interConfig from './interConfig';
|
|
|
|
|
import ApproveCom from './approveCom.vue';
|
|
|
|
|
import Uploader from '../../../../../../../components/common/uploader/Upload.vue';
|
|
|
|
|
export default{
|
|
|
|
|
props: {
|
|
|
|
|
param: {
|
|
|
|
|
type: Object,
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
data(){
|
|
|
|
|
return {
|
|
|
|
|
applyInfo: {},
|
|
|
|
|
typeStr:"",//请假类型
|
|
|
|
|
fileList:[],
|
|
|
|
|
spinning: false,
|
|
|
|
|
listScroll: this.StaticParams.scrollOption,
|
|
|
|
|
hasNext: 0,//是否存在下一审批节点
|
|
|
|
|
checkPersonList: [],//审批人信息
|
|
|
|
|
nextLevelId: "",//下级节点ID
|
|
|
|
|
openCopyFlag: 1,//是否开启抄送
|
|
|
|
|
copyPersonType: 0,//抄送类型 (0-自选,1-申请部门领导,2-指定)
|
|
|
|
|
copyPersonList: [],//抄送人员
|
|
|
|
|
|
|
|
|
|
checkPersonId: "",//下一步审核人员ID
|
|
|
|
|
checkPersonName: "",//下一步审核人员姓名
|
|
|
|
|
paramCopyList: [],//抄送人
|
|
|
|
|
options: "",//审批意见
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted(){
|
|
|
|
|
this.getApplyInfo();
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
|
|
|
|
getApplyInfo: function () {
|
|
|
|
|
let params = {
|
|
|
|
|
run_id: this.param.run_id,
|
|
|
|
|
level_check: 1,
|
|
|
|
|
need_next: 1,
|
|
|
|
|
person_id: this.BaseConfig.userInfo.person_id
|
|
|
|
|
}
|
|
|
|
|
this.spinning = true;
|
|
|
|
|
this.InterfaceConfig.callInterface([{
|
|
|
|
|
url: interConfig.getLeaveApplyDetail.url,
|
|
|
|
|
params: params,
|
|
|
|
|
method: interConfig.getLeaveApplyDetail.method,
|
|
|
|
|
isTestLogin: interConfig.getLeaveApplyDetail.isTestLogin
|
|
|
|
|
}], (result) => {
|
|
|
|
|
let res = result[0].data;
|
|
|
|
|
if (res.code === 2000) {
|
|
|
|
|
|
|
|
|
|
let dataBox = res.data;
|
|
|
|
|
if(dataBox.run){
|
|
|
|
|
this.applyInfo = dataBox.run;
|
|
|
|
|
this.fileList = JSON.parse(dataBox.run.attachment_json);
|
|
|
|
|
}
|
|
|
|
|
let typeId = dataBox.run.type_id;
|
|
|
|
|
this.typeStr = this.getTypeStr(typeId);
|
|
|
|
|
this.hasNext = dataBox.has_next;//是否存在下一审批节点
|
|
|
|
|
if (this.hasNext === 1 && dataBox.next_level) {
|
|
|
|
|
this.checkPersonList = dataBox.next_level.check_person_list;
|
|
|
|
|
this.nextLevelId = dataBox.next_level.level_id;
|
|
|
|
|
}
|
|
|
|
|
this.spinning = false;
|
|
|
|
|
} else {
|
|
|
|
|
this.spinning = false;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
getTypeStr:function (typeId) {
|
|
|
|
|
console.log(typeId)
|
|
|
|
|
let str = "";
|
|
|
|
|
switch (typeId){
|
|
|
|
|
case 1:
|
|
|
|
|
str = "事假";
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
str = "病假";
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
str = "婚假";
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
str = "产假";
|
|
|
|
|
break;
|
|
|
|
|
case 5:
|
|
|
|
|
str = "丧假";
|
|
|
|
|
break;
|
|
|
|
|
case 6:
|
|
|
|
|
str = "陪护假";
|
|
|
|
|
break;
|
|
|
|
|
case 7:
|
|
|
|
|
str = "其他";
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
return str;
|
|
|
|
|
},
|
|
|
|
|
changeCheckPerson: function (personId) {
|
|
|
|
|
let checkPerson = this.checkPersonList.filter((item) => {
|
|
|
|
|
return parseInt(item.person_id) === parseInt(personId);
|
|
|
|
|
})
|
|
|
|
|
this.checkPersonId = personId;
|
|
|
|
|
if (checkPerson.length > 0) {
|
|
|
|
|
this.checkPersonName = checkPerson[0].person_name;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
changeCopyPerson: function (personArr) {
|
|
|
|
|
this.paramCopyList = personArr;
|
|
|
|
|
},
|
|
|
|
|
submit: function (res) {
|
|
|
|
|
let type = res.type;
|
|
|
|
|
this.options = res.options;
|
|
|
|
|
if (type === 1) {
|
|
|
|
|
if (this.hasNext === 1 && this.checkPersonId === "") {
|
|
|
|
|
Modal.warning({
|
|
|
|
|
title: "请选择审批人",
|
|
|
|
|
content: "",
|
|
|
|
|
centered: true
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
if (this.openCopyFlag === 1 && this.paramCopyList.length > 20) {
|
|
|
|
|
Modal.warning({
|
|
|
|
|
title: "请选择审批人",
|
|
|
|
|
content: "",
|
|
|
|
|
centered: true
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
} else if (type === -1) {
|
|
|
|
|
if (this.options === "") {
|
|
|
|
|
Modal.warning({
|
|
|
|
|
title: "请填写审批意见",
|
|
|
|
|
content: "",
|
|
|
|
|
centered: true
|
|
|
|
|
})
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let submitParam = {
|
|
|
|
|
check_id: this.param.check_id,
|
|
|
|
|
status_id: type,
|
|
|
|
|
person_id: this.BaseConfig.userInfo.person_id_cookie,
|
|
|
|
|
check_opinion: this.options,
|
|
|
|
|
has_next: this.hasNext,
|
|
|
|
|
}
|
|
|
|
|
if (type === 1 && this.hasNext === 1) {
|
|
|
|
|
submitParam.next_level_id = this.nextLevelId;
|
|
|
|
|
submitParam.next_person_id = this.checkPersonId;
|
|
|
|
|
submitParam.next_person_name = this.checkPersonName;
|
|
|
|
|
}
|
|
|
|
|
if (this.copyPersonType === 1 && this.copyPersonList.length > 0) {
|
|
|
|
|
//部门领导
|
|
|
|
|
submitParam.copy_list = JSON.stringify(this.copyPersonList);
|
|
|
|
|
}
|
|
|
|
|
if (this.copyPersonType !== 1 && this.paramCopyList.length > 0) {
|
|
|
|
|
//其他方式
|
|
|
|
|
submitParam.copy_list = JSON.stringify(this.paramCopyList);
|
|
|
|
|
}
|
|
|
|
|
this.spinning = true;
|
|
|
|
|
this.InterfaceConfig.callInterface([{
|
|
|
|
|
url: interConfig.leaveCheck.url,
|
|
|
|
|
params: submitParam,
|
|
|
|
|
method: interConfig.leaveCheck.method,
|
|
|
|
|
isTestLogin: interConfig.leaveCheck.isTestLogin
|
|
|
|
|
}], (result) => {
|
|
|
|
|
let res = result[0].data;
|
|
|
|
|
if (res.code === 2000) {
|
|
|
|
|
Modal.success({
|
|
|
|
|
title: "审批成功",
|
|
|
|
|
content: "",
|
|
|
|
|
centered: true
|
|
|
|
|
})
|
|
|
|
|
this.$emit("updateModuleData")
|
|
|
|
|
this.spinning = false;
|
|
|
|
|
} else {
|
|
|
|
|
this.spinning = false;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
components: {
|
|
|
|
|
ASpin: Spin,
|
|
|
|
|
ADivider: Divider,
|
|
|
|
|
ApproveCom,
|
|
|
|
|
Uploader
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped lang="scss">
|
|
|
|
|
.leave-info-box-style {
|
|
|
|
|
width: 100%;
|
|
|
|
|
/*height: calc(100% - 50px) !important;*/
|
|
|
|
|
padding: 10px !important;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
.info-row-style {
|
|
|
|
|
width: 100%;
|
|
|
|
|
min-height: 2.5rem;
|
|
|
|
|
display: flex;
|
|
|
|
|
.info-left {
|
|
|
|
|
width: 20%;
|
|
|
|
|
text-align: right;
|
|
|
|
|
}
|
|
|
|
|
.info-right {
|
|
|
|
|
width: 80%;
|
|
|
|
|
text-align: left;
|
|
|
|
|
display: flex;
|
|
|
|
|
.left-style {
|
|
|
|
|
width: 50%;
|
|
|
|
|
text-align: left;
|
|
|
|
|
}
|
|
|
|
|
.right-style {
|
|
|
|
|
width: 50%;
|
|
|
|
|
text-align: left;
|
|
|
|
|
display: flex;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
scrollbar-width: none; /* Firefox */
|
|
|
|
|
-ms-overflow-style: none; /* IE 10+ */
|
|
|
|
|
::-webkit-scrollbar {
|
|
|
|
|
display: none; /* Chrome Safari */
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|