Commit c773b33f authored by yanglilong's avatar yanglilong

fix(custom): 理赔件管理bug修复

parent 9a6458d5
...@@ -2,5 +2,6 @@ ...@@ -2,5 +2,6 @@
"semi": false, "semi": false,
"singleQuote": true, "singleQuote": true,
"trailingComma": "none", "trailingComma": "none",
"bracketSpacing": true "bracketSpacing": true,
"endOfLine": "auto"
} }
...@@ -7,8 +7,20 @@ ...@@ -7,8 +7,20 @@
<a-row :gutter="30"> <a-row :gutter="30">
<a-col :lg="8" :sm="12"> <a-col :lg="8" :sm="12">
<a-form-model-item label="保险公司"> <a-form-model-item label="保险公司">
<a-select v-model="form.payorCode" placeholder="请选择保险公司" allow-clear showSearch :disabled="!isEdit" optionFilterProp="label"> <a-select
<a-select-option v-for="item in companyOptions" :key="item.id" :value="item.payorCode" :label="item.longName"> v-model="form.payorCode"
placeholder="请选择保险公司"
allow-clear
showSearch
:disabled="!isEdit"
optionFilterProp="label"
>
<a-select-option
v-for="item in companyOptions"
:key="item.id"
:value="item.payorCode"
:label="item.longName"
>
{{ item.longName }} {{ item.longName }}
</a-select-option> </a-select-option>
</a-select> </a-select>
...@@ -16,7 +28,12 @@ ...@@ -16,7 +28,12 @@
</a-col> </a-col>
<a-col :lg="8" :sm="12"> <a-col :lg="8" :sm="12">
<a-form-model-item label="寄送状态"> <a-form-model-item label="寄送状态">
<a-select v-model="form.sendSts" placeholder="请选择寄送状态" allow-clear :disabled="!isEdit"> <a-select
v-model="form.sendSts"
placeholder="请选择寄送状态"
allow-clear
:disabled="!isEdit"
>
<a-select-option value="1">已寄送</a-select-option> <a-select-option value="1">已寄送</a-select-option>
<a-select-option value="2">未寄送</a-select-option> <a-select-option value="2">未寄送</a-select-option>
</a-select> </a-select>
...@@ -24,19 +41,40 @@ ...@@ -24,19 +41,40 @@
</a-col> </a-col>
<a-col :lg="8" :sm="12"> <a-col :lg="8" :sm="12">
<a-form-model-item label="快递公司"> <a-form-model-item label="快递公司">
<a-select v-model="form.sendCompany" placeholder="请选择快递公司" showSearch allow-clear :disabled="!isEdit"> <a-select
<a-select-option v-for="(item) in expressList" :key="item.id" :value="item.descCh">{{item.descCh}}</a-select-option> v-model="form.sendCompany"
placeholder="请选择快递公司"
showSearch
allow-clear
:disabled="!isEdit"
>
<a-select-option
v-for="item in expressList"
:key="item.id"
:value="item.descCh"
>{{ item.descCh }}</a-select-option
>
</a-select> </a-select>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :lg="8" :sm="12"> <a-col :lg="8" :sm="12">
<a-form-model-item label="快递单号"> <a-form-model-item label="快递单号">
<a-input v-model="form.trackingNo" placeholder="请输入快递单号" allow-clear :disabled="!isEdit" /> <a-input
v-model="form.trackingNo"
placeholder="请输入快递单号"
allow-clear
:disabled="!isEdit"
/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :lg="8" :sm="12"> <a-col :lg="8" :sm="12">
<a-form-model-item label="寄送方式"> <a-form-model-item label="寄送方式">
<a-select v-model="form.sendMode" placeholder="请选择寄送方式" allow-clear :disabled="!isEdit"> <a-select
v-model="form.sendMode"
placeholder="请选择寄送方式"
allow-clear
:disabled="!isEdit"
>
<a-select-option value="快递">快递</a-select-option> <a-select-option value="快递">快递</a-select-option>
<a-select-option value="邮件">邮件</a-select-option> <a-select-option value="邮件">邮件</a-select-option>
</a-select> </a-select>
...@@ -44,92 +82,168 @@ ...@@ -44,92 +82,168 @@
</a-col> </a-col>
<a-col :lg="8" :sm="12"> <a-col :lg="8" :sm="12">
<a-form-model-item label="寄送日期"> <a-form-model-item label="寄送日期">
<a-date-picker format="YYYY年MM月DD日" v-model="form.sendDate" placeholder="选择日期" /> <a-date-picker
format="YYYY年MM月DD日"
v-model="form.sendDate"
placeholder="选择日期"
/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :lg="8" :sm="12"> <a-col :lg="8" :sm="12">
<a-form-model-item label="寄送地址"> <a-form-model-item label="寄送地址">
<a-input v-model="form.sendAddress" placeholder="请输入寄送地址" allow-clear :disabled="!isEdit" /> <a-input
v-model="form.sendAddress"
placeholder="请输入寄送地址"
allow-clear
:disabled="!isEdit"
/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :lg="8" :sm="12"> <a-col :lg="8" :sm="12">
<a-form-model-item label="寄送邮箱"> <a-form-model-item label="寄送邮箱">
<a-input v-model="form.sendEmail" placeholder="请输入寄送邮箱" allow-clear :disabled="!isEdit" /> <a-input
v-model="form.sendEmail"
placeholder="请输入寄送邮箱"
allow-clear
:disabled="!isEdit"
/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :lg="8" :sm="12"> <a-col :lg="8" :sm="12">
<a-form-model-item label="寄送备注"> <a-form-model-item label="寄送备注">
<a-textarea v-model="form.sendRemark" placeholder="请输入寄送备注" :auto-size="{ minRows: 2, maxRows: 5 }" allow-clear :disabled="!isEdit" /> <a-textarea
v-model="form.sendRemark"
placeholder="请输入寄送备注"
:auto-size="{ minRows: 2, maxRows: 5 }"
allow-clear
:disabled="!isEdit"
/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :sm="24" class="none-label" v-if="isEdit"> <a-col :sm="24" class="none-label" v-if="isEdit">
<div class="btn-div flex"> <div class="btn-div flex">
<span></span> <span></span>
<a-form-model-item label="button"> <a-form-model-item label="button">
<a-button class="mar-left10" type="primary" @click.stop="addNewCharge"> <a-button
<Icon :name="sendBatchNo?'ssibaocun':'ssiadd'" :size="14" />{{sendBatchNo?'保存寄送':'新建寄送'}}</a-button> class="mar-left10"
type="primary"
@click.stop="addNewCharge(true)"
>
<Icon
:name="sendBatchNo ? 'ssibaocun' : 'ssiadd'"
:size="14"
/>{{ sendBatchNo ? '保存寄送' : '新建寄送' }}</a-button
>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
</a-row> </a-row>
</a-form-model> </a-form-model>
<a-form-model ref="form" layout="vertical" :model="searchForm"> <a-form-model ref="form" layout="vertical" :model="searchForm">
<a-row :gutter="30"> <a-row :gutter="30">
<a-col :lg="8" :sm="12"> <a-col :lg="8" :sm="12">
<a-form-model-item label="账单日期"> <a-form-model-item label="账单日期">
<a-range-picker format="YYYY-MM-DD" value-format="YYYY-MM-DD" v-model="searchForm.visitTimeStart" :placeholder="['选择账单开始日期', '选择账单结束日期']" /> <a-range-picker
</a-form-model-item> format="YYYY-MM-DD"
</a-col> value-format="YYYY-MM-DD"
<a-col :lg="8" :sm="12"> v-model="searchForm.visitTimeStart"
<a-form-model-item label="病历号"> :placeholder="['选择账单开始日期', '选择账单结束日期']"
<a-input v-model="searchForm.mrnNo" placeholder="请输入病历号" allow-clear /> />
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :lg="8" :sm="12"> <a-col :lg="8" :sm="12">
<a-form-model-item label="客户名称"> <a-form-model-item label="病历号">
<a-input v-model="searchForm.patientName" placeholder="请输入客户名称" allow-clear /> <a-input
</a-form-model-item> v-model="searchForm.mrnNo"
</a-col> placeholder="请输入病历号"
</a-row> allow-clear
<a-row :gutter="30"> />
<a-col :lg="8" :sm="12"> </a-form-model-item>
<a-form-model-item label="账单编号"> </a-col>
<a-input v-model="searchForm.receiptNo" placeholder="请输入账单编号" allow-clear /> <a-col :lg="8" :sm="12">
</a-form-model-item> <a-form-model-item label="客户名称">
</a-col> <a-input
<a-col :lg="8" :sm="12"> v-model="searchForm.patientName"
<a-form-model-item label="状态"> placeholder="请输入客户名称"
<a-select v-model="searchForm.rStatus" placeholder="请选择状态" allow-clear> allow-clear
<a-select-option :key="item.code" :value="item.code" v-for="item in statusOptions">{{item.name}}</a-select-option> />
</a-select> </a-form-model-item>
</a-form-model-item> </a-col>
</a-col> </a-row>
</a-row> <a-row :gutter="30">
<a-col :lg="8" :sm="12">
<a-form-model-item label="账单编号">
<a-input
v-model="searchForm.receiptNo"
placeholder="请输入账单编号"
allow-clear
/>
</a-form-model-item>
</a-col>
<a-col :lg="8" :sm="12">
<a-form-model-item label="状态">
<a-select
v-model="searchForm.rStatus"
placeholder="请选择状态"
allow-clear
>
<a-select-option
:key="item.code"
:value="item.code"
v-for="item in statusOptions"
>{{ item.name }}</a-select-option
>
</a-select>
</a-form-model-item>
</a-col>
</a-row>
<a-row :gutter="30"> <a-row :gutter="30">
<a-col :sm="24" class="none-label"> <a-col :sm="24" class="none-label">
<div class="btn-div flex"> <div class="btn-div flex">
<div class="total-div flex"> <div class="total-div flex">
<div> <div>
<span>总账单数:</span> <span>总账单数:</span>
<span class="blue-text">{{ totalListNum + selectedRowKeys.length }}</span> <span class="blue-text">{{
<span :style="{color: 'red'}" v-if="invalidNum > 0">(无效{{ invalidNum }} 条)</span> totalListNum + selectedRowKeys.length
}}</span>
<span :style="{ color: 'red' }" v-if="invalidNum > 0"
>(无效{{ invalidNum }} 条)</span
>
</div> </div>
<div> <div>
<span>理赔金额合计:</span> <span>理赔金额合计:</span>
<span class="blue-text">{{ totalAmount }}</span> <span class="blue-text">{{ totalAmount }}</span>
<span :style="{color: 'red'}" v-if="invalidActualAmount > 0">(无效{{ invalidActualAmount }}元)</span> <span :style="{ color: 'red' }" v-if="invalidActualAmount > 0"
</div> >(无效{{ invalidActualAmount }}元)</span
<a-button v-if="isEditNewBill" size="small" type="primary" @click="checkAll">全选</a-button> >
</div>
<a-button
v-if="isEditNewBill"
size="small"
type="primary"
@click="checkAll"
>全选</a-button
>
</div> </div>
<a-form-model-item label="button"> <a-form-model-item label="button">
<a-button type="primary" @click="handlerSearch"> <a-button type="primary" @click="handlerSearch">
<Icon name="ssisearch_active" :size="14" />查询 <Icon name="ssisearch_active" :size="14" />查询
</a-button> </a-button>
<a-button class="mar-left10" type="primary" @click="exportEvt"> <a-button class="mar-left10" type="primary" @click="exportEvt">
<Icon name="ssidaochu" :size="14" />导出 <Icon name="ssidaochu" :size="14" />导出
</a-button> </a-button>
<a-button class="mar-left10" type="primary" @click.stop="addNewBill" v-if="isEdit"> <a-button
<Icon :name="isEditNewBill?'ssibaocun':'ssiadd'" :size="14" />{{isEditNewBill? '保存账单': '添加账单'}}</a-button> class="mar-left10"
type="primary"
@click.stop="addNewBill"
v-if="isEdit"
>
<Icon
:name="isEditNewBill ? 'ssibaocun' : 'ssiadd'"
:size="14"
/>{{ isEditNewBill ? '保存账单' : '添加账单' }}</a-button
>
</a-form-model-item> </a-form-model-item>
</div> </div>
</a-col> </a-col>
...@@ -137,34 +251,62 @@ ...@@ -137,34 +251,62 @@
</a-form-model> </a-form-model>
<!-- table --> <!-- table -->
<a-table :columns="columns" :data-source="dataList" :scroll="{ x: true }" :pagination="false" <a-table
:row-selection="isEditNewBill? { selectedRowKeys: selectedRowKeys, onChange: onSelectChange }: null"> :columns="columns"
:data-source="dataList"
:scroll="{ x: true }"
:pagination="false"
:row-selection="
isEditNewBill
? { selectedRowKeys: selectedRowKeys, onChange: onSelectChange }
: null
"
>
<template slot="sendDate" slot-scope="text"> <template slot="sendDate" slot-scope="text">
{{ text? moment(text).format('YYYY-MM-DD'): '' }} {{ text ? moment(text).format('YYYY-MM-DD') : '' }}
</template> </template>
<template slot="sendSts" slot-scope="text"> <template slot="sendSts" slot-scope="text">
{{ text==1?'已寄送':'未寄送' }} {{ text == 1 ? '已寄送' : '未寄送' }}
</template> </template>
<template slot="status" slot-scope="text"> <template slot="status" slot-scope="text">
<span :style="{color: text == 2 ? 'red' : ''}">{{ text==1?'有效':text==2?'无效':'' }}</span> <span :style="{ color: text == 2 ? 'red' : '' }">{{
text == 1 ? '有效' : text == 2 ? '无效' : ''
}}</span>
</template> </template>
<template slot="operation" slot-scope="text, record"> <template slot="operation" slot-scope="text, record">
<!-- <a-button type="link" @click.stop="editEvt(record)">修改</a-button> --> <!-- <a-button type="link" @click.stop="editEvt(record)">修改</a-button> -->
<a-button type="link" class="danger" @click.stop="delRecord(record)">删除</a-button> <a-button type="link" class="danger" @click.stop="delRecord(record)"
>删除</a-button
>
</template> </template>
</a-table> </a-table>
<!--分页--> <!--分页-->
<BurtPagination :pagination="pagination" @pageChange="getPageData" /> <BurtPagination :pagination="pagination" @pageChange="getPageData" />
<a-modal title="编辑" :visible="dialogShow" width="700px" :maskClosable="false" <a-modal
okText="确定" cancelText="取消" title="编辑"
@ok="handleEditOK" @cancel="dialogShow = false"> :visible="dialogShow"
width="700px"
:maskClosable="false"
okText="确定"
cancelText="取消"
@ok="handleEditOK"
@cancel="dialogShow = false"
>
<a-form-model ref="editForm" :model="editFormObj" :rules="editRules"> <a-form-model ref="editForm" :model="editFormObj" :rules="editRules">
<a-row :gutter="30"> <a-row :gutter="30">
<a-col :lg="12" :xs="24"> <a-col :lg="12" :xs="24">
<a-form-model-item label="保险公司" prop="payorCode"> <a-form-model-item label="保险公司" prop="payorCode">
<a-select v-model="editFormObj.payorCode" placeholder="请选择保险公司" allowClear> <a-select
<a-select-option v-for="item in companyOptions" :key="item.id" :value="item.payorCode"> v-model="editFormObj.payorCode"
placeholder="请选择保险公司"
allowClear
>
<a-select-option
v-for="item in companyOptions"
:key="item.id"
:value="item.payorCode"
>
{{ item.longName }} {{ item.longName }}
</a-select-option> </a-select-option>
</a-select> </a-select>
...@@ -172,7 +314,11 @@ ...@@ -172,7 +314,11 @@
</a-col> </a-col>
<a-col :lg="12" :sm="24"> <a-col :lg="12" :sm="24">
<a-form-model-item label="寄送状态" prop="sendSts"> <a-form-model-item label="寄送状态" prop="sendSts">
<a-select v-model="editFormObj.sendSts" placeholder="请选择寄送状态" allowClear> <a-select
v-model="editFormObj.sendSts"
placeholder="请选择寄送状态"
allowClear
>
<a-select-option :value="1">已寄送</a-select-option> <a-select-option :value="1">已寄送</a-select-option>
<a-select-option :value="2">未寄送</a-select-option> <a-select-option :value="2">未寄送</a-select-option>
</a-select> </a-select>
...@@ -180,19 +326,29 @@ ...@@ -180,19 +326,29 @@
</a-col> </a-col>
<a-col :lg="12" :sm="24"> <a-col :lg="12" :sm="24">
<a-form-model-item label="寄送日期" prop="sendDate"> <a-form-model-item label="寄送日期" prop="sendDate">
<a-date-picker format="YYYY年MM月DD日" v-model="editFormObj.sendDate" placeholder="选择日期" /> <a-date-picker
format="YYYY年MM月DD日"
v-model="editFormObj.sendDate"
placeholder="选择日期"
/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
<a-col :lg="12" :xs="24"> <a-col :lg="12" :xs="24">
<a-form-model-item label="快递单号" prop="trackingNo"> <a-form-model-item label="快递单号" prop="trackingNo">
<a-input v-model.trim="editFormObj.trackingNo" placeholder="快递单号" /> <a-input
v-model.trim="editFormObj.trackingNo"
placeholder="快递单号"
/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
<a-row :gutter="30"> <a-row :gutter="30">
<a-col :lg="12" :xs="24"> <a-col :lg="12" :xs="24">
<a-form-model-item label="寄送备注" prop="sendRemark"> <a-form-model-item label="寄送备注" prop="sendRemark">
<a-textarea v-model.trim="editFormObj.sendRemark" placeholder="寄送备注" /> <a-textarea
v-model.trim="editFormObj.sendRemark"
placeholder="寄送备注"
/>
</a-form-model-item> </a-form-model-item>
</a-col> </a-col>
</a-row> </a-row>
...@@ -202,10 +358,10 @@ ...@@ -202,10 +358,10 @@
</template> </template>
<script> <script>
import Goback from "@/components/Customers/goback"; import Goback from '@/components/Customers/goback'
import BurtPagination from "@/components/Customers/pagation"; import BurtPagination from '@/components/Customers/pagation'
import moment from 'moment' import moment from 'moment'
import Big from 'big.js'; import Big from 'big.js'
// import { numValid } from "@/utils/index" // import { numValid } from "@/utils/index"
export default { export default {
...@@ -237,18 +393,22 @@ export default { ...@@ -237,18 +393,22 @@ export default {
pagination: { pagination: {
pageNum: 1, pageNum: 1,
pageSize: 200, pageSize: 200,
total: 0, total: 0
}, },
editFormObj: { editFormObj: {
payorCode: '', payorCode: '',
sendSts: '', sendSts: '',
sendDate: '', sendDate: '',
trackingNo: '', trackingNo: '',
sendRemark: '', sendRemark: ''
}, },
editRules: { editRules: {
sendDate: [{ required: true, message: "请选择寄送日期", trigger: "change" }], sendDate: [
trackingNo: [{ required: true, message: "请输入寄送单号", trigger: "blur" }], { required: true, message: '请选择寄送日期', trigger: 'change' }
],
trackingNo: [
{ required: true, message: '请输入寄送单号', trigger: 'blur' }
]
}, },
statusOptions: [ statusOptions: [
{ {
...@@ -265,15 +425,19 @@ export default { ...@@ -265,15 +425,19 @@ export default {
selectActualAmount: 0, selectActualAmount: 0,
invalidNum: 0, invalidNum: 0,
invalidActualAmount: 0 invalidActualAmount: 0
}; }
}, },
components: { components: {
Goback, Goback,
BurtPagination, BurtPagination
}, },
computed: { computed: {
totalAmount(){ totalAmount() {
console.log(this.totalActualAmount,this.selectActualAmount,Number(this.totalActualAmount * 100) + this.selectActualAmount * 100) console.log(
this.totalActualAmount,
this.selectActualAmount,
Number(this.totalActualAmount * 100) + this.selectActualAmount * 100
)
if (this.isEditNewBill) { if (this.isEditNewBill) {
return Big(this.totalActualAmount).plus(this.selectActualAmount) return Big(this.totalActualAmount).plus(this.selectActualAmount)
} else { } else {
...@@ -281,96 +445,176 @@ export default { ...@@ -281,96 +445,176 @@ export default {
} }
}, },
columns() { columns() {
const base = [ const base = [
{ title: "账单日期", dataIndex: "receiptDate", width: 120,fixed: "left",scopedSlots: { customRender: "receiptDate" } }, {
{ title: "状态", dataIndex: "status", key:"status",align:'center',fixed: "left", width: 60,scopedSlots: { customRender: "status" } }, title: '账单日期',
{ title: "客户姓名", dataIndex: "patientName",fixed: "left", width: 120 }, dataIndex: 'receiptDate',
{ title: "病历号", dataIndex: "mrnNo", key:"mrnNo",align:'center', width: 136}, width: 120,
{ title: "保险公司", dataIndex: "payorName", ellipsis: true, width: 250 }, fixed: 'left',
{ title: "保险卡号", dataIndex: "memberCardNo", width: 140 }, scopedSlots: { customRender: 'receiptDate' }
{ title: "客户生日", dataIndex: "birthday", width: 120 }, },
{ title: "就诊医生", dataIndex: "doctorName", width: 100, align: 'center' }, {
{ title: "应收金额", dataIndex: "chargeAmount", width: 100, align: 'center' }, title: '状态',
{ title: "折扣金额", dataIndex: "discountAmount", width: 100, align: 'center' }, dataIndex: 'status',
{ title: "减免金额", dataIndex: "reduceAmount", width: 100, align: 'center' }, key: 'status',
{ title: "客户自付", dataIndex: "selfpaidAmount", width: 100, align: 'center' }, align: 'center',
{ title: "理赔金额", dataIndex: "actualAmount", width: 100, align: 'center' }, fixed: 'left',
{ title: "账单编号", dataIndex: "receiptNo", key:"receiptNo",align:'center'}, width: 60,
]; scopedSlots: { customRender: 'status' }
if(this.sendBatchNo && ! this.isEditNewBill && this.isEdit){ // 编辑状态下已经保存的数据才可进行操作 },
return base.concat([ {
{ title: "操作", key: "operation", width: "100px",fixed: "right",scopedSlots: { customRender: "operation" }}, title: '客户姓名',
]); dataIndex: 'patientName',
fixed: 'left',
width: 120
},
{
title: '病历号',
dataIndex: 'mrnNo',
key: 'mrnNo',
align: 'center',
width: 136
},
{
title: '保险公司',
dataIndex: 'payorName',
ellipsis: true,
width: 250
},
{ title: '保险卡号', dataIndex: 'memberCardNo', width: 140 },
{ title: '客户生日', dataIndex: 'birthday', width: 120 },
{
title: '就诊医生',
dataIndex: 'doctorName',
width: 100,
align: 'center'
},
{
title: '应收金额',
dataIndex: 'chargeAmount',
width: 100,
align: 'center'
},
{
title: '折扣金额',
dataIndex: 'discountAmount',
width: 100,
align: 'center'
},
{
title: '减免金额',
dataIndex: 'reduceAmount',
width: 100,
align: 'center'
},
{
title: '客户自付',
dataIndex: 'selfpaidAmount',
width: 100,
align: 'center'
},
{
title: '理赔金额',
dataIndex: 'actualAmount',
width: 100,
align: 'center'
},
{
title: '账单编号',
dataIndex: 'receiptNo',
key: 'receiptNo',
align: 'center'
} }
return base ]
if (this.sendBatchNo && !this.isEditNewBill && this.isEdit) {
// 编辑状态下已经保存的数据才可进行操作
return base.concat([
{
title: '操作',
key: 'operation',
width: '100px',
fixed: 'right',
scopedSlots: { customRender: 'operation' }
}
])
}
return base
} }
}, },
created() { created() {
const { sendBatchNo, isEdit } = this.$route.query; const { sendBatchNo, isEdit } = this.$route.query
this.sendBatchNo = sendBatchNo; this.sendBatchNo = sendBatchNo
this.isEdit = isEdit; this.isEdit = isEdit
this._getCompanyOptions(); this._getCompanyOptions()
this.getRefcdByRefgrp(); this.getRefcdByRefgrp()
if(this.sendBatchNo){ if (this.sendBatchNo) {
let jisongDataDetail = localStorage.getItem('jisongDataDetail'); let jisongDataDetail = localStorage.getItem('jisongDataDetail')
this.form = jisongDataDetail? JSON.parse(jisongDataDetail): {}; this.form = jisongDataDetail ? JSON.parse(jisongDataDetail) : {}
this.getData(); this.getData()
} }
}, },
methods: { methods: {
moment, moment,
onSelectChange(selectedRowKeys) { onSelectChange(selectedRowKeys) {
let arr = []; let arr = []
this.selectActualAmount = 0 this.selectActualAmount = 0
for(let i=0; i<selectedRowKeys.length; i++){ for (let i = 0; i < selectedRowKeys.length; i++) {
let idx = selectedRowKeys[i]; let idx = selectedRowKeys[i]
if(this.dataList[idx].sendBatchNo){ if (this.dataList[idx].sendBatchNo) {
this.$msg.destroy(); this.$msg.destroy()
this.$message.warning('寄送批号已存在') this.$message.warning('寄送批号已存在')
}else{ } else {
arr.push(idx); arr.push(idx)
if(idx.status == 2){ if (idx.status == 2) {
this.invalidNum++ this.invalidNum++
this.invalidActualAmount = Big(this.invalidActualAmount).plus(this.dataList[idx].actualAmount) this.invalidActualAmount = Big(this.invalidActualAmount).plus(
this.dataList[idx].actualAmount
)
} }
this.selectActualAmount = Big(this.selectActualAmount).plus(this.dataList[idx].actualAmount) this.selectActualAmount = Big(this.selectActualAmount).plus(
this.dataList[idx].actualAmount
)
} }
} }
this.selectedRowKeys = arr; this.selectedRowKeys = arr
}, },
// 全选 // 全选
checkAll() { checkAll() {
this.$apis.queryNoSendReceipList({ this.$apis
.queryNoSendReceipList({
pageNum: 1, pageNum: 1,
pageSize: this.pagination.total, pageSize: this.pagination.total,
payorCode: this.form.payorCode, payorCode: this.form.payorCode,
...this.searchData ...this.searchData
}) })
.then((res) => { .then((res) => {
if (res.returnCode == "0000") { if (res.returnCode == '0000') {
const dataList = res.content.list || []; const dataList = res.content.list || []
const selectedRowKeys = dataList.map((item, index) => index); const selectedRowKeys = dataList.map((item, index) => index)
this.onSelectChange(selectedRowKeys) this.onSelectChange(selectedRowKeys)
const index = Math.ceil(dataList.length / this.pagination.pageSize) const index = Math.ceil(dataList.length / this.pagination.pageSize)
for(let i = 1; i < index + 1 ; i++) { for (let i = 1; i < index + 1; i++) {
this.cacheDataList[i] = dataList.slice((i-1)*this.pagination.pageSize, i*this.pagination.pageSize) this.cacheDataList[i] = dataList.slice(
(i - 1) * this.pagination.pageSize,
i * this.pagination.pageSize
)
} }
} else { } else {
this.$message.error(res.returnMsg); this.$message.error(res.returnMsg)
} }
}); })
}, },
// 分页回调 // 分页回调
getPageData(pager) { getPageData(pager) {
console.log(pager, 1111) console.log(pager, 1111)
if(pager){ if (pager) {
this.pagination = { this.pagination = {
...this.pagination, ...this.pagination,
...pager ...pager
} }
} }
if(this.isEditNewBill) { // 新增时添加了账单信息 那分页也应该是调账单信息接口 if (this.isEditNewBill) {
// 新增时添加了账单信息 那分页也应该是调账单信息接口
this._getNewBillList() this._getNewBillList()
} else { } else {
this.getData() this.getData()
...@@ -378,39 +622,40 @@ export default { ...@@ -378,39 +622,40 @@ export default {
}, },
// 获取列表数据 // 获取列表数据
getData() { getData() {
this.selectedRowKeys = []; this.selectedRowKeys = []
let filter = { let filter = {
pageNum: this.pagination.pageNum, pageNum: this.pagination.pageNum,
pageSize: this.pagination.pageSize, pageSize: this.pagination.pageSize,
sendBatchNo: this.sendBatchNo || undefined, sendBatchNo: this.sendBatchNo || undefined,
...this.searchData ...this.searchData
} }
this.$apis.querySendReceipList(filter) this.$apis.querySendReceipList(filter).then((res) => {
.then((res) => { if (res.returnCode == '0000') {
if (res.returnCode == "0000") { let content = res.content || {}
let content = res.content || {}; this.pagination.total = content.total || 0
this.pagination.total = content.total || 0; this.dataList = content.list || []
this.dataList = content.list || [];
this.cacheDataList[filter.pageNum] = this.dataList this.cacheDataList[filter.pageNum] = this.dataList
this.getTotal() this.getTotal()
} else { } else {
this.$message.error(res.returnMsg); this.$message.error(res.returnMsg)
} }
}); })
}, },
// 计算总保费 // 计算总保费
getTotal(){ getTotal() {
let totalNum = 0 let totalNum = 0
let totalMoney= 0 let totalMoney = 0
let invalidNum = 0 let invalidNum = 0
let invalidActualAmount = 0 let invalidActualAmount = 0
if(this.dataList.length>0){ if (this.dataList.length > 0) {
this.dataList.forEach((item)=>{ this.dataList.forEach((item) => {
totalNum++ totalNum++
totalMoney = Big(totalMoney).plus(item.actualAmount) totalMoney = Big(totalMoney).plus(item.actualAmount)
if(item.status == 2){ if (item.status == 2) {
invalidNum++ invalidNum++
invalidActualAmount = Big(invalidActualAmount).plus(item.actualAmount) invalidActualAmount = Big(invalidActualAmount).plus(
item.actualAmount
)
} }
}) })
} }
...@@ -422,71 +667,81 @@ export default { ...@@ -422,71 +667,81 @@ export default {
// 获取保险公司下拉选项 // 获取保险公司下拉选项
_getCompanyOptions() { _getCompanyOptions() {
this.$apis.getCompanyOptions().then((res) => { this.$apis.getCompanyOptions().then((res) => {
this.companyOptions = res.content || []; this.companyOptions = res.content || []
}); })
}, },
// 获取快递列表 // 获取快递列表
getRefcdByRefgrp() { getRefcdByRefgrp() {
this.$apis.getRefcdByRefgrp({ this.$apis
modid: "CI", .getRefcdByRefgrp({
refgrp: "SEND_COMPANY" modid: 'CI',
}).then((res) => { refgrp: 'SEND_COMPANY'
this.expressList = res.content || []; })
}); .then((res) => {
this.expressList = res.content || []
})
}, },
//查看 //查看
detailEvt(record) { detailEvt(record) {
const { receiptNo } = record; const { receiptNo } = record
this.$router.push({ this.$router.push({
name: "chargeQueryDetail", name: 'chargeQueryDetail',
query: { receiptNo }, query: { receiptNo }
}); })
}, },
editEvt(record) { editEvt(record) {
this.editFormObj = { this.editFormObj = {
ciReceiptSendVos: [ ciReceiptSendVos: [
{ {
id: record.id, id: record.id,
receiptNo: record.receiptNo, receiptNo: record.receiptNo
} }
], ],
payorCode: record.payorCode || "", payorCode: record.payorCode || '',
sendSts: Number(record.sendSts) || "", sendSts: Number(record.sendSts) || '',
sendDate: record.sendDate || "", sendDate: record.sendDate || '',
trackingNo: record.trackingNo || "", trackingNo: record.trackingNo || '',
sendRemark: record.sendRemark || "", sendRemark: record.sendRemark || ''
}; }
this.dialogShow = true; this.dialogShow = true
}, },
//编辑保存 //编辑保存
handleEditOK() { handleEditOK() {
this.$refs.editForm.validate((valid) => { this.$refs.editForm.validate((valid) => {
if (valid) { if (valid) {
this.$apis.saceReceipSendInfo({ this.$apis
...this.editFormObj, .saceReceipSendInfo({
sendDate: moment(this.editFormObj.sendDate).format('YYYY-MM-DD 00:00:00') ...this.editFormObj,
}) sendDate: moment(this.editFormObj.sendDate).format(
.then((res) => { 'YYYY-MM-DD 00:00:00'
if (res.returnCode == "0000") { )
this.$message.success("编辑成功"); })
this.dialogShow = false; .then((res) => {
this.getData(); if (res.returnCode == '0000') {
} else { this.$message.success('编辑成功')
this.$message.error(res.returnMsg); this.dialogShow = false
} this.getData()
}); } else {
this.$message.error(res.returnMsg)
}
})
} }
}); })
}, },
handlerSearch() { handlerSearch() {
this.pagination.pageNum = 1; this.pagination.pageNum = 1
let visitTimeStart = this.searchForm.visitTimeStart || [] let visitTimeStart = this.searchForm.visitTimeStart || []
this.searchData = this.$lodash.cloneDeep({ this.searchData = this.$lodash.cloneDeep({
...this.searchForm, ...this.searchForm,
visitTimeEnd: visitTimeStart[1] ? visitTimeStart[1] + ' 23:59:59' : undefined, visitTimeEnd: visitTimeStart[1]
visitTimeStart: visitTimeStart[0] ? visitTimeStart[0] + ' 00:00:00' : undefined, ? visitTimeStart[1] + ' 23:59:59'
}); : undefined,
if(this.isEditNewBill) { // 新增时添加了账单信息 那分页也应该是调账单信息接口 visitTimeStart: visitTimeStart[0]
? visitTimeStart[0] + ' 00:00:00'
: undefined
})
if (this.isEditNewBill) {
// 新增时添加了账单信息 那分页也应该是调账单信息接口
this._getNewBillList() this._getNewBillList()
} else { } else {
this.getData() this.getData()
...@@ -495,35 +750,35 @@ export default { ...@@ -495,35 +750,35 @@ export default {
//删除 //删除
delRecord(data) { delRecord(data) {
this.$modal.confirm({ this.$modal.confirm({
title: "删除", title: '删除',
content: "确定删除该条记录?", content: '确定删除该条记录?',
okText: "确定", okText: '确定',
cancelText: "取消", cancelText: '取消',
onOk: () => { onOk: () => {
this.$apis.deleteSendReceipt({ this.$apis
ciReceiptSendVos: [ .deleteSendReceipt({
{receiptNo: data.receiptNo} ciReceiptSendVos: [{ receiptNo: data.receiptNo }],
], sendBatchNo: this.sendBatchNo
sendBatchNo: this.sendBatchNo,
}) })
.then((res) => { .then((res) => {
if (res.returnCode == "0000") { if (res.returnCode == '0000') {
this.$message.success("删除成功"); this.$message.success('删除成功')
this.getData() this.getData()
// this.dataList.splice(index, 1); // this.dataList.splice(index, 1);
} else { } else {
this.$message.error(res.returnMsg); this.$message.error(res.returnMsg)
} }
}); })
}, }
}); })
}, },
//导出 //导出
exportEvt(){ exportEvt() {
let visitTimeStart = this.searchForm.visitTimeStart || [] let visitTimeStart = this.searchForm.visitTimeStart || []
let api = '' let api = ''
if(!this.isEditNewBill) { // 新增时添加了账单信息 那分页也应该是调账单信息接口 if (!this.isEditNewBill) {
// 新增时添加了账单信息 那分页也应该是调账单信息接口
api = this.$apis.sendReceipListExport api = this.$apis.sendReceipListExport
} else { } else {
api = this.$apis.noSendReceipListExport api = this.$apis.noSendReceipListExport
...@@ -532,36 +787,44 @@ export default { ...@@ -532,36 +787,44 @@ export default {
sendBatchNo: this.sendBatchNo || undefined, sendBatchNo: this.sendBatchNo || undefined,
...this.searchForm, ...this.searchForm,
payorCode: this.form.payorCode || undefined, payorCode: this.form.payorCode || undefined,
visitTimeEnd: visitTimeStart[1] ? visitTimeStart[1] + ' 23:59:59' : undefined, visitTimeEnd: visitTimeStart[1]
visitTimeStart: visitTimeStart[0] ? visitTimeStart[0] + ' 00:00:00' : undefined, ? visitTimeStart[1] + ' 23:59:59'
}) : undefined,
.then(res => { visitTimeStart: visitTimeStart[0]
? visitTimeStart[0] + ' 00:00:00'
: undefined
}).then((res) => {
let blob = new Blob([res.data], { let blob = new Blob([res.data], {
type:"application/vnd.ms-excel;charset=utf-8" type: 'application/vnd.ms-excel;charset=utf-8'
}); })
let url=window.URL.createObjectURL(blob); let url = window.URL.createObjectURL(blob)
let aLink=document.createElement("a"); let aLink = document.createElement('a')
aLink.style.display="none"; aLink.style.display = 'none'
aLink.href=url; aLink.href = url
aLink.setAttribute("download",!this.isEditNewBill?"寄送账单.xls":'未寄送账单.xls'); aLink.setAttribute(
document.body.appendChild(aLink); 'download',
aLink.click(); !this.isEditNewBill ? '寄送账单.xls' : '未寄送账单.xls'
document.body.removeChild(aLink); )
window.URL.revokeObjectURL(url); document.body.appendChild(aLink)
}) aLink.click()
document.body.removeChild(aLink)
window.URL.revokeObjectURL(url)
})
}, },
//添加账单 //添加账单
addNewBill(){ addNewBill() {
if(this.isEditNewBill){ //保存 if (this.isEditNewBill) {
this.addNewCharge() //保存
.then(()=>{ this.addNewCharge().then(() => {
this.isEditNewBill = false; this.isEditNewBill = false
}) })
}else{ //查询所有未加入的账单 } else {
this.pagination.pageNum = 1; //查询所有未加入的账单
this.isEditNewBill = true; this.pagination.pageNum = 1
this.isEditNewBill = true
this.cacheDataList = {} this.cacheDataList = {}
if(this.isEditNewBill) { // 新增时添加了账单信息 那分页也应该是调账单信息接口 if (this.isEditNewBill) {
// 新增时添加了账单信息 那分页也应该是调账单信息接口
this._getNewBillList() this._getNewBillList()
} else { } else {
this.getData() this.getData()
...@@ -569,103 +832,108 @@ export default { ...@@ -569,103 +832,108 @@ export default {
} }
}, },
_getNewBillList() { _getNewBillList() {
console.log(2133) this.$apis
this.$apis.queryNoSendReceipList({ .queryNoSendReceipList({
pageNum: this.pagination.pageNum, pageNum: this.pagination.pageNum,
pageSize: this.pagination.pageSize, pageSize: this.pagination.pageSize,
payorCode: this.form.payorCode, payorCode: this.form.payorCode,
...this.searchData ...this.searchData
}) })
.then((res) => { .then((res) => {
if (res.returnCode == "0000") { if (res.returnCode == '0000') {
// this.selectedRowKeys = []; // this.selectedRowKeys = [];
let content = res.content || {}; let content = res.content || {}
this.pagination.total = content.total || 0; this.pagination.total = content.total || 0
this.dataList = content.list || []; this.dataList = content.list || []
this.cacheDataList[this.pagination.pageNum] = this.dataList this.cacheDataList[this.pagination.pageNum] = this.dataList
} else { } else {
this.$message.error(res.returnMsg); this.$message.error(res.returnMsg)
} }
}); })
}, },
checkBeforeSave() { checkBeforeSave() {
if(!this.form.trackingNo){ if (!this.form.trackingNo) {
this.$message.warning("请输入快递单号"); this.$message.warning('请输入快递单号')
return false; return false
} }
if(!this.form.sendDate){ if (!this.form.sendDate) {
this.$message.warning("请选择寄送日期"); this.$message.warning('请选择寄送日期')
return false; return false
} }
let allData = [] let allData = []
for(let i in this.cacheDataList){ for (let i in this.cacheDataList) {
allData = allData.concat(this.cacheDataList[i]) allData = allData.concat(this.cacheDataList[i])
} }
let ciReceiptSendVos = []; let ciReceiptSendVos = []
if(this.isEditNewBill){ if (this.isEditNewBill) {
ciReceiptSendVos = []; ciReceiptSendVos = []
allData.forEach((item,index)=>{ allData.forEach((item, index) => {
if(this.selectedRowKeys.indexOf(index)!=-1){ if (this.selectedRowKeys.indexOf(index) != -1) {
ciReceiptSendVos.push({ ciReceiptSendVos.push({
id: item.id, id: item.id,
receiptNo: item.receiptNo, receiptNo: item.receiptNo,
selfpaidAmount: item.selfpaidAmount selfpaidAmount: item.selfpaidAmount
})
}
})
} else {
ciReceiptSendVos = allData.map(item => {
return {
id: item.id,
receiptNo: item.receiptNo,
selfpaidAmount: item.selfpaidAmount
}
}) })
} }
// for(let i = 0; i < ciReceiptSendVos.length; i ++) { })
// const selfpaidAmount = ciReceiptSendVos[i].selfpaidAmount } else {
// if(selfpaidAmount && !numValid.test(selfpaidAmount)){ ciReceiptSendVos = allData.map((item) => {
// this.$message.warning("请输入正确的客户自付金额"); return {
// return false; id: item.id,
// } receiptNo: item.receiptNo,
// } selfpaidAmount: item.selfpaidAmount
return { }
...this.form, })
ciReceiptSendVos: ciReceiptSendVos, }
sendDate: moment(this.form.sendDate).format('YYYY-MM-DD 00:00:00'), // for(let i = 0; i < ciReceiptSendVos.length; i ++) {
sendBatchNo: this.sendBatchNo || undefined // const selfpaidAmount = ciReceiptSendVos[i].selfpaidAmount
} // if(selfpaidAmount && !numValid.test(selfpaidAmount)){
// this.$message.warning("请输入正确的客户自付金额");
// return false;
// }
// }
return {
...this.form,
ciReceiptSendVos: ciReceiptSendVos,
sendDate: moment(this.form.sendDate).format('YYYY-MM-DD 00:00:00'),
sendBatchNo: this.sendBatchNo || undefined
}
}, },
//新建/保存寄送 //新建/保存寄送
addNewCharge(){ addNewCharge(flag = false) {
return new Promise((resolve,reject)=>{ return new Promise((resolve, reject) => {
let formData = this.checkBeforeSave() let formData = this.checkBeforeSave()
if(!formData){ if (!formData) {
reject() reject()
return false; return false
} }
this.$apis.saceReceipSendInfo(formData) this.$apis.saceReceipSendInfo(formData).then((res) => {
.then((res) => { if (res.returnCode == '0000') {
if (res.returnCode == "0000") { this.sendBatchNo = res.content
this.sendBatchNo = res.content; this.$message.success('成功')
this.$message.success("成功");
// this.selectedRowKeys = []; // this.selectedRowKeys = [];
this.cacheDataList = {} this.cacheDataList = {}
if(!this.isEditNewBill) { // 新增时添加了账单信息 那分页也应该是调账单信息接口 if (flag) {
this.isEditNewBill = false
this.getData()
return true
}
if (!this.isEditNewBill) {
// 新增时添加了账单信息 那分页也应该是调账单信息接口
this._getNewBillList() this._getNewBillList()
} else { } else {
this.getData() this.getData()
} }
resolve(); resolve()
} else { } else {
this.$message.error(res.returnMsg); this.$message.error(res.returnMsg)
reject(); reject()
} }
}); })
}) })
} }
}, }
}; }
</script> </script>
<style lang="less" scoped> <style lang="less" scoped>
.none-label { .none-label {
...@@ -677,12 +945,12 @@ export default { ...@@ -677,12 +945,12 @@ export default {
.ant-btn .icon-class { .ant-btn .icon-class {
.mg-r(10); .mg-r(10);
} }
.btn-div{ .btn-div {
justify-content: space-between; justify-content: space-between;
} }
.total-div{ .total-div {
gap:20px; gap: 20px;
div span:first-child{ div span:first-child {
font-weight: bold; font-weight: bold;
font-family: PingFangSC-Medium, PingFang SC; font-family: PingFangSC-Medium, PingFang SC;
font-size: 14px; font-size: 14px;
......
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