From ebddc02611b0373c1d5bfa342bd781fb5eb82009 Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期二, 01 八月 2023 14:23:31 +0800
Subject: [PATCH] 侧边栏样式机销售明细单增加销售机会选择弹窗

---
 src/views/sales/refundForm/AddRefundFormDialog.vue |  101 ++++++++++++++++++++++++++++++++++----------------
 1 files changed, 69 insertions(+), 32 deletions(-)

diff --git a/src/views/sales/refundForm/AddRefundFormDialog.vue b/src/views/sales/refundForm/AddRefundFormDialog.vue
index 9e3503a..0eb0266 100644
--- a/src/views/sales/refundForm/AddRefundFormDialog.vue
+++ b/src/views/sales/refundForm/AddRefundFormDialog.vue
@@ -22,11 +22,20 @@
           <div class="basic-info-view">
             <el-row>
               <el-col :span="12">
-                <el-form-item label="瀹㈡埛鍚嶇О" prop="clientId">
+                <el-form-item label="瀹㈡埛鍚嶇О" prop="client_name">
                   <div class="custom-name">
-                    <el-input v-model="editConfig.infomation.clientId"></el-input>
-                    <div class="common-select-btn"><i class="el-icon-circle-plus-outline" title="閫夋嫨"></i></div>
-                    <div class="common-select-btn"><i class="el-icon-edit" title="缂栬緫"></i></div>
+                    <el-autocomplete
+                      v-model="editConfig.infomation.client_name"
+                      :fetch-suggestions="querySearchAsync"
+                      value-key="name"
+                      @select="handleSelectClient"
+                    ></el-autocomplete>
+                    <div class="common-select-btn" @click="selClientClick">
+                      <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i>
+                    </div>
+                    <div class="common-select-btn" @click="clearupClient">
+                      <i class="el-icon-edit-outline" title="娓呴櫎"></i>
+                    </div>
                   </div>
                 </el-form-item>
               </el-col>
@@ -225,6 +234,12 @@
         <el-button type="primary" size="small" @click="saveClick('form')">淇濆瓨</el-button>
         <el-button size="small" @click="editConfig.visible = false">鍙栨秷</el-button>
       </div>
+      <!-- 閫夋嫨瀹㈡埛 -->
+      <SelectClientDialog
+        v-if="editSelectClientConfig.editVisible"
+        :edit-common-config="editSelectClientConfig"
+        @selClient="selClient"
+      />
     </el-dialog>
   </div>
 </template>
@@ -233,6 +248,7 @@
 import CommonFormTableView from "@/components/makepager/CommonFormTableView"
 import { getAllData } from "@/api/client/client"
 import { getAddSalesRefund, getUpdateSalesRefund } from "@/api/sales/refundForm"
+import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog"
 export default {
   name: "AddRefundFormDialog",
   props: {
@@ -247,8 +263,12 @@
       }
     }
   },
-  components: { CommonFormTableView },
-  computed: {},
+  components: { CommonFormTableView, SelectClientDialog },
+  computed: {
+    clientList() {
+      return this.$store.state.getClientName.clientList
+    }
+  },
   data() {
     return {
       dialogWidth: "80%",
@@ -261,25 +281,11 @@
         account: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }]
       },
       memberOptions: [],
-      selSourceOrderOptions: [{ value: "1", label: "閿�鍞��璐у崟" }], // 閫夋嫨婧愬崟
-      refundMethodOptions: [
-        { value: "1", label: "鐜伴噾" },
-        { value: "2", label: "鏀エ" },
-        { value: "3", label: "鐢垫眹" },
-        { value: "4", label: "閭斂姹囨" },
-        { value: "5", label: "缃戜笂閾惰" },
-        { value: "6", label: "鍏朵粬" }
-      ], // 浠樻鏂瑰紡
-      accountOptions: [{ value: "1", label: "浜烘皯甯佽处鎴�" }], // 璐︽埛
-      isInvoiceOptions: [
-        { value: "1", label: "鏈紑" },
-        { value: "2", label: "宸插紑" }
-      ], // 鏄惁寮�绁�
-      currencyOptions: [
-        { value: "1", label: "浜烘皯甯�(楼)" },
-        { value: "2", label: "鑻遍晳(拢)" },
-        { value: "3", label: "娆у厓(鈧�)" }
-      ], // 甯佺
+      // selSourceOrderOptions: [{ value: "1", label: "閿�鍞��璐у崟" }], // 閫夋嫨婧愬崟
+      refundMethodOptions: [], // 浠樻鏂瑰紡
+      accountOptions: [], // 璐︽埛
+      isInvoiceOptions: [], // 鏄惁寮�绁�
+      currencyOptions: [], // 甯佺
       approvalWorkflowOptions: [], // 瀹℃壒娴佺▼
       productTableList: {},
       showSummary: {
@@ -287,10 +293,16 @@
         total: true,
         sumProp: ["other1", "other2", "other3", "other4"],
         mergeNumber: 5
+      },
+      editSelectClientConfig: {
+        editVisible: false,
+        title: "",
+        infomation: {}
       }
     }
   },
   created() {
+    this.$store.dispatch("geClient")
     this.setTableForm()
     this.getCommonData()
   },
@@ -299,6 +311,10 @@
       getAllData()
         .then((res) => {
           this.memberOptions = res.data.member
+          this.refundMethodOptions = res.data.refundMethod
+          this.accountOptions = res.data.accountId
+          this.isInvoiceOptions = res.data.isInvoice
+          this.currencyOptions = res.data.currency
         })
         .catch((err) => {
           console.log(err)
@@ -381,6 +397,33 @@
     handleClose() {
       this.editConfig.visible = false
     },
+    // 閫夋嫨瀹㈡埛鐩稿叧鏂规硶
+    querySearchAsync(queryString, cb) {
+      var restaurants = this.clientList
+      var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants
+      cb(results)
+    },
+    createStateFilter(queryString) {
+      return (state) => {
+        return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0
+      }
+    },
+    handleSelectClient(item) {
+      this.editConfig.infomation.client_id = item.id
+    },
+    selClientClick() {
+      this.editSelectClientConfig.editVisible = true
+    },
+    selClient(row) {
+      console.log(row)
+      this.editConfig.infomation.client_name = row.name
+      this.editConfig.infomation.client_id = row.id
+    },
+    // 娓呴櫎宸查�夋嫨鐢ㄦ埛
+    clearupClient() {
+      this.editConfig.infomation.client_name = ""
+      this.editConfig.infomation.client_id = 0
+    },
     // 娣诲姞闄勪欢
     addAnnexClick() {},
     // 璁剧疆鍏佽涓婁紶鏂囦欢鏍煎紡
@@ -437,13 +480,7 @@
     .basic-info-view {
       margin-top: 10px;
       padding-right: 40px;
-      .custom-name {
-        display: flex;
-        .common-select-btn {
-          margin-left: 5px;
-          font-size: 18px;
-        }
-      }
+      .custom-name,
       .common-select {
         display: flex;
         .common-select-sel {

--
Gitblit v1.8.0