Merge branch 'sy-dev'

This commit is contained in:
BianLzhaoMin 2025-02-08 17:56:37 +08:00
commit 7e7c68e78d
3 changed files with 439 additions and 273 deletions

View File

@ -1,45 +1,91 @@
<template> <template>
<div class="container"> <div class="container">
<div :class="{'content1': this.auditType === '审批信息' , 'content2': this.auditType !== '审批信息' }"> <div :class="{ content1: this.auditType === '审批信息', content2: this.auditType !== '审批信息' }">
<img src="@/assets/file/no_data.png" alt="暂无数据" v-if="!items" style="position: absolute;top: 30%;left: 43%"> <img
<div style="height: 90%" v-else> src="@/assets/file/no_data.png"
<el-timeline :reverse="reverse" > alt="暂无数据"
<el-timeline-item v-for="(item,index) in items" v-if="!items"
:key="index" :timestamp="item.time" placement="top" :color="item.name === userName ? color : color1"> style="position: absolute; top: 30%; left: 43%"
<el-card style="border-radius: 15px"> />
<span>审批部门{{ item.section }}</span> <span style="margin-left: 50px;">审批人{{ item.name }}</span> <div style="height: 90%" v-else>
<p>审批时间 {{ item.time }}</p> <el-timeline :reverse="reverse">
<p>审批状态 {{ item.status }}</p> <el-timeline-item
<p v-if="item.name.indexOf(userName) !=-1 && showType == 2 ">审批意见: <el-input v-model="reason" maxlength="200" show-word-limit placeholder="请输入审批意见" @change="changReason" style="width: 60%"></el-input></p> v-for="(item, index) in items"
<p v-else>审批意见 {{ item.reason.replaceAll(/@@/g, ' ') }}</p> :key="index"
<p v-if="item.turnDownReason !== '' && showPosition === 2">驳回原因 {{ item.turnDownReason }}</p> :timestamp="item.time"
<p v-else-if="item.turnDownReason !== '' && item.name !== userName ">驳回原因 {{ item.turnDownReason }}</p> placement="top"
:color="item.name === userName ? color : color1"
</el-card> >
</el-timeline-item> <el-card style="border-radius: 15px">
</el-timeline> <span>审批部门{{ item.section }}</span>
<div slot="footer" class="dialog-footer" v-show="btnShow" style="position: absolute;top: 94%;left: 80%;z-index: 999 !important;width: 250px;"> <span style="margin-left: 50px">审批人{{ item.name }}</span>
<el-button type="warning" @click="finalInstanceBtn" v-if="finalCheck != '0'">终审</el-button> <p>审批时间 {{ item.time }}</p>
<el-button type="primary" @click="passBtn">通过</el-button> <p>审批状态 {{ item.status }}</p>
<el-button type="primary" plain @click="turnDownBtn">驳回</el-button> <p v-if="item.name.indexOf(userName) != -1 && showType == 2">
</div> 审批意见
</div> <el-input
<el-dialog title="驳回原因" :visible.sync="dialogVisible" width="30%" :close-on-click-modal="false"> v-model="reason"
<el-form :model="form" ref="form" :rules="rules" label-width="80px"> maxlength="200"
<el-form-item label="请输入驳回原因" label-width="120px" prop="turnDownReason"> show-word-limit
<el-input type="textarea" v-model="form.turnDownReason" :rows="6" maxlength="200" show-word-limit placeholder="请输入驳回原因"></el-input> placeholder="请输入审批意见"
</el-form-item> @change="changReason"
</el-form> style="width: 60%"
<span slot="footer" class="dialog-footer"> ></el-input>
<el-button @click="dialogVisible = false"> </el-button> </p>
<el-button type="primary" @click="submitForm('form')" v-preventReClick="5000"> </el-button> <p v-else>审批意见 {{ item.reason.replaceAll(/@@/g, ' ') }}</p>
</span> <p v-if="item.turnDownReason !== '' && showPosition === 2">驳回原因 {{ item.turnDownReason }}</p>
</el-dialog> <p v-else-if="item.turnDownReason !== '' && item.name !== userName">
</div> 驳回原因 {{ item.turnDownReason }}
<div style="width: 38%;position: absolute;left: 65%;top: 0;height: 70vh;overflow: auto" v-if="this.auditType === '审批信息' && auditPersonArr.length > 0"> </p>
<el-aside width="100%" style="background: transparent;margin-top: 2%;"> </el-card>
<div style="display: flex;flex-direction: column;align-items: center"> </el-timeline-item>
<div style="border-radius: 10px;padding: 15px;border: 1.5px solid black;width: 50%;text-align: center;font-weight: bold"> </el-timeline>
<div
slot="footer"
class="dialog-footer"
v-show="btnShow"
style="position: absolute; top: 94%; left: 80%; z-index: 999 !important; width: 250px"
>
<el-button type="warning" @click="finalInstanceBtn" v-if="finalCheck != '0'">终审</el-button>
<el-button type="primary" @click="passBtn">通过</el-button>
<el-button type="primary" plain @click="turnDownBtn">驳回</el-button>
</div>
</div>
<el-dialog title="驳回原因" :visible.sync="dialogVisible" width="30%" :close-on-click-modal="false">
<el-form :model="form" ref="form" :rules="rules" label-width="80px">
<el-form-item label="请输入驳回原因" label-width="120px" prop="turnDownReason">
<el-input
type="textarea"
v-model="form.turnDownReason"
:rows="6"
maxlength="200"
show-word-limit
placeholder="请输入驳回原因"
></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="submitForm('form')" v-preventReClick="5000"> </el-button>
</span>
</el-dialog>
</div>
<div
style="width: 38%; position: absolute; left: 65%; top: 0; height: 70vh; overflow: auto"
v-if="this.auditType === '审批信息' && auditPersonArr.length > 0"
>
<el-aside width="100%" style="background: transparent; margin-top: 2%">
<div style="display: flex; flex-direction: column; align-items: center">
<div
style="
border-radius: 10px;
padding: 15px;
border: 1.5px solid black;
width: 50%;
text-align: center;
font-weight: bold;
"
>
开始 开始
</div> </div>
<div class="arrow-container"> <div class="arrow-container">
@ -47,9 +93,23 @@
<div class="arrow-down"></div> <div class="arrow-down"></div>
</div> </div>
<div v-for="(item,index) in auditPersonArr" :key="index" style="width: 100%;display: flex;flex-direction: column;align-items: center;"> <div
<div :class="{'highlight': index < currentCheckIndex, 'normal': index > currentCheckIndex,'currentLight': index === currentCheckIndex }"> v-for="(item, index) in auditPersonArr"
{{ item.checkPerson }} ( {{ item.examineType === '0' ? '依次' : item.examineType === '1' ? '会签' : '或签' }})<span style="margin-left: 15px;font-size: 20px;font-weight: bold"> {{index < currentCheckIndex ? '√' : (currentCheckIndex === index ? '?' : '') }}</span> :key="index"
style="width: 100%; display: flex; flex-direction: column; align-items: center"
>
<div
:class="{
highlight: index < currentCheckIndex && item.isResult,
normal: index > currentCheckIndex,
currentLight: index === currentCheckIndex || (index === currentCheckIndex - 1 && !item.isResult),
}"
>
{{ item.checkPerson }} (
{{ item.examineType === '0' ? '依次' : item.examineType === '1' ? '会签' : '或签' }})
<span style="margin-left: 15px; font-size: 20px; font-weight: bold">
{{ index < currentCheckIndex && item.isResult ? '√' : currentCheckIndex === index ? '?' : '?' }}
</span>
</div> </div>
<div class="arrow-container"> <div class="arrow-container">
@ -57,20 +117,24 @@
<div class="arrow-down"></div> <div class="arrow-down"></div>
</div> </div>
</div> </div>
<div style="border-radius: 10px;padding: 15px;border: 1.5px solid black;width: 50%;text-align: center;font-weight: bold"> <div
style="
border-radius: 10px;
padding: 15px;
border: 1.5px solid black;
width: 50%;
text-align: center;
font-weight: bold;
"
>
结束 结束
</div> </div>
</div> </div>
</el-aside> </el-aside>
</div> </div>
</div> </div>
</template> </template>
<script> <script>
import { getAuditPerson } from '@/api/pro/approval_cons' import { getAuditPerson } from '@/api/pro/approval_cons'
import store from '@/store' import store from '@/store'
@ -78,17 +142,17 @@ export default {
props: { props: {
auditReason: { auditReason: {
type: Array, type: Array,
default: [] default: [],
}, },
showType: Number,// 1 2 showType: Number, // 1 2
isExamine: false,// true false isExamine: false, // true false
btnShow: false,// btnShow: false, //
finalCheck: String, finalCheck: String,
ids: Object, // {proId: '', consId: '', subId: '', supId: '', personId: ''} ids: Object, // {proId: '', consId: '', subId: '', supId: '', personId: ''}
auditType:{ auditType: {
type: String, type: String,
default: '审批信息' default: '审批信息',
},// }, //
items: { items: {
type: Array, type: Array,
default: [ default: [
@ -99,8 +163,8 @@ export default {
status: '', status: '',
reason: '', reason: '',
turnDownReason: '', turnDownReason: '',
} },
] ],
}, },
showPosition: { showPosition: {
type: Number, type: Number,
@ -112,45 +176,43 @@ export default {
return store return store
}, },
isUserIncluded(index) { isUserIncluded(index) {
console.log("index=========",index) console.log('index=========', index)
if (this.auditPersonArr[index].checkPerson.includes(this.userName)) { if (this.auditPersonArr[index].checkPerson.includes(this.userName)) {
return true return true
} else { } else {
return false return false
} }
} },
}, },
watch: { watch: {
items: { items: {
handler: function (val) { handler: function (val) {
console.log("=----------------",val) console.log('=----------------', val)
}, },
deep: true deep: true,
} },
}, },
data() { data() {
return { return {
currentCheckIndex: 0, currentCheckIndex: 0,
auditPersonArr:[], auditPersonArr: [],
taskId : '', taskId: '',
reason:'', reason: '',
dialogVisible: false, dialogVisible: false,
height: this.$props.auditType ? 600 : 750, height: this.$props.auditType ? 600 : 750,
form: { form: {
turnDownReason: '' turnDownReason: '',
}, },
rules:{ rules: {
turnDownReason: [ turnDownReason: [{ required: true, message: '请输入驳回原因', trigger: 'blur' }],
{ required: true, message: '请输入驳回原因', trigger: 'blur' }
]
}, },
reverse: false, reverse: false,
color: '#0bbd87', color: '#0bbd87',
color1: '#ededed', color1: '#ededed',
userName: this.$store.state.user.userData.nickName, userName: this.$store.state.user.userData.nickName,
code:1, code: 1,
num:0, num: 0,
assignNum:0 assignNum: 0,
} }
}, },
mounted() { mounted() {
@ -158,14 +220,14 @@ export default {
}, },
methods: { methods: {
assign() { assign() {
console.log("111auditType==="+this.auditType) console.log('111auditType===' + this.auditType)
if (this.assignNum > 5){ if (this.assignNum > 5) {
return return
} }
if (this.auditType === '审批信息' ||this.auditRecordType === '全部'){ if (this.auditType === '审批信息' || this.auditRecordType === '全部') {
if (this.taskId){ if (this.taskId) {
this.getAuditPerson() this.getAuditPerson()
}else{ } else {
if (this.$props.items && this.$props.items.length > 0) { if (this.$props.items && this.$props.items.length > 0) {
this.taskId = this.$props.items[0].taskId this.taskId = this.$props.items[0].taskId
} }
@ -178,21 +240,31 @@ export default {
} }
}, },
getAuditPerson() { getAuditPerson() {
getAuditPerson({taskId: this.taskId}).then(res => { getAuditPerson({ taskId: this.taskId }).then(res => {
if (res.code === 200) { if (res.code === 200) {
this.auditPersonArr = res.data this.auditPersonArr = res.data
console.log('this.auditPersonArr审核流程', this.auditPersonArr)
//isActive1 //isActive1
this.currentCheckIndex = this.auditPersonArr.findIndex(item => item.isActive == '1') this.currentCheckIndex = this.auditPersonArr.findIndex(item => item.isActive == '1')
if (this.auditPersonArr[0].isActive == '10'){
if (this.auditPersonArr[0].isActive == '10') {
this.currentCheckIndex = this.auditPersonArr.length this.currentCheckIndex = this.auditPersonArr.length
} }
console.log("this.auditPersonArr.==="+JSON.stringify(this.auditPersonArr))
console.log("this.currentCheckIndex==="+this.currentCheckIndex) this.auditPersonArr.forEach(e => {
if (e.isActive == 10) {
e.isResult = true
} else {
e.isResult = false
}
})
console.log('this.auditPersonArr.===' + JSON.stringify(this.auditPersonArr))
console.log('this.currentCheckIndex===' + this.currentCheckIndex)
} }
}) })
}, },
changReason(e) { changReason(e) {
console.log("222auditType==="+this.auditType) console.log('222auditType===' + this.auditType)
this.$emit('reason', { reason: e, auditType: this.auditType }) this.$emit('reason', { reason: e, auditType: this.auditType })
}, },
// //
@ -202,52 +274,50 @@ export default {
// //
passBtn() { passBtn() {
if (this.reason === '') { if (this.reason === '') {
this.reason = '@@' this.reason = '@@'
} }
this.$emit('pass', this.reason) this.$emit('pass', this.reason)
}, },
// //
turnDownBtn() { turnDownBtn() {
console.log("333auditType==="+JSON.stringify(this.auditReason)) console.log('333auditType===' + JSON.stringify(this.auditReason))
console.log("333auditType==="+this.auditReason.toString()) console.log('333auditType===' + this.auditReason.toString())
let reason = '' let reason = ''
if (this.auditReason && this.auditReason.length > 0){ if (this.auditReason && this.auditReason.length > 0) {
this.auditReason.forEach(item => { this.auditReason.forEach(item => {
if (item.reason === '' || item.reason === null || item.reason === undefined){ if (item.reason === '' || item.reason === null || item.reason === undefined) {
}else{ } else {
reason += item.reason + "" reason += item.reason + ''
} }
}) })
reason = reason.substring(0, reason.length - 1) reason = reason.substring(0, reason.length - 1)
}else{ } else {
reason = this.reason reason = this.reason
} }
this.form.turnDownReason =reason this.form.turnDownReason = reason
this.dialogVisible = true this.dialogVisible = true
}, },
submitForm(){ submitForm() {
this.$refs.form.validate((valid) => { this.$refs.form.validate(valid => {
if (valid) { if (valid) {
this.dialogVisible = false this.dialogVisible = false
if (this.reason === '') { if (this.reason === '') {
this.reason = '@@' this.reason = '@@'
} }
this.$emit('turnDown',{"rejectReason":this.form.turnDownReason,"reason":this.reason}) this.$emit('turnDown', { rejectReason: this.form.turnDownReason, reason: this.reason })
} else { } else {
return false; return false
} }
}); })
}, },
addReason(){ addReason() {
this.dialogVisible = true this.dialogVisible = true
} },
},
}
} }
</script> </script>
<style scoped> <style scoped>
.container{ .container {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
overflow-y: auto; overflow-y: auto;
@ -274,25 +344,48 @@ export default {
.highlight { .highlight {
/* Add any specific styles for the highlighted state */ /* Add any specific styles for the highlighted state */
padding: 8px;border: 1px solid green;width: 50%;text-align: center;height: 50px;font-size: 14px;margin-top: 2px;border-radius: 5px; padding: 8px;
border: 1px solid green;
width: 50%;
text-align: center;
height: 50px;
font-size: 14px;
margin-top: 2px;
border-radius: 5px;
background: #35c50c; background: #35c50c;
} }
.currentLight { .currentLight {
/* Add any specific styles for the highlighted state */ /* Add any specific styles for the highlighted state */
padding: 8px;border: 1px solid green;width: 50%;text-align: center;height: 50px;font-size: 14px;margin-top: 2px;border-radius: 5px; padding: 8px;
border: 1px solid green;
width: 50%;
text-align: center;
height: 50px;
font-size: 14px;
margin-top: 2px;
border-radius: 5px;
background: #e6f511; background: #e6f511;
} }
.normal { .normal {
/* Add any specific styles for the normal state */ /* Add any specific styles for the normal state */
padding: 8px;border: 1px solid black;width: 50%;text-align: center;height: 50px;font-size: 14px;margin-top: 2px;border-radius: 5px; padding: 8px;
border: 1px solid black;
width: 50%;
text-align: center;
height: 50px;
font-size: 14px;
margin-top: 2px;
border-radius: 5px;
} }
.content1 { .content1 {
/* Add any specific styles for the highlighted state */ /* Add any specific styles for the highlighted state */
width: 70%;overflow-y: auto;height: 700px width: 70%;
overflow-y: auto;
height: 700px;
} }
.content2 { .content2 {
/* Add any specific styles for the highlighted state */ /* Add any specific styles for the highlighted state */
width: 100%;overflow-y: auto; width: 100%;
overflow-y: auto;
} }
</style> </style>

View File

@ -1,35 +1,55 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form ref="elForm" :model="formData" :rules="rules" size="medium" label-width="100px" <el-form
:label-position="labelPosition" ref="elForm"
:model="formData"
:rules="rules"
size="medium"
label-width="100px"
:label-position="labelPosition"
> >
<h2 style="color: #409EFF;background: #e8e8e8;padding: 15px;border-radius: 10px">基本信息 </h2> <h2 style="color: #409eff; background: #e8e8e8; padding: 15px; border-radius: 10px">基本信息</h2>
<div style="padding:0 0 0 10px "> <div style="padding: 0 0 0 10px">
<el-row> <el-row>
<el-col :span="6"> <el-col :span="6">
<el-form-item label-width="120px" label="审批流名称" prop="examineName"> <el-form-item label-width="120px" label="审批流名称" prop="examineName">
<el-input v-model="formData.examineName" placeholder="请输入审批流名称" :maxlength="60" show-word-limit <el-input
clearable v-no-whitespace v-model="formData.examineName"
:style="{width: '86.5%'}" placeholder="请输入审批流名称"
@blur="checkIsExistFlowName" :maxlength="60"
:disabled="edit || (paramsData.type === 'view')" show-word-limit
clearable
v-no-whitespace
:style="{ width: '86.5%' }"
@blur="checkIsExistFlowName"
:disabled="edit || paramsData.type === 'view'"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label-width="120px" label="审批流编号" prop="definitionKey"> <el-form-item label-width="120px" label="审批流编号" prop="definitionKey">
<el-input v-model="formData.definitionKey" placeholder="自动生成" :maxlength="60" show-word-limit <el-input
clearable v-no-whitespace v-model="formData.definitionKey"
:style="{width: '86.5%'}" placeholder="自动生成"
:disabled="true || (paramsData.type === 'view')" :maxlength="60"
show-word-limit
clearable
v-no-whitespace
:style="{ width: '86.5%' }"
:disabled="true || paramsData.type === 'view'"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label-width="120px" label="审批流类型" prop="examineType"> <el-form-item label-width="120px" label="审批流类型" prop="examineType">
<el-select v-model="formData.examineType" placeholder="请选择审批流" clearable :style="{width: '86.5%'}" <el-select
@change="change" @clear="clearPro" v-model="formData.examineType"
:disabled="edit || (paramsData.type === 'view')" placeholder="请选择审批流"
clearable
:style="{ width: '86.5%' }"
@change="change"
@clear="clearPro"
:disabled="edit || paramsData.type === 'view'"
> >
<el-option label="专用审批流" value="1" /> <el-option label="专用审批流" value="1" />
<el-option label="通用审批流" value="2" /> <el-option label="通用审批流" value="2" />
@ -47,34 +67,34 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label="工程" prop="proId" <el-form-item
v-if="formData.examineType === '1' || formData.examineType === '专用审批流'" label="工程"
prop="proId"
v-if="formData.examineType === '1' || formData.examineType === '专用审批流'"
> >
<el-select v-model="formData.proId" placeholder="请选择工程" clearable style="width: 86.5%;" <el-select
@change="changeType" @clear="clearBusiness" v-model="formData.proId"
:disabled="edit || (paramsData.type === 'view')" placeholder="请选择工程"
clearable
style="width: 86.5%"
@change="changeType"
@clear="clearBusiness"
:disabled="edit || paramsData.type === 'view'"
> >
<el-option <el-option v-for="item in proOptions" :key="item.value" :label="item.label" :value="item.value" />
v-for="item in proOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6"> <el-col :span="6">
<el-form-item label-width="120px" label="审批业务类型" prop="businessType"> <el-form-item label-width="120px" label="审批业务类型" prop="businessType">
<el-select v-model="formData.businessType" placeholder="请选择审批业务类型" clearable <el-select
:style="{width: '86.5%'}" v-model="formData.businessType"
:disabled="edit || (paramsData.type === 'view')" placeholder="请选择审批业务类型"
clearable
:style="{ width: '86.5%' }"
:disabled="edit || paramsData.type === 'view'"
> >
<el-option <el-option v-for="item in flowOptions" :key="item.value" :label="item.label" :value="item.value" />
v-for="item in flowOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -82,71 +102,95 @@
<el-row> <el-row>
<el-col :span="18"> <el-col :span="18">
<el-form-item label="审批流说明" prop="examineMark"> <el-form-item label="审批流说明" prop="examineMark">
<el-input type="textarea" v-model="formData.examineMark" maxlength="200" <el-input
:disabled="paramsData.type === 'view'" v-no-whitespace type="textarea"
show-word-limit :style="{width: '96%'}" v-model="formData.examineMark"
maxlength="200"
:disabled="paramsData.type === 'view'"
v-no-whitespace
show-word-limit
:style="{ width: '96%' }"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</div> </div>
<h2 style="color: #409EFF;background: #e8e8e8;padding: 15px;border-radius: 10px">审批流程设置</h2> <h2 style="color: #409eff; background: #e8e8e8; padding: 15px; border-radius: 10px">审批流程设置</h2>
<el-container> <el-container>
<el-main> <el-main>
<el-row v-for="(item, index) in formData.processSetupItems" :key="index"> <el-row v-for="(item, index) in formData.processSetupItems" :key="index">
<div style="padding:0 0 30px 10px "> <div style="padding: 0 0 30px 10px">
<el-row> <el-row>
<el-button type="primary" <el-button type="primary" @click="addAddressOption" v-if="paramsData.type !== 'view'">
@click="addAddressOption" 添加节点
v-if="(paramsData.type !== 'view')"
>添加节点
</el-button> </el-button>
<el-button type="danger" v-if="index !== 0 && (paramsData.type !== 'view')" <el-button
@click="removeLastItem(index)" type="danger"
>删除节点 v-if="index !== 0 && paramsData.type !== 'view'"
@click="removeLastItem(index)"
>
删除节点
</el-button> </el-button>
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="8"> <el-col :span="8">
<el-form-item :label="'审批节点 ' + (index + 1)" <el-form-item
:prop="'processSetupItems.' + index + '.nodeName'" :label="'审批节点 ' + (index + 1)"
:rules="{required: true, message: '请选择审批节点', trigger: 'blur'}" :prop="'processSetupItems.' + index + '.nodeName'"
:rules="{ required: true, message: '请选择审批节点', trigger: 'blur' }"
> >
<el-input v-model="item.nodeName" placeholder="请输入审批节点" :maxlength="60" show-word-limit <el-input
clearable v-no-whitespace v-model="item.nodeName"
:disabled="paramsData.type === 'view'" placeholder="请输入审批节点"
:style="{width: '86.5%'}" :maxlength="60"
show-word-limit
clearable
v-no-whitespace
:disabled="paramsData.type === 'view'"
:style="{ width: '86.5%' }"
></el-input> ></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="审批部门" <el-form-item
:prop="'processSetupItems.' + index + '.deptId'" label="审批部门"
:rules="{required: true, message: '请选择审批部门', trigger: 'blur'}" :prop="'processSetupItems.' + index + '.deptId'"
:rules="{ required: true, message: '请选择审批部门', trigger: 'blur' }"
> >
<Treeselect v-model="item.deptId" :options="deptOptions" :show-count="true" <Treeselect
placeholder="请选择归属部门" :style="{width: '86.5%'}" v-model="item.deptId"
class="treeselectMain" :options="deptOptions"
:disabled="paramsData.type === 'view'" :show-count="true"
:noResultsText="'未找到相关部门!'" placeholder="请选择归属部门"
@select="UserType" :style="{ width: '86.5%' }"
class="treeselectMain"
:disabled="paramsData.type === 'view'"
:noResultsText="'未找到相关部门!'"
@select="UserType"
:append-to-body="true"
/> />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="选择成员" <el-form-item
:prop="'processSetupItems.' + index + '.checkPerson'" label="选择成员"
:rules="{required: true, message: '请选择选择成员', trigger: 'blur'}" :prop="'processSetupItems.' + index + '.checkPerson'"
:rules="{ required: true, message: '请选择选择成员', trigger: 'blur' }"
> >
<el-select v-model="item.checkPerson" placeholder="请选择选择成员" multiple filterable <el-select
:disabled="item.deptId === undefined || paramsData.type === 'view'" v-model="item.checkPerson"
@change="changeUser($event, index)" placeholder="请选择选择成员"
:style="{width: '86.5%'}" multiple
filterable
:disabled="item.deptId === undefined || paramsData.type === 'view'"
@change="changeUser($event, index)"
:style="{ width: '86.5%' }"
> >
<el-option v-for="dict in userOptions" <el-option
:key="dict.value" v-for="dict in userOptions"
:label="dict.label" :key="dict.value"
:value="dict.value" :label="dict.label"
:value="dict.value"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
@ -154,44 +198,56 @@
</el-row> </el-row>
<el-row> <el-row>
<el-col :span="16"> <el-col :span="16">
<el-form-item label="审批方式" <el-form-item
:prop="'processSetupItems.' + index + '.examineTypes'" label="审批方式"
:rules="{required: true, message: '请选择审批方式', trigger: 'blur'}" :prop="'processSetupItems.' + index + '.examineTypes'"
:rules="{ required: true, message: '请选择审批方式', trigger: 'blur' }"
> >
<el-radio-group v-model="item.examineTypes" style="display: flex; flex-direction: column;" <el-radio-group
:disabled="paramsData.type === 'view'" v-model="item.examineTypes"
style="display: flex; flex-direction: column"
:disabled="paramsData.type === 'view'"
> >
<el-radio :label="'0'" :value="0" style="margin-bottom: 20px;"> <el-radio :label="'0'" :value="0" style="margin-bottom: 20px">
依次审批按先后顺序一人审批完成后流转到下一人 依次审批按先后顺序一人审批完成后流转到下一人
</el-radio> </el-radio>
<el-radio :label="'1'" :value="1" style="margin-bottom: 20px;">会签审批需所有人同意</el-radio> <el-radio :label="'1'" :value="1" style="margin-bottom: 20px">会签审批需所有人同意</el-radio>
<el-radio :label="'2'" :value="2" style="margin-bottom: 20px;">或签审批一人同意即可</el-radio> <el-radio :label="'2'" :value="2" style="margin-bottom: 20px">或签审批一人同意即可</el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8" <el-col :span="8">
>
<el-form-item label="抄送人员" v-if="index === formData.processSetupItems.length - 1"> <el-form-item label="抄送人员" v-if="index === formData.processSetupItems.length - 1">
<!-- :prop="'ccPerson'"--> <!-- :prop="'ccPerson'"-->
<!-- :rules="{required: true, message: '请选择抄送成员', trigger: 'blur'}"--> <!-- :rules="{required: true, message: '请选择抄送成员', trigger: 'blur'}"-->
<el-select v-model="formData.ccPerson" placeholder="请选择选择成员" clearable multiple filterable <el-select
:disabled="paramsData.type === 'view'" v-model="formData.ccPerson"
:style="{width: '86.5%'}" placeholder="请选择选择成员"
clearable
multiple
filterable
:disabled="paramsData.type === 'view'"
:style="{ width: '86.5%' }"
> >
<el-option v-for="dict in ccPersonOptions" <el-option
:key="dict.value" v-for="dict in ccPersonOptions"
:label="dict.label" :key="dict.value"
:value="dict.value" :label="dict.label"
:value="dict.value"
></el-option> ></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="是否支持终审" <el-form-item
v-if="index !== formData.processSetupItems.length - 1" label="是否支持终审"
:prop="'processSetupItems.' + index + '.finalJudgment'" v-if="index !== formData.processSetupItems.length - 1"
:rules="{required: true, message: '请选择是否支持终审', trigger: 'blur'}" :prop="'processSetupItems.' + index + '.finalJudgment'"
:rules="{ required: true, message: '请选择是否支持终审', trigger: 'blur' }"
> >
<el-select v-model="item.finalJudgment" placeholder="请选择是否支持终审" :style="{width: '86.5%'}" <el-select
:disabled="paramsData.type === 'view'" v-model="item.finalJudgment"
placeholder="请选择是否支持终审"
:style="{ width: '86.5%' }"
:disabled="paramsData.type === 'view'"
> >
<el-option label="是" value="1" /> <el-option label="是" value="1" />
<el-option label="否" value="0" /> <el-option label="否" value="0" />
@ -207,10 +263,17 @@
</el-button> </el-button>
</el-footer> </el-footer>
</el-main> </el-main>
<el-aside width="25%" style="background: transparent;margin-top: 2%;"> <el-aside width="25%" style="background: transparent; margin-top: 2%">
<div style="display: flex;flex-direction: column;align-items: center"> <div style="display: flex; flex-direction: column; align-items: center">
<div <div
style="border-radius: 10px;padding: 15px;border: 1.5px solid black;width: 50%;text-align: center;font-weight: bold" style="
border-radius: 10px;
padding: 15px;
border: 1.5px solid black;
width: 50%;
text-align: center;
font-weight: bold;
"
> >
开始 开始
</div> </div>
@ -219,11 +282,21 @@
<div class="arrow-down"></div> <div class="arrow-down"></div>
</div> </div>
<div v-for="(item,index) in formData.processSetupItems" :key="index" <div
style="width: 100%;display: flex;flex-direction: column;align-items: center;" v-for="(item, index) in formData.processSetupItems"
:key="index"
style="width: 100%; display: flex; flex-direction: column; align-items: center"
> >
<div <div
style="padding: 8px;border: 1px solid black;width: 50%;text-align: center;height: 50px;font-size: 14px;margin-top: 2px;" style="
padding: 8px;
border: 1px solid black;
width: 50%;
text-align: center;
height: 50px;
font-size: 14px;
margin-top: 2px;
"
> >
{{ item.nodeName.length > 7 ? item.nodeName.substring(0, 7) + '...' : item.nodeName }} {{ item.nodeName.length > 7 ? item.nodeName.substring(0, 7) + '...' : item.nodeName }}
</div> </div>
@ -233,22 +306,24 @@
</div> </div>
</div> </div>
<div <div
style="border-radius: 10px;padding: 15px;border: 1.5px solid black;width: 50%;text-align: center;font-weight: bold" style="
border-radius: 10px;
padding: 15px;
border: 1.5px solid black;
width: 50%;
text-align: center;
font-weight: bold;
"
> >
结束 结束
</div> </div>
</div> </div>
</el-aside> </el-aside>
</el-container> </el-container>
</el-form> </el-form>
</div> </div>
</template> </template>
<script> <script>
import { getProName, personnelDropDownBox, queryTheApprovalServiceType } from '@/api/tool/select' import { getProName, personnelDropDownBox, queryTheApprovalServiceType } from '@/api/tool/select'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
@ -281,7 +356,6 @@ export default {
checkPerson: [], checkPerson: [],
examineTypes: '', examineTypes: '',
finalJudgment: '0', finalJudgment: '0',
}, },
], ],
}, },
@ -292,18 +366,10 @@ export default {
userOptions: [], userOptions: [],
ccPersonOptions: [], ccPersonOptions: [],
rules: { rules: {
examineName: [ examineName: [{ required: true, message: '请输入审批流名称', trigger: 'blur' }],
{ required: true, message: '请输入审批流名称', trigger: 'blur' }, examineType: [{ required: true, message: '请选择审批流类型', trigger: 'change' }],
], businessType: [{ required: true, message: '请选择审批业务类型', trigger: 'change' }],
examineType: [ proId: [{ required: true, message: '请选择工程', trigger: 'change' }],
{ required: true, message: '请选择审批流类型', trigger: 'change' },
],
businessType: [
{ required: true, message: '请选择审批业务类型', trigger: 'change' },
],
proId: [
{ required: true, message: '请选择工程', trigger: 'change' },
],
// ccPerson: [ // ccPerson: [
// {required: true, message: '', trigger: 'change'} // {required: true, message: '', trigger: 'change'}
// ] // ]
@ -322,7 +388,6 @@ export default {
this.paramsData = JSON.parse(decryptCBC(params)) this.paramsData = JSON.parse(decryptCBC(params))
if (this.paramsData.type === 'view') { if (this.paramsData.type === 'view') {
// //
} }
let id = this.paramsData.id let id = this.paramsData.id
let version = this.paramsData.version let version = this.paramsData.version
@ -337,8 +402,8 @@ export default {
if (this.isChangingUser) return if (this.isChangingUser) return
this.isChangingUser = true this.isChangingUser = true
// Check if the selected value exists in any of the checkPerson arrays // Check if the selected value exists in any of the checkPerson arrays
const isDuplicate = this.formData.processSetupItems.some((item, idx) => const isDuplicate = this.formData.processSetupItems.some(
idx !== index && item.checkPerson.includes(e[e.length - 1]), (item, idx) => idx !== index && item.checkPerson.includes(e[e.length - 1])
) )
if (isDuplicate) { if (isDuplicate) {
@ -470,24 +535,31 @@ export default {
}, },
// //
async submitConsForm() { async submitConsForm() {
let text = '<span style="font-size: 14px;font-weight: bold">是否提交审批流程配置?</span>' + let text =
'<span style="font-size: 14px;font-weight: bold">是否提交审批流程配置?</span>' +
'<br/><span style="font-size: 12px">提交完成,会重置当前审核流!!!</span>' '<br/><span style="font-size: 12px">提交完成,会重置当前审核流!!!</span>'
if (!this.edit) { if (!this.edit) {
text = '<span style="font-size: 14px;font-weight: bold">是否提交审批流程配置?</span>' text = '<span style="font-size: 14px;font-weight: bold">是否提交审批流程配置?</span>'
} }
this.$modal.confirm(text).then(function() { this.$modal
return true .confirm(text)
}).then(() => { .then(function () {
this.submitForm() return true
}).catch(() => { })
this.loading = false .then(() => {
}) this.submitForm()
})
.catch(() => {
this.loading = false
})
}, },
submitForm() { submitForm() {
console.log('formData:', JSON.stringify(this.formData.processSetupItems[0].checkPerson)) console.log('formData:', JSON.stringify(this.formData.processSetupItems[0].checkPerson))
//processSetupItemscheckPerson null //processSetupItemscheckPerson null
this.formData.processSetupItems.forEach(item => { this.formData.processSetupItems.forEach(item => {
item.checkPerson = item.checkPerson.filter(person => person !== null && person !== undefined && person !== 'null') item.checkPerson = item.checkPerson.filter(
person => person !== null && person !== undefined && person !== 'null'
)
}) })
console.log('formData:', JSON.stringify(this.formData.processSetupItems[0].checkPerson)) console.log('formData:', JSON.stringify(this.formData.processSetupItems[0].checkPerson))
// return // return
@ -509,27 +581,29 @@ export default {
if (id !== '0') { if (id !== '0') {
// TODO // TODO
this.formData.examineId = id this.formData.examineId = id
updateExamine(this.formData).then(response => { updateExamine(this.formData)
this.$modal.msgSuccess('修改成功') .then(response => {
this.$tab.closePage() this.$modal.msgSuccess('修改成功')
}).catch(error => { this.$tab.closePage()
this.$modal.msgError('修改失败') })
}) .catch(error => {
this.$modal.msgError('修改失败')
})
} else { } else {
// TODO // TODO
addExamine(this.formData).then(response => { addExamine(this.formData)
if (response.msg === '该审核流已存在') { .then(response => {
this.$modal.msgError('该审核流已存在') if (response.msg === '该审核流已存在') {
return this.$modal.msgError('该审核流已存在')
} return
this.$modal.msgSuccess('新增成功') }
this.$tab.closePage() this.$modal.msgSuccess('新增成功')
}).catch(error => { this.$tab.closePage()
this.$modal.msgError('新增失败') })
}) .catch(error => {
this.$modal.msgError('新增失败')
})
} }
} }
}) })
}, },
@ -576,12 +650,11 @@ export default {
border-right: 5px solid transparent; border-right: 5px solid transparent;
border-top: 10px solid black; border-top: 10px solid black;
} }
.treeselectMain .vue-treeselect__menu{ .treeselectMain .vue-treeselect__menu {
max-height: 200px!important; // max-height: 200px !important;
z-index: 9999!important; z-index: 2147483690 !important;
} }
::v-deep .vue-treeselect__menu{ ::v-deep .vue-treeselect__menu {
max-height: 200px!important; // max-height: 200px !important;
} }
</style> </style>

View File

@ -38,8 +38,8 @@ module.exports = {
// target: `http://localhost:18080`, // target: `http://localhost:18080`,
// target: 'http://192.168.0.176:18080', // target: 'http://192.168.0.176:18080',
// target: 'http://192.168.0.58:19090', // 杰 // target: 'http://192.168.0.58:19090', // 杰
// target: 'http://192.168.0.14:18080', // 测试 target: 'http://192.168.0.14:18080', // 测试环境
target: 'http://218.21.27.6:1999/prod-api', // 测试 // target: 'http://218.21.27.6:1999/prod-api', // 生产环境
// target: 'http://192.168.0.38:18080', // 郝 // target: 'http://192.168.0.38:18080', // 郝
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {