Browse Source

JLHWEB: 1、床垫清单,编辑时产品清单合产品配置,新增增删插行功能;2、修复床网报价-弹簧选择按照床网类别筛选

JohnnyChan 2 days ago
parent
commit
5ca6a3fe03

+ 2 - 2
JLHWEB/src/components/LjHeaderMenu/index.vue

@@ -4,15 +4,15 @@
 
 
 <script setup lang="tsx" name="LjHeaderMenu">
 <script setup lang="tsx" name="LjHeaderMenu">
 import { ref, reactive, computed, watch, nextTick, useSlots, onMounted } from "vue";
 import { ref, reactive, computed, watch, nextTick, useSlots, onMounted } from "vue";
-import { useI18n } from "vue-i18n";
 import { convertStrToObj } from "@/utils";
 import { convertStrToObj } from "@/utils";
 import ButtonGroup from "@/components/LjDetail/components/ButtonGroup.vue";
 import ButtonGroup from "@/components/LjDetail/components/ButtonGroup.vue";
 import { detailAction } from "@/components/LjDetail/interface";
 import { detailAction } from "@/components/LjDetail/interface";
 import { useAuthButtons } from "@/hooks/useAuthButtons";
 import { useAuthButtons } from "@/hooks/useAuthButtons";
 import { useGlobalStore } from "@/stores/modules/global";
 import { useGlobalStore } from "@/stores/modules/global";
 // import { useDesign } from "@/hooks/useDesign";
 // import { useDesign } from "@/hooks/useDesign";
+import { t } from "@/utils/i18n";
 
 
-const { t } = useI18n();
+// const { t } = useI18n();
 const slots = useSlots();
 const slots = useSlots();
 // const { prefixCls } = useDesign("header-menu");
 // const { prefixCls } = useDesign("header-menu");
 
 

+ 49 - 30
JLHWEB/src/utils/dialog.ts

@@ -1,33 +1,52 @@
-import { h, render } from "vue";
-/**
- * 函数式弹窗
- * @param component 组件
- * @param options 组件参数
- * @returns
- */
-function createDialog(component: any, options: any) {
+import { h, nextTick, render, ref } from "vue";
+
+const dialog = (aRender: any, option: any) => {
   return new Promise((resolve, reject) => {
   return new Promise((resolve, reject) => {
-    // 创建一个div节点
-    const mountNode = document.createElement("div");
-    // 将div节点拼接到Dom的body节点下
-    document.body.appendChild(mountNode);
-    // 使用h函数创建节点
-    const vNode = h(component, {
-      ...options,
-      // 注意: vue子组件emit回调事件名称必须以on开头
-      onSubmit: (data: any) => {
-        resolve(data);
-        // 移除节点
-        document.body.removeChild(mountNode);
-      },
-      onCancel: (data: any) => {
-        reject(data);
-        // 移除节点
-        document.body.removeChild(mountNode);
-      }
+    const divDom = document.createElement("div");
+    document.body.appendChild(divDom);
+
+    // 👇 创建 ref 来引用组件实例
+    // const componentRef = ref();
+
+    const onSubmit = (data: any) => {
+      resolve(data);
+      onClosed();
+      // componentRef.value.hide(); // 调用组件内部方法
+    };
+
+    const onCancel = () => {
+      reject();
+      onClosed();
+    };
+
+    const onClosed = () => {
+      // nextTick(() => {
+      console.log("closeddd :>> ");
+      render(null, divDom);
+      divDom.remove();
+      // });
+    };
+
+    const vNode = h(aRender, {
+      ...option,
+      modelValue: true,
+      onSubmit,
+      onCancel,
+      onClose: onCancel,
+      onClosed
+
+      // 👇 将组件实例赋值给 componentRef
+      // ref: componentRef
     });
     });
-    // 渲染Dialog
-    render(vNode, mountNode);
+    render(vNode, divDom);
+
+    // // 👇 提供一个外部可调用的方法来触发组件内部函数
+    // (dialog as any).invokeComponentMethod = () => {
+    //   if (componentRef.value) {
+    //     console.log("componentRef valll:>> ", componentRef.value);
+    //     componentRef.value.show(); // 调用组件内部方法
+    //   }
+    // };
   });
   });
-}
-export default createDialog;
+};
+export default dialog;

+ 6 - 0
JLHWEB/src/utils/i18n.ts

@@ -0,0 +1,6 @@
+import I18n from "@/languages/index";
+
+// 直接使用全局实例
+export const t = (key: string) => {
+  return I18n.global.t(key);
+};

+ 91 - 0
JLHWEB/src/views/erpapi/mattressInterface/components/insterMx.vue

@@ -0,0 +1,91 @@
+<template>
+  <LjDialogNew v-bind="$attrs" class="is-selector" :style="{ padding: 0 }" width="600px" :closed="closed">
+    <template #header>
+      <div class="flx-1">
+        <span class="text-h5-b">产品清单新增</span>
+      </div>
+    </template>
+
+    <div class="flx-1 h-full">
+      <LjHeaderMenu :action="defaultAction" />
+      <el-form class="mr-16" :model="formdata" label-width="140px">
+        <el-form-item label="项目">
+          <el-autocomplete
+            v-model="formdata.itemname"
+            :fetch-suggestions="(q, c) => querySearch(q, c, itemnameArr)"
+            clearable
+            placeholder="请输入项目"
+          />
+        </el-form-item>
+        <el-form-item label="二级项目">
+          <el-autocomplete
+            v-model="formdata.bj_pzname"
+            :fetch-suggestions="(q, c) => querySearch(q, c, bjPznameArr)"
+            clearable
+            placeholder="请输入二级项目"
+          />
+        </el-form-item>
+        <el-form-item label="明细项目">
+          <el-input v-model="formdata.bj_pzname_mx" placeholder="请输入明细项目"></el-input>
+        </el-form-item>
+        <el-form-item label="核价系统物料名称">
+          <el-input v-model="formdata.bj_pzname_mx_mx" placeholder="请输入核价系统物料名称"></el-input>
+        </el-form-item>
+      </el-form>
+    </div>
+  </LjDialogNew>
+</template>
+
+<script lang="ts" setup name="mattressInterfaceDetail_InsterMxDialog">
+import { ref, defineEmits, computed } from "vue";
+import LjDialogNew from "@/components/LjDialog/index-new.vue";
+import { useAuthButtons } from "@/hooks/useAuthButtons";
+import LjHeaderMenu from "@/components/LjHeaderMenu/index.vue";
+
+const emits = defineEmits(["cancel", "submit", "closed", "update:modelValue"]);
+const { buttonDefault } = useAuthButtons();
+
+interface WidgetProps {
+  formData: any;
+  itemnameEnum?: any[];
+  bjPznameEnum?: any[];
+}
+const props = withDefaults(defineProps<WidgetProps>(), {
+  formData: () => ({})
+});
+
+const formdata = ref({
+  ...props.formData
+});
+
+const closed = () => {
+  emits("closed");
+};
+
+const defaultAction = [
+  buttonDefault({
+    label: "确定",
+    clickFunc: () => {
+      emits("submit", formdata.value);
+    }
+  }),
+  buttonDefault({
+    label: "取消",
+    clickFunc: () => {
+      emits("cancel");
+    }
+  })
+];
+
+const itemnameArr = computed(() => props.itemnameEnum);
+const bjPznameArr = computed(() => props.bjPznameEnum);
+const querySearch = (queryString: string, cb: any, arr: any) => {
+  const results = queryString ? arr.filter(createFilter(queryString)) : arr;
+  cb(results);
+};
+const createFilter = (queryString: string) => {
+  return itm => {
+    return itm.value.indexOf(queryString.trim()) === 0;
+  };
+};
+</script>

+ 87 - 0
JLHWEB/src/views/erpapi/mattressInterface/components/insterPz.vue

@@ -0,0 +1,87 @@
+<template>
+  <LjDialogNew v-bind="$attrs" class="is-selector" :style="{ padding: 0 }" width="600px" :closed="closed">
+    <template #header>
+      <div class="flx-1">
+        <span class="text-h5-b">产品配置新增</span>
+      </div>
+    </template>
+
+    <div class="flx-1 h-full">
+      <LjHeaderMenu :action="defaultAction" />
+      <el-form class="mr-16" :model="formdata" label-width="140px">
+        <el-form-item label="项目">
+          <el-autocomplete
+            v-model="formdata.itemname"
+            :fetch-suggestions="(q, c) => querySearch(q, c, itemnameArr)"
+            clearable
+            class="inline-input w-50"
+            placeholder="请输入项目名称"
+          />
+        </el-form-item>
+        <el-form-item label="核价_配置名称">
+          <el-autocomplete
+            v-model="formdata.bj_pzname"
+            :fetch-suggestions="(q, c) => querySearch(q, c, bjPznameArr)"
+            clearable
+            class="inline-input w-50"
+            placeholder="请输入核价配置名称"
+          />
+        </el-form-item>
+      </el-form>
+    </div>
+  </LjDialogNew>
+</template>
+
+<script lang="ts" setup name="mattressInterfaceDetail_InsterPzDialog">
+import { ref, defineEmits, computed } from "vue";
+import LjDialogNew from "@/components/LjDialog/index-new.vue";
+import { useAuthButtons } from "@/hooks/useAuthButtons";
+import LjHeaderMenu from "@/components/LjHeaderMenu/index.vue";
+
+const emits = defineEmits(["cancel", "submit", "closed", "update:modelValue"]);
+const { buttonDefault } = useAuthButtons();
+
+interface WidgetProps {
+  formData: any;
+  itemnameEnum?: any[];
+  bjPznameEnum?: any[];
+}
+const props = withDefaults(defineProps<WidgetProps>(), {
+  formData: () => ({})
+});
+
+const formdata = ref({
+  ...props.formData
+});
+
+const closed = () => {
+  emits("closed");
+};
+
+const defaultAction = [
+  buttonDefault({
+    label: "确定",
+    clickFunc: () => {
+      emits("submit", formdata.value);
+    }
+  }),
+  buttonDefault({
+    label: "取消",
+    clickFunc: () => {
+      emits("cancel");
+    }
+  })
+];
+
+const itemnameArr = computed(() => props.itemnameEnum);
+const bjPznameArr = computed(() => props.bjPznameEnum);
+const querySearch = (queryString: string, cb: any, arr: any) => {
+  const results = queryString ? arr.filter(createFilter(queryString)) : arr;
+  cb(results);
+};
+const createFilter = (queryString: string) => {
+  return itm => {
+    return itm.value.indexOf(queryString.trim()) === 0;
+  };
+};
+</script>

+ 262 - 108
JLHWEB/src/views/erpapi/mattressInterface/detail.vue

@@ -75,44 +75,6 @@
     </template>
     </template>
   </LjDetail>
   </LjDetail>
 
 
-  <LjDialog ref="LjDialogQdRowAdd" class="is-selector" :style="{ padding: 0 }" width="480px">
-    <template #header>
-      <div class="flx-1">
-        <span class="text-h5-b">产品清单新增</span>
-      </div>
-    </template>
-    <!-- <div class="flx-1 h-full">
-      <LjHeaderMenu :action="qdDefaultAction" />
-      {{ interIndex }}
-      <el-form :model="qdFormParam" label-width="80px">
-        <el-form-item label="项目">
-          <el-select v-model="qdFormParam.itemname" placeholder="请选择部门">
-            <el-option v-for="(col, index) in itemnameEnum" :key="index" :label="col.label" :value="col.value"></el-option>
-          </el-select>
-          <el-autocomplete
-            v-model="qdFormParam.itemname"
-            :fetch-suggestions="querySearch"
-            :trigger-on-focus="false"
-            clearable
-            class="inline-input w-50"
-            placeholder="Please Input"
-            @select="handleSelect"
-          />
-        </el-form-item>
-        <el-form-item label="二级项目">
-          <el-select v-model="qdFormParam.bj_pzname">
-            <el-option v-for="(col, index) in itemnameEnum" :key="index" :label="col.label" :value="col.value"></el-option>
-          </el-select>
-        </el-form-item>
-        <el-form-item label="明细项目">
-          <el-select v-model="qdFormParam.bj_pzname_mx">
-            <el-option v-for="(col, index) in itemnameEnum" :key="index" :label="col.label" :value="col.value"></el-option>
-          </el-select>
-        </el-form-item>
-        核价系统物料名称
-      </el-form>
-    </div> -->
-  </LjDialog>
   <MattressDialog ref="MattressDialogRef" v-bind="MattressDialogProps" />
   <MattressDialog ref="MattressDialogRef" v-bind="MattressDialogProps" />
   <MtrldefErpDialog ref="MtrldefErpDialogRef" v-bind="MtrldefErpDialogProps" />
   <MtrldefErpDialog ref="MtrldefErpDialogRef" v-bind="MtrldefErpDialogProps" />
   <!-- <SetSubspecsDialog ref=SetSubspecsDialogRef" /> -->
   <!-- <SetSubspecsDialog ref=SetSubspecsDialogRef" /> -->
@@ -139,8 +101,10 @@ import LjFoldLayout from "@/components/LjFoldLayout/index.vue";
 import { detailAction } from "@/components/LjDetail/interface";
 import { detailAction } from "@/components/LjDetail/interface";
 import { transformTreeData, autoMergeCells, isFilterPrice } from "@/utils/index";
 import { transformTreeData, autoMergeCells, isFilterPrice } from "@/utils/index";
 import LjDialog from "@/components/LjDialog/index.vue";
 import LjDialog from "@/components/LjDialog/index.vue";
-// import dialog from "@/utils/dialog";
+import dialog from "@/utils/dialog";
 // import SetSubspecsDialog from "./components/setSubspecs.vue";
 // import SetSubspecsDialog from "./components/setSubspecs.vue";
+import InsterMxDialog from "./components/insterMx.vue";
+import InsterPzDialog from "./components/insterPz.vue";
 
 
 interface detailProp {
 interface detailProp {
   /**
   /**
@@ -337,26 +301,120 @@ const toMove = async (refName: string, action: number) => {
   }
   }
 };
 };
 
 
+const pzFormData = ref({
+  itemname: "辅料",
+  bj_pzname: ""
+});
+/**
+ * @description 配置插入明细行
+ * @param refName 表格ref名称
+ * @param type 0:最后插入,1:插入列
+ */
+const FuncInsertRowPz = (refName: string, type: number) => {
+  const _ref = dynamicRef(refName);
+  const $table = _ref.element;
+  let insertParam = null;
+
+  if ($table) {
+    let { visibleData } = $table.getTableData();
+
+    // 判断插入位置
+    if (type == 1) {
+      let currentRecod = $table.getCurrentRecord();
+      insertParam = currentRecod;
+    } else {
+      insertParam = -1;
+    }
+    // 收集下拉数据
+    let itEnum = [{ value: "辅料" }];
+
+    let pzEnum = [
+      { value: "价外物料1" },
+      { value: "价外物料1做法" },
+      { value: "价外物料2" },
+      { value: "价外物料2做法" },
+      { value: "价外物料3" },
+      { value: "价外物料3做法" },
+      { value: "价外物料4" },
+      { value: "价外物料4做法" },
+      { value: "价外物料5" }
+    ];
+
+    console.log("itEnum :>> ", itEnum);
+    dialog(InsterPzDialog, {
+      formData: pzFormData.value,
+      itemnameEnum: itEnum,
+      bjPznameEnum: pzEnum
+    }).then((data: any) => {
+      $table.insertAt(data, insertParam).then(async ({ row }) => {
+        // $table.reloadData(visibleData);
+
+        const $table1 = dynamicRef(refName).element;
+
+        if ($table1) {
+          let visibleData1 = $table1.getTableData().visibleData;
+
+          visibleData1.map((o, idx) => {
+            o.printid = idx + 1;
+            return o;
+          });
+
+          await $table1.reloadData(visibleData1);
+          resetMergeCells(() => {
+            dynamicRef(refName).scrollTo(row, "bj_namemx");
+          });
+        }
+      });
+    });
+  }
+};
 const qdActionYW: detailAction[] = [
 const qdActionYW: detailAction[] = [
-  // buttonDefault({
-  //   label: "增行",
-  //   clickFunc: () => {
-  //     interIndex.value = -1;
-  //     LjDialogQdRowAdd.value.show();
-  //   }
-  // }),
-  // buttonDefault({
-  //   label: "插行",
-  //   divider: true,
-  //   clickFunc: () => {
-  //     const $table = QdTableRef.value.element;
-  //     const curRecords = $table?.getCurrentRecord();
-  //     if (curRecords) {
-  //       interIndex.value = $table.getRowIndex(curRecords);
-  //     }
-  //     LjDialogQdRowAdd.value.show();
-  //   }
-  // }),
+  buttonDefault({
+    label: "增行",
+    clickFunc: () => FuncInsertRowPz("VxeTableMxRef", 0)
+  }),
+  buttonDefault({
+    label: "插行",
+    divider: true,
+    clickFunc: () => FuncInsertRowPz("VxeTableMxRef", 1)
+  }),
+  buttonDefault({
+    label: "删行",
+    limited: () => editType.value != 1,
+    // disabledTextCallBack: (data: any) => {
+    //   if (editType.value != 3) {
+    //     return "不是清单补充,无法操作";
+    //   }
+    //   return "";
+    // },
+    divider: true,
+    clickFunc: () => {
+      const $table = VxeTableMxRef.value.element;
+      if ($table) {
+        let curRow = $table.getCurrentRecord();
+        console.log("curRow :>> ", curRow);
+        if (!curRow) {
+          ElMessage.warning("请先选择要删除的行");
+          return;
+        }
+        ElMessageBox.confirm(`是否确定删除当前行?`, "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消"
+        })
+          .then(() => {
+            // $table.remove(curRow);
+
+            const $table = VxeTableMxRef.value.element;
+            if ($table) {
+              $table.removeCurrentRow();
+            }
+          })
+          .catch(() => {
+            // ElMessage.warning("已经取消审批流程操作!");
+          });
+      }
+    }
+  }),
   buttonDefault({
   buttonDefault({
     label: "上移",
     label: "上移",
     clickFunc: () => toMove("VxeTableMxRef", 1)
     clickFunc: () => toMove("VxeTableMxRef", 1)
@@ -368,39 +426,140 @@ const qdActionYW: detailAction[] = [
   })
   })
 ];
 ];
 
 
+const qdFormData = ref({
+  itemname: "",
+  bj_pzname: "",
+  bj_pzname_mx: "",
+  bj_pzname_mx_mx: ""
+});
+
+/**
+ * @description 插入明细行
+ * @param refName 表格ref名称
+ * @param type 0:最后插入,1:插入列
+ */
+const FuncInsertRow = (refName: string, type: number) => {
+  const _ref = dynamicRef(refName);
+  const $table = _ref.element;
+  let insertParam = null;
+
+  if ($table) {
+    let { visibleData } = $table.getTableData();
+
+    // 判断插入位置
+    if (type == 1) {
+      let currentRecod = $table.getCurrentRecord();
+      insertParam = currentRecod;
+    } else {
+      insertParam = -1;
+    }
+    // 收集下拉数据
+    let itEnum = visibleData
+      .map(t => {
+        return {
+          value: t.itemname
+        };
+      })
+      .filter(t => t);
+
+    itEnum = [...new Set(itEnum.map(item => JSON.stringify(item)))].map((item: any) => JSON.parse(item));
+
+    let pzEnum = visibleData
+      .map(t => {
+        return {
+          value: t.bj_pzname
+        };
+      })
+      .filter(t => t);
+
+    pzEnum = [...new Set(pzEnum.map(item => JSON.stringify(item)))].map((item: any) => JSON.parse(item));
+
+    console.log("itEnum :>> ", itEnum);
+    dialog(InsterMxDialog, {
+      formData: qdFormData.value,
+      itemnameEnum: itEnum,
+      bjPznameEnum: pzEnum
+    }).then((data: any) => {
+      $table.insertAt(data, insertParam).then(({ row }) => {
+        // $table.reloadData(visibleData);
+        _ref.scrollTo(row, "bj_namemx");
+
+        if (type == 1) {
+          const $table1 = dynamicRef(refName).element;
+
+          if ($table1) {
+            let visibleData1 = $table1.getTableData().visibleData;
+
+            $table1.reloadData(visibleData1);
+            resetMergeCellsQd();
+          }
+        }
+      });
+    });
+  }
+};
+
 const qdAction: detailAction[] = [
 const qdAction: detailAction[] = [
   buttonDefault({
   buttonDefault({
     label: "增行",
     label: "增行",
-    clickFunc: () => {
-      interIndex.value = -1;
-      LjDialogQdRowAdd.value.show();
-    }
+    limited: () => editType.value != 3,
+    // disabledTextCallBack: (data: any) => {
+    //   if (editType.value != 3) {
+    //     return "不是清单补充,无法操作";
+    //   }
+    //   return "";
+    // },
+    clickFunc: () => FuncInsertRow("QdTableRef", 0)
   }),
   }),
   buttonDefault({
   buttonDefault({
     label: "插行",
     label: "插行",
+    limited: () => editType.value != 3,
+    // disabledTextCallBack: (data: any) => {
+    //   console.log("editType.value != 3 :>> ", editType.value != 3);
+    //   if (editType.value != 3) {
+    //     return "不是清单补充,无法操作";
+    //   }
+    //   return "";
+    // },
+    clickFunc: () => FuncInsertRow("QdTableRef", 1)
+  }),
+  buttonDefault({
+    label: "删行",
+    limited: () => editType.value != 3,
+    // disabledTextCallBack: (data: any) => {
+    //   if (editType.value != 3) {
+    //     return "不是清单补充,无法操作";
+    //   }
+    //   return "";
+    // },
+    divider: true,
     clickFunc: () => {
     clickFunc: () => {
       const $table = QdTableRef.value.element;
       const $table = QdTableRef.value.element;
-      const curRecords = $table?.getCurrentRecord();
-      if (curRecords) {
-        interIndex.value = $table.getRowIndex(curRecords);
+      if ($table) {
+        let curRow = $table.getCurrentRecord();
+        console.log("curRow :>> ", curRow);
+        if (!curRow) {
+          ElMessage.warning("请先选择要删除的行");
+          return;
+        }
+        ElMessageBox.confirm(`是否确定删除当前行?`, "提示", {
+          confirmButtonText: "确定",
+          cancelButtonText: "取消"
+        })
+          .then(() => {
+            // $table.remove(curRow);
+
+            const $table = QdTableRef.value.element;
+            if ($table) {
+              $table.removeCurrentRow();
+            }
+          })
+          .catch(() => {
+            // ElMessage.warning("已经取消审批流程操作!");
+          });
       }
       }
-      LjDialogQdRowAdd.value.show();
     }
     }
   }),
   }),
-  // buttonDefault({
-  //   label: "删行",
-  //   divider: true,
-  //   clickFunc: () => {
-  //     ElMessageBox.prompt(`是否确定删除当前行?`, "提示", {
-  //       confirmButtonText: "确定",
-  //       cancelButtonText: "取消"
-  //     })
-  //       .then(({ value }) => {})
-  //       .catch(() => {
-  //         // ElMessage.warning("已经取消审批流程操作!");
-  //       });
-  //   }
-  // }),
   buttonDefault({
   buttonDefault({
     label: "上移",
     label: "上移",
     clickFunc: () => toMove("QdTableRef", 1)
     clickFunc: () => toMove("QdTableRef", 1)
@@ -1100,32 +1259,27 @@ const autoRowDragend = async data => {
   // }, 1000);
   // }, 1000);
 };
 };
 
 
-const LjDialogQdRowAdd = ref();
-const interIndex = ref(0);
-const qdFormParam = ref({
-  itemname: "",
-  bj_pzname: "",
-  bj_pzname_mx: "",
-  u_mtrl_price_mtrlname: ""
-});
-const qdDefaultAction = [
-  buttonDefault({
-    label: t("common.cancelText"),
-    icon: "iconchevron-left",
-    clickFunc: item => {
-      LjDialogQdRowAdd.value.hide();
-    }
-  }),
-  buttonDefault({
-    label: t("common.okText"),
-    clickFunc: async item => {
-      LjDialogQdRowAdd.value.hide();
-    }
-  })
-];
-const querySearch = (queryString: string, cb: any) => {
-  const results = queryString ? restaurants.value.filter(createFilter(queryString)) : restaurants.value;
-  // call callback function to return suggestions
-  cb(results);
-};
+// const LjDialogQdRowAdd = ref();
+// const interIndex = ref(0);
+// const qdFormParam = ref({
+//   itemname: "",
+//   bj_pzname: "",
+//   bj_pzname_mx: "",
+//   u_mtrl_price_mtrlname: ""
+// });
+// const qdDefaultAction = [
+//   buttonDefault({
+//     label: t("common.cancelText"),
+//     icon: "iconchevron-left",
+//     clickFunc: item => {
+//       LjDialogQdRowAdd.value.hide();
+//     }
+//   }),
+//   buttonDefault({
+//     label: t("common.okText"),
+//     clickFunc: async item => {
+//       LjDialogQdRowAdd.value.hide();
+//     }
+//   })
+// ];
 </script>
 </script>

+ 6 - 1
JLHWEB/src/views/erpapi/mattressInterface/index.vue

@@ -38,7 +38,7 @@ import { DwnameEnum } from "@/enums/dwnameEnum";
 import { formatToDateTime, formatToDate } from "@/utils/dateUtil";
 import { formatToDateTime, formatToDate } from "@/utils/dateUtil";
 import { cloneDeep } from "lodash-es";
 import { cloneDeep } from "lodash-es";
 import { useGlobalStore } from "@/stores/modules/global";
 import { useGlobalStore } from "@/stores/modules/global";
-import { ElMessage, ElMessageBox } from "element-plus";
+import { ElMessage, ElMessageBox, ElNotification } from "element-plus";
 import { detailAction } from "@/components/LjDetail/interface";
 import { detailAction } from "@/components/LjDetail/interface";
 import mittBus from "@/utils/mittBus";
 import mittBus from "@/utils/mittBus";
 import { MittEnum } from "@/enums/mittEnum";
 import { MittEnum } from "@/enums/mittEnum";
@@ -209,6 +209,11 @@ const action: detailAction[] = [
         const { curRecords } = getCurrentRecords(vxeTableRef.value);
         const { curRecords } = getCurrentRecords(vxeTableRef.value);
 
 
         JSAudit(0, curRecords, () => {
         JSAudit(0, curRecords, () => {
+          ElNotification({
+            title: t("sys.api.operationSuccess"),
+            message: "产品补充审核后,需重新生成L1物料",
+            type: "warning"
+          });
           vxeTableRef.value.refresh();
           vxeTableRef.value.refresh();
         });
         });
       }
       }

+ 5 - 5
JLHWEB/src/views/quote/bednetQuote/components/FormulaItem.vue

@@ -130,14 +130,14 @@ const RenderVariable = (data: any, rprops: any) => {
 
 
   let _value = "";
   let _value = "";
   if (sumVal) {
   if (sumVal) {
-    _value = isFilterPrice(sumVal.value);
+    _value = isFilterPrice(sumVal.value, 4);
     // if (Number(_value) == 0) {
     // if (Number(_value) == 0) {
     // _value = sumVal.value;
     // _value = sumVal.value;
     // }
     // }
-    let isFormulaValue = props.formula.some(o => o.label.indexOf(fieldName) > -1);
-    if (isFormulaValue) {
-      _value = isFilterPrice(sumVal.value);
-    }
+    // let isFormulaValue = props.formula.some(o => o.label.indexOf(fieldName) > -1);
+    // if (isFormulaValue) {
+    //   _value = isFilterPrice(sumVal.value);
+    // }
     // } else {
     // } else {
     //   if (rprops.data?.children) {
     //   if (rprops.data?.children) {
     //     let _trgItem = rprops.data.children.find(c => {
     //     let _trgItem = rprops.data.children.find(c => {

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

@@ -203,9 +203,26 @@ export const useHooks = (t?: any, props?: any) => {
     return new Promise((resolve, reject) => {
     return new Promise((resolve, reject) => {
       // if (!ALLOW_EDIT_STATE.includes(status)) return;
       // if (!ALLOW_EDIT_STATE.includes(status)) return;
 
 
+      let _arg_bedtypeid = -1;
+      let _arg_newspring = 0;
+      if (params?.arg_bednettypeid) {
+        switch (params?.arg_bednettypeid) {
+          case 11: // 袋装网
+            _arg_bedtypeid = 0;
+            _arg_newspring = 1;
+            break;
+          case 12: // 圆网
+            _arg_bedtypeid = 2;
+            break;
+          case 13: // 拉丝网
+            _arg_bedtypeid = 1;
+            break;
+        }
+      }
       let _params = {
       let _params = {
         // arg_springtypeid: "11", // 默认选择国内分类
         // arg_springtypeid: "11", // 默认选择国内分类
-        arg_newspring: 1,
+        arg_newspring: _arg_newspring,
+        arg_bedtypeid: _arg_bedtypeid,
         ...params
         ...params
       };
       };
       state.SpringDialogProps = {
       state.SpringDialogProps = {
@@ -1887,10 +1904,17 @@ export const useHooks = (t?: any, props?: any) => {
             <SpringSelect
             <SpringSelect
               value={row.springid}
               value={row.springid}
               argHeight={row.bednet_height}
               argHeight={row.bednet_height}
+              argBednettypeid={state.LjDetailRef._mainData.bednettypeid}
               disabled={Number(row.if_part) == 1}
               disabled={Number(row.if_part) == 1}
               clearable
               clearable
               placeholder={_label}
               placeholder={_label}
-              onOpenModal={() => fModelChoseSpring(row, { arg_height: row.bednet_height }, rModelSetMxSpring)}
+              onOpenModal={() =>
+                fModelChoseSpring(
+                  row,
+                  { arg_height: row.bednet_height, arg_bednettypeid: state.LjDetailRef._mainData.bednettypeid },
+                  rModelSetMxSpring
+                )
+              }
               onSelect={(val: any) => rModelSetMxSpring(row, val)}
               onSelect={(val: any) => rModelSetMxSpring(row, val)}
               onClear={() => rModelClearSpring(row)}
               onClear={() => rModelClearSpring(row)}
             >
             >
@@ -2063,7 +2087,13 @@ export const useHooks = (t?: any, props?: any) => {
               disabled={Number(row.if_part) == 1}
               disabled={Number(row.if_part) == 1}
               clearable
               clearable
               placeholder={_label}
               placeholder={_label}
-              onOpenModal={() => fModelChoseSpring(scope.row, { arg_height: mxlist[0]?.bednet_height }, rModelSetSpring)}
+              onOpenModal={() =>
+                fModelChoseSpring(
+                  scope.row,
+                  { arg_height: mxlist[0]?.bednet_height, arg_bednettypeid: state.LjDetailRef._mainData.bednettypeid },
+                  rModelSetSpring
+                )
+              }
               onSelect={(val: any) => rModelSetSpring(scope.row, val)}
               onSelect={(val: any) => rModelSetSpring(scope.row, val)}
               onClear={() => rModelClearSpring(scope.row)}
               onClear={() => rModelClearSpring(scope.row)}
             >
             >

+ 19 - 0
JLHWEB/src/views/system/selector/spring/select.vue

@@ -59,6 +59,7 @@ import { useUserStore } from "@/stores/modules/user";
 interface ProTableProps {
 interface ProTableProps {
   value: any;
   value: any;
   argHeight?: any;
   argHeight?: any;
+  argBednettypeid?: any;
 }
 }
 
 
 // 默认值
 // 默认值
@@ -86,6 +87,24 @@ const remoteMethod = async (queryString: string) => {
     arg_newspring: 1
     arg_newspring: 1
   };
   };
   props?.argHeight && (newParams.queryParams.arg_height = props?.argHeight);
   props?.argHeight && (newParams.queryParams.arg_height = props?.argHeight);
+  if (props?.argBednettypeid) {
+    let _arg_bedtypeid = -1;
+    let _arg_newspring = 0;
+    switch (props?.argBednettypeid) {
+      case 11: // 袋装网
+        _arg_bedtypeid = 0;
+        _arg_newspring = 1;
+        break;
+      case 12: // 圆网
+        _arg_bedtypeid = 2;
+        break;
+      case 13: // 拉丝网
+        _arg_bedtypeid = 1;
+        break;
+    }
+    newParams.queryParams.arg_bedtypeid = _arg_bedtypeid;
+    newParams.queryParams.arg_newspring = _arg_newspring;
+  }
   newParams.dsname = "web_spring_define_choose";
   newParams.dsname = "web_spring_define_choose";
   let result = await CommonDynamicSelect(newParams, DwnameEnum.bednetSpringChoose);
   let result = await CommonDynamicSelect(newParams, DwnameEnum.bednetSpringChoose);