Browse Source

import

master
pengjun 2 years ago
parent
commit
1442c30b00
  1. 21
      src/views/customerOrg/patientRegisterImport.vue

21
src/views/customerOrg/patientRegisterImport.vue

@ -151,7 +151,7 @@
<div style="display: flex;margin:20px;">
<div>
<span>体检单位</span>
<el-cascader v-model="query.customerOrgIds" :options="customerOrgTree"
<el-cascader v-model="customerOrgIds" :options="customerOrgTree"
style="width:200px;" @change="changeCustomerOrg" filterable :filter-method="filterMethod"
:props="{ checkStrictly: true, expandTrigger: 'hover', ...customerOrg.treeprops, }"
:show-all-levels="false" size="small">
@ -1054,6 +1054,7 @@ export default {
e.choosed = false;
e.index = index;
e.id = 'excelData' + index;
});
//console.log('this.excelCols',this.excelCols)
// console.log('sheet_to_json excelData',this.excelData)
@ -1144,6 +1145,7 @@ export default {
})
})
//
this.$contextmenu({
items,
event,
@ -1160,6 +1162,7 @@ export default {
//
setColumn(oldColNum,newColObj){
// console.log('oldColNum,newColObj',oldColNum,newColObj)
//
if(newColObj.dispLabel != "不设置"){
let lfind = arrayExistObj(this.excelCols,'dataLabel',newColObj.dispLabel)
@ -1168,8 +1171,18 @@ export default {
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
@ -1277,9 +1290,9 @@ export default {
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;
// 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;

Loading…
Cancel
Save