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 ++++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 204 insertions(+), 40 deletions(-) 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> -- Gitblit v1.9.3