Prechádzať zdrojové kódy

JLHWEB: 1、床垫清单新增半成品归属信息补充

JohnnyChan 1 týždeň pred
rodič
commit
d4abb0d021

+ 86 - 7
JLHWEB/src/views/erpapi/mattressInterface/detail.vue

@@ -61,8 +61,7 @@
             :dwname="DwnameEnum.mattressInterfaceQd"
             :request-auto="false"
             :table-props="tableProps_qd"
-            :tool-button="[]"
-            :auto-load-layout="false"
+            :tool-button="['setting']"
             collapseButtons
             @row-dragend="autoRowDragend"
           >
@@ -72,6 +71,44 @@
     </template>
   </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" />
   <MtrldefErpDialog ref="MtrldefErpDialogRef" v-bind="MtrldefErpDialogProps" />
 </template>
@@ -96,6 +133,7 @@ import { formatToDate } from "@/utils/dateUtil";
 import LjFoldLayout from "@/components/LjFoldLayout/index.vue";
 import { detailAction } from "@/components/LjDetail/interface";
 import { transformTreeData, autoMergeCells, isFilterPrice } from "@/utils/index";
+import LjDialog from "@/components/LjDialog/index.vue";
 
 interface detailProp {
   /**
@@ -279,11 +317,23 @@ const toMove = async (action: number) => {
 
 const qdAction: detailAction[] = [
   buttonDefault({
-    label: "增行"
+    label: "增行",
+    clickFunc: () => {
+      interIndex.value = -1;
+      LjDialogQdRowAdd.value.show();
+    }
   }),
   buttonDefault({
     label: "插行",
-    divider: true
+    divider: true,
+    clickFunc: () => {
+      const $table = QdTableRef.value.element;
+      const curRecords = $table?.getCurrentRecord();
+      if (curRecords) {
+        interIndex.value = $table.getRowIndex(curRecords);
+      }
+      LjDialogQdRowAdd.value.show();
+    }
   }),
   buttonDefault({
     label: "上移",
@@ -433,9 +483,9 @@ const orderDefaultAction = [
                   type: "success"
                 });
                 // tabRemove(route.fullPath);
-                // router.replace(
-                //   `/erpapi/mattressInterface/detail?id=${LjDetailRef.value?._mainData.mattressid}&code=${LjDetailRef.value?._mainData.mattresscode}`
-                // );
+                router.replace(
+                  `/erpapi/mattressInterface/detail?id=${LjDetailRef.value?._mainData.mattressid}&code=${LjDetailRef.value?._mainData.mattresscode}`
+                );
 
                 // const _cur = LjDetailRef.value?._mainData;
                 // router.push({
@@ -924,4 +974,33 @@ const autoRowDragend = async data => {
   });
   // }, 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);
+};
 </script>

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

@@ -1008,6 +1008,53 @@ export const useHooks = (t?: any) => {
     return enumMap.value.get("wrkgrpid");
   });
 
+  const wipTypeEnum = [
+    {
+      label: "",
+      value: ""
+    },
+    {
+      label: "面裥绵",
+      value: "面裥绵"
+    },
+    {
+      label: "底裥绵",
+      value: "底裥绵"
+    },
+    {
+      label: "大侧裥绵",
+      value: "大侧裥绵"
+    },
+    {
+      label: "小侧裥绵1",
+      value: "小侧裥绵1"
+    },
+    {
+      label: "小侧裥棉2",
+      value: "小侧裥棉2"
+    },
+    {
+      label: "V侧裥绵1",
+      value: "V侧裥绵1"
+    },
+    {
+      label: "V侧裥绵2",
+      value: "V侧裥绵2"
+    },
+    {
+      label: "顶布1",
+      value: "顶布1"
+    },
+    {
+      label: "顶布2",
+      value: "顶布2"
+    },
+    {
+      label: "顶布3",
+      value: "顶布3"
+    }
+  ];
+
   const columns_qd = ref<ColumnProps<any>[]>([
     { title: "#", type: "seq", fixed: "left", width: 60, dragSort: true },
     // {
@@ -1040,6 +1087,29 @@ export const useHooks = (t?: any) => {
       title: "二级明细项目",
       fixed: "left"
     },
+    {
+      field: "wip_type",
+      title: "半成品归属",
+      width: 120,
+      editRender: {},
+      editColRender: (scope: any) => {
+        // console.log("formulakind editColRender scope :>> ", scope);
+        return (
+          <el-select v-model={scope.row.wip_type} filterable>
+            {{
+              default: () => {
+                let rs = [];
+                wipTypeEnum.map((t: any) => {
+                  rs.push(<el-option label={t.label} value={t.value} />);
+                });
+                return rs;
+              }
+              // label: ({ label, value }) => label
+            }}
+          </el-select>
+        );
+      }
+    },
     {
       field: "erp_mtrlcode",
       title: "L1物料编码",