Просмотр исходного кода

流程回退不可修改bug解决

cz 1 год назад
Родитель
Сommit
f43918a121

+ 91 - 35
src/components/WDLY/process/SendPurchaseWDLY.vue

@@ -5,19 +5,27 @@
       :rules="rules"
       ref="formDom"
       label-position="top"
-      :disabled="props.queryData.purchaseDetailList ? true : false"
+      :disabled="judgeStatus()"
     >
       <div class="_t">基础信息</div>
       <el-row :gutter="10">
         <el-col :span="6">
           <el-form-item label="采购部门" prop="deptName">
-            <el-input v-model="formData.data.deptName" placeholder="请输入">
+            <el-input
+              v-model="formData.data.deptName"
+              placeholder="请输入"
+              disabled
+            >
             </el-input>
           </el-form-item>
         </el-col>
         <el-col :span="6">
           <el-form-item label="采购人" prop="purchaseName">
-            <el-input v-model="formData.data.purchaseName" placeholder="请输入">
+            <el-input
+              v-model="formData.data.purchaseName"
+              placeholder="请输入"
+              disabled
+            >
             </el-input>
           </el-form-item>
         </el-col>
@@ -27,6 +35,7 @@
               v-model="formData.data.purchaseTime"
               type="datetime"
               placeholder="请选择"
+              disabled
             />
           </el-form-item>
         </el-col>
@@ -112,7 +121,7 @@
               (row) =>
                 row.productDefinition == 1
                   ? '产品'
-                  : row.productDefinition == 1
+                  : row.productDefinition == 2
                   ? '物料'
                   : ''
             "
@@ -125,16 +134,8 @@
             label="单位"
             :formatter="(row) => dictValueLabel(row.productUnit, productUnit)"
           />
-          <el-table-column
-            prop="subscribeCount"
-            label="申购数量"
-            v-if="ids.length > 0"
-          />
-          <el-table-column
-            prop="purchaseCount"
-            label="已采购数量"
-            v-if="ids.length > 0"
-          />
+          <el-table-column prop="subscribeCount" label="申购数量" />
+          <el-table-column prop="purchaseCount" label="已采购数量" />
           <el-table-column prop="count" label="本次采购" min-width="150">
             <template #default="{ row, $index }">
               <el-form-item
@@ -399,28 +400,63 @@ onMounted(() => {
   if (!route.query.processType) {
     ids.value = props.queryData.ids.split(",") || [];
     getDetails();
-  }
-  setTimeout(() => {
-    if (!props.queryData.purchaseDetailList) return;
-    formData.data = props.queryData;
+  } else {
     proxy
-      .post("/subscribeDetail/detail", {
-        ids: props.queryData.purchaseDetailList.map((item) => {
-          return item.subscribeDetailId;
-        }),
+      .post("/purchase/detail", {
+        id: route.query.businessId,
       })
       .then((res) => {
-        console.log(formData.data.purchaseDetailList);
-        formData.data.purchaseDetailList =
-          props.queryData.purchaseDetailList.map((x, index) => ({
-            ...res[index],
-            subscribeCount: x.count,
-            count: x.count,
-            price: x.price,
-            amount: x.amount,
-          }));
-        console.log(formData.data.purchaseDetailList);
+        let jsonData = {};
+        if (res.victoriatouristJson) {
+          jsonData = JSON.parse(res.victoriatouristJson);
+        }
+        formData.data = { ...res, ...jsonData };
+        formData.data.purchaseDetailList = formData.data.purchaseDetailList.map(
+          (x) => ({
+            ...x,
+            subscribeCount: x.subscribeQuantity,
+            purchaseCount: x.purchaseQuantity,
+          })
+        );
       });
+  }
+  setTimeout(() => {
+    if (!props.queryData.purchaseDetailList) return;
+    // formData.data = props.queryData;
+    // proxy
+    //   .post("/subscribeDetail/detail", {
+    //     ids: props.queryData.purchaseDetailList.map((item) => {
+    //       return item.subscribeDetailId;
+    //     }),
+    //   })
+    //   .then((res) => {
+    //     formData.data.purchaseDetailList =
+    //       props.queryData.purchaseDetailList.map((x, index) => ({
+    //         ...res[index],
+    //         subscribeCount: x.count,
+    //         count: x.count,
+    //         price: x.price,
+    //         amount: x.amount,
+    //       }));
+    //   });
+    // proxy
+    //   .post("/purchase/detail", {
+    //     id: route.query.businessId,
+    //   })
+    //   .then((res) => {
+    //     let jsonData = {};
+    //     if (res.victoriatouristJson) {
+    //       jsonData = JSON.parse(res.victoriatouristJson);
+    //     }
+    //     formData.data = { ...res, ...jsonData };
+    //     formData.data.purchaseDetailList = formData.data.purchaseDetailList.map(
+    //       (x) => ({
+    //         ...x,
+    //         subscribeCount: x.subscribeQuantity,
+    //         purchaseCount: x.purchaseQuantity,
+    //       })
+    //     );
+    //   });
   }, 2000);
 });
 
@@ -432,9 +468,9 @@ const props = defineProps({
 const ids = ref([]);
 const getDetails = () => {
   proxy.post("/subscribeDetail/detail", { ids: ids.value }).then((res) => {
-    console.log(res, "123123123123123123123123");
     formData.data.purchaseDetailList = res.map((x) => ({
       ...x,
+      subscribeDetailId: x.id,
       subscribeCount: x.count,
       count: Number(x.count) - Number(x.purchaseCount),
       price: null,
@@ -443,7 +479,6 @@ const getDetails = () => {
   });
 };
 // 获取用户信息并赋默认值
-// const tenantId = "@福建宏星!#¥%……&*()";
 const tenantId = userInfo.tenantId;
 // 获取供应商数据
 const supplierData = ref([]);
@@ -518,9 +553,30 @@ const getDict = () => {
   });
 };
 getDict();
+
+const judgeStatus = () => {
+  if (route.query.processType == 20) {
+    return true;
+  }
+  if (props.queryData.recordList && props.queryData.recordList.length > 0) {
+    let data = props.queryData.recordList.filter(
+      (item) => item.status === 2 && item.nodeType !== 1
+    );
+    if (data && data.length > 0) {
+      return true;
+    }
+  }
+  return false;
+};
+
+const getFormData = () => {
+  return formData.data;
+};
+
 // 向父组件暴露
 defineExpose({
-  submitData: formData.data,
+  // submitData: formData.data,
+  getFormData,
   handleSubmit,
 });
 </script>

+ 6 - 1
src/components/WDLY/process/SendSubscribeWDLY.vue

@@ -283,9 +283,14 @@ onMounted(() => {
     formData.data.subcribeName = userInfo.nickName;
   }
 });
+const getFormData = () => {
+  return formData.data;
+};
+
 // 向父组件暴露
 defineExpose({
-  submitData: formData.data,
+  // submitData: formData.data,
+  getFormData,
   handleSubmit,
 });
 </script>

+ 1 - 0
src/views/WDLY/purchaseManage/alreadyPurchase/index.vue

@@ -1377,6 +1377,7 @@ const handleClickContractCode = (row) => {
     query: {
       flowKey: row.processInstanceId,
       id: row.flowId,
+      businessId: row.id,
       processType: 20,
     },
   });

+ 1 - 0
src/views/process/dealWith/index.vue

@@ -168,6 +168,7 @@ const config = computed(() => {
                                 query: {
                                     flowKey: row.flowKey,
                                     id: row.id,
+																		businessId: row.businessId,
 									processType:10,
 									version:row.version
                                 },

+ 30 - 9
src/views/process/processApproval/index.vue

@@ -272,7 +272,8 @@ const handleSubmit = async (_type) => {
     if (flag) {
       flowFormDom.value.validate((valid) => {
         if (valid) {
-          const data = { ...makeDom.value.submitData };
+          // const data = { ...makeDom.value.submitData };
+          const data = makeDom.value.getFormData();
           if (flowForm.flowKey == "subscribe_flow") {
             data.subscribeDetailList = data.subscribeDetailList.map((x) => ({
               bussinessId: x.bussinessId,
@@ -302,14 +303,26 @@ const handleSubmit = async (_type) => {
             };
             data.victoriatouristJson = JSON.stringify(victoriatouristJson);
           } else if (flowForm.flowKey == "wdly_purchase") {
-            data.purchaseDetailList = data.purchaseDetailList.map((x) => ({
-              bussinessId: x.bussinessId,
-              subscribeDetailId: x.id,
-              count: x.count,
-              price: x.price,
-              amount: x.amount,
-              deptId: x.deptId,
-            }));
+            if (route.query.processType && route.query.processType == 10) {
+              data.purchaseDetailList = data.purchaseDetailList.map((x) => ({
+                bussinessId: x.bussinessId,
+                subscribeDetailId: x.subscribeDetailId,
+                count: x.count,
+                price: x.price,
+                amount: x.amount,
+                deptId: x.deptId,
+                id: x.id,
+              }));
+            } else {
+              data.purchaseDetailList = data.purchaseDetailList.map((x) => ({
+                bussinessId: x.bussinessId,
+                subscribeDetailId: x.subscribeDetailId,
+                count: x.count,
+                price: x.price,
+                amount: x.amount,
+                deptId: x.deptId,
+              }));
+            }
             const victoriatouristJson = {
               isAgreement: data.isAgreement,
               paymentMethod: data.paymentMethod,
@@ -424,6 +437,14 @@ const handleSubmit = async (_type) => {
               .then((res) => {
                 handleResult(res);
               });
+            if (_type && _type == 1) {
+              proxy
+                .post("/flowExample/setStartData", {
+                  exampleId: route.query.id,
+                  startDate: data,
+                })
+                .then();
+            }
             return;
           } else {
             proxy

+ 29 - 1
src/views/process/processConfig/vueFlow.vue

@@ -42,6 +42,28 @@
 			</el-button>
 		</template>
 	</el-dialog>
+	<el-dialog
+		title="节点信息配置"
+		v-model="startModalType"
+		width="500"
+		v-loading="loading"
+	>
+		<div>
+			节点后执行方法
+			<el-input style="margin-top:10px" v-model="handlingMethod"></el-input>
+		</div>
+		<template #footer>
+  <el-button @click="startModalType = false" size="large">取 消</el-button>
+  <el-button
+    type="primary"
+    @click="startModalType = false"
+    size="large"
+    :loading="submitLoading"
+  >
+    确 定
+  </el-button>
+</template>
+	</el-dialog>
 </template>
 <script lang="ts" setup>
 import {
@@ -94,6 +116,8 @@ const formData = reactive({
     password: "",
   },
 });
+const startModalType = ref(false);
+const handlingMethod = ref("");
 const byform = ref(null);
 const flowDefinitionNodeObj = ref({});
 const rules = reactive({
@@ -304,6 +328,7 @@ const submitAll = () => {
         id: 1,
         parentId: 0,
         nodeButtonSet: [1],
+        handlingMethod: handlingMethod.value,
       });
     }
     //说明是线
@@ -621,7 +646,10 @@ const antvInit = (data) => {
   graph.on("cell:click", ({ e, x, y, cell, view }) => {
     console.log(flowDefinitionNodeObj.value);
     console.log(cell);
-    if (cell.shape === "start-btn") return;
+    if (cell.shape === "start-btn") {
+      startModalType.value = true;
+      return;
+    }
     if (cell.shape === "end-btn" || cell.shape === "edge") {
       ElMessageBox.confirm("是否删除", "提示", {
         confirmButtonText: "确定",