ded81416 by simon

默认提交

1 parent f7ec6769
import api from '@/api/api'
import {
httpGet,
httpPost,
formdata
httpGet,
httpPost,
formdata
} from '@/api/fetch-api.js'
import DatePicker from '@/components/date-picker/date-picker.vue';
import ClarmsUpload from './clarms-plugins-upload.vue';
import Vue from 'vue';
import { Loading } from 'vant';
import { Select, Option } from 'element-ui';
import {
Loading
} from 'vant';
import {
Select,
Option
} from 'element-ui';
Vue.use(Loading);
Vue.use(Select);
Vue.use(Option);
export default {
props: {
// 是否显示组件
insuredList: {
type: Array,
default() {
return []
}
},
cid: {
type: String,
default: ""
}
},
data() {
return {
showTips: false,
// 候选人所购买的保单可选择的类型
/**
* 1 意外医疗
* 2 疾病医疗
* 3 意外残疾
* 4 疾病残疾
* 5 意外死亡
* 6 疾病死亡
* 7 重大疾病
*/
typeCandidates: ['1', '2', '5', '6', '7'],
// 已经选择的类型,
typeSelected: [],
images: [],
agress: false,
data: {
insuredIndex: "",
amount: null,
contactDate: "",
// 必传资料
HT41: null,
HT26: null,
// 非必传资料
HT29: null,
HT34: null,
HT16: null,
props: {
// 是否显示组件
insuredList: {
type: Array,
default () {
return []
}
},
cid: {
type: String,
default: ""
}
},
data() {
return {
showTips: false,
// 候选人所购买的保单可选择的类型
/**
* 1 意外医疗
* 2 疾病医疗
* 3 意外残疾
* 4 疾病残疾
* 5 意外死亡
* 6 疾病死亡
* 7 重大疾病
*/
typeCandidates: ['1', '2', '5', '6', '7'],
// 已经选择的类型,
typeSelected: [],
images: [],
agress: false,
data: {
insuredIndex: "",
amount: null,
contactDate: "",
// 必传资料
HT41: null,
HT26: null,
// 非必传资料
HT29: null,
HT34: null,
HT16: null,
// 是否正在上传
HT41Uploading: false,
HT26Uploading: false,
HT29Uploading: false,
HT34Uploading: false,
HT16Uploading: false,
// 是否正在上传
HT41Uploading: false,
HT26Uploading: false,
HT29Uploading: false,
HT34Uploading: false,
HT16Uploading: false,
},
loading: false,
contactDateError: false,
// 判断是否有合法的保单
policyIllegal: true,
}
},
components: {
DatePicker,
ClarmsUpload
},
computed: {
lan() {
return this.$i18n.locale;
},
i18n() {
return this.$i18n.messages && this.$i18n.locale ? this.$i18n.messages[this.$i18n.locale] : {};
},
submitBtnDisabled() {
// 受保人
let b1 = this.data.insuredIndex ? false : true;
// 申请类型
let b2 = this.typeSelected.length > 0 ? false : true;
// 申请额度
let b3 = this.data.amount > 0 ? false : true;
// 日期校验
let b4 = this.data.contactDate ? false : true;
let b5 = this.contactDateError;
},
loading: false,
contactDateError: false,
// 判断是否有合法的保单
policyIllegal: true,
}
},
components: {
DatePicker,
ClarmsUpload
},
computed: {
lan() {
return this.$i18n.locale;
},
i18n() {
return this.$i18n.messages && this.$i18n.locale ? this.$i18n.messages[this.$i18n.locale] : {};
},
submitBtnDisabled() {
// 受保人
let b1 = this.data.insuredIndex ? false : true;
// 申请类型
let b2 = this.typeSelected.length > 0 ? false : true;
// 申请额度
let b3 = this.data.amount > 0 ? false : true;
// 日期校验
let b4 = this.data.contactDate ? false : true;
let b5 = this.contactDateError;
// 必传资料
let b6 = this.data.HT41 && this.data.HT41.length > 0 ? false : true;
let b7 = this.data.HT26 && this.data.HT26.length > 0 ? false : true;
// 资料上传中
let b8 = this.data.HT41Uploading || this.data.HT26Uploading || this.data.HT29Uploading || this.data.HT34Uploading || this.data.HT16Uploading;
let b9 = !this.agress;
// 必传资料
let b6 = this.data.HT41 && this.data.HT41.length > 0 ? false : true;
let b7 = this.data.HT26 && this.data.HT26.length > 0 ? false : true;
// 资料上传中
let b8 = this.data.HT41Uploading || this.data.HT26Uploading || this.data.HT29Uploading || this.data.HT34Uploading || this.data.HT16Uploading;
let b9 = !this.agress;
let b10 = this.policyIllegal;
let b10 = this.policyIllegal;
return b1 || b2 || b3 || b4 || b5 || b6 || b7 || b8 || b9 || b10;
}
},
methods: {
initData() {
// console.log("this.insuredList = ", this.insuredList);
},
typeClickHandle(t) {
let index = this.typeSelected.indexOf(t);
if (index > -1) {
this.typeSelected.splice(index, 1);
} else {
this.typeSelected.push(t);
}
},
amountCheck() {
if (this.data.amount) {
if (this.data.amount < 0) {
this.data.amount = 0;
} else if (this.data.amount > 5000) {
this.data.amount = 5000;
}
}
},
uploadSuccess(data) {
// console.log(data);
switch (data.type) {
case "HT41":
this.data.HT41Uploading = false;
this.data.HT41 = data.list;
break;
case "HT26":
this.data.HT26Uploading = false;
this.data.HT26 = data.list;
break;
case "HT29":
this.data.HT29Uploading = false;
this.data.HT29 = data.list;
break;
case "HT34":
this.data.HT34Uploading = false;
this.data.HT34 = data.list;
break;
case "HT16":
this.data.HT16Uploading = false;
this.data.HT16 = data.list;
break;
}
},
beforeUpload(data) {
// console.log(data);
switch (data.type) {
case "HT41":
this.data.HT41Uploading = true;
this.data.HT41 = [];
break;
case "HT26":
this.data.HT26Uploading = true;
this.data.HT26 = [];
break;
case "HT29":
this.data.HT29Uploading = true;
this.data.HT29 = [];
break;
case "HT34":
this.data.HT34Uploading = true;
this.data.HT34 = [];
break;
case "HT16":
this.data.HT16Uploading = true;
this.data.HT16 = [];
break;
}
},
checkDate(data) {
this.contactDateError = data.disable;
},
toContact() {
this.$router.push({
path: "/custom/service?q=m1"
});
},
submitMaterial() {
return b1 || b2 || b3 || b4 || b5 || b6 || b7 || b8 || b9 || b10;
}
},
methods: {
initData() {
// console.log("this.insuredList = ", this.insuredList);
},
typeClickHandle(t) {
let index = this.typeSelected.indexOf(t);
if (index > -1) {
this.typeSelected.splice(index, 1);
} else {
this.typeSelected.push(t);
}
},
amountCheck() {
if (this.data.amount) {
if (this.data.amount < 0) {
this.data.amount = 0;
} else if (this.data.amount > 5000) {
this.data.amount = 5000;
}
}
},
uploadSuccess(data) {
// console.log(data);
switch (data.type) {
case "HT41":
this.data.HT41Uploading = false;
this.data.HT41 = data.list;
break;
case "HT26":
this.data.HT26Uploading = false;
this.data.HT26 = data.list;
break;
case "HT29":
this.data.HT29Uploading = false;
this.data.HT29 = data.list;
break;
case "HT34":
this.data.HT34Uploading = false;
this.data.HT34 = data.list;
break;
case "HT16":
this.data.HT16Uploading = false;
this.data.HT16 = data.list;
break;
}
},
beforeUpload(data) {
// console.log(data);
switch (data.type) {
case "HT41":
this.data.HT41Uploading = true;
this.data.HT41 = [];
break;
case "HT26":
this.data.HT26Uploading = true;
this.data.HT26 = [];
break;
case "HT29":
this.data.HT29Uploading = true;
this.data.HT29 = [];
break;
case "HT34":
this.data.HT34Uploading = true;
this.data.HT34 = [];
break;
case "HT16":
this.data.HT16Uploading = true;
this.data.HT16 = [];
break;
}
},
checkDate(data) {
this.contactDateError = data.disable;
},
toContact() {
this.$router.push({
path: "/custom/service?q=m1"
});
},
submitMaterial() {
if (this.submitBtnDisabled) {
return;
}
if (this.loading) {
return;
}
let policy = this.checkPolicy();
if (!policy) {
return;
}
let insured = this.insuredList[this.data.insuredIndex - 1];
this.loading = true;
if (this.submitBtnDisabled) {
return;
}
if (this.loading) {
return;
}
let policy = this.checkPolicy();
if (!policy) {
return;
}
let insured = this.insuredList[this.data.insuredIndex - 1];
this.loading = true;
let imageList = [];
imageList = this.data.HT41 && this.data.HT41.length > 0 ? imageList.concat(this.data.HT41) : imageList;
imageList = this.data.HT26 && this.data.HT26.length > 0 ? imageList.concat(this.data.HT26) : imageList;
imageList = this.data.HT29 && this.data.HT29.length > 0 ? imageList.concat(this.data.HT29) : imageList;
imageList = this.data.HT34 && this.data.HT34.length > 0 ? imageList.concat(this.data.HT34) : imageList;
imageList = this.data.HT16 && this.data.HT16.length > 0 ? imageList.concat(this.data.HT16) : imageList;
let imageList = [];
imageList = this.data.HT41 && this.data.HT41.length > 0 ? imageList.concat(this.data.HT41) : imageList;
imageList = this.data.HT26 && this.data.HT26.length > 0 ? imageList.concat(this.data.HT26) : imageList;
imageList = this.data.HT29 && this.data.HT29.length > 0 ? imageList.concat(this.data.HT29) : imageList;
imageList = this.data.HT34 && this.data.HT34.length > 0 ? imageList.concat(this.data.HT34) : imageList;
imageList = this.data.HT16 && this.data.HT16.length > 0 ? imageList.concat(this.data.HT16) : imageList;
let params = {
cid: this.cid,
insuredId: insured.insuredId,
policyId: policy.policyId,
accidentTime: this.data.contactDate,
applyReasonList: this.typeSelected.join(","),
treatmentAmount: this.data.amount,
imageList: imageList
}
httpPost({ url: api.clarmsRegisterCase, data: params }).then(res => {
this.$emit("showModal", 2);
this.loading = false;
this.agress = false;
}).catch(e => {
this.loading = false;
this.showTips = true;
this.agress = false;
})
},
checkPolicy() {
// 校验选择的受保人在选择的时间点内是否有保单
if (this.contactDateError) {
return false;
}
if (!this.data.contactDate || !this.data.insuredIndex) {
return false;
}
let insured = this.insuredList[this.data.insuredIndex - 1];
if (!insured.policyInfoList || insured.policyInfoList.length <= 0) {
this.$emit("showModal", 1);
return false;
}
// console.log("insured === ", insured);
var time = new Date(this.data.contactDate.replace(/\-/g, "/") + " 00:00:00").getTime();
for (let index = 0; index < insured.policyInfoList.length; index++) {
let policy = insured.policyInfoList[index];
// 有效期为生效日至满期日+60天
if (policy.activeDate <= time && policy.expireDate + 60 * 24 * 60 * 60 * 1000 >= time) {
return policy;
}
}
this.$emit("showModal", 1);
return false;
}
},
watch: {
"data.insuredIndex": function (v, ov) {
this.typeSelected = [];
let params = {
cid: this.cid,
insuredId: insured.insuredId,
policyId: policy.policyId,
accidentTime: this.data.contactDate,
applyReasonList: this.typeSelected.join(","),
treatmentAmount: this.data.amount,
imageList: imageList
}
httpPost({
url: api.clarmsRegisterCase,
data: params
}).then(res => {
this.$emit("showModal", 2);
this.loading = false;
this.agress = false;
}).catch(e => {
this.loading = false;
this.showTips = true;
this.agress = false;
})
},
checkPolicy() {
// 校验选择的受保人在选择的时间点内是否有保单
if (this.contactDateError) {
return false;
}
if (!this.data.contactDate || !this.data.insuredIndex) {
return false;
}
let insured = this.insuredList[this.data.insuredIndex - 1];
if (!insured.policyInfoList || insured.policyInfoList.length <= 0) {
this.$emit("showModal", 1);
return false;
}
// console.log("insured === ", insured);
var time = new Date(this.data.contactDate.replace(/\-/g, "/") + " 00:00:00").getTime();
for (let index = 0; index < insured.policyInfoList.length; index++) {
let policy = insured.policyInfoList[index];
// 有效期为生效日至满期日+60天
if (policy.activeDate <= time && policy.expireDate + 60 * 24 * 60 * 60 * 1000 >= time) {
return policy;
}
}
this.$emit("showModal", 1);
return false;
}
},
watch: {
"data.insuredIndex": function (v, ov) {
this.typeSelected = [];
let d = {
insuredIndex: this.data.insuredIndex,
amount: null,
contactDate: "",
// 必传资料
HT41: null,
HT26: null,
// 非必传资料
HT29: null,
HT34: null,
HT16: null,
let d = {
insuredIndex: this.data.insuredIndex,
amount: null,
contactDate: "",
// 必传资料
HT41: null,
HT26: null,
// 非必传资料
HT29: null,
HT34: null,
HT16: null,
// 是否正在上传
HT41Uploading: false,
HT26Uploading: false,
HT29Uploading: false,
HT34Uploading: false,
HT16Uploading: false,
};
this.$set(this, "data", d);
if (this.checkPolicy()) {
this.policyIllegal = false;
} else {
this.policyIllegal = true;
}
},
"data.contactDate": function () {
if (this.checkPolicy()) {
this.policyIllegal = false;
} else {
this.policyIllegal = true;
}
},
'agree': function () {
this.showTips = false;
}
},
mounted() {
this.initData();
},
created() { }
// 是否正在上传
HT41Uploading: false,
HT26Uploading: false,
HT29Uploading: false,
HT34Uploading: false,
HT16Uploading: false,
};
this.$set(this, "data", d);
if (this.checkPolicy()) {
this.policyIllegal = false;
} else {
this.policyIllegal = true;
}
},
"data.contactDate": function () {
if (this.checkPolicy()) {
this.policyIllegal = false;
} else {
this.policyIllegal = true;
}
},
'agree': function () {
this.showTips = false;
}
},
mounted() {
this.initData();
},
created() {
try {
this.$root.eventBus.$off("_evt_to_account_information");
} catch (e) {}
this.$root.eventBus.$on("_evt_to_account_information", () => {
this.$nextTick(() => {
console.log("ccccc:", document.getElementById("sc"));
let sc = document.getElementById("sc");
if (sc) {
document.getElementById("sc").scrollIntoView();
}
})
});
}
}
......
......@@ -124,13 +124,13 @@
</div>
<div class="value">
<clarms-upload :icon="require('@/assets/images/clarms/icon3.png')" :options="{name:$t('clarms.step2.label14'),imageTypeID:'HT29',imageMainTypeID:'HT06',toast:$t('clarms.step2.toast3')}" @success="uploadSuccess" @beforeUpload="beforeUpload"></clarms-upload>
<clarms-upload class="mt20" :icon="require('@/assets/images/clarms/icon4.png')" :options="{name:$t('clarms.step2.label15'),imageTypeID:'HT34',imageMainTypeID:'HT08',toast:$t('clarms.step2.toast4')}" @success="uploadSuccess" @beforeUpload="beforeUpload"></clarms-upload>
<clarms-upload id="sc" ref="sc" class="mt20" :icon="require('@/assets/images/clarms/icon4.png')" :options="{name:$t('clarms.step2.label15'),imageTypeID:'HT34',imageMainTypeID:'HT08',toast:$t('clarms.step2.toast4')}" @success="uploadSuccess" @beforeUpload="beforeUpload"></clarms-upload>
<clarms-upload class="mt20" :icon="require('@/assets/images/clarms/icon5.png')" :options="{name:$t('clarms.step2.label16'),imageTypeID:'HT16',imageMainTypeID:'HT03',toast:$t('clarms.step2.toast5')}" @success="uploadSuccess" @beforeUpload="beforeUpload"></clarms-upload>
</div>
</div>
</template>
</div>
<hr v-if="data.amount > 0">
<hr v-if="data.amount > 0" >
<div class="bottom-tip orange mt20">{{$t('clarms.step2.label17')}}</div>
<div class="bottom-tip gray mt10">{{$t('clarms.step2.tip1')}}</div>
......
export default {
data() {
return {
data() {
return {
}
},
components: {},
computed: {
},
methods: {
initData() {
}
},
components: {},
computed: {},
methods: {
initData() {
},
onOverLayHandler() {
this.$emit("close");
},
toContact() {
this.$router.push({
path: "/custom/service?q=m1"
});
}
},
mounted() {
},
onOverLayHandler() {
this.$emit("close");
},
toAccountInformation() {
this.$emit("close");
this.$root.eventBus.$emit('_evt_to_account_information');
},
toContact() {
this.$router.push({
path: "/custom/service?q=m1"
});
}
},
mounted() {
},
created() {
this.initData();
},
watch: {
},
},
created() {
this.initData();
},
watch: {},
}
......
......@@ -9,7 +9,7 @@
<img src="@/assets/images/clarms/suc.png">
</div>
<div class="message">
{{$t('clarms.step2.tip7')}}<span @click="onOverLayHandler">{{$t('clarms.step2.tip8')}}</span>
{{$t('clarms.step2.tip7')}}<span @click="toAccountInformation">{{$t('clarms.step2.tip8')}}</span>
</div>
</div>
</div>
......
import {
mapGetters,
mapActions,
mapState
mapGetters,
mapActions,
mapState
} from "vuex";
import api from '@/api/api'
import {
httpGet,
httpPost
httpGet,
httpPost
} from '@/api/fetch-api.js'
import ClarmsModalOne from '@/components/clarms/clarms-plugins-modal1.vue';
......@@ -25,126 +25,140 @@ import ClarmsMaterial from '@/components/clarms/clarms-plugins-material.vue';
// 有保单
export default {
data() {
return {
step: 0, // 1是表单;2是报案页面;3=信息不完整
showModal1: false,
showModal2: false,
agress: false,
reservationTypes: [],
cid: false,
// 可以理赔的客户信息
customerList: []
}
},
components: {
ClarmsVerifyForm,
ClarmsMaterial,
ClarmsModalOne,
ClarmsModalTwo
},
computed: {
...mapState({
userInfo: state => state.userInfo
}),
i18n() {
return this.$i18n.messages && this.$i18n.locale ? this.$i18n.messages[this.$i18n.locale] : {};
},
},
methods: {
initData() {
// this.step = 2;
// return;
if (this.userInfo && this.userInfo.name) {
this.loadCidIfLogin();
sessionStorage.removeItem("clarmsRequestCid")
} else {
let cid = sessionStorage.getItem("clarmsRequestCid");
if (cid) {
this.cid = cid;
this.checkCid();
} else {
this.step = 1;
}
}
},
loadCidIfLogin() {
let param = {
sid: this.userInfo.sid
};
httpPost({ url: api.getCidByLogin, sid: true, data: param }).then(res => {
if (res) {
this.cid = res;
this.checkCid();
} else {
this.step = 3;
}
}).catch(e => {
this.step = 1;
});
},
checkCid() {
let param = {
cid: this.cid
}
httpPost({ url: api.clarmsCustomerList, data: param }).then(res => {
sessionStorage.removeItem("clarmsRequestCid");
if (res) {
this.customerList = res.insuredInfoList;
this.step = 2;
}
// if (res && res.insuredInfoList && res.insuredInfoList.length > 0) {
// this.customerList = res.insuredInfoList;
// this.step = 2;
// } else {
// sessionStorage.removeItem("clarmsRequestCid");
// this.step = 1;
// }
}).catch(e => {
sessionStorage.removeItem("clarmsRequestCid");
this.step = 1;
});
},
handleInsuredInfo(data) {
this.cid = data.cid;
this.customerList = data.list;
this.step = 2;
},
handleShowModal(modalIndex) {
console.log(modalIndex);
if (modalIndex == 1) {
this.showModal1 = true;
} else if (modalIndex == 2) {
this.showModal2 = true;
}
},
gotoInformationPage() {
let c = this.$route.fullPath;
this.$router.push({ path: "/infomation/improve", query: { c: c, a: 1 } });
},
logoutAction() {
this.sid = false;
this.hadQueryCustomerList = false;
this.customerList = [];
this.step = 1;
},
loginAction() {
this.sid = false;
this.hadQueryCustomerList = false;
this.customerList = [];
}
},
watch: {
userInfo(val) {
if (val && val.name) {
this.loginAction();
} else {
this.logoutAction();
}
}
},
mounted() {
this.initData();
},
created() { }
data() {
return {
step: 0, // 1是表单;2是报案页面;3=信息不完整
showModal1: false,
showModal2: false,
agress: false,
reservationTypes: [],
cid: "",
// 可以理赔的客户信息
customerList: []
}
},
components: {
ClarmsVerifyForm,
ClarmsMaterial,
ClarmsModalOne,
ClarmsModalTwo
},
computed: {
...mapState({
userInfo: state => state.userInfo
}),
i18n() {
return this.$i18n.messages && this.$i18n.locale ? this.$i18n.messages[this.$i18n.locale] : {};
},
},
methods: {
initData() {
// this.step = 2;
// return;
if (this.userInfo && this.userInfo.name) {
this.loadCidIfLogin();
sessionStorage.removeItem("clarmsRequestCid")
} else {
let cid = sessionStorage.getItem("clarmsRequestCid");
if (cid) {
this.cid = cid;
this.checkCid();
} else {
this.step = 1;
}
}
},
loadCidIfLogin() {
let param = {
sid: this.userInfo.sid
};
httpPost({
url: api.getCidByLogin,
sid: true,
data: param
}).then(res => {
if (res) {
this.cid = res;
this.checkCid();
} else {
this.step = 3;
}
}).catch(e => {
this.step = 1;
});
},
checkCid() {
let param = {
cid: this.cid
}
httpPost({
url: api.clarmsCustomerList,
data: param
}).then(res => {
sessionStorage.removeItem("clarmsRequestCid");
if (res) {
this.customerList = res.insuredInfoList;
this.step = 2;
}
// if (res && res.insuredInfoList && res.insuredInfoList.length > 0) {
// this.customerList = res.insuredInfoList;
// this.step = 2;
// } else {
// sessionStorage.removeItem("clarmsRequestCid");
// this.step = 1;
// }
}).catch(e => {
sessionStorage.removeItem("clarmsRequestCid");
this.step = 1;
});
},
handleInsuredInfo(data) {
this.cid = data.cid;
this.customerList = data.list;
this.step = 2;
},
handleShowModal(modalIndex) {
console.log(modalIndex);
if (modalIndex == 1) {
this.showModal1 = true;
} else if (modalIndex == 2) {
this.showModal2 = true;
}
},
gotoInformationPage() {
let c = this.$route.fullPath;
this.$router.push({
path: "/infomation/improve",
query: {
c: c,
a: 1
}
});
},
logoutAction() {
this.sid = false;
this.hadQueryCustomerList = false;
this.customerList = [];
this.step = 1;
},
loginAction() {
this.sid = false;
this.hadQueryCustomerList = false;
this.customerList = [];
}
},
watch: {
userInfo(val) {
if (val && val.name) {
this.loginAction();
} else {
this.logoutAction();
}
}
},
mounted() {
this.initData();
},
created() {}
}
......