From 7bf2fb0fe59ca062ff4bf20688474ffae9856ce0 Mon Sep 17 00:00:00 2001 From: WXL <1785969728@qq.com> Date: 星期一, 26 二月 2024 17:02:19 +0800 Subject: [PATCH] 11 --- src/views/project/fund/medicalCostApply/index.vue | 361 ++++++++++++++++++++++++++++++++++++++------------- 1 files changed, 269 insertions(+), 92 deletions(-) diff --git a/src/views/project/fund/medicalCostApply/index.vue b/src/views/project/fund/medicalCostApply/index.vue index f8c3558..9edadf1 100644 --- a/src/views/project/fund/medicalCostApply/index.vue +++ b/src/views/project/fund/medicalCostApply/index.vue @@ -1,28 +1,6 @@ <!-- --> <template> <div class="app-container"> - <el-form :model="queryParams" ref="queryForm" :inline="true" label-width="70px"> - <el-row align="left"> - <el-col :span="6"> - <el-form-item label="濮撳悕" prop="name"> - <el-input v-model="queryParams.name" placeholder="璇疯緭鍏ュ鍚�" clearable size="small" - @keyup.enter.native="handleQuery" /> - </el-form-item> - </el-col> - <el-col :span="6"> - <el-form-item label="鎹愮尞杩涘害" prop="recordstate"> - <el-select v-model="queryParams.recordstate" placeholder="璇烽�夋嫨璁板綍鐘舵��" clearable size="small"> - <el-option v-for="dict in dict.type.sys_DonationStatus" :key="dict.value" :label="dict.label" - :value="dict.value" /> - </el-select> - </el-form-item> - </el-col> - <el-col :span="6"> - <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-col> - </el-row> - </el-form> <el-row> <el-col :span="6"> <el-card shadow="never"> @@ -33,18 +11,80 @@ </el-row> </el-col> </el-row> - <el-table v-loading="loading" border highlight-current-row :data="donatebaseinfoList" - @row-click="selectDonotor"> + <div> + <el-form + :model="queryParams" + ref="queryForm" + :inline="true" + label-width="70px" + > + <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="recordstate"> + <el-select + v-model="queryParams.recordstate" + placeholder="璇烽�夋嫨璁板綍鐘舵��" + clearable + size="small" + > + <el-option + v-for="dict in dict.type.sys_DonationStatus" + :key="dict.value" + :label="dict.label" + :value="dict.value" + /> + </el-select> + </el-form-item> + <div style="float: right; margin-bottom: 10px;"> + <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 + > + </div> + </el-form> + </div> + <el-table + v-loading="loading" + border + highlight-current-row + :data="donatebaseinfoList" + @row-click="selectDonotor" + > <!-- <el-table-column label="鎹愮尞缂栧彿" align="center" prop="donorno" /> --> <el-table-column label="鎹愮尞杩涘害" align="center" prop="recordstate"> <template slot-scope="scope"> - <dict-tag :options="dict.type.sys_DonationStatus" :value="scope.row.recordstate" /> + <dict-tag + :options="dict.type.sys_DonationStatus" + :value="scope.row.recordstate" + /> </template> </el-table-column> <el-table-column label="濮撳悕" align="center" prop="name" /> </el-table> - <pagination v-show="total > 0" :total="total" small :page.sync="queryParams.pageNum" - :limit.sync="queryParams.pageSize" @pagination="getBaseInfoList" /> + <pagination + v-show="total > 0" + :total="total" + small + :page.sync="queryParams.pageNum" + :limit.sync="queryParams.pageSize" + @pagination="getBaseInfoList" + /> </el-card> </el-col> <el-col :span="18"> @@ -53,7 +93,10 @@ <el-row :gutter="4" align="right" class="mb8"> <el-col :span="9"> <el-form-item label="鎹愮尞缂栧彿"> - <el-input v-model="curCase.donorno" :disabled="true"></el-input> + <el-input + v-model="curCase.donorno" + :disabled="true" + ></el-input> </el-form-item> </el-col> <el-col :span="9"> @@ -65,49 +108,147 @@ </el-row> <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="['project:medicalfund:add']">鏂板鐢宠鍗�</el-button> + <el-button + type="primary" + plain + icon="el-icon-plus" + size="mini" + @click="handleAdd" + v-hasPermi="['project:medicalfund:add']" + >鏂板鐢宠鍗�</el-button + > </el-col> </el-row> <el-row> - <el-table v-loading="loading" border :data="donateconsolationfundList"> - <el-table-column label="鐢宠鏃ユ湡" align="center" prop="createTime" width="150px"> + <el-table + v-loading="loading" + border + :data="donateconsolationfundList" + :row-class-name="rowClassName" + > + <el-table-column + label="鐢宠鏃ユ湡" + align="center" + prop="applyTime" + width="150px" + > <template slot-scope="scope"> <span>{{ - parseTime(scope.row.createTime, "{y}-{m}-{d}") + parseTime(scope.row.applyTime, "{y}-{m}-{d}") }}</span> </template> </el-table-column> - <el-table-column label="鐢宠浜�" align="center" prop="username" width="120px" /> - <el-table-column label="鐢宠閲戦" align="center" prop="pretaxcost" width="200px" /> - <el-table-column label="鎵�灞炵粍鍒�" align="center" prop="deptmentname" width="220px" /> - <el-table-column label="缁勯暱" align="center" prop="managername" width="200px" /> - <el-table-column label="瀹℃牳鐘舵��" align="center" prop="recordstatus"> + <el-table-column + label="鐢宠浜�" + align="center" + prop="username" + width="120px" + /> + <el-table-column + label="鐢宠閲戦" + align="center" + prop="pretaxcost" + width="200px" + /> + <el-table-column + label="鎵�灞炵粍鍒�" + align="center" + prop="deptmentname" + width="220px" + /> + <el-table-column + label="缁勯暱" + align="center" + prop="managername" + width="200px" + /> + <el-table-column + label="瀹℃牳鐘舵��" + align="center" + prop="recordstatus" + > <template slot-scope="scope"> - <dict-tag :options="dict.type.sys_recordstatus" :value="scope.row.recordstatus" /> + <dict-tag + :options="dict.type.sys_recordstatus" + :value="scope.row.recordstatus" + /> + </template> + </el-table-column> + <el-table-column + label="鐢宠鏉愭枡鐘舵��" + width="140" + align="center" + prop="checkstatus" + > + <template slot-scope="scope"> + <dict-tag + :options="dict.type.sys_stage_type" + :value="scope.row.checkstatus" + /> </template> </el-table-column> <!-- <el-table-column label="鑱旂郴鐢佃瘽" align="center" prop="phone" width="150px" /> <el-table-column label="宸ヤ綔鍗曚綅" align="center" prop="unitname" width="150px" /> --> - <el-table-column label="鎿嶄綔" fixed="right" align="center" class-name="small-padding fixed-width" - width="280px"> + <el-table-column + label="鎿嶄綔" + fixed="right" + align="center" + class-name="small-padding fixed-width" + width="280px" + > <template slot-scope="scope"> - <el-button v-if="scope.row.recordstatus == -1 || - scope.row.recordstatus == 1 - " size="mini" type="text" icon="el-icon-edit" @click="handleup(scope.row)">涓婃姤</el-button> - <el-button v-if="scope.row.recordstatus == -1 || - scope.row.recordstatus == 1 - " size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" - v-hasPermi="['project:medicalfund:edit']">淇敼</el-button> - <el-button size="mini" type="text" icon="el-icon-view" @click="handleDetail(scope.row)">鏌ョ湅</el-button> - <el-button v-if="scope.row.recordstatus == -1 || - scope.row.recordstatus == 1 - " size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" - v-hasPermi="['project:medicalfund:delete']">鍒犻櫎</el-button> - <el-button size="mini" type="text" icon="el-icon-download" @click="mixExport(scope.row.id)" - v-hasPermi="['project:medicalfund:download']">涓嬭浇</el-button> + <el-button + v-if=" + scope.row.recordstatus == -1 || + scope.row.recordstatus == 1 + " + size="mini" + type="text" + icon="el-icon-edit" + @click="handleup(scope.row)" + >涓婃姤</el-button + > + <el-button + v-if=" + scope.row.recordstatus == -1 || + scope.row.recordstatus == 1 + " + size="mini" + type="text" + icon="el-icon-edit" + @click="handleUpdate(scope.row)" + v-hasPermi="['project:medicalfund:edit']" + >淇敼</el-button + > + <el-button + size="mini" + type="text" + icon="el-icon-view" + @click="handleDetail(scope.row)" + >鏌ョ湅</el-button + > + <el-button + v-if=" + scope.row.recordstatus == -1 || + scope.row.recordstatus == 1 + " + size="mini" + type="text" + icon="el-icon-delete" + @click="handleDelete(scope.row)" + v-hasPermi="['project:medicalfund:delete']" + >鍒犻櫎</el-button + > + <el-button + size="mini" + type="text" + icon="el-icon-download" + @click="mixExport(scope.row.id)" + v-hasPermi="['project:medicalfund:download']" + >涓嬭浇</el-button + > </template> </el-table-column> </el-table> @@ -116,7 +257,6 @@ </el-card> </el-col> </el-row> - </div> </template> @@ -197,7 +337,8 @@ "sys_fund_type", "sys_finsubject", "sys_financeitemtype", - "sys_expensetype" + "sys_expensetype", + "sys_stage_type" ], data() { //杩欓噷瀛樻斁鏁版嵁 @@ -239,7 +380,7 @@ username: [ { required: true, message: "璇疯緭鍏ョ敵璇蜂汉", trigger: "blur" } ], - createTime: [ + applyTime: [ { required: true, message: "璇疯緭鍏ョ敵璇锋棩鏈�", trigger: "blur" } ], deptmentname: [ @@ -326,13 +467,13 @@ this.getUsermsg(); }, - beforeCreate() { }, //鐢熷懡鍛ㄦ湡 - 鍒涘缓涔嬪墠 - beforeMount() { }, //鐢熷懡鍛ㄦ湡 - 鎸傝浇涔嬪墠 - beforeUpdate() { }, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪墠 - updated() { }, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪悗 - beforeDestroy() { }, //鐢熷懡鍛ㄦ湡 - 閿�姣佷箣鍓� - destroyed() { }, //鐢熷懡鍛ㄦ湡 - 閿�姣佸畬鎴� - activated() { }, //濡傛灉椤甸潰鏈塳eep-alive缂撳瓨鍔熻兘锛岃繖涓嚱鏁颁細瑙﹀彂 + beforeCreate() {}, //鐢熷懡鍛ㄦ湡 - 鍒涘缓涔嬪墠 + beforeMount() {}, //鐢熷懡鍛ㄦ湡 - 鎸傝浇涔嬪墠 + beforeUpdate() {}, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪墠 + updated() {}, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪悗 + beforeDestroy() {}, //鐢熷懡鍛ㄦ湡 - 閿�姣佷箣鍓� + destroyed() {}, //鐢熷懡鍛ㄦ湡 - 閿�姣佸畬鎴� + activated() {}, //濡傛灉椤甸潰鏈塳eep-alive缂撳瓨鍔熻兘锛岃繖涓嚱鏁颁細瑙﹀彂 //鏂规硶闆嗗悎 methods: { @@ -382,7 +523,9 @@ } else { const h = this.$createElement; this.$message({ - message: h("p", null, [h("span", null, "璇峰湪宸﹁竟鐨勬崘鐚渚嬭〃閫夋嫨闇�瑕佹搷浣滅殑妗堜緥锛�")]), + message: h("p", null, [ + h("span", null, "璇峰湪宸﹁竟鐨勬崘鐚渚嬭〃閫夋嫨闇�瑕佹搷浣滅殑妗堜緥锛�") + ]) }); } return; @@ -444,8 +587,8 @@ //闄勪欢澶勭悊 this.fileList = this.form.annexbankcard ? this.form.annexbankcard - .split(",") - .map(item => ({ url: item, name: item })) + .split(",") + .map(item => ({ url: item, name: item })) : []; getownFundDetail(id).then(async res => { @@ -491,8 +634,8 @@ //闄勪欢澶勭悊 this.fileList = this.form.annexbankcard ? this.form.annexbankcard - .split(",") - .map(item => ({ url: item, name: item })) + .split(",") + .map(item => ({ url: item, name: item })) : []; listFundflow(listFundflowparams).then(res => { @@ -520,7 +663,7 @@ const ids = row.id || this.ids; this.$modal .confirm("鏄惁纭鍒犻櫎璇ヨ褰曪紵") - .then(function () { + .then(function() { return delFund(ids); }) .then(() => { @@ -534,7 +677,7 @@ this.getfundList(); this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); }) - .catch(() => { }); + .catch(() => {}); }, /** 涓婃姤鎸夐挳鎿嶄綔 */ @@ -548,7 +691,19 @@ //鏌ユ壘鏄惁瀛樺湪鐧昏瀹屾垚璁板綍 //鍒ゆ柇鏄惁瀛樺湪涓婃姤璁板綍 row.recordstatus = 0; - + var currenttime = new Date(); + row.applyTime = + currenttime.getFullYear() + + "-" + + (currenttime.getMonth() + 1) + + "-" + + currenttime.getDate() + + " " + + currenttime.getHours() + + ":" + + currenttime.getMinutes() + + ":" + + currenttime.getSeconds(); updateFund(row).then(response => { if (response.code == 200) { this.$message({ @@ -908,9 +1063,9 @@ tempData.itemid = tempItemArr[itemIndex].id; } if (tempData.id > 0) { - updateFunddetail(tempData).then(response2 => { }); + updateFunddetail(tempData).then(response2 => {}); } else { - addFunddetail(tempData).then(response2 => { }); + addFunddetail(tempData).then(response2 => {}); } } }); @@ -1132,22 +1287,35 @@ // 鎹愮尞鑰呭尰瀛︾粺璁℃墦鍗� dayin2(id) { getdownloadYX(id).then(res => { - if (res.downloadUrl) { - var fileUrl = res; - //鑾峰彇褰撳墠缃戝潃 - var urlBase = process.env.VUE_APP_BASE_API; - var curWWWPath = window.document.location.href; - var pos = curWWWPath.indexOf(window.document.location.pathname); - // 鍒涘缓a鏍囩 - var aEle = document.createElement("a"); - aEle.href = - curWWWPath.substring(0, pos) + urlBase + fileUrl["downloadUrl"]; - aEle.click(); - this.$alert("涓嬭浇鎴愬姛", "鎻愮ず", { - confirmButtonText: "纭畾", - type: "success" + var fileUrl = res; + //鑾峰彇褰撳墠缃戝潃 + var urlBase = process.env.VUE_APP_BASE_API; + var curWWWPath = window.document.location.href; + var pos = curWWWPath.indexOf(window.document.location.pathname); + // 鍒涘缓a鏍囩 + var aEle = document.createElement("a"); + aEle.href = + curWWWPath.substring(0, pos) + urlBase + fileUrl["downloadUrl"]; + console.log(aEle.href); + // 娣诲姞Authorization澶撮儴 + fetch(aEle.href, { + headers: this.headers + }) + .then(response => { + // 灏嗘枃浠朵笅杞介摼鎺ヤ綔涓篵lob瀵硅薄杩涜涓嬭浇 + return response.blob(); + }) + .then(blob => { + const url = window.URL.createObjectURL(new Blob([blob])); + console.log(url); + const link = document.createElement("a"); + link.href = url; + const name = fileUrl["downloadName"]; + link.setAttribute("download", name); // 鏇挎崲file.pdf涓哄疄闄呯殑鏂囦欢鍚� + document.body.appendChild(link); + link.click(); + link.parentNode.removeChild(link); }); - } }); }, @@ -1201,7 +1369,7 @@ }, //鏂囦欢涓婁紶 - handleUploadError() { }, + handleUploadError() {}, handleremove(file) { this.fileList.splice(this.fileList.indexOf(file), 1); @@ -1268,10 +1436,19 @@ this.$modal.msgWarning("褰撳墠鏂囦欢鏆備笉鏀寔棰勮"); this.previewpdf = false; } + }, + rowClassName({ row, column, rowIndex, columnIndex }) { + if (row.recordstatus == -1 && row.backflowlevel >= 0) { + return "error-row"; + } + return ""; } } }; </script> -<style scoped> +<style lang="scss" scoped> /* @import url(); 寮曞叆鍏叡css绫� */ +::v-deep.el-table .error-row { + background: #fcebeb; +} </style> -- Gitblit v1.9.3