From 36fb84a1ec003eb97502d8cc6f56bca67e1502a0 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期五, 15 九月 2023 11:25:04 +0800
Subject: [PATCH] 产品出入库明细页面及公共组件优化

---
 src/views/productManage/product/AddProductDialog.vue |  100 +++++++++++++++++++++++---------------------------
 1 files changed, 46 insertions(+), 54 deletions(-)

diff --git a/src/views/productManage/product/AddProductDialog.vue b/src/views/productManage/product/AddProductDialog.vue
index 022c0c6..7320da8 100644
--- a/src/views/productManage/product/AddProductDialog.vue
+++ b/src/views/productManage/product/AddProductDialog.vue
@@ -32,9 +32,9 @@
         style="height: 60vh; overflow-x: hidden"
       >
         <div class="content-btn">
-          <el-button plain size="mini">鏍囩鎵撳嵃</el-button>
-          <el-button plain size="mini">鏇存柊鏁伴噺</el-button>
-          <el-button plain size="mini">鎵ц琛ヨ揣</el-button>
+          <el-button plain size="mini" disabled>鏍囩鎵撳嵃</el-button>
+          <el-button plain size="mini" disabled>鏇存柊鏁伴噺</el-button>
+          <el-button plain size="mini" disabled>鎵ц琛ヨ揣</el-button>
         </div>
 
         <div class="basic-info">
@@ -60,7 +60,7 @@
                 <div class="right-label">棰勬祴</div>
               </div>
             </div>
-            <div class="sub-number">
+            <div class="sub-number" @click="inOutBoundClick" style="cursor: pointer">
               <div class="left icon-view"><i class="el-icon-sort"></i></div>
               <div class="right">
                 <div class="right-label">{{ "杩�: " + 0 }}</div>
@@ -100,7 +100,11 @@
               <el-col :span="20">
                 <div style="margin-left: 20px">浜у搧鍚嶇О</div>
                 <el-form-item label="" prop="client_name" label-width="20px">
-                  <el-input v-model="editConfig.infomation.client_name" placeholder=""></el-input>
+                  <el-input
+                    v-model="editConfig.infomation.client_name"
+                    placeholder=""
+                    :disabled="!showFooter"
+                  ></el-input>
                 </el-form-item>
               </el-col>
               <el-col :span="4">
@@ -111,8 +115,8 @@
               </el-col>
               <el-col :span="24">
                 <div style="margin-left: 20px; margin-top: -30px">
-                  <el-checkbox v-model="marketable">鍙攢鍞�</el-checkbox>
-                  <el-checkbox v-model="procurable">鍙噰璐�</el-checkbox>
+                  <el-checkbox v-model="marketable" :disabled="!showFooter">鍙攢鍞�</el-checkbox>
+                  <el-checkbox v-model="procurable" :disabled="!showFooter">鍙噰璐�</el-checkbox>
                 </div>
               </el-col>
             </el-row>
@@ -320,12 +324,11 @@
               <div class="purchase-view">
                 <div class="left">
                   <div class="second-label">浣滀笟</div>
-                  <el-form-item label="璺嚎" prop="client_name" style="margin-left: 20px">
-                    <el-checkbox-group v-model="editConfig.infomation.type">
-                      <el-checkbox label="璐濇�濈渚涘簲浜у搧鏉ヨ嚜鍖椾含浠�" name="type"></el-checkbox>
-                      <el-checkbox label="璐濇�濈-warehouse#6:渚涘簲浜у搧鏉ヨ嚜璐濇�濈123" name="type"></el-checkbox>
-                      <el-checkbox label="璐濇�濈-warehouse#4:渚涘簲浜у搧鏉ヨ嚜鍖椾含浠�" name="type"></el-checkbox>
-                      <el-checkbox label="璐濇�濈-warehouse#4:渚涘簲浜у搧鏉ヨ嚜璐濇�濈123" name="type"></el-checkbox>
+                  <el-form-item label="璺嚎" prop="checkedCities" style="margin-left: 20px">
+                    <el-checkbox-group v-model="checkedCities" :min="1" :max="2">
+                      <el-checkbox v-for="city in cities" :label="city" :key="city" class="list-item">{{
+                        city.length > 20 ? city.substring(0, 20) + "..." : city
+                      }}</el-checkbox>
                     </el-checkbox-group>
                   </el-form-item>
                 </div>
@@ -352,7 +355,7 @@
                       style="width: 85%"
                       :disabled="!showFooter"
                     ></el-input>
-                    <span>kg</span>
+                    <span> kg</span>
                   </el-form-item>
                   <el-form-item label="浣撶Н" prop="client_name" style="margin-left: 20px">
                     <el-input
@@ -362,7 +365,7 @@
                       style="width: 85%"
                       :disabled="!showFooter"
                     ></el-input>
-                    <span>m鲁</span>
+                    <span> m鲁</span>
                   </el-form-item>
                   <el-form-item label="瀹㈡埛鍓嶇疆鏃堕棿" prop="client_name" style="margin-left: 20px">
                     <el-input
@@ -372,7 +375,7 @@
                       style="width: 85%"
                       :disabled="!showFooter"
                     ></el-input>
-                    <span>澶�</span>
+                    <span> 澶�</span>
                   </el-form-item>
                   <el-form-item label="HS缂栫爜" prop="name" style="margin-left: 20px">
                     <el-input
@@ -471,7 +474,7 @@
         return {
           visible: false,
           title: "鏂板缓",
-          infomation: {}
+          infomation: { type: [] }
         }
       }
     }
@@ -507,7 +510,9 @@
       showFooter: false, // 鏄惁鏄剧ず鍙栨秷淇濆瓨
       imageSrc: "", // 鍥剧墖鍦板潃
       marketable: true, // 鍙攢鍞�
-      procurable: true // 鍙噰璐�
+      procurable: true, // 鍙噰璐�
+      checkedCities: ["涓婃捣", "鍖椾含"],
+      cities: ["涓婃捣瀵瑰瀵瑰瀵瑰澶氬澶氬澶氬澶氬寳浜瀵瑰瀵瑰瀵�", "鍖椾含瀵瑰瀵瑰瀵瑰澶�", "骞垮窞", "娣卞湷"]
     }
   },
   created() {
@@ -521,32 +526,10 @@
         this.showButton = false
         this.showEdit = false
         this.showFooter = true
+      } else {
+        this.showEdit = true
+        this.showFooter = false
       }
-      // } else if (this.editConfig.infomation.status === "瀹屾垚") {
-      //   this.showButton = true
-      //   this.showEdit = false
-      //   this.isDelClick = true
-      //   this.showFooter = false
-      // } else if (this.editConfig.infomation.status === "宸插彇娑�") {
-      //   this.showButton = true
-      //   this.showEdit = false
-      //   this.showFooter = false
-      // } else {
-      //   this.showButton = true
-      //   this.showEdit = true
-      //   this.showFooter = false
-      // }
-      // if (this.editConfig.title === "鏂板缓") {
-      //   this.list[0].status = "active"
-      // } else {
-      //   this.list.map((item) => {
-      //     if (item.label === this.editConfig.infomation.status) {
-      //       item.status = "active"
-      //     } else {
-      //       item.status = "todo"
-      //     }
-      //   })
-      // }
     },
     // 鍏抽棴
     handleClose() {
@@ -621,19 +604,21 @@
     },
     // 涓婁紶鍥剧墖
     toGetImg() {
-      if (inputElement === null) {
-        // 鐢熸垚鏂囦欢涓婁紶鐨勬帶浠�
-        inputElement = document.createElement("input")
-        inputElement.setAttribute("type", "file")
-        inputElement.style.display = "none"
-        if (window.addEventListener) {
-          inputElement.addEventListener("change", this.uploadFile, false)
-        } else {
-          inputElement.attachEvent("onchange", this.uploadFile)
+      if (this.showFooter) {
+        if (inputElement === null) {
+          // 鐢熸垚鏂囦欢涓婁紶鐨勬帶浠�
+          inputElement = document.createElement("input")
+          inputElement.setAttribute("type", "file")
+          inputElement.style.display = "none"
+          if (window.addEventListener) {
+            inputElement.addEventListener("change", this.uploadFile, false)
+          } else {
+            inputElement.attachEvent("onchange", this.uploadFile)
+          }
+          document.body.appendChild(inputElement)
         }
-        document.body.appendChild(inputElement)
+        inputElement.click()
       }
-      inputElement.click()
     },
     uploadFile(el) {
       if (el && el.target && el.target.files && el.target.files.length > 0) {
@@ -662,6 +647,10 @@
           }
         }
       }
+    },
+    // 杩涘嚭鐐瑰嚮
+    inOutBoundClick() {
+      this.$router.push({ path: "/reportForm/inOutboundDetail", query: { name: "浜у搧鍚嶇О/鍑哄叆搴撴槑缁�" } })
     }
   }
 }
@@ -757,6 +746,9 @@
     border-bottom: 1px solid #d9d9d9;
     margin-bottom: 10px;
   }
+  .list-item {
+    width: 300px;
+  }
   .avatar-uploader .el-upload {
     border: 1px dashed #d9d9d9;
     border-radius: 6px;

--
Gitblit v1.8.0