From f417dc0a44d225d4ed19bcb5207250eb1b669455 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期五, 25 八月 2023 12:45:09 +0800
Subject: [PATCH] bug修复

---
 src/views/sales/salesReturn/AddSalesReturnDialog.vue |   55 ++++++++++++++-----------------------------------------
 1 files changed, 14 insertions(+), 41 deletions(-)

diff --git a/src/views/sales/salesReturn/AddSalesReturnDialog.vue b/src/views/sales/salesReturn/AddSalesReturnDialog.vue
index 90aae43..270ffad 100644
--- a/src/views/sales/salesReturn/AddSalesReturnDialog.vue
+++ b/src/views/sales/salesReturn/AddSalesReturnDialog.vue
@@ -35,7 +35,11 @@
                     <div class="common-select-btn" @click="selClientClick">
                       <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i>
                     </div>
-                    <div class="common-select-btn" @click="clearupClient">
+                    <div
+                      v-if="editConfig.infomation.client_name && editConfig.infomation.client_name.length > 0"
+                      class="common-select-btn"
+                      @click="clearupClient"
+                    >
                       <i class="el-icon-edit-outline" title="娓呴櫎"></i>
                     </div>
                   </div>
@@ -46,28 +50,10 @@
                   <el-input v-model="editConfig.infomation.number"></el-input>
                 </el-form-item>
               </el-col>
-              <!-- <el-col :span="12">
-                <el-form-item label="閫夋嫨婧愬崟" prop="selSourceOrder">
-                  <el-select v-model="editConfig.infomation.selSourceOrder" size="mini" style="width: 63%">
-                    <el-option
-                      v-for="item in selSourceOrderOptions"
-                      :key="item.value"
-                      :label="item.label"
-                      :value="item.value"
-                    >
-                    </el-option>
-                  </el-select>
-                </el-form-item>
-              </el-col> -->
               <el-col :span="12">
                 <el-form-item label="閫�鍏ヤ粨搴�" prop="repository">
                   <el-select v-model="editConfig.infomation.repository" size="mini" style="width: 63%">
-                    <el-option
-                      v-for="item in repositoryOptions"
-                      :key="item.value"
-                      :label="item.label"
-                      :value="item.value"
-                    >
+                    <el-option v-for="item in repositoryOptions" :key="item.id" :label="item.name" :value="item.name">
                     </el-option>
                   </el-select>
                 </el-form-item>
@@ -253,7 +239,8 @@
         infomation: {}
       },
       productId: 1,
-      isNoProduct: true
+      isNoProduct: true,
+      clientId: this.editCommonConfig.infomation.clientId
     }
   },
   created() {
@@ -318,10 +305,6 @@
                 this.editConfig.visible = false
                 if (res.code === 200) {
                   this.$message.success("缂栬緫鎴愬姛")
-                  this.$message({
-                    message: "缂栬緫鎴愬姛",
-                    type: "success"
-                  })
                   this.$parent.getData()
                 }
               })
@@ -338,20 +321,10 @@
       let params = {
         id: this.editConfig.title === "鏂板缓" ? 0 : data.id,
         salesReturn: {
-          clientId: data.clientId || 0,
+          clientId: this.clientId || 0,
           memberId: data.memberId || 0,
           number: data.number || "",
-          products: [
-            {
-              amount: 0,
-              desc: "",
-              id: 0,
-              name: "",
-              number: "",
-              price: 0,
-              total: 0
-            }
-          ],
+          products: this.tableData,
           reason: data.reason || "",
           repository: data.repository || "",
           returnDate: data.returnDate || "",
@@ -375,7 +348,7 @@
       }
     },
     handleSelectClient(item) {
-      this.editConfig.infomation.client_id = item.id
+      this.clientId = item.id
     },
     selClientClick() {
       this.editSelectClientConfig.editVisible = true
@@ -383,19 +356,19 @@
     selClient(row) {
       console.log(row)
       this.editConfig.infomation.client_name = row.name
-      this.editConfig.infomation.client_id = row.id
+      this.clientId = row.id
     },
     // 娓呴櫎宸查�夋嫨鐢ㄦ埛
     clearupClient() {
       this.editConfig.infomation.client_name = ""
-      this.editConfig.infomation.client_id = 0
+      this.clientId = 0
     },
     // 娣诲姞闄勪欢
     addAnnexClick() {},
     // 璁剧疆鍏佽涓婁紶鏂囦欢鏍煎紡
     setFormatClick() {},
     setTableForm() {
-      if (this.editConfig.title === "鏂板缓") {
+      if (this.editConfig.title === "鏂板缓" || this.editConfig.infomation.products.length === 0) {
         this.tableData = [
           {
             productId: this.productId,

--
Gitblit v1.8.0