|
@@ -1,14 +1,16 @@
|
|
<template>
|
|
<template>
|
|
<div class="process">
|
|
<div class="process">
|
|
- <van-nav-bar
|
|
|
|
- title="流程审批"
|
|
|
|
- left-text=""
|
|
|
|
- left-arrow
|
|
|
|
- @click-left="onClickLeft"
|
|
|
|
- >
|
|
|
|
|
|
+ <van-nav-bar title="流程审批" left-text="" left-arrow @click-left="onClickLeft">
|
|
</van-nav-bar>
|
|
</van-nav-bar>
|
|
- <component ref="makeDom" :is='componentObj[route.query.flowKey].component'></component>
|
|
|
|
- <div class="card">
|
|
|
|
|
|
+ <div>
|
|
|
|
+ <component ref="makeDom" :queryData="queryData.data" :is="
|
|
|
|
+ componentObj[route.query.flowKey]
|
|
|
|
+ ? componentObj[route.query.flowKey].component
|
|
|
|
+ : SendSubscribe
|
|
|
|
+ "></component>
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <!-- <div class="card">
|
|
<div class="common-title border-btm">申购信息</div>
|
|
<div class="common-title border-btm">申购信息</div>
|
|
<div class="common-form-text">
|
|
<div class="common-form-text">
|
|
<div class="common-form-text-item">
|
|
<div class="common-form-text-item">
|
|
@@ -35,113 +37,63 @@
|
|
<div class="common-form-text-item-label">申购类型</div>
|
|
<div class="common-form-text-item-label">申购类型</div>
|
|
<div class="common-form-text-item-value">物料</div>
|
|
<div class="common-form-text-item-value">物料</div>
|
|
</div>
|
|
</div>
|
|
- <div class="common-form-text-item textarea">
|
|
|
|
- <div class="common-form-text-item-label">申购说明</div>
|
|
|
|
- <van-field
|
|
|
|
- v-model="message"
|
|
|
|
- rows="3"
|
|
|
|
- autosize
|
|
|
|
- type="textarea"
|
|
|
|
- maxlength="400"
|
|
|
|
- placeholder="请输入申购说明"
|
|
|
|
- show-word-limit
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
|
|
+
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
- <div class="card">
|
|
|
|
- <div class="common-title">申购明细</div>
|
|
|
|
- <div class="common-mobile-table">
|
|
|
|
- <table>
|
|
|
|
- <thead>
|
|
|
|
- <tr>
|
|
|
|
- <th>物料编码</th>
|
|
|
|
- <th>物料名称</th>
|
|
|
|
- <th>规格型号</th>
|
|
|
|
- <th>规格型号</th>
|
|
|
|
- <th>规格型号</th>
|
|
|
|
- <th>规格型号</th>
|
|
|
|
- <th>规格型号</th>
|
|
|
|
- </tr>
|
|
|
|
- </thead>
|
|
|
|
- <tbody>
|
|
|
|
- <tr>
|
|
|
|
- <td>1000000001</td>
|
|
|
|
- <td>电脑</td>
|
|
|
|
- <td>台</td>
|
|
|
|
- </tr>
|
|
|
|
- <tr>
|
|
|
|
- <td>1000000002</td>
|
|
|
|
- <td>显示器</td>
|
|
|
|
- <td>台</td>
|
|
|
|
- </tr>
|
|
|
|
- </tbody>
|
|
|
|
- </table>
|
|
|
|
|
|
+ </div> -->
|
|
|
|
+
|
|
|
|
+ <div class="btn-warp" :class="footerMoreType ? 'open-more' : ''">
|
|
|
|
+ <div class="more-btn" @click="footerMoreType = true">
|
|
|
|
+ 更多 <van-icon name="arrow-up" />
|
|
|
|
+ </div>
|
|
|
|
+ <div class="foot-btn-warp">
|
|
|
|
+ <div class="agree-btn" @click="handleSubmit(1)">同意</div>
|
|
|
|
+ <div class="next-btn" @click="nextFn">下一步</div>
|
|
</div>
|
|
</div>
|
|
- <div class="more-btn">查看更多</div>
|
|
|
|
</div>
|
|
</div>
|
|
- <div class="card">
|
|
|
|
- <div class="common-title">审批流程</div>
|
|
|
|
- <van-steps
|
|
|
|
- direction="vertical"
|
|
|
|
- :active="stepsNum"
|
|
|
|
- class="common-steps"
|
|
|
|
- >
|
|
|
|
- <van-step v-for="(i, index) in recordList" :key="i.nodeId">
|
|
|
|
- <div class="label">
|
|
|
|
- <span class="name">{{ i.processedUser }}</span>
|
|
|
|
- <span class="tip">{{ i.nodeName }}</span>
|
|
|
|
- <span
|
|
|
|
- class="state"
|
|
|
|
- :class="
|
|
|
|
- index == stepsNum
|
|
|
|
- ? 'cl-yl'
|
|
|
|
- : index < stepsNum
|
|
|
|
|
|
+ <van-action-sheet v-model:show="footerMoreType" title="审批记录" class="more-modal">
|
|
|
|
+ <div class="card">
|
|
|
|
+ <van-steps direction="vertical" :active="stepsNum" class="common-steps">
|
|
|
|
+ <van-step v-for="(i, index) in recordList" :key="i.nodeId">
|
|
|
|
+ <div class="label">
|
|
|
|
+ <span class="name">{{ i.processedUser }}</span>
|
|
|
|
+ <span class="tip">{{ i.nodeName }}</span>
|
|
|
|
+ <span class="state" :class="index == stepsNum
|
|
|
|
+ ? 'cl-yl'
|
|
|
|
+ : index < stepsNum
|
|
? 'cl-blue'
|
|
? 'cl-blue'
|
|
: ''
|
|
: ''
|
|
- "
|
|
|
|
- >
|
|
|
|
- {{ i.nodeName }}
|
|
|
|
- </span>
|
|
|
|
- </div>
|
|
|
|
- <div class="content">审批意见:{{ i.remark }}</div>
|
|
|
|
- <p>{{ i.processedDate }}</p>
|
|
|
|
- </van-step>
|
|
|
|
- </van-steps>
|
|
|
|
- <div class="common-form-text">
|
|
|
|
- <div class="common-form-text-item textarea">
|
|
|
|
- <van-field
|
|
|
|
- v-model="message"
|
|
|
|
- rows="3"
|
|
|
|
- autosize
|
|
|
|
- type="textarea"
|
|
|
|
- maxlength="400"
|
|
|
|
- placeholder="请输入审批意见"
|
|
|
|
- show-word-limit
|
|
|
|
- />
|
|
|
|
- </div>
|
|
|
|
- <div class="btn-warp">
|
|
|
|
- <van-button
|
|
|
|
- type="primary"
|
|
|
|
- v-if="approvalRecordData.buttonInfoList.length == 0"
|
|
|
|
- >同意</van-button
|
|
|
|
- >
|
|
|
|
- <van-button
|
|
|
|
- type="primary"
|
|
|
|
- v-else
|
|
|
|
- v-for="i in approvalRecordData.buttonInfoList"
|
|
|
|
- :key="i.type"
|
|
|
|
- >{{ i.name }}</van-button
|
|
|
|
- >
|
|
|
|
|
|
+ ">
|
|
|
|
+ {{ i.nodeName }}
|
|
|
|
+ </span>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="content">审批意见:{{ i.remark }}</div>
|
|
|
|
+ <p>{{ i.processedDate }}</p>
|
|
|
|
+ </van-step>
|
|
|
|
+ </van-steps>
|
|
|
|
+ </div>
|
|
|
|
+ <div style="padding: 0 12px">
|
|
|
|
+ <van-field v-model="flowForm.remark" rows="3" autosize type="textarea" maxlength="400" placeholder="请输入审批意见"
|
|
|
|
+ show-word-limit style="backround: #f1f1f1" />
|
|
|
|
+ </div>
|
|
|
|
+ <div class="load-btn-box">
|
|
|
|
+ <van-button size="small" type="primary" plain round v-for="i in approvalRecordData.buttonInfoList"
|
|
|
|
+ :key="i.type" v-show="i.type != 1" @click="handleSubmit(i.type)">{{ i.name }}
|
|
|
|
+ </van-button>
|
|
|
|
+ </div>
|
|
|
|
+ <div class="content">
|
|
|
|
+ <div class="foot-btn-warp">
|
|
|
|
+ <div class="agree-btn" @click="handleSubmit(1)">同意</div>
|
|
|
|
+ <div class="next-btn" @click="nextFn">下一步</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
- </div>
|
|
|
|
|
|
+ </van-action-sheet>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script setup>
|
|
<script setup>
|
|
import { ref, getCurrentInstance, onMounted, reactive } from 'vue'
|
|
import { ref, getCurrentInstance, onMounted, reactive } from 'vue'
|
|
import { useRoute } from 'vue-router'
|
|
import { useRoute } from 'vue-router'
|
|
import SendSubscribe from './components/SendSubscribe'
|
|
import SendSubscribe from './components/SendSubscribe'
|
|
|
|
+import { showSuccessToast, showFailToast } from 'vant'
|
|
const route = useRoute()
|
|
const route = useRoute()
|
|
const proxy = getCurrentInstance().proxy
|
|
const proxy = getCurrentInstance().proxy
|
|
const onClickLeft = () => proxy.$router.push('/main/working')
|
|
const onClickLeft = () => proxy.$router.push('/main/working')
|
|
@@ -149,10 +101,12 @@ const message = ref('')
|
|
const onClickRight = () => {
|
|
const onClickRight = () => {
|
|
proxy.$router.push('/main/working')
|
|
proxy.$router.push('/main/working')
|
|
}
|
|
}
|
|
|
|
+const makeDom = ref(null)
|
|
let stepsNum = ref(0)
|
|
let stepsNum = ref(0)
|
|
let queryData = reactive({
|
|
let queryData = reactive({
|
|
data: {},
|
|
data: {},
|
|
})
|
|
})
|
|
|
|
+let footerMoreType = ref(false)
|
|
const flowForm = reactive({
|
|
const flowForm = reactive({
|
|
flowKey: '',
|
|
flowKey: '',
|
|
tenantType: '',
|
|
tenantType: '',
|
|
@@ -165,8 +119,8 @@ const approvalRecordData = ref({
|
|
buttonInfoList: [],
|
|
buttonInfoList: [],
|
|
})
|
|
})
|
|
|
|
|
|
-const getAuxiliaryData = (data)=>{
|
|
|
|
- auxiliaryData.value=data
|
|
|
|
|
|
+const getAuxiliaryData = (data) => {
|
|
|
|
+ auxiliaryData.value = data
|
|
}
|
|
}
|
|
|
|
|
|
let componentObj = ref({
|
|
let componentObj = ref({
|
|
@@ -177,21 +131,24 @@ let componentObj = ref({
|
|
},
|
|
},
|
|
})
|
|
})
|
|
|
|
|
|
-let dialogVisible = ref(false);
|
|
|
|
|
|
+let dialogVisible = ref(false)
|
|
//判断是否有下一节点处理人
|
|
//判断是否有下一节点处理人
|
|
const handleResult = (res) => {
|
|
const handleResult = (res) => {
|
|
- if (res !== null && res.success) {
|
|
|
|
- skipPage();
|
|
|
|
- } else {
|
|
|
|
- dialogVisible.value = true;
|
|
|
|
- nextHandleUser.value = res.userList;
|
|
|
|
- }
|
|
|
|
-};
|
|
|
|
|
|
+ if (res !== null && res.success) {
|
|
|
|
+ skipPage()
|
|
|
|
+ } else {
|
|
|
|
+ dialogVisible.value = true
|
|
|
|
+ nextHandleUser.value = res.userList
|
|
|
|
+ }
|
|
|
|
+}
|
|
const skipPage = () => {
|
|
const skipPage = () => {
|
|
- router.replace({
|
|
|
|
- path: route.query.processType === 10 ? "/main/processApproval" : componentObj[route.query.flowKey].backUrl,
|
|
|
|
- });
|
|
|
|
-};
|
|
|
|
|
|
+ router.replace({
|
|
|
|
+ path:
|
|
|
|
+ route.query.processType === 10
|
|
|
|
+ ? '/main/processApproval'
|
|
|
|
+ : componentObj[route.query.flowKey].backUrl,
|
|
|
|
+ })
|
|
|
|
+}
|
|
|
|
|
|
const handleSelectUser = () => {
|
|
const handleSelectUser = () => {
|
|
if (!flowForm.handleUserId) {
|
|
if (!flowForm.handleUserId) {
|
|
@@ -203,44 +160,41 @@ const handleSelectUser = () => {
|
|
handleSubmit()
|
|
handleSubmit()
|
|
}
|
|
}
|
|
const handleSubmit = async (_type) => {
|
|
const handleSubmit = async (_type) => {
|
|
- const flag = await makeDom.value.handleSubmit()
|
|
|
|
- if (flag) {
|
|
|
|
- flowFormDom.value.validate((valid) => {
|
|
|
|
- if (
|
|
|
|
- route.query.processType == 10 ||
|
|
|
|
- route.query.processType == 30
|
|
|
|
- ) {
|
|
|
|
- proxy
|
|
|
|
- .post('/flowProcess/jump', {
|
|
|
|
- ...flowForm,
|
|
|
|
- data,
|
|
|
|
- handleType: _type,
|
|
|
|
- version: route.query.version,
|
|
|
|
- flowId: route.query.id,
|
|
|
|
- })
|
|
|
|
- .then((res) => {
|
|
|
|
- handleResult(res)
|
|
|
|
- })
|
|
|
|
- if (_type && _type == 1) {
|
|
|
|
- proxy
|
|
|
|
- .post('/flowExample/setStartData', {
|
|
|
|
- exampleId: route.query.id,
|
|
|
|
- startDate: data,
|
|
|
|
- })
|
|
|
|
- .then()
|
|
|
|
- }
|
|
|
|
- return
|
|
|
|
- } else {
|
|
|
|
|
|
+ console.log(makeDom)
|
|
|
|
+ const childrenData = await makeDom.value.handleSubmit()
|
|
|
|
+ console.log(childrenData, '子组件回来的数据')
|
|
|
|
+ if (childrenData) {
|
|
|
|
+ if (route.query.processType == 10 || route.query.processType == 30) {
|
|
|
|
+ proxy
|
|
|
|
+ .post('/flowProcess/jump', {
|
|
|
|
+ ...flowForm,
|
|
|
|
+ childrenData,
|
|
|
|
+ handleType: _type,
|
|
|
|
+ version: route.query.version,
|
|
|
|
+ flowId: route.query.id,
|
|
|
|
+ })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ handleResult(res)
|
|
|
|
+ })
|
|
|
|
+ if (_type && _type == 1) {
|
|
proxy
|
|
proxy
|
|
- .post('/flowProcess/initiate', {
|
|
|
|
- ...flowForm,
|
|
|
|
- data,
|
|
|
|
- })
|
|
|
|
- .then((res) => {
|
|
|
|
- handleResult(res)
|
|
|
|
|
|
+ .post('/flowExample/setStartData', {
|
|
|
|
+ exampleId: route.query.id,
|
|
|
|
+ startDate: childrenData,
|
|
})
|
|
})
|
|
|
|
+ .then()
|
|
}
|
|
}
|
|
- })
|
|
|
|
|
|
+ return
|
|
|
|
+ } else {
|
|
|
|
+ proxy
|
|
|
|
+ .post('/flowProcess/initiate', {
|
|
|
|
+ ...flowForm,
|
|
|
|
+ childrenData,
|
|
|
|
+ })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ handleResult(res)
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -275,6 +229,9 @@ const getRecords = (_id) => {
|
|
}
|
|
}
|
|
onMounted(async () => {
|
|
onMounted(async () => {
|
|
//processType 10 为修改 20为查看 30回退发起 无为发起
|
|
//processType 10 为修改 20为查看 30回退发起 无为发起
|
|
|
|
+ if (!componentObj.value[route.query.flowKey]) {
|
|
|
|
+ return showSuccessToast('代码未配置此流程!')
|
|
|
|
+ }
|
|
if (
|
|
if (
|
|
route.query.processType == 10 ||
|
|
route.query.processType == 10 ||
|
|
route.query.processType == 20 ||
|
|
route.query.processType == 20 ||
|
|
@@ -283,7 +240,7 @@ onMounted(async () => {
|
|
await proxy
|
|
await proxy
|
|
.post('/flowProcess/getStartData', { flowId: route.query.id })
|
|
.post('/flowProcess/getStartData', { flowId: route.query.id })
|
|
.then((res) => {
|
|
.then((res) => {
|
|
- queryData.data = { ...res }
|
|
|
|
|
|
+ queryData.data = { ...res.data }
|
|
})
|
|
})
|
|
} else {
|
|
} else {
|
|
queryData.data = { ...route.query }
|
|
queryData.data = { ...route.query }
|
|
@@ -292,23 +249,99 @@ onMounted(async () => {
|
|
getRecords(route.query.id)
|
|
getRecords(route.query.id)
|
|
})
|
|
})
|
|
</script>
|
|
</script>
|
|
|
|
+<style>
|
|
|
|
+.van-step--vertical .van-step__circle-container {
|
|
|
|
+ top: 25px;
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+.van-step--vertical .van-step__line {
|
|
|
|
+ top: 23px;
|
|
|
|
+}
|
|
|
|
+</style>
|
|
<style lang="scss">
|
|
<style lang="scss">
|
|
.process {
|
|
.process {
|
|
- padding-bottom: 60px;
|
|
|
|
- .btn-warp {
|
|
|
|
|
|
+ .more-modal {
|
|
|
|
+ .van-field {
|
|
|
|
+ border: none;
|
|
|
|
+ background: #f1f1f1;
|
|
|
|
+ border-radius: 5px;
|
|
|
|
+ padding: 5px 10px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .load-btn-box {
|
|
|
|
+ height: 50px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ padding: 9px;
|
|
|
|
+ box-sizing: border-box;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .foot-btn-warp {
|
|
|
|
+ height: 50px;
|
|
|
|
+ line-height: 50px;
|
|
|
|
+ text-align: center;
|
|
display: flex;
|
|
display: flex;
|
|
- justify-content: space-between;
|
|
|
|
|
|
+ width: 100vw;
|
|
|
|
+ font-size: 16px;
|
|
|
|
+
|
|
|
|
+ .agree-btn {
|
|
|
|
+ flex: 1;
|
|
|
|
+ background: #eaf0ff;
|
|
|
|
+ color: #0084ff;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .next-btn {
|
|
|
|
+ flex: 1;
|
|
|
|
+ background: #0084ff;
|
|
|
|
+ color: #fff;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .btn-warp {
|
|
|
|
+ position: fixed;
|
|
|
|
+ bottom: 0;
|
|
|
|
+ left: 0;
|
|
|
|
+ right: 0;
|
|
|
|
+ margin: 0;
|
|
|
|
+ z-index: 2;
|
|
|
|
|
|
- margin: 20px 0 10px;
|
|
|
|
button {
|
|
button {
|
|
width: 48%;
|
|
width: 48%;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ .content {
|
|
|
|
+ height: 0;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ transition: all 0.3s ease;
|
|
|
|
+ background: #fff;
|
|
|
|
+ padding: 0 12px;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ .more-btn {
|
|
|
|
+ width: 100%;
|
|
|
|
+ background: #fff;
|
|
|
|
+ color: #999999;
|
|
|
|
+ font-size: 14px;
|
|
|
|
+ text-align: center;
|
|
|
|
+ height: 50px;
|
|
|
|
+ line-height: 50px;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ .open-more {
|
|
|
|
+ .content {
|
|
|
|
+ height: 170px;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ padding-bottom: 60px;
|
|
|
|
+
|
|
.card {
|
|
.card {
|
|
background: #fff;
|
|
background: #fff;
|
|
padding: 0 12px;
|
|
padding: 0 12px;
|
|
margin-top: 10px;
|
|
margin-top: 10px;
|
|
}
|
|
}
|
|
|
|
+
|
|
.textarea {
|
|
.textarea {
|
|
.van-field {
|
|
.van-field {
|
|
border: none;
|
|
border: none;
|
|
@@ -317,6 +350,7 @@ onMounted(async () => {
|
|
padding: 5px 10px;
|
|
padding: 5px 10px;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
.more-btn {
|
|
.more-btn {
|
|
height: 60px;
|
|
height: 60px;
|
|
line-height: 60px;
|
|
line-height: 60px;
|