From 0f43183f986f0ed314647687c73da5a4493d2611 Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期一, 16 十月 2023 20:36:15 +0800 Subject: [PATCH] bug修复(5219 5233) --- src/views/other/payment/receipt/addReceipt.vue | 145 ++++++++++++++++++++++++++++++++--------------- 1 files changed, 98 insertions(+), 47 deletions(-) diff --git a/src/views/other/payment/receipt/addReceipt.vue b/src/views/other/payment/receipt/addReceipt.vue index 1c58f1a..ed5daa4 100644 --- a/src/views/other/payment/receipt/addReceipt.vue +++ b/src/views/other/payment/receipt/addReceipt.vue @@ -13,7 +13,7 @@ :model="editConfig.infomation" :rules="rules" label-position="right" - label-width="308px" + label-width="168px" size="mini" style="height: 60vh; overflow-x: hidden" > @@ -35,12 +35,17 @@ " 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> </div> - <div class="common-select-btn" @click="clearupClient('client')"> - <i class="el-icon-edit-outline" title="娓呴櫎"></i> + <div + v-if="editConfig.infomation.client_name && editConfig.infomation.client_name.length > 0" + class="common-select-btn" + @click="clearupClient('client')" + > + <i class="el-icon-remove-outline" title="娓呴櫎"></i> </div> </div> </el-form-item> @@ -63,21 +68,29 @@ " value-key="number" @select="handleSelectClient('serviceContract', $event)" + style="width: 100%" ></el-autocomplete> <div class="common-select-btn" @click="selClientClick('serviceContract')"> <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i> </div> - <div class="common-select-btn" @click="clearupClient('serviceContract')"> - <i class="el-icon-edit-outline" title="娓呴櫎"></i> + <div + v-if=" + editConfig.infomation.serviceContract_Number && + editConfig.infomation.serviceContract_Number.length > 0 + " + class="common-select-btn" + @click="clearupClient('serviceContract')" + > + <i class="el-icon-remove-outline" title="娓呴櫎"></i> </div> </div> </el-form-item> </el-col> <el-col v-else :span="12"> - <el-form-item label="鍚堝悓璁㈠崟"> + <el-form-item label="閿�鍞槑缁嗗崟" prop="saleDetailNumber"> <div class="custom-name"> <el-autocomplete - v-model="editConfig.infomation.number" + v-model="editConfig.infomation.saleDetailNumber" :fetch-suggestions=" (queryString, callback) => { querySearchAsync(queryString, callback, 'contract') @@ -85,12 +98,17 @@ " value-key="number" @select="handleSelectClient('contract', $event)" + style="width: 100%" ></el-autocomplete> <div class="common-select-btn" @click="selClientClick('contract')"> <i class="el-icon-circle-plus-outline" title="閫夋嫨"></i> </div> - <div class="common-select-btn" @click="clearupClient('contract')"> - <i class="el-icon-edit-outline" title="娓呴櫎"></i> + <div + v-if="editConfig.infomation.saleDetailNumber && editConfig.infomation.saleDetailNumber.length > 0" + class="common-select-btn" + @click="clearupClient('contract')" + > + <i class="el-icon-remove-outline" title="娓呴櫎"></i> </div> </div> </el-form-item> @@ -101,7 +119,7 @@ v-model="editConfig.infomation.principalId" 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> @@ -115,6 +133,7 @@ value-format="yyyy-MM-dd" type="date" placeholder="閫夋嫨鏃ユ湡" + style="width: 100%" > </el-date-picker> </el-form-item> @@ -139,7 +158,7 @@ v-model="editConfig.infomation.paymentTypeId" placeholder="璇烽�夋嫨" size="mini" - style="width: 63%" + style="width: 100%" > <el-option v-for="item in paymentTypeListOptions" @@ -157,7 +176,7 @@ v-model="editConfig.infomation.bankAccountId" placeholder="璇烽�夋嫨" size="mini" - style="width: 63%" + style="width: 100%" > <el-option v-for="item in bankAccountOptions" :key="item.id" :label="item.name" :value="item.id"> </el-option> @@ -175,7 +194,7 @@ <div class="basic-info-title">鏀舵淇℃伅</div> <div class="basic-info-view"> <el-row> - <el-col :span="24"> + <el-col :span="12"> <el-form-item label="鏈鏀舵閲戦" prop="amount"> <el-input-number v-model="editConfig.infomation.amount" @@ -183,7 +202,7 @@ :min="0" :precision="2" :controls="false" - style="width: 25%; margin-right: 5px" + style="width: 100%" ></el-input-number> </el-form-item> </el-col> @@ -335,12 +354,13 @@ }, data() { return { - dialogWidth: "80%", + dialogWidth: "50%", editConfig: this.editCommonConfig, rules: { client_name: [{ required: true, message: "璇烽�夋嫨瀹㈡埛鍚嶇О", trigger: "change" }], signTime: [{ required: true, message: "璇烽�夋嫨鏀舵鏃ユ湡", trigger: "change" }], - memberId: [{ required: true, message: "璇烽�夋嫨閿�鍞礋璐d汉", trigger: "change" }] + memberId: [{ required: true, message: "璇烽�夋嫨閿�鍞礋璐d汉", trigger: "change" }], + saleDetailNumber: [{ required: true, message: "璇烽�夋嫨閿�鍞槑缁嗗崟", trigger: "change" }] // approvalOpinion: [{ required: true, message: "璇疯緭鍏�", trigger: "blur" }] }, memberOptions: [], @@ -500,9 +520,9 @@ } }, selClient(row, value) { - if (value === "contact") { - this.editConfig.infomation.contact_name = row.name - this.contactId = row.id + if (value === "client") { + this.editConfig.infomation.client_name = row.name + this.clientId = row.id } else if (value === "serviceContract") { this.editConfig.infomation.serviceContract_Number = row.number this.serviceContractId = row.id @@ -529,52 +549,83 @@ // 璁剧疆鍏佽涓婁紶鏂囦欢鏍煎紡 setFormatClick() {}, setTableForm() { - if (this.editConfig.title === "鏂板缓") { + if (this.editConfig.title === "鏂板缓" || this.editConfig.infomation.products.length === 0) { this.tableData = [ { - id: 1, - Amount: 0, - IsSale: true, - MaterialMode: "", - MinInventory: 0, - Name: "", - Number: "", - PurchaseType: "", - SalePrice: 0, - Unit: "" + productId: this.productId, + id: 0, + amount: 0, + desc: "", + name: "", + number: "", + price: 0, + total: 0 } ] } else { this.tableData = this.editConfig.infomation.products + this.tableData.map((item, index) => { + item.productId = index + 1 + }) } this.productTableList = { tableData: this.tableData, tableColumn: [ - { label: "#", prop: "id", width: 40 }, - { label: "浜у搧鍚嶇О", prop: "Name", input: true, isRequird: true }, - { label: "浜у搧缂栧彿", prop: "Number" }, - { label: "鏁伴噺", prop: "Amount", input: true, isRequird: true }, - { label: "閿�鍞崟浠�", prop: "Unit", input: true }, - { label: "浠风◣鍚堣", prop: "total", input: true }, - { label: "鎻忚堪", prop: "other8" } + { label: "#", prop: "productId", width: 40 }, + { label: "浜у搧鍚嶇О", prop: "name", productName: true, isRequird: true }, + { label: "浜у搧缂栧彿", prop: "number" }, + { label: "鏁伴噺", prop: "amount", inputNumber: true, isRequird: true }, + { label: "閿�鍞崟浠�", prop: "price", inputFloat: true }, + { label: "浠风◣鍚堣", prop: "total", inputFloat: true } ] } + }, + // 浜у搧鍒楄〃杈撳叆 + inputContent(val, prop, row) { + this.productId = row.productId + this.tableData.map((item) => { + if (item.productId === row.productId) { + item[prop] = val + } + }) }, // 浜у搧鏂板 addProductClick() { this.productId++ this.tableData.push({ - id: this.productId, - Amount: 0, - IsSale: true, - MaterialMode: "", - MinInventory: 0, - Name: "", - Number: "", - PurchaseType: "", - SalePrice: 0, - Unit: "" + productId: this.productId, + id: 0, + amount: 0, + desc: "", + name: "", + number: "", + price: 0, + total: 0 }) + this.showSummary.show = true + }, + // 浜у搧娓呯┖ + emptyProductClick() { + this.productId = 1 + this.tableData = [ + { + productId: this.productId, + id: 0, + amount: 0, + desc: "", + name: "", + number: "", + price: 0, + total: 0 + } + ] + this.productTableList.tableData = this.tableData + }, + // 浜у搧閲嶇畻 + recalculateProductClick() {}, + clearupProduct(data) { + this.tableData = data + this.productTableList.tableData = this.tableData } } } -- Gitblit v1.8.0