<template>
|
<div class="app-container">
|
<el-form
|
:model="queryParams"
|
ref="queryForm"
|
:inline="true"
|
v-show="showSearch"
|
label-width="68px"
|
>
|
<el-row>
|
<el-col :span="6">
|
<el-form-item label="捐献编号" prop="donorno">
|
<el-input
|
v-model="queryParams.donorno"
|
placeholder="请输入捐献编号"
|
clearable
|
size="small"
|
@keyup.enter.native="handleQuery"
|
/>
|
</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-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="queryParams.treatmenthospitalno"
|
/>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<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="['project:donateannex: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="['project:donateannex: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="['project:donateannex: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="['project:donateannex:export']"
|
>导出</el-button
|
>
|
</el-col>
|
<right-toolbar
|
:showSearch.sync="showSearch"
|
@queryTable="getList"
|
></right-toolbar>
|
</el-row>
|
|
<el-table
|
v-loading="loading"
|
:data="donateannexList"
|
@selection-change="handleSelectionChange"
|
>
|
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column
|
label="捐献编号"
|
align="center"
|
prop="donorno"
|
width="140"
|
/>
|
<el-table-column
|
label="捐献进度"
|
align="center"
|
prop="recordstate"
|
width="120"
|
>
|
<template slot-scope="scope">
|
<div v-if="!scope.terminationCase">
|
<dict-tag
|
:options="dict.type.sys_DonationStatus"
|
:value="scope.row.recordstate"
|
/>
|
</div>
|
<div v-else>任务终止</div>
|
</template>
|
</el-table-column>
|
<el-table-column label="姓名" align="center" prop="name" width="120" />
|
<el-table-column label="性别" align="center" prop="sex" width="120">
|
<template slot-scope="scope">
|
<dict-tag :options="dict.type.sys_user_sex" :value="scope.row.sex" />
|
</template>
|
</el-table-column>
|
<el-table-column label="年龄" align="center" prop="age" width="120" />
|
<el-table-column
|
label="医疗机构"
|
align="center"
|
prop="treatmenthospitalname"
|
width="180"
|
/>
|
|
<el-table-column
|
label="报告人"
|
align="center"
|
prop="reportername"
|
width="120"
|
/>
|
<el-table-column
|
label="报告时间"
|
align="center"
|
prop="reporttime"
|
width="120"
|
/>
|
<!-- <el-table-column label="完成时间" sortable align="center" prop="CompleteTime" width="180">
|
<template slot-scope="scope">
|
<span>{{ parseTime(scope.row.CompleteTime, '{y}-{m}-{d}') }}</span>
|
</template>
|
</el-table-column> -->
|
<!-- <el-table-column label="附件编号" align="center" prop="id" /> -->
|
<!-- <el-table-column label="捐献编号" align="center" prop="donorno" /> -->
|
<el-table-column label="附件编号" align="center" prop="annexno" />
|
<el-table-column label="附件名称" align="center" prop="annexname" />
|
<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="['project:donateannex:edit']"
|
>修改</el-button
|
>
|
<el-button
|
size="mini"
|
type="text"
|
icon="el-icon-delete"
|
@click="handleDelete(scope.row)"
|
v-hasPermi="['project:donateannex: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="donorno">
|
<el-input v-model="form.donorno" placeholder="请输入捐献者编号" />
|
</el-form-item>
|
<el-form-item label="附件名称" prop="annexname">
|
<el-input v-model="form.annexname" placeholder="请输入附件名称" />
|
</el-form-item>
|
<el-form-item label="附件编号" prop="annexno">
|
<el-input v-model="form.annexno" placeholder="请输入附件编号" />
|
</el-form-item>
|
<el-form-item label="附件路径">
|
<fileUpload v-model="form.annexurl"/>
|
</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> -->
|
|
<el-dialog
|
:close-on-click-modal="false"
|
:title="title"
|
:visible.sync="open"
|
width="800px"
|
append-to-body
|
>
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
<el-form-item label="捐献编号" prop="donorno">
|
<el-input v-model="form.donorno" placeholder="请输入捐献者编号" />
|
</el-form-item>
|
|
<el-form-item label="姓名" prop="name">
|
<el-input
|
disabled
|
v-model="form.name"
|
placeholder="请输入捐献者姓名"
|
/>
|
</el-form-item>
|
|
<el-table
|
:data="attachmentTableData"
|
style="width: 100%; margin-bottom: 20px"
|
row-key="annexno"
|
border
|
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
>
|
<el-table-column prop="annexname" width="350" label="附件名称">
|
</el-table-column>
|
<el-table-column label="状态">
|
<template slot-scope="scope">
|
<span v-if="scope.row.istitle"></span>
|
<span v-else-if="scope.row.annexurl.length == 0" size="mini"
|
>未上传</span
|
>
|
<span v-else size="mini">已上传</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="操作">
|
<template slot-scope="scope">
|
<!-- <el-button v-if="!scope.row.istitle && scope.row.annexurl.length == 0" size="mini">上传</el-button> -->
|
<el-upload
|
v-if="!scope.row.istitle"
|
size="mini"
|
class="upload-demo"
|
:action="uploadFileUrl"
|
:file-list="scope.row.fileList"
|
multiple
|
:limit="5"
|
:headers="headers"
|
:on-success="
|
(response, file, fileList) =>
|
uploadSccess(response, file, fileList, scope.row, scope)
|
"
|
:on-error="uploadError"
|
:on-remove="
|
(file, fileList) => removeFile(file, fileList, scope.row)
|
"
|
>
|
<el-button size="small" type="primary">上传</el-button>
|
</el-upload>
|
</template>
|
</el-table-column>
|
</el-table>
|
</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 { getToken } from "@/utils/auth";
|
import {
|
listnewDonateannex,
|
listDonateannex,
|
getDonateannex,
|
delDonateannex,
|
addDonateannex,
|
updateDonateannex,
|
exportDonateannex
|
} from "@/api/project/donateannex";
|
import Li_area_select from "@/components/Address";
|
import OrgSelecter from "@/views/project/components/orgselect";
|
import AnnexUpload from "@/views/project/components/annexupload";
|
import {
|
listDonatebaseinfo,
|
getDonatebaseinfo,
|
delDonatebaseinfo,
|
addDonatebaseinfo,
|
updateDonatebaseinfo,
|
exportDonatebaseinfo,
|
getdonatorno
|
// exportProvincemessage,
|
} from "@/api/project/donatebaseinfo";
|
export default {
|
components: {
|
Li_area_select,
|
OrgSelecter,
|
AnnexUpload
|
},
|
name: "Donateannex",
|
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 {
|
// 遮罩层
|
loading: true,
|
// 导出遮罩层
|
exportLoading: false,
|
// 选中数组
|
ids: [],
|
// 非单个禁用
|
single: true,
|
// 非多个禁用
|
multiple: true,
|
// 显示搜索条件
|
showSearch: true,
|
// 总条数
|
total: 0,
|
// 捐献附件表格数据
|
donateannexList: [],
|
// 弹出层标题
|
title: "",
|
// 是否显示弹出层
|
open: false,
|
donorno: "",
|
// 查询参数
|
queryParams: {
|
pageNum: 1,
|
pageSize: 10,
|
donorno: null,
|
annexname: null,
|
annexno: null
|
},
|
// 表单参数
|
form: {},
|
// 表单校验
|
rules: {},
|
//附件列表
|
attachmentTableData: [
|
{
|
annexname: "捐献者及亲属身份证明",
|
istitle: true,
|
annexno: "001",
|
annexurl: "",
|
children: [
|
{
|
annexname: "捐献者身份证明",
|
annexno: "0001",
|
annexurl: "",
|
fileList: []
|
},
|
{
|
annexname: "捐献者亲属身份证明",
|
annexno: "0002",
|
annexurl: "",
|
fileList: []
|
}
|
]
|
},
|
{
|
annexname: "捐献者及亲属关系证明",
|
annexno: "002",
|
annexurl: "",
|
fileList: []
|
},
|
{
|
annexname: "捐献者病情简介",
|
annexno: "003",
|
annexurl: "",
|
fileList: []
|
},
|
{
|
annexname: "捐献确认登记表",
|
annexno: "004",
|
annexurl: "",
|
fileList: []
|
},
|
{
|
annexname: "人体器官捐献人员评估资质(可选)",
|
annexno: "005",
|
annexurl: "",
|
fileList: []
|
},
|
{
|
annexname: "公民逝世后人体器官捐献告知书",
|
annexno: "006",
|
annexurl: "",
|
fileList: []
|
},
|
{
|
annexname: "DBD/DCD可行性评估报告",
|
istitle: true,
|
annexno: "007",
|
annexurl: "",
|
children: [
|
{
|
annexname: "(一)DBD可行性评估报告",
|
istitle: true,
|
annexno: "0071",
|
annexurl: "",
|
children: [
|
{
|
annexname: "人体器官捐献病情评估表(DBD)",
|
annexno: "00711",
|
annexurl: "",
|
fileList: []
|
},
|
{
|
annexname: "脑死亡判定符合报告:符合其中两项即可",
|
istitle: true,
|
annexno: "00712",
|
annexurl: "",
|
children: [
|
{
|
annexname: "脑电图报告",
|
annexno: "007121",
|
annexurl: "",
|
fileList: []
|
},
|
{
|
annexname: "短潜伏期体感诱发电位",
|
annexno: "007122",
|
annexurl: "",
|
fileList: []
|
},
|
{
|
annexname: "经颅多普勒超声报告",
|
annexno: "007123",
|
annexurl: "",
|
fileList: []
|
}
|
]
|
},
|
{
|
annexname: "人体器官捐献病情评估意见(DBD)",
|
annexno: "00713",
|
annexurl: "",
|
fileList: []
|
}
|
]
|
},
|
{
|
annexname: "(二)DCD可行性评估报告",
|
istitle: true,
|
annexno: "0072",
|
annexurl: "",
|
children: [
|
{
|
annexname: "人体器官捐献病情评估表(DCD)",
|
annexno: "00721",
|
annexurl: "",
|
fileList: []
|
},
|
{
|
annexname: "撤除心肺支持60分钟内死亡风险评估单",
|
annexno: "00722",
|
annexurl: "",
|
fileList: []
|
},
|
{
|
annexname: "人体器官捐献病情评估意见(DCD)",
|
annexno: "00723",
|
annexurl: "",
|
fileList: []
|
}
|
]
|
}
|
]
|
}
|
],
|
// 上传的图片服务器地址
|
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload",
|
headers: {
|
Authorization: "Bearer " + getToken()
|
},
|
//各份附件所在attachmentTableData数组中的位置
|
attachJsonPosition: [
|
{
|
id: null,
|
annexname: "捐献者身份证明",
|
annexno: "001",
|
annexurl: "",
|
level: 2,
|
position: [0, 0]
|
},
|
{
|
id: null,
|
annexname: "捐献者亲属身份证明",
|
annexno: "002",
|
annexurl: "",
|
level: 2,
|
position: [0, 1]
|
},
|
{
|
id: null,
|
annexname: "捐献者及亲属关系证明",
|
annexno: "001",
|
annexurl: "",
|
level: 1,
|
position: [1]
|
},
|
{
|
id: null,
|
annexname: "捐献者病情简介",
|
annexno: "001",
|
annexurl: "",
|
level: 1,
|
position: [2]
|
},
|
{
|
id: null,
|
annexname: "捐献确认登记表",
|
annexno: "001",
|
annexurl: "",
|
level: 1,
|
position: [3]
|
},
|
{
|
id: null,
|
annexname: "人体器官捐献人员评估资质(可选)",
|
annexno: "001",
|
annexurl: "",
|
level: 1,
|
position: [4]
|
},
|
{
|
id: null,
|
annexname: "公民逝世后人体器官捐献告知书",
|
annexno: "001",
|
annexurl: "",
|
level: 1,
|
position: [5]
|
},
|
{
|
id: null,
|
annexname: "人体器官捐献病情评估表(DBD)",
|
annexno: "001",
|
annexurl: "",
|
level: 3,
|
position: [6, 0, 0]
|
},
|
{
|
id: null,
|
annexname: "脑电图报告",
|
annexno: "001",
|
annexurl: "",
|
level: 4,
|
position: [6, 0, 1, 0]
|
},
|
{
|
id: null,
|
annexname: "短潜伏期体感诱发电位",
|
annexno: "001",
|
annexurl: "",
|
level: 4,
|
position: [6, 0, 1, 1]
|
},
|
{
|
id: null,
|
annexname: "经颅多普勒超声报告",
|
annexno: "001",
|
annexurl: "",
|
level: 4,
|
position: [6, 0, 1, 2]
|
},
|
{
|
id: null,
|
annexname: "人体器官捐献病情评估意见(DBD)",
|
annexno: "001",
|
annexurl: "",
|
level: 3,
|
position: [6, 0, 2]
|
},
|
{
|
id: null,
|
annexname: "人体器官捐献病情评估表(DCD)",
|
annexno: "001",
|
annexurl: "",
|
level: 3,
|
position: [6, 1, 0]
|
},
|
{
|
id: null,
|
annexname: "撤除心肺支持60分钟内死亡风险评估单",
|
annexno: "001",
|
annexurl: "",
|
level: 3,
|
position: [6, 1, 1]
|
},
|
{
|
id: null,
|
annexname: "人体器官捐献病情评估意见(DCD)",
|
annexno: "001",
|
annexurl: "",
|
level: 3,
|
position: [6, 1, 2]
|
}
|
],
|
//捐赠编号
|
donorno: "0001",
|
infoid: "8",
|
openType: "edit"
|
};
|
},
|
created() {
|
this.getList();
|
},
|
methods: {
|
/** 查询捐献附件列表 */
|
getList() {
|
this.loading = true;
|
listnewDonateannex(this.queryParams).then(response => {
|
console.log("新数据", response);
|
this.donateannexList = response.rows;
|
console.log(this.donateannexList.donorNo);
|
this.total = response.total;
|
this.loading = false;
|
});
|
},
|
// 取消按钮
|
cancel() {
|
this.open = false;
|
this.reset();
|
},
|
curCase: {
|
donorno: "",
|
name: "",
|
registerAddresss: "",
|
infoid: ""
|
},
|
// 表单重置
|
reset() {
|
this.form = {
|
id: null,
|
name: null,
|
sex: null,
|
idcardtype: null,
|
idcardno: null,
|
age: null,
|
ageunit: null,
|
birthday: null,
|
phone: null,
|
residenceaddress: null,
|
nationality: null,
|
residenceprovince: null,
|
nativeplace: null,
|
residenceprovincename: null,
|
nation: null,
|
occupation: null,
|
residencecity: null,
|
residencecityname: null,
|
education: null,
|
residencetown: null,
|
residencetownname: null,
|
residencecommunity: null,
|
residencecommunityname: null,
|
residencecountycode: null,
|
residencecountyname: null,
|
registeraddress: null,
|
registerprovince: null,
|
registerprovincename: null,
|
registercity: null,
|
registercityname: null,
|
registertown: null,
|
registertownname: null,
|
registercommunity: null,
|
registercommunityname: null,
|
registercountycode: null,
|
registercountyname: null,
|
recordstate: null,
|
treatmenthospitalno: null,
|
treatmenthospitalname: null,
|
treatmentdeptname: null,
|
diagnosisno: null,
|
diagnosisname: null,
|
bloodtype: "0",
|
inpatientno: null,
|
rhyin: 0,
|
donorno: null,
|
donationcategory: null,
|
illnessoverview: null,
|
diseasetype: [],
|
infectious: [],
|
selfwill: [],
|
othercases: [],
|
kinshipwill: 0,
|
diseasetypeOther: null,
|
kinship: [],
|
infosources: [],
|
redorganno: null,
|
redorganname: null,
|
contactperson: null,
|
infectiousOther: null,
|
contactnumber: null,
|
reporterno: null,
|
patientstate: [],
|
reportername: null,
|
infosourcesOther: null,
|
reporterphone: null,
|
reporttime: null,
|
delFlag: null,
|
createBy: null,
|
createTime: null,
|
updateBy: null,
|
updateTime: null,
|
kinshipOther: null,
|
majorrelatives: null,
|
familyrelations: null,
|
acquisitiontissueno: null,
|
acquisitiontissuename: null
|
};
|
this.resetForm("form");
|
},
|
handleQuery() {
|
this.queryParams.pageNum = 1;
|
this.getList();
|
},
|
/** 重置按钮操作 */
|
resetQuery() {
|
this.daterangeReporttime = [];
|
this.resetForm("queryForm");
|
this.handleQuery();
|
},
|
// 多选框选中数据
|
handleSelectionChange(selection) {
|
this.ids = selection.map(item => item.id);
|
this.single = selection.length !== 1;
|
this.multiple = !selection.length;
|
},
|
/** 新增按钮操作 */
|
handleAdd(data) {
|
this.reset();
|
// this.curCase.name=data.name;
|
this.curCase = data;
|
if (this.openType == "edit") {
|
this.title = "修改捐献基础";
|
let searchParam = {
|
donorno: this.donorno,
|
infoid: this.infoid,
|
isdel: 0
|
};
|
this.loading = true;
|
listDonateannex(searchParam).then(response => {
|
//this.donateannexList = response.rows;
|
this.loading = false;
|
let dataList = response.rows;
|
//将保存数据转为页面控件能调用的格式
|
for (let i = 0; i < dataList.length; i++) {
|
for (let k = 0; k < this.attachJsonPosition.length; k++) {
|
if (
|
dataList[i].annexname == this.attachJsonPosition[k].annexname
|
) {
|
this.attachJsonPosition[k].annexurl = dataList[i].annexurl;
|
this.attachJsonPosition[k].id = dataList[i].id;
|
let tempUrl = dataList[i].annexurl;
|
let temp = 1;
|
let tempfileList = [];
|
if (tempUrl != "") {
|
const list = Array.isArray(tempUrl)
|
? tempUrl
|
: tempUrl.split(",");
|
tempfileList = list.map(item => {
|
if (typeof item === "string") {
|
item = { name: item, url: item };
|
}
|
item.uid = item.uid || new Date().getTime() + temp++;
|
return item;
|
});
|
}
|
//定位到树状数据
|
let tempPositionArr = this.attachJsonPosition[k].position;
|
let tempData;
|
if (this.attachJsonPosition[k].level == 1) {
|
this.attachmentTableData[
|
tempPositionArr[0]
|
].fileList = tempfileList;
|
this.attachmentTableData[
|
tempPositionArr[0]
|
].annexurl = tempUrl;
|
tempData = this.attachmentTableData[tempPositionArr[0]];
|
} else if (this.attachJsonPosition[k].level == 2) {
|
this.attachmentTableData[tempPositionArr[0]].children[
|
tempPositionArr[1]
|
].fileList = tempfileList;
|
this.attachmentTableData[tempPositionArr[0]].children[
|
tempPositionArr[1]
|
].annexurl = tempUrl;
|
tempData = this.attachmentTableData[tempPositionArr[0]]
|
.children[tempPositionArr[1]];
|
} else if (this.attachJsonPosition[k].level == 3) {
|
this.attachmentTableData[tempPositionArr[0]].children[
|
tempPositionArr[1]
|
].children[tempPositionArr[2]].fileList = tempfileList;
|
this.attachmentTableData[tempPositionArr[0]].children[
|
tempPositionArr[1]
|
].children[tempPositionArr[2]].annexurl = tempUrl;
|
tempData = this.attachmentTableData[tempPositionArr[0]]
|
.children[tempPositionArr[1]].children[tempPositionArr[2]];
|
} else if (this.attachJsonPosition[k].level == 4) {
|
this.attachmentTableData[tempPositionArr[0]].children[
|
tempPositionArr[1]
|
].children[tempPositionArr[2]].children[
|
tempPositionArr[3]
|
].fileList = tempfileList;
|
this.attachmentTableData[tempPositionArr[0]].children[
|
tempPositionArr[1]
|
].children[tempPositionArr[2]].children[
|
tempPositionArr[3]
|
].annexurl = tempUrl;
|
tempData = this.attachmentTableData[tempPositionArr[0]]
|
.children[tempPositionArr[1]].children[tempPositionArr[2]]
|
.children[tempPositionArr[3]];
|
}
|
}
|
}
|
}
|
});
|
} else {
|
this.title = "添加捐献基础";
|
}
|
this.open = true;
|
},
|
/** 修改按钮操作 */
|
handleUpdate(row) {
|
this.reset();
|
const id = row.id || this.ids;
|
getDonatebaseinfo(id).then(response => {
|
this.form = response.data;
|
console.log("form:", this.form);
|
// this.form.diseasetype = this.form.diseasetype.split(",");
|
// this.form.infectious = this.form.infectious.split(",");
|
// this.form.selfwill = this.form.selfwill.split(",");
|
// this.form.othercases = this.form.othercases.split(",");
|
// this.form.kinship = this.form.kinship.split(",");
|
// this.form.infosources = this.form.infosources.split(",");
|
// this.form.patientstate = this.form.patientstate.split(",");
|
this.open = true;
|
this.title = "修改捐献基础";
|
});
|
},
|
/** 提交按钮 */
|
submitForm() {
|
if (this.openType == "edit") {
|
//循环数组,单个上传,后续改为批量上传
|
for (let i = 0; i < this.attachJsonPosition.length; i++) {
|
let updateParam = {
|
id: this.attachJsonPosition[i].id,
|
infoid: this.infoid,
|
donorno: this.donorno,
|
delFlag: 0,
|
annexname: this.attachJsonPosition[i].annexname,
|
annexno: this.attachJsonPosition[i].annexno,
|
annexurl: this.attachJsonPosition[i].annexurl
|
};
|
updateDonateannex(updateParam).then(response => {
|
this.$modal.msgSuccess("修改成功");
|
});
|
}
|
} else {
|
//循环数组,单个上传,后续改为批量上传
|
for (let i = 0; i < this.attachJsonPosition.length; i++) {
|
let addParam = {
|
infoid: this.infoid,
|
donorno: this.donorno,
|
delFlag: 0,
|
annexname: this.attachJsonPosition[i].annexname,
|
annexno: this.attachJsonPosition[i].annexno,
|
annexurl: this.attachJsonPosition[i].annexurl
|
};
|
addDonateannex(addParam).then(response => {
|
this.$modal.msgSuccess("新增成功");
|
//this.open = false;
|
});
|
}
|
}
|
},
|
|
/** 删除按钮操作 */
|
handleDelete(row) {
|
const ids = row.id || this.ids;
|
this.$modal
|
.confirm('是否确认删除捐献基础编号为"' + ids + '"的数据项?')
|
.then(function() {
|
return delDonatebaseinfo(ids);
|
})
|
.then(() => {
|
this.getList();
|
this.$modal.msgSuccess("删除成功");
|
})
|
.catch(() => {});
|
},
|
/** 导出按钮操作 */
|
handleExport() {
|
const queryParams = this.queryParams;
|
this.$modal
|
.confirm("是否确认导出所有捐献基础数据项?")
|
.then(() => {
|
this.exportLoading = true;
|
return exportDonatebaseinfo(queryParams);
|
})
|
.then(response => {
|
this.$download.name(response.msg);
|
this.exportLoading = false;
|
})
|
.catch(() => {});
|
},
|
/** 附件上传按钮 */
|
|
uploadSccess(response, file, fileList, attachmentFileInfo, scope) {
|
//获取附件信息位置
|
if (response.code == 200) {
|
this.$modal.msgSuccess(response.msg);
|
var position;
|
let positionIndex;
|
for (let i = 0; i < this.attachJsonPosition.length; i++) {
|
if (
|
attachmentFileInfo.annexname == this.attachJsonPosition[i].annexname
|
) {
|
position = this.attachJsonPosition[i];
|
positionIndex = i;
|
break;
|
}
|
}
|
if (position != null) {
|
let positionArr = [];
|
positionArr = position.position;
|
if (position.level == 1) {
|
let first = this.attachmentTableData[positionArr[0]];
|
first.fileList.push({ name: file.name, url: response.fileName });
|
first.annexurl = this.listToString(first.fileList);
|
this.attachmentTableData[positionArr[0]] = first;
|
this.attachJsonPosition[positionIndex].annexurl = first.annexurl;
|
} else if (position.level == 2) {
|
let first = this.attachmentTableData[positionArr[0]];
|
let second = first.children[positionArr[1]];
|
second.fileList.push({ name: file.name, url: response.fileName });
|
second.annexurl = this.listToString(second.fileList);
|
first.children[positionArr[1]] = second;
|
this.attachmentTableData[positionArr[0]] = first;
|
this.attachJsonPosition[positionIndex].annexurl = second.annexurl;
|
} else if (position.level == 3) {
|
let first = this.attachmentTableData[positionArr[0]];
|
let second = first.children[positionArr[1]];
|
let third = second.children[positionArr[2]];
|
third.fileList.push({ name: file.name, url: response.fileName });
|
third.annexurl = this.listToString(third.fileList);
|
second.children[positionArr[2]] = third;
|
first.children[positionArr[1]] = second;
|
this.attachmentTableData[positionArr[0]] = first;
|
this.attachJsonPosition[positionIndex].annexurl = third.annexurl;
|
} else if (position.level == 4) {
|
let first = this.attachmentTableData[positionArr[0]];
|
let second = first.children[positionArr[1]];
|
let third = second.children[positionArr[2]];
|
let forth = third.children[positionArr[3]];
|
forth.fileList.push({ name: file.name, url: response.fileName });
|
forth.annexurl = this.listToString(forth.fileList);
|
third.children[positionArr[3]] = forth;
|
second.children[positionArr[2]] = third;
|
first.children[positionArr[1]] = second;
|
this.attachmentTableData[positionArr[0]] = first;
|
this.attachJsonPosition[positionIndex].annexurl = forth.annexurl;
|
}
|
}
|
} else {
|
console.log(response.msg);
|
}
|
},
|
|
uploadError(err, file, fileList) {
|
alert("上传失败:" + err);
|
},
|
//移除附件
|
removeFile(file, fileList, attachmentFileInfo) {
|
let fileArr = [];
|
let fileUrl = "";
|
for (let i = 0; i < fileList.length; i++) {
|
fileArr.push({ name: fileList[i].name, url: fileList[i].url });
|
}
|
attachmentFileInfo.fileList = fileArr;
|
attachmentFileInfo.annexurl = this.listToString(fileArr);
|
//获取附件信息位置
|
var position;
|
let positionIndex;
|
for (let i = 0; i < this.attachJsonPosition.length; i++) {
|
if (
|
attachmentFileInfo.annexname == this.attachJsonPosition[i].annexname
|
) {
|
position = this.attachJsonPosition[i];
|
positionIndex = i;
|
break;
|
}
|
}
|
if (position != null) {
|
let positionArr = [];
|
positionArr = position.position;
|
if (position.level == 1) {
|
this.attachmentTableData[positionArr[0]] = attachmentFileInfo;
|
this.attachJsonPosition[positionIndex].annexurl =
|
attachmentFileInfo.annexurl;
|
} else if (position.level == 2) {
|
this.attachmentTableData[positionArr[0]].children[
|
positionArr[1]
|
] = attachmentFileInfo;
|
this.attachJsonPosition[positionIndex].annexurl =
|
attachmentFileInfo.annexurl;
|
} else if (position.level == 3) {
|
this.attachmentTableData[positionArr[0]].children[
|
positionArr[1]
|
].children[positionArr[2]] = attachmentFileInfo;
|
this.attachJsonPosition[positionIndex].annexurl =
|
attachmentFileInfo.annexurl;
|
} else if (position.level == 4) {
|
this.attachmentTableData[positionArr[0]].children[
|
positionArr[1]
|
].children[positionArr[2]].children[3] = attachmentFileInfo;
|
this.attachJsonPosition[positionIndex].annexurl =
|
attachmentFileInfo.annexurl;
|
}
|
}
|
},
|
|
// 对象转成指定字符串分隔
|
listToString(list, separator, attachmentFileInfo) {
|
let strs = "";
|
separator = separator || ",";
|
for (let i in list) {
|
strs += list[i].url + separator;
|
}
|
return strs != "" ? strs.substr(0, strs.length - 1) : "";
|
}
|
}
|
};
|
</script>
|