<template>
|
<div class="Modifydetailscla">
|
<div class="boxdiv">
|
<div class="top-text">{{ title }}</div>
|
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
<el-row>
|
<el-col :span="5">
|
<el-form-item label="案例姓名" prop="name">
|
<el-input
|
v-model="form.name"
|
placeholder="请输入姓名"
|
:disabled="true"
|
/>
|
</el-form-item>
|
</el-col>
|
<el-col :span="5">
|
<el-form-item label="性别" prop="sex">
|
<el-select v-model="form.sex" placeholder="请输入性别">
|
<el-option
|
v-for="dict in dict.type.sys_user_sex"
|
:key="dict.label"
|
:label="dict.label"
|
:value="dict.value"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
</el-col>
|
<el-col :span="5">
|
<el-form-item label="年龄" prop="age">
|
<el-input v-model="form.age" placeholder="请输入年龄" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="5">
|
<el-form-item label="出生年月" prop="borthdate">
|
<el-date-picker
|
clearable
|
size="small"
|
v-model="form.borthdate"
|
type="date"
|
value-format="yyyy-MM-dd"
|
placeholder="选择出生年月"
|
>
|
</el-date-picker>
|
</el-form-item>
|
</el-col> </el-row
|
><el-row
|
><el-col :span="10"
|
><el-form-item label="案例编号" prop="donateno">
|
<el-input
|
v-model="form.donateno"
|
placeholder="请输入案例编号"
|
:disabled="true"
|
/>
|
</el-form-item>
|
</el-col>
|
<el-col :span="5">
|
<el-form-item label="案例时间" prop="donatetime">
|
<el-date-picker
|
clearable
|
size="small"
|
v-model="form.donatetime"
|
type="date"
|
value-format="yyyy-MM-dd"
|
placeholder="选择捐献时间"
|
>
|
</el-date-picker>
|
</el-form-item>
|
</el-col>
|
<el-col :span="5">
|
<el-form-item label="捐献类别" prop="donationcategory">
|
<el-input
|
v-model="form.donationcategory"
|
placeholder="请输入捐献类别"
|
/>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row>
|
<el-col :span="10">
|
<el-form-item label="备注" prop="remark">
|
<el-input v-model="form.remark" placeholder="请输入备注" />
|
</el-form-item>
|
</el-col>
|
<el-col :span="5">
|
<el-form-item label="实收金额" prop="chargeamounted">
|
<el-input
|
v-model="form.chargeamounted"
|
placeholder="请输入实收金额"
|
:disabled="true"
|
/>
|
</el-form-item>
|
</el-col>
|
<el-col :span="5">
|
<el-form-item label="应收金额" prop="chargeamount">
|
<el-input
|
v-model="form.chargeamount"
|
placeholder="请输入应收金额"
|
:disabled="true"
|
/>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
<el-row style="margin-top: 10px">
|
<el-table
|
:data="donorchargeorgans"
|
ref="table"
|
border
|
max-height="800"
|
highlight-current-row
|
:summary-method="getSummaries"
|
show-summary
|
>
|
<el-table-column
|
prop="organno"
|
align="center"
|
label="器官编号"
|
width="90"
|
>
|
<template slot-scope="scope">
|
<el-input
|
v-model="scope.row.organno"
|
placeholder="器官编号"
|
:disabled="true"
|
/>
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="organname"
|
align="center"
|
label="器官名称"
|
width="120"
|
>
|
<template slot-scope="scope">
|
<el-input
|
v-model="scope.row.organname"
|
placeholder="器官名称"
|
:disabled="true"
|
/>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="系统编号"
|
align="center"
|
width="120"
|
prop="caseno"
|
>
|
<template slot-scope="scope">
|
<el-input
|
v-model="scope.row.caseno"
|
placeholder="系统编号"
|
:disabled="true"
|
/>
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="amount"
|
align="center"
|
label="实收金额"
|
width="150"
|
>
|
<template slot-scope="scope">
|
<el-input
|
v-model="scope.row.amount"
|
placeholder="实收金额"
|
:disabled="true"
|
/>
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="amounttime"
|
align="center"
|
label="实收时间"
|
width="200"
|
>
|
<template slot-scope="scope">
|
<el-date-picker
|
clearable
|
:disabled="true"
|
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="organcharge"
|
align="center"
|
label="标准费用"
|
width="150"
|
>
|
<template slot-scope="scope">
|
<el-input
|
v-model="scope.row.organcharge"
|
placeholder="标准费用"
|
:disabled="true"
|
/>
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="hospitalno"
|
align="center"
|
label="接收医院"
|
width="280"
|
>
|
<template slot-scope="scope">
|
<org-selecter
|
v-model="scope.row.hospitalno"
|
ref="tranHosSelect"
|
:org-type="'4'"
|
style="width: 100%"
|
:disabled="true"
|
/>
|
</template>
|
</el-table-column>
|
<el-table-column
|
label="受体姓氏"
|
align="center"
|
width="120"
|
prop="name"
|
>
|
<template slot-scope="scope">
|
<el-input
|
v-model="scope.row.name"
|
placeholder="受体姓氏"
|
/>
|
</template>
|
</el-table-column>
|
<el-table-column
|
prop="organtime"
|
align="center"
|
label="移植时间"
|
width="200"
|
>
|
<template slot-scope="scope">
|
<el-date-picker
|
clearable
|
:disabled="true"
|
size="small"
|
style="width: 100%"
|
v-model="scope.row.organtime"
|
type="date"
|
value-format="yyyy-MM-dd HH:mm:ss"
|
placeholder="移植时间"
|
>
|
</el-date-picker>
|
</template>
|
</el-table-column>
|
<el-table-column prop="organchargedesc" align="center" label="备注">
|
<template slot-scope="scope" width="300">
|
<el-input
|
v-model="scope.row.organchargedesc"
|
placeholder="备注"
|
/>
|
</template>
|
</el-table-column>
|
</el-table>
|
</el-row>
|
</el-form>
|
<div slot="footer" class="dialog-footer">
|
<el-button
|
type="success"
|
@click="submitForm"
|
v-if="operationType == 'add' || operationType == 'update'"
|
>保 存</el-button
|
>
|
<el-button type="info" @click="cancel">关闭</el-button>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import pdf from "vue-pdf";
|
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
|
} 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 OrgSelecter from "@/views/project/components/orgselect";
|
import Li_area_select from "@/components/Address";
|
import { getUserProfile } from "@/api/system/user";
|
import { getToken } from "@/utils/auth";
|
import debounce from "lodash/debounce";
|
export default {
|
components: {
|
Treeselect,
|
OrgSelecter,
|
Li_area_select,
|
pdf
|
},
|
dicts: ["sys_user_sex", "sys_0_1"],
|
name: "Donorchargemanager",
|
data() {
|
return {
|
activeName: 1, //文件类型
|
// 部门树选项
|
//票据文件
|
pdftitle: "",
|
pdfimg: "",
|
pdfVisible: false,
|
costtypeobj: {
|
value: 0,
|
label: ""
|
},
|
pdfimgsrcList: [],
|
Savereminder: false, //提醒保存弹框
|
Reminderquantity: 0, //提醒数量
|
totalquantity: 0, //总数量
|
|
hintitle: "选中左侧已上传文件预览查看",
|
atpresent: "",
|
iframeurl: "",
|
options: regionDataPlus,
|
selectedOptions: [],
|
value1: "",
|
previewpdf: false,
|
// 遮罩层
|
loading: true,
|
// 导出遮罩层
|
exportLoading: false,
|
// 网络请求头
|
Networkheader: null,
|
|
// 选中数组
|
ids: [],
|
// 非单个禁用
|
single: true,
|
// 非多个禁用
|
multiple: true,
|
// 显示搜索条件
|
showSearch: true,
|
// 总条数
|
total: 0,
|
// 捐献案例器官列表格数据
|
donorchargeList: [],
|
donorchargeorgans: [],
|
// 弹出层标题
|
title: "",
|
// 查询费用表参数
|
queryParams: {
|
pageNum: 1,
|
pageSize: 10,
|
infoid: null,
|
name: null,
|
donationcategory: null,
|
donateorgan: null,
|
chargeamounted: null
|
},
|
// 查询费用器官表参数
|
organParams: {
|
pageNum: 1,
|
pageSize: 10,
|
donorchargeid: null
|
},
|
// 当前用户信息
|
userprofile: {},
|
// 表单参数
|
form: {},
|
// 列表参数
|
table: {},
|
reimbursementList: [],
|
|
// 表单校验
|
rules: {
|
reason: [
|
{ required: true, message: "请输入出差事由", trigger: "blur" }
|
],
|
deptmentname: [
|
{ required: true, message: "请输入所属业务组", trigger: "blur" }
|
]
|
},
|
|
baselist: [],
|
donorList: [],
|
organchargelist: [],
|
standardlevel: 0,
|
defaultperson: {},
|
fundflowList: [],
|
showApproveRecordDialog: false,
|
|
// 当前单据ID
|
curId: 0,
|
curCase: null,
|
//业务操作类型
|
operationType: "edit",
|
|
//上传发票文件路径
|
uploadFileUrl: process.env.VUE_APP_BASE_API + "/common/upload",
|
//文件列表
|
fileList: [],
|
fileListto: [],
|
invoicefileList: [],
|
invoicefileListto: [],
|
invoicepdfimg: "",
|
invoicepdfimgsrcList: [],
|
invoDatatop: [],
|
//人员类别
|
persontype: null,
|
|
headers: {
|
Authorization: "Bearer " + getToken()
|
},
|
jurisdiction: false,
|
|
//保存按钮控制
|
idisabled: false
|
};
|
},
|
|
created() {
|
console.log(234);
|
this.Getnetworkheader();
|
|
//获取登录者信息
|
getUserProfile().then(response => {
|
this.userprofile = response.data;
|
this.defaultperson = response.data;
|
this.standardlevel = response.data.standardlevel;
|
});
|
//获取参数
|
this.getroute();
|
},
|
|
mounted() {
|
window.addEventListener("beforeunload", e => this.beforeunloadHandler(e));
|
},
|
|
updated() {
|
this.$nextTick(() => {
|
this.$refs["table"].doLayout();
|
});
|
},
|
|
destroyed() {
|
window.removeEventListener("beforeunload", e => this.beforeunloadFn(e));
|
}, //生命周期 - 销毁完成
|
|
methods: {
|
// 浏览器页面关闭或刷新提示
|
beforeunloadHandler(e) {
|
if (
|
(JSON.stringify(this.form) == sessionStorage.getItem("apiform") &&
|
JSON.stringify(this.donorchargeorgans) ==
|
sessionStorage.getItem("apifunddetail")) ||
|
!sessionStorage.getItem("apifunddetail")
|
) {
|
} else {
|
this._beforeUnload_time = new Date().getTime();
|
e = e || window.event;
|
if (e) {
|
e.returnValue = "关闭提示";
|
}
|
return "关闭提示";
|
}
|
},
|
|
handleUploadError() {},
|
// 获取请求头
|
Getnetworkheader() {
|
let string = window.location.href;
|
if (string.includes("9091")) {
|
const index = string.indexOf("9091");
|
this.Networkheader = string.slice(0, index + 4); // 截取9091及其前部字符
|
} else {
|
const index = string.indexOf("8032");
|
this.Networkheader = string.slice(0, index + 4); // 截取8032及其前部字符
|
}
|
},
|
// 发票切换
|
handleClick(tab, event) {
|
if (this.activeName == 1) {
|
this.pdftitle = "共" + this.pdfimgsrcList.length + "项";
|
} else {
|
this.pdftitle = "共" + this.invoicepdfimgsrcList.length + "项";
|
}
|
},
|
|
getIndexInArray(arr, obj) {
|
return arr.indexOf(obj);
|
},
|
|
// 表单重置
|
reset() {
|
this.form = {
|
id: null,
|
infoid: null,
|
donateno: null,
|
donatetime: null,
|
name: null,
|
borthdate: null,
|
sex: null,
|
age: null,
|
donationcategory: null,
|
donateorgan: null,
|
chargeamount: null,
|
chargeamounted: null,
|
remark: null,
|
delFlag: null,
|
createBy: null,
|
createTime: null,
|
updateBy: null,
|
updateTime: null
|
};
|
this.resetForm("form");
|
},
|
|
/** 通过参数获取业务类型 */
|
getroute() {
|
//选择业务类型:1、新增;2、修改;3、查看
|
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);
|
|
if (this.operationType == "add") {
|
this.title = "新建案例器官费用表";
|
this.handleAdd();
|
console.log("1");
|
} else if (this.operationType == "update") {
|
this.title = "修改案例器官费用表";
|
this.handleUpdate();
|
console.log("2");
|
} else if (this.operationType == "detail") {
|
this.title = "查看案例器官费用表";
|
this.handleDetail();
|
console.log("3");
|
}
|
},
|
|
/** 重置按钮操作 */
|
resetQuery() {
|
this.resetForm("queryForm");
|
this.handleQuery();
|
},
|
|
// 取消按钮
|
cancel() {
|
this.$store.dispatch("tagsView/delView", this.$route);
|
this.$router.go(-1);
|
},
|
|
// 多选框选中数据
|
handleSelectionChange(selection) {
|
this.ids = selection.map(item => item.id);
|
this.single = selection.length !== 1;
|
this.multiple = !selection.length;
|
},
|
|
/** 新增按钮操作 */
|
handleAdd() {
|
this.reset();
|
this.title = "新增捐献案例器官费用表";
|
|
if (this.curCase) {
|
this.form.infoid = this.curCase.id;
|
this.form.donateno = this.curCase.donorno;
|
this.form.donatetime = this.curCase.donatetime;
|
this.form.name = this.curCase.name;
|
this.form.borthdate = this.curCase.birthday;
|
this.form.sex = this.curCase.sex;
|
this.form.age = this.curCase.age;
|
this.form.donationcategory = this.curCase.donationcategory;
|
|
//获取完成登记的器官表
|
if (this.curCase.id > 0) {
|
} else {
|
this.curCase.id = 0;
|
}
|
let searchParam = {
|
infoid: this.curCase.id
|
};
|
listDonatecomporgan(searchParam).then(res => {
|
if (res.code == 200) {
|
// 查询器官费用表
|
let tempParam = {
|
organcode: null,
|
organname: null,
|
charge: null
|
};
|
listOrgancharge(tempParam).then(res1 => {
|
if (res1.code == 200) {
|
this.organchargelist = res1.rows;
|
}
|
//插入器官表
|
res.rows.forEach(item => {
|
//获取费用金额
|
this.organchargelist.map(rescharge => {
|
if (rescharge.organcode == item.organno) {
|
this.donorchargeorgans.push({
|
organno: item.organno,
|
caseno: item.caseno,
|
organname: item.organname,
|
organcharge: rescharge.charge,
|
infoid: item.infoid,
|
hospitalname: item.hospitalname,
|
hospitalno: item.hospitalno,
|
organtime: item.transplanttime,
|
chargestate: "0"
|
});
|
}
|
});
|
});
|
});
|
}
|
});
|
}
|
},
|
|
/** 修改按钮操作 */
|
handleUpdate() {
|
this.reset();
|
this.title = "修改捐献案例器官费用表";
|
|
getDonorcharge(this.curId).then(response => {
|
this.form = response.data;
|
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;
|
console.log(this.donorchargeorgans, "donorchargeorgans");
|
if (this.donorchargeorgans.length > 0) {
|
} else {
|
this.addRow(0);
|
}
|
});
|
});
|
},
|
|
/** 修改查看操作 */
|
handleDetail() {
|
this.reset();
|
|
getDonorcharge(this.curId).then(response => {
|
this.form = response.data;
|
this.title = "查看捐献案例器官费用表";
|
|
//器官费用信息
|
this.organParams.donorchargeid = this.curId;
|
listDonorchargeorgan(this.organParams).then(res => {
|
this.donorchargeorgans = res.rows;
|
if (this.donorchargeorgans.length > 0) {
|
} else {
|
this.addRow(0);
|
}
|
});
|
});
|
},
|
|
/** 提交保存按钮 */
|
submitForm: debounce(function(data) {
|
this.$refs["form"].validate(valid => {
|
if (valid) {
|
//校验、费用合计
|
let ChargeSum = 0;
|
let ChargeamountSum = 0;
|
let organname = "";
|
|
try {
|
for (let i = 0; i < this.donorchargeorgans.length; i++) {
|
organname += this.donorchargeorgans[i].organname + ",";
|
if (!isNaN(parseFloat(this.donorchargeorgans[i].organcharge))) {
|
ChargeSum += parseFloat(this.donorchargeorgans[i].organcharge);
|
}
|
if (!isNaN(parseFloat(this.donorchargeorgans[i].amount))) {
|
ChargeamountSum += parseFloat(this.donorchargeorgans[i].amount);
|
}
|
}
|
this.form.donateorgan = organname.substring(
|
0,
|
organname.lastIndexOf(",")
|
);
|
this.form.chargeamount = ChargeSum.toFixed(2);
|
this.form.chargeamounted = ChargeamountSum.toFixed(2);
|
} catch {}
|
|
//保存
|
if (this.form.id != null) {
|
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.$router.go(-1);
|
|
}
|
});
|
}
|
});
|
} else {
|
addDonorcharge(this.form).then(response => {
|
if (response.code == 200) {
|
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.$router.go(-1);
|
|
}
|
});
|
}
|
});
|
}
|
}
|
});
|
}, 500),
|
|
//计算费用合计
|
chargeSum() {
|
let ChargeSum = 0;
|
let ChargeamountSum = 0;
|
|
//费用合计
|
try {
|
for (let i = 0; i < this.donorchargeorgans.length; i++) {
|
if (!isNaN(parseFloat(this.donorchargeorgans[i].organcharge))) {
|
ChargeSum += parseFloat(this.donorchargeorgans[i].organcharge);
|
}
|
if (!isNaN(parseFloat(this.donorchargeorgans[i].amount))) {
|
ChargeamountSum += parseFloat(this.donorchargeorgans[i].amount);
|
}
|
}
|
|
this.form.chargeamount = ChargeSum.toFixed(2);
|
this.form.chargeamounted = ChargeamountSum.toFixed(2);
|
} catch {}
|
},
|
|
//表格合计
|
getSummaries(param) {
|
const { columns, data } = param;
|
const sums = [];
|
var columnnames = [
|
"organno",
|
"organname",
|
"caseno",
|
"amounttime",
|
"name",
|
"hospitalname",
|
"organtime",
|
"remark",
|
'organchargedesc'
|
];
|
columns.forEach((column, index) => {
|
if (index === 0) {
|
sums[index] = "合计";
|
return;
|
}
|
// if (index === 2) {
|
// sums[index] = this.form.chargeamounted;
|
// return;
|
// }
|
// if (index === 4) {
|
// sums[index] = this.form.chargeamount;
|
// return;
|
// }
|
//去除部分字段计算
|
if (columnnames.indexOf(column.property) > -1) {
|
return;
|
}
|
|
const values = data.map(item => Number(item[column.property]));
|
if (!values.every(value => isNaN(value))) {
|
sums[index] = values.reduce((prev, curr) => {
|
const value = Number(curr);
|
if (!isNaN(value)) {
|
return prev + curr;
|
} else {
|
return prev;
|
}
|
}, 0);
|
sums[index] = sums[index].toFixed(2); // 保留2位小数,解决小数合计列;
|
} else {
|
sums[index] = "";
|
}
|
});
|
return sums;
|
}
|
}
|
};
|
</script>
|
|
<style lang="scss" scoped>
|
.Modifydetailscla {
|
padding: 10px;
|
|
.boxdiv {
|
font-size: 18px;
|
padding: 0 30px;
|
padding-bottom: 60px;
|
|
.top-text {
|
text-align: center;
|
|
font-size: 23px;
|
font-weight: 600;
|
margin: 20px 0;
|
margin-bottom: 50px;
|
}
|
|
.dialog-footer {
|
text-align: left;
|
margin-top: 10px;
|
}
|
}
|
}
|
|
.upload-demo {
|
text-align: center;
|
}
|
|
.pdfimg {
|
display: flex; // text-align: center;
|
width: 100%;
|
height: 600px;
|
|
.box-pdf {
|
width: 400px;
|
padding-top: 20px;
|
margin-right: 30px;
|
border: 1px solid #dcdfe6;
|
-webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12),
|
0 0 6px 0 rgba(0, 0, 0, 0.04);
|
box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.1); // <- Add this to fix.
|
}
|
|
.pdftit {
|
width: 200px;
|
padding: 20px;
|
font-size: 18px;
|
}
|
|
.pdftit:hover {
|
background: #c0cef7;
|
}
|
|
.pdfimgmin {
|
width: 60%;
|
|
img {
|
width: 100%;
|
}
|
}
|
|
.pdfimgmins {
|
font-size: 28px;
|
width: 60%;
|
text-align: center;
|
}
|
}
|
::v-deep .el-input.is-disabled .el-input__inner {
|
background-color: #F5F7FA;
|
border-color: #dfe4ed;
|
color: #000000;
|
cursor: not-allowed;
|
}
|
|
::v-deep .el-input--medium .el-input__inner {
|
height: 36px;
|
line-height: 36px;
|
text-align: center;
|
}
|
|
::v-deep .el-alert__title {
|
font-size: 20px;
|
line-height: 20px;
|
}
|
</style>
|