|
@@ -97,10 +97,55 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</van-action-sheet>
|
|
|
+
|
|
|
+ <!-- <van-dialog v-model:show="dialogVisible" :title="dialogTitle" show-cancel-button @cancel="(val)=>handleNextClose(val)" @confirm="handleSelectUser"
|
|
|
+ @close="(val)=>handleNextClose(val)"> -->
|
|
|
+
|
|
|
+ <!-- </van-dialog> -->
|
|
|
+
|
|
|
+ <van-popup v-model:show="dialogVisible" position="bottom" :style="{ height: '70vh' }" :close-on-click-overlay="false">
|
|
|
+ <div style="height:55vh;overflow:auto;margin-top:20px">
|
|
|
+ <div v-if="nextHandleUser && nextHandleUser.length>0">
|
|
|
+ <div>
|
|
|
+ <van-picker v-for="(node,index) in nextHandleUser" :key="node.nodeId" :title="node.nodeName+'已选择:'+node.handleUserName"
|
|
|
+ :columns="node.userList" :columns-field-names="{text: 'nickName',
|
|
|
+ value: 'userId',}" cancel-button-text=" " @confirm="(val)=>onConfirm(val,node,index)">
|
|
|
+ <template #title>
|
|
|
+ <div>
|
|
|
+ <div>
|
|
|
+ 节点:{{node.nodeName}}
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ 已选择:<span style="color:red">{{node.handleUserName}}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </van-picker>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div v-if="flowDefinitionNodeList && flowDefinitionNodeList.length>0">
|
|
|
+ <van-picker :title="'退回节点'" :columns="flowDefinitionNodeList" :columns-field-names="{text: 'nodeName',
|
|
|
+ value: 'id',}" cancel-button-text=" " @confirm="(val)=>onConfirmOne(val)">
|
|
|
+ <template #title>
|
|
|
+ <div>
|
|
|
+ <div>
|
|
|
+ 退回节点:<span style="color:red">{{flowForm.handleNodeName}}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </van-picker>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div style="text-align:center">
|
|
|
+ <van-button type="default" @click="handleNextClose()" style="margin-right:20px"> 取消</van-button>
|
|
|
+ <van-button type="primary" @click="handleSelectUser()">提交</van-button>
|
|
|
+ </div>
|
|
|
+ </van-popup>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script setup>
|
|
|
-import { ref, getCurrentInstance, onMounted, reactive } from "vue";
|
|
|
+import { ref, getCurrentInstance, onMounted, reactive, watch } from "vue";
|
|
|
import { useRoute } from "vue-router";
|
|
|
import SendSubscribe from "./components/SendSubscribe";
|
|
|
import SendFunds from "./components/SendFunds";
|
|
@@ -121,6 +166,8 @@ import ActivityPriceInventory from "./components/ActivityPriceInventory";
|
|
|
import InvoicingApplication from "./components/InvoicingApplication";
|
|
|
import InvoiceTaxDeduction from "./components/InvoiceTaxDeduction";
|
|
|
import PersonalInvoice from "./components/PersonalInvoice";
|
|
|
+import Become from "./components/Become";
|
|
|
+import ChangeSalary from "./components/ChangeSalary";
|
|
|
|
|
|
import SendPurchase from "./components/SendPurchase";
|
|
|
import SendPurchasePayment from "./components/SendPurchasePayment";
|
|
@@ -284,17 +331,88 @@ let componentObj = ref({
|
|
|
backUrl: "/main/working",
|
|
|
tabsNum: 0,
|
|
|
},
|
|
|
+ promotion_apply_flow: {
|
|
|
+ title: "员工转正申请发起流程",
|
|
|
+ component: Become,
|
|
|
+ backUrl: "/main/working",
|
|
|
+ tabsNum: 0,
|
|
|
+ },
|
|
|
+ adjust_salary_apply_flow: {
|
|
|
+ title: "员工调薪申请发起流程",
|
|
|
+ component: ChangeSalary,
|
|
|
+ backUrl: "/main/working",
|
|
|
+ tabsNum: 0,
|
|
|
+ },
|
|
|
});
|
|
|
|
|
|
let dialogVisible = ref(false);
|
|
|
+const flowDefinitionNodeList = ref([]);
|
|
|
+const nextHandleUser = ref([]);
|
|
|
+const dialogTitle = ref("");
|
|
|
//判断是否有下一节点处理人
|
|
|
const handleResult = (res) => {
|
|
|
- if (res !== null && res.success) {
|
|
|
+ if (res.success) {
|
|
|
skipPage();
|
|
|
- } else {
|
|
|
+ } else if (res.selectUserList && res.selectUserList.length > 0) {
|
|
|
+ flowDefinitionNodeList.value = [];
|
|
|
+ dialogTitle.value = "下一处理人";
|
|
|
+ dialogVisible.value = true;
|
|
|
+ nextHandleUser.value = res.selectUserList;
|
|
|
+ } else if (
|
|
|
+ res.flowDefinitionNodeList &&
|
|
|
+ res.flowDefinitionNodeList.length > 0
|
|
|
+ ) {
|
|
|
+ nextHandleUser.value = [];
|
|
|
+ dialogTitle.value = "退回到指定节点";
|
|
|
dialogVisible.value = true;
|
|
|
- nextHandleUser.value = res.userList;
|
|
|
+ flowDefinitionNodeList.value = res.flowDefinitionNodeList;
|
|
|
+ } else {
|
|
|
+ return showFailToast("请联系管理员!");
|
|
|
}
|
|
|
+ // if (flowForm.flowKey == "medical_insurance_flow") {
|
|
|
+ // makeDom.value.dataRollback();
|
|
|
+ // }
|
|
|
+};
|
|
|
+
|
|
|
+const onConfirm = ({ selectedValues }, node, index) => {
|
|
|
+ let value = selectedValues[0];
|
|
|
+ const current = node.userList.find((x) => x.userId == value);
|
|
|
+ nextHandleUser.value[index].handleUserId = value;
|
|
|
+ node.handleUserName = current.nickName;
|
|
|
+};
|
|
|
+
|
|
|
+const onConfirmOne = ({ selectedValues }) => {
|
|
|
+ let value = selectedValues[0];
|
|
|
+ const current = flowDefinitionNodeList.value.find((x) => x.id == value);
|
|
|
+ flowForm.handleNodeId = value;
|
|
|
+ flowForm.handleNodeName = current.nodeName;
|
|
|
+};
|
|
|
+
|
|
|
+const handleType = ref(null);
|
|
|
+const handleNextClose = () => {
|
|
|
+ for (let i = 0; i < nextHandleUser.value.length; i++) {
|
|
|
+ const node = nextHandleUser.value[i];
|
|
|
+ node.handleUserId = "";
|
|
|
+ }
|
|
|
+ nextHandleUser.value = [];
|
|
|
+ dialogVisible.value = false;
|
|
|
+};
|
|
|
+const handleSelectUser = () => {
|
|
|
+ if (nextHandleUser.value && nextHandleUser.value.length > 0) {
|
|
|
+ for (let i = 0; i < nextHandleUser.value.length; i++) {
|
|
|
+ const node = nextHandleUser.value[i];
|
|
|
+ if (!node.handleUserId) {
|
|
|
+ return showFailToast("请选择下一节点处理人!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (flowDefinitionNodeList.value && flowDefinitionNodeList.value.length > 0) {
|
|
|
+ if (!flowForm.handleNodeId) {
|
|
|
+ return showFailToast("请选择要退回的节点!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ handleSubmit(handleType.value);
|
|
|
};
|
|
|
const skipPage = () => {
|
|
|
onClickLeft();
|
|
@@ -306,16 +424,8 @@ const skipPage = () => {
|
|
|
// })
|
|
|
};
|
|
|
|
|
|
-const handleSelectUser = () => {
|
|
|
- if (!flowForm.handleUserId) {
|
|
|
- return ElMessage({
|
|
|
- message: "请选择下一节点处理人!",
|
|
|
- type: "info",
|
|
|
- });
|
|
|
- }
|
|
|
- handleSubmit();
|
|
|
-};
|
|
|
const handleSubmit = async (_type) => {
|
|
|
+ handleType.value = _type ? _type : undefined;
|
|
|
const childrenData = await makeDom.value.handleSubmit();
|
|
|
if (childrenData) {
|
|
|
if (route.query.processType == 10 || route.query.processType == 30) {
|
|
@@ -326,19 +436,20 @@ const handleSubmit = async (_type) => {
|
|
|
handleType: _type,
|
|
|
version: route.query.version,
|
|
|
flowId: route.query.id,
|
|
|
+ selectUserList: nextHandleUser.value,
|
|
|
})
|
|
|
.then((res) => {
|
|
|
- // handleResult(res.data)
|
|
|
- proxy.$router.go(-1);
|
|
|
+ handleResult(res.data);
|
|
|
+ // proxy.$router.go(-1);
|
|
|
});
|
|
|
- if (_type && _type == 1) {
|
|
|
- proxy
|
|
|
- .post("/flowExample/setStartData", {
|
|
|
- exampleId: route.query.id,
|
|
|
- startData: childrenData,
|
|
|
- })
|
|
|
- .then();
|
|
|
- }
|
|
|
+ // if (_type && _type == 1) {
|
|
|
+ // proxy
|
|
|
+ // .post("/flowExample/setStartData", {
|
|
|
+ // exampleId: route.query.id,
|
|
|
+ // startData: childrenData,
|
|
|
+ // })
|
|
|
+ // .then();
|
|
|
+ // }
|
|
|
return;
|
|
|
} else {
|
|
|
proxy
|