Browse Source

JLHWEB: 修复床垫报价数据看板异常

JohnnyChan 2 weeks ago
parent
commit
7c4b28383a

+ 48 - 0
JLHWEB/src/views/baseinfo/mtrltype/hooks/index.tsx

@@ -57,6 +57,54 @@ export const useHooks = (t?: any) => {
         span: 2,
         editable: ALLOW_EDIT_STATE
       }
+    },
+    {
+      field: "dannum1_rate",
+      title: "损耗率:散单系数浮动数",
+      basicinfo: {
+        el: "input",
+        props: {
+          type: "number"
+        },
+        span: 2,
+        editable: ALLOW_EDIT_STATE
+      }
+    },
+    {
+      field: "dannum2_rate",
+      title: "损耗率:标准系数浮动数",
+      basicinfo: {
+        el: "input",
+        props: {
+          type: "number"
+        },
+        span: 2,
+        editable: ALLOW_EDIT_STATE
+      }
+    },
+    {
+      field: "dannum3_rate",
+      title: "损耗率:大单系数浮动数",
+      basicinfo: {
+        el: "input",
+        props: {
+          type: "number"
+        },
+        span: 2,
+        editable: ALLOW_EDIT_STATE
+      }
+    },
+    {
+      field: "dannum4_rate",
+      title: "损耗率:小单系数浮动数",
+      basicinfo: {
+        el: "input",
+        props: {
+          type: "number"
+        },
+        span: 2,
+        editable: ALLOW_EDIT_STATE
+      }
     }
   ];
 

+ 2 - 5
JLHWEB/src/views/quote/mattressQuote/components/AllFormula.vue

@@ -26,18 +26,15 @@
       <template v-if="iforigin">
         <el-tabs v-model="activeName">
           <el-tab-pane label="新公式" name="first">
-            <!-- <LjHeader class="flx-1" title="单据统计" /> -->
             <FormulaGroup :data="isNormalFormulas" :fields="isFieldsReplace" />
           </el-tab-pane>
           <el-tab-pane label="旧公式" name="second">
-            <!-- <LjHeader class="flx-1" title="单据统计" /> -->
             <FormulaGroup :data="isNormalFormulasOri" :fields="isFieldsReplaceOri" />
           </el-tab-pane>
         </el-tabs>
       </template>
       <template v-else>
-        <!-- <LjHeader class="flx-1" title="单据统计" /> -->
-        <FormulaGroup :data="isNormalFormulas" :fields="fieldsReplace" />
+        <FormulaGroup :data="isNormalFormulas" :fields="isFieldsReplace" />
       </template>
     </template>
   </LjDrawer>
@@ -78,7 +75,7 @@ const formulaMxList = ref<any>([]);
 
 const dannumValue = ref("标准");
 
-const dannumOptions = ["标准", "散单", "大单", "小单"];
+const dannumOptions = ["散单", "小单", "标准", "大单"];
 
 const isNormalFormulas = computed(() => {
   let _formula = formulaList.value.filter((item: any) => item.type == 0);

+ 12 - 10
JLHWEB/src/views/quote/mattressQuote/components/Statistic.vue

@@ -108,45 +108,47 @@ const { userInfo } = useUserStore();
 // ]);
 const statisticData = ref<statisticDataProps[]>([
   {
-    label: "【标准金额】",
+    label: "【散单金额】",
     value: 0,
     origin: 0,
     key: "【部门含税价】",
-    type: 2
+    type: 1
   },
   {
-    label: "【单金额】",
+    label: "【单金额】",
     value: 0,
     origin: 0,
     key: "【部门含税价】",
-    type: 1
+    type: 4
   },
   {
-    label: "【大单金额】",
+    label: "【标准金额】",
     value: 0,
     origin: 0,
     key: "【部门含税价】",
-    type: 3
+    type: 2
   },
   {
-    label: "【单金额】",
+    label: "【单金额】",
     value: 0,
     origin: 0,
     key: "【部门含税价】",
-    type: 4
+    type: 3
   }
 ]);
 
 watch(
-  () => props.data,
+  () => props.differ,
   val => {
+    console.log("props.differ val :>> ", val);
     statisticData.value = statisticData.value.filter(o => {
       // let tg = val.find(item => item.label === o.key);
 
-      let tg = props.differ.find(item => item.type === o.type);
+      let tg = val.find(item => item.type === o.type);
       if (tg) {
         let tgRl = tg.replace.find(item => item.label === o.key);
         o.value = tgRl ? tgRl.value : 0;
+        console.log("tgRl,  :>> ", props.iforigin, tgRl);
         if (props.iforigin) {
           let tgori = tg.replace_origin.find(item => item.label === o.key);
           o.origin = tgori ? tgori.value : 0;

+ 7 - 3
JLHWEB/src/views/quote/mattressQuote/detail.vue

@@ -23,9 +23,9 @@
         />
         <el-select v-model="scope.data.dannum_type" placeholder="大小单" style="width: 80px">
           <el-option label="散单" :value="1" />
+          <el-option label="小单" :value="4" />
           <el-option label="标准" :value="2" />
           <el-option label="大单" :value="3" />
-          <el-option label="小单" :value="4" />
         </el-select>
       </el-space>
     </template>
@@ -839,6 +839,10 @@ const globalStore = useGlobalStore();
 
 const showOriginFormulaMattress = (value: any) => {
   globalStore.setGlobalState("isShowOriginFormulaMattress", Boolean(value));
+
+  // 刷新页面
+  router.go(0);
+  // LjDetailRef.value.refresh();
 };
 
 const _variables: any = variables;
@@ -1400,10 +1404,10 @@ const topCottonNum_error = computed(() => {
   return arr.length;
 });
 
-const getData_topCotton = (params: any) => {
+const getData_topCotton = async (params: any) => {
   if (!Object.keys(initParams.value).includes("arg_mattressid") || initParams.value.arg_mattressid == 0) return false;
   let _params = { ...params, arg_formulatype: [103] };
-  return getData_mx(_params);
+  return await getData_mx(_params);
 };
 /**↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ */
 

+ 2 - 7
JLHWEB/src/views/quote/mattressQuote/hooks/index.tsx

@@ -2581,13 +2581,8 @@ export const useHooks = (t?: any) => {
       state.cmpFormulas = res.formulas;
       state.cmpFormulaReplace = res.replace;
       // state.
-      if (state.isShowOriginFormulaMattress) {
-        state.cmpFormulasOri = res.formulas_origin;
-        state.cmpDiffer = res.differ;
-      } else {
-        state.cmpFormulasOri = [];
-        state.cmpDiffer = [];
-      }
+      state.cmpFormulasOri = res.formulas_origin ?? [];
+      state.cmpDiffer = res.differ;
     } else {
       setTimeout(() => {
         if (res.message) {