feat:手动上传药品处方单据

20240912_adapter
chenhc 6 months ago
parent ce403e408a
commit ca182b7b20

@ -106,7 +106,7 @@
<!-- </el-form>-->
<!-- </div>-->
<div class="top-right-btn">
<el-button-group>
<el-button-group style="display:flex;">
<el-button icon="el-icon-view" type="primary" @click="hideSearch"></el-button>
<el-button
type="primary"
@ -118,6 +118,24 @@
>查询
</el-button
>
<el-upload
:action="action"
:headers ="headers"
accept=".xlsx,.xls"
:on-preview="handlePreview"
:on-remove="handleRemove"
:before-remove="beforeRemove"
:on-success="handleSuccess"
:on-progress="handleProgress"
:on-error="handleError"
:before-upload="beforeUpload"
:limit="1"
:on-exceed="handleExceed"
:file-list="fileList"
:show-file-list="false"
:data="extraData">
<el-button icon="el-icon-upload" type="primary" >手动上传数据</el-button>
</el-upload>
<el-button type="primary" icon="el-icon-download" @click="downloadData"
>下载数据
</el-button
@ -404,6 +422,7 @@ import {
import {filterSubAllOptimize} from "@/api/system/invSubWarehouse";
import {filterWorkOptimize} from "@/api/basic/workPlace/sysWorkplaceManage";
import {getWorkBindBusTypes} from '@/api/basic/workPlace/sysWorkplaceDocuments'
import {getAdminId, getToken} from '@/utils/auth';
export default {
name: "prescribePanel",
@ -522,7 +541,15 @@ export default {
page: 1,
limit: 100
},
errQueryPage: 1
errQueryPage: 1,
headers:{
ADMINID: getAdminId(),
ADMINTOKEN: getToken()
},
extraData:{"uuid": "upload-xlsx"},
uploadLoading: false,
action: process.env.VUE_APP_BASE_API + "/udiwms/collect/order/xlsxUpload",
fileList: []
}
},
@ -530,7 +557,53 @@ export default {
addOrder, errOrder, prescribeDownloadDialog, prescribeOriginPanel, PannelOriginOrderDetail
},
methods: {
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
},
handleExceed(files, fileList) {
// this.$message.warning(` 5 ${files.length} ${files.length + fileList.length} `);
},
beforeRemove(file, fileList) {
// return this.$confirm(` ${ file.name }`);
},
handleSuccess(res, file, fileList) {
fileList = fileList.filter(item => item.response.code === 20000);
this.fileList = fileList;
if (res.code === 20000) {
this.$message.success(res.message);
this.fileList = []
} else {
this.$message.error(res.message);
}
this.uploadLoading.close();
},
beforeUpload(file) {
const isXML = file.name.endsWith('.xls');
const isXML2 = file.name.endsWith('.xlsx');
const isLt5M = file.size / 1024 / 1024 < 100;
if (!isXML &&!isXML2) {
this.$message.error('上传文件只能是 xls 格式!');
}
if (!isLt5M) {
this.$message.error('上传文件大小不能超过 10MB!');
}
return (isXML || isXML2) && isLt5M;
},
handleProgress() {
this.uploadLoading = this.$loading({
lock: true,
text: '文件上传中…',
spinner: 'el-icon-loading',
background: 'rgba(0, 0, 0, 0.5)'
});
},
handleError() {
this.uploadLoading.close();
this.$message.error('文件上传失败,请检查文件大小或文件格式');
},
//------------
executeFuc(row, type, clickFuc, value) {
return executeFuc(this, row, type, clickFuc, value);

Loading…
Cancel
Save