From 733457daf115deb6088984c3c55dc5bcc906d28c Mon Sep 17 00:00:00 2001 From: yxh <172933527@qq.com> Date: 星期三, 09 八月 2023 23:53:58 +0800 Subject: [PATCH] yxh --- src/views/project/fund/medicalCostFundApply/index.vue | 546 +++++++++++++++++++++++++++++++----------------------- 1 files changed, 313 insertions(+), 233 deletions(-) diff --git a/src/views/project/fund/medicalCostFundApply/index.vue b/src/views/project/fund/medicalCostFundApply/index.vue index 4f1dd9c..efff279 100644 --- a/src/views/project/fund/medicalCostFundApply/index.vue +++ b/src/views/project/fund/medicalCostFundApply/index.vue @@ -24,7 +24,7 @@ </el-row> </el-form> <el-row> - <el-col :span="8"> + <el-col :span="6"> <el-card shadow="never"> <!-- 鎹愮尞妗堜緥鍒楄〃 --> <el-row> @@ -47,7 +47,7 @@ :limit.sync="queryParams.pageSize" @pagination="getBaseInfoList" /> </el-card> </el-col> - <el-col :span="16"> + <el-col :span="18"> <el-card shadow="naver"> <el-form ref="infoform" label-width="100px"> <el-row :gutter="4" align="right" class="mb8"> @@ -149,7 +149,7 @@ <el-row style="text-align: left"> <el-col :span="5"> <el-form-item label="鐢宠绫诲瀷"> - <el-radio v-model="form.applytype" label="3">鍖诲鎴愭湰鐢宠</el-radio> + <el-radio v-model="form.applytype" label='3'>鍖诲鎴愭湰鐢宠</el-radio> </el-form-item> </el-col> <el-col :span="10"> @@ -487,6 +487,35 @@ <el-button type="primary" @click="ConfirmDetailDialog()">纭� 瀹�</el-button> </span> </el-dialog> + + <el-dialog :title="pdftitle" :visible.sync="pdfVisible" width="50%"> + <div class="pdfimg"> + <div class="box-pdf"> + <div> + <el-upload size="mini" class="upload-demo" :action="uploadFileUrl" :file-list="fileListto" multiple + :limit="20" :headers="headers" :on-success="(response, file, fileList) => + uploadSccess(response, file, fileList) + " :on-preview="downFile" :disabled="dialogType == 'detail'" :on-error="handleUploadError" + :on-exceed="handleExceed" :on-remove="remove" accept="image/*,.pdf"> + <el-button :disabled="dialogType == 'detail'" size="small" type="primary">涓婁紶</el-button> + </el-upload> + </div> + <!-- <div + class="pdftit" + @click="pdffn(item)" + v-for="item in fileList" + :key="item.name" + > + {{ item.name }} + </div> --> + </div> + + <div v-if="this.previewpdf" class="pdfimgmin"> + <img :src="pdfimg" /> + </div> + <div v-else class="pdfimgmins">{{ hintitle }}</div> + </div> + </el-dialog> </div> </template> @@ -650,6 +679,7 @@ fundtypeArrAll: [], dialogType: "edit", + detailInfoDialogShow: false, detailInfoDialogShowType: "", funddetailForm: { @@ -662,20 +692,256 @@ //闄勪欢鍒楄〃 fileList: [], + fileListto: [], //涓婁紶闄勪欢璺緞 uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload", headers: { Authorization: "Bearer " + getToken(), }, - + //绁ㄦ嵁鏂囦欢 + pdftitle: "", + pdfimg: "", + pdfVisible: false, + previewpdf: false, + hintitle: "閫変腑宸︿晶宸蹭笂浼犳枃浠堕瑙堟煡鐪�", + atpresent: "", }; }, //鐩戝惉灞炴�� 绫讳技浜巇ata姒傚康 computed: {}, //鐩戞帶data涓殑鏁版嵁鍙樺寲 watch: {}, + //鐢熷懡鍛ㄦ湡 - 鍒涘缓瀹屾垚锛堝彲浠ヨ闂綋鍓峵his瀹炰緥锛� + created() { + this.getList(); + this.getBaseInfoList(); + this.getCurFundType(); + this.getlistUser(); + // this.getUnitList(); + }, + + //鐢熷懡鍛ㄦ湡 - 鎸傝浇瀹屾垚锛堝彲浠ヨ闂瓺OM鍏冪礌锛� + mounted() { + this.getBankAccount(); + this.getUsermsg(); + }, + + beforeCreate() { }, //鐢熷懡鍛ㄦ湡 - 鍒涘缓涔嬪墠 + beforeMount() { }, //鐢熷懡鍛ㄦ湡 - 鎸傝浇涔嬪墠 + beforeUpdate() { }, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪墠 + updated() { }, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪悗 + beforeDestroy() { }, //鐢熷懡鍛ㄦ湡 - 閿�姣佷箣鍓� + destroyed() { }, //鐢熷懡鍛ㄦ湡 - 閿�姣佸畬鎴� + activated() { }, //濡傛灉椤甸潰鏈塳eep-alive缂撳瓨鍔熻兘锛岃繖涓嚱鏁颁細瑙﹀彂 + //鏂规硶闆嗗悎 methods: { + /** 鎼滅储鎸夐挳鎿嶄綔 */ + handleQuery() { + this.queryParams.pageNum = 1; + this.getList(); + }, + /** 閲嶇疆鎸夐挳鎿嶄綔 */ + resetQuery() { + this.daterangeReporttime = []; + + this.resetForm("queryForm"); + this.handleQuery(); + }, + + /** 鏌ヨ鎹愮尞浜洪亾鎱伴棶閲戝垪琛� */ + getList() { + this.loading = true; + this.queryParams.params = {}; + if (null != this.daterangeReporttime && "" != this.daterangeReporttime) { + this.queryParams.params["beginReporttime"] = + this.daterangeReporttime[0]; + this.queryParams.params["endReporttime"] = this.daterangeReporttime[1]; + } + // this.queryParams.residencetown = this.$refs.areaSelect.getQu(); + listDonatebaseinfo(this.queryParams).then((response) => { + this.donatebaseinfoList = response.rows; + this.total = response.total; + this.loading = false; + }); + }, + + /** 鏂板鎸夐挳鎿嶄綔 */ + handleAdd() { + this.$router.push({ + path: "/finance/fundcontext/", + query: { id: 0, businessType: "3", operationType: "add", curCase: this.curCase } + }); + return; + + if (this.curCase.id) { + this.istrue += 2; + this.reset(); + this.queryParams.params = {}; + this.form.donorno = this.curCase.donorno; + this.form.name = this.curCase.name; + this.form.infoid = this.curCase.id; + this.form.username = this.defaultperson.nickName; + this.form.userno = this.defaultperson.userName; + this.form.deptmentname = this.defaultperson.dept.deptName; + this.form.deptmentno = this.defaultperson.dept.deptId; + this.form.managername = this.defaultperson.dept.leader; + + // this.form.createTime = nowdate; + //this.open = true; + //this.initFundApplyForm(); + this.fundDetails = []; + this.addRow(); + this.dialogOpen = true; + this.title = "娣诲姞璐圭敤鐢宠"; + this.dialogType = "edit"; + } else { + const h = this.$createElement; + this.$message({ + message: h("p", null, [h("span", null, "璇峰厛閫夋嫨宸︽柟鎹愮尞妗堜緥 ")]), + }); + } + }, + /** 淇敼鎸夐挳鎿嶄綔 */ + handleUpdate(row) { + this.$router.push({ + path: "/finance/fundcontext/", + query: { id: row.id, businessType: "3", operationType: "update", curCase: this.curCase } + }); + return; + + this.isopen = 0; + this.reset(); + this.queryParams.params = {}; + this.form.donorno = this.curCase.donorno; + this.form.infoid = this.curCase.id; + this.dialogType = "edit"; + this.dialogOpen = true; + this.title = "淇敼璐圭敤鐢宠"; + + + const id = row.id || this.ids; + getFund(id).then((response) => { + this.form = response.data; + this.form.name = this.curCase.name; + //闄勪欢澶勭悊 + this.fileList = this.form.annexbankcard ? this.form.annexbankcard.split(",").map(item => ({ url: item, name: item })) : [] + + getownFundDetail(id).then(async (res) => { + this.fundDetails = res.data; + for (let m = 0; m < this.fundDetails.length; m++) { + this.fundDetails[m].itemArr = []; + this.getItemArr(m, this.fundDetails[m]); + } + }); + }); + }, + + /** 鏌ョ湅鎸夐挳鎿嶄綔 */ + handleDetail(row) { + this.$router.push({ + path: "/finance/fundcontext/", + query: { id: row.id, businessType: "3", operationType: "detail", curCase: this.curCase } + }); + return; + + this.isopen = 0; + this.reset(); + this.queryParams.params = {}; + this.form.donorno = this.curCase.donorno; + this.form.infoid = this.curCase.id; + this.dialogOpen = true; + this.title = "鏌ョ湅璐圭敤鐢宠"; + this.dialogType = "detail"; + const id = row.id || this.ids; + + getFund(id).then((response) => { + this.form = response.data; + this.form.name = this.curCase.name; + let listFundflowparams = { + fundid: row.id, + fundtype: 2, + }; + //闄勪欢澶勭悊 + this.fileList = this.form.annexbankcard ? this.form.annexbankcard.split(",").map(item => ({ url: item, name: item })) : [] + + listFundflow(listFundflowparams).then((res) => { + this.fundflowList = res.rows; + }); + getownFundDetail(id).then((res) => { + this.fundDetails = res.data; + for (let m = 0; m < this.fundDetails.length; m++) { + this.fundDetails[m].itemArr = []; + this.getItemArr(m, this.fundDetails[m]); + this.fundDetails[m].fundblock = []; + this.fundDetails[m].fundblock.push({ + expense: this.fundDetails[m].expense, + expensedescribe: this.fundDetails[m].servicesscopename, + remark: this.fundDetails[m].servicesscope, + servicesscope: this.fundDetails[m].servicesscope, + }); + } + }); + }); + }, + + /** 鍒犻櫎鎸夐挳鎿嶄綔 */ + handleDelete(row) { + const ids = row.id || this.ids; + this.$modal + .confirm("鏄惁纭鍒犻櫎璇ヨ褰曪紵") + .then(function () { + return delFund(ids); + }) + .then(() => { + getownFundDetail(ids).then((res) => { + let listdetails = res.data; + for (let i = 0; i < listdetails.length; i++) { + delFunddetail(listdetails[i].id); + } + }); + // this.getList(); + this.getfundList(); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }) + .catch(() => { }); + }, + + /** 涓婃姤鎸夐挳鎿嶄綔 */ + handleup(row) { + this.$confirm("鏄惁纭灏嗙櫥璁拌褰曚笂鎶ワ紵", "鎻愮ず", { + confirmButtonText: "纭畾", + cancelButtonText: "鍙栨秷", + type: "warning", + }) + .then(() => { + //鏌ユ壘鏄惁瀛樺湪鐧昏瀹屾垚璁板綍 + //鍒ゆ柇鏄惁瀛樺湪涓婃姤璁板綍 + row.recordstatus = 0; + + updateFund(row).then((response) => { + if (response.code == 200) { + this.$message({ + type: "success", + message: "鐢宠鎴愬姛", + }); + } else { + this.$message({ + type: "error", + message: "鐢宠澶辫触", + }); + } + this.loading = false; + }); + }) + .catch(() => { + this.$message({ + type: "info", + message: "宸插彇娑堢敵璇�", + }); + }); + }, + ShowDetailDialog(spoce, showType) { this.funddetailForm.index = spoce.$index; this.funddetailForm.beneficiaryno = spoce.row.beneficiaryno; @@ -711,13 +977,11 @@ }); } else if (this.detailInfoDialogShowType == "unit") { singleDetail.unitno = this.funddetailForm.unitno; - console.log("this.funddetailForm", this.funddetailForm); try { let unitIndex = this.bankaccountlist.findIndex( (item) => singleDetail.unitno == item.reportNo ); - console.log("this.bankaccountlist[unitIndex]", this.bankaccountlist[unitIndex]); if (unitIndex > -1) { singleDetail.unitname = this.bankaccountlist[unitIndex].reportName; singleDetail.depositbank = this.bankaccountlist[unitIndex].depositbank; @@ -729,10 +993,11 @@ singleDetail.unitname = singleDetail.unitno; } } - console.log("singleDetail", singleDetail); + this.fundDetails[tempIndex] = singleDetail; this.detailInfoDialogShow = false; }, + selectremark(row) { this.fundblock.forEach((item, i) => { if (item.expensedescribe === row.servicesscopename) { @@ -742,43 +1007,10 @@ this.fundDetails.map((item) => { this.form.serviceFunddetails += item.amount; }); - // row.remark } }); }, - handleup(row) { - this.$confirm("鏄惁纭灏嗙櫥璁拌褰曚笂鎶ワ紵", "鎻愮ず", { - confirmButtonText: "纭畾", - cancelButtonText: "鍙栨秷", - type: "warning", - }) - .then(() => { - //鏌ユ壘鏄惁瀛樺湪鐧昏瀹屾垚璁板綍 - //鍒ゆ柇鏄惁瀛樺湪涓婃姤璁板綍 - row.recordstatus = 0; - updateFund(row).then((response) => { - if (response.code == 200) { - this.$message({ - type: "success", - message: "鐢宠鎴愬姛", - }); - } else { - this.$message({ - type: "error", - message: "鐢宠澶辫触", - }); - } - this.loading = false; - }); - }) - .catch(() => { - this.$message({ - type: "info", - message: "宸插彇娑堢敵璇�", - }); - }); - }, select(row) { row.itemArr.map((res) => { if (row.itemid === res.id) { @@ -825,34 +1057,6 @@ this.standardlevel = response.data.standardlevel; }); }, - /** 鎼滅储鎸夐挳鎿嶄綔 */ - handleQuery() { - this.queryParams.pageNum = 1; - this.getList(); - }, - /** 閲嶇疆鎸夐挳鎿嶄綔 */ - resetQuery() { - this.daterangeReporttime = []; - - this.resetForm("queryForm"); - this.handleQuery(); - }, - /** 鏌ヨ鎹愮尞浜洪亾鎱伴棶閲戝垪琛� */ - getList() { - this.loading = true; - this.queryParams.params = {}; - if (null != this.daterangeReporttime && "" != this.daterangeReporttime) { - this.queryParams.params["beginReporttime"] = - this.daterangeReporttime[0]; - this.queryParams.params["endReporttime"] = this.daterangeReporttime[1]; - } - // this.queryParams.residencetown = this.$refs.areaSelect.getQu(); - listDonatebaseinfo(this.queryParams).then((response) => { - this.donatebaseinfoList = response.rows; - this.total = response.total; - this.loading = false; - }); - }, getBaseInfoList() { this.loading = true; @@ -863,36 +1067,7 @@ }); }, - /** 鏂板鎸夐挳鎿嶄綔 */ - handleAdd() { - if (this.curCase.id) { - this.istrue += 2; - this.reset(); - this.queryParams.params = {}; - this.form.donorno = this.curCase.donorno; - this.form.name = this.curCase.name; - this.form.infoid = this.curCase.id; - this.form.username = this.defaultperson.nickName; - this.form.userno = this.defaultperson.userName; - this.form.deptmentname = this.defaultperson.dept.deptName; - this.form.deptmentno = this.defaultperson.dept.deptId; - this.form.managername = this.defaultperson.dept.leader; - // this.form.createTime = nowdate; - //this.open = true; - //this.initFundApplyForm(); - this.fundDetails = []; - this.addRow(); - this.dialogOpen = true; - this.title = "娣诲姞璐圭敤鐢宠"; - this.dialogType = "edit"; - } else { - const h = this.$createElement; - this.$message({ - message: h("p", null, [h("span", null, "璇峰厛閫夋嫨宸︽柟鎹愮尞妗堜緥 ")]), - }); - } - }, //鐐瑰嚮鎹愮尞妗堜緥鍒楄〃瑙﹀彂鏂规硶 selectDonotor(row, column, event) { this.curCase = row; @@ -1147,8 +1322,6 @@ this.getList(); this.selectDonotor(this.curCase); } - - } }); }, @@ -1157,7 +1330,6 @@ //鑾峰彇閾惰璐﹀彿鍒楄〃锛岀被鍨嬫槸鏈烘瀯 listReportname("org").then((res) => { this.bankaccountlist = res.data; - console.log("this.bankaccountlist", this.bankaccountlist); }); }, @@ -1167,97 +1339,7 @@ }); }, - /** 淇敼鎸夐挳鎿嶄綔 */ - handleUpdate(row) { - this.isopen = 0; - this.reset(); - this.queryParams.params = {}; - this.form.donorno = this.curCase.donorno; - this.form.infoid = this.curCase.id; - this.dialogType = "edit"; - this.dialogOpen = true; - this.title = "淇敼璐圭敤鐢宠"; - - const id = row.id || this.ids; - getFund(id).then((response) => { - this.form = response.data; - this.form.name = this.curCase.name; - //闄勪欢澶勭悊 - this.fileList = this.form.annexbankcard ? this.form.annexbankcard.split(",").map(item => ({ url: item, name: item })) : [] - - getownFundDetail(id).then(async (res) => { - this.fundDetails = res.data; - for (let m = 0; m < this.fundDetails.length; m++) { - this.fundDetails[m].itemArr = []; - this.getItemArr(m, this.fundDetails[m]); - } - }); - }); - }, - - /** 鏌ョ湅鎸夐挳鎿嶄綔 */ - handleDetail(row) { - this.isopen = 0; - this.reset(); - this.queryParams.params = {}; - this.form.donorno = this.curCase.donorno; - this.form.infoid = this.curCase.id; - this.dialogOpen = true; - this.title = "鏌ョ湅璐圭敤鐢宠"; - this.dialogType = "detail"; - const id = row.id || this.ids; - - getFund(id).then((response) => { - this.form = response.data; - this.form.name = this.curCase.name; - let listFundflowparams = { - fundid: row.id, - fundtype: 2, - }; - //闄勪欢澶勭悊 - this.fileList = this.form.annexbankcard ? this.form.annexbankcard.split(",").map(item => ({ url: item, name: item })) : [] - - listFundflow(listFundflowparams).then((res) => { - this.fundflowList = res.rows; - }); - getownFundDetail(id).then((res) => { - this.fundDetails = res.data; - for (let m = 0; m < this.fundDetails.length; m++) { - this.fundDetails[m].itemArr = []; - this.getItemArr(m, this.fundDetails[m]); - this.fundDetails[m].fundblock = []; - this.fundDetails[m].fundblock.push({ - expense: this.fundDetails[m].expense, - expensedescribe: this.fundDetails[m].servicesscopename, - remark: this.fundDetails[m].servicesscope, - servicesscope: this.fundDetails[m].servicesscope, - }); - } - }); - }); - }, - - handleDelete(row) { - const ids = row.id || this.ids; - this.$modal - .confirm("鏄惁纭鍒犻櫎璇ヨ褰曪紵") - .then(function () { - return delFund(ids); - }) - .then(() => { - getownFundDetail(ids).then((res) => { - let listdetails = res.data; - for (let i = 0; i < listdetails.length; i++) { - delFunddetail(listdetails[i].id); - } - }); - // this.getList(); - this.getfundList(); - this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); - }) - .catch(() => { }); - }, deleteRows(row, index, rows) { this.$confirm("鏄惁纭鍒犻櫎?", "鎻愮ず", { @@ -1404,7 +1486,6 @@ getUnitList() { listOrganization(3).then((res) => { - console.log("listOrganization", res); for (let i = 0; i < res.rows.length; i++) { this.unitList.push({ organizationid: res.rows[i].organizationid, @@ -1489,17 +1570,17 @@ //鏂囦欢涓婁紶 handleUploadError() { }, + handleremove(file) { this.fileList.splice(this.fileList.indexOf(file), 1) }, + handleExceed() { this.$message.error(`涓婁紶鏂囦欢鏁伴噺涓嶈兘瓒呰繃 ${5} 涓�!`); }, + //鏂囦欢涓婁紶鎴愬姛鍥炶皟 uploadSccess(response, file, fileList) { - console.log("response", response); - console.log("file", file); - console.log("fileList", fileList); //鑾峰彇闄勪欢淇℃伅浣嶇疆 if (response.code == 200) { this.form.filename = file.raw.name; @@ -1518,46 +1599,45 @@ a.href = url; a.dispatchEvent(event); }, + + remove(file) { + this.fileList.splice(this.fileList.indexOf(file), 1) + }, + + // 鐐瑰嚮鏂囦欢 + Filepopup(index, rows, row) { + this.atpresent = index; + this.pdfVisible = true; + if (this.fundDetails[index].annexfilesList) { + this.fileListto = this.rbDetails[index].annexfilesList; + } else { + this.fileListto = []; + this.pdfimg = ""; + this.pdftitle = ""; + } + }, + // 鐐瑰嚮宸蹭笂浼犳枃浠� + downFile(item) { + this.pdftitle = item.name; + let name = item.name.split("."); + if (name[1] == "pdf") { + this.$modal.msgWarning("褰撳墠鏂囦欢鏆備笉鏀寔棰勮"); + this.previewpdf = false; + this.hintitle = "褰撳墠鏂囦欢鏆備笉鏀寔棰勮"; + } else if (name[1] == "jpg" || "png") { + this.previewpdf = true; + if (item.url) { + this.pdfimg = item.url; + } else { + this.pdfimg = item.response.url; + } + } else { + this.hintitle = "褰撳墠鏂囦欢鏆備笉鏀寔棰勮"; + this.$modal.msgWarning("褰撳墠鏂囦欢鏆備笉鏀寔棰勮"); + this.previewpdf = false; + } + }, }, - - // 鐐瑰嚮鏂囦欢 - Filepopup(index, rows, row) { - console.log(index, rows, row); - this.atpresent = index; - console.log(this.atpresent); - this.pdfVisible = true; - if (this.fundDetails[index].annexfilesList) { - this.fileListto = this.rbDetails[index].annexfilesList; - } else { - this.fileListto = []; - this.pdfimg = ""; - this.pdftitle = ""; - } - }, - - //鐢熷懡鍛ㄦ湡 - 鍒涘缓瀹屾垚锛堝彲浠ヨ闂綋鍓峵his瀹炰緥锛� - created() { - this.getList(); - this.getBaseInfoList(); - - this.getCurFundType(); - this.getlistUser(); - // this.getUnitList(); - }, - - //鐢熷懡鍛ㄦ湡 - 鎸傝浇瀹屾垚锛堝彲浠ヨ闂瓺OM鍏冪礌锛� - mounted() { - this.getBankAccount(); - this.getUsermsg(); - }, - - beforeCreate() { }, //鐢熷懡鍛ㄦ湡 - 鍒涘缓涔嬪墠 - beforeMount() { }, //鐢熷懡鍛ㄦ湡 - 鎸傝浇涔嬪墠 - beforeUpdate() { }, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪墠 - updated() { }, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪悗 - beforeDestroy() { }, //鐢熷懡鍛ㄦ湡 - 閿�姣佷箣鍓� - destroyed() { }, //鐢熷懡鍛ㄦ湡 - 閿�姣佸畬鎴� - activated() { }, //濡傛灉椤甸潰鏈塳eep-alive缂撳瓨鍔熻兘锛岃繖涓嚱鏁颁細瑙﹀彂 }; </script> <style scoped> -- Gitblit v1.9.3