From 62377c544f841008837548151a62c9d8aaca5f69 Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期三, 30 八月 2023 10:50:08 +0800 Subject: [PATCH] bug修复 --- src/views/client/salesLead/DetailSalesLead.vue | 8 +- src/views/sales/salesReturn/index.vue | 10 ++ src/views/sales/salesReturn/AddSalesReturnDialog.vue | 126 ++++++++++++++++++++++++++++++++++-------- src/views/sales/refundForm/index.vue | 7 ++ src/views/sales/quotation/index.vue | 9 ++ 5 files changed, 128 insertions(+), 32 deletions(-) diff --git a/src/views/client/salesLead/DetailSalesLead.vue b/src/views/client/salesLead/DetailSalesLead.vue index adafad6..0fd12d9 100644 --- a/src/views/client/salesLead/DetailSalesLead.vue +++ b/src/views/client/salesLead/DetailSalesLead.vue @@ -171,9 +171,11 @@ if (item.FollowRecord && item.FollowRecord.length > 0) { this.record = item.FollowRecord[0].record console.log(item.FollowRecord[0].follow_time) - let follow_time = item.FollowRecord[0].follow_time - this.newContactDays = follow_time.substring(0, 10) - this.noContactDays = this.getDiffDay(Date.now(), this.newContactDays) + if (item.FollowRecord[0].follow_time && item.FollowRecord[0].follow_time.length > 0) { + let follow_time = item.FollowRecord[0].follow_time + this.newContactDays = follow_time.substring(0, 10) + this.noContactDays = this.getDiffDay(Date.now(), this.newContactDays) + } } this.basicInfoList = [ { diff --git a/src/views/sales/quotation/index.vue b/src/views/sales/quotation/index.vue index fbaaf6f..b854a02 100644 --- a/src/views/sales/quotation/index.vue +++ b/src/views/sales/quotation/index.vue @@ -252,13 +252,18 @@ selClientClick(row) { console.log(row) this.clientDeail.visible = true - this.clientDeail.infomation = { ...row, client_name: row.name } + this.clientDeail.infomation = { + ...row.client, + client_name: row.name, + client_level: row.client.client_level.name, + client_status: row.client.client_status.name + } }, // 鑱旂郴浜鸿鎯� selContactsClick(row) { console.log(row) this.contactsDeail.visible = true - this.contactsDeail.infomation = { ...row } + this.contactsDeail.infomation = { ...row.contact, Client: row.client } }, // 鏈轰細鍚嶇О璇︽儏 selCommonClick(row) { diff --git a/src/views/sales/refundForm/index.vue b/src/views/sales/refundForm/index.vue index 15c4dda..569c212 100644 --- a/src/views/sales/refundForm/index.vue +++ b/src/views/sales/refundForm/index.vue @@ -250,7 +250,12 @@ selClientClick(row) { console.log(row) this.clientDeail.visible = true - this.clientDeail.infomation = { ...row, client_name: row.name } + this.clientDeail.infomation = { + ...row.client, + client_name: row.name, + client_level: row.client.client_level.name, + client_status: row.client.client_status.name + } }, // 鑱旂郴浜鸿鎯� selCommonClick(row) { diff --git a/src/views/sales/salesReturn/AddSalesReturnDialog.vue b/src/views/sales/salesReturn/AddSalesReturnDialog.vue index 6b2df6b..bc222ca 100644 --- a/src/views/sales/salesReturn/AddSalesReturnDialog.vue +++ b/src/views/sales/salesReturn/AddSalesReturnDialog.vue @@ -28,17 +28,21 @@ <div class="custom-name"> <el-autocomplete v-model="editConfig.infomation.client_name" - :fetch-suggestions="querySearchAsync" + :fetch-suggestions=" + (queryString, callback) => { + querySearchAsync(queryString, callback, 'client') + } + " value-key="name" - @select="handleSelectClient" + @select="handleSelectClient('client', $event)" ></el-autocomplete> - <div class="common-select-btn" @click="selClientClick"> + <div 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" class="common-select-btn" - @click="clearupClient" + @click="clearupClient('client')" > <i class="el-icon-remove-outline" title="娓呴櫎"></i> </div> @@ -48,6 +52,32 @@ <el-col :span="12"> <el-form-item label="閿�鍞��璐у崟缂栧彿" prop="number"> <el-input v-model="editConfig.infomation.number"></el-input> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="鍚堝悓璁㈠崟"> + <div class="custom-name"> + <el-autocomplete + v-model="editConfig.infomation.salesDetailNumber" + :fetch-suggestions=" + (queryString, callback) => { + querySearchAsync(queryString, callback, 'contract') + } + " + value-key="number" + @select="handleSelectClient('contract', $event)" + ></el-autocomplete> + <div class="common-select-btn" @click="selClientClick('contract')"> + <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i> + </div> + <div + v-if="editConfig.infomation.number && editConfig.infomation.number.length > 0" + class="common-select-btn" + @click="clearupClient('contract')" + > + <i class="el-icon-remove-outline" title="娓呴櫎"></i> + </div> + </div> </el-form-item> </el-col> <el-col :span="12"> @@ -182,6 +212,12 @@ :edit-common-config="editSelectClientConfig" @selClient="selClient" /> + <!-- 閫夋嫨鍚堝悓璁㈠崟 --> + <SelectCommonDialog + v-if="editSelCommonConfig.editVisible" + :edit-common-config="editSelCommonConfig" + @selClient="selClient" + /> </el-dialog> </div> </template> @@ -192,6 +228,7 @@ import { getAddSalesReturn, getUpdateSalesReturn } from "@/api/sales/salesReturn" import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog" import { getProductList } from "@/api/common/other" +import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog" export default { name: "AddSalesReturnDialog", props: { @@ -206,10 +243,13 @@ } } }, - components: { CommonFormTableView, SelectClientDialog }, + components: { CommonFormTableView, SelectClientDialog, SelectCommonDialog }, computed: { clientList() { return this.$store.state.getClientName.clientList + }, + salesDetailsList() { + return this.$store.state.getClientName.salesDetailsList } }, data() { @@ -238,13 +278,20 @@ title: "", infomation: {} }, + editSelCommonConfig: { + editVisible: false, + title: "", + infomation: {} + }, productId: 1, isNoProduct: true, - clientId: this.editCommonConfig.infomation.clientId + clientId: this.editCommonConfig.infomation.clientId, + SalesDetailsId: this.editCommonConfig.infomation.SalesDetailsId } }, created() { this.$store.dispatch("geClient") + this.$store.dispatch("geSalesDetails") this.setTableForm() this.getCommonData() this.getProductList() @@ -328,7 +375,9 @@ reason: data.reason || "", repository: data.repository || "", returnDate: data.returnDate || "", - status: data.status || 0 + salesReturnStatusId: data.salesReturnStatusId || 0, + sourceId: this.SalesDetailsId, + sourceType: 1 } } return params @@ -336,32 +385,61 @@ handleClose() { this.editConfig.visible = false }, - // 閫夋嫨瀹㈡埛鐩稿叧鏂规硶 - querySearchAsync(queryString, cb) { - var restaurants = this.clientList - var results = queryString ? restaurants.filter(this.createStateFilter(queryString)) : restaurants + // 閫夋嫨鐢ㄦ埛鐩稿叧鏂规硶 + querySearchAsync(queryString, cb, value) { + var restaurants = [] + if (value === "client") { + restaurants = this.clientList + } else if (value === "contract") { + restaurants = this.salesDetailsList + } + var results = queryString ? restaurants.filter(this.createStateFilter(queryString, value)) : restaurants cb(results) }, - createStateFilter(queryString) { + createStateFilter(queryString, value) { return (state) => { - return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0 + if (value === "contract") { + return state.number.toLowerCase().indexOf(queryString.toLowerCase()) === 0 + } else { + return state.name.toLowerCase().indexOf(queryString.toLowerCase()) === 0 + } } }, - handleSelectClient(item) { - this.clientId = item.id + handleSelectClient(value, item) { + if (value === "client") { + this.clientId = item.id + } else if (value === "contract") { + this.SalesDetailsId = item.id + } }, - selClientClick() { - this.editSelectClientConfig.editVisible = true + selClientClick(value) { + console.log(value) + if (value === "client") { + this.editSelectClientConfig.editVisible = true + } else if (value === "contract") { + this.editSelCommonConfig.title = "閿�鍞槑缁嗗崟" + this.editSelCommonConfig.editVisible = true + } }, - selClient(row) { - console.log(row) - this.editConfig.infomation.client_name = row.name - this.clientId = row.id + selClient(row, value) { + console.log(row, value) + if (value === "client") { + this.editConfig.infomation.client_name = row.name + this.clientId = row.id + } else if (value === "contract") { + this.editConfig.infomation.salesDetailNumber = row.number + this.SalesDetailsId = row.id + } }, // 娓呴櫎宸查�夋嫨鐢ㄦ埛 - clearupClient() { - this.editConfig.infomation.client_name = "" - this.clientId = 0 + clearupClient(value) { + if (value === "client") { + this.editConfig.infomation.client_name = "" + this.clientId = 0 + } else if (value === "contract") { + this.editConfig.infomation.salesDetailNumber = "" + this.SalesDetailsId = 0 + } }, // 娣诲姞闄勪欢 addAnnexClick() {}, diff --git a/src/views/sales/salesReturn/index.vue b/src/views/sales/salesReturn/index.vue index cd9f47f..93bf71e 100644 --- a/src/views/sales/salesReturn/index.vue +++ b/src/views/sales/salesReturn/index.vue @@ -217,7 +217,7 @@ console.log(row) this.editConfig.visible = true this.editConfig.title = "缂栬緫" - this.editConfig.infomation = { ...row, currency: "浜烘皯甯�" } + this.editConfig.infomation = { ...row, currency: "浜烘皯甯�", salesDetailNumber: row.Source.number } }, // 鍒犻櫎 delClick() { @@ -254,7 +254,13 @@ selClientClick(row) { console.log(row) this.clientDeail.visible = true - this.clientDeail.infomation = { ...row, client_name: row.name } + this.clientDeail.infomation = { + ...row.client, + client_name: row.name, + member: row.Member, + client_level: row.client.client_level.name, + client_status: row.client.client_status.name + } }, // 鑱旂郴浜鸿鎯� selCommonClick(row) { -- Gitblit v1.8.0