From 40e702344f3d35e251bb098d1227fdea74ee8e4e Mon Sep 17 00:00:00 2001 From: WXL <1785969728@qq.com> Date: 星期三, 20 三月 2024 17:50:24 +0800 Subject: [PATCH] 11 --- src/views/project/fund/medicalCostApply/index.vue | 414 ++++++++++++++++++++++++++++++++++++++++++---------------- 1 files changed, 300 insertions(+), 114 deletions(-) diff --git a/src/views/project/fund/medicalCostApply/index.vue b/src/views/project/fund/medicalCostApply/index.vue index 7b710ce..3859817 100644 --- a/src/views/project/fund/medicalCostApply/index.vue +++ b/src/views/project/fund/medicalCostApply/index.vue @@ -1,39 +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-form-item label="鎹愮尞鑰�" prop="name"> - <el-input - v-model="queryParams.donorname" - placeholder="璇疯緭鍏ユ崘鐚�呭鍚�" - clearable - size="small" - @keyup.enter.native="handleQuery" - /> - </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"> @@ -44,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"> @@ -64,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"> @@ -76,62 +108,167 @@ </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> + 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" + @click="handleDelete(scope.row)" + v-hasPermi="['project:medicalfund:delete']" + ><span class="button-delete" + ><i class="el-icon-delete"></i>鍒犻櫎</span + ></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-column + fixed="right" + align="center" + width="120" + label="鍔熻兘" + > + <template slot-scope="scope"> + <el-button size="mini" v-if="scope.row.uploadStates == 1" + >绾夸笅宸叉姤閿�</el-button + > + <el-button + size="mini" + type="success" + v-else-if="scope.row.uploadStates == 0" + @click="Dooffline(scope.$index, scope.row)" + >绾夸笅鎶ラ攢</el-button + > </template> </el-table-column> </el-table> @@ -140,7 +277,6 @@ </el-card> </el-col> </el-row> - </div> </template> @@ -264,7 +400,7 @@ username: [ { required: true, message: "璇疯緭鍏ョ敵璇蜂汉", trigger: "blur" } ], - createTime: [ + applyTime: [ { required: true, message: "璇疯緭鍏ョ敵璇锋棩鏈�", trigger: "blur" } ], deptmentname: [ @@ -351,13 +487,13 @@ this.getUsermsg(); }, - beforeCreate() { }, //鐢熷懡鍛ㄦ湡 - 鍒涘缓涔嬪墠 - beforeMount() { }, //鐢熷懡鍛ㄦ湡 - 鎸傝浇涔嬪墠 - beforeUpdate() { }, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪墠 - updated() { }, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪悗 - beforeDestroy() { }, //鐢熷懡鍛ㄦ湡 - 閿�姣佷箣鍓� - destroyed() { }, //鐢熷懡鍛ㄦ湡 - 閿�姣佸畬鎴� - activated() { }, //濡傛灉椤甸潰鏈塳eep-alive缂撳瓨鍔熻兘锛岃繖涓嚱鏁颁細瑙﹀彂 + beforeCreate() {}, //鐢熷懡鍛ㄦ湡 - 鍒涘缓涔嬪墠 + beforeMount() {}, //鐢熷懡鍛ㄦ湡 - 鎸傝浇涔嬪墠 + beforeUpdate() {}, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪墠 + updated() {}, //鐢熷懡鍛ㄦ湡 - 鏇存柊涔嬪悗 + beforeDestroy() {}, //鐢熷懡鍛ㄦ湡 - 閿�姣佷箣鍓� + destroyed() {}, //鐢熷懡鍛ㄦ湡 - 閿�姣佸畬鎴� + activated() {}, //濡傛灉椤甸潰鏈塳eep-alive缂撳瓨鍔熻兘锛岃繖涓嚱鏁颁細瑙﹀彂 //鏂规硶闆嗗悎 methods: { @@ -372,6 +508,17 @@ this.resetForm("queryForm"); this.handleQuery(); + }, + Dooffline(a, value) { + value.uploadStates = 1; + value.notes = "绾夸笅宸叉姤閿�"; + addorupdateFund(value).then(res => { + if (res.code == 200) { + this.$modal.msgSuccess("璁板綍鎴愬姛"); + } else { + this.$modal.msgError(res.msg); + } + }); }, /** 鏌ヨ鎹愮尞浜洪亾鎱伴棶閲戝垪琛� */ @@ -407,7 +554,9 @@ } else { const h = this.$createElement; this.$message({ - message: h("p", null, [h("span", null, "璇峰湪宸﹁竟鐨勬崘鐚渚嬭〃閫夋嫨闇�瑕佹搷浣滅殑妗堜緥锛�")]), + message: h("p", null, [ + h("span", null, "璇峰湪宸﹁竟鐨勬崘鐚渚嬭〃閫夋嫨闇�瑕佹搷浣滅殑妗堜緥锛�") + ]) }); } return; @@ -469,8 +618,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 => { @@ -516,8 +665,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 => { @@ -545,7 +694,7 @@ const ids = row.id || this.ids; this.$modal .confirm("鏄惁纭鍒犻櫎璇ヨ褰曪紵") - .then(function () { + .then(function() { return delFund(ids); }) .then(() => { @@ -559,7 +708,7 @@ this.getfundList(); this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); }) - .catch(() => { }); + .catch(() => {}); }, /** 涓婃姤鎸夐挳鎿嶄綔 */ @@ -573,7 +722,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({ @@ -933,9 +1094,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 => {}); } } }); @@ -1157,22 +1318,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); }); - } }); }, @@ -1226,7 +1400,7 @@ }, //鏂囦欢涓婁紶 - handleUploadError() { }, + handleUploadError() {}, handleremove(file) { this.fileList.splice(this.fileList.indexOf(file), 1); @@ -1293,10 +1467,22 @@ this.$modal.msgWarning("褰撳墠鏂囦欢鏆備笉鏀寔棰勮"); this.previewpdf = false; } + }, + rowClassName({ row, column, rowIndex, columnIndex }) { + if (row.recordstatus == -1 && row.backflowlevel != null) { + return "error-row"; + } + return ""; } } }; </script> -<style scoped> +<style lang="scss" scoped> /* @import url(); 寮曞叆鍏叡css绫� */ +.button-delete { + color: rgb(236, 69, 69); +} +::v-deep.el-table .error-row { + background: #fcebeb; +} </style> -- Gitblit v1.9.3