|
|
@ -217,7 +217,7 @@ |
|
|
<el-button class="commonbutton" @click="refund">退费</el-button> |
|
|
<el-button class="commonbutton" @click="refund">退费</el-button> |
|
|
</div> |
|
|
</div> |
|
|
<div style="margin-top: 10px"> |
|
|
<div style="margin-top: 10px"> |
|
|
<a :underline="false" href="/files/单位体检人员名单导入模板.xlsx"> |
|
|
|
|
|
|
|
|
<a :underline="false" href="/files/会员卡导入模板.xls"> |
|
|
<el-button class="commonbutton" style="font-size: 12px">下载建卡模板</el-button> |
|
|
<el-button class="commonbutton" style="font-size: 12px">下载建卡模板</el-button> |
|
|
</a> |
|
|
</a> |
|
|
</div> |
|
|
</div> |
|
|
@ -483,12 +483,41 @@ |
|
|
</div> |
|
|
</div> |
|
|
</span> |
|
|
</span> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 通用进度条 --> |
|
|
|
|
|
<el-dialog title="数据处理中……" :visible.sync="elProgress.display" width="700px" height="400" :show-close="false" |
|
|
|
|
|
:close-on-click-modal="false" :append-to-body="true"> |
|
|
|
|
|
<ElProgressOCX /> |
|
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<!--导入状态导出--> |
|
|
|
|
|
<div v-show="false" id="tableExport"> |
|
|
|
|
|
<el-table :data="tableData" width="100%" row-key="cardNo" border> |
|
|
|
|
|
<el-table-column type="index" label="序号" width="50" align="center" /> |
|
|
|
|
|
|
|
|
|
|
|
<el-table-column prop="importState" label="导入状态" align="center" /> |
|
|
|
|
|
<el-table-column prop="importDes" label="失败原因" align="center" /> |
|
|
|
|
|
<el-table-column prop="cardTypeName" label="卡类别" align="center" /> |
|
|
|
|
|
<el-table-column prop="cardNo" label="会员卡号" align="center" /> |
|
|
|
|
|
<el-table-column prop="discount" label="折扣率" align="center" /> |
|
|
|
|
|
<el-table-column prop="cardBalance" label="初始金额" align="center" /> |
|
|
|
|
|
<el-table-column prop="payModeName" label="充值方式" align="center" /> |
|
|
|
|
|
|
|
|
|
|
|
<el-table-column prop="expiryDate" label="有效期限" align="center" /> |
|
|
|
|
|
<el-table-column prop="customerName" label="卡主姓名" align="center" /> |
|
|
|
|
|
<el-table-column prop="idNo" label="卡主身份证号" align="center" /> |
|
|
|
|
|
<el-table-column prop="telephone" label="卡主电话" align="center" /> |
|
|
|
|
|
<el-table-column prop="mobileTelephone" label="卡主手机号" align="center" /> |
|
|
|
|
|
<el-table-column prop="remark" label="备注" align="center" /> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
<script> |
|
|
<script> |
|
|
import moment from "moment"; |
|
|
import moment from "moment"; |
|
|
import { mapState, mapActions } from "vuex"; |
|
|
import { mapState, mapActions } from "vuex"; |
|
|
|
|
|
import FileSaver from "file-saver"; |
|
|
import { read, readFile, utils } from "xlsx"; |
|
|
import { read, readFile, utils } from "xlsx"; |
|
|
import { getapi, postapi, putapi, deletapi } from "@/api/api"; |
|
|
import { getapi, postapi, putapi, deletapi } from "@/api/api"; |
|
|
import { |
|
|
import { |
|
|
@ -641,11 +670,11 @@ export default { |
|
|
|
|
|
|
|
|
dataCols: [ |
|
|
dataCols: [ |
|
|
{ dispLabel: "不设置", val: "" }, |
|
|
{ dispLabel: "不设置", val: "" }, |
|
|
{ dispLabel: "卡类别", val: "cardTypeId" }, |
|
|
|
|
|
|
|
|
{ dispLabel: "卡类别", val: "cardTypeName" }, |
|
|
{ dispLabel: "会员卡号", val: "cardNo" }, |
|
|
{ dispLabel: "会员卡号", val: "cardNo" }, |
|
|
{ dispLabel: "折扣率", val: "discount" }, |
|
|
{ dispLabel: "折扣率", val: "discount" }, |
|
|
{ dispLabel: "初始金额", val: "cardBalance" }, |
|
|
{ dispLabel: "初始金额", val: "cardBalance" }, |
|
|
{ dispLabel: "充值方式", val: "payMode" }, |
|
|
|
|
|
|
|
|
{ dispLabel: "充值方式", val: "payModeName" }, |
|
|
{ dispLabel: "有效期限", val: "expiryDate" }, |
|
|
{ dispLabel: "有效期限", val: "expiryDate" }, |
|
|
{ dispLabel: "卡主姓名", val: "customerName" }, |
|
|
{ dispLabel: "卡主姓名", val: "customerName" }, |
|
|
{ dispLabel: "卡主身份证号", val: "idNo" }, |
|
|
{ dispLabel: "卡主身份证号", val: "idNo" }, |
|
|
@ -655,6 +684,7 @@ export default { |
|
|
//{ dispLabel: '支付方式', val: 'payTypeFlag' }, |
|
|
//{ dispLabel: '支付方式', val: 'payTypeFlag' }, |
|
|
], |
|
|
], |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
workBook: null, //EXCEL 工作薄 |
|
|
workBook: null, //EXCEL 工作薄 |
|
|
sheetNames: [], //EXCEL 工作薄中的表单 {sheetName:} |
|
|
sheetNames: [], //EXCEL 工作薄中的表单 {sheetName:} |
|
|
readDataOpts: { |
|
|
readDataOpts: { |
|
|
@ -667,6 +697,7 @@ export default { |
|
|
startRow: 0, //从 excelData 的第几行开始导入 |
|
|
startRow: 0, //从 excelData 的第几行开始导入 |
|
|
}, |
|
|
}, |
|
|
dataImportOptsInit: {}, |
|
|
dataImportOptsInit: {}, |
|
|
|
|
|
tableData: [], // 批量建卡状态数据 |
|
|
|
|
|
|
|
|
jsonFields: { |
|
|
jsonFields: { |
|
|
卡类别: "cardTypeId", |
|
|
卡类别: "cardTypeId", |
|
|
@ -761,6 +792,7 @@ export default { |
|
|
"会员卡列表" + moment(new Date()).format("yyyyMMDDHHmmss") + ".xls"; |
|
|
"会员卡列表" + moment(new Date()).format("yyyyMMDDHHmmss") + ".xls"; |
|
|
return tableDatas; |
|
|
return tableDatas; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
handleSelectionChange(val) { |
|
|
handleSelectionChange(val) { |
|
|
this.multipleSelection = val; |
|
|
this.multipleSelection = val; |
|
|
}, |
|
|
}, |
|
|
@ -1121,9 +1153,6 @@ export default { |
|
|
|
|
|
|
|
|
// 导入建卡 -- 确定导入 |
|
|
// 导入建卡 -- 确定导入 |
|
|
btnImportCardOK() { |
|
|
btnImportCardOK() { |
|
|
this.elProgress.display = true; |
|
|
|
|
|
this.elProgress.percentage = 0; |
|
|
|
|
|
|
|
|
|
|
|
this.importCols = [] |
|
|
this.importCols = [] |
|
|
this.excelCols.forEach(e => { |
|
|
this.excelCols.forEach(e => { |
|
|
if (e.val) { |
|
|
if (e.val) { |
|
|
@ -1136,10 +1165,19 @@ export default { |
|
|
if (e.choosed) this.choosedData.push(e) |
|
|
if (e.choosed) this.choosedData.push(e) |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
if (this.choosedData.length == 0) { |
|
|
|
|
|
this.$message.warning({ showClose: true, message: '请选中要导入的记录' }) |
|
|
|
|
|
return |
|
|
|
|
|
} else { |
|
|
|
|
|
this.elProgress.display = true; |
|
|
|
|
|
this.elProgress.percentage = 0; |
|
|
//导入进行中 |
|
|
//导入进行中 |
|
|
this.importing(this.dataImportOpts.startRow) |
|
|
this.importing(this.dataImportOpts.startRow) |
|
|
// 开始导入时,清除选择的 文件 |
|
|
// 开始导入时,清除选择的 文件 |
|
|
document.getElementById('fileNames').value = ''; |
|
|
document.getElementById('fileNames').value = ''; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
//导入完后,导入状态显示 |
|
|
//导入完后,导入状态显示 |
|
|
@ -1499,6 +1537,9 @@ export default { |
|
|
|
|
|
|
|
|
async importing(startRow) { |
|
|
async importing(startRow) { |
|
|
let body = {}; |
|
|
let body = {}; |
|
|
|
|
|
let medicalCenterId = window.sessionStorage.getItem('peisid') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (let i = startRow; i < this.choosedData.length; i++) { |
|
|
for (let i = startRow; i < this.choosedData.length; i++) { |
|
|
this.elProgress.percentage = Math.floor( |
|
|
this.elProgress.percentage = Math.floor( |
|
|
((i + 1) * 100) / this.choosedData.length |
|
|
((i + 1) * 100) / this.choosedData.length |
|
|
@ -1506,14 +1547,14 @@ export default { |
|
|
|
|
|
|
|
|
// 将Excel的数据转换成接口的数据 |
|
|
// 将Excel的数据转换成接口的数据 |
|
|
body = this.excelDataToApiBody(this.choosedData[i]); |
|
|
body = this.excelDataToApiBody(this.choosedData[i]); |
|
|
|
|
|
body.medicalCenterId = medicalCenterId |
|
|
console.log(`this.choosedData[${i}],startRowNameType,body`, body); |
|
|
console.log(`this.choosedData[${i}],startRowNameType,body`, body); |
|
|
|
|
|
|
|
|
try { |
|
|
try { |
|
|
let res={code:0} |
|
|
|
|
|
// let res = await postapi( |
|
|
|
|
|
// "/api/app/patientregister/CreatePatientRegisterFromExcel", |
|
|
|
|
|
// body |
|
|
|
|
|
// ); |
|
|
|
|
|
|
|
|
let res = await postapi( |
|
|
|
|
|
"/api/app/CardRegister/BatchCreateCardRegisterByExcel", |
|
|
|
|
|
body |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
if (res.code >= 0) { |
|
|
if (res.code >= 0) { |
|
|
this.tableData.push( |
|
|
this.tableData.push( |
|
|
@ -1542,7 +1583,8 @@ export default { |
|
|
this.seq = -1; |
|
|
this.seq = -1; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
console.log('this.tableData',this.tableData) |
|
|
|
|
|
|
|
|
//console.log('this.tableData',this.tableData) |
|
|
|
|
|
this.exportImportState("tableExport", "批量建卡") |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
//将Excel的数据转换成接口的数据 |
|
|
//将Excel的数据转换成接口的数据 |
|
|
@ -1560,6 +1602,22 @@ export default { |
|
|
return body |
|
|
return body |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 将批量建卡状态导出 |
|
|
|
|
|
exportImportState(elId, title) { |
|
|
|
|
|
|
|
|
|
|
|
// let table = this.$refs["tableExport"] //.cloneNode(true) true |
|
|
|
|
|
let table = document.getElementById(elId) |
|
|
|
|
|
// console.log('table,refsTable', table, refsTable) |
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
let tableData = table.innerHTML |
|
|
|
|
|
let fileName = title + moment(new Date()).format('yyyyMMDDHHmmss') |
|
|
|
|
|
|
|
|
|
|
|
let blob = new Blob([tableData], { type: "text/plain;charset=utf-8" }); |
|
|
|
|
|
|
|
|
|
|
|
FileSaver.saveAs(blob, fileName + '.xls'); |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
// 表格行底色样式 |
|
|
// 表格行底色样式 |
|
|
tableRowClassName({ row, rowIndex }) { |
|
|
tableRowClassName({ row, rowIndex }) { |
|
|
if (row.isActive == 'N') { |
|
|
if (row.isActive == 'N') { |
|
|
|