Procházet zdrojové kódy

采购右侧决策辅助

cz před 1 rokem
rodič
revize
daceb6903a

+ 61 - 0
src/components/process/SendPurchase.vue

@@ -579,6 +579,48 @@ let auxiliaryData = ref([
       ],
     ],
   },
+  {
+    label: "产品价格",
+    data: [
+      [
+        {
+          label: "产品名称",
+          value: "12312312312456",
+          fn: () => {
+            console.log(formData.data);
+          },
+          style: {
+            color: "red",
+          },
+          num: 1,
+        },
+        {
+          label: "最近价格",
+          value: "123456",
+          fn: () => {
+            alert("点击事件");
+          },
+          num: 1,
+        },
+        {
+          label: "历史最高",
+          value: "123456",
+          fn: () => {
+            alert("点击事件");
+          },
+          num: 1,
+        },
+        {
+          label: "历史最低",
+          value: "123456",
+          fn: () => {
+            alert("点击事件");
+          },
+          num: 1,
+        },
+      ],
+    ],
+  },
 ]);
 const auxiliaryChange = (data) => {
   emit("auxiliaryChange", data);
@@ -604,6 +646,7 @@ const getAuxiliaryData = (supplyId, productIdList) => {
               } else {
                 value =
                   res.purchaseList[index].currency +
+                  " " +
                   proxy.moneyFormat(res.purchaseList[index].amount, 2);
               }
               obj.value = value;
@@ -611,6 +654,24 @@ const getAuxiliaryData = (supplyId, productIdList) => {
             });
           }
         );
+        const arr = auxiliaryData.value[1].data[0];
+        auxiliaryData.value[1].data = res.productPriceList.map((x, index) => {
+          return arr.map((y, sonIndex) => {
+            let obj = { ...y };
+            let value = "";
+            if (sonIndex === 0) {
+              value = x.name;
+            } else if (sonIndex === 1) {
+              value = x.lastPrice;
+            } else if (sonIndex === 2) {
+              value = x.maxPrice;
+            } else {
+              value = x.minPrice;
+            }
+            obj.value = value;
+            return obj;
+          });
+        });
         console.log(auxiliaryData.value, "aaa");
         auxiliaryChange(auxiliaryData.value);
       });

+ 8 - 2
src/views/process/processApproval/index.vue

@@ -6,8 +6,8 @@
           {{ route.query.flowName || "流程标题(发起)" }}
         </div>
         <div class="line"></div>
-        <SendSubscribe ref="makeDom" @auxiliaryChange='(e) => auxiliaryData = e' v-if="flowForm.flowKey == 'subscribe_flow'" :queryData="queryData.data"></SendSubscribe>
-        <SendPurchase ref="makeDom" @auxiliaryChange='(e) => auxiliaryData = e' v-else-if="flowForm.flowKey == 'purchase_flow'" :queryData="queryData.data"></SendPurchase>
+        <SendSubscribe ref="makeDom" @auxiliaryChange='(e) => getAuxiliaryData(e)' v-if="flowForm.flowKey == 'subscribe_flow'" :queryData="queryData.data"></SendSubscribe>
+        <SendPurchase ref="makeDom" @auxiliaryChange='(e) => getAuxiliaryData(e)' 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>
@@ -85,7 +85,10 @@
           <!-- <div style="overflow-y: auto; max-height: calc(100vh - 200px)">
             <DecisionAids></DecisionAids>
           </div> -->
+          <div style="overflow: auto; height: calc(100vh - 200px)">
           <auxiliary :data="auxiliaryData"></auxiliary>
+
+          </div>
           <!-- <div style="overflow: auto; height: calc(100vh - 200px)">
             <purchaseAuxiliary></purchaseAuxiliary>
           </div> -->
@@ -161,6 +164,9 @@ const handleClick = (tab, event) => {
   // console.log(tab, event);
 };
 let auxiliaryData = ref([]);
+const getAuxiliaryData = (data)=>{
+  auxiliaryData.value=data
+}
 // 意见表单
 const flowForm = reactive({
   flowKey: "",