Commit 9f12785a authored by 王飞龙's avatar 王飞龙

导入

parent 36f5e22c
......@@ -162,9 +162,11 @@ export function importExclusive(url, params, filename, config) {
console.log("这是错误名字",filename)
saveAs(blob, filename)
} else if (resText=='{"msg":"请上传正确的模板文件","code":500}') {
Message.error("请上传正确的模板文件")
Message.warning("请上传正确的模板文件")
} else if (resText=='{"msg":"药品库存文件内容为空,请编辑模板文件内容重新上传","code":500}') {
Message.error(filename+"文件内容为空,请编辑模板文件内容重新上传")
Message.warning("文件内容为空,请编辑模板文件内容重新上传")
} else if(resText=='{"msg":"单次导入不能超过500条","code":500}'){
Message.warning("单次导入不能超过500条")
} else{
Message.success('导入成功');
}
......
......@@ -83,7 +83,7 @@
</el-col>
</el-row>
<el-table ref="table" v-loading="loading" :data="drugdeliveryList" :header-cell-style="{ background:'#E8E9E8'}" @select="selectChange" @select-all="selectChange">
<el-table ref="table" v-loading="loading" :data="drugdeliveryList" :header-cell-style="{background:'#F4F4F4'}" @select="selectChange" @select-all="selectChange">
<el-table-column type="selection" width="47" align="center" />
<el-table-column type="index" label="序号" width="50" />
<el-table-column label="药品名称" align="left" prop="drugName" width="200px" show-overflow-tooltip />
......
......@@ -564,6 +564,7 @@ export default {
},
/** 查询药品列表 */
getList() {
console.log('刷新页面啦')
this.loading = true
listDrug(this.queryParams).then(response => {
console.log('列表数据', response)
......@@ -699,15 +700,16 @@ export default {
console.log('response', response)
const url = response.msg
console.log(' data.url', url)
this.importExclusive('/finance/stock/drug/manage/uploadByUrl?url=' + url, {}, `error_${this.exportFormatTime(new Date())}.xlsx`)
this.handleQuery()
this.closeImport()
this.importExclusive('/finance/stock/drug/manage/uploadByUrl?url=' + url, {}, `错误信息${this.exportFormatTime(new Date())}.xlsx`)
setTimeout(() => {
this.getList()
this.closeImport()
}, 1000)
},
// 提交上传文件
submitUpload() {
if (this.$refs.upload.uploadFiles.length === 0) {
this.$modal.msgWarning('请上传文件')
this.isImport = false
}
this.$refs.upload.submit()
},
......@@ -794,11 +796,6 @@ export default {
},
// 关闭导入弹出层
closeImport() {
console.log('关闭弹出层')
if (this.fileList1.length === 0) {
this.$modal.msgWarning('请上传文件')
this.isImport = false
}
this.isImport = false
},
// 导出格式化
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment