Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-app-operator-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
lanbaoming
jiedao-app-operator-master
Commits
49e39287
Commit
49e39287
authored
Jan 29, 2024
by
zhoutong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
后台出仓详情优化
parent
b5a9563c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
88 additions
and
2 deletions
+88
-2
startCheckout.vue
...s/ecw/box/shippingAir/nodePage/checkout/startCheckout.vue
+28
-2
utils.js
src/views/ecw/box/shippingAir/utils.js
+60
-0
No files found.
src/views/ecw/box/shippingAir/nodePage/checkout/startCheckout.vue
View file @
49e39287
...
@@ -89,7 +89,12 @@
...
@@ -89,7 +89,12 @@
<el-row>
<el-row>
<el-col
:span=
"6"
class=
"totle-info"
>
<el-col
:span=
"6"
class=
"totle-info"
>
<div
class=
"count-info"
>
<div
class=
"count-info"
>
<p>
{{$t('总计')}}:{{getSumData}}
</p>
<p>
{{ $t('合包后总箱数')}}:{{ getpkgSunData }}
</p>
</div>
</el-col>
<el-col
:span=
"6"
class=
"totle-info"
>
<div
class=
"count-info"
>
<p>
{{$t('订单总箱数')}}:{{getSumData}}
</p>
</div>
</div>
<!-- <div>
<!-- <div>
<p>{{$t('容量')}}:</p>
<p>{{$t('容量')}}:</p>
...
@@ -97,6 +102,16 @@
...
@@ -97,6 +102,16 @@
</div>
</div>
<div>{{$t('已装')}} {{getInstallNumCount}} {{$t('箱')}}</div> -->
<div>{{$t('已装')}} {{getInstallNumCount}} {{$t('箱')}}</div> -->
</el-col>
</el-col>
<el-col
:span=
"6"
class=
"totle-info"
>
<div
class=
"count-info"
>
<p>
{{ $t('合包后已出箱数')}}:{{ getpkgOutData }}
</p>
</div>
</el-col>
<el-col
:span=
"6"
class=
"totle-info"
>
<div
class=
"count-info"
>
<p>
{{ $t('订单已出箱数')}}:{{ getOrderOutData }}
</p>
</div>
</el-col>
</el-row>
</el-row>
<el-row
style=
"margin-top: 20px;"
>
<el-row
style=
"margin-top: 20px;"
>
<el-button
type=
"primary"
@
click=
"submitCheckout"
>
{{$t('确认出仓')}}
</el-button>
<el-button
type=
"primary"
@
click=
"submitCheckout"
>
{{$t('确认出仓')}}
</el-button>
...
@@ -205,6 +220,8 @@ import {
...
@@ -205,6 +220,8 @@ import {
serviceMsg
,
serviceMsg
,
getCapacity
,
getCapacity
,
sumStatistics
,
sumStatistics
,
allTotalStatistics
,
getAllTotlContent
}
from
"
../../utils
"
;
}
from
"
../../utils
"
;
import
Decimal
from
"
decimal.js
"
;
import
Decimal
from
"
decimal.js
"
;
import
{
getChannelList
}
from
"
@/api/ecw/channel
"
;
import
{
getChannelList
}
from
"
@/api/ecw/channel
"
;
...
@@ -557,8 +574,17 @@ export default {
...
@@ -557,8 +574,17 @@ export default {
return
getCapacity
(
cabinetRespVO
);
return
getCapacity
(
cabinetRespVO
);
},
},
/* 总计 */
/* 总计 */
getpkgSunData
()
{
return
allTotalStatistics
(
this
.
listData
,
[
"
mergeNum
"
,
"
mergeVolume
"
,
"
mergeWeight
"
]);
},
getSumData
()
{
getSumData
()
{
return
sumStatistics
(
this
.
listData
);
return
allTotalStatistics
(
this
.
listData
,
[
"
num
"
,
"
volume
"
,
"
weight
"
]);
},
getpkgOutData
()
{
return
allTotalStatistics
(
this
.
listData
,
[
"
checkoutMergeNum
"
,
"
checkoutMergeVolume
"
,
"
checkoutMergeWeight
"
]);
},
getOrderOutData
()
{
return
allTotalStatistics
(
this
.
listData
,
[
"
checkoutOrderNum
"
,
"
checkoutOrderVolume
"
,
"
checkoutOrderWeight
"
]);
},
},
/* 已装总数 */
/* 已装总数 */
getInstallNumCount
()
{
getInstallNumCount
()
{
...
...
src/views/ecw/box/shippingAir/utils.js
View file @
49e39287
...
@@ -1420,6 +1420,64 @@ function sumStatistics(val) {
...
@@ -1420,6 +1420,64 @@ function sumStatistics(val) {
return getTotlContent(count);
return getTotlContent(count);
}
}
function allTotalStatistics(val, type = ["num", "volume", "weight"]) {
// let count = { type[0]: 0, type[1]: 0, type[2]: 0 };
let count = {}
count[type[0]] = 0;
count[type[1]] = 0;
count[type[2]] = 0;
if (Array.isArray(val)) {
val.forEach((item) => {
const { secStatistics } = item;
if (secStatistics) {
if (!Number.isNaN(Number(secStatistics[type[0]]))) {
count[type[0]] = Decimal.add(
count[type[0]],
Number(secStatistics[type[0]])
).toNumber();
}
if (!Number.isNaN(Number(secStatistics[type[1]]))) {
console.log(secStatistics[type[1]],count[type[1]],'1111');
count[type[1]] = Decimal.add(
count[type[1]],
Number(secStatistics[type[1]])
).toNumber();;
console.log(secStatistics[type[1]],count[type[1]],'2222');
}
if (!Number.isNaN(Number(secStatistics[type[2]]))) {
count[type[2]] = Decimal.add(
count[type[2]],
Number(secStatistics[type[2]])
).toNumber();;
}
}
});
}
return getAllTotlContent(count, type);
}
function getAllTotlContent(total, keys = ["num", "volume", "weight"]) {
let content = [];
const regexNum = new RegExp('num', 'i');
const regexVolume = new RegExp('volume', 'i');
const regexWeight = new RegExp('weight', 'i');
for (const key of keys) {
if (regexNum.test(key)) {
content.push(`
$
{
total
[
key
]
??
0
}
$
{
i18n
.
$t
(
"
箱
"
)}
`);
}
if (regexVolume.test(key)) {
let volume = total[key] ?? 0;
content.push(`
$
{
volume
}
m
³
`);
}
if (regexWeight.test(key)) {
let weight = total[key] ?? 0;
content.push(`
$
{
weight
}
kg
`);
}
}
return content.join(" ");
}
export const fileTypes = [
export const fileTypes = [
"doc",
"doc",
"xls",
"xls",
...
@@ -1509,4 +1567,6 @@ export {
...
@@ -1509,4 +1567,6 @@ export {
toReviewDetail,
toReviewDetail,
downloadFile,
downloadFile,
downloadFileByUrl,
downloadFileByUrl,
allTotalStatistics,
getAllTotlContent
};
};
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