Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pet-finance-web
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
刘怀志
pet-finance-web
Commits
36f5e22c
Commit
36f5e22c
authored
Aug 25, 2023
by
王飞龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
导入
parent
6647dc57
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
15 deletions
+16
-15
request.js
src/utils/request.js
+5
-4
ruoyi.js
src/utils/ruoyi.js
+4
-0
drug-delivery-detail.vue
...agement/drug-delivery-management/drug-delivery-detail.vue
+4
-2
drug-management.vue
.../inventory-management/drug-management/drug-management.vue
+3
-9
No files found.
src/utils/request.js
View file @
36f5e22c
...
@@ -3,7 +3,7 @@ import { Notification, MessageBox, Message, Loading } from 'element-ui'
...
@@ -3,7 +3,7 @@ import { Notification, MessageBox, Message, Loading } from 'element-ui'
import
store
from
'@/store'
import
store
from
'@/store'
import
{
getToken
}
from
'@/utils/auth'
import
{
getToken
}
from
'@/utils/auth'
import
errorCode
from
'@/utils/errorCode'
import
errorCode
from
'@/utils/errorCode'
import
{
tansParams
,
blobValidate
}
from
"@/utils/ruoyi"
;
import
{
tansParams
,
blobValidate
,
blobValidate1
}
from
'@/utils/ruoyi'
import
cache
from
'@/plugins/cache'
import
cache
from
'@/plugins/cache'
import
{
saveAs
}
from
'file-saver'
import
{
saveAs
}
from
'file-saver'
...
@@ -152,17 +152,18 @@ export function importExclusive(url, params, filename, config) {
...
@@ -152,17 +152,18 @@ export function importExclusive(url, params, filename, config) {
...
config
...
config
}).
then
(
async
(
data
)
=>
{
}).
then
(
async
(
data
)
=>
{
console
.
log
(
"导入返回的数据流"
,
data
)
console
.
log
(
"导入返回的数据流"
,
data
)
const
isBlob
=
blobValidate
(
data
);
const
isBlob
=
blobValidate
1
(
data
);
const
resText
=
await
data
.
text
();
const
resText
=
await
data
.
text
();
console
.
log
(
"导入返回的数据流"
,
isBlob
)
console
.
log
(
"导入返回的数据流"
,
isBlob
)
console
.
log
(
"报错信息"
,
resText
)
if
(
isBlob
)
{
if
(
isBlob
)
{
Message
.
error
(
'导入失败'
)
Message
.
error
(
'导入失败'
)
const
blob
=
new
Blob
([
data
])
const
blob
=
new
Blob
([
data
])
console
.
log
(
"这是错误名字"
,
filename
)
console
.
log
(
"这是错误名字"
,
filename
)
saveAs
(
blob
,
filename
)
saveAs
(
blob
,
filename
)
}
else
if
(
resText
==
'{"msg":"
上传模板与系统模板不匹配,请使用平台模板上传数据
","code":500}'
)
{
}
else
if
(
resText
==
'{"msg":"
请上传正确的模板文件
","code":500}'
)
{
Message
.
error
(
"请上传正确的模板文件"
)
Message
.
error
(
"请上传正确的模板文件"
)
}
else
if
(
resText
==
'{"msg":"
null
文件内容为空,请编辑模板文件内容重新上传","code":500}'
)
{
}
else
if
(
resText
==
'{"msg":"
药品库存
文件内容为空,请编辑模板文件内容重新上传","code":500}'
)
{
Message
.
error
(
filename
+
"文件内容为空,请编辑模板文件内容重新上传"
)
Message
.
error
(
filename
+
"文件内容为空,请编辑模板文件内容重新上传"
)
}
else
{
}
else
{
Message
.
success
(
'导入成功'
);
Message
.
success
(
'导入成功'
);
...
...
src/utils/ruoyi.js
View file @
36f5e22c
...
@@ -238,3 +238,7 @@ export function tansParams(params) {
...
@@ -238,3 +238,7 @@ export function tansParams(params) {
export
function
blobValidate
(
data
)
{
export
function
blobValidate
(
data
)
{
return
data
.
type
!==
'application/json'
return
data
.
type
!==
'application/json'
}
}
export
function
blobValidate1
(
data
)
{
return
data
.
type
!==
'application/json'
&&
data
.
type
!==
'text/xml'
;
// return data.type !== 'text/xml'
}
src/views/inventory-management/drug-delivery-management/drug-delivery-detail.vue
View file @
36f5e22c
...
@@ -335,7 +335,8 @@
...
@@ -335,7 +335,8 @@
</el-col>
</el-col>
<el-col
:span=
"8"
>
<el-col
:span=
"8"
>
<el-form-item
label=
"标准价格"
>
<el-form-item
label=
"标准价格"
>
<el-input
:value=
"'¥'+form.standardAmount"
placeholder=
"-"
style=
"width: 250px"
disabled
/>
<el-input
:value=
"+form.standardAmount"
placeholder=
"-"
style=
"width: 230px"
disabled
/>
<span
style=
"margin-left: 10px"
>
元
</span>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"8"
>
<el-col
:span=
"8"
>
...
@@ -348,7 +349,8 @@
...
@@ -348,7 +349,8 @@
<el-row>
<el-row>
<el-col
:span=
"8"
>
<el-col
:span=
"8"
>
<el-form-item
label=
"支付金额"
>
<el-form-item
label=
"支付金额"
>
<el-input
:value=
"'¥'+form.payAmount"
placeholder=
"-"
style=
"width: 250px"
disabled
/>
<el-input
:value=
"+form.payAmount"
placeholder=
"-"
style=
"width: 230px"
disabled
/>
<span
style=
"margin-left: 10px"
>
元
</span>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
<el-col
:span=
"8"
>
<el-col
:span=
"8"
>
...
...
src/views/inventory-management/drug-management/drug-management.vue
View file @
36f5e22c
...
@@ -673,7 +673,7 @@ export default {
...
@@ -673,7 +673,7 @@ export default {
if
(
fileType
===
'xlsx'
||
fileType
===
'xlr'
||
fileType
===
'xls'
)
{
if
(
fileType
===
'xlsx'
||
fileType
===
'xlr'
||
fileType
===
'xls'
)
{
console
.
log
(
file
)
console
.
log
(
file
)
}
else
{
}
else
{
this
.
$modal
.
msgWarning
(
'仅支持扩展名: .xlsx.xlr.xls
'
)
this
.
$modal
.
msgWarning
(
file
.
name
+
'文件格式不正确,请上传正确的模板文件
'
)
// 返回false 就不会执行上传操作了
// 返回false 就不会执行上传操作了
return
false
return
false
}
}
...
@@ -699,15 +699,9 @@ export default {
...
@@ -699,15 +699,9 @@ export default {
console
.
log
(
'response'
,
response
)
console
.
log
(
'response'
,
response
)
const
url
=
response
.
msg
const
url
=
response
.
msg
console
.
log
(
' data.url'
,
url
)
console
.
log
(
' data.url'
,
url
)
this
.
importExclusive
(
'/finance/stock/drug/manage/uploadByUrl?url='
+
url
,
{},
`error_
${
this
.
exportFormatTime
(
new
Date
())}
.xlsx`
)
// uploadByUrl(url).then(res => {
this
.
handleQuery
()
// console.log(res)
// })
this
.
importExclusive
(
'/finance/stock/drug/manage/uploadByUrl?url='
+
url
,
{},
`error_
${
new
Date
().
getTime
()}
.xlsx`
)
// this.$alert("
<
div
style
=
'overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'
>
" + response.msg + '</div>', '导入结果', { dangerouslyUseHTMLString: true })
this
.
closeImport
()
this
.
closeImport
()
this.getList()
},
},
// 提交上传文件
// 提交上传文件
submitUpload
()
{
submitUpload
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment