From d68b036a3b3c67273b8effa3c9925ef3869a91ba Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期三, 07 二月 2024 13:56:50 +0800
Subject: [PATCH] wms项目 wms系统参数设置的页面开发+路由+是否显示表头配置

---
 src/views/productManage/product/AddProductDialog.vue |  117 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 108 insertions(+), 9 deletions(-)

diff --git a/src/views/productManage/product/AddProductDialog.vue b/src/views/productManage/product/AddProductDialog.vue
index d1b5371..a6ded80 100644
--- a/src/views/productManage/product/AddProductDialog.vue
+++ b/src/views/productManage/product/AddProductDialog.vue
@@ -130,7 +130,7 @@
                       </el-option>
                     </el-select>
                   </el-form-item>
-                  <el-form-item label="鍗曚綅" prop="unit">
+                  <el-form-item label="鍗曚綅old" prop="unit">
                     <el-input
                       v-model="editConfig.infomation.unit"
                       placeholder="璇疯緭鍏�"
@@ -138,6 +138,29 @@
                       :disabled="!showFooter"
                     ></el-input>
                   </el-form-item>
+
+                  <el-form-item label="鍗曚綅" prop="unit">
+                    <el-select
+                      v-model="editConfig.infomation.unit"
+                      placeholder="鍗曚綅"
+                      filterable
+                      @change="$forceUpdate()"
+                      style="width: calc(100% - 30px)"
+                    >
+                      <el-option
+                        v-for="ele in unitList"
+                        :key="ele.id"
+                        :label="ele.name"
+                        :value="ele.name"
+                      ></el-option>
+                    </el-select>
+                    <i
+                      class="el-icon-setting margin_left_10px cursor_pointer"
+                      style="font-size: 20px; color: gray"
+                      @click="handleUnitShow"
+                    ></i>
+                  </el-form-item>
+                  
                   <el-form-item label="浜у搧鏍囩" prop="productTagName">
                     <el-input
                       v-model="editConfig.infomation.productTagName"
@@ -282,9 +305,14 @@
                       placeholder="璇烽�夋嫨"
                       size="mini"
                       style="width: 85%"
-                      :disabled="!showFooter"
+                      disabled
                     >
-                      <el-option v-for="item in memberOptions" :key="item.id" :label="item.name" :value="item.name">
+                      <el-option
+                        v-for="(item, index) in memberOptions"
+                        :key="index"
+                        :label="item.userName"
+                        :value="item.userName"
+                      >
                       </el-option>
                     </el-select>
                   </el-form-item>
@@ -505,6 +533,13 @@
         <el-button size="small" @click="editConfig.visible = false">鍙栨秷</el-button>
       </div>
     </el-dialog>
+    <BomDialog
+      ref="editDialog"
+      @sucessSet="handleGetBomKindDictList"
+      @handleConfirmSave="handleConfirmSave"
+      :workList="unitList"
+      title="璁¢噺鍗曚綅"
+    ></BomDialog>
   </div>
 </template>
 
@@ -512,9 +547,13 @@
 import IconCropper from "./IconCropper"
 import { getProductCategoryList } from "@/api/product/productCategory"
 import { getProductList, addProduct, updateProduct } from "@/api/product/product"
-import { uploadFiles } from "@/api/common/other"
+import { uploadFiles, getUserInfo } from "@/api/common/other"
 import codeMixin from "@/components/mixin/codeMixin"
 import { getDataByType } from "@/api/data"
+import BomDialog from "./components/bomDialog";
+// import { postGetSaveSUnitDict  } from "@/api/basic/standard";
+
+
 export default {
   mixins: [codeMixin],
   name: "AddProductDialog",
@@ -531,7 +570,10 @@
       }
     }
   },
-  components: { IconCropper },
+  components: { 
+    IconCropper,
+    BomDialog, 
+  },
   computed: {
     modalTitle() {
       if (this.editConfig.title === "缂栬緫" && this.editConfig.autoEdit) {
@@ -556,7 +598,7 @@
         // 閲囪喘绫诲瀷
         purchaseType: [{ required: true, message: "璇烽�夋嫨", trigger: "blur" }]
       },
-      memberOptions: [{ name: "绠$悊鍛�", id: 1 }],
+      memberOptions: [],
       productCategoryOptions: [], // 浜у搧绫诲埆
       productTypeOptions: [
         { name: "鑳芥秷鑰�", id: 1 },
@@ -611,7 +653,8 @@
       },
       isView: false,
       fileFormdata: null, // 涓婁紶鍥剧墖鍏ュ弬
-      purchaseTypeList: getDataByType("purchaseType")
+      purchaseTypeList: getDataByType("purchaseType"),
+      unitList: [],
     }
   },
   created() {
@@ -631,8 +674,58 @@
     }
     this.setOptionalFieldsToEmpty()
     this.formInfo()
+    this.getUserInfo()
   },
   methods: {
+    // 鍗曚綅
+    handleUnitShow() {
+      this.handleGetBomKindDictList();
+      this.$refs.editDialog.editDialogVisible = true;
+    },
+    //  鍗曚綅
+    handleGetBomKindDictList(val) {
+      console.log(val)
+      // postGetUnitDictList().then((res) => {
+      //   this.unitList = res.data;
+      //   if (val) {
+      //     for (let i in this.unitList) {
+      //       if (this.unitList[i].isDefault) {
+      //         this.form.unit = this.form.unit
+      //           ? this.form.unit
+      //           : this.unitList[i].name;
+      //         // this.$set(this.form, "unit", this.form.unit);
+      //         break;
+      //       }
+      //     }
+      //   }
+      // });
+    },
+    handleConfirmSave(data) {
+      console.log(data)
+      // postGetSaveSUnitDict({ data: data }).then((res) => {
+      //   if (res.code == 200) {
+      //     this.$message({
+      //       message: "鎿嶄綔鎴愬姛锛�",
+      //       type: "success",
+      //     });
+      //     this.$refs.editDialog.editDialogVisible = false;
+      //     this.handleGetBomKindDictList();
+      //   }
+      // });
+      this.$refs.editDialog.editDialogVisible = false;
+
+    },
+    // 鑾峰彇鐧诲綍鐢ㄦ埛淇℃伅
+    getUserInfo() {
+      getUserInfo().then((res) => {
+        console.log(res)
+        if (res.code == 200) {
+          this.editConfig.infomation.principal = res.data.userName
+          this.memberOptions.push(res.data)
+        }
+        console.log(this.memberOptions)
+      })
+    },
     formInfo() {
       this.objCode.type = "鐗╂枡缂栫爜"
       this.objCode.codeStandID = ""
@@ -832,11 +925,17 @@
       // console.log(formdata, "鍥剧墖鏁版嵁")
     },
     // 杩涘嚭鐐瑰嚮
-    inOutBoundClick() {
+    inOutBoundClick(val) {
       if (this.editConfig.title !== "鏂板缓") {
         console.log(this.editConfig.infomation)
+        let url=''
+        if(val=='杩�'){
+          url='inboundOutboundDetail'
+        }else{
+          url='outboundDetail'
+        }
         this.$router.push({
-          name: "inboundOutboundDetail",
+          name:url,
           params: {
             name: this.editConfig.infomation.name,
             id: this.editConfig.infomation.id

--
Gitblit v1.8.0