From 3d04f62e6c9124e2d37b5d09191a02fc6390d16f Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期五, 13 十月 2023 17:07:10 +0800 Subject: [PATCH] bug修复 --- src/views/sales/contractManage/AddContractManageDialog.vue | 128 ++++++++++++++++++++++++++++++++++++------ 1 files changed, 110 insertions(+), 18 deletions(-) diff --git a/src/views/sales/contractManage/AddContractManageDialog.vue b/src/views/sales/contractManage/AddContractManageDialog.vue index 7f5c91d..b3114e0 100644 --- a/src/views/sales/contractManage/AddContractManageDialog.vue +++ b/src/views/sales/contractManage/AddContractManageDialog.vue @@ -11,7 +11,7 @@ :model="editConfig.infomation" :rules="rules" label-position="right" - label-width="308px" + label-width="168px" size="mini" > <!-- 淇℃伅 --> @@ -20,6 +20,30 @@ <div class="basic-info-title">鍩烘湰淇℃伅</div> <div class="basic-info-view"> <el-row> + <el-col :span="12"> + <el-form-item label="鍗曟嵁缂栧彿" prop="number"> + <!-- <el-input v-model="editConfig.infomation.number" style="width: 100%"></el-input> --> + <WordInput + v-if="codenumer && (explain != '' || isIdDisabled) && method == 0" + :codenumer="codenumer" + :sum="sum" + :disabled="editConfig.title !== '鏂板缓' || isIdDisabled" + :inputValue="inputValue" + @codeList="codeList" + /> + <span v-else-if="method == 0" style="color: #f56c6c" + >璇蜂紭鍏堥厤缃紪鐮佽鑼� <el-button type="text" @click="numberClick"> 閰嶇疆瑙勮寖 </el-button></span + > + <span v-else>{{ editConfig.title === "鏂板缓" ? "鑷姩鐢熸垚" : editConfig.infomation.number }}</span> + </el-form-item> + </el-col> + <el-col :span="12"> + <el-form-item label="鍚堝悓鍚嶇О" prop="contractName"> + <div class="custom-name"> + <el-input v-model="editConfig.infomation.contractName"></el-input> + </div> + </el-form-item> + </el-col> <el-col :span="12"> <el-form-item label="瀹㈡埛鍚嶇О" prop="client_name"> <div class="custom-name"> @@ -32,6 +56,7 @@ " value-key="name" @select="handleSelectClient('client', $event)" + style="width: 100%" ></el-autocomplete> <div class="common-select-btn" @click="selClientClick('client')"> <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i> @@ -47,17 +72,12 @@ </el-form-item> </el-col> <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="璐熻矗浜�" prop="memberId"> <el-select v-model="editConfig.infomation.memberId" placeholder="璇烽�夋嫨" size="mini" - style="width: 63%" + style="width: 100%" > <el-option v-for="item in memberOptions" :key="item.id" :label="item.username" :value="item.id"> </el-option> @@ -72,6 +92,7 @@ placeholder="璇烽�夋嫨" class="common-select-sel" size="mini" + style="width: 100%" > <el-option v-for="item in statusOptions" :key="item.id" :label="item.name" :value="item.id"> </el-option> @@ -92,12 +113,19 @@ " value-key="number" @select="handleSelectClient('quotation', $event)" + style="width: 100%" + placeholder="璇峰厛閫夋嫨瀹㈡埛鍚嶇О" + :disabled="isAddQuatation" ></el-autocomplete> - <div class="common-select-btn" @click="selClientClick('quotation')"> + <div v-if="!isAddQuatation" class="common-select-btn" @click="selClientClick('quotation')"> <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i> </div> <div - v-if="editConfig.infomation.quotation_number && editConfig.infomation.quotation_number.length > 0" + v-if=" + editConfig.infomation.quotation_number && + editConfig.infomation.quotation_number.length > 0 && + !isAddQuatation + " class="common-select-btn" @click="clearupClient('quotation')" > @@ -208,8 +236,11 @@ import { getAddContract, getUpdateContract } from "@/api/sales/contractManage" import SelectClientDialog from "@/views/other/commonDialog/SelectClientDialog" import SelectCommonDialog from "@/views/other/commonDialog/SelectCommonDialog" +import codeMixin from "@/views/client/followupRecords/mixin/codeMixin" +import { getQuotationList } from "@/api/sales/quotation" export default { name: "AddContractManageDialog", + mixins: [codeMixin], props: { editCommonConfig: { type: Object, @@ -226,17 +257,18 @@ computed: { clientList() { return this.$store.state.getClientName.clientList - }, - quotationList() { - return this.$store.state.getClientName.quotationList } + // quotationList() { + // return this.$store.state.getClientName.quotationList + // } }, data() { return { - dialogWidth: "80%", + dialogWidth: "50%", editConfig: this.editCommonConfig, rules: { - number: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }], + number: [{ required: true, validator: this.checkCode, trigger: "blur" }], + client_name: [{ required: true, message: "璇烽�夋嫨瀹㈡埛鍚嶇О", trigger: "change" }], member_id: [{ required: true, message: "璇烽�夋嫨", trigger: "change" }] }, memberOptions: [], @@ -255,15 +287,36 @@ infomation: {} }, clientId: this.editCommonConfig.infomation.clientId, - quotationId: this.editCommonConfig.infomation.quotationId + quotationId: this.editCommonConfig.infomation.quotationId, + isAddQuatation: true, + quotationList: [] } }, created() { this.$store.dispatch("geClient") - this.$store.dispatch("geQuotation") + // this.$store.dispatch("geQuotation") this.getCommonData() + this.formInfo() + }, + watch: { + "editCommonConfig.visible"(val) { + if (val) { + this.formInfo() + } + }, + "editCommonConfig.infomation.codeStandID"() { + this.formInfo() + } }, methods: { + formInfo() { + this.objCode.type = "鍚堝悓缂栫爜" + this.objCode.codeStandID = "" + if (this.editConfig.infomation.codeStandID) { + this.objCode.codeStandID = this.editConfig.infomation.codeStandID + } + this.getRCodeStandardList() + }, getCommonData() { getAllData() .then((res) => { @@ -308,19 +361,38 @@ }, saveParams() { let data = this.editConfig.infomation + console.log(data) let params = { id: this.editConfig.title === "鏂板缓" ? 0 : data.id, + contractName: data.contractName || "", client_id: this.clientId || 0, file: "", member_id: data.memberId || 0, number: data.number || "", quotation_id: this.quotationId || 0, - status_id: data.statusId || 0 + status_id: data.statusId || 0, + codeStandID: data.ID, + codeRule: this.codeRule } return params }, handleClose() { this.editConfig.visible = false + }, + // 鑾峰彇鎶ヤ环鍗� + getQuotation(id) { + getQuotationList({ + page: 0, + pageSize: 0, + search_map: { + client_id: id + } + }).then((res) => { + if (res.code == 200) { + console.log(res) + this.quotationList = res.data.list + } + }) }, // 閫夋嫨瀹㈡埛鐩稿叧鏂规硶 querySearchAsync(queryString, cb, value) { @@ -343,14 +415,19 @@ } }, handleSelectClient(value, item) { - console.log(value) + console.log(item) if (value === "client") { + this.editConfig.infomation.client_name = item.name this.clientId = item.id + this.isAddQuatation = false + this.getQuotation(item.id) } else if (value === "quotation") { + this.editConfig.infomation.quotation_number = item.number this.quotationId = item.id } }, selClientClick(value) { + console.log("aaaa") if (value === "client") { this.editSelectClientConfig.editVisible = true } else if (value === "quotation") { @@ -360,10 +437,13 @@ } }, selClient(row, value) { + console.log("bbbb") console.log(value) if (value === "client") { this.editConfig.infomation.client_name = row.name this.clientId = row.id + this.isAddQuatation = false + this.getQuotation(row.id) } else if (value === "quotation") { this.editConfig.infomation.quotation_number = row.number this.quotationId = row.id @@ -371,9 +451,13 @@ }, // 娓呴櫎宸查�夋嫨鐢ㄦ埛 clearupClient(value) { + console.log(value) if (value === "client") { this.editConfig.infomation.client_name = "" this.clientId = 0 + this.isAddQuatation = true + this.editConfig.infomation.quotation_number = "" + this.quotationId = 0 } else if (value === "quotation") { this.editConfig.infomation.quotation_number = "" this.quotationId = 0 @@ -392,6 +476,14 @@ this.unflodCollapseStr = "鏀惰捣" this.isUnflod = true } + }, + // 璁㈠崟缂栫爜鍗曠嫭鏍¢獙 + checkCode(rule, value, callback) { + if (this.editConfig.infomation.number && this.editConfig.infomation.number.length > 0) { + callback() + } else { + callback(new Error("璇疯緭鍏ュ崟鎹紪鍙�")) + } } } } -- Gitblit v1.8.0