Browse Source

JLHWEB:1、完成床网、床垫报价单数据核对
2、床垫报价单,床网tab,新增弹窗新增修改床网报价单

JohnnyChan 5 months ago
parent
commit
19ffa1665d

+ 8 - 17
JLHWEB/src/components/LjDrawer/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <el-drawer v-model="drawer" v-bind="{ ...drawerDefineProp, ...$attrs }">
+  <el-drawer v-model="drawer" v-bind="{ ...drawerDefineProp, ...$attrs }" :key="drawerKey">
     <template v-for="slotKey in Object.keys($slots)" #[slotKey]="scope">
       <slot :name="slotKey" v-bind="scope"></slot>
     </template>
@@ -47,23 +47,14 @@ const drawerDefineProp: any = {
 };
 
 const drawer = ref(false);
-// const slots = useSlots();
-function show() {
+const drawerKey = ref(0);
+const show = () => {
+  drawerKey.value++;
   drawer.value = true;
-}
-function hide() {
+};
+const hide = () => {
   drawer.value = false;
-}
-function confirmClick() {
-  // ElMessageBox.confirm(`Are you confirm to chose ${radio1.value} ?`)
-  //   .then(() => {
-  //     drawer.value = false;
-  //   })
-  //   .catch(() => {
-  //     // catch error
-  //   });
-}
-
+};
 // 注入响应式断点
 const breakPoint = ref<BreakPoint>("xl");
 // 监听屏幕变化
@@ -108,7 +99,7 @@ onDeactivated(() => {
   window.removeEventListener("resize", resize);
 });
 
-defineExpose({ breakPoint, show, hide, confirmClick });
+defineExpose({ breakPoint, show, hide });
 </script>
 
 <style lang="scss"></style>

+ 1 - 1
JLHWEB/src/components/LjVxeTable/index.vue

@@ -243,7 +243,7 @@
         <slot></slot>
         <template v-for="item in tableColumns" :key="item">
           <!-- checkbox || seq || expand -->
-          <vxe-column v-bind="item" :align="item.align ?? 'center'" v-if="item.type && TABLE_TYPE_FILTER.includes(item.type)">
+          <vxe-column v-bind="item" :align="item.align ?? 'center'" v-if="item?.type && TABLE_TYPE_FILTER.includes(item.type)">
             <template #content="scope" v-if="item.type == 'expand'">
               <slot :name="item.type" v-bind="scope"></slot>
             </template>

+ 1 - 1
JLHWEB/src/hooks/useDwLayout.tsx

@@ -225,7 +225,7 @@ export const useDwLayout = (
    */
   const flatColumnsFunc = (argColumns: ColumnProps[], dwMap: Map<KeyType, any> = new Map(), flatArr: ColumnProps[] = []) => {
     argColumns.forEach(async (col: any) => {
-      if (col._children?.length) flatArr.push(...flatColumnsFunc(col._children, dwMap));
+      if (col?._children?.length) flatArr.push(...flatColumnsFunc(col._children, dwMap));
 
       if (dwMap.size) {
         // 读取个性设置属性

+ 1 - 1
JLHWEB/src/layouts/components/Header/components/Avatar.vue

@@ -54,7 +54,7 @@ import AvatarIcon from "./AvatarIcon.vue";
 
 interface AvatarProp {
   size?: "small" | "default" | "large";
-  onlyIcon: boolean;
+  onlyIcon?: boolean;
 }
 const props = withDefaults(defineProps<AvatarProp>(), {
   size: "default",

+ 1 - 1
JLHWEB/src/layouts/components/Menu/RightMenu.vue

@@ -73,7 +73,7 @@ const show = () => {
  */
 const handleSelFirstMenu = (item: any) => {
   console.log("handleSelFirstMenu item :>> ", item);
-  if (item?.children) {
+  if (item?.children.length > 0) {
     menuList.value = item.children;
     activeMenu.value = item.path;
   } else {

+ 8 - 0
JLHWEB/src/layouts/components/Tabs/index.vue

@@ -1,5 +1,9 @@
 <template>
   <div class="tabs-box flx-center">
+    <div class="flx-shrink pl-12 pr-8" style="cursor: pointer" @click="gohome">
+      <i class="tabs-icon iconfont iconhome-smile"></i>
+    </div>
+    <el-divider direction="vertical"></el-divider>
     <div class="tabs-menu flx-1">
       <el-tabs v-model="tabsMenuValue" type="card" @tab-click="tabClick" @tab-remove="tabRemove">
         <el-tab-pane v-for="item in tabsMenuList" :key="item.path" :label="item.title" :name="item.path" :closable="item.close">
@@ -178,6 +182,10 @@ const getParam = (path: string, name: string) => {
   return res ? res[1] : null;
 };
 
+const gohome = () => {
+  router.push("/home/index");
+};
+
 defineExpose({
   tabRemove
 });

+ 1 - 1
JLHWEB/src/routers/modules/menuRouter.ts

@@ -12,7 +12,7 @@ export const menuRouter = [
       isLink: "",
       isHide: true,
       isFull: false,
-      isAffix: true,
+      isAffix: false,
       isKeepAlive: true
     }
   }

+ 6 - 0
JLHWEB/src/styles/common.scss

@@ -554,3 +554,9 @@
     vertical-align: bottom;
   }
 }
+
+.lj-drawer-win {
+  .el-drawer__body {
+    padding: 0 !important;
+  }
+}

+ 5 - 5
JLHWEB/src/utils/index.ts

@@ -633,7 +633,7 @@ export function setDifference(oriLayout: any, loadLayout: any, arrayAttr: string
   for (const key in loadLayout) {
     if (loadLayout.hasOwnProperty(key)) {
       if (Array.isArray(loadLayout[key])) {
-        console.log("setDifference _oriLayout :>> ", _oriLayout);
+        // console.log("setDifference _oriLayout :>> ", _oriLayout);
         let _sortedObj1 = _oriLayout[key].slice().sort((a: any, b: any) => {
           let indexA = loadLayout[key].findIndex((item: any) => item[arrayAttr] === a[arrayAttr]);
           let indexB = loadLayout[key].findIndex((item: any) => item[arrayAttr] === b[arrayAttr]);
@@ -643,8 +643,8 @@ export function setDifference(oriLayout: any, loadLayout: any, arrayAttr: string
             return indexA - indexB;
           }
         });
-        console.log("setDifference _sortedObj1 :>> ", _sortedObj1);
-        console.log("setDifference loadLayout[key] :>> ", loadLayout[key]);
+        // console.log("setDifference _sortedObj1 :>> ", _sortedObj1);
+        // console.log("setDifference loadLayout[key] :>> ", loadLayout[key]);
 
         let arr = [];
         for (const idx in _sortedObj1) {
@@ -655,11 +655,11 @@ export function setDifference(oriLayout: any, loadLayout: any, arrayAttr: string
           //   arr.push(setDifference(_sortedObj1[idx], loadLayout[key][idx], arrayAttr));
           // }
           let itemIdx = loadLayout[key].findIndex((item: any) => item[arrayAttr] === _sortedObj1[idx][arrayAttr]);
-          console.log(itemIdx);
+          // console.log(itemIdx);
           let _loadLayout = itemIdx > -1 ? loadLayout[key][itemIdx] : {};
           arr.push(setDifference(_sortedObj1[idx], _loadLayout, arrayAttr));
         }
-        console.log("arr :>> ", arr);
+        // console.log("arr :>> ", arr);
         arr.length && (_oriLayout[key] = arr);
       } else if (typeof loadLayout[key] === "object") {
         if (!_oriLayout.hasOwnProperty(key)) {

+ 1 - 1
JLHWEB/src/views/baseinfo/mattressformula/detail.vue

@@ -8,7 +8,7 @@
     :init-param="mainData[0]"
     :if-fold-layout="false"
     :if-layout-editable="false"
-    :if-baisc-editable="false"
+    :if-basic-editable="false"
     :search-col="{ xs: 6, sm: 6, md: 6, lg: 6, xl: 6 }"
     :basic-group-col="{ xs: 6, sm: 6, md: 6, lg: 6, xl: 6 }"
     :enum="props.enum"

+ 1 - 1
JLHWEB/src/views/baseinfo/mattresstype/detail.vue

@@ -8,7 +8,7 @@
     :init-param="mainData[0]"
     :if-fold-layout="false"
     :if-layout-editable="false"
-    :if-baisc-editable="false"
+    :if-basic-editable="false"
     :search-col="{ xs: 6, sm: 6, md: 6, lg: 6, xl: 6 }"
     :basic-group-col="{ xs: 6, sm: 6, md: 6, lg: 6, xl: 6 }"
     :enum="props.enum"

+ 1 - 1
JLHWEB/src/views/baseinfo/mtrldef/detail.vue

@@ -8,7 +8,7 @@
     :init-param="mainData[0]"
     :if-fold-layout="false"
     :if-layout-editable="false"
-    :if-baisc-editable="false"
+    :if-basic-editable="false"
     :search-col="{ xs: 4, sm: 4, md: 4, lg: 4, xl: 4 }"
     :basic-group-col="{ xs: 4, sm: 4, md: 4, lg: 4, xl: 4 }"
     :enum="props.enum"

+ 2 - 2
JLHWEB/src/views/baseinfo/user/detail.vue

@@ -10,7 +10,7 @@
       :data="mainData"
       :init-param="mainData[0]"
       :if-layout-editable="false"
-      :if-baisc-editable="false"
+      :if-basic-editable="false"
       :if-fold-layout="false"
       :search-col="{ xs: 2, sm: 2, md: 2, lg: 2, xl: 2 }"
       :basic-group-col="{ xs: 2, sm: 2, md: 2, lg: 2, xl: 2 }"
@@ -128,7 +128,7 @@
                   :tool-button="[]"
                   :request-auto="false"
                 >
-                  <template #edit> 321 </template>
+                  <!-- <template #edit> 321 </template> -->
                 </LjVxeTable>
               </div>
             </div>

+ 50 - 75
JLHWEB/src/views/quote/bednetQuote/detail.vue

@@ -107,9 +107,23 @@ import SpringDialog from "@/views/system/selector/spring/index.vue";
 // import { MittEnum } from "@/enums/mittEnum";
 // import { getCurrentRecords } from "@/utils/index";
 import { useUserStore } from "@/stores/modules/user";
-import { getBedNetAreaList } from "@/api/modules/basicinfo";
+// import { getBedNetAreaList } from "@/api/modules/basicinfo";
 import AllFormula from "./components/AllFormula.vue";
 
+interface DetailProps {
+  deptid?: number | string;
+  bednetid?: number;
+  state?: string;
+}
+
+const props = withDefaults(defineProps<DetailProps>(), {
+  // deptid: 0,
+  // bednetid: 0,
+  // state: ""
+});
+
+const emit = defineEmits(["aftersave", "aftercancel"]);
+
 const { t } = useI18n();
 const route = useRoute();
 const router = useRouter();
@@ -140,7 +154,6 @@ const {
   getDataMxAdd,
   getDataMxSpring,
   dataCallback,
-  dataCallbackMx,
   wf_cmp_cb,
   setMxSpringLength,
   gotoSummy
@@ -310,13 +323,17 @@ const orderDefaultAction: detailAction[] = [
       return !orderStatus.value;
     },
     clickFunc: item => {
-      tabRemove(route.fullPath);
-      if (route.path.indexOf("/new") > -1) {
-        router.replace("/bednetQuote");
+      if (typeof props.bednetid != "undefined") {
+        emit("aftercancel");
       } else {
-        router.replace(
-          `/bednetQuote/detail?id=${LjDetailRef.value._mainData.bednetid}&code=${LjDetailRef.value._mainData.bednetcode}`
-        );
+        tabRemove(route.fullPath);
+        if (route.path.indexOf("/new") > -1) {
+          router.replace("/bednetQuote");
+        } else {
+          router.replace(
+            `/bednetQuote/detail?id=${LjDetailRef.value._mainData.bednetid}&code=${LjDetailRef.value._mainData.bednetcode}`
+          );
+        }
       }
     }
   }),
@@ -387,11 +404,15 @@ const orderDefaultAction: detailAction[] = [
                 message: t("sys.api.sueccessToSave"),
                 type: "success"
               });
-              if (res.bednet.bednetid) {
-                tabRemove(route.fullPath);
-                router.replace(`/bednetQuote/detail?id=${res.bednet.bednetid}`);
+              if (typeof props.bednetid != "undefined") {
+                emit("aftersave", res);
               } else {
-                router.replace("/bednetQuote");
+                if (res.bednet.bednetid) {
+                  tabRemove(route.fullPath);
+                  router.replace(`/bednetQuote/detail?id=${res.bednet.bednetid}`);
+                } else {
+                  router.replace("/bednetQuote");
+                }
               }
               setTimeout(() => {
                 if (res.message) {
@@ -570,6 +591,7 @@ const orderDefaultAction: detailAction[] = [
 ];
 
 onMounted(async () => {
+  console.log("onMounted bednet route.query :>> ", route.query, props);
   initParams.value.arg_bednetid = Number(route.query?.id ?? 0);
   initParamsMx.value.arg_bednetid = Number(route.query?.id ?? 0);
   if (!Number(route.query?.id)) {
@@ -577,13 +599,17 @@ onMounted(async () => {
       defaultColumnsValue.value.deptid = route.query?.deptid;
     }
   }
-  // defaultColumnsValue.value.sponge_mtrlid = 0;
-  // console.log(
-  //   "donMounted efaultColumnsValue.value :>> ",
-  //   defaultColumnsValue.value,
-  //   Object.keys(route.query).includes("id"),
-  //   route.query?.id
-  // );
+  console.log('typeof props?.bednetid != "undefined" :>> ', typeof props?.bednetid != "undefined");
+  if (typeof props?.bednetid != "undefined") {
+    // 直接读取
+    orderStatus.value = props.state;
+    initParams.value.arg_bednetid = props.bednetid;
+    initParamsMx.value.arg_bednetid = props.bednetid;
+    defaultColumnsValue.value.deptid = props?.deptid;
+    // mainData.value = props.data;
+  }
+
+  console.log("initParams.value :>> ", initParams.value);
 });
 
 /**
@@ -639,83 +665,32 @@ const funcAfterMound = async (data: any) => {
     tableProps_mx.value.editConfig.enabled = true;
     tableProps_spring.value.editConfig.enabled = true;
 
-    let res = await getBedNetAreaList({});
+    // let res = await getBedNetAreaList({});
 
-    if (res.datatable.length) {
-      AreaList.value = res.datatable;
-    }
+    // if (res.datatable.length) {
+    //   AreaList.value = res.datatable;
+    // }
   }
   // ifAfterMound.value = true;
 
   console.log(
     "onMounted detail sale start LjDetailRef.value.mainData :>> ",
-    AreaList.value,
+    // AreaList.value,
     tableProps_mx.value,
     LjDetailRef.value
   );
 
   if (orderStatus.value != "new") {
-    // const { enumMap, _mainData } = LjDetailRef.value;
-    // console.log("enumMap :>> ", enumMap, _mainData);
-    // let _enum = enumMap.get("mattresstypeid");
-    // console.log("_enum :>> ", _enum);
-    // if (_enum) {
-    //   mattresstypeEnum.value = _enum.find(t => t.value == _mainData.mattresstypeid);
-    //   console.log("mattresstypeEnum :>> ", mattresstypeEnum);
-    // }
-
-    // let itmshow = fabricMxTabList.value.find(t => t.visible());
-    // fabricMxTabs.value = itmshow.name;
-
-    // let res = await getData_mx(initParams.value);
-    // oriMxData.value = dataCallback(res);
-    // oriMxData.value.list = oriMxData.value.list.map(t => {
-    //   t.formulakind = Number(t.formulakind);
-    //   t.thickness = Number(t.thickness);
-    //   return t;
-    // });
-
-    // getMattressType();
-
-    // 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;
-    // bednetMxSpringData.value = result.list;
-
     await reload_dw2(data, (params: any) => {
       const { mx, spring } = params;
       console.log("reload_dw2 22result :>> ", params);
       bednetMxData.value = mx.list;
       bednetMxSpringData.value = spring.list;
-
-      // vxeTableMxSpringRef.value.refresh();
     });
 
     nextTick(() => {
       gotoSummy(8000);
     });
-    // bednetMxData.value = bednetMxData.value.map(t => {
-    //   // t.formulakind = Number(t.formulakind);
-    //   // t.thickness = Number(t.thickness);
-    //   // t.qty = Number(t.qty);
-    //   return t;
-    // });
-
-    // console.log("bednetMxData after:>> ", bednetMxData.value, orderStatus.value, vxeTableMxRef.value.tableColumns);
-    // nextTick(() => {
-    //   vxeTableMxRef.value.refresh();
-    // });
-
-    // res = await getDataMxSpring(initParams.value);
-
-    // funcChaifenTab();
-    // funcGetFabricMxShowData(itmshow.name);
-    // console.log("funcAfterMound resData :>> ", fabricMxData.value);
   }
 };
 </script>

+ 7 - 19
JLHWEB/src/views/quote/bednetQuote/hooks/index.tsx

@@ -443,7 +443,8 @@ export const useHooks = (t?: any) => {
     state.bednetMxData = [];
     state.bednetMxSpringData = [];
     let res = await getDataMxAdd(state.initParamsMx);
-    let result = dataCallbackMx(res);
+    console.log("getDataMxAdd res :>> ", res);
+    let result = dataCallback(res);
 
     columnsMx.value = wf_hide_dw2(bednetData, result.tableinfo.columns).map(item => {
       let _default = columnsMx_default.value.find(t => t.field == item.field);
@@ -452,11 +453,11 @@ export const useHooks = (t?: any) => {
       }
       return item;
     });
-    console.log("reset columnsMx.value :>> ", columnsMx.value);
+    console.log("reset columnsMx.value :>> ", columnsMx.value, result);
     // cb && cb(result);
 
     let res2 = await getDataMxSpring(state.initParamsMx);
-    let result2 = dataCallbackMx(res2);
+    let result2 = dataCallback(res2);
     // columnsMxSpring.value = result.tableinfo.columns;
     columnsMxSpring.value = result2.tableinfo.columns.map(item => {
       let _default = columnsMxSpring_default.value.find(t => t.field == item.field);
@@ -466,7 +467,7 @@ export const useHooks = (t?: any) => {
       return item;
     });
 
-    console.log("reload_dw2 columnsMxSpring.value :>> ", columnsMxSpring.value);
+    console.log("reload_dw2 columnsMxSpring.value :>> ", columnsMxSpring.value, result);
 
     cb && cb({ mx: result, spring: result2 });
   };
@@ -621,7 +622,7 @@ export const useHooks = (t?: any) => {
     return CommonDynamicSelect(newParams, DwnameEnum.bednetQuoteMxSpring);
   };
 
-  const getDataMxAdd = (params: any) => {
+  const getDataMxAdd = async (params: any) => {
     console.log("getData params :>> ", params);
     let newParams: any = {};
     params.pageNum && (newParams.pageindex = params.pageNum);
@@ -631,7 +632,7 @@ export const useHooks = (t?: any) => {
     newParams.queryParams = params;
     console.log("params :>> ", params);
     newParams.dsname = "web_bednet_mx_add";
-    return CommonDynamicSelect(newParams, DwnameEnum.bednetQuoteMxSpring);
+    return await CommonDynamicSelect(newParams, DwnameEnum.bednetQuoteMx);
   };
 
   const dataCallback = (data: any) => {
@@ -644,18 +645,6 @@ export const useHooks = (t?: any) => {
     };
   };
 
-  const dataCallbackMx = (data: any) => {
-    console.log("dataCallback data :>> ", data);
-    data.datatable.length > 0 && (state.initParamsMxSpring.arg_bednetmxid = data.datatable[0].bednetmxid);
-    return {
-      list: data.datatable,
-      tableinfo: data.tableinfo,
-      total: data.totalcnt,
-      pageNum: data.pageindex,
-      pageSize: data.pagesize
-    };
-  };
-
   const handleBlur = (value: any, data: any, field: string) => {
     //保留小数点和-号
     value = (value + "").replace(/[^-\d.]/g, "");
@@ -2462,7 +2451,6 @@ export const useHooks = (t?: any) => {
     getDataMxSpring,
     getDataMxAdd,
     dataCallback,
-    dataCallbackMx,
     wf_cmp_cb,
     setMxSpringLength,
     gotoSummy

+ 2 - 3
JLHWEB/src/views/quote/bednetQuote/index.vue

@@ -39,7 +39,7 @@
           :columns="columnsMx"
           :init-param="initParamsMx"
           :request-api="getDataMx"
-          :data-callback="dataCallbackMx"
+          :data-callback="dataCallback"
           :dwname="DwnameEnum.bednetQuoteMx"
           :table-props="tableProps"
           :table-events="tableEventsMx"
@@ -115,8 +115,7 @@ const {
   getData,
   getDataMx,
   getDataMxSpring,
-  dataCallback,
-  dataCallbackMx
+  dataCallback
 } = useHooks();
 const { CheckPower, CheckOption, buttonNew, buttonDefault } = useAuthButtons(t);
 

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

@@ -228,12 +228,12 @@
         :extra-loading="mxLoading"
         :footer-sum-attrs="['costamt']"
       >
-        <!-- <template #tableHeader>
+        <template #tableHeader v-if="orderStatus">
           <el-space wrap>
-            <el-button type="primary">{{ $t("common.add") }}</el-button>
-            <el-button type="danger">{{ $t("common.editText") }}</el-button>
+            <el-button type="primary" @click="handleAddBednetMx">{{ $t("common.add") }}</el-button>
+            <el-button type="danger" @click="handleEditBednetMx">{{ $t("common.editText") }}</el-button>
           </el-space>
-        </template> -->
+        </template>
       </LjVxeTable>
     </template>
 
@@ -466,6 +466,10 @@
     :formulakindenum="formulaKindEnum"
   />
   <AllFormula ref="AllFormulaRef" />
+
+  <LjDrawer ref="LjDrawerRef" class="lj-drawer-win" size="80%" direction="btt" :title="drawerTitle">
+    <BednetDetail v-bind="bednetDrawerProps" @aftersave="autoBednetSave" @aftercancel="LjDrawerRef.close()" />
+  </LjDrawer>
 </template>
 
 <script setup lang="ts" name="mattressQuoteDetail">
@@ -478,7 +482,7 @@ import { useHooks } from "./hooks/index";
 import { useHooksCpQuote } from "./hooks/cpQuote";
 import { useAuthButtons } from "@/hooks/useAuthButtons";
 import LjVxeTable from "@/components/LjVxeTable/index.vue";
-// import { cloneDeep } from "lodash-es";
+import { cloneDeep } from "lodash-es";
 import { useRoute, useRouter } from "vue-router";
 import { CommonDynamicSelect, GetFormulaCompute } from "@/api/modules/common";
 import { SaveMattress, SaveMattressAuditing, DelMattress } from "@/api/modules/quote";
@@ -495,6 +499,8 @@ import { MittEnum } from "@/enums/mittEnum";
 import { getCurrentRecords } from "@/utils/index";
 import { useUserStore } from "@/stores/modules/user";
 import AllFormula from "./components/AllFormula.vue";
+import LjDrawer from "@/components/LjDrawer/index.vue";
+import BednetDetail from "@/views/quote/bednetQuote/detail.vue";
 
 // interface detailProp {
 //   // /**
@@ -572,6 +578,7 @@ const {
   cabinetTypeOptions,
   topCottonAddList,
   AllFormulaRef,
+  LjDrawerRef,
   funcAddMxSide,
   funcChaifenTab,
   getData_mx,
@@ -601,6 +608,12 @@ const tabRemove: Function = inject("tabRemove") as Function;
 
 const defaultColumnsValue = ref<any>({});
 const mxLoading = ref(false);
+const drawerTitle = ref("");
+const bednetDrawerProps = reactive({
+  bednetid: 0,
+  state: "",
+  deptid: 0
+});
 
 /**
  * @description 明细表格组件基础配置
@@ -1051,6 +1064,7 @@ const orderDefaultAction = [
                 type: "success"
               });
               if (res.mattressid) {
+                tabRemove(route.fullPath);
                 router.replace(`/mattressQuote/detail?id=${res.mattressid}`);
               } else {
                 router.replace("/mattressQuote");
@@ -1291,7 +1305,16 @@ const orderDefaultAction = [
     })
   ],
   buttonDefault({
-    label: t("common.copyQuote")
+    label: t("common.copyQuote"),
+    power: 75,
+    limited: () => {
+      return !!orderStatus.value;
+    },
+    clickFunc: item => {
+      let _cur = LjDetailRef.value._mainData;
+
+      router.push(`/mattressQuote/copy?id=${_cur.mattressid}&code=${_cur.mattresscode}`);
+    }
   }),
   buttonDefault({
     label: t("common.showFormula"),
@@ -1324,7 +1347,7 @@ const orderDefaultAction = [
         fabricMx: fabricMxTabList.value,
         formulakindenum: formulaKindEnum.value
       };
-      toExcelQuote(_data, "报价单");
+      toExcelQuote(_data, "床垫报价单_" + LjDetailRef.value._mainData.mattresscode);
     }
   })
   // buttonDefault({
@@ -1784,6 +1807,88 @@ const toDelMx_cushions = () => {
       });
     });
 };
+
+const handleAddBednetMx = () => {
+  nextTick(() => {
+    console.log("LjDetailRef.value._mainData :>> ", LjDetailRef.value._mainData);
+    drawerTitle.value = "新增床网报价";
+    bednetDrawerProps.deptid = LjDetailRef.value._mainData.deptid;
+    bednetDrawerProps.bednetid = 0;
+    bednetDrawerProps.state = "new";
+    LjDrawerRef.value.show();
+  });
+};
+
+const handleEditBednetMx = () => {
+  const $table = bednetMxRef.value.element;
+
+  if ($table) {
+    const records = $table.getCurrentRecord();
+    console.log("records :>> ", records);
+    if (records) {
+      if (!Number(records?.mtrlid)) {
+        handleAddBednetMx();
+      } else {
+        nextTick(() => {
+          drawerTitle.value = "修改床网报价";
+          bednetDrawerProps.deptid = LjDetailRef.value._mainData.deptid;
+          bednetDrawerProps.bednetid = records.mtrlid;
+          bednetDrawerProps.state = "edit";
+          LjDrawerRef.value.show();
+        });
+      }
+    } else {
+      ElMessage.warning("请先选择要修改的行");
+    }
+  }
+};
+
+const autoBednetSave = (res: any) => {
+  const $table = bednetMxRef.value.element;
+
+  if ($table) {
+    const { fullData } = $table.getTableData();
+    let idx = fullData.findIndex(t => t.mtrlid == res.bednet.bednetid);
+    let _mtrlname =
+      res.bednet.typename +
+      " " +
+      res.bednet.bednetcode +
+      " " +
+      res.bednet.mattress_width +
+      "*" +
+      res.bednet.mattress_length +
+      "*" +
+      res.bednet.mattress_height;
+    if (idx > -1) {
+      fullData[idx].mtrlid = res.bednet.bednetid;
+      fullData[idx].mtrlname = _mtrlname;
+      fullData[idx].price = res.bednet.nottax_factory_cost;
+
+      $table.reloadData(fullData);
+    } else {
+      let _data = cloneDeep(fullData[0]);
+      let _row = {
+        addmx: "+",
+        delmx: "-",
+        formulatype: _data.formulatype,
+        if_mtrl: _data.if_mtrl,
+        formulaid: _data.formulaid,
+        sortcode: _data.sortcode,
+        formulakind: _data.formulakind,
+        formula: _data.formula,
+        thickness: 0,
+        mtrlid: res.bednet.bednetid,
+        mtrlname: _mtrlname,
+        price: res.bednet.nottax_factory_cost,
+        qty: 1
+      };
+
+      $table.insertAt(_row, -1);
+    }
+  }
+
+  LjDrawerRef.value.hide();
+};
 </script>
 
 <style lang="scss">

+ 3 - 3
JLHWEB/src/views/quote/mattressQuote/hooks/cpQuote.ts

@@ -122,14 +122,14 @@ export const useHooksCpQuote = (t?: any) => {
   };
 
   const wf_retrieve_qingdan_bednet = async (data: any) => {
-    const { getDataMxAdd, getDataMxSpring, dataCallbackMx } = useHooks(t);
+    const { getDataMxAdd, getDataMxSpring, dataCallback } = useHooks(t);
     let s_bednet_qingdan = [];
 
     // let bednetMxData = [];
     // let bednetMxSpringData = [];
     console.log("data :>> ", data);
     let res = await getDataMxAdd({ arg_bednetid: data.list[0].bednetid });
-    let mxResult = dataCallbackMx(res);
+    let mxResult = dataCallback(res);
     console.log("wf_retrieve_qingdan_bednet mxResult :>> ", mxResult);
 
     let ls_床网名称,
@@ -151,7 +151,7 @@ export const useHooksCpQuote = (t?: any) => {
     let item: any = {};
 
     let res2 = await getDataMxSpring({ arg_bednetid: data.list[0].bednetid });
-    let springResult = dataCallbackMx(res2);
+    let springResult = dataCallback(res2);
     console.log("springResult :>> ", springResult);
 
     //床网名称

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

@@ -105,6 +105,14 @@ interface defaultState {
   diancengAreaEnum: any;
   topCottonAddList: any;
   AllFormulaRef: any;
+  LjDrawerRef: any;
+  bednetDrawerProps: bednetDrawerPropsdata;
+}
+
+interface bednetDrawerPropsdata {
+  deptid?: number;
+  bednetid?: number;
+  state?: string;
 }
 
 export const useHooks = (t?: any) => {
@@ -338,7 +346,9 @@ export const useHooks = (t?: any) => {
     ],
     diancengAreaEnum: [],
     topCottonAddList: [],
-    AllFormulaRef: null
+    AllFormulaRef: null,
+    LjDrawerRef: null,
+    bednetDrawerProps: {}
   });
 
   const router = useRouter();
@@ -1577,6 +1587,18 @@ export const useHooks = (t?: any) => {
     }
   };
 
+  /**
+   * @description 明细,删除
+   */
+  const funcDelBednet = (scope: any) => {
+    console.log("funcDelBednet: ", scope);
+    if (scope.data.length == 1) {
+      ElMessage.warning("不能全部删除,至少保留一个床网");
+      return false;
+    }
+    funcDelMtrlMx(scope);
+  };
+
   /**
    * @description 据字符串'myRef'来获取ref
    * @param name
@@ -2470,6 +2492,8 @@ export const useHooks = (t?: any) => {
   const wf_cmp_cb = async () => {
     const { _mainData, enumMap, baseformRef } = state.LjDetailRef;
 
+    //wf_paixu 未有
+
     await wf_factory_profitrate();
 
     // 佣金
@@ -2515,6 +2539,7 @@ export const useHooks = (t?: any) => {
     mattress.mattressid = Number(mattress.mattressid ?? 0);
     mattress.xd_flag = Number(mattress.xd_flag ?? 0);
     mattress.js1_flag = Number(mattress.js1_flag ?? 0);
+    mattress.flag = Number(mattress.flag ?? 0);
     console.log("bbbbbbbbbbbbbbbbbbbb mattress :>> ", mattress);
     // mattress.if_moneyrate = Number(mattress.if_moneyrate ?? 0);
     // mattress.if_bcp_type = Number(mattress.if_bcp_type ?? 0);
@@ -2634,6 +2659,11 @@ export const useHooks = (t?: any) => {
             console.log("gotoHisprice dd val :>> ", row, router);
             if (Number(row.typeid) == 1) {
               router.push(`/mattressQuote/detail?id=${row.bednetid_mattressid}`);
+
+              // state.bednetDrawerProps.deptid = state.LjDetailRef._mainData.deptid;
+              // state.bednetDrawerProps.bednetid = row.bednetid_mattressid;
+              // state.bednetDrawerProps.state = "";
+              // state.LjDrawerRef.show();
             } else if (Number(row.typeid) == 2) {
               router.push(`/bednetQuote/detail?id=${row.bednetid_mattressid}`);
             }
@@ -3904,6 +3934,41 @@ export const useHooks = (t?: any) => {
           </>
         );
       }
+    },
+    {
+      title: "-",
+      field: "delmx",
+      width: 80,
+      render: (scope: any) => {
+        let _if_mtrl = Number(scope.row.if_mtrl);
+        if (_if_mtrl > 1) {
+          if (state.orderStatus) {
+            return (
+              <>
+                <ElPopconfirm
+                  width="220"
+                  icon={InfoFilled}
+                  title={t("business.tips.mattress.delMx")}
+                  confirm-button-text={t("common.delText")}
+                  confirm-button-type="danger"
+                  onConfirm={() => funcDelBednet(scope)}
+                >
+                  {{
+                    reference: () => {
+                      return <ElButton type="danger" plain circle icon={Minus} />;
+                    }
+                  }}
+                </ElPopconfirm>
+              </>
+            );
+            // return <ElButton type="danger" plain circle icon={Minus} onClick={() => funcDelMtrlMx(scope)}></ElButton>;
+          } else {
+            return <>-</>;
+          }
+        } else {
+          return <></>;
+        }
+      }
     }
   ];
   const cushionsColumns: ColumnProps<any>[] = [

+ 13 - 41
JLHWEB/src/views/quote/mattressQuote/index.vue

@@ -155,8 +155,13 @@ const handleDBlClickTable = ({ row, rowIndex, $rowIndex, column, columnIndex, $c
 
 const rowClsNameFunc = (data: any) => {
   const { row, rowIndex, $rowIndex } = data;
-  if (row.flag == "0") {
-    return "vxecol-danger";
+  if (Number(row.flag) == 0) {
+    if (Number(row.xd_flag) == 0) {
+      return "vxecol-danger";
+    }
+    if (Number(row.xd_flag) == 1) {
+      return "vxecol-blue";
+    }
   }
   return "";
 };
@@ -317,13 +322,11 @@ const action: detailAction[] = [
         return;
       }
 
-      const _cur = $table.getCurrentRecord() ?? null;
-      if (_cur) {
-        router.push(`/mattressQuote/copy?id=${_cur.mattressid}&code=${_cur.mattresscode}`);
-      } else {
-        const _cur = curRecords[curRecords.length - 1];
-        router.push(`/mattressQuote/copy?id=${_cur.mattressid}&code=${_cur.mattresscode}`);
+      let _cur = $table.getCurrentRecord() ?? null;
+      if (!_cur) {
+        _cur = curRecords[curRecords.length - 1];
       }
+      router.push(`/mattressQuote/copy?id=${_cur.mattressid}&code=${_cur.mattresscode}`);
     }
   }),
   [
@@ -434,43 +437,12 @@ const action: detailAction[] = [
   buttonDefault({
     label: t("common.businessSupplement"),
     power: 72,
-    clickFunc: item => {
-      toExcelQuote(vxeTableRef.value, "aces测试");
-    }
+    clickFunc: item => {}
   }),
   buttonDefault({
     label: t("common.recalculateERPCost"),
     power: 72,
-    clickFunc: item => {
-      const $table = vxeTableRef.value.element;
-
-      // 自定义内容
-      const customContent = [
-        ["公司名称", "XX科技有限公司"],
-        ["地址", "XX市XX区XX路XX号"],
-        ["联系方式", "000-0000000"]
-      ];
-      // 导出表格数据
-      $table.exportData({
-        filename: "导出的文件",
-        sheetName: "Sheet1",
-        type: "csv",
-        data: vxeTableRef.value._mainData,
-        original: false,
-        columnFilterMethod({ column }) {
-          // 可以在这里过滤不需要导出的列
-          return true;
-        },
-        getCellFormat({ cellValue, cellColumn }) {
-          // 可以在这里自定义单元格格式
-          return cellValue;
-        },
-        footerFilterMethod() {
-          // 返回自定义的底部内容
-          return customContent;
-        }
-      });
-    }
+    clickFunc: item => {}
   })
 ];
 

+ 1 - 1
JLHWEB/src/views/saleprice/dept/detail.vue

@@ -8,7 +8,7 @@
     :init-param="mainData[0]"
     :if-fold-layout="false"
     :if-layout-editable="false"
-    :if-baisc-editable="false"
+    :if-basic-editable="false"
     :basic-group-col="{ xs: 2, sm: 2, md: 2, lg: 2, xl: 2 }"
     :enum="props.enum"
   >

+ 1 - 1
JLHWEB/src/views/saleprice/pricelist/detail.vue

@@ -8,7 +8,7 @@
     :init-param="mainData[0]"
     :if-fold-layout="false"
     :if-layout-editable="false"
-    :if-baisc-editable="false"
+    :if-basic-editable="false"
     :search-col="{ xs: 1, sm: 1, md: 1, lg: 1, xl: 1 }"
     :basic-group-col="{ xs: 1, sm: 1, md: 1, lg: 1, xl: 1 }"
   >

+ 1 - 1
JLHWEB/src/views/saleprice/profitrate/detail.vue

@@ -8,7 +8,7 @@
     :init-param="mainData[0]"
     :if-fold-layout="false"
     :if-layout-editable="false"
-    :if-baisc-editable="false"
+    :if-basic-editable="false"
     :basic-group-col="{ xs: 2, sm: 2, md: 2, lg: 2, xl: 2 }"
     :enum="props.enum"
   >