From fde4963aaa85d4f02a58ed8d5cc58396604537ae Mon Sep 17 00:00:00 2001
From: yangfeng <wanwan926_4@163.com>
Date: 星期五, 21 七月 2023 18:55:56 +0800
Subject: [PATCH] 服务管理相关联调
---
src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue | 85 +++++++++++++++++++++++++++++++++---------
1 files changed, 66 insertions(+), 19 deletions(-)
diff --git a/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue b/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue
index 91d50da..9a8ff45 100644
--- a/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue
+++ b/src/views/sales/salesOpportunity/AddSalesOpportunityDialog.vue
@@ -22,11 +22,20 @@
<div class="basic-info-view">
<el-row>
<el-col :span="12">
- <el-form-item label="瀹㈡埛鍚嶇О" prop="client_id">
+ <el-form-item label="瀹㈡埛鍚嶇О" prop="client_name">
<div class="custom-name">
- <el-input v-model="editConfig.infomation.client_id"></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>
@@ -467,6 +476,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>
@@ -474,6 +489,7 @@
<script>
import { getAllData } from "@/api/client/client"
import { getAddSaleChance, getUpdateSaleChance } from "@/api/sales/salesOpportunity"
+import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog"
export default {
name: "AddSalesOpportunityDialog",
props: {
@@ -488,10 +504,13 @@
}
}
},
- components: {},
+ components: { SelectClientDialog },
computed: {
searchCommonHeight() {
return this.$refs.searchCommonView.offsetHeight
+ },
+ clientList() {
+ return this.$store.state.getClientName.clientList
}
},
data() {
@@ -513,20 +532,22 @@
saleStageOptions: [], // 閿�鍞樁娈�
oldCustomerMarketOptions: [], // 鑰佸鎴疯惀閿�
possibleOptions: [], // 鍙兘鎬�
- currencyOptions: [
- {
- id: 1,
- name: "浜烘皯甯�"
- }
- ], // 甯佺
+ currencyOptions: [], // 甯佺
currentStateOptions: [], // 褰撳墠鐘舵��
countryOptions: [], // 鍥藉
provinceOptions: [], // 鐪佷唤
cityOptions: [], // 鍩庡競
- regionOptions: [] // 鍖哄煙
+ regionOptions: [], // 鍖哄煙
+ editSelectClientConfig: {
+ editVisible: false,
+ title: "",
+ infomation: {}
+ },
+ restaurants: []
}
},
created() {
+ this.$store.dispatch("geClient")
this.getCommonData()
},
methods: {
@@ -543,6 +564,9 @@
this.provinceOptions = res.data.province
this.cityOptions = res.data.city
this.regionOptions = res.data.region
+ this.possibleOptions = res.data.possibility
+ this.currencyOptions = res.data.currency
+ this.currentStateOptions = res.data.status
})
.catch((err) => {
console.log(err)
@@ -638,6 +662,33 @@
}
return params
},
+ // 閫夋嫨鐢ㄦ埛鐩稿叧鏂规硶
+ querySearchAsync(queryString, cb) {
+ console.log(this.clientList)
+ 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) {
+ 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() {},
// 璁剧疆鍏佽涓婁紶鏂囦欢鏍煎紡
@@ -662,22 +713,18 @@
.basic-info-view {
margin-top: 10px;
padding-right: 40px;
- .custom-name {
+ .custom-name,
+ .common-select {
display: flex;
.common-select-btn {
margin-left: 5px;
font-size: 18px;
+ cursor: pointer;
}
}
.common-select {
- display: flex;
.common-select-sel {
width: 270px;
- }
- .common-select-btn {
- margin-left: 5px;
- font-size: 16px;
- cursor: pointer;
}
}
}
--
Gitblit v1.8.0