Commit 99a73794 authored by 吴婷慧's avatar 吴婷慧

’新建客户信息好啦‘

parent dcd9fd69
// 基础api // 基础api
export default { export default {
// getUserInfo: `/getUserInfo`, // getUserInfo: `/getUserInfo`,
payorCodeList: "/backstage/auth/payorListNopage",
corporateCodeList: "/backstage/auth/corporateList", corporateCodeList: "/backstage/auth/corporateList",
planCodeList: "/backstage/auth/planList",
uploadImg: "/common/upload", uploadImg: "/common/upload",
}; };
...@@ -2,4 +2,5 @@ ...@@ -2,4 +2,5 @@
export default { export default {
getCustomerList: "/backstage/auth/patientList", getCustomerList: "/backstage/auth/patientList",
updateCustomList: "/backstage/auth/updatePatientPolicy", updateCustomList: "/backstage/auth/updatePatientPolicy",
createCustomer: "/backstage/auth/createPatient",
}; };
...@@ -8,10 +8,20 @@ const GETUSERINFO = (params) => { ...@@ -8,10 +8,20 @@ const GETUSERINFO = (params) => {
params, params,
}); });
}; };
// get corporate Code // 保险公司下拉数据
const GETPAYORCODE = (data) => {
return req.post(apis.payorCodeList, {
data,
});
};
// get corporate Code 根据保险公司获取客户公司
const GETCORPORATECODE = (data) => { const GETCORPORATECODE = (data) => {
return req.post(apis.corporateCodeList, data); return req.post(apis.corporateCodeList, data);
}; };
// get plan Code 根据客户公司获取保险计划
const GETPLANCODE = (data) => {
return req.post(apis.planCodeList, data);
};
// 上传图片 // 上传图片
const UPLOADIMG = (data) => { const UPLOADIMG = (data) => {
...@@ -19,4 +29,10 @@ const UPLOADIMG = (data) => { ...@@ -19,4 +29,10 @@ const UPLOADIMG = (data) => {
}; };
// 对象数组 // 对象数组
export default { GETUSERINFO, GETCORPORATECODE, UPLOADIMG }; export default {
GETUSERINFO,
GETPAYORCODE,
GETCORPORATECODE,
GETPLANCODE,
UPLOADIMG,
};
...@@ -12,4 +12,9 @@ const UPDATECUSTOMDATA = function (data) { ...@@ -12,4 +12,9 @@ const UPDATECUSTOMDATA = function (data) {
return req.post(apis.updateCustomList, data); return req.post(apis.updateCustomList, data);
}; };
export default { GETCUSTOMERLIST, UPDATECUSTOMDATA }; // 创建新用户
const CREATENEWCUSTOMER = function (data) {
return req.post(apis.createCustomer, data);
};
export default { GETCUSTOMERLIST, UPDATECUSTOMDATA, CREATENEWCUSTOMER };
...@@ -5,13 +5,18 @@ ...@@ -5,13 +5,18 @@
<a-row :gutter="30"> <a-row :gutter="30">
<a-col :xl="6" :lg="6" :sm="12"> <a-col :xl="6" :lg="6" :sm="12">
<a-form-model-item label="病历号码" prop="mrnNo"> <a-form-model-item label="病历号码" prop="mrnNo">
<a-input v-model="form.mrnNo" placeholder="请输入病历号"></a-input> <a-input
v-model="form.mrnNo"
placeholder="请输入病历号"
allow-clear
></a-input>
</a-form-model-item> </a-form-model-item>
</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="patientName"> <a-form-model-item label="客户姓名" prop="patientName">
<a-input <a-input
v-model="form.patientName" v-model="form.patientName"
allow-clear
placeholder="请输入客户姓名" placeholder="请输入客户姓名"
></a-input> ></a-input>
</a-form-model-item> </a-form-model-item>
...@@ -20,15 +25,28 @@ ...@@ -20,15 +25,28 @@
<a-form-model-item label="出生日期" prop="birthday"> <a-form-model-item label="出生日期" prop="birthday">
<a-date-picker <a-date-picker
v-model="form.birthday" v-model="form.birthday"
allow-clear
placeholder="请选择出生日期" placeholder="请选择出生日期"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD 00:00:00"
></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="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
@filterOption="filterCode"
@change="payorChange"
>
<a-select-option
v-for="item in companyCode"
:key="item.id"
:value="item.id"
:label="item.longName"
>
{{ item.longName }} {{ item.longName }}
</a-select-option> </a-select-option>
</a-select> </a-select>
...@@ -36,15 +54,28 @@ ...@@ -36,15 +54,28 @@
</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="payorName">
<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
allow-clear
v-model="form.policyNo" v-model="form.policyNo"
placeholder="请输入保单卡号" placeholder="请输入保单卡号"
></a-input> ></a-input>
...@@ -53,41 +84,56 @@ ...@@ -53,41 +84,56 @@
<a-col :xl="4" :lg="6" :sm="12"> <a-col :xl="4" :lg="6" :sm="12">
<a-form-model-item label="首次入保时间" prop="firstEnrollmentTime"> <a-form-model-item label="首次入保时间" prop="firstEnrollmentTime">
<a-date-picker <a-date-picker
allow-clear
v-model="form.firstEnrollmentTime" v-model="form.firstEnrollmentTime"
placeholder="请选择首次入保时间" placeholder="请选择首次入保时间"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD 00:00:00"
></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="4" :lg="6" :sm="12">
<a-form-model-item label="保单生效日期" prop="startDate"> <a-form-model-item label="保单生效日期" prop="startDate">
<a-date-picker <a-date-picker
allow-clear
v-model="form.startDate" v-model="form.startDate"
placeholder="请选择保单生效日期" placeholder="请选择保单生效日期"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD 00:00:00"
></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="4" :lg="6" :sm="12">
<a-form-model-item label="保单终止日期" prop="endDate"> <a-form-model-item label="保单终止日期" prop="endDate">
<a-date-picker <a-date-picker
allow-clear
v-model="form.endDate" v-model="form.endDate"
placeholder="请选择保单终止日期" placeholder="请选择保单终止日期"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD 00:00:00"
></a-date-picker> ></a-date-picker>
</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
allow-clear
v-model="form.remark" v-model="form.remark"
placeholder="请输入备注信息" placeholder="请输入备注信息"
></a-input> ></a-input>
...@@ -108,9 +154,10 @@ ...@@ -108,9 +154,10 @@
<a-col :xl="4" :lg="6" :sm="12"> <a-col :xl="4" :lg="6" :sm="12">
<a-form-model-item label="等待期时间" prop="waitingPeriodTime"> <a-form-model-item label="等待期时间" prop="waitingPeriodTime">
<a-date-picker <a-date-picker
allow-clear
v-model="form.waitingPeriodTime" v-model="form.waitingPeriodTime"
placeholder="请选择等待期时间" placeholder="请选择等待期时间"
value-format="YYYY-MM-DD" value-format="YYYY-MM-DD 00:00:00"
></a-date-picker> ></a-date-picker>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
...@@ -197,6 +244,9 @@ export default { ...@@ -197,6 +244,9 @@ export default {
return { return {
previewVisible: false, previewVisible: false,
form: { form: {
payorId: undefined,
corpName: undefined,
planName: undefined,
waitingPeriod: "N", waitingPeriod: "N",
isUndertakeAnamnesis: "N", isUndertakeAnamnesis: "N",
medCardCopeFiles: [], medCardCopeFiles: [],
...@@ -206,11 +256,13 @@ export default { ...@@ -206,11 +256,13 @@ export default {
idCardCopeFiles: [], // 身份证复印件 idCardCopeFiles: [], // 身份证复印件
previewImage: "", previewImage: "",
companyCode: [], companyCode: [],
corpCode: [],
planCode: [],
formRules: {}, formRules: {},
}; };
}, },
mounted() { mounted() {
this._getCorporateCode(); this._getPayorCode();
}, },
methods: { methods: {
handlerSave() { handlerSave() {
...@@ -218,8 +270,13 @@ export default { ...@@ -218,8 +270,13 @@ export default {
if (!valid) { if (!valid) {
return false; return false;
} }
this.$apis.UPDATECUSTOMDATA(this.form).then((res) => { this.$apis.CREATENEWCUSTOMER(this.form).then((res) => {
console.log(res); if (res.returnCode === "0000") {
this.$message.success("新建成功");
this.$router.push("/customer");
} else {
this.$message.success(res.returnMsg || "新建失败");
}
}); });
}); });
}, },
...@@ -230,6 +287,24 @@ export default { ...@@ -230,6 +287,24 @@ export default {
this.form.idCardCopeFiles = []; this.form.idCardCopeFiles = [];
this.idCardCopeFiles = []; this.idCardCopeFiles = [];
}, },
payorChange(val) {
this.form.corpName = 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);
},
uploadMedImg(file) { uploadMedImg(file) {
console.log(file); console.log(file);
// this.form.medCardCopeFiles.push(file); // this.form.medCardCopeFiles.push(file);
...@@ -238,6 +313,7 @@ export default { ...@@ -238,6 +313,7 @@ export default {
}, },
uploadIDImg(file) { uploadIDImg(file) {
this.uploadFile(file, "2"); this.uploadFile(file, "2");
return false;
}, },
uploadFile(file, type) { uploadFile(file, type) {
let formData = new FormData(); let formData = new FormData();
...@@ -263,7 +339,6 @@ export default { ...@@ -263,7 +339,6 @@ export default {
this.idCardCopeFiles.push(showItem); this.idCardCopeFiles.push(showItem);
} }
} }
console.log(res);
}); });
return false; return false;
}, },
...@@ -292,15 +367,39 @@ export default { ...@@ -292,15 +367,39 @@ export default {
handleClose() { handleClose() {
this.previewVisible = false; this.previewVisible = false;
}, },
_getCorporateCode() { // 选择框筛选
const params = { filterCode(input, option) {
longName: "", return (
payorId: 0, option.componentOptions.children[0].text
}; .toLowerCase()
this.$apis.GETCORPORATECODE(params).then((res) => { .indexOf(input.toLowerCase()) >= 0
);
},
_getPayorCode() {
this.$apis.GETPAYORCODE({}).then((res) => {
this.companyCode = res.content || []; 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 || [];
});
},
}, },
}; };
</script> </script>
......
...@@ -27,7 +27,11 @@ ...@@ -27,7 +27,11 @@
<a-col :xl="4" :lg="6" :sm="12"> <a-col :xl="4" :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 v-for="item in companyCode" :key="item.corpCode"> <a-select-option
v-for="item in companyCode"
:key="item.corpCode"
:value="item.id"
>
{{ item.longName }} {{ item.longName }}
</a-select-option> </a-select-option>
</a-select> </a-select>
...@@ -43,11 +47,11 @@ ...@@ -43,11 +47,11 @@
</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">
<a-form-model-item label="button"> <a-form-model-item label="button">
<a-button type="primary" <a-button type="primary" @click="addNewCustom"
><Icon name="ssiadd" size="14" />新建客户信息</a-button ><Icon name="ssiadd" :size="14" />新建客户信息</a-button
> >
<a-button class="mar-left10" type="primary" @click="handlerSearch"> <a-button class="mar-left10" type="primary" @click="handlerSearch">
<Icon name="ssisearch_active" size="14" />查询 <Icon name="ssisearch_active" :size="14" />查询
</a-button> </a-button>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
...@@ -83,27 +87,24 @@ ...@@ -83,27 +87,24 @@
export default { export default {
data() { data() {
const columns = [ const columns = [
{ title: "病历号", dataIndex: "mrnNo", ellipsis: true, width: 180 }, { title: "病历号", dataIndex: "mrnNo", width: 180 },
{ {
title: "客户姓名", title: "客户姓名",
dataIndex: "patientName", dataIndex: "patientName",
ellipsis: true,
width: 120, width: 120,
}, },
{ title: "出生日期", dataIndex: "birthday", ellipsis: true, width: 180 }, { title: "出生日期", dataIndex: "birthday", width: 180 },
{ title: "性别", dataIndex: "sex", ellipsis: true, width: 80 }, { title: "性别", dataIndex: "sex", width: 80 },
{ title: "保险公司", dataIndex: "payorName", ellipsis: true, width: 180 }, { title: "保险公司", dataIndex: "payorName", width: 180 },
{ title: "保单号码", dataIndex: "policyNo", ellipsis: true, width: 190 }, { title: "保单号码", dataIndex: "policyNo", width: 190 },
{ {
title: "保险有效日期", title: "保险有效日期",
dataIndex: "startDate", dataIndex: "startDate",
ellipsis: true,
width: 180, width: 180,
}, },
{ {
title: "保险终止日期", title: "保险终止日期",
dataIndex: "endDate", dataIndex: "endDate",
ellipsis: true,
width: 180, width: 180,
}, },
{ {
...@@ -129,7 +130,7 @@ export default { ...@@ -129,7 +130,7 @@ export default {
}, },
created() { created() {
this._getCustomerList(); this._getCustomerList();
this._getCorporateCode(); this._getPayorCode();
}, },
computed: { computed: {
pagination() { pagination() {
...@@ -183,6 +184,23 @@ export default { ...@@ -183,6 +184,23 @@ export default {
}, },
}, },
methods: { methods: {
// customDeal(columns) {
// return columns.map((item) => {
// return {
// ...item,
// ellipsis: true,
// customRender: (text, record, index) => {
// const data = item.customRender
// ? item.customRender(text, record, index)
// : text;
// if (record.isEdit) {
// return "";
// }
// return data;
// },
// };
// });
// },
onChange(pager) { onChange(pager) {
const { current } = pager; const { current } = pager;
// console.log(pager); // console.log(pager);
...@@ -212,12 +230,12 @@ export default { ...@@ -212,12 +230,12 @@ export default {
deleteData() { deleteData() {
this.$message.success("删除成功"); this.$message.success("删除成功");
}, },
_getCorporateCode() { // 新建客户信息
const params = { addNewCustom() {
longName: "", this.$router.push("/customer/edit");
payorId: 0, },
}; _getPayorCode() {
this.$apis.GETCORPORATECODE(params).then((res) => { this.$apis.GETPAYORCODE({}).then((res) => {
this.companyCode = res.content || []; this.companyCode = res.content || [];
}); });
}, },
......
<template> <template>
<div class="index"> <div class="welfare">
<!-- 福利管理 --> <!-- form -->
福利管理 <a-form-model ref="form" layout="vertical" :model="form">
<a-row :gutter="30">
<a-col :xl="6" :lg="6" :sm="12">
<a-form-model-item label="客户姓名" prop="patientName">
<a-input
v-model="form.patientName"
placeholder="请输入客户姓名"
></a-input>
</a-form-model-item>
</a-col>
<a-col :xl="4" :lg="6" :sm="12">
<a-form-model-item label="出生日期" prop="birthday">
<a-date-picker
v-model="form.birthday"
placeholder="请选择出生日期"
value-format="YYYY-MM-DD"
></a-date-picker>
</a-form-model-item>
</a-col>
<a-col :xl="4" :lg="6" :sm="12">
<a-form-model-item label="保险公司" prop="payorId">
<a-select v-model="form.payorId" placeholder="请选择保险公司">
<a-select-option v-for="item in companyCode" :key="item.corpCode">
{{ item.longName }}
</a-select-option>
</a-select>
</a-form-model-item>
</a-col>
<a-col :xl="6" :lg="6" :sm="12">
<a-form-model-item label="客户公司名称" prop="payorName">
<a-input
v-model="form.payorName"
placeholder="请输入客户公司名称"
></a-input>
</a-form-model-item>
</a-col>
<a-col :xl="6" :lg="6" :sm="12">
<a-form-model-item label="保单卡号" prop="policyNo">
<a-input
v-model="form.policyNo"
placeholder="请输入保单卡号"
></a-input>
</a-form-model-item>
</a-col>
<a-col :xl="4" :lg="6" :sm="12">
<a-form-model-item label="首次入保时间" prop="firstEnrollmentTime">
<a-date-picker
v-model="form.firstEnrollmentTime"
placeholder="请选择首次入保时间"
value-format="YYYY-MM-DD"
></a-date-picker>
</a-form-model-item>
</a-col>
<a-col :xl="4" :lg="6" :sm="12">
<a-form-model-item label="保单生效日期" prop="startDate">
<a-date-picker
v-model="form.startDate"
placeholder="请选择保单生效日期"
value-format="YYYY-MM-DD"
></a-date-picker>
</a-form-model-item>
</a-col>
<a-col :xl="4" :lg="6" :sm="12">
<a-form-model-item label="保单终止日期" prop="endDate">
<a-date-picker
v-model="form.endDate"
placeholder="请选择保单终止日期"
value-format="YYYY-MM-DD"
></a-date-picker>
</a-form-model-item>
</a-col>
<a-col :xl="6" :lg="6" :sm="12">
<a-form-model-item label="保险计划" prop="planId">
<a-input
v-model="form.planId"
placeholder="请输入保险计划"
></a-input>
</a-form-model-item>
</a-col>
<a-col :xl="6" :lg="6" :sm="12">
<a-form-model-item label="其他备注" prop="remark">
<a-input
v-model="form.remark"
placeholder="请输入备注信息"
></a-input>
</a-form-model-item>
</a-col>
<a-col :xl="4" :lg="6" :sm="12">
<a-form-model-item label="等待期" prop="waitingPeriod">
<a-radio-group
v-model="form.waitingPeriod"
:default-value="form.waitingPeriod"
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>
</a-form-model-item>
</a-col>
<a-col :xl="4" :lg="6" :sm="12">
<a-form-model-item label="等待期时间" prop="waitingPeriodTime">
<a-date-picker
v-model="form.waitingPeriodTime"
placeholder="请选择等待期时间"
value-format="YYYY-MM-DD"
></a-date-picker>
</a-form-model-item>
</a-col>
<a-col :xl="4" :lg="6" :sm="12">
<a-form-model-item label="是否承担既往症" prop="isUndertakeAnamnesis">
<a-radio-group
v-model="form.isUndertakeAnamnesis"
:default-value="form.isUndertakeAnamnesis"
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>
</a-form-model-item>
</a-col>
<a-col :xl="24" :lg="18" :sm="12" class="none-label">
<a-form-model-item label="button">
<a-button class="mar-left10 text-r" type="primary"
><Icon name="ssidownload" :size="14" />查询
</a-button>
</a-form-model-item>
</a-col>
</a-row>
</a-form-model>
</div> </div>
</template> </template>
<script> <script>
export default { export default {
data() { data() {
return {}; return {
form: {},
companyCode: [],
};
}, },
computed: {}, computed: {},
watch: {}, watch: {},
...@@ -16,4 +147,9 @@ export default { ...@@ -16,4 +147,9 @@ export default {
}; };
</script> </script>
<style lang="less" scoped></style> <style lang="less" scoped>
.welfare {
.pa(30, 36, 50, 39);
background-color: #fff;
}
</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