Browse Source

JLHWEB:1、床垫报价,勾选了币种,汇总显示美金结果
2、床网报价,弹簧筛选时,取消默认选择国内
3、床垫报价,主副规格,高度默认读取主规格、无法编辑
4、床垫报价,主副规格,带出的弹簧排列数错误
5、特殊工艺逻辑有问题
6、床垫清单,配置必填项,文本显示红色,且保存前检查
7、床垫清单名称变更:新物料编码改名系统物料编码,新物料名称改名系统物料名称,新物料规格改物料规格英文名称改成:旧床垫编码
8、床垫清单,配置列表中没有的就不显示(顶布裥棉、内部套),保用卡顺序错误,不应数index
9、床垫报价,复制报价时,清空唯一码内容
10、床网报价,类别定义资料补充所有方法属性
11、修复tab页切换缓存问题

JohnnyChan 2 weeks ago
parent
commit
9b8cbd3feb

+ 2 - 1
JLHWEB/src/components/LjDetail/index.vue

@@ -1904,7 +1904,8 @@ watch(
     } else {
       _mainData.value = { ...infoParam.value };
     }
-  }
+  },
+  { immediate: true, deep: true }
 );
 watch(
   () => tableData.value,

+ 10 - 1
JLHWEB/src/components/LjDialog/index.vue

@@ -20,7 +20,7 @@
 </template>
 
 <script setup lang="ts" name="LjDialog">
-import { ref, useSlots } from "vue";
+import { ref, useSlots, watch } from "vue";
 import { useGlobalStore } from "@/stores/modules/global";
 
 // 接收父组件参数并设置默认值
@@ -66,6 +66,15 @@ function confirmClick() {
   //   });
 }
 
+watch(
+  () => drawer.value,
+  val => {
+    if (!val) {
+      drawerKey.value++;
+    }
+  }
+);
+
 defineExpose({ show, hide });
 </script>
 

+ 3 - 2
JLHWEB/src/components/LjVxeTable/index.vue

@@ -745,13 +745,14 @@ const _defineProps = ref({
     }
     return null;
   },
-  cellClassName: ({ column }: any) => {
+  cellClassName: data => {
+    let { column } = data;
     if (ALLOW_EDIT_STATE.includes(orderStatus.value) || props.editable) {
       if (column?.editRender && column.editRender.enabled !== false) {
         return "vxecol-edit";
       }
     }
-    return null;
+    return props.cellClassName ? props.cellClassName(data, ALLOW_EDIT_STATE.includes(orderStatus.value) || props.editable) : null;
   }
 });
 

+ 5 - 0
JLHWEB/src/components/LjVxeTable/interface/index.ts

@@ -440,6 +440,11 @@ export interface LjVxetableProps extends aboutVxetableApiProps {
    * @argument params column
    */
   headerCellClassName?: (params: any) => any;
+  /**
+   * 给表头的单元格附加 className https://vxetable.cn/#/table/api?filterName=header-cell-class-name
+   * @argument params column
+   */
+  cellClassName?: (params: any, editable: boolean) => any;
   /**
    * @argument Object 表格绑定的事件
    */

+ 3 - 3
JLHWEB/src/layouts/LayoutClassic/index.vue

@@ -99,11 +99,11 @@ const toggleRightMenu = (val: any) => {
  */
 const MainRef = ref<any>(null);
 const refresh = () => {
+  keepAliveStore.removeKeepAliveName(route);
+  MainRef.value.refreshCurrentPage(false);
   setTimeout(() => {
-    keepAliveStore.removeKeepAliveName(route.name as string);
-    MainRef.value.refreshCurrentPage(false);
     nextTick(() => {
-      keepAliveStore.addKeepAliveName(route.name as string);
+      keepAliveStore.addKeepAliveName(route);
       MainRef.value.refreshCurrentPage(true);
     });
   }, 0);

+ 68 - 7
JLHWEB/src/layouts/components/Main/index.vue

@@ -6,12 +6,11 @@
     </template>
   </Tabs>
   <el-main class="lj-main-body" :class="globalStore.assemblySize">
+    <!-- {{ JSON.stringify(keepAliveList) }} -->
     <router-view v-slot="{ Component, route }">
-      <!-- <transition appear :name="tabsAnimating ? 'fade-transform' : ''" mode="out-in"> -->
-      <keep-alive :include="keepAliveName">
-        <component :is="Component" :key="route.fullPath" v-if="isRouterShow" />
+      <keep-alive>
+        <component :is="Component" :key="getRouteKey(route)" />
       </keep-alive>
-      <!-- </transition> -->
     </router-view>
   </el-main>
   <el-footer v-if="footer">
@@ -20,7 +19,7 @@
 </template>
 
 <script setup lang="ts">
-import { ref, onBeforeUnmount, provide, watch } from "vue";
+import { ref, onBeforeUnmount, provide, watch, computed } from "vue";
 import { storeToRefs } from "pinia";
 import { useDebounceFn } from "@vueuse/core";
 import { useGlobalStore } from "@/stores/modules/global";
@@ -29,16 +28,78 @@ import Maximize from "./components/Maximize.vue";
 import Tabs from "@/layouts/components/Tabs/index.vue";
 import Footer from "@/layouts/components/Footer/index.vue";
 import { TabPaneName } from "element-plus";
+import { useRoute } from "vue-router";
 
+const cur_route = useRoute();
 const globalStore = useGlobalStore();
 const { maximize, isCollapse, layout, asideInverted, tabs, footer, tabsAnimating } = storeToRefs(globalStore);
 
 const keepAliveStore = useKeepAliveStore();
-const { keepAliveName } = storeToRefs(keepAliveStore);
+const { keepAliveName, keepAliveList } = storeToRefs(keepAliveStore);
 
 // 注入刷新页面方法
 const isRouterShow = ref(true);
-const refreshCurrentPage = (val: boolean) => (isRouterShow.value = val);
+// const refreshCurrentPage = (val: boolean) => (isRouterShow.value = val);
+
+/**
+ * @description 监听路由变化, 刷新缓存互不影响
+ */
+const refreshTimes = ref<any>([]);
+
+/**
+ * @description 刷新时,记录刷新次数,将用于刷新key值
+ */
+// const refreshCurrentPage = (val: boolean) => {
+//   const fullPath = cur_route.fullPath;
+//   let routeItem = refreshTimes.value.find((item: any) => item.fullPath == fullPath);
+//   if (!routeItem) {
+//     routeItem = {
+//       fullPath: fullPath,
+//       times: 0
+//     };
+//     refreshTimes.value.push(routeItem);
+//   }
+
+//   refreshTimes.value.forEach((item: any) => {
+//     if (item.fullPath == fullPath) {
+//       item.times++;
+//     }
+//   });
+// };
+const refreshCurrentPage = (val: boolean) => {
+  // const fullPath = cur_route;
+  // let routeItem = keepAliveList.find((item: any) => item.fullPath == fullPath);
+  // if (!routeItem) {
+  //   routeItem = {
+  //     fullPath: fullPath,
+  //     times: 0
+  //   };
+  //   keepAliveList.push(routeItem);
+  // }
+
+  console.log("refreshCurrentPage cur_route :>> ", cur_route);
+  keepAliveStore.updateKeepAliveName(cur_route);
+};
+
+// const getRouteKey = () => {
+//   const cur_route = useRoute();
+//   let routeItem = keepAliveStore.getKeepAliveName(cur_route.fullPath);
+//   return routeItem.fullPath + "_" + routeItem.times;
+// // };
+// const getRouteKey = computed(() => {
+//   const cur_route = useRoute();
+//   const keepAliveStore = useKeepAliveStore();
+//   let routeItem = keepAliveStore.getKeepAliveName(cur_route.fullPath);
+//   return routeItem.fullPath + "_" + routeItem.times;
+// });
+// };
+const getRouteKey = (route: any) => {
+  // const cur_route = useRoute();
+  // const keepAliveStore1 = useKeepAliveStore();
+  let routeItem = keepAliveStore.getKeepAliveName(route.fullPath);
+  console.log("getKeepAliveName routeItem getRouteKey:>> ", routeItem, route.fullPath);
+  return routeItem.fullPath + "_" + routeItem.times;
+};
 
 const tabsRef = ref();
 const tabRemove = (fullPath: TabPaneName) => {

+ 5 - 5
JLHWEB/src/layouts/components/Tabs/components/MoreButton.vue

@@ -44,14 +44,14 @@ const keepAliveStore = useKeepAliveStore();
 // refresh current page
 const refreshCurrentPage: Function = inject("refresh") as Function;
 const refresh = () => {
+  keepAliveStore.removeKeepAliveName(route);
+  refreshCurrentPage(false);
   setTimeout(() => {
-    keepAliveStore.removeKeepAliveName(route.name as string);
-    refreshCurrentPage(false);
     nextTick(() => {
-      keepAliveStore.addKeepAliveName(route.name as string);
+      keepAliveStore.addKeepAliveName(route);
       refreshCurrentPage(true);
     });
-  }, 0);
+  }, 10);
 };
 
 // maximize current page
@@ -63,7 +63,7 @@ const maximize = () => {
 const closeCurrentTab = () => {
   if (route.meta.isAffix) return;
   tabStore.removeTabs(route.fullPath);
-  keepAliveStore.removeKeepAliveName(route.name as string);
+  keepAliveStore.removeKeepAliveName(route);
 };
 
 // Close Other

+ 5 - 4
JLHWEB/src/layouts/components/Tabs/index.vue

@@ -179,13 +179,14 @@ const tabRemove = (fullPath: TabPaneName) => {
   console.log("tabRemove tabStore.tabsMenuList :>> ", tabStore.tabsMenuList);
   console.log("tabRemove routeItem :>> ", routeItem);
   keepAliveStore.removeKeepAliveName(routeItem);
-  let arr = keepAliveStore.getKeepAliveList;
+  // let arr = keepAliveStore.getKeepAliveList;
 
-  arr = arr.filter(item => item.fullPath !== routeItem.path);
-  console.log("tabRemove arr :>> ", arr);
-  keepAliveStore.setKeepAliveList(arr);
+  // arr = arr.filter(item => item.fullPath !== routeItem.path);
+  // console.log("tabRemove arr :>> ", arr);
+  // keepAliveStore.setKeepAliveList(arr);
 
   tabStore.removeTabs(fullPath as string, fullPath == route.fullPath);
+  router.go(-1);
 };
 
 // get Path param

+ 2 - 18
JLHWEB/src/stores/modules/keepAlive.ts

@@ -35,29 +35,14 @@ export const useKeepAliveStore = defineStore({
     },
     // Remove KeepAliveName
     removeKeepAliveName(route: any) {
-      console.log("removeKeepAliveName :>> ", route.name, route);
       this.keepAliveName = this.keepAliveName.filter(item => item !== route.name);
 
-      // this.keepAliveList = this.keepAliveList.filter(item => item.fullPath !== route.path);
-
       let index = this.keepAliveList.findIndex(item => item.fullPath === route.path);
       if (index > -1) {
-        this.keepAliveList.splice(index, 1);
+        // this.keepAliveList.splice(index, 1);
+        this.keepAliveList[index].times = this.keepAliveList[index].times + 1;
       }
 
-      // const { keepAliveList } = this;
-      // let arr = cloneDeep(this.keepAliveList);
-      // this.keepAliveList = [];
-      // arr.filter(item => item.fullPath !== route.path);
-      // setTimeout(() => {
-      //   keepAliveList = arr;
-      // }, 0);
-      //   .forEach(item => {
-      //     this.keepAliveList.push(item);
-      //   });
-      // this.keepAliveList = arr;
-      // this.setKeepAliveList(arr);
-
       console.log("getKeepAliveName routeItem removeKeepAliveName :>> ", JSON.stringify(this.keepAliveList));
       console.log("getKeepAliveName routeItem removeKeepAliveName :>> ", this.keepAliveList);
       console.log("getKeepAliveName routeItem keepAliveName :>> ", this.keepAliveName);
@@ -84,7 +69,6 @@ export const useKeepAliveStore = defineStore({
         };
         this.keepAliveList.push(routeItem);
       }
-      console.log("getKeepAliveName routeItem :>> ", routeItem, this.keepAliveList);
       return routeItem;
     }
   }

+ 0 - 1
JLHWEB/src/views/baseinfo/bednettype/detail.vue

@@ -5,7 +5,6 @@
     v-bind="detailProps"
     v-model:order-status="orderStatus"
     :data="mainData"
-    :init-param="mainData[0]"
     :if-fold-layout="false"
     :if-layout-editable="false"
     :search-col="{ xs: 4, sm: 4, md: 4, lg: 4, xl: 4 }"

+ 414 - 2
JLHWEB/src/views/baseinfo/bednettype/hooks/index.tsx

@@ -128,12 +128,63 @@ export const useHooks = (t?: any) => {
         }
       }
     },
+    {
+      field: "spring_mtrl_formula",
+      title: "弹簧总材料成本公式",
+      basicinfo: {
+        el: "input",
+        span: 4,
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "spring_hr_formula",
+      title: "弹簧总人工成本公式",
+      basicinfo: {
+        el: "input",
+        span: 4,
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "fabrics1_mtrl_formula",
+      title: "入袋无纺布材料成本公式",
+      basicinfo: {
+        el: "input",
+        span: 4,
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "fabrics2_mtrl_formula",
+      title: "底面无纺布材料成本公式",
+      basicinfo: {
+        el: "input",
+        span: 4,
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "glue_mtrl_formula",
+      title: "胶水材料成本公式",
+      basicinfo: {
+        el: "input",
+        span: 4,
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
     {
       field: "if_snake_wire",
       title: "蛇线",
       basicinfo: {
         editable: ALLOW_EDIT_STATE,
         span: 1,
+        group: "蛇线",
         render: (scope: any) => {
           const { column, searchParam } = scope;
 
@@ -153,6 +204,7 @@ export const useHooks = (t?: any) => {
       basicinfo: {
         el: "input",
         span: 3,
+        group: "蛇线",
         editable: ALLOW_EDIT_STATE
       }
     },
@@ -163,6 +215,7 @@ export const useHooks = (t?: any) => {
         el: "input",
         offset: 1,
         span: 3,
+        group: "蛇线",
         editable: ALLOW_EDIT_STATE,
         props: { type: "textarea", rows: 3 }
       }
@@ -173,6 +226,7 @@ export const useHooks = (t?: any) => {
       basicinfo: {
         editable: ALLOW_EDIT_STATE,
         span: 1,
+        group: "四周",
         render: (scope: any) => {
           const { column, searchParam } = scope;
 
@@ -192,6 +246,7 @@ export const useHooks = (t?: any) => {
       basicinfo: {
         el: "input",
         span: 3,
+        group: "四周",
         editable: ALLOW_EDIT_STATE,
         props: { type: "textarea", rows: 3 }
       }
@@ -203,6 +258,7 @@ export const useHooks = (t?: any) => {
         el: "input",
         offset: 1,
         span: 3,
+        group: "四周",
         editable: ALLOW_EDIT_STATE,
         props: { type: "textarea", rows: 3 }
       }
@@ -213,6 +269,7 @@ export const useHooks = (t?: any) => {
       basicinfo: {
         editable: ALLOW_EDIT_STATE,
         span: 1,
+        group: "四周",
         render: (scope: any) => {
           const { column, searchParam } = scope;
 
@@ -232,6 +289,7 @@ export const useHooks = (t?: any) => {
       basicinfo: {
         el: "input",
         span: 3,
+        group: "四周",
         editable: ALLOW_EDIT_STATE,
         props: { type: "textarea", rows: 3 }
       }
@@ -243,6 +301,7 @@ export const useHooks = (t?: any) => {
         el: "input",
         offset: 1,
         span: 3,
+        group: "四周",
         editable: ALLOW_EDIT_STATE,
         props: { type: "textarea", rows: 3 }
       }
@@ -253,6 +312,7 @@ export const useHooks = (t?: any) => {
       basicinfo: {
         editable: ALLOW_EDIT_STATE,
         span: 1,
+        group: "边铁",
         render: (scope: any) => {
           const { column, searchParam } = scope;
 
@@ -272,6 +332,7 @@ export const useHooks = (t?: any) => {
       basicinfo: {
         el: "input",
         span: 3,
+        group: "边铁",
         editable: ALLOW_EDIT_STATE,
         props: { type: "textarea", rows: 3 }
       }
@@ -283,17 +344,368 @@ export const useHooks = (t?: any) => {
         el: "input",
         offset: 1,
         span: 3,
+        group: "边铁",
         editable: ALLOW_EDIT_STATE,
         props: { type: "textarea", rows: 3 }
       }
     },
     {
-      field: "glue_mtrl_formula",
-      title: "胶水材料成本公式",
+      field: "if_rsorwa",
+      title: "胶条?包角?",
+      basicinfo: {
+        editable: ALLOW_EDIT_STATE,
+        span: 1,
+        group: "胶条?包角?",
+        render: (scope: any) => {
+          const { column, searchParam } = scope;
+
+          return (
+            <>
+              <div class="flx-align-center">
+                <el-checkbox v-model={searchParam[column.field]} true-value={1} false-value={0} />
+              </div>
+            </>
+          );
+        }
+      }
+    },
+    {
+      field: "rsorwa_mtrl_formula",
+      title: "胶条/包角材料成本公式",
+      basicinfo: {
+        el: "input",
+        span: 3,
+        group: "胶条?包角?",
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "rsorwa_hr_formula",
+      title: "胶条/包角人工成本公式",
+      basicinfo: {
+        el: "input",
+        offset: 1,
+        span: 3,
+        group: "胶条?包角?",
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "if_sponge_drilling",
+      title: "海绵打孔?",
+      basicinfo: {
+        editable: ALLOW_EDIT_STATE,
+        span: 1,
+        group: "其他",
+        render: (scope: any) => {
+          const { column, searchParam } = scope;
+          return (
+            <>
+              <div class="flx-align-center">
+                <el-checkbox v-model={searchParam[column.field]} true-value={1} false-value={0} />
+              </div>
+            </>
+          );
+        }
+      }
+    },
+    {
+      field: "sponge_drilling_hr_formula",
+      title: "海绵打孔人力成本公式",
+      basicinfo: {
+        el: "input",
+        span: 3,
+        group: "其他",
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "fork_mtrl_formula",
+      title: "弹叉材料成本公式",
+      basicinfo: {
+        el: "input",
+        offset: 1,
+        span: 3,
+        group: "其他",
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "fork_hr_formula",
+      title: "弹叉人力成本公式",
+      basicinfo: {
+        el: "input",
+        offset: 1,
+        span: 3,
+        group: "其他",
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "cnail_mtrl_formula",
+      title: "C钉/夹码材料成本公式",
+      basicinfo: {
+        el: "input",
+        offset: 1,
+        span: 3,
+        group: "其他",
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "cnail_hr_formula",
+      title: "C钉/夹码人工成本公式",
+      basicinfo: {
+        el: "input",
+        offset: 1,
+        span: 3,
+        group: "其他",
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "sponge_mtrl_formula",
+      title: "海绵包边材料成本公式",
+      basicinfo: {
+        el: "input",
+        offset: 1,
+        span: 3,
+        group: "其他",
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "sponge_hr_formula",
+      title: "海绵包边人工成本公式",
+      basicinfo: {
+        el: "input",
+        offset: 1,
+        span: 3,
+        group: "其他",
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "sponge_mtrl_tc_formula",
+      title: "填充海绵成本公式",
+      basicinfo: {
+        el: "input",
+        offset: 1,
+        span: 3,
+        group: "其他",
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "edge_mtrl_formula",
+      title: "封边材料成本公式",
+      basicinfo: {
+        el: "input",
+        offset: 1,
+        span: 3,
+        group: "其他",
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "edge_hr_formula",
+      title: "封边人工成本公式",
+      basicinfo: {
+        el: "input",
+        offset: 1,
+        span: 3,
+        group: "其他",
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "felt_mtrl_formula",
+      title: "上下垫层成本公式",
+      basicinfo: {
+        el: "input",
+        offset: 1,
+        span: 3,
+        group: "其他",
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "felt_hr_formula",
+      title: "上下垫层人力成本公式",
+      basicinfo: {
+        el: "input",
+        offset: 1,
+        span: 3,
+        group: "其他",
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "packet_mtrl_formula",
+      title: "包装材料成本公式",
+      basicinfo: {
+        el: "input",
+        offset: 1,
+        span: 3,
+        group: "其他",
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "packet_hr_formula",
+      title: "包装人工成本公式",
+      basicinfo: {
+        el: "input",
+        offset: 1,
+        span: 3,
+        group: "其他",
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "spring_weight_formula",
+      title: "铁丝重量",
+      basicinfo: {
+        el: "input",
+        offset: 1,
+        span: 3,
+        group: "重量",
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "side_iron_weight_formula",
+      title: "边铁重量",
+      basicinfo: {
+        el: "input",
+        offset: 1,
+        span: 3,
+        group: "重量",
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "hard_around_weight_formula",
+      title: "四周加硬重量",
+      basicinfo: {
+        el: "input",
+        offset: 1,
+        span: 3,
+        group: "重量",
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "fabrics1_weight_formula",
+      title: "入袋无纺布重量",
+      basicinfo: {
+        el: "input",
+        offset: 1,
+        span: 3,
+        group: "重量",
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "fabrics2_weight_formula",
+      title: "面底无纺布重量",
+      basicinfo: {
+        el: "input",
+        offset: 1,
+        span: 3,
+        group: "重量",
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "felt_weight_formula",
+      title: "上下垫层物料重量",
+      basicinfo: {
+        el: "input",
+        offset: 1,
+        span: 3,
+        group: "重量",
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "cnail_weight_formula",
+      title: "C钉/夹码重量",
+      basicinfo: {
+        el: "input",
+        offset: 1,
+        span: 3,
+        group: "重量",
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "sponge_weight_formula",
+      title: "海绵包边重量",
+      basicinfo: {
+        el: "input",
+        offset: 1,
+        span: 3,
+        group: "重量",
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "sponge_weight_tc_formula",
+      title: "填充物料重量",
+      basicinfo: {
+        el: "input",
+        offset: 1,
+        span: 3,
+        group: "重量",
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "edge_weight_formula",
+      title: "封边物料重量",
+      basicinfo: {
+        el: "input",
+        offset: 1,
+        span: 3,
+        group: "重量",
+        editable: ALLOW_EDIT_STATE,
+        props: { type: "textarea", rows: 3 }
+      }
+    },
+    {
+      field: "fork_weight_formula",
+      title: "弹叉重量",
       basicinfo: {
         el: "input",
         offset: 1,
         span: 3,
+        group: "重量",
         editable: ALLOW_EDIT_STATE,
         props: { type: "textarea", rows: 3 }
       }

+ 2 - 1
JLHWEB/src/views/baseinfo/bednettype/index.vue

@@ -36,7 +36,7 @@
         <span class="text-h5-b">类别: {{ typename }}</span>
       </div>
     </template>
-    <div class="flx-1 h-full">
+    <div class="flx-col">
       <LjHeaderMenu :data="mainData" :action="orderStatus ? orderEditAction : orderDefaultAction" />
       <Detail class="flx-1" :data="mainData" :status="orderStatus" :enum="enumMap" />
     </div>
@@ -141,6 +141,7 @@ const LjDrawerRef = ref();
 const handleDBlClickTable = ({ row, rowIndex, $rowIndex, column, columnIndex, $columnIndex, $event }: any) => {
   // 弹窗
   mainData.value = cloneDeep(row);
+  console.log("handleDBlClickTable :>> ", mainData.value);
   typename.value = row.typename;
   orderStatus.value = "edit";
   LjDrawerRef.value.show();

+ 133 - 8
JLHWEB/src/views/erpapi/mattressInterface/detail.vue

@@ -24,11 +24,12 @@
         :tool-button="[]"
         :auto-load-layout="false"
         collapseButtons
+        :cellClassName="cellClassNameFn"
       >
       </LjVxeTable>
     </template>
-    <template #tabNavRight v-if="orderStatus">
-      <div class="flx-center flx-end flx-1">
+    <template #tabNavRight="scope" v-if="orderStatus">
+      <div class="flx-center flx-end flx-1" v-if="scope.active == 'mattressQD'">
         <LjHeaderMenu group-cls="flx-end" :action="qdAction"></LjHeaderMenu>
       </div>
     </template>
@@ -92,6 +93,7 @@ import MattressDialog from "@/views/system/selector/mattress/index.vue";
 import MtrldefErpDialog from "@/views/system/selector/mtrldefErp/index.vue";
 import { formatToDate } from "@/utils/dateUtil";
 import LjFoldLayout from "@/components/LjFoldLayout/index.vue";
+import { detailAction } from "@/components/LjDetail/interface";
 
 interface detailProp {
   /**
@@ -191,7 +193,98 @@ const loadingStatus = reactive({
   save: false
 });
 
-const qdAction = [
+const cellClassNameFn = (data: any, editable) => {
+  let { column, row } = data;
+  if (editable) {
+    if (column.field == "bj_pzname") {
+      if (
+        ["垫层", "辅料"].includes(row.itemname) ||
+        [
+          "边带",
+          "面层裥棉图案",
+          "底层裥棉图案",
+          "大侧裥棉图案",
+          "小侧1裥棉图案",
+          "小侧2裥棉图案",
+          "小侧3裥棉图案",
+          "拉手刺绣及其他工艺项目所有"
+        ].includes(row.bj_pzname)
+      ) {
+        return "vxecol-danger";
+      }
+    }
+  }
+  return null;
+};
+
+const moveData = async (index: number, nextIndex: number) => {
+  const $table = QdTableRef.value.element;
+  let { visibleData } = $table.getTableData();
+  const curRecords = $table?.getCurrentRecord();
+
+  let prevRow = visibleData[nextIndex];
+  visibleData[nextIndex] = visibleData[index];
+  visibleData[index] = prevRow;
+
+  visibleData.map((o, idx) => {
+    o.printid = idx + 1;
+    return o;
+  });
+
+  $table.reloadData(visibleData);
+  await $table.setCurrentRow(curRecords);
+  resetMergeCellsQd();
+};
+
+const toMove = async (action: number) => {
+  const $table = QdTableRef.value.element;
+  let curRecords = $table?.getCurrentRecord();
+
+  let visibleData = $table.getTableData().visibleData;
+
+  if (!curRecords) {
+    ElMessage.warning("请先选择要移动的行");
+    return;
+  }
+
+  let curIdx = visibleData.findIndex(t => t === curRecords);
+  console.log("curIdx :>> ", curIdx);
+
+  if (action == 1) {
+    // 上移
+    if (curIdx == 0) {
+      ElMessage.warning("已经是第一条了");
+      return;
+    }
+    moveData(curIdx, curIdx - 1);
+  } else if (action == -1) {
+    // 下移
+    if (curIdx == visibleData.length - 1) {
+      ElMessage.warning("已经是最后一条了");
+      return;
+    }
+
+    moveData(curIdx, curIdx + 1);
+  }
+};
+
+const qdAction: detailAction[] = [
+  buttonDefault({
+    label: "上移",
+    clickFunc: () => toMove(1)
+  }),
+  buttonDefault({
+    label: "下移",
+    clickFunc: () => toMove(-1),
+    divider: true
+  }),
+  buttonDefault({
+    label: "增行"
+  }),
+  buttonDefault({
+    label: "插行",
+    divider: true
+  }),
   buttonDefault({
     label: "批量设置",
     clickFunc: () => {
@@ -268,6 +361,31 @@ const orderDefaultAction = [
       try {
         await LjDetailRef.value.toValidateForm();
 
+        let $tableYW = VxeTableMxRef.value.element;
+        let { visibleData } = $tableYW.getTableData();
+        visibleData.map(o => {
+          console.log("tableYW visibleData o :>> ", o);
+          if (
+            ["垫层", "辅料"].includes(o.itemname) ||
+            [
+              "边带",
+              "面层裥棉图案",
+              "底层裥棉图案",
+              "大侧裥棉图案",
+              "小侧1裥棉图案",
+              "小侧2裥棉图案",
+              "小侧3裥棉图案",
+              "拉手刺绣及其他工艺项目所有"
+            ].includes(o.bj_pzname)
+          ) {
+            if (o.bj_namemx == "") {
+              VxeTableMxRef.value.scrollTo(o, "bj_namemx");
+              throw new Error("产品配置:【" + o.bj_pzname + "】的明细是必填项,请输入/选择");
+            }
+          }
+          return o;
+        });
+
         ElMessageBox.confirm("是否确定要保存吗?", "询问", {
           confirmButtonText: "是",
           cancelButtonText: "否",
@@ -319,12 +437,18 @@ const orderDefaultAction = [
           }
         });
       } catch (error) {
-        for (const key in error) {
-          if (Object.prototype.hasOwnProperty.call(error, key)) {
-            const element = error[key];
-            ElMessage.error(element[0].message);
+        console.log("errorerrorerrorerror :>> ", typeof error, error);
+        if (error.hasOwnProperty("message")) {
+          ElMessage.error(error.message);
+        } else {
+          for (const key in error) {
+            if (Object.prototype.hasOwnProperty.call(error, key)) {
+              const element = error[key];
+              ElMessage.error(element[0].message);
+            }
           }
         }
+
         return false;
       }
     }
@@ -613,7 +737,7 @@ const routeToEdit = (type: any) => {
  * @description 页面数据加载完成
  */
 const funcAfterMound = async () => {
-  console.log("onMounted detail sale start!!!! :>> ");
+  console.log("onMounted detail sale start!!!! :>> ", orderStatus.value);
   if (!orderStatus.value) {
     // 详情页
     // gotoSummy(8000);
@@ -623,6 +747,7 @@ const funcAfterMound = async () => {
     // tableProps_mx_yw.value.editConfig.enabled = true;
     // tableProps_mx_qd.value.editConfig.enabled = true;
   }
+  console.log("onMounted detail sale start!!!! :>> ", tableProps_mx.value.editConfig);
 
   console.log("onMounted detail sale start LjDetailRef.value.mainData :>> ", LjDetailRef.value);
 

+ 6 - 6
JLHWEB/src/views/erpapi/mattressInterface/hooks/index.tsx

@@ -515,7 +515,7 @@ export const useHooks = (t?: any) => {
   const columns_detail: ColumnProps<any>[] = [
     {
       field: "erp_mtrlcode",
-      title: "物料编码",
+      title: "系统物料编码",
       basicinfo: {
         el: "input",
         // props: {
@@ -533,7 +533,7 @@ export const useHooks = (t?: any) => {
     },
     {
       field: "erp_mtrlname",
-      title: "物料名称",
+      title: "系统物料名称",
       basicinfo: {
         el: "input",
         editable: ALLOW_EDIT_STATE,
@@ -544,7 +544,7 @@ export const useHooks = (t?: any) => {
     },
     {
       field: "erp_mtrlmode",
-      title: "物料规格",
+      title: "物料规格",
       basicinfo: {
         el: "input",
         editable: ALLOW_EDIT_STATE,
@@ -639,7 +639,7 @@ export const useHooks = (t?: any) => {
     },
     {
       field: "erp_mtrlengname",
-      title: "英文名称",
+      title: "旧床垫编码",
       basicinfo: {
         el: "input",
         editable: ALLOW_EDIT_STATE,
@@ -735,7 +735,7 @@ export const useHooks = (t?: any) => {
           pzid: row.erp_pzid
         };
 
-        if (row.bj_inputtype == "0") {
+        if (row.bj_inputtype == 0) {
           return (
             <CodemxSelect
               value={scope.row.bj_namemx}
@@ -746,7 +746,7 @@ export const useHooks = (t?: any) => {
               onClear={() => rModelClearCodemx(scope.row, $table)}
             ></CodemxSelect>
           );
-        } else if (row.bj_inputtype == "1") {
+        } else if (row.bj_inputtype == 1) {
           return <el-input v-model={scope.row.bj_namemx} />;
         } else {
           return <span>{row.bj_namemx}</span>;

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

@@ -204,7 +204,7 @@ export const useHooks = (t?: any, props?: any) => {
       // if (!ALLOW_EDIT_STATE.includes(status)) return;
 
       let _params = {
-        arg_springtypeid: "11", // 默认选择国内分类
+        // arg_springtypeid: "11", // 默认选择国内分类
         ...params
       };
       state.SpringDialogProps = {

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

@@ -2,7 +2,14 @@
   <div style="display: table">
     <el-row class="statistic-row h-full" :gutter="8" style="width: 180px" :class="{ 'is-admin': userInfo.usermode === 0 }">
       <el-col :span="24" v-for="(item, index) in statisticData" :key="index">
-        <StatisticItem :data="item" v-bind="$attrs" :iforigin="props.iforigin" @click="handleClick(item)" />
+        <StatisticItem
+          :data="item"
+          v-bind="$attrs"
+          :iforigin="props.iforigin"
+          @click="handleClick(item)"
+          :moneyrate="moneyrate"
+          :ifMoneyrate="ifMoneyrate"
+        />
       </el-col>
     </el-row>
   </div>
@@ -17,6 +24,8 @@ interface WidgetProps {
   data: any;
   differ?: any;
   iforigin?: any;
+  moneyrate?: any;
+  ifMoneyrate?: any;
 }
 
 interface statisticDataProps {

+ 38 - 14
JLHWEB/src/views/quote/mattressQuote/components/StatisticItem.vue

@@ -4,20 +4,27 @@
       <template #title>
         {{ isFilterLabel(data.label) }}
         <!-- <div class="footer-item">
-          <i class="iconfont iconjiu"></i>
-          <span>{{ isFilterPrice(data.origin) }}</span>
-        </div> -->
+            <i class="iconfont iconjiu"></i>
+            <span>{{ isFilterPrice(data.origin) }}</span>
+          </div> -->
+
+        <div class="text-f-c text-secondary-text" v-if="ifMoneyrate">
+          {{ currentMoneyrate.label }}
+        </div>
+      </template>
+      <template #suffix>
+        <div class="text-body-c text-secondary-text ml-4" v-if="ifMoneyrate" style="font-weight: 500">
+          {{ cprRateValue }}
+        </div>
+        <!-- <span
+            v-if="getDiscrepancy !== 0"
+            class="statistic-suffix"
+            :class="getDiscrepancy > 0 ? 'green' : 'red'"
+            style="text-align: right"
+          >
+            {{ getDiscrepancy }}
+          </span> -->
       </template>
-      <!-- <template #suffix>
-        <span
-          v-if="getDiscrepancy !== 0"
-          class="statistic-suffix"
-          :class="getDiscrepancy > 0 ? 'green' : 'red'"
-          style="text-align: right"
-        >
-          {{ getDiscrepancy }}
-        </span>
-      </template> -->
     </el-statistic>
     <div class="statistic-footer" v-if="iforigin">
       <div class="footer-item">
@@ -35,7 +42,7 @@
 </template>
 
 <script setup lang="ts" name="mattressQuoteDetail_statistic-item">
-import { ref, watch, computed } from "vue";
+import { ref, watch, computed, inject } from "vue";
 import { useTransition } from "@vueuse/core";
 // import { CaretTop, CaretBottom } from "@element-plus/icons-vue";
 import { floatSub, formatAmount3 } from "@/utils/index";
@@ -43,6 +50,8 @@ import { floatSub, formatAmount3 } from "@/utils/index";
 interface WidgetProps {
   data: any;
   iforigin?: any;
+  moneyrate?: any;
+  ifMoneyrate?: any;
 }
 
 const props = withDefaults(defineProps<WidgetProps>(), {
@@ -54,6 +63,21 @@ const outputValue = useTransition(source, {
   duration: 800
 });
 
+const enumMap = inject("mainEnumMap", ref(new Map()));
+
+console.log("mattressQuoteDetail_statistic enumMap :>> ", enumMap);
+
+const currentMoneyrate = computed(() => {
+  let _enum = enumMap.value.get("moneyrate") ?? [];
+  let item = _enum.find(item => item.value === props.ifMoneyrate);
+  return item ?? { label: "暂无数据" };
+});
+
+const cprRateValue = computed(() => {
+  let _moneyrate = props.moneyrate == 0 ? 1 : props.moneyrate;
+  return formatAmount3({ val: source.value / _moneyrate });
+});
+
 const isFilterLabel = val => {
   return val.replace(/【/g, "").replace(/】/g, "");
 };

+ 16 - 1
JLHWEB/src/views/quote/mattressQuote/detail.vue

@@ -35,6 +35,8 @@
         :differ="cmpDiffer"
         :iforigin="isShowOriginFormulaMattress"
         :precision="2"
+        :moneyrate="cmpMoneyrate"
+        :ifMoneyrate="cmpIfMoneyrate"
         @click="gotoShowFormula"
       />
     </template>
@@ -2219,6 +2221,10 @@ onMounted(() => {
  */
 const funcAfterMound = async () => {
   console.log("onMounted detail sale start!!!! :>> ", orderStatus.value, orderStatus.value != "new");
+  if (route.fullPath.indexOf("/copy?") > -1) {
+    LjDetailRef.value._mainData.mattresscode = "";
+  }
+
   if (!orderStatus.value) {
     // 详情页
   } else {
@@ -2858,7 +2864,9 @@ const toAddMx_subSpecs = async () => {
       mattresscode: "",
       mattress_width: "",
       mattress_length: "",
-      mattress_height: ""
+      mattress_height: LjDetailRef.value._mainData.mattress_height,
+      spring_qty_length: 0,
+      spring_qty_width: 0
     };
     const { row: newRow } = await $table.insertNextAt(records, -1);
     await $table.setEditCell(newRow, "mattress_width");
@@ -2948,6 +2956,13 @@ const handleCellDblClick_bednet = ({ row, rowIndex, $rowIndex, column, columnInd
     LjDrawerRef.value.show(true);
   }
 };
+
+const cmpMoneyrate = computed(() => {
+  return LjDetailRef.value?._mainData.moneyrate ?? 0;
+});
+const cmpIfMoneyrate = computed(() => {
+  return LjDetailRef.value._mainData.if_moneyrate ?? 0;
+});
 </script>
 
 <style lang="scss">

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

@@ -5101,7 +5101,7 @@ export const useHooks = (t?: any) => {
       editColRender: (scope: any) => {
         return (
           <>
-            <el-input v-model={scope.row.mattress_width} onChange={() => disshow_subspecs(scope.row)} />
+            <el-input v-model={scope.row.mattress_width} onChange={() => disshow_subspecs(scope)} />
           </>
         );
       }
@@ -5120,7 +5120,7 @@ export const useHooks = (t?: any) => {
       editColRender: (scope: any) => {
         return (
           <>
-            <el-input v-model={scope.row.mattress_length} onChange={() => disshow_subspecs(scope.row)} />
+            <el-input v-model={scope.row.mattress_length} onChange={() => disshow_subspecs(scope)} />
           </>
         );
       }
@@ -5128,21 +5128,21 @@ export const useHooks = (t?: any) => {
     {
       title: "床垫高/CM",
       field: "mattress_height",
-      datatype: "number",
+      datatype: "number"
       // editRender: {
       //   name: "$input",
       //   props: {
       //     type: "number"
       //   }
       // }
-      editRender: {},
-      editColRender: (scope: any) => {
-        return (
-          <>
-            <el-input v-model={scope.row.mattress_height} onChange={() => disshow_subspecs(scope.row)} />
-          </>
-        );
-      }
+      // editRender: {},
+      // editColRender: (scope: any) => {
+      //   return (
+      //     <>
+      //       <el-input v-model={scope.row.mattress_height} onChange={() => disshow_subspecs(scope.row)} />
+      //     </>
+      //   );
+      // }
     },
     {
       title: "弹簧排列个数-宽",
@@ -5426,8 +5426,9 @@ export const useHooks = (t?: any) => {
   /**
    * @description 设置床网高度,自动计算宽度,长度
    */
-  const setMxSpringQtyWidthAndLength = async row => {
-    console.log("setMxSpringQtyWidthAndLength varow :>> ", row);
+  const setMxSpringQtyWidthAndLength = async scope => {
+    console.log("setMxSpringQtyWidthAndLength varow :>> ", scope);
+    const { row } = scope;
     const $tableBednet = state.bednetMxRef.element;
     if ($tableBednet) {
       const { visibleData } = $tableBednet.getTableData();
@@ -5456,6 +5457,8 @@ export const useHooks = (t?: any) => {
       // bednet.ifsaleout = Number(bednet.ifsaleout);
       // bednet.if_jb = Number(bednet.if_jb);
       // bednet.flag = Number(bednet.flag);
+      bednet.mattress_length = row.mattress_length;
+      bednet.mattress_width = row.mattress_width;
       bednet.pricelistid = _pricelistid;
 
       let _params: any = {
@@ -5469,9 +5472,10 @@ export const useHooks = (t?: any) => {
       console.log("setMxSpringQtyWidthAndLength res :>> ", res);
       console.log("setMxSpringQtyWidthAndLength row :>> ", row);
       if (!res?.message) {
-        row.spring_qty_width = res.bednetMx[0].spring_qty_width;
-        row.spring_qty_length = res.bednetMx[0].spring_qty_length;
+        scope.row.spring_qty_width = res.bednetMx[0].spring_qty_width;
+        scope.row.spring_qty_length = res.bednetMx[0].spring_qty_length;
       }
+      console.log("setMxSpringQtyWidthAndLength scopes row :>> ", scope.row);
     }
   };