From 7bc46f0968567d82f70d310da021e2fc3a707cae Mon Sep 17 00:00:00 2001
From: WXL <1785969728@qq.com>
Date: 星期四, 30 五月 2024 15:04:49 +0800
Subject: [PATCH] 11
---
src/views/project/donationwitness/index.vue | 472 ++++++++++++++++++++++++++++++++--------------------------
1 files changed, 257 insertions(+), 215 deletions(-)
diff --git a/src/views/project/donationwitness/index.vue b/src/views/project/donationwitness/index.vue
index c5cf180..a6bbd22 100644
--- a/src/views/project/donationwitness/index.vue
+++ b/src/views/project/donationwitness/index.vue
@@ -50,13 +50,13 @@
<el-col :span="6">
<el-form-item label="鎹愮尞杩涘害" prop="recordstate">
<el-select
- v-model="queryParams.recordstate"
+ v-model="queryParams.workflow"
placeholder="璇烽�夋嫨鎹愮尞杩涘害"
clearable
size="small"
>
<el-option
- v-for="dict in dict.type.sys_DonationStatus"
+ v-for="dict in dict.type.sys_donornode"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@@ -68,7 +68,10 @@
<el-row :gutter="8">
<el-col :span="6">
<el-form-item label="鎶ュ憡浜�">
- <el-select v-model="queryParams.reporterno" placeholder="璇烽�夋嫨鎶ュ憡浜�">
+ <el-select
+ v-model="queryParams.reporterno"
+ placeholder="璇烽�夋嫨鎶ュ憡浜�"
+ >
<el-option
v-for="item in reportlist"
:key="item.index"
@@ -95,8 +98,6 @@
</el-date-picker>
</el-form-item>
</el-col>
-
-
<el-col :span="6">
<el-form-item>
@@ -115,7 +116,6 @@
</el-row>
</el-form>
<el-row :gutter="10" class="mb8">
-
<el-col :span="1.5">
<el-button
type="warning"
@@ -124,11 +124,9 @@
size="mini"
:loading="exportLoading"
@click="handleExport"
-
>瀵煎嚭</el-button
>
</el-col>
-
</el-row>
<el-table
v-loading="loading"
@@ -136,6 +134,16 @@
border
:data="donatebaseinfoList"
>
+ <el-table-column
+ label="妗堜緥鏃堕棿"
+ align="center"
+ prop="donatetime"
+ width="120"
+ >
+ <template slot-scope="scope">
+ <span>{{ parseTime(scope.row.donatetime, "{y}-{m}-{d}") }}</span>
+ </template>
+ </el-table-column>
<el-table-column
label="鎶ュ憡鏃堕棿"
align="center"
@@ -148,7 +156,7 @@
</el-table-column>
<el-table-column label="濮撳悕" align="center" prop="name" width="100" />
-
+
<el-table-column label="鎬у埆" align="center" prop="sex" width="100">
<template slot-scope="scope">
<dict-tag
@@ -158,13 +166,18 @@
</template>
</el-table-column>
<el-table-column label="骞撮緞" align="center" prop="age" width="100" />
- <el-table-column
+ <el-table-column
label="鍖荤枟鏈烘瀯"
align="center"
prop="treatmenthospitalname"
/>
<!-- <el-table-column label="韬唤璇佸彿" prop="idcardno" width="200" /> -->
- <el-table-column label="鎹愮尞绫诲埆" align="center" prop="dwdonationcategory" width="150">
+ <el-table-column
+ label="鎹愮尞绫诲埆"
+ align="center"
+ prop="dwdonationcategory"
+ width="150"
+ >
<template slot-scope="scope">
<dict-tag
:options="dict.type.sys_DonationCategory"
@@ -173,8 +186,10 @@
</template>
</el-table-column>
<el-table-column label="瑙佽瘉鏃堕棿" align="center" prop="operationbegtime">
- <template slot-scope="scope">
- <span>{{ parseTime(scope.row.operationbegtime, "{y}-{m}-{d}") }}</span>
+ <template slot-scope="scope">
+ <span>{{
+ parseTime(scope.row.operationbegtime, "{y}-{m}-{d}")
+ }}</span>
</template>
</el-table-column>
<el-table-column
@@ -187,13 +202,17 @@
<el-table-column
label="鎹愮尞杩涘害"
align="center"
- prop="recordstate"
+ prop="workflow"
+ width="120"
>
<template slot-scope="scope">
- <dict-tag
- :options="dict.type.sys_DonationStatus"
- :value="scope.row.recordstate"
- />
+ <div v-if="!scope.row.terminationCase">
+ <dict-tag
+ :options="dict.type.sys_donornode"
+ :value="scope.row.workflow"
+ />
+ </div>
+ <div v-else>浠诲姟缁堟</div>
</template>
</el-table-column>
@@ -321,39 +340,6 @@
</el-form-item>
</el-col>
<el-col :span="6">
- <el-form-item label="姘戞棌" prop="nation">
- <el-select
- v-model="curCase.nation"
- disabled
- placeholder="璇烽�夋嫨姘戞棌"
- >
- <el-option
- v-for="dict in dict.type.sys_nation"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col> </el-row
- ><el-row>
- <el-col :span="6">
- <el-form-item label="璇佷欢绫诲瀷" prop="idcardtype">
- <el-select
- v-model="curCase.idcardtype"
- disabled
- placeholder="璇烽�夋嫨璇佷欢绫诲瀷"
- >
- <el-option
- v-for="dict in dict.type.sys_IDType"
- :key="dict.value"
- :label="dict.label"
- :value="parseInt(dict.value)"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="6">
<el-form-item label="璇佷欢鍙风爜" prop="idcardno">
<el-input
ref="updateBSvalue"
@@ -364,40 +350,43 @@
/>
</el-form-item>
</el-col>
+ </el-row>
+ <!--
+ <el-row>
+ <el-col :span="6">
+ <el-form-item label="姘戞棌" prop="nation">
+ <el-select v-model="curCase.nation" disabled placeholder="璇烽�夋嫨姘戞棌">
+ <el-option v-for="dict in dict.type.sys_nation" :key="dict.value" :label="dict.label"
+ :value="dict.value"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
<el-col :span="6">
<el-form-item label="瀛﹀巻" prop="education">
- <el-select
- v-model="curCase.education"
- disabled
- placeholder="璇烽�夋嫨瀛﹀巻"
- >
- <el-option
- v-for="dict in dict.type.sys_education"
- :key="dict.value"
- :label="dict.value"
- :value="dict.value"
- ></el-option>
+ <el-select v-model="curCase.education" disabled placeholder="璇烽�夋嫨瀛﹀巻">
+ <el-option v-for="dict in dict.type.sys_education" :key="dict.value" :label="dict.value"
+ :value="dict.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item label="鑱屼笟" prop="occupation">
- <el-select
- v-model="curCase.occupation"
- disabled
- placeholder="璇烽�夋嫨鑱屼笟"
- >
- <el-option
- v-for="dict in dict.type.sys_occupation"
- :key="dict.value"
- :label="dict.label"
- :value="dict.value"
- ></el-option>
+ <el-select v-model="curCase.occupation" disabled placeholder="璇烽�夋嫨鑱屼笟">
+ <el-option v-for="dict in dict.type.sys_occupation" :key="dict.value" :label="dict.label"
+ :value="dict.value"></el-option>
+ </el-select>
+ </el-form-item>
+ </el-col>
+ <el-col :span="6">
+ <el-form-item label="璇佷欢绫诲瀷" prop="idcardtype">
+ <el-select v-model="curCase.idcardtype" disabled placeholder="璇烽�夋嫨璇佷欢绫诲瀷">
+ <el-option v-for="dict in dict.type.sys_IDType" :key="dict.value" :label="dict.label"
+ :value="parseInt(dict.value)"></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
-
+ -->
<el-row>
<el-col :span="24">
<el-form-item align="left" label="鎹愮尞鍐冲畾">
@@ -838,8 +827,7 @@
import {
listOrganization,
listReportname,
- listUser,
-
+ listUser
} from "@/api/project/organization";
import {
@@ -857,21 +845,22 @@
listDonateorgan,
addDonateorgan,
delDonateorgan,
- updateDonateorgan,
+ updateDonateorgan
} from "@/api/project/donateorgan";
import {
listDonatebaseinfo,
updateDonatebaseinfo,
- getDonatebaseinfo,
+ getDonatebaseinfo
} from "@/api/project/donatebaseinfo";
import Li_area_select from "@/components/Address";
import OrgSelecter from "@/views/project/components/orgselect";
import { updatedonatorno } from "@/api/project/relativesconfirmation";
+import { getToken } from "@/utils/auth";
export default {
components: {
Li_area_select,
- OrgSelecter,
+ OrgSelecter
},
name: "Donationwitness",
dicts: [
@@ -901,18 +890,18 @@
"sys_Infectious",
"sys_InfoSources",
"sys_OtherCases",
- "sys_DonationStatus",
+ "sys_donornode",
"sys_DiseaseType",
"sys_SelfWill",
"sys_FamilyRelation",
"sys_Organ",
- "sys_organstate",
+ "sys_organstate"
],
data() {
return {
starttime: "",
endtime: "",
-
+
// 鎻掔浣嶇疆
cannulatimeList: {},
coordinatorlist1: [],
@@ -933,7 +922,7 @@
{ label: "琛㈠窞甯�", value: "8" },
{ label: "鑸熷北甯�", value: "9" },
{ label: "鍙板窞甯�", value: "A" },
- { label: "涓芥按甯�", value: "B" },
+ { label: "涓芥按甯�", value: "B" }
],
// 鎻掔鏃堕棿
@@ -945,7 +934,7 @@
sheng: "",
shi: "",
qu: "",
- organizationname: null,
+ organizationname: null
},
table: {},
@@ -953,7 +942,9 @@
dialogFormVisible: false,
dialogTableVisible: false,
tableData: [],
-
+ headers: {
+ Authorization: "Bearer " + getToken()
+ },
dosex: "",
dobirthday: "",
donation: "",
@@ -1015,48 +1006,51 @@
reportername: null,
reporttime: null,
city: null,
- treatmenthospitalno: null,
+ treatmenthospitalno: null
},
// 琛ㄥ崟鍙傛暟
form: {},
// 琛ㄥ崟鏍¢獙
rules: {
donationcategory: [
- { required: true, message: "璇疯緭鍏ラ�夋嫨鎹愮尞绫诲埆", trigger: "blur" },
+ { required: true, message: "璇疯緭鍏ラ�夋嫨鎹愮尞绫诲埆", trigger: "blur" }
],
deathjudgedocto: [
- { required: true, message: "璇疯緭鍏ユ浜″垽瀹氫笓瀹朵竴", trigger: "blur" },
+ { required: true, message: "璇疯緭鍏ユ浜″垽瀹氫笓瀹朵竴", trigger: "blur" }
],
deathjudgedoctt: [
- { required: true, message: "璇疯緭鍏ユ浜″垽瀹氫笓瀹朵簩", trigger: "blur" },
+ { required: true, message: "璇疯緭鍏ユ浜″垽瀹氫笓瀹朵簩", trigger: "blur" }
],
deathtime: [
- { required: true, message: "璇疯緭鍏ユ浜℃椂闂�", trigger: "blur" },
+ { required: true, message: "璇疯緭鍏ユ浜℃椂闂�", trigger: "blur" }
],
operationbegtime: [
- { required: true, message: "璇疯緭鍏ユ墜鏈紑濮嬫椂闂�", trigger: "blur" },
+ { required: true, message: "璇疯緭鍏ユ墜鏈紑濮嬫椂闂�", trigger: "blur" }
],
responsibleusername: [
- { required: true, message: "璇疯緭鍏ユ墜鏈礋璐d汉", trigger: "blur" },
+ { required: true, message: "璇疯緭鍏ユ墜鏈礋璐d汉", trigger: "blur" }
],
coordinateduserido: [
- { required: true, message: "璇疯緭鍏ュ崗璋冨憳涓�", trigger: "blur" },
+ { required: true, message: "璇疯緭鍏ュ崗璋冨憳涓�", trigger: "blur" }
],
coordinateduseridt: [
- { required: true, message: "璇疯緭鍏ュ崗璋冨憳浜�", trigger: "blur" },
- ],
+ { required: true, message: "璇疯緭鍏ュ崗璋冨憳浜�", trigger: "blur" }
+ ]
},
curCase: {},
- tempRecordState: null,
+ tempRecordState: null
};
},
created() {
- this.getuserlist();
+ if (sessionStorage.getItem("donationwitness")) {
+ this.queryParams = JSON.parse(sessionStorage.getItem("donationwitness"));
+ console.log(this.queryParams, "queryParams");
+ }
this.getCoordinatorList1();
this.getCoordinatorList2();
- this.getList();
},
- activated() {
+ activated() {},
+ mounted(e) {
this.selecttime = "";
this.reportervalue = "";
this.reportlist = [];
@@ -1067,9 +1061,7 @@
if (this.$route.params.starttime != null && this.$route.params.endtime) {
this.selecttime = [
this.$moment(this.$route.params.starttime).format("YYYY-MM-DD"),
- this.$moment(this.$route.params.endtime)
- .add(-1, "month")
- .format("YYYY-MM-DD"),
+ this.$moment(this.$route.params.endtime).format("YYYY-MM-DD")
];
}
if (this.$route.params.reporterno != "") {
@@ -1095,28 +1087,27 @@
}
this.getTimeList();
this.getList();
- },
- mounted(e) {
this.getuserlist();
// this.selectReporters();
this.tempRecordState = this.$route.params.tempRecordState;
- this.starttime = this.$route.params.starttime;
+ // this.starttime = this.$route.params.starttime;
+ // this.endtime = this.$route.params.endtime;
console.log("浼犳潵鐨勫��", this.starttime);
- this.endtime = this.$route.params.endtime;
+ console.log("浼犳潵鐨勫��", this.endtime);
this.LoadReportList();
},
methods: {
LoadReportList() {
- listDonatebaseinfo().then((res) => {
+ listDonatebaseinfo().then(res => {
console.log("娼滃湪鎹愮尞琛�", res);
let list = res.rows;
let reportlist = [];
- list.forEach((element) => {
+ list.forEach(element => {
reportlist.push({
reporterno: element.reporterno,
- reportername: element.reportername,
+ reportername: element.reportername
});
});
console.log("dwada", reportlist);
@@ -1128,7 +1119,7 @@
},
resetArr(Arr) {
var hash = {};
- Arr = Arr.reduce(function (arr, current) {
+ Arr = Arr.reduce(function(arr, current) {
hash[current.reporterno]
? ""
: (hash[current.reporterno] = true && arr.push(current));
@@ -1193,20 +1184,20 @@
},
//鐢ㄦ埛鍒楄〃
getuserlist() {
- listUser().then((res) => {
+ listUser().then(res => {
this.users = res.data;
});
},
getCoordinatorList1() {
//鍗忚皟鍛樹竴
// let userType = {"userType":"xty1"};
- listReportname("xty1").then((res) => {
+ listReportname("xty1").then(res => {
this.coordinatorlist1 = res.data;
});
},
getCoordinatorList2() {
//鍗忚皟鍛樹簩
- listReportname("xty2").then((res) => {
+ listReportname("xty2").then(res => {
this.coordinatorlist2 = res.data;
});
},
@@ -1214,6 +1205,11 @@
getList(e) {
this.loading = true;
this.queryParams.params = {};
+ sessionStorage.removeItem("donationwitness");
+ sessionStorage.setItem(
+ "donationwitness",
+ JSON.stringify(this.queryParams)
+ );
if (this.starttime != "") {
this.queryParams.starttime = this.starttime;
}
@@ -1227,7 +1223,7 @@
// this.queryParams.recordstate = e
// }
this.$nextTick(() => {
- listnewDonationwitness(this.queryParams).then((response) => {
+ listnewDonationwitness(this.queryParams).then(response => {
this.donatebaseinfoList = response.rows;
this.donatebaseinfoList.dodeathtime = "";
this.total = response.total;
@@ -1316,7 +1312,7 @@
updateBy: null,
updateTime: null,
organdonation: [],
- organdonationOther: null,
+ organdonationOther: null
};
this.resetForm("form");
},
@@ -1345,7 +1341,7 @@
acquisitiontissueno: null,
reportername: null,
reporttime: null,
- city: null,
+ city: null
};
this.selecttime = [];
this.getTimeList();
@@ -1353,17 +1349,17 @@
sheng: "",
shi: "",
qu: "",
- organizationname: null,
+ organizationname: null
};
- this.operationbegtime = []
- this.startoperationbegtime = ""
- this.endoperationbegtime = ""
+ this.operationbegtime = [];
+ this.startoperationbegtime = "";
+ this.endoperationbegtime = "";
this.resetForm("queryForm");
this.handleQuery();
},
handleSelectionChange(selection) {
- this.ids = selection.map((item) => item.id);
+ this.ids = selection.map(item => item.id);
this.single = selection.length !== 1;
this.multiple = !selection.length;
@@ -1374,62 +1370,79 @@
},
/** 鏂板鎸夐挳鎿嶄綔 */
handleAdd(row) {
- debugger;
- this.curCase = {
- id: row.id,
- recordstate: null,
- donorno: row.donorno,
- };
- this.reset();
- const id = row.id;
- getDonatebaseinfo(id).then((res) => {
- console.log("鎹愮尞鍩虹琛ㄦ暟鎹�", res);
- this.curCase.nation = res.data.nation;
- this.curCase.education = res.data.education;
- this.curCase.occupation = res.data.occupation;
- });
- // this.open = true;
- this.form.infoid = row.id;
- this.form.donorno = row.donorno;
- this.form.name = row.name;
- this.form.treatmenthospitalname = row.treatmenthospitalname;
- this.form.dosex = row.sex;
- this.form.doidcardtype = row.idcardtype;
- this.form.doidcardno = row.idcardno;
- this.form.doeducation = row.education;
- this.form.donationality = row.nationality;
- this.form.dooccupation = row.occupation;
- this.form.dobirthday = row.birthday;
-
- //鍒ゆ柇鏄惁瀛樺湪瑙佽瘉璁板綍
- let searchParam = {
- infoid: row.id,
- };
- debugger;
- this.GetDonortedList();
- const infoid = this.form.infoid;
- getByInfoId(infoid).then((response) => {
- if (response.code == 200) {
- //鑾峰彇鍣ㄥ畼鍒嗛厤淇℃伅
-
- if (response.data != null) {
- // this.$modal.msgError("鑾峰彇鎹愮尞鍣ㄥ畼澶辫触1锛�" + response.msg);
- this.open = true;
- this.form = response.data;
- this.form.organdonation = this.form.organdonation.split(",");
- this.title = "淇敼浜轰綋鍣ㄥ畼鎹愮尞鑾峰彇瑙佽瘉鐧昏琛�";
- } else {
- this.open = true;
- this.title = "鏂板浜轰綋鍣ㄥ畼鎹愮尞鑾峰彇瑙佽瘉鐧昏琛�";
- }
+ this.$router.push({
+ path: "/organ/donationdetails/",
+ query: {
+ id: row.id,
+ organType: "edit"
}
});
+ // this.reset();
+
+ // const id = row.id;
+ // this.curCase = {
+ // id: row.id,
+ // recordstate: null,
+ // donorno: row.donorno,
+ // name: row.name,
+ // treatmenthospitalname: row.treatmenthospitalname,
+ // sex: row.sex,
+ // idcardtype: row.idcardtype,
+ // idcardno: row.idcardno,
+ // education: row.education,
+ // nationality: row.nationality,
+ // occupation: row.occupation,
+ // birthday: row.birthday
+ // };
+
+ // getDonatebaseinfo(id).then(res => {
+ // console.log("鎹愮尞鍩虹琛ㄦ暟鎹�", res);
+ // this.curCase.nation = res.data.nation;
+ // this.curCase.education = res.data.education;
+ // this.curCase.occupation = res.data.occupation;
+ // });
+ // // this.open = true;
+ // console.log("row", row);
+ // this.form.infoid = row.id;
+ // this.form.donorno = row.donorno;
+ // this.form.name = row.name;
+ // this.form.treatmenthospitalname = row.treatmenthospitalname;
+ // this.form.dosex = row.sex;
+ // this.form.doidcardtype = row.idcardtype;
+ // this.form.doidcardno = row.idcardno;
+ // this.form.doeducation = row.education;
+ // this.form.donationality = row.nationality;
+ // this.form.dooccupation = row.occupation;
+ // this.form.dobirthday = row.birthday;
+
+ // //鍒ゆ柇鏄惁瀛樺湪瑙佽瘉璁板綍
+ // let searchParam = {
+ // infoid: row.id
+ // };
+ // this.GetDonortedList();
+ // const infoid = this.form.infoid;
+ // getByInfoId(infoid).then(response => {
+ // if (response.code == 200) {
+ // //鑾峰彇鍣ㄥ畼鍒嗛厤淇℃伅
+
+ // if (response.data != null) {
+ // // this.$modal.msgError("鑾峰彇鎹愮尞鍣ㄥ畼澶辫触1锛�" + response.msg);
+ // this.open = true;
+ // this.form = response.data;
+ // this.form.organdonation = this.form.organdonation.split(",");
+ // this.title = "淇敼浜轰綋鍣ㄥ畼鎹愮尞鑾峰彇瑙佽瘉鐧昏琛�";
+ // } else {
+ // this.open = true;
+ // this.title = "鏂板浜轰綋鍣ㄥ畼鎹愮尞鑾峰彇瑙佽瘉鐧昏琛�";
+ // }
+ // }
+ // });
},
/** 淇敼鎸夐挳鎿嶄綔 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids;
- getDonationwitness(id).then((response) => {
+ getDonationwitness(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "淇敼";
@@ -1438,31 +1451,33 @@
/** 鎻愪氦鎸夐挳 */
submitForm() {
- this.$refs["form"].validate((valid) => {
+ this.$refs["form"].validate(valid => {
if (valid) {
//鍗忚皟鍛�1
let coordinatedusernameIndex = this.coordinatorlist1.findIndex(
- (item) => this.form.coordinateduserido == item.reportNo
+ item => this.form.coordinateduserido == item.reportNo
);
if (coordinatedusernameIndex > -1) {
- this.form.coordinatedusernameo =
- this.coordinatorlist1[coordinatedusernameIndex].reportName;
+ this.form.coordinatedusernameo = this.coordinatorlist1[
+ coordinatedusernameIndex
+ ].reportName;
}
//鍗忚皟鍛�2
let coordinatedusernametIndex = this.coordinatorlist1.findIndex(
- (item) => this.form.coordinateduseridt == item.reportNo
+ item => this.form.coordinateduseridt == item.reportNo
);
if (coordinatedusernametIndex > -1) {
- this.form.coordinatedusernamet =
- this.coordinatorlist1[coordinatedusernametIndex].reportName;
+ this.form.coordinatedusernamet = this.coordinatorlist1[
+ coordinatedusernametIndex
+ ].reportName;
}
this.form.organdonation = this.form.organdonation.join(",");
if (this.form.id != null) {
- updateDonationwitness(this.form).then((response) => {
+ updateDonationwitness(this.form).then(response => {
this.$modal.msgSuccess("淇敼鎴愬姛");
- updatedonatorno(this.form.infoid).then((res) => {
+ updatedonatorno(this.form.infoid).then(res => {
this.getList();
});
this.open = false;
@@ -1470,14 +1485,15 @@
//鏇存柊鍣ㄥ畼琛�
for (let k = 0; k < this.tableData.length; k++) {
try {
- this.tableData[k].gainhospitalname =
- this.$refs.gainhosselect.getOptionByValue(
- this.tableData[k].gainhospitalno
- ).organizationname;
+ this.tableData[
+ k
+ ].gainhospitalname = this.$refs.gainhosselect.getOptionByValue(
+ this.tableData[k].gainhospitalno
+ ).organizationname;
} catch {
console.log("鑾峰彇鏈烘瀯鍚嶇О澶辫触");
}
- updateDonateorgan(this.tableData[k]).then((response1) => {
+ updateDonateorgan(this.tableData[k]).then(response1 => {
if (response1.code == 200) {
this.$modal.msgSuccess("鍣ㄥ畼璁板綍淇敼鎴愬姛");
}
@@ -1486,35 +1502,36 @@
this.curCase.recordstate = 11;
//update.donatebaseinfoList.deathtime = this.form.deathtime;
- updateDonatebaseinfo(this.curCase).then((response) => {
+ updateDonatebaseinfo(this.curCase).then(response => {
this.open = false;
});
this.getList();
});
} else {
- addDonationwitness(this.form).then((response) => {
+ addDonationwitness(this.form).then(response => {
this.$modal.msgSuccess("鏂板鎴愬姛");
//鏇存柊鍣ㄥ畼琛�
for (let k = 0; k < this.tableData.length; k++) {
try {
- this.tableData[k].gainhospitalname =
- this.$refs.gainhosselect.getOptionByValue(
- this.tableData[k].gainhospitalno
- ).organizationname;
+ this.tableData[
+ k
+ ].gainhospitalname = this.$refs.gainhosselect.getOptionByValue(
+ this.tableData[k].gainhospitalno
+ ).organizationname;
} catch {
console.log("鑾峰彇鏈烘瀯鍚嶇О澶辫触");
}
- updateDonateorgan(this.tableData[k]).then((response1) => {
+ updateDonateorgan(this.tableData[k]).then(response1 => {
if (response1.code == 200) {
this.$modal.msgSuccess("鍣ㄥ畼璁板綍淇敼鎴愬姛");
}
});
}
- updatedonatorno(this.form.infoid).then((res) => {
+ updatedonatorno(this.form.infoid).then(res => {
this.getList();
});
this.curCase.recordstate = 11;
- updateDonatebaseinfo(this.curCase).then((response) => {
+ updateDonatebaseinfo(this.curCase).then(response => {
this.open = false;
this.getList();
});
@@ -1530,7 +1547,7 @@
const ids = row.id || this.ids;
this.$modal
.confirm('鏄惁纭鍒犻櫎鎹愮尞瑙佽瘉缂栧彿涓�"' + ids + '"鐨勬暟鎹」锛�')
- .then(function () {
+ .then(function() {
return delDonationwitness(ids);
})
.then(() => {
@@ -1544,14 +1561,13 @@
this.loading = true;
let oraganqueryParam = {
//donorno: this.form.donorno,
- infoid: this.curCase.id,
+ infoid: this.curCase.id
};
- debugger;
console.log(
"璋冪敤鍣ㄥ畼鍒楄〃鎺ュ彛锛屽弬鏁帮細" + JSON.stringify(oraganqueryParam)
);
- listDonateorgan(oraganqueryParam).then((response) => {
- debugger;
+
+ listDonateorgan(oraganqueryParam).then(response => {
this.loading = false;
if (response.code == 200) {
this.organdonation = [];
@@ -1562,15 +1578,17 @@
this.tableData[i].gainhospitalname == null ||
this.tableData[i].gainhospitalname == ""
) {
- this.tableData[i].gainhospitalname =
- this.tableData[i].transplanthospitalname;
+ this.tableData[i].gainhospitalname = this.tableData[
+ i
+ ].transplanthospitalname;
}
if (
this.tableData[i].gainhospitalno == null ||
this.tableData[i].gainhospitalno == ""
) {
- this.tableData[i].gainhospitalno =
- this.tableData[i].transplanthospitalno;
+ this.tableData[i].gainhospitalno = this.tableData[
+ i
+ ].transplanthospitalno;
}
}
//this.organalForm.organname = [];
@@ -1586,8 +1604,8 @@
handledownload(row) {
const id = row.id || this.ids;
console.log("232323232", row);
- downloadwitnessinfo(row.dwid).then((response) => {
- var fileUrl = response;
+ downloadwitnessinfo(row.dwid).then(res => {
+ var fileUrl = res;
//鑾峰彇褰撳墠缃戝潃
var urlBase = process.env.VUE_APP_BASE_API;
var curWWWPath = window.document.location.href;
@@ -1596,20 +1614,44 @@
var aEle = document.createElement("a");
aEle.href =
curWWWPath.substring(0, pos) + urlBase + fileUrl["downloadUrl"];
- aEle.click();
+ 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);
+ });
});
},
- /** 瀵煎嚭鎸夐挳鎿嶄綔 */
+ /** 瀵煎嚭鎸夐挳鎿嶄綔 */
handleExport() {
const queryParams = this.queryParams;
- this.$modal.confirm('鏄惁纭瀵煎嚭鎵�鏈夎幏鍙栬璇佹暟鎹」锛�').then(() => {
- this.exportLoading = true;
- return exportDonationwitness(queryParams);
- }).then(response => {
- this.$download.name(response.msg);
- this.exportLoading = false;
- }).catch(() => {});z
+ this.$modal
+ .confirm("鏄惁纭瀵煎嚭鎵�鏈夎幏鍙栬璇佹暟鎹」锛�")
+ .then(() => {
+ this.exportLoading = true;
+ return exportDonationwitness(queryParams);
+ })
+ .then(response => {
+ this.$download.name(response.msg);
+ this.exportLoading = false;
+ })
+ .catch(() => {});
+ z;
}
- },
+ }
};
-</script>
\ No newline at end of file
+</script>
--
Gitblit v1.9.3