Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
梁建民
/
wmsMin
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
56e7358b
authored
May 09, 2024
by
LJM
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
add
parent
6a623e37
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
352 additions
and
143 deletions
assets/css/tally/index.scss
pages/goods/addReceiving.vue
pages/home/index.vue
pages/mine/index.vue
pages/mine/login.vue
pages/tally/abnormalTally.vue
pages/tally/index.vue
pages/tally/printBox.vue
pages/tallyGoods/exception.vue
util/api.js
assets/css/tally/index.scss
View file @
56e7358b
...
...
@@ -88,6 +88,7 @@
transition
:
all
0
.4s
ease
;
&
.disabled
{
background-color
:
#f2f9ff
;
border
:
1px
solid
#bbdcfd
;
}
.pb16
{
padding-bottom
:
16rpx
;
...
...
pages/goods/addReceiving.vue
View file @
56e7358b
...
...
@@ -178,6 +178,8 @@
this
.
noexebshowFalg
=
false
;
//不允许再次触发onshow这个生命周期
var
self
=
this
;
var
time
=
parseInt
(
new
Date
().
getTime
()
/
1000
);
// #ifdef MP-WEIXIN
uni
.
chooseMedia
({
count
:
4
,
mediaType
:
[
'image'
],
...
...
@@ -225,6 +227,58 @@
}
}
});
// #endif
// #ifdef APP-PLUS
uni
.
chooseImage
({
count
:
4
,
sizeType
:
[
'original'
,
'compressed'
],
sourceType
:
[
'album'
,
'camera'
],
success
:
chooseImageRes
=>
{
uni
.
showLoading
({
title
:
'上传中...'
});
const
tempFilePaths
=
chooseImageRes
.
tempFilePaths
;
let
maxNum
=
tempFilePaths
.
length
*
1
+
self
.
form
.
check_in_pic
.
length
*
1
;
if
(
maxNum
>
4
)
{
uni
.
hideLoading
();
uni
.
showToast
({
title
:
'图片不超过4张'
});
return
false
;
}
for
(
let
i
=
0
;
i
<
tempFilePaths
.
length
;
i
++
)
{
uni
.
uploadFile
({
url
:
API
.
upload
,
filePath
:
tempFilePaths
[
i
],
name
:
'upload'
,
formData
:
{
source
:
'1'
,
k1
:
time
,
k2
:
w_md5
.
hex_md5_32
(
w_md5
.
hex_md5_32
(
String
(
time
))
+
'fh6y5t4rr351d2c3bryi'
)
},
success
:
uploadFileRes
=>
{
uni
.
hideLoading
();
var
data
=
JSON
.
parse
(
uploadFileRes
.
data
);
if
(
data
.
code
===
200
)
{
self
.
form
.
check_in_pic
.
push
(
data
.
data
[
0
]);
}
else
{
uni
.
showToast
({
title
:
data
.
message
,
icon
:
'error'
});
}
},
fail
:
error
=>
{
uni
.
hideLoading
();
}
});
}
}
});
// #endif
},
inputChange
()
{
if
(
this
.
form
.
check_in_remark
.
length
<=
200
)
{
...
...
pages/home/index.vue
View file @
56e7358b
...
...
@@ -2,12 +2,22 @@
<view
class=
"home-index"
>
<view
class=
"head"
>
<!-- 未登录 -->
<!-- #ifdef MP-WEIXIN -->
<navigator
class=
"row verCenter box"
v-if=
"!is_login"
url=
"/pages/mine/auth"
hover-class=
"none"
>
<view
class=
"row verCenter"
>
<text
class=
"iconfont icon-juxing"
></text>
<text
class=
"t1"
>
未登录
</text>
</view>
</navigator>
<!-- #endif -->
<!-- #ifdef APP-PLUS -->
<navigator
class=
"row verCenter box"
v-if=
"!is_login"
url=
"/pages/mine/login"
hover-class=
"none"
>
<view
class=
"row verCenter"
>
<text
class=
"iconfont icon-juxing"
></text>
<text
class=
"t1"
>
未登录
</text>
</view>
</navigator>
<!-- #endif -->
<!-- 已登录 -->
<view
class=
"row bothSide verCenter box"
v-else
>
<view
class=
"row verCenter"
>
...
...
@@ -58,6 +68,7 @@
is_login
:
false
,
userInfo
:
{},
rawData
:
''
,
// #ifdef MP-WEIXIN
gridList
:
[{
name
:
'快递回单上传'
,
iconfont
:
'icon-a-juxing1'
,
...
...
@@ -139,6 +150,20 @@
tips
:
''
}
]
// #endif
// #ifdef APP-PLUS
gridList
:
[{
name
:
'收货登记'
,
iconfont
:
'icon-juxing3'
,
tips
:
''
},
{
name
:
'入库理货'
,
iconfont
:
'icon-a-10cangkucangchu4'
,
tips
:
''
}
]
// #endif
};
},
onShow
()
{
...
...
@@ -187,27 +212,37 @@
});
},
toUrl
()
{
// #ifdef MP-WEIXIN
uni
.
navigateTo
({
url
:
'/pages/mine/auth'
});
// #endif
// #ifdef APP-PLUS
uni
.
navigateTo
({
url
:
'/pages/mine/login'
});
// #endif
},
gridClick
(
item
,
index
)
{
if
(
item
.
name
==
'快递回单上传'
)
{
this
.
scanChange
();
}
else
if
(
item
.
name
==
'打印标签'
)
{
// #ifdef MP-WEIXIN
uni
.
navigateTo
({
url
:
'/pages/tag/print'
});
//是否启用蓝牙wifi打印
// if (this.userInfo.is_new_print == 1) {
// uni.navigateTo({
// url: '/pages/tag/printNew'
// });
// } else {
// uni.navigateTo({
// url: '/pages/tag/print'
// });
// }
// #endif
// #ifdef APP-PLUS
uni
.
navigateTo
({
url
:
'/pages/tag/printNew'
});
// #endif
}
else
if
(
item
.
name
==
'追加标签'
)
{
uni
.
navigateTo
({
url
:
'/pages/tag/repairPrint'
...
...
pages/mine/index.vue
View file @
56e7358b
...
...
@@ -11,7 +11,7 @@
<
template
v-else
>
<view
class=
"logged-in row bothSide verCenter"
>
<view
class=
"row verCenter"
>
<image
class=
"uni-img"
:src=
"userData.head_pic || 'http://img.ichunt.com/images/ichunt/minProgram/scm/14ec21333cd69cc5269772811b46b7ac.png'
"
mode=
"aspectFill"
></image>
<image
class=
"uni-img"
src=
"http://img.ichunt.com/images/ichunt/minProgram/scm/14ec21333cd69cc5269772811b46b7ac.png
"
mode=
"aspectFill"
></image>
<view
class=
"text column"
>
<text
class=
"t1"
>
{{
userInfo
.
name
}}
</text>
<text
class=
"t2"
>
{{
userInfo
.
email
}}
</text>
...
...
@@ -25,54 +25,63 @@
</template>
<
script
>
import
{
API
}
from
'@/util/api.js'
;
export
default
{
data
()
{
return
{
is_login
:
false
,
userInfo
:
{}
};
},
onShow
()
{
this
.
getData
();
},
methods
:
{
getData
()
{
this
.
request
(
API
.
userInfo
,
'POST'
,
{},
false
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
this
.
userInfo
=
res
.
data
;
this
.
is_login
=
true
;
}
else
{
this
.
is_login
=
false
;
}
});
import
{
API
}
from
'@/util/api.js'
;
export
default
{
data
()
{
return
{
is_login
:
false
,
userInfo
:
{}
};
},
toUrl
()
{
uni
.
navigateTo
({
url
:
'/pages/mine/auth'
});
onShow
()
{
this
.
getData
();
},
exit
()
{
uni
.
showModal
({
title
:
'提示'
,
content
:
'您确定退出系统嘛'
,
success
:
res
=>
{
if
(
res
.
confirm
)
{
this
.
request
(
API
.
unBindUserInfo
,
'POST'
,
{},
true
).
then
(
res
=>
{});
uni
.
removeStorageSync
(
'token'
);
uni
.
switchTab
({
url
:
'/pages/home/index'
});
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
);
methods
:
{
getData
()
{
this
.
request
(
API
.
userInfo
,
'POST'
,
{},
false
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
this
.
userInfo
=
res
.
data
;
this
.
is_login
=
true
;
}
else
{
this
.
is_login
=
false
;
}
});
},
toUrl
()
{
// #ifdef MP-WEIXIN
uni
.
navigateTo
({
url
:
'/pages/mine/auth'
});
// #endif
// #ifdef APP-PLUS
uni
.
navigateTo
({
url
:
'/pages/mine/login'
});
// #endif
},
exit
()
{
uni
.
showModal
({
title
:
'提示'
,
content
:
'您确定退出系统嘛'
,
success
:
res
=>
{
if
(
res
.
confirm
)
{
this
.
request
(
API
.
unBindUserInfo
,
'POST'
,
{},
true
).
then
(
res
=>
{});
uni
.
removeStorageSync
(
'token'
);
uni
.
switchTab
({
url
:
'/pages/home/index'
});
}
else
if
(
res
.
cancel
)
{
console
.
log
(
'用户点击取消'
);
}
}
}
}
);
}
);
}
}
}
};
};
</
script
>
<
style
lang=
"scss"
>
@import
'../../assets/css/mine/index.scss'
;
</
style
>
@import
'../../assets/css/mine/index.scss'
;
</
style
>
\ No newline at end of file
pages/mine/login.vue
View file @
56e7358b
...
...
@@ -18,59 +18,59 @@
</
template
>
<
script
>
import
{
API
}
from
'@/util/api.js'
;
import
{
API
}
from
'@/util/api.js'
;
export
default
{
data
()
{
return
{
account
:
''
,
passwd
:
''
};
},
onLoad
(
options
)
{},
onShareTimeline
(
res
)
{
return
{
title
:
''
,
imageUrl
:
''
};
},
methods
:
{
submit
()
{
if
(
!
this
.
account
)
{
uni
.
showToast
({
title
:
'请输入登录账号'
,
icon
:
'error'
});
return
false
;
}
if
(
!
this
.
passwd
)
{
uni
.
showToast
({
title
:
'请输入登录密码'
,
icon
:
'error'
});
return
false
;
}
let
unionid
=
uni
.
getStorageSync
(
'unionid'
);
this
.
request
(
API
.
login
,
'POST'
,
{
account
:
this
.
account
,
passwd
:
this
.
passwd
,
unionid
:
unionid
},
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
uni
.
setStorageSync
(
'token'
,
res
.
data
.
token
);
uni
.
navigateBack
({
delta
:
3
export
default
{
data
()
{
return
{
account
:
''
,
passwd
:
''
};
},
onShareTimeline
()
{
return
{
title
:
''
,
imageUrl
:
''
};
},
methods
:
{
submit
()
{
if
(
!
this
.
account
)
{
uni
.
showToast
({
title
:
'请输入登录账号'
,
icon
:
'error'
});
}
else
{
return
false
;
}
if
(
!
this
.
passwd
)
{
uni
.
showToast
({
title
:
res
.
err_msg
,
title
:
'请输入登录密码'
,
icon
:
'error'
});
return
false
;
}
});
let
unionid
=
uni
.
getStorageSync
(
'unionid'
);
this
.
request
(
API
.
login
,
'POST'
,
{
account
:
this
.
account
,
passwd
:
this
.
passwd
,
unionid
:
unionid
},
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
uni
.
setStorageSync
(
'token'
,
res
.
data
.
token
);
uni
.
setStorageSync
(
'email'
,
res
.
data
.
email
);
uni
.
navigateBack
({
delta
:
3
});
}
else
{
uni
.
showToast
({
title
:
res
.
err_msg
,
icon
:
'error'
});
}
});
}
}
}
};
};
</
script
>
<
style
lang=
"scss"
>
@import
'../../assets/css/mine/login.scss'
;
</
style
>
@import
'../../assets/css/mine/login.scss'
;
</
style
>
\ No newline at end of file
pages/tally/abnormalTally.vue
View file @
56e7358b
...
...
@@ -123,6 +123,7 @@
export
default
{
data
()
{
return
{
email
:
uni
.
getStorageSync
(
'email'
)
||
''
,
//操作人邮箱
curr
:
0
,
arr
:
[
'全部未装箱'
,
'美产'
,
'商检'
,
'已装箱'
],
num
:
''
,
//异常数量总数
...
...
@@ -298,8 +299,13 @@
});
return
false
;
}
this
.
request
(
API
.
fixBox
,
'POST'
,
{
old_box_sn_str
:
this
.
old_box_sn_str
},
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
var
params
=
{
type
:
1
,
email
:
this
.
email
,
print_json
:
JSON
.
stringify
([{
box_sn
:
this
.
box_sn
}])
}
this
.
request
(
API
.
addSCTallyData
,
'POST'
,
params
,
true
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
uni
.
showModal
({
title
:
''
,
content
:
'打印成功,请查看打印机'
,
...
...
pages/tally/index.vue
View file @
56e7358b
...
...
@@ -222,6 +222,7 @@
export
default
{
data
()
{
return
{
email
:
uni
.
getStorageSync
(
'email'
)
||
''
,
//操作人邮箱
is_focus
:
true
,
//获取焦点动态化
title
:
''
,
step
:
0
,
...
...
@@ -243,7 +244,8 @@
form
:
{},
isRequestSent
:
false
,
isStopRequest
:
false
,
gross_weight
:
''
gross_weight
:
''
,
net_weight_total
:
0
//净重合计
};
},
watch
:
{
...
...
@@ -336,6 +338,7 @@
chooseImageChange
(
key
)
{
this
.
noexebshowFalg
=
false
;
// 使用 chooseImage选择图片
// #ifdef MP-WEIXIN
uni
.
chooseMedia
({
count
:
5
,
mediaType
:
[
'image'
],
...
...
@@ -413,6 +416,87 @@
});
}
});
// #endif
// #ifdef APP-PLUS
uni
.
chooseImage
({
count
:
5
,
sizeType
:
[
'original'
,
'compressed'
],
sourceType
:
[
'album'
,
'camera'
],
success
:
chooseImageRes
=>
{
console
.
log
(
'选择图片成功:'
,
chooseImageRes
);
// 显示loading
uni
.
showLoading
({
title
:
'上传中...'
});
// 获取选择的图片路径数组
const
imagePaths
=
chooseImageRes
.
tempFilePaths
;
// 判断选择的图片数量是否超过最大限制数量
let
maxNum
=
Number
(
imagePaths
.
length
)
+
Number
(
this
.
image_list
.
length
);
//当前上传的+已经上传的
if
(
maxNum
>
5
)
{
uni
.
hideLoading
();
uni
.
showToast
({
title
:
'图片不超过5张'
,
icon
:
'none'
});
return
false
;
}
// 遍历图片路径数组,对每张图片进行压缩
imagePaths
.
forEach
((
imagePath
)
=>
{
// 使用compressImage 压缩图片
uni
.
compressImage
({
src
:
imagePath
,
quality
:
60
,
//压缩质量,范围0~100,数值越小,质量越低,压缩率越高
success
:
compressedRes
=>
{
console
.
log
(
'压缩图片成功:'
,
compressedRes
);
// 获取压缩后的图片路径
const
compressedImagePath
=
compressedRes
.
tempFilePath
;
// 在这里处理压缩后的图片,上传到服务器
uni
.
uploadFile
({
url
:
API
.
uploadImageHk
+
'?sys_type=4'
,
filePath
:
compressedImagePath
,
name
:
'file'
,
timeout
:
10000
,
header
:
{
'Content-Type'
:
'multipart/form-data'
},
success
:
uploadFileRes
=>
{
console
.
log
(
'服务器上传图片成功:'
,
uploadFileRes
);
uni
.
hideLoading
();
let
data
=
JSON
.
parse
(
uploadFileRes
.
data
);
if
(
data
.
code
===
0
)
{
this
.
image_list
[
key
].
push
(
data
.
data
.
oss_image_url
);
this
.
$forceUpdate
();
}
else
{
uni
.
showToast
({
title
:
data
.
msg
,
icon
:
'none'
});
}
},
fail
:
()
=>
{
uni
.
hideLoading
();
uni
.
showToast
({
title
:
'上传图片失败'
,
icon
:
'none'
});
}
});
},
fail
:
err
=>
{
console
.
log
(
'压缩图片失败:'
,
err
);
}
});
});
}
});
// #endif
},
/**
* 预览图片
...
...
@@ -559,6 +643,7 @@
if
(
res
.
data
.
detail
.
length
>
0
)
{
// 使用 map 方法生成表单数组
this
.
form
=
res
.
data
.
detail
.
map
((
item
)
=>
({
tally_status
:
item
.
tally_status
,
//理货状态
tally_num
:
item
.
tally_num
,
// 入库数量
origin
:
item
.
origin
,
// 原产地
net_weight
:
item
.
net_weight
,
// 净重
...
...
@@ -571,6 +656,8 @@
this
.
image_list
=
res
.
data
.
detail
.
map
(()
=>
new
Array
());
//图片特殊处理
//还原理货的图片
res
.
data
.
detail
.
forEach
((
item
,
index
)
=>
{
if
(
item
.
goods_check_pic
)
{
this
.
image_list
[
index
]
=
item
.
goods_check_pic
.
split
(
','
);
...
...
@@ -696,7 +783,10 @@
* 关单封箱
*/
closeBox
()
{
this
.
title
=
`入仓号
${
this
.
erp_order_sn
}
已经全部验货完毕是否更换新的箱子?`
;
this
.
net_weight_total
=
this
.
form
.
filter
(
item
=>
item
.
tally_status
===
3
)
// 筛选出 tally_status 等于 3 的数据
.
reduce
((
acc
,
curr
)
=>
acc
+
parseFloat
(
curr
.
net_weight
),
0
);
// 将 net_weight 转换为数字并计算总和
this
.
title
=
`入仓号
${
this
.
erp_order_sn
}
已经全部验货完毕是否更换新的箱子?\n\n总净重:
${
this
.
net_weight_total
}
`
;
this
.
$refs
.
inputDialog
.
open
();
},
/**
...
...
@@ -710,6 +800,23 @@
});
return
false
;
}
// 判断 val 是否为数字
if
(
isNaN
(
val
))
{
uni
.
showToast
({
title
:
'请输入合法数字'
,
icon
:
'error'
});
return
false
;
}
if
(
Number
(
val
)
<
Number
(
this
.
net_weight_total
))
{
uni
.
showToast
({
title
:
'毛重不能小于总净重'
,
icon
:
'none'
});
return
false
;
}
this
.
request
(
API
.
closeBox
,
'POST'
,
{
wsty_id
:
this
.
wsty_id
,
gross_weight
:
val
},
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
uni
.
showToast
({
...
...
@@ -736,32 +843,9 @@
* 不需要换箱
*/
dialogInputClose
()
{
if
(
!
this
.
gross_weight
)
{
uni
.
showToast
({
title
:
'请输入毛重'
,
icon
:
'error'
});
return
false
;
}
this
.
request
(
API
.
closeBox
,
'POST'
,
{
wsty_id
:
this
.
wsty_id
,
gross_weight
:
this
.
gross_weight
},
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
uni
.
showToast
({
title
:
'操作成功'
,
icon
:
'success'
,
duration
:
2000
});
setTimeout
(()
=>
{
this
.
$refs
.
inputDialog
.
close
();
this
.
tallyData
=
[];
this
.
erp_order_sn
=
''
;
},
2000
);
}
else
{
uni
.
showToast
({
title
:
res
.
err_msg
,
icon
:
'none'
});
}
});
this
.
$refs
.
inputDialog
.
close
();
this
.
tallyData
=
[];
this
.
erp_order_sn
=
''
;
},
/**
* 打印箱号
...
...
@@ -775,8 +859,13 @@
});
return
false
;
}
this
.
request
(
API
.
fixBox
,
'POST'
,
{
old_box_sn_str
:
this
.
old_box_sn_str
},
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
var
params
=
{
type
:
1
,
email
:
this
.
email
,
print_json
:
JSON
.
stringify
([{
box_sn
:
this
.
box_sn
}])
}
this
.
request
(
API
.
addSCTallyData
,
'POST'
,
params
,
true
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
uni
.
showModal
({
title
:
''
,
content
:
'打印成功,请查看打印机'
,
...
...
pages/tally/printBox.vue
View file @
56e7358b
...
...
@@ -13,6 +13,7 @@
export
default
{
data
()
{
return
{
email
:
uni
.
getStorageSync
(
'email'
)
||
''
,
//操作人邮箱
is_focus
:
true
,
//获取焦点动态化
box_sn
:
''
};
...
...
@@ -27,8 +28,13 @@
});
return
false
;
}
this
.
request
(
API
.
fixBox
,
'POST'
,
{
old_box_sn_str
:
this
.
old_box_sn_str
},
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
var
params
=
{
type
:
1
,
email
:
this
.
email
,
print_json
:
JSON
.
stringify
([{
box_sn
:
this
.
box_sn
}])
}
this
.
request
(
API
.
addSCTallyData
,
'POST'
,
params
,
true
).
then
(
res
=>
{
if
(
res
.
code
===
0
)
{
uni
.
showModal
({
title
:
''
,
content
:
'打印成功,请查看打印机'
,
...
...
pages/tallyGoods/exception.vue
View file @
56e7358b
...
...
@@ -196,6 +196,18 @@
this
.
request
(
API
.
askCustomerProblemListV2
,
'GET'
,
this
.
searchParams
,
true
).
then
(
res
=>
{
if
(
res
.
err_code
===
0
)
{
this
.
list
=
res
.
data
.
data
;
}
else
if
(
res
.
err_code
==
20045
)
{
// #ifdef MP-WEIXIN
uni
.
navigateTo
({
url
:
'/pages/mine/auth'
});
// #endif
// #ifdef APP-PLUS
uni
.
navigateTo
({
url
:
'/pages/mine/login'
});
// #endif
}
else
{
uni
.
showToast
({
title
:
res
.
err_msg
,
...
...
@@ -212,11 +224,6 @@
if
(
res
.
err_code
===
0
)
{
this
.
ask_customer_status_one_num
=
res
.
data
.
ask_customer_status_one_num
;
//商务已回复更新统计数量
this
.
ask_customer_status_two_num
=
res
.
data
.
ask_customer_status_two_num
;
//等待回复更新统计数量
}
else
{
uni
.
showToast
({
title
:
res
.
err_msg
,
icon
:
'none'
});
}
});
},
...
...
util/api.js
View file @
56e7358b
...
...
@@ -299,9 +299,9 @@ const API = {
*/
cancelRelease
:
API_BASE
+
'/supplywechatwms/cancelRelease'
,
/**
*
识别二维码的数量和型号
*
*
/
identifyQrCodeNumAndSn
:
API_BASE_WMS
+
'/api/stockIn/identifyQrCodeNumAndSn'
,
*
供应链理货打印 - 箱号标签
*/
addSCTallyData
:
API_BASE_WMS
+
'/open/label/addSCTallyData'
}
...
...
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