From 25b727a5dc28f3c2d225c5e017da58f35c6b84b3 Mon Sep 17 00:00:00 2001
From: zzq <a13193816592@163.com>
Date: 星期二, 26 九月 2023 19:38:40 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/zzq'

---
 src/views/productManage/product/AddProductDialog.vue |  169 +++++++++++++++++++++++++++++---------------------------
 1 files changed, 87 insertions(+), 82 deletions(-)

diff --git a/src/views/productManage/product/AddProductDialog.vue b/src/views/productManage/product/AddProductDialog.vue
index 206aa69..b939663 100644
--- a/src/views/productManage/product/AddProductDialog.vue
+++ b/src/views/productManage/product/AddProductDialog.vue
@@ -36,7 +36,6 @@
           <el-button plain size="mini" disabled>鏇存柊鏁伴噺</el-button>
           <el-button plain size="mini" disabled>鎵ц琛ヨ揣</el-button>
         </div>
-
         <div class="basic-info">
           <FormBtnsView
             :add-product="addProduct"
@@ -47,7 +46,7 @@
           <div class="basic-info-view">
             <el-row>
               <el-col :span="23">
-                <div style="margin-left: 20px">浜у搧鍚嶇О</div>
+                <div style="margin-left: 20px"><span style="color: #f56c6c">*</span>浜у搧鍚嶇О</div>
                 <el-form-item label="" prop="name" label-width="20px">
                   <el-input v-model="editConfig.infomation.name" placeholder="" :disabled="!showFooter"></el-input>
                 </el-form-item>
@@ -105,8 +104,8 @@
                       <el-option v-for="item in strategyOptions" :key="item.id" :label="item.name" :value="item.id">
                       </el-option>
                     </el-select>
-                    <div>鍙偍瀛樼殑浜у搧鏄偍绠$悊搴撳瓨姘村钩鐨勫疄鐗╅」鐩��</div>
-                    <div>鎮ㄥ彲浠ュ湪鍙戣揣鍓嶄负鍏跺紑鍏风粨绠楀崟銆�</div>
+                    <div class="font_size_13" style="color: gray">鍙偍瀛樼殑浜у搧鏄偍绠$悊搴撳瓨姘村钩鐨勫疄鐗╅」鐩��</div>
+                    <div class="font_size_13" style="color: gray">鎮ㄥ彲浠ュ湪鍙戣揣鍓嶄负鍏跺紑鍏风粨绠楀崟銆�</div>
                   </el-form-item>
                   <el-form-item label="鐗╂枡绫诲瀷" prop="model" style="margin-left: 20px">
                     <el-select
@@ -116,20 +115,26 @@
                       clearable
                       style="width: 85%"
                       :popper-append-to-body="false"
+                      :disabled="!showFooter"
                     >
                       <el-option v-for="item in materialTypeList" :key="item.id" :label="item.name" :value="item.id">
                       </el-option>
                     </el-select>
                   </el-form-item>
                   <el-form-item label="鍗曚綅" prop="unit" style="margin-left: 20px">
-                    <el-input v-model="editConfig.infomation.unit" placeholder="璇疯緭鍏�" style="width: 85%"></el-input>
+                    <el-input
+                      v-model="editConfig.infomation.unit"
+                      placeholder="璇疯緭鍏�"
+                      style="width: 85%"
+                      :disabled="!showFooter"
+                    ></el-input>
                   </el-form-item>
-
                   <el-form-item label="浜у搧鏍囩" prop="productTagName" style="margin-left: 20px">
                     <el-input
                       v-model="editConfig.infomation.productTagName"
                       placeholder="璇疯緭鍏�"
                       style="width: 85%"
+                      :disabled="!showFooter"
                     ></el-input>
                   </el-form-item>
                 </div>
@@ -153,6 +158,7 @@
                       :min="0"
                       :controls="false"
                       style="width: 85%; margin-right: 5px"
+                      :disabled="!showFooter"
                     ></el-input-number>
                   </el-form-item>
                   <el-form-item label="鎴愭湰" prop="cost" style="margin-left: 20px">
@@ -237,7 +243,6 @@
                     </el-checkbox-group>
                   </el-form-item>
                 </div> -->
-
                 <div class="left">
                   <el-form-item label="璐熻矗浜�" prop="principal" style="margin-left: 20px" label-width="80px">
                     <el-select
@@ -259,6 +264,7 @@
                       :precision="2"
                       :controls="false"
                       style="width: 85%"
+                      :disabled="!showFooter"
                     ></el-input-number>
                     <span> kg</span>
                   </el-form-item>
@@ -270,6 +276,7 @@
                       :precision="2"
                       :controls="false"
                       style="width: 85%"
+                      :disabled="!showFooter"
                     ></el-input-number>
                     <span> m鲁</span>
                   </el-form-item>
@@ -277,6 +284,40 @@
                 <div class="right">
                   <el-form-item
                     label="鍒堕�犲墠缃椂闂�"
+                    prop="makeAdvanceTime"
+                    style="margin-left: 20px"
+                    label-width="130px"
+                  >
+                    <el-input-number
+                      v-model="editConfig.infomation.makeAdvanceTime"
+                      placeholder="璇疯緭鍏�"
+                      :min="0"
+                      :precision="0"
+                      :controls="false"
+                      style="width: 85%"
+                      :disabled="!showFooter"
+                    ></el-input-number>
+                    <span> 澶╂暟</span>
+                  </el-form-item>
+                  <el-form-item
+                    label="鐢熶骇璁㈠崟鍑嗗澶╂暟"
+                    prop="orderAdvanceTime"
+                    style="margin-left: 20px"
+                    label-width="130px"
+                  >
+                    <el-input-number
+                      v-model="editConfig.infomation.orderAdvanceTime"
+                      placeholder="璇疯緭鍏�"
+                      :min="0"
+                      :precision="0"
+                      :controls="false"
+                      style="width: 85%"
+                      :disabled="!showFooter"
+                    ></el-input-number>
+                    <span> 澶╂暟</span>
+                  </el-form-item>
+                  <el-form-item
+                    label="瀹㈡埛鍓嶇疆鏃堕棿"
                     prop="deliveryAdvanceTime"
                     style="margin-left: 20px"
                     label-width="130px"
@@ -285,35 +326,12 @@
                       v-model="editConfig.infomation.deliveryAdvanceTime"
                       placeholder="璇疯緭鍏�"
                       :min="0"
-                      :precision="2"
+                      :precision="0"
                       :controls="false"
-                      style="width: 85%"
-                    ></el-input-number>
-                    <span> 澶╂暟</span>
-                  </el-form-item>
-                  <el-form-item label="鐢熶骇璁㈠崟鍑嗗澶╂暟" prop="name" style="margin-left: 20px" label-width="130px">
-                    <el-input-number
-                      v-model="editConfig.infomation.customerTaxes"
-                      placeholder="璇疯緭鍏�"
-                      :min="0"
-                      :precision="2"
-                      :controls="false"
-                      style="width: 85%"
-                    ></el-input-number>
-                    <span> 澶╂暟</span>
-                  </el-form-item>
-                  <el-form-item label="瀹㈡埛鍓嶇疆鏃堕棿" prop="aaa" style="margin-left: 20px" label-width="130px">
-                    <el-select
-                      v-model="editConfig.infomation.aaa"
-                      multiple
-                      placeholder="璇烽�夋嫨"
-                      size="mini"
                       style="width: 85%"
                       :disabled="!showFooter"
-                    >
-                      <el-option v-for="item in aaaOptions" :key="item.id" :label="item.username" :value="item.id">
-                      </el-option>
-                    </el-select>
+                    ></el-input-number>
+                    <span> 澶�</span>
                   </el-form-item>
                 </div>
               </div>
@@ -466,7 +484,6 @@
       </el-form>
       <!-- 灏� -->
       <div v-if="showFooter" slot="footer" class="dialog-footer">
-        <!-- <el-button type="primary" size="small" @click="editConfig.visible = false">淇濆苟鎻愪氦瀹℃壒</el-button> -->
         <el-button type="primary" size="small" @click="saveClick('form')">淇濆瓨</el-button>
         <el-button size="small" @click="editConfig.visible = false">鍙栨秷</el-button>
       </div>
@@ -477,7 +494,7 @@
 <script>
 // import CommonFormTableView from "@/components/makepager/CommonFormTableView"
 import { getProductCategoryList } from "@/api/product/productCategory"
-import { getProductList, addProduct } from "@/api/product/product"
+import { getProductList, addProduct, updateProduct } from "@/api/product/product"
 
 let inputElement = null
 export default {
@@ -489,7 +506,7 @@
         return {
           visible: false,
           title: "鏂板缓",
-          infomation: { type: [] }
+          infomation: {}
         }
       }
     }
@@ -501,18 +518,12 @@
       dialogWidth: "50%",
       editConfig: this.editCommonConfig,
       rules: {
-        client_name: [{ required: true, message: "璇烽�夋嫨瀹㈡埛鍚嶇О", trigger: "change" }],
-        number: [{ required: true, message: "璇疯緭鍏ラ��娆惧崟缂栧彿", trigger: "blur" }],
-        refundDate: [{ required: true, message: "璇烽�夋嫨閫�娆炬棩鏈�", trigger: "change" }],
-        memberId: [{ required: true, message: "璇烽�夋嫨閿�鍞礋璐d汉", trigger: "change" }],
-        sale_return_nunber: [{ required: true, message: "璇烽�夋嫨閿�鍞��璐у崟", trigger: "change" }]
+        name: [{ required: true, message: "璇疯緭鍏ヤ骇鍝佸悕绉�", trigger: "blur" }],
+        model: [{ required: true, message: "璇烽�夋嫨鐗╂枡绫诲瀷", trigger: "change" }],
+        salePrice: [{ required: true, message: "璇疯緭鍏ラ攢鍞环鏍�", trigger: "blur" }],
+        unit: [{ required: true, message: "璇疯緭鍏ュ崟浣�", trigger: "blur" }]
       },
-      memberOptions: [
-        {
-          name: "admin",
-          id: 1
-        }
-      ],
+      memberOptions: [{ name: "绠$悊鍛�", id: 1 }],
       productCategoryOptions: [], // 浜у搧绫诲埆
       productTypeOptions: [
         { name: "鑳芥秷鑰�", id: 1 },
@@ -527,7 +538,7 @@
       showButton: true,
       activeName: "first",
       productTableList: {},
-      tableData: [{ name: "ssss" }],
+      tableData: [],
       isNoProduct: false, // 娣诲姞鏄庣粏琛屾椂鏄惁鏈変骇鍝佹湭閫夋嫨
       showEdit: false, // 鏄惁鏄剧ず缂栬緫鎸夐挳
       isDelClick: false, // 鍒犻櫎鎸夐挳鏄惁鍙偣鍑�
@@ -541,30 +552,12 @@
       showProcure: true,
       showSale: true,
       materialTypeList: [
-        {
-          name: "鍘熸潗鏂�",
-          id: "鍘熸潗鏂�"
-        },
-        {
-          name: "鍗婃垚鍝�",
-          id: "鍗婃垚鍝�"
-        },
-        {
-          name: "鎴愬搧",
-          id: "鎴愬搧"
-        },
-        {
-          name: "杈呮枡",
-          id: "杈呮枡"
-        },
-        {
-          name: "鑰楁潗",
-          id: "鑰楁潗"
-        },
-        {
-          name: "鍏朵粬",
-          id: "鍏朵粬"
-        }
+        { name: "鍘熸潗鏂�", id: "鍘熸潗鏂�" },
+        { name: "鍗婃垚鍝�", id: "鍗婃垚鍝�" },
+        { name: "鎴愬搧", id: "鎴愬搧" },
+        { name: "杈呮枡", id: "杈呮枡" },
+        { name: "鑰楁潗", id: "鑰楁潗" },
+        { name: "鍏朵粬", id: "鍏朵粬" }
       ]
     }
   },
@@ -630,16 +623,21 @@
       this.setTableForm()
     },
     // 淇濆瓨
-    async saveClick() {
+    saveClick(formName) {
       console.log(this.editConfig.infomation)
-      await addProduct({
-        ...this.editConfig.infomation
-      }).then((res) => {
-        console.log(res)
-        this.editConfig.visible = false
-        if (res.code === 200) {
-          this.$message.success("娣诲姞鎴愬姛")
-          this.$parent.getData()
+      this.$refs[formName].validate((valid) => {
+        if (valid) {
+          let requestUrl = this.editConfig.title === "鏂板缓" ? addProduct : updateProduct
+          requestUrl({
+            ...this.editConfig.infomation
+          }).then((res) => {
+            console.log(res)
+            this.editConfig.visible = false
+            if (res.code === 200) {
+              this.$message.success("娣诲姞鎴愬姛")
+              this.$parent.getData()
+            }
+          })
         }
       })
     },
@@ -750,7 +748,11 @@
     // 杩涘嚭鐐瑰嚮
     inOutBoundClick() {
       if (this.editConfig.title !== "鏂板缓") {
-        this.$router.push({ path: "/reportForm/inOutboundDetail", query: { name: "浜у搧鍚嶇О/鍑哄叆搴撴槑缁�" } })
+        console.log(this.editConfig.infomation)
+        this.$router.push({
+          name: "inOutboundDetail",
+          params: { name: this.editConfig.infomation.name, id: this.editConfig.infomation.id }
+        })
       }
     },
     // 鍙攢鍞�/鍙噰璐�
@@ -905,5 +907,8 @@
     line-height: 30px;
     font-size: 13px;
   }
+  .el-input__inner {
+    text-align: left;
+  }
 }
 </style>

--
Gitblit v1.8.0