From 06611cb899ed5e32479585d175b8011a90bc675f Mon Sep 17 00:00:00 2001 From: haoxuan <haoxuan> Date: 星期一, 16 十月 2023 12:42:49 +0800 Subject: [PATCH] Merge branch 'dev' of http://192.168.5.5:10010/r/web/crm-web into wn --- src/views/sales/subOrder/AddSubOrderDialog.vue | 42 +++++++++++++++++++++++++++++++++++------- 1 files changed, 35 insertions(+), 7 deletions(-) diff --git a/src/views/sales/subOrder/AddSubOrderDialog.vue b/src/views/sales/subOrder/AddSubOrderDialog.vue index 3acc1ed..d224472 100644 --- a/src/views/sales/subOrder/AddSubOrderDialog.vue +++ b/src/views/sales/subOrder/AddSubOrderDialog.vue @@ -78,14 +78,17 @@ " value-key="number" @select="handleSelectClient('master', $event)" + placeholder="璇峰厛閫夋嫨瀹㈡埛鍚嶇О" + :disabled="isAddMaster" ></el-autocomplete> - <div class="common-select-btn" @click="selClientClick('master')"> + <div v-if="!isAddMaster" class="common-select-btn" @click="selClientClick('master')"> <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i> </div> <div v-if=" editConfig.infomation.master_order_number && - editConfig.infomation.master_order_number.length > 0 + editConfig.infomation.master_order_number.length > 0 && + !isAddMaster " class="common-select-btn" @click="clearupClient('master')" @@ -189,6 +192,7 @@ import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog" import WordInput from "@/components/wordInput.vue" import codeMixin from "@/views/client/followupRecords/mixin/codeMixin" +import { getMasterOrderList } from "@/api/sales/masterOrder" export default { name: "SubOrderDialog", @@ -209,10 +213,10 @@ computed: { clientList() { return this.$store.state.getClientName.clientList - }, - masterOrderList() { - return this.$store.state.getClientName.masterOrderList } + // masterOrderList() { + // return this.$store.state.getClientName.masterOrderList + // } }, data() { return { @@ -258,12 +262,14 @@ tableData: [], productId: 1, addProductArr: [], - objCode: { name: "", page: 0, pageSize: 0, type: "閿�鍞瓙鍗曠紪鐮�", codeStandID: "" } + objCode: { name: "", page: 0, pageSize: 0, type: "閿�鍞瓙鍗曠紪鐮�", codeStandID: "" }, + isAddMaster: true, + masterOrderList: [] } }, created() { this.$store.dispatch("geClient") - this.$store.dispatch("geMaster") + // this.$store.dispatch("geMaster") this.setTableForm() this.getCommonData() this.formInfo() @@ -377,6 +383,20 @@ handleClose() { this.editConfig.visible = false }, + // 鑾峰彇閿�鍞�诲崟 + getMasterList(id) { + getMasterOrderList({ + page: 0, + pageSize: 0, + search_map: { + client_id: id + } + }).then((res) => { + if (res.code == 200) { + this.masterOrderList = res.data.list + } + }) + }, // 閫夋嫨瀹㈡埛鐩稿叧鏂规硶 querySearchAsync(queryString, cb, value) { var restaurants = [] @@ -401,6 +421,8 @@ handleSelectClient(value, item) { if (value === "client") { this.clientId = item.id + this.isAddMaster = false + this.getMasterList(item.id) } else if (value === "master") { this.masterId = item.id } @@ -411,6 +433,7 @@ } else if (value == "master") { this.editSelectMasterConfig.title = "閿�鍞�诲崟" this.editSelectMasterConfig.editVisible = true + this.editSelectMasterConfig.clientId = this.clientId this.editSelectMasterConfig.tableInfomation = [...this.masterOrderList] } }, @@ -420,6 +443,8 @@ this.editConfig.infomation.client_name = row.name this.editConfig.infomation.client_id = row.id this.clientId = row.id + this.isAddMaster = false + this.getMasterList(row.id) } else if (value == "master") { this.editConfig.infomation.master_order_number = row.number this.masterId = row.id @@ -432,6 +457,9 @@ this.editConfig.infomation.client_name = "" this.editConfig.infomation.client_id = 0 this.clientId = 0 + this.isAddMaster = true + this.editConfig.infomation.master_order_number = "" + this.masterId = 0 } else if (value == "master") { this.editConfig.infomation.master_order_number = "" this.masterId = 0 -- Gitblit v1.8.0