From 0e1564998fce2ecea6dd73b290a31c91d8b9d2ed Mon Sep 17 00:00:00 2001 From: ryoeiken <754264374@qq.com> Date: Mon, 25 Jan 2021 15:25:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E7=A5=A8=E7=AE=A1=E7=90=86=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=89=8D=E7=AB=AF=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/fantang/invoiceReturn/index.vue | 163 +++++++++++++++++- 1 file changed, 157 insertions(+), 6 deletions(-) diff --git a/ruoyi-ui/src/views/fantang/invoiceReturn/index.vue b/ruoyi-ui/src/views/fantang/invoiceReturn/index.vue index 2b4784f49..7852fdc99 100644 --- a/ruoyi-ui/src/views/fantang/invoiceReturn/index.vue +++ b/ruoyi-ui/src/views/fantang/invoiceReturn/index.vue @@ -37,8 +37,17 @@ icon="el-icon-edit" @click="handleUpdate(scope.row)" v-hasPermi="['fantang:invoice:edit']" + v-if="returnFlag(scope.row)" >回款登记 + 查看详情 + @@ -51,7 +60,7 @@ @pagination="getList" /> - + @@ -129,13 +138,102 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -180,6 +278,8 @@ export default { title: "", // 是否显示弹出层 open: false, + // 查看详情弹出层 + viewOpen: false, // 查询参数 queryParams: { pageNum: 1, @@ -220,7 +320,6 @@ export default { this.invoiceList = response.rows; this.total = response.total; this.loading = false; - console.log(response.rows); }); }, // 取消按钮 @@ -271,6 +370,43 @@ export default { this.open = true; this.title = "添加财务收费开票"; }, + // 查看凭证图片 + handleViewPic(row) { + window.open(row.voucherUrl, '_blank') + }, + /** 查看按钮 */ + handleView(row) { + this.reset(); + const id = row.id || this.ids + getInvoice(id).then(response => { + this.form = response.data; + this.viewOpen = true; + this.title = "回款登记"; + }); + + getReturnByInvoice(id).then(response => { + this.returnManageList = response.rows.map(item => { + if (item.voucherUrl === null) { + item.isUrl = false; + return item; + } else { + item.isUrl = true; + return item; + } + }); + + if (this.returnManageList.length > 0) { + let ret = this.returnManageList.reduce((x, y) => { + y.returnPrice = x.returnPrice + y.returnPrice; + return y; + }) + this.form.receipts = ret.returnPrice; + } + }) + }, + returnFlag(row) { + return row.invoiceType === 2; + }, /** 修改按钮操作 */ handleUpdate(row) { this.reset(); @@ -279,11 +415,26 @@ export default { this.form = response.data; this.open = true; this.title = "回款登记"; - console.log(response.data) }); getReturnByInvoice(id).then(response => { - this.returnManageList = response.rows; + this.returnManageList = response.rows.map(item => { + if (item.voucherUrl === null) { + item.isUrl = false; + return item; + } else { + item.isUrl = true; + return item; + } + }); + + if (this.returnManageList.length > 0) { + let ret = this.returnManageList.reduce((x, y) => { + y.returnPrice = x.returnPrice + y.returnPrice; + return y; + }) + this.form.receipts = ret.returnPrice; + } }) }, /** 提交按钮 */