Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-front
Overview
Overview
Details
Activity
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
platform
hg-front
Commits
0819347e
Commit
0819347e
authored
Aug 20, 2024
by
zhangzhen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
功能优化
parent
59067845
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
14 deletions
+43
-14
home.vue
pages/home/home.vue
+3
-3
edit.vue
pages/product-order/edit.vue
+28
-7
index.vue
pages/product-order/index.vue
+5
-4
tools.js
utils/tools.js
+7
-0
No files found.
pages/home/home.vue
View file @
0819347e
...
...
@@ -127,7 +127,7 @@
if
(
res
.
data
.
result
&&
res
.
data
.
result
.
length
){
this
.
swiperList
=
res
.
data
.
result
.
map
(
item
=>
{
return
{
img
:
this
.
assetsPath
+
"/hggp/file/download/
docId/
"
+
item
.
DOC_ID
img
:
this
.
assetsPath
+
"/hggp/file/download/"
+
item
.
DOC_ID
}
})
...
...
@@ -149,7 +149,7 @@
let
list
=
resData
.
map
(
item
=>
{
return
{
...
item
,
appIconUrl
:
item
.
docIdApp
?
this
.
assetsPath
+
"/hggp/file/download/
docId/
"
+
item
.
docIdApp
:
''
appIconUrl
:
item
.
docIdApp
?
this
.
assetsPath
+
"/hggp/file/download/"
+
item
.
docIdApp
:
''
}
})
this
.
companyInfo
=
list
[
0
]
...
...
@@ -171,7 +171,7 @@
this
.
list
=
res
.
data
.
menu
.
map
(
item
=>
{
return
{
...
item
,
imagePath
:
item
.
imagePath
?
this
.
assetsPath
+
"/hggp/file/download/
docId/
"
+
item
.
imagePath
:
false
imagePath
:
item
.
imagePath
?
this
.
assetsPath
+
"/hggp/file/download/"
+
item
.
imagePath
:
false
}
});
}
else
{
...
...
pages/product-order/edit.vue
View file @
0819347e
...
...
@@ -155,8 +155,8 @@
<text
class=
"text-black text-title text-lg"
>
图片上传:
</text>
</view>
<view
class=
""
>
<u-upload
:fileList=
"fileList"
@
afterRead=
"afterRead"
@
delete=
"deletePic"
name=
"1"
multiple
:maxCount=
"6"
></u-upload>
<u-upload
:fileList=
"fileList"
@
oversize=
"afterRead"
@
afterRead=
"afterRead"
@
delete=
"deletePic"
name=
"1"
multiple
:maxCount=
"6"
:maxSize=
"1024*1024*5"
></u-upload>
</view>
</view>
...
...
@@ -233,7 +233,7 @@
this
.
orderInfo
=
{
...
rows
[
0
],
quantity
:
rows
[
0
].
unregisterQuantity
,
weight
:
Number
(
rows
[
0
].
unregisterQuantity
)
*
Number
(
rows
[
0
].
singleWeight
)
weight
:
(
Number
(
rows
[
0
].
unregisterQuantity
)
*
Number
(
rows
[
0
].
singleWeight
)).
toFixed
(
2
)
};
}
}
...
...
@@ -243,10 +243,30 @@
deletePic
(
event
)
{
this
.
fileList
.
splice
(
event
.
index
,
1
)
},
onOversize
(
fileData
){
let
indexS
=
[];
let
upLoad
=
[]
fileData
.
file
.
forEach
((
item
,
k
)
=>
{
if
(
item
.
size
>
1024
*
1024
*
5
){
indexS
.
push
(
k
+
1
)
}
else
{
upLoad
.
push
(
item
)
}
})
if
(
indexS
.
length
){
uni
.
showToast
({
icon
:
"none"
,
title
:
`图片第
${
indexS
.
join
(
'、'
)}
张,大小超出5MB限制`
,
duration
:
3000
})
}
return
upLoad
},
// 新增图片
async
afterRead
(
event
)
{
// 当设置 multiple 为 true 时, file 为数组格式,否则为对象格式
let
lists
=
[].
concat
(
event
.
file
);
console
.
log
(
event
,
"文件资源"
)
let
lists
=
this
.
onOversize
(
event
);
console
.
log
(
lists
,
9999
)
let
fileListLen
=
this
.
fileList
.
length
;
lists
.
map
((
item
)
=>
{
this
.
fileList
.
push
({
...
...
@@ -260,12 +280,13 @@
url
:
lists
[
i
].
url
})
console
.
log
(
result
,
99999
)
let
res
=
JSON
.
parse
(
result
.
data
)
let
item
=
this
.
fileList
[
fileListLen
]
this
.
fileList
.
splice
(
fileListLen
,
1
,
Object
.
assign
(
item
,
{
status
:
'success'
,
status
:
res
.
status
==
500
?
'failed'
:
'success'
,
message
:
''
,
url
:
lists
[
i
].
url
,
id
:
JSON
.
parse
(
result
.
data
)
.
id
id
:
res
.
id
}))
fileListLen
++
}
...
...
pages/product-order/index.vue
View file @
0819347e
...
...
@@ -84,12 +84,12 @@
<text
class=
"text-gray part-2"
>
:
</text>
<text
class=
"text-title"
>
{{
orderInfo
.
registeredQuantity
}}
</text>
</view>
<view
class=
"flex-row"
>
<view
v-if=
"Number(orderInfo.unregisterQuantity)"
class=
"flex-row"
>
<text
class=
"text-gray part-1"
>
待报工数量
</text>
<text
class=
"text-gray part-2"
>
:
</text>
<text
class=
"text-title"
>
{{
orderInfo
.
unregisterQuantity
}}
</text>
</view>
<view
class=
"flex-row"
>
<view
v-if=
"Number(orderInfo.unregisterWeight)"
class=
"flex-row"
>
<text
class=
"text-gray part-1"
>
待报工重量
</text>
<text
class=
"text-gray part-2"
>
:
</text>
<text
class=
"text-title"
>
{{
Number
(
orderInfo
.
unregisterWeight
)
}}
</text>
...
...
@@ -163,6 +163,7 @@
<
script
>
import
config
from
"@/config/index.config"
;
import
{
checkIsImg
}
from
"@/utils/tools.js"
;
import
{
pathToBase64
,
base64ToPath
...
...
@@ -278,12 +279,12 @@
matId
:
item
.
id
,
bizType
:
"SCBG"
})
let
imgList
=
toJsonData
(
imgDatas
.
data
.
__blocks__
.
result
.
rows
,
imgDatas
.
data
.
__blocks__
.
result
.
meta
.
columns
)
let
imgList
=
toJsonData
(
imgDatas
.
data
.
__blocks__
.
result
.
rows
,
imgDatas
.
data
.
__blocks__
.
result
.
meta
.
columns
)
.
filter
(
item
=>
checkIsImg
(
item
.
docName
))
list
.
push
({
...
item
,
imgList
:
imgList
.
length
?
imgList
.
map
(
val
=>
{
return
{
url
:
this
.
assetsPath
+
"/hggp/file/download/
docId/
"
+
val
.
docId
url
:
this
.
assetsPath
+
"/hggp/file/download/"
+
val
.
docId
}
}):[]
})
...
...
utils/tools.js
View file @
0819347e
...
...
@@ -182,3 +182,9 @@ export function formatForLen14 (dateStr) {
}
return
dateStr
}
export
function
checkIsImg
(
fileName
){
const
extension
=
fileName
.
split
(
"."
).
pop
().
toLowerCase
();
const
imgExtensions
=
[
"jpg"
,
"png"
,
"jpeg"
,
"gif"
,
"bmp"
,
"webp"
,
"svg"
]
return
imgExtensions
.
includes
(
extension
)
}
\ No newline at end of file
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