From d9c209aecf592804ba2d119a65eddc1f73bd913c Mon Sep 17 00:00:00 2001 From: WXL <1785969728@qq.com> Date: 星期三, 28 二月 2024 15:09:03 +0800 Subject: [PATCH] 11 --- src/views/project/donorcharge/donorcharge/index.vue | 12 src/views/project/fund/performancedetails/index.vue | 89 +- src/views/project/fund/applyDetail/index.vue | 161 +++-- src/views/project/travelexpenseapply/travelexpensedetail/index.vue | 89 +- src/views/project/unitCost/particulars.vue | 914 +++++++++++++++++++++++++++++++ src/views/project/unitCost/index.vue | 463 +++++++++++++++ 6 files changed, 1,588 insertions(+), 140 deletions(-) diff --git a/src/views/project/donorcharge/donorcharge/index.vue b/src/views/project/donorcharge/donorcharge/index.vue index 993e963..8f95238 100644 --- a/src/views/project/donorcharge/donorcharge/index.vue +++ b/src/views/project/donorcharge/donorcharge/index.vue @@ -59,8 +59,10 @@ v-hasPermi="['system:donorcharge:edit']">淇敼</el-button> <el-button size="mini" type="text" icon="el-icon-edit" @click="handleDetail(scope.row)" v-hasPermi="['system:donorcharge:edit']">璇︽儏</el-button> - <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" - v-hasPermi="['system:donorcharge:remove']">鍒犻櫎</el-button> + <el-button size="mini" type="text" @click="handleDelete(scope.row)" + v-hasPermi="['system:donorcharge:remove']"><span class="button-delete" + ><i class="el-icon-delete"></i>鍒犻櫎</span + ></el-button> </template> </el-table-column> </el-table> @@ -478,3 +480,9 @@ } }; </script> +<style scoped> +/* @import url(); 寮曞叆鍏叡css绫� */ +.button-delete{ + color: rgb(236, 69, 69); +} +</style> diff --git a/src/views/project/fund/applyDetail/index.vue b/src/views/project/fund/applyDetail/index.vue index eb26d54..9880c69 100644 --- a/src/views/project/fund/applyDetail/index.vue +++ b/src/views/project/fund/applyDetail/index.vue @@ -1034,7 +1034,7 @@ type="border-card" @tab-click="handleClick" > - <el-tab-pane label="鏅�氶檮浠�" :name="1"> + <el-tab-pane label="鏅�氶檮浠�" name="common"> <div class="pdfimg"> <div class="box-pdf"> <div> @@ -1095,7 +1095,7 @@ > <template slot-scope="scope"> <el-button - type="primary" + type="danger" size="mini" @click.native.prevent.stop="deletedowfile(scope.row)" >鍒犻櫎</el-button @@ -1139,7 +1139,7 @@ <div v-else class="pdfimgmins">{{ hintitle }}</div> </div> </el-tab-pane> - <el-tab-pane label="鍙戠エ鏂囦欢" :name="2"> + <el-tab-pane label="鍙戠エ鏂囦欢" name="invoice"> <div class="pdfimg"> <div class="box-pdf"> <div> @@ -1656,7 +1656,7 @@ invoicepdfimg: "", invoicepdfimgsrcList: [], invoDatatop: [], - activeName: 1, //鏂囦欢绫诲瀷 + activeName: "common", //鏂囦欢绫诲瀷 //涓婁紶闄勪欢璺緞 uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", ICDtoken: getToken(), @@ -3162,7 +3162,7 @@ handleUploadError() {}, remove(file, fileList) { const rbDetails = [...this.rbDetails]; - if (this.activeName == 1) { + if (this.activeName == "common") { this.fileListto.splice(this.fileListto.indexOf(file), 1); rbDetails[this.atpresent].annexfilesList = this.fileListto; } else { @@ -3178,7 +3178,7 @@ }; const pdfimg = this.Networkheader + "/prod-api" + response.fileName; //鑾峰彇绁ㄦ嵁淇℃伅浣嶇疆 - if (this.activeName == 1) { + if (this.activeName == "common") { if (response.code == 200) { this.previewpdf = true; @@ -3262,29 +3262,54 @@ this.tableDatatop.push(row); this.atpresent = index; this.pdfVisible = true; - console.log(this.fileListto, "this.fileListto"); - console.log(this.invoicefileListto, "this.invoicefileListto"); + if (this.rbDetails[index].annexfilesList) { - this.rbDetails[index].annexfilesList.forEach((value, indexson) => { - const pdfimg = this.Networkheader + "/prod-api" + value.url; - fetch(pdfimg, config) - .then(response => response.blob()) - .then(blob => { - // 灏嗚幏鍙栫殑鏁版嵁娴佽浆鎹负URL - this.fileListto.push({ - name: value.name, - url: URL.createObjectURL(blob) + // this.rbDetails[index].annexfilesList.forEach((value, indexson) => { + // const pdfimg = this.Networkheader + "/prod-api" + value.url; + // fetch(pdfimg, config) + // .then(response => response.blob()) + // .then(blob => { + // // 灏嗚幏鍙栫殑鏁版嵁娴佽浆鎹负URL + // this.fileListto.push({ + // name: value.name, + // url: URL.createObjectURL(blob) + // }); + // if (this.fileListto.length == 1) { + // this.pdfimg = URL.createObjectURL(blob); + // } + // this.pdfimgsrcList.push(URL.createObjectURL(blob)); + // }) + // .catch(error => { + // console.error("Error loading image", error); + // return; + // }); + // }); + + const fetchPromises = this.rbDetails[index].annexfilesList.map( + (value, indexson) => { + const pdfimg = this.Networkheader + "/prod-api" + value.url; + return fetch(pdfimg, config) + .then(response => response.blob()) + .then(blob => { + return { + name: value.name, + url: URL.createObjectURL(blob) + }; + }) + .catch(error => { + console.error("Error loading image", error); + return null; }); - if (this.fileListto.length == 1) { - this.pdfimg = URL.createObjectURL(blob); - } - this.pdfimgsrcList.push(URL.createObjectURL(blob)); - }) - .catch(error => { - console.error("Error loading image", error); - return; - }); + } + ); + + Promise.all(fetchPromises).then(fileListto => { + this.fileListto = fileListto.filter(item => item !== null); + this.pdfimg = this.fileListto[0].url; + console.log(this.pdfimg, "pdfimg"); + this.pdfimgsrcList = this.fileListto.map(item => item.url); }); + this.previewpdf = true; } else { this.fileListto = []; @@ -3293,26 +3318,31 @@ } //鍙戠エ if (this.rbDetails[index].invoicefilesList) { - this.rbDetails[index].invoicefilesList.forEach((value, indexson) => { - const pdfimg = this.Networkheader + "/prod-api" + value.url; - fetch(pdfimg, config) - .then(response => response.blob()) - .then(blob => { - // 灏嗚幏鍙栫殑鏁版嵁娴佽浆鎹负URL - this.invoicefileListto.push({ - name: value.name, - url: URL.createObjectURL(blob) + const fetchPromises = this.rbDetails[index].invoicefilesList.map( + (value, indexson) => { + const pdfimg = this.Networkheader + "/prod-api" + value.url; + return fetch(pdfimg, config) + .then(response => response.blob()) + .then(blob => { + return { + name: value.name, + url: URL.createObjectURL(blob) + }; + }) + .catch(error => { + console.error("Error loading image", error); + return null; }); - if (this.invoicefileListto.length == 1) { - this.invoicepdfimg = URL.createObjectURL(blob); - } - this.invoicepdfimgsrcList.push(URL.createObjectURL(blob)); - }) - .catch(error => { - console.error("Error loading image", error); - return; - }); + } + ); + + Promise.all(fetchPromises).then(invoicefileListto => { + this.invoicefileListto = invoicefileListto.filter(item => item !== null); + this.invoicepdfimg = this.invoicefileListto[0].url; + console.log(this.invoicepdfimg, "invoicepdfimg"); + this.invoicepdfimgsrcList = this.invoicefileListto.map(item => item.url); }); + this.previewpdf = true; } else { this.invoicefileListto = []; @@ -3320,16 +3350,18 @@ this.pdftitle = ""; } - if (this.activeName == 1) { + if (this.activeName == "common") { this.pdftitle = "鍏�" + this.pdfimgsrcList.length + "椤�"; } else { this.pdftitle = "鍏�" + this.invoicepdfimgsrcList.length + "椤�"; } + console.log(this.fileListto, "this.fileListto"); + console.log(this.rbDetails[index].annexfilesList, "annexfilesList"); }, // 鐐瑰嚮宸蹭笂浼犳枃浠� downFile(item) { - if (this.activeName == 1) { + if (this.activeName == "common") { this.pdftitle = "鍏�" + this.pdfimgsrcList.length + "椤癸紝褰撳墠閫変腑" + item.name; let name = item.name.split("."); @@ -3377,7 +3409,7 @@ }, // 鍙戠エ鍒囨崲 handleClick(tab, event) { - if (this.activeName == 1) { + if (this.activeName == "common") { this.pdftitle = "鍏�" + this.pdfimgsrcList.length + "椤�"; } else { this.pdftitle = "鍏�" + this.invoicepdfimgsrcList.length + "椤�"; @@ -3387,16 +3419,14 @@ deletedowfile(row) { console.log(row); let indexvalue = ""; - if (this.activeName == 1) { + if (this.activeName == "common") { const indexlist = this.getIndexInArray(this.pdfimgsrcList, row.url); this.pdfimgsrcList.splice(indexlist, 1); const index = this.getIndexInArray(this.fileListto, row); this.fileListto.splice(index, 1); console.log(this.rbDetails[this.atpresent].annexfilesList); - indexvalue = this.rbDetails[this.atpresent].annexfilesList.find( - (item, index) => { - return item.name == row.name; - } + indexvalue = this.rbDetails[this.atpresent].annexfilesList.findIndex( + item => item.name == row.name ); console.log(indexvalue, "鍒犻櫎绱㈠紩"); this.rbDetails[this.atpresent].annexfilesList.splice(indexvalue, 1); @@ -3409,10 +3439,8 @@ const index = this.getIndexInArray(this.invoicefileListto, row); this.invoicefileListto.splice(index, 1); console.log(this.rbDetails[this.atpresent].invoicefilesList); - indexvalue = this.rbDetails[this.atpresent].invoicefilesList.find( - (item, index) => { - return item.name == row.name; - } + indexvalue = this.rbDetails[this.atpresent].invoicefilesList.findIndex( + item => item.name == row.name ); console.log(indexvalue, "鍒犻櫎绱㈠紩"); this.rbDetails[this.atpresent].invoicefilesList.splice(indexvalue, 1); @@ -3420,11 +3448,14 @@ }, // 鐐瑰嚮涓婄Щ moveupdowfile(row) { - if (this.activeName == 1) { - const index = this.getIndexInArray(this.fileListto, row); + if (this.activeName == "common") { + const index = this.fileListto.findIndex(item => item.name == row.name); const item = this.fileListto.splice(index, 1)[0]; // 绉婚櫎鎸囧畾绱㈠紩澶勭殑鍏冪礌锛屽苟淇濆瓨鍒癷tem鍙橀噺涓� this.fileListto.splice(index - 1, 0, item); // 灏唅tem鎻掑叆鍒扮储寮曚綅缃殑鍓嶄竴浣� - const indexann = this.rbDetails[this.atpresent].annexfilesList.findIndex(item => item.name == row.name); + + const indexann = this.rbDetails[ + this.atpresent + ].annexfilesList.findIndex(item => item.name == row.name); const itemann = this.rbDetails[this.atpresent].annexfilesList.splice( indexann, 1 @@ -3434,13 +3465,19 @@ 0, itemann ); // 灏唅temann鎻掑叆鍒扮储寮曚綅缃殑鍓嶄竴浣� - + console.log(indexann, "indexann"); + console.log(index, "index"); } else { - const index = this.getIndexInArray(this.invoicefileListto, row); + const index = this.invoicefileListto.findIndex( + item => item.name == row.name + ); + const item = this.invoicefileListto.splice(index, 1)[0]; // 绉婚櫎鎸囧畾绱㈠紩澶勭殑鍏冪礌锛屽苟淇濆瓨鍒癷tem鍙橀噺涓� this.invoicefileListto.splice(index - 1, 0, item); // 灏唅tem鎻掑叆鍒扮储寮曚綅缃殑鍓嶄竴浣� - const indexinvo = this.rbDetails[this.atpresent].invoicefilesList.findIndex(item => item.name == row.name); + const indexinvo = this.rbDetails[ + this.atpresent + ].invoicefilesList.findIndex(item => item.name == row.name); const iteminvo = this.rbDetails[this.atpresent].invoicefilesList.splice( indexinvo, 1 diff --git a/src/views/project/fund/performancedetails/index.vue b/src/views/project/fund/performancedetails/index.vue index f00fb88..1a26ee2 100644 --- a/src/views/project/fund/performancedetails/index.vue +++ b/src/views/project/fund/performancedetails/index.vue @@ -2516,7 +2516,7 @@ this.tableDatatop = []; this.fileListto = []; this.invoicefileListto = []; - this.pdfimg = ''; + this.pdfimg = ""; this.invoicepdfimg = []; this.pdfimgsrcList = []; this.invoicepdfimgsrcList = []; @@ -2525,26 +2525,32 @@ this.pdfVisible = true; if (this.rbDetails[index].annexfilesList) { - this.rbDetails[index].annexfilesList.forEach((value, indexson) => { - const pdfimg = this.Networkheader + "/prod-api" + value.url; - fetch(pdfimg, config) - .then(response => response.blob()) - .then(blob => { - // 灏嗚幏鍙栫殑鏁版嵁娴佽浆鎹负URL - this.fileListto.push({ - name: value.name, - url: URL.createObjectURL(blob) + + const fetchPromises = this.rbDetails[index].annexfilesList.map( + (value, indexson) => { + const pdfimg = this.Networkheader + "/prod-api" + value.url; + return fetch(pdfimg, config) + .then(response => response.blob()) + .then(blob => { + return { + name: value.name, + url: URL.createObjectURL(blob) + }; + }) + .catch(error => { + console.error("Error loading image", error); + return null; }); - if (this.fileListto.length == 1) { - this.pdfimg = URL.createObjectURL(blob); - } - this.pdfimgsrcList.push(URL.createObjectURL(blob)); - }) - .catch(error => { - console.error("Error loading image", error); - return; - }); + } + ); + + Promise.all(fetchPromises).then(fileListto => { + this.fileListto = fileListto.filter(item => item !== null); + this.pdfimg = this.fileListto[0].url; + console.log(this.pdfimg, "pdfimg"); + this.pdfimgsrcList = this.fileListto.map(item => item.url); }); + this.previewpdf = true; } else { this.fileListto = []; @@ -2553,26 +2559,31 @@ } //鍙戠エ if (this.rbDetails[index].invoicefilesList) { - this.rbDetails[index].invoicefilesList.forEach((value, indexson) => { - const pdfimg = this.Networkheader + "/prod-api" + value.url; - fetch(pdfimg, config) - .then(response => response.blob()) - .then(blob => { - // 灏嗚幏鍙栫殑鏁版嵁娴佽浆鎹负URL - this.invoicefileListto.push({ - name: value.name, - url: URL.createObjectURL(blob) + const fetchPromises = this.rbDetails[index].invoicefilesList.map( + (value, indexson) => { + const pdfimg = this.Networkheader + "/prod-api" + value.url; + return fetch(pdfimg, config) + .then(response => response.blob()) + .then(blob => { + return { + name: value.name, + url: URL.createObjectURL(blob) + }; + }) + .catch(error => { + console.error("Error loading image", error); + return null; }); - if (this.invoicefileListto.length == 1) { - this.invoicepdfimg = URL.createObjectURL(blob); - } - this.invoicepdfimgsrcList.push(URL.createObjectURL(blob)); - }) - .catch(error => { - console.error("Error loading image", error); - return; - }); + } + ); + + Promise.all(fetchPromises).then(invoicefileListto => { + this.invoicefileListto = invoicefileListto.filter(item => item !== null); + this.invoicepdfimg = this.invoicefileListto[0].url; + console.log(this.invoicepdfimg, "invoicepdfimg"); + this.invoicepdfimgsrcList = this.invoicefileListto.map(item => item.url); }); + this.previewpdf = true; } else { this.invoicefileListto = []; @@ -2580,11 +2591,13 @@ this.pdftitle = ""; } - if (this.activeName == 1) { + if (this.activeName == "common") { this.pdftitle = "鍏�" + this.pdfimgsrcList.length + "椤�"; } else { this.pdftitle = "鍏�" + this.invoicepdfimgsrcList.length + "椤�"; } + console.log(this.fileListto, "this.fileListto"); + console.log(this.rbDetails[index].annexfilesList, "annexfilesList"); }, // 鐐瑰嚮宸蹭笂浼犳枃浠� diff --git a/src/views/project/travelexpenseapply/travelexpensedetail/index.vue b/src/views/project/travelexpenseapply/travelexpensedetail/index.vue index ead57ef..f1e7bbd 100644 --- a/src/views/project/travelexpenseapply/travelexpensedetail/index.vue +++ b/src/views/project/travelexpenseapply/travelexpensedetail/index.vue @@ -1636,7 +1636,7 @@ this.tableDatatop = []; this.fileListto = []; this.invoicefileListto = []; - this.pdfimg = []; + this.pdfimg = ""; this.invoicepdfimg = []; this.pdfimgsrcList = []; this.invoicepdfimgsrcList = []; @@ -1645,26 +1645,32 @@ this.pdfVisible = true; if (this.rbDetails[index].annexfilesList) { - this.rbDetails[index].annexfilesList.forEach((value, indexson) => { - const pdfimg = this.Networkheader + "/prod-api" + value.url; - fetch(pdfimg, config) - .then(response => response.blob()) - .then(blob => { - // 灏嗚幏鍙栫殑鏁版嵁娴佽浆鎹负URL - this.fileListto.push({ - name: value.name, - url: URL.createObjectURL(blob) + + const fetchPromises = this.rbDetails[index].annexfilesList.map( + (value, indexson) => { + const pdfimg = this.Networkheader + "/prod-api" + value.url; + return fetch(pdfimg, config) + .then(response => response.blob()) + .then(blob => { + return { + name: value.name, + url: URL.createObjectURL(blob) + }; + }) + .catch(error => { + console.error("Error loading image", error); + return null; }); - if (this.fileListto.length == 1) { - this.pdfimg = URL.createObjectURL(blob); - } - this.pdfimgsrcList.push(URL.createObjectURL(blob)); - }) - .catch(error => { - console.error("Error loading image", error); - return; - }); + } + ); + + Promise.all(fetchPromises).then(fileListto => { + this.fileListto = fileListto.filter(item => item !== null); + this.pdfimg = this.fileListto[0].url; + console.log(this.pdfimg, "pdfimg"); + this.pdfimgsrcList = this.fileListto.map(item => item.url); }); + this.previewpdf = true; } else { this.fileListto = []; @@ -1673,26 +1679,31 @@ } //鍙戠エ if (this.rbDetails[index].invoicefilesList) { - this.rbDetails[index].invoicefilesList.forEach((value, indexson) => { - const pdfimg = this.Networkheader + "/prod-api" + value.url; - fetch(pdfimg, config) - .then(response => response.blob()) - .then(blob => { - // 灏嗚幏鍙栫殑鏁版嵁娴佽浆鎹负URL - this.invoicefileListto.push({ - name: value.name, - url: URL.createObjectURL(blob) + const fetchPromises = this.rbDetails[index].invoicefilesList.map( + (value, indexson) => { + const pdfimg = this.Networkheader + "/prod-api" + value.url; + return fetch(pdfimg, config) + .then(response => response.blob()) + .then(blob => { + return { + name: value.name, + url: URL.createObjectURL(blob) + }; + }) + .catch(error => { + console.error("Error loading image", error); + return null; }); - if (this.invoicefileListto.length == 1) { - this.invoicepdfimg = URL.createObjectURL(blob); - } - this.invoicepdfimgsrcList.push(URL.createObjectURL(blob)); - }) - .catch(error => { - console.error("Error loading image", error); - return; - }); + } + ); + + Promise.all(fetchPromises).then(invoicefileListto => { + this.invoicefileListto = invoicefileListto.filter(item => item !== null); + this.invoicepdfimg = this.invoicefileListto[0].url; + console.log(this.invoicepdfimg, "invoicepdfimg"); + this.invoicepdfimgsrcList = this.invoicefileListto.map(item => item.url); }); + this.previewpdf = true; } else { this.invoicefileListto = []; @@ -1700,11 +1711,13 @@ this.pdftitle = ""; } - if (this.activeName == 1) { + if (this.activeName == "common") { this.pdftitle = "鍏�" + this.pdfimgsrcList.length + "椤�"; } else { this.pdftitle = "鍏�" + this.invoicepdfimgsrcList.length + "椤�"; } + console.log(this.fileListto, "this.fileListto"); + console.log(this.rbDetails[index].annexfilesList, "annexfilesList"); }, // 鐐瑰嚮宸蹭笂浼犳枃浠� diff --git a/src/views/project/unitCost/index.vue b/src/views/project/unitCost/index.vue new file mode 100644 index 0000000..4483273 --- /dev/null +++ b/src/views/project/unitCost/index.vue @@ -0,0 +1,463 @@ +<template> + <div class="app-container"> + <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="120px"> + <el-form-item label="浠樻鍖婚櫌" prop="name"> + <el-input v-model="queryParams.name" placeholder="璇疯緭鍏ュ鍚�" clearable size="small" + @keyup.enter.native="handleQuery" /> + </el-form-item> + <el-form-item label="鏀舵骞村害" prop="donationcategory"> + <el-input v-model="queryParams.donationcategory" placeholder="璇疯緭鍏ユ崘鐚被鍒�" clearable size="small" + @keyup.enter.native="handleQuery" /> + </el-form-item> + <el-form-item label="鏀舵鐘舵��" prop="chargeamount"> + <el-input v-model="queryParams.chargeamount" placeholder="璇疯緭鍏ヨ垂鐢ㄩ噾棰�" clearable size="small" + @keyup.enter.native="handleQuery" /> + </el-form-item> + <el-form-item> + <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">鎼滅储</el-button> + <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">閲嶇疆</el-button> + </el-form-item> + </el-form> + + <el-row :gutter="10" class="mb8"> + <el-col :span="1.5"> + <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd" + v-hasPermi="['system:donorcharge:add']">鏂板</el-button> + </el-col> + <el-col :span="1.5"> + <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate" + v-hasPermi="['system:donorcharge:edit']">淇敼</el-button> + </el-col> + <el-col :span="1.5"> + <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple" @click="handleDelete" + v-hasPermi="['system:donorcharge:remove']">鍒犻櫎</el-button> + </el-col> + + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> + </el-row> + + <el-table v-loading="loading" :data="donorchargeList" @selection-change="handleSelectionChange"> + <el-table-column type="selection" width="55" align="center" /> + <el-table-column label="鐢宠鏃堕棿" align="center" prop="donatetime" width="180"> + <template slot-scope="scope"> + <span>{{ parseTime(scope.row.donatetime, '{y}-{m}-{d}') }}</span> + </template> + </el-table-column> + <el-table-column label="鏀舵鍗曞彿" align="center" prop="donateno" /> + <el-table-column label="浠樻鍖婚櫌" align="center" prop="name" /> + <el-table-column label="鏀舵鐘舵��" align="center" prop="donationcategory" /> + <el-table-column label="搴旀敹閲戦" align="center" prop="donateorgan" /> + <el-table-column label="宸叉敹閲戦" align="center" prop="chargeamounted" /> + <el-table-column label="鏀舵鏃ユ湡" align="center" prop="chargeamount" /> + <el-table-column label="缁忓姙浜�" align="center" prop="agent" /> + <el-table-column label="鎿嶄綔" align="center"> + <template slot-scope="scope"> + <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" + v-hasPermi="['system:donorcharge:edit']">淇敼</el-button> + <el-button size="mini" type="text" icon="el-icon-edit" @click="handleDetail(scope.row)" + v-hasPermi="['system:donorcharge:edit']">璇︽儏</el-button> + <el-button size="mini" type="text" @click="handleDelete(scope.row)" + v-hasPermi="['system:donorcharge:remove']"><span class="button-delete" + ><i class="el-icon-delete"></i>鍒犻櫎</span + ></el-button> + </template> + </el-table-column> + </el-table> + + <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" + @pagination="getList" /> + + <!-- 娣诲姞鎴栦慨鏀规崘鐚渚嬪櫒瀹樺垪瀵硅瘽妗� --> + <el-dialog :title="title" :visible.sync="open" append-to-body align="center" :close-on-click-modal="false" + width="1200px"> + <el-form ref="form" :model="form" :rules="rules" label-width="100px"> + <el-row> + <el-col :span="12"><el-form-item label="OPO缂栧彿" prop="donateno"> + <el-input v-model="form.donateno" placeholder="璇疯緭鍏PO缂栧彿" /> + </el-form-item> + </el-col> + <el-col :span="6"> + <el-form-item label="濮撳悕" prop="name"> + <el-input v-model="form.name" placeholder="璇疯緭鍏ュ鍚�" /> + </el-form-item> + </el-col> + <el-col :span="6"> + <el-form-item label="鎹愮尞鏃堕棿" prop="donatetime"> + <el-date-picker clearable size="small" v-model="form.donatetime" type="date" value-format="yyyy-MM-dd" + style="width: 174px" placeholder="閫夋嫨鎹愮尞鏃堕棿"> + </el-date-picker> + </el-form-item> + </el-col> + </el-row> + <el-row> + <el-col :span="6"><el-form-item label="鍑虹敓骞存湀" prop="borthdate"> + <el-date-picker clearable size="small" v-model="form.borthdate" type="date" value-format="yyyy-MM-dd" + style="width: 174px" placeholder="閫夋嫨鍑虹敓骞存湀"> + </el-date-picker> + </el-form-item></el-col> + <el-col :span="6"><el-form-item label="骞撮緞" prop="age"> + <el-input v-model="form.age" placeholder="璇疯緭鍏ュ勾榫�" /> + </el-form-item></el-col> + <el-col :span="6"> <el-form-item label="鎬у埆" prop="sex"> + <el-select v-model="form.sex" placeholder="璇烽�夋嫨鎬у埆"> + <el-option label="璇烽�夋嫨瀛楀吀鐢熸垚" value="" /> + </el-select> + </el-form-item></el-col> + <el-col :span="6"><el-form-item label="鎹愮尞绫诲埆" prop="donationcategory"> + <el-input v-model="form.donationcategory" placeholder="璇疯緭鍏ユ崘鐚被鍒�" /> + </el-form-item></el-col> + </el-row> + <el-row> + <el-col :span="6"><el-form-item label="鎹愮尞妗堜緥ID" prop="infoid"> + <el-input v-model="form.infoid" placeholder="璇疯緭鍏ユ崘鐚渚婭D" /> + </el-form-item></el-col> + <el-col :span="6"><el-form-item label="鎹愮尞鍣ㄥ畼" prop="donateorgan"> + <el-input v-model="form.donateorgan" placeholder="璇疯緭鍏ユ崘鐚殑鍣ㄥ畼" /> + </el-form-item></el-col> + <el-col :span="6"><el-form-item label="搴旀敹璐圭敤" prop="chargeamount"> + <el-input v-model="form.chargeamount" placeholder="璇疯緭鍏ュ簲鏀惰垂鐢�" /> + </el-form-item></el-col> + <el-col :span="6"><el-form-item label="宸叉敹璐圭敤" prop="chargeamounted"> + <el-input v-model="form.chargeamounted" placeholder="璇疯緭鍏ュ凡鏀惰垂鐢�" /> + </el-form-item></el-col> + </el-row><el-row> + <el-col :span="24"><el-form-item label="澶囨敞" prop="remark"> + <el-input v-model="form.remark" placeholder="璇疯緭鍏ュ娉�" /> + </el-form-item></el-col> + </el-row> + <el-row> + <el-table :data="donorchargerogans" v-loading="loading" max-height="1200" border highlight-current-row> + <el-table-column prop="orderno" align="center" label="搴忓彿" width="80"> + <template slot-scope="scope"> + <el-input v-model="scope.row.orderno" placeholder="搴忓彿" /> + </template> + </el-table-column> + <el-table-column prop="organno" align="center" label="鍣ㄥ畼缂栧彿" width="90"> + <template slot-scope="scope"> + <el-input v-model="scope.row.organno" placeholder="鍣ㄥ畼缂栧彿" /> + </template> + </el-table-column> + <el-table-column prop="organname" align="center" label="鍣ㄥ畼鍚嶇О" width="100"> + <template slot-scope="scope"> + <el-input v-model="scope.row.organname" placeholder="鍣ㄥ畼鍚嶇О" /> + </template> + </el-table-column> + <el-table-column prop="hospitalname" align="center" label="鎺ユ敹鍖婚櫌" width="200"> + <template slot-scope="scope"> + <el-input v-model="scope.row.hospitalname" placeholder="鎺ユ敹鍖婚櫌" /> + </template> + </el-table-column> + <el-table-column prop="amounttime" align="center" label="鎺ユ敹鏃堕棿" width="120"> + <template slot-scope="scope"> + <el-date-picker clearable size="small" style="width: 100%" v-model="scope.row.amounttime" type="date" + value-format="yyyy-MM-dd HH:mm:ss" placeholder="鎺ユ敹鏃堕棿"> + </el-date-picker> </template> + </el-table-column> + <el-table-column prop="amount" align="center" label="宸叉敹璐圭敤" width="120"> + <template slot-scope="scope"> + <el-input v-model="scope.row.amount" placeholder="宸叉敹璐圭敤" /> + </template> + </el-table-column> + <el-table-column prop="amounttime" align="center" label="鏀舵鏃堕棿" width="120"> + <template slot-scope="scope"> + <el-date-picker clearable size="small" style="width: 100%" v-model="scope.row.amounttime" type="date" + value-format="yyyy-MM-dd HH:mm:ss" placeholder="鏀舵鏃堕棿" @blur="getdays(scope.row)"> + </el-date-picker> </template> + </el-table-column> + <el-table-column prop="organcharge" align="center" label="鏍囧噯璐圭敤" width="120"> + <template slot-scope="scope"> + <el-input v-model="scope.row.organcharge" placeholder="宸叉敹璐圭敤" /> + </template> + </el-table-column> + <el-table-column prop="remark" align="center" label="澶囨敞"> + <template slot-scope="scope"> + <el-input v-model="scope.row.remark" placeholder="澶囨敞" /> + </template> + </el-table-column> + </el-table> + </el-row> + </el-form> + <div slot="footer" class="dialog-footer"> + <el-button type="primary" @click="submitForm">纭� 瀹�</el-button> + <el-button @click="cancel">鍙� 娑�</el-button> + </div> + </el-dialog> + + <el-dialog :visible.sync="showSelectionDialog" :close-on-click-modal="false" :title="'璇烽�夋嫨鎹愮尞妗堜緥'" width="500px" + style="text-align: center" v-loading="loading"> + <el-form ref="selectionForm" :model="selectionForm"> + <el-row> + <el-form-item label="鎹愮尞鑰呭悕瀛楋細" prop="donorname" label-width="120px"> + <el-select v-model="selectionForm.donorid" filterable reserve-keyword default-first-option + placeholder="璇疯緭鍏ユ崘鐚�呯殑濮撳悕" style="width: 100%"> + <el-option v-for="item in donorlist" :key="item.donorid" :label="item.donorname" :value="item.donorid"> + </el-option> + </el-select> + </el-form-item> + </el-row> + </el-form> + <span slot="footer" class="dialog-footer"> + <el-button @click="showSelectionDialog = false">鍙� 娑�</el-button> + <el-button type="primary" @click="confirmSelection()">纭� 瀹�</el-button> + </span> + </el-dialog> + </div> + </template> + + <script> + import { listDonatebaseinfo } from "@/api/project/donatebaseinfo"; + import { listDonorcharge, getDonorcharge, delDonorcharge, addDonorcharge, updateDonorcharge, exportDonorcharge, listDonorchargeorgan, delDonorchargeorgan, addDonorchargeorgan, updateDonorchargeorgan, exportDonorchargeorgan } from "@/api/project/donorcharge"; + export default { + name: "Donorcharge", + data() { + return { + // 閬僵灞� + loading: true, + // 瀵煎嚭閬僵灞� + exportLoading: false, + // 閫変腑鏁扮粍 + ids: [], + // 闈炲崟涓鐢� + single: true, + // 闈炲涓鐢� + multiple: true, + // 鏄剧ず鎼滅储鏉′欢 + showSearch: true, + // 鎬绘潯鏁� + total: 0, + //褰撳墠妗堜緥id + curInfoId: 0, + // 鎹愮尞妗堜緥鍣ㄥ畼鍒楄〃鏍兼暟鎹� + donorchargeList: [], + donorchargerogans: [], + //鎹愮尞妗堜緥閫夋嫨 + showSelectionDialog: false, + donorlist: [], + donorinfolist: [], + selectionForm: { + index: null, + donorid: null, + donorname: null + }, + loadingdonorlist: false, + + // 寮瑰嚭灞傛爣棰� + title: "", + // 鏄惁鏄剧ず寮瑰嚭灞� + open: false, + // 鏌ヨ璐圭敤琛ㄥ弬鏁� + queryParams: { + pageNum: 1, + pageSize: 10, + infoid: null, + name: null, + donationcategory: null, + donateorgan: null, + chargeamounted: null, + }, + //鏌ヨ妗堜緥鍙傛暟 + donorParams: { + pageNum: 1, + pageSize: 1000, + }, + // 鏌ヨ璐圭敤鍣ㄥ畼琛ㄥ弬鏁� + organParams: { + pageNum: 1, + pageSize: 10, + donorchargeid: null, + }, + // 琛ㄥ崟鍙傛暟 + form: {}, + // 琛ㄥ崟鏍¢獙 + rules: { + } + }; + }, + created() { + this.getList(); + }, + + methods: { + //涓撳/鍖荤枟鏈烘瀯/璐圭敤鎶ラ攢鏈烘瀯閫夋嫨 + confirmSelection() { + var curdonorinfo = null; + //浠庢渚嬪垪琛ㄨ幏鍙栦俊鎭� + this.donorinfolist.map(item => { + if (this.selectionForm.donorid == item.id) { + curdonorinfo = item; + } + }); + this.showSelectionDialog = false; + this.$router.push({ + path: "/cost/particulars", + query: { id: 0, operation: "add", data: curdonorinfo } + }); + }, + + /** 鏌ヨ鎹愮尞妗堜緥鍣ㄥ畼鍒楀垪琛� */ + getList() { + this.loading = true; + listDonorcharge(this.queryParams).then(response => { + this.donorchargeList = response.rows; + this.total = response.total; + this.loading = false; + }); + }, + + // 鍙栨秷鎸夐挳 + cancel() { + this.open = false; + this.reset(); + }, + // 琛ㄥ崟閲嶇疆 + reset() { + this.form = { + id: null, + infoid: null, + donateno: null, + donatetime: null, + name: null, + borthdate: null, + sex: null, + age: null, + donationcategory: null, + donateorgan: null, + chargeamount: null, + chargeamounted: null, + remark: null, + delFlag: null, + createBy: null, + createTime: null, + updateBy: null, + updateTime: null + }; + this.resetForm("form"); + }, + /** 鎼滅储鎸夐挳鎿嶄綔 */ + handleQuery() { + this.queryParams.pageNum = 1; + this.getList(); + }, + /** 閲嶇疆鎸夐挳鎿嶄綔 */ + resetQuery() { + this.resetForm("queryForm"); + this.handleQuery(); + }, + // 澶氶�夋閫変腑鏁版嵁 + handleSelectionChange(selection) { + this.ids = selection.map(item => item.id) + this.single = selection.length !== 1 + this.multiple = !selection.length + }, + /** 鏂板鎸夐挳鎿嶄綔 */ + handleAdd() { + this.selectionForm.index = null; + this.selectionForm.donorid = null; + this.selectionForm.donorname = null; + + if (this.donorlist[0]) { + this.showSelectionDialog = true; + } + else { + //鑾峰彇鎹愮尞妗堜緥鍒楄〃 + if (this.donorlist.length > 0) { } + else { + this.loading = true; + listDonatebaseinfo(this.donorParams).then(res => { + // this.donorinfolist = res.rows; + res.rows.forEach(item => { + if (item.workflow >= 6) { + this.donorinfolist.push(item); + } + }); + + this.donorinfolist.forEach(item1 => { + this.donorlist.push({ + donorid: item1.id, + donorname: item1.name + }); + }); + console.log(this.donorinfolist,' this.donorinfolist'); + this.loading = false; + }); + } + + this.showSelectionDialog = true; + }; + + /** + this.reset(); + this.open = true; + this.title = "鎹愮尞妗堜緥鍣ㄥ畼璐圭敤鎯呭喌"; + this.donorchargerogans = []; + */ + }, + + /** 淇敼鎸夐挳鎿嶄綔 */ + handleUpdate(row) { + this.$router.push({ + path: "/cost/particulars", + query: { id: row.id, operation: "update", data: row } + }); + }, + + /** 璇︽儏鏌ョ湅鎸夐挳鎿嶄綔 */ + handleDetail(row) { + this.$router.push({ + path: "/cost/particulars", + query: { id: row.id, operation: "detail", data: row } + }); + }, + + /** 鍒犻櫎鎸夐挳鎿嶄綔 */ + handleDelete(row) { + const ids = row.id || this.ids; + this.$modal.confirm('鏄惁纭鍒犻櫎鎹愮尞妗堜緥鍣ㄥ畼鍒楃紪鍙蜂负"' + ids + '"鐨勬暟鎹」锛�').then(function () { + return delDonorcharge(ids); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }).catch(() => { }); + }, + + /** 瀵煎嚭鎸夐挳鎿嶄綔 */ + handleExport() { + const queryParams = this.queryParams; + this.$modal.confirm('鏄惁纭瀵煎嚭鎵�鏈夋崘鐚渚嬪櫒瀹樺垪鏁版嵁椤癸紵').then(() => { + this.exportLoading = true; + return exportDonorcharge(queryParams); + }).then(response => { + this.$download.name(response.msg); + this.exportLoading = false; + }).catch(() => { }); + }, + + /** 鎻愪氦鎸夐挳 */ + submitForm() { + this.$refs["form"].validate(valid => { + if (valid) { + if (this.form.id != null) { + updateDonorcharge(this.form).then(response => { + this.$modal.msgSuccess("淇敼鎴愬姛"); + this.open = false; + this.getList(); + }); + } else { + addDonorcharge(this.form).then(response => { + this.$modal.msgSuccess("鏂板鎴愬姛"); + this.open = false; + this.getList(); + }); + } + } + }); + }, + } + }; + </script> + <style scoped> + /* @import url(); 寮曞叆鍏叡css绫� */ + .button-delete{ + color: rgb(236, 69, 69); + } + </style> \ No newline at end of file diff --git a/src/views/project/unitCost/particulars.vue b/src/views/project/unitCost/particulars.vue new file mode 100644 index 0000000..6fe7a3c --- /dev/null +++ b/src/views/project/unitCost/particulars.vue @@ -0,0 +1,914 @@ +<template> + <div class="Modifydetailscla"> + <div class="boxdiv"> + <div class="top-text">{{ title }}</div> + <el-form ref="form" :model="form" :rules="rules" label-width="120px"> + <el-row> + <el-col :span="5"> + <el-form-item label="缁忓姙浜�" prop="name"> + <el-input + v-model="form.name" + placeholder="璇疯緭鍏ュ鍚�" + :disabled="true" + /> + </el-form-item> + </el-col> + <el-col :span="7"> + <el-form-item label="鏀舵鐘舵��" prop="sex"> + <el-select v-model="form.sex" placeholder="璇疯緭鍏ユ�у埆"> + <el-option + v-for="dict in dict.type.sys_user_sex" + :key="dict.label" + :label="dict.label" + :value="parseInt(dict.value)" + ></el-option> + </el-select> + </el-form-item> + </el-col> + + <el-col :span="5"> + <el-form-item label="鐢宠鏃ユ湡" prop="borthdate"> + <el-date-picker + clearable + size="small" + v-model="form.borthdate" + type="date" + value-format="yyyy-MM-dd" + placeholder="閫夋嫨鍑虹敓骞存湀" + > + </el-date-picker> + </el-form-item> + </el-col> </el-row + ><el-row + ><el-col :span="5" + ><el-form-item label="鏀舵鍗曚綅" prop="donateno"> + <el-input + v-model="form.donateno" + placeholder="璇疯緭鍏ユ敹娆惧崟浣�" + :disabled="true" + /> + </el-form-item> + </el-col> + <el-col :span="7" + ><el-form-item label="鏀舵閾惰" prop="donateno"> + <el-input + v-model="form.donateno" + placeholder="璇疯緭鍏ユ敹娆鹃摱琛�" + :disabled="true" + /> + </el-form-item> + </el-col> + + <el-col :span="5"> + <el-form-item label="鏀舵琛屽彿" prop="donationcategory"> + <el-input + v-model="form.donationcategory" + placeholder="璇疯緭鍏ユ敹娆捐鍙�" + /> + </el-form-item> + </el-col> + </el-row> + <el-row> + <el-col :span="17"> + <el-form-item label="鑱旂郴淇℃伅" prop="remark"> + <el-input v-model="form.remark" placeholder="璇疯緭鍏ュ娉�" /> + </el-form-item> + </el-col> + </el-row> + <el-row> + <el-col :span="5"> + <el-form-item label="浠樻鍖婚櫌" prop="sex"> + <el-select v-model="form.sex" placeholder="璇烽�夋嫨鍖婚櫌"> + <el-option + v-for="dict in dict.type.sys_user_sex" + :key="dict.label" + :label="dict.label" + :value="parseInt(dict.value)" + ></el-option> + </el-select> + </el-form-item> + </el-col> + <el-col :span="5"> + <el-form-item label="搴旀敹閲戦" prop="chargeamount"> + <el-input + v-model="form.chargeamount" + placeholder="璇疯緭鍏ュ簲鏀堕噾棰�" + :disabled="true" + /> + </el-form-item> + </el-col> + <el-col :span="5"> + <el-form-item label="瀹炴敹閲戦" prop="chargeamounted"> + <el-input + v-model="form.chargeamounted" + placeholder="璇疯緭鍏ュ疄鏀堕噾棰�" + :disabled="true" + /> + </el-form-item> + </el-col> + <el-col :span="5"> + <el-form-item label="鐢宠鏃ユ湡" prop="borthdate"> + <el-date-picker + clearable + size="small" + v-model="form.borthdate" + type="date" + value-format="yyyy-MM-dd" + placeholder="閫夋嫨鍑虹敓骞存湀" + > + </el-date-picker> + </el-form-item> + </el-col> + </el-row> + <el-row style="margin-top: 10px"> + <el-table + :data="donorchargeorgans" + ref="table" + border + max-height="800" + highlight-current-row + :summary-method="getSummaries" + show-summary + > + <el-table-column + prop="organno" + align="center" + label="鍣ㄥ畼缂栧彿" + width="90" + > + <template slot-scope="scope"> + <el-input + v-model="scope.row.organno" + placeholder="鍣ㄥ畼缂栧彿" + :disabled="true" + /> + </template> + </el-table-column> + <el-table-column + prop="organname" + align="center" + label="鍣ㄥ畼鍚嶇О" + width="120" + > + <template slot-scope="scope"> + <el-input + v-model="scope.row.organname" + placeholder="鍣ㄥ畼鍚嶇О" + /> + </template> + </el-table-column> + <el-table-column + label="鍥藉缂栧彿" + align="center" + width="120" + prop="caseno" + > + <template slot-scope="scope"> + <el-input v-model="scope.row.caseno" placeholder="鍥藉缂栧彿" /> + </template> + </el-table-column> + <el-table-column + prop="hospitalname" + align="center" + label="鎺ユ敹鍖婚櫌" + width="280" + > + <template slot-scope="scope"> + <org-selecter + ref="tranHosSelect" + :org-type="'4'" + v-model="scope.row.hospitalno" + style="width: 100%" + /> + </template> + </el-table-column> + <el-table-column + label="鍙椾綋濮撴皬" + align="center" + width="120" + prop="name" + > + <template slot-scope="scope"> + <el-input v-model="scope.row.name" placeholder="鍙椾綋濮撴皬" /> + </template> + </el-table-column> + <el-table-column + prop="organtime" + align="center" + label="鎺ユ敹鏃ユ湡" + width="200" + > + <template slot-scope="scope"> + <el-date-picker + clearable + size="small" + style="width: 100%" + v-model="scope.row.organtime" + type="date" + value-format="yyyy-MM-dd HH:mm:ss" + placeholder="鎺ユ敹鏃ユ湡" + > + </el-date-picker> + </template> + </el-table-column> + + + <el-table-column + prop="amount" + align="center" + label="搴旀敹閲戦" + width="150" + > + <template slot-scope="scope"> + <el-input v-model="scope.row.amount" placeholder="搴旀敹閲戦" /> + </template> + </el-table-column> + <el-table-column + prop="amount" + align="center" + label="瀹炴敹閲戦" + width="150" + > + <template slot-scope="scope"> + <el-input v-model="scope.row.amount" placeholder="瀹炴敹閲戦" /> + </template> + </el-table-column> + + <el-table-column + prop="amounttime" + align="center" + label="鏀舵鏃ユ湡" + width="200" + > + <template slot-scope="scope"> + <el-date-picker + clearable + size="small" + style="width: 100%" + v-model="scope.row.amounttime" + type="date" + value-format="yyyy-MM-dd HH:mm:ss" + placeholder="鏀舵鏃ユ湡" + > + </el-date-picker> + </template> + </el-table-column> + <el-table-column prop="organchargedesc" align="center" label="澶囨敞"> + <template slot-scope="scope"> + <el-input + v-model="scope.row.organchargedesc" + placeholder="澶囨敞" + /> + </template> + </el-table-column> + <el-table-column label="鎿嶄綔" align="center"> + <template slot-scope="scope"> + <el-button size="mini" type="text" icon="el-icon-circle-plus-outline" @click="handleUpdate(scope.row)" + v-hasPermi="['system:donorcharge:edit']">鏂板</el-button> + + <el-button size="mini" type="text" @click="handleDelete(scope.row)" + v-hasPermi="['system:donorcharge:remove']"><span class="button-delete" + ><i class="el-icon-delete"></i>鍒犻櫎</span + ></el-button> + <el-button size="mini" type="text" icon="el-icon-folder-opened" @click="handleUpdate(scope.row)" + v-hasPermi="['system:donorcharge:edit']">闄勪欢</el-button> + </template> + </el-table-column> + </el-table> + </el-row> + </el-form> + <div slot="footer" class="dialog-footer"> + <el-button + type="primary" + @click="submitForm" + v-if="operationType == 'add' || operationType == 'update'" + >淇� 瀛�</el-button + > + <el-button type="primary" @click="cancel">鍏抽棴</el-button> + </div> + </div> + </div> +</template> + +<script> +import pdf from "vue-pdf"; +import Treeselect from "@riophae/vue-treeselect"; +import "@riophae/vue-treeselect/dist/vue-treeselect.css"; +import { regionDataPlus, CodeToText } from "element-china-area-data"; +import { + getDonorcharge, + addDonorcharge, + updateDonorcharge +} from "@/api/project/donorcharge"; +import { + listDonorchargeorgan, + delDonorchargeorgan, + saveDonorchargeorgan +} from "@/api/project/donorcharge"; +import { listDonatecomporgan } from "@/api/project/donatecompletioninfo"; +import { listOrgancharge } from "@/api/project/organcharge"; +import OrgSelecter from "@/views/project/components/orgselect"; +import Li_area_select from "@/components/Address"; +import { getUserProfile } from "@/api/system/user"; +import { getToken } from "@/utils/auth"; +import debounce from "lodash/debounce"; +export default { + components: { + Treeselect, + OrgSelecter, + Li_area_select, + pdf + }, + dicts: ["sys_user_sex", "sys_0_1"], + name: "Donorchargemanager", + data() { + return { + activeName: 1, //鏂囦欢绫诲瀷 + // 閮ㄩ棬鏍戦�夐」 + + //绁ㄦ嵁鏂囦欢 + pdftitle: "", + pdfimg: "", + pdfVisible: false, + costtypeobj: { + value: 0, + label: "" + }, + pdfimgsrcList: [], + Savereminder: false, //鎻愰啋淇濆瓨寮规 + Reminderquantity: 0, //鎻愰啋鏁伴噺 + totalquantity: 0, //鎬绘暟閲� + + hintitle: "閫変腑宸︿晶宸蹭笂浼犳枃浠堕瑙堟煡鐪�", + atpresent: "", + iframeurl: "", + options: regionDataPlus, + selectedOptions: [], + value1: "", + previewpdf: false, + // 閬僵灞� + loading: true, + // 瀵煎嚭閬僵灞� + exportLoading: false, + // 缃戠粶璇锋眰澶� + Networkheader: null, + + // 閫変腑鏁扮粍 + ids: [], + // 闈炲崟涓鐢� + single: true, + // 闈炲涓鐢� + multiple: true, + // 鏄剧ず鎼滅储鏉′欢 + showSearch: true, + // 鎬绘潯鏁� + total: 0, + // 鎹愮尞妗堜緥鍣ㄥ畼鍒楄〃鏍兼暟鎹� + donorchargeList: [], + donorchargeorgans: [], + // 寮瑰嚭灞傛爣棰� + title: "", + // 鏄惁鏄剧ず寮瑰嚭灞� + open: false, + // 鏌ヨ璐圭敤琛ㄥ弬鏁� + queryParams: { + pageNum: 1, + pageSize: 10, + infoid: null, + name: null, + donationcategory: null, + donateorgan: null, + chargeamounted: null + }, + // 鏌ヨ璐圭敤鍣ㄥ畼琛ㄥ弬鏁� + organParams: { + pageNum: 1, + pageSize: 10, + donorchargeid: null + }, + + // 褰撳墠鐢ㄦ埛淇℃伅 + userprofile: {}, + // 琛ㄥ崟鍙傛暟 + form: {}, + // 鍒楄〃鍙傛暟 + table: {}, + reimbursementList: [], + + // 琛ㄥ崟鏍¢獙 + rules: { + reason: [ + { required: true, message: "璇疯緭鍏ュ嚭宸簨鐢�", trigger: "blur" } + ], + deptmentname: [ + { required: true, message: "璇疯緭鍏ユ墍灞炰笟鍔$粍", trigger: "blur" } + ] + }, + + baselist: [], + donorList: [], + organchargelist: [], + standardlevel: 0, + defaultperson: {}, + fundflowList: [], + showApproveRecordDialog: false, + + // 褰撳墠鍗曟嵁ID + curId: 0, + curCase: null, + //涓氬姟鎿嶄綔绫诲瀷 + operationType: "edit", + + //涓婁紶鍙戠エ鏂囦欢璺緞 + uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", + //鏂囦欢鍒楄〃 + fileList: [], + fileListto: [], + invoicefileList: [], + invoicefileListto: [], + invoicepdfimg: "", + invoicepdfimgsrcList: [], + invoDatatop: [], + //浜哄憳绫诲埆 + persontype: null, + + headers: { + Authorization: "Bearer " + getToken() + }, + + jurisdiction: false, + + //淇濆瓨鎸夐挳鎺у埗 + idisabled: false + }; + }, + + created() { + console.log(234); + this.Getnetworkheader(); + + //鑾峰彇鐧诲綍鑰呬俊鎭� + getUserProfile().then(response => { + this.userprofile = response.data; + this.defaultperson = response.data; + this.standardlevel = response.data.standardlevel; + }); + + //鑾峰彇鍙傛暟 + this.getroute(); + }, + + mounted() { + window.addEventListener("beforeunload", e => this.beforeunloadHandler(e)); + }, + + updated() { + this.$nextTick(() => { + this.$refs["table"].doLayout(); + }); + }, + + destroyed() { + window.removeEventListener("beforeunload", e => this.beforeunloadFn(e)); + }, //鐢熷懡鍛ㄦ湡 - 閿�姣佸畬鎴� + + methods: { + // 娴忚鍣ㄩ〉闈㈠叧闂垨鍒锋柊鎻愮ず + beforeunloadHandler(e) { + if ( + (JSON.stringify(this.form) == sessionStorage.getItem("apiform") && + JSON.stringify(this.donorchargeorgans) == + sessionStorage.getItem("apifunddetail")) || + !sessionStorage.getItem("apifunddetail") + ) { + } else { + this._beforeUnload_time = new Date().getTime(); + e = e || window.event; + if (e) { + e.returnValue = "鍏抽棴鎻愮ず"; + } + return "鍏抽棴鎻愮ず"; + } + }, + + handleUploadError() {}, + // 鑾峰彇璇锋眰澶� + Getnetworkheader() { + let string = window.location.href; + if (string.includes("9091")) { + const index = string.indexOf("9091"); + this.Networkheader = string.slice(0, index + 4); // 鎴彇9091鍙婂叾鍓嶉儴瀛楃 + } else { + const index = string.indexOf("8032"); + this.Networkheader = string.slice(0, index + 4); // 鎴彇8032鍙婂叾鍓嶉儴瀛楃 + } + }, + // 鍙戠エ鍒囨崲 + handleClick(tab, event) { + if (this.activeName == 1) { + this.pdftitle = "鍏�" + this.pdfimgsrcList.length + "椤�"; + } else { + this.pdftitle = "鍏�" + this.invoicepdfimgsrcList.length + "椤�"; + } + }, + + getIndexInArray(arr, obj) { + return arr.indexOf(obj); + }, + + // 琛ㄥ崟閲嶇疆 + reset() { + this.form = { + id: null, + infoid: null, + donateno: null, + donatetime: null, + name: null, + borthdate: null, + sex: null, + age: null, + donationcategory: null, + donateorgan: null, + chargeamount: null, + chargeamounted: null, + remark: null, + delFlag: null, + createBy: null, + createTime: null, + updateBy: null, + updateTime: null + }; + this.resetForm("form"); + }, + + /** 閫氳繃鍙傛暟鑾峰彇涓氬姟绫诲瀷 */ + getroute() { + //閫夋嫨涓氬姟绫诲瀷:1銆佹柊澧烇紱2銆佷慨鏀癸紱3銆佹煡鐪� + this.operationType = this.$route.query.operation; + this.curId = this.$route.query.id; + this.curCase = this.$route.query.data; + console.log("this.$route.query", this.$route.query); + + if (this.operationType == "add") { + this.title = "鏂板缓妗堜緥鍣ㄥ畼璐圭敤琛�"; + this.handleAdd(); + console.log("1"); + } else if (this.operationType == "update") { + this.title = "淇敼妗堜緥鍣ㄥ畼璐圭敤琛�"; + this.handleUpdate(); + console.log("2"); + } else if (this.operationType == "detail") { + this.title = "鏌ョ湅妗堜緥鍣ㄥ畼璐圭敤琛�"; + this.handleDetail(); + console.log("3"); + } + }, + + /** 閲嶇疆鎸夐挳鎿嶄綔 */ + resetQuery() { + this.resetForm("queryForm"); + this.handleQuery(); + }, + + // 鍙栨秷鎸夐挳 + cancel() { + this.$store.dispatch("tagsView/delView", this.$route); + this.$router.go(-1); + }, + + // 澶氶�夋閫変腑鏁版嵁 + handleSelectionChange(selection) { + this.ids = selection.map(item => item.id); + this.single = selection.length !== 1; + this.multiple = !selection.length; + }, + + /** 鏂板鎸夐挳鎿嶄綔 */ + handleAdd() { + this.reset(); + this.open = true; + this.title = "鏂板鎹愮尞妗堜緥鍣ㄥ畼璐圭敤琛�"; + + if (this.curCase) { + this.form.infoid = this.curCase.id; + this.form.donateno = this.curCase.donorno; + this.form.donatetime = this.curCase.donatetime; + this.form.name = this.curCase.name; + this.form.borthdate = this.curCase.birthday; + this.form.sex = this.curCase.sex; + this.form.age = this.curCase.age; + this.form.donationcategory = this.curCase.donationcategory; + + //鑾峰彇瀹屾垚鐧昏鐨勫櫒瀹樿〃 + if (this.curCase.id > 0) { + } else { + this.curCase.id = 0; + } + let searchParam = { + infoid: this.curCase.id + }; + listDonatecomporgan(searchParam).then(res => { + if (res.code == 200) { + // 鏌ヨ鍣ㄥ畼璐圭敤琛� + let tempParam = { + organcode: null, + organname: null, + charge: null + }; + listOrgancharge(tempParam).then(res1 => { + if (res1.code == 200) { + this.organchargelist = res1.rows; + } + + //鎻掑叆鍣ㄥ畼琛� + res.rows.forEach(item => { + //鑾峰彇璐圭敤閲戦 + this.organchargelist.map(rescharge => { + if (rescharge.organcode == item.organno) { + this.donorchargeorgans.push({ + organno: item.organno, + organname: item.organname, + organcharge: rescharge.charge, + infoid: item.infoid, + hospitalname: item.transplanthospitalname, + hospitalno: item.transplanthospitalno, + organtime: item.transplanttime, + chargestate: "0" + }); + } + }); + }); + }); + } + }); + } + }, + + /** 淇敼鎸夐挳鎿嶄綔 */ + handleUpdate() { + this.reset(); + this.open = true; + this.title = "淇敼鎹愮尞妗堜緥鍣ㄥ畼璐圭敤琛�"; + + getDonorcharge(this.curId).then(response => { + this.form = response.data; + console.log("getDonorcharge", response); + + //鍣ㄥ畼璐圭敤淇℃伅 + this.organParams.donorchargeid = this.curId; + console.log("this.organParams", this.organParams); + listDonorchargeorgan(this.organParams).then(res => { + console.log("listDonorchargeorgan", res); + this.donorchargeorgans = res.rows; + console.log(this.donorchargeorgans, "donorchargeorgans"); + if (this.donorchargeorgans.length > 0) { + } else { + this.addRow(0); + } + }); + }); + }, + + /** 淇敼鏌ョ湅鎿嶄綔 */ + handleDetail() { + this.reset(); + this.open = true; + + getDonorcharge(this.curId).then(response => { + this.form = response.data; + this.open = true; + this.title = "鏌ョ湅鎹愮尞妗堜緥鍣ㄥ畼璐圭敤琛�"; + + //鍣ㄥ畼璐圭敤淇℃伅 + this.organParams.donorchargeid = this.curId; + listDonorchargeorgan(this.organParams).then(res => { + this.donorchargeorgans = res.rows; + if (this.donorchargeorgans.length > 0) { + } else { + this.addRow(0); + } + }); + }); + }, + + /** 鎻愪氦淇濆瓨鎸夐挳 */ + submitForm: debounce(function(data) { + this.$refs["form"].validate(valid => { + if (valid) { + //鏍¢獙銆佽垂鐢ㄥ悎璁� + let ChargeSum = 0; + let ChargeamountSum = 0; + let organname = ""; + + try { + for (let i = 0; i < this.donorchargeorgans.length; i++) { + organname += this.donorchargeorgans[i].organname + ","; + if (!isNaN(parseFloat(this.donorchargeorgans[i].organcharge))) { + ChargeSum += parseFloat(this.donorchargeorgans[i].organcharge); + } + if (!isNaN(parseFloat(this.donorchargeorgans[i].amount))) { + ChargeamountSum += parseFloat(this.donorchargeorgans[i].amount); + } + } + this.form.donateorgan = organname.substring( + 0, + organname.lastIndexOf(",") + ); + this.form.chargeamount = ChargeSum.toFixed(2); + this.form.chargeamounted = ChargeamountSum.toFixed(2); + } catch {} + + //淇濆瓨 + if (this.form.id != null) { + for (let k = 0; k < this.donorchargeorgans.length; k++) { + this.donorchargeorgans[k].donorchargeID = this.form.id; + } + + updateDonorcharge(this.form).then(res1 => { + if (res1.code == 200) { + saveDonorchargeorgan(this.donorchargeorgans).then(res2 => { + if (res2.code == 200) { + this.$modal.msgSuccess("淇濆瓨鎴愬姛锛�"); + this.open = false; + } + }); + } + }); + } else { + addDonorcharge(this.form).then(response => { + if (response.code == 200) { + console.log("addDonorcharge", response); + //淇濆瓨鍓嶆牎楠屾暟鎹� + for (let k = 0; k < this.donorchargeorgans.length; k++) { + this.donorchargeorgans[k].donorchargeid = response.data.id; + } + saveDonorchargeorgan(this.donorchargeorgans).then(res2 => { + if (res2.code == 200) { + this.$modal.msgSuccess("淇濆瓨鎴愬姛锛�"); + this.open = false; + } + }); + } + }); + } + } + }); + }, 500), + + //璁$畻璐圭敤鍚堣 + chargeSum() { + let ChargeSum = 0; + let ChargeamountSum = 0; + + //璐圭敤鍚堣 + try { + for (let i = 0; i < this.donorchargeorgans.length; i++) { + if (!isNaN(parseFloat(this.donorchargeorgans[i].organcharge))) { + ChargeSum += parseFloat(this.donorchargeorgans[i].organcharge); + } + if (!isNaN(parseFloat(this.donorchargeorgans[i].amount))) { + ChargeamountSum += parseFloat(this.donorchargeorgans[i].amount); + } + } + + this.form.chargeamount = ChargeSum.toFixed(2); + this.form.chargeamounted = ChargeamountSum.toFixed(2); + } catch {} + }, + + //琛ㄦ牸鍚堣 + getSummaries(param) { + const { columns, data } = param; + const sums = []; + var columnnames = [ + "organno", + "organname", + "amount", + "amounttime", + "organcharge", + "hospitalname", + "organtime", + "remark" + ]; + columns.forEach((column, index) => { + if (index === 0) { + sums[index] = "鍚堣"; + return; + } + // if (index === 2) { + // sums[index] = this.form.chargeamounted; + // return; + // } + // if (index === 4) { + // sums[index] = this.form.chargeamount; + // return; + // } + //鍘婚櫎閮ㄥ垎瀛楁璁$畻 + if (columnnames.indexOf(column.property) > -1) { + return; + } + + const values = data.map(item => Number(item[column.property])); + if (!values.every(value => isNaN(value))) { + sums[index] = values.reduce((prev, curr) => { + const value = Number(curr); + if (!isNaN(value)) { + return prev + curr; + } else { + return prev; + } + }, 0); + sums[index] = sums[index].toFixed(2); // 淇濈暀2浣嶅皬鏁帮紝瑙e喅灏忔暟鍚堣鍒�; + } else { + sums[index] = ""; + } + }); + return sums; + } + } +}; +</script> + +<style lang="scss" scoped> +.Modifydetailscla { + padding: 10px; + + .boxdiv { + font-size: 18px; + padding: 0 30px; + padding-bottom: 60px; + + .top-text { + text-align: center; + + font-size: 23px; + font-weight: 600; + margin: 20px 0; + margin-bottom: 50px; + } + + .dialog-footer { + text-align: left; + margin-top: 10px; + } + } +} + +.upload-demo { + text-align: center; +} + +.pdfimg { + display: flex; // text-align: center; + width: 100%; + height: 600px; + + .box-pdf { + width: 400px; + padding-top: 20px; + margin-right: 30px; + border: 1px solid #dcdfe6; + -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12), + 0 0 6px 0 rgba(0, 0, 0, 0.04); + box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1); // <- Add this to fix. + } + + .pdftit { + width: 200px; + padding: 20px; + font-size: 18px; + } + + .pdftit:hover { + background: #c0cef7; + } + + .pdfimgmin { + width: 60%; + + img { + width: 100%; + } + } + + .pdfimgmins { + font-size: 28px; + width: 60%; + text-align: center; + } +} +.button-delete{ + color: rgb(236, 69, 69); +} + +::v-deep .el-input--medium .el-input__inner { + height: 36px; + line-height: 36px; + text-align: center; +} + +::v-deep .el-alert__title { + font-size: 20px; + line-height: 20px; +} +</style> -- Gitblit v1.9.3