|
|
@ -75,9 +75,9 @@ |
|
|
<el-table :data="dataList" ref="info" id="info" width="100%" :height="window.pageHeight < 600 |
|
|
<el-table :data="dataList" ref="info" id="info" width="100%" :height="window.pageHeight < 600 |
|
|
? 210 |
|
|
? 210 |
|
|
: Math.floor((window.pageHeight - 340) / 2) |
|
|
: Math.floor((window.pageHeight - 340) / 2) |
|
|
" row-key="id" highlight-current-row @selection-change="handleSelectionChange" @row-click="rowClick" |
|
|
|
|
|
:row-class-name="tableRowClassName" :row-style="{height:'28px'}" border> |
|
|
|
|
|
<el-table-column type="index" label="序号" width="50" align="center"/> |
|
|
|
|
|
|
|
|
" row-key="id" highlight-current-row @selection-change="handleSelectionChange" @row-click="rowClick" |
|
|
|
|
|
:row-class-name="tableRowClassName" :row-style="{ height: '28px' }" border> |
|
|
|
|
|
<el-table-column type="index" label="序号" width="50" align="center" /> |
|
|
<el-table-column prop="cardTypeId" label="卡类别" width="70" sortable align="center"> |
|
|
<el-table-column prop="cardTypeId" label="卡类别" width="70" sortable align="center"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<div> |
|
|
<div> |
|
|
@ -92,8 +92,8 @@ |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column prop="cardNo" label="会员卡号" width="150" sortable align="center"/> |
|
|
|
|
|
<el-table-column prop="discount" label="折扣率" width="80" sortable align="center"/> |
|
|
|
|
|
|
|
|
<el-table-column prop="cardNo" label="会员卡号" width="150" sortable align="center" /> |
|
|
|
|
|
<el-table-column prop="discount" label="折扣率" width="80" sortable align="center" /> |
|
|
<el-table-column prop="cardBalance" label="卡余额" width="80" sortable align="center"> |
|
|
<el-table-column prop="cardBalance" label="卡余额" width="80" sortable align="center"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<div style="color: red;"> |
|
|
<div style="color: red;"> |
|
|
@ -108,17 +108,19 @@ |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column prop="customerName" label="卡主姓名" width="100" sortable align="center" show-overflow-tooltip/> |
|
|
|
|
|
<el-table-column prop="idNo" label="卡主身份证号" width="200" sortable align="center" show-overflow-tooltip/> |
|
|
|
|
|
<el-table-column prop="telephone" label="卡主电话" width="150" sortable align="center" show-overflow-tooltip/> |
|
|
|
|
|
<el-table-column prop="mobileTelephone" label="卡主手机号" width="150" sortable align="center" show-overflow-tooltip/> |
|
|
|
|
|
|
|
|
<el-table-column prop="customerName" label="卡主姓名" width="100" sortable align="center" |
|
|
|
|
|
show-overflow-tooltip /> |
|
|
|
|
|
<el-table-column prop="idNo" label="卡主身份证号" width="200" sortable align="center" show-overflow-tooltip /> |
|
|
|
|
|
<el-table-column prop="telephone" label="卡主电话" width="150" sortable align="center" show-overflow-tooltip /> |
|
|
|
|
|
<el-table-column prop="mobileTelephone" label="卡主手机号" width="150" sortable align="center" |
|
|
|
|
|
show-overflow-tooltip /> |
|
|
<el-table-column prop="isActive" label="启用" width="60" sortable align="center"> |
|
|
<el-table-column prop="isActive" label="启用" width="60" sortable align="center"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<div>{{ scope.row.isActive == "N" ? "否" : "是" }}</div> |
|
|
<div>{{ scope.row.isActive == "N" ? "否" : "是" }}</div> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column prop="remark" label="备注" width="200" sortable /> |
|
|
<el-table-column prop="remark" label="备注" width="200" sortable /> |
|
|
<el-table-column prop="creatorName" label="创建人员" width="90" sortable align="center"/> |
|
|
|
|
|
|
|
|
<el-table-column prop="creatorName" label="创建人员" width="90" sortable align="center" /> |
|
|
<el-table-column prop="creationTime" label="创建日期" width="100" sortable align="center"> |
|
|
<el-table-column prop="creationTime" label="创建日期" width="100" sortable align="center"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<div v-if="scope.row.creationTime"> |
|
|
<div v-if="scope.row.creationTime"> |
|
|
@ -126,7 +128,7 @@ |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column prop="lastModifierName" label="修改人员" width="90" sortable align="center"/> |
|
|
|
|
|
|
|
|
<el-table-column prop="lastModifierName" label="修改人员" width="90" sortable align="center" /> |
|
|
<el-table-column prop="lastModificationTime" label="修改日期" width="100" sortable align="center"> |
|
|
<el-table-column prop="lastModificationTime" label="修改日期" width="100" sortable align="center"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<div v-if="scope.row.lastModificationTime"> |
|
|
<div v-if="scope.row.lastModificationTime"> |
|
|
@ -152,9 +154,9 @@ |
|
|
? 210 |
|
|
? 210 |
|
|
: Math.floor((window.pageHeight - 300) / 2) |
|
|
: Math.floor((window.pageHeight - 300) / 2) |
|
|
" row-key="id" highlight-current-row ref="cardBillList" @selection-change="handleSelectionChange" border> |
|
|
" row-key="id" highlight-current-row ref="cardBillList" @selection-change="handleSelectionChange" border> |
|
|
<el-table-column type="index" label="序号" align="center" width="40"/> |
|
|
|
|
|
<el-table-column prop="patientRegisterNo" label="条码号" align="center"/> |
|
|
|
|
|
<el-table-column prop="patientName" label="姓名" align="center"/> |
|
|
|
|
|
|
|
|
<el-table-column type="index" label="序号" align="center" width="40" /> |
|
|
|
|
|
<el-table-column prop="patientRegisterNo" label="条码号" align="center" /> |
|
|
|
|
|
<el-table-column prop="patientName" label="姓名" align="center" /> |
|
|
<el-table-column prop="payModeId" label="支付方式" align="center"> |
|
|
<el-table-column prop="payModeId" label="支付方式" align="center"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<div> |
|
|
<div> |
|
|
@ -164,7 +166,7 @@ |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column prop="billMoney" label="记账金额" align="center"/> |
|
|
|
|
|
|
|
|
<el-table-column prop="billMoney" label="记账金额" align="center" /> |
|
|
<el-table-column prop="billFlag" label="记账标志" align="center"> |
|
|
<el-table-column prop="billFlag" label="记账标志" align="center"> |
|
|
<template slot-scope="scope"> |
|
|
<template slot-scope="scope"> |
|
|
<div> |
|
|
<div> |
|
|
@ -174,7 +176,7 @@ |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
</el-table-column> |
|
|
</el-table-column> |
|
|
<el-table-column prop="creatorName" label="操作人员" align="center"/> |
|
|
|
|
|
|
|
|
<el-table-column prop="creatorName" label="操作人员" align="center" /> |
|
|
<el-table-column prop="creationTime" label="操作日期" width="160" align="center" /> |
|
|
<el-table-column prop="creationTime" label="操作日期" width="160" align="center" /> |
|
|
<!-- |
|
|
<!-- |
|
|
<el-table-column prop="lastModifierName" label="修改人员" /> |
|
|
<el-table-column prop="lastModifierName" label="修改人员" /> |
|
|
@ -216,7 +218,7 @@ |
|
|
</div> |
|
|
</div> |
|
|
<div style="margin-top: 10px"> |
|
|
<div style="margin-top: 10px"> |
|
|
<a :underline="false" href="/files/单位体检人员名单导入模板.xlsx"> |
|
|
<a :underline="false" href="/files/单位体检人员名单导入模板.xlsx"> |
|
|
<el-button class="commonbutton" style="font-size: 12px">导入建卡模板</el-button> |
|
|
|
|
|
|
|
|
<el-button class="commonbutton" style="font-size: 12px">下载建卡模板</el-button> |
|
|
</a> |
|
|
</a> |
|
|
</div> |
|
|
</div> |
|
|
<div style="margin-top: 10px"> |
|
|
<div style="margin-top: 10px"> |
|
|
@ -487,6 +489,7 @@ |
|
|
<script> |
|
|
<script> |
|
|
import moment from "moment"; |
|
|
import moment from "moment"; |
|
|
import { mapState, mapActions } from "vuex"; |
|
|
import { mapState, mapActions } from "vuex"; |
|
|
|
|
|
import { read, readFile, utils } from "xlsx"; |
|
|
import { getapi, postapi, putapi, deletapi } from "@/api/api"; |
|
|
import { getapi, postapi, putapi, deletapi } from "@/api/api"; |
|
|
import { |
|
|
import { |
|
|
dddw, |
|
|
dddw, |
|
|
@ -495,9 +498,13 @@ import { |
|
|
arrayExistObj, |
|
|
arrayExistObj, |
|
|
deepCopy, |
|
|
deepCopy, |
|
|
} from "@/utlis/proFunc"; |
|
|
} from "@/utlis/proFunc"; |
|
|
|
|
|
import ElProgressOCX from "../../components/report/ElProgressOCX.vue"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
components: {}, |
|
|
|
|
|
|
|
|
components: { |
|
|
|
|
|
ElProgressOCX, |
|
|
|
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
peisid: null, |
|
|
peisid: null, |
|
|
@ -619,18 +626,13 @@ export default { |
|
|
|
|
|
|
|
|
// 批量导入 |
|
|
// 批量导入 |
|
|
dialogGroup: { |
|
|
dialogGroup: { |
|
|
mode: true, //选模式 10 开始 文件导入,20开始 从数据库中导入 |
|
|
|
|
|
|
|
|
//mode: true, //选模式 10 开始 文件导入,20开始 从数据库中导入 |
|
|
fileReadme: false, //导入EXCEL注意事项 |
|
|
fileReadme: false, //导入EXCEL注意事项 |
|
|
fileChoose: false, //选择文件 |
|
|
fileChoose: false, //选择文件 |
|
|
fileDataOpr: false, //文件数据分析操作 |
|
|
fileDataOpr: false, //文件数据分析操作 |
|
|
fileDataOpts: false, //文件数据导入前参数设定 |
|
|
|
|
|
|
|
|
|
|
|
query: false, //单位查询条件 |
|
|
|
|
|
oldMansChoose: false, //选择历史数据导入 |
|
|
|
|
|
oldMansOpts: false, //历史数据导入前参数设定 |
|
|
|
|
|
}, |
|
|
}, |
|
|
oldSeq: -2, //旧的步骤(辅助区分上一步,下一步) |
|
|
|
|
|
seq: -1, //当前显示窗口 |
|
|
|
|
|
|
|
|
seq: -1, //0 当前显示窗口 |
|
|
|
|
|
|
|
|
mode: "10", //模式 10 开始 文件导入,20开始 从数据库中导入 ,30 开始职业病 |
|
|
mode: "10", //模式 10 开始 文件导入,20开始 从数据库中导入 ,30 开始职业病 |
|
|
excelCols: [{ dispLabel: "", val: "", dataLabel: "" }], //excel数据列名 {dispLabel:'',val:'',dataLabel:''} |
|
|
excelCols: [{ dispLabel: "", val: "", dataLabel: "" }], //excel数据列名 {dispLabel:'',val:'',dataLabel:''} |
|
|
importCols: [], //实际导入的列(即有设置与 dataCols 匹配的列) |
|
|
importCols: [], //实际导入的列(即有设置与 dataCols 匹配的列) |
|
|
@ -642,11 +644,9 @@ export default { |
|
|
{ dispLabel: "卡类别", val: "cardTypeId" }, |
|
|
{ dispLabel: "卡类别", val: "cardTypeId" }, |
|
|
{ dispLabel: "会员卡号", val: "cardNo" }, |
|
|
{ dispLabel: "会员卡号", val: "cardNo" }, |
|
|
{ dispLabel: "折扣率", val: "discount" }, |
|
|
{ dispLabel: "折扣率", val: "discount" }, |
|
|
{ dispLabel: "初始余额", val: "cardBalance" }, |
|
|
|
|
|
|
|
|
{ dispLabel: "初始金额", val: "cardBalance" }, |
|
|
{ dispLabel: "充值方式", val: "payMode" }, |
|
|
{ dispLabel: "充值方式", val: "payMode" }, |
|
|
{ dispLabel: "性别", val: "expiryDate" }, |
|
|
|
|
|
{ dispLabel: "年龄", val: "age" }, |
|
|
|
|
|
{ dispLabel: "有效期限", val: "birthDate" }, |
|
|
|
|
|
|
|
|
{ dispLabel: "有效期限", val: "expiryDate" }, |
|
|
{ dispLabel: "卡主姓名", val: "customerName" }, |
|
|
{ dispLabel: "卡主姓名", val: "customerName" }, |
|
|
{ dispLabel: "卡主身份证号", val: "idNo" }, |
|
|
{ dispLabel: "卡主身份证号", val: "idNo" }, |
|
|
{ dispLabel: "卡主电话", val: "telephone" }, |
|
|
{ dispLabel: "卡主电话", val: "telephone" }, |
|
|
@ -662,6 +662,11 @@ export default { |
|
|
sheetNameChoosed: "", //当前选中的表格 |
|
|
sheetNameChoosed: "", //当前选中的表格 |
|
|
titleRow: 1, //标题行 |
|
|
titleRow: 1, //标题行 |
|
|
}, |
|
|
}, |
|
|
|
|
|
readDataOptsInit: {}, |
|
|
|
|
|
dataImportOpts: { |
|
|
|
|
|
startRow: 0, //从 excelData 的第几行开始导入 |
|
|
|
|
|
}, |
|
|
|
|
|
dataImportOptsInit: {}, |
|
|
|
|
|
|
|
|
jsonFields: { |
|
|
jsonFields: { |
|
|
卡类别: "cardTypeId", |
|
|
卡类别: "cardTypeId", |
|
|
@ -690,6 +695,9 @@ export default { |
|
|
this.formInit = deepCopy(this.form); |
|
|
this.formInit = deepCopy(this.form); |
|
|
|
|
|
|
|
|
this.loadOptsInit = Object.assign({}, this.loadOpts); |
|
|
this.loadOptsInit = Object.assign({}, this.loadOpts); |
|
|
|
|
|
|
|
|
|
|
|
this.readDataOptsInit = Object.assign({}, this.readDataOpts) |
|
|
|
|
|
this.dataImportOptsInit = Object.assign({}, this.dataImportOpts) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
//挂载完成 |
|
|
//挂载完成 |
|
|
@ -701,7 +709,7 @@ export default { |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
computed: { |
|
|
computed: { |
|
|
...mapState(["window", "dict"]), |
|
|
|
|
|
|
|
|
...mapState(["window", "dict", "elProgress"]), |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
...mapActions(["getCustomerOrgGroup", "getPatientRegisterAbs"]), |
|
|
...mapActions(["getCustomerOrgGroup", "getPatientRegisterAbs"]), |
|
|
@ -1109,13 +1117,29 @@ export default { |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 导入建卡按钮 |
|
|
|
|
|
btnImportCard() { |
|
|
|
|
|
this.$message.warning({ showClose: true, message: "调试中,敬请期待……" }); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 导入建卡 -- 确定导入 |
|
|
// 导入建卡 -- 确定导入 |
|
|
btnImportCardOK() { }, |
|
|
|
|
|
|
|
|
btnImportCardOK() { |
|
|
|
|
|
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) |
|
|
|
|
|
// 开始导入时,清除选择的 文件 |
|
|
|
|
|
document.getElementById('fileNames').value = ''; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
//导入完后,导入状态显示 |
|
|
//导入完后,导入状态显示 |
|
|
importRowClassName({ row, rowIndex }) { |
|
|
importRowClassName({ row, rowIndex }) { |
|
|
@ -1135,6 +1159,61 @@ export default { |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//清空进度数据数据 |
|
|
|
|
|
clearProcess() { |
|
|
|
|
|
this.dialogGroup.fileReadme = false |
|
|
|
|
|
this.dialogGroup.fileChoose = false |
|
|
|
|
|
this.dialogGroup.fileDataOpr = false |
|
|
|
|
|
|
|
|
|
|
|
let elo = document.getElementById('fileNames') |
|
|
|
|
|
if (elo) elo.value = ''; // 清空选择的文件 |
|
|
|
|
|
|
|
|
|
|
|
this.workBook = null //EXCEL 工作薄 |
|
|
|
|
|
this.sheetNames = [] //EXCEL 工作薄中的表单 {sheetName:} |
|
|
|
|
|
|
|
|
|
|
|
this.readDataOpts = Object.assign({}, this.readDataOptsInit) |
|
|
|
|
|
this.dataImportOpts = Object.assign({}, this.dataImportOptsInit) |
|
|
|
|
|
|
|
|
|
|
|
this.customerOrgIds = [] //选中单位节点 |
|
|
|
|
|
this.customerOrgRegisterList = [] //体检次数列表 |
|
|
|
|
|
this.customerOrgRegister = {} //体检次数 |
|
|
|
|
|
|
|
|
|
|
|
this.startPoint = -1 // 多选起点 -1 表示未选择 |
|
|
|
|
|
this.endPoint = -1 // 多选终点 -1 表示未选择 |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 导入过程 上一步,下一步 |
|
|
|
|
|
btnProcess(seq) { |
|
|
|
|
|
// console.log('keys',keys) |
|
|
|
|
|
switch (seq) { |
|
|
|
|
|
|
|
|
|
|
|
case 0: |
|
|
|
|
|
//显示 选择导入方式 |
|
|
|
|
|
this.dialogGroup.fileReadme = true |
|
|
|
|
|
this.excelCols = [] |
|
|
|
|
|
this.tableData = [] |
|
|
|
|
|
this.prList = [] |
|
|
|
|
|
this.startPoint = -1 // 多选起点 -1 表示未选择 |
|
|
|
|
|
this.endPoint = -1 // 多选终点 -1 表示未选择 |
|
|
|
|
|
break; |
|
|
|
|
|
case 1: |
|
|
|
|
|
this.dialogGroup.fileReadme = false |
|
|
|
|
|
this.dialogGroup.fileChoose = true |
|
|
|
|
|
break; |
|
|
|
|
|
case 2: |
|
|
|
|
|
this.readData() //读取数据 |
|
|
|
|
|
this.dialogGroup.fileChoose = false |
|
|
|
|
|
this.dialogGroup.fileDataOpr = true |
|
|
|
|
|
break; |
|
|
|
|
|
default: |
|
|
|
|
|
//关闭所有弹窗 |
|
|
|
|
|
this.clearProcess() |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
//清除所选文件 |
|
|
//清除所选文件 |
|
|
fileGetFocus(e) { |
|
|
fileGetFocus(e) { |
|
|
console.log("fileGetFocus(e)", e); |
|
|
console.log("fileGetFocus(e)", e); |
|
|
@ -1246,7 +1325,7 @@ export default { |
|
|
e.id = "excelData" + index; |
|
|
e.id = "excelData" + index; |
|
|
}); |
|
|
}); |
|
|
//console.log('this.excelCols',this.excelCols) |
|
|
//console.log('this.excelCols',this.excelCols) |
|
|
// console.log('sheet_to_json excelData',this.excelData) |
|
|
|
|
|
|
|
|
console.log('sheet_to_json excelData',this.excelData) |
|
|
|
|
|
|
|
|
// 导入后,批量分析Excel列 与 数据字段 的匹配关系 |
|
|
// 导入后,批量分析Excel列 与 数据字段 的匹配关系 |
|
|
this.parseExcelData(); |
|
|
this.parseExcelData(); |
|
|
@ -1368,66 +1447,56 @@ export default { |
|
|
this.excelCols[oldColNum].dataLabel = newColObj.dispLabel; |
|
|
this.excelCols[oldColNum].dataLabel = newColObj.dispLabel; |
|
|
this.excelCols[oldColNum].val = newColObj.val; |
|
|
this.excelCols[oldColNum].val = newColObj.val; |
|
|
// console.log('newColObj.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") |
|
|
|
|
|
: ""; |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
let tempVal = ""; |
|
|
|
|
|
|
|
|
|
|
|
// 数据转换 |
|
|
|
|
|
switch (newColObj.val) { |
|
|
|
|
|
case "birthDate": |
|
|
|
|
|
case "expiryDate": |
|
|
|
|
|
this.excelData.forEach((e) => { |
|
|
|
|
|
tempVal = e[this.excelCols[oldColNum].dispLabel]; |
|
|
|
|
|
e[this.excelCols[oldColNum].dispLabel] = tempVal |
|
|
|
|
|
? moment(new Date(tempVal)).format("yyyy-MM-DD") |
|
|
|
|
|
: ""; |
|
|
|
|
|
}); |
|
|
|
|
|
break; |
|
|
|
|
|
case "discount": |
|
|
|
|
|
this.excelData.forEach((e) => { |
|
|
|
|
|
tempVal = e[this.excelCols[oldColNum].dispLabel]; |
|
|
|
|
|
e[this.excelCols[oldColNum].dispLabel] = Number(tempVal)||100 |
|
|
|
|
|
}); |
|
|
|
|
|
break; |
|
|
|
|
|
case "cardBalance": |
|
|
|
|
|
this.excelData.forEach((e) => { |
|
|
|
|
|
tempVal = e[this.excelCols[oldColNum].dispLabel]; |
|
|
|
|
|
e[this.excelCols[oldColNum].dispLabel] = Number(tempVal) |
|
|
|
|
|
}); |
|
|
|
|
|
break; |
|
|
|
|
|
default: |
|
|
|
|
|
this.excelData.forEach((e) => { |
|
|
|
|
|
tempVal = e[this.excelCols[oldColNum].dispLabel] || ''; |
|
|
|
|
|
e[this.excelCols[oldColNum].dispLabel] = tempVal |
|
|
|
|
|
}); |
|
|
|
|
|
break; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 选择EXCEL文件后,批量分析Excel列 与 数据字段 的匹配关系 |
|
|
// 选择EXCEL文件后,批量分析Excel列 与 数据字段 的匹配关系 |
|
|
parseExcelData() { |
|
|
parseExcelData() { |
|
|
let lfind = -1; |
|
|
let lfind = -1; |
|
|
this.excelCols.forEach((e, i) => { |
|
|
|
|
|
|
|
|
this.excelCols.forEach((e, i) => { |
|
|
lfind = arrayExistObj(this.dataCols, "dispLabel", e.dispLabel); |
|
|
lfind = arrayExistObj(this.dataCols, "dispLabel", e.dispLabel); |
|
|
|
|
|
console.log('e.dispLabel',e.dispLabel,lfind) |
|
|
if (lfind > -1) this.setColumn(i, this.dataCols[lfind]); |
|
|
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) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
async importing(startRow) { |
|
|
let body = {}; |
|
|
let body = {}; |
|
|
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( |
|
|
@ -1435,52 +1504,25 @@ export default { |
|
|
); |
|
|
); |
|
|
|
|
|
|
|
|
// 将Excel的数据转换成接口的数据 |
|
|
// 将Excel的数据转换成接口的数据 |
|
|
body = this.excelDataToApiBody(this.choosedData[i]); |
|
|
|
|
|
if (i == startRow) body.nameType = startRowNameType; |
|
|
|
|
|
console.log(`this.choosedData[${i}],startRowNameType,body`); |
|
|
|
|
|
|
|
|
body = this.excelDataToApiBody(this.choosedData[i]); |
|
|
|
|
|
console.log(`this.choosedData[${i}],startRowNameType,body`,body); |
|
|
|
|
|
|
|
|
try { |
|
|
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 = {}; // 清除选择同一人员的记录 |
|
|
|
|
|
|
|
|
let res={code:0} |
|
|
|
|
|
// let res = await postapi( |
|
|
|
|
|
// "/api/app/patientregister/CreatePatientRegisterFromExcel", |
|
|
|
|
|
// body |
|
|
|
|
|
// ); |
|
|
|
|
|
|
|
|
if (res.code >= 0) { |
|
|
if (res.code >= 0) { |
|
|
this.tableData.push( |
|
|
this.tableData.push( |
|
|
Object.assign({ importState: "导入成功" }, this.choosedData[i]) |
|
|
|
|
|
|
|
|
Object.assign({ importState: "导入成功" }, body) |
|
|
); |
|
|
); |
|
|
} else { |
|
|
} else { |
|
|
this.tableData.push( |
|
|
this.tableData.push( |
|
|
Object.assign( |
|
|
Object.assign( |
|
|
{ importState: "导入失败", importDes: res.message }, |
|
|
{ importState: "导入失败", importDes: res.message }, |
|
|
this.choosedData[i] |
|
|
|
|
|
|
|
|
body |
|
|
) |
|
|
) |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
@ -1488,7 +1530,7 @@ export default { |
|
|
this.tableData.push( |
|
|
this.tableData.push( |
|
|
Object.assign( |
|
|
Object.assign( |
|
|
{ importState: "导入失败", importDes: `${error}` }, |
|
|
{ importState: "导入失败", importDes: `${error}` }, |
|
|
this.choosedData[i] |
|
|
|
|
|
|
|
|
body |
|
|
) |
|
|
) |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
@ -1499,11 +1541,27 @@ export default { |
|
|
this.seq = -1; |
|
|
this.seq = -1; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
console.log('this.tableData',this.tableData) |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//将Excel的数据转换成接口的数据 |
|
|
|
|
|
excelDataToApiBody(ExcelData) { |
|
|
|
|
|
let body = { |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
this.excelCols.forEach(e => { |
|
|
|
|
|
if (e.val) { |
|
|
|
|
|
body[e.val] = ExcelData[e.dispLabel] |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
return body |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 表格行底色样式 |
|
|
// 表格行底色样式 |
|
|
tableRowClassName({ row, rowIndex }) { |
|
|
|
|
|
if(row.isActive == 'N'){ |
|
|
|
|
|
|
|
|
tableRowClassName({ row, rowIndex }) { |
|
|
|
|
|
if (row.isActive == 'N') { |
|
|
return 'unActive'; |
|
|
return 'unActive'; |
|
|
} |
|
|
} |
|
|
return ''; |
|
|
return ''; |
|
|
@ -1512,6 +1570,21 @@ export default { |
|
|
|
|
|
|
|
|
//监听事件 |
|
|
//监听事件 |
|
|
watch: { |
|
|
watch: { |
|
|
|
|
|
"seq": { |
|
|
|
|
|
//immediate: true, // 立即执行 |
|
|
|
|
|
// // deep: true, // 深度监听复杂类型内变化 |
|
|
|
|
|
handler(newVal, oldVal) { |
|
|
|
|
|
// console.log('watch:seq:', newVal, oldVal) |
|
|
|
|
|
// if (!oldVal && oldVal != 0) { |
|
|
|
|
|
// this.oldSeq = -2 |
|
|
|
|
|
// } else { |
|
|
|
|
|
// this.oldSeq = oldVal |
|
|
|
|
|
// } |
|
|
|
|
|
if (newVal != oldVal) { |
|
|
|
|
|
this.btnProcess(newVal); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
//触发查询事件 |
|
|
//触发查询事件 |
|
|
"patientRegister.query.times"(newVal, oldVal) { |
|
|
"patientRegister.query.times"(newVal, oldVal) { |
|
|
if (newVal != oldVal) { |
|
|
if (newVal != oldVal) { |
|
|
|