From 4a63f03516cc177ad60ebbe28a65e80587846b3e Mon Sep 17 00:00:00 2001 From: yangfeng <wanwan926_4@163.com> Date: 星期四, 24 八月 2023 14:56:45 +0800 Subject: [PATCH] 新增销售退款单增加选择退货单及其他bug --- src/views/other/payment/receipt/addReceipt.vue | 87 +++++++++++++++++++++++++++++-------------- 1 files changed, 59 insertions(+), 28 deletions(-) diff --git a/src/views/other/payment/receipt/addReceipt.vue b/src/views/other/payment/receipt/addReceipt.vue index 1c58f1a..0a9203d 100644 --- a/src/views/other/payment/receipt/addReceipt.vue +++ b/src/views/other/payment/receipt/addReceipt.vue @@ -529,52 +529,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