Commit d6e01f55 authored by 吴婷慧's avatar 吴婷慧

表格编辑新增功能实现,福利信息页面处理

parent 99a73794
...@@ -5,4 +5,5 @@ export default { ...@@ -5,4 +5,5 @@ export default {
corporateCodeList: "/backstage/auth/corporateList", corporateCodeList: "/backstage/auth/corporateList",
planCodeList: "/backstage/auth/planList", planCodeList: "/backstage/auth/planList",
uploadImg: "/common/upload", uploadImg: "/common/upload",
specialtyList: "/backstage/auth/specialtyList",
}; };
...@@ -3,4 +3,5 @@ export default { ...@@ -3,4 +3,5 @@ export default {
getCustomerList: "/backstage/auth/patientList", getCustomerList: "/backstage/auth/patientList",
updateCustomList: "/backstage/auth/updatePatientPolicy", updateCustomList: "/backstage/auth/updatePatientPolicy",
createCustomer: "/backstage/auth/createPatient", createCustomer: "/backstage/auth/createPatient",
customerDetail: "/backstage/auth/patientDetail",
}; };
// 福利管理api // 福利管理api
export default {}; export default {
benefitType: "/backstage/auth/benefitMasterList",
coverageList: "/backstage/auth/coverageList",
};
...@@ -8,21 +8,29 @@ const GETUSERINFO = (params) => { ...@@ -8,21 +8,29 @@ const GETUSERINFO = (params) => {
params, params,
}); });
}; };
// 保险公司下拉数据 // 保险公司下拉数据
const GETPAYORCODE = (data) => { const GETPAYORCODE = (data) => {
return req.post(apis.payorCodeList, { return req.post(apis.payorCodeList, {
data, data,
}); });
}; };
// get corporate Code 根据保险公司获取客户公司 // get corporate Code 根据保险公司获取客户公司
const GETCORPORATECODE = (data) => { const GETCORPORATECODE = (data) => {
return req.post(apis.corporateCodeList, data); return req.post(apis.corporateCodeList, data);
}; };
// get plan Code 根据客户公司获取保险计划 // get plan Code 根据客户公司获取保险计划
const GETPLANCODE = (data) => { const GETPLANCODE = (data) => {
return req.post(apis.planCodeList, data); return req.post(apis.planCodeList, data);
}; };
// 科室信息
const GETSPECIALTYLIST = (data) => {
return req.post(apis.specialtyList, data);
};
// 上传图片 // 上传图片
const UPLOADIMG = (data) => { const UPLOADIMG = (data) => {
return req.post(apis.uploadImg, data); return req.post(apis.uploadImg, data);
...@@ -34,5 +42,6 @@ export default { ...@@ -34,5 +42,6 @@ export default {
GETPAYORCODE, GETPAYORCODE,
GETCORPORATECODE, GETCORPORATECODE,
GETPLANCODE, GETPLANCODE,
GETSPECIALTYLIST,
UPLOADIMG, UPLOADIMG,
}; };
...@@ -7,6 +7,11 @@ const GETCUSTOMERLIST = function (data) { ...@@ -7,6 +7,11 @@ const GETCUSTOMERLIST = function (data) {
return req.post(apis.getCustomerList, data); return req.post(apis.getCustomerList, data);
}; };
// get custom detail
const GETCUSTOMERDETAIL = function (data) {
return req.post(apis.customerDetail, data);
};
// add or update custom data // add or update custom data
const UPDATECUSTOMDATA = function (data) { const UPDATECUSTOMDATA = function (data) {
return req.post(apis.updateCustomList, data); return req.post(apis.updateCustomList, data);
...@@ -17,4 +22,9 @@ const CREATENEWCUSTOMER = function (data) { ...@@ -17,4 +22,9 @@ const CREATENEWCUSTOMER = function (data) {
return req.post(apis.createCustomer, data); return req.post(apis.createCustomer, data);
}; };
export default { GETCUSTOMERLIST, UPDATECUSTOMDATA, CREATENEWCUSTOMER }; export default {
GETCUSTOMERLIST,
GETCUSTOMERDETAIL,
UPDATECUSTOMDATA,
CREATENEWCUSTOMER,
};
// 福利管理函数库 // 福利管理函数库
// import apis from "../apis_moudles/index"; import apis from "../apis_moudles/welfare.js";
// import req from "../request"; import req from "../request";
const GETBENEGITTYPE = () => {
return req.post(apis.benefitType);
};
const GETCOVERAGELIST = (data) => {
return req.post(apis.coverageList, data);
};
// 对象数组 // 对象数组
export default {}; export default { GETBENEGITTYPE, GETCOVERAGELIST };
...@@ -170,6 +170,13 @@ select { ...@@ -170,6 +170,13 @@ select {
vertical-align: middle; vertical-align: middle;
} }
.success.ant-btn-link {
color: #4cd964;
}
.danger.ant-btn-link {
color: #ff3b30;
}
// 菜单默认样式及激活样式重置 // 菜单默认样式及激活样式重置
.menu { .menu {
.icon-class { .icon-class {
...@@ -244,6 +251,11 @@ select { ...@@ -244,6 +251,11 @@ select {
// .fs(21); // .fs(21);
.pa(0, 8, 0, 8) .pa(0, 8, 0, 8)
} }
// 编辑的时候字体颜色修改
.ant-input,
.ant-select{
color: #2B63FF;
}
} }
.ant-btn-primary{ .ant-btn-primary{
background-color: #2B63FF; background-color: #2B63FF;
...@@ -267,7 +279,7 @@ select { ...@@ -267,7 +279,7 @@ select {
} }
} }
.custom-info { .ant-pagination {
.ant-pagination-item-active { .ant-pagination-item-active {
.fs(16); .fs(16);
border: none; border: none;
...@@ -284,6 +296,15 @@ select { ...@@ -284,6 +296,15 @@ select {
.ant-pagination-item:not(.ant-pagination-item-active) { .ant-pagination-item:not(.ant-pagination-item-active) {
display: none; display: none;
} }
.current-page {
color: #4d7cfe;
}
.size-change {
.w(107);
.mg-l(40);
background-color: #f8fafb;
border: none;
}
} }
.ant-radio-group{ .ant-radio-group{
......
<template> <template>
<div <div class="icon-class" :style="`font-size:${size}px`" @click="clickEvent">
class="icon-class"
:style="`font-size:${size}px`"
@click.stop="clickEvent"
>
<svg class="icon" aria-hidden="true"> <svg class="icon" aria-hidden="true">
<use :xlink:href="iconName" /> <use :xlink:href="iconName" />
</svg> </svg>
......
// 福利管理路由表,分包名称:welfare // 福利管理路由表,分包名称:welfare
export default { export default {
path: "/welfare", path: "/welfare",
name: "Welfare", name: "welfare",
component: () => { component: () => {
return import(/* webpackChunkName: "Welfare" */ "@/views/welfare"); return import(/* webpackChunkName: "Welfare" */ "@/views/welfare");
}, },
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :xl="6" :lg="6" :sm="12"> <a-col :xl="6" :lg="6" :sm="12">
<a-form-model-item label="客户公司名称" prop="payorName"> <a-form-model-item label="客户公司名称" prop="corpName">
<a-select <a-select
v-model="form.corpName" v-model="form.corpName"
placeholder="请选择客户公司名称" placeholder="请选择客户公司名称"
...@@ -214,7 +214,7 @@ ...@@ -214,7 +214,7 @@
</div> </div>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :xl="24" :lg="18" :sm="12" class="none-label"> <a-col :xl="24" :lg="18" :sm="12" class="none-label clearfix">
<a-form-model-item label="button"> <a-form-model-item label="button">
<a-button type="primary"> <a-button type="primary">
<Icon name="ssiprint" :size="14" />打印理赔申请书 <Icon name="ssiprint" :size="14" />打印理赔申请书
...@@ -273,7 +273,12 @@ export default { ...@@ -273,7 +273,12 @@ export default {
this.$apis.CREATENEWCUSTOMER(this.form).then((res) => { this.$apis.CREATENEWCUSTOMER(this.form).then((res) => {
if (res.returnCode === "0000") { if (res.returnCode === "0000") {
this.$message.success("新建成功"); this.$message.success("新建成功");
this.$router.push("/customer"); const { id, patientPolicyId } = res.content || {};
this.$router.push({
name: "welfare",
query: { id, patientPolicyId },
});
// this.$router.push("/customer");
} else { } else {
this.$message.success(res.returnMsg || "新建失败"); this.$message.success(res.returnMsg || "新建失败");
} }
......
...@@ -3,12 +3,12 @@ ...@@ -3,12 +3,12 @@
<!-- form --> <!-- form -->
<a-form-model ref="form" layout="vertical" :model="form"> <a-form-model ref="form" layout="vertical" :model="form">
<a-row :gutter="30"> <a-row :gutter="30">
<a-col :xl="5" :lg="6" :sm="12"> <a-col :xl="6" :lg="6" :sm="12">
<a-form-model-item label="病历号码"> <a-form-model-item label="病历号码">
<a-input v-model="form.mrnNo" placeholder="请输入病历号"></a-input> <a-input v-model="form.mrnNo" placeholder="请输入病历号"></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :xl="5" :lg="6" :sm="12"> <a-col :xl="6" :lg="6" :sm="12">
<a-form-model-item label="客户姓名"> <a-form-model-item label="客户姓名">
<a-input <a-input
v-model="form.patientName" v-model="form.patientName"
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
></a-date-picker> ></a-date-picker>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :xl="4" :lg="6" :sm="12"> <a-col :xl="5" :lg="6" :sm="12">
<a-form-model-item label="保险公司"> <a-form-model-item label="保险公司">
<a-select v-model="form.payorId" placeholder="请选择保险公司"> <a-select v-model="form.payorId" placeholder="请选择保险公司">
<a-select-option <a-select-option
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :xl="5" :lg="6" :sm="12"> <a-col :xl="6" :lg="6" :sm="12">
<a-form-model-item label="保单号码"> <a-form-model-item label="保单号码">
<a-input <a-input
v-model="form.policyNo" v-model="form.policyNo"
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
></a-input> ></a-input>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :xl="24" :lg="18" :sm="12" class="none-label"> <a-col :xl="18" :lg="18" :sm="12" class="none-label">
<a-form-model-item label="button"> <a-form-model-item label="button">
<a-button type="primary" @click="addNewCustom" <a-button type="primary" @click="addNewCustom"
><Icon name="ssiadd" :size="14" />新建客户信息</a-button ><Icon name="ssiadd" :size="14" />新建客户信息</a-button
...@@ -65,10 +65,19 @@ ...@@ -65,10 +65,19 @@
row-key="mrnNo" row-key="mrnNo"
:scroll="{ x: true }" :scroll="{ x: true }"
:pagination="pagination" :pagination="pagination"
:customRow="handlerRowClick"
@change="onChange" @change="onChange"
> >
<template slot="operation" slot-scope=""> <template slot="operation" slot-scope="record">
<a-button type="link">修改</a-button> <a-button
v-if="record.isEdit"
type="link"
@click.stop="saveChange(record)"
>保存</a-button
>
<a-button v-else type="link" @click.stop="changeDataStatus(record)"
>修改</a-button
>
<a-button type="link" class="success">新增</a-button> <a-button type="link" class="success">新增</a-button>
<a-popconfirm <a-popconfirm
title="你确定要关闭吗?" title="你确定要关闭吗?"
...@@ -87,26 +96,34 @@ ...@@ -87,26 +96,34 @@
export default { export default {
data() { data() {
const columns = [ const columns = [
{ title: "病历号", dataIndex: "mrnNo", width: 180 }, {
title: "病历号",
dataIndex: "mrnNo",
width: 180,
customRender: (val, row) => {
if (row.isEdit) {
return <a-input v-model={row.mrnNo}></a-input>;
}
return val;
},
},
{ {
title: "客户姓名", title: "客户姓名",
dataIndex: "patientName", dataIndex: "patientName",
width: 120, width: 120,
customRender: (val, row) => {
if (row.isEdit) {
return <a-input v-model={row.patientName}></a-input>;
}
return val;
},
}, },
{ title: "出生日期", dataIndex: "birthday", width: 180 }, { title: "出生日期", dataIndex: "birthday", width: 180 },
{ title: "性别", dataIndex: "sex", width: 80 }, { title: "性别", dataIndex: "sex", width: 80 },
{ title: "保险公司", dataIndex: "payorName", width: 180 }, { title: "保险公司", dataIndex: "payorName", width: 180 },
{ title: "保单号码", dataIndex: "policyNo", width: 190 }, { title: "保单号码", dataIndex: "policyNo", width: 190 },
{ { title: "保险有效日期", dataIndex: "startDate", width: 180 },
title: "保险有效日期", { title: "保险终止日期", dataIndex: "endDate", width: 180 },
dataIndex: "startDate",
width: 180,
},
{
title: "保险终止日期",
dataIndex: "endDate",
width: 180,
},
{ {
title: "操作", title: "操作",
key: "operation", key: "operation",
...@@ -134,9 +151,6 @@ export default { ...@@ -134,9 +151,6 @@ export default {
}, },
computed: { computed: {
pagination() { pagination() {
// if (!this.pager || !this.dataList.length) {
// return false;
// }
const { pageNum, pageSize } = this.pager; const { pageNum, pageSize } = this.pager;
const pages = Math.ceil(this.total / pageSize); const pages = Math.ceil(this.total / pageSize);
return { return {
...@@ -156,8 +170,6 @@ export default { ...@@ -156,8 +170,6 @@ export default {
if (current !== pageNum) { if (current !== pageNum) {
return undefined; return undefined;
} }
// originalElement.children = undefined;
// originalElement.text = `${current} / ${pages}`;
return ( return (
<p> <p>
<span class="current-page">{current}</span> / {pages} <span class="current-page">{current}</span> / {pages}
...@@ -179,11 +191,37 @@ export default { ...@@ -179,11 +191,37 @@ export default {
} }
return originalElement; return originalElement;
}, },
onChange: (pager) => this.onChange(pager),
}; };
}, },
}, },
methods: { methods: {
handlerRowClick(record) {
const { id, patientPolicyId } = record;
return {
style: {
color: record.isEdit ? "#2B63FF" : "#252631",
},
on: {
click: () => {
if (record.isEdit) {
return true;
}
this.$router.push({
name: "welfare",
query: { id, patientPolicyId },
});
},
},
};
},
// 修改按钮
changeDataStatus(record) {
this.$set(record, "isEdit", true);
},
saveChange(record) {
record.isEdit = undefined;
record.isNew = undefined;
},
// customDeal(columns) { // customDeal(columns) {
// return columns.map((item) => { // return columns.map((item) => {
// return { // return {
...@@ -259,22 +297,7 @@ export default { ...@@ -259,22 +297,7 @@ export default {
opacity: 0; opacity: 0;
} }
} }
.current-page {
color: #4d7cfe;
}
.size-change {
.w(107);
.mg-l(40);
background-color: #f8fafb;
border: none;
}
.ant-btn .icon-class { .ant-btn .icon-class {
.mg-r(10); .mg-r(10);
} }
.success.ant-btn-link {
color: #4cd964;
}
.danger.ant-btn-link {
color: #ff3b30;
}
</style> </style>
<template>
<div>
<!-- 分类 -->
<div class="classify clearfix">
<a-button :type="!type ? 'primary' : ''">全部</a-button>
<a-button
:type="item.code === type ? 'primary' : ''"
v-for="item in welfareType"
:key="item.code"
>
{{ item.name }}
</a-button>
<div class="save-btn">
<a-button type="danger" @click="addNew">
<Icon name="ssiadd" :size="14" />新增
</a-button>
<a-button type="primary">
<Icon name="ssidownload" :size="14" />保存
</a-button>
</div>
</div>
<!-- table -->
<a-table
:columns="columns"
:data-source="dataList"
row-key="mrnNo"
:scroll="{ x: true }"
:pagination="pagination"
@change="onWelfareChange"
>
<template slot="operation" slot-scope="text, record, index">
<a-button
v-if="record.isEdit"
type="link"
@click.stop="saveEditData(record)"
>
保存
</a-button>
<a-button v-else type="link" @click.stop="editData(record, index)">
修改
</a-button>
<a-button type="link" class="success">新增</a-button>
<a-popconfirm
title="你确定要关闭吗?"
ok-text="确定"
cancel-text="取消"
@confirm="deleteData(record, index)"
>
<a-button type="link" class="danger">删除</a-button>
</a-popconfirm>
</template>
</a-table>
</div>
</template>
<script>
export default {
props: {
coverageForm: {
type: Object,
required: true,
},
},
data() {
const columns = [
{
title: "责任项目",
dataIndex: "coverageCode",
width: 180,
customRender: (val, row) => {
if (row.isEdit) {
return <a-input v-model={row.coverageCode}></a-input>;
}
return val;
},
},
{ title: "责任项目列表", dataIndex: "patientName", width: 120 },
{
title: "是否直付",
dataIndex: "isdirect",
width: 180,
customRender: (val, row) => {
if (row.isEdit) {
return (
<a-radio-group
v-model={row.isdirect}
default-value={row.isdirect}
button-style="solid"
>
<a-radio-button value="Y"> </a-radio-button>
<a-radio-button class="mar-left10" value="N">
</a-radio-button>
</a-radio-group>
);
}
return val;
},
},
{ title: "单位", dataIndex: "sex", width: 80 },
{ title: "年限额", dataIndex: "payorName", width: 180 },
{ title: "剩余额度(¥)", dataIndex: "policyNo", width: 190 },
{ title: "次限额(¥)", dataIndex: "startDate", width: 180 },
// { title: "次免赔额(¥)", dataIndex: "endDate", width: 180 },
// { title: "自付比例", dataIndex: "endDate", width: 180 },
// { title: "备注", dataIndex: "endDate", width: 180 },
{
title: "操作",
key: "operation",
width: "175px",
fixed: "right",
scopedSlots: { customRender: "operation" },
},
];
return {
columns,
dataList: [{}],
type: "",
welfareType: [],
pager: {
pageNum: 1,
pageSize: 10,
},
total: 0,
};
},
watch: {
coverageForm: {
deep: true,
handler: function () {
this.type = "";
this._getCoverageList();
},
},
},
mounted() {
this._getSpecialtyCode();
// this._getCoverageList();
},
computed: {
pagination() {
return this.initPageConfig(
{ ...this.pager, total: this.total },
this.onWelfareSizeChange
);
},
},
methods: {
addNew() {
const item = { isEdit: true, isNew: true };
this.pager.pageSize++;
this.dataList.unshift(item);
},
editData(record) {
this.$set(record, "isEdit", true);
},
saveEditData(record) {
record.isEdit = undefined;
},
deleteData(record, index) {
if (record.isNew) {
this.dataList.splice(index, 1);
return true;
}
this.dataList.splice(index, 1);
},
initPageConfig(pager, sizeChange) {
const { pageNum, pageSize, total } = pager;
const pages = Math.ceil(total / pageSize);
return {
current: pageNum,
pageSize,
size: "large",
position: "bottom",
align: "right",
total: this.total,
hideOnSinglePage: false,
itemRender: (current, type, originalElement) => {
if (type === "prev") {
originalElement.children = undefined;
originalElement.text = "上一页";
}
if (type === "page") {
if (current !== pageNum) {
return undefined;
}
return (
<p>
<span class="current-page">{current}</span> / {pages}
</p>
);
}
if (type === "next") {
originalElement.children = undefined;
originalElement.text = "下一页";
return (
<div>
{originalElement}
<a-input-number
onblur={sizeChange}
class="size-change"
></a-input-number>
</div>
);
}
return originalElement;
},
};
},
onWelfareChange(pager) {
const { current } = pager;
// console.log(pager);
this.pager.pageNum = current;
// this._getCustomerList();
},
onWelfareSizeChange(e) {
e && e.stopPropagation();
const val = e.target.value * 1;
if (!val || val < 0) {
return false;
}
this.pager.pageSize = val;
},
_getSpecialtyCode() {
this.$apis.GETSPECIALTYLIST().then((res) => {
this.welfareType = res.content || [];
});
},
_getCoverageList() {
const { corpCode, payorCode, planCode } = this.coverageForm;
this.$apis
.GETCOVERAGELIST({
corpCode,
payorCode,
planCode,
specialtyCode: this.type,
})
.then((res) => {
this.dataList = res.content || [];
});
},
},
};
</script>
<style lang="less" scoped>
.none-label {
text-align: right;
}
.classify {
.pa(10, 20, 10, 20);
.mg-t(30);
.mg-b(10);
background-color: #f8fafb;
.ant-btn:not(:first-child) {
.mg-l(30);
}
.save-btn {
float: right;
}
}
.icon-class {
.mg-r(10);
}
</style>
...@@ -22,25 +22,49 @@ ...@@ -22,25 +22,49 @@
</a-col> </a-col>
<a-col :xl="4" :lg="6" :sm="12"> <a-col :xl="4" :lg="6" :sm="12">
<a-form-model-item label="保险公司" prop="payorId"> <a-form-model-item label="保险公司" prop="payorId">
<a-select v-model="form.payorId" placeholder="请选择保险公司"> <a-select
<a-select-option v-for="item in companyCode" :key="item.corpCode"> v-model="form.payorId"
placeholder="请选择保险公司"
show-search
allow-clear
@change="payorChange"
@filterOption="filterCode"
>
<a-select-option
v-for="item in companyCode"
:key="item.id"
:value="item.id"
>
{{ item.longName }} {{ item.longName }}
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :xl="6" :lg="6" :sm="12"> <a-col :xl="7" :lg="6" :sm="12">
<a-form-model-item label="客户公司名称" prop="payorName"> <a-form-model-item label="客户公司名称" prop="corpName">
<a-input <a-select
v-model="form.payorName" v-model="form.corpName"
placeholder="请输入客户公司名称" placeholder="请选择客户公司名称"
></a-input> show-search
allow-clear
@filterOption="filterCode"
@change="corpChange"
>
<a-select-option
v-for="item in corpCode"
:key="item.id"
:value="item.id + '$_' + item.longName"
>
{{ item.longName }}
</a-select-option>
</a-select>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :xl="6" :lg="6" :sm="12"> <a-col :xl="6" :lg="6" :sm="12">
<a-form-model-item label="保单卡号" prop="policyNo"> <a-form-model-item label="保单卡号" prop="policyNo">
<a-input <a-input
v-model="form.policyNo" v-model="form.policyNo"
allow-clear
placeholder="请输入保单卡号" placeholder="请输入保单卡号"
></a-input> ></a-input>
</a-form-model-item> </a-form-model-item>
...@@ -73,17 +97,29 @@ ...@@ -73,17 +97,29 @@
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :xl="6" :lg="6" :sm="12"> <a-col :xl="6" :lg="6" :sm="12">
<a-form-model-item label="保险计划" prop="planId"> <a-form-model-item label="保险计划" prop="planName">
<a-input <a-select
v-model="form.planId" v-model="form.planName"
placeholder="请输入保险计划" placeholder="请选择保险计划"
></a-input> show-search
allow-clear
@filterOption="filterCode"
>
<a-select-option
v-for="item in planCode"
:key="item.id"
:vlaue="item.longName"
>
{{ item.longName }}
</a-select-option>
</a-select>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :xl="6" :lg="6" :sm="12"> <a-col :xl="6" :lg="6" :sm="12">
<a-form-model-item label="其他备注" prop="remark"> <a-form-model-item label="其他备注" prop="remark">
<a-input <a-input
v-model="form.remark" v-model="form.remark"
allow-clear
placeholder="请输入备注信息" placeholder="请输入备注信息"
></a-input> ></a-input>
</a-form-model-item> </a-form-model-item>
...@@ -121,29 +157,266 @@ ...@@ -121,29 +157,266 @@
</a-radio-group> </a-radio-group>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :xl="24" :lg="18" :sm="12" class="none-label"> <a-col :xl="6" :lg="18" :sm="12" class="none-label">
<a-form-model-item label="button"> <a-form-model-item label="button">
<a-button class="mar-left10 text-r" type="primary" <a-button type="primary" class="text-r" @click="handlerReset">
><Icon name="ssidownload" :size="14" />查询 <Icon name="ssireset" :size="14" />重置
</a-button>
<a-button type="primary" class="mar-left10" @click="handlerSearch"
><Icon name="ssisearch_active" :size="14" />查询
</a-button> </a-button>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
</a-form-model> </a-form-model>
<a-table
v-if="customList && customList.length"
:columns="customColumns"
:data-source="customList"
row-key="mrnNo"
:scroll="{ x: true }"
:pagination="cusPagination"
:customRow="handlerRowClick"
@change="onCustomChange"
></a-table>
<coverages
:coverageForm="coverageForm"
v-if="isShowCoverageData"
></coverages>
</div> </div>
</template> </template>
<script> <script>
import coverages from "./components/coverages";
export default { export default {
components: {
coverages,
},
data() { data() {
const customColumns = [
{ title: "病历号", dataIndex: "mrnNo", width: 180 },
{ title: "客户姓名", dataIndex: "patientName", width: 120 },
{ title: "出生日期", dataIndex: "birthday", width: 180 },
{ title: "性别", dataIndex: "sex", width: 80 },
{ title: "保险公司", dataIndex: "payorName", width: 180 },
{ title: "保单号码", dataIndex: "policyNo", width: 190 },
{ title: "保险有效日期", dataIndex: "startDate", width: 180 },
{ title: "保险终止日期", dataIndex: "endDate", width: 180 },
];
return { return {
form: {}, isShowCoverageData: false,
customColumns,
form: {
patientName: undefined,
payorId: undefined,
corpName: undefined,
planName: undefined,
birthday: undefined,
policyNo: undefined,
firstEnrollmentTime: undefined,
startDate: undefined,
endDate: undefined,
remark: undefined,
waitingPeriod: "N",
isUndertakeAnamnesis: "N",
},
detailForm: {},
coverageForm: {},
customList: [],
companyCode: [], companyCode: [],
corpCode: [],
planCode: [],
queryForm: {},
cusPager: {
pageNum: 1,
pageSize: 10,
},
cusTotal: 0,
}; };
}, },
computed: {}, computed: {
watch: {}, cusPagination() {
methods: {}, return this.initPageConfig(
{ ...this.cusPager, total: this.cusTotal },
this.onCustomSizeChange
);
},
},
mounted() {
if (this.$route.query && this.$route.query.id) {
console.log(this.$route);
this.detailForm = this.$route.query;
this.getCustomerDetail();
}
this._getPayorCode();
},
methods: {
initPageConfig(pager, sizeChange) {
const { pageNum, pageSize, total } = pager;
const pages = Math.ceil(total / pageSize);
return {
current: pageNum,
pageSize,
size: "large",
position: "bottom",
align: "right",
total: this.total,
hideOnSinglePage: false,
itemRender: (current, type, originalElement) => {
if (type === "prev") {
originalElement.children = undefined;
originalElement.text = "上一页";
}
if (type === "page") {
if (current !== pageNum) {
return undefined;
}
return (
<p>
<span class="current-page">{current}</span> / {pages}
</p>
);
}
if (type === "next") {
originalElement.children = undefined;
originalElement.text = "下一页";
return (
<div>
{originalElement}
<a-input-number
onblur={sizeChange}
class="size-change"
></a-input-number>
</div>
);
}
return originalElement;
},
};
},
onCustomChange(pager) {
const { current } = pager;
// console.log(pager);
this.cusPager.pageNum = current;
this._getCustomerList();
},
onCustomSizeChange(e) {
e && e.stopPropagation();
const val = e.target.value * 1;
if (!val || val < 0) {
return false;
}
this.cusPager.pageSize = val;
this._getCustomerList();
},
handlerRowClick(record) {
const { id, patientPolicyId } = record;
return {
on: {
click: () => {
this.detailForm = { id, patientPolicyId };
this.getCustomerDetail();
},
},
};
},
getCustomerDetail() {
// this.queryForm = this.$lodash.cloneDeep(this.form);
const { id, patientPolicyId } = this.detailForm;
const data = {
id: id && id * 1,
patientPolicyId: patientPolicyId * 1,
};
this.$apis.GETCUSTOMERDETAIL(data).then((res) => {
if (res.returnCode === "0000") {
const data = res.content || {};
for (let i in this.form) {
this.form[i] = data[i];
}
this.coverageForm = res.content || {};
this.isShowCoverageData = true;
}
// this.dataList = (res.content && res.content.list) || [];
// this.total = (res.content && res.content.total) || 0;
});
},
handlerReset() {
this.$refs.form.resetFields();
},
handlerSearch() {
console.log(this.$refs.form.validate);
this.$refs.form.validate((valid) => {
if (!valid) {
return false;
}
this.cusPager.pageNum = 1;
this.queryForm = this.$lodash.cloneDeep(this.form);
this._getCustomerList();
});
},
payorChange(val) {
this.form.corpName = undefined;
this.form.planName = undefined;
if (!val) {
return false;
}
this._getCorporateCode(val);
},
corpChange(val) {
// 因为接口要name 但是查计划要用id
this.form.planName = undefined;
if (!val) {
return false;
}
console.log(val);
this.form.corpName = val.split("$_")[1];
val = val.split("$_")[0];
this._getPlanCode(val);
},
// 选择框筛选
filterCode(input, option) {
return (
option.componentOptions.children[0].text
.toLowerCase()
.indexOf(input.toLowerCase()) >= 0
);
},
_getPayorCode() {
this.$apis.GETPAYORCODE({}).then((res) => {
this.companyCode = res.content || [];
});
},
_getCorporateCode(val) {
this.$apis
.GETCORPORATECODE({
longName: "",
payorId: val,
})
.then((res) => {
this.corpCode = res.content || [];
});
},
_getPlanCode(val) {
this.$apis
.GETPLANCODE({
longName: "",
corpId: val,
})
.then((res) => {
this.planCode = res.content || [];
});
},
_getCustomerList() {
const data = {
...this.queryForm,
...this.cusPager,
};
this.$apis.GETCUSTOMERLIST(data).then((res) => {
this.customList = (res.content && res.content.list) || [];
this.cusTotal = (res.content && res.content.total) || 0;
});
},
},
}; };
</script> </script>
...@@ -151,5 +424,23 @@ export default { ...@@ -151,5 +424,23 @@ export default {
.welfare { .welfare {
.pa(30, 36, 50, 39); .pa(30, 36, 50, 39);
background-color: #fff; background-color: #fff;
.none-label {
text-align: right;
}
.classify {
.pa(10, 20, 10, 20);
.mg-t(10);
.mg-b(10);
background-color: #f8fafb;
.ant-btn:not(:first-child) {
.mg-l(30);
}
.save-btn {
float: right;
}
}
.icon-class {
.mg-r(10);
}
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment