Przeglądaj źródła

JLHWEB: 床网报价保存接口调整

JohnnyChan 5 miesięcy temu
rodzic
commit
3164d5cc19

+ 1 - 1
JLHWEB/src/api/modules/quote.ts

@@ -48,7 +48,7 @@ export const DeleteMattressBcp = (params: Mattress.ReqMultiMattressBcp) => {
  * @name 床网报价:保存
  */
 export const SaveBedNet = (params: Mattress.ReqSaveBedNet) => {
-  return http.post<Mattress.ResSaveBedNet>(PORT1 + `/SaveMattressBcp`, params);
+  return http.post<Mattress.ResSaveBedNet>(PORT1 + `/SaveBedNet`, params);
 };
 
 /**

+ 10 - 6
JLHWEB/src/components/LjDetail/index.vue

@@ -1162,11 +1162,11 @@ onMounted(async () => {
       console.log("_mainData :>> ", _mainData.value);
       console.log("props.data :>> ", props.data);
       console.log("onMounted detail end!!!! :>> ");
-      props.afterMound && props.afterMound();
+      props.afterMound && props.afterMound(_mainData.value);
     });
   } else {
     console.log("onMounted detail end!!!! :>> ");
-    props.afterMound && props.afterMound();
+    props.afterMound && props.afterMound(_mainData.value);
   }
 });
 
@@ -1646,10 +1646,14 @@ const RenderTabs = (rProps: DetailProp) => {
  */
 const basicinfoRender = (rProps: any) => {
   let soltinfo = "basicinfo";
-  let _params =
-    orderStatus.value == "new" ? infoParam.value : orderStatus.value == "edit" ? reactive(_mainData.value) : _mainData.value;
-  console.log("basicinfoRender _params :>> ", _params);
-  console.log("basicinfoRender infoColumns.value :>> ", infoColumns.value);
+  // let _params =
+  //   orderStatus.value == "new" ? infoParam.value : orderStatus.value == "edit" ? reactive(_mainData.value) : _mainData.value;
+  let _params = editable.value ? reactive(_mainData.value) : _mainData.value;
+
+  console.log("basicinfoRender rProps :>> ", rProps);
+  console.log("basicinfoRender _params :>> ", editable.value, _params);
+  console.log("basicinfoRender _mainData.value :>> ", _mainData.value);
+  console.log("basicinfoRender infoColumns.value :>> ", infoParam.value);
   // let codeValue = orderStatus.value == "new" ? true : convertStrToObj(_mainData.value, props.header.fieldNames?.code);
   return (
     <>

+ 1 - 1
JLHWEB/src/components/LjDetail/interface/index.ts

@@ -331,7 +331,7 @@ export interface DetailProp extends aboutVxetableApiProps {
    * @argument function
    * @description 布局加载后,执行函数
    */
-  afterMound?: () => void;
+  afterMound?: (data: any) => void;
   /**
    * @description 是否可编辑布局
    */

+ 3 - 0
JLHWEB/src/components/LjSelector/select.vue

@@ -17,6 +17,9 @@
     @focus="handleFocus"
     @change="handleSelect"
   >
+    <template #label v-if="$slots?.label">
+      <slot name="label"></slot>
+    </template>
     <template #prefix>
       <slot name="prefix">
         <el-button type="primary" text bg class="pl-6 pr-6" size="small" :icon="Search" @click.stop="openModal"></el-button>

+ 16 - 0
JLHWEB/src/enums/dwnameEnum.ts

@@ -106,6 +106,22 @@ export enum DwnameEnum {
    * @description 床网分区定义
    */
   configurecodemxlist = "web_configure_codemxlist",
+  /**
+   *@description 床网报价表
+   */
+  bednetQuote = "u_bednet_define",
+  /**
+   *@description 床网报价表-明细
+   */
+  bednetQuoteMx = "u_bednetmx",
+  /**
+   *@description 床网报价表-明细弹簧
+   */
+  bednetQuoteMxSpring = "u_bednetmx_spring",
+  /**
+   *@description 床网报价表-弹簧选择
+   */
+  bednetSpringChoose = "u_spring_define_choose",
   /*
    * @description 半成品报价
    */

+ 4 - 4
JLHWEB/src/styles/common.scss

@@ -179,15 +179,15 @@
 
 /* nprogress */
 #nprogress .bar {
-  background: var(--el-color-primary) !important;
+  background: var(--lj-color-primary-300) !important;
   height: 6px !important;
 }
 #nprogress .spinner-icon {
-  border-top-color: var(--el-color-primary) !important;
-  border-left-color: var(--el-color-primary) !important;
+  border-top-color: var(--lj-color-primary-300y) !important;
+  border-left-color: var(--lj-color-primary-300y) !important;
 }
 #nprogress .peg {
-  box-shadow: 0 0 10px var(--el-color-primary), 0 0 5px var(--el-color-primary) !important;
+  box-shadow: 0 0 10px var(--lj-color-primary-300y), 0 0 5px var(--lj-color-primary-300y) !important;
 }
 
 /* 外边距、内边距全局样式 */

+ 5 - 1
JLHWEB/src/styles/element.scss

@@ -324,7 +324,7 @@
     border-color: var(--lj-color-primary-300) !important;
 
     &::after {
-      border-color: var(--lj-color-primary-600) !important;
+      border-color: var(--lj-color-primary-600);
     }
   }
 }
@@ -341,6 +341,10 @@
   }
 }
 
+.el-checkbox__input.is-disabled.is-checked .el-checkbox__inner:after {
+  border-color: var(--lj-color-gray-2) !important;
+}
+
 .is-disabled,
 .is-disabled:focus,
 .is-disabled:hover {

+ 116 - 129
JLHWEB/src/views/quote/bednetQuote/detail.vue

@@ -57,9 +57,9 @@
             <template #tableHeader>
               <div class="flx">
                 <LjHeader class="flx-shrink" title="多区袋装明细" />
-                <div class="flx-1 flx-end pb-8">
-                  <span class="text-secondary-text">划分</span>
-                  <el-select v-model="currentArea" class="pl-4 pr-4" style="width: 80px" @change="handleAreaChange">
+                <div class="flx-1 flx-end pb-8" v-if="AreaList.length">
+                  <span class="text-secondary-text">比例设置</span>
+                  <el-select v-model="currentArea" class="pl-4 pr-4" style="width: 80px" @change="setMxSpringLength">
                     <el-option
                       v-for="item in AreaList"
                       :key="item.areaname"
@@ -68,7 +68,6 @@
                     ></el-option>
                     <!-- <el-option v-for="item in 7" :key="item" :label="item" :value="item"></el-option> -->
                   </el-select>
-                  <span class="text-secondary-text">区</span>
                 </div>
               </div>
             </template>
@@ -94,7 +93,7 @@ import LjVxeTable from "@/components/LjVxeTable/index.vue";
 // import { cloneDeep } from "lodash-es";
 import { useRoute, useRouter } from "vue-router";
 import { CommonDynamicSelect, GetFormulaCompute } from "@/api/modules/common";
-import { SaveBedNet } from "@/api/modules/quote";
+import { SaveBedNet, AuditBedNet, DeleteBedNet } from "@/api/modules/quote";
 // import ToastFormula from "@/components/ToastWidget/Formula/index.vue";
 import { TYPE, useToast, POSITION } from "vue-toastification";
 import { ElMessage, ElMessageBox, ElNotification } from "element-plus";
@@ -133,12 +132,14 @@ const {
   currentArea,
   AreaList,
   dw_bednet_mx_spring,
+  reload_dw2,
   getData,
   getDataMxAdd,
   getDataMxSpring,
   dataCallback,
   dataCallbackMx,
-  wf_cmp_cb
+  wf_cmp_cb,
+  setMxSpringLength
 } = useHooks();
 
 const { CheckPower, CheckOption, buttonNew, buttonDefault } = useAuthButtons(t);
@@ -213,6 +214,10 @@ const detailProps = reactive<DetailProp>({
   ]
 });
 
+const loadingStatus = reactive({
+  save: false
+});
+
 const orderDefaultAction: detailAction[] = [
   buttonDefault({
     label: t("common.cancelText"),
@@ -221,8 +226,8 @@ const orderDefaultAction: detailAction[] = [
       return !orderStatus.value;
     },
     clickFunc: item => {
+      tabRemove(route.fullPath);
       if (route.path.indexOf("/new") > -1) {
-        tabRemove(route.fullPath);
         router.replace("/bednetQuote");
       } else {
         router.replace(
@@ -237,21 +242,20 @@ const orderDefaultAction: detailAction[] = [
     // loading: () => loadingStatus.save,
     limited: () => !orderStatus.value,
     clickFunc: async () => {
+      console.log("save LjDetailRef.value :>> ", LjDetailRef.value);
       console.log("save LjDetailRef.value._mainData :>> ", LjDetailRef.value._mainData);
-
-      // console.log("save------------ :>> ", loadingStatus.save);
-      // console.log("save cushionsMxData :>> ", cushionsMxData.value);
+      console.log("save LjDetailRef.value.pp :>> ", LjDetailRef.value.infoParam);
 
       try {
         await LjDetailRef.value.toValidateForm();
 
-        wf_cmp_cb();
+        if (!(await wf_cmp_cb())) return;
 
         let bednet = LjDetailRef.value._mainData;
 
-        let bednetMx = vxeTableMxRef.value?.element.getTableData();
+        let bednetMx = vxeTableMxRef.value?.element.getTableData().fullData;
 
-        let spring = vxeTableMxSpringRef.value?.element.getTableData();
+        let spring = vxeTableMxSpringRef.value?.element.getTableData().fullData ?? [];
 
         let _param_mf = {
           bednet,
@@ -279,7 +283,12 @@ const orderDefaultAction: detailAction[] = [
         } catch (error) {
           ElMessage.error(t("sys.api.operationFailed"));
         }
-      } catch (e) {}
+      } catch (e) {
+        ElMessage({
+          type: "error",
+          message: e.message
+        });
+      }
     }
   }),
   buttonDefault({
@@ -299,12 +308,16 @@ const orderDefaultAction: detailAction[] = [
       return !!orderStatus.value;
     },
     clickFunc: item => {
+      tabRemove(route.fullPath);
       router.replace(`/bednetQuote/edit?id=${LjDetailRef.value._mainData.bednetid}`);
     }
   }),
   buttonDefault({
     label: t("common.delText"),
     power: 76,
+    limited: () => {
+      return !!orderStatus.value;
+    },
     disabledTextCallBack: (data: any) => {
       if (!CheckPower(76)) {
         return "你没有【报价单-删除】的使用权限";
@@ -313,104 +326,96 @@ const orderDefaultAction: detailAction[] = [
       return "";
     },
     clickFunc: item => {
-      // const { curRecords } = getCurrentRecords(vxeTableRef.value);
-      // console.log("curRecords :>> ", curRecords);
-      // if (!curRecords.length) {
-      //   ElMessage.warning(t("business.tips.mattress.records"));
-      //   return;
-      // }
-      // let _mattressids = curRecords.map((item: any) => Number(item.mattressid));
-      // ElMessageBox.confirm(`是否确定要删除${curRecords.length}张床垫报价单吗?`, "询问", {
-      //   confirmButtonText: t("common.delText"),
-      //   cancelButtonText: "否",
-      //   type: "warning"
-      // })
-      //   .then(() => {
-      //     DelMattress({ mattressids: _mattressids }).then(() => {
-      //       ElMessage.success("删除成功!");
-      //       vxeTableRef.value.refresh();
-      //     });
-      //   })
-      //   .catch((e: TypeError) => {
-      //     console.log("e :>> ", e);
-      //     ElMessage({
-      //       type: "info",
-      //       message: "操作取消"
-      //     });
-      //   });
+      ElMessageBox.confirm(`是否确定要删除该报价单吗?`, "询问", {
+        confirmButtonText: t("common.delText"),
+        cancelButtonText: "否",
+        type: "warning"
+      })
+        .then(() => {
+          let list = [LjDetailRef.value._mainData];
+
+          DeleteBedNet({ list }).then(() => {
+            ElMessage.success("删除成功!");
+
+            LjDetailRef.value.refresh();
+          });
+        })
+        .catch((e: TypeError) => {
+          console.log("e :>> ", e);
+          ElMessage({
+            type: "info",
+            message: "操作取消"
+          });
+        });
     }
   }),
   [
     buttonDefault({
-      label: t("common.auditFinance"),
+      label: t("common.auditText"),
       power: 63,
       limited: () => {
         return !!orderStatus.value;
       },
       disabledTextCallBack: (data: any) => {
         if (!CheckPower(63)) {
-          return `你没有【报价单-${t("common.auditFinance")}】的使用权限`;
+          return `你没有【报价单-${t("common.auditText")}】的使用权限`;
         }
         return "";
       },
       clickFunc: item => {
-        // ElMessageBox.confirm(`是否确定要${t("common.auditFinance")}吗?`, "询问", {
-        //   confirmButtonText: "是",
-        //   cancelButtonText: "否",
-        //   type: "warning"
-        // })
-        //   .then(() => {
-        //     let _params = {
-        //       mattressids: [Number(LjDetailRef.value._mainData.mattressid)],
-        //       flag: 1
-        //     };
-        //     SaveMattressAuditing(_params).then(() => {
-        //       ElMessage.success(t("sys.api.operationSuccess"));
-        //       LjDetailRef.value.refresh();
-        //     });
-        //   })
-        //   .catch((e: TypeError) => {
-        //     ElMessage({
-        //       type: "info",
-        //       message: "操作取消"
-        //     });
-        //   });
+        ElMessageBox.confirm("是否确定要审核单据吗?", "询问", {
+          confirmButtonText: "是",
+          cancelButtonText: "否",
+          type: "warning"
+        })
+          .then(() => {
+            let list = [LjDetailRef.value._mainData];
+            AuditBedNet({ list, type: 1 }).then(() => {
+              ElMessage.success("审核成功!");
+
+              LjDetailRef.value.refresh();
+            });
+          })
+          .catch((e: TypeError) => {
+            ElMessage({
+              type: "info",
+              message: "操作取消"
+            });
+          });
       }
     }),
     buttonDefault({
-      label: t("common.withdrawAuditFinance"),
+      label: t("common.withdrawAuditText"),
       power: 64,
       limited: () => {
         return !!orderStatus.value;
       },
       disabledTextCallBack: (data: any) => {
         if (!CheckPower(64)) {
-          return `你没有【报价单-${t("common.withdrawAuditFinance")}】的使用权限`;
+          return `你没有【报价单-${t("common.withdrawAuditText")}】的使用权限`;
         }
         return "";
       },
       clickFunc: item => {
-        // ElMessageBox.confirm(`是否确定要${t("common.withdrawAuditFinance")}吗?`, "询问", {
-        //   confirmButtonText: "是",
-        //   cancelButtonText: "否",
-        //   type: "warning"
-        // })
-        //   .then(() => {
-        //     let _params = {
-        //       mattressids: [Number(LjDetailRef.value._mainData.mattressid)],
-        //       flag: 0
-        //     };
-        //     SaveMattressAuditing(_params).then(() => {
-        //       ElMessage.success(t("sys.api.operationSuccess"));
-        //       LjDetailRef.value.refresh();
-        //     });
-        //   })
-        //   .catch((e: TypeError) => {
-        //     ElMessage({
-        //       type: "info",
-        //       message: "操作取消"
-        //     });
-        //   });
+        ElMessageBox.confirm("是否确定要撤审单据吗?", "询问", {
+          confirmButtonText: "是",
+          cancelButtonText: "否",
+          type: "warning"
+        })
+          .then(() => {
+            let list = [LjDetailRef.value._mainData];
+            AuditBedNet({ list, type: 0 }).then(() => {
+              ElMessage.success("撤审成功!");
+
+              LjDetailRef.value.refresh();
+            });
+          })
+          .catch((e: TypeError) => {
+            ElMessage({
+              type: "info",
+              message: "操作取消"
+            });
+          });
       }
     })
   ],
@@ -457,8 +462,8 @@ onMounted(async () => {
 /**
  * @description 页面数据加载完成
  */
-const funcAfterMound = async () => {
-  console.log("onMounted detail sale start!!!! :>> ", !orderStatus.value);
+const funcAfterMound = async (data: any) => {
+  console.log("onMounted detail sale start!!!! :>> ", !orderStatus.value, data);
   // console.log("LjDetailRef.value.currentMould :>> ", LjDetailRef.value.currentMould);
   // console.log(
   //   "Boolean(Number(CheckOption(sysOptionEnum.sys_option_043))) :>> ",
@@ -515,7 +520,12 @@ const funcAfterMound = async () => {
   }
   // ifAfterMound.value = true;
 
-  console.log("onMounted detail sale start LjDetailRef.value.mainData :>> ", tableProps_mx.value, LjDetailRef.value);
+  console.log(
+    "onMounted detail sale start LjDetailRef.value.mainData :>> ",
+    AreaList.value,
+    tableProps_mx.value,
+    LjDetailRef.value
+  );
 
   if (orderStatus.value != "new") {
     // const { enumMap, _mainData } = LjDetailRef.value;
@@ -540,15 +550,24 @@ const funcAfterMound = async () => {
 
     // getMattressType();
 
-    let res = await getDataMxAdd(initParamsMx.value);
-    let result = dataCallbackMx(res);
-    columnsMx.value = result.tableinfo.columns;
-    bednetMxData.value = result.list;
+    // let res = await getDataMxAdd(initParamsMx.value);
+    // let result = dataCallbackMx(res);
+    // columnsMx.value = result.tableinfo.columns;
+    // bednetMxData.value = result.list;
+
+    // res = await getDataMxSpring(initParamsMx.value);
+    // result = dataCallbackMx(res);
+    // columnsMxSpring.value = result.tableinfo.columns;
+    // bednetMxSprintData.value = result.list;
 
-    res = await getDataMxSpring(initParamsMx.value);
-    result = dataCallbackMx(res);
-    columnsMxSpring.value = result.tableinfo.columns;
-    bednetMxSprintData.value = result.list;
+    reload_dw2(data, (params: any) => {
+      const { mx, spring } = params;
+      console.log("reload_dw2 22result :>> ", params);
+      bednetMxData.value = mx.list;
+      bednetMxSprintData.value = spring.list;
+
+      // vxeTableMxSpringRef.value.refresh();
+    });
     // bednetMxData.value = bednetMxData.value.map(t => {
     //   // t.formulakind = Number(t.formulakind);
     //   // t.thickness = Number(t.thickness);
@@ -556,7 +575,7 @@ const funcAfterMound = async () => {
     //   return t;
     // });
 
-    console.log("bednetMxData after:>> ", bednetMxData.value, vxeTableMxRef.value.tableColumns);
+    // console.log("bednetMxData after:>> ", bednetMxData.value, orderStatus.value, vxeTableMxRef.value.tableColumns);
     // nextTick(() => {
     //   vxeTableMxRef.value.refresh();
     // });
@@ -568,36 +587,4 @@ const funcAfterMound = async () => {
     // console.log("funcAfterMound resData :>> ", fabricMxData.value);
   }
 };
-
-const handleAreaChange = async (val: any) => {
-  console.log("handleAreaChange val :>> ", val);
-  let item = AreaList.value.find(t => t.areaname == val);
-
-  if (item) {
-    let num = 0;
-    for (const key in item) {
-      if (key.indexOf("area_") && Number(item[key]) > 0) {
-        num++;
-      }
-    }
-    console.log("num :>> ", num);
-    LjDetailRef.value._mainData.duo_qv_str = num;
-
-    const $table = vxeTableMxSpringRef.value.element;
-
-    const { fullData } = $table.getTableData();
-    console.log("handleAreaChange fullData :>> ", fullData);
-
-    if (num > 0 && fullData.length < num) {
-      for (let i = 0; i < num - fullData.length; i++) {
-        let _data = {
-          ...dw_bednet_mx_spring
-          // bednetmx_partid: LjDetailRef.value._mainData.bednetmxid,
-          // bednetmxid:
-        };
-        await $table.insertAt(_data, -1);
-      }
-    }
-  }
-};
 </script>

+ 235 - 193
JLHWEB/src/views/quote/bednetQuote/hooks/index.tsx

@@ -246,7 +246,7 @@ export const useHooks = (t?: any) => {
   const rModelSetMtrlSpongeTc = (data: any, item: any) => {
     if (item) {
       data.sponge_tc_mtrlid = item.mtrlid;
-      data.mtrl_tc_sponge_name = item.mtrlname;
+      data.mtrl_sponge_tc_name = item.mtrlname;
     }
   };
 
@@ -327,6 +327,7 @@ export const useHooks = (t?: any) => {
       data.sponge_price = item.pricelistprice;
       data.mtrl_sponge_name = item.mtrlname;
     }
+    console.log("rModelSetMtrlSponge after data :>> ", data);
   };
 
   const rModelClearMtrlSponge = (data: any) => {
@@ -343,7 +344,8 @@ export const useHooks = (t?: any) => {
 
     console.log('bednetData.typename != "袋装网" :>> ', bednetData.typename, bednetData.typename != "袋装网");
 
-    if (bednetData.typename != "袋装网") {
+    // if (bednetData.typename != "袋装网") {
+    if (Number(bednetData.bednettypeid) != 11) {
       hFields.push("if_part");
       // 圆网和拉丝网 没有 入袋无纺布和底面无纺布
       hFields.push("fabrics1_mtrlid");
@@ -390,6 +392,43 @@ export const useHooks = (t?: any) => {
     });
   };
 
+  /**
+   * @description 重载床网明细和多区明细,返回多区明细数据
+   * @param bednetData
+   * @returns
+   */
+  const reload_dw2 = async (bednetData: any, cb?: any) => {
+    state.bednetMxData = [];
+    state.bednetMxSprintData = [];
+    let res = await getDataMxAdd(state.initParamsMx);
+    let result = dataCallbackMx(res);
+
+    columnsMx.value = wf_hide_dw2(bednetData, result.tableinfo.columns).map(item => {
+      let _default = columnsMx_default.value.find(t => t.field == item.field);
+      if (_default) {
+        item = defaultsDeep(item, _default);
+      }
+      return item;
+    });
+    console.log("reset columnsMx.value :>> ", columnsMx.value);
+    // cb && cb(result);
+
+    let res2 = await getDataMxSpring(state.initParamsMx);
+    let result2 = dataCallbackMx(res2);
+    // columnsMxSpring.value = result.tableinfo.columns;
+    columnsMxSpring.value = result2.tableinfo.columns.map(item => {
+      let _default = columnsMxSpring_default.value.find(t => t.field == item.field);
+      if (_default) {
+        item = defaultsDeep(item, _default);
+      }
+      return item;
+    });
+
+    console.log("reload_dw2 columnsMxSpring.value :>> ", columnsMxSpring.value);
+
+    cb && cb({ mx: result, spring: result2 });
+  };
+
   /**
    * @description 变更床垫分类时,重载明细数据 dw_1 itemchange
    * @author w_mattress_add dw_1 itemchange
@@ -480,34 +519,9 @@ export const useHooks = (t?: any) => {
     _mainData.edge_weight_formula = rBednetType.edge_weight_formula;
     _mainData.fork_weight_formula = rBednetType.fork_weight_formula;
 
-    state.bednetMxData = [];
-    state.bednetMxSprintData = [];
-    res = await getDataMxAdd(state.initParamsMx);
-    let result = dataCallbackMx(res);
-
-    columnsMx.value = wf_hide_dw2(rBednetType, result.tableinfo.columns).map(item => {
-      let _default = columnsMx_default.value.find(t => t.field == item.field);
-      if (_default) {
-        item = defaultsDeep(item, _default);
-      }
-      return item;
-    });
-    console.log("reset columnsMx.value :>> ", columnsMx.value);
-    state.bednetMxData = [dw_bednet_define_add_mx];
-
-    if (rBednetType.if_part == 0) {
-    }
-    res = await getDataMxSpring(state.initParamsMx);
-    result = dataCallbackMx(res);
-    // columnsMxSpring.value = result.tableinfo.columns;
-    columnsMxSpring.value = result.tableinfo.columns.map(item => {
-      let _default = columnsMxSpring_default.value.find(t => t.field == item.field);
-      if (_default) {
-        item = defaultsDeep(item, _default);
-      }
-      return item;
+    reload_dw2(rBednetType, () => {
+      state.bednetMxData = [dw_bednet_define_add_mx];
     });
-    // state.bednetMxSprintData = [dw_bednet_mx_spring];
 
     nextTick(() => {
       console.log("wf_b_bednet_type_ch state.vxeTableMxRef :>> ", state.vxeTableMxRef);
@@ -787,7 +801,7 @@ export const useHooks = (t?: any) => {
         editable: ALLOW_EDIT_STATE,
         render: (scope: any) => {
           console.log("mtrlname hooks render scope :>> ", scope);
-          console.log("mtrlname hooks render LjDetailRef.value._mainData :>> ", state.LjDetailRef);
+          console.log("mtrl_sponge_name hooks render LjDetailRef.value._mainData :>> ", state.LjDetailRef);
           const { column, row, status } = scope;
           let field = column.field;
           let _label = column.title;
@@ -815,14 +829,19 @@ export const useHooks = (t?: any) => {
           return (
             <>
               <MtrldefSelect
-                value={state.LjDetailRef._mainData.sponge_mtrlid}
+                value={scope.searchParam.sponge_mtrlid}
                 {...params}
+                disabled={!ALLOW_EDIT_STATE.includes(status)}
                 clearable
                 placeholder={_label}
-                onOpenModal={() => fModelChoseMtrl(state.LjDetailRef._mainData, params, rModelSetMtrlSponge)}
-                onSelect={(val: any) => rModelSetMtrlSponge(state.LjDetailRef._mainData, val)}
-                onClear={() => rModelClearMtrlSponge(state.LjDetailRef._mainData)}
-              />
+                onOpenModal={() => fModelChoseMtrl(scope.searchParam, params, rModelSetMtrlSponge)}
+                onSelect={(val: any) => rModelSetMtrlSponge(scope.searchParam, val)}
+                onClear={() => rModelClearMtrlSponge(scope.searchParam)}
+              >
+                {{
+                  label: () => scope.searchParam.mtrl_sponge_name
+                }}
+              </MtrldefSelect>
             </>
           );
         }
@@ -881,14 +900,19 @@ export const useHooks = (t?: any) => {
           return (
             <>
               <MtrldefSelect
-                value={state.LjDetailRef._mainData.sponge_tc_mtrlid}
+                value={scope.searchParam.sponge_tc_mtrlid}
                 {...params}
+                disabled={!ALLOW_EDIT_STATE.includes(status)}
                 clearable
                 placeholder={_label}
-                onOpenModal={() => fModelChoseMtrl(state.LjDetailRef._mainData, params, rModelSetMtrlSpongeTc)}
-                onSelect={(val: any) => rModelSetMtrlSpongeTc(state.LjDetailRef._mainData, val)}
-                onClear={() => rModelClearMtrlSpongeTc(state.LjDetailRef._mainData)}
-              />
+                onOpenModal={() => fModelChoseMtrl(scope.searchParam, params, rModelSetMtrlSpongeTc)}
+                onSelect={(val: any) => rModelSetMtrlSpongeTc(scope.searchParam, val)}
+                onClear={() => rModelClearMtrlSpongeTc(scope.searchParam)}
+              >
+                {{
+                  label: () => scope.searchParam.mtrl_sponge_tc_name
+                }}
+              </MtrldefSelect>
             </>
           );
         }
@@ -947,14 +971,19 @@ export const useHooks = (t?: any) => {
           return (
             <>
               <MtrldefSelect
-                value={state.LjDetailRef._mainData.edge_mtrlid}
+                value={scope.searchParam.edge_mtrlid}
                 {...params}
+                disabled={!ALLOW_EDIT_STATE.includes(status)}
                 clearable
                 placeholder={_label}
-                onOpenModal={() => fModelChoseMtrl(state.LjDetailRef._mainData, params, rModelSetMtrlEdge)}
-                onSelect={(val: any) => rModelSetMtrlEdge(state.LjDetailRef._mainData, val)}
-                onClear={() => rModelClearMtrlEdge(state.LjDetailRef._mainData)}
-              />
+                onOpenModal={() => fModelChoseMtrl(scope.searchParam, params, rModelSetMtrlEdge)}
+                onSelect={(val: any) => rModelSetMtrlEdge(scope.searchParam, val)}
+                onClear={() => rModelClearMtrlEdge(scope.searchParam)}
+              >
+                {{
+                  label: () => scope.searchParam.mtrl_edge_name
+                }}
+              </MtrldefSelect>
             </>
           );
         }
@@ -995,14 +1024,19 @@ export const useHooks = (t?: any) => {
           return (
             <>
               <MtrldefSelect
-                value={state.LjDetailRef._mainData.felt_mtrlid}
+                value={scope.searchParam.felt_mtrlid}
                 {...params}
+                disabled={!ALLOW_EDIT_STATE.includes(status)}
                 clearable
                 placeholder={_label}
-                onOpenModal={() => fModelChoseMtrl(state.LjDetailRef._mainData, params, rModelSetMtrlFelt)}
-                onSelect={(val: any) => rModelSetMtrlFelt(state.LjDetailRef._mainData, val)}
-                onClear={() => rModelClearMtrlFelt(state.LjDetailRef._mainData)}
-              />
+                onOpenModal={() => fModelChoseMtrl(scope.searchParam, params, rModelSetMtrlFelt)}
+                onSelect={(val: any) => rModelSetMtrlFelt(scope.searchParam, val)}
+                onClear={() => rModelClearMtrlFelt(scope.searchParam)}
+              >
+                {{
+                  label: () => scope.searchParam.mtrl_felt_name
+                }}
+              </MtrldefSelect>
             </>
           );
         }
@@ -1042,14 +1076,19 @@ export const useHooks = (t?: any) => {
           return (
             <>
               <MtrldefSelect
-                value={state.LjDetailRef._mainData.felt_x_mtrlid}
+                value={scope.searchParam.felt_x_mtrlid}
                 {...params}
+                disabled={!ALLOW_EDIT_STATE.includes(status)}
                 clearable
                 placeholder={_label}
-                onOpenModal={() => fModelChoseMtrl(state.LjDetailRef._mainData, params, rModelSetMtrlFeltX)}
-                onSelect={(val: any) => rModelSetMtrlFeltX(state.LjDetailRef._mainData, val)}
-                onClear={() => rModelClearMtrlFeltX(state.LjDetailRef._mainData)}
-              />
+                onOpenModal={() => fModelChoseMtrl(scope.searchParam, params, rModelSetMtrlFeltX)}
+                onSelect={(val: any) => rModelSetMtrlFeltX(scope.searchParam, val)}
+                onClear={() => rModelClearMtrlFeltX(scope.searchParam)}
+              >
+                {{
+                  label: () => scope.searchParam.mtrl_felt_x_name
+                }}
+              </MtrldefSelect>
             </>
           );
         }
@@ -1445,7 +1484,7 @@ export const useHooks = (t?: any) => {
           return false;
         },
         editvisible: (scope: any) => {
-          if (ALLOW_EDIT_STATE.includes(scope.status) && Number(scope.searchParam.bednettypeid) == 11) {
+          if (Number(scope.searchParam.bednettypeid) == 11) {
             return true;
           }
           return false;
@@ -1453,7 +1492,12 @@ export const useHooks = (t?: any) => {
         render: scope => {
           return (
             <>
-              <el-select v-model={scope.searchParam.duo_qv_str} clearable onChange={handelChangeDuoqv}>
+              <el-select
+                v-model={scope.searchParam.duo_qv_str}
+                disabled={!ALLOW_EDIT_STATE.includes(scope.status)}
+                clearable
+                onChange={handelChangeDuoqv}
+              >
                 <el-option label="单" value="单" />
                 <el-option label="3" value="3" />
                 <el-option label="5" value="5" />
@@ -1466,6 +1510,10 @@ export const useHooks = (t?: any) => {
     }
   ];
 
+  /**
+   * @description 多区select,控制多区明细条数
+   * @param val
+   */
   const handelChangeDuoqv = (val: any) => {
     console.log("duo_qv_str val :>> ", val);
     let num = 0;
@@ -1478,7 +1526,12 @@ export const useHooks = (t?: any) => {
     let { fullData } = state.vxeTableMxRef.element.getTableData();
     fullData[0].if_part = Boolean(num);
 
+    // const { areaArr, total } = setMxSpringLength();
+    // console.log("areaArr, total :>> ", areaArr, total);
+
     if (num > 0) {
+      fullData[0].springid = 0;
+      fullData[0].springname = "";
       nextTick(() => {
         setTimeout(async () => {
           console.log(
@@ -1493,23 +1546,86 @@ export const useHooks = (t?: any) => {
 
             if (num > 0 && springData.length < num) {
               let arr = [];
+              // let sum = Number(fullData[0].spring_qty_length);
+              // let lengthValSum = 0;
               for (let i = 0; i < num - springData.length; i++) {
-                arr.push(dw_bednet_mx_spring);
+                // let lengthVal = 0;
+                // if (i < num - springData.length - 1) {
+                //   if (sum > 0) {
+                //     lengthVal = (areaArr[i] / total) * sum;
+                //     lengthValSum += lengthVal;
+                //   }
+                // } else {
+                //   lengthVal = sum - lengthValSum;
+                // }
+                // console.log("lengthVal :>> ", lengthVal);
+
+                let _data = {
+                  ...dw_bednet_mx_spring,
+                  spring_qty_width: Number(fullData[0].spring_qty_width),
+                  spring_qty_length: 0
+                };
+                arr.push(_data);
               }
               console.log("$table :>> ", $table, arr);
-              // let _data = {
-              //   ...dw_bednet_mx_spring
-              //   // bednetmx_partid: LjDetailRef.value._mainData.bednetmxid,
-              //   // bednetmxid:
-              // };
               await $table.insertAt(arr, -1);
+            } else if (springData.length > num) {
+              let arrs = springData.filter((item, index) => index + 1 > num);
+              await $table.remove(arrs);
             }
+
+            setMxSpringLength();
           }
         }, 200);
       });
     }
   };
 
+  const setMxSpringLength = (val = state.currentArea) => {
+    let item = state.AreaList.find(t => t.areaname == val);
+    console.log("item :>> ", item, state.AreaList);
+    let arr = [];
+    for (const key in item) {
+      if (key.indexOf("area_") > -1 && Number(item[key]) > 0) {
+        arr.push(Number(item[key]));
+      }
+    }
+
+    let totality = arr.reduce((a, b) => a + b, 0);
+
+    // return { areaArr: arr, total: totality };
+    let { fullData } = state.vxeTableMxRef.element.getTableData();
+    let sum = Number(fullData[0].spring_qty_length);
+    console.log("arr, totality  :>> ", arr, totality, sum);
+
+    let { fullData: springData } = state.vxeTableMxSpringRef.element.getTableData();
+    // fullData[0].if_part = Boolean(num);
+    let lengthValSum = 0;
+
+    springData.forEach((item, index) => {
+      let lengthVal = 0;
+      if (arr.length >= index + 1) {
+        console.log("index, arr.length  :>> ", index, arr.length);
+        if (index <= arr.length - 1) {
+          if (index == arr.length - 1) {
+            lengthVal = sum - lengthValSum;
+          } else {
+            lengthVal = (arr[index] / totality) * sum;
+            lengthValSum += lengthVal;
+          }
+        } else {
+          lengthVal = 0;
+        }
+        console.log("lengthVal :>> ", lengthVal);
+      }
+      item.spring_qty_length = lengthVal;
+    });
+
+    console.log("state.vxeTableMxSpringRef.element :>> ", state.vxeTableMxSpringRef.element);
+
+    state.vxeTableMxSpringRef.element.updateFooter();
+  };
+
   const columnsMx_default = ref<ColumnProps<any>[]>([
     {
       field: "bednet_height",
@@ -1545,7 +1661,7 @@ export const useHooks = (t?: any) => {
         const { column, row, status } = scope;
         return (
           <>
-            <el-input-number v-model={row.spring_qty_length} style="width: unset" />
+            <el-input-number v-model={row.spring_qty_length} onChange={() => setMxSpringLength()} style="width: unset" />
           </>
         );
       }
@@ -1836,9 +1952,11 @@ export const useHooks = (t?: any) => {
 
     wf_set_if_doublespring();
 
-    if (!wf_check_rule()) return;
+    if (!wf_check_rule()) return false;
+
+    if (!(await wf_check_required())) return false;
 
-    if (!wf_check_required()) return;
+    return true;
   };
 
   /**
@@ -1916,13 +2034,23 @@ export const useHooks = (t?: any) => {
     let deptItem = deptEnum.find((item: any) => Number(item.value) == _mainData.deptid);
     let typeItem = bednettypeEnum.find((item: any) => Number(item.value) == _mainData.bednettypeid);
 
-    if (typeItem.indexOf("圆网") > -1 && deptItem.indexOf("外贸") === -1 && deptItem.indexOf("国外") === -1) {
+    console.log("typeItem :>> ", typeItem, deptItem);
+    if (
+      typeItem &&
+      deptItem &&
+      typeItem.label.indexOf("圆网") > -1 &&
+      deptItem.label.indexOf("外贸") === -1 &&
+      deptItem.label.indexOf("国外") === -1
+    ) {
       _mainData.if_doublespring = 1;
     }
   };
 
   const wf_check_rule = (): boolean => {
     let { fullData: mxlist } = state.vxeTableMxRef.element.getTableData();
+    if (!state.vxeTableMxSpringRef) {
+      return true;
+    }
     let { fullData: springlist } = state.vxeTableMxSpringRef.element.getTableData();
 
     for (let mx of mxlist) {
@@ -1934,22 +2062,16 @@ export const useHooks = (t?: any) => {
           sum_length += parseFloat(spring.spring_qty_length);
 
           if (Number(mx.spring_qty_width) != Number(spring.spring_qty_width)) {
-            ElMessage({
-              type: "info",
-              message: `多区袋装明细列表,第${spring.pid}行,弹簧个数排列宽填写错误!`
-            });
-            return false;
+            throw new Error(`多区袋装明细列表,第${spring.pid}行,弹簧个数排列宽填写错误!`);
           }
         }
 
         if (parseFloat(mx.spring_qty_length) != sum_length) {
-          ElMessage({
-            type: "info",
-            message: `床网明细列表 弹簧个数排列长${parseFloat(
+          throw new Error(
+            `床网明细列表 弹簧个数排列长${parseFloat(
               mx.spring_qty_length
             )}不等于 多区袋装明细列表 弹簧个数排列长合计${sum_length}!`
-          });
-          return false;
+          );
         }
       } else if (Number(mx.if_hard_around) === 1) {
         // 左边 弹簧个数排列宽   小于   右边每行  弹簧个数排列宽
@@ -1958,23 +2080,17 @@ export const useHooks = (t?: any) => {
           sum_length += parseFloat(spring.spring_qty_length);
 
           if (Number(mx.spring_qty_width) < Number(spring.spring_qty_width)) {
-            ElMessage({
-              type: "info",
-              message: `多区袋装明细列表,第${spring.pid}行,弹簧个数排列宽填写错误!`
-            });
-            return false;
+            throw new Error(`多区袋装明细列表,第${spring.pid}行,弹簧个数排列宽填写错误!`);
           }
         }
 
         //左边 弹簧个数排列长  小于  右边每行合计  弹簧个数排列长
         if (parseFloat(mx.spring_qty_length) < sum_length) {
-          ElMessage({
-            type: "info",
-            message: `床网明细列表 弹簧个数排列长${parseFloat(
+          throw new Error(
+            `床网明细列表 弹簧个数排列长${parseFloat(
               mx.spring_qty_length
             )}小于 多区袋装明细列表 弹簧个数排列长合计${sum_length}!`
-          });
-          return false;
+          );
         }
       }
     }
@@ -1989,11 +2105,7 @@ export const useHooks = (t?: any) => {
     //检查有没有填写床网高
     for (let mx of mxlist) {
       if (mx.bednet_height + 0 == 0) {
-        ElMessage({
-          type: "info",
-          message: `请填写床网高!`
-        });
-        return false;
+        throw new Error("请填写床网高");
       } else {
         _mainData.mattress_height = parseFloat(mx.bednet_height);
       }
@@ -2002,27 +2114,15 @@ export const useHooks = (t?: any) => {
     // 检查有没有 填写 填充海绵高
     if (_mainData.sponge_tc_mtrlid + 0 > 0) {
       if (_mainData.sponge_tc_thickness + 0 == 0) {
-        ElMessage({
-          type: "info",
-          message: `请填写填充海绵厚度!`
-        });
-        return false;
+        throw new Error("请填写填充海绵厚度!");
       }
 
       if (_mainData.sponge_tc_height + 0 == 0) {
-        ElMessage({
-          type: "info",
-          message: `请填写填充海绵厚度!`
-        });
-        return false;
+        throw new Error("请填写填充海绵厚度!");
       }
 
       if ((_mainData.sponge_tc_thickness + 0 > 0 || _mainData.sponge_tc_height + 0 > 0) && _mainData.sponge_tc_mtrlid + 0 == 0) {
-        ElMessage({
-          type: "info",
-          message: `请选择填充海绵物料!`
-        });
-        return false;
+        throw new Error("请选择填充海绵物料!");
       }
     }
 
@@ -2030,95 +2130,55 @@ export const useHooks = (t?: any) => {
     if (_mainData.sponge_mtrlid > 0 && _mainData.sponge_height + 0 <= 0) _mainData.sponge_height = _mainData.mattress_height;
     if (_mainData.edge_mtrlid > 0 && _mainData.edge_height + 0 <= 0) _mainData.edge_height = _mainData.mattress_height;
 
-    _mainData.commission = _mainData.commission ?? 1;
-    _mainData.taxrate = _mainData.taxrate ?? 1;
-    _mainData.other_rate = _mainData.other_rate ?? 1;
-    _mainData.moneyrate = _mainData.moneyrate ?? 1;
+    _mainData.commission = _mainData.commission && Number(_mainData.commission) !== 0 ? _mainData.commission : 1;
+    _mainData.taxrate = _mainData.taxrate && Number(_mainData.taxrate) !== 0 ? _mainData.taxrate : 1;
+    _mainData.other_rate = _mainData.other_rate && Number(_mainData.other_rate) !== 0 ? _mainData.other_rate : 1;
+    _mainData.moneyrate = _mainData.moneyrate && Number(_mainData.moneyrate) !== 0 ? _mainData.moneyrate : 1;
 
-    if (_mainData.commission < 1) {
-      ElMessage({
-        type: "info",
-        message: `佣金点数不能小于1!`
-      });
-      return false;
+    if (Number(_mainData.commission) < 1) {
+      throw new Error("佣金点数不能小于1!");
     }
 
-    if (_mainData.taxrate < 1) {
-      ElMessage({
-        type: "info",
-        message: `税率不能小于1!`
-      });
-      return false;
+    if (Number(_mainData.taxrate) < 1) {
+      throw new Error("税率不能小于1!");
     }
 
-    if (_mainData.other_rate < 1) {
-      ElMessage({
-        type: "info",
-        message: `额外点数不能小于1!`
-      });
-      return false;
+    if (Number(_mainData.other_rate) < 1) {
+      throw new Error("额外点数不能小于1!");
     }
 
     if (_mainData.packtype && _mainData.packtype.length > 0) {
       _mainData.packtype = _mainData.packtype.trim();
 
       if (_mainData.packtype != "不压不卷" && _mainData.packqty + 0 == 0) {
-        ElMessage({
-          type: "info",
-          message: `请填写包装数量!`
-        });
-        return false;
+        throw new Error("请填写包装数量!");
       }
 
       if (_mainData.packtype != "不压不卷" && _mainData.packtype != "裸包装" && _mainData.transport_type + "" == "") {
-        ElMessage({
-          type: "info",
-          message: `请选择运输方式!`
-        });
-        return false;
+        throw new Error("请选择运输方式!");
       }
 
       if (_mainData.packtype == "卷包" && _mainData.packmtrl + "" == "") {
-        ElMessage({
-          type: "info",
-          message: `请选择包装材料!`
-        });
-        return false;
+        throw new Error("请选择包装材料!");
       }
     }
 
     await wf_factory_profitrate();
 
     if (_mainData.dept_profitrate + 0 == 0) {
-      ElMessage({
-        type: "info",
-        message: `部门利润率不能为0!`
-      });
-      return false;
+      throw new Error("部门利润率不能为0!");
     }
 
     if (_mainData.bednettypeid + 0 == 0) {
-      ElMessage({
-        type: "info",
-        message: `请选择床网类别!`
-      });
-      return false;
+      throw new Error("请选择床网类别!");
     }
 
     if (_mainData.sponge_mtrlid + 0 > 0 && _mainData.sponge_thickness + 0 == 0) {
-      ElMessage({
-        type: "info",
-        message: `请填写海绵厚度!`
-      });
-      return false;
+      throw new Error("请填写海绵厚度!");
     }
 
     if (_mainData.sponge_mtrlid + 0 == 0 && _mainData.sponge_thickness + 0 > 0) {
-      ElMessage({
-        type: "info",
-        message: `请选择海绵物料!`
-      });
-      return false;
+      throw new Error("请选择海绵物料!");
     }
 
     const bednettypeEnum = enumMap.get("bednettypeid");
@@ -2126,41 +2186,21 @@ export const useHooks = (t?: any) => {
 
     for (let mx of mxlist) {
       if (mx.bednet_height + 0 == 0) {
-        ElMessage({
-          type: "info",
-          message: `第${mx.pid}行,请填写床网高!`
-        });
-        return false;
+        throw new Error(`第${mx.pid}行,请填写床网高!`);
       }
       if (mx.spring_qty_width + 0 == 0) {
-        ElMessage({
-          type: "info",
-          message: `第${mx.pid}行,请填写弹簧排列个数-宽!`
-        });
-        return false;
+        throw new Error(`第${mx.pid}行,请填写弹簧排列个数-宽!`);
       }
       if (mx.spring_qty_length + 0 == 0) {
-        ElMessage({
-          type: "info",
-          message: `第${mx.pid}行,请填写弹簧排列个数-长!`
-        });
-        return false;
+        throw new Error(`第${mx.pid}行,请填写弹簧排列个数-长!`);
       }
 
-      if (typeItem.indexOf("袋装网") > -1 && mx.fabrics1_mtrlid + 0 == 0) {
-        ElMessage({
-          type: "info",
-          message: `第${mx.pid}行,请选择入袋无纺布!`
-        });
-        return false;
+      if (typeItem.label.indexOf("袋装网") > -1 && mx.fabrics1_mtrlid + 0 == 0) {
+        throw new Error(`第${mx.pid}行,请选择入袋无纺布!`);
       }
 
       if (mx.if_side_iron > 0 && mx.side_iron_qty + 0 == 0) {
-        ElMessage({
-          type: "info",
-          message: `第${mx.pid}行,请填写边铁条数!`
-        });
-        return false;
+        throw new Error(`第${mx.pid}行,请填写边铁条数!`);
       }
     }
 
@@ -2181,7 +2221,7 @@ export const useHooks = (t?: any) => {
     // 四周加硬逻辑
     if (mx.if_hard_around + 0 === 1) {
       let ls_temp_str = 0;
-      if (typeItem.indexOf("袋装") > -1) {
+      if (typeItem.label.indexOf("袋装") > -1) {
         ls_temp_str = (mx.hard_around_row + 0) * 2;
       } else {
         ls_temp_str = mx.hard_around_row + 0;
@@ -2203,7 +2243,7 @@ export const useHooks = (t?: any) => {
     // 四周口袋逻辑
     if (mx.if_pocket_around + 0 === 1) {
       let ls_temp_str = 0;
-      if (typeItem.indexOf("袋装") > -1) {
+      if (typeItem.label.indexOf("袋装") > -1) {
         ls_temp_str = (mx.pocket_around_row + 0) * 2;
       } else {
         ls_temp_str = mx.pocket_around_row + 0;
@@ -2669,12 +2709,14 @@ export const useHooks = (t?: any) => {
     columnsMxSpring,
     columnsBednet,
     dw_bednet_mx_spring,
+    reload_dw2,
     getData,
     getDataMx,
     getDataMxSpring,
     getDataMxAdd,
     dataCallback,
     dataCallbackMx,
-    wf_cmp_cb
+    wf_cmp_cb,
+    setMxSpringLength
   };
 };

+ 66 - 64
JLHWEB/src/views/quote/bednetQuote/index.vue

@@ -269,7 +269,7 @@ const action: detailAction[] = [
         ElMessage.warning(t("business.tips.mattress.records"));
         return;
       }
-      ElMessageBox.confirm(`是否确定要删除${curRecords.length}张床垫报价单吗?`, "询问", {
+      ElMessageBox.confirm(`是否确定要删除${curRecords.length}张报价单吗?`, "询问", {
         confirmButtonText: t("common.delText"),
         cancelButtonText: "否",
         type: "warning"
@@ -292,74 +292,76 @@ const action: detailAction[] = [
         });
     }
   }),
-  buttonDefault({
-    label: t("common.auditText"),
-    power: 63,
-    disabledTextCallBack: (data: any) => {
-      if (!CheckPower(63)) {
-        return `你没有【报价单-${t("common.auditText")}】的使用权限`;
-      }
-      return "";
-    },
-    clickFunc: item => {
-      const { curRecords } = getCurrentRecords(vxeTableRef.value);
-      ElMessageBox.confirm("是否确定要审核单据吗?", "询问", {
-        confirmButtonText: "是",
-        cancelButtonText: "否",
-        type: "warning"
-      })
-        .then(() => {
-          let list = curRecords.map((item: any) => {
-            return { bednetid: Number(item.bednetid) };
-          });
-          AuditBedNet({ list, type: 1 }).then(() => {
-            ElMessage.success("审核成功!");
-
-            vxeTableRef.value.refresh();
-          });
+  [
+    buttonDefault({
+      label: t("common.auditText"),
+      power: 63,
+      disabledTextCallBack: (data: any) => {
+        if (!CheckPower(63)) {
+          return `你没有【报价单-${t("common.auditText")}】的使用权限`;
+        }
+        return "";
+      },
+      clickFunc: item => {
+        const { curRecords } = getCurrentRecords(vxeTableRef.value);
+        ElMessageBox.confirm("是否确定要审核单据吗?", "询问", {
+          confirmButtonText: "是",
+          cancelButtonText: "否",
+          type: "warning"
         })
-        .catch((e: TypeError) => {
-          ElMessage({
-            type: "info",
-            message: "操作取消"
-          });
-        });
-    }
-  }),
-  buttonDefault({
-    label: t("common.withdrawAuditText"),
-    power: 64,
-    disabledTextCallBack: (data: any) => {
-      if (!CheckPower(64)) {
-        return `你没有【报价单-${t("common.withdrawAuditText")}】的使用权限`;
-      }
-      return "";
-    },
-    clickFunc: item => {
-      const { curRecords } = getCurrentRecords(vxeTableRef.value);
-      ElMessageBox.confirm("是否确定要撤审单据吗?", "询问", {
-        confirmButtonText: "是",
-        cancelButtonText: "否",
-        type: "warning"
-      })
-        .then(() => {
-          let list = curRecords.map((item: any) => {
-            return { bednetid: Number(item.bednetid) };
-          });
-          AuditBedNet({ list, type: 0 }).then(() => {
-            ElMessage.success("撤审成功!");
+          .then(() => {
+            let list = curRecords.map((item: any) => {
+              return { bednetid: Number(item.bednetid) };
+            });
+            AuditBedNet({ list, type: 1 }).then(() => {
+              ElMessage.success("审核成功!");
 
-            vxeTableRef.value.refresh();
+              vxeTableRef.value.refresh();
+            });
+          })
+          .catch((e: TypeError) => {
+            ElMessage({
+              type: "info",
+              message: "操作取消"
+            });
           });
+      }
+    }),
+    buttonDefault({
+      label: t("common.withdrawAuditText"),
+      power: 64,
+      disabledTextCallBack: (data: any) => {
+        if (!CheckPower(64)) {
+          return `你没有【报价单-${t("common.withdrawAuditText")}】的使用权限`;
+        }
+        return "";
+      },
+      clickFunc: item => {
+        const { curRecords } = getCurrentRecords(vxeTableRef.value);
+        ElMessageBox.confirm("是否确定要撤审单据吗?", "询问", {
+          confirmButtonText: "是",
+          cancelButtonText: "否",
+          type: "warning"
         })
-        .catch((e: TypeError) => {
-          ElMessage({
-            type: "info",
-            message: "操作取消"
+          .then(() => {
+            let list = curRecords.map((item: any) => {
+              return { bednetid: Number(item.bednetid) };
+            });
+            AuditBedNet({ list, type: 0 }).then(() => {
+              ElMessage.success("撤审成功!");
+
+              vxeTableRef.value.refresh();
+            });
+          })
+          .catch((e: TypeError) => {
+            ElMessage({
+              type: "info",
+              message: "操作取消"
+            });
           });
-        });
-    }
-  }),
+      }
+    })
+  ],
   buttonDefault({
     label: t("common.copyQuote"),
     clickFunc: item => {

+ 72 - 62
JLHWEB/src/views/quote/mattressQuote/detail.vue

@@ -14,9 +14,9 @@
   >
     <template #rightBtn="scope">
       <el-select v-model="scope.data.dannum_rate" placeholder="大小单" style="width: 80px">
-        <el-option label="散单" value="1" />
-        <el-option label="标准" value="2" />
-        <el-option label="大单" value="3" />
+        <el-option label="散单" :value="1" />
+        <el-option label="标准" :value="2" />
+        <el-option label="大单" :value="3" />
       </el-select>
     </template>
     <!-- @to-pin-detail="emit('toPinDetail')" -->
@@ -47,6 +47,7 @@
             :tool-button="[]"
             :auto-load-layout="false"
             collapseButtons
+            :request-auto="false"
           >
           </LjVxeTable>
         </el-tab-pane>
@@ -65,6 +66,7 @@
             :dwname="DwnameEnum.mattressQuoteMx"
             :table-props="tableProps_mx"
             :tool-button="[]"
+            :request-auto="false"
             :auto-load-layout="false"
             collapseButtons
           >
@@ -85,6 +87,7 @@
             :dwname="DwnameEnum.mattressQuoteMx"
             :table-props="tableProps_mx"
             :tool-button="[]"
+            :request-auto="false"
             :auto-load-layout="false"
             collapseButtons
           >
@@ -124,6 +127,7 @@
             :dwname="DwnameEnum.mattressQuoteMx"
             :table-props="tableProps_mx"
             :tool-button="[]"
+            :request-auto="false"
             :auto-load-layout="false"
             collapseButtons
           >
@@ -163,6 +167,7 @@
             :dwname="DwnameEnum.mattressQuoteMx"
             :table-props="tableProps_mx"
             :tool-button="[]"
+            :request-auto="false"
             :auto-load-layout="false"
             collapseButtons
           >
@@ -178,6 +183,7 @@
             :dwname="DwnameEnum.mattressQuoteMx"
             :table-props="tableProps_mx"
             :tool-button="[]"
+            :request-auto="false"
             :auto-load-layout="false"
             collapseButtons
           >
@@ -204,6 +210,7 @@
         :dwname="DwnameEnum.mattressQuoteMxBednet"
         :table-props="tableProps_mx"
         :tool-button="[]"
+        :request-auto="false"
         :auto-load-layout="false"
         collapseButtons
       >
@@ -234,6 +241,7 @@
         :dwname="DwnameEnum.mattressQuoteMxCushions"
         :table-props="tableProps_mx"
         :tool-button="[]"
+        :request-auto="false"
         :auto-load-layout="false"
         collapseButtons
       >
@@ -269,6 +277,7 @@
         :dwname="DwnameEnum.mattressQuoteMxAccessories"
         :table-props="tableProps_mx"
         :tool-button="[]"
+        :request-auto="false"
         :auto-load-layout="false"
         collapseButtons
       >
@@ -299,6 +308,7 @@
         :dwname="DwnameEnum.mattressQuoteMxPackag"
         :table-props="tableProps_mx"
         :tool-button="[]"
+        :request-auto="false"
         :auto-load-layout="false"
         collapseButtons
       >
@@ -929,47 +939,47 @@ const orderDefaultAction = [
         loadingStatus.save = true;
 
         let mattress = LjDetailRef.value._mainData;
-        console.log("save cushionsMxData :>> ", LjDetailRef.value._mainData, mattress?.if_d_chai, Number(mattress.if_d_chai));
-        mattress.mattressid = Number(mattress.mattressid ?? 0);
-        mattress.if_moneyrate = Number(mattress.if_moneyrate ?? 0);
-        mattress.if_bcp_type = Number(mattress.if_bcp_type ?? 0);
-        mattress.if_d_chai = Number(mattress.if_d_chai ?? 0);
-        mattress.if_m_chai = Number(mattress.if_m_chai ?? 0);
-        mattress.if_m_wbutao_way = Number(mattress.if_m_wbutao_way ?? 0);
-        mattress.if_moneyrate = Number(mattress.if_moneyrate ?? 0);
-        mattress.if_moneyrate = Number(mattress.if_moneyrate ?? 0);
-        mattress.if_n_butao = Number(mattress.if_n_butao ?? 0);
-        mattress.if_w_butao = Number(mattress.if_w_butao ?? 0);
-        mattress.if_z_chai = Number(mattress.if_z_chai ?? 0);
-        mattress.if_zhedie_type = Number(mattress.if_zhedie_type ?? 0);
-        mattress.packqty = Number(mattress.packqty ?? 0);
-        mattress.woodpallettype = mattress?.woodpallettype ?? "0";
-        mattress.total_hr_cost = mattress?.total_hr_cost ?? "0";
-        mattress.total_material_cost = mattress?.total_material_cost ?? "0";
-        mattress.total_hr_cost = mattress?.total_hr_cost ?? 0;
-        mattress.total_material_cost = mattress?.total_material_cost ?? 0;
-        mattress.total_fees_cost = mattress?.total_fees_cost ?? 0;
-        mattress.total_cost = mattress?.total_cost ?? 0;
-        mattress.commissionrate = mattress?.commissionrate ?? 0;
-        mattress.fob = mattress?.fob ?? 0;
-        mattress.profitrate = mattress?.profitrate ?? 0;
-        mattress.nottax_factory_cost = mattress?.nottax_factory_cost ?? 0;
-        mattress.nottax_dept_cost = mattress?.nottax_dept_cost ?? 0;
-        mattress.foreign_cost = mattress?.foreign_cost ?? 0;
-        mattress.diameter = mattress?.diameter ?? 0;
-        mattress.area = mattress?.area ?? 0;
-        mattress.cabinet_type = mattress?.cabinet_type ?? 0;
-        mattress.hrcost = mattress?.hrcost ?? 0;
-        mattress.biandaicost = mattress?.biandaicost ?? 0;
-        mattress.flag = mattress?.flag ?? 0;
-        mattress.dept_profitrate_rangli = mattress?.dept_profitrate_rangli ?? 0;
-        mattress.profitrate_point = mattress?.profitrate_point ?? 0;
-        mattress.chaizhuang_point = mattress?.chaizhuang_point ?? 0;
-        mattress.haimian_point = mattress?.haimian_point ?? 0;
-        mattress.qr_auditingdate = mattress?.qr_auditingdate ?? 0;
-        mattress.zhizao_amt = mattress?.zhizao_amt ?? 0;
-        mattress.foreign_cost_bz = mattress?.foreign_cost_bz ?? 0;
-        mattress.cubage = mattress?.cubage ?? 0;
+        // console.log("save cushionsMxData :>> ", LjDetailRef.value._mainData, mattress?.if_d_chai, Number(mattress.if_d_chai));
+        // mattress.mattressid = Number(mattress.mattressid ?? 0);
+        // mattress.if_moneyrate = Number(mattress.if_moneyrate ?? 0);
+        // mattress.if_bcp_type = Number(mattress.if_bcp_type ?? 0);
+        // mattress.if_d_chai = Number(mattress.if_d_chai ?? 0);
+        // mattress.if_m_chai = Number(mattress.if_m_chai ?? 0);
+        // mattress.if_m_wbutao_way = Number(mattress.if_m_wbutao_way ?? 0);
+        // mattress.if_moneyrate = Number(mattress.if_moneyrate ?? 0);
+        // mattress.if_moneyrate = Number(mattress.if_moneyrate ?? 0);
+        // mattress.if_n_butao = Number(mattress.if_n_butao ?? 0);
+        // mattress.if_w_butao = Number(mattress.if_w_butao ?? 0);
+        // mattress.if_z_chai = Number(mattress.if_z_chai ?? 0);
+        // mattress.if_zhedie_type = Number(mattress.if_zhedie_type ?? 0);
+        // mattress.packqty = Number(mattress.packqty ?? 0);
+        // mattress.woodpallettype = mattress?.woodpallettype ?? "0";
+        // mattress.total_hr_cost = mattress?.total_hr_cost ?? "0";
+        // mattress.total_material_cost = mattress?.total_material_cost ?? "0";
+        // mattress.total_hr_cost = mattress?.total_hr_cost ?? 0;
+        // mattress.total_material_cost = mattress?.total_material_cost ?? 0;
+        // mattress.total_fees_cost = mattress?.total_fees_cost ?? 0;
+        // mattress.total_cost = mattress?.total_cost ?? 0;
+        // mattress.commissionrate = mattress?.commissionrate ?? 0;
+        // mattress.fob = mattress?.fob ?? 0;
+        // mattress.profitrate = mattress?.profitrate ?? 0;
+        // mattress.nottax_factory_cost = mattress?.nottax_factory_cost ?? 0;
+        // mattress.nottax_dept_cost = mattress?.nottax_dept_cost ?? 0;
+        // mattress.foreign_cost = mattress?.foreign_cost ?? 0;
+        // mattress.diameter = mattress?.diameter ?? 0;
+        // mattress.area = mattress?.area ?? 0;
+        // mattress.cabinet_type = mattress?.cabinet_type ?? 0;
+        // mattress.hrcost = mattress?.hrcost ?? 0;
+        // mattress.biandaicost = mattress?.biandaicost ?? 0;
+        // mattress.flag = mattress?.flag ?? 0;
+        // mattress.dept_profitrate_rangli = mattress?.dept_profitrate_rangli ?? 0;
+        // mattress.profitrate_point = mattress?.profitrate_point ?? 0;
+        // mattress.chaizhuang_point = mattress?.chaizhuang_point ?? 0;
+        // mattress.haimian_point = mattress?.haimian_point ?? 0;
+        // mattress.qr_auditingdate = mattress?.qr_auditingdate ?? 0;
+        // mattress.zhizao_amt = mattress?.zhizao_amt ?? 0;
+        // mattress.foreign_cost_bz = mattress?.foreign_cost_bz ?? 0;
+        // mattress.cubage = mattress?.cubage ?? 0;
 
         let mattressMx = [];
         fabricMxTabList.value.map(t => {
@@ -1018,24 +1028,24 @@ const orderDefaultAction = [
         };
         try {
           console.log("综合 _param_mf :>> ", _param_mf);
-          // await SaveMattress(_param_mf)
-          //   .then(res => {
-          //     ElNotification({
-          //       title: "温馨提示",
-          //       message: t("sys.api.sueccessToSave"),
-          //       type: "success"
-          //     });
-          //     if (res.mattressid) {
-          //       router.replace(`/mattressQuote/detail?id=${res.mattressid}`);
-          //     } else {
-          //       router.replace("/mattressQuote");
-          //     }
-          //     loadingStatus.save = false;
-          //   })
-          //   .catch(error => {
-          //     console.log("error !! :>> ", error);
-          //     loadingStatus.save = false;
-          //   });
+          await SaveMattress(_param_mf)
+            .then(res => {
+              ElNotification({
+                title: "温馨提示",
+                message: t("sys.api.sueccessToSave"),
+                type: "success"
+              });
+              if (res.mattressid) {
+                router.replace(`/mattressQuote/detail?id=${res.mattressid}`);
+              } else {
+                router.replace("/mattressQuote");
+              }
+              loadingStatus.save = false;
+            })
+            .catch(error => {
+              console.log("error !! :>> ", error);
+              loadingStatus.save = false;
+            });
         } catch (error) {
           ElMessage.error(t("sys.api.operationFailed"));
         }

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

@@ -1765,7 +1765,7 @@ export const useHooks = (t?: any) => {
 
       fullData.map(item => {
         let tFormula = res?.datatable.find(itm => itm.formulakind == item.formulakind);
-        state[t.ref].element.setRow(item, {
+        state.cushionsMxRef.element.setRow(item, {
           formulaid: tFormula.formulaid
         });
       });

+ 3 - 0
JLHWEB/src/views/system/selector/mtrldef/select.vue

@@ -9,6 +9,9 @@
     @select="handleSelect"
     @open-modal="openModal"
   >
+    <template #label v-if="$slots?.label">
+      <slot name="label"></slot>
+    </template>
     <template #header>
       <div class="table-header lj-select__table">
         <div class="table-tr">