|
|
|
@ -76,8 +76,7 @@ |
|
|
|
<el-table :data="dataList" ref="info" id="info" width="100%" :height="window.pageHeight < 600 |
|
|
|
? 210 |
|
|
|
: Math.floor((window.pageHeight - 340) / 2) |
|
|
|
" row-key="id" highlight-current-row @selection-change="handleSelectionChange" |
|
|
|
@row-click="rowClick"> |
|
|
|
" row-key="id" highlight-current-row @selection-change="handleSelectionChange" @row-click="rowClick"> |
|
|
|
<el-table-column prop="cardTypeId" label="卡类别" width="70"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div> |
|
|
|
@ -214,169 +213,263 @@ |
|
|
|
<div style="margin-top: 10px"> |
|
|
|
<el-button class="commonbutton" @click="refund">退费</el-button> |
|
|
|
</div> |
|
|
|
<div style="margin-top: 10px"> |
|
|
|
<a :underline="false" href="/files/单位体检人员名单导入模板.xlsx"> |
|
|
|
<el-button class="commonbutton" style="font-size: 12px;">导入建卡模板</el-button> |
|
|
|
</a> |
|
|
|
</div> |
|
|
|
<div style="margin-top: 10px"> |
|
|
|
<el-button class="commonbutton" @click="btnImportCard">导入建卡</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<el-dialog :title="form.id ? '编辑' : '新增'" :visible.sync="dialogVisible" width="820px" :close-on-click-modal="false"> |
|
|
|
<el-form ref="form" :model="form" label-width="100px" :rules="rules" size="small"> |
|
|
|
<el-row> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="卡类别" prop="cardTypeId"> |
|
|
|
<el-select v-model="form.cardTypeId" placeholder="请选择" filterable @change="category" :disabled="form.id ? true:false"> |
|
|
|
<el-option v-for="item in dict.cardType" :key="item.id" :label="item.displayName" :value="item.id" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="会员卡号" prop="cardNo"> |
|
|
|
<el-input v-model="form.cardNo" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="折扣率" prop="discount"> |
|
|
|
<el-input type="number" v-model="form.discount" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="有效期限" prop="expiryDate"> |
|
|
|
<el-date-picker v-model="form.expiryDate" type="date" placeholder="有效期限" size="small" |
|
|
|
:style="'width: ' + Math.floor((820 - 340) / 3) + 'px'" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="卡主姓名" prop="customerName"> |
|
|
|
<el-input v-model="form.customerName" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="卡主身份证" prop="idNo"> |
|
|
|
<el-input v-model="form.idNo" /> |
|
|
|
|
|
|
|
<!--弹窗--> |
|
|
|
<div> |
|
|
|
<el-dialog :title="form.id ? '编辑' : '新增'" :visible.sync="dialogVisible" width="820px" :close-on-click-modal="false"> |
|
|
|
<el-form ref="form" :model="form" label-width="100px" :rules="rules" size="small"> |
|
|
|
<el-row> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="卡类别" prop="cardTypeId"> |
|
|
|
<el-select v-model="form.cardTypeId" placeholder="请选择" filterable @change="category" |
|
|
|
:disabled="form.id ? true : false"> |
|
|
|
<el-option v-for="item in dict.cardType" :key="item.id" :label="item.displayName" :value="item.id" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="会员卡号" prop="cardNo"> |
|
|
|
<el-input v-model="form.cardNo" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="折扣率" prop="discount"> |
|
|
|
<el-input type="number" v-model="form.discount" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="有效期限" prop="expiryDate"> |
|
|
|
<el-date-picker v-model="form.expiryDate" type="date" placeholder="有效期限" size="small" |
|
|
|
:style="'width: ' + Math.floor((820 - 340) / 3) + 'px'" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="卡主姓名" prop="customerName"> |
|
|
|
<el-input v-model="form.customerName" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="卡主身份证" prop="idNo"> |
|
|
|
<el-input v-model="form.idNo" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="卡主电话" prop="telephone"> |
|
|
|
<el-input type="tel" v-model="form.telephone" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="卡主手机号" prop="mobileTelephone"> |
|
|
|
<el-input type="tel" v-model="form.mobileTelephone" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="启用" prop="isActive"> |
|
|
|
<el-radio v-model="form.isActive" label="Y">是</el-radio> |
|
|
|
<el-radio v-model="form.isActive" label="N">否</el-radio> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="体检中心" prop="medicalCenterId"> |
|
|
|
<el-select v-model="form.medicalCenterId" placeholder="请选择" filterable :disabled="peisid ? true : false"> |
|
|
|
<el-option v-for="item in dict.organization" :key="item.id" :label="item.displayName" :value="item.id"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="16"> |
|
|
|
<el-form-item label="备注" prop="remark"> |
|
|
|
<el-input v-model="form.remark" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
|
|
|
|
<el-row> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="创建人员" label-width="80px"> |
|
|
|
<el-input v-model="form.creatorName" disabled></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="创建时间" label-width="80px"> |
|
|
|
<el-input :value="form.creationTime |
|
|
|
? moment(form.creationTime).format('yyyy-MM-DD') |
|
|
|
: '' |
|
|
|
" disabled></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="修改人员" label-width="80px"> |
|
|
|
<el-input v-model="form.lastModifierName" disabled></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="修改时间" label-width="80px"> |
|
|
|
<el-input :value="form.lastModificationTime |
|
|
|
? moment(form.lastModificationTime).format('yyyy-MM-DD') |
|
|
|
: '' |
|
|
|
" disabled></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button @click="dialogVisible = false" class="difference">取消</el-button> |
|
|
|
<el-button type="primary" @click="onSubmit('form')" class="commonbutton">确定</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
<el-dialog title="会员卡充值" :visible.sync="dialogOrder" width="400px" :close-on-click-modal="false"> |
|
|
|
<el-form ref="order" :model="order" label-width="100px" :rules="orderRules" size="small"> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="会员卡号" prop="cardRegisterId"> |
|
|
|
<el-input v-model="order.cardNo" disabled style="width: 200px" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="卡主电话" prop="telephone"> |
|
|
|
<el-input type="tel" v-model="form.telephone" /> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="充值方式" prop="payModeId"> |
|
|
|
<el-select v-model="order.payModeId" placeholder="请选择" filterable :disabled="order.id ? true : false" |
|
|
|
style="width: 200px"> |
|
|
|
<el-option v-for="item in dict.payMode" :key="item.id" :label="item.displayName" :value="item.id" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="卡主手机号" prop="mobileTelephone"> |
|
|
|
<el-input type="tel" v-model="form.mobileTelephone" /> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="充值金额" prop="billMoney"> |
|
|
|
<el-input type="number" v-model="order.billMoney" :disabled="order.id ? true : false" |
|
|
|
style="width: 200px" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="启用" prop="isActive"> |
|
|
|
<el-radio v-model="form.isActive" label="Y">是</el-radio> |
|
|
|
<el-radio v-model="form.isActive" label="N">否</el-radio> |
|
|
|
</el-form> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button @click="dialogOrder = false" class="difference">取消</el-button> |
|
|
|
<el-button type="primary" @click="orderSubmit('order')" class="commonbutton">确定</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
<el-dialog title="会员卡退费" :visible.sync="refundOrder" width="400px" :close-on-click-modal="false"> |
|
|
|
<el-form ref="refundorder" :model="refundorder" label-width="100px" :rules="refundRules" size="small"> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="会员卡号" prop="cardRegisterId"> |
|
|
|
<el-input v-model="refundorder.cardNo" disabled style="width: 200px" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="体检中心" prop="medicalCenterId"> |
|
|
|
<el-select v-model="form.medicalCenterId" placeholder="请选择" filterable :disabled="peisid ? true : false"> |
|
|
|
<el-option v-for="item in dict.organization" :key="item.id" :label="item.displayName" :value="item.id"> |
|
|
|
</el-option> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="退费方式" prop="payModeId"> |
|
|
|
<el-select v-model="refundorder.payModeId" placeholder="请选择" filterable |
|
|
|
:disabled="refundorder.id ? true : false" style="width: 200px"> |
|
|
|
<el-option v-for="item in dict.payMode" :key="item.id" :label="item.displayName" :value="item.id" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="16"> |
|
|
|
<el-form-item label="备注" prop="remark"> |
|
|
|
<el-input v-model="form.remark" /> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="退费金额" prop="billMoney"> |
|
|
|
<el-input type="number" v-model="refundorder.billMoney" :disabled="refundorder.id ? true : false" |
|
|
|
style="width: 200px" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button @click="refundOrder = false" class="difference">取消</el-button> |
|
|
|
<el-button type="primary" @click="orderSubmit('refundorder')" class="commonbutton">确定</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<el-row> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="创建人员" label-width="80px"> |
|
|
|
<el-input v-model="form.creatorName" disabled></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="创建时间" label-width="80px"> |
|
|
|
<el-input :value="form.creationTime |
|
|
|
? moment(form.creationTime).format('yyyy-MM-DD') |
|
|
|
: '' |
|
|
|
" disabled></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="修改人员" label-width="80px"> |
|
|
|
<el-input v-model="form.lastModifierName" disabled></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="6"> |
|
|
|
<el-form-item label="修改时间" label-width="80px"> |
|
|
|
<el-input :value="form.lastModificationTime |
|
|
|
? moment(form.lastModificationTime).format('yyyy-MM-DD') |
|
|
|
: '' |
|
|
|
" disabled></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</el-form> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button @click="dialogVisible = false" class="difference">取消</el-button> |
|
|
|
<el-button type="primary" @click="onSubmit('form')" class="commonbutton">确定</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
<el-dialog title="会员卡充值" :visible.sync="dialogOrder" width="400px" :close-on-click-modal="false"> |
|
|
|
<el-form ref="order" :model="order" label-width="100px" :rules="orderRules" size="small"> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="会员卡号" prop="cardRegisterId"> |
|
|
|
<el-input v-model="order.cardNo" disabled style="width: 200px" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="充值方式" prop="payModeId"> |
|
|
|
<el-select v-model="order.payModeId" placeholder="请选择" filterable :disabled="order.id ? true : false" |
|
|
|
style="width: 200px"> |
|
|
|
<el-option v-for="item in dict.payMode" :key="item.id" :label="item.displayName" :value="item.id" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="充值金额" prop="billMoney"> |
|
|
|
<el-input type="number" v-model="order.billMoney" :disabled="order.id ? true : false" |
|
|
|
style="width: 200px" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-form> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button @click="dialogOrder = false" class="difference">取消</el-button> |
|
|
|
<el-button type="primary" @click="orderSubmit('order')" class="commonbutton">确定</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
<el-dialog title="会员卡退费" :visible.sync="refundOrder" width="400px" :close-on-click-modal="false"> |
|
|
|
<el-form ref="refundorder" :model="refundorder" label-width="100px" :rules="refundRules" size="small"> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="会员卡号" prop="cardRegisterId"> |
|
|
|
<el-input v-model="refundorder.cardNo" disabled style="width: 200px" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="退费方式" prop="payModeId"> |
|
|
|
<el-select v-model="refundorder.payModeId" placeholder="请选择" filterable |
|
|
|
:disabled="refundorder.id ? true : false" style="width: 200px"> |
|
|
|
<el-option v-for="item in dict.payMode" :key="item.id" :label="item.displayName" :value="item.id" /> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="退费金额" prop="billMoney"> |
|
|
|
<el-input type="number" v-model="refundorder.billMoney" :disabled="refundorder.id ? true : false" |
|
|
|
style="width: 200px" /> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-form> |
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
<el-button @click="refundOrder = false" class="difference">取消</el-button> |
|
|
|
<el-button type="primary" @click="orderSubmit('refundorder')" class="commonbutton">确定</el-button> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
<el-dialog title="导入EXCEL注意事项" :visible.sync="dialogGroup.fileReadme" width="700px" :show-close="false" |
|
|
|
:append-to-body="true" :close-on-click-modal="false"> |
|
|
|
<div style="height:400px;padding: 0 20px; "> |
|
|
|
<br />导入Excel时,Excel的格式必须符合一定规范,该格式的模板文件可通过下载模板获取。 |
|
|
|
<br />注意事项如下: |
|
|
|
<br /> |
|
|
|
<div style="margin-left: 25px;">1、卡号、卡主不能为空,其余数据可根据实际情况选择是否填写。 |
|
|
|
<br />2、卡类别与本软件系统中的名称完全一致。 |
|
|
|
<br />3、折扣率填写错误(未填、0、负数或非有数字)时,则默认为 100 |
|
|
|
<br />4、Excel中标题列不能有单元格合并。 |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button class="commonbutton" type="primary" @click="seq--">上一步</el-button> |
|
|
|
<el-button class="commonbutton" type="primary" @click="seq++">下一步</el-button> |
|
|
|
<el-button class="commonbutton" @click="seq = -1">关闭</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<el-dialog title="选择文件" :visible.sync="dialogGroup.fileChoose" width="700px" :show-close="false" |
|
|
|
:append-to-body="true" :close-on-click-modal="false"> |
|
|
|
<div style="height:400px;padding: 0 50px; "> |
|
|
|
<!-- webkitdirectory 选择文件属性, multiple 多选属性--> |
|
|
|
<div><input id="fileNames" type="file" accept=".xlsx,.xls" @change="changeFileChoose" @focus="fileGetFocus" /> |
|
|
|
</div> |
|
|
|
<div style="margin: 5px 70px;width:240px;"> |
|
|
|
<el-table :data="sheetNames" border ref="sheetNames" height="300" row-click="chooseSheetName" |
|
|
|
highlight-current-row size="small"> |
|
|
|
<el-table-column prop="sheetName" label="Excel表单名" min-width="200" align="center" /> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
<div style="display: flex;flex-wrap: wrap;"> |
|
|
|
<span style="margin-top: 6px;">标题行: 第</span> |
|
|
|
<el-input type="number" v-model="readDataOpts.titleRow" size="small" style="width:60px;margin: 0 5px;" /> |
|
|
|
<span style="margin-top: 6px;">行</span> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button class="commonbutton" type="primary" @click="seq--">上一步</el-button> |
|
|
|
<el-button class="commonbutton" type="primary" @click="seq++">下一步</el-button> |
|
|
|
<el-button class="commonbutton" @click="seq = -1">关闭</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<el-dialog title="选择待导入的卡信息" :visible.sync="dialogGroup.fileDataOpr" width="700px" :show-close="false" |
|
|
|
:close-on-click-modal="false"> <!--:append-to-body="true" --> |
|
|
|
<div style="height:400px;"> |
|
|
|
<div style="margin-top: -10px;"> |
|
|
|
1、在标题列右击鼠标可设置列名,即:标题列有 √ 的,才参与数据导入;<br> |
|
|
|
3、按住 Ctr1 或 Shift 键可进行多选。<br> |
|
|
|
</div> |
|
|
|
<div style="margin: 5px 0px 0px;" @contextmenu.prevent=""> <!-- --> |
|
|
|
<el-table :data="excelData" border ref="excelData" @header-contextmenu="headerContextmenu" height="340" |
|
|
|
@row-click="chooseDataImport" row-key="id" highlight-current-row size="small" |
|
|
|
:row-class-name="handleRowClassName"> |
|
|
|
<el-table-column type="index" align="center" label="序号" min-width="40" /> |
|
|
|
<!-- |
|
|
|
<el-table-column prop="choosed" align="center" label="选中" min-width="40"/> |
|
|
|
--> |
|
|
|
<el-table-column v-for="(item, index) in excelCols" :key="`col_${index}`" :prop="item.dispLabel" |
|
|
|
align="center" :label="(item.val ? '√ ' : '') + (item.dataLabel || item.dispLabel)" |
|
|
|
:min-width="100 + index" /> |
|
|
|
|
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<div style="display: flex;justify-content: space-between;"> |
|
|
|
<div style="display: flex;"> |
|
|
|
<el-button class="commonbutton" type="primary" @click="btnChoose('excelData', 'all')">全选</el-button> |
|
|
|
<el-button class="commonbutton" type="primary" @click="btnChoose('excelData')">取消全选</el-button> |
|
|
|
</div> |
|
|
|
<div style="display: flex;"> |
|
|
|
<el-button class="commonbutton" type="primary" @click="seq--">上一步</el-button> |
|
|
|
<el-button class="commonbutton" type="primary" @click="btnImportCardOK">确定导入</el-button> |
|
|
|
<el-button class="commonbutton" @click="seq = -1">关闭</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
@ -507,6 +600,52 @@ export default { |
|
|
|
|
|
|
|
curChoosedRow: {}, //当前选择的行数据 |
|
|
|
curChoosedId: "", //当前选择的行ID |
|
|
|
|
|
|
|
|
|
|
|
// 批量导入 |
|
|
|
dialogGroup: { |
|
|
|
mode: true, //选模式 10 开始 文件导入,20开始 从数据库中导入 |
|
|
|
fileReadme: false, //导入EXCEL注意事项 |
|
|
|
fileChoose: false, //选择文件 |
|
|
|
fileDataOpr: false, //文件数据分析操作 |
|
|
|
fileDataOpts: false, //文件数据导入前参数设定 |
|
|
|
|
|
|
|
query: false, //单位查询条件 |
|
|
|
oldMansChoose: false, //选择历史数据导入 |
|
|
|
oldMansOpts: false, //历史数据导入前参数设定 |
|
|
|
}, |
|
|
|
oldSeq: -2, //旧的步骤(辅助区分上一步,下一步) |
|
|
|
seq: 0, //当前显示窗口 |
|
|
|
mode: '10', //模式 10 开始 文件导入,20开始 从数据库中导入 ,30 开始职业病 |
|
|
|
excelCols: [{ dispLabel: '', val: '', dataLabel: '' }], //excel数据列名 {dispLabel:'',val:'',dataLabel:''} |
|
|
|
importCols: [], //实际导入的列(即有设置与 dataCols 匹配的列) |
|
|
|
excelData: [], //excel表格数据 |
|
|
|
choosedData: [], // 选中的待导入的数据 |
|
|
|
|
|
|
|
dataCols: [ |
|
|
|
{ dispLabel: '不设置', val: '' }, |
|
|
|
{ dispLabel: '卡类别', val: 'cardTypeId' }, |
|
|
|
{ dispLabel: '会员卡号', val: 'cardNo' }, |
|
|
|
{ dispLabel: '折扣率', val: 'discount' }, |
|
|
|
{ dispLabel: '初始余额', val: 'cardBalance' }, |
|
|
|
{ dispLabel: '性别', val: 'expiryDate' }, |
|
|
|
{ dispLabel: '年龄', val: 'age' }, |
|
|
|
{ dispLabel: '有效期限', val: 'birthDate' }, |
|
|
|
{ dispLabel: '卡主姓名', val: 'customerName' }, |
|
|
|
{ dispLabel: '卡主身份证号', val: 'idNo' }, |
|
|
|
{ dispLabel: '卡主电话', val: 'telephone' }, |
|
|
|
{ dispLabel: '卡主手机号', val: 'mobileTelephone' }, |
|
|
|
{ dispLabel: '备注', val: 'remark' }, |
|
|
|
//{ dispLabel: '支付方式', val: 'payTypeFlag' }, |
|
|
|
], |
|
|
|
|
|
|
|
workBook: null, //EXCEL 工作薄 |
|
|
|
sheetNames: [], //EXCEL 工作薄中的表单 {sheetName:} |
|
|
|
readDataOpts: { |
|
|
|
file: '', //选中的文件名 |
|
|
|
sheetNameChoosed: '', //当前选中的表格 |
|
|
|
titleRow: 1, //标题行 |
|
|
|
}, |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
|
@ -893,7 +1032,7 @@ export default { |
|
|
|
|
|
|
|
loadQuery() { |
|
|
|
let body = this.getQueryBody() |
|
|
|
if (Number(this.loadOpts.skipCount) * Number(this.loadOpts.maxResultCount||100) >= Number(this.loadOpts.totalCount)) { |
|
|
|
if (Number(this.loadOpts.skipCount) * Number(this.loadOpts.maxResultCount || 100) >= Number(this.loadOpts.totalCount)) { |
|
|
|
this.$message.warning({ showClose: true, message: '没有更多的数据可拉取' }) |
|
|
|
return |
|
|
|
} |
|
|
|
@ -910,6 +1049,370 @@ export default { |
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 导入建卡按钮 |
|
|
|
btnImportCard(){ |
|
|
|
this.$message.warning({showClose:true,message:'调试中,敬请期待……'}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 导入建卡 -- 确定导入 |
|
|
|
btnImportCardOK(){ |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//导入完后,导入状态显示 |
|
|
|
importRowClassName({ row, rowIndex }) { |
|
|
|
if (row.importState == '导入失败') { |
|
|
|
return "danger"; |
|
|
|
} else { |
|
|
|
return ""; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//多选 颜色标记 |
|
|
|
handleRowClassName({ row, rowIndex }) { |
|
|
|
if (row.choosed) { |
|
|
|
return "current-row"; |
|
|
|
} else { |
|
|
|
return ""; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//清除所选文件 |
|
|
|
fileGetFocus(e) { |
|
|
|
console.log('fileGetFocus(e)', e) |
|
|
|
e.value = '' //未起作用的 |
|
|
|
// e.target.files = [] |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取选择的文件 |
|
|
|
changeFileChoose(e) { |
|
|
|
if (e.target.files.length <= 0) return; |
|
|
|
// console.log('file',e.target.files[0]) |
|
|
|
this.readDataOpts.file = e.target.files[0]; |
|
|
|
// 调用导入Excel文件的方法 |
|
|
|
// File {name: 'vulkan-1.dll', |
|
|
|
// console.log('file',file,file.type) |
|
|
|
let fileName = this.readDataOpts.file.name.split('.') |
|
|
|
let fileNameExt = fileName[fileName.length - 1].toLowerCase() |
|
|
|
if (fileNameExt != 'xls' && fileNameExt != 'xlsx') { |
|
|
|
this.$message.warning("你选的文件可能不是标准的Excel文件!") |
|
|
|
} |
|
|
|
this.readFile(this.readDataOpts.file); |
|
|
|
}, |
|
|
|
|
|
|
|
//sheetjs 读取文件 |
|
|
|
readFile(file) { |
|
|
|
const reader = new FileReader(); |
|
|
|
|
|
|
|
// reader.readAsArrayBuffer(file); |
|
|
|
// 定义读取文件 |
|
|
|
reader.onload = (e) => { |
|
|
|
let data = e.target.result; |
|
|
|
// let typedArray = new Uint8Array(data); |
|
|
|
// var workBook = read(typedArray,{type:'array'}) |
|
|
|
// this.workBook = read(data,{type:'binary',cellDates:true}) //日期将转成 标准 日期格式,显示会 undefined |
|
|
|
this.workBook = read(data, { type: 'binary' }) |
|
|
|
// var workBook = readFile(file); //后端读法 |
|
|
|
|
|
|
|
this.sheetNames = [] |
|
|
|
this.workBook.SheetNames.forEach(e => { |
|
|
|
this.sheetNames.push({ sheetName: e }) |
|
|
|
}) |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs['sheetNames'].setCurrentRow(this.sheetNames[0]); |
|
|
|
this.chooseSheetName(this.sheetNames[0]) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
// 错误处理 |
|
|
|
reader.onerror = function (event) { |
|
|
|
// 读取失败时执行的代码 |
|
|
|
console.error("File could not be read!" + event.target.error); |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
reader.readAsBinaryString(file); |
|
|
|
}, |
|
|
|
|
|
|
|
//选择要导入的Excel表单名 |
|
|
|
chooseSheetName(row) { |
|
|
|
this.readDataOpts.sheetNameChoosed = row.sheetName |
|
|
|
}, |
|
|
|
|
|
|
|
//读取数据 |
|
|
|
readData() { |
|
|
|
let ret = 1 |
|
|
|
if (!this.readDataOpts.file || !this.workBook || !this.readDataOpts.sheetNameChoosed) { |
|
|
|
this.$message.warning("请选择文件及要导入的表格") |
|
|
|
return 0 |
|
|
|
} |
|
|
|
|
|
|
|
if (this.readDataOpts.titleRow <= 0) { |
|
|
|
this.$message.warning("标题行不能小于1") |
|
|
|
return 0 |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let worksheet = this.workBook.Sheets[this.readDataOpts.sheetNameChoosed]; |
|
|
|
|
|
|
|
//分析标题信息 |
|
|
|
let head = utils.sheet_to_json(worksheet, { header: 1 }); |
|
|
|
|
|
|
|
this.excelCols = [] |
|
|
|
head[this.readDataOpts.titleRow - 1].forEach(e => { |
|
|
|
let lfind = arrayExistObj(this.dataCols, 'dispTitle', e), val = '', dataLabel = ''; |
|
|
|
if (lfind > -1) { |
|
|
|
val = this.dataCols[lfind].val |
|
|
|
dataLabel = this.dataCols[lfind].dataLabel |
|
|
|
} |
|
|
|
this.excelCols.push({ |
|
|
|
dispLabel: e, |
|
|
|
val, |
|
|
|
dataLabel |
|
|
|
}) |
|
|
|
}) |
|
|
|
//console.log('head,',head,this.excelCols) |
|
|
|
|
|
|
|
this.excelData = utils.sheet_to_json(worksheet, { raw: false, range: this.readDataOpts.titleRow - 1 }); //raw:false,range:1 从第1行开始读取 |
|
|
|
this.excelData.forEach((e, index) => { |
|
|
|
e.choosed = false; |
|
|
|
e.index = index; |
|
|
|
e.id = 'excelData' + index; |
|
|
|
|
|
|
|
}); |
|
|
|
//console.log('this.excelCols',this.excelCols) |
|
|
|
// console.log('sheet_to_json excelData',this.excelData) |
|
|
|
|
|
|
|
// 导入后,批量分析Excel列 与 数据字段 的匹配关系 |
|
|
|
this.parseExcelData() |
|
|
|
|
|
|
|
return ret |
|
|
|
}, |
|
|
|
|
|
|
|
//选择要导入的数据 |
|
|
|
chooseDataImport(row) { |
|
|
|
// console.log("this.excelData",this.excelData); |
|
|
|
|
|
|
|
// 按住了shift键 |
|
|
|
if (this.window.shift) { |
|
|
|
//清除所有选择 |
|
|
|
this.excelData.forEach((e, index) => { |
|
|
|
e.choosed = false; |
|
|
|
e.index = index; |
|
|
|
}); |
|
|
|
|
|
|
|
if (this.startPoint == -1) { |
|
|
|
this.excelData[row.index].choosed = true; |
|
|
|
this.startPoint = row.index; |
|
|
|
} else { |
|
|
|
if (this.startPoint > row.index) { |
|
|
|
for (let i = row.index; i <= this.startPoint; i++) { |
|
|
|
this.excelData[i].choosed = true; |
|
|
|
} |
|
|
|
} else if (this.startPoint <= row.index) { |
|
|
|
for (let i = this.startPoint; i <= row.index; i++) { |
|
|
|
this.excelData[i].choosed = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} else if (this.window.ctrl) { // 按住了ctrl 键 |
|
|
|
this.excelData[row.index].choosed = true; |
|
|
|
if (this.startPoint == -1) { |
|
|
|
this.startPoint = row.index; |
|
|
|
} |
|
|
|
} else { |
|
|
|
// 未按住了ctrl 、shift 键 |
|
|
|
//清除所有选择 |
|
|
|
console.log("清除所有选择"); |
|
|
|
this.excelData.forEach((e, index) => { |
|
|
|
e.choosed = false; |
|
|
|
e.index = index; |
|
|
|
}); |
|
|
|
// console.log(this.excelData,row.index); |
|
|
|
// console.log(this.excelData[row.index].choosed); |
|
|
|
|
|
|
|
this.excelData[row.index].choosed = true; |
|
|
|
this.startPoint = row.index; |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 全选(取消全选) |
|
|
|
btnChoose(refName, type) { |
|
|
|
let choosed = false |
|
|
|
if (type && type == 'all') { |
|
|
|
choosed = true |
|
|
|
} |
|
|
|
this[refName].forEach(e => { |
|
|
|
e.choosed = choosed |
|
|
|
if (choosed) { |
|
|
|
this.$refs[refName].setCurrentRow(e) |
|
|
|
} |
|
|
|
}) |
|
|
|
|
|
|
|
if (!choosed) { |
|
|
|
this.$refs[refName].setCurrentRow() |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//右击标题 |
|
|
|
headerContextmenu(column, event) { |
|
|
|
let chooseCol = column.minWidth - 100 |
|
|
|
let items = [] //菜单 |
|
|
|
|
|
|
|
this.dataCols.forEach(e => { |
|
|
|
items.push({ |
|
|
|
label: e.dispLabel, |
|
|
|
onClick: () => { |
|
|
|
this.setColumn(chooseCol, e) |
|
|
|
}, |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
//右击显示的菜单 |
|
|
|
this.$contextmenu({ |
|
|
|
items, |
|
|
|
event, |
|
|
|
//x: event.clientX, |
|
|
|
//y: event.clientY, |
|
|
|
customClass: "custom-class", |
|
|
|
zIndex: 30000, //够大再能在最上面显示 |
|
|
|
minWidth: 80, |
|
|
|
height: 20 |
|
|
|
}); |
|
|
|
|
|
|
|
return false; |
|
|
|
}, |
|
|
|
|
|
|
|
//设置真实数据字段列 |
|
|
|
setColumn(oldColNum, newColObj) { |
|
|
|
// console.log('oldColNum,newColObj',oldColNum,newColObj) |
|
|
|
//如果数据字段已设置过,则将之前设置的先清空 |
|
|
|
if (newColObj.dispLabel != "不设置") { |
|
|
|
let lfind = arrayExistObj(this.excelCols, 'dataLabel', newColObj.dispLabel) |
|
|
|
if (lfind > -1) { |
|
|
|
this.excelCols[lfind].dataLabel = '' |
|
|
|
this.excelCols[lfind].val = '' |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
this.excelCols[oldColNum].dataLabel = newColObj.dispLabel |
|
|
|
this.excelCols[oldColNum].val = newColObj.val |
|
|
|
// console.log('newColObj.val',newColObj.val) |
|
|
|
let tempDate = '' |
|
|
|
if (newColObj.val == 'birthDate') { |
|
|
|
this.excelData.forEach(e => { |
|
|
|
tempDate = e[this.excelCols[oldColNum].dispLabel] |
|
|
|
// console.log('birthDate',tempDate) |
|
|
|
e[this.excelCols[oldColNum].dispLabel] = tempDate ? moment(new Date(tempDate)).format('yyyy-MM-DD') : '' |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 选择EXCEL文件后,批量分析Excel列 与 数据字段 的匹配关系 |
|
|
|
parseExcelData() { |
|
|
|
let lfind = -1 |
|
|
|
this.excelCols.forEach((e, i) => { |
|
|
|
lfind = arrayExistObj(this.dataCols, 'dispLabel', e.dispLabel) |
|
|
|
if (lfind > -1) this.setColumn(i, this.dataCols[lfind]) |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
// 确定导入数据库 |
|
|
|
btnImport() { |
|
|
|
if (!this.customerOrgIds || this.customerOrgIds.length == 0) { |
|
|
|
this.$message.warning("请选择单位") |
|
|
|
return |
|
|
|
} |
|
|
|
if (!this.customerOrgRegister || !this.customerOrgRegister.id) { |
|
|
|
this.$message.warning("请选择单位体检次数") |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.elProgress.display = true; |
|
|
|
this.elProgress.percentage = 0; |
|
|
|
|
|
|
|
this.importCols = [] |
|
|
|
this.excelCols.forEach(e => { |
|
|
|
if (e.val) { |
|
|
|
this.importCols.push(e) |
|
|
|
} |
|
|
|
}) |
|
|
|
this.tableData = [] // 记录导入后结果状态 |
|
|
|
this.choosedData = [] //选中待导入的数据 |
|
|
|
this.excelData.forEach(e => { |
|
|
|
if (e.choosed) this.choosedData.push(e) |
|
|
|
}); |
|
|
|
|
|
|
|
//导入进行中 |
|
|
|
this.importing(this.dataImportOpts.startRow, this.dataImportOpts.nameType) |
|
|
|
// 开始导入时,清除选择的 文件 |
|
|
|
document.getElementById('fileNames').value = ''; |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//导入进行时 |
|
|
|
// startRow : 从第几行开始导入,同名判断交互时,续接导入 |
|
|
|
// startRowNameType : 续接导入的第1行,执行 同名判断模式, 3.不提示,按新人导入(前端不用管) |
|
|
|
async importing(startRow, startRowNameType) { |
|
|
|
let body = {} |
|
|
|
for (let i = startRow; i < this.choosedData.length; i++) { |
|
|
|
this.elProgress.percentage = Math.floor( |
|
|
|
((i + 1) * 100) / this.choosedData.length |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
// 将Excel的数据转换成接口的数据 |
|
|
|
body = this.excelDataToApiBody(this.choosedData[i]) |
|
|
|
if (i == startRow) body.nameType = startRowNameType |
|
|
|
console.log(`this.choosedData[${i}],startRowNameType,body`) |
|
|
|
|
|
|
|
try { |
|
|
|
// 同一人判断 |
|
|
|
if (this.choosedSameMan.patientNo) { |
|
|
|
// 上一次循环已经判断是否同一人,此次循环不需再判断了 |
|
|
|
if (this.choosedSameMan.patientNo == '$newPatient$') { |
|
|
|
body.nameType = '3' |
|
|
|
} else { |
|
|
|
body.patientNo = this.choosedSameMan.patientNo |
|
|
|
} |
|
|
|
} else if (startRowNameType != '3') { |
|
|
|
let result = await this.isSamePatient(startRowNameType, body) |
|
|
|
if (result.isContinue) { |
|
|
|
if (result.err) { |
|
|
|
this.tableData.push(Object.assign({ importState: '导入失败', importDes: result.err }, this.choosedData[i])) |
|
|
|
continue |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.dataImportOpts.startRow = i |
|
|
|
break; // 跳出循环,重新从 i 开执行 this.importing |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 旧接口:/api/app/patientregister/createpatientregisterexcel |
|
|
|
let res = await postapi('/api/app/patientregister/CreatePatientRegisterFromExcel', body) |
|
|
|
this.choosedSameMan = {} // 清除选择同一人员的记录 |
|
|
|
if (res.code >= 0) { |
|
|
|
this.tableData.push(Object.assign({ importState: '导入成功' }, this.choosedData[i])) |
|
|
|
} else { |
|
|
|
this.tableData.push(Object.assign({ importState: '导入失败', importDes: res.message }, this.choosedData[i])) |
|
|
|
} |
|
|
|
} catch (error) { |
|
|
|
this.tableData.push(Object.assign({ importState: '导入失败', importDes: `${error}` }, this.choosedData[i])) |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 结束导入 |
|
|
|
if (i == this.choosedData.length - 1) { |
|
|
|
this.elProgress.display = false; |
|
|
|
this.seq = -1 |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//监听事件 |
|
|
|
|