<template>
|
<div class="app-container">
|
<el-form
|
:model="queryParams"
|
ref="queryForm"
|
:inline="true"
|
v-show="showSearch"
|
label-width="70px"
|
>
|
<el-row :gutter="8">
|
|
<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
|
align="left"
|
label="医疗机构"
|
prop="treatmenthospitalno"
|
>
|
<org-selecter
|
ref="orgSelecter"
|
:org-type="'3'"
|
v-model="form.treatmenthospitalno"
|
/>
|
</el-form-item>
|
</el-col>
|
|
<el-col :span="6">
|
<el-form-item label="捐献地市">
|
<el-select v-model="queryParams.city" placeholder="请选择地市">
|
<el-option
|
v-for="item in provinceData"
|
:key="item.value"
|
:label="item.label"
|
:value="item.value"
|
>
|
</el-option>
|
</el-select>
|
</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-row>
|
<el-row :gutter="8">
|
<el-col :span="6">
|
<el-form-item label="报告人">
|
<el-select v-model="queryParams.reporterno" placeholder="请选择报告人">
|
<el-option
|
v-for="item in reportlist"
|
:key="item.index"
|
:label="item.reportername"
|
:value="item.reporterno"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
|
<el-col :span="12">
|
<el-form-item label="报告日期">
|
<el-date-picker
|
style="width: 100%"
|
v-model="selecttime"
|
type="monthrange"
|
range-separator="至"
|
start-placeholder="开始月份"
|
end-placeholder="结束月份"
|
value-format="yyyy-MM-dd"
|
@change="getTimeList"
|
>
|
</el-date-picker>
|
</el-form-item>
|
</el-col>
|
|
<el-col :span="6">
|
<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-col>
|
|
</el-row>
|
<!-- <el-row>
|
<el-col :span="14">
|
<el-form-item label="地址">
|
<div>
|
<li_area_select
|
ref="areaSelect"
|
v-model="searchAddress"
|
></li_area_select>
|
</div>
|
</el-form-item>
|
</el-col>
|
|
|
</el-row> -->
|
</el-form>
|
|
<el-table
|
v-loading="loading"
|
border
|
:default-sort="{ prop: 'completetime', order: 'descending' }"
|
:data="donatebaseinfoList"
|
>
|
<el-table-column
|
label="报告时间"
|
align="center"
|
prop="reporttime"
|
width="120"
|
>
|
<template slot-scope="scope">
|
<span>{{ parseTime(scope.row.reporttime, "{y}-{m}-{d}") }}</span>
|
</template>
|
</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
|
:options="dict.type.sys_user_sex"
|
:value="parseInt(scope.row.sex)"
|
/>
|
</template>
|
</el-table-column>
|
<el-table-column label="年龄" align="center" prop="age" width="100" />
|
<el-table-column
|
label="医疗机构"
|
align="center"
|
prop="treatmenthospitalname"
|
/>
|
<el-table-column
|
label="完成时间"
|
align="center"
|
prop="completetime"
|
width="200"
|
>
|
<template slot-scope="scope">
|
<span>{{ parseTime(scope.row.createtime, "{y}-{m}-{d}") }}</span>
|
</template>
|
</el-table-column>
|
<!-- <el-table-column label="身份证号" prop="idcardno" width="180" /> -->
|
<el-table-column
|
label="报告人"
|
align="center"
|
prop="reportername"
|
width="100"
|
/>
|
|
<el-table-column
|
label="捐献进度"
|
align="center"
|
prop="recordstate"
|
>
|
<template slot-scope="scope">
|
<dict-tag
|
:options="dict.type.sys_DonationStatus"
|
:value="scope.row.recordstate"
|
/>
|
</template>
|
</el-table-column>
|
|
<el-table-column
|
label="操作"
|
align="center"
|
class-name="small-padding fixed-width"
|
width="200"
|
fixed="right"
|
>
|
<template slot-scope="scope">
|
<!-- <el-button
|
size="mini"
|
type="text"
|
icon="el-icon-refrigerator"
|
@click="updatedonorno(scope.row)"
|
>更新编号</el-button
|
> -->
|
<el-button
|
v-if="scope.row.dcid == undefined"
|
size="mini"
|
type="text"
|
icon="el-icon-edit"
|
@click="handleAdd(scope.row)"
|
>登记</el-button
|
>
|
|
<el-button
|
v-if="scope.row.dcid > 0"
|
size="mini"
|
type="text"
|
icon="el-icon-edit"
|
@click="handleUpdate(scope.row)"
|
v-hasPermi="['project:donatebaseinfo:edit']"
|
>修改</el-button
|
>
|
|
<el-button
|
v-if="scope.row.dcid > 0"
|
size="mini"
|
type="text"
|
icon="el-icon-edit"
|
@click="handleReport(scope.row)"
|
>上报</el-button
|
>
|
<el-button
|
v-if="scope.row.dcid > 0"
|
size="mini"
|
type="text"
|
icon="el-icon-refrigerator"
|
@click="handledownload(scope.row)"
|
>下载</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"
|
align="center"
|
:visible.sync="open"
|
width="1100px"
|
:close-on-click-modal="false"
|
append-to-body
|
>
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
<el-row>
|
<el-col :span="8">
|
<el-form-item label="捐献编号" prop="donorno">
|
<el-input
|
disabled
|
v-model="curCase.donorno"
|
placeholder="请输入捐献者编号"
|
/>
|
</el-form-item>
|
</el-col>
|
<el-col :span="8">
|
<el-form-item label="姓名" prop="name">
|
<el-input
|
disabled
|
v-model="curCase.name"
|
placeholder="请输入捐献者姓名"
|
/>
|
</el-form-item>
|
</el-col>
|
<el-col :span="8">
|
<el-form-item label="完成时间" prop="completetime">
|
<el-date-picker
|
style="width: 167px"
|
clearable
|
size="small"
|
v-model="form.completetime"
|
type="date"
|
value-format="yyyy-MM-dd hh:mm:ss"
|
placeholder="选择完成时间"
|
>
|
</el-date-picker>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-form-item label="器官组织">
|
<el-checkbox-group align="left" v-model="form.donateorganList">
|
<el-checkbox
|
v-for="dict in dict.type.sys_Organ"
|
:key="dict.value"
|
:label="dict.value"
|
disabled
|
>
|
{{ dict.label }}
|
</el-checkbox>
|
</el-checkbox-group>
|
</el-form-item>
|
</el-row>
|
<el-row style="margin-bottom: 22px">
|
<el-table v-loading="loading" border :data="tableData">
|
<el-table-column
|
label="器官名称"
|
align="center"
|
prop="organname"
|
width="80"
|
/>
|
<el-table-column
|
label="移植医院(接收单位)"
|
align="center"
|
prop="transplanthospitalno"
|
width="240"
|
>
|
<template slot-scope="scope">
|
<org-selecter
|
ref="transplanthosselect"
|
:org-type="'4'"
|
v-model="scope.row.transplanthospitalno"
|
/>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="移植负责人"
|
align="center"
|
prop="transplantdoct"
|
width="120"
|
>
|
<template slot-scope="scope">
|
<el-input
|
v-model="scope.row.transplantdoct"
|
placeholder="请输入负责人"
|
></el-input>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="移植日期"
|
align="center"
|
prop="transplanttime"
|
width="230"
|
>
|
<template slot-scope="scope">
|
<el-row>
|
<el-date-picker
|
clearable
|
size="small"
|
style="width: 90%"
|
v-model="scope.row.transplanttime"
|
type="date"
|
value-format="yyyy-MM-dd HH:mm:ss"
|
placeholder="选择器官移植时间"
|
>
|
</el-date-picker>
|
</el-row>
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="abandonreason"
|
label="弃用原因"
|
align="center"
|
width="260"
|
>
|
<template slot-scope="scope">
|
<el-row>
|
<el-input
|
clearable
|
v-model="scope.row.abandonreason"
|
placeholder="请输入弃用原因"
|
/>
|
</el-row>
|
</template>
|
</el-table-column>
|
|
<el-table-column
|
label="器官状态"
|
align="center"
|
prop="organstate"
|
width="130"
|
>
|
<template slot-scope="scope">
|
<el-select
|
v-model="scope.row.organstate"
|
placeholder="请选择器官状态"
|
value-key="value"
|
@change="selectOrganstate(scope.row)"
|
>
|
<el-option
|
v-for="dict in dict.type.sys_organstate"
|
:key="dict.value"
|
:label="dict.label"
|
:value="dict.value"
|
></el-option>
|
</el-select>
|
</template>
|
</el-table-column>
|
</el-table>
|
</el-row>
|
|
<el-row>
|
<el-col :span="7">
|
<el-form-item align="left" label="遗体捐献" prop="isbodydonation">
|
<el-radio-group v-model="form.isbodydonation">
|
<el-radio
|
v-for="dict in dict.type.sys_0_1"
|
:key="dict.value"
|
:label="dict.value"
|
>{{ dict.label }}</el-radio
|
>
|
</el-radio-group>
|
</el-form-item>
|
</el-col>
|
<el-col :span="7">
|
<el-form-item align="left" label="接收单位" prop="receivingunit">
|
<el-input
|
v-model="form.receivingunit"
|
placeholder="请输入接受单位"
|
/>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
|
<el-row>
|
<el-col :span="7">
|
<el-form-item label="负责人" prop="responsibleuserid">
|
<el-select v-model="form.responsibleuserid" placeholder="请选择">
|
<el-option
|
v-for="item in leaderlist"
|
:key="item.reportNo"
|
:label="item.reportName"
|
:value="item.reportNo"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="7">
|
<el-form-item label="协调员一" prop="coordinateduserido">
|
<el-select v-model="form.coordinateduserido" placeholder="请选择">
|
<el-option
|
v-for="item in coordinatorlist1"
|
:key="item.reportNo"
|
:label="item.reportName"
|
:value="item.reportNo"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="7">
|
<el-form-item label="协调员二" prop="coordinateduseridt">
|
<el-select v-model="form.coordinateduseridt" placeholder="请选择">
|
<el-option
|
v-for="item in coordinatorlist1"
|
:key="item.reportNo"
|
:label="item.reportName"
|
:value="item.reportNo"
|
>
|
</el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
|
<!-- <el-row>
|
<el-form-item align="left" label="附件">
|
<fileUpload v-model="form.assessannex" />
|
</el-form-item>
|
</el-row> -->
|
<el-row>
|
<el-form-item label="附件" align="left" prop="annexfile">
|
<annex-upload
|
ref="finishannex"
|
:infoid="curCase.id"
|
:donorno="curCase.donorno"
|
:flowname="flowname"
|
:annexno="annexno"
|
/>
|
</el-form-item>
|
</el-row>
|
</el-form>
|
<div slot="footer" class="dialog-footer">
|
<el-button :disabled="loading" type="primary" @click="submitForm">保 存</el-button>
|
<el-button @click="cancel">取 消</el-button>
|
</div>
|
</el-dialog>
|
</div>
|
</template>
|
<style scoped>
|
</style>
|
<script>
|
import {
|
listOrganization,
|
listReportname,
|
listUser,
|
} from "@/api/project/organization";
|
import {
|
listDonatebaseinfo,
|
getDonatebaseinfo,
|
addDonatebaseinfo,
|
updateDonatebaseinfo,
|
// exportProvincemessage,
|
} from "@/api/project/donatebaseinfo";
|
|
import {
|
updatedonatorno,
|
updateDonateNumber,
|
} from "@/api/project/relativesconfirmation";
|
import {
|
getDonatecompletioninfo,
|
listnewDonatecompletioninfo,
|
addDonatecompletioninfo,
|
updateDonatecompletioninfo,
|
listDonatecompletioninfo,
|
downloadcompletioninfo,
|
} from "@/api/project/donatecompletioninfo";
|
|
import Li_area_select from "@/components/Address";
|
import OrgSelecter from "@/views/project/components/orgselect";
|
import AnnexUpload from "@/views/project/components/annexupload";
|
import {
|
listDonateorgan,
|
addDonateorgan,
|
delDonateorgan,
|
updateDonateorgan,
|
getDonateorgan,
|
} from "@/api/project/donateorgan";
|
|
export default {
|
components: {
|
Li_area_select,
|
OrgSelecter,
|
AnnexUpload,
|
},
|
name: "Donatefinish",
|
dicts: [
|
"sys_OrganizationType",
|
"sys_HospitalNature",
|
"sys_RegionalLevel",
|
"country",
|
"sys_user_sex",
|
"sys_IDType",
|
"sys_AgeUnit",
|
"sys_BloodType",
|
"sys_0_1",
|
"sys_patientstate",
|
"sys_DonationCategory",
|
"sys_Kinship",
|
"sys_Infectious",
|
"sys_InfoSources",
|
"sys_OtherCases",
|
"sys_DonationStatus",
|
"sys_DiseaseType",
|
"sys_SelfWill",
|
"sys_FamilyRelation",
|
"sys_Organ",
|
"sys_organstate",
|
],
|
data() {
|
return {
|
starttime: "",
|
endtime: "",
|
countyname: "",
|
cuuntry: "",
|
|
selecttime: "",
|
reportervalue: "",
|
reportlist: [],
|
provinceData: [
|
{ label: "全部", value: "" },
|
{ label: "杭州市", value: "1" },
|
{ label: "宁波市", value: "2" },
|
{ label: "温州市", value: "3" },
|
{ label: "嘉兴市", value: "4" },
|
{ label: "湖州市", value: "5" },
|
{ label: "绍兴市", value: "6" },
|
{ label: "金华市", value: "7" },
|
{ label: "衢州市", value: "8" },
|
{ label: "舟山市", value: "9" },
|
{ label: "台州市", value: "A" },
|
{ label: "丽水市", value: "B" },
|
],
|
|
//省市区
|
//默认值设置,可为空
|
searchAddress: {
|
sheng: "",
|
shi: "",
|
qu: "",
|
organizationname: null,
|
},
|
residenceAddresss: {
|
sheng: "浙江省",
|
shi: "",
|
qu: "",
|
},
|
registerAddresss: {
|
sheng: "浙江省",
|
shi: "",
|
qu: "",
|
},
|
|
//用户表
|
users: [],
|
//负责人
|
leaderlist: [],
|
//协调员一
|
coordinatorlist1: [],
|
//协调员二
|
coordinatorlist2: [],
|
// 遮罩层
|
loading: true,
|
// 导出遮罩层
|
exportLoading: false,
|
// 选中数组
|
ids: [],
|
// 非单个禁用
|
single: true,
|
// 非多个禁用
|
multiple: true,
|
// 显示搜索条件
|
showSearch: true,
|
// 总条数
|
total: 0,
|
// 捐献基础表格数据
|
donatebaseinfoList: [],
|
// 弹出层标题
|
title: "",
|
// 是否显示弹出层
|
open: false,
|
// 获取组织名称时间范围
|
daterangeReporttime: [],
|
// 查询参数
|
queryParams: {
|
pageNum: 1,
|
pageSize: 10,
|
name: null,
|
idcardno: null,
|
residenceprovince: null,
|
residencecity: null,
|
residencetown: null,
|
recordstate: null,
|
treatmenthospitalname: null,
|
treatmenthospitalno: null,
|
donorno: null,
|
reportername: null,
|
reporttime: null,
|
city: null,
|
},
|
// 表单参数
|
form: {},
|
// 表单校验
|
rules: {
|
completetime: [
|
{ required: true, message: "请输入完成时间", trigger: "blur" },
|
],
|
coordinatedusernameo: [
|
{ required: true, message: "请选择协调员一", trigger: "blur" },
|
],
|
coordinatedusernamet: [
|
{ required: true, message: "请选择协调员二", trigger: "blur" },
|
],
|
responsibleusername: [
|
{ required: true, message: "请选择负责人", trigger: "blur" },
|
],
|
},
|
curCase: {
|
donorno: "",
|
name: "",
|
registerAddresss: "",
|
infoid: "",
|
},
|
//器官列表
|
// donateorganList: [],
|
//当前选中捐献案例
|
curdonotor: {},
|
tableData: [],
|
//流程名称
|
flowname: "捐献完成登记",
|
//流程名称-伦理审查
|
annexno: "",
|
};
|
},
|
created() {
|
// this.getDicts('country').then(res=>{
|
// this.nationality =res.data
|
// })
|
},
|
activated() {
|
this.selecttime = "";
|
this.reportervalue = "";
|
this.reportlist = [];
|
this.queryParams.donorno = "";
|
this.queryParams.recordstate = "";
|
this.queryParams.name = "";
|
this.queryParams.treatmenthospitalno = "";
|
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"),
|
];
|
}
|
if (this.$route.params.reporterno != "") {
|
this.reporterno = this.$route.params.reporterno;
|
}
|
if (this.$route.params.tempRecordState != "") {
|
this.queryParams.recordstate = this.$route.params.tempRecordState;
|
}
|
if (this.$route.params.reporterno != "") {
|
this.reportervalue = this.$route.params.reporterno;
|
}
|
if (!this.$route.params.shen != "") {
|
this.searchAddress.sheng = this.$route.params.shen;
|
if (!this.$route.params.shi != "") {
|
this.searchAddress.shi = this.$route.params.shi;
|
}
|
if (!this.$route.params.qu) {
|
this.searchAddress.qu = this.$route.params.qu;
|
}
|
}
|
if (this.$route.params.city != "") {
|
this.queryParams.city = this.$route.params.city;
|
}
|
this.getTimeList();
|
this.getList();
|
},
|
mounted() {
|
this.getuserlist();
|
this.getLeaderList();
|
this.getCoordinatorList1();
|
this.getCoordinatorList2();
|
|
this.LoadReportList();
|
},
|
methods: {
|
LoadReportList() {
|
listDonatebaseinfo().then((res) => {
|
console.log("潜在捐献表", res);
|
let list = res.rows;
|
let reportlist = [];
|
list.forEach((element) => {
|
reportlist.push({
|
reporterno: element.reporterno,
|
reportername: element.reportername,
|
});
|
});
|
console.log("dwada", reportlist);
|
if (reportlist != 0) {
|
reportlist = this.resetArr(reportlist);
|
this.reportlist = reportlist;
|
}
|
});
|
},
|
resetArr(Arr) {
|
var hash = {};
|
Arr = Arr.reduce(function (arr, current) {
|
hash[current.reporterno]
|
? ""
|
: (hash[current.reporterno] = true && arr.push(current));
|
return arr;
|
}, []);
|
return Arr;
|
},
|
getTimeList(e) {
|
if (this.selecttime != 0) {
|
this.endtime = this.selecttime[1];
|
this.starttime = this.selecttime[0];
|
// if (this.endtime == this.starttime) {
|
let num = Number(this.endtime.slice(5, 7));
|
if (num < 9) {
|
let mon = Number(this.endtime.slice(6, 7));
|
this.endtime =
|
this.endtime.slice(0, 5) +
|
"0" +
|
(mon + 1) +
|
"-" +
|
"01" +
|
" " +
|
"00" +
|
":" +
|
"00" +
|
":" +
|
"00";
|
}
|
// this.endtime=this.endtime.slice(0,5)年
|
else if (num >= 10) {
|
this.endtime =
|
this.endtime.slice(0, 5) +
|
(num + 1) +
|
"-" +
|
"01" +
|
" " +
|
"00" +
|
":" +
|
"00" +
|
":" +
|
"00";
|
} else {
|
this.endtime =
|
this.endtime.slice(0, 5) +
|
"10" +
|
"-" +
|
"01" +
|
" " +
|
"00" +
|
":" +
|
"00" +
|
":" +
|
"00";
|
console.log("1212121", this.endtime);
|
}
|
this.starttime = this.starttime + " " + "00" + ":" + "00" + ":" + "00";
|
// }
|
} else {
|
// this.starttime = "1998-01-01 00:00:00";
|
// this.endtime = "2998-01-01 00:00:00";
|
}
|
console.log(this.starttime);
|
console.log(this.endtime);
|
},
|
updatedonorno(row) {
|
console.log("row", row);
|
updatedonatorno(row.infoid).then((res) => {
|
console.log("1221212", res);
|
this.getList();
|
});
|
},
|
selectOrganstate(e) {
|
console.log("器官状态", e);
|
//当是弃用的时候
|
if (e.organstate === 99) {
|
this.$prompt("请输入启用原因", "提示", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
})
|
.then(({ value }) => {
|
console.log("启用原因", value);
|
getDonateorgan(e.id);
|
})
|
.catch(() => {
|
this.$message({
|
type: "info",
|
message: "取消",
|
});
|
});
|
}
|
},
|
|
//获取用户表
|
getuserlist() {
|
listUser().then((res) => {
|
this.users = res.data;
|
});
|
},
|
|
//获取负责人
|
getLeaderList() {
|
listReportname("fzr").then((res) => {
|
this.leaderlist = res.data;
|
});
|
},
|
|
//获取协调员一
|
getCoordinatorList1() {
|
listReportname("xty1").then((res) => {
|
this.coordinatorlist1 = res.data;
|
});
|
},
|
|
//获取协调员二
|
getCoordinatorList2() {
|
listReportname("xty2").then((res) => {
|
this.coordinatorlist2 = res.data;
|
});
|
},
|
|
// updateMessage() {
|
// const reg =
|
// /^[1-9]\d{5}(18|19|([23]\d))\d{2}((0[1-9])|(10|11|12))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/;
|
// if (reg.test(this.form.idcardno)) {
|
// // 身份证号码是否合法
|
// var org_birthday = this.form.idcardno.substring(6, 14);
|
// var org_gender = this.form.idcardno.substring(16, 17);
|
// var sex = org_gender % 2 == 1 ? "男" : "女";
|
// var birthday =
|
// org_birthday.substring(0, 4) +
|
// "-" +
|
// org_birthday.substring(4, 6) +
|
// "-" +
|
// org_birthday.substring(6, 8);
|
// var birthdays = new Date(birthday.replace(/-/g, "/"));
|
// let d = new Date();
|
// // let age = d.getFullYear() - birthdays.getFullYear() - (d.getMonth() < birthdays.getMonth() || (d.getMonth() == birthdays.getMonth() && d.getDate() < birthdays.getDate()) ? 1 : 0);
|
|
// // console.log('生日转换时间', birthdays)
|
// // console.log('年龄', age)
|
|
// // 赋值给表格
|
// this.form.sex = sex;
|
// this.form.birthdays = birthdays;
|
// // this.form.age = age
|
// } else {
|
// this.dataList.sex = "未填写";
|
// return false;
|
// }
|
// },
|
// 身份证验证
|
//根据身份证号自动生成性别、出生日期和年龄
|
// inputChange() {
|
// const idCard = this.props.form.getFieldValue("idCard");
|
// let birthday = "";
|
// let sex = 0;
|
// if (idCard.length === 15) {
|
// birthday = `19${idCard.substring(6, 8)}-${idCard.substring(
|
// 9,
|
// 10
|
// )}-${idCard.substring(11, 12)}`;
|
// sex = idCard[14] % 2 === 0 ? "0" : "1";
|
// } else {
|
// birthday = `${idCard.substring(6, 10)}-${idCard.substring(
|
// 11,
|
// 12
|
// )}-${idCard.substring(13, 14)}`;
|
// sex = idCard[16] % 2 === 0 ? "0" : "1";
|
// }
|
// this.setState({
|
// birthday,
|
// sex,
|
// });
|
// },
|
|
/** 查询捐献基础列表 */
|
getList() {
|
this.loading = true;
|
this.queryParams.params = {};
|
if (null != this.daterangeReporttime && "" != this.daterangeReporttime) {
|
this.queryParams.params["beginReporttime"] =
|
this.daterangeReporttime[0];
|
this.queryParams.params["endReporttime"] = this.daterangeReporttime[1];
|
}
|
|
if (this.starttime != "") {
|
this.queryParams.starttime = this.starttime;
|
}
|
if (this.endtime != "") {
|
this.queryParams.endtime = this.endtime;
|
}
|
|
this.queryParams.reportervalue = this.reportervalue;
|
this.$nextTick(() => {
|
// this.queryParams.residenceprovince = this.$refs.areaSelect.getSheng();
|
// this.queryParams.residencecity = this.$refs.areaSelect.getShi();
|
// this.queryParams.residencetown = this.$refs.areaSelect.getQu();
|
listnewDonatecompletioninfo(this.queryParams).then((response) => {
|
this.donatebaseinfoList = response.rows;
|
this.total = response.total;
|
this.loading = false;
|
});
|
});
|
},
|
|
// 取消按钮
|
cancel() {
|
this.open = false;
|
this.reset();
|
},
|
|
// 表单重置
|
reset() {
|
this.form = {
|
id: null,
|
infoid: null,
|
donorno: null,
|
delFlag: null,
|
createBy: null,
|
createTime: null,
|
updateBy: null,
|
updateTime: null,
|
isbodydonation: "0",
|
receivingunit: null,
|
completetime: null,
|
responsibleuserid: null,
|
responsibleusername: null,
|
coordinateduserido: null,
|
coordinatedusernameo: null,
|
coordinateduseridt: null,
|
coordinatedusernamet: null,
|
assessannex: null,
|
donateorgan: "",
|
donateorganList: [],
|
};
|
this.resetForm("form");
|
},
|
|
/** 重置按钮操作 */
|
resetQuery() {
|
this.daterangeReporttime = [];
|
|
this.queryParams = {
|
doname: null,
|
pageNum: 1,
|
pageSize: 10,
|
name: null,
|
idcardno: null,
|
residenceprovince: null,
|
residencecity: null,
|
residencetown: null,
|
// "2"
|
recordstate: null,
|
treatmenthospitalname: null,
|
donorno: null,
|
acquisitiontissueno: null,
|
reportername: null,
|
reporttime: null,
|
city: null,
|
treatmenthospitalno: null,
|
};
|
this.selecttime = [];
|
this.getTimeList();
|
this.searchAddress = {
|
sheng: "",
|
shi: "",
|
qu: "",
|
organizationname: null,
|
};
|
//this.$refs.areaSelect.clean();
|
|
this.resetForm("queryForm");
|
this.handleQuery();
|
},
|
|
/** 搜索按钮操作 */
|
handleQuery() {
|
this.queryParams.pageNum = 1;
|
this.getList();
|
},
|
|
/** 新增按钮操作 */
|
handleAdd(row) {
|
this.reset();
|
|
//读取案例基本信息
|
//this.curCase = row;
|
this.curCase = {
|
id: row.id,
|
recordstate: null,
|
donorno: row.donorno,
|
};
|
this.form.coordinateduserido = row.coordinateduserido;
|
this.form.coordinateduseridt = row.coordinateduseridt;
|
this.form.coordinatedusernameo = row.coordinatedusernameo;
|
this.form.coordinatedusernamet = row.coordinatedusernamet;
|
this.form.responsibleuserid = row.responsibleuserid;
|
this.form.responsibleusername = row.responsibleusername;
|
|
this.form.receivingunit = row.receivingunit;
|
this.form.responsibleusername = row.responsibleusername;
|
this.registerAddresss.sheng = row.residenceprovincename;
|
this.registerAddresss.shi = row.residencecityname;
|
this.registerAddresss.qu = row.residencetownname;
|
|
//判断是否存在上报记录
|
let searchParam = {
|
id: row.id,
|
};
|
listDonatecompletioninfo(searchParam).then((response) => {
|
if (response.code == 200 && response.rows.length == 1) {
|
this.form = response.rows[0];
|
this.form.donateorganList = JSON.parse(this.form.donateorgan);
|
this.title = "修改捐献完成登记表";
|
} else {
|
this.curdonotor = row;
|
this.open = true;
|
this.title = "新增捐献完成登记表";
|
}
|
});
|
|
//获取器官信息
|
let oraganqueryParam = {
|
infoid: row.id,
|
};
|
listDonateorgan(oraganqueryParam).then((response) => {
|
if (response.code == 200) {
|
this.tableData = response.rows;
|
} else {
|
this.$modal.msgError("获取捐献器官失败:" + response.msg);
|
}
|
});
|
|
//获取附件信息
|
// this.$nextTick(function () {
|
// this.$refs.finishannex.getAnnexList();
|
// });
|
|
this.loading = false;
|
this.open = true;
|
},
|
|
/** 修改按钮操作 */
|
handleUpdate(row) {
|
console.log("333333", row);
|
//获取捐献完成登记记录
|
this.loading = true;
|
this.reset();
|
this.curCase.registerAddresss = row.registeraddresss;
|
this.curCase.donorno = row.donorno;
|
this.curCase.name = row.name;
|
this.curCase.infoid = row.infoid;
|
this.open = true;
|
this.title = "修改捐献完成登记表";
|
this.curdonotor = row;
|
this.form.id = row.dcid;
|
|
//查询
|
let searchParam = {
|
id: row.id,
|
};
|
let oraganqueryParam = {
|
infoid: row.id,
|
// donorname: this.curCase.name,
|
// donorno: this.curCase.donorno,
|
// registeraddress: this.curCase.registeraddresss,
|
};
|
listDonateorgan(oraganqueryParam).then((response) => {
|
if (response.code == 200) {
|
console.log("2", response);
|
this.tableData = response.rows;
|
} else {
|
this.$modal.msgError("获取捐献器官失败:" + response.msg);
|
}
|
this.loading = false;
|
//获取器官分配信息
|
// this.GetDonortedList();
|
});
|
listnewDonatecompletioninfo(searchParam).then((response) => {
|
if (response.code == 200 && response.rows.length == 1) {
|
this.open = true;
|
this.form = response.rows[0];
|
console.log("update", this.form.donateorgan);
|
this.form.donateorganList = JSON.parse(this.form.donateorgan);
|
console.log("update2", this.form.donateorganList);
|
this.form.id = row.dcid;
|
} else {
|
this.$modal.msgError(
|
"获取捐献完成登记记录错误:" + JSON.stringify(response)
|
);
|
}
|
this.loading = false;
|
});
|
},
|
|
/** 提交按钮 */
|
submitForm() {
|
this.loading = true;
|
this.$refs["form"].validate((valid) => {
|
if (valid) {
|
this.form.donorno = this.curCase.donorno;
|
this.form.infoid = this.curCase.id;
|
this.form.donateorgan = JSON.stringify(this.form.donateorganList);
|
// let forms = delete this.form.donateorganList;
|
|
//负责人 //leaderlist
|
let responsibleuseridIndex = this.leaderlist.findIndex(
|
(item) => this.form.responsibleuserid == item.reportNo
|
);
|
if (responsibleuseridIndex > -1) {
|
this.form.responsibleusername =
|
this.leaderlist[responsibleuseridIndex].reportName;
|
}
|
//协调员1
|
let coordinatedusernameIndex = this.coordinatorlist1.findIndex(
|
(item) => this.form.coordinateduserido == item.reportNo
|
);
|
if (coordinatedusernameIndex > -1) {
|
this.form.coordinatedusernameo =
|
this.coordinatorlist1[coordinatedusernameIndex].reportName;
|
}
|
//协调员2
|
let coordinatedusernametIndex = this.coordinatorlist1.findIndex(
|
(item) => this.form.coordinateduseridt == item.reportNo
|
);
|
if (coordinatedusernametIndex > -1) {
|
this.form.coordinatedusernamet =
|
this.coordinatorlist1[coordinatedusernametIndex].reportName;
|
}
|
|
if (this.form.id != null) {
|
console.log("更新form", this.form);
|
|
updateDonatecompletioninfo(this.form).then((response) => {
|
this.$modal.msgSuccess("修改成功");
|
this.loading = false;
|
this.open = false;
|
//this.getList();
|
//更新器官表
|
for (let k = 0; k < this.tableData.length; k++) {
|
try {
|
this.tableData[k].transplanthospitalname =
|
this.$refs.transplanthosselect.getOptionByValue(
|
this.tableData[k].transplanthospitalno
|
).organizationname;
|
} catch {
|
console.log("获取机构名称失败!");
|
}
|
|
updateDonateorgan(this.tableData[k]).then((response1) => {
|
if (response1.code == 200) {
|
// this.$modal.msgSuccess("器官记录修改成功");
|
}
|
});
|
}
|
|
//更新捐献状态
|
this.curCase.recordstate = 12;
|
getDonatebaseinfo(this.curCase.infoid).then((res) => {
|
let donatebasedata = res.data;
|
donatebasedata.recordstate = 12;
|
updateDonatebaseinfo(donatebasedata).then((response) => {
|
//this.$modal.msgSuccess("审核成功");
|
//this.isShowReviewDialog = false;
|
this.getList();
|
});
|
});
|
});
|
} else {
|
addDonatecompletioninfo(this.form).then((response) => {
|
this.loading=false
|
this.$modal.msgSuccess("新增成功");
|
this.open = false;
|
|
//更新器官表
|
for (let k = 0; k < this.tableData.length; k++) {
|
try {
|
this.tableData[k].transplanthospitalname =
|
this.$refs.transplanthosselect.getOptionByValue(
|
this.tableData[k].transplanthospitalno
|
).organizationname;
|
} catch {
|
console.log("获取机构名称失败");
|
}
|
updateDonateorgan(this.tableData[k]).then((response1) => {
|
if (response1.code == 200) {
|
this.$modal.msgSuccess("器官记录修改成功");
|
}
|
});
|
}
|
|
//更新捐献状态
|
this.curCase.recordstate = 12;
|
updateDonatebaseinfo(this.curCase).then((response) => {
|
//this.$modal.msgSuccess("审核成功");
|
//this.isShowReviewDialog = false;
|
this.getList();
|
});
|
});
|
}
|
}
|
else{
|
this.loading = false;
|
}
|
});
|
},
|
|
//完成登记上报
|
handleReport(row) {
|
this.$confirm("是否确认将登记记录上报?", "提示", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning",
|
})
|
.then(() => {
|
//查找是否存在登记完成记录
|
//判断是否存在上报记录
|
let searchParam = {
|
infoid: row.id,
|
};
|
console.log("上报参数", searchParam);
|
listDonatecompletioninfo(searchParam).then((response) => {
|
console.log("上报", response);
|
if (response.code == 200 && response.rows.length == 1) {
|
row.recordstate = 13;
|
row.birthday = this.$moment(row.birthday).format(
|
"YYYY-MM-DD HH:mm:ss"
|
);
|
updateDonatebaseinfo(row).then((response1) => {
|
this.$message({
|
type: "success",
|
message: "上报成功",
|
});
|
});
|
} else {
|
this.$message({
|
type: "error",
|
message: "捐献完成登记记录不存在!",
|
});
|
}
|
this.loading = false;
|
});
|
})
|
.catch(() => {
|
this.$message({
|
type: "info",
|
message: "已取消上报",
|
});
|
});
|
},
|
|
//下载捐献完成登记表
|
handledownload(row) {
|
const id = row.id || this.ids;
|
console.log("22222", row);
|
downloadcompletioninfo(row.dcid).then((response) => {
|
var fileUrl = response;
|
//获取当前网址
|
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();
|
});
|
},
|
|
//获取病人已捐献的器官列表
|
GetDonortedList(row) {
|
this.loading = true;
|
let oraganqueryParam = {
|
infoid: row.infoid,
|
};
|
listDonateorgan(oraganqueryParam).then((response) => {
|
this.loading = false;
|
if (response.code == 200) {
|
this.form.donateorganList = [];
|
this.tableData = response.rows;
|
console.log("listDonateorgan", response);
|
for (let i = 0; i < response.rows.length; i++) {
|
this.form.donateorganList.push(response.rows[i].organno);
|
}
|
} else {
|
// this.$modal.msgError("获取捐献器官失败:" + response.msg);
|
}
|
});
|
},
|
},
|
};
|
</script>
|