瀏覽代碼

销售合同流程决策辅助

lxf 1 年之前
父節點
當前提交
8c2490f0a6
共有 3 個文件被更改,包括 73 次插入140 次删除
  1. 1 0
      package.json
  2. 20 0
      src/views/process/processApproval/decisionAids.vue
  3. 52 140
      src/views/process/processApproval/index.vue

+ 1 - 0
package.json

@@ -44,6 +44,7 @@
     "moment": "^2.29.4",
     "nprogress": "0.2.0",
     "pinia": "2.0.22",
+    "pubsub-js": "^1.9.4",
     "sortablejs": "^1.15.0",
     "typescript": "^5.0.4",
     "vue": "3.2.45",

+ 20 - 0
src/views/process/processApproval/decisionAids.vue

@@ -0,0 +1,20 @@
+<template>
+  <div class="tenant">1111</div>
+</template>
+
+<script setup>
+import Pubsub from "pubsub-js";
+
+onMounted(() => {
+  Pubsub.subscribe("refreshDecisionAids", changeMessage);
+});
+const changeMessage = (type, val) => {
+  console.log(type, val);
+};
+</script>
+
+<style lang="scss" scoped>
+.tenant {
+  padding: 20px;
+}
+</style>

+ 52 - 140
src/views/process/processApproval/index.vue

@@ -5,109 +5,41 @@
         <div class="commons-title title">
           {{ route.query.flowName || "流程标题(发起)" }}
         </div>
-        <SendSubscribe
-          ref="makeDom"
-          v-if="flowForm.flowKey == 'subscribe_flow'"
-          :queryData="queryData.data"
-        ></SendSubscribe>
-        <SendPurchase
-          ref="makeDom"
-          v-else-if="flowForm.flowKey == 'purchase_flow'"
-          :queryData="queryData.data"
-        ></SendPurchase>
-        <SendFunds
-          ref="makeDom"
-          v-else-if="flowForm.flowKey == 'account_request_funds_flow'"
-          :queryData="queryData.data"
-        ></SendFunds>
-        <ReturnGood
-          ref="makeDom"
-          v-else-if="flowForm.flowKey == 'sales_return_flow'"
-          :queryData="queryData.data"
-        ></ReturnGood>
-        <PurchaseRefund
-          ref="makeDom"
-          v-else-if="flowForm.flowKey == 'refund_flow'"
-          :queryData="queryData.data"
-        ></PurchaseRefund>
-        <PurchasePayment
-          ref="makeDom"
-          v-else-if="flowForm.flowKey == 'pay_flow'"
-          :queryData="queryData.data"
-        ></PurchasePayment>
+        <SendSubscribe ref="makeDom" v-if="flowForm.flowKey == 'subscribe_flow'" :queryData="queryData.data"></SendSubscribe>
+        <SendPurchase ref="makeDom" v-else-if="flowForm.flowKey == 'purchase_flow'" :queryData="queryData.data"></SendPurchase>
+        <SendFunds ref="makeDom" v-else-if="flowForm.flowKey == 'account_request_funds_flow'" :queryData="queryData.data"></SendFunds>
+        <ReturnGood ref="makeDom" v-else-if="flowForm.flowKey == 'sales_return_flow'" :queryData="queryData.data"></ReturnGood>
+        <PurchaseRefund ref="makeDom" v-else-if="flowForm.flowKey == 'refund_flow'" :queryData="queryData.data"></PurchaseRefund>
+        <PurchasePayment ref="makeDom" v-else-if="flowForm.flowKey == 'pay_flow'" :queryData="queryData.data"></PurchasePayment>
         <template v-else-if="flowForm.flowKey == 'sale_quotation_flow'">
-          <PriceSheetEHSD
-            ref="makeDom"
-            v-if="flowForm.tenantType === 'EHSD'"
-            :queryData="queryData.data"
-          ></PriceSheetEHSD>
-          <PriceSheet
-            ref="makeDom"
-            v-else
-            :queryData="queryData.data"
-          ></PriceSheet>
+          <PriceSheetEHSD ref="makeDom" v-if="flowForm.tenantType === 'EHSD'" :queryData="queryData.data"></PriceSheetEHSD>
+          <PriceSheet ref="makeDom" v-else :queryData="queryData.data"></PriceSheet>
         </template>
         <template v-else-if="flowForm.flowKey == 'contract_flow'">
-          <ContractEHSD
-            ref="makeDom"
-            v-if="flowForm.tenantType === 'EHSD'"
-            :queryData="queryData.data"
-          ></ContractEHSD>
+          <ContractEHSD ref="makeDom" v-if="flowForm.tenantType === 'EHSD'" :queryData="queryData.data"></ContractEHSD>
           <Contract ref="makeDom" v-else :queryData="queryData.data"></Contract>
         </template>
         <template v-else-if="flowForm.flowKey == 'sample_flow'">
           <SampleEHSD ref="makeDom" :queryData="queryData.data"></SampleEHSD>
         </template>
         <template v-else-if="flowForm.flowKey == 'ehsd_purchase_flow'">
-          <PurchaseEHSD
-            ref="makeDom"
-            :queryData="queryData.data"
-          ></PurchaseEHSD>
+          <PurchaseEHSD ref="makeDom" :queryData="queryData.data"></PurchaseEHSD>
         </template>
 
-        <ServiceContract
-          ref="makeDom"
-          v-else-if="flowForm.flowKey == 'service_contract_flow'"
-          :queryData="queryData.data"
-        ></ServiceContract>
+        <ServiceContract ref="makeDom" v-else-if="flowForm.flowKey == 'service_contract_flow'" :queryData="queryData.data"></ServiceContract>
         <!-- 维多利亚 -->
-        <SendSubscribeWDLY
-          ref="makeDom"
-          v-else-if="flowForm.flowKey == 'wdly_apply_purchase'"
-          :queryData="queryData.data"
-        ></SendSubscribeWDLY>
-        <SendPurchaseWDLY
-          ref="makeDom"
-          v-else-if="flowForm.flowKey == 'wdly_purchase'"
-          :queryData="queryData.data"
-        ></SendPurchaseWDLY>
+        <SendSubscribeWDLY ref="makeDom" v-else-if="flowForm.flowKey == 'wdly_apply_purchase'" :queryData="queryData.data"></SendSubscribeWDLY>
+        <SendPurchaseWDLY ref="makeDom" v-else-if="flowForm.flowKey == 'wdly_purchase'" :queryData="queryData.data"></SendPurchaseWDLY>
       </div>
       <div class="bottom" v-if="route.query.processType != 20">
         <div class="commons-title title">处理意见</div>
         <el-form :model="flowForm" :rules="flowRules" ref="flowFormDom">
           <el-form-item prop="remark" label-width="0px" label="">
-            <el-input
-              type="textarea"
-              placeholder="请输入"
-              v-model="flowForm.remark"
-            >
-            </el-input>
+            <el-input type="textarea" placeholder="请输入" v-model="flowForm.remark"> </el-input>
           </el-form-item>
           <el-form-item>
-            <el-button
-              type="primary"
-              v-if="approvalRecordData.buttonInfoList.length == 0"
-              @click="handleSubmit"
-              >提交</el-button
-            >
-            <el-button
-              type="primary"
-              v-else
-              v-for="i in approvalRecordData.buttonInfoList"
-              :key="i.type"
-              @click="handleSubmit(i.type)"
-              >{{ i.name }}</el-button
-            >
+            <el-button type="primary" v-if="approvalRecordData.buttonInfoList.length == 0" @click="handleSubmit">提交</el-button>
+            <el-button type="primary" v-else v-for="i in approvalRecordData.buttonInfoList" :key="i.type" @click="handleSubmit(i.type)">{{ i.name }}</el-button>
           </el-form-item>
         </el-form>
       </div>
@@ -129,8 +61,7 @@
                   : item.status == 3 && route.query.id
                   ? 'flow-grey'
                   : ''
-              "
-            >
+              ">
               <div class="left-icon">
                 <i class="iconfont icon-iconm_daick"></i>
                 <i class="iconfont icon-icomx_quertj1 right-btm-status"></i>
@@ -139,9 +70,7 @@
                 <div class="name">{{ item.nodeName }}</div>
                 <div class="remark">
                   <div class="label">
-                    <span v-if="item.status != 3">办理人:</span
-                    >{{ item.processedUser
-                    }}<span class="time">{{ item.processedDate }}</span>
+                    <span v-if="item.status != 3">办理人:</span>{{ item.processedUser }}<span class="time">{{ item.processedDate }}</span>
                   </div>
                   {{ item.remark }}
                 </div>
@@ -150,35 +79,23 @@
             </li>
           </ul>
         </el-tab-pane>
-
-        <!-- <el-tab-pane
-          label="决策辅助"
-          name="second"
-          v-if="flowForm.flowKey == 'purchase_flow'"
-        >
-          <auxiliary></auxiliary>
-          <div style="overflow: auto; height: calc(100vh - 200px)">
-            <purchaseAuxiliary></purchaseAuxiliary>
+        <el-tab-pane label="决策辅助" name="second" v-if="flowForm.flowKey == 'contract_flow' && flowForm.tenantType !== 'EHSD'">
+          <div style="overflow-y: auto; max-height: calc(100vh - 200px)">
+            <DecisionAids></DecisionAids>
           </div>
-        </el-tab-pane> -->
+          <!-- <auxiliary></auxiliary> -->
+          <!-- <div style="overflow: auto; height: calc(100vh - 200px)">
+            <purchaseAuxiliary></purchaseAuxiliary>
+          </div> -->
+        </el-tab-pane>
       </el-tabs>
     </div>
 
     <el-dialog title="下一处理人" width="400" v-model="dialogVisible">
       <el-form :model="flowForm">
         <el-form-item prop="remark" label="处理人">
-          <el-select
-            v-model="flowForm.handleUserId"
-            placeholder="请选择"
-            filterable
-            style="width: 100%"
-          >
-            <el-option
-              v-for="item in nextHandleUser"
-              :label="item.name"
-              :value="item.id"
-            >
-            </el-option>
+          <el-select v-model="flowForm.handleUserId" placeholder="请选择" filterable style="width: 100%">
+            <el-option v-for="item in nextHandleUser" :label="item.name" :value="item.id"> </el-option>
           </el-select>
         </el-form-item>
         <el-form-item>
@@ -197,6 +114,7 @@ import { useRouter, useRoute } from "vue-router";
 //决策辅助
 import auxiliary from "./auxiliary";
 import purchaseAuxiliary from "./purchaseAuxiliary";
+import DecisionAids from "./decisionAids";
 
 //申购发起
 import SendSubscribe from "@/components/process/SendSubscribe";
@@ -332,18 +250,16 @@ const handleSubmit = async (_type) => {
               data.ehsdJson = JSON.stringify({
                 deliveryTime: data.deliveryTime,
               });
-              data.quotationProductList = data.quotationProductList.map(
-                (item) => {
-                  let ehsdJson = JSON.stringify({
-                    packMethod: item.packMethod,
-                    tradeMethods: item.tradeMethods,
-                  });
-                  return {
-                    ...item,
-                    ehsdJson: ehsdJson,
-                  };
-                }
-              );
+              data.quotationProductList = data.quotationProductList.map((item) => {
+                let ehsdJson = JSON.stringify({
+                  packMethod: item.packMethod,
+                  tradeMethods: item.tradeMethods,
+                });
+                return {
+                  ...item,
+                  ehsdJson: ehsdJson,
+                };
+              });
             }
           } else if (flowForm.flowKey == "contract_flow") {
             if (flowForm.tenantType === "EHSD") {
@@ -372,18 +288,16 @@ const handleSubmit = async (_type) => {
               data.ehsdJson = JSON.stringify({
                 deliveryTime: data.deliveryTime,
               });
-              data.contractProductList = data.contractProductList.map(
-                (item) => {
-                  let ehsdJson = JSON.stringify({
-                    packMethod: item.packMethod,
-                    tradeMethods: item.tradeMethods,
-                  });
-                  return {
-                    ...item,
-                    ehsdJson: ehsdJson,
-                  };
-                }
-              );
+              data.contractProductList = data.contractProductList.map((item) => {
+                let ehsdJson = JSON.stringify({
+                  packMethod: item.packMethod,
+                  tradeMethods: item.tradeMethods,
+                });
+                return {
+                  ...item,
+                  ehsdJson: ehsdJson,
+                };
+              });
             }
           } else if (flowForm.flowKey == "sample_flow") {
             if (data.fileList && data.fileList.length > 0) {
@@ -576,11 +490,9 @@ const getRecords = (_id) => {
 onMounted(async () => {
   //processType 10 为修改 20为查看
   if (route.query.processType == 10 || route.query.processType == 20) {
-    await proxy
-      .post("/flowProcess/getStartData", { flowId: route.query.id })
-      .then((res) => {
-        queryData.data = { ...res };
-      });
+    await proxy.post("/flowProcess/getStartData", { flowId: route.query.id }).then((res) => {
+      queryData.data = { ...res };
+    });
   } else {
     queryData.data = { ...route.query };
   }