From 3d04f62e6c9124e2d37b5d09191a02fc6390d16f Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期五, 13 十月 2023 17:07:10 +0800
Subject: [PATCH] bug修复

---
 src/views/sales/salesDetails/AddSalesDetailsDialog.vue |  113 +++++++++++++++++++++++++++++++-------------------------
 1 files changed, 63 insertions(+), 50 deletions(-)

diff --git a/src/views/sales/salesDetails/AddSalesDetailsDialog.vue b/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
index 62c1572..e487891 100644
--- a/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
+++ b/src/views/sales/salesDetails/AddSalesDetailsDialog.vue
@@ -24,10 +24,26 @@
           <div class="basic-info-view">
             <el-row>
               <el-col :span="12">
+                <el-form-item label="璁㈠崟缂栧彿" prop="number">
+                  <WordInput
+                    v-if="codenumer && (explain != '' || isIdDisabled) && method == 0"
+                    :codenumer="codenumer"
+                    :sum="sum"
+                    :disabled="editConfig.title !== '鏂板缓' || isIdDisabled"
+                    :inputValue="inputValue"
+                    @codeList="codeList"
+                  />
+                  <span v-else-if="method == 0" style="color: #f56c6c"
+                    >璇蜂紭鍏堥厤缃紪鐮佽鑼� <el-button type="text" @click="numberClick"> 閰嶇疆瑙勮寖 </el-button></span
+                  >
+                  <span v-else>{{ editConfig.title === "鏂板缓" ? "鑷姩鐢熸垚" : editConfig.infomation.number }}</span>
+                </el-form-item>
+              </el-col>
+              <el-col :span="12">
                 <el-form-item label="瀹㈡埛鍚嶇О" prop="client_name">
                   <div class="custom-name">
                     <el-autocomplete
-                      style="width:100%;"
+                      style="width: 100%"
                       v-model="editConfig.infomation.client_name"
                       :fetch-suggestions="
                         (queryString, callback) => {
@@ -36,12 +52,17 @@
                       "
                       value-key="name"
                       @select="handleSelectClient('client', $event)"
+                      :disabled="isNameChanceEdit"
                     ></el-autocomplete>
-                    <div class="common-select-btn" @click="selClientClick('client')">
+                    <div v-if="!isNameChanceEdit" class="common-select-btn" @click="selClientClick('client')">
                       <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i>
                     </div>
                     <div
-                      v-if="editConfig.infomation.client_name && editConfig.infomation.client_name.length > 0"
+                      v-if="
+                        editConfig.infomation.client_name &&
+                        editConfig.infomation.client_name.length > 0 &&
+                        !isNameChanceEdit
+                      "
                       class="common-select-btn"
                       @click="clearupClient('client')"
                     >
@@ -50,31 +71,12 @@
                   </div>
                 </el-form-item>
               </el-col>
-              <el-col :span="12">
-                <el-form-item label="璁㈠崟缂栧彿" prop="number">
-                  <WordInput
-                    v-if="codenumer && (explain != '' || isIdDisabled)&&method == 0"
-                    :codenumer="codenumer"
-                    :sum="sum"
-                    :disabled="editConfig.infomation.id || isIdDisabled"
-                    :inputValue="inputValue"
-                    @codeList="codeList"
-                  />
-                  <span v-else-if="method == 0" style="color: #f56c6c"
-                    >璇蜂紭鍏堥厤缃紪鐮佽鑼�
-                    <el-button type="text"  @click="numberClick">
-                        閰嶇疆瑙勮寖
-                      </el-button
-                    ></span
-                  >
-                  <span v-else>{{editConfig.title==='鏂板缓'? '鑷姩鐢熸垚': editConfig.infomation.number}}</span>
-                </el-form-item>
-              </el-col>
+
               <el-col :span="12">
                 <el-form-item label="閿�鍞満浼�" prop="saleChanceId">
                   <div class="custom-name">
                     <el-autocomplete
-                      style="width:100%"
+                      style="width: 100%"
                       v-model="editConfig.infomation.sale_chance_name"
                       :fetch-suggestions="
                         (queryString, callback) => {
@@ -83,12 +85,17 @@
                       "
                       value-key="name"
                       @select="handleSelectClient('chance', $event)"
+                      :disabled="isNameChanceEdit"
                     ></el-autocomplete>
-                    <div class="common-select-btn" @click="selClientClick('chance')">
+                    <div v-if="!isNameChanceEdit" class="common-select-btn" @click="selClientClick('chance')">
                       <i class="el-icon-circle-plus-outline"></i>
                     </div>
                     <div
-                      v-if="editConfig.infomation.sale_chance_name && editConfig.infomation.sale_chance_name.length > 0"
+                      v-if="
+                        editConfig.infomation.sale_chance_name &&
+                        editConfig.infomation.sale_chance_name.length > 0 &&
+                        !isNameChanceEdit
+                      "
                       class="common-select-btn"
                       @click="clearupClient('chance')"
                     >
@@ -117,7 +124,7 @@
                     value-format="yyyy-MM-dd"
                     type="date"
                     placeholder="閫夋嫨鏃ユ湡"
-                    style="width:100%"
+                    style="width: 100%"
                   >
                   </el-date-picker>
                 </el-form-item>
@@ -125,7 +132,6 @@
               <el-col :span="12">
                 <el-form-item label="閿�鍞礋璐d汉" prop="memberId">
                   <el-select
-                  
                     v-model="editConfig.infomation.memberId"
                     placeholder="璇烽�夋嫨"
                     size="mini"
@@ -143,7 +149,7 @@
                     value-format="yyyy-MM-dd"
                     type="date"
                     placeholder="閫夋嫨鏃ユ湡"
-                    style="width:100%"
+                    style="width: 100%"
                   >
                   </el-date-picker>
                 </el-form-item>
@@ -190,7 +196,7 @@
               <el-col :span="12">
                 <el-form-item label="鏀惰揣鍦板潃" prop="address">
                   <el-input
-                    style="width:100%"
+                    style="width: 100%"
                     type="textarea"
                     :autosize="{ minRows: 2 }"
                     v-model="editConfig.infomation.address"
@@ -228,7 +234,7 @@
               <el-col :span="24">
                 <el-form-item label="鏉℃涓庢潯浠�" prop="conditions" label-width="15%">
                   <el-input
-                    style="width:100%;"
+                    style="width: 100%"
                     type="textarea"
                     :autosize="{ minRows: 4 }"
                     v-model="editConfig.infomation.conditions"
@@ -378,10 +384,10 @@
 import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog"
 import SelectChanceDialog from "@/views/other/commonDialog/SelectChanceDialog"
 import AddCollectionPlan from "@/views/other/payment/collectionPlan/AddCollectionPlan"
-import codeMixin from "@/views/client/followupRecords/mixin/codeMixin";
+import codeMixin from "@/views/client/followupRecords/mixin/codeMixin"
 export default {
   name: "AddSalesDetailsDialog",
-  mixins:[codeMixin],
+  mixins: [codeMixin],
   props: {
     editCommonConfig: {
       type: Object,
@@ -445,7 +451,8 @@
         title: "鏂板缓",
         infomation: {}
       },
-      amountTotal: 0
+      amountTotal: 0,
+      isNameChanceEdit: false
     }
   },
   created() {
@@ -453,27 +460,33 @@
     this.$store.dispatch("geChance")
     this.setTableForm()
     this.getCommonData()
-    this.formInfo();
+    this.formInfo()
+    if (this.editConfig.title === "鏂板缓" && this.editConfig.infomation.client_name.length > 0) {
+      this.isNameChanceEdit = true
+    }
+    // else {
+
+    // }
   },
-  watch:{
-    'editClientManageConfig.visible'(val){
-      if(val){
+  watch: {
+    "editClientManageConfig.visible"(val) {
+      if (val) {
         this.formInfo()
       }
     },
-    'editClientManageConfig.infomation.codeStandID'(){
+    "editClientManageConfig.infomation.codeStandID"() {
       this.formInfo()
     }
   },
   methods: {
-    formInfo(){
-      this.objCode.type='閿�鍞槑缁嗙紪鐮�'
-      this.objCode.codeStandID = ''
-      if(this.editConfig.infomation.codeStandID){
-        this.objCode.codeStandID = this.editConfig.infomation.codeStandID;
+    formInfo() {
+      this.objCode.type = "閿�鍞槑缁嗙紪鐮�"
+      this.objCode.codeStandID = ""
+      if (this.editConfig.infomation.codeStandID) {
+        this.objCode.codeStandID = this.editConfig.infomation.codeStandID
       }
-      this.getRCodeStandardList();
-    }, 
+      this.getRCodeStandardList()
+    },
     getCommonData() {
       getAllData()
         .then((res) => {
@@ -561,7 +574,7 @@
         logisticCompany: data.logisticCompany || "",
         logisticCost: data.logisticCost || 0,
         logisticNumber: data.logisticNumber || "",
-        codeRule:this.codeRule,
+        codeRule: this.codeRule
       }
       let params = {}
       if (this.editConfig.title === "鏂板缓") {
@@ -662,7 +675,7 @@
           { label: "浜у搧鍚嶇О", prop: "name", productName: true, isRequird: true },
           { label: "浜у搧缂栧彿", prop: "number" },
           { label: "鏁伴噺", prop: "amount", inputNumber: true, isRequird: true },
-          { label: "閿�鍞崟浠�", prop: "price",inputFloat: true  },
+          { label: "閿�鍞崟浠�", prop: "price", inputFloat: true },
           { label: "浠风◣鍚堣", prop: "total", inputFloat: true }
         ]
       }
@@ -722,8 +735,8 @@
 <style lang="scss" scoped>
 ::v-deep {
   .iframe-dialog .el-dialog__body {
-    .el-form{
-      .el-form-item{
+    .el-form {
+      .el-form-item {
         width: 100%;
       }
     }

--
Gitblit v1.8.0