|
|
|
@ -65,20 +65,38 @@ |
|
|
|
</div> |
|
|
|
</el-upload> |
|
|
|
</div> |
|
|
|
<div style="display: flex;margin-top: 10px;justify-content:space-between;"> |
|
|
|
<div style="display: flex;margin: 5px 0;"> |
|
|
|
<span>条码方式:</span> |
|
|
|
<div> |
|
|
|
<el-radio-group v-model="upPic.barcodeMode" @change="upPic.asbitemId = ''"> |
|
|
|
<el-radio label="0">人员条码</el-radio> |
|
|
|
<el-radio label="1">检验条码</el-radio> |
|
|
|
<el-radio label="2">检查条码</el-radio> |
|
|
|
</el-radio-group> |
|
|
|
</div> |
|
|
|
<div v-show="upPic.barcodeMode != '2'"> |
|
|
|
<el-select v-model="upPic.asbitemId" placeholder="请选择检查项目" filterable clearable size="small" |
|
|
|
style="width:240px;margin: -5px 0 0 25px;" @focus="getAsbitems()"> |
|
|
|
<el-option v-for="item in asbitems" :key="item.asbitemId" :label="item.asbitemName" |
|
|
|
:value="item.asbitemId" /> |
|
|
|
</el-select> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div style="display: flex;justify-content:space-between;"> |
|
|
|
<div> |
|
|
|
<div style="display: flex;"> |
|
|
|
<span style="margin: 5px 0;">条码号:</span> |
|
|
|
<el-select v-model="upPic.getCheckNoMode" placeholder="截取检查号" filterable size="small" |
|
|
|
style="width:180px;margin: 0 5px 0 0;"> |
|
|
|
<el-option label="文件名即检查号" value="0" /> |
|
|
|
<el-option label="文件名即条码号" value="0" /> |
|
|
|
<el-option label="文件名左侧 ? 个字符" value="1" /> |
|
|
|
<el-option label="文件名右侧 ? 个字符" value="2" /> |
|
|
|
<el-option label="文件名第 ? 至 ? 个字符" value="3" /> |
|
|
|
</el-select> |
|
|
|
<el-input v-model="upPic.startLen" style="width:150px;" size="small" |
|
|
|
<el-input v-model="upPic.startLen" style="width:100px;" size="small" |
|
|
|
v-if="upPic.getCheckNoMode == '1' || upPic.getCheckNoMode == '2' || upPic.getCheckNoMode == '3'" /> |
|
|
|
<span v-if="upPic.getCheckNoMode == '3'" style="padding: 5px 5px;">至</span> |
|
|
|
<el-input v-model="upPic.endLen" style="width:150px;" size="small" v-if="upPic.getCheckNoMode == '3'" /> |
|
|
|
<el-input v-model="upPic.endLen" style="width:100px;" size="small" v-if="upPic.getCheckNoMode == '3'" /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div> |
|
|
|
@ -121,12 +139,16 @@ export default { |
|
|
|
routeUrlorPageName: 'patientRegisterBatch', //当前页面归属路由或归属页面权限名称 |
|
|
|
privs: [] // 页面权限 |
|
|
|
}, |
|
|
|
|
|
|
|
upPic: { |
|
|
|
visible: false, |
|
|
|
barcodeMode: '0', |
|
|
|
asbitemId: '', |
|
|
|
getCheckNoMode: '3', |
|
|
|
startLen: null, |
|
|
|
endLen: null |
|
|
|
startLen: 1, |
|
|
|
endLen: 6 |
|
|
|
}, |
|
|
|
asbitems: [], |
|
|
|
tableData: [], |
|
|
|
dialogImageUrl: '', |
|
|
|
dialogVisible: false, |
|
|
|
@ -140,9 +162,6 @@ export default { |
|
|
|
//获取用户当前页面的权限 |
|
|
|
let userPriv = window.sessionStorage.getItem('userPriv') |
|
|
|
if (userPriv) this.pagePriv.privs = deepCopy(getPagePriv(this.pagePriv.routeUrlorPageName)) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
//页面挂载完成,一般页面渲染数据放在这里 |
|
|
|
@ -169,6 +188,72 @@ export default { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 获取检查项目 |
|
|
|
getAsbitems() { |
|
|
|
if (!(this.fileList && typeof this.fileList == 'object' && this.fileList.length > 0)) { |
|
|
|
this.$message.warning({ showClose: true, message: "请选择要上传的文件!" }) |
|
|
|
return |
|
|
|
} |
|
|
|
let err = '' |
|
|
|
let file = this.fileList[0] |
|
|
|
let fileName = "" |
|
|
|
let dotIndex = file.name.lastIndexOf('.'); |
|
|
|
if (dotIndex > -1) fileName = file.name.substring(0, dotIndex); |
|
|
|
|
|
|
|
let barcodeName = '人员' |
|
|
|
|
|
|
|
switch (this.upPic.barcodeMode) { |
|
|
|
case '1': |
|
|
|
barcodeName = "检验" |
|
|
|
break; |
|
|
|
case '2': |
|
|
|
barcodeName = "检查" |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
let barcode = fileName |
|
|
|
switch (this.upPic.getCheckNoMode) { |
|
|
|
case '1': |
|
|
|
barcode = fileName.substring(0, this.upPic.startLen) |
|
|
|
if (barcode.length != this.upPic.startLen) err = `从 ${fileName} 截取的 ${barcodeName}条码号 长度不够` |
|
|
|
break; |
|
|
|
case '2': |
|
|
|
barcode = fileName.substring(fileName.length - this.upPic.startLen) |
|
|
|
if (barcode.length != this.upPic.startLen) err = `从 ${fileName} 截取的 ${barcodeName}条码号 长度不够` |
|
|
|
break; |
|
|
|
case '3': |
|
|
|
barcode = fileName.substring(this.upPic.startLen - 1, this.upPic.endLen) |
|
|
|
if (barcode.length != Number(this.upPic.endLen - this.upPic.startLen) + Number(1)) err = `从 ${fileName} 截取的 ${barcodeName}条码号 长度不够` |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
if (err) { |
|
|
|
this.$message.warning({ showClose: true, message: err }) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
this.upPic.asbitemId = '' |
|
|
|
this.asbitems = [] |
|
|
|
switch (this.upPic.barcodeMode) { |
|
|
|
case "0": |
|
|
|
postapi('/api/app/RegisterCheck/GetRegisterCheckAsbitemsByPatientRegisterNos', { patientRegisterNos: [barcode] }) |
|
|
|
.then(res => { |
|
|
|
if (res.code > -1) this.asbitems = res.data |
|
|
|
}) |
|
|
|
break; |
|
|
|
case "1": |
|
|
|
|
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 导入完后,状态统计 |
|
|
|
getSummaries(param) { |
|
|
|
const { columns, data } = param; |
|
|
|
@ -222,6 +307,7 @@ export default { |
|
|
|
this.$message.warning({ showClose: true, message: "请选择要上传的文件!" }) |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
let checkSize = [] |
|
|
|
this.fileList.forEach(e => { |
|
|
|
if (e.size > 1024 * 1024 * 20) checkSize.push(e.name) |
|
|
|
@ -232,6 +318,11 @@ export default { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
if (this.upPic.barcodeMode != '2' && !this.upPic.asbitemId) { |
|
|
|
this.$message.error({ showClose: true, message: `请选择检查项目` }) |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
let that = this; |
|
|
|
let count = 0, err = ''; |
|
|
|
console.log('this.fileList', this.fileList) |
|
|
|
@ -239,7 +330,7 @@ export default { |
|
|
|
let file = this.fileList[i] |
|
|
|
console.log('file', file) |
|
|
|
let reader = new FileReader(); |
|
|
|
|
|
|
|
|
|
|
|
// 定义读取文件 |
|
|
|
reader.onload = (event) => { |
|
|
|
let fileName = "" |
|
|
|
@ -265,35 +356,52 @@ export default { |
|
|
|
break; |
|
|
|
} |
|
|
|
count++; |
|
|
|
if (err) { |
|
|
|
if (err) { |
|
|
|
that.tableData.push({ |
|
|
|
importState:'导入失败', |
|
|
|
importDes:err, |
|
|
|
importState: '导入失败', |
|
|
|
importDes: err, |
|
|
|
fileName, |
|
|
|
}) |
|
|
|
} else { |
|
|
|
}) |
|
|
|
} else { |
|
|
|
let rd = { |
|
|
|
importState:'导入失败', |
|
|
|
importDes:err, |
|
|
|
importState: '导入失败', |
|
|
|
importDes: err, |
|
|
|
fileName, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
let body = { |
|
|
|
checkRequestNo, |
|
|
|
checkRequestNo, // 检查条码 |
|
|
|
pictureName: fileName, |
|
|
|
pictureBase64: data |
|
|
|
pictureBase64: data, |
|
|
|
patientRegisterNo: checkRequestNo, // 人员条码 |
|
|
|
asbitemId: this.upPic.asbitemId |
|
|
|
} |
|
|
|
|
|
|
|
let url = '/api/app/RegisterCheckPicture/ImportRegisterCheckPicture' |
|
|
|
|
|
|
|
switch (this.upPic.barcodeMode) { |
|
|
|
case '0': |
|
|
|
url = '/api/app/RegisterCheckPicture/ImportRegisterCheckPictureByPatientRegisterNo' |
|
|
|
break; |
|
|
|
case '1': |
|
|
|
url = '/api/app/RegisterCheckPicture/ImportRegisterCheckPictureByLisRequestNo' |
|
|
|
break; |
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
postapi('/api/app/RegisterCheckPicture/ImportRegisterCheckPicture', body) |
|
|
|
.then(res => { |
|
|
|
|
|
|
|
if (res.code > -1) { |
|
|
|
postapi(url, body) |
|
|
|
.then(res => { |
|
|
|
if (res.code > -1) { |
|
|
|
rd.importState = "导入成功" |
|
|
|
rd.importDes = "" |
|
|
|
rd.importDes = "" |
|
|
|
} else { |
|
|
|
rd.importDes = res.message |
|
|
|
rd.importDes = res.message |
|
|
|
} |
|
|
|
}) |
|
|
|
.catch(error => { |
|
|
|
rd.importDes = `${error}` |
|
|
|
rd.importDes = `${error}` |
|
|
|
}) |
|
|
|
.finally(() => { |
|
|
|
that.tableData.push(rd) |
|
|
|
@ -316,27 +424,13 @@ export default { |
|
|
|
}; |
|
|
|
}, |
|
|
|
|
|
|
|
closePicUpload(){ |
|
|
|
closePicUpload() { |
|
|
|
this.upPic.visible = false |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//导入完后,导入状态显示 |
|
|
|
importRowClassName({ row, rowIndex }) { |
|
|
|
if (row.importState == '导入失败') { |
|
|
|
@ -470,4 +564,22 @@ input[type="number"]::-webkit-outer-spin-button { |
|
|
|
::v-deep .menu_item { |
|
|
|
line-height: 24px; |
|
|
|
} |
|
|
|
|
|
|
|
::v-deep .el-upload--picture-card { |
|
|
|
width: 148px; |
|
|
|
height: 148px; |
|
|
|
line-height: 146px; |
|
|
|
} |
|
|
|
|
|
|
|
::v-deep .el-upload-list--item-thumbnail { |
|
|
|
width: 72px; |
|
|
|
height: 72px; |
|
|
|
line-height: 72px; |
|
|
|
} |
|
|
|
|
|
|
|
::v-deep .el-upload-list--item-actions { |
|
|
|
width: 72px; |
|
|
|
height: 72px; |
|
|
|
line-height: 72px; |
|
|
|
} |
|
|
|
</style> |