From ad33e8834b09f52f3751be207b75346ab6be7494 Mon Sep 17 00:00:00 2001 From: yxh <172933527@qq.com> Date: 星期三, 03 一月 2024 17:35:36 +0800 Subject: [PATCH] yxh --- src/views/project/donorcharge/donorcharge/index.vue | 244 +++++++- src/views/project/donorcharge/organcharge/index.vue | 294 ++++++++++ src/views/project/donorcharge/donorchargedetail/index.vue | 1003 +++++++++++++++++++++++++++++++++++++ src/api/project/organcharge.js | 53 + 4 files changed, 1,554 insertions(+), 40 deletions(-) diff --git a/src/api/project/organcharge.js b/src/api/project/organcharge.js new file mode 100644 index 0000000..9309cf3 --- /dev/null +++ b/src/api/project/organcharge.js @@ -0,0 +1,53 @@ +import request from '@/utils/request' + +// 鏌ヨ浜轰綋鍣ㄥ畼鑾峰彇璐圭敤鍒楄〃 +export function listOrgancharge(query) { + return request({ + url: '/project/organcharge/list', + method: 'get', + params: query + }) +} + +// 鏌ヨ浜轰綋鍣ㄥ畼鑾峰彇璐圭敤璇︾粏 +export function getOrgancharge(id) { + return request({ + url: '/project/organcharge/getInfo/' + id, + method: 'get' + }) +} + +// 鏂板浜轰綋鍣ㄥ畼鑾峰彇璐圭敤 +export function addOrgancharge(data) { + return request({ + url: '/project/organcharge/add', + method: 'post', + data: data + }) +} + +// 淇敼浜轰綋鍣ㄥ畼鑾峰彇璐圭敤 +export function updateOrgancharge(data) { + return request({ + url: '/project/organcharge/edit', + method: 'post', + data: data + }) +} + +// 鍒犻櫎浜轰綋鍣ㄥ畼鑾峰彇璐圭敤 +export function delOrgancharge(id) { + return request({ + url: '/project/organcharge/remove' + id, + method: 'get' + }) +} + +// 瀵煎嚭浜轰綋鍣ㄥ畼鑾峰彇璐圭敤 +export function exportOrgancharge(query) { + return request({ + url: '/project/organcharge/export', + method: 'get', + params: query + }) +} \ No newline at end of file diff --git a/src/views/project/donorcharge/index.vue b/src/views/project/donorcharge/donorcharge/index.vue similarity index 61% rename from src/views/project/donorcharge/index.vue rename to src/views/project/donorcharge/donorcharge/index.vue index 230d90e..548cf47 100644 --- a/src/views/project/donorcharge/index.vue +++ b/src/views/project/donorcharge/donorcharge/index.vue @@ -47,24 +47,19 @@ <span>{{ parseTime(scope.row.donatetime, '{y}-{m}-{d}') }}</span> </template> </el-table-column> - <el-table-column label="OPO缂栧彿" align="center" prop="donateno" /> + <el-table-column label="妗堜緥缂栧彿" align="center" prop="donateno" /> <el-table-column label="鎹愮尞濮撳悕" align="center" prop="name" /> - <el-table-column label="鍑虹敓骞存湀" align="center" prop="borthdate" width="180"> - <template slot-scope="scope"> - <span>{{ parseTime(scope.row.borthdate, '{y}-{m}-{d}') }}</span> - </template> - </el-table-column> - <el-table-column label="鎬у埆" align="center" prop="sex" /> - <el-table-column label="骞撮緞" align="center" prop="age" /> <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="chargeamounted" /> <el-table-column label="澶囨敞" align="center" prop="remark" /> - <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width"> + <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" icon="el-icon-delete" @click="handleDelete(scope.row)" v-hasPermi="['system:donorcharge:remove']">鍒犻櫎</el-button> </template> @@ -132,16 +127,87 @@ <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, getDonorchargeorgan, delDonorchargeorgan, addDonorchargeorgan, updateDonorchargeorgan, exportDonorchargeorgan } from "@/api/project/donorcharge"; export default { name: "Donorcharge", @@ -161,27 +227,46 @@ 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, - donateno: null, - donatetime: null, name: null, - borthdate: null, - sex: null, - age: null, donationcategory: null, donateorgan: null, - chargeamount: null, chargeamounted: null, + }, + //鏌ヨ妗堜緥鍙傛暟 + donorParams: { + pageNum: 1, + pageSize: 1000, + }, + // 鏌ヨ璐圭敤鍣ㄥ畼琛ㄥ弬鏁� + organParams: { + pageNum: 1, + pageSize: 10, + donorchargeid: null, }, // 琛ㄥ崟鍙傛暟 form: {}, @@ -193,7 +278,24 @@ 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: "/finance/donorchargedetail/", + query: { id: 0, operation: "add", data: curdonorinfo } + }); + }, + /** 鏌ヨ鎹愮尞妗堜緥鍣ㄥ畼鍒楀垪琛� */ getList() { this.loading = true; @@ -203,6 +305,7 @@ this.loading = false; }); }, + // 鍙栨秷鎸夐挳 cancel() { this.open = false; @@ -250,20 +353,102 @@ }, /** 鏂板鎸夐挳鎿嶄綔 */ 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; + this.donorinfolist.forEach(item => { + this.donorlist.push({ + donorid: item.id, + donorname: item.name + }); + }); + this.loading = false; + }); + } + + this.showSelectionDialog = true; + }; + + /** this.reset(); this.open = true; - this.title = "娣诲姞鎹愮尞妗堜緥鍣ㄥ畼鍒�"; + this.title = "鎹愮尞妗堜緥鍣ㄥ畼璐圭敤鎯呭喌"; + this.donorchargerogans = []; + */ }, + /** 淇敼鎸夐挳鎿嶄綔 */ handleUpdate(row) { + this.$router.push({ + path: "/finance/donorchargedetail/", + query: { id: row.id, operation: "update", data: row } + }); + + /** this.reset(); const id = row.id || this.ids getDonorcharge(id).then(response => { this.form = response.data; this.open = true; - this.title = "淇敼鎹愮尞妗堜緥鍣ㄥ畼鍒�"; + this.title = "淇敼鎹愮尞妗堜緥鍣ㄥ畼璐圭敤鎯呭喌"; + + //鍣ㄥ畼璐圭敤淇℃伅 + // this.organParams.infoid = row.infoid; + this.organParams.donorchargeid = row.id; + listDonorchargeorgan(this.organParams).then(res => { + console.log(res); + this.donorchargerogans = res.rows; + if (this.donorchargerogans.length > 0) { + } else { + this.addRow(0); + } + }); + }); + */ + }, + + /** 璇︽儏鏌ョ湅鎸夐挳鎿嶄綔 */ + handleDetail(row) { + this.$router.push({ + path: "/finance/donorchargedetail/", + 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 => { @@ -284,27 +469,6 @@ } }); }, - /** 鍒犻櫎鎸夐挳鎿嶄綔 */ - 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(() => { }); - } } }; </script> diff --git a/src/views/project/donorcharge/donorchargedetail/index.vue b/src/views/project/donorcharge/donorchargedetail/index.vue new file mode 100644 index 0000000..0985c94 --- /dev/null +++ b/src/views/project/donorcharge/donorchargedetail/index.vue @@ -0,0 +1,1003 @@ +<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="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="age"> + <el-input v-model="form.age" placeholder="璇疯緭鍏ュ勾榫�" /> + </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="10"><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="donatetime"> + <el-date-picker clearable size="small" v-model="form.donatetime" type="date" value-format="yyyy-MM-dd" + placeholder="閫夋嫨鎹愮尞鏃堕棿"> + </el-date-picker> + </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="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="10"> + <el-form-item label="澶囨敞" prop="remark"> + <el-input v-model="form.remark" placeholder="璇疯緭鍏ュ娉�" /> + </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 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="organcharge" align="center" label="鏍囧噯璐圭敤" width="150"> + <template slot-scope="scope"> + <el-input v-model="scope.row.organcharge" placeholder="鏍囧噯璐圭敤" /> + </template> + </el-table-column> + <el-table-column prop="hospitalname" align="center" label="鎺ユ敹鍖婚櫌" width="280"> + <template slot-scope="scope"> + <el-input v-model="scope.row.hospitalname" 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="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" v-if="operationType == 'add' || operationType == 'update'">淇� + 瀛�</el-button> + <el-button type="primary" @click="cancel">鍏抽棴</el-button> + </div> + </div> + + <el-dialog v-dialogDrags :modal="false" :close-on-click-modal="false" :title="pdftitle" :visible.sync="pdfVisible" + width="60%"> + <el-tabs style="margin-top: 20px;" v-model="activeName" type="border-card" @tab-click="handleClick"> + <el-tab-pane label="鏅�氶檮浠�" :name="1"> + <div class="pdfimg"> + <div class="box-pdf"> + <div> + <el-upload size="mini" class="upload-demo" :action="uploadFileUrl" :file-list="fileListto" + :show-file-list="false" multiple drag :headers="headers" :on-success="(response, file, fileList) => + uploadSccess(response, file, fileList) + " :on-preview="downFile" :disabled="operationType == 'detail'" :on-error="handleUploadError" + :on-remove="remove" accept="image/*,.pdf"> + <i class="el-icon-upload"></i> + <div class="el-upload__text"> + 灏嗙エ鎹嫋鍒版澶勶紝鎴� + <em><el-button :disabled="operationType == 'detail'" size="small" type="primary">鐐瑰嚮涓婁紶</el-button></em> + </div> + </el-upload> + <el-table :data="fileListto" @row-click="downFile" style="width: 100%" height="400"> + <el-table-column prop="name" :show-overflow-tooltip="true" label="鍚嶇О"> + <template slot-scope="scope"> + <i style="color:#409EFF" class=" el-icon-s-order" />{{ + scope.row.name + }} + </template> + </el-table-column> + + <el-table-column prop="name" width="180" :show-overflow-tooltip="true" label="鍔熻兘"> + <template slot-scope="scope"> + <el-button type="primary" size="mini" + @click.native.prevent.stop="deletedowfile(scope.row)">鍒犻櫎</el-button> + <el-button type="primary" size="mini" + @click.native.prevent.stop="moveupdowfile(scope.row)">涓婄Щ</el-button> + </template> + </el-table-column> + </el-table> + </div> + </div> + + <div v-if="this.previewpdf && pdfimgsrcList.length" class="pdfimgmin"> + <!-- <img :src="pdfimg" /> --> + <el-image style="width: 95%; height: 90%" :src="pdfimg" :preview-src-list="pdfimgsrcList"> + <!-- <div slot="error" class="image-slot"> + <i class="el-icon-picture-outline"></i> + </div> --> + </el-image> + </div> + <div v-else class="pdfimgmins">{{ hintitle }}</div> + </div> + </el-tab-pane> + <el-tab-pane label="鍙戠エ鏂囦欢" :name="2"> + <div class="pdfimg"> + <div class="box-pdf"> + <div> + <el-upload size="mini" class="upload-demo" :action="uploadFileUrl" :file-list="invoicefileList" + :show-file-list="false" multiple drag :headers="headers" :on-success="(response, file, fileList) => + uploadSccess(response, file, fileList) + " :on-preview="downFile" :disabled="operationType == 'detail'" :on-error="handleUploadError" + :on-remove="remove" accept="image/*,.pdf"> + <i class="el-icon-upload"></i> + <div class="el-upload__text"> + 灏嗗彂绁ㄦ枃浠舵嫋鍒版澶勶紝鎴� + <em><el-button :disabled="operationType == 'detail'" size="small" type="primary">鐐瑰嚮涓婁紶</el-button></em> + </div> + </el-upload> + <el-table :data="invoicefileListto" @row-click="downFile" style="width: 100%" height="400"> + <el-table-column prop="name" :show-overflow-tooltip="true" label="鍚嶇О"> + <template slot-scope="scope"> + <i style="color:#409EFF" class=" el-icon-s-order" />{{ + scope.row.name + }} + </template> + </el-table-column> + + <el-table-column prop="name" width="180" :show-overflow-tooltip="true" label="鍔熻兘"> + <template slot-scope="scope"> + <el-button type="primary" size="mini" + @click.native.prevent.stop="deletedowfile(scope.row)">鍒犻櫎</el-button> + <el-button type="primary" size="mini" + @click.native.prevent.stop="moveupdowfile(scope.row)">涓婄Щ</el-button> + </template> + </el-table-column> + </el-table> + </div> + </div> + + <div v-if="this.previewpdf && invoicepdfimgsrcList.length" class="pdfimgmin"> + <el-image style="width: 95%; height: 90%" :src="invoicepdfimg" :preview-src-list="invoicepdfimgsrcList"> + </el-image> + </div> + <div v-else class="pdfimgmins">{{ hintitle }}</div> + </div> + </el-tab-pane> + </el-tabs> + </el-dialog> + <el-dialog title="鎻愮ず" :visible.sync="Savereminder" width="30%"> + <el-alert :title="'鎮ㄥ凡娣诲姞' + + totalquantity + + '鏉℃暟鎹紝涓洪槻姝㈡暟鎹涪澶辨槸鍚︽彁浜や繚瀛樺啀缁х画娣诲姞銆�' + " type="warning"> + </el-alert> + <span slot="footer" class="dialog-footer"> + <el-button @click="unsave">鍙� 娑�</el-button> + <el-button type="primary" @click="Savenow">纭� 瀹�</el-button> + </span> + </el-dialog> + </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, listDonorchargeorgan, getDonorchargeorgan, delDonorchargeorgan, addDonorchargeorgan, updateDonorchargeorgan, exportDonorchargeorgan } from "@/api/project/donorcharge"; +import { listDonatebaseinfo } from "@/api/project/donatebaseinfo"; +import { listDonatecomporgan } from "@/api/project/donatecompletioninfo"; +import { listOrgancharge } from "@/api/project/organcharge"; +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, + Li_area_select, + pdf + }, + dicts: [ + "sys_user_sex", + "sys_0_1", + ], + name: "Donorcharge", + 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: {}, + 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 + "椤�"; + } + }, + remove(file, fileList) { + const donorchargeorgans = [...this.donorchargeorgans]; + if (this.activeName == 1) { + this.fileListto.splice(this.fileListto.indexOf(file), 1); + donorchargeorgans[this.atpresent].annexfilesList = this.fileListto; + } else { + this.invoicefileListto.splice(this.invoicefileListto.indexOf(file), 1); + donorchargeorgans[this.atpresent].invoicefilesList = this.invoicefileListto; + } + }, + + handleExceed() { + this.$message.error(`涓婁紶鏂囦欢鏁伴噺涓嶈兘瓒呰繃 ${5} 涓�!`); + }, + + //鏂囦欢涓婁紶鎴愬姛鍥炶皟 + uploadSccess(response, file, fileList) { + this.donorchargeorgans; + //鑾峰彇绁ㄦ嵁淇℃伅浣嶇疆 + if (this.activeName == 1) { + if (response.code == 200) { + // this.form.filename = file.raw.name; + this.previewpdf = true; + this.$modal.msgSuccess(response.msg); + this.fileListto.push({ + name: file.name, + url: response.fileName + }); + this.pdfimgsrcList.push( + this.Networkheader + "/prod-api" + response.fileName + ); + + this.pdftitle = "鍏�" + this.pdfimgsrcList.length + "椤�"; + this.pdfimg = this.Networkheader + "/prod-api" + response.fileName; + this.donorchargeorgans[this.atpresent].annexfilesList = this.fileListto; + } else { + console.log(response.msg); + } + } else { + if (response.code == 200) { + // this.form.filename = file.raw.name; + this.previewpdf = true; + this.$modal.msgSuccess(response.msg); + this.invoicefileListto.push({ + name: file.name, + url: response.fileName + }); + this.invoicepdfimgsrcList.push( + this.Networkheader + "/prod-api" + response.fileName + ); + + this.pdftitle = "鍏�" + this.invoicepdfimgsrcList.length + "椤�"; + this.pdfimg = this.Networkheader + "/prod-api" + response.fileName; + this.donorchargeorgans[ + this.atpresent + ].invoicefilesList = this.invoicefileListto; + } else { + console.log(response.msg); + } + } + }, + // 鐐瑰嚮绁ㄦ嵁 + Filepopup(index, rows, row) { + this.tableDatatop = []; + this.pdfimgsrcList = []; + this.invoDatatop = []; + this.invoicepdfimgsrcList = []; + this.invoDatatop.push(row); + this.tableDatatop.push(row); + this.atpresent = index; + this.pdfVisible = true; + + + if (this.donorchargeorgans[index].annexfilesList) { + this.previewpdf = true; + this.fileListto = this.donorchargeorgans[index].annexfilesList; + this.pdfimg = this.Networkheader + "/prod-api" + this.fileListto[0].url; + this.fileListto.forEach(item => { + this.pdfimgsrcList.push(this.Networkheader + "/prod-api" + item.url); + }); + } else { + this.fileListto = []; + this.pdfimg = ""; + this.pdftitle = ""; + } + // -鍙戠エ鏂囦欢 + if (this.donorchargeorgans[index].invoicefilesList) { + this.previewpdf = true; + this.invoicefileListto = this.donorchargeorgans[index].invoicefilesList; + this.invoicepdfimg = + this.Networkheader + "/prod-api" + this.invoicefileListto[0].url; + this.invoicefileListto.forEach(item => { + this.invoicepdfimgsrcList.push( + this.Networkheader + "/prod-api" + item.url + ); + }); + + } else { + this.invoicefileListto = []; + this.invoicepdfimg = ""; + this.pdftitle = ""; + } + + if (this.activeName == 1) { + this.pdftitle = "鍏�" + this.pdfimgsrcList.length + "椤�"; + } else { + this.pdftitle = "鍏�" + this.invoicepdfimgsrcList.length + "椤�"; + } + }, + + // 鐐瑰嚮宸蹭笂浼犳枃浠� + downFile(item) { + if (this.activeName == 1) { + this.pdftitle = + "鍏�" + this.pdfimgsrcList.length + "椤癸紝褰撳墠閫変腑" + 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 = this.Networkheader + "/prod-api" + item.url; + } else { + this.pdfimg = this.Networkheader + "/prod-api" + item.response.url; + } + } else { + this.hintitle = "褰撳墠鏂囦欢鏆備笉鏀寔棰勮"; + this.$modal.msgWarning("褰撳墠鏂囦欢鏆備笉鏀寔棰勮"); + this.previewpdf = false; + } + } else { + console.log(item, "鐐瑰嚮鏂囦欢鎷縤tem"); + this.pdftitle = + "鍏�" + this.invoicepdfimgsrcList.length + "椤癸紝褰撳墠閫変腑" + 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.invoicepdfimg = this.Networkheader + "/prod-api" + item.url; + } else { + this.invoicepdfimg = + this.Networkheader + "/prod-api" + item.response.url; + } + } else { + this.hintitle = "褰撳墠鏂囦欢鏆備笉鏀寔棰勮"; + this.$modal.msgWarning("褰撳墠鏂囦欢鏆備笉鏀寔棰勮"); + this.previewpdf = false; + } + } + }, + getIndexInArray(arr, obj) { + return arr.indexOf(obj); + }, + // 鐐瑰嚮鍒犻櫎 + deletedowfile(row) { + if (this.activeName == 1) { + const indexlist = this.getIndexInArray( + this.pdfimgsrcList, + this.Networkheader + "/prod-api" + row.url + ); + this.pdfimgsrcList.splice(indexlist, 1); + const index = this.getIndexInArray(this.fileListto, row); + this.fileListto.splice(index, 1); + } else { + const indexlist = this.getIndexInArray( + this.invoicepdfimgsrcList, + this.Networkheader + "/prod-api" + row.url + ); + this.invoicepdfimgsrcList.splice(indexlist, 1); + const index = this.getIndexInArray(this.invoicefileListto, row); + this.invoicefileListto.splice(index, 1); + } + }, + // 鐐瑰嚮涓婄Щ + moveupdowfile(row) { + if (this.activeName == 1) { + const index = this.getIndexInArray(this.fileListto, row); + const item = this.fileListto.splice(index, 1)[0]; // 绉婚櫎鎸囧畾绱㈠紩澶勭殑鍏冪礌锛屽苟淇濆瓨鍒癷tem鍙橀噺涓� + this.fileListto.splice(index - 1, 0, item); // 灏唅tem鎻掑叆鍒扮储寮曚綅缃殑鍓嶄竴浣� + } else { + const index = this.getIndexInArray(this.invoicefileListto, row); + const item = this.invoicefileListto.splice(index, 1)[0]; // 绉婚櫎鎸囧畾绱㈠紩澶勭殑鍏冪礌锛屽苟淇濆瓨鍒癷tem鍙橀噺涓� + this.invoicefileListto.splice(index - 1, 0, item); // 灏唅tem鎻掑叆鍒扮储寮曚綅缃殑鍓嶄竴浣� + } + }, + + // 琛ㄥ崟閲嶇疆 + 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; + + 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); + } + }); + }); + }, + + /** 淇敼鏌ョ湅鎿嶄綔 */ + 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) { + if (this.form.id != null) { + updateDonorcharge(this.form).then(response => { + if (response.code == 200) { + this.$modal.msgSuccess("淇濆瓨鎴愬姛锛�"); + } + this.open = false; + }); + } else { + addDonorcharge(this.form).then(response => { + if (response.code == 200) { + console.log(response); + this.$modal.msgSuccess("淇濆瓨鎴愬姛锛�"); + } + this.open = false; + }); + } + } + }); + }, 500), + + //璁$畻璐圭敤鍚堣 + sumTotalFee() { + let allSum = 0; + + //鎹愮尞鑰呭灞炶垂鐢� + if (!isNaN(parseFloat(this.form.donoramount))) { + allSum += parseFloat(this.form.donoramount); + } + + //鎶ラ攢鏄庣粏璐圭敤 + try { + for (let i = 0; i < this.donorchargeorgans.length; i++) { + /* + let totalFee = 0; + //璁$畻褰撳墠鎶ラ攢鍐呭璐圭敤鍚堣 + if (!isNaN(parseFloat(this.donorchargeorgans[i].total))) { + totalFee += parseFloat(this.donorchargeorgans[i].total); + } + if (!isNaN(parseFloat(this.donorchargeorgans[i].cityfee))) { + totalFee += parseFloat(this.donorchargeorgans[i].cityfee); + } + if (!isNaN(parseFloat(this.donorchargeorgans[i].hotelexpense))) { + totalFee += parseFloat(this.donorchargeorgans[i].hotelexpense); + } + if (!isNaN(parseFloat(this.donorchargeorgans[i].otherexpense))) { + totalFee += parseFloat(this.donorchargeorgans[i].otherexpense); + } + if (!isNaN(parseFloat(this.donorchargeorgans[i].foodexpenses))) { + totalFee += parseFloat(this.donorchargeorgans[i].foodexpenses); + } + if (!isNaN(parseFloat(this.donorchargeorgans[i].foodallowance))) { + totalFee += parseFloat(this.donorchargeorgans[i].foodallowance); + } + if (!isNaN(parseFloat(this.donorchargeorgans[i].otherfeeamount))) { + totalFee += parseFloat(this.donorchargeorgans[i].otherfeeamount); + } + this.donorchargeorgans[i].total = parseFloat(totalFee).toFixed(2); + this.$set(this.donorchargeorgans, i, this.donorchargeorgans[i]); + */ + + if (!isNaN(parseFloat(this.donorchargeorgans[i].total))) { + allSum += parseFloat(this.donorchargeorgans[i].total); + } + } + + this.form.amountrequested = allSum.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; + } +} + +::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> diff --git a/src/views/project/donorcharge/organcharge/index.vue b/src/views/project/donorcharge/organcharge/index.vue new file mode 100644 index 0000000..e2bdecb --- /dev/null +++ b/src/views/project/donorcharge/organcharge/index.vue @@ -0,0 +1,294 @@ +<template> + <div class="app-container"> + <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="68px"> + <el-form-item label="鍣ㄥ畼缂栫爜" prop="organcode"> + <el-input + v-model="queryParams.organcode" + placeholder="璇疯緭鍏ュ櫒瀹樼紪鐮�" + clearable + size="small" + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="鍣ㄥ畼鍚嶇О" prop="organname"> + <el-input + v-model="queryParams.organname" + placeholder="璇疯緭鍏ュ櫒瀹樺悕绉�" + clearable + size="small" + @keyup.enter.native="handleQuery" + /> + </el-form-item> + <el-form-item label="鑾峰彇璐圭敤" prop="charge"> + <el-input + v-model="queryParams.charge" + 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:organcharge: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:organcharge: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:organcharge:remove']" + >鍒犻櫎</el-button> + </el-col> + <el-col :span="1.5"> + <el-button + type="warning" + plain + icon="el-icon-download" + size="mini" + :loading="exportLoading" + @click="handleExport" + v-hasPermi="['system:organcharge:export']" + >瀵煎嚭</el-button> + </el-col> + <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> + </el-row> + + <el-table v-loading="loading" :data="organchargeList" @selection-change="handleSelectionChange"> + <el-table-column type="selection" width="55" align="center" /> + <el-table-column label="鑾峰彇璐圭敤" align="center" prop="id" /> + <el-table-column label="鍣ㄥ畼缂栫爜" align="center" prop="organcode" /> + <el-table-column label="鍣ㄥ畼鍚嶇О" align="center" prop="organname" /> + <el-table-column label="鑾峰彇璐圭敤" align="center" prop="charge" /> + <el-table-column label="澶囨敞" align="center" prop="remark" /> + <el-table-column label="鎿嶄綔" align="center" class-name="small-padding fixed-width"> + <template slot-scope="scope"> + <el-button + size="mini" + type="text" + icon="el-icon-edit" + @click="handleUpdate(scope.row)" + v-hasPermi="['system:organcharge:edit']" + >淇敼</el-button> + <el-button + size="mini" + type="text" + icon="el-icon-delete" + @click="handleDelete(scope.row)" + v-hasPermi="['system:organcharge:remove']" + >鍒犻櫎</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" width="500px" append-to-body> + <el-form ref="form" :model="form" :rules="rules" label-width="80px"> + <el-form-item label="鍣ㄥ畼缂栫爜" prop="organcode"> + <el-input v-model="form.organcode" placeholder="璇疯緭鍏ュ櫒瀹樼紪鐮�" /> + </el-form-item> + <el-form-item label="鍣ㄥ畼鍚嶇О" prop="organname"> + <el-input v-model="form.organname" placeholder="璇疯緭鍏ュ櫒瀹樺悕绉�" /> + </el-form-item> + <el-form-item label="鑾峰彇璐圭敤" prop="charge"> + <el-input v-model="form.charge" placeholder="璇疯緭鍏ヨ幏鍙栬垂鐢�" /> + </el-form-item> + <el-form-item label="澶囨敞" prop="remark"> + <el-input v-model="form.remark" placeholder="璇疯緭鍏ュ娉�" /> + </el-form-item> + </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> + </div> +</template> + +<script> +import { listOrgancharge, getOrgancharge, delOrgancharge, addOrgancharge, updateOrgancharge, exportOrgancharge } from "@/api/project/organcharge"; + +export default { + name: "Organcharge", + data() { + return { + // 閬僵灞� + loading: true, + // 瀵煎嚭閬僵灞� + exportLoading: false, + // 閫変腑鏁扮粍 + ids: [], + // 闈炲崟涓鐢� + single: true, + // 闈炲涓鐢� + multiple: true, + // 鏄剧ず鎼滅储鏉′欢 + showSearch: true, + // 鎬绘潯鏁� + total: 0, + // 浜轰綋鍣ㄥ畼鑾峰彇璐圭敤琛ㄦ牸鏁版嵁 + organchargeList: [], + // 寮瑰嚭灞傛爣棰� + title: "", + // 鏄惁鏄剧ず寮瑰嚭灞� + open: false, + // 鏌ヨ鍙傛暟 + queryParams: { + pageNum: 1, + pageSize: 10, + organcode: null, + organname: null, + charge: null, + }, + // 琛ㄥ崟鍙傛暟 + form: {}, + // 琛ㄥ崟鏍¢獙 + rules: { + } + }; + }, + created() { + this.getList(); + }, + methods: { + /** 鏌ヨ浜轰綋鍣ㄥ畼鑾峰彇璐圭敤鍒楄〃 */ + getList() { + this.loading = true; + listOrgancharge(this.queryParams).then(response => { + this.organchargeList = response.rows; + this.total = response.total; + this.loading = false; + }); + }, + // 鍙栨秷鎸夐挳 + cancel() { + this.open = false; + this.reset(); + }, + // 琛ㄥ崟閲嶇疆 + reset() { + this.form = { + id: null, + organcode: null, + organname: null, + charge: null, + delFlag: null, + remark: 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.reset(); + this.open = true; + this.title = "娣诲姞浜轰綋鍣ㄥ畼鑾峰彇璐圭敤"; + }, + /** 淇敼鎸夐挳鎿嶄綔 */ + handleUpdate(row) { + this.reset(); + const id = row.id || this.ids + getOrgancharge(id).then(response => { + this.form = response.data; + this.open = true; + this.title = "淇敼浜轰綋鍣ㄥ畼鑾峰彇璐圭敤"; + }); + }, + /** 鎻愪氦鎸夐挳 */ + submitForm() { + this.$refs["form"].validate(valid => { + if (valid) { + if (this.form.id != null) { + updateOrgancharge(this.form).then(response => { + this.$modal.msgSuccess("淇敼鎴愬姛"); + this.open = false; + this.getList(); + }); + } else { + addOrgancharge(this.form).then(response => { + this.$modal.msgSuccess("鏂板鎴愬姛"); + this.open = false; + this.getList(); + }); + } + } + }); + }, + /** 鍒犻櫎鎸夐挳鎿嶄綔 */ + handleDelete(row) { + const ids = row.id || this.ids; + this.$modal.confirm('鏄惁纭鍒犻櫎浜轰綋鍣ㄥ畼鑾峰彇璐圭敤缂栧彿涓�"' + ids + '"鐨勬暟鎹」锛�').then(function() { + return delOrgancharge(ids); + }).then(() => { + this.getList(); + this.$modal.msgSuccess("鍒犻櫎鎴愬姛"); + }).catch(() => {}); + }, + /** 瀵煎嚭鎸夐挳鎿嶄綔 */ + handleExport() { + const queryParams = this.queryParams; + this.$modal.confirm('鏄惁纭瀵煎嚭鎵�鏈変汉浣撳櫒瀹樿幏鍙栬垂鐢ㄦ暟鎹」锛�').then(() => { + this.exportLoading = true; + return exportOrgancharge(queryParams); + }).then(response => { + this.$download.name(response.msg); + this.exportLoading = false; + }).catch(() => {}); + } + } +}; +</script> -- Gitblit v1.9.3