From 256c84e5ff19b4597731d12d826d362e0e1e4867 Mon Sep 17 00:00:00 2001 From: yxh <172933527@qq.com> Date: 星期四, 04 一月 2024 17:40:50 +0800 Subject: [PATCH] yxh --- src/views/project/donorcharge/donorchargedetail/index.vue | 50 +++++++++++++++++++++++++++++++++++--------------- 1 files changed, 35 insertions(+), 15 deletions(-) diff --git a/src/views/project/donorcharge/donorchargedetail/index.vue b/src/views/project/donorcharge/donorchargedetail/index.vue index d2975c7..cda6d51 100644 --- a/src/views/project/donorcharge/donorchargedetail/index.vue +++ b/src/views/project/donorcharge/donorchargedetail/index.vue @@ -103,9 +103,9 @@ value-format="yyyy-MM-dd HH:mm:ss" placeholder="绉绘鏃堕棿"> </el-date-picker> </template> </el-table-column> - <el-table-column prop="remark" align="center" label="澶囨敞"> + <el-table-column prop="organchargedesc" align="center" label="澶囨敞"> <template slot-scope="scope"> - <el-input v-model="scope.row.remark" placeholder="澶囨敞" /> + <el-input v-model="scope.row.organchargedesc" placeholder="澶囨敞" /> </template> </el-table-column> </el-table> @@ -232,8 +232,8 @@ 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 { getDonorcharge, addDonorcharge, updateDonorcharge } from "@/api/project/donorcharge"; +import { listDonorchargeorgan, delDonorchargeorgan, saveDonorchargeorgan } from "@/api/project/donorcharge"; import { listDonatecomporgan } from "@/api/project/donatecompletioninfo"; import { listOrgancharge } from "@/api/project/organcharge"; import Li_area_select from "@/components/Address"; @@ -321,6 +321,8 @@ userprofile: {}, // 琛ㄥ崟鍙傛暟 form: {}, + // 鍒楄〃鍙傛暟 + table: {}, reimbursementList: [], // 琛ㄥ崟鏍¢獙 @@ -396,7 +398,7 @@ this.$refs["table"].doLayout(); }); }, - + destroyed() { window.removeEventListener("beforeunload", e => this.beforeunloadFn(e)); }, //鐢熷懡鍛ㄦ湡 - 閿�姣佸畬鎴� @@ -663,7 +665,7 @@ 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); + console.log("this.$route.query", this.$route.query); if (this.operationType == "add") { this.title = "鏂板缓妗堜緥鍣ㄥ畼璐圭敤琛�"; @@ -764,15 +766,17 @@ handleUpdate() { this.reset(); this.open = true; + this.title = "淇敼鎹愮尞妗堜緥鍣ㄥ畼璐圭敤琛�"; getDonorcharge(this.curId).then(response => { this.form = response.data; - this.open = true; - this.title = "淇敼鎹愮尞妗堜緥鍣ㄥ畼璐圭敤琛�"; + console.log("getDonorcharge", response); //鍣ㄥ畼璐圭敤淇℃伅 this.organParams.donorchargeid = this.curId; + console.log("this.organParams", this.organParams); listDonorchargeorgan(this.organParams).then(res => { + console.log("listDonorchargeorgan", res); this.donorchargeorgans = res.rows; if (this.donorchargeorgans.length > 0) { } else { @@ -809,19 +813,35 @@ this.$refs["form"].validate(valid => { if (valid) { if (this.form.id != null) { - updateDonorcharge(this.form).then(response => { - if (response.code == 200) { - this.$modal.msgSuccess("淇濆瓨鎴愬姛锛�"); + for (let k = 0; k < this.donorchargeorgans.length; k++) { + this.donorchargeorgans[k].donorchargeID = this.form.id; + } + + updateDonorcharge(this.form).then(res1 => { + if (res1.code == 200) { + saveDonorchargeorgan(this.donorchargeorgans).then(res2 => { + if (res2.code == 200) { + this.$modal.msgSuccess("淇濆瓨鎴愬姛锛�"); + this.open = false; + } + }); } - this.open = false; }); } else { addDonorcharge(this.form).then(response => { if (response.code == 200) { - console.log(response); - this.$modal.msgSuccess("淇濆瓨鎴愬姛锛�"); + console.log("addDonorcharge", response); + //淇濆瓨鍓嶆牎楠屾暟鎹� + for (let k = 0; k < this.donorchargeorgans.length; k++) { + this.donorchargeorgans[k].donorchargeid = response.data.id; + } + saveDonorchargeorgan(this.donorchargeorgans).then(res2 => { + if (res2.code == 200) { + this.$modal.msgSuccess("淇濆瓨鎴愬姛锛�"); + this.open = false; + } + }); } - this.open = false; }); } } -- Gitblit v1.9.3