From b136c0a80500d929897a8e24f920efad47e2e307 Mon Sep 17 00:00:00 2001
From: haoxuan <haoxuan>
Date: 星期三, 01 十一月 2023 19:03:01 +0800
Subject: [PATCH] 变更公海 的接口传参修改
---
src/views/sales/generatePlan/AddGeneratePlanDialog.vue | 78 ++++++++++++++++++++++++++++++++++-----
1 files changed, 68 insertions(+), 10 deletions(-)
diff --git a/src/views/sales/generatePlan/AddGeneratePlanDialog.vue b/src/views/sales/generatePlan/AddGeneratePlanDialog.vue
index 341b67c..2d766f5 100644
--- a/src/views/sales/generatePlan/AddGeneratePlanDialog.vue
+++ b/src/views/sales/generatePlan/AddGeneratePlanDialog.vue
@@ -21,11 +21,24 @@
<div class="basic-info-view">
<el-row>
<el-col v-if="isUnflod" :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
+ v-if="editConfig.infomation.client_name && editConfig.infomation.client_name.length > 0"
+ class="common-select-btn"
+ @click="clearupClient"
+ >
+ <i class="el-icon-remove-outline" title="娓呴櫎"></i>
+ </div>
</div>
</el-form-item>
</el-col>
@@ -42,7 +55,7 @@
size="mini"
style="width: 63%"
>
- <el-option v-for="item in memberOptions" :key="item.value" :label="item.label" :value="item.value">
+ <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id">
</el-option>
</el-select>
</el-form-item>
@@ -130,9 +143,15 @@
</div>
</el-form>
<div 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>
+ <!-- 閫夋嫨瀹㈡埛 -->
+ <SelectClientDialog
+ v-if="editSelectClientConfig.editVisible"
+ :edit-common-config="editSelectClientConfig"
+ @selClient="selClient"
+ />
</el-dialog>
</div>
</template>
@@ -140,6 +159,7 @@
<script>
import { getAllData } from "@/api/client/client"
import { getAddPlan, getUpdatePlan } from "@/api/sales/generatePlan"
+import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog"
export default {
name: "AddGeneratePlanDialog",
props: {
@@ -154,8 +174,12 @@
}
}
},
- components: {},
- computed: {},
+ components: { SelectClientDialog },
+ computed: {
+ clientList() {
+ return this.$store.state.getClientName.clientList
+ }
+ },
data() {
return {
dialogWidth: "80%",
@@ -166,10 +190,16 @@
},
memberOptions: [],
unflodCollapseStr: "鏀惰捣",
- isUnflod: true
+ isUnflod: true,
+ editSelectClientConfig: {
+ editVisible: false,
+ title: "",
+ infomation: {}
+ }
}
},
created() {
+ this.$store.dispatch("geClient")
this.getCommonData()
},
methods: {
@@ -233,7 +263,7 @@
let params = {
id: this.editConfig.title === "鏂板缓" ? 0 : data.id,
plan: {
- clientId: data.clientId || 0,
+ clientId: parseInt(data.clientId) || 0,
content: data.content || "",
endTime: data.endTime || "",
file: data.file || "",
@@ -248,6 +278,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() {},
@@ -288,6 +345,7 @@
.common-select-btn {
margin-left: 5px;
font-size: 18px;
+ cursor: pointer;
}
}
}
--
Gitblit v1.8.0