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; + } }) }, /** 提交按钮 */