pengjun 4 months ago
parent
commit
e25704d0eb
  1. 2
      src/components/patientRegister/patientRegisterRecoverListQuery.vue
  2. 309
      src/views/fee-settings/cardRegister.vue

2
src/components/patientRegister/patientRegisterRecoverListQuery.vue

@ -173,7 +173,7 @@
<el-table-column prop="patientName" label="姓名" sortable/> <el-table-column prop="patientName" label="姓名" sortable/>
<el-table-column prop="sexName" label="性别" sortable> <el-table-column prop="sexName" label="性别" sortable>
</el-table-column> </el-table-column>
<el-table-column prop="age" label="年龄" />
<el-table-column prop="age" label="年龄" sortable/>
<el-table-column prop="patientRegisterNo" label="条码号" width="150" sortable/> <el-table-column prop="patientRegisterNo" label="条码号" width="150" sortable/>
<el-table-column prop="patientNo" label="档案号" sortable/> <el-table-column prop="patientNo" label="档案号" sortable/>
<el-table-column prop="medicalTimes" label="体检次数"></el-table-column> <el-table-column prop="medicalTimes" label="体检次数"></el-table-column>

309
src/views/fee-settings/cardRegister.vue

@ -76,8 +76,8 @@
? 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-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-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,16 +1447,39 @@ 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;
} }
}, },
// EXCELExcel // EXCELExcel
@ -1385,49 +1487,16 @@ export default {
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(
@ -1436,51 +1505,24 @@ export default {
// Excel // Excel
body = this.excelDataToApiBody(this.choosedData[i]); body = this.excelDataToApiBody(this.choosedData[i]);
if (i == startRow) body.nameType = startRowNameType;
console.log(`this.choosedData[${i}],startRowNameType,body`);
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
}
}
let res={code:0}
// let res = await postapi(
// "/api/app/patientregister/CreatePatientRegisterFromExcel",
// body
// );
// /api/app/patientregister/createpatientregisterexcel
let res = await postapi(
"/api/app/patientregister/CreatePatientRegisterFromExcel",
body
);
this.choosedSameMan = {}; //
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 }) { tableRowClassName({ row, rowIndex }) {
if(row.isActive == 'N'){
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) {

Loading…
Cancel
Save