Browse Source

import

master
pengjun 2 years ago
parent
commit
7c4d631ce9
  1. 5
      src/assets/css/global_dialog.css
  2. 2
      src/router/index.js
  3. 2
      src/views/Home.vue
  4. 720
      src/views/customerOrg/patientRegisterImport.vue

5
src/assets/css/global_dialog.css

@ -33,4 +33,9 @@
text-align: right;
box-sizing: border-box;
*/
}
/* 右击菜单 */
.menu_item[data-v-e3a2c392]{
line-height: 25px; /* 原始:32 */
}

2
src/router/index.js

@ -290,7 +290,7 @@ const routes = [{
import ("../views/customerOrg/patientRegisterSign.vue"),
},
{
path: "/personnelBatch",
path: "/patientRegisterBatch",
name: "人员批量登记",
component: () =>
import ("../views/customerOrg/patientRegisterImport.vue"), //../views/doctorCheck/personnelBatch.vue

2
src/views/Home.vue

@ -306,7 +306,7 @@
<el-dropdown-item command="patientRegister" class="dropdownmain"
>体检人员登记</el-dropdown-item
>
<el-dropdown-item command="personnelBatch" class="dropdownmain"
<el-dropdown-item command="patientRegisterBatch" class="dropdownmain"
>人员批量登记</el-dropdown-item
>
<el-dropdown-item

720
src/views/customerOrg/patientRegisterImport.vue

@ -15,6 +15,9 @@
:height="window.pageHeight < 600 ? 405 : (window.pageHeight - 195)"
highlight-current-row size="small" >
<el-table-column type="index" label="序号" width="40" align="center"/>
<el-table-column prop="importState" label="导入状态" min-width="150"/>
<el-table-column v-for="(item,index) in importCols" :key="`col${index}`" :prop="item.dispLabel" align="center"
:label="item.dataLabel || item.dispLabel" min-width="100"/>
</el-table>
</div>
</el-card>
@ -23,8 +26,8 @@
:append-to-body="true" :close-on-click-modal="false">
<div style="height:300px;margin-left: 200px;">
<br/><el-radio v-model="mode" label="10">从Excle导入</el-radio>
<br/><br/>
<el-radio v-model="mode" label="20">从以往体检资料中导入</el-radio>
<br/>
<br/><el-radio v-model="mode" label="20">从以往体检资料中导入</el-radio>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="btnFirst">下一步</el-button>
@ -55,6 +58,18 @@
:append-to-body="true" :close-on-click-modal="false">
<div style="height:300px;padding: 0 50px; ">
<div><input type="file" accept=".xlsx,.xls" @change="changeFileChoose" /></div>
<div style="margin: 5px 70px;width:240px;">
<el-table :data="sheetNames" border ref="sheetNames"
height="240" 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 type="primary" @click="seq--">上一步</el-button>
@ -62,105 +77,321 @@
<el-button @click="seq = -1">关闭</el-button>
</span>
</el-dialog>
<el-dialog title="选择待导入的客户信息" :visible.sync="dialogGroup.fileDataOpr" width="600px" :show-close="false"
:close-on-click-modal="false"> <!--:append-to-body="true" -->
<div style="height:300px;">
<div style="margin-top: -10px;">
1按住 Ctr1 Shift 键可进行多选在标题列右击鼠标可设置列名标题列有<br>
2身份证号有值且合法时将以身份证号为主自动换算性别出生日期及年龄<br>
</div>
<div style="margin: 5px 0px 0px;" @contextmenu.prevent=""> <!-- -->
<el-table :data="excelData" border ref="excelData" @header-contextmenu="headerContextmenu"
height="260" @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">
<el-button type="primary" @click="btnChoose('all')">全选</el-button>
<el-button type="primary" @click="btnChoose" style="margin-right: 200px;">取消全选</el-button>
<el-button type="primary" @click="seq--">上一步</el-button>
<el-button type="primary" @click="seq++">下一步</el-button>
<el-button @click="seq = -1">关闭</el-button>
</span>
</el-dialog>
<el-dialog title="选择单位" :visible.sync="dialogGroup.fileDataOpts" width="600px" :show-close="false"
:close-on-click-modal="false"> <!--:append-to-body="true" -->
<div style="height:300px;">
<div style="margin-top: -10px;">
选择的人员信息必须直接属于该单位或者是该单位的一级部门,如果人员信息直接属于该单位请将Exce1文件中该人员信息的部门名称设为空
</div>
<div style="display: flex;margin:10px;">
<div>
<span>体检单位</span>
<el-cascader v-model="customerOrgIds" :options="customerOrgTree"
style="width:150px;" @change="changeCustomerOrg" filterable :filter-method="filterMethod"
:props="{ checkStrictly: true, expandTrigger: 'hover', ...customerOrg.treeprops, }"
:show-all-levels="false" size="small">
</el-cascader>
</div>
<div style="margin-left: 20px">
<span>单位体检次数</span>
<el-select
v-model="customerOrgRegister"
placeholder="次数"
style="width: 60px; margin-left: 10px"
size="small"
value-key="id"
>
<el-option
v-for="item in customerOrgRegisterList"
:key="item.id"
:label="item.medicalTimes"
:value="item"
/>
</el-select>
</div>
</div>
<div style="display: flex;margin:10px;">
<span>相同姓名的人员</span>
<div style="display: flex;margin-top:20px;">
<el-radio v-model="dataImportOpts.nameType" label="1">同名病人提示</el-radio>
<el-radio v-model="dataImportOpts.nameType" label="2">本单位同名提示</el-radio>
<el-radio v-model="dataImportOpts.nameType" label="3">不提示</el-radio>
</div>
</div>
<div style="display: flex;margin:10px;">
<span>登记状态</span>
<div style="display: flex;margin-top:20px;">
<el-radio v-model="dataImportOpts.completeFlag" label="0">预登记</el-radio>
<el-radio v-model="dataImportOpts.completeFlag" label="1">正式登记</el-radio>
</div>
</div>
<div style="display: flex;margin:10px;">
<span>工卡号</span>
<div style="display: block;margin-top:20px;">
<div style="display: flex;">
<el-checkbox v-model="dataImportOpts.isAutoCreatePatientNo" />
<span style="margin-left:5px;">工卡号作为档案号</span>
</div>
<div style="display: flex;">
<span style="margin-top:6px;">工卡号开始位置</span>
<el-input type="number" v-model="dataImportOpts.cardStartNum" size="small" style="width:100px;margin: 0 10px 0 0;"/>
<span style="margin-top:6px;">长度</span>
<el-input type="number" v-model="dataImportOpts.cardLength" size="small" style="width:100px;margin: 0 10px 0 0;"/>
</div>
</div>
</div>
<div style="display: flex;margin:10px;">
<span>是否自动创建部门</span>
<el-checkbox v-model="dataImportOpts.isAutoCreateDepartment" />
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="seq--">上一步</el-button>
<el-button type="primary" @click="btnImport">确定导入</el-button>
<el-button @click="seq = -1">关闭</el-button>
</span>
</el-dialog>
<!-- 通用进度条 -->
<el-dialog
title="数据处理中……"
:visible.sync="elProgress.display"
width="600px"
height="400"
:show-close="false"
:close-on-click-modal="false"
:append-to-body="true"
>
<ElProgressOCX />
</el-dialog>
</div>
</template>
<script>
import moment from "moment"
import { mapState, mapActions } from "vuex";
import ExcelJS from "exceljs";
import { read,readFile, utils } from "xlsx";
import { getapi, postapi, putapi, deletapi } from "@/api/api";
import { arrayExistObj ,arrayFilter ,tcdate } from '@/utlis/proFunc';
import ElProgressOCX from "../../components/report/ElProgressOCX.vue";
export default {
components: {
ElProgressOCX,
},
data() {
return {
return {
customerOrgTree:[],
customerOrgIds:[], //
customerOrgRegisterList: [], //
customerOrgRegister: {}, //
peisid:null,
startPoint: -1, // -1
endPoint: -1, // -1
rClickRow: null, //
rClickColumn: null, //
dialogGroup:{
mode:true, // 10 20
fileReadme:false,
fileChoose:false,
fileDataChoose:false,
fileDataOption:false,
fileReadme:false, //EXCEL
fileChoose:false, //
fileDataOpr:false, //
fileDataOpts:false, //
},
seq: 0, //
mode: '10', // 10 20
excelCols: [{label:'',val:''}], //excel
excelData: [], //excel
excelCols: [{dispLabel:'',val:'',dataLabel:''}], //excel {dispLabel:'',val:'',dataLabel:''}
importCols:[], // dataCols
excelData: [], //excel
dataCols:[
{label:'不设置',val:'noSet'},
{label:'工卡号',val:'noSet'},
{label:'部门',val:'noSet'},
{label:'姓名',val:'noSet'},
{label:'性别',val:'noSet'},
{label:'不设置',val:'noSet'},
{label:'工卡号',val:'noSet'},
{label:'部门',val:'noSet'},
{label:'姓名',val:'noSet'},
{label:'性别',val:'noSet'},
{label:'年龄',val:'noSet'},
{label:'出生日期',val:'noSet'},
{label:'婚姻状况',val:'noSet'},
{label:'民族',val:'noSet'},
{label:'身份证号',val:'noSet'},
{label:'电话',val:'noSet'},
{label:'手机',val:'noSet'},
{label:'电子邮件',val:'noSet'},
{label:'邮编',val:'noSet'},
{label:'地址',val:'noSet'},
{label:'人员类别',val:'noSet'},
{label:'体检类别',val:'noSet'},
{label:'支付方式',val:'noSet'},
{dispLabel:'不设置',val:''},
{dispLabel:'工卡号',val:'jobCardNo'},
{dispLabel:'部门',val:'departmentName'},
{dispLabel:'分组',val:'customerOrgGroupName'},
{dispLabel:'姓名',val:'patientName'},
{dispLabel:'性别',val:'sexName'},
{dispLabel:'年龄',val:'age'},
{dispLabel:'出生日期',val:'birthDate'},
{dispLabel:'婚姻状况',val:'maritalStatusName'},
{dispLabel:'民族',val:'nationName'},
{dispLabel:'身份证号',val:'idNo'},
{dispLabel:'体检卡号',val:'medicalCardNo'},
{dispLabel:'电话',val:'telephone'},
{dispLabel:'手机',val:'mobileTelephone'},
{dispLabel:'电子邮件',val:'email'},
{dispLabel:'邮编',val:'postalCode'},
{dispLabel:'地址',val:'address'},
{dispLabel:'职务',val:'jobPost'},
{dispLabel:'职称',val:'jobTitle'},
{dispLabel:'人员类别',val:'personnelTypeName'},
{dispLabel:'体检类别',val:'medicalTypeName'},
{dispLabel:'支付方式',val:'payTypeFlag'},
],
/*
photo string
nullable: true
照片
salesman string
nullable: true
介绍人
sexHormoneTermName string
nullable: true
性激素期限
isNameHide string
nullable: true
隐藏姓名
remark string
nullable: true
备注
interposeMeasure string
nullable: true
干预措施
medicalConclusionId string($uuid)
nullable: true
体检结论
birthPlaceName string
nullable: true
出生地
*/
tableData:[],
workBook:null, //EXCEL
sheetNames:[], //EXCEL
sheetNames:[], //EXCEL {sheetName:}
readDataOpts:{
sheetNameChoosed:'', //
titleRow:1, //
dataRow:2, //
titleRow:1, //
},
dataImportOpts:{
customerOrgId:'', //ID
nameType:'2', //(1. 2. 3.)
completeFlag:'0', // 0 1 2 3
isAutoCreateDepartment:true, // Y N( N Y:)
isAutoCreatePatientNo:false, // Y/N ()
cardStartNum:0,
cardLength:6
}
};
},
//
created() {
this.peisid = window.sessionStorage.getItem('peisid');
if(!this.peisid || this.peisid == 'null'){
this.seq = -1
}
},
//
mounted() {
this.getCustomerOrgTree()
},
computed: {
...mapState(["window", "dict", "patientRegister", "customerOrg"]),
...mapState(["window", "dict", "elProgress", "patientRegister", "customerOrg"]),
},
methods: {
//
getCustomerOrgTree() {
getapi("/api/app/customerorg/getbycodeall").then((res) => {
// console.log("res.data", res.data);
if(res.code != -1){
this.customerOrgTree = res.data;
let lfind = arrayExistObj(this.customerOrgTree,'id',this.dict.personOrgId)
if(lfind > -1) this.customerOrgTree.splice(lfind,1)
tcdate(this.customerOrgTree)
}
});
},
//
filterMethod(){
},
//
changeCustomerOrg(v) {
let id = ''
if(typeof v == 'string'){
id = v
}else{
id = v[0]
}
getapi(
`/api/app/customerorgregister/getlistincustomerorgid?CustomerOrgId=${id}`
).then((res) => {
if (res.code != -1) {
this.customerOrgRegisterList = arrayFilter(res.data, 'isComplete', 'N') //
if (this.customerOrgRegisterList.length > 0) {
this.customerOrgRegister = this.customerOrgRegisterList[this.customerOrgRegisterList.length - 1];
// this.getCustomerOrgGroup(this.customerOrgRegister.id);
} else {
this.customerOrgRegister = {};
// this.customerOrgGroups = [];
}
// objCopy(this.formInit,this.form)
}
});
},
//
btnFirst() {
if(!this.peisid || this.peisid == 'null'){
this.$message.warning("该用户未选归属体检中心,不能执行此操作!");
return
}
this.seq = parseInt(this.mode)
},
//
btnNext() {
if(this.seq == 0) return;
this.seq++;
this.setDialogDisp();
},
btnImport(seq){
//
btnProcess(seq){
let keys = Object.keys(this.dialogGroup)
if(seq == 9){
@ -179,7 +410,7 @@ export default {
})
break;
case 0:
//
//
keys.forEach(e =>{
if(e == 'mode'){
this.dialogGroup[e] = true
@ -189,7 +420,7 @@ export default {
})
break;
case 10:
//
// EXCEL
keys.forEach(e =>{
if(e == 'fileReadme'){
this.dialogGroup[e] = true
@ -199,7 +430,7 @@ export default {
})
break;
case 11:
//
//
keys.forEach(e =>{
if(e == 'fileChoose'){
this.dialogGroup[e] = true
@ -208,6 +439,44 @@ export default {
}
})
break;
case 12:
// 退
if(this.excelData.length == 0){
if(!this.readData()){
this.seq--
break;
}
}
//
keys.forEach(e =>{
if(e == 'fileDataOpr'){
this.dialogGroup[e] = true
}else{
this.dialogGroup[e] = false
}
})
break;
case 13:
let count = 0
this.excelData.forEach(e =>{
if(e.choosed) count++
})
if(count == 0){
this.$message.warning("未选中要导入的记录")
this.seq--
break;
}
//
keys.forEach(e =>{
if(e == 'fileDataOpts'){
this.dialogGroup[e] = true
}else{
this.dialogGroup[e] = false
}
})
break;
default:
break;
@ -215,16 +484,13 @@ export default {
},
//
setDialogDisp(){
this.dialogGroup.forEach((item,index) =>{
if(index == this.seq){
item = true;
}else{
item = false;
}
return item;
});
//
handleRowClassName({ row, rowIndex }) {
if (row.choosed) {
return "current-row";
} else {
return "";
}
},
changeFileChoose(e) {
@ -244,136 +510,269 @@ export default {
let data = e.target.result;
// let typedArray = new Uint8Array(data);
// var workBook = read(typedArray,{type:'array'})
this.workBook = read(data,{type:'binary',cellDates:true})
// 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])
})
this.sheetNames = this.workBook.SheetNames
console.log('workBook',workBook)
var sheet_name_list = workBook.SheetNames;
sheet_name_list.forEach(function(e,index) {
var worksheet = workBook.Sheets[e];
console.log(e,index,worksheet)
let jsonData = utils.sheet_to_json(worksheet,{header:1}) //raw:false,range:1
console.log('jsonData',jsonData)
utils.sheet_to_formulae()
/* DO SOMETHING WITH worksheet HERE */
});
}
},
//Excel
chooseSheetName(row){
this.readDataOpts.sheetNameChoosed = row.sheetName
},
//
readData(){
let ret = 1
if(!this.workBook || !this.readDataOpts.sheetNameChoosed){
this.$message.warning("请选择文件及要导入的表格")
return
return 0
}
if(this.readDataOpts.titleRow <= 0){
this.$message.warning("标题行不能小于1")
return
}
if(this.readDataOpts.dataRowRow <= 0){
this.$message.warning("数据行不能小于2")
return
return 0
}
let worksheet = this.workBook.Sheets[this.readDataOpts.sheetNameChoosed];
let temp
let worksheet = this.workBook.Sheets[this.readDataOpts.sheetNameChoosed];
// = utils.sheet_to_json(worksheet,{header:1}) //raw:false,range:1
//
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
})
})
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);
//ExcelFile
importExcelFile(file) {
// shift
if (this.window.shift) {
//
this.excelData.forEach((e,index) => {
e.choosed = false;
e.index = index;
});
// 簿
const workbook = new ExcelJS.Workbook();
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);
console.log('workbook',workbook)
// Excel
const reader = new FileReader();
this.excelData[row.index].choosed = true;
this.startPoint = row.index;
}
},
reader.onload = () => {
const buffer = reader.result;
const typedArray = new Uint8Array(buffer);
//
btnChoose(type){
let choosed = false
if(type && type == 'all'){
choosed = true
}
this.excelData.forEach(e =>{
e.choosed = choosed
if(choosed){
this.$refs['excelData'].setCurrentRow(e)
}
})
//application/vnd.ms-excel
const blob = new Blob([typedArray], {
//type xlsx:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, xls:application/vnd.ms-excel
type: file.type,
});
if(!choosed){
this.$refs['excelData'].setCurrentRow()
}
},
// BlobExcel
workbook.xlsx.load(blob).then((wb) => {
console.log('wb',wb);
//
const worksheet = wb.getWorksheet(1);
console.log('worksheet',worksheet);
// Excel
worksheet.eachRow((row, rowNumber) => {
console.log(row.values);
this.excelData.push(row.values);
// console.log(`${row.rowNumber}${row.rowData}`);
});
});
};
reader.readAsArrayBuffer(file);
//
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;
},
//
parseexcelData(startRow) {
if (!this.excelData || this.excelData.length == 0) return;
let cols = [];
let record = {};
this.excelData.forEach((item, index) => {
console.log(index, item);
if (index == startRow - 2) {
item.forEach((e, i) => {
console.log("e", i, e);
if (i > 0) {
if (e) {
this.tableDataCol.push({ excelCol: e, apiCol: "", label: e });
cols.push(e);
} else {
this.tableDataCol.push({
excelCol: `${Number(i) + 1}`,
apiCol: "",
lebel: `${Number(i) + 1}`,
});
cols.push(`${Number(i) + 1}`);
}
}
});
} else if (index > startRow - 2) {
for (let i = 0; i < item.length; i++) {
if (i > 0) {
console.log("cols[i]", i, cols[i - 1]);
if (item[i]) {
record[cols[i - 1]] = item[i];
} else {
record[cols[i - 1]] = null;
}
}
}
this.tableData.push({ ...record });
//
setColumn(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
},
// 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])
});
},
// console.log("tableDataCol", this.tableDataCol);
// console.log("tableData", this.tableData);
//
async btnImport(){
if(!this.customerOrgIds || this.customerOrgIds.length == 0){
this.$message.warning("请选择单位")
return
}
if(!this.customerOrgRegister || !this.customerOrgRegister.id){
this.$message.warning("请选择单位体检次数")
return
}
let body = {}
this.elProgress.display = true;
this.elProgress.percentage = 0;
this.tableData = []
for(let i=0;i<this.excelData.length;i++){
this.elProgress.percentage = Math.floor(
((i + 1) * 100) / this.excelData.length
);
if(this.excelData[i].choosed){
body = this.excelDataToApiBody(this.excelData[i])
console.log('this.excelData[i]',i,body)
try {
let res = await postapi('/api/app/patientregister/createpatientregisterexcel',body)
if(res.code != -1){
this.tableData.push(Object.assign({importState:'导入成功'},this.excelData[i]))
}else{
this.tableData.push(Object.assign({importState:`导入失败,原因:${res.message}`},this.excelData[i]))
}
} catch (error) {
break;
}
}
}
this.elProgress.display = false;
this.seq = -1
this.importCols = []
this.excelCols.forEach(e =>{
if(e.val){
this.importCols.push(e)
}
})
},
//Excel
excelDataToApiBody(ExcelData){
let body = {
customerOrgId:this.customerOrgIds[this.customerOrgIds.length - 1],
customerOrgRegisterId:this.customerOrgRegister.id,
organizationUnitId:this.peisid,
nameType:this.dataImportOpts.nameType,
completeFlag:this.dataImportOpts.completeFlag,
isAutoCreateDepartment: this.dataImportOpts.isAutoCreateDepartment ? 'Y':'N',
isAutoCreatePatientNo:this.dataImportOpts.isAutoCreatePatientNo ? 'Y':'N',
cardStartNum:this.dataImportOpts.cardStartNum,
cardLength:this.dataImportOpts.cardLength
}
this.excelCols.forEach(e =>{
if(e.val){
switch (e.val) {
case 'age':
if(ExcelData[e.dispLabel]) body[e.val] = parseInt(ExcelData[e.dispLabel])
break;
case 'birthDate':
if(ExcelData[e.dispLabel]) body[e.val] = moment(new Date(ExcelData[e.dispLabel])).format('yyyy-MM-DD')
break;
default:
body[e.val] = ExcelData[e.dispLabel]
break;
}
}
})
return body
},
},
@ -384,7 +783,7 @@ export default {
handler(newVal,oldVal){
console.log('watch:seq:',newVal,oldVal)
if(newVal != oldVal){
this.btnImport(newVal);
this.btnProcess(newVal);
}
}
},
@ -398,10 +797,11 @@ export default {
@import '../../assets/css/global_card.css';
@import '../../assets/css/global_dialog.css';
@import '../../assets/css/global_form.css';
@import '../../assets/css/global_input.css';
/* @import '../../assets/css/global_input.css'; */
@import '../../assets/css/global_table.css';
@import '../../assets/css/global.css';
.btnClass{
margin-right: 10px;
}

Loading…
Cancel
Save