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
18983f23
Commit
18983f23
authored
Jan 06, 2024
by
我在何方
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://gitlab.jdshangmen.com/jiedao-app/jiedao-app-operator
into dev
parents
cf42a904
9ab53b11
Changes
36
Hide whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
4089 additions
and
1286 deletions
+4089
-1286
boxAir.js
src/api/ecw/boxAir.js
+105
-0
customerContacts.js
src/api/ecw/customerContacts.js
+33
-0
productPrice.js
src/api/ecw/productPrice.js
+9
-0
region.js
src/api/ecw/region.js
+9
-1
index.vue
src/views/bpm/processInstance/index.vue
+5
-0
copy.vue
src/views/bpm/task/copy.vue
+4
-0
done.vue
src/views/bpm/task/done.vue
+2
-2
checkout.vue
src/views/ecw/box/shippingAir/nodePage/checkout.vue
+16
-1
startCheckout.vue
...s/ecw/box/shippingAir/nodePage/checkout/startCheckout.vue
+646
-0
pkgPage.vue
src/views/ecw/box/shippingAir/nodePage/mergePkg/pkgPage.vue
+313
-11
index.vue
src/views/ecw/box/shippingAir/nodePage/tally/index.vue
+184
-22
packaging-type.vue
src/views/ecw/channel/componrnts/packaging-type.vue
+19
-26
edit.vue
src/views/ecw/channel/edit.vue
+363
-349
allAchievement.vue
src/views/ecw/deptTarget/allAchievement.vue
+22
-18
myAchievement.vue
src/views/ecw/deptTarget/myAchievement.vue
+9
-15
myDeptAchievement.vue
src/views/ecw/deptTarget/myDeptAchievement.vue
+10
-25
total_num.vue
src/views/ecw/deptTarget/total_num.vue
+53
-0
all-routes-list.vue
src/views/ecw/offer/all-routes-list.vue
+193
-0
channel-route.vue
src/views/ecw/offer/channel-route.vue
+320
-0
airFreightRouteTemplate.vue
src/views/ecw/offer/components/airFreightRouteTemplate.vue
+124
-0
edit.vue
src/views/ecw/order/edit.vue
+19
-1
index.vue
src/views/ecw/product/index.vue
+81
-74
batchEdit.vue
src/views/ecw/productPrice/batchEdit.vue
+8
-2
batchEditAir.vue
src/views/ecw/productPrice/batchEditAir.vue
+8
-11
batchIncrease.vue
src/views/ecw/productPrice/batchIncrease.vue
+204
-141
batchIncreaseAir.vue
src/views/ecw/productPrice/batchIncreaseAir.vue
+325
-0
Logs.vue
src/views/ecw/productPrice/components/Logs.vue
+70
-23
PriceStep.vue
src/views/ecw/productPrice/components/PriceStep.vue
+19
-13
QuickSet.vue
src/views/ecw/productPrice/components/QuickSet.vue
+51
-2
SeaPrice.vue
src/views/ecw/productPrice/components/SeaPrice.vue
+220
-0
SeaStep.vue
src/views/ecw/productPrice/components/SeaStep.vue
+258
-0
ShowStepPriceItem.vue
src/views/ecw/productPrice/components/ShowStepPriceItem.vue
+68
-0
edit.vue
src/views/ecw/productPrice/edit.vue
+215
-455
editAir.vue
src/views/ecw/productPrice/editAir.vue
+14
-26
index.vue
src/views/ecw/productPrice/index.vue
+88
-68
index.vue
src/views/ecw/warehouse/index.vue
+2
-0
No files found.
src/api/ecw/boxAir.js
View file @
18983f23
...
...
@@ -402,4 +402,109 @@ export function downloadLoadGoods(params) {
timeout
:
120000
,
params
,
})
}
/**
* 创建理货和合包标签
*
* @export
* @param {*} data
* @return {*}
*/
export
function
checkInfoSingleCreate
(
data
)
{
return
request
({
url
:
`/ecw/box-order-check-info/singleCreate`
,
method
:
"
post
"
,
data
:
data
});
}
/**
* 批量创建理货和合包标签
*
* @export
* @param {*} data
* @return {*}
*/
export
function
checkInfoBatchCreate
(
data
)
{
return
request
({
url
:
`/ecw/box-order-check-info/batchCreate`
,
method
:
"
post
"
,
data
:
data
});
}
/**
* 删除理货和合包标签
*
* @export
* @param {*} data
* @return {*}
*/
export
function
checkInfoSingleDelete
(
data
)
{
return
request
({
url
:
`/ecw/box-order-check-info/singleDelete`
,
method
:
"
post
"
,
data
:
data
});
}
/**
* 批量删除理货和合包标签
*
* @export
* @param {*} data
* @return {*}
*/
export
function
checkInfoBatchDelete
(
data
)
{
return
request
({
url
:
`/ecw/box-order-check-info/batchDelete`
,
method
:
"
post
"
,
data
:
data
});
}
/**
* 获取订单理货,合包编号列表
*
* @export
* @param {*} data
* @return {*}
*/
export
function
getOrderTagList
(
params
)
{
return
request
({
url
:
`/ecw/box-order-check-info/orderTagList`
,
method
:
"
get
"
,
params
});
}
/**
* 根据箱号、订单号查找订单号码,理货和合包使用
*
* @export
* @param {*} data
* @return {*}
*/
export
function
searchLoadOrderByBoxNo
(
data
)
{
return
request
({
url
:
`/ecw/box-order-check-info/searchLoadOrderByBoxNo`
,
method
:
"
post
"
,
data
:
data
});
}
/**
* 确认出仓
*
* @export
* @param {*} data
* @return {*}
*/
export
function
confirmAirCheckout
(
params
)
{
return
request
({
url
:
`/ecw/box-air-checkout/confirmAirCheckout`
,
method
:
"
get
"
,
params
});
}
\ No newline at end of file
src/api/ecw/customerContacts.js
View file @
18983f23
...
...
@@ -81,3 +81,36 @@ export function getCustomerContactsListByCustomer(query) {
return
Promise
.
resolve
()
}
}
//全部列表数据
export
function
warehouseLinePage
(
params
){
return
request
({
url
:
'
/ecw/warehouse-line/page
'
,
method
:
'
get
'
,
params
,
})
}
//获得空运线路模板
export
function
getAirLineChannelTemplateList
(
params
){
return
request
({
url
:
'
/ecw/warehouse-line/get-air-line-channel-template-list
'
,
method
:
'
get
'
,
params
})
}
// 根据线路id渠道列表和清关费(复制使用)
export
function
getAirLineChannelPackagingList
(
id
){
return
request
({
url
:
'
/ecw/warehouse-line/get-air-line-channel-packaging-list
'
,
method
:
'
get
'
,
params
:{
lineId
:
id
}
})
}
// 创建仓库线路的渠道包装
export
function
createWarehouseLineChannelPackaging
(
data
){
return
request
({
url
:
'
/ecw/warehouse-line/create-warehouse-line-channel-packaging
'
,
method
:
'
put
'
,
data
})
}
src/api/ecw/productPrice.js
View file @
18983f23
...
...
@@ -150,3 +150,12 @@ export function batchAddPrice(data) {
data
})
}
// 批量加价空运
export
function
batchAddPriceAir
(
data
)
{
return
request
({
url
:
'
/ecw/product-price/batchAddPriceAir
'
,
method
:
'
put
'
,
data
})
}
src/api/ecw/region.js
View file @
18983f23
...
...
@@ -98,6 +98,14 @@ export function getTradeCityList(query) {
params
:
query
})
}
// 获得目的地国家
export
function
getTradeCountryList
(
query
)
{
return
request
({
url
:
'
/ecw/region/getTradeCountryList
'
,
method
:
'
get
'
,
params
:
query
})
}
export
function
listByIds
(
params
){
...
...
@@ -106,4 +114,4 @@ export function listByIds(params){
method
:
'
get
'
,
params
})
}
\ No newline at end of file
}
src/views/bpm/processInstance/index.vue
View file @
18983f23
...
...
@@ -30,6 +30,10 @@
:key=
"dict.value"
:label=
"dict.label"
:value=
"dict.value"
/>
</el-select>
</el-form-item>
<el-form-item
:label=
"$t('业务编号')"
prop=
"businessNo"
>
<el-input
v-model=
"queryParams.businessNo"
:placeholder=
"$t('请输入业务编号')"
clearable
@
keyup.enter.native=
"handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleQuery"
>
{{
$t
(
'
搜索
'
)
}}
</el-button>
<el-button
icon=
"el-icon-refresh"
@
click=
"resetQuery"
>
{{
$t
(
'
重置
'
)
}}
</el-button>
...
...
@@ -126,6 +130,7 @@ export default {
category
:
null
,
status
:
null
,
result
:
null
,
}
};
},
...
...
src/views/bpm/task/copy.vue
View file @
18983f23
...
...
@@ -18,6 +18,10 @@
<el-date-picker
v-model=
"dateRangeCreateTime"
style=
"width: 240px"
value-format=
"yyyy-MM-dd"
type=
"daterange"
range-separator=
"-"
:start-placeholder=
"$t('开始日期')"
:end-placeholder=
"$t('结束日期')"
/>
</el-form-item>
<el-form-item
:label=
"$t('业务编号')"
prop=
"businessNo"
>
<el-input
v-model=
"queryParams.businessNo"
:placeholder=
"$t('请输入业务编号')"
clearable
@
keyup.enter.native=
"handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleQuery"
>
{{
$t
(
'
搜索
'
)
}}
</el-button>
<el-button
icon=
"el-icon-refresh"
@
click=
"resetQuery"
>
{{
$t
(
'
重置
'
)
}}
</el-button>
...
...
src/views/bpm/task/done.vue
View file @
18983f23
...
...
@@ -21,10 +21,10 @@
type=
"daterange"
range-separator=
"-"
:start-placeholder=
"$t('开始日期')"
:end-placeholder=
"$t('结束日期')"
/>
</el-form-item>
<!--
el-form-item :label="$t('业务编号')" prop="businessNo">
<
el-form-item
:label=
"$t('业务编号')"
prop=
"businessNo"
>
<el-input
v-model=
"queryParams.businessNo"
:placeholder=
"$t('请输入业务编号')"
clearable
@
keyup.enter.native=
"handleQuery"
/>
</el-form-item>
-->
</el-form-item>
<el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleQuery"
>
{{
$t
(
'
搜索
'
)
}}
</el-button>
<el-button
icon=
"el-icon-refresh"
@
click=
"resetQuery"
>
{{
$t
(
'
重置
'
)
}}
</el-button>
...
...
src/views/ecw/box/shippingAir/nodePage/checkout.vue
View file @
18983f23
...
...
@@ -71,16 +71,23 @@
</el-form>
<!-- 开始出仓 -->
<el-dialog
:title=
"$t('开始出仓')"
:visible.sync=
"dialogVisible"
fullscreen
:modal-append-to-body=
false
append-to-body
>
<startCheckout
v-bind=
"$attrs"
v-if=
"dialogVisible"
v-on=
"$listeners"
@
closeDialog1=
"closeDialog1"
/>
</el-dialog>
<el-row
class=
"operate-button"
>
<el-button
type=
"primary"
@
click=
"onSubmit(1)"
>
{{
$t
(
'
保存
'
)
}}
</el-button>
<el-button
:disabled=
"$attrs.shipmentObj.approvaling"
type=
"success"
@
click=
"onSubmit(2)"
>
{{
$t
(
'
提交
'
)
}}
</el-button>
<el-button
@
click=
"cancel"
>
{{
$t
(
'
关闭
'
)
}}
</el-button>
<el-button
@
click=
"startCheckout"
>
{{
$t
(
'
确认出仓
'
)
}}
</el-button>
</el-row>
</div>
</
template
>
<
script
>
import
{
airCheckoutCreate
}
from
"
@/api/ecw/boxSea
"
;
import
startCheckout
from
"
./checkout/startCheckout.vue
"
;
import
userSelect
from
"
./common/userSelect.vue
"
;
import
ImageUpload
from
"
@/components/ImageUpload
"
;
import
{
constantDict
,
formatDateStr
,
formatNumberString
,
serviceMsg
}
from
"
../utils
"
;
...
...
@@ -91,7 +98,7 @@ import { constantDict, formatDateStr, formatNumberString, serviceMsg } from "../
export
default
{
name
:
"
checkout
"
,
inheritAttrs
:
false
,
components
:
{
userSelect
,
ImageUpload
},
components
:
{
userSelect
,
ImageUpload
,
startCheckout
},
data
()
{
return
{
// 空运出仓对象
...
...
@@ -106,6 +113,7 @@ export default {
//deliverType: [{ required: true, message: this.$t("必填"), trigger: "change" }],
checkoutTime
:
[{
required
:
true
,
message
:
this
.
$t
(
"
必填
"
),
trigger
:
"
change
"
}]
},
dialogVisible
:
false
};
},
created
()
{
...
...
@@ -140,6 +148,13 @@ export default {
cancel
(
type
)
{
this
.
$emit
(
"
closeDialog
"
,
type
);
},
/** 开始出仓 */
startCheckout
()
{
this
.
dialogVisible
=
true
;
},
closeDialog1
()
{
this
.
dialogVisible
=
false
;
},
},
};
</
script
>
...
...
src/views/ecw/box/shippingAir/nodePage/checkout/startCheckout.vue
0 → 100644
View file @
18983f23
<
template
>
<div
class=
"startPacking"
>
<el-card>
<el-row
class=
"table-title"
>
<div><dict-tag
:type=
"DICT_TYPE.ECW_TRANSPORT_TYPE"
:value=
"shipmentObj.transportType"
/>
:
{{
importCityName
(
shipmentObj
.
startWarehouseId
)
}}
》
{{
importCityName
(
shipmentObj
.
destWarehouseId
)
}}
【
{{
getShipChannelName
(
shipmentObj
.
channelRespVO
.
channelId
)
}}
】
</div>
<div>
<template>
<el-input
v-model=
"qrCode"
:placeholder=
"$t('请输入二维码/条码编号')"
clearable
></el-input>
<el-button
type=
"primary"
@
click=
"handlerBatchCreate('single')"
>
{{
$t
(
'
确定
'
)
}}
</el-button>
<el-button
type=
"primary"
@
click=
"handlerClick('batchInput',$t('批量输入'))"
>
{{
$t
(
'
批量输入
'
)
}}
</el-button>
<el-button
type=
"primary"
@
click=
"handlerClick('correction',$t('出仓纠错'))"
>
{{
$t
(
'
出仓纠错
'
)
}}
</el-button>
<el-button
type=
"primary"
@
click=
"handlerClick('correctionOrder',$t('批量出仓纠错'))"
>
{{
$t
(
'
批量出仓纠错
'
)
}}
</el-button>
</
template
>
</div>
</el-row>
<!-- 表格 -->
<el-row
class=
"table-content"
>
<el-table
:data=
"tableData.sectionOrderList"
border
max-height=
"500px"
>
<el-table-column
:label=
"$t('序号')"
align=
"center"
width=
"50"
prop=
"tidanNum"
/>
<el-table-column
:label=
"$t('订单号')"
align=
"center"
prop=
"orderNo"
>
<
template
slot-scope=
"scope"
>
<div>
<a
href=
"javascript:void(0);"
class=
"order-href"
@
click=
"orderClick(scope.row)"
>
{{
scope
.
row
.
orderNo
}}
</a>
</div>
<div
style=
"color:blue;fontWeight:bold;"
>
{{
scope
.
row
.
isExternalWarehouse
===
1
?
'
(
'
+
$t
(
'
外部仓
'
)
+
'
)
'
:
''
}}
</div>
</
template
>
</el-table-column>
<el-table-column
:label=
"$t('货物信息')"
align=
"center"
prop=
"goodsList"
>
<
template
slot-scope=
"scope"
>
<section
class=
"table-goodList"
>
<div
v-for=
"(item, index) in scope.row.goodsList"
:key=
"index"
class=
"goodList-div"
>
<p>
{{
$t
(
'
品名
'
)
}}
:
{{
$l
(
item
,
'
prodTitle
'
)
}}
</p>
<p>
{{
$t
(
'
品牌
'
)
}}
:【
<template
v-if=
"item.brandName"
>
{{
item
.
brandName
}}
</
template
>
<dict-tag
v-else
:type=
"DICT_TYPE.ECW_IS_BRAND"
:value=
"item.feeType"
/>
{{ $t('】') }}
</p>
<p>
{{$t('其他')}}:{{getTotlContent(item)}}
</p>
</div>
</section>
</template>
</el-table-column>
<el-table-column
:label=
"$t('报关方式')"
align=
"center"
prop=
"customsType"
>
<
template
slot-scope=
"scope"
>
<div
:class=
"scope.row.customsType !== 1 ? 'custom_type_red' : ''"
>
<dict-tag
:type=
"DICT_TYPE.ECW_CUSTOMS_TYPE"
:value=
"scope.row.customsType"
/>
</div>
</
template
>
</el-table-column>
<el-table-column
:label=
"$t('计划箱数')"
align=
"center"
prop=
"num"
>
<
template
slot-scope=
"scope"
>
{{
getTotlContent
(
scope
.
row
,[
'
num
'
])
}}
</
template
>
</el-table-column>
<el-table-column
:label=
"$t('实装箱数')"
align=
"center"
prop=
"installNum"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
installNum
}}{{
$t
(
'
箱
'
)
}}
</
template
>
</el-table-column>
<el-table-column
:label=
"$t('体积')"
align=
"center"
prop=
"volume"
>
<
template
slot-scope=
"scope"
>
{{
getTotlContent
(
scope
.
row
,[
'
volume
'
])
}}
</
template
>
</el-table-column>
<el-table-column
:label=
"$t('重量')"
align=
"center"
prop=
"weight"
>
<
template
slot-scope=
"scope"
>
{{
getTotlContent
(
scope
.
row
,[
'
weight
'
])
}}
</
template
>
</el-table-column>
</el-table>
</el-row>
</el-card>
<!-- 统计 -->
<el-row>
<el-col
:span=
"6"
class=
"totle-info"
>
<div
class=
"count-info"
>
<p>
{{$t('总计')}}:{{getSumData}}
</p>
</div>
<!-- <div>
<p>{{$t('容量')}}:</p>
<p>{{calcCapacity}}</p>
</div>
<div>{{$t('已装')}} {{getInstallNumCount}} {{$t('箱')}}</div> -->
</el-col>
</el-row>
<el-row
style=
"margin-top: 20px;"
>
<el-button
type=
"primary"
@
click=
"submitCheckout"
>
{{$t('确认出仓')}}
</el-button>
<el-button
@
click=
"$emit('closeDialog1')"
>
{{$t('取消')}}
</el-button>
</el-row>
<!-- 对话框 -->
<el-dialog
custom-class=
"shipping-dialog"
:title=
"dialogConfig.title"
:visible.sync=
"dialogConfig.dialogVisible"
:fullscreen=
"dialogConfig.fullscreen"
:width=
"dialogConfig.width"
:modal-append-to-body=
false
append-to-body
>
<!-- 已装未装订单 -->
<
template
v-if=
"dialogConfig.type === 'orderTable'"
>
<el-table
:data=
"orderList"
height=
"500px"
border
>
<el-table-column
:label=
"$t('已出仓')"
align=
"center"
prop=
"loadTag"
/>
<el-table-column
:label=
"$t('未出仓')"
align=
"center"
prop=
"unloadTag"
/>
</el-table>
</
template
>
<!-- 出仓纠错 -->
<
template
v-if=
"dialogConfig.type === 'correction' && dialogConfig.dialogVisible"
>
<el-form
ref=
"correctionForm"
:rules=
"rules"
:model=
"correctionObj"
label-position=
"top"
>
<el-form-item
:label=
"$t('出仓纠错(二维码/条形码编号)')"
prop=
"qrCode"
>
<el-input
v-model=
"correctionObj.qrCode"
:placeholder=
"$t('请输入二维码/条形码编号')"
clearable
/>
</el-form-item>
</el-form>
<el-row
class=
"operate-button"
>
<el-button
type=
"primary"
@
click=
"onSubmit('correctionForm')"
>
{{
$t
(
'
提交
'
)
}}
</el-button>
<el-button
@
click=
"closeDialog2"
>
{{
$t
(
'
取消
'
)
}}
</el-button>
</el-row>
</
template
>
<!-- 批量出仓纠错(订单号) -->
<
template
v-if=
"dialogConfig.type === 'correctionOrder' && dialogConfig.dialogVisible"
>
<el-form
ref=
"orderForm"
:rules=
"rules"
:model=
"orderObj"
label-position=
"top"
>
<el-form-item
:label=
"$t('出仓纠错') +'(' + $t('订单号') + ')'"
prop=
"orderNo"
>
<el-input
type=
"textarea"
:rows=
"3"
v-model=
"orderObj.orderNo"
:placeholder=
"$t('请输入,多个以逗号分隔')"
clearable
/>
</el-form-item>
</el-form>
<el-row
class=
"operate-button"
>
<el-button
type=
"primary"
@
click=
"onSubmit('orderForm')"
>
{{
$t
(
'
提交
'
)
}}
</el-button>
<el-button
@
click=
"closeDialog2"
>
{{
$t
(
'
取消
'
)
}}
</el-button>
</el-row>
</
template
>
<!-- 出仓批量输入 -->
<
template
v-if=
"dialogConfig.type === 'batchInput' && dialogConfig.dialogVisible"
>
<el-form
ref=
"batchForm"
:rules=
"rules"
:model=
"batchObj"
>
<el-form-item
label=
""
prop=
"qrCode"
class=
"two-element"
>
<el-input
v-model=
"batchObj.qrCode"
:placeholder=
"$t('请输入订单号')"
clearable
/>
<el-button
style=
"marginLeft:10px;"
type=
"primary"
@
click=
"queryOrderInfo"
>
{{
$t
(
'
确定
'
)
}}
</el-button>
</el-form-item>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('订单号')"
>
{{
boxOrderInfo
.
orderNo
}}
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('箱数')"
>
<el-input-number
v-if=
"boxOrderInfo.isExternalWarehouse === 1"
v-model=
"batchObj.boxNum"
:min=
"0"
:max=
"boxOrderInfo.num"
/>
<template
v-else
>
{{
boxOrderInfo
.
num
}}
</
template
>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('方数')"
>
{{getTotlContent(boxOrderInfo, ['volume'])}}
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('重量')"
>
{{getTotlContent(boxOrderInfo, ['weight'])}}
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-row
class=
"operate-button"
>
<el-button
type=
"primary"
:disabled=
"boxOrderInfo.orderId ? false : true"
@
click=
"batchLoad"
>
{{$t('提交')}}
</el-button>
<el-button
@
click=
"closeDialog2"
>
{{$t('取消')}}
</el-button>
</el-row>
</template>
</el-dialog>
</div>
</template>
<
script
>
import
dayjs
from
"
dayjs
"
;
import
{
getCabinetPage
}
from
"
@/api/ecw/cabinet
"
;
import
{
getbox
}
from
"
@/api/ecw/box
"
;
import
{
confirmAirCheckout
}
from
"
@/api/ecw/boxAir
"
;
import
{
loadSecGoodsList
,
orderTagList
,
singleCreate
,
batchCreate
,
singleDelete
,
batchDelete
,
remove
,
getOrderDetailByBoxNo
,
externalLoad
,
}
from
"
@/api/ecw/boxSea
"
;
import
{
getTotlContent
,
serviceMsg
,
getCapacity
,
sumStatistics
,
}
from
"
../../utils
"
;
import
Decimal
from
"
decimal.js
"
;
import
{
getChannelList
}
from
"
@/api/ecw/channel
"
;
/**
* 开始出仓
*/
export
default
{
name
:
"
startPacking
"
,
inheritAttrs
:
false
,
props
:
{
shipmentObj
:
Object
,
},
data
()
{
return
{
// 表格数据
listData
:
[],
// 表格数据
tableData
:
{},
// 弹窗配置
dialogConfig
:
{
title
:
""
,
dialogVisible
:
false
,
width
:
"
30%
"
,
type
:
""
,
fullscreen
:
false
,
},
// 已装/未装
orderList
:
[],
// 柜型
cabinetList
:
[],
// 二维码/条码编号
qrCode
:
""
,
// 批量输入
batchObj
:
{
boxNum
:
0
,
},
// 批量纠错(订单号)
orderObj
:
{},
// 纠错
correctionObj
:
{},
// 修改柜信息
modifyCabinetObj
:
{},
// 修改柜信息校验
rules
:
{
startWarehouseId
:
[
{
required
:
true
,
message
:
this
.
$t
(
"
必填
"
),
trigger
:
"
change
"
},
],
cabinetId
:
[
{
required
:
true
,
message
:
this
.
$t
(
"
必填
"
),
trigger
:
"
change
"
},
],
qrCode
:
[
{
required
:
true
,
message
:
this
.
$t
(
"
必填
"
),
trigger
:
"
change
"
},
],
orderNo
:
[
{
required
:
true
,
message
:
this
.
$t
(
"
必填
"
),
trigger
:
"
change
"
},
],
},
// 当前行
currRow
:
{},
selectedUsers
:
[],
// 订单信息
boxOrderInfo
:
{},
newshipmentObj
:
{},
channelList
:
[]
};
},
created
()
{
this
.
getLoadSecGoodsList
();
// 柜型
getCabinetPage
(
null
).
then
((
response
)
=>
{
this
.
cabinetList
=
response
.
data
.
list
;
});
// 查询渠道
getChannelList
().
then
((
res
)
=>
(
this
.
channelList
=
res
.
data
));
// this.getBoxInfo()
},
methods
:
{
getTotlContent
,
getBoxInfo
()
{
getbox
(
this
.
shipmentObj
.
id
).
then
((
res
)
=>
{
const
{
data
}
=
res
;
this
.
newshipmentObj
=
data
??
{};
});
},
/* 获取城市 */
importCityName
(
id
)
{
var
arr
=
this
.
$attrs
.
warehouseList
.
filter
((
item
)
=>
item
.
id
==
id
);
return
arr
.
length
>
0
?
this
.
$l
(
arr
[
0
],
"
title
"
)
:
this
.
$t
(
"
无
"
);
},
/* 出仓部分列表 */
getLoadSecGoodsList
()
{
loadSecGoodsList
({
shipmentId
:
this
.
shipmentObj
.
id
}).
then
((
res
)
=>
{
const
{
data
=
[]
}
=
res
;
this
.
listData
=
data
.
map
((
item
,
index
)
=>
{
return
{
...
item
,
title
:
this
.
$t
(
"
第{index}部分
"
,
{
index
:
1
+
index
}),
};
});
if
(
this
.
listData
.
length
)
{
this
.
tableData
=
this
.
listData
[
0
];
}
});
},
/** 点击事件统一入口 */
handlerClick
(
type
,
title
)
{
this
.
shwoDialog
({
type
,
title
});
},
/** 表格订单号点击 */
orderClick
(
row
)
{
orderTagList
({
orderId
:
row
.
orderId
}).
then
((
res
)
=>
{
const
{
data
=
{}
}
=
res
;
this
.
orderList
=
[];
// 取最长的list
let
dataLength
=
data
.
loadList
.
length
;
if
(
data
.
unLoadList
.
length
>
dataLength
)
{
dataLength
=
data
.
unLoadList
.
length
;
}
// 组装数据,用一个table组件渲染
for
(
let
index
=
0
;
index
<
dataLength
;
index
++
)
{
this
.
orderList
.
push
({
loadTag
:
data
.
loadList
[
index
],
unloadTag
:
data
.
unLoadList
[
index
],
});
}
});
this
.
shwoDialog
({
type
:
"
orderTable
"
,
title
:
row
.
selfNo
,
});
},
/** 弹窗事件 */
shwoDialog
(
config
)
{
this
.
$set
(
this
.
dialogConfig
,
"
title
"
,
config
.
title
);
this
.
$set
(
this
.
dialogConfig
,
"
type
"
,
config
.
type
);
switch
(
config
.
type
)
{
case
"
orderTable
"
:
this
.
$set
(
this
.
dialogConfig
,
"
fullscreen
"
,
false
);
break
;
case
"
supplementOrder
"
:
this
.
$set
(
this
.
dialogConfig
,
"
fullscreen
"
,
true
);
break
;
case
"
batchInput
"
:
this
.
$set
(
this
.
dialogConfig
,
"
fullscreen
"
,
false
);
this
.
batchObj
=
{
boxNum
:
0
};
this
.
boxOrderInfo
=
{};
break
;
case
"
correction
"
:
this
.
$set
(
this
.
dialogConfig
,
"
fullscreen
"
,
false
);
this
.
correctionObj
=
{};
break
;
case
"
correctionOrder
"
:
this
.
$set
(
this
.
dialogConfig
,
"
fullscreen
"
,
false
);
this
.
orderObj
=
{};
break
;
case
"
modifyCabinet
"
:
this
.
$set
(
this
.
dialogConfig
,
"
fullscreen
"
,
false
);
this
.
modifyCabinetObj
=
{};
this
.
$set
(
this
.
modifyCabinetObj
,
'
cabinetId
'
,
this
.
shipmentObj
.
cabinetId
)
this
.
$set
(
this
.
modifyCabinetObj
,
'
cubNo
'
,
this
.
shipmentObj
.
cubNo
)
break
;
}
this
.
$set
(
this
.
dialogConfig
,
"
dialogVisible
"
,
true
);
},
/** 关闭弹窗 */
closeDialog2
()
{
this
.
$set
(
this
.
dialogConfig
,
"
dialogVisible
"
,
false
);
},
/** 修改提交 */
onSubmit
(
formName
)
{
this
.
$refs
[
formName
].
validate
((
valid
)
=>
{
if
(
valid
)
{
if
(
formName
===
"
batchForm
"
)
{
this
.
handlerBatchCreate
(
"
batch
"
);
}
if
(
formName
===
"
correctionForm
"
)
{
this
.
handlerBatchDelete
(
{
orderNumCode
:
this
.
correctionObj
.
qrCode
,
},
"
single
"
);
}
if
(
formName
===
"
orderForm
"
)
{
this
.
handlerBatchDelete
(
{
orderNo
:
this
.
orderObj
.
orderNo
},
"
batch
"
);
}
if
(
formName
===
"
modifyForm
"
)
{
this
.
modifyBoxUpdate
();
}
}
});
},
/* 部分点击 */
partClick
(
item
)
{
this
.
tableData
=
item
;
},
/* 出仓 */
handlerBatchCreate
(
type
)
{
let
params
=
{
shipmentId
:
this
.
shipmentObj
.
id
,
secId
:
this
.
tableData
.
id
,
};
if
(
type
===
"
single
"
)
{
if
(
!
this
.
qrCode
)
{
this
.
$message
.
error
(
this
.
$t
(
"
请输入二维码/条码编号
"
));
return
;
}
params
.
orderNumCode
=
this
.
qrCode
;
singleCreate
(
params
).
then
((
res
)
=>
{
serviceMsg
(
res
,
this
).
then
(()
=>
{
this
.
qrCode
=
""
;
this
.
getLoadSecGoodsList
();
});
});
}
else
{
params
.
orderNo
=
this
.
batchObj
.
qrCode
;
batchCreate
(
params
).
then
((
res
)
=>
{
serviceMsg
(
res
,
this
).
then
(()
=>
{
this
.
closeDialog2
();
this
.
getLoadSecGoodsList
();
});
});
}
},
/* 删除已出仓 */
handlerBatchDelete
(
params
,
type
)
{
params
=
{
shipmentId
:
this
.
shipmentObj
.
id
,
secId
:
this
.
tableData
.
id
,
...
params
,
};
if
(
type
===
"
single
"
)
{
singleDelete
(
params
).
then
((
res
)
=>
{
serviceMsg
(
res
,
this
).
then
(()
=>
{
this
.
closeDialog2
();
this
.
getLoadSecGoodsList
();
});
});
}
else
{
batchDelete
(
params
).
then
((
res
)
=>
{
serviceMsg
(
res
,
this
).
then
(()
=>
{
this
.
closeDialog2
();
this
.
getLoadSecGoodsList
();
});
});
}
},
/* 移出 */
moveOut
(
row
)
{
let
params
=
{
shipmentId
:
this
.
shipmentObj
.
id
,
secId
:
this
.
tableData
.
id
,
orderId
:
row
.
orderId
,
};
remove
(
params
).
then
((
res
)
=>
{
serviceMsg
(
res
,
this
).
then
(()
=>
{
this
.
getLoadSecGoodsList
();
});
}).
catch
((
res
)
=>
{
if
(
res
.
code
===
666
)
{
this
.
$confirm
(
"
<div style='max-height:500px;overflow:auto'>
"
+
res
.
msg
+
this
.
$t
(
'
是否需要一起移出?
'
)
+
"
</div>
"
,
this
.
$t
(
"
提示
"
),
{
dangerouslyUseHTMLString
:
true
,
distinguishCancelAndClose
:
true
,
confirmButtonText
:
'
确定移出
'
,
cancelButtonText
:
'
仅移出当前订单
'
})
.
then
((
_
)
=>
{
remove
({
...
params
,
deleteType
:
2
}).
then
((
res
)
=>
{
serviceMsg
(
res
,
this
).
then
(()
=>
{
this
.
getLoadSecGoodsList
();
});
});
})
.
catch
(
action
=>
{
if
(
action
==
'
cancel
'
){
remove
({
...
params
,
deleteType
:
1
}).
then
((
res
)
=>
{
serviceMsg
(
res
,
this
).
then
(()
=>
{
this
.
getLoadSecGoodsList
();
});
});
}
});
}
});
},
queryOrderInfo
()
{
this
.
$refs
[
"
batchForm
"
].
validate
((
valid
)
=>
{
if
(
valid
)
{
getOrderDetailByBoxNo
({
orderNumCode
:
this
.
batchObj
.
qrCode
,
shipmentId
:
this
.
shipmentObj
.
id
,
}).
then
((
res
)
=>
{
const
{
data
}
=
res
;
this
.
boxOrderInfo
=
data
;
this
.
batchObj
.
boxNum
=
Number
(
data
.
num
);
});
}
});
},
batchLoad
()
{
if
(
!
this
.
boxOrderInfo
.
orderId
)
{
this
.
$message
.
error
(
this
.
$t
(
"
请输入订单号
"
));
return
;
}
if
(
this
.
batchObj
.
boxNum
===
0
)
{
this
.
$message
.
error
(
this
.
$t
(
"
箱数不能为0
"
));
return
;
}
let
params
=
{
boxNum
:
this
.
boxOrderInfo
.
num
,
orderId
:
this
.
boxOrderInfo
.
orderId
,
orderNo
:
this
.
boxOrderInfo
.
orderNo
,
shipmentId
:
this
.
shipmentObj
.
id
,
};
if
(
this
.
boxOrderInfo
.
isExternalWarehouse
===
1
)
{
params
.
boxNum
=
this
.
batchObj
.
boxNum
;
}
externalLoad
(
params
).
then
((
res
)
=>
{
serviceMsg
(
res
,
this
).
then
(()
=>
{
this
.
closeDialog2
();
this
.
boxOrderInfo
=
{};
this
.
getLoadSecGoodsList
();
});
});
},
submitCheckout
(){
confirmAirCheckout
({
shipmentId
:
this
.
shipmentObj
.
id
}).
then
((
res
)
=>
{
serviceMsg
(
res
,
this
).
then
(()
=>
{
this
.
$emit
(
'
closeDialog1
'
)
});
});
}
},
computed
:
{
/* 容量 */
calcCapacity
()
{
const
{
cabinetRespVO
}
=
this
.
shipmentObj
;
return
getCapacity
(
cabinetRespVO
);
},
/* 总计 */
getSumData
()
{
return
sumStatistics
(
this
.
listData
);
},
/* 已装总数 */
getInstallNumCount
()
{
let
count
=
0
;
if
(
Array
.
isArray
(
this
.
listData
))
{
this
.
listData
.
forEach
((
item
)
=>
{
const
{
sectionOrderList
=
[]
}
=
item
;
sectionOrderList
.
forEach
((
item
)
=>
{
count
=
Decimal
.
add
(
count
,
item
.
installNum
).
toNumber
();
});
});
}
return
count
;
},
/* 渠道 */
getShipChannelName
()
{
return
(
shippingChannelId
)
=>
{
for
(
const
channelItem
of
this
.
channelList
)
{
if
(
channelItem
.
channelId
==
shippingChannelId
)
{
return
this
.
$l
(
channelItem
,
"
name
"
);
}
}
};
},
},
};
</
script
>
<
style
lang=
"scss"
scoped
>
.startPacking
{
display
:
flex
;
flex-direction
:
column
;
p
{
margin
:
0
;
}
.table-title
{
display
:
flex
;
align-items
:
center
;
margin-bottom
:
10px
;
>
div
:first-child
{
flex
:
1
;
font-size
:
16px
;
}
>
div
:last-child
{
display
:
flex
;
>
.el-input
{
margin-right
:
10px
;
}
}
}
.table-content
{
.table-goodList
{
.goodList-div
{
border-bottom
:
1px
solid
#e6ebf5
;
>
p
{
text-align
:
left
;
}
>
p
:last-child
{
>
span
{
margin-right
:
5px
;
}
}
}
>
div
:last-child
{
border-bottom
:
none
;
}
}
.el-table
{
color
:
red
;
}
}
.totle-info
{
font-size
:
20px
;
margin-top
:
15px
;
>
div
{
display
:
flex
;
margin-bottom
:
5px
;
}
.count-info
{
>
p
>
span
{
margin-right
:
5px
;
}
}
}
.process-area
{
margin-top
:
15px
;
padding-bottom
:
30px
;
.process
{
display
:
flex
;
flex-direction
:
column
;
>
:first-child
{
color
:
#606266
;
font-weight
:
bolder
;
font-size
:
16px
;
}
}
}
}
</
style
>
src/views/ecw/box/shippingAir/nodePage/mergePkg/pkgPage.vue
View file @
18983f23
<
template
>
<div>
<el-row
style=
"margin-top: 25px"
>
<el-row
v-if=
"flag == 'edit'"
>
<el-button
size=
"small"
type=
"primary"
@
click=
"removeBatch"
>
{{
$t
(
'
批量移出合包
'
)
}}
</el-button>
<el-button
size=
"small"
type=
"primary"
@
click=
"sealBox"
>
{{
$t
(
'
封箱
'
)
}}
</el-button>
<el-row
v-if=
"flag == 'edit'"
class=
"table-title"
>
<div>
<el-button
size=
"small"
type=
"primary"
@
click=
"removeBatch"
>
{{
$t
(
'
批量移出合包
'
)
}}
</el-button>
<el-button
size=
"small"
type=
"primary"
@
click=
"sealBox"
>
{{
$t
(
'
封箱
'
)
}}
</el-button>
</div>
<div>
<template>
<el-input
v-model=
"qrCode"
:placeholder=
"$t('请输入二维码/条码编号')"
clearable
></el-input>
<el-button
type=
"primary"
@
click=
"handlerBatchCreate()"
>
{{
$t
(
'
确定
'
)
}}
</el-button>
<el-button
type=
"primary"
@
click=
"handlerClick('batchInput',$t('批量输入'))"
>
{{
$t
(
'
批量输入
'
)
}}
</el-button>
<el-button
type=
"primary"
@
click=
"handlerClick('correction',$t('装箱纠错'))"
>
{{
$t
(
'
装箱纠错
'
)
}}
</el-button>
<el-button
type=
"primary"
@
click=
"handlerClick('correctionOrder',$t('批量装箱纠错'))"
>
{{
$t
(
'
批量装箱纠错
'
)
}}
</el-button>
</
template
>
</div>
</el-row>
<el-row
style=
"margin-top: 5px"
>
<el-table
border
:data=
"pagList"
max-height=
"600px"
@
select=
"checkboxSelect"
@
select-all=
"checkboxSelect"
>
...
...
@@ -11,7 +22,9 @@
<el-table-column
align=
"center"
:label=
"$t('序号')"
width=
"50"
type=
"index"
/>
<el-table-column
:label=
"$t('订单号')"
align=
"center"
prop=
"orderNo"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
orderNo
}}
<el-link
type=
"primary"
@
click.native=
"orderClick(scope.row)"
>
{{
scope
.
row
.
orderNo
}}
</el-link>
</
template
>
</el-table-column>
<el-table-column
:label=
"$t('商品信息')"
width=
"250px"
align=
"center"
>
...
...
@@ -26,9 +39,9 @@
<dict-tag
:type=
"DICT_TYPE.PRODUCT_RECORD_ATTRIBUTE"
:value=
"row.productRecord"
/>
</
template
>
</el-table-column>
<el-table-column
:label=
"$t('
箱数
')"
align=
"center"
prop=
"sumNum"
>
<el-table-column
:label=
"$t('
计划/已装
')"
align=
"center"
prop=
"sumNum"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
sumNum
}}
{{
scope
.
row
.
sumNum
}}
/
{{
scope
.
row
.
installNum
}}
</
template
>
</el-table-column>
<el-table-column
:label=
"$t('纸箱尺寸')"
align=
"center"
>
...
...
@@ -125,13 +138,91 @@
<el-dialog
:title=
"$t('集运封箱标签')"
:visible.sync=
"printdialogVisible"
width=
"350px"
:modal-append-to-body=
"false"
append-to-body
>
<print-tag
v-if=
"printdialogVisible"
:tagData=
"tagData"
/>
</el-dialog>
<!-- 对话框 -->
<el-dialog
custom-class=
"shipping-dialog"
:title=
"checkDialogConfig.title"
:visible.sync=
"checkDialogConfig.dialogVisible"
:fullscreen=
"checkDialogConfig.fullscreen"
:width=
"checkDialogConfig.width"
:modal-append-to-body=
false
append-to-body
>
<!-- 已装未装订单 -->
<
template
v-if=
"checkDialogConfig.type === 'orderTable'"
>
<el-table
:data=
"orderList"
height=
"500px"
border
>
<el-table-column
:label=
"$t('已装')"
align=
"center"
prop=
"loadTag"
/>
<el-table-column
:label=
"$t('未装')"
align=
"center"
prop=
"unloadTag"
/>
</el-table>
</
template
>
<!-- 装柜纠错 -->
<
template
v-if=
"checkDialogConfig.type === 'correction' && checkDialogConfig.dialogVisible"
>
<el-form
ref=
"correctionForm"
:rules=
"rules"
:model=
"correctionObj"
label-position=
"top"
>
<el-form-item
:label=
"$t('装柜纠错(二维码/条形码编号)')"
prop=
"qrCode"
>
<el-input
v-model=
"correctionObj.qrCode"
:placeholder=
"$t('请输入二维码/条形码编号')"
clearable
/>
</el-form-item>
</el-form>
<el-row
class=
"operate-button"
>
<el-button
type=
"primary"
@
click=
"delCheck()"
>
{{
$t
(
'
提交
'
)
}}
</el-button>
<el-button
@
click=
"closeDialog2"
>
{{
$t
(
'
取消
'
)
}}
</el-button>
</el-row>
</
template
>
<!-- 批量装柜纠错(订单号) -->
<
template
v-if=
"checkDialogConfig.type === 'correctionOrder' && checkDialogConfig.dialogVisible"
>
<el-form
ref=
"orderForm"
:rules=
"rules"
:model=
"orderObj"
label-position=
"top"
>
<el-form-item
:label=
"$t('装柜纠错') +'(' + $t('订单号') + ')'"
prop=
"orderNo"
>
<el-input
type=
"textarea"
:rows=
"3"
v-model=
"orderObj.orderNo"
:placeholder=
"$t('请输入,多个以逗号分隔')"
clearable
/>
</el-form-item>
</el-form>
<el-row
class=
"operate-button"
>
<el-button
type=
"primary"
@
click=
"batchDelCheck()"
>
{{
$t
(
'
提交
'
)
}}
</el-button>
<el-button
@
click=
"closeDialog2"
>
{{
$t
(
'
取消
'
)
}}
</el-button>
</el-row>
</
template
>
<!-- 装柜批量输入 -->
<
template
v-if=
"checkDialogConfig.type === 'batchInput' && checkDialogConfig.dialogVisible"
>
<el-form
ref=
"batchForm"
:rules=
"rules"
:model=
"batchObj"
>
<el-form-item
label=
""
prop=
"qrCode"
class=
"two-element"
>
<el-input
v-model=
"batchObj.qrCode"
:placeholder=
"$t('请输入订单号')"
clearable
/>
<el-button
style=
"marginLeft:10px;"
type=
"primary"
@
click=
"queryOrderInfo"
>
{{
$t
(
'
确定
'
)
}}
</el-button>
</el-form-item>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('订单号')"
>
{{
boxOrderInfo
.
orderNo
}}
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('箱数')"
>
<el-input-number
v-if=
"boxOrderInfo.isExternalWarehouse === 1"
v-model=
"batchObj.boxNum"
:min=
"0"
:max=
"boxOrderInfo.num"
/>
<template
v-else
>
{{
boxOrderInfo
.
num
}}
</
template
>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('方数')"
>
{{getTotlContent(boxOrderInfo, ['volume'])}}
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('重量')"
>
{{getTotlContent(boxOrderInfo, ['weight'])}}
</el-form-item>
</el-col>
</el-row>
</el-form>
<el-row
class=
"operate-button"
>
<el-button
type=
"primary"
:disabled=
"boxOrderInfo.orderId ? false : true"
@
click=
"batchLoad"
>
{{$t('提交')}}
</el-button>
<el-button
@
click=
"closeDialog2"
>
{{$t('取消')}}
</el-button>
</el-row>
</template>
</el-dialog>
</el-row>
</div>
</template>
<
script
>
import
{
getPkgPageByPkgId
,
deleteRelate
,
deleteBatchRelate
,
getMergePkgInfoById
,
updateMergePkg
,
getMergeTagById
}
from
'
@/api/ecw/boxAir
'
import
{
formatDate
,
serviceMsg
}
from
'
../../utils
'
import
{
getPkgPageByPkgId
,
deleteRelate
,
deleteBatchRelate
,
getMergePkgInfoById
,
updateMergePkg
,
getMergeTagById
,
checkInfoSingleCreate
,
checkInfoBatchCreate
,
getOrderTagList
,
checkInfoSingleDelete
,
checkInfoBatchDelete
}
from
'
@/api/ecw/boxAir
'
import
{
formatDate
,
serviceMsg
,
getTotlContent
}
from
'
../../utils
'
import
{
getOrderDetailByBoxNo
}
from
"
@/api/ecw/boxSea
"
;
import
printTag
from
'
./printTag.vue
'
export
default
{
props
:
{
...
...
@@ -159,7 +250,37 @@ export default {
sealBoxdialogVisible
:
false
,
sealBoxForm
:
{},
printdialogVisible
:
false
,
tagData
:
{}
tagData
:
{},
// 二维码/条码编号
qrCode
:
""
,
// 批量输入
batchObj
:
{
boxNum
:
0
,
},
// 批量纠错(订单号)
orderObj
:
{},
// 纠错
correctionObj
:
{},
// 弹窗配置
checkDialogConfig
:
{
title
:
""
,
dialogVisible
:
false
,
width
:
"
30%
"
,
type
:
""
,
fullscreen
:
false
,
},
// 订单信息
boxOrderInfo
:
{},
rules
:
{
qrCode
:
[
{
required
:
true
,
message
:
this
.
$t
(
"
必填
"
),
trigger
:
"
change
"
},
],
orderNo
:
[
{
required
:
true
,
message
:
this
.
$t
(
"
必填
"
),
trigger
:
"
change
"
},
],
},
// 已理/未理
orderList
:
[],
}
},
created
()
{
...
...
@@ -168,7 +289,7 @@ export default {
methods
:
{
getList
()
{
let
queryParams
=
{
id
:
this
.
pkgData
.
id
,
id
:
this
.
pkgData
.
id
,
shipmentId
:
this
.
shipmentObj
.
id
,
...
this
.
queryParams
}
...
...
@@ -179,6 +300,7 @@ export default {
},
// 格式化日期
formatDate
,
getTotlContent
,
//去重
notset
(
string
)
{
if
(
!
string
)
return
string
...
...
@@ -227,6 +349,18 @@ export default {
},
//封箱
sealBox
()
{
let
flag
=
false
let
orderNo
=
''
this
.
pagList
.
forEach
(
item
=>
{
if
(
item
.
installNum
!=
item
.
num
){
flag
=
true
orderNo
=
orderNo
+
'
《
'
+
item
.
orderNo
+
'
》
'
}
})
if
(
flag
){
this
.
$message
.
error
(
this
.
$t
(
`订单号
${
orderNo
}
未完成装箱,请完成全部订单装箱后重试`
));
return
;
}
getMergePkgInfoById
(
this
.
pkgData
.
id
).
then
(
res
=>
{
this
.
sealBoxForm
=
{
pkgHight
:
res
.
data
.
pkgHight
,
...
...
@@ -264,10 +398,178 @@ export default {
});
})
})
},
/** 表格订单号点击 */
orderClick
(
row
)
{
getOrderTagList
({
orderId
:
row
.
orderId
,
type
:
1
}).
then
((
res
)
=>
{
const
{
data
=
{}
}
=
res
;
this
.
orderList
=
[];
// 取最长的list
let
dataLength
=
data
.
loadList
.
length
;
if
(
data
.
unLoadList
.
length
>
dataLength
)
{
dataLength
=
data
.
unLoadList
.
length
;
}
// 组装数据,用一个table组件渲染
for
(
let
index
=
0
;
index
<
dataLength
;
index
++
)
{
this
.
orderList
.
push
({
loadTag
:
data
.
loadList
[
index
],
unloadTag
:
data
.
unLoadList
[
index
],
});
}
});
this
.
shwoDialog
({
type
:
"
orderTable
"
,
title
:
row
.
selfNo
,
});
},
/** 点击事件统一入口 */
handlerClick
(
type
,
title
)
{
this
.
shwoDialog
({
type
,
title
});
},
/** 弹窗事件 */
shwoDialog
(
config
)
{
this
.
$set
(
this
.
checkDialogConfig
,
"
title
"
,
config
.
title
);
this
.
$set
(
this
.
checkDialogConfig
,
"
type
"
,
config
.
type
);
switch
(
config
.
type
)
{
case
"
orderTable
"
:
this
.
$set
(
this
.
checkDialogConfig
,
"
fullscreen
"
,
false
);
break
;
case
"
batchInput
"
:
this
.
$set
(
this
.
checkDialogConfig
,
"
fullscreen
"
,
false
);
this
.
batchObj
=
{
boxNum
:
0
};
this
.
boxOrderInfo
=
{};
break
;
case
"
correction
"
:
this
.
$set
(
this
.
checkDialogConfig
,
"
fullscreen
"
,
false
);
this
.
correctionObj
=
{};
break
;
case
"
correctionOrder
"
:
this
.
$set
(
this
.
checkDialogConfig
,
"
fullscreen
"
,
false
);
this
.
orderObj
=
{};
break
;
}
this
.
$set
(
this
.
checkDialogConfig
,
"
dialogVisible
"
,
true
);
},
/** 关闭弹窗 */
closeDialog2
()
{
this
.
$set
(
this
.
checkDialogConfig
,
"
dialogVisible
"
,
false
);
},
/* 创建装柜标签 */
handlerBatchCreate
()
{
if
(
!
this
.
qrCode
)
{
this
.
$message
.
error
(
this
.
$t
(
"
请输入二维码/条码编号
"
));
return
;
}
let
params
=
{
shipmentId
:
this
.
shipmentObj
.
id
,
pkgId
:
this
.
pkgData
.
id
,
type
:
1
,
};
params
.
orderNumCode
=
this
.
qrCode
;
checkInfoSingleCreate
(
params
).
then
((
res
)
=>
{
serviceMsg
(
res
,
this
).
then
(()
=>
{
this
.
qrCode
=
""
;
this
.
getList
();
});
});
},
queryOrderInfo
()
{
this
.
$refs
[
"
batchForm
"
].
validate
((
valid
)
=>
{
if
(
valid
)
{
getOrderDetailByBoxNo
({
orderNumCode
:
this
.
batchObj
.
qrCode
,
shipmentId
:
this
.
shipmentObj
.
id
,
}).
then
((
res
)
=>
{
const
{
data
}
=
res
;
this
.
boxOrderInfo
=
data
;
this
.
batchObj
.
boxNum
=
Number
(
data
.
num
);
});
}
});
},
/**批量创建装柜标签 */
batchLoad
()
{
if
(
!
this
.
boxOrderInfo
.
orderId
)
{
this
.
$message
.
error
(
this
.
$t
(
"
请输入订单号
"
));
return
;
}
if
(
this
.
batchObj
.
boxNum
===
0
)
{
this
.
$message
.
error
(
this
.
$t
(
"
箱数不能为0
"
));
return
;
}
let
params
=
{
orderId
:
this
.
boxOrderInfo
.
orderId
,
orderNo
:
this
.
boxOrderInfo
.
orderNo
,
shipmentId
:
this
.
shipmentObj
.
id
,
pkgId
:
this
.
pkgData
.
id
,
type
:
1
};
checkInfoBatchCreate
(
params
).
then
((
res
)
=>
{
serviceMsg
(
res
,
this
).
then
(()
=>
{
this
.
closeDialog2
();
this
.
boxOrderInfo
=
{};
this
.
getList
();
});
});
},
/**装柜纠错 */
delCheck
()
{
if
(
!
this
.
correctionObj
.
qrCode
)
{
this
.
$message
.
error
(
this
.
$t
(
"
请输入二维码/条码编号
"
));
return
;
}
let
params
=
{
shipmentId
:
this
.
shipmentObj
.
id
,
type
:
1
,
pkgId
:
this
.
pkgData
.
id
,
orderNumCode
:
this
.
correctionObj
.
qrCode
};
checkInfoSingleDelete
(
params
).
then
((
res
)
=>
{
serviceMsg
(
res
,
this
).
then
(()
=>
{
this
.
closeDialog2
();
this
.
getList
();
});
});
},
/**批量装柜纠错 */
batchDelCheck
()
{
if
(
!
this
.
orderObj
.
orderNo
)
{
this
.
$message
.
error
(
this
.
$t
(
"
请输入订单号
"
));
return
;
}
let
params
=
{
shipmentId
:
this
.
shipmentObj
.
id
,
pkgId
:
this
.
pkgData
.
id
,
type
:
1
,
orderNo
:
this
.
orderObj
.
orderNo
};
checkInfoBatchDelete
(
params
).
then
((
res
)
=>
{
serviceMsg
(
res
,
this
).
then
(()
=>
{
this
.
closeDialog2
();
this
.
getList
();
});
});
}
}
}
</
script
>
<
style
>
<
style
lang=
"scss"
scoped
>
.table-title
{
display
:
flex
;
align-items
:
center
;
margin-bottom
:
10px
;
>
div
:first-child
{
flex
:
1
;
font-size
:
16px
;
}
>
div
:last-child
{
display
:
flex
;
>
.el-input
{
margin-right
:
10px
;
}
}
}
</
style
>
src/views/ecw/box/shippingAir/nodePage/tally/index.vue
View file @
18983f23
...
...
@@ -28,7 +28,7 @@
<div>
<template>
<el-input
v-model=
"qrCode"
:placeholder=
"$t('请输入二维码/条码编号')"
clearable
></el-input>
<el-button
type=
"primary"
@
click=
"handlerBatchCreate(
'single'
)"
>
{{
$t
(
'
确定
'
)
}}
</el-button>
<el-button
type=
"primary"
@
click=
"handlerBatchCreate()"
>
{{
$t
(
'
确定
'
)
}}
</el-button>
<el-button
type=
"primary"
@
click=
"handlerClick('batchInput',$t('批量输入'))"
>
{{
$t
(
'
批量输入
'
)
}}
</el-button>
<el-button
type=
"primary"
@
click=
"handlerClick('correction',$t('理货纠错'))"
>
{{
$t
(
'
理货纠错
'
)
}}
</el-button>
<el-button
type=
"primary"
@
click=
"handlerClick('correctionOrder',$t('批量理货纠错'))"
>
{{
$t
(
'
批量理货纠错
'
)
}}
</el-button>
...
...
@@ -74,10 +74,10 @@
</div>
</
template
>
</el-table-column>
<el-table-column
:label=
"$t('
箱数
')"
align=
"center"
prop=
"warehouseInInfo.cartonsNum"
>
<el-table-column
:label=
"$t('
计划/已理
')"
align=
"center"
prop=
"warehouseInInfo.cartonsNum"
>
<
template
slot-scope=
"scope"
>
<el-link
type=
"primary"
@
click.native=
"
showWarehouseLogs
(scope.row)"
>
{{
scope
.
row
.
warehouseInInfo
.
cartons
Num
}}
<el-link
type=
"primary"
@
click.native=
"
orderClick
(scope.row)"
>
{{
scope
.
row
.
num
}}
/
{{
scope
.
row
.
install
Num
}}
</el-link>
<div
style=
"color:blue;fontWeight:bold;"
>
{{
scope
.
row
.
multiSpecification
===
true
?
'
(多规格)
'
:
''
}}
...
...
@@ -136,33 +136,40 @@
@
cancel=
"currentTurnExceptionOrder=null"
@
success=
"currentTurnExceptionOrder=null"
/>
<!-- 对话框 -->
<el-dialog
custom-class=
"shipping-dialog"
:title=
"dialogConfig.title"
:visible.sync=
"dialogConfig.dialogVisible"
:fullscreen=
"dialogConfig.fullscreen"
:width=
"dialogConfig.width"
:modal-append-to-body=
false
append-to-body
>
<!-- 装柜纠错 -->
<
template
v-if=
"dialogConfig.type === 'correction' && dialogConfig.dialogVisible"
>
<el-dialog
custom-class=
"shipping-dialog"
:title=
"checkDialogConfig.title"
:visible.sync=
"checkDialogConfig.dialogVisible"
:fullscreen=
"checkDialogConfig.fullscreen"
:width=
"checkDialogConfig.width"
:modal-append-to-body=
false
append-to-body
>
<!-- 已装未装订单 -->
<
template
v-if=
"checkDialogConfig.type === 'orderTable'"
>
<el-table
:data=
"orderList"
height=
"500px"
border
>
<el-table-column
:label=
"$t('已理')"
align=
"center"
prop=
"loadTag"
/>
<el-table-column
:label=
"$t('未理')"
align=
"center"
prop=
"unloadTag"
/>
</el-table>
</
template
>
<!-- 理货纠错 -->
<
template
v-if=
"checkDialogConfig.type === 'correction' && checkDialogConfig.dialogVisible"
>
<el-form
ref=
"correctionForm"
:rules=
"rules"
:model=
"correctionObj"
label-position=
"top"
>
<el-form-item
:label=
"$t('
装柜
纠错(二维码/条形码编号)')"
prop=
"qrCode"
>
<el-form-item
:label=
"$t('
理货
纠错(二维码/条形码编号)')"
prop=
"qrCode"
>
<el-input
v-model=
"correctionObj.qrCode"
:placeholder=
"$t('请输入二维码/条形码编号')"
clearable
/>
</el-form-item>
</el-form>
<el-row
class=
"operate-button"
>
<el-button
type=
"primary"
@
click=
"
onSubmit('correctionForm'
)"
>
{{
$t
(
'
提交
'
)
}}
</el-button>
<el-button
type=
"primary"
@
click=
"
delCheck(
)"
>
{{
$t
(
'
提交
'
)
}}
</el-button>
<el-button
@
click=
"closeDialog2"
>
{{
$t
(
'
取消
'
)
}}
</el-button>
</el-row>
</
template
>
<!-- 批量
装柜
纠错(订单号) -->
<
template
v-if=
"
dialogConfig.type === 'correctionOrder' && d
ialogConfig.dialogVisible"
>
<!-- 批量
理货
纠错(订单号) -->
<
template
v-if=
"
checkDialogConfig.type === 'correctionOrder' && checkD
ialogConfig.dialogVisible"
>
<el-form
ref=
"orderForm"
:rules=
"rules"
:model=
"orderObj"
label-position=
"top"
>
<el-form-item
:label=
"$t('
装柜
纠错') +'(' + $t('订单号') + ')'"
prop=
"orderNo"
>
<el-form-item
:label=
"$t('
理货
纠错') +'(' + $t('订单号') + ')'"
prop=
"orderNo"
>
<el-input
type=
"textarea"
:rows=
"3"
v-model=
"orderObj.orderNo"
:placeholder=
"$t('请输入,多个以逗号分隔')"
clearable
/>
</el-form-item>
</el-form>
<el-row
class=
"operate-button"
>
<el-button
type=
"primary"
@
click=
"
onSubmit('orderForm'
)"
>
{{
$t
(
'
提交
'
)
}}
</el-button>
<el-button
type=
"primary"
@
click=
"
batchDelCheck(
)"
>
{{
$t
(
'
提交
'
)
}}
</el-button>
<el-button
@
click=
"closeDialog2"
>
{{
$t
(
'
取消
'
)
}}
</el-button>
</el-row>
</
template
>
<!--
装柜
批量输入 -->
<
template
v-if=
"
dialogConfig.type === 'batchInput' && d
ialogConfig.dialogVisible"
>
<!--
理货
批量输入 -->
<
template
v-if=
"
checkDialogConfig.type === 'batchInput' && checkD
ialogConfig.dialogVisible"
>
<el-form
ref=
"batchForm"
:rules=
"rules"
:model=
"batchObj"
>
<el-form-item
label=
""
prop=
"qrCode"
class=
"two-element"
>
<el-input
v-model=
"batchObj.qrCode"
:placeholder=
"$t('请输入订单号')"
clearable
/>
...
...
@@ -210,7 +217,8 @@
<
script
>
import
batchTally
from
"
./batchTally.vue
"
;
import
{
getTallyList
,
tallyRemove
,
tallyCommit
}
from
"
@/api/ecw/boxSea
"
;
import
{
getTallyList
,
tallyRemove
,
tallyCommit
,
getOrderDetailByBoxNo
}
from
"
@/api/ecw/boxSea
"
;
import
{
checkInfoSingleCreate
,
checkInfoBatchCreate
,
getOrderTagList
,
checkInfoSingleDelete
,
checkInfoBatchDelete
}
from
"
@/api/ecw/boxAir
"
;
import
{
formatDate
,
serviceMsg
,
getTotlContent
}
from
"
../../utils
"
;
import
WarehouseDetail
from
"
./warehouseDetail
"
;
import
{
getOrder
,
orderSpecialNeed
}
from
"
@/api/ecw/order
"
;
...
...
@@ -264,8 +272,26 @@ export default {
type
:
""
,
fullscreen
:
false
,
},
checkDialogConfig
:
{
title
:
""
,
dialogVisible
:
false
,
width
:
"
30%
"
,
type
:
""
,
fullscreen
:
false
,
},
// 订单信息
boxOrderInfo
:
{},
rules
:
{
qrCode
:
[
{
required
:
true
,
message
:
this
.
$t
(
"
必填
"
),
trigger
:
"
change
"
},
],
orderNo
:
[
{
required
:
true
,
message
:
this
.
$t
(
"
必填
"
),
trigger
:
"
change
"
},
],
},
// 已理/未理
orderList
:
[],
checkOrderList
:
[]
};
},
created
()
{
...
...
@@ -285,6 +311,7 @@ export default {
// 查询理货列表
getList
()
{
getTallyList
({
shipmentId
:
this
.
shipmentObj
.
id
}).
then
((
res
)
=>
{
this
.
checkOrderList
=
res
.
data
let
list
=
[];
res
.
data
.
forEach
((
item
)
=>
{
item
.
orderItemList
.
forEach
((
oItem
)
=>
{
...
...
@@ -301,6 +328,7 @@ export default {
positionNo
:
oItem
.
positionNo
,
tallyStatus
:
item
.
tallyStatus
,
tallyTime
:
item
.
tallyTime
,
installNum
:
item
.
installNum
,
});
});
});
...
...
@@ -447,6 +475,16 @@ export default {
},
// 理货完成
tallyFinish
()
{
let
flag
=
false
this
.
checkOrderList
.
forEach
(
item
=>
{
if
(
item
.
installNum
!=
item
.
num
){
flag
=
true
}
})
if
(
flag
){
this
.
$message
.
error
(
this
.
$t
(
"
仍有订单未理货,请完成所有订单箱号标签扫码后完成理货
"
));
return
;
}
tallyCommit
({
shipmentId
:
this
.
shipmentObj
.
id
}).
then
((
res
)
=>
{
serviceMsg
(
res
,
this
).
then
(()
=>
{
this
.
$emit
(
"
closeDialog
"
,
"
submit
"
);
...
...
@@ -460,31 +498,155 @@ export default {
this
.
showWarehouseInItemId
=
row
.
orderItemId
;
});
},
/** 表格订单号点击 */
orderClick
(
row
)
{
getOrderTagList
({
orderId
:
row
.
orderId
,
type
:
0
}).
then
((
res
)
=>
{
const
{
data
=
{}
}
=
res
;
this
.
orderList
=
[];
// 取最长的list
let
dataLength
=
data
.
loadList
.
length
;
if
(
data
.
unLoadList
.
length
>
dataLength
)
{
dataLength
=
data
.
unLoadList
.
length
;
}
// 组装数据,用一个table组件渲染
for
(
let
index
=
0
;
index
<
dataLength
;
index
++
)
{
this
.
orderList
.
push
({
loadTag
:
data
.
loadList
[
index
],
unloadTag
:
data
.
unLoadList
[
index
],
});
}
});
this
.
shwoDialog
({
type
:
"
orderTable
"
,
title
:
row
.
selfNo
,
});
},
/** 点击事件统一入口 */
handlerClick
(
type
,
title
)
{
this
.
shwoDialog
({
type
,
title
});
},
/** 弹窗事件 */
shwoDialog
(
config
)
{
this
.
$set
(
this
.
d
ialogConfig
,
"
title
"
,
config
.
title
);
this
.
$set
(
this
.
d
ialogConfig
,
"
type
"
,
config
.
type
);
this
.
$set
(
this
.
checkD
ialogConfig
,
"
title
"
,
config
.
title
);
this
.
$set
(
this
.
checkD
ialogConfig
,
"
type
"
,
config
.
type
);
switch
(
config
.
type
)
{
case
"
orderTable
"
:
this
.
$set
(
this
.
checkDialogConfig
,
"
fullscreen
"
,
false
);
break
;
case
"
batchInput
"
:
this
.
$set
(
this
.
d
ialogConfig
,
"
fullscreen
"
,
false
);
this
.
$set
(
this
.
checkD
ialogConfig
,
"
fullscreen
"
,
false
);
this
.
batchObj
=
{
boxNum
:
0
};
this
.
boxOrderInfo
=
{};
break
;
case
"
correction
"
:
this
.
$set
(
this
.
d
ialogConfig
,
"
fullscreen
"
,
false
);
this
.
$set
(
this
.
checkD
ialogConfig
,
"
fullscreen
"
,
false
);
this
.
correctionObj
=
{};
break
;
case
"
correctionOrder
"
:
this
.
$set
(
this
.
d
ialogConfig
,
"
fullscreen
"
,
false
);
this
.
$set
(
this
.
checkD
ialogConfig
,
"
fullscreen
"
,
false
);
this
.
orderObj
=
{};
break
;
}
this
.
$set
(
this
.
dialogConfig
,
"
dialogVisible
"
,
true
);
this
.
$set
(
this
.
checkDialogConfig
,
"
dialogVisible
"
,
true
);
},
/** 关闭弹窗 */
closeDialog2
()
{
this
.
$set
(
this
.
checkDialogConfig
,
"
dialogVisible
"
,
false
);
},
/* 创建理货标签 */
handlerBatchCreate
()
{
if
(
!
this
.
qrCode
)
{
this
.
$message
.
error
(
this
.
$t
(
"
请输入二维码/条码编号
"
));
return
;
}
let
params
=
{
shipmentId
:
this
.
shipmentObj
.
id
,
type
:
0
,
};
params
.
orderNumCode
=
this
.
qrCode
;
checkInfoSingleCreate
(
params
).
then
((
res
)
=>
{
serviceMsg
(
res
,
this
).
then
(()
=>
{
this
.
qrCode
=
""
;
this
.
getList
();
});
});
},
queryOrderInfo
()
{
this
.
$refs
[
"
batchForm
"
].
validate
((
valid
)
=>
{
if
(
valid
)
{
getOrderDetailByBoxNo
({
orderNumCode
:
this
.
batchObj
.
qrCode
,
shipmentId
:
this
.
shipmentObj
.
id
,
}).
then
((
res
)
=>
{
const
{
data
}
=
res
;
this
.
boxOrderInfo
=
data
;
this
.
batchObj
.
boxNum
=
Number
(
data
.
num
);
});
}
});
},
/**批量创建理货标签 */
batchLoad
()
{
if
(
!
this
.
boxOrderInfo
.
orderId
)
{
this
.
$message
.
error
(
this
.
$t
(
"
请输入订单号
"
));
return
;
}
if
(
this
.
batchObj
.
boxNum
===
0
)
{
this
.
$message
.
error
(
this
.
$t
(
"
箱数不能为0
"
));
return
;
}
let
params
=
{
orderId
:
this
.
boxOrderInfo
.
orderId
,
orderNo
:
this
.
boxOrderInfo
.
orderNo
,
shipmentId
:
this
.
shipmentObj
.
id
,
type
:
0
};
checkInfoBatchCreate
(
params
).
then
((
res
)
=>
{
serviceMsg
(
res
,
this
).
then
(()
=>
{
this
.
closeDialog2
();
this
.
boxOrderInfo
=
{};
this
.
getList
();
});
});
},
/**理货纠错 */
delCheck
()
{
if
(
!
this
.
correctionObj
.
qrCode
)
{
this
.
$message
.
error
(
this
.
$t
(
"
请输入二维码/条码编号
"
));
return
;
}
let
params
=
{
shipmentId
:
this
.
shipmentObj
.
id
,
type
:
0
,
orderNumCode
:
this
.
correctionObj
.
qrCode
};
checkInfoSingleDelete
(
params
).
then
((
res
)
=>
{
serviceMsg
(
res
,
this
).
then
(()
=>
{
this
.
closeDialog2
();
this
.
getList
();
});
});
},
/**批量理货纠错 */
batchDelCheck
()
{
if
(
!
this
.
orderObj
.
orderNo
)
{
this
.
$message
.
error
(
this
.
$t
(
"
请输入订单号
"
));
return
;
}
let
params
=
{
shipmentId
:
this
.
shipmentObj
.
id
,
type
:
0
,
orderNo
:
this
.
orderObj
.
orderNo
};
checkInfoBatchDelete
(
params
).
then
((
res
)
=>
{
serviceMsg
(
res
,
this
).
then
(()
=>
{
this
.
closeDialog2
();
this
.
getList
();
});
});
}
},
computed
:
{
/* 获取仓库 */
...
...
src/views/ecw/channel/componrnts/packaging-type.vue
View file @
18983f23
...
...
@@ -37,7 +37,7 @@
<span
class=
"mr-10"
>
-
</span>
<el-input
v-model=
"item.endNum"
class=
"mr-10"
></el-input
>
<span
class=
"mr-10"
>
/
</span>
<weight-select
@
change=
"
changeWeight"
:disabled=
"index > 0"
v-model=
"item.weight
Unit"
:options=
"unitList"
></weight-select>
<weight-select
@
change=
"
setAirFreightWeight"
:disabled=
"index > 0"
v-model=
"item.clearanceVolume
Unit"
:options=
"unitList"
></weight-select>
</div>
</el-col>
</el-row>
...
...
@@ -75,7 +75,7 @@ export default {
type
:
String
,
default
:
'
channelPriceStepClearanceList
'
},
readonly
:
Boolean
readonly
:
Boolean
,
},
name
:
"
packaging-type
"
,
components
:
{
Template
,
WeightSelect
,
CurrencySelect
},
...
...
@@ -95,24 +95,24 @@ export default {
}
},
computed
:{
screenCom
(){
let
num
=
undefined
if
(
this
.
keyArr
===
'
channelPriceStepClearanceList
'
){
num
=
this
.
getDictDatas
(
this
.
DICT_TYPE
.
AIR_CUSTOM_CLEARANCE
)[
0
]?.
value
}
else
{
num
=
this
.
getDictDatas
(
this
.
DICT_TYPE
.
AIR_COMMODITY_CUSTOM_CLEARANCE
)[
0
]?.
value
}
return
num
}
//
screenCom(){
//
let num = undefined
//
if(this.keyArr === 'channelPriceStepClearanceList'){
//
num = this.getDictDatas(this.DICT_TYPE.AIR_CUSTOM_CLEARANCE)[0]?.value
//
}else {
//
num = this.getDictDatas(this.DICT_TYPE. AIR_COMMODITY_CUSTOM_CLEARANCE)[0]?.value
//
}
//
//
return num
//
}
},
mounted
()
{
this
.
value1
=
this
.
value
this
.
$nextTick
(()
=>
{
if
(
!
this
.
value1
.
airWeightLimit
){
this
.
value1
.
airWeightLimit
=
this
.
screenCom
}
})
//
this.$nextTick(()=>{
//
if(!this.value1.airWeightLimit){
//
this.value1.airWeightLimit = this.screenCom
//
}
//
})
this
.
$nextTick
(()
=>
{
if
(
this
.
value1
[
this
.
keyArr
]
&&
this
.
value1
[
this
.
keyArr
].
length
===
0
){
this
.
addInterval
()
...
...
@@ -120,11 +120,6 @@ export default {
})
},
methods
:{
changeWeight
(
e
){
this
.
value1
[
this
.
keyArr
].
forEach
(
item
=>
{
item
.
weightUnit
=
e
})
},
setCurrency
(
e
){
this
.
value1
[
this
.
keyArr
].
forEach
(
item
=>
{
item
.
clearancePriceUnit
=
e
...
...
@@ -137,14 +132,11 @@ export default {
},
addInterval
(){
let
p
=
{
"
channelId
"
:
''
,
"
clearancePrice
"
:
''
,
"
clearancePriceUnit
"
:
this
.
value1
[
this
.
keyArr
].
length
&&
this
.
value1
[
this
.
keyArr
][
0
].
clearancePriceUnit
?
this
.
value1
[
this
.
keyArr
][
0
].
clearancePriceUnit
:
''
,
"
clearanceVolumeUnit
"
:
this
.
value1
[
this
.
keyArr
].
length
?
this
.
value1
[
this
.
keyArr
][
0
].
clearanceVolumeUnit
:
6
,
"
endNum
"
:
''
,
"
packagingId
"
:
''
,
"
startNum
"
:
''
,
"
weightUnit
"
:
this
.
value1
[
this
.
keyArr
].
length
?
this
.
value1
[
this
.
keyArr
][
0
].
weightUnit
:
6
}
this
.
value1
[
this
.
keyArr
].
push
(
p
)
this
.
$forceUpdate
();
...
...
@@ -152,10 +144,11 @@ export default {
deleteFn
(
index
){
this
.
value1
[
this
.
keyArr
].
splice
(
index
,
1
)
this
.
$forceUpdate
();
}
},
watch
:{
'
value1.priceStepClearanceList
'
:{
'
value1.priceStepClearance
CreateReqVO
List
'
:{
handler
(
val
){
if
(
val
&&
val
.
length
===
0
){
this
.
addInterval
();
...
...
src/views/ecw/channel/edit.vue
View file @
18983f23
<
template
>
<div
class=
"app-container"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"120px"
>
<el-card
shadow=
"never"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
{{
$t
(
'
渠道信息
'
)
}}
</span>
</div>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('中文名称')"
prop=
"nameZh"
>
<el-input
v-model=
"form.nameZh"
:placeholder=
"$t('请输入名称-中文')"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('名称英文')"
prop=
"nameEn"
>
<el-input
v-model=
"form.nameEn"
:placeholder=
"$t('请输入名称-英文')"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('内部名称中文')"
prop=
"internalNameZh"
>
<el-input
v-model=
"form.internalNameZh"
:placeholder=
"$t('请输入内部名称-中文')"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('内部名称英文')"
prop=
"internalNameEn"
>
<el-input
v-model=
"form.internalNameEn"
:placeholder=
"$t('请输入内部名称-英文')"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('类型编码')"
prop=
"typeNumber"
>
<el-input
v-model=
"form.typeNumber"
:placeholder=
"$t('请输入类型编码')"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('简码')"
prop=
"code"
>
<el-input
v-model=
"form.code"
:placeholder=
"$t('请输入简码')"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<!--
<el-form-item
:label=
"$t('归属仓库')"
prop=
"warehouseIds"
>
-->
<!-- <!–
<el-select
v-model=
"form.wareHouseIds"
>
-->
<!--
<el-option
v-for=
"item in warehouseList"
:value=
"item.id"
:label=
"item.nameZh"
/>
-->
<!--
</el-select>
–>
-->
<!--
<el-checkbox-group
v-model=
"warehouseIdsArr"
>
-->
<!-- <!–label需要是字符串,因为回显时分解后为字符串格式–>-->
<!--
<el-checkbox
v-for=
"item in warehouseList"
:label=
"`$
{item.id}`" :key="item.id" >
{{
item
.
titleZh
}}
</el-checkbox>
-->
<!--
</el-checkbox-group>
-->
<!-- <!–
<el-input-->
<!-- v-model="form.warehouseIds"-->
<!-- placeholder="请输入归属仓库Ids"-->
<!-- /> –>-->
<!--
</el-form-item>
-->
</el-col>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('排序')"
prop=
"sort"
>
<el-input
v-model=
"form.sort"
:placeholder=
"$t('请输入排序')"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('快递')"
prop=
"expressId"
>
<!--
<el-input
v-model=
"form.expressId"
placeholder=
"请输入快递ID"
/>
-->
<el-select
v-model=
"form.expressId"
>
<el-option
v-for=
"item in expressList"
:value=
"item.id+''"
:label=
"item.companyName"
:key=
"item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('预计到达时间')"
prop=
"etaTime"
>
<el-input
type=
"number"
v-model=
"form.etaTime"
:placeholder=
"$t('请输入天数')"
>
<span
slot=
"append"
>
{{
$t
(
'
天
'
)
}}
</span>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter=
"20"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"可出商品特性"
prop=
"attrId"
>
<el-select
multiple
v-model=
"form.attrId"
>
<el-option
v-for=
"(item, index) in attrList"
:value=
"item.id"
:label=
"$l(item, 'attrName')"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter=
"20"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"渠道泡重比例"
prop=
"attrId"
>
<el-input
v-model.number=
"form.bubbleWeightRatio"
style=
"width: 200px"
>
<template
#suffix
>
<span>
%
</span>
</
template
>
</el-input>
</el-form-item>
</el-col>
</el-row>
<div
style=
"display: flex; justify-content: space-between;"
>
<h1>
<span
style=
"color: red;font-size: 14px;font-weight: 700;"
>
*
</span>
渠道包装列表
</h1>
<div>
<el-button
type=
"primary"
@
click=
"addPackaging"
>
添加包装类型
</el-button>
<el-button
type=
"text"
@
click=
"dialogVisible = true;"
>
选择渠道包装模板
</el-button>
</div>
</div>
<el-row
:gutter=
"20"
v-for=
"(itemm, index) in form.channelPackagingList"
style=
"margin-bottom: 50px;border-bottom: 1px solid #cccccc"
:key=
"index"
>
<el-col
:span=
"2"
>
包装类型{{index + 1}}:
</el-col>
<el-col
:span=
"5"
>
<el-select
multiple
v-model=
"itemm.packagingTypes"
>
<el-option
v-for=
"item in getDictDatas(DICT_TYPE.ECW_PACKAGING_TYPE)"
:value=
"item.value"
:key=
"item.value"
:label=
"$l(item, 'label')"
:disabled=
"deletePackagingTypes.includes(item.value) && !itemm.packagingTypes.includes(item.value)"
></el-option>
</el-select>
</el-col>
<el-col
:span=
"16"
>
<packaging-type
v-if=
"form.channelPackagingList.length"
v-model=
"form.channelPackagingList[index]"
>
<el-button
:disabled=
"form.channelPackagingList.length === 1"
@
click=
"deleteFn(index)"
type=
"danger"
>
删除包装类型{{index + 1}}
</el-button>
</packaging-type>
</el-col>
</el-row>
<el-form-item
:label=
"$t('备注-中文')"
prop=
"remarksZh"
>
<el-input
v-model=
"form.remarksZh"
:placeholder=
"$t('请输入备注-中文')"
/>
</el-form-item>
<el-form-item
:label=
"$t('备注-英文')"
prop=
"remarksEn"
>
<el-input
v-model=
"form.remarksEn"
:placeholder=
"$t('请输入备注-英文')"
/>
</el-form-item>
<!-- <el-form-item label="状态(0:禁用 1:启用)" prop="status">
<el-radio-group v-model="form.status">
<el-radio label="1">{{ $t('请选择字典生成') }}</el-radio>
</el-radio-group>
</el-form-item> -->
</el-card>
<!-- <el-card shadow="never">-->
<!-- <div slot="header" class="clearfix">-->
<!-- <span>{{ $t('渠道收费规则') }}</span>-->
<!-- </div>-->
<!-- -->
<!-- <el-form-item :label="$t('清关单价')" prop="customsClearUnit">-->
<!-- <el-input v-model="form.customsClearUnit" :placeholder="$t('请输入清关单价')">-->
<!-- <span slot="append">$</span>-->
<!-- </el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="每0.5KG单价" prop="weightUnitPrice">-->
<!-- <el-input v-model="form.weightUnitPrice" :placeholder="$t('此字段名暂缺')" >-->
<!-- <span slot="append">$</span>-->
<!-- </el-input>-->
<!-- </el-form-item>-->
<!-- </el-card>-->
</el-form>
<div>
<el-button
type=
"primary"
@
click=
"submitForm"
>
{{ $t('确 定') }}
</el-button>
<el-button
@
click=
"$router.back()"
>
{{ $t('返回列表') }}
</el-button>
</div>
<div
class=
"app-container"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"120px"
>
<el-card
shadow=
"never"
>
<div
slot=
"header"
class=
"clearfix"
>
<span>
{{
$t
(
'
渠道信息
'
)
}}
</span>
</div>
<el-row>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('中文名称')"
prop=
"nameZh"
>
<el-input
v-model=
"form.nameZh"
:placeholder=
"$t('请输入名称-中文')"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('名称英文')"
prop=
"nameEn"
>
<el-input
v-model=
"form.nameEn"
:placeholder=
"$t('请输入名称-英文')"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('内部名称中文')"
prop=
"internalNameZh"
>
<el-input
v-model=
"form.internalNameZh"
:placeholder=
"$t('请输入内部名称-中文')"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('内部名称英文')"
prop=
"internalNameEn"
>
<el-input
v-model=
"form.internalNameEn"
:placeholder=
"$t('请输入内部名称-英文')"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('类型编码')"
prop=
"typeNumber"
>
<el-input
v-model=
"form.typeNumber"
:placeholder=
"$t('请输入类型编码')"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('简码')"
prop=
"code"
>
<el-input
v-model=
"form.code"
:placeholder=
"$t('请输入简码')"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<!--
<el-form-item
:label=
"$t('归属仓库')"
prop=
"warehouseIds"
>
-->
<!-- <!–
<el-select
v-model=
"form.wareHouseIds"
>
-->
<!--
<el-option
v-for=
"item in warehouseList"
:value=
"item.id"
:label=
"item.nameZh"
/>
-->
<!--
</el-select>
–>
-->
<!--
<el-checkbox-group
v-model=
"warehouseIdsArr"
>
-->
<!-- <!–label需要是字符串,因为回显时分解后为字符串格式–>-->
<!--
<el-checkbox
v-for=
"item in warehouseList"
:label=
"`$
{item.id}`" :key="item.id" >
{{
item
.
titleZh
}}
</el-checkbox>
-->
<!--
</el-checkbox-group>
-->
<!-- <!–
<el-input-->
<!-- v-model="form.warehouseIds"-->
<!-- placeholder="请输入归属仓库Ids"-->
<!-- /> –>-->
<!--
</el-form-item>
-->
</el-col>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('排序')"
prop=
"sort"
>
<el-input
v-model=
"form.sort"
:placeholder=
"$t('请输入排序')"
/>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('快递')"
prop=
"expressId"
>
<!--
<el-input
v-model=
"form.expressId"
placeholder=
"请输入快递ID"
/>
-->
<el-select
v-model=
"form.expressId"
>
<el-option
v-for=
"item in expressList"
:value=
"item.id+''"
:label=
"item.companyName"
:key=
"item.id"
/>
</el-select>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('预计到达时间')"
prop=
"etaTime"
>
<el-input
type=
"number"
v-model=
"form.etaTime"
:placeholder=
"$t('请输入天数')"
>
<span
slot=
"append"
>
{{
$t
(
'
天
'
)
}}
</span>
</el-input>
</el-form-item>
</el-col>
<el-col
:span=
"12"
>
<el-form-item
:label=
"$t('所属目的国家')"
prop=
"country"
>
<el-select
filterable
clearable
v-model=
"form.countryId"
:placeholder=
"$t('请选择国家')"
>
<el-option
v-for=
"dict in countryList"
:key=
"dict.id"
:label=
"$l(dict,'title')"
:value=
"parseInt(dict.id)"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter=
"20"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"可出商品特性"
prop=
"attrId"
>
<el-select
multiple
v-model=
"form.attrId"
>
<el-option
v-for=
"(item, index) in attrList"
:value=
"item.id"
:label=
"$l(item, 'attrName')"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row
:gutter=
"20"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"渠道泡重比例"
prop=
"attrId"
>
<el-input
v-model.number=
"form.bubbleWeightRatio"
style=
"width: 200px"
>
<template
#suffix
>
<span>
%
</span>
</
template
>
</el-input>
</el-form-item>
</el-col>
</el-row>
<!-- <div style="display: flex; justify-content: space-between;">-->
<!-- <h1>-->
<!-- <span style="color: red;font-size: 14px;font-weight: 700;">*</span>-->
<!-- 渠道包装列表-->
<!-- </h1>-->
<!-- <div>-->
<!-- <el-button type="primary" @click="addPackaging" >添加包装类型</el-button>-->
<!-- <el-button type="text" @click="dialogVisible = true;">选择渠道包装模板</el-button>-->
<!-- </div>-->
<!-- </div>-->
<!-- <el-row :gutter="20" v-for="(itemm, index) in form.channelPackagingList" style="margin-bottom: 50px;border-bottom: 1px solid #cccccc" :key="index">-->
<!-- <el-col :span="2">包装类型{{index + 1}}:</el-col>-->
<!-- <el-col :span="5">-->
<!-- <el-select multiple v-model="itemm.packagingTypes" >-->
<!-- <el-option v-for="item in getDictDatas(DICT_TYPE.ECW_PACKAGING_TYPE)" :value="item.value" :key="item.value" :label="$l(item, 'label')" :disabled="deletePackagingTypes.includes(item.value) && !itemm.packagingTypes.includes(item.value)" ></el-option>-->
<!-- </el-select>-->
<!-- </el-col>-->
<!-- <el-col :span="16">-->
<!-- <packaging-type v-if="form.channelPackagingList.length" v-model="form.channelPackagingList[index]">-->
<!-- <el-button :disabled="form.channelPackagingList.length === 1" @click="deleteFn(index)" type="danger">删除包装类型{{index + 1}}</el-button>-->
<!-- </packaging-type>-->
<!-- </el-col>-->
<!-- </el-row>-->
<el-form-item
:label=
"$t('备注-中文')"
prop=
"remarksZh"
>
<el-input
v-model=
"form.remarksZh"
:placeholder=
"$t('请输入备注-中文')"
/>
</el-form-item>
<el-form-item
:label=
"$t('备注-英文')"
prop=
"remarksEn"
>
<el-input
v-model=
"form.remarksEn"
:placeholder=
"$t('请输入备注-英文')"
/>
</el-form-item>
<!-- <el-form-item label="状态(0:禁用 1:启用)" prop="status">
<el-radio-group v-model="form.status">
<el-radio label="1">{{ $t('请选择字典生成') }}</el-radio>
</el-radio-group>
</el-form-item> -->
</el-card>
<!-- <el-card shadow="never">-->
<!-- <div slot="header" class="clearfix">-->
<!-- <span>{{ $t('渠道收费规则') }}</span>-->
<!-- </div>-->
<!-- -->
<!-- <el-form-item :label="$t('清关单价')" prop="customsClearUnit">-->
<!-- <el-input v-model="form.customsClearUnit" :placeholder="$t('请输入清关单价')">-->
<!-- <span slot="append">$</span>-->
<!-- </el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="每0.5KG单价" prop="weightUnitPrice">-->
<!-- <el-input v-model="form.weightUnitPrice" :placeholder="$t('此字段名暂缺')" >-->
<!-- <span slot="append">$</span>-->
<!-- </el-input>-->
<!-- </el-form-item>-->
<!-- </el-card>-->
</el-form>
<div>
<el-button
type=
"primary"
@
click=
"submitForm"
>
{{ $t('确 定') }}
</el-button>
<el-button
@
click=
"$router.back()"
>
{{ $t('返回列表') }}
</el-button>
</div>
<el-dialog
title=
"提示"
:visible.sync=
"dialogVisible"
...
...
@@ -180,11 +188,11 @@
</template>
<
script
>
import
{
createChannel
,
updateChannel
,
getChannel
,
getChannelPage
,
exportChannelExcel
,
createChannel
,
updateChannel
,
getChannel
,
getChannelPage
,
exportChannelExcel
,
}
from
"
@/api/ecw/channel
"
;
import
{
getWarehouseList
}
from
'
@/api/ecw/warehouse
'
import
{
getExpressPage
}
from
'
@/api/ecw/express
'
...
...
@@ -192,216 +200,222 @@ import PackagingType from "@/views/ecw/channel/componrnts/packaging-type.vue";
import
{
DICT_TYPE
,
getDictDataLabel
,
getDictDatas
}
from
"
@/utils/dict
"
;
import
{
getProductAttrList
}
from
"
@/api/ecw/productAttr
"
;
import
indexDialog
from
"
@/views/ecw/channel/index-dialog.vue
"
;
import
{
getTradeCountryList
}
from
"
@/api/ecw/region
"
;
export
default
{
components
:
{
PackagingType
,
indexDialog
},
data
()
{
return
{
dialogVisible
:
false
,
form
:
{
bubbleWeightRatio
:
100
,
channelCostCreateReqVO
:{},
channelPackagingList
:[],
attrId
:[],
},
components
:
{
PackagingType
,
indexDialog
},
data
()
{
return
{
countryList
:
[],
dialogVisible
:
false
,
form
:
{
countryId
:
undefined
,
bubbleWeightRatio
:
100
,
channelCostCreateReqVO
:
{},
attrId
:
[],
},
rules
:
{
nameZh
:
{
required
:
true
,
message
:
'
请输入中文名称
'
,
trigger
:
'
blur
'
},
nameEn
:
{
required
:
true
,
message
:
'
请输入英文名称
'
,
trigger
:
'
blur
'
},
internalNameZh
:
{
required
:
true
,
message
:
'
请输入内部中文名称
'
,
trigger
:
'
blur
'
},
internalNameEn
:
{
required
:
true
,
message
:
'
请输入内部英文名称
'
,
trigger
:
'
blur
'
},
typeNumber
:
{
required
:
true
,
message
:
'
请输入编码类型
'
,
trigger
:
'
blur
'
},
code
:
{
required
:
true
,
message
:
'
请输入简码
'
,
trigger
:
'
blur
'
},
attrId
:
{
required
:
true
,
message
:
'
请选择可出商品特性
'
,
trigger
:
'
blur
'
}
rules
:
{
nameZh
:
{
required
:
true
,
message
:
'
请输入中文名称
'
,
trigger
:
'
blur
'
},
nameEn
:
{
required
:
true
,
message
:
'
请输入英文名称
'
,
trigger
:
'
blur
'
},
internalNameZh
:
{
required
:
true
,
message
:
'
请输入内部中文名称
'
,
trigger
:
'
blur
'
},
internalNameEn
:
{
required
:
true
,
message
:
'
请输入内部英文名称
'
,
trigger
:
'
blur
'
},
typeNumber
:
{
required
:
true
,
message
:
'
请输入编码类型
'
,
trigger
:
'
blur
'
},
code
:
{
required
:
true
,
message
:
'
请输入简码
'
,
trigger
:
'
blur
'
},
attrId
:
{
required
:
true
,
message
:
'
请选择可出商品特性
'
,
trigger
:
'
blur
'
}
},
expressList
:[],
warehouseList
:
[],
warehouseIdsArr
:[],
attrList
:[]
};
},
watch
:{
/* wareHouseIdsArr(val){
console.log('更新wareHouseIdsArr', val)
this.$set(this.form, 'wareHouseIds', val.join(','))
},
'form.wareHouseIds'(val){
console.log('form.wareHouseIds', val)
this.wareHouseIdsArr = val?.split(',') || []
} */
expressList
:
[],
warehouseList
:
[],
warehouseIdsArr
:
[],
attrList
:
[]
};
},
watch
:
{
/* wareHouseIdsArr(val){
console.log('更新wareHouseIdsArr', val)
this.$set(this.form, 'wareHouseIds', val.join(','))
},
'form.wareHouseIds'(val){
console.log('form.wareHouseIds', val)
this.wareHouseIdsArr = val?.split(',') || []
} */
},
mounted
()
{
getTradeCountryList
().
then
(
r
=>
{
this
.
countryList
=
r
.
data
})
getProductAttrList
().
then
(
response
=>
{
this
.
attrList
=
response
.
data
;
this
.
form
.
attrId
=
this
.
attrList
.
map
(
i
=>
i
.
id
)
})
},
},
async
created
()
{
// 获得仓库
await
getWarehouseList
().
then
(
res
=>
{
this
.
warehouseList
=
res
.
data
})
await
getExpressPage
({
pageSize
:
1000
}).
then
(
res
=>
{
this
.
expressList
=
res
.
data
.
list
})
// 获得仓库
await
getWarehouseList
().
then
(
res
=>
{
this
.
warehouseList
=
res
.
data
})
await
getExpressPage
({
pageSize
:
1000
}).
then
(
res
=>
{
this
.
expressList
=
res
.
data
.
list
})
if
(
this
.
$route
.
query
.
id
)
{
getChannel
(
this
.
$route
.
query
.
id
).
then
((
res
)
=>
{
this
.
$set
(
this
,
'
form
'
,
{...
res
.
data
})
if
(
this
.
form
.
channelPackagingList
===
null
){
this
.
form
.
channelPackagingList
=
[];
this
.
addPackaging
()
}
if
(
this
.
form
.
attrId
){
this
.
form
.
attrId
=
this
.
form
.
attrId
.
split
(
'
,
'
).
map
(
i
=>
+
i
)
}
else
{
this
.
form
.
attrId
=
[]
}
if
(
this
.
$route
.
query
.
id
)
{
getChannel
(
this
.
$route
.
query
.
id
).
then
((
res
)
=>
{
this
.
$set
(
this
,
'
form
'
,
{...
res
.
data
})
// if(this.form.channelPackagingList === null ){
// this.form.channelPackagingList = [];
// this.addPackaging()
// }
if
(
this
.
form
.
attrId
)
{
this
.
form
.
attrId
=
this
.
form
.
attrId
.
split
(
'
,
'
).
map
(
i
=>
+
i
)
}
else
{
this
.
form
.
attrId
=
[]
}
this
.
form
.
countryId
=
this
.
form
.
countryId
||
undefined
this
.
form
.
channelPackagingList
.
forEach
(
item
=>
{
item
.
packagingTypes
=
item
.
packagingTypes
&&
item
.
packagingTypes
.
length
!==
0
?
item
.
packagingTypes
.
split
(
'
,
'
)
:
[]
})
// if(this.form.warehouseIds.length){
// this.warehouseIdsArr = this.form.warehouseIds.split(',')?.filter(item => !!item)
// }
if
(
this
.
form
.
bubbleWeightRatio
){
this
.
form
.
bubbleWeightRatio
=
this
.
form
.
bubbleWeightRatio
*
100
}
});
}
else
{
this
.
addPackaging
()
// this.form.channelPackagingList.forEach(item =>{
// item.packagingTypes = item.packagingTypes && item.packagingTypes.length !== 0 ? item.packagingTypes.split(',') : []
// })
// if(this.form.warehouseIds.length){
// this.warehouseIdsArr = this.form.warehouseIds.split(',')?.filter(item => !!item)
// }
if
(
this
.
form
.
bubbleWeightRatio
)
{
this
.
form
.
bubbleWeightRatio
=
this
.
form
.
bubbleWeightRatio
*
100
}
});
}
else
{
this
.
addPackaging
()
}
},
computed
:{
DICT_TYPE
()
{
return
DICT_TYPE
},
deletePackagingTypes
(){
let
a
=
[]
this
.
form
.
channelPackagingList
.
forEach
(
item
=>
{
a
.
push
(...
item
.
packagingTypes
)
})
return
a
}
/* wareHouseIdsArr:{
get(){
return this.form.wareHouseIds?.split(',') || []
},
set(val){
console.log('val', val)
this.$set(this.form, 'wareHouseIds', val.join(','))
}
} */
},
computed
:
{
DICT_TYPE
()
{
return
DICT_TYPE
},
methods
:
{
deletePackagingTypes
()
{
let
a
=
[]
this
.
form
.
channelPackagingList
.
forEach
(
item
=>
{
a
.
push
(...
item
.
packagingTypes
)
})
return
a
}
/* wareHouseIdsArr:{
get(){
return this.form.wareHouseIds?.split(',') || []
},
set(val){
console.log('val', val)
this.$set(this.form, 'wareHouseIds', val.join(','))
}
} */
},
methods
:
{
getDictDatas
,
copyFn
(
val
){
copyFn
(
val
)
{
this
.
form
.
channelPackagingList
=
[];
this
.
dialogVisible
=
false
;
getChannel
(
val
).
then
((
res
)
=>
{
(
res
.
data
.
channelPackagingList
||
[]).
forEach
((
item
,
index
)
=>
{
this
.
form
.
channelPackagingList
[
index
]
=
{
airWeightLimit
:
item
.
airWeightLimit
,
packagingTypes
:
item
.
packagingTypes
?
item
.
packagingTypes
.
split
(
'
,
'
)
:
[],
channelPriceStepClearanceList
:[],}
// if(!this.form.channelPackagingList[index]){
// this.form.channelPackagingList[index] = { airWeightLimit:item.airWeightLimit, packagingTypes:item.packagingTypes ? item.packagingTypes.split(',') : [], channelPriceStepClearanceList:[],}
// }else {
//
// }
item
.
channelPriceStepClearanceList
.
forEach
((
itemm
,
indexx
)
=>
{
let
p
=
{
"
channelId
"
:
''
,
"
clearancePrice
"
:
''
,
"
clearancePriceUnit
"
:
''
,
"
clearanceVolumeUnit
"
:
''
,
"
endNum
"
:
''
,
"
packagingId
"
:
''
,
"
startNum
"
:
''
,
"
weightUnit
"
:
''
}
if
(
!
this
.
form
.
channelPackagingList
[
index
].
channelPriceStepClearanceList
[
indexx
]){
this
.
form
.
channelPackagingList
[
index
].
channelPriceStepClearanceList
[
indexx
]
=
p
;
}
let
it
=
this
.
form
.
channelPackagingList
[
index
].
channelPriceStepClearanceList
[
indexx
]
this
.
form
.
channelPackagingList
[
index
].
channelPriceStepClearanceList
[
indexx
]
=
{
...
p
,
...
it
,
clearancePrice
:
itemm
.
clearancePrice
,
clearancePriceUnit
:
itemm
.
clearancePriceUnit
,
clearanceVolumeUnit
:
itemm
.
clearanceVolumeUnit
,
endNum
:
itemm
.
endNum
,
startNum
:
itemm
.
startNum
,
weightUnit
:
itemm
.
weightUnit
}
;
})
})
this
.
$forceUpdate
()
});
//
getChannel(val).then((res) => {
//
(res.data.channelPackagingList || []).forEach((item,index) =>{
//
this.form.channelPackagingList[index] = { airWeightLimit:item.airWeightLimit, packagingTypes: item.packagingTypes ? item.packagingTypes.split(',') : [], channelPriceStepClearanceList:[],}
//
// if(!this.form.channelPackagingList[index]){
//
// this.form.channelPackagingList[index] = { airWeightLimit:item.airWeightLimit, packagingTypes:item.packagingTypes ? item.packagingTypes.split(',') : [], channelPriceStepClearanceList:[],}
//
// }else {
//
//
//
// }
//
item.channelPriceStepClearanceList.forEach((itemm, indexx) => {
//
let p = {
//
"channelId":'',
//
"clearancePrice":'',
//
"clearancePriceUnit":'',
//
"clearanceVolumeUnit":'',
//
"endNum":'',
//
"packagingId":'',
//
"startNum":'',
//
"weightUnit":''
//
}
//
if(!this.form.channelPackagingList[index].channelPriceStepClearanceList[indexx]){
//
this.form.channelPackagingList[index].channelPriceStepClearanceList[indexx] = p;
//
}
//
let it = this.form.channelPackagingList[index].channelPriceStepClearanceList[indexx]
//
this.form.channelPackagingList[index].channelPriceStepClearanceList[indexx] = {
//
...p,
//
...it,
//
clearancePrice:itemm.clearancePrice,
//
clearancePriceUnit:itemm.clearancePriceUnit,
//
clearanceVolumeUnit:itemm.clearanceVolumeUnit,
//
endNum:itemm.endNum,
//
startNum:itemm.startNum,
//
weightUnit:itemm.weightUnit
//
} ;
//
})
//
})
//
this.$forceUpdate()
//
});
},
deleteFn
(
index
){
deleteFn
(
index
)
{
this
.
form
.
channelPackagingList
.
splice
(
index
,
1
)
},
//添加包装类型
addPackaging
(){
addPackaging
()
{
let
p
=
{
airWeightLimit
:
''
,
packagingTypes
:[],
channelPriceStepClearanceList
:[],
airWeightLimit
:
''
,
packagingTypes
:
[],
channelPriceStepClearanceList
:
[],
}
this
.
form
.
channelPackagingList
.
push
(
p
)
},
verify
(
row
){
verify
(
row
)
{
return
(
row
.
startNum
!==
''
&&
row
.
endNum
!==
''
&&
row
.
clearancePrice
!==
''
&&
row
.
clearancePriceUnit
!==
''
&&
row
.
clearanceVolumeUnit
!==
''
)
},
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
"
form
"
].
validate
((
valid
)
=>
{
if
(
!
valid
)
{
return
;
}
/** 提交按钮 */
submitForm
()
{
this
.
$refs
[
"
form
"
].
validate
((
valid
)
=>
{
if
(
!
valid
)
{
return
;
}
let
derail
=
false
this
.
form
.
channelPackagingList
.
forEach
(
item
=>
{
if
(
item
.
airWeightLimit
===
''
||
item
.
airWeightLimit
===
0
){
derail
=
true
return
this
.
$message
.
warning
(
'
请输入空运订单重量上限
'
)
}
if
(
!
item
.
packagingTypes
.
length
){
derail
=
true
return
this
.
$message
.
warning
(
'
请输入包装类型
'
)
}
if
(
!
item
.
channelPriceStepClearanceList
.
every
(
this
.
verify
)){
derail
=
true
return
this
.
$message
.
warning
(
'
请输入阶梯价格
'
)
}
})
if
(
derail
)
return
;
// this.form.channelPackagingList.forEach(item =>{
// if(item.airWeightLimit === '' || item.airWeightLimit === 0){
// derail = true
// return this.$message.warning('请输入空运订单重量上限')
// }
// // if(!item.packagingTypes.length){
// // derail = true
// // return this.$message.warning('请输入包装类型')
// // }
// // if(!item.channelPriceStepClearanceList.every(this.verify)){
// // derail = true
// // return this.$message.warning('请输入阶梯价格')
// // }
// })
// this.form.warehouseIds = this.warehouseIdsArr.join(',')
let
form
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
form
))
let
attrId
=
this
.
form
.
attrId
attrId
=
attrId
.
join
(
'
,
'
)
form
.
attrId
=
attrId
form
.
channelPackagingList
.
forEach
(
item
=>
{
item
.
packagingTypes
=
item
.
packagingTypes
.
join
(
'
,
'
)
})
let
form
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
form
))
let
attrId
=
this
.
form
.
attrId
attrId
=
attrId
.
join
(
'
,
'
)
form
.
attrId
=
attrId
//
form.channelPackagingList.forEach(item =>{
//
item.packagingTypes = item.packagingTypes.join(',')
//
})
form
.
bubbleWeightRatio
=
form
.
bubbleWeightRatio
/
100
// 修改的提交
if
(
this
.
form
.
channelId
!=
null
)
{
updateChannel
(
form
).
then
((
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"
修改成功
"
);
this
.
$router
.
back
();
});
return
;
}
// 添加的提交
createChannel
(
form
).
then
((
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"
新增成功
"
);
this
.
$router
.
back
();
});
});
},
},
// 修改的提交
if
(
this
.
form
.
channelId
!=
null
)
{
updateChannel
(
form
).
then
((
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"
修改成功
"
);
this
.
$router
.
back
();
});
return
;
}
// 添加的提交
createChannel
(
form
).
then
((
response
)
=>
{
this
.
$modal
.
msgSuccess
(
"
新增成功
"
);
this
.
$router
.
back
();
});
});
},
},
};
</
script
>
<
style
scoped
lang=
"scss"
>
.el-card
{
margin-bottom
:
20px
;
.el-card
{
margin-bottom
:
20px
;
}
</
style
>
src/views/ecw/deptTarget/allAchievement.vue
View file @
18983f23
...
...
@@ -59,27 +59,14 @@
</el-select>
</el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleQuery"
>
{{
$t
(
'
搜索
'
)
}}
</el-button>
<el-button
type=
"primary"
icon=
"el-icon-search"
@
click=
"resetQuery"
>
{{
$t
(
'
重置
'
)
}}
</el-button>
<el-button
@
click=
"resetQuery"
>
{{
$t
(
'
重置
'
)
}}
</el-button>
<el-button
type=
"warning"
plain
icon=
"el-icon-download"
size=
"mini"
@
click=
"handleExportDetail"
:loading=
"exportLoading"
v-hasPermi=
"['ecw:achievement:export']"
>
{{
$t
(
'
导出明细
'
)
}}
</el-button>
<el-button
type=
"warning"
plain
icon=
"el-icon-download"
size=
"mini"
@
click=
"handleExportStatistics"
:loading=
"exportLoading"
v-hasPermi=
"['ecw:achievement:export']"
>
{{
$t
(
'
导出统计
'
)
}}
</el-button>
<!--
<el-button
type=
"warning"
plain
icon=
"el-icon-download"
size=
"mini"
@
click=
"handleExport"
:loading=
"exportLoading"
>
{{
$t
(
'
导出
'
)
}}
</el-button>
-->
</el-form-item>
</el-form>
<div
class=
"total_num"
>
<span>
{{
$t
(
'
开发客户:
'
)
}}
</span>
<span>
{{
$t
(
'
总箱数
'
)
}}
{{
totalData
.
developNum
}}{{
$t
(
'
箱
'
)
}}
</span>
<span>
{{
$t
(
'
总方数
'
)
}}
{{
totalData
.
developVolume
}}
m³
</span>
<span>
{{
$t
(
'
总重量
'
)
}}
{{
totalData
.
developWeight
}}
KG
</span>
<span>
{{
$t
(
'
公司客户:
'
)
}}
</span>
<span>
{{
$t
(
'
总箱数
'
)
}}
{{
totalData
.
companyNum
}}{{
$t
(
'
箱
'
)
}}
</span>
<span>
{{
$t
(
'
总方数
'
)
}}
{{
totalData
.
companyVolume
}}
m³
</span>
<span>
{{
$t
(
'
总重量
'
)
}}
{{
totalData
.
companyWeight
}}
KG
</span>
<span>
{{
$t
(
'
汇总:
'
)
}}
</span>
<span>
{{
$t
(
'
总箱数
'
)
}}
{{
totalData
.
sumNum
}}{{
$t
(
'
箱
'
)
}}
</span>
<span>
{{
$t
(
'
总方数
'
)
}}
{{
totalData
.
sumVolume
}}
m³
</span>
<span>
{{
$t
(
'
总重量
'
)
}}
{{
totalData
.
sumWeight
}}
KG
</span>
</div>
<total
_num
:total-data=
"totalData"
></total
_num
>
<!-- 列表 -->
<el-table
v-loading=
"loading"
:data=
"list"
@
selection-change=
"handleSelectionChange"
>
<!--
<el-table-column
:label=
"$t('序号')"
align=
"center"
type=
"index"
></el-table-column>
-->
...
...
@@ -145,10 +132,11 @@
import
dayjs
from
"
dayjs
"
;
import
{
listServiceUser
}
from
"
@/api/system/user
"
;
import
{
getWarehouseList
}
from
'
@/api/ecw/warehouse
'
import
Total_num
from
"
@/views/ecw/deptTarget/total_num.vue
"
;
export
default
{
name
:
"
EcwDepttargetAllachievement
"
,
components
:
{},
components
:
{
Total_num
},
data
()
{
return
{
// 遮罩层
...
...
@@ -219,6 +207,12 @@
sumWeight
:
0
,
sumVolume
:
0
,
sumNum
:
0
,
newTotalNum
:
0
,
newTotalVolume
:
0
,
newTotalWeight
:
0
,
oldTotalNum
:
0
,
oldTotalVolume
:
0
,
oldTotalWeight
:
0
,
},
myAchievementData
:{},
warehouseList
:[]
...
...
@@ -313,6 +307,12 @@
this
.
totalData
.
developWeight
=
this
.
myAchievementData
.
devTotalWeight
this
.
totalData
.
developVolume
=
this
.
myAchievementData
.
devTotalVolume
this
.
totalData
.
developNum
=
this
.
myAchievementData
.
devTotalNum
this
.
$set
(
this
.
totalData
,
'
newTotalNum
'
,
this
.
myAchievementData
.
newTotalNum
)
this
.
$set
(
this
.
totalData
,
'
newTotalVolume
'
,
this
.
myAchievementData
.
newTotalVolume
)
this
.
$set
(
this
.
totalData
,
'
newTotalWeight
'
,
this
.
myAchievementData
.
newTotalWeight
)
this
.
$set
(
this
.
totalData
,
'
oldTotalNum
'
,
this
.
myAchievementData
.
oldTotalNum
)
this
.
$set
(
this
.
totalData
,
'
oldTotalVolume
'
,
this
.
myAchievementData
.
oldTotalVolume
)
this
.
$set
(
this
.
totalData
,
'
oldTotalWeight
'
,
this
.
myAchievementData
.
oldTotalWeight
)
this
.
loading
=
false
;
});
},
...
...
@@ -350,7 +350,11 @@
this
.
dateRangeCreateTime
=
[];
this
.
dateRangeStartTime
=
[];
this
.
dateRangeEndTime
=
[];
this
.
resetForm
(
"
queryForm
"
);
this
.
resetForm
(
"
queryParams
"
);
this
.
queryParams
=
{
pageNo
:
1
,
pageSize
:
10
}
this
.
handleQuery
();
},
/** 新增按钮操作 */
...
...
@@ -516,7 +520,7 @@
.total_num
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
justify-content
:
left
;
margin
:
20px
0
;
font-size
:
15px
;
}
...
...
src/views/ecw/deptTarget/myAchievement.vue
View file @
18983f23
...
...
@@ -70,20 +70,7 @@
>
{{
$t
(
'
导出
'
)
}}
</el-button>
-->
</el-form-item>
</el-form>
<div
class=
"total_num"
>
<span>
{{
$t
(
'
开发客户:
'
)
}}
</span>
<span>
{{
$t
(
'
总箱数
'
)
}}
{{
totalData
.
developNum
}}{{
$t
(
'
箱
'
)
}}
</span>
<span>
{{
$t
(
'
总方数
'
)
}}
{{
totalData
.
developVolume
}}
m³
</span>
<span>
{{
$t
(
'
总重量
'
)
}}
{{
totalData
.
developWeight
}}
KG
</span>
<span>
{{
$t
(
'
公司客户:
'
)
}}
</span>
<span>
{{
$t
(
'
总箱数
'
)
}}
{{
totalData
.
companyNum
}}{{
$t
(
'
箱
'
)
}}
</span>
<span>
{{
$t
(
'
总方数
'
)
}}
{{
totalData
.
companyVolume
}}
m³
</span>
<span>
{{
$t
(
'
总重量
'
)
}}
{{
totalData
.
companyWeight
}}
KG
</span>
<span>
{{
$t
(
'
汇总:
'
)
}}
</span>
<span>
{{
$t
(
'
总箱数
'
)
}}
{{
totalData
.
sumNum
}}{{
$t
(
'
箱
'
)
}}
</span>
<span>
{{
$t
(
'
总方数
'
)
}}
{{
totalData
.
sumVolume
}}
m³
</span>
<span>
{{
$t
(
'
总重量
'
)
}}
{{
totalData
.
sumWeight
}}
KG
</span>
</div>
<total
_num
:total-data=
"totalData"
></total
_num
>
<!-- 列表 -->
<el-table
v-loading=
"loading"
:data=
"list"
@
selection-change=
"handleSelectionChange"
>
<!--
<el-table-column
:label=
"$t('序号')"
align=
"center"
type=
"index"
></el-table-column>
-->
...
...
@@ -147,10 +134,11 @@
import
dayjs
from
"
dayjs
"
;
import
{
listServiceUser
}
from
"
@/api/system/user
"
;
import
{
getWarehouseList
}
from
'
@/api/ecw/warehouse
'
import
Total_num
from
"
@/views/ecw/deptTarget/total_num.vue
"
;
export
default
{
name
:
"
EcwDepttargetMyachievement
"
,
components
:
{},
components
:
{
Total_num
},
data
()
{
return
{
// 遮罩层
...
...
@@ -316,6 +304,12 @@
this
.
totalData
.
developWeight
=
this
.
myAchievementData
.
devTotalWeight
this
.
totalData
.
developVolume
=
this
.
myAchievementData
.
devTotalVolume
this
.
totalData
.
developNum
=
this
.
myAchievementData
.
devTotalNum
this
.
$set
(
this
.
totalData
,
'
newTotalNum
'
,
this
.
myAchievementData
.
newTotalNum
)
this
.
$set
(
this
.
totalData
,
'
newTotalVolume
'
,
this
.
myAchievementData
.
newTotalVolume
)
this
.
$set
(
this
.
totalData
,
'
newTotalWeight
'
,
this
.
myAchievementData
.
newTotalWeight
)
this
.
$set
(
this
.
totalData
,
'
oldTotalNum
'
,
this
.
myAchievementData
.
oldTotalNum
)
this
.
$set
(
this
.
totalData
,
'
oldTotalVolume
'
,
this
.
myAchievementData
.
oldTotalVolume
)
this
.
$set
(
this
.
totalData
,
'
oldTotalWeight
'
,
this
.
myAchievementData
.
oldTotalWeight
)
this
.
loading
=
false
;
});
},
...
...
src/views/ecw/deptTarget/myDeptAchievement.vue
View file @
18983f23
...
...
@@ -69,20 +69,7 @@
>
{{
$t
(
'
导出
'
)
}}
</el-button>
-->
</el-form-item>
</el-form>
<div
class=
"total_num"
>
<span>
{{
$t
(
'
开发客户:
'
)
}}
</span>
<span>
{{
$t
(
'
总箱数
'
)
}}
{{
totalData
.
developNum
}}{{
$t
(
'
箱
'
)
}}
</span>
<span>
{{
$t
(
'
总方数
'
)
}}
{{
totalData
.
developVolume
}}
m³
</span>
<span>
{{
$t
(
'
总重量
'
)
}}
{{
totalData
.
developWeight
}}
KG
</span>
<span>
{{
$t
(
'
公司客户:
'
)
}}
</span>
<span>
{{
$t
(
'
总箱数
'
)
}}
{{
totalData
.
companyNum
}}{{
$t
(
'
箱
'
)
}}
</span>
<span>
{{
$t
(
'
总方数
'
)
}}
{{
totalData
.
companyVolume
}}
m³
</span>
<span>
{{
$t
(
'
总重量
'
)
}}
{{
totalData
.
companyWeight
}}
KG
</span>
<span>
{{
$t
(
'
汇总:
'
)
}}
</span>
<span>
{{
$t
(
'
总箱数
'
)
}}
{{
totalData
.
sumNum
}}{{
$t
(
'
箱
'
)
}}
</span>
<span>
{{
$t
(
'
总方数
'
)
}}
{{
totalData
.
sumVolume
}}
m³
</span>
<span>
{{
$t
(
'
总重量
'
)
}}
{{
totalData
.
sumWeight
}}
KG
</span>
</div>
<total
_num
:total-data=
"totalData"
></total
_num
>
<!-- 列表 -->
<el-table
v-loading=
"loading"
:data=
"list"
@
selection-change=
"handleSelectionChange"
>
<!--
<el-table-column
:label=
"$t('序号')"
align=
"center"
type=
"index"
></el-table-column>
-->
...
...
@@ -147,10 +134,11 @@
import
dayjs
from
"
dayjs
"
;
import
{
listServiceUser
}
from
"
@/api/system/user
"
;
import
{
getWarehouseList
}
from
'
@/api/ecw/warehouse
'
import
Total_num
from
"
@/views/ecw/deptTarget/total_num.vue
"
;
export
default
{
name
:
"
EcwDepttargetMydeptachievement
"
,
components
:
{},
components
:
{
Total_num
},
data
()
{
return
{
// 遮罩层
...
...
@@ -313,6 +301,12 @@
this
.
totalData
.
developWeight
=
this
.
myAchievementData
.
devTotalWeight
this
.
totalData
.
developVolume
=
this
.
myAchievementData
.
devTotalVolume
this
.
totalData
.
developNum
=
this
.
myAchievementData
.
devTotalNum
this
.
$set
(
this
.
totalData
,
'
newTotalNum
'
,
this
.
myAchievementData
.
newTotalNum
)
this
.
$set
(
this
.
totalData
,
'
newTotalVolume
'
,
this
.
myAchievementData
.
newTotalVolume
)
this
.
$set
(
this
.
totalData
,
'
newTotalWeight
'
,
this
.
myAchievementData
.
newTotalWeight
)
this
.
$set
(
this
.
totalData
,
'
oldTotalNum
'
,
this
.
myAchievementData
.
oldTotalNum
)
this
.
$set
(
this
.
totalData
,
'
oldTotalVolume
'
,
this
.
myAchievementData
.
oldTotalVolume
)
this
.
$set
(
this
.
totalData
,
'
oldTotalWeight
'
,
this
.
myAchievementData
.
oldTotalWeight
)
this
.
loading
=
false
;
});
},
...
...
@@ -491,14 +485,5 @@
<
style
scoped
>
.total_num
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
margin
:
20px
0
;
font-size
:
15px
;
}
.total_num
span
{
margin
:
0
8px
;
}
</
style
>
src/views/ecw/deptTarget/total_num.vue
0 → 100644
View file @
18983f23
<
script
>
export
default
{
name
:
"
total_num
"
,
props
:{
totalData
:{
type
:
Object
,
default
:()
=>
({})
}
}
}
</
script
>
<
template
>
<div>
<div
class=
"total_num"
>
<span>
{{
$t
(
'
新客户:
'
)
}}
</span>
<span>
{{
$t
(
'
总箱数
'
)
}}
{{
totalData
.
newTotalNum
}}{{
$t
(
'
箱
'
)
}}
</span>
<span>
{{
$t
(
'
总方数
'
)
}}
{{
totalData
.
newTotalVolume
}}
m³
</span>
<span>
{{
$t
(
'
总重量
'
)
}}
{{
totalData
.
newTotalWeight
}}
KG
</span>
<span>
{{
$t
(
'
旧客户:
'
)
}}
</span>
<span>
{{
$t
(
'
总箱数
'
)
}}
{{
totalData
.
oldTotalNum
}}{{
$t
(
'
箱
'
)
}}
</span>
<span>
{{
$t
(
'
总方数
'
)
}}
{{
totalData
.
oldTotalVolume
}}
m³
</span>
<span>
{{
$t
(
'
总重量
'
)
}}
{{
totalData
.
oldTotalWeight
}}
KG
</span>
</div>
<div
class=
"total_num"
>
<span>
{{
$t
(
'
开发客户:
'
)
}}
</span>
<span>
{{
$t
(
'
总箱数
'
)
}}
{{
totalData
.
developNum
}}{{
$t
(
'
箱
'
)
}}
</span>
<span>
{{
$t
(
'
总方数
'
)
}}
{{
totalData
.
developVolume
}}
m³
</span>
<span>
{{
$t
(
'
总重量
'
)
}}
{{
totalData
.
developWeight
}}
KG
</span>
<span>
{{
$t
(
'
公司客户:
'
)
}}
</span>
<span>
{{
$t
(
'
总箱数
'
)
}}
{{
totalData
.
companyNum
}}{{
$t
(
'
箱
'
)
}}
</span>
<span>
{{
$t
(
'
总方数
'
)
}}
{{
totalData
.
companyVolume
}}
m³
</span>
<span>
{{
$t
(
'
总重量
'
)
}}
{{
totalData
.
companyWeight
}}
KG
</span>
<span>
{{
$t
(
'
汇总:
'
)
}}
</span>
<span>
{{
$t
(
'
总箱数
'
)
}}
{{
totalData
.
sumNum
}}{{
$t
(
'
箱
'
)
}}
</span>
<span>
{{
$t
(
'
总方数
'
)
}}
{{
totalData
.
sumVolume
}}
m³
</span>
<span>
{{
$t
(
'
总重量
'
)
}}
{{
totalData
.
sumWeight
}}
KG
</span>
</div>
</div>
</
template
>
<
style
scoped
lang=
"scss"
>
.total_num
{
display
:flex
;
align-items
:
center
;
justify-content
:
left
;
margin
:
20px
0
;
font-size
:
15px
;
}
.total_num
span
{
margin
:
0
8px
;
}
</
style
>
src/views/ecw/offer/all-routes-list.vue
0 → 100644
View file @
18983f23
<
template
>
<div
class=
"app-container"
>
<!-- 搜索工作栏 -->
<el-form
:model=
"queryParams"
ref=
"queryForm"
size=
"small"
:inline=
"true"
label-width=
"68px"
>
<el-form-item
:label=
"$t('运输方式')"
prop=
"transportType"
>
<dict-selector
:type=
"DICT_TYPE.ECW_TRANSPORT_TYPE"
v-model=
"queryParams.transportType"
formatter=
"number"
clearable
/>
</el-form-item>
<el-form-item>
<el-form-item
:label=
"$t('始发仓')"
prop=
"startWarehouseId"
>
<el-select
multiple
v-model=
"queryParams.startWarehouseIdList"
:placeholder=
"$t('请选择始发仓')"
clearable
>
<el-option
v-for=
"item in exportWarehouseList"
:label=
"$l(item, 'title')"
:value=
"item.id"
:key=
"item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
:label=
"$t('目的仓')"
prop=
"destWarehouseIdArr"
>
<el-select
multiple
v-model=
"queryParams.destWarehouseIdList"
multiple
:placeholder=
"$t('请选择目的仓')"
clearable
>
<el-option
v-for=
"item in importWarehouseList"
:label=
"$l(item, 'title')"
:value=
"item.id"
:key=
"item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
:label=
"$t('出货渠道')"
prop=
"shippingChannel"
>
<el-select
v-model=
"queryParams.shippingChannel"
:placeholder=
"$t('请选择出货渠道')"
clearable
>
<el-option
v-for=
"item in channelList"
:label=
"item.nameZh"
:value=
"item.channelId"
:key=
"item.channelId"
></el-option>
</el-select>
</el-form-item>
<el-button
type=
"primary"
icon=
"el-icon-search"
@
click=
"handleQuery"
>
{{
$t
(
'
搜索
'
)
}}
</el-button>
</el-form-item>
</el-form>
<!-- 列表 -->
<el-table
v-loading=
"loading"
:data=
"list"
>
<el-table-column
:label=
"$t('序号')"
align=
"center"
type=
"index"
/>
<el-table-column
:label=
"$t('始发仓')"
align=
"center"
>
<template
slot-scope=
"
{row}">
{{
$l
(
row
,
'
startWarehouseTitle
'
)
}}
</
template
>
</el-table-column>
<el-table-column
:label=
"$t('目的仓')"
align=
"center"
>
<
template
slot-scope=
"{row}"
>
{{
$l
(
row
,
'
destWarehouseTitle
'
)
}}
</
template
>
</el-table-column>
<el-table-column
:label=
"$t('运输方式')"
align=
"center"
>
<
template
slot-scope=
"{row}"
>
<dict-tag
:type=
"DICT_TYPE.ECW_TRANSPORT_TYPE"
:value=
"row.transportType"
></dict-tag>
</
template
>
</el-table-column>
<el-table-column
:label=
"$t('出货渠道')"
align=
"center"
>
<
template
slot-scope=
"{row}"
>
{{
row
.
channelIds
?
$l
(
row
,
'
channelNames
'
)
:
'
/
'
}}
</
template
>
</el-table-column>
<el-table-column
:label=
"$t('操作')"
align=
"center"
>
<
template
slot-scope=
"{row}"
>
<el-button
v-if=
"row.transportType === 3"
type=
"text"
@
click=
"$router.push(
{
path:'/offer/channel-route?id='+ row.id,
query:{
startWarehouseTitle:$l(row,'startWarehouseTitle'),
destWarehouseTitle: $l(row, 'destWarehouseTitle'),
}
})">空运渠道包装清关费
</el-button>
</
template
>
</el-table-column>
</el-table>
<!-- 分页组件 -->
<pagination
v-show=
"total > 0"
:total=
"total"
:page.sync=
"queryParams.page"
:limit.sync=
"queryParams.rows"
@
pagination=
"getList"
/>
</div>
</template>
<
script
>
import
{
createDeptTarget
,
updateDeptTarget
,
deleteDeptTarget
,
getDeptTarget
,
getDeptTargetPage
,
exportDeptTargetExcel
,
getCreateInitData
,
getPersonTargetPage
,
myAchievementByPage
}
from
"
@/api/ecw/deptTarget
"
;
import
{
listSimpleDepts
}
from
"
@/api/system/dept
"
;
import
{
getChannelList
}
from
'
@/api/ecw/channel
'
;
import
dayjs
from
"
dayjs
"
;
import
{
listServiceUser
}
from
"
@/api/system/user
"
;
import
{
getWarehouseList
}
from
'
@/api/ecw/warehouse
'
import
{
DICT_TYPE
}
from
"
@/utils/dict
"
;
import
{
warehouseLinePage
}
from
"
@/api/ecw/customerContacts
"
;
export
default
{
name
:
"
all-routes-list
"
,
components
:
{},
data
()
{
return
{
// 遮罩层
loading
:
true
,
// 总条数
total
:
0
,
list
:
[],
// 是否显示弹出层
open
:
false
,
tableOpen
:
false
,
channelList
:
[],
// 查询参数
queryParams
:
{
page
:
1
,
rows
:
10
,
},
// 表单校验
myAchievementData
:
{},
warehouseList
:
[]
};
},
computed
:
{
DICT_TYPE
()
{
return
DICT_TYPE
},
exportWarehouseList
()
{
/* tradeType 1 进口,2出口,3进出口 */
return
this
.
warehouseList
.
filter
(
item
=>
item
.
tradeType
==
2
||
item
.
tradeType
==
3
)
},
importWarehouseList
()
{
return
this
.
warehouseList
.
filter
(
item
=>
item
.
tradeType
==
1
||
item
.
tradeType
==
3
)
},
},
activated
()
{
this
.
getChannelList
();
this
.
getList
();
},
created
()
{
this
.
getChannelList
();
this
.
getList
();
listServiceUser
().
then
(
r
=>
{
this
.
customerServiceList
=
r
.
data
;
})
getWarehouseList
().
then
(
res
=>
{
this
.
warehouseList
=
res
.
data
})
},
methods
:
{
getChannelList
()
{
getChannelList
().
then
(
res
=>
this
.
channelList
=
res
.
data
)
},
customerServiceFn
(
val
)
{
if
(
this
.
customerServiceList
.
length
>
0
)
{
let
index
=
this
.
customerServiceList
.
findIndex
(
item
=>
item
.
id
===
val
.
userId
);
return
index
!==
-
1
?
this
.
customerServiceList
[
index
]?.
nickname
:
''
}
else
{
return
''
}
},
/** 查询列表 */
getList
()
{
this
.
loading
=
true
;
const
params
=
{...
this
.
queryParams
}
// 执行查询
warehouseLinePage
(
params
).
then
(
r
=>
{
this
.
loading
=
false
;
this
.
list
=
r
.
data
.
list
;
this
.
total
=
r
.
data
.
total
})
},
/** 搜索按钮操作 */
handleQuery
()
{
this
.
queryParams
.
page
=
1
;
this
.
getList
();
},
}
};
</
script
>
<
style
scoped
>
.total_num
{
display
:
flex
;
align-items
:
center
;
justify-content
:
center
;
margin
:
20px
0
;
font-size
:
15px
;
}
.total_num
span
{
margin
:
0
8px
;
}
</
style
>
src/views/ecw/offer/channel-route.vue
0 → 100644
View file @
18983f23
<
script
>
import
{
DICT_TYPE
,
getDictDatas
}
from
"
@/utils/dict
"
;
import
PackagingType
from
"
@/views/ecw/channel/componrnts/packaging-type.vue
"
;
import
{
getChannelList
}
from
"
@/api/ecw/channel
"
;
import
AirFreightRouteTemplate
from
"
@/views/ecw/offer/components/airFreightRouteTemplate.vue
"
;
import
{
createWarehouseLineChannelPackaging
,
getAirLineChannelPackagingList
}
from
"
@/api/ecw/customerContacts
"
;
export
default
{
name
:
"
channel-route
"
,
components
:
{
AirFreightRouteTemplate
,
PackagingType
},
mounted
()
{
getChannelList
({
lineId
:
this
.
lineId
}).
then
((
res
)
=>
(
this
.
channelList
=
res
.
data
));
this
.
getRouteDetails
(
this
.
lineId
,
(
value
)
=>
{
this
.
form
.
channelList
=
this
.
setChannelData
(
value
)
})
},
data
()
{
return
{
form
:
{
"
lineId
"
:
0
,
channelList
:
[{
"
channelIds
"
:
""
,
"
packagingCreateReqVOList
"
:
[
{
"
airWeightLimit
"
:
0
,
"
packagingTypes
"
:
""
,
"
priceStepClearanceCreateReqVOList
"
:
[]
}
]
}],
},
channelList
:
[],
dialogVisible
:
false
,
}
},
computed
:
{
DICT_TYPE
()
{
return
DICT_TYPE
},
deletePackagingTypes
()
{
let
a
=
[]
this
.
form
.
channelList
.
forEach
(
item
=>
{
item
.
packagingCreateReqVOList
.
forEach
(
i
=>
{
a
.
push
(...
i
.
packagingTypes
)
})
})
return
a
},
channelIdBlackList
()
{
let
arr
=
[]
this
.
form
.
channelList
.
forEach
(
i
=>
{
arr
.
push
(...
i
.
channelIds
)
})
return
arr
},
// 线路id
lineId
()
{
return
Number
(
this
.
$route
.
query
.
id
);
}
},
methods
:
{
deleteFn
(
index
)
{
this
.
form
.
channelPackagingList
.
splice
(
index
,
1
)
},
getDictDatas
,
//添加包装类型
addPackaging
(
index
)
{
let
p
=
{
airWeightLimit
:
''
,
packagingTypes
:
[],
priceStepClearanceCreateReqVOList
:
[],
}
let
arr
=
this
.
form
.
channelList
[
index
].
packagingCreateReqVOList
arr
.
push
(
p
)
this
.
$set
(
this
.
form
.
channelList
[
index
],
'
packagingCreateReqVOList
'
,
arr
);
},
newChannelsAdd
(
index
)
{
this
.
form
.
channelList
.
splice
(
index
+
1
,
0
,
{
"
channelIds
"
:
""
,
"
packagingCreateReqVOList
"
:
[
{
"
airWeightLimit
"
:
0
,
"
packagingTypes
"
:
""
,
"
priceStepClearanceCreateReqVOList
"
:
[]
}
]
},)
},
channelsDelete
(
index
)
{
this
.
form
.
channelList
.
splice
(
index
,
1
)
},
deletePackag
(
index
,
indexx
)
{
let
arr
=
this
.
form
.
channelList
;
arr
[
index
].
packagingCreateReqVOList
.
splice
(
indexx
,
1
);
this
.
form
.
channelList
=
arr
;
},
getRouteDetails
(
id
,
callback
=
()
=>
{
})
{
getAirLineChannelPackagingList
(
id
).
then
((
r
)
=>
{
callback
(
r
.
data
)
})
},
setChannelData
(
list
=
[])
{
let
arr
=
[]
list
.
forEach
((
i
,
index
)
=>
{
if
(
index
===
0
)
{
arr
.
push
({
channelIds
:
i
.
channelIds
,
packagingCreateReqVOList
:
[
i
]})
}
else
{
if
(
i
.
channelIds
===
list
[
index
-
1
].
channelIds
)
{
arr
[
arr
.
length
-
1
].
packagingCreateReqVOList
.
push
(
i
)
}
else
{
arr
.
push
({
channelIds
:
i
.
channelIds
,
packagingCreateReqVOList
:
[
i
]})
}
}
})
arr
.
forEach
(
i
=>
{
i
.
channelIds
=
i
.
channelIds
?
i
.
channelIds
.
split
(
'
,
'
)
:
[]
i
.
packagingCreateReqVOList
.
forEach
(
item
=>
{
item
.
packagingTypes
=
item
.
packagingTypes
?
item
.
packagingTypes
.
split
(
'
,
'
)
:
[];
item
.
priceStepClearanceCreateReqVOList
=
item
.
lineChannelPriceStepClearanceBackVOList
||
[];
item
.
lineChannelPriceStepClearanceBackVOList
=
null
;
item
.
priceStepClearanceCreateReqVOList
.
forEach
(
itemm
=>
{
itemm
.
clearancePriceUnit
=
item
.
clearancePriceUnit
itemm
.
clearanceVolumeUnit
=
item
.
clearanceVolumeUnit
})
})
})
if
(
arr
.
length
===
0
)
{
return
[{
"
channelIds
"
:
""
,
"
packagingCreateReqVOList
"
:
[
{
"
airWeightLimit
"
:
0
,
"
packagingTypes
"
:
""
,
"
priceStepClearanceCreateReqVOList
"
:
[]
}
]
}]
}
return
arr
;
},
getChannelDate
(
value
)
{
let
obj
=
Object
.
assign
({},
value
)
let
arr
=
[]
obj
.
channelList
.
forEach
(
i
=>
{
i
.
packagingCreateReqVOList
.
forEach
(
item
=>
{
item
.
channelIds
=
i
.
channelIds
.
join
(
'
,
'
);
let
p
=
{
"
airWeightLimit
"
:
item
.
airWeightLimit
,
"
channelIds
"
:
item
.
channelIds
,
"
clearancePriceUnit
"
:
item
.
priceStepClearanceCreateReqVOList
[
0
].
clearancePriceUnit
,
"
clearanceVolumeUnit
"
:
item
.
priceStepClearanceCreateReqVOList
[
0
].
clearanceVolumeUnit
,
"
lineId
"
:
this
.
lineId
,
"
packagingTypes
"
:
item
.
packagingTypes
.
join
(
'
,
'
),
priceStepClearanceCreateReqVOList
:
this
.
getPriceStepClearanceCreateReqVOList
(
item
.
priceStepClearanceCreateReqVOList
)
}
arr
.
push
(
p
)
})
})
return
{
lineId
:
this
.
lineId
,
packagingCreateReqVOList
:
arr
,
}
},
getPriceStepClearanceCreateReqVOList
(
list
)
{
let
arr
=
[]
list
.
forEach
(
i
=>
{
arr
.
push
({
"
clearancePrice
"
:
i
.
clearancePrice
,
"
endNum
"
:
i
.
endNum
,
"
startNum
"
:
i
.
startNum
})
})
return
arr
},
submit
()
{
if
(
!
this
.
validation
())
return
createWarehouseLineChannelPackaging
(
this
.
getChannelDate
(
this
.
form
)).
then
(
r
=>
{
this
.
$message
.
success
(
'
保存成功
'
);
this
.
$router
.
back
()
})
},
copy
(
value
)
{
this
.
getRouteDetails
(
value
.
id
,
(
value
)
=>
{
this
.
form
.
channelList
=
this
.
setChannelData
(
value
)
this
.
$message
.
success
(
'
复制成功。
'
)
})
},
validation
()
{
let
flag
=
true
try
{
this
.
form
.
channelList
.
forEach
((
item
,
index
)
=>
{
if
(
!
item
.
channelIds
.
length
)
{
throw
`渠道
${
index
+
1
}
没有选择航道`
;
}
item
.
packagingCreateReqVOList
.
forEach
((
itemm
,
indexx
)
=>
{
if
(
!
itemm
.
packagingTypes
.
length
)
{
throw
`渠道
${
index
+
1
}
-包装类型
${
indexx
+
1
}
,没有选择包装类型。`
;
}
if
(
!
(
itemm
.
airWeightLimit
>
0
))
{
throw
`渠道
${
index
+
1
}
-包装类型
${
indexx
+
1
}
,没有输入空运订单重量上限。`
;
}
let
check
=
(
indexxx
)
=>
{
return
`渠道
${
index
+
1
}
-包装类型
${
indexx
+
1
}
- 第
${
indexxx
+
1
}
价格输入有问题。`
}
itemm
.
priceStepClearanceCreateReqVOList
.
forEach
((
itemmm
,
indexxx
)
=>
{
if
(
!
itemmm
.
clearancePrice
||
itemmm
.
clearancePrice
===
''
)
{
throw
check
(
indexxx
);
}
if
(
!
itemmm
.
clearancePriceUnit
||
itemmm
.
clearancePriceUnit
===
''
)
{
throw
check
(
indexxx
);
}
if
(
!
itemmm
.
clearanceVolumeUnit
||
itemmm
.
clearanceVolumeUnit
===
''
)
{
throw
check
(
indexxx
);
}
if
(
isNaN
(
itemmm
.
endNum
)
||
itemmm
.
endNum
===
''
)
{
throw
check
(
indexxx
);
}
if
(
isNaN
(
itemmm
.
startNum
)
||
itemmm
.
startNum
===
''
)
{
throw
check
(
indexxx
);
}
// if (!itemmm.weightUnit || itemmm.weightUnit === '') {
// throw check(indexxx);
// }
})
})
})
}
catch
(
e
)
{
flag
=
false
console
.
log
(
e
.
Error
,
'
eee
'
)
this
.
$message
.
warning
(
e
);
}
return
flag
}
}
}
</
script
>
<
template
>
<div
style=
"padding: 20px"
>
<div
style=
"margin-bottom: 15px"
>
<span>
路线:
{{
$route
.
query
.
startWarehouseTitle
}}
到
{{
$route
.
query
.
destWarehouseTitle
}}
</span>
<span
style=
"margin-left: 30px;"
>
运输方式:空运专线
</span>
</div>
<el-card
style=
"margin-bottom: 10px"
v-for=
"(itemOuter,index) in form.channelList"
:key=
"index"
>
<template
#header
>
<el-row
:gutter=
"20"
type=
"flex"
align=
"middle"
>
<el-col
:span=
"1"
>
渠道
{{
index
+
1
}}
</el-col>
<el-col
:span=
"3"
>
<el-select
multiple
v-model=
"itemOuter.channelIds"
>
<el-option
:disabled=
"channelIdBlackList.includes(item.channelId.toString()) && (!itemOuter.channelIds.includes(item.channelId.toString()))"
v-for=
"item in channelList"
:value=
"item.channelId.toString()"
:key=
"item.channelId"
:label=
"$l(item, 'name')"
></el-option>
</el-select>
</el-col>
<el-col
:span=
"3"
>
<el-button
size=
"mini"
type=
"primary"
@
click=
"newChannelsAdd(index)"
>
新增渠道
</el-button>
</el-col>
<el-col
:span=
"3"
>
<el-button
size=
"mini"
type=
"danger"
:disabled=
"form.channelList.length === 1"
@
click=
"channelsDelete(index)"
>
删除当前渠道
</el-button>
</el-col>
<el-col
:span=
"3"
>
<air-freight-route-template
:lineId=
"lineId"
@
copy=
"copy"
>
<el-button
size=
"mini"
v-if=
"index === 0"
type=
"text"
>
选择渠道包装模板
</el-button>
</air-freight-route-template>
</el-col>
</el-row>
</
template
>
<div
style=
"display: flex;justify-content: space-between;"
>
<h1>
<span
style=
"color: red;font-size: 14px;font-weight: 700;"
>
*
</span>
渠道包装列表
</h1>
<div>
<el-button
type=
"primary"
@
click=
"addPackaging(index)"
>
添加包装类型
</el-button>
</div>
</div>
<el-row
:gutter=
"20"
v-for=
"(itemm, indexx) in itemOuter.packagingCreateReqVOList"
style=
"margin-bottom: 50px; border-bottom: 1px solid #cccccc"
:key=
"indexx"
>
<el-col
:span=
"2"
>
包装类型{{ indexx + 1 }}:
</el-col>
<el-col
:span=
"5"
>
<el-select
multiple
v-model=
"itemm.packagingTypes"
>
<el-option
:disabled=
"deletePackagingTypes.includes(item.value) && (!itemm.packagingTypes.includes(item.value))"
v-for=
"item in getDictDatas(DICT_TYPE.ECW_PACKAGING_TYPE)"
:value=
"item.value"
:key=
"item.value"
:label=
"$l(item, 'label')"
></el-option>
</el-select>
</el-col>
<el-col
:span=
"16"
>
<!-- v-if="itemOuter.packagingCreateReqVOList[indexx].length"-->
<packaging-type
key-arr=
"priceStepClearanceCreateReqVOList"
v-model=
"itemOuter.packagingCreateReqVOList[indexx]"
>
<el-button
@
click=
"deletePackag(index,indexx)"
:disabled=
"itemOuter.packagingCreateReqVOList.length === 1"
type=
"danger"
>
删除包装类型{{ indexx + 1 }}
</el-button>
</packaging-type>
</el-col>
</el-row>
</el-card>
<div
class=
"footer"
>
<el-button
type=
"primary"
@
click=
"submit"
>
保存
</el-button>
</div>
</div>
</template>
<
style
scoped
lang=
"scss"
>
.footer
{
position
:
fixed
;
bottom
:
20px
;
}
</
style
>
src/views/ecw/offer/components/airFreightRouteTemplate.vue
0 → 100644
View file @
18983f23
<
script
>
import
{
warehouseLinePage
}
from
"
@/api/ecw/customerContacts
"
;
import
{
getWarehouseList
}
from
"
@/api/ecw/warehouse
"
;
import
Template
from
"
@/views/cms/template/index.vue
"
;
export
default
{
name
:
"
airFreightRouteTemplate
"
,
components
:
{
Template
},
props
:{
lineId
:{
default
:
''
}
},
data
()
{
return
{
open
:
false
,
warehouseList
:
[],
list
:
[],
total
:
0
,
form
:
{},
queryParams
:
{
page
:
1
,
rows
:
10
,
transportType
:
3
,
startWarehouseIdList
:[],
destWarehouseIdList
:
[]
}
}
},
mounted
()
{
getWarehouseList
().
then
((
r
)
=>
{
this
.
warehouseList
=
r
.
data
;
});
},
methods
:
{
getList
()
{
warehouseLinePage
(
this
.
queryParams
).
then
(
r
=>
{
this
.
list
=
r
.
data
.
list
;
this
.
total
=
r
.
data
.
total
})
},
copy
(
value
)
{
this
.
$emit
(
'
copy
'
,
value
)
this
.
open
=
false
}
},
computed
:
{
exportWarehouseList
()
{
return
this
.
warehouseList
.
filter
(
(
item
)
=>
item
.
tradeType
==
"
2
"
||
item
.
type
==
"
3
"
);
},
importWarehouseList
()
{
return
this
.
warehouseList
.
filter
(
(
item
)
=>
item
.
tradeType
==
"
1
"
||
item
.
type
==
"
3
"
);
},
},
watch
:
{
open
(
value
)
{
if
(
value
)
{
this
.
getList
();
}
}
}
}
</
script
>
<
template
>
<div>
<div
@
click=
"open = true;"
style=
"display: inline-block"
>
<slot></slot>
</div>
<el-dialog
:visible.sync=
"open"
>
<el-card>
<template
#header
>
<el-form
inline
>
<el-form-item
label=
"始发地"
>
<el-select
v-model=
"queryParams.startWarehouseIdList"
@
change=
"queryParams.page = 1;getList()"
multiple
:placeholder=
"$t('请选择始发地')"
>
<el-option
v-for=
"item in exportWarehouseList"
:label=
"$l(item, 'title')"
:value=
"item.id"
:key=
"item.id"
></el-option>
</el-select>
</el-form-item>
<el-form-item
:label=
"$t('目的地')"
prop=
"destWarehouseId"
>
<el-select
@
change=
"queryParams.page = 1;getList()"
v-model=
"queryParams.destWarehouseIdList"
multiple
:placeholder=
"$t('请选择目的地')"
>
<el-option
v-for=
"item in importWarehouseList"
:label=
"$l(item, 'title')"
:value=
"item.id"
:key=
"item.id"
></el-option>
</el-select>
</el-form-item>
</el-form>
</
template
>
<el-table
border
:data=
"list"
>
<el-table-column
label=
"始发仓"
>
<
template
slot-scope=
"{row}"
>
{{
$l
(
row
,
'
startWarehouseTitle
'
)
}}
</
template
>
</el-table-column>
<el-table-column
label=
"目的仓"
>
<
template
slot-scope=
"{row}"
>
{{
$l
(
row
,
'
destWarehouseTitle
'
)
}}
</
template
>
</el-table-column>
<el-table-column
label=
"渠道数"
>
<
template
slot-scope=
"{row}"
>
{{
row
.
channelIds
?
row
.
channelIds
.
split
(
'
,
'
).
length
:
0
}}
</
template
>
</el-table-column>
<el-table-column>
<
template
slot-scope=
"{row}"
>
<el-button
type=
"text"
v-if=
"lineId !== row.id"
@
click=
"copy(row)"
>
复制
</el-button>
</
template
>
</el-table-column>
</el-table>
<pagination
v-show=
"total > 0"
:total=
"total"
:page.sync=
"queryParams.page"
:limit.sync=
"queryParams.rows"
@
pagination=
"getList"
/>
</el-card>
</el-dialog>
</div>
</template>
<
style
scoped
lang=
"scss"
>
</
style
>
src/views/ecw/order/edit.vue
View file @
18983f23
...
...
@@ -939,6 +939,14 @@ export default {
'
form.channelId
'
(){
this
.
calculationPrice
()
if
(
this
.
form
.
lineId
)
this
.
getOfferData
()
// 选择渠道后需要筛选目的城市和线路
// 有点卡,改异步
this
.
$nextTick
(()
=>
{
// 更新目的城市备选
this
.
getTradeCity
()
// 更新线路备选
this
.
getOpenedRouterList
()
})
},
'
form.consigneeCountryCode
'
(){
if
(
this
.
form
.
lineId
)
this
.
getOfferData
()
...
...
@@ -1086,7 +1094,7 @@ export default {
this
.
productAttrList
=
(
await
getProductAttrList
()).
data
this
.
channelList
=
(
await
getChannelList
()).
data
this
.
tradeCityList
=
(
await
getTradeCityList
()).
data
await
this
.
getTradeCity
()
this
.
currencyList
=
(
await
getCurrencyList
()).
data
this
.
unitList
=
(
await
getUnitList
()).
data
this
.
transportList
=
this
.
getDictDatas
(
this
.
DICT_TYPE
.
ECW_TRANSPORT_TYPE
)
...
...
@@ -1110,6 +1118,13 @@ export default {
},
methods
:
{
async
getTradeCity
(){
let
query
=
{}
if
(
this
.
form
.
channelId
){
query
.
channelId
=
this
.
form
.
channelId
}
this
.
tradeCityList
=
(
await
getTradeCityList
(
query
)).
data
},
onTableMounted
(
e
){
// console.warn('onTableMounted', e)
},
...
...
@@ -1333,6 +1348,9 @@ export default {
if
(
this
.
form
.
transportId
){
params
.
transportType
=
this
.
form
.
transportId
}
if
(
this
.
form
.
channelId
){
params
.
channelId
=
this
.
form
.
channelId
}
// 始发,目的和运输方式都没有的时候不获取
if
(
!
params
.
startCityId
&&
!
params
.
destCityId
&&
!
params
.
transportType
)
return
false
getOpenedRouterList
(
params
).
then
(
res
=>
this
.
routerList
=
res
.
data
.
filter
(
item
=>
{
...
...
src/views/ecw/product/index.vue
View file @
18983f23
...
...
@@ -224,18 +224,22 @@
</div>
</div>
</el-form-item>
<packaging-type
key-arr=
"priceStepClearanceList"
v-model=
"form"
>
<el-button
@
click=
"visible = true; open = false;"
type=
"text"
>
选择空运模板
</el-button>
</packaging-type>
<p
v-if=
"lineNum"
>
<span>
复制模板线路价格:{{lineNum}}个
</span>
<span
@
click=
"toPriceManager(formCopy, true)"
style=
"color: #0a84ff;cursor: pointer;"
>
查看《#{{$l(formCopy,'title')}}#》路线价格
</span>
<el-button
style=
"font-size: 12px;margin-left: 15px;color: red;"
type=
"text"
@
click=
"form.priceStepClearanceList = [];lineNum = 0"
>
清除路线
</el-button>
</p>
<el-form-item
label-width=
"150px"
label=
"空运订单重量上限kg"
>
<el-input-number
v-model=
"form.airWeightLimit"
controls-position=
"right"
></el-input-number>
</el-form-item>
<!-- <packaging-type key-arr="priceStepClearanceList" v-model="form">-->
<!-- <el-button @click="visible = true; open = false;" type="text">选择空运模板</el-button>-->
<!-- </packaging-type>-->
<!-- <p v-if="lineNum">-->
<!-- <span>-->
<!-- 复制模板线路价格:{{lineNum}}个-->
<!-- </span>-->
<!-- <span @click="toPriceManager(formCopy, true)" style="color: #0a84ff;cursor: pointer;">-->
<!-- 查看《#{{$l(formCopy,'title')}}#》路线价格-->
<!-- </span>-->
<!-- <el-button style="font-size: 12px;margin-left: 15px;color: red;" type="text" @click="form.priceStepClearanceList = [];lineNum = 0" >清除路线</el-button>-->
<!-- </p>-->
</el-form>
<div
slot=
"footer"
class=
"dialog-footer"
>
<el-button
type=
"primary"
@
click=
"submitForm"
>
{{$t('确定')}}
</el-button>
...
...
@@ -415,59 +419,59 @@ export default {
},
methods
:
{
copyLine
(
val
,
bol
){
this
.
formCopy
=
val
;
let
copy
=
()
=>
{
if
(
val
.
priceStepClearanceList
.
length
===
0
)
return
this
.
form
.
priceStepClearanceList
=
[]
this
.
form
.
airWeightLimit
=
val
.
airWeightLimit
;
val
.
priceStepClearanceList
.
forEach
((
item
,
index
)
=>
{
if
(
this
.
form
.
priceStepClearanceList
[
index
]){
this
.
form
.
priceStepClearanceList
[
index
].
clearancePrice
=
item
.
clearancePrice
this
.
form
.
priceStepClearanceList
[
index
].
clearancePriceUnit
=
item
.
clearancePriceUnit
this
.
form
.
priceStepClearanceList
[
index
].
clearanceVolumeUnit
=
item
.
clearanceVolumeUnit
this
.
form
.
priceStepClearanceList
[
index
].
endNum
=
item
.
endNum
this
.
form
.
priceStepClearanceList
[
index
].
startNum
=
item
.
startNum
this
.
form
.
priceStepClearanceList
[
index
].
weightUnit
=
item
.
weightUnit
}
else
{
let
p
=
{
"
channelId
"
:
undefined
,
"
clearancePrice
"
:
item
.
clearancePrice
,
"
clearancePriceUnit
"
:
item
.
clearancePriceUnit
,
"
clearanceVolumeUnit
"
:
item
.
clearanceVolumeUnit
,
"
endNum
"
:
item
.
endNum
,
"
packagingId
"
:
undefined
,
"
startNum
"
:
item
.
startNum
,
"
weightUnit
"
:
item
.
weightUnit
}
this
.
form
.
priceStepClearanceList
.
push
(
p
)
}
})
}
this
.
visible
=
false
;
if
(
bol
){
let
message
=
this
.
$l
(
this
.
form
,
'
title
'
)
?
`请确认是否要将#
${
this
.
$l
(
val
,
'
title
'
)}
#的所有路线价格复制到当前商品#
${
this
.
$l
(
this
.
form
,
'
title
'
)}
#中?`
:
`请确认是否要将#
${
this
.
$l
(
val
,
'
title
'
)}
#的所有路线价格复制到当前商品中?`
this
.
$confirm
(
message
,
'
提示
'
,
{
confirmButtonText
:
'
确定
'
,
cancelButtonText
:
'
取消
'
,
type
:
'
warning
'
}).
then
(()
=>
{
// this.form.priceLineCount = val.id;
this
.
lineNum
=
val
.
priceLineCount
;
this
.
form
.
productTemplateId
=
val
.
id
;
this
.
form
.
isCopyProductPriceTemplate
=
true
;
copy
()
this
.
open
=
true
;
}).
catch
(()
=>
{
this
.
open
=
true
;
});
}
else
{
this
.
open
=
true
;
copy
()
this
.
lineNum
=
0
this
.
form
.
isCopyProductPriceTemplate
=
false
;
}
this
.
$forceUpdate
()
},
//
copyLine(val , bol){
//
this.formCopy = val;
//
let copy = ()=>{
//
if(val.priceStepClearanceList.length === 0) return this.form.priceStepClearanceList = []
//
this.form.airWeightLimit = val.airWeightLimit;
//
val.priceStepClearanceList.forEach((item ,index) =>{
//
if(this.form.priceStepClearanceList[index]){
//
this.form.priceStepClearanceList[index].clearancePrice = item.clearancePrice
//
this.form.priceStepClearanceList[index].clearancePriceUnit = item.clearancePriceUnit
//
this.form.priceStepClearanceList[index].clearanceVolumeUnit = item.clearanceVolumeUnit
//
this.form.priceStepClearanceList[index].endNum = item.endNum
//
this.form.priceStepClearanceList[index].startNum = item.startNum
//
this.form.priceStepClearanceList[index].weightUnit = item.weightUnit
//
}else {
//
let p = {
//
"channelId":undefined,
//
"clearancePrice":item.clearancePrice,
//
"clearancePriceUnit":item.clearancePriceUnit,
//
"clearanceVolumeUnit":item.clearanceVolumeUnit,
//
"endNum":item.endNum,
//
"packagingId":undefined,
//
"startNum":item.startNum,
//
"weightUnit":item.weightUnit
//
}
//
this.form.priceStepClearanceList.push(p)
//
}
//
})
//
}
//
this.visible = false;
//
if(bol){
//
let message = this.$l(this.form,'title') ? `请确认是否要将#${this.$l(val,'title')}#的所有路线价格复制到当前商品#${this.$l(this.form,'title')}#中?` : `请确认是否要将#${this.$l(val,'title')}#的所有路线价格复制到当前商品中?`
//
this.$confirm(message, '提示', {
//
confirmButtonText: '确定',
//
cancelButtonText: '取消',
//
type: 'warning'
//
}).then(() => {
//
// this.form.priceLineCount = val.id;
//
this.lineNum = val.priceLineCount;
//
this.form.productTemplateId = val.id;
//
this.form.isCopyProductPriceTemplate = true;
//
copy()
//
this.open = true;
//
}).catch(() => {
//
this.open = true;
//
});
//
}else {
//
this.open = true;
//
copy()
//
this.lineNum = 0
//
this.form.isCopyProductPriceTemplate = false;
//
}
//
this.$forceUpdate()
//
},
/** 获取产品属性列表 */
getAttrList
()
{
getProductAttrList
().
then
(
response
=>
{
...
...
@@ -556,6 +560,7 @@ export default {
priceStepClearanceList
:[],
isCopyProductPriceTemplate
:
false
,
productTemplateId
:
undefined
,
};
this
.
lineNum
=
0
this
.
resetForm
(
"
form
"
);
...
...
@@ -583,6 +588,7 @@ export default {
if
(
this
.
queryParams
.
typeId
)
{
this
.
form
.
typeId
=
this
.
queryParams
.
typeId
;
}
this
.
form
.
airWeightLimit
=
this
.
getDictDatas
(
this
.
DICT_TYPE
.
AIR_COMMODITY_CUSTOM_CLEARANCE
)[
0
]?.
value
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
...
...
@@ -607,6 +613,7 @@ export default {
this
.
form
.
couponIds
=
this
.
preferentialList
.
filter
(
i
=>
i
.
isDefault
).
map
(
i
=>
i
.
couponId
)
// this.reset()
})
});
},
verify
(
row
){
...
...
@@ -621,15 +628,15 @@ export default {
if
(
!
this
.
form
.
airWeightLimit
){
return
this
.
$message
.
warning
(
'
请输入空运订单重量上限
'
)
}
if
(
this
.
form
.
priceStepClearanceList
.
length
===
0
){
return
this
.
$message
.
warning
(
'
阶梯定价输入不完整!
'
)
}
else
{
let
bol
=
this
.
form
.
priceStepClearanceList
.
every
(
this
.
verify
)
if
(
!
bol
){
return
this
.
$message
.
warning
(
'
阶梯定价输入不完整!
'
)
}
}
//
if(this.form.priceStepClearanceList.length === 0){
//
return this.$message.warning('阶梯定价输入不完整!')
//
}else {
//
let bol = this.form.priceStepClearanceList.every(this.verify)
//
if(!bol){
//
return this.$message.warning('阶梯定价输入不完整!')
//
}
//
//
}
//商品特性转字符串
this
.
form
.
attrId
=
this
.
form
.
attrArray
.
join
(
'
,
'
);
// 修改的提交
...
...
src/views/ecw/productPrice/batchEdit.vue
View file @
18983f23
...
...
@@ -411,7 +411,10 @@ export default {
minWeightUnit
,
needOrderInquiry
,
needBook
,
needPay
needPay
,
freightPriceStepList
,
clearancePriceStepList
,
fullPriceStepList
}
=
res
.
data
const
data
=
{
...
...
@@ -432,7 +435,10 @@ export default {
minWeightUnit
,
needOrderInquiry
,
needBook
,
needPay
needPay
,
freightPriceStepList
,
clearancePriceStepList
,
fullPriceStepList
}
// 海运需要填充货柜位置和订单方数上限
if
(
this
.
type
==
'
sea
'
){
...
...
src/views/ecw/productPrice/batchEditAir.vue
View file @
18983f23
...
...
@@ -216,15 +216,6 @@ export default {
// 获取模板数据(复制的源路线价格信息)
async
getTemplateDetail
(
id
){
const
res
=
await
getProductPrice
(
id
)
// 填充商品、线路、价格信息、出货渠道(空运)
// this.form.productIdList = [res.data.productId]
/* 23-11-07要求不复制商品和线路 https://zentao.test.jdshangmen.com/bug-view-5145.html
this.selectedRoutes = [{
"lineId": res.data.warehouseLineId,
"channelId": res.data.shippingChannelId,
"transportId": res.data.warehouseLineDO.transportType,
"shippingChannelId":res.data.channelId
}]*/
// 要复制过来的字段
const
{
allPrice
,
...
...
@@ -244,7 +235,10 @@ export default {
minWeightUnit
,
needOrderInquiry
,
needBook
,
needPay
needPay
,
freightPriceStepList
,
clearancePriceStepList
,
fullPriceStepList
}
=
res
.
data
const
data
=
{
...
...
@@ -265,7 +259,10 @@ export default {
minWeightUnit
,
needOrderInquiry
,
needBook
,
needPay
needPay
,
freightPriceStepList
,
clearancePriceStepList
,
fullPriceStepList
}
this
.
$set
(
this
,
'
form
'
,
Object
.
assign
({},
this
.
form
,
data
))
...
...
src/views/ecw/productPrice/batchIncrease.vue
View file @
18983f23
...
...
@@ -13,59 +13,85 @@
</div>
<div
:gutter=
"20"
>
<el-form-item
:label=
"$t('单价模式')"
prop=
"priceType"
>
<dict-selector
:type=
"DICT_TYPE.ECW_PRICE_TYPE"
v-model=
"form.priceType"
form-type=
"radio"
/>
<dict-selector
:type=
"DICT_TYPE.ECW_PRICE_TYPE"
v-model=
"form.priceType"
form-type=
"radio"
formatter=
"number"
/>
<!--海运才需要是否含阶梯价的选项,空运只有阶梯价就不需要了-->
<div
v-if=
"type == 'sea'"
>
<el-checkbox
v-model=
"form.stepPrice"
:true-label=
"1"
:false-label=
"0"
>
{{
$t
(
'
是否含阶梯价
'
)
}}
</el-checkbox>
</div>
</el-form-item>
<el-form-item
:label=
"$t('默认全包价')"
v-if=
"form.priceType == 1"
>
<inputor
default2=
"0"
v-model.number=
"form.allPrice"
type=
"number"
:placeholder=
"$t('整数或者两位小数')"
class=
"w100 mr10"
/>
<selector
v-model=
"form.allPriceUnit"
@
input=
"syncAllUnit"
:options=
"currencyList"
:label-field=
"$l('title')"
value-field=
"id"
defaultable2
class=
"w100"
/>
/
<selector
v-model=
"form.allVolumeUnit"
@
input=
"syncAllUnit"
:options=
"unitList"
:label-field=
"$l('title')"
value-field=
"id"
defaultable2
class=
"w100"
/>
</el-form-item>
<template
v-else
>
<el-form-item
:label=
"$t('默认运费')"
prop=
"transportPrice"
>
<selector
v-model=
"form.transportPriceUnit"
@
input=
"syncAllUnit"
:options=
"currencyList"
:label-field=
"$l('title')"
value-field=
"id"
defaultable2
class=
"w-100"
/>
<inputor
default2=
"0"
v-model.number=
"form.transportPrice"
type=
"number"
:placeholder=
"$t('整数或者两位小数')"
class=
"w-100 ml-10 mr-10"
/>
/
<selector
v-model=
"form.transportVolumeUnit"
@
input=
"syncAllUnit"
:options=
"unitList"
:label-field=
"$l('title')"
value-field=
"id"
defaultable2
class=
"w-100"
/>
</el-form-item>
<el-form-item
:label=
"$t('默认清关费')"
prop=
"clearancePrice"
v-if=
"type != 'air'"
>
<selector
v-model=
"form.clearancePriceUnit"
@
input=
"syncAllUnit"
:options=
"currencyList"
:label-field=
"$l('title')"
value-field=
"id"
defaultable2
class=
"w-100"
/>
<inputor
default2=
"0"
v-model.number=
"form.clearancePrice"
type=
"number"
:placeholder=
"$t('整数或者两位小数')"
class=
"w-100 ml-10 mr-10"
/>
/
<selector
v-model=
"form.clearanceVolumeUnit"
@
input=
"syncAllUnit"
:options=
"unitList"
:label-field=
"$l('title')"
value-field=
"id"
defaultable2
class=
"w-100"
/>
</el-form-item>
</
template
>
<!--特需-->
<
template
v-if=
"form.priceType==1"
>
<el-form-item
v-for=
"(special, specialIndex) in form.specialList"
:label=
"getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('全包价')"
:key=
"specialIndex + 'transport'"
>
<selector
disabled
v-model=
"special.allPriceUnit"
:options=
"currencyList"
:label-field=
"$l('title')"
value-field=
"id"
defaultable2
class=
"w-100"
/>
<inputor
default2=
"0"
v-model.number=
"special.allPrice"
type=
"number"
:placeholder=
"$t('整数或者两位小数')"
class=
"w-100 ml-10 mr-10"
/>
/
<selector
disabled
v-model=
"special.allVolumeUnit"
:options=
"unitList"
:label-field=
"$l('title')"
value-field=
"id"
defaultable2
class=
"w-100"
/>
</el-form-item>
</
template
>
<
template
v-else
v-for=
"(special, specialIndex) in form.specialList"
>
<el-form-item
:label=
"getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('运费')"
:key=
"specialIndex + 'transport'"
>
<selector
disabled
v-model=
"special.transportPriceUnit"
:options=
"currencyList"
:label-field=
"$l('title')"
value-field=
"id"
defaultable2
class=
"w-100"
/>
<inputor
default2=
"0"
v-model.number=
"special.transportPrice"
type=
"number"
:placeholder=
"$t('整数或者两位小数')"
class=
"w-100 ml-10 mr-10"
/>
/
<selector
disabled
v-model=
"special.transportVolumeUnit"
:options=
"unitList"
:label-field=
"$l('title')"
value-field=
"id"
defaultable2
class=
"w-100"
/>
</el-form-item>
<el-form-item
v-if=
"type != 'air'"
:label=
"getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('清关费')"
:key=
"specialIndex + 'clearance'"
>
<selector
disabled
v-model=
"special.clearancePriceUnit"
:options=
"currencyList"
:label-field=
"$l('title')"
value-field=
"id"
defaultable2
class=
"w-100"
/>
<inputor
default2=
"0"
v-model.number=
"special.clearancePrice"
type=
"number"
:placeholder=
"$t('整数或者两位小数')"
class=
"w-100 ml-10 mr-10"
/>
/
<selector
disabled
v-model=
"special.clearanceVolumeUnit"
:options=
"unitList"
:label-field=
"$l('title')"
value-field=
"id"
defaultable2
class=
"w-100"
/>
</el-form-item>
<!--如果是阶梯价-->
<template
v-if=
"form.stepPrice"
>
<!--全包价-->
<template
v-if=
"form.priceType==1"
>
<div
v-for=
"(item, index) in form.fullPriceStepList"
:key=
"index"
>
<price-step
ref=
"stepPrice"
:index=
"index"
:currency-list=
"currencyList"
:unit-list=
"unitList"
field-prefix=
"all"
:price-name=
"$t('全包价')"
:show-add=
"index === form.fullPriceStepList.length -1"
:value=
"item"
:step-tips=
"!isStepPriceValid(item) ? $t('区间设置不完整,将被忽略') : null"
@
add=
"handleAddPrice('fullPriceStepList', $event)"
@
delete=
"handleDeletePrice('fullPriceStepList', $event)"
@
changeUnit=
"handleUnitChange(form.fullPriceStepList, index, ...$event)"
></price-step>
</div>
</
template
>
<el-row
v-else
:gutter=
"20"
class=
"mt-20"
>
<el-col
:span=
"12"
>
<div
v-for=
"(item, index) in form.freightPriceStepList"
:key=
"index"
>
<price-step
ref=
"stepPrice"
:index=
"index"
:currency-list=
"currencyList"
:unit-list=
"unitList"
field-prefix=
"transport"
:price-name=
"$t('运费')"
:show-add=
"index === form.freightPriceStepList.length -1"
:value=
"item"
:step-tips=
"!isStepPriceValid(item) ? $t('区间设置不完整,将被忽略') : null"
@
add=
"handleAddPrice('freightPriceStepList', $event)"
@
delete=
"handleDeletePrice('freightPriceStepList', $event)"
@
changeUnit=
"handleUnitChange(form.freightPriceStepList, index, ...$event)"
></price-step>
</div>
</el-col>
<el-col
:span=
"12"
>
<div
v-for=
"(item, index) in form.clearancePriceStepList"
:key=
"index"
>
<price-step
ref=
"stepPrice"
:index=
"index"
:currency-list=
"currencyList"
:unit-list=
"unitList"
field-prefix=
"clearance"
:price-name=
"$t('清关费')"
:show-add=
"index === form.clearancePriceStepList.length -1"
:value=
"item"
:step-tips=
"!isStepPriceValid(item) ? $t('区间设置不完整,将被忽略') : null"
@
add=
"handleAddPrice('clearancePriceStepList', $event)"
@
delete=
"handleDeletePrice('clearancePriceStepList', $event)"
@
changeUnit=
"handleUnitChange(form.clearancePriceStepList, index, ...$event)"
></price-step>
</div>
</el-col>
</el-row>
</template>
<
template
v-else
>
<sea-price
ref=
"seaPrice"
:price-type=
"form.priceType"
:currency-list=
"currencyList"
:unit-list=
"unitList"
:value=
"form"
@
changeUnit=
"handleFormUnitChange($event)"
></sea-price>
</
template
>
</div>
</el-card>
</el-form>
...
...
@@ -85,9 +111,16 @@ import ProductsSelector from '@/components/ProductsSelector'
import
Selector
from
'
@/components/Selector
'
import
Inputor
from
'
@/components/Inputor
'
import
Decimal
from
'
decimal.js
'
import
SeaPrice
from
"
@/views/ecw/productPrice/components/SeaPrice.vue
"
;
import
Template
from
"
@/views/cms/template/index.vue
"
;
import
PriceStep
from
"
@/views/ecw/productPrice/components/PriceStep.vue
"
;
const
DEFAULT_PRICE_UNIT
=
1
const
DEFAULT_VOLUME_UNIT
=
7
const
DEFAULT_WEIGHT_UNIT
=
7
export
default
{
components
:
{
RoutersSelector
,
ProductsSelector
,
Selector
,
Inputor
},
components
:
{
PriceStep
,
Template
,
SeaPrice
,
RoutersSelector
,
ProductsSelector
,
Selector
,
Inputor
},
data
()
{
return
{
checkList
:
[],
...
...
@@ -117,22 +150,12 @@ export default {
type
(){
return
this
.
$route
.
path
.
split
(
/
[
-_
]
/
).
pop
()
},
// 默认运费的货币和体积单位
currencyAndUnit
(){
let
currency
=
null
,
unit
=
null
,
fields
=
null
// 如果是阶梯价格则取第一阶梯,否则就取form中的字段
let
obj
=
this
.
form
.
stepPrice
==
1
?
this
.
form
.
priceStepList
[
0
]
:
this
.
form
// 全包价
if
(
this
.
form
.
priceType
==
1
){
currency
=
obj
.
allPriceUnit
unit
=
obj
.
allVolumeUnit
}
else
{
currency
=
obj
.
transportPriceUnit
unit
=
obj
.
transportVolumeUnit
// 判断阶梯价是否有效
isStepPriceValid
(){
return
stepPrice
=>
{
return
stepPrice
.
startNum
&&
stepPrice
.
endNum
}
return
{
currency
,
unit
}
}
},
},
watch
:
{
checkList
()
{
//选择路线
...
...
@@ -147,25 +170,21 @@ export default {
product
()
{
this
.
$set
(
this
.
form
,
'
productType
'
,
this
.
product
.
typeId
)
},
selectedRoutes
(
routers
)
{
let
transportIds
=
[]
routers
.
forEach
(
item
=>
{
item
.
shippingChannelId
=
item
.
channelId
transportIds
.
push
(
+
item
.
transportId
)
})
// 如果只选择了空运(3),则默认体积单位改成千克
transportIds
=
new
Set
(
transportIds
)
console
.
log
(
transportIds
)
window
.
transportIds
=
transportIds
if
(
transportIds
.
size
==
1
&&
transportIds
.
has
(
3
)){
this
.
setDefaultVolumeUnit
(
6
)
}
else
this
.
setDefaultVolumeUnit
(
7
)
}
'
form.priceType
'
(
priceType
){
if
(
this
.
form
.
stepPrice
===
1
){
this
.
initStepPrice
()
}
},
'
form.stepPrice
'
(
stepPrice
){
if
(
this
.
form
.
stepPrice
===
1
){
this
.
initStepPrice
()
}
this
.
stepPrice
=
!!
stepPrice
},
},
async
created
()
{
getCurrencyList
().
then
(
res
=>
this
.
currencyList
=
res
.
data
)
getUnitList
().
then
(
res
=>
this
.
unitList
=
res
.
data
)
this
.
currencyList
=
(
await
getCurrencyList
())?.
data
||
[]
this
.
unitList
=
(
await
getUnitList
())?.
data
||
[]
this
.
$nextTick
(
async
()
=>
{
this
.
setDefaultVolumeUnit
(
this
.
type
==
'
air
'
?
6
:
7
)
...
...
@@ -187,76 +206,91 @@ export default {
})
},
methods
:
{
// 同步全部单位
syncAllUnit
(){
let
obj
=
this
.
form
let
fields
=
{}
// 全包价
if
(
this
.
form
.
priceType
==
1
){
fields
=
{
allPriceUnit
:
obj
[
'
allPriceUnit
'
],
allVolumeUnit
:
obj
[
'
allVolumeUnit
'
]
}
}
else
{
fields
=
{
transportPriceUnit
:
obj
.
transportPriceUnit
,
transportVolumeUnit
:
obj
.
transportVolumeUnit
,
clearancePriceUnit
:
obj
.
clearancePriceUnit
,
clearanceVolumeUnit
:
obj
.
clearanceVolumeUnit
,
}
handleAddPrice
(
field
,
fieldPrefix
){
if
(
!
this
.
form
[
field
]){
this
.
$set
(
this
.
form
,
field
,
[])
}
// 全包价还需要同步阶梯的重量单位
if
(
this
.
form
.
stepPrice
==
1
){
fields
[
'
weightUnit
'
]
=
obj
.
weightUnit
let
priceUnit
=
DEFAULT_PRICE_UNIT
let
volumeUnit
=
DEFAULT_VOLUME_UNIT
let
weightUnit
=
DEFAULT_WEIGHT_UNIT
if
(
this
.
form
[
field
].
length
){
const
first
=
this
.
form
[
field
][
0
]
priceUnit
=
first
[
`
${
fieldPrefix
}
PriceUnit`
]
volumeUnit
=
first
[
`
${
fieldPrefix
}
VolumeUnit`
]
weightUnit
=
first
.
weightUnit
}
this
.
syncSpecialUnit
(
fields
)
},
// 同步特需的货币单位和体积单位
syncSpecialUnit
(
obj
){
console
.
log
(
'
syncSpecialUnit
'
,
obj
)
if
(
!
obj
)
return
// 同步特需单位
this
.
form
.
specialList
.
forEach
(
item
=>
{
Object
.
assign
(
item
,
obj
)
console
.
log
(
"
添加价格的默认单位
"
,
{
priceUnit
,
volumeUnit
,
weightUnit
})
this
.
form
[
field
].
push
({
[
`
${
fieldPrefix
}
PriceUnit`
]:
priceUnit
,
[
`
${
fieldPrefix
}
VolumeUnit`
]:
volumeUnit
,
weightUnit
:
weightUnit
,
specialList
:[]
})
},
handleDeletePrice
(
field
,
index
){
this
.
form
[
field
].
splice
(
index
,
1
)
},
handleUnitChange
(
stepPriceList
,
index
,
data
){
console
.
log
(
'
handleUnitChange
'
,
...
arguments
)
if
(
index
>
0
)
return
// 如果是阶梯价则需要同步其他阶梯
if
(
this
.
form
.
stepPrice
==
1
){
this
.
form
.
priceStepList
.
forEach
((
item
,
index
)
=>
{
this
.
$set
(
this
.
form
.
priceStepList
,
index
,
Object
.
assign
(
item
,
obj
))
})
// 如果是重量单位,且不是清关费想换的,则需要同步最小起计量单位
if
(
data
.
field
===
'
weightUnit
'
&&
data
.
type
!=
'
clearance
'
){
this
.
form
.
minWeightUnit
=
data
.
value
}
stepPriceList
.
forEach
(
item
=>
{
item
[
data
.
field
]
=
data
.
value
if
(
item
.
packagingList
?.
length
){
item
.
packagingList
.
forEach
(
p
=>
{
p
[
data
.
field
]
=
data
.
value
})
}
if
(
item
.
specialList
?.
length
){
item
.
specialList
.
forEach
(
p
=>
{
p
[
data
.
field
]
=
data
.
value
})
}
})
},
// 不是阶梯价需要 同步最小起计量
if
(
obj
[
'
transportVolumeUnit
'
]
||
obj
[
'
allVolumeUnit
'
]){
this
.
$set
(
this
.
form
,
'
minWeightUnit
'
,
obj
[
'
transportVolumeUnit
'
]
||
obj
[
'
allVolumeUnit
'
])
}
// 获得用语提交的阶梯价副本
getPriceList
(
stepList
){
if
(
!
stepList
?.
length
)
return
[]
let
stepPriceList
=
JSON
.
parse
(
JSON
.
stringify
(
stepList
))
stepPriceList
.
forEach
((
item
,
index
)
=>
{
item
.
rankNum
=
index
+
1
item
.
packagingList
=
item
.
packagingList
.
filter
(
p
=>
!!
p
.
packagingTypes
?.
length
)
item
.
packagingList
=
item
.
packagingList
.
map
(
p
=>
{
p
.
packagingTypes
=
p
.
packagingTypes
.
join
(
"
,
"
)
return
p
})
})
// 过滤掉空的阶梯
return
stepPriceList
.
filter
(
this
.
isStepPriceValid
)
},
//
价格校验器
priceValidator
(
rule
,
value
,
callback
){
if
(
!
value
||
value
==
''
)
return
callback
()
value
=
parseFloat
(
value
)
if
(
!
value
||
value
<
0
){
return
callback
(
new
Error
(
'
价格错误
'
)
)
//
非阶梯价格更新单位
handleFormUnitChange
(
data
){
if
(
this
.
form
.
specialList
?.
length
){
this
.
form
.
specialList
.
forEach
(
p
=>
{
p
[
data
.
field
]
=
data
.
value
}
)
}
callback
()
},
setDefaultVolumeUnit
(
unit
){
this
.
$set
(
this
.
form
,
'
transportVolumeUnit
'
,
unit
)
this
.
$set
(
this
.
form
,
'
clearanceVolumeUnit
'
,
unit
)
this
.
$set
(
this
.
form
,
'
allVolumeUnit
'
,
unit
)
this
.
$set
(
this
.
form
,
'
minWeightUnit
'
,
unit
)
console
.
log
(
this
.
form
.
priceStepList
,
this
.
form
.
stepPrice
)
// 阶梯价
if
(
this
.
form
.
stepPrice
==
1
&&
this
.
form
.
priceStepList
?.
length
){
this
.
form
.
priceStepList
.
forEach
(
item
=>
{
this
.
$set
(
item
,
'
transportVolumeUnit
'
,
unit
)
this
.
$set
(
item
,
'
clearanceVolumeUnit
'
,
unit
)
this
.
$set
(
item
,
'
allVolumeUnit
'
,
unit
)
this
.
$set
(
item
,
'
weightUnit
'
,
unit
)
})
initStepPrice
(){
if
(
this
.
form
.
priceType
==
1
&&
!
this
.
form
.
fullPriceStepList
?.
length
){
this
.
handleAddPrice
(
"
fullPriceStepList
"
,
'
all
'
)
}
if
(
this
.
form
.
priceType
===
0
){
if
(
!
this
.
form
.
freightPriceStepList
?.
length
){
this
.
handleAddPrice
(
'
freightPriceStepList
'
,
'
transport
'
)
}
if
(
!
this
.
form
.
clearancePriceStepList
?.
length
){
this
.
handleAddPrice
(
'
clearancePriceStepList
'
,
'
clearance
'
)
}
}
},
submitForm
()
{
...
...
@@ -290,10 +324,39 @@ export default {
if
(
data
.
lineChannelList
.
length
<
1
){
return
this
.
$message
.
error
(
this
.
$t
(
'
请选择需要修改的路线
'
))
}
await
this
.
$confirm
(
this
.
$t
(
'
已选择{route}条路线,{product}个商品;确认提交修改?
'
,
{
data
.
fullPriceStepList
=
this
.
getPriceList
(
data
.
fullPriceStepList
)
data
.
freightPriceStepList
=
this
.
getPriceList
(
data
.
freightPriceStepList
)
data
.
clearancePriceStepList
=
this
.
getPriceList
(
data
.
clearancePriceStepList
)
// 检查被忽略的阶梯价
let
msgArr
=
[];
if
(
data
.
priceType
){
const
ignoreAll
=
data
.
fullPriceStepList
.
length
!=
this
.
form
.
fullPriceStepList
.
length
if
(
ignoreAll
){
msgArr
.
push
(
this
.
$t
(
"
{n}个全包阶梯价
"
,
{
n
:
ignoreAll
}))
}
}
else
{
const
ignoreFreight
=
this
.
form
.
freightPriceStepList
.
length
-
data
.
freightPriceStepList
.
length
const
ignoreClearance
=
this
.
form
.
clearancePriceStepList
.
length
-
data
.
clearancePriceStepList
.
length
if
(
ignoreFreight
){
msgArr
.
push
(
this
.
$t
(
"
{n}个运费阶梯价
"
,
{
n
:
ignoreFreight
}))
}
if
(
ignoreClearance
){
msgArr
.
push
(
this
.
$t
(
"
{n}个清关费阶梯价
"
,
{
n
:
ignoreClearance
}))
}
}
let
msg
=
this
.
$t
(
'
已选择{route}条路线,{product}个商品
'
,
{
route
:
data
.
lineChannelList
.
length
,
product
:
this
.
isAllProduct
?
this
.
$refs
.
productSelector
.
allTotal
:
data
.
productIdList
.
length
}))
})
console
.
log
(
msgArr
)
if
(
msgArr
.
length
){
msg
+=
"
;
"
+
msgArr
.
join
(
"
,
"
)
+
"
被忽略
"
}
await
this
.
$confirm
(
msg
+
this
.
$t
(
'
;确认提交修改?
'
,
))
this
.
loading
=
true
batchAddPrice
(
data
).
then
(
async
(
response
)
=>
{
await
this
.
$alert
(
this
.
$t
(
"
操作成功
"
));
...
...
src/views/ecw/productPrice/batchIncreaseAir.vue
0 → 100644
View file @
18983f23
<
template
>
<div
class=
"app-container"
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"150px"
>
<products-selector
ref=
"productSelector"
v-model=
"form.productIdList"
show-all
@
setall=
"isAllProduct=$event"
enable-filtered
@
setFiltered=
"isAllFilteredProduct=$event"
:default-ids=
"form.productIdList"
class=
"mb-20"
/>
<routers-selector
v-model=
"selectedRoutes"
:type=
"type"
/>
<el-card
style=
"margin-bottom: 10px"
>
<div
slot=
"header"
style=
"font-size:20px;"
>
{{
$t
(
'
价格设置
'
)
}}
</div>
<el-form-item
:label=
"$t('单价模式')"
prop=
"priceType"
>
<dict-selector
:type=
"DICT_TYPE.ECW_PRICE_TYPE"
v-model=
"form.priceType"
form-type=
"radio"
formatter=
"number"
/>
</el-form-item>
<!--全包价-->
<template
v-if=
"form.priceType === 1"
>
<div
v-for=
"(item, index) in form.fullPriceStepList"
:key=
"index"
class=
"mb-20"
>
<price-step
ref=
"stepPrice"
:index=
"index"
:currency-list=
"currencyList"
:unit-list=
"unitList"
field-prefix=
"all"
:price-name=
"$t('全包价')"
:show-add=
"index === form.fullPriceStepList.length -1"
:value=
"item"
:step-tips=
"!isStepPriceValid(item) ? $t('区间设置不完整,将被忽略') : null"
@
add=
"handleAddPrice('fullPriceStepList', $event)"
@
delete=
"handleDeletePrice('fullPriceStepList', $event)"
@
changeUnit=
"handleUnitChange(form.fullPriceStepList, index, ...$event)"
></price-step>
</div>
</
template
>
<el-row
v-else
:gutter=
"20"
class=
"mt-20"
>
<el-col
:span=
"12"
>
<div
v-for=
"(item, index) in form.freightPriceStepList"
:key=
"index"
class=
"mb-20"
>
<price-step
ref=
"stepPrice"
:index=
"index"
:currency-list=
"currencyList"
:unit-list=
"unitList"
field-prefix=
"transport"
:price-name=
"$t('运费')"
:show-add=
"index === form.freightPriceStepList.length -1"
:value=
"item"
:step-tips=
"!isStepPriceValid(item) ? $t('区间设置不完整,将被忽略') : null"
@
add=
"handleAddPrice('freightPriceStepList', $event)"
@
delete=
"handleDeletePrice('freightPriceStepList', $event)"
@
changeUnit=
"handleUnitChange(form.freightPriceStepList, index, ...$event)"
></price-step>
</div>
</el-col>
<el-col
:span=
"12"
>
<div
v-for=
"(item, index) in form.clearancePriceStepList"
:key=
"index"
class=
"mb-20"
>
<price-step
ref=
"stepPrice"
:index=
"index"
:currency-list=
"currencyList"
:unit-list=
"unitList"
field-prefix=
"clearance"
:price-name=
"$t('清关费')"
:show-add=
"index === form.clearancePriceStepList.length -1"
:value=
"item"
:step-tips=
"!isStepPriceValid(item) ? $t('区间设置不完整,将被忽略') : null"
@
add=
"handleAddPrice('clearancePriceStepList', $event)"
@
delete=
"handleDeletePrice('clearancePriceStepList', $event)"
@
changeUnit=
"handleUnitChange(form.clearancePriceStepList, index, ...$event)"
></price-step>
</div>
</el-col>
</el-row>
</el-card>
</el-form>
<div
style=
"margin: 20px 0"
>
<el-button
@
click=
"submitForm"
type=
"primary"
:loading=
"loading"
>
{{$t('确认提交')}}
</el-button>
<el-button
type=
"default"
@
click=
"$router.back()"
>
{{$t('返回上一页')}}
</el-button>
</div>
</div>
</template>
<
script
>
import
RoutersSelector
from
'
@/components/RoutersSelector
'
import
{
batchAddPrice
,
batchAddPriceAir
,
batchUpdateProductPrice
,
getProductPrice
}
from
"
@/api/ecw/productPrice
"
;
import
{
getCurrencyList
}
from
'
@/api/ecw/currency
'
;
import
{
getUnitList
}
from
'
@/api/ecw/unit
'
;
import
ProductsSelector
from
'
@/components/ProductsSelector
'
import
Selector
from
'
@/components/Selector
'
import
Inputor
from
'
@/components/Inputor
'
import
Decimal
from
'
decimal.js
'
import
PriceStep
from
"
@/views/ecw/productPrice/components/PriceStep.vue
"
;
import
{
getProductTypeList
}
from
"
@/api/ecw/productType
"
;
// 定义默认的价格单位和体积单位
const
DEFAULT_PRICE_UNIT
=
1
const
DEFAULT_VOLUME_UNIT
=
6
const
DEFAULT_WEIGHT_UNIT
=
6
export
default
{
components
:
{
PriceStep
,
RoutersSelector
,
ProductsSelector
,
Selector
,
Inputor
},
data
()
{
return
{
checkList
:
[],
selectedRoutes
:
[],
// 勾选的路线渠道
form
:
{
priceType
:
undefined
,
specialList
:
[],
// 空运固定阶梯价
stepPrice
:
1
,
fullPriceStepList
:[],
freightPriceStepList
:[],
clearancePriceStepList
:[]
},
isAllProduct
:
false
,
// 是否全部商品
isAllFilteredProduct
:
false
,
// 是否全部篩選商品
specialProducts
:
[],
rules
:
{},
product
:
null
,
currencyList
:
[],
unitList
:
[],
productTypeList
:
[],
productDisabled
:
true
,
lineList
:
[],
//路线数组
loading
:
false
,
// 批量加价/减价
quickForm
:{}
}
},
computed
:
{
// 类型,默认海运sea,air表示空运
type
(){
return
this
.
$route
.
path
.
split
(
/
[
-_
]
/
).
pop
()
},
// 判断阶梯价是否有效
isStepPriceValid
(){
return
stepPrice
=>
{
return
stepPrice
.
startNum
&&
stepPrice
.
endNum
}
},
},
watch
:
{
checkList
()
{
//选择路线
if
(
this
.
checkList
.
length
>
0
)
{
this
.
form
.
lineChannelList
=
this
.
checkList
.
map
(
item
=>
{
return
{
lineId
:
item
,
shippingChannelId
:
0
}
})
}
else
{
this
.
form
.
lineChannelList
=
[]
}
},
product
()
{
this
.
$set
(
this
.
form
,
'
productType
'
,
this
.
product
.
typeId
)
},
"
form.priceType
"
(
priceType
){
if
(
priceType
&&
!
this
.
form
.
fullPriceStepList
?.
length
){
this
.
handleAddPrice
(
"
fullPriceStepList
"
,
"
all
"
)
}
if
(
!
priceType
){
if
(
!
this
.
form
.
freightPriceStepList
?.
length
){
this
.
handleAddPrice
(
"
freightPriceStepList
"
,
"
transport
"
)
}
if
(
!
this
.
form
.
clearancePriceStepList
?.
length
){
this
.
handleAddPrice
(
"
clearancePriceStepList
"
,
"
clearance
"
)
}
}
}
},
async
created
()
{
this
.
currencyList
=
(
await
getCurrencyList
())?.
data
||
[]
this
.
unitList
=
(
await
getUnitList
())?.
data
||
[]
this
.
productTypeList
=
(
await
getProductTypeList
())?.
data
||
[]
},
methods
:
{
handleAddPrice
(
field
,
fieldPrefix
){
if
(
!
this
.
form
[
field
]){
this
.
$set
(
this
.
form
,
field
,
[])
}
let
priceUnit
=
DEFAULT_PRICE_UNIT
let
volumeUnit
=
DEFAULT_VOLUME_UNIT
let
weightUnit
=
DEFAULT_WEIGHT_UNIT
if
(
this
.
form
[
field
].
length
){
const
first
=
this
.
form
[
field
][
0
]
priceUnit
=
first
[
`
${
fieldPrefix
}
PriceUnit`
]
volumeUnit
=
first
[
`
${
fieldPrefix
}
VolumeUnit`
]
weightUnit
=
first
.
weightUnit
}
console
.
log
(
"
添加价格的默认单位
"
,
{
priceUnit
,
volumeUnit
,
weightUnit
})
this
.
form
[
field
].
push
({
[
`
${
fieldPrefix
}
PriceUnit`
]:
priceUnit
,
[
`
${
fieldPrefix
}
VolumeUnit`
]:
volumeUnit
,
weightUnit
:
weightUnit
,
specialList
:[]
})
},
handleDeletePrice
(
field
,
index
){
this
.
form
[
field
].
splice
(
index
,
1
)
},
handleUnitChange
(
stepPriceList
,
index
,
data
){
console
.
log
(
'
handleUnitChange
'
,
...
arguments
)
if
(
index
>
0
)
return
// 如果是重量单位,且不是清关费想换的,则需要同步最小起计量单位
if
(
data
.
field
===
'
weightUnit
'
&&
data
.
type
!=
'
clearance
'
){
this
.
form
.
minWeightUnit
=
data
.
value
}
stepPriceList
.
forEach
(
item
=>
{
item
[
data
.
field
]
=
data
.
value
if
(
item
.
packagingList
?.
length
){
item
.
packagingList
.
forEach
(
p
=>
{
p
[
data
.
field
]
=
data
.
value
})
}
if
(
item
.
specialList
?.
length
){
item
.
specialList
.
forEach
(
p
=>
{
p
[
data
.
field
]
=
data
.
value
})
}
})
},
// 获得用语提交的阶梯价副本
getPriceList
(
stepList
){
if
(
!
stepList
?.
length
)
return
[]
let
stepPriceList
=
JSON
.
parse
(
JSON
.
stringify
(
stepList
))
stepPriceList
.
forEach
((
item
,
index
)
=>
{
item
.
rankNum
=
index
+
1
item
.
packagingList
=
item
.
packagingList
.
filter
(
p
=>
!!
p
.
packagingTypes
?.
length
)
item
.
packagingList
=
item
.
packagingList
.
map
(
p
=>
{
p
.
packagingTypes
=
p
.
packagingTypes
.
join
(
"
,
"
)
return
p
})
})
// 过滤掉空的阶梯
return
stepPriceList
.
filter
(
this
.
isStepPriceValid
)
},
submitForm
()
{
this
.
$refs
[
"
form
"
].
validate
(
async
(
valid
)
=>
{
if
(
!
valid
)
{
return
;
}
// 只有新增的时候做判断
if
(
!
this
.
$route
.
query
.
ids
&&
(
!
this
.
selectedRoutes
||
!
this
.
selectedRoutes
.
length
))
{
this
.
$message
.
error
(
this
.
$t
(
'
请选择线路
'
));
return
;
}
let
data
=
Object
.
assign
({},
this
.
form
,
{
// lineChannelList: this.selectedRoutes,
// specialList: this.specialProducts,
isAllProduct
:
this
.
isAllProduct
?
1
:
0
})
if
(
!
data
.
isAllProduct
&&
(
!
data
.
productIdList
||
!
data
.
productIdList
.
length
)){
return
this
.
$message
.
error
(
this
.
$t
(
'
请选择商品
'
)
+
"
!
"
)
}
data
.
lineChannelList
=
this
.
selectedRoutes
if
(
data
.
lineChannelList
.
length
<
1
){
return
this
.
$message
.
error
(
this
.
$t
(
'
请选择需要修改的路线
'
))
}
data
.
fullPriceStepList
=
this
.
getPriceList
(
data
.
fullPriceStepList
)
data
.
freightPriceStepList
=
this
.
getPriceList
(
data
.
freightPriceStepList
)
data
.
clearancePriceStepList
=
this
.
getPriceList
(
data
.
clearancePriceStepList
)
// 检查被忽略的阶梯价
let
msgArr
=
[];
if
(
data
.
priceType
){
const
ignoreAll
=
data
.
fullPriceStepList
.
length
!=
this
.
form
.
fullPriceStepList
.
length
if
(
ignoreAll
){
msgArr
.
push
(
this
.
$t
(
"
{n}个全包阶梯价
"
,
{
n
:
ignoreAll
}))
}
}
else
{
const
ignoreFreight
=
this
.
form
.
freightPriceStepList
.
length
-
data
.
freightPriceStepList
.
length
const
ignoreClearance
=
this
.
form
.
clearancePriceStepList
.
length
-
data
.
clearancePriceStepList
.
length
if
(
ignoreFreight
){
msgArr
.
push
(
this
.
$t
(
"
{n}个运费阶梯价
"
,
{
n
:
ignoreFreight
}))
}
if
(
ignoreClearance
){
msgArr
.
push
(
this
.
$t
(
"
{n}个清关费阶梯价
"
,
{
n
:
ignoreClearance
}))
}
}
let
msg
=
this
.
$t
(
'
已选择{route}条路线,{product}个商品
'
,
{
route
:
data
.
lineChannelList
.
length
,
product
:
this
.
isAllProduct
?
this
.
$refs
.
productSelector
.
allTotal
:
data
.
productIdList
.
length
})
if
(
msgArr
.
length
){
msg
+=
"
;
"
+
msgArr
.
join
(
"
,
"
)
+
"
被忽略
"
}
await
this
.
$confirm
(
msg
+
this
.
$t
(
'
;确认提交修改?
'
,
))
this
.
loading
=
true
batchAddPriceAir
(
data
).
then
(
async
(
response
)
=>
{
await
this
.
$alert
(
this
.
$t
(
"
操作成功
"
));
this
.
$store
.
dispatch
(
"
tagsView/delCurrentView
"
)
})
.
finally
(
res
=>
{
this
.
loading
=
false
})
});
}
}
}
</
script
>
<
style
scoped
>
.w100
{
width
:
100px
;
}
.mr10
{
margin-right
:
10px
;
}
.tips
{
color
:
red
;
}
</
style
>
src/views/ecw/productPrice/components/Logs.vue
View file @
18983f23
<
script
>
import
{
getPriceSnapshotList
}
from
"
@/api/ecw/productPrice
"
;
import
{
parseTime
}
from
"
../../../../utils/ruoyi
"
;
import
Template
from
"
@/views/cms/template/index.vue
"
;
import
ShowStepPriceItem
from
"
@/views/ecw/productPrice/components/ShowStepPriceItem.vue
"
;
export
default
{
name
:
"
Logs
"
,
components
:
{
ShowStepPriceItem
,
Template
},
filters
:
{
parseTime
},
props
:{
currencyMap
:{
type
:
Object
,
...
...
@@ -25,6 +30,7 @@ export default {
}
},
methods
:{
parseTime
,
open
(
id
){
this
.
showLogsDialog
=
true
this
.
loading
=
true
...
...
@@ -61,57 +67,98 @@ export default {
<!----阶梯定价-->
<template
v-if=
"row.detail.stepPrice == 1"
>
<template
v-for=
"(item, index) in row.detail.priceStepList"
>
<div
class=
"mt-10"
>
第
{{
index
+
1
}}
阶段
{{
item
.
startNum
}}
-
{{
item
.
endNum
}}
{{
unitMap
[
item
.
weightUnit
]
}}
</div>
<template
v-if=
"row.detail.priceType != 1"
>
<div
:key=
"index + '_freight'"
class=
"pl-10"
>
运费:
{{
item
.
transportPrice
}}
{{
currencyMap
[
item
.
transportPriceUnit
]
}}
/
{{
unitMap
[
item
.
transportVolumeUnit
]
}}
<!--老的数据格式-->
<template
v-if=
"row.detail.priceStepList"
>
<template
v-for=
"(item, index) in row.detail.priceStepList"
>
<div
class=
"mt-10"
>
第
{{
index
+
1
}}
阶段
{{
item
.
startNum
}}
-
{{
item
.
endNum
}}
{{
unitMap
[
item
.
weightUnit
]
}}
</div>
<!--空运没有清关费, 不需要显示-->
<div
v-if=
"type != 'air'"
:key=
"item.specialDictType + '_clearance'"
class=
"pl-10"
>
清关费:
{{
item
.
clearancePrice
}}
{{
currencyMap
[
item
.
clearancePriceUnit
]
}}
/
{{
unitMap
[
item
.
clearanceVolumeUnit
]
}}
<template
v-if=
"row.detail.priceType != 1"
>
<div
:key=
"index + '_freight'"
class=
"pl-10"
>
运费:
{{
item
.
transportPrice
}}
{{
currencyMap
[
item
.
transportPriceUnit
]
}}
/
{{
unitMap
[
item
.
transportVolumeUnit
]
}}
</div>
<!--空运没有清关费, 不需要显示-->
<div
v-if=
"type != 'air'"
:key=
"item.specialDictType + '_clearance'"
class=
"pl-10"
>
清关费:
{{
item
.
clearancePrice
}}
{{
currencyMap
[
item
.
clearancePriceUnit
]
}}
/
{{
unitMap
[
item
.
clearanceVolumeUnit
]
}}
</div>
</
template
>
<div
v-else
class=
"pl-10"
>
全包价:
{{item.allPrice}} {{currencyMap[item.allPriceUnit]}} / {{unitMap[item.allVolumeUnit]}}
</div>
</template>
<div
v-else
class=
"pl-10"
>
全包价:
{{item.allPrice}} {{currencyMap[item.allPriceUnit]}} / {{unitMap[item.allVolumeUnit]}}
</div>
</template>
<
template
v-else-if=
"row.detail.priceType"
>
<template
v-for=
"(item, index) in row.detail.fullPriceStepList"
>
<show-step-price-item
:value=
"item"
:unit-map=
"unitMap"
:currency-map=
"currencyMap"
:index=
"index"
:price-name=
"$t('全包价')"
field-prefix=
"all"
/>
</
template
>
</template>
<
template
v-else
>
<template
v-if=
"row.detail.freightPriceStepList && row.detail.freightPriceStepList.length"
>
<template
v-for=
"(item, index) in row.detail.freightPriceStepList"
>
<show-step-price-item
:value=
"item"
:unit-map=
"unitMap"
:currency-map=
"currencyMap"
:index=
"index"
:price-name=
"$t('运费')"
field-prefix=
"transport"
/>
</
template
>
</template>
<
template
v-if=
"row.detail.freightPriceStepList && row.detail.freightPriceStepList.length"
>
<template
v-for=
"(item, index) in row.detail.freightPriceStepList"
>
<show-step-price-item
:value=
"item"
:unit-map=
"unitMap"
:currency-map=
"currencyMap"
:index=
"index"
:price-name=
"$t('清关费')"
field-prefix=
"clearance"
/>
</
template
>
</template>
</template>
</template>
<
template
v-else
>
<template
v-if=
"row.detail.priceType != 1"
>
<div>
默认运费
:
{{
$t
(
'
默认运费
'
)
}}
’
:
{{
row
.
detail
.
transportPrice
}}
{{
currencyMap
[
row
.
detail
.
transportPriceUnit
]
}}
/
{{
unitMap
[
row
.
detail
.
transportVolumeUnit
]
}}
</div>
<div>
默认清关费
:
{{
$t
(
'
默认清关费
'
)
}}
:
{{
row
.
detail
.
clearancePrice
}}
{{
currencyMap
[
row
.
detail
.
clearancePriceUnit
]
}}
/
{{
unitMap
[
row
.
detail
.
clearanceVolumeUnit
]
}}
</div>
</
template
>
<div
v-else
>
全包价
:
{{$t('全包价')}}
:
{{row.detail.allPrice}} {{currencyMap[row.detail.allPriceUnit]}} / {{unitMap[row.detail.allVolumeUnit]}}
</div>
<
template
v-for=
"(item, index) in row.detail.specialList"
>
<template
v-if=
"row.detail.priceType != 1"
>
<div
:key=
"item.specialDictType + '_freight'"
>
{{
getDictDataLabel
(
DICT_TYPE
.
ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS
,
item
.
specialDictType
)
}}
运费
:
{{
getDictDataLabel
(
DICT_TYPE
.
ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS
,
item
.
specialDictType
)
}}
{{
$t
(
'
运费
'
)
}}
}
:
{{
item
.
transportPrice
}}
{{
currencyMap
[
item
.
transportPriceUnit
]
}}
/
{{
unitMap
[
item
.
transportVolumeUnit
]
}}
</div>
<div
:key=
"item.specialDictType + '_clearance'"
>
{{
getDictDataLabel
(
DICT_TYPE
.
ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS
,
item
.
specialDictType
)
}}
清关费
:
{{
getDictDataLabel
(
DICT_TYPE
.
ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS
,
item
.
specialDictType
)
}}
{{
$t
(
'
清关费
'
)
}}
:
{{
item
.
clearancePrice
}}
{{
currencyMap
[
item
.
clearancePriceUnit
]
}}
/
{{
unitMap
[
item
.
clearanceVolumeUnit
]
}}
</div>
</
template
>
<div
v-else
>
{{getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, item.specialDictType)}}
全包价
:
{{getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, item.specialDictType)}}
{{$t('全包价')}}
:
{{item.allPrice}} {{currencyMap[item.allPriceUnit]}} / {{unitMap[item.allVolumeUnit]}}
</div>
</template>
...
...
src/views/ecw/productPrice/components/PriceStep.vue
View file @
18983f23
...
...
@@ -21,6 +21,7 @@ export default {
},
showAdd
:
Boolean
,
readonly
:
Boolean
,
stepTips
:
String
,
value
:{
type
:
Object
,
default
:
()
=>
{
...
...
@@ -51,7 +52,8 @@ export default {
},
computed
:{
packagingList
(){
return
getDictDatas
(
DICT_TYPE
.
ECW_PACKAGING_TYPE
).
map
(
dict
=>
{
const
dicts
=
JSON
.
parse
(
JSON
.
stringify
(
getDictDatas
(
DICT_TYPE
.
ECW_PACKAGING_TYPE
)))
return
dicts
.
map
(
dict
=>
{
dict
.
enable
=
true
this
.
value
.
packagingList
.
forEach
(
item
=>
{
if
(
item
.
packagingTypes
?.
length
&&
item
.
packagingTypes
.
indexOf
(
dict
.
value
)
>
-
1
){
...
...
@@ -97,32 +99,34 @@ export default {
},
// 校验
validate
(){
let
valid
=
true
const
index
=
this
.
index
const
errors
=
[]
// 区间设置检查
if
(
index
>
0
&&
!
this
.
value
.
startNum
){
valid
=
false
this
.
$message
.
error
(
`请设置第
${
index
+
1
}
阶段的起始值`
)
errors
.
push
(
`请设置
${
this
.
priceName
}
第
${
index
+
1
}
阶段的起始值`
)
}
if
(
!
this
.
value
.
endNum
){
valid
=
false
this
.
$message
.
error
(
`请设置第
${
index
+
1
}
阶段的结束值`
)
errors
.
push
(
`请设置
${
this
.
priceName
}
第
${
index
+
1
}
阶段的结束值`
)
}
// 价格检查
if
(
!
this
.
validatePrice
(
this
.
value
[
`
${
this
.
fieldPrefix
}
Price`
])){
valid
=
false
this
.
$message
.
error
(
`请设置第
${
index
+
1
}
阶段的
${
this
.
priceName
}
`
)
errors
.
push
(
`请设置第
${
index
+
1
}
阶段的
${
this
.
priceName
}
`
)
}
// 包装价格检查
if
(
this
.
value
.
packagingList
?.
length
){
this
.
value
.
packagingList
.
forEach
((
item
,
i
)
=>
{
if
(
item
.
packagingTypes
?.
length
&&
!
this
.
validatePrice
(
item
.
packagingPrice
)){
valid
=
false
this
.
$message
.
error
(
`请设置第
${
index
+
1
}
阶段的包装类型
${
i
+
1
}
的
${
this
.
priceName
}
`
)
errors
.
push
(
`请设置第
${
index
+
1
}
阶段的包装类型
${
i
+
1
}
的
${
this
.
priceName
}
`
)
}
})
}
return
valid
if
(
errors
.
length
){
this
.
$notify
.
error
({
title
:
this
.
$t
(
"
表单错误
"
),
message
:
errors
.
join
(
'
;
\n
'
)
});
}
return
!
errors
.
length
},
// 校验价格是否为空,可以是0
validatePrice
(
value
){
...
...
@@ -163,6 +167,7 @@ export default {
}
)
"
value
-
field
=
"
id
"
class
=
"
w-100
"
/>
<
div
class
=
"
tips
"
v
-
if
=
"
stepTips
"
>
{{
stepTips
}}
<
/div
>
<
/el-form-item
>
<
el
-
form
-
item
:
label
=
"
$t('默认') + priceName
"
>
<
el
-
input
-
number
v
-
model
=
"
value[`${fieldPrefix
}
Price`]
"
:
placeholder
=
"
$t('整数或者两位小数')
"
:
precision
=
"
2
"
:
controls
=
"
false
"
class
=
"
w-100 mr-10
"
/>
...
...
@@ -206,9 +211,10 @@ export default {
<!--
包装类型价格
-->
<
template
v
-
for
=
"
(item, i) in value.packagingList
"
>
<
el
-
form
-
item
:
label
=
"
$t('包装类型') + priceName + (i+1)
"
>
<
el
-
form
-
item
:
label
=
"
$t('包装类型') + priceName + (i+1)
"
:
key
=
"
i
"
>
<
template
#
label
>
<
div
class
=
"
el-form-item__label
"
style
=
"
width: 150px;
"
>
{{
$t
(
'
包装类型
'
)
+
priceName
+
(
i
+
1
)
}}
<
/div
>
<
div
v
-
if
=
"
!item.packagingTypes || !item.packagingTypes.length
"
class
=
"
tips
"
>
{{
$t
(
'
未选择包装类型将被忽略
'
)
}}
<
/div
>
<
/template
>
<
el
-
select
v
-
model
=
"
item.packagingTypes
"
multiple
placeholder
=
"
请选择
"
style
=
"
width: 100%; max-width: 450px; margin-bottom: 5px; display: block
"
>
<
el
-
option
...
...
@@ -229,7 +235,7 @@ export default {
<
el
-
divider
direction
=
"
vertical
"
><
/el-divider
>
<
el
-
link
type
=
"
danger
"
@
click
.
native
=
"
deletePackage(i)
"
>
{{
$t
(
'
删除
'
)
}}
<
/el-link
>
<
/template
>
<
div
v
-
if
=
"
!item.packagingTypes || !item.packagingTypes.length
"
class
=
"
tips
"
>
{{
$t
(
'
未选择包装类型,将被忽略
'
)
}}
<
/div
>
<
/el-form-item
>
<
/template
>
<
/div
>
...
...
src/views/ecw/productPrice/components/QuickSet.vue
View file @
18983f23
...
...
@@ -4,13 +4,18 @@ import Selector from "@/components/Selector/index.vue";
export
default
{
name
:
"
QuickSet.vue
"
,
props
:{
type
:
String
,
unitList
:{
type
:
Array
,
default
:
[]
default
(){
return
[]
}
},
currencyList
:{
type
:
Array
,
default
:
[]
default
(){
return
[]
}
},
value
:{
type
:
Object
,
...
...
@@ -28,6 +33,16 @@ export default {
computed
:{
getUnit
(){
return
(
field
,
unitField
)
=>
{
if
(
this
.
type
==
'
sea
'
){
if
(
this
.
value
.
stepPrice
&&
!
this
.
value
.
priceStepList
?.
length
){
return
null
}
if
(
this
.
value
.
stepPrice
){
return
this
.
value
.
priceStepList
[
0
][
unitField
]
}
return
this
.
value
[
unitField
]
}
// 后面是空运的
if
(
!
this
.
value
[
field
]?.
length
)
return
null
return
this
.
value
[
field
][
0
][
unitField
]
}
...
...
@@ -39,6 +54,9 @@ export default {
if
(
!
amount
){
return
this
.
$message
.
error
(
this
.
$t
(
'
请输入加价金额
'
))
}
if
(
this
.
type
==
'
sea
'
){
return
this
.
batchSetSeaPrice
(
type
,
amount
)
}
if
(
this
.
value
?.
priceType
==
1
){
this
.
batchSetPrice
(
"
fullPriceStepList
"
,
'
all
'
,
amount
)
}
else
if
(
type
==
'
transport
'
){
...
...
@@ -71,6 +89,37 @@ export default {
})
}
})
},
batchSetSeaPrice
(
type
,
amount
){
console
.
log
(
'
快捷设置海运价格
'
,
type
,
amount
)
if
(
!
this
.
value
.
stepPrice
){
if
(
!
this
.
value
.
priceType
){
this
.
setSeaPrice
(
this
.
value
,
"
transport
"
,
amount
)
this
.
setSeaPrice
(
this
.
value
,
"
clearance
"
,
amount
)
}
else
{
this
.
setSeaPrice
(
this
.
value
,
"
all
"
,
amount
)
}
return
}
this
.
value
.
priceStepList
.
forEach
(
item
=>
{
if
(
!
this
.
value
.
priceType
){
this
.
setSeaPrice
(
item
,
"
transport
"
,
amount
)
this
.
setSeaPrice
(
item
,
"
clearance
"
,
amount
)
}
else
{
this
.
setSeaPrice
(
item
,
"
all
"
,
amount
)
}
})
},
setSeaPrice
(
parent
,
fieldPrefix
,
amount
){
console
.
log
(
parent
[
`
${
fieldPrefix
}
Price`
],
...
arguments
)
parent
[
`
${
fieldPrefix
}
Price`
]
=
(
parent
[
fieldPrefix
+
'
Price
'
]
*
100
+
amount
*
100
)
/
100
if
(
!
parent
.
specialList
?.
length
)
return
parent
.
specialList
.
forEach
(
special
=>
{
console
.
log
(
special
.
specialDictType
,
special
[
fieldPrefix
+
'
Price
'
])
if
(
special
[
fieldPrefix
+
'
Price
'
]){
special
[
fieldPrefix
+
'
Price
'
]
=
(
special
[
fieldPrefix
+
'
Price
'
]
*
100
+
amount
*
100
)
/
100
}
})
}
}
}
...
...
src/views/ecw/productPrice/components/SeaPrice.vue
0 → 100644
View file @
18983f23
<
script
>
import
Selector
from
"
@/components/Selector/index.vue
"
;
import
Inputor
from
"
@/components/Inputor/index.vue
"
;
import
Template
from
"
@/views/cms/template/index.vue
"
;
import
{
DICT_TYPE
,
getDictDatas
}
from
"
@/utils/dict
"
;
export
default
{
name
:
"
SeaPrice
"
,
components
:
{
Template
,
Inputor
,
Selector
},
props
:{
priceType
:
Number
,
// 1全包价,0清关费+运费
unitList
:{
type
:
Array
,
default
:
[]
},
currencyList
:{
type
:
Array
,
default
:
[]
},
readonly
:
Boolean
,
value
:{
type
:
Object
,
default
:
()
=>
{
return
{
}
}
}
},
created
()
{
this
.
initSpecialPrice
()
},
data
(){
return
{
}
},
methods
:{
getDictDatas
,
// 初始化特需加价
initSpecialPrice
(){
if
(
!
this
.
value
.
specialList
){
this
.
$set
(
this
.
value
,
'
specialList
'
,
[])
}
this
.
getDictDatas
(
this
.
DICT_TYPE
.
ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS
).
forEach
(
item
=>
{
if
(
!
this
.
value
.
specialList
.
find
(
special
=>
special
.
specialDictType
==
item
.
value
)){
this
.
value
.
specialList
.
push
({
allPrice
:
undefined
,
// 新建默认给0,否则默认是null
allPriceUnit
:
this
.
value
[
`allPriceUnit`
],
allVolumeUnit
:
this
.
value
[
`allVolumeUnit`
],
transportPrice
:
undefined
,
// 新建默认给0,否则默认是null
transportPriceUnit
:
this
.
value
[
`transportPriceUnit`
],
transportVolumeUnit
:
this
.
value
[
`transportVolumeUnit`
],
clearancePrice
:
undefined
,
clearancePriceUnit
:
this
.
value
[
`clearancePriceUnit`
],
clearanceVolumeUnit
:
this
.
value
[
`clearanceVolumeUnit`
],
specialDictType
:
item
.
value
})
}
})
},
// 校验
validate
(){
let
valid
=
true
// 价格检查
if
(
this
.
priceType
){
if
(
!
this
.
validatePrice
(
this
.
value
[
`allPrice`
])){
valid
=
false
this
.
$message
.
error
(
`请设置全包价`
)
}
}
else
{
if
(
!
this
.
validatePrice
(
this
.
value
[
`transportPrice`
])){
valid
=
false
this
.
$message
.
error
(
`请设置运费`
)
}
if
(
!
this
.
validatePrice
(
this
.
value
[
`clearancePrice`
])){
valid
=
false
this
.
$message
.
error
(
`请设置清关费`
)
}
}
return
valid
},
// 校验价格是否为空,可以是0
validatePrice
(
value
){
if
(
value
===
undefined
||
value
===
null
||
value
===
''
){
return
false
}
return
true
},
}
}
</
script
>
<
template
>
<div>
<el-form-item
:label=
"$t('默认运费')"
v-if=
"!priceType"
>
<el-input-number
v-model=
"value[`transportPrice`]"
:placeholder=
"$t('整数或者两位小数')"
:controls=
"false"
:disabled=
"readonly"
class=
"w-100 mr-10"
/>
<selector
:disabled=
"readonly"
v-model=
"value[`transportPriceUnit`]"
:options=
"currencyList"
:label-field=
"$l(null, 'title')"
@
input=
"$emit('changeUnit',
{
value: $event,
field: `transportPriceUnit`
})"
value-field="id"
class="w-100" />
/
<selector
:disabled=
"readonly"
v-model=
"value[`transportVolumeUnit`]"
:options=
"unitList"
:label-field=
"$l(null, 'title')"
@
input=
"$emit('changeUnit',
{
value: $event,
field: `transportVolumeUnit`
})"
value-field="id"
class="w-100" />
</el-form-item>
<el-form-item
:label=
"$t('默认清关费')"
v-if=
"!priceType"
>
<el-input-number
v-model=
"value[`clearancePrice`]"
:placeholder=
"$t('整数或者两位小数')"
:disabled=
"readonly"
:controls=
"false"
class=
"w-100 mr-10"
/>
<selector
:disabled=
"readonly"
v-model=
"value[`clearancePriceUnit`]"
:options=
"currencyList"
:label-field=
"$l(null, 'title')"
@
input=
"$emit('changeUnit',
{
value: $event,
field: `clearancePriceUnit`
})"
value-field="id"
class="w-100" />
/
<selector
:disabled=
"readonly"
v-model=
"value[`clearanceVolumeUnit`]"
:options=
"unitList"
:label-field=
"$l(null, 'title')"
@
input=
"$emit('changeUnit',
{
value: $event,
field: `clearanceVolumeUnit`
})"
value-field="id"
class="w-100" />
</el-form-item>
<el-form-item
:label=
"$t('默认全包价')"
v-if=
"priceType"
>
<el-input-number
v-model=
"value[`allPrice`]"
:placeholder=
"$t('整数或者两位小数')"
:disabled=
"readonly"
:controls=
"false"
class=
"w-100 mr-10"
/>
<selector
:disabled=
"readonly"
v-model=
"value[`allPriceUnit`]"
:options=
"currencyList"
:label-field=
"$l(null, 'title')"
@
input=
"$emit('changeUnit',
{
value: $event,
field: `allPriceUnit`
})"
value-field="id"
class="w-100" />
/
<selector
:disabled=
"readonly"
v-model=
"value[`allVolumeUnit`]"
:options=
"unitList"
:label-field=
"$l(null, 'title')"
@
input=
"$emit('changeUnit',
{
value: $event,
field: `allVolumeUnit`
})"
value-field="id"
class="w-100" />
</el-form-item>
<!--特性加价-->
<template
v-for=
"(special, specialIndex) in value.specialList"
>
<div
:key=
"specialIndex + 'transport'"
>
<el-form-item
v-if=
"!priceType"
:label=
"getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('运费')"
>
<el-input-number
v-model.number=
"special[`transportPrice`]"
:controls=
"false"
:min=
"0"
:disabled=
"readonly"
:placeholder=
"$t('整数或者两位小数')"
class=
"w-100 mr-10"
/>
<selector
disabled
v-model=
"special[`transportPriceUnit`]"
:options=
"currencyList"
:label-field=
"$l(null, 'title')"
value-field=
"id"
defaultable2
class=
"w-100 mr-10"
/>
<span
class=
"mr-10"
>
/
</span>
<selector
disabled
v-model=
"special[`transportVolumeUnit`]"
:options=
"unitList"
:label-field=
"$l(null, 'title')"
value-field=
"id"
defaultable2
class=
"w-100"
/>
</el-form-item>
<el-form-item
v-if=
"!priceType"
:label=
"getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('清关费')"
>
<el-input-number
v-model.number=
"special[`clearancePrice`]"
:controls=
"false"
:min=
"0"
:disabled=
"readonly"
:placeholder=
"$t('整数或者两位小数')"
class=
"w-100 mr-10"
/>
<selector
disabled
v-model=
"special[`clearancePriceUnit`]"
:options=
"currencyList"
:label-field=
"$l(null, 'title')"
value-field=
"id"
defaultable2
class=
"w-100 mr-10"
/>
<span
class=
"mr-10"
>
/
</span>
<selector
disabled
v-model=
"special[`clearanceVolumeUnit`]"
:options=
"unitList"
:label-field=
"$l(null, 'title')"
value-field=
"id"
defaultable2
class=
"w-100"
/>
</el-form-item>
<el-form-item
v-if=
"priceType"
:label=
"getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('全包价')"
>
<el-input-number
v-model.number=
"special[`allPrice`]"
:controls=
"false"
:min=
"0"
:disabled=
"readonly"
:placeholder=
"$t('整数或者两位小数')"
class=
"w-100 mr-10"
/>
<selector
disabled
v-model=
"special[`allPriceUnit`]"
:options=
"currencyList"
:label-field=
"$l(null, 'title')"
value-field=
"id"
defaultable2
class=
"w-100 mr-10"
/>
<span
class=
"mr-10"
>
/
</span>
<selector
disabled
v-model=
"special[`allVolumeUnit`]"
:options=
"unitList"
:label-field=
"$l(null, 'title')"
value-field=
"id"
defaultable2
class=
"w-100"
/>
</el-form-item>
</div>
</
template
>
</div>
</template>
<
style
scoped
lang=
"scss"
>
.bold
{
font-weight
:
bold
;
}
.text-lg
{
font-size
:
1
.3rem
;
}
.tips
{
font-size
:
1rem
;
color
:
red
;
}
</
style
>
src/views/ecw/productPrice/components/SeaStep.vue
0 → 100644
View file @
18983f23
<
script
>
import
Selector
from
"
@/components/Selector/index.vue
"
;
import
Inputor
from
"
@/components/Inputor/index.vue
"
;
import
Template
from
"
@/views/cms/template/index.vue
"
;
import
{
DICT_TYPE
,
getDictDatas
}
from
"
@/utils/dict
"
;
export
default
{
name
:
"
SeaStep
"
,
components
:
{
Template
,
Inputor
,
Selector
},
props
:{
index
:
Number
,
priceType
:
Number
,
// 1全包价,0清关费+运费
unitList
:{
type
:
Array
,
default
:
[]
},
currencyList
:{
type
:
Array
,
default
:
[]
},
showAdd
:
Boolean
,
readonly
:
Boolean
,
value
:{
type
:
Object
,
default
:
()
=>
{
return
{
}
}
}
},
created
()
{
this
.
initSpecialPrice
()
},
data
(){
return
{
}
},
methods
:{
getDictDatas
,
// 初始化特需加价
initSpecialPrice
(){
if
(
!
this
.
value
.
specialList
){
this
.
$set
(
this
.
value
,
'
specialList
'
,
[])
}
this
.
getDictDatas
(
this
.
DICT_TYPE
.
ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS
).
forEach
(
item
=>
{
if
(
!
this
.
value
.
specialList
.
find
(
special
=>
special
.
specialDictType
==
item
.
value
)){
this
.
value
.
specialList
.
push
({
allPrice
:
undefined
,
// 新建默认给0,否则默认是null
allPriceUnit
:
this
.
value
[
`allPriceUnit`
],
allVolumeUnit
:
this
.
value
[
`allVolumeUnit`
],
transportPrice
:
undefined
,
// 新建默认给0,否则默认是null
transportPriceUnit
:
this
.
value
[
`transportPriceUnit`
],
transportVolumeUnit
:
this
.
value
[
`transportVolumeUnit`
],
clearancePrice
:
undefined
,
clearancePriceUnit
:
this
.
value
[
`clearancePriceUnit`
],
clearanceVolumeUnit
:
this
.
value
[
`clearanceVolumeUnit`
],
specialDictType
:
item
.
value
})
}
})
},
// 校验
validate
(){
let
valid
=
true
const
index
=
this
.
index
// 区间设置检查
if
(
index
>
0
&&
!
this
.
value
.
startNum
){
valid
=
false
this
.
$message
.
error
(
`请设置第
${
index
+
1
}
阶段的起始值`
)
}
if
(
!
this
.
value
.
endNum
){
valid
=
false
this
.
$message
.
error
(
`请设置第
${
index
+
1
}
阶段的结束值`
)
}
// 价格检查
if
(
this
.
priceType
){
if
(
!
this
.
validatePrice
(
this
.
value
[
`allPrice`
])){
valid
=
false
this
.
$message
.
error
(
`请设置第
${
index
+
1
}
阶段的全包价`
)
}
}
else
{
if
(
!
this
.
validatePrice
(
this
.
value
[
`transportPrice`
])){
valid
=
false
this
.
$message
.
error
(
`请设置第
${
index
+
1
}
阶段的运费`
)
}
if
(
!
this
.
validatePrice
(
this
.
value
[
`clearancePrice`
])){
valid
=
false
this
.
$message
.
error
(
`请设置第
${
index
+
1
}
阶段的清关费`
)
}
}
return
valid
},
// 校验价格是否为空,可以是0
validatePrice
(
value
){
if
(
value
===
undefined
||
value
===
null
||
value
===
''
){
return
false
}
return
true
},
}
}
</
script
>
<
template
>
<div>
<div
style=
"font-size:14px; margin:10px 0"
>
{{
$t
(
'
第{index
}
阶梯定价方案
'
,
{
index
:
index
+
1
}
)
}}
:
<
template
v
-
if
=
"
showAdd
"
>
<
el
-
link
type
=
"
primary
"
@
click
.
native
=
"
$emit('add', fieldPrefix)
"
>
{{
$t
(
'
添加区间
'
)
}}
<
/el-link
>
<
el
-
divider
direction
=
"
vertical
"
><
/el-divider
>
<
el
-
link
type
=
"
danger
"
@
click
.
native
=
"
$emit( 'delete', index)
"
>
{{
$t
(
'
删除
'
)
}}
<
/el-link
>
<
/template
>
<
/div
>
<
el
-
form
-
item
:
label
=
"
$t('第{index
}
阶梯', {index: index+1
}
)
"
>
<
el
-
input
-
number
v
-
model
=
"
value.startNum
"
:
controls
=
"
false
"
class
=
"
w-100
"
><
/el-input-number
>
-
<
el
-
input
-
number
v
-
model
=
"
value.endNum
"
:
controls
=
"
false
"
class
=
"
w-100
"
><
/el-input-number
>
/
<
selector
:
disabled
=
"
index>0
"
v
-
model
=
"
value.weightUnit
"
:
options
=
"
unitList
"
:
label
-
field
=
"
$l(null, 'title')
"
@
input
=
"
$emit('changeUnit', {
value: $event,
field: 'weightUnit',
type: fieldPrefix
}
)
"
value
-
field
=
"
id
"
class
=
"
w-100
"
/>
<
/el-form-item
>
<
el
-
form
-
item
:
label
=
"
$t('默认运费')
"
v
-
if
=
"
!priceType
"
>
<
el
-
input
-
number
v
-
model
=
"
value[`transportPrice`]
"
:
placeholder
=
"
$t('整数或者两位小数')
"
:
precision
=
"
2
"
:
controls
=
"
false
"
class
=
"
w-100 mr-10
"
/>
<
selector
:
disabled
=
"
index>0
"
v
-
model
=
"
value[`transportPriceUnit`]
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l(null, 'title')
"
@
input
=
"
$emit('changeUnit', {
value: $event,
field: `transportPriceUnit`
}
)
"
value
-
field
=
"
id
"
class
=
"
w-100
"
/>
/
<
selector
:
disabled
=
"
index>0
"
v
-
model
=
"
value[`transportVolumeUnit`]
"
:
options
=
"
unitList
"
:
label
-
field
=
"
$l(null, 'title')
"
@
input
=
"
$emit('changeUnit', {
value: $event,
field: `transportVolumeUnit`
}
)
"
value
-
field
=
"
id
"
class
=
"
w-100
"
/>
<
/el-form-item
>
<
el
-
form
-
item
:
label
=
"
$t('默认清关费')
"
v
-
if
=
"
!priceType
"
>
<
el
-
input
-
number
v
-
model
=
"
value[`clearancePrice`]
"
:
placeholder
=
"
$t('整数或者两位小数')
"
:
precision
=
"
2
"
:
controls
=
"
false
"
class
=
"
w-100 mr-10
"
/>
<
selector
:
disabled
=
"
index>0
"
v
-
model
=
"
value[`clearancePriceUnit`]
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l(null, 'title')
"
@
input
=
"
$emit('changeUnit', {
value: $event,
field: `clearancePriceUnit`
}
)
"
value
-
field
=
"
id
"
class
=
"
w-100
"
/>
/
<
selector
:
disabled
=
"
index>0
"
v
-
model
=
"
value[`clearanceVolumeUnit`]
"
:
options
=
"
unitList
"
:
label
-
field
=
"
$l(null, 'title')
"
@
input
=
"
$emit('changeUnit', {
value: $event,
field: `clearanceVolumeUnit`
}
)
"
value
-
field
=
"
id
"
class
=
"
w-100
"
/>
<
/el-form-item
>
<
el
-
form
-
item
:
label
=
"
$t('默认全包价')
"
v
-
if
=
"
priceType
"
>
<
el
-
input
-
number
v
-
model
=
"
value[`allPrice`]
"
:
placeholder
=
"
$t('整数或者两位小数')
"
:
precision
=
"
2
"
:
controls
=
"
false
"
class
=
"
w-100 mr-10
"
/>
<
selector
:
disabled
=
"
index>0
"
v
-
model
=
"
value[`allPriceUnit`]
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l(null, 'title')
"
@
input
=
"
$emit('changeUnit', {
value: $event,
field: `allPriceUnit`
}
)
"
value
-
field
=
"
id
"
class
=
"
w-100
"
/>
/
<
selector
:
disabled
=
"
index>0
"
v
-
model
=
"
value[`allVolumeUnit`]
"
:
options
=
"
unitList
"
:
label
-
field
=
"
$l(null, 'title')
"
@
input
=
"
$emit('changeUnit', {
value: $event,
field: `allVolumeUnit`
}
)
"
value
-
field
=
"
id
"
class
=
"
w-100
"
/>
<
/el-form-item
>
<!--
特性加价
-->
<
template
v
-
for
=
"
(special, specialIndex) in value.specialList
"
>
<
div
:
key
=
"
specialIndex + 'transport'
"
>
<
el
-
form
-
item
v
-
if
=
"
!priceType
"
:
label
=
"
getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('运费')
"
>
<
el
-
input
-
number
v
-
model
.
number
=
"
special[`transportPrice`]
"
:
controls
=
"
false
"
:
min
=
"
0
"
:
placeholder
=
"
$t('整数或者两位小数')
"
class
=
"
w-100 mr-10
"
/>
<
selector
disabled
v
-
model
=
"
special[`transportPriceUnit`]
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
defaultable2
class
=
"
w-100 mr-10
"
/>
<
span
class
=
"
mr-10
"
>
/</
span
>
<
selector
disabled
v
-
model
=
"
special[`transportVolumeUnit`]
"
:
options
=
"
unitList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
defaultable2
class
=
"
w-100
"
/>
<
/el-form-item
>
<
el
-
form
-
item
v
-
if
=
"
!priceType
"
:
label
=
"
getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('清关费')
"
>
<
el
-
input
-
number
v
-
model
.
number
=
"
special[`clearancePrice`]
"
:
controls
=
"
false
"
:
min
=
"
0
"
:
placeholder
=
"
$t('整数或者两位小数')
"
class
=
"
w-100 mr-10
"
/>
<
selector
disabled
v
-
model
=
"
special[`clearancePriceUnit`]
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
defaultable2
class
=
"
w-100 mr-10
"
/>
<
span
class
=
"
mr-10
"
>
/</
span
>
<
selector
disabled
v
-
model
=
"
special[`clearanceVolumeUnit`]
"
:
options
=
"
unitList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
defaultable2
class
=
"
w-100
"
/>
<
/el-form-item
>
<
el
-
form
-
item
v
-
if
=
"
priceType
"
:
label
=
"
getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('全包价')
"
>
<
el
-
input
-
number
v
-
model
.
number
=
"
special[`allPrice`]
"
:
controls
=
"
false
"
:
min
=
"
0
"
:
placeholder
=
"
$t('整数或者两位小数')
"
class
=
"
w-100 mr-10
"
/>
<
selector
disabled
v
-
model
=
"
special[`allPriceUnit`]
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
defaultable2
class
=
"
w-100 mr-10
"
/>
<
span
class
=
"
mr-10
"
>
/</
span
>
<
selector
disabled
v
-
model
=
"
special[`allVolumeUnit`]
"
:
options
=
"
unitList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
defaultable2
class
=
"
w-100
"
/>
<
/el-form-item
>
<
/div
>
<
/template
>
<
/div
>
<
/template
>
<
style
scoped
lang
=
"
scss
"
>
.
bold
{
font
-
weight
:
bold
;
}
.
text
-
lg
{
font
-
size
:
1.3
rem
;
}
.
tips
{
font
-
size
:
1
rem
;
color
:
red
;
}
<
/style
>
src/views/ecw/productPrice/components/ShowStepPriceItem.vue
0 → 100644
View file @
18983f23
<
script
>
import
Selector
from
"
@/components/Selector/index.vue
"
;
import
Template
from
"
@/views/cms/template/index.vue
"
;
import
{
DICT_TYPE
}
from
"
@/utils/dict
"
;
export
default
{
name
:
"
ShowStepPriceItem
"
,
components
:
{
Template
,
Selector
},
props
:
{
index
:
Number
,
value
:
Object
,
priceName
:
String
,
fieldPrefix
:
String
,
unitMap
:
{
type
:
Object
,
default
(){
return
{}
}
},
currencyMap
:
{
type
:
Object
,
default
(){
return
{}
}
}
},
computed
:{
showPackages
(){
return
str
=>
{
let
arr
=
str
.
split
(
"
,
"
)
return
arr
.
map
(
item
=>
{
return
this
.
getDictDataLabel
(
DICT_TYPE
.
ECW_PACKAGING_TYPE
,
item
)
}).
join
(
"
,
"
)
}
}
}
}
</
script
>
<
template
>
<div>
<div
class=
"mt-10"
>
{{
$t
(
"
第{no
}
阶段
"
,
{
no
:
index
+
1
}
)
}}
{{
priceName
}}
{{
value
.
startNum
}}
-
{{
value
.
endNum
}}
{{
unitMap
[
value
.
weightUnit
]
}}
<
/div
>
<
div
class
=
"
pl-10
"
>
{{
$t
(
'
默认
'
)
+
priceName
}}
:
{{
value
.
transportPrice
}}
{{
currencyMap
[
value
[
`${fieldPrefix
}
PriceUnit`
]]
}}
/
{{
unitMap
[
value
[
`${fieldPrefix
}
VolumeUnit`
]]
}}
<
/div
>
<!--
特需加价
-->
<
div
v
-
for
=
"
(special, specialIndex) in value.specialList
"
>
{{
getDictDataLabel
(
DICT_TYPE
.
ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS
,
special
.
specialDictType
)
+
priceName
}}
{{
special
[
`${fieldPrefix
}
Price`
]
}}
{{
currencyMap
[
special
[
`${fieldPrefix
}
PriceUnit`
]]
}}
{{
unitMap
[
special
[
`${fieldPrefix
}
VolumeUnit`
]]
}}
<
/div
>
<!--
包装价
-->
<!--
包装类型价格
-->
<
template
v
-
for
=
"
(item, i) in value.packagingList
"
>
{{
$t
(
'
包装类型
'
)
+
priceName
+
(
i
+
1
)
}}
{{
showPackages
(
item
.
packagingTypes
)
}}
{{
item
.
packagingPrice
}}
{{
currencyMap
[
item
.
packagingPriceUnit
]
}}
{{
unitMap
[
item
.
packagingVolumeUnit
]
}}
<
/template
>
<
/div
>
<
/template
>
src/views/ecw/productPrice/edit.vue
View file @
18983f23
...
...
@@ -92,154 +92,92 @@
:label=
"$t('最小起计量')"
:prop=
"`minWeight`"
>
<
inputor
default2=
"0"
v-model.number=
"form.minWeight"
type=
"number"
class=
"w-100"
:rules=
"{validator: priceValidator, trigger: 'blur', message: '数量错误'}
"
/>
<
el-input-number
v-model=
"form.minWeight"
type=
"number"
class=
"w-100"
:controls=
"false
"
/>
/
<selector
v-model=
"form.minWeightUnit"
:options=
"unitList"
:label-field=
"$l(null, 'title')"
value-field=
"id"
defaultable2
class=
"w-100"
disabled
/>
</el-form-item>
<!--阶梯定价-->
<
template
v-if=
"form.stepPrice==1"
>
<div
v-for=
"(item, index) in form.priceStepList"
:key=
"index"
>
<div
style=
"font-size:14px; margin:10px 0"
>
{{
$t
(
'
第{index
}
阶梯定价方案
'
,
{
index
:
index
+
1
}
)
}}
:
<
template
v
-
if
=
"
index == form.priceStepList.length - 1 && !readonly
"
>
<
el
-
link
type
=
"
primary
"
@
click
.
native
=
"
addStepPrice
"
>
{{
$t
(
'
添加区间
'
)
}}
<
/el-link
>
<
el
-
divider
direction
=
"
vertical
"
><
/el-divider
>
<
el
-
link
type
=
"
danger
"
@
click
.
native
=
"
form.priceStepList.splice(index, 1)
"
>
{{
$t
(
'
删除
'
)
}}
<
/el-link
>
<
/template
>
<
/div
>
<
el
-
form
-
item
:
label
=
"
$t('第{index
}
阶梯', {index: index + 1
}
)
"
>
<
el
-
input
v
-
model
=
"
item.startNum
"
type
=
"
number
"
placeholder
=
""
class
=
"
w-100
"
><
/el-input
>
-
<
el
-
input
v
-
model
=
"
item.endNum
"
type
=
"
number
"
placeholder
=
""
class
=
"
w-100
"
><
/el-input
>
/
<
selector
:
disabled
=
"
index > 0
"
@
input
=
"
syncAllUnit
"
v
-
model
=
"
item.weightUnit
"
:
options
=
"
unitList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
class
=
"
w-100
"
/>
<
/el-form-item
>
<
el
-
form
-
item
:
label
=
"
$t('默认运费')
"
v
-
if
=
"
form.priceType != 1
"
:
prop
=
"
`priceStepList.${index
}
.transportPrice`
"
:
rules
=
"
{validator: priceValidator, trigger: 'blur', message: '价格错误'
}
"
>
<
inputor
default2
=
"
0
"
v
-
model
.
number
=
"
item.transportPrice
"
type
=
"
number
"
:
placeholder
=
"
$t('整数或者两位小数')
"
class
=
"
w-100 mr-10
"
/>
<
selector
:
disabled
=
"
index > 0
"
@
input
=
"
syncAllUnit
"
v
-
model
=
"
item.transportPriceUnit
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
class
=
"
w-100
"
/>
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.transportVolumeUnit" :options="unitList" :label-field="$l
(
null, 'title'
)
" value-field="id" class="w-100" /
>
<
/el-form-item
>
<
el
-
form
-
item
:
label
=
"
$t('默认清关费')
"
v
-
if
=
"
form.priceType != 1 && type != 'air'
"
:
prop
=
"
`priceStepList.${index
}
.transportPrice`
"
:
rules
=
"
{validator: priceValidator, trigger: 'blur', message: '价格错误'
}
"
>
<
inputor
default2
=
"
0
"
v
-
model
.
number
=
"
item.clearancePrice
"
type
=
"
number
"
:
placeholder
=
"
$t('整数或者两位小数')
"
class
=
"
w-100 mr-10
"
:
rules
=
"
{validator: priceValidator, trigger: 'blur', message: '价格错误'
}
"
/>
<
selector
:
disabled
=
"
index > 0
"
@
input
=
"
syncAllUnit
"
v
-
model
=
"
item.clearancePriceUnit
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
class
=
"
w-100
"
/>
/ <selector disabled @input="syncAllUnit" v-model="item.clearanceVolumeUnit" :options="unitList" :label-field="$l
(
null, 'title'
)
" value-field="id" class="w-100" /
>
<
/el-form-item
>
<
el
-
form
-
item
:
label
=
"
$t('默认全包价')
"
v
-
if
=
"
form.priceType == 1
"
:
prop
=
"
`priceStepList.${index
}
.allPrice`
"
:
rules
=
"
{validator: priceValidator, trigger: 'blur', message: '价格错误'
}
"
>
<
selector
:
disabled
=
"
index > 0
"
@
input
=
"
syncAllUnit
"
v
-
model
=
"
item.allPriceUnit
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
class
=
"
w-100
"
/>
<
inputor
default2
=
"
0
"
v
-
model
.
number
=
"
item.allPrice
"
type
=
"
number
"
:
placeholder
=
"
$t('整数或者两位小数')
"
class
=
"
w-100 ml-10
"
:
rules
=
"
{validator: priceValidator, trigger: 'blur', message: '价格错误'
}
"
/>
/ <selector :disabled="index > 0" @input="syncAllUnit" v-model="item.allVolumeUnit" :options="unitList" :label-field="$l
(
null, 'title'
)
" value-field="id" class="w-100" /
>
<
/el-form-item
>
<
/div
>
<
/template
>
<
template
v
-
else
>
<
el
-
form
-
item
:
label
=
"
$t('默认全包价')
"
v
-
if
=
"
form.priceType == 1
"
prop
=
"
allPrice
"
:
rules
=
"
{validator: priceValidator, trigger: 'blur', message: '价格错误'
}
"
>
<
selector
test
=
"
allPriceUnit
"
v
-
model
=
"
form.allPriceUnit
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l('title')
"
value
-
field
=
"
id
"
class
=
"
w-100 mr-10 aaa
"
/>
<
inputor
default2
=
"
0
"
v
-
model
.
number
=
"
form.allPrice
"
type
=
"
number
"
:
placeholder
=
"
$t('整数或者两位小数')
"
class
=
"
w-100 mr10
"
/>
<
span
class
=
"
mr-10
"
>
/</
span
>
<
selector
v
-
model
=
"
form.allVolumeUnit
"
:
options
=
"
unitList
"
:
label
-
field
=
"
$l('title')
"
value
-
field
=
"
id
"
class
=
"
w-100
"
/>
<
/el-form-item
>
<
template
v
-
else
>
<
el
-
form
-
item
:
label
=
"
$t('默认运费')
"
prop
=
"
transportPrice
"
:
rules
=
"
{validator: priceValidator, trigger: 'blur', message: '价格错误'
}
"
>
<
selector
v
-
model
=
"
form.transportPriceUnit
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l('title')
"
value
-
field
=
"
id
"
class
=
"
w-100 mr-10
"
/>
<
inputor
default2
=
"
0
"
v
-
model
.
number
=
"
form.transportPrice
"
type
=
"
number
"
:
placeholder
=
"
$t('整数或者两位小数')
"
class
=
"
w-100 mr-10
"
/>
<
span
class
=
"
mr-10
"
>
/</
span
>
<
selector
v
-
model
=
"
form.transportVolumeUnit
"
:
options
=
"
unitList
"
:
label
-
field
=
"
$l('title')
"
value
-
field
=
"
id
"
class
=
"
w-100
"
/>
<
/el-form-item
>
<
el
-
form
-
item
v
-
if
=
"
type != 'air'
"
:
label
=
"
$t('默认清关费')
"
prop
=
"
clearancePrice
"
:
rules
=
"
{validator: priceValidator, trigger: 'blur', message: '价格错误'
}
"
>
<
selector
v
-
model
=
"
form.clearancePriceUnit
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l('title')
"
value
-
field
=
"
id
"
class
=
"
w-100 mr-10
"
/>
<
inputor
default2
=
"
0
"
v
-
model
.
number
=
"
form.clearancePrice
"
type
=
"
number
"
:
placeholder
=
"
$t('整数或者两位小数')
"
class
=
"
w-100 mr-10
"
/>
<
span
class
=
"
mr-10
"
>
/</
span
>
<
selector
disabled
v
-
model
=
"
form.clearanceVolumeUnit
"
:
options
=
"
unitList
"
:
label
-
field
=
"
$l('title')
"
value
-
field
=
"
id
"
class
=
"
w-100
"
/>
<
/el-form-item
>
<
/template
>
<
/template
>
<!--
特需
-->
<
template
v
-
if
=
"
form.priceType==1
"
>
<
el
-
form
-
item
v
-
for
=
"
(special, specialIndex) in this.form.specialList
"
:
label
=
"
getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('全包价')
"
:
key
=
"
specialIndex + 'transport'
"
:
prop
=
"
`specialList.${specialIndex
}
`.allPrice
"
:
rules
=
"
{validator: priceValidator, trigger: 'blur', message: '价格错误'
}
"
>
<
selector
disabled
v
-
model
=
"
special.allPriceUnit
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
defaultable2
class
=
"
w-100 mr-10
"
/>
<
inputor
default2
=
"
0
"
v
-
model
.
number
=
"
special.allPrice
"
type
=
"
number
"
:
placeholder
=
"
$t('整数或者两位小数')
"
class
=
"
w-100 mr-10
"
/>
<
span
class
=
"
mr-10
"
>
/</
span
>
<
selector
disabled
v
-
model
=
"
special.allVolumeUnit
"
:
options
=
"
unitList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
defaultable2
class
=
"
w-100
"
/>
<
/el-form-item
>
<
/template
>
<
template
v
-
else
v
-
for
=
"
(special, specialIndex) in this.form.specialList
"
>
<
el
-
form
-
item
:
label
=
"
getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('运费')
"
:
key
=
"
specialIndex + 'transport'
"
:
prop
=
"
`specialList.${specialIndex
}
.transportPrice`
"
:
rules
=
"
{validator: priceValidator, trigger: 'blur', message: '价格错误'
}
"
>
<
selector
disabled
v
-
model
=
"
special.transportPriceUnit
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
defaultable2
class
=
"
w-100 mr-10
"
/>
<
inputor
default2
=
"
0
"
v
-
model
.
number
=
"
special.transportPrice
"
type
=
"
number
"
:
placeholder
=
"
$t('整数或者两位小数')
"
class
=
"
w-100 mr-10
"
/>
<
span
class
=
"
mr-10
"
>
/</
span
>
<
selector
disabled
v
-
model
=
"
special.transportVolumeUnit
"
:
options
=
"
unitList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
defaultable2
class
=
"
w-100
"
/>
<
/el-form-item
>
<
el
-
form
-
item
v
-
if
=
"
type != 'air'
"
:
label
=
"
getDictDataLabel(DICT_TYPE.ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS, special.specialDictType) + $t('清关费')
"
:
key
=
"
specialIndex + 'clearance'
"
:
prop
=
"
`specialList.${specialIndex
}
.clearancePrice`
"
:
rules
=
"
{validator: priceValidator, trigger: 'blur', message: '价格错误'
}
"
>
<
selector
disabled
v
-
model
=
"
special.clearancePriceUnit
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
defaultable2
class
=
"
w-100 mr-10
"
/>
<
inputor
default2
=
"
0
"
v
-
model
.
number
=
"
special.clearancePrice
"
type
=
"
number
"
:
placeholder
=
"
$t('整数或者两位小数')
"
class
=
"
w-100 mr-10
"
/>
<
span
class
=
"
mr-10
"
>
/</
span
>
<
selector
disabled
v
-
model
=
"
special.clearanceVolumeUnit
"
:
options
=
"
unitList
"
:
label
-
field
=
"
$l(null, 'title')
"
value
-
field
=
"
id
"
defaultable2
class
=
"
w-100
"
/>
<
/el-form-item
>
<
/template
>
<
el
-
form
-
item
:
label
=
"
$t('价格有效期')
"
>
<
el
-
date
-
picker
v
-
model
=
"
form.validateStartDate
"
value
-
format
=
"
yyyy-MM-dd HH:mm:ss
"
><
/el-date-picker
>
-
<
el
-
date
-
picker
v
-
model
=
"
form.validateEndDate
"
value
-
format
=
"
yyyy-MM-dd HH:mm:ss
"
><
/el-date-picker
>
<
/el-form-item
>
</el-col>
<!--
编辑的时候右侧显示快捷设置,查看的时候空运显示商品清关费
-->
<
el
-
col
:
span
=
"
12
"
v
-
if
=
"
!readonly
"
>
<
h2
>
{{
$t
(
'
快捷设置
'
)
}}
<
/h2
>
<
div
class
=
"
flex items-center
"
>
{{
$t
(
'
批量加价
'
)
}}
+
<
el
-
input
v
-
model
=
"
quickForm.plus
"
class
=
"
w-100 ml-10 mr-10
"
:
disabled
=
"
!!quickForm.minus
"
><
/el-input
>
<
selector
disabled
v
-
model
=
"
currencyAndUnit.currency
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l('title')
"
value
-
field
=
"
id
"
class
=
"
w-100
"
/>
/ <selector disabled v-model="currencyAndUnit.unit" :options="unitList" :label-field="$l
(
'title'
)
" value-field="id" class="w-100" /
>
<
div
class
=
"
ml-10
"
>
{{
$t
(
'
*针对所有价格加价
'
)
}}
<
/div
>
<
/div
>
<
div
class
=
"
flex items-center mt-10
"
>
{{
$t
(
'
批量减价
'
)
}}
-
<
el
-
input
v
-
model
=
"
quickForm.minus
"
class
=
"
w-100 ml-10 mr-10
"
:
disabled
=
"
!!quickForm.plus
"
><
/el-input
>
<
selector
disabled
v
-
model
=
"
currencyAndUnit.currency
"
:
options
=
"
currencyList
"
:
label
-
field
=
"
$l('title')
"
value
-
field
=
"
id
"
class
=
"
w-100
"
/>
/ <selector disabled v-model="currencyAndUnit.unit" :options="unitList" :label-field="$l
(
'title'
)
" value-field="id" class="w-100" /
>
<
div
class
=
"
ml-10
"
>
{{
$t
(
'
*针对所有价格减价
'
)
}}
<
/div
>
<
/div
>
<
div
class
=
"
mt-10
"
>
<
el
-
button
@
click
=
"
quickSet
"
type
=
"
primary
"
:
disabled
=
"
!quickForm.plus && !quickForm.minus
"
>
{{
$t
(
'
确定
'
)
}}
<
/el-button
>
<
/div
>
<el-col
:span=
"12"
>
<quick-set
:value=
"form"
type=
"sea"
:unit-list=
"unitList"
:currency-list=
"currencyList"
></quick-set>
</el-col>
<!--
甲方要求不显示清关费
https
:
//zentao.test.jdshangmen.com/bug-view-5298.html
-->
<!--
<
el
-
col
:
span
=
"
12
"
v
-
else
-
if
=
"
readonly && type === 'air'
"
>
&
lt
;
!&
ndash
;
商品清关费
&
ndash
;
&
gt
;
<
h2
>
{{
$t
(
'
商品清关费价格
'
)
}}
<
/h2
>
<
packaging
-
type
v
-
if
=
"
product && product.priceStepClearanceList && product.priceStepClearanceList.length
"
:
value
=
"
product
"
key
-
arr
=
"
priceStepClearanceList
"
readonly
/>
<
div
v
-
else
>
{{
$t
(
'
未设置清关费
'
)
}}
<
/div
>
<
/el-col>--
>
</el-row>
<!--如果是阶梯价-->
<
template
v-if=
"form.stepPrice"
>
<!--全包价-->
<template
v-if=
"form.priceType==1"
>
<div
v-for=
"(item, index) in form.fullPriceStepList"
:key=
"index"
>
<price-step
ref=
"stepPrice"
:index=
"index"
:currency-list=
"currencyList"
:unit-list=
"unitList"
field-prefix=
"all"
:price-name=
"$t('全包价')"
:show-add=
"index === form.fullPriceStepList.length -1 && !readonly"
:value=
"item"
:readonly=
"readonly"
@
add=
"handleAddPrice('fullPriceStepList', $event)"
@
delete=
"handleDeletePrice('fullPriceStepList', $event)"
@
changeUnit=
"handleUnitChange(form.fullPriceStepList, index, ...$event)"
></price-step>
</div>
</
template
>
<el-row
v-else
:gutter=
"20"
class=
"mt-20"
>
<el-col
:span=
"12"
>
<div
v-for=
"(item, index) in form.freightPriceStepList"
:key=
"index"
>
<price-step
ref=
"stepPrice"
:index=
"index"
:currency-list=
"currencyList"
:unit-list=
"unitList"
field-prefix=
"transport"
:price-name=
"$t('运费')"
:show-add=
"index === form.freightPriceStepList.length -1 && !readonly"
:value=
"item"
:readonly=
"readonly"
@
add=
"handleAddPrice('freightPriceStepList', $event)"
@
delete=
"handleDeletePrice('freightPriceStepList', $event)"
@
changeUnit=
"handleUnitChange(form.freightPriceStepList, index, ...$event)"
></price-step>
</div>
</el-col>
<el-col
:span=
"12"
>
<div
v-for=
"(item, index) in form.clearancePriceStepList"
:key=
"index"
>
<price-step
ref=
"stepPrice"
:index=
"index"
:currency-list=
"currencyList"
:unit-list=
"unitList"
field-prefix=
"clearance"
:price-name=
"$t('清关费')"
:show-add=
"index === form.clearancePriceStepList.length -1 && !readonly"
:value=
"item"
:readonly=
"readonly"
@
add=
"handleAddPrice('clearancePriceStepList', $event)"
@
delete=
"handleDeletePrice('clearancePriceStepList', $event)"
@
changeUnit=
"handleUnitChange(form.clearancePriceStepList, index, ...$event)"
></price-step>
</div>
</el-col>
</el-row>
</template>
<
template
v-else
>
<sea-price
ref=
"seaPrice"
:price-type=
"form.priceType"
:currency-list=
"currencyList"
:unit-list=
"unitList"
:value=
"form"
:readonly=
"readonly"
@
changeUnit=
"handleFormUnitChange($event)"
></sea-price>
</
template
>
<el-form-item
:label=
"$t('价格有效期')"
>
<el-date-picker
v-model=
"form.validateStartDate"
value-format=
"yyyy-MM-dd HH:mm:ss"
></el-date-picker>
-
<el-date-picker
v-model=
"form.validateEndDate"
value-format=
"yyyy-MM-dd HH:mm:ss"
></el-date-picker>
</el-form-item>
</el-card>
...
...
@@ -271,6 +209,7 @@
<el-form-item
:label=
"$t('是否单询')"
prop=
"inquiry"
>
<dict-selector
:type=
"DICT_TYPE.NEED_ORDER_INQUIRY"
v-model=
"form.needOrderInquiry"
form-type=
"radio"
formatter=
"number"
></dict-selector>
</el-form-item>
</el-card>
</el-form>
...
...
@@ -287,86 +226,10 @@
<div
style=
"margin: 20px 0"
>
<el-button
@
click=
"submitForm"
type=
"primary"
v-if=
"!readonly"
:loading=
"loading"
>
{{$t('确认提交')}}
</el-button>
<el-button
type=
"default"
@
click=
"$router.back()"
>
{{$t('返回上一页')}}
</el-button>
<
el
-
button
@
click
=
"
showLogs
Dialog=true
"
type
=
"
primary
"
v
-
if
=
"
readonly
"
>
{{
$t
(
'
查看价格日志
'
)
}}
<
/el-button
>
<el-button
@
click=
"showLogs"
type=
"primary"
v-if=
"readonly"
>
{{$t('查看价格日志')}}
</el-button>
</div>
<
el
-
dialog
:
title
=
"
$t('查看价格日志')
"
:
visible
=
"
showLogsDialog
"
:
before
-
close
=
"
closeLogsDialog
"
width
=
"
1000px
"
>
<
el
-
table
:
data
=
"
logs
"
>
<
el
-
table
-
column
:
label
=
"
$t('序号')
"
type
=
"
index
"
><
/el-table-column
>
<
el
-
table
-
column
:
label
=
"
$t('修改人')
"
prop
=
"
creatorName
"
width
=
"
200px
"
><
/el-table-column
>
<
el
-
table
-
column
:
label
=
"
$t('修改时间')
"
>
<
template
slot
-
scope
=
"
{row
}
"
>
{{
row
.
createTime
|
parseTime
}}
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
:
label
=
"
$t('修改前')
"
>
<
template
slot
-
scope
=
"
{row
}
"
>
<
div
>
{{
$t
(
'
预付
'
)
}}
:
<
dict
-
tag
:
type
=
"
DICT_TYPE.ECW_PAY_ADVANCE
"
:
value
=
"
row.detail.needPay
"
/><
/div
>
<
div
>
{{
$t
(
'
单价模式
'
)
}}
:
<
dict
-
tag
:
type
=
"
DICT_TYPE.ECW_PRICE_TYPE
"
:
value
=
"
row.detail.priceType
"
/><
/div
>
<
div
v
-
if
=
"
row.detail.minWeight
"
>
{{
$t
(
'
最小起计量
'
)
}}
:
{{
row
.
detail
.
minWeight
}}
{{
unitMap
[
row
.
detail
.
minWeightUnit
]
}}
<
/div
>
<!--
--
阶梯定价
-->
<
template
v
-
if
=
"
row.detail.stepPrice == 1
"
>
<
template
v
-
for
=
"
(item, index) in row.detail.priceStepList
"
>
<
div
class
=
"
mt-10
"
>
第
{{
index
+
1
}}
阶段
{{
item
.
startNum
}}
-
{{
item
.
endNum
}}
{{
unitMap
[
item
.
weightUnit
]
}}
<
/div
>
<
template
v
-
if
=
"
row.detail.priceType != 1
"
>
<
div
:
key
=
"
index + '_freight'
"
class
=
"
pl-10
"
>
运费:
{{
item
.
transportPrice
}}
{{
currencyMap
[
item
.
transportPriceUnit
]
}}
/
{{
unitMap
[
item
.
transportVolumeUnit
]
}}
<
/div
>
<!--
空运没有清关费,
不需要显示
-->
<
div
v
-
if
=
"
type != 'air'
"
:
key
=
"
item.specialDictType + '_clearance'
"
class
=
"
pl-10
"
>
清关费:
{{
item
.
clearancePrice
}}
{{
currencyMap
[
item
.
clearancePriceUnit
]
}}
/
{{
unitMap
[
item
.
clearanceVolumeUnit
]
}}
<
/div
>
<
/template
>
<
div
v
-
else
class
=
"
pl-10
"
>
全包价:
{{
item
.
allPrice
}}
{{
currencyMap
[
item
.
allPriceUnit
]
}}
/
{{
unitMap
[
item
.
allVolumeUnit
]
}}
<
/div
>
<
/template
>
<
/template
>
<
template
v
-
else
>
<
template
v
-
if
=
"
row.detail.priceType != 1
"
>
<
div
>
默认运费:
{{
row
.
detail
.
transportPrice
}}
{{
currencyMap
[
row
.
detail
.
transportPriceUnit
]
}}
/
{{
unitMap
[
row
.
detail
.
transportVolumeUnit
]
}}
<
/div
>
<
div
>
默认清关费:
{{
row
.
detail
.
clearancePrice
}}
{{
currencyMap
[
row
.
detail
.
clearancePriceUnit
]
}}
/
{{
unitMap
[
row
.
detail
.
clearanceVolumeUnit
]
}}
<
/div
>
<
/template
>
<
div
v
-
else
>
全包价:
{{
row
.
detail
.
allPrice
}}
{{
currencyMap
[
row
.
detail
.
allPriceUnit
]
}}
/
{{
unitMap
[
row
.
detail
.
allVolumeUnit
]
}}
<
/div
>
<
template
v
-
for
=
"
(item, index) in row.detail.specialList
"
>
<
template
v
-
if
=
"
row.detail.priceType != 1
"
>
<
div
:
key
=
"
item.specialDictType + '_freight'
"
>
{{
getDictDataLabel
(
DICT_TYPE
.
ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS
,
item
.
specialDictType
)
}}
运费:
{{
item
.
transportPrice
}}
{{
currencyMap
[
item
.
transportPriceUnit
]
}}
/
{{
unitMap
[
item
.
transportVolumeUnit
]
}}
<
/div
>
<
div
:
key
=
"
item.specialDictType + '_clearance'
"
>
{{
getDictDataLabel
(
DICT_TYPE
.
ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS
,
item
.
specialDictType
)
}}
清关费:
{{
item
.
clearancePrice
}}
{{
currencyMap
[
item
.
clearancePriceUnit
]
}}
/
{{
unitMap
[
item
.
clearanceVolumeUnit
]
}}
<
/div
>
<
/template
>
<
div
v
-
else
>
{{
getDictDataLabel
(
DICT_TYPE
.
ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS
,
item
.
specialDictType
)
}}
全包价:
{{
item
.
allPrice
}}
{{
currencyMap
[
item
.
allPriceUnit
]
}}
/
{{
unitMap
[
item
.
allVolumeUnit
]
}}
<
/div
>
<
/template
>
<
/template
>
<
div
v
-
if
=
"
row.detail.validateStartDate || row.detail.validateStartDate
"
>
有效期
:{{
row
.
detail
.
validateStartDate
|
parseTime
}}
-
{{
row
.
detail
.
validateEndDate
|
parseTime
}}
<
/div
>
<
/template
>
<
/el-table-column
>
<
/el-table
>
<
/el-dialog
>
<logs
ref=
"logs"
></logs>
</div>
</template>
<
script
>
...
...
@@ -385,8 +248,22 @@ import Decimal from "decimal.js";
import
{
getChannel
}
from
"
@/api/ecw/channel
"
;
import
PackagingType
from
"
@/views/ecw/channel/componrnts/packaging-type.vue
"
;
import
{
getStatusName
}
from
'
./util
'
import
QuickSet
from
"
./components/QuickSet.vue
"
import
Logs
from
"
@/views/ecw/productPrice/components/Logs.vue
"
;
import
SeaStep
from
"
@/views/ecw/productPrice/components/SeaStep.vue
"
;
import
Template
from
"
@/views/cms/template/index.vue
"
;
import
SeaPrice
from
"
@/views/ecw/productPrice/components/SeaPrice.vue
"
;
import
PriceStep
from
"
@/views/ecw/productPrice/components/PriceStep.vue
"
;
const
DEFAULT_PRICE_UNIT
=
1
const
DEFAULT_VOLUME_UNIT
=
7
const
DEFAULT_WEIGHT_UNIT
=
7
export
default
{
components
:
{
PackagingType
,
RoutersSelector
,
ProductSelector
,
Selector
,
Inputor
}
,
components
:
{
PriceStep
,
SeaPrice
,
Template
,
Logs
,
QuickSet
,
PackagingType
,
RoutersSelector
,
ProductSelector
,
Selector
,
Inputor
,
SeaStep
},
filters
:
{
parseTime
},
data
()
{
return
{
...
...
@@ -401,9 +278,6 @@ export default {
},
needPay
:
false
,
// 是否需要预付
stepPrice
:
false
,
// 是否阶梯订单
// specialProducts: [],
// priceStepList: [
{
}
,{
}
],
// 阶梯价格
// specialList:[], // 特殊需求,默认四个
rules
:
{
transportPrice
:
[{
required
:
true
,
message
:
this
.
$t
(
"
海运费不能为空
"
),
trigger
:
"
blur
"
}],
clearancePrice
:
[{
required
:
true
,
message
:
this
.
$t
(
"
清关费不能为空
"
),
trigger
:
"
blur
"
}],
...
...
@@ -418,10 +292,6 @@ export default {
readonly
:
false
,
lineList
:
[],
//路线数组
loading
:
false
,
showLogsDialog
:
false
,
// 显示价格日志弹层
logs
:
[],
// 批量加价/减价
quickForm
:{
}
,
// 快速加价/减价表单
// 渠道信息
channel
:
null
}
...
...
@@ -470,11 +340,6 @@ export default {
},
watch
:
{
showLogsDialog
(
showLogsDialog
){
if
(
showLogsDialog
){
this
.
laodLogs
()
}
}
,
checkList
()
{
//选择路线
if
(
this
.
checkList
.
length
>
0
)
{
this
.
form
.
lineChannelList
=
this
.
checkList
.
map
(
item
=>
{
...
...
@@ -498,58 +363,19 @@ export default {
}
},
form
(
val
)
{
if
(
!
val
)
return
// 特殊需求回显
if
(
val
.
specialList
)
{
val
.
specialList
.
forEach
(
item
=>
{
let
index
=
this
.
form
.
specialList
.
findIndex
(
special
=>
special
.
specialDictType
==
item
.
specialDictType
)
if
(
index
>
-
1
)
this
.
form
.
specialList
[
index
]
=
item
}
)
}
}
,
'
form.priceType
'
(
priceType
){
// 切换全包价的时候给默认货币单位,如果是回填则不需要给默认值
if
(
priceType
==
1
&&
!
this
.
form
.
allPrice
){
this
.
$set
(
this
.
form
,
'
allPriceUnit
'
,
1
)
}
this
.
syncAllUnit
(
'
watch:form.priceType
'
)
}
,
'
form.minWeightUnit
'
(
minWeightUnit
){
console
.
log
(
'
最小起计量单位
'
,
minWeightUnit
)
}
,
'
form.transportVolumeUnit
'
(
transportVolumeUnit
){
// 最小其计量
this
.
$set
(
this
.
form
,
'
minWeightUnit
'
,
transportVolumeUnit
)
this
.
syncSpecialUnit
({
transportVolumeUnit
}
)
this
.
form
.
clearanceVolumeUnit
=
transportVolumeUnit
// 清关费体积单位同步运费体积单位
}
,
'
form.clearanceVolumeUnit
'
(
clearanceVolumeUnit
){
this
.
syncSpecialUnit
({
clearanceVolumeUnit
}
)
}
,
'
form.transportPriceUnit
'
(
transportPriceUnit
){
this
.
syncSpecialUnit
({
transportPriceUnit
}
)
}
,
'
form.clearancePriceUnit
'
(
clearancePriceUnit
){
this
.
syncSpecialUnit
({
clearancePriceUnit
}
)
}
,
'
form.allPriceUnit
'
(
allPriceUnit
){
this
.
syncSpecialUnit
({
allPriceUnit
}
)
}
,
'
form.allVolumeUnit
'
(
allVolumeUnit
){
// 最小起计量
this
.
$set
(
this
.
form
,
'
minWeightUnit
'
,
allVolumeUnit
)
this
.
syncSpecialUnit
({
allVolumeUnit
}
)
}
,
'
form.needBook
'
(
val
){
if
(
val
)
this
.
$set
(
this
.
form
,
'
dayLimit
'
,
10000
)
else
delete
this
.
form
.
dayLimit
},
'
form.priceType
'
(
priceType
){
if
(
this
.
form
.
stepPrice
===
1
){
this
.
initStepPrice
()
}
},
'
form.stepPrice
'
(
stepPrice
){
if
(
stepPrice
==
1
&&
(
!
this
.
form
.
priceStepList
||
!
this
.
form
.
priceStepList
.
length
)
){
this
.
$set
(
this
.
form
,
'
priceStepList
'
,
[{
}
,{
}
]
)
if
(
this
.
form
.
stepPrice
===
1
){
this
.
initStepPrice
(
)
}
this
.
syncAllUnit
(
'
watch:form.stepPrice
'
)
this
.
stepPrice
=
!!
stepPrice
},
needPay
(
val
){
...
...
@@ -558,29 +384,15 @@ export default {
stepPrice
(
val
){
this
.
$set
(
this
.
form
,
'
stepPrice
'
,
val
?
1
:
0
)
},
selectedRoutes
(
routers
)
{
let
transportIds
=
[]
routers
.
forEach
(
item
=>
{
item
.
shippingChannelId
=
item
.
channelId
transportIds
.
push
(
+
item
.
transportId
)
}
)
// 如果只选择了空运(3),则默认体积单位改成千克
transportIds
=
new
Set
(
transportIds
)
console
.
log
(
transportIds
)
window
.
transportIds
=
transportIds
if
(
transportIds
.
size
==
1
&&
transportIds
.
has
(
3
)){
this
.
setDefaultVolumeUnit
(
6
)
}
else
this
.
setDefaultVolumeUnit
(
7
)
}
},
async
created
()
{
this
.
currencyList
=
(
await
getCurrencyList
())?.
data
||
[]
this
.
unitList
=
(
await
getUnitList
())?.
data
||
[]
this
.
productTypeList
=
(
await
getProductTypeList
())?.
data
||
[]
if
(
this
.
$route
.
query
.
readonly
){
this
.
readonly
=
true
}
if
(
this
.
type
==
'
air
'
){
this
.
stepPrice
=
true
}
const
defaultVolumeUnit
=
this
.
type
===
'
air
'
?
6
:
7
const
defaultPriceUnit
=
1
...
...
@@ -605,20 +417,6 @@ export default {
}
this
.
lineList
=
[
res
.
data
]
// 如果是阶梯价格,但是一个阶梯价都没有(异常数据),则默认给两个阶梯价
if
(
this
.
form
.
stepPrice
==
1
&&
(
!
this
.
form
.
priceStepList
||
!
this
.
form
.
priceStepList
.
length
)){
const
defaultStep
=
this
.
form
.
priceType
==
1
?
{
allPriceUnit
:
defaultPriceUnit
,
allVolumeUnit
:
defaultVolumeUnit
,
weightUnit
:
defaultVolumeUnit
}
:
{
transportVolumeUnit
:
defaultVolumeUnit
,
transportPriceUnit
:
defaultPriceUnit
,
weightUnit
:
defaultVolumeUnit
}
console
.
log
(
'
阶梯价没有阶梯信息,默认给两个
'
,
{...
defaultStep
}
)
this
.
$set
(
this
.
form
,
'
priceStepList
'
,
[{...
defaultStep
}
,{...
defaultStep
}
])
}
}
// action=batchUpdate且ids不为空
...
...
@@ -694,12 +492,6 @@ export default {
if
(
!
this
.
$route
.
query
.
action
||
this
.
$route
.
query
.
action
==
'
batchUpdate
'
){
this
.
$nextTick
(()
=>
{
// 默认体积单位,空运为千克,海运为立方米
console
.
log
(
'
指定默认单位
'
,
this
.
type
===
'
air
'
?
6
:
7
)
this
.
setDefaultVolumeUnit
(
this
.
type
===
'
air
'
?
6
:
7
)
// 默认货币单位(美元)
this
.
setDefaultPriceUnit
(
1
)
// 空运默认的阶梯重量单位是千克
if
(
this
.
type
===
'
air
'
){
this
.
$set
(
this
.
form
.
priceStepList
[
0
],
'
weightUnit
'
,
6
)
...
...
@@ -714,16 +506,6 @@ export default {
this
.
$set
(
this
.
form
,
'
productId
'
,
+
this
.
$route
.
query
.
product_id
)
}
// 显示渠道(修改或者从异常处理等进入携带了渠道参数)
if
(
this
.
form
.
shippingChannelId
&&
this
.
type
==
'
air
'
){
getChannel
(
this
.
form
.
shippingChannelId
).
then
(
res
=>
{
this
.
channel
=
res
.
data
}
)
}
getCurrencyList
().
then
(
res
=>
this
.
currencyList
=
res
.
data
)
getUnitList
().
then
(
res
=>
this
.
unitList
=
res
.
data
)
this
.
getDictDatas
(
this
.
DICT_TYPE
.
ECW_SPECIAL_REQ_FOR_LINE_PRODUCTS
).
forEach
(
item
=>
{
if
(
!
this
.
form
.
specialList
.
find
(
special
=>
special
.
specialDictType
==
item
.
value
)){
this
.
form
.
specialList
.
push
({
...
...
@@ -739,75 +521,100 @@ export default {
})
},
methods
:
{
// 同步全部单位
syncAllUnit
(
from
){
let
obj
=
this
.
form
.
stepPrice
==
1
?
this
.
form
.
priceStepList
[
0
]
:
this
.
form
let
fields
=
{
}
// 全包价
if
(
this
.
form
.
priceType
==
1
){
fields
=
{
allPriceUnit
:
obj
[
'
allPriceUnit
'
],
allVolumeUnit
:
obj
[
'
allVolumeUnit
'
]
}
}
else
{
fields
=
{
transportPriceUnit
:
obj
.
transportPriceUnit
,
transportVolumeUnit
:
obj
.
transportVolumeUnit
,
clearancePriceUnit
:
obj
.
clearancePriceUnit
,
clearanceVolumeUnit
:
obj
.
transportVolumeUnit
,
// 清关费和运费的体积单位同步
}
handleAddPrice
(
field
,
fieldPrefix
){
if
(
!
this
.
form
[
field
]){
this
.
$set
(
this
.
form
,
field
,
[])
}
// 阶梯价还需要同步阶梯的重量单位
if
(
this
.
form
.
stepPrice
==
1
){
fields
[
'
weightUnit
'
]
=
obj
.
weightUnit
let
priceUnit
=
DEFAULT_PRICE_UNIT
let
volumeUnit
=
DEFAULT_VOLUME_UNIT
let
weightUnit
=
DEFAULT_WEIGHT_UNIT
if
(
this
.
form
[
field
].
length
){
const
first
=
this
.
form
[
field
][
0
]
priceUnit
=
first
[
`
${
fieldPrefix
}
PriceUnit`
]
volumeUnit
=
first
[
`
${
fieldPrefix
}
VolumeUnit`
]
weightUnit
=
first
.
weightUnit
}
console
.
log
(
'
-> 同步特需单位
'
,
fields
,
{
from
}
)
this
.
syncSpecialUnit
(
fields
)
}
,
// 同步特需的货币单位和体积单位
syncSpecialUnit
(
obj
){
console
.
log
(
'
syncSpecialUnit
'
,
obj
)
if
(
!
obj
)
return
// 同步特需单位
this
.
form
.
specialList
.
forEach
(
item
=>
{
Object
.
assign
(
item
,
obj
)
console
.
log
(
"
添加价格的默认单位
"
,
{
priceUnit
,
volumeUnit
,
weightUnit
})
this
.
form
[
field
].
push
({
[
`
${
fieldPrefix
}
PriceUnit`
]:
priceUnit
,
[
`
${
fieldPrefix
}
VolumeUnit`
]:
volumeUnit
,
weightUnit
:
weightUnit
,
specialList
:[]
})
},
handleDeletePrice
(
field
,
index
){
this
.
form
[
field
].
splice
(
index
,
1
)
},
handleUnitChange
(
stepPriceList
,
index
,
data
){
console
.
log
(
'
handleUnitChange
'
,
...
arguments
)
if
(
index
>
0
)
return
// 如果是阶梯价则需要同步其他阶梯
if
(
this
.
form
.
stepPrice
==
1
&&
this
.
form
.
priceStepList
){
this
.
form
.
priceStepList
.
forEach
((
item
,
index
)
=>
{
this
.
$set
(
this
.
form
.
priceStepList
,
index
,
Object
.
assign
(
item
,
obj
))
}
)
// 如果是重量单位,且不是清关费想换的,则需要同步最小起计量单位
if
(
data
.
field
===
'
weightUnit
'
&&
data
.
type
!=
'
clearance
'
){
this
.
form
.
minWeightUnit
=
data
.
value
}
stepPriceList
.
forEach
(
item
=>
{
item
[
data
.
field
]
=
data
.
value
if
(
item
.
packagingList
?.
length
){
item
.
packagingList
.
forEach
(
p
=>
{
if
(
data
.
field
.
indexOf
(
"
PriceUnit
"
)
>
-
1
){
p
[
'
packagingPriceUnit
'
]
=
data
.
value
}
if
(
data
.
field
.
indexOf
(
"
VolumeUnit
"
)
>
-
1
){
p
[
'
packagingVolumeUnit
'
]
=
data
.
value
}
})
}
if
(
item
.
specialList
?.
length
){
item
.
specialList
.
forEach
(
p
=>
{
p
[
data
.
field
]
=
data
.
value
})
}
})
},
// 不是阶梯价需要 同步最小起计量
if
(
obj
[
'
transportVolumeUnit
'
]
||
obj
[
'
allVolumeUnit
'
]){
this
.
$set
(
this
.
form
,
'
minWeightUnit
'
,
obj
[
'
transportVolumeUnit
'
]
||
obj
[
'
allVolumeUnit
'
])
}
// 获得用语提交的阶梯价副本
getPriceList
(
stepList
){
if
(
!
stepList
?.
length
)
return
[]
let
stepPriceList
=
JSON
.
parse
(
JSON
.
stringify
(
stepList
))
stepPriceList
.
forEach
((
item
,
index
)
=>
{
item
.
rankNum
=
index
+
1
item
.
packagingList
=
item
.
packagingList
.
filter
(
p
=>
!!
p
.
packagingTypes
?.
length
)
item
.
packagingList
=
item
.
packagingList
.
map
(
p
=>
{
p
.
packagingTypes
=
p
.
packagingTypes
.
join
(
"
,
"
)
return
p
})
})
return
stepPriceList
},
priceValidator
(
rule
,
value
,
callback
){
if
(
!
value
||
value
==
''
)
return
callback
()
value
=
parseFloat
(
value
)
if
(
!
value
||
value
<
0
){
return
callback
(
new
Error
(
'
价格错误
'
))
// 非阶梯价格更新单位
handleFormUnitChange
(
data
){
if
(
this
.
form
.
specialList
?.
length
){
this
.
form
.
specialList
.
forEach
(
p
=>
{
p
[
data
.
field
]
=
data
.
value
})
}
callback
()
},
setDefaultVolumeUnit
(
unit
){
console
.
log
(
'
设置默认体积单位
'
,
unit
)
this
.
$set
(
this
.
form
,
'
transportVolumeUnit
'
,
unit
)
this
.
$set
(
this
.
form
,
'
clearanceVolumeUnit
'
,
unit
)
this
.
$set
(
this
.
form
,
'
allVolumeUnit
'
,
unit
)
}
,
setDefaultPriceUnit
(
priceUnit
){
console
.
log
(
'
设置默认价格单位
'
,
priceUnit
)
this
.
$set
(
this
.
form
,
'
transportPriceUnit
'
,
priceUnit
)
this
.
$set
(
this
.
form
,
'
clearancePriceUnit
'
,
priceUnit
)
this
.
$set
(
this
.
form
,
'
allPriceUnit
'
,
priceUnit
)
initStepPrice
(){
if
(
this
.
form
.
priceType
==
1
&&
!
this
.
form
.
fullPriceStepList
?.
length
){
this
.
handleAddPrice
(
"
fullPriceStepList
"
,
'
all
'
)
}
if
(
this
.
form
.
priceType
===
0
){
if
(
!
this
.
form
.
freightPriceStepList
?.
length
){
this
.
handleAddPrice
(
'
freightPriceStepList
'
,
'
transport
'
)
}
if
(
!
this
.
form
.
clearancePriceStepList
?.
length
){
this
.
handleAddPrice
(
'
clearancePriceStepList
'
,
'
clearance
'
)
}
}
},
// force 为是否强制提交,在价格过期的时候需要确认后强制提交
submitForm
(
force
=
false
)
{
console
.
log
(
"
this.$refs[
\"
form
\"
]
"
,
this
.
$refs
[
"
form
"
])
this
.
$refs
[
"
form
"
].
validate
(
async
(
valid
)
=>
{
if
(
!
valid
)
{
return
;
...
...
@@ -827,39 +634,27 @@ export default {
// specialList: this.specialProducts,
isAllProduct
:
0
})
if
(
this
.
form
.
stepPrice
!=
1
){
// data.priceStepList = this.priceStepList
delete
data
.
priceStepList
// 非阶梯价格判断是否运费(全包价是否为空)
if
((
this
.
form
.
priceType
==
0
&&
!
this
.
form
.
transportPrice
)
||
(
this
.
form
.
priceType
==
1
&&
!
this
.
form
.
allPrice
)){
return
this
.
$message
.
error
(
this
.
$t
(
'
运费/全包价不能为0
'
))
}
}
else
{
// 全包价 的阶段 设置和运费(全包价)不能为空
let
stepPriceEmpty
=
[]
this
.
form
.
priceStepList
.
forEach
((
item
,
index
)
=>
{
let
notEmptyFields
=
[
'
endNum
'
,
'
weightUnit
'
]
// 第一条阶梯的起始值可以是0,其他的不能为0
if
(
index
){
notEmptyFields
.
push
(
'
startNum
'
)
if
(
this
.
$refs
.
stepPrice
){
let
isValid
=
true
for
(
let
stepPrice
of
this
.
$refs
.
stepPrice
){
if
(
!
stepPrice
.
validate
()){
isValid
=
false
break
}
notEmptyFields
.
forEach
(
field
=>
{
// 第一个阶梯的起始值不判断0
if
(
index
===
0
&&
field
==
'
startNum
'
&&
item
[
field
]
==
0
)
return
if
(
!
item
[
field
]
||
item
[
field
].
toString
().
trim
()
==
''
){
stepPriceEmpty
.
push
({
index
,
field
}
)
}
}
)
if
((
this
.
form
.
priceType
==
0
&&
!
item
.
transportPrice
)
||
(
this
.
form
.
priceType
==
1
&&
!
item
.
allPrice
)){
stepPriceEmpty
.
push
({
index
,
field
:
!
item
.
transportPrice
?
'
transportPrice
'
:
'
allPrice
'
}
)
}
}
)
if
(
stepPriceEmpty
.
length
){
console
.
log
(
'
stepPriceEmpty
'
,
stepPriceEmpty
)
return
this
.
$message
.
error
(
this
.
$t
(
'
阶梯和价格设置不能留空
'
))
}
if
(
!
isValid
)
return
}
// 全包价
if
(
this
.
form
.
priceType
==
1
)
{
data
.
fullPriceStepList
=
this
.
getPriceList
(
this
.
form
.
fullPriceStepList
)
delete
data
.
clearancePriceStepList
delete
data
.
freightPriceStepList
}
else
{
data
.
clearancePriceStepList
=
this
.
getPriceList
(
this
.
form
.
clearancePriceStepList
)
data
.
freightPriceStepList
=
this
.
getPriceList
(
this
.
form
.
freightPriceStepList
)
delete
data
.
fullPriceStepList
}
// 设置了有效期,且已过期则给提示
...
...
@@ -946,46 +741,11 @@ export default {
}).
finally
(
res
=>
this
.
loading
=
false
);
});
},
closeLogsDialog
(){
this
.
showLogsDialog
=
false
}
,
laodLogs
(){
getPriceSnapshotList
(
this
.
form
.
id
).
then
(
res
=>
{
this
.
logs
=
res
.
data
this
.
logs
.
forEach
(
item
=>
{
item
.
detail
=
JSON
.
parse
(
item
.
content
)
}
)
}
)
}
,
// 快捷设置,只更新默认运费
quickSet
(){
// 字段,根据是否全包价来取
let
field
=
this
.
form
.
priceType
==
1
?
'
allPrice
'
:
'
transportPrice
'
// 取得要加的数额(减少则是负数)
let
amount
=
Decimal
(
this
.
quickForm
.
plus
||
-
this
.
quickForm
.
minus
)
this
.
form
.
priceStepList
.
forEach
(
item
=>
{
// 加上对应的价格,但是不能小于0
this
.
$set
(
item
,
field
,
Math
.
max
(
0
,
Decimal
(
item
[
field
]
||
0
).
plus
(
amount
).
toNumber
()))
}
)
}
,
// 添加区间价
addStepPrice
(){
let
fields
=
{
}
const
obj
=
this
.
form
.
priceStepList
[
0
]
||
{
}
if
(
this
.
form
.
priceType
==
1
){
fields
=
{
allPriceUnit
:
obj
[
'
allPriceUnit
'
],
allVolumeUnit
:
obj
[
'
allVolumeUnit
'
]
}
}
else
{
fields
=
{
transportPriceUnit
:
obj
.
transportPriceUnit
,
transportVolumeUnit
:
obj
.
transportVolumeUnit
,
clearancePriceUnit
:
obj
.
clearancePriceUnit
,
clearanceVolumeUnit
:
obj
.
transportVolumeUnit
,
}
showLogs
(){
if
(
!
this
.
$refs
.
logs
){
return
this
.
$message
.
error
(
"
未找到组件
"
)
}
this
.
form
.
priceStepList
.
push
(
fields
)
this
.
$refs
.
logs
.
open
(
this
.
form
.
id
)
}
}
}
...
...
src/views/ecw/productPrice/editAir.vue
View file @
18983f23
...
...
@@ -191,7 +191,7 @@
<el-button
@
click=
"showLogs"
type=
"primary"
v-if=
"readonly"
>
{{$t('查看价格日志')}}
</el-button>
</div>
<logs
ref=
"logs"
></logs>
<logs
ref=
"logs"
:unit-map=
"unitMap"
:currency-map=
"currencyMap"
></logs>
</div>
</template>
<
script
>
...
...
@@ -235,6 +235,7 @@ export default {
checkList
:
[],
selectedRoutes
:
[],
// 勾选的路线渠道
form
:
{
weightLimit
:
0
,
minWeightUnit
:
0
,
priceStepList
:
[],
// 阶梯价格
specialList
:
[],
...
...
@@ -527,7 +528,12 @@ export default {
item
[
data
.
field
]
=
data
.
value
if
(
item
.
packagingList
?.
length
){
item
.
packagingList
.
forEach
(
p
=>
{
p
[
data
.
field
]
=
data
.
value
if
(
data
.
field
.
indexOf
(
"
PriceUnit
"
)
>
-
1
){
p
[
'
packagingPriceUnit
'
]
=
data
.
value
}
if
(
data
.
field
.
indexOf
(
"
VolumeUnit
"
)
>
-
1
){
p
[
'
packagingVolumeUnit
'
]
=
data
.
value
}
})
}
if
(
item
.
specialList
?.
length
){
...
...
@@ -579,9 +585,12 @@ export default {
// 全包价
if
(
this
.
form
.
priceType
==
1
)
{
data
.
fullPriceStepList
=
this
.
getPriceList
(
this
.
form
.
fullPriceStepList
)
delete
data
.
freightPriceStepList
delete
data
.
clearancePriceStepList
}
else
{
data
.
clearancePriceStepList
=
this
.
getPriceList
(
this
.
form
.
clearancePriceStepList
)
data
.
freightPriceStepList
=
this
.
getPriceList
(
this
.
form
.
freightPriceStepList
)
delete
data
.
fullPriceStepList
}
// 设置了有效期,且已过期则给提示
...
...
@@ -598,6 +607,9 @@ export default {
}
}
// 空运固定阶梯价
data
.
stepPrice
=
1
// 修改单条路线
if
(
this
.
$route
.
query
.
action
==
'
update
'
)
{
this
.
loading
=
true
...
...
@@ -660,30 +672,6 @@ export default {
}).
finally
(
res
=>
this
.
loading
=
false
);
});
},
// 快捷设置,只更新默认运费
quickSet
(
data
){
// 字段,根据是否全包价来取
let
field
=
this
.
form
.
priceType
==
1
?
'
allPrice
'
:
'
transportPrice
'
// 取得要加的数额(减少则是负数)
let
amount
=
Decimal
(
data
.
plus
||
-
data
.
minus
)
this
.
form
.
priceStepList
.
forEach
(
item
=>
{
// 加上对应的价格,但是不能小于0
this
.
$set
(
item
,
field
,
Math
.
max
(
0
,
Decimal
(
item
[
field
]
||
0
).
plus
(
amount
).
toNumber
()))
})
},
/*// 添加区间价,field是阶梯价字段,fieldPrefix是价格字段前缀
addStepPrice(field, fieldPrefix){
console.log('addPrice', field, fieldPrefix)
let fields = {}
if(!this.form[field]) this.$set(this.form, field, [])
const obj = this.form[field][0] || {}
fields[fieldPrefix + 'PriceUnit'] = obj[fieldPrefix + 'PriceUnit']
fields[fieldPrefix + 'VolumeUnit'] = obj[fieldPrefix + 'VolumeUnit']
fields[fieldPrefix + 'Price'] = obj[fieldPrefix + 'Price']
this.form[field].push(fields)
},*/
showLogs
(){
if
(
!
this
.
$refs
.
logs
){
return
this
.
$message
.
error
(
"
未找到组件
"
)
...
...
src/views/ecw/productPrice/index.vue
View file @
18983f23
...
...
@@ -167,44 +167,40 @@
<el-table-column
prop=
"price"
:label=
"$t('价格')"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<template
v-if=
"scope.row.stepPrice == 1 && scope.row.priceStepList && scope.row.priceStepList.length"
>
{{
$t
(
"
第{no
}
阶梯({start
}
~{end
}
{weightUnit
}
)
"
,
{
no
:
1
,
start
:
scope
.
row
.
priceStepList
[
0
].
startNum
,
end
:
scope
.
row
.
priceStepList
[
0
].
endNum
,
weightUnit
:
getUnitTitle
(
scope
.
row
.
priceStepList
[
0
].
weightUnit
),
}
)
}}
<
br
/>
<
div
v
-
if
=
"
scope.row.priceType == 0
"
>
{{
$t
(
'
运费
'
)
}}
:{{
getCurrencySymbol
(
scope
.
row
.
priceStepList
[
0
].
transportPriceUnit
)
+
scope
.
row
.
priceStepList
[
0
].
transportPrice
}}
&
nbsp
;
{{
getCurrencyTitle
(
scope
.
row
.
priceStepList
[
0
].
transportPriceUnit
)
+
'
/
'
+
getUnitTitle
(
scope
.
row
.
priceStepList
[
0
].
transportVolumeUnit
)
}}
<
br
/>
<
template
v
-
if
=
"
[3,4].indexOf(+scope.row.warehouseLineDO.transportType) > -1
"
>
<!--
空运的清关费
根据要求隐藏列表的空运清关费
https
:
//zentao.test.jdshangmen.com/bug-view-5298.html
-->
<!--
<
template
v
-
if
=
"
scope.row.clearPriceStepList.length
"
>
{{
$t
(
'
清关费
'
)
}}
:{{
getCurrencySymbol
(
scope
.
row
.
clearPriceStepList
[
0
].
clearancePriceUnit
)
+
scope
.
row
.
clearPriceStepList
[
0
].
clearancePrice
}}
&
nbsp
;
{{
getCurrencyTitle
(
scope
.
row
.
clearPriceStepList
[
0
].
clearancePriceUnit
)
+
'
/
'
+
getUnitTitle
(
scope
.
row
.
clearPriceStepList
[
0
].
clearanceVolumeUnit
)
}}
<
/template
>
<
template
v
-
else
>
{{
$t
(
'
暂无清关费设置
'
)
}}
<
/template>--
>
<
/template
>
<
template
v
-
else
>
<!--
海运的清关费
-->
{{
$t
(
'
清关费
'
)
}}
:{{
getCurrencySymbol
(
scope
.
row
.
priceStepList
[
0
].
clearancePriceUnit
)
+
scope
.
row
.
priceStepList
[
0
].
clearancePrice
}}
&
nbsp
;
{{
getCurrencyTitle
(
scope
.
row
.
priceStepList
[
0
].
clearancePriceUnit
)
+
'
/
'
+
getUnitTitle
(
scope
.
row
.
priceStepList
[
0
].
clearanceVolumeUnit
)
}}
<
/template
>
<
/div
>
<
div
v
-
if
=
"
scope.row.priceType == 1
"
>
{{
$t
(
'
全包价
'
)
}}
:{{
getCurrencySymbol
(
scope
.
row
.
priceStepList
[
0
].
allPriceUnit
)
+
scope
.
row
.
priceStepList
[
0
].
allPrice
}}
&
nbsp
;
{{
getCurrencyTitle
(
scope
.
row
.
priceStepList
[
0
].
allPriceUnit
)
+
'
/
'
+
getUnitTitle
(
scope
.
row
.
priceStepList
[
0
].
allVolumeUnit
)
}}
<template
v-if=
"scope.row.stepPrice == 1"
>
<!--全包价-->
<div
v-if=
"scope.row.priceType"
>
<div
v-if=
"!scope.row.fullPriceStepList || !scope.row.fullPriceStepList.length"
>
{{
$t
(
'
未设置全包价阶梯价
'
)
}}
</div>
<div
v-else
>
{{
$t
(
"
第{no
}
阶梯({start
}
~{end
}
{weightUnit
}
)
"
,
{
no
:
1
,
start
:
scope
.
row
.
fullPriceStepList
[
0
].
startNum
,
end
:
scope
.
row
.
fullPriceStepList
[
0
].
endNum
,
weightUnit
:
getUnitTitle
(
scope
.
row
.
fullPriceStepList
[
0
].
weightUnit
),
}
)
}}
<
br
/>
{{
$t
(
'
全包价
'
)
}}
:{{
getCurrencySymbol
(
scope
.
row
.
fullPriceStepList
[
0
].
allPriceUnit
)
+
scope
.
row
.
fullPriceStepList
[
0
].
allPrice
}}
&
nbsp
;
{{
getCurrencyTitle
(
scope
.
row
.
fullPriceStepList
[
0
].
allPriceUnit
)
+
'
/
'
+
getUnitTitle
(
scope
.
row
.
fullPriceStepList
[
0
].
allVolumeUnit
)
}}
<
/div
>
<
/div
>
<
template
v
-
else
>
<
div
v
-
if
=
"
!scope.row.freightPriceStepList || !scope.row.freightPriceStepList.length
"
>
{{
$t
(
'
未设置运费阶梯价
'
)
}}
<
/div
>
<
div
v
-
else
>
{{
$t
(
"
第{no
}
阶梯({start
}
~{end
}
{weightUnit
}
)
"
,
{
no
:
1
,
start
:
scope
.
row
.
freightPriceStepList
[
0
].
startNum
,
end
:
scope
.
row
.
freightPriceStepList
[
0
].
endNum
,
weightUnit
:
getUnitTitle
(
scope
.
row
.
freightPriceStepList
[
0
].
weightUnit
),
}
)
}}
<
br
/>
<
div
>
{{
$t
(
'
运费
'
)
}}
:{{
getCurrencySymbol
(
scope
.
row
.
freightPriceStepList
[
0
].
transportPriceUnit
)
+
scope
.
row
.
freightPriceStepList
[
0
].
transportPrice
}}
&
nbsp
;
{{
getCurrencyTitle
(
scope
.
row
.
freightPriceStepList
[
0
].
transportPriceUnit
)
+
'
/
'
+
getUnitTitle
(
scope
.
row
.
freightPriceStepList
[
0
].
transportVolumeUnit
)
}}
<
/div
>
<
/div
>
<
/template
>
<
el
-
button
type
=
"
text
"
@
click
=
"
showMoreStepPriceItem=scope.row
"
>
{{
$t
(
'
查看更多
'
)
}}
<
/el-button
>
<
/template
>
<
template
v
-
else
-
if
=
"
scope.row.stepPrice
"
>
{{
$t
(
'
缺少阶梯价格设置
'
)
}}
<
/template
>
<
template
v
-
else
>
<
div
v
-
if
=
"
scope.row.priceType == 0
"
>
{{
$t
(
'
运费
'
)
}}
:{{
getCurrencySymbol
(
scope
.
row
.
transportPriceUnit
)
+
scope
.
row
.
transportPrice
}}
&
nbsp
;
...
...
@@ -277,34 +273,42 @@
<
el
-
row
:
gutter
=
"
20
"
v
-
if
=
"
showMoreStepPriceItem
"
>
<
el
-
col
:
span
=
"
12
"
>
<
div
v
-
for
=
"
(item, index) in showMoreStepPriceItem.priceStepList
"
>
<
div
class
=
"
page-title
"
>
{{
$t
(
"
第{no
}
阶梯({start
}
~{end
}
{weightUnit
}
)
"
,
{
no
:
index
+
1
,
start
:
item
.
startNum
,
end
:
item
.
endNum
,
weightUnit
:
getUnitTitle
(
item
.
weightUnit
),
}
)
}}
<!--
全包价
-->
<
template
v
-
if
=
"
showMoreStepPriceItem.priceType
"
>
<
div
v
-
for
=
"
(item, index) in showMoreStepPriceItem.fullPriceStepList
"
>
<
show
-
step
-
price
-
item
:
value
=
"
item
"
:
unit
-
map
=
"
unitMap
"
:
currency
-
map
=
"
currencyMap
"
:
index
=
"
index
"
field
-
prefix
=
"
all
"
:
price
-
name
=
"
$t('全包价')
"
><
/show-step-price-item
>
<
/div
>
<
div
v
-
if
=
"
showMoreStepPriceItem.priceType == 0
"
>
{{
$t
(
'
运费
'
)
}}
:{{
getCurrencySymbol
(
item
.
transportPriceUnit
)
+
item
.
transportPrice
}}
&
nbsp
;
{{
getCurrencyTitle
(
item
.
transportPriceUnit
)
+
'
/
'
+
getUnitTitle
(
item
.
transportVolumeUnit
)
}}
<
br
/>
<
template
v
-
if
=
"
[3,4].indexOf(+showMoreStepPriceItem.warehouseLineDO.transportType) > -1
"
>
<!--
空运的清关费单独显示
-->
<
/template
>
<
template
v
-
else
>
<!--
海运的清关费
-->
{{
$t
(
'
清关费
'
)
}}
:{{
getCurrencySymbol
(
item
.
clearancePriceUnit
)
+
item
.
clearancePrice
}}
&
nbsp
;
{{
getCurrencyTitle
(
item
.
clearancePriceUnit
)
+
'
/
'
+
getUnitTitle
(
item
.
clearanceVolumeUnit
)
}}
<
/template
>
<
/div
>
<
div
v
-
if
=
"
showMoreStepPriceItem.priceType == 1
"
>
{{
$t
(
'
全包价
'
)
}}
:{{
getCurrencySymbol
(
item
.
allPriceUnit
)
+
item
.
allPrice
}}
&
nbsp
;
{{
getCurrencyTitle
(
item
.
allPriceUnit
)
+
'
/
'
+
getUnitTitle
(
item
.
allVolumeUnit
)
}}
<
/div
>
<
/div
>
<
/template
>
<
template
v
-
else
>
<
template
v
-
if
=
"
showMoreStepPriceItem.freightPriceStepList
"
>
<
div
v
-
for
=
"
(item, index) in showMoreStepPriceItem.freightPriceStepList
"
>
<
show
-
step
-
price
-
item
:
value
=
"
item
"
:
unit
-
map
=
"
unitMap
"
:
currency
-
map
=
"
currencyMap
"
:
index
=
"
index
"
field
-
prefix
=
"
transport
"
:
price
-
name
=
"
$t('运费')
"
><
/show-step-price-item
>
<
/div
>
<
/template
>
<
template
v
-
if
=
"
showMoreStepPriceItem.clearancePriceStepList
"
>
<
div
v
-
for
=
"
(item, index) in showMoreStepPriceItem.clearancePriceStepList
"
>
<
show
-
step
-
price
-
item
:
value
=
"
item
"
:
unit
-
map
=
"
unitMap
"
:
currency
-
map
=
"
currencyMap
"
:
index
=
"
index
"
field
-
prefix
=
"
clearance
"
:
price
-
name
=
"
$t('清关费')
"
><
/show-step-price-item
>
<
/div
>
<
/template
>
<
/template
>
<
/el-col
>
<!--
空运的清关费单独显示
-->
<!--
...
...
@@ -360,10 +364,12 @@ import { getProduct } from '@/api/ecw/product';
import
{
parseTime
}
from
'
@/utils/ruoyi
'
import
Template
from
"
@/views/cms/template
"
;
import
{
getStatusName
}
from
"
./util
"
;
import
ShowStepPriceItem
from
"
@/views/ecw/productPrice/components/ShowStepPriceItem.vue
"
;
export
default
{
name
:
"
EcwProductpriceIndex
"
,
filters
:
{
parseTime
}
,
components
:
{
ShowStepPriceItem
,
Template
,
DictTag
}
,
...
...
@@ -383,7 +389,7 @@ export default {
/* startCityList: [], //始发地城市
destCityList: [], //目的地城市 */
routedList
:
[],
//已开头路线列表
currecyList
:
[],
//货币列表
curre
n
cyList
:
[],
//货币列表
unitList
:
[],
//单位列表
channelList
:[]
,
// 渠道
routeParams
:{
}
,
//路线搜索条件
...
...
@@ -510,8 +516,8 @@ export default {
// 显示币种符号
getCurrencySymbol
()
{
return
currencyId
=>
{
for
(
let
index
in
this
.
currecyList
)
{
let
currecyItem
=
this
.
currecyList
[
index
];
for
(
let
index
in
this
.
curre
n
cyList
)
{
let
currecyItem
=
this
.
curre
n
cyList
[
index
];
if
(
currecyItem
.
id
==
currencyId
)
{
return
currecyItem
.
fuhao
;
}
...
...
@@ -521,8 +527,8 @@ export default {
// 显示币种名称
getCurrencyTitle
()
{
return
currencyId
=>
{
for
(
let
index
in
this
.
currecyList
)
{
let
currecyItem
=
this
.
currecyList
[
index
];
for
(
let
index
in
this
.
curre
n
cyList
)
{
let
currecyItem
=
this
.
curre
n
cyList
[
index
];
if
(
currecyItem
.
id
==
currencyId
)
{
return
this
.
$l
(
currecyItem
,
'
title
'
);
}
...
...
@@ -547,6 +553,20 @@ export default {
destCityList
(){
return
this
.
cityList
.
filter
(
item
=>
item
.
type
==
1
||
item
.
type
==
3
)
}
,
currencyMap
(){
let
map
=
{
}
this
.
currencyList
.
forEach
(
item
=>
{
map
[
item
.
id
]
=
this
.
$l
(
item
,
'
title
'
)
}
)
return
map
}
,
unitMap
(){
let
map
=
{
}
this
.
unitList
.
forEach
(
item
=>
{
map
[
item
.
id
]
=
this
.
$l
(
item
,
'
title
'
)
}
)
return
map
}
,
}
,
activated
()
{
// console.log('activated', Object.assign(
{
}
,
this
.
$route
.
query
))
...
...
@@ -691,7 +711,7 @@ export default {
/**获取所有货币列表 */
requestCurrencyList
()
{
getCurrencyList
().
then
(
response
=>
{
this
.
currecyList
=
response
.
data
;
this
.
curre
n
cyList
=
response
.
data
;
}
)
}
,
...
...
src/views/ecw/warehouse/index.vue
View file @
18983f23
...
...
@@ -137,6 +137,8 @@
<el-button
size=
"mini"
type=
"primary"
@
click=
"serviceClick(scope.row)"
v-if=
"scope.row.lineId != null"
v-hasPermi=
"['ecw:warehouse:routerQuery']"
>
{{
$t
(
'
开通服务
'
)
}}
</el-button>
<!--
<el-button
size=
"mini"
type=
"danger"
@
click=
"$router.push('/offer/channel-route?lineId='+scope.row.lineId)"
v-if=
"scope.row.lineId != null && scope.row.transportType == 3"
>
{{
$t
(
'
渠道包装清关费
'
)
}}
</el-button>
-->
</
template
>
</el-table-column>
</el-table>
...
...
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