e-correspondence-head-list.js 2.47 KB
/**
 * 组件描述:保单查询列表
 */

import api from '@/api/api';
import {
	httpPost,
	requestDomain
} from '@/api/fetch-api.js';

import {
	mapState
} from 'vuex';
import {
	formatMoney,
	getInsuredPeriod,
	getInsuredState,
	getPolicyName
} from "@/utils/biz.js";
import Modal2Comp from '@/components/modal2-comp/modal2-comp.vue';
import FilterComp from '@/components/filter-comp/filter-comp.vue';

export default {
	props: {
		multiSelectable: {
			type: Boolean,
			default: false
		},
		model: {
			type: String,
			default: "download"
		},
	},
	name: "LetterListHeader",
	data() {
		return {
			contentList: [],
			maxShow: 2,
			selectPolicyCode: "",
			selectPolicyCodes: {},
			hide: false,
			showDownloadError: false,
			filterVisible: false,
			checkList: []
		}
	},
	computed: {
		lan() {
			return this.$i18n.locale;
		},
		i18n() {
			return this.$i18n.messages && this.$i18n.locale ? this.$i18n.messages[this.$i18n.locale] : {};
		},
	},
	methods: {
		initData() {
			httpPost({
				url: api.letterRecordList,
				sid: true
			}).then(res => {
				this.contentList = res;
				this.$set(this, 'contentList', res);
			});
		},
		onShowTipsOverHandler(event, item, index) {
			let child = event.currentTarget.childNodes[0];
			child.style.display = "block";
		},
		onShowTipsOutHandler(event, item, index) {
			let child = event.currentTarget.childNodes[0];
			child.style.display = "none";
		},
		// 过滤筛选
		onFilterHandler(idx) {
			this.checkList = []
			switch (idx) {
				// 保单号码
				case 1:

					break;
				// 通知书类型
				case 2:

					break;
				// 发出时间
				case 3:

					break;

				// 状况
				case 5:

					break;

				default:
					break;
			}

			// 显示模态窗
			this.filterVisible = true;
		},
		/**
		 * 多选确认
		 */
		onCheckConfirmHandler(evt) {
			console.log("checkList evt :", evt);
		},
		changeLetterType(letterNo) {
			return this.i18n.eCorrespondenceEnquiry.LetterMap[letterNo];
		},
		toContactUs() {
			this.$router.push({
				path: "/custom/service",
				query: {
					q: "m1"
				}
			});
		},
		downloadPolicy(item) {
			httpPost({
				url: api.getDownloadPath,
				sid: true,
				data: {
					policyCode: item.bizNo,
					recordId: item.recordId
				}
			}).then(res => {
				if (res) {
					let url = requestDomain() + api.downloadPolicy + "/" + res;
					window.open(url);
				} else {
					this.showDownloadError = true;
				}
			});
		}
	},
	components: {
		Modal2Comp,
		FilterComp
	},
	mounted() {
		this.initData();
	},
}