Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
提交反馈
为 GitLab 提交贡献
登录
切换导航
P
pica.cloud.web-education-admin
项目
项目
详情
动态
版本
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Wiki
Wiki
代码片段
代码片段
成员
成员
收起侧边栏
Close sidebar
动态
分支图
统计图
创建新议题
提交
议题看板
打开侧边栏
jingqi.liu
pica.cloud.web-education-admin
提交
f1865701
提交
f1865701
编写于
8月 16, 2021
作者:
changdi.hao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
优化运费的配置
上级
338b0b66
变更
1
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
459 行增加
和
323 行删除
+459
-323
freight-config.vue
src/views/freight/freight-config.vue
+459
-323
未找到文件。
src/views/freight/freight-config.vue
浏览文件 @
f1865701
<
template
>
<div
class=
"order-detail-wrapper"
>
<bread-crumb
:curmbFirst=
"curmbFirst"
:curmbSecond=
"curmbSecond"
></bread-crumb>
<bread-crumb
:curmbFirst=
"curmbFirst"
:curmbSecond=
"curmbSecond"
></bread-crumb>
<div
class=
"order-detail-content screenSet"
id=
"screenSet"
>
<div
class=
"header-title"
>
店铺运费
</div>
<div
class=
"freight-config-content"
>
<el-form
ref=
"form"
:model=
"formData"
label-width=
"100px"
inline
>
<!-- ≤,≥,<,> -->
<el-row
class=
"title"
>
运费配置
</el-row>
<el-row
class=
"title"
>
运费配置
</el-row>
<el-row
class=
"c-row"
:style=
"
{ padding: index != 0 ? '20px' : '' }"
v-for="(item, index) in formData.list.slice(0, 1)"
:key="'first' + index"
>
<span
v-if=
"index == 0"
style=
"margin: 0 20px 0 40px
;
"
>
0
</span>
<span
v-if=
"index == 0"
style=
"margin: 0 20px 0 40px"
>
0
</span>
<el-input
v-else
disabled
...
...
@@ -30,12 +30,21 @@
<span
class=
"big"
>
订单金额
</span>
<span>
<
</span>
<el-form-item
:prop=
"`list.$
{index}.rangeMax`" :rules="bgRules">
<el-input
<
!--
<
el-input
v-model=
"item.rangeMax"
size=
"small"
style=
"width: 80px;"
placeholder=
"请输入"
></el-input>
></el-input>
-->
<el-input-number
v-model=
"item.rangeMax"
:controls=
"false"
:min=
"0.00"
:max=
"99999.99"
size=
"small"
style=
"width: 80px"
placeholder=
"请输入"
></el-input-number>
</el-form-item>
<span
class=
"small"
>
元
</span>
<span
class=
"middle"
>
运费:
</span>
...
...
@@ -51,16 +60,16 @@
</el-row>
<el-row>
<el-button
style=
"margin: 10px 20px 20px
;
"
style=
"margin: 10px 20px 20px"
size=
"small"
type=
"primary"
@
click=
"addCondition"
>
添加条件
>
添加条件
</el-button>
</el-row>
<el-row
class=
"c-row"
style=
"padding: 10px 20px
;
"
style=
"padding: 10px 20px"
v-for=
"(item, index) in formData.list.slice(1)"
:key=
"index"
>
...
...
@@ -78,7 +87,7 @@
<el-input
v-model=
"item.rangeMax"
size=
"small"
style=
"width: 80px
;
"
style=
"width: 80px"
placeholder=
"请输入"
></el-input>
</el-form-item>
...
...
@@ -88,7 +97,7 @@
<el-input
v-model=
"item.fee"
size=
"small"
style=
"width: 80px
;
"
style=
"width: 80px"
placeholder=
"请输入"
></el-input>
</el-form-item>
...
...
@@ -97,11 +106,10 @@
type=
"danger"
size=
"small"
@
click=
"deleteCondition(index + 1)"
>
删除
</el-button>
</el-row>
<el-row
class=
"title"
style=
"margin-top: 80px;"
>
提示文案
>
删除
</el-button
>
</el-row>
<el-row
class=
"title"
style=
"margin-top: 80px"
>
提示文案
</el-row>
<el-row>
<el-form-item
class=
"lh"
label=
"运费说明:"
>
<el-input
...
...
@@ -109,138 +117,236 @@
size=
"small"
maxlength=
"10"
style=
"width: 410px"
placeholder=
"请输入"
></el-input>
placeholder=
"请输入"
></el-input>
</el-form-item>
</el-row>
</el-form>
</div>
<div
class=
"header-title"
>
商品运费
</div>
<el-button
style=
"margin: 10px 20px 20px
;
"
style=
"margin: 10px 20px 20px"
size=
"small"
type=
"primary"
@
click=
"addGoodsCondition"
>
添加条件
>
添加条件
</el-button>
<el-table
:data=
"resultForm.goodConditionReqList"
@
row-click=
'handleRowClickRole'
border
class=
"item-table"
style=
"width: 100%;margin-top: 30px;"
>
<el-table-column
prop=
"goodIds"
label=
"商品ID"
min-width=
"100"
align=
"center"
>
<el-table
:data=
"resultForm.goodConditionReqList"
@
row-click=
"handleRowClickRole"
border
class=
"item-table"
style=
"width: 100%; margin-top: 30px"
>
<el-table-column
prop=
"goodIds"
label=
"商品ID"
min-width=
"100"
align=
"center"
>
<template
slot-scope=
"scope"
>
<div
v-for=
"(item, index) in scope.row.goodIds"
:key=
"index"
style=
"text-align: center;margin: 0 auto;padding: 0;"
>
<div
v-if=
"index != scope.row.goodIds.length - 1"
style=
"cursor: pointer;color: #449284;float: left;display: inline-block;"
@
click=
"viewGoods(item, scope.row)"
>
{{
item
}}
、
</div>
<div
v-else-if=
"index == scope.row.goodIds.length - 1"
style=
"cursor: pointer;color: #449284;float: left;display: inline-block;"
@
click=
"viewGoods(item,scope.row)"
>
{{
item
}}
</div>
<div
v-for=
"(item, index) in scope.row.goodIds"
:key=
"index"
style=
"text-align: center; margin: 0 auto; padding: 0"
>
<div
v-if=
"index != scope.row.goodIds.length - 1"
style=
"
cursor: pointer;
color: #449284;
float: left;
display: inline-block;
"
@
click=
"viewGoods(item, scope.row)"
>
{{
item
}}
、
</div>
<div
v-else-if=
"index == scope.row.goodIds.length - 1"
style=
"
cursor: pointer;
color: #449284;
float: left;
display: inline-block;
"
@
click=
"viewGoods(item, scope.row)"
>
{{
item
}}
</div>
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"conditionType"
label=
"包邮条件"
min-width=
"100"
align=
"center"
>
<el-table-column
prop=
"conditionType"
label=
"包邮条件"
min-width=
"100"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<div
v-if=
"scope.row.conditionType == 1"
>
满
{{
scope
.
row
.
number
}}
件包邮
满
{{
scope
.
row
.
number
}}
件包邮
</div>
<div
v-if=
"scope.row.conditionType == 2"
>
满
{{
scope
.
row
.
numberText
}}
元包邮
满
{{
scope
.
row
.
numberText
}}
元包邮
</div>
</
template
>
</el-table-column>
<el-table-column
prop=
"intro"
label=
"说明"
min-width=
"100"
align=
"center"
>
<el-table-column
prop=
"intro"
label=
"说明"
min-width=
"100"
align=
"center"
>
</el-table-column>
<el-table-column
prop=
"status"
label=
"操作"
min-width=
"100"
align=
"center"
>
<el-table-column
prop=
"status"
label=
"操作"
min-width=
"100"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<el-button
type=
"text"
size=
"small"
@
click=
"editGoodsFreight(scope.row)"
>
编辑
</el-button>
<el-button
type=
"text"
size=
"small"
@
click=
"delGoodsFreight(scope.row,scope.$index)"
>
删除
</el-button>
<el-button
type=
"text"
size=
"small"
@
click=
"editGoodsFreight(scope.row)"
>
编辑
</el-button
>
<el-button
type=
"text"
size=
"small"
@
click=
"delGoodsFreight(scope.row, scope.$index)"
>
删除
</el-button
>
</
template
>
</el-table-column>
</el-table>
<el-row
style=
"margin: 50px 0 0 220px
;
"
>
<el-row
style=
"margin: 50px 0 0 220px"
>
<el-button
:disabled=
"btnDisabled"
type=
"primary"
size=
"small"
@
click=
"beforSave()"
>
保存
</el-button>
<el-button
:disabled=
"btnDisabled"
size=
"small"
@
click=
"cancleSave()"
>
取消
</el-button>
>
保存
</el-button
>
<el-button
:disabled=
"btnDisabled"
size=
"small"
@
click=
"cancleSave()"
>
取消
</el-button
>
</el-row>
<el-dialog
:title=
"title"
:visible
.
sync=
"setAddVisible"
width=
"60%"
>
<el-dialog
:title=
"title"
:visible
.
sync=
"setAddVisible"
width=
"60%"
>
<!-- <el-row :gutter="30" class="row search" type="flex" style="margin-bottom:0;">-->
<el-form
ref=
"GoodsPriceForm"
:rules=
"addRules"
:model=
"goodCondition"
label-width=
"250px"
label-suffix=
":"
label-position=
"right"
size=
"mini"
style=
"width: 100%;"
>
<el-form-item
label=
"适用商品ID"
class=
"required-label"
prop=
"goodIds"
>
<el-form
ref=
"GoodsPriceForm"
:rules=
"addRules"
:model=
"goodCondition"
label-width=
"250px"
label-suffix=
":"
label-position=
"right"
size=
"mini"
style=
"width: 100%"
>
<el-form-item
label=
"适用商品ID"
class=
"required-label"
prop=
"goodIds"
>
<el-col
:span=
"12"
>
<!-- <el-select v-model="goodCondition.goodIdList"-->
<!-- filterable-->
<!-- remote-->
<!-- reserve-keyword-->
<!-- placeholder="多个商品ID,以“、”隔开"-->
<!-- clearable-->
<!-- value-key="id"-->
<!-- style="width: 130%;"-->
<!-- :remote-method="remoteMethod"-->
<!-- @change="nameChange"-->
<!-- @visible-change="noSelectHand">-->
<el-select
v-model=
"goodCondition.goodIds"
filterable
clearable
multiple
placeholder=
"可以选择多个商品ID"
style=
"width: 130%;"
>
<!-- <el-select v-model="goodCondition.goodIdList"-->
<!-- filterable-->
<!-- remote-->
<!-- reserve-keyword-->
<!-- placeholder="多个商品ID,以“、”隔开"-->
<!-- clearable-->
<!-- value-key="id"-->
<!-- style="width: 130%;"-->
<!-- :remote-method="remoteMethod"-->
<!-- @change="nameChange"-->
<!-- @visible-change="noSelectHand">-->
<el-select
v-model=
"goodCondition.goodIds"
filterable
clearable
multiple
placeholder=
"可以选择多个商品ID"
style=
"width: 130%"
>
<el-option
v-for=
"item in nameList"
:key=
"item.id"
:label=
"item.id"
:value=
"item.id"
>
<span>
{{item.value}}
</span>
:value=
"item.id"
>
<span>
{{ item.value }}
</span>
</el-option>
</el-select>
</el-col>
</el-form-item>
<el-form-item
label=
"包邮条件"
class=
"required-label"
prop=
"conditionType"
>
<el-form-item
label=
"包邮条件"
class=
"required-label"
prop=
"conditionType"
>
<el-col
:span=
"4"
>
<el-select
v-model=
"goodCondition.conditionType"
size=
"small"
>
<el-select
v-model=
"goodCondition.conditionType"
size=
"small"
>
<el-option
v-for=
"(item,index) in typeList"
v-for=
"(item,
index) in typeList"
:key=
"index"
:label=
"item.label"
:value=
"item.value"
></el-option>
</el-select>
</el-col>
<el-col
:span=
"9"
style=
"margin-left: 5px;"
>
<span
style=
"margin-left: 5px;"
>
满
</span>
<el-input-number
v-if=
"goodCondition.conditionType == 1"
v-model=
"goodCondition.number"
style=
"margin-left: 5px;"
size=
"small"
:precision=
"0"
:min=
"1"
:max=
"100000"
></el-input-number>
<el-input-number
v-if=
"goodCondition.conditionType == 2"
v-model=
"goodCondition.number"
style=
"margin-left: 5px;"
size=
"small"
:precision=
"2"
:min=
"0.00"
:max=
"99999.99"
></el-input-number>
<span
style=
"margin-left: 5px;"
v-if=
"goodCondition.conditionType == 1"
>
件包邮
</span>
<span
style=
"margin-left: 5px;"
v-if=
"goodCondition.conditionType == 2"
>
元包邮
</span>
<el-col
:span=
"9"
style=
"margin-left: 5px"
>
<span
style=
"margin-left: 5px"
>
满
</span>
<el-input-number
v-if=
"goodCondition.conditionType == 1"
v-model=
"goodCondition.number"
style=
"margin-left: 5px"
size=
"small"
:precision=
"0"
:min=
"1"
:max=
"100000"
></el-input-number>
<el-input-number
v-if=
"goodCondition.conditionType == 2"
v-model=
"goodCondition.number"
style=
"margin-left: 5px"
size=
"small"
:precision=
"2"
:min=
"0.0"
:max=
"99999.99"
></el-input-number>
<span
style=
"margin-left: 5px"
v-if=
"goodCondition.conditionType == 1"
>
件包邮
</span
>
<span
style=
"margin-left: 5px"
v-if=
"goodCondition.conditionType == 2"
>
元包邮
</span
>
</el-col>
</el-form-item>
<el-form-item
label=
"运费说明"
class=
"required-label"
>
<el-col
:span=
"15"
>
<el-input
v-model=
"goodCondition.intro"
maxlength=
"10"
style=
"width: 100%;"
size=
"small"
placeholder=
"请输入"
></el-input>
<el-input
v-model=
"goodCondition.intro"
maxlength=
"10"
style=
"width: 100%"
size=
"small"
placeholder=
"请输入"
></el-input>
</el-col>
</el-form-item>
</el-form>
<!-- </el-row>-->
<span
slot=
"footer"
class=
"dialog-footer"
style=
"text-align: center
;
"
>
<el-button
@
click=
"setAddVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"save()"
>
保存
</el-button>
</span>
<span
slot=
"footer"
class=
"dialog-footer"
style=
"text-align: center"
>
<el-button
@
click=
"setAddVisible = false"
>
取 消
</el-button>
<el-button
type=
"primary"
@
click=
"save()"
>
保存
</el-button>
</span>
</el-dialog>
</div>
</div>
...
...
@@ -249,12 +355,17 @@
<
script
>
let
vm
=
null
;
import
BreadCrumb
from
"@/components/breadcrumb.vue"
;
import
{
getExpressFee
,
createOrModifyExpressFee
,
getFreightConfig
,
saveFreightConfig
}
from
"@/utils/freight"
;
import
{
closeLoading
,
openLoading
}
from
"../../utils/utils"
;
import
{
getGoodsIdList
}
from
'@/utils/goods'
;
import
{
getExpressFee
,
createOrModifyExpressFee
,
getFreightConfig
,
saveFreightConfig
,
}
from
"@/utils/freight"
;
import
{
closeLoading
,
openLoading
}
from
"../../utils/utils"
;
import
{
getGoodsIdList
}
from
"@/utils/goods"
;
export
default
{
components
:
{
BreadCrumb
BreadCrumb
,
},
data
()
{
var
checkRange
=
(
rule
,
value
,
callback
)
=>
{
...
...
@@ -276,13 +387,13 @@ export default {
}
};
return
{
curmbFirst
:
'云鹊店铺'
,
curmbSecond
:
'运费配置'
,
curmbFirst
:
"云鹊店铺"
,
curmbSecond
:
"运费配置"
,
btnDisabled
:
false
,
formData
:
{
expressFeeConfigId
:
0
,
intro
:
""
,
introId
:
""
,
introId
:
""
,
list
:
[
{
fee
:
0
,
...
...
@@ -291,46 +402,46 @@ export default {
},
],
},
model
:{
type
:
1
,
model
:
{
type
:
1
,
userName
:
""
,
},
typeList
:
[
{
label
:
'件数'
,
label
:
"件数"
,
value
:
1
,
},
{
label
:
'金额'
,
},
{
label
:
"金额"
,
value
:
2
,
}],
title
:
"添加条件"
,
},
],
title
:
"添加条件"
,
setAddVisible
:
false
,
storeId
:
''
,
goodCondition
:{
id
:
""
,
goodIds
:[],
conditionType
:
''
,
number
:
''
,
intro
:
''
,
goodIdList
:
''
storeId
:
""
,
goodCondition
:
{
id
:
""
,
goodIds
:
[],
conditionType
:
""
,
number
:
""
,
intro
:
""
,
goodIdList
:
""
,
},
goodIdsArray
:[],
nameList
:[],
resultForm
:{
goodConditionReqList
:[],
intro
:
''
,
introId
:
''
,
storeExpressIntervalReqList
:[],
storeId
:
''
,
tradeGoods
:
''
goodIdsArray
:
[],
nameList
:
[],
resultForm
:
{
goodConditionReqList
:
[],
intro
:
""
,
introId
:
""
,
storeExpressIntervalReqList
:
[],
storeId
:
""
,
tradeGoods
:
""
,
},
rowIndex
:
''
,
addRules
:{
goodIds
:
[
{
required
:
true
,
message
:
"请输入商品ID"
,
trigger
:
'blur'
}
],
rowIndex
:
""
,
addRules
:
{
goodIds
:
[{
required
:
true
,
message
:
"请输入商品ID"
,
trigger
:
"blur"
}],
conditionType
:
[
{
required
:
true
,
message
:
"请选择包邮条件"
,
trigger
:
'blur'
}
{
required
:
true
,
message
:
"请选择包邮条件"
,
trigger
:
"blur"
},
],
},
bgRules
:
[{
validator
:
checkRange
,
trigger
:
"blur"
}],
...
...
@@ -356,23 +467,22 @@ export default {
this
.
getFreightConfig
();
},
methods
:
{
changeValue
(
v
){
changeValue
(
v
)
{
console
.
log
(
v
);
},
// 对数据进行处理
dataHandler
(
listData
,
isRatioLower
=
true
)
{
let
list
=
JSON
.
parse
(
JSON
.
stringify
(
listData
));
let
ratio
=
0.01
;
if
(
isRatioLower
)
{
list
.
map
(
item
=>
{
if
(
isRatioLower
)
{
list
.
map
(
(
item
)
=>
{
item
.
fee
=
Number
(
item
.
fee
*
ratio
).
toFixed
(
2
);
item
.
rangeMin
=
Number
(
item
.
rangeMin
*
ratio
).
toFixed
(
2
);
item
.
rangeMax
=
Number
(
item
.
rangeMax
*
ratio
).
toFixed
(
2
);
});
}
else
{
ratio
=
100
;
list
.
map
(
item
=>
{
list
.
map
(
(
item
)
=>
{
item
.
fee
=
parseInt
(
item
.
fee
*
ratio
);
item
.
rangeMin
=
parseInt
(
item
.
rangeMin
*
ratio
);
item
.
rangeMax
=
parseInt
(
item
.
rangeMax
*
ratio
);
...
...
@@ -383,15 +493,15 @@ export default {
// 获取配置信息
getExpressFeeInfo
()
{
getExpressFee
().
then
(
res
=>
{
getExpressFee
().
then
(
(
res
)
=>
{
let
curData
=
res
.
data
;
if
(
res
.
data
&&
res
.
data
.
list
&&
res
.
data
.
list
.
length
)
{
if
(
res
.
data
&&
res
.
data
.
list
&&
res
.
data
.
list
.
length
)
{
curData
.
list
=
this
.
dataHandler
(
res
.
data
.
list
);
}
else
{
curData
.
list
=
this
.
formData
.
list
;
}
this
.
formData
=
curData
;
})
})
;
},
// 增加单个条件
...
...
@@ -402,9 +512,9 @@ export default {
rangeMax
:
0
,
});
},
handleRowClickRole
(
row
){
this
.
rowIndex
=
row
.
index
console
.
log
(
this
.
rowIndex
)
handleRowClickRole
(
row
)
{
this
.
rowIndex
=
row
.
index
;
console
.
log
(
this
.
rowIndex
)
;
},
// 删除条件
deleteCondition
(
index
)
{
...
...
@@ -437,14 +547,14 @@ export default {
vm
.
resultForm
.
introId
=
formData
.
introId
;
vm
.
resultForm
.
storeId
=
vm
.
storeId
;
saveFreightConfig
(
vm
.
resultForm
)
// createOrModifyExpressFee(formData)
// createOrModifyExpressFee(formData)
.
then
((
res
)
=>
{
if
(
res
.
code
==
"000000"
)
{
// this.getExpressFeeInfo();
this
.
$message
({
type
:
"success"
,
message
:
"保存成功!"
});
this
.
$router
.
push
({
path
:
`/shop-list`
})
path
:
`/shop-list`
,
})
;
}
else
{
this
.
$message
({
type
:
"error"
,
message
:
res
.
message
});
}
...
...
@@ -453,10 +563,10 @@ export default {
this
.
btnDisabled
=
false
;
});
},
cancleSave
(){
cancleSave
()
{
this
.
$router
.
push
({
path
:
`/shop-list`
})
path
:
`/shop-list`
,
})
;
// this.$confirm(`是否取消?`, "", {
// confirmButtonText: "确定",
// cancelButtonText: "取消",
...
...
@@ -484,179 +594,199 @@ export default {
},
// 查看商品详情
viewGoods
(
item
,
row
){
viewGoods
(
item
,
row
)
{
let
goodsType
=
""
;
for
(
let
i
=
0
;
i
<
row
.
tradeGoods
.
length
;
i
++
)
{
if
(
item
==
row
.
tradeGoods
[
i
].
id
)
{
for
(
let
i
=
0
;
i
<
row
.
tradeGoods
.
length
;
i
++
)
{
if
(
item
==
row
.
tradeGoods
[
i
].
id
)
{
goodsType
=
row
.
tradeGoods
[
i
].
goodsType
;
break
;
}
}
// url = `/create-good?id=${row.goodsId}&storeId=${this.searchForm.storeId}&goodsType=${goodsType}&commissionFlag=${this.commissionFlag}`
let
url
=
`/create-good?id=
${
item
}
&storeId=
${
this
.
storeId
}
&goodsType=
${
goodsType
}
&commissionFlag=2`
// this.$store.dispatch('goodsManage/changeGoodsInfo', {...row});
this
.
$router
.
push
({
path
:
url
})
let
url
=
`/create-good?id=
${
item
}
&storeId=
${
this
.
storeId
}
&goodsType=
${
goodsType
}
&commissionFlag=2`
;
// this.$store.dispatch('goodsManage/changeGoodsInfo', {...row});
this
.
$router
.
push
({
path
:
url
,
});
},
addGoodsCondition
(){
addGoodsCondition
()
{
vm
.
remoteMethod
();
vm
.
goodCondition
=
{
id
:
""
,
goodIds
:
[],
conditionType
:
''
,
number
:
''
,
intro
:
''
,
goodIdList
:
''
id
:
""
,
goodIds
:
[],
conditionType
:
""
,
number
:
""
,
intro
:
""
,
goodIdList
:
""
,
};
this
.
title
=
"添加条件"
;
this
.
setAddVisible
=
true
;
},
setIdArray
(
goodIdList
){
setIdArray
(
goodIdList
)
{
let
idArray
=
[];
if
(
goodIdList
.
indexOf
(
"、"
)
>
-
1
)
{
if
(
goodIdList
.
indexOf
(
"、"
)
>
-
1
)
{
idArray
=
goodIdList
.
split
(
"、"
);
}
else
{
}
else
{
idArray
.
push
(
goodIdList
);
}
return
idArray
;
},
getIdArray
(
goodIds
){
let
idArray
=
''
;
for
(
let
i
=
0
;
i
<
goodIds
.
length
;
i
++
)
{
if
(
i
!=
goodIds
.
length
-
1
)
{
getIdArray
(
goodIds
)
{
let
idArray
=
""
;
for
(
let
i
=
0
;
i
<
goodIds
.
length
;
i
++
)
{
if
(
i
!=
goodIds
.
length
-
1
)
{
idArray
=
idArray
+
goodIds
[
i
]
+
"、"
;
}
else
if
(
i
==
goodIds
.
length
-
1
){
}
else
if
(
i
==
goodIds
.
length
-
1
)
{
idArray
=
idArray
+
goodIds
[
i
];
}
}
return
idArray
;
},
editGoodsFreight
(
row
){
editGoodsFreight
(
row
)
{
vm
.
remoteMethod
();
let
idArray
=
this
.
getIdArray
(
row
.
goodIds
);
if
(
row
.
conditionType
==
2
)
{
if
(
row
.
conditionType
==
2
)
{
vm
.
goodCondition
=
{
id
:
row
.
id
,
goodIds
:
row
.
goodIds
,
conditionType
:
row
.
conditionType
,
number
:
row
.
number
/
100
,
intro
:
row
.
intro
,
introId
:
row
.
introId
,
goodIdList
:
idArray
id
:
row
.
id
,
goodIds
:
row
.
goodIds
,
conditionType
:
row
.
conditionType
,
number
:
row
.
number
/
100
,
intro
:
row
.
intro
,
introId
:
row
.
introId
,
goodIdList
:
idArray
,
};
}
else
{
}
else
{
vm
.
goodCondition
=
{
id
:
row
.
id
,
goodIds
:
row
.
goodIds
,
conditionType
:
row
.
conditionType
,
number
:
row
.
number
,
intro
:
row
.
intro
,
introId
:
row
.
introId
,
goodIdList
:
idArray
id
:
row
.
id
,
goodIds
:
row
.
goodIds
,
conditionType
:
row
.
conditionType
,
number
:
row
.
number
,
intro
:
row
.
intro
,
introId
:
row
.
introId
,
goodIdList
:
idArray
,
};
}
this
.
title
=
"修改条件"
;
this
.
setAddVisible
=
true
;
},
delGoodsFreight
(
row
,
index
)
{
// vm.rowIndex;
vm
.
resultForm
.
goodConditionReqList
.
splice
(
index
,
1
);
delGoodsFreight
(
row
,
index
)
{
// vm.rowIndex;
vm
.
resultForm
.
goodConditionReqList
.
splice
(
index
,
1
);
},
// 获取配置信息
getFreightConfig
()
{
getFreightConfig
({
id
:
this
.
storeId
}).
then
(
res
=>
{
getFreightConfig
({
id
:
this
.
storeId
}).
then
((
res
)
=>
{
let
curData
=
res
.
data
;
if
(
res
.
data
&&
res
.
data
.
expressFeeIntervalConfigList
&&
res
.
data
.
expressFeeIntervalConfigList
.
length
)
{
curData
.
list
=
this
.
dataHandler
(
res
.
data
.
expressFeeIntervalConfigList
);
if
(
res
.
data
&&
res
.
data
.
expressFeeIntervalConfigList
&&
res
.
data
.
expressFeeIntervalConfigList
.
length
)
{
curData
.
list
=
this
.
dataHandler
(
res
.
data
.
expressFeeIntervalConfigList
);
}
else
{
curData
.
list
=
this
.
formData
.
list
;
}
if
(
res
.
data
.
goodConditionDtoList
){
for
(
let
i
=
0
;
i
<
res
.
data
.
goodConditionDtoList
.
length
;
i
++
){
if
(
res
.
data
.
goodConditionDtoList
[
i
].
goodExpressConditionConfig
.
conditionType
==
2
){
this
.
resultForm
.
goodConditionReqList
.
push
(
{
id
:
res
.
data
.
goodConditionDtoList
[
i
].
goodExpressConditionConfig
.
id
,
goodIds
:
res
.
data
.
goodConditionDtoList
[
i
].
goodIds
,
conditionType
:
res
.
data
.
goodConditionDtoList
[
i
].
goodExpressConditionConfig
.
conditionType
,
number
:
res
.
data
.
goodConditionDtoList
[
i
].
goodExpressConditionConfig
.
number
,
numberText
:
res
.
data
.
goodConditionDtoList
[
i
].
goodExpressConditionConfig
.
number
/
100
,
intro
:
res
.
data
.
goodConditionDtoList
[
i
].
goodExpressConditionConfig
.
intro
,
introId
:
res
.
data
.
goodConditionDtoList
[
i
].
goodExpressConditionConfig
.
id
,
tradeGoods
:
res
.
data
.
goodConditionDtoList
[
i
].
tradeGoods
});
}
else
{
this
.
resultForm
.
goodConditionReqList
.
push
(
{
id
:
res
.
data
.
goodConditionDtoList
[
i
].
goodExpressConditionConfig
.
id
,
goodIds
:
res
.
data
.
goodConditionDtoList
[
i
].
goodIds
,
conditionType
:
res
.
data
.
goodConditionDtoList
[
i
].
goodExpressConditionConfig
.
conditionType
,
number
:
res
.
data
.
goodConditionDtoList
[
i
].
goodExpressConditionConfig
.
number
,
numberText
:
res
.
data
.
goodConditionDtoList
[
i
].
goodExpressConditionConfig
.
number
,
intro
:
res
.
data
.
goodConditionDtoList
[
i
].
goodExpressConditionConfig
.
intro
,
introId
:
res
.
data
.
goodConditionDtoList
[
i
].
goodExpressConditionConfig
.
id
,
tradeGoods
:
res
.
data
.
goodConditionDtoList
[
i
].
tradeGoods
});
if
(
res
.
data
.
goodConditionDtoList
)
{
for
(
let
i
=
0
;
i
<
res
.
data
.
goodConditionDtoList
.
length
;
i
++
)
{
if
(
res
.
data
.
goodConditionDtoList
[
i
].
goodExpressConditionConfig
.
conditionType
==
2
)
{
this
.
resultForm
.
goodConditionReqList
.
push
({
id
:
res
.
data
.
goodConditionDtoList
[
i
].
goodExpressConditionConfig
.
id
,
goodIds
:
res
.
data
.
goodConditionDtoList
[
i
].
goodIds
,
conditionType
:
res
.
data
.
goodConditionDtoList
[
i
].
goodExpressConditionConfig
.
conditionType
,
number
:
res
.
data
.
goodConditionDtoList
[
i
].
goodExpressConditionConfig
.
number
,
numberText
:
res
.
data
.
goodConditionDtoList
[
i
].
goodExpressConditionConfig
.
number
/
100
,
intro
:
res
.
data
.
goodConditionDtoList
[
i
].
goodExpressConditionConfig
.
intro
,
introId
:
res
.
data
.
goodConditionDtoList
[
i
].
goodExpressConditionConfig
.
id
,
tradeGoods
:
res
.
data
.
goodConditionDtoList
[
i
].
tradeGoods
,
});
}
else
{
this
.
resultForm
.
goodConditionReqList
.
push
({
id
:
res
.
data
.
goodConditionDtoList
[
i
].
goodExpressConditionConfig
.
id
,
goodIds
:
res
.
data
.
goodConditionDtoList
[
i
].
goodIds
,
conditionType
:
res
.
data
.
goodConditionDtoList
[
i
].
goodExpressConditionConfig
.
conditionType
,
number
:
res
.
data
.
goodConditionDtoList
[
i
].
goodExpressConditionConfig
.
number
,
numberText
:
res
.
data
.
goodConditionDtoList
[
i
].
goodExpressConditionConfig
.
number
,
intro
:
res
.
data
.
goodConditionDtoList
[
i
].
goodExpressConditionConfig
.
intro
,
introId
:
res
.
data
.
goodConditionDtoList
[
i
].
goodExpressConditionConfig
.
id
,
tradeGoods
:
res
.
data
.
goodConditionDtoList
[
i
].
tradeGoods
,
});
}
}
}
// this.tableData = res.data.goodConditionDtoList;
this
.
formData
.
list
=
curData
.
list
;
this
.
formData
.
intro
=
res
.
data
.
storeExpressFeeIntro
.
intro
;
this
.
formData
.
introId
=
res
.
data
.
storeExpressFeeIntro
.
id
;
})
})
;
},
// 本应分页加载,这个设置pageSize为最大值解决
remoteMethod
(
val
)
{
this
.
searchForm
=
{
goodsIdList
:
[],
goodIdStr
:
val
,
goodsType
:
''
,
pageNo
:
1
,
pageSize
:
999
,
storeId
:
this
.
storeId
,
commissionType
:
0
goodsIdList
:
[],
goodIdStr
:
val
,
goodsType
:
""
,
pageNo
:
1
,
pageSize
:
999
,
storeId
:
this
.
storeId
,
commissionType
:
0
,
};
// if (val.length >= 2) {
// console.log('搜索',val)
getGoodsIdList
(
this
.
searchForm
)
// console.log('搜索',val)
getGoodsIdList
(
this
.
searchForm
)
// this.GET(`/diagnose/commission/downDoctor/doctorInfoByNameLike?name=${val}`)
.
then
(
function
(
res
)
{
if
(
res
.
code
==
'000000'
)
{
// let data = JSON.parse(JSON.stringify(res.data.data));//通过这个实现深拷贝
let
list
=
res
.
data
.
goodsList
;
vm
.
expertData
=
list
;
let
newList
=
[];
list
.
map
((
item
,
index
)
=>
{
newList
[
index
]
=
{
value
:
`
${
item
.
goodsId
}
${
item
.
goodsName
}
`
,
id
:
item
.
goodsId
,
name
:
item
.
goodsName
,
goodsType
:
item
.
goodsType
}
})
// console.log('新数组',newList)
vm
.
nameList
=
newList
;
}
}).
catch
(
function
(
error
)
{
.
then
(
function
(
res
)
{
if
(
res
.
code
==
"000000"
)
{
// let data = JSON.parse(JSON.stringify(res.data.data));//通过这个实现深拷贝
let
list
=
res
.
data
.
goodsList
;
vm
.
expertData
=
list
;
let
newList
=
[];
list
.
map
((
item
,
index
)
=>
{
newList
[
index
]
=
{
value
:
`
${
item
.
goodsId
}
${
item
.
goodsName
}
`
,
id
:
item
.
goodsId
,
name
:
item
.
goodsName
,
goodsType
:
item
.
goodsType
,
};
});
// console.log('新数组',newList)
vm
.
nameList
=
newList
;
}
})
.
catch
(
function
(
error
)
{
errorResponseCheck
(
error
,
vm
);
});
// }else {
...
...
@@ -668,17 +798,17 @@ export default {
// console.log('选中的值',val)
let
addFlag
=
true
;
if
(
val
)
{
for
(
let
i
=
0
;
i
<
vm
.
expertData
.
length
;
i
++
)
{
for
(
let
i
=
0
;
i
<
vm
.
expertData
.
length
;
i
++
)
{
if
(
val
==
vm
.
expertData
[
i
].
goodsId
)
{
let
item
=
vm
.
expertData
[
i
];
vm
.
goodIdsArray
=
vm
.
goodCondition
.
goodIds
;
for
(
let
j
=
0
;
j
<
vm
.
goodIdsArray
.
length
;
j
++
)
{
if
(
vm
.
goodIdsArray
[
j
]
==
val
)
{
for
(
let
j
=
0
;
j
<
vm
.
goodIdsArray
.
length
;
j
++
)
{
if
(
vm
.
goodIdsArray
[
j
]
==
val
)
{
addFlag
=
false
;
break
;
}
}
if
(
addFlag
)
{
if
(
addFlag
)
{
vm
.
goodIdsArray
.
push
(
val
);
}
vm
.
goodCondition
.
goodIdList
=
this
.
getIdArray
(
vm
.
goodIdsArray
);
...
...
@@ -691,7 +821,7 @@ export default {
// vm.model.userId = item.doctorId;
}
}
}
else
{
}
else
{
vm
.
goodCondition
.
goodIdList
=
""
;
}
vm
.
nameList
=
[];
...
...
@@ -702,103 +832,114 @@ export default {
}
},
// 保存商品运费添加条件
save
(){
save
()
{
let
addFlag
=
false
;
this
.
$refs
[
"GoodsPriceForm"
].
validate
((
valid
)
=>
{
if
(
!
valid
)
return
false
;
// vm.goodCondition.goodIds = [];
// vm.goodCondition.goodIds = vm.setIdArray(vm.goodCondition.goodIdList);
if
(
vm
.
goodCondition
.
conditionType
==
2
&&
vm
.
goodCondition
.
number
>=
100000
){
this
.
$message
({
type
:
"warning"
,
message
:
"包邮金额最大不能超过99999.99!"
});
if
(
vm
.
goodCondition
.
conditionType
==
2
&&
vm
.
goodCondition
.
number
>=
100000
)
{
this
.
$message
({
type
:
"warning"
,
message
:
"包邮金额最大不能超过99999.99!"
,
});
return
;
}
if
(
vm
.
resultForm
.
goodConditionReqList
.
length
>
0
)
{
if
(
vm
.
resultForm
.
goodConditionReqList
.
length
>
0
)
{
// this.formData.tabs[0].contents = vm.resultForm.goodConditionReqList.filter(function (item) {
// return item.goodIds == vm.goodCondition.goodIds;
// });
for
(
let
i
=
0
;
i
<
vm
.
resultForm
.
goodConditionReqList
.
length
;
i
++
){
if
((
vm
.
goodCondition
.
id
!=
""
&&
vm
.
resultForm
.
goodConditionReqList
[
i
].
id
==
vm
.
goodCondition
.
id
)
||
(
vm
.
goodCondition
.
id
==
""
&&
vm
.
getIdArray
(
vm
.
resultForm
.
goodConditionReqList
[
i
].
goodIds
)
==
vm
.
getIdArray
(
vm
.
goodCondition
.
goodIds
))){
vm
.
resultForm
.
goodConditionReqList
[
i
].
conditionType
=
vm
.
goodCondition
.
conditionType
;
vm
.
resultForm
.
goodConditionReqList
[
i
].
goodIds
=
vm
.
goodCondition
.
goodIds
;
if
(
vm
.
goodCondition
.
conditionType
==
2
){
vm
.
resultForm
.
goodConditionReqList
[
i
].
number
=
vm
.
goodCondition
.
number
*
100
;
vm
.
resultForm
.
goodConditionReqList
[
i
].
numberText
=
vm
.
goodCondition
.
number
;
}
else
{
vm
.
resultForm
.
goodConditionReqList
[
i
].
number
=
vm
.
goodCondition
.
number
;
for
(
let
i
=
0
;
i
<
vm
.
resultForm
.
goodConditionReqList
.
length
;
i
++
)
{
if
(
(
vm
.
goodCondition
.
id
!=
""
&&
vm
.
resultForm
.
goodConditionReqList
[
i
].
id
==
vm
.
goodCondition
.
id
)
||
(
vm
.
goodCondition
.
id
==
""
&&
vm
.
getIdArray
(
vm
.
resultForm
.
goodConditionReqList
[
i
].
goodIds
)
==
vm
.
getIdArray
(
vm
.
goodCondition
.
goodIds
))
)
{
vm
.
resultForm
.
goodConditionReqList
[
i
].
conditionType
=
vm
.
goodCondition
.
conditionType
;
vm
.
resultForm
.
goodConditionReqList
[
i
].
goodIds
=
vm
.
goodCondition
.
goodIds
;
if
(
vm
.
goodCondition
.
conditionType
==
2
)
{
vm
.
resultForm
.
goodConditionReqList
[
i
].
number
=
vm
.
goodCondition
.
number
*
100
;
vm
.
resultForm
.
goodConditionReqList
[
i
].
numberText
=
vm
.
goodCondition
.
number
;
}
else
{
vm
.
resultForm
.
goodConditionReqList
[
i
].
number
=
vm
.
goodCondition
.
number
;
}
vm
.
resultForm
.
goodConditionReqList
[
i
].
intro
=
vm
.
goodCondition
.
intro
;
vm
.
resultForm
.
goodConditionReqList
[
i
].
introId
=
vm
.
goodCondition
.
introId
;
vm
.
resultForm
.
goodConditionReqList
[
i
].
tradeGoods
=
vm
.
setTradeGoods
(
vm
.
goodCondition
.
goodIds
);
addFlag
=
false
;
vm
.
resultForm
.
goodConditionReqList
[
i
].
intro
=
vm
.
goodCondition
.
intro
;
vm
.
resultForm
.
goodConditionReqList
[
i
].
introId
=
vm
.
goodCondition
.
introId
;
vm
.
resultForm
.
goodConditionReqList
[
i
].
tradeGoods
=
vm
.
setTradeGoods
(
vm
.
goodCondition
.
goodIds
);
addFlag
=
false
;
break
;
}
if
(
i
==
vm
.
resultForm
.
goodConditionReqList
.
length
-
1
)
{
if
(
i
==
vm
.
resultForm
.
goodConditionReqList
.
length
-
1
)
{
addFlag
=
true
;
}
}
if
(
addFlag
)
{
if
(
addFlag
)
{
vm
.
addGoodConditionReqList
();
}
}
else
{
vm
.
addGoodConditionReqList
();
}
else
{
vm
.
addGoodConditionReqList
();
}
vm
.
setAddVisible
=
false
;
});
},
addGoodConditionReqList
(){
if
(
vm
.
goodCondition
.
conditionType
==
2
){
addGoodConditionReqList
()
{
if
(
vm
.
goodCondition
.
conditionType
==
2
)
{
vm
.
resultForm
.
goodConditionReqList
.
push
({
goodIds
:
vm
.
goodCondition
.
goodIds
,
conditionType
:
vm
.
goodCondition
.
conditionType
,
number
:
vm
.
goodCondition
.
number
*
100
,
numberText
:
vm
.
goodCondition
.
number
,
intro
:
vm
.
goodCondition
.
intro
,
introId
:
vm
.
goodCondition
.
introId
,
tradeGoods
:
vm
.
setTradeGoods
(
vm
.
goodCondition
.
goodIds
)
goodIds
:
vm
.
goodCondition
.
goodIds
,
conditionType
:
vm
.
goodCondition
.
conditionType
,
number
:
vm
.
goodCondition
.
number
*
100
,
numberText
:
vm
.
goodCondition
.
number
,
intro
:
vm
.
goodCondition
.
intro
,
introId
:
vm
.
goodCondition
.
introId
,
tradeGoods
:
vm
.
setTradeGoods
(
vm
.
goodCondition
.
goodIds
)
,
});
}
else
{
}
else
{
vm
.
resultForm
.
goodConditionReqList
.
push
({
goodIds
:
vm
.
goodCondition
.
goodIds
,
conditionType
:
vm
.
goodCondition
.
conditionType
,
number
:
vm
.
goodCondition
.
number
,
numberText
:
vm
.
goodCondition
.
number
,
intro
:
vm
.
goodCondition
.
intro
,
introId
:
vm
.
goodCondition
.
introId
,
tradeGoods
:
vm
.
setTradeGoods
(
vm
.
goodCondition
.
goodIds
)
goodIds
:
vm
.
goodCondition
.
goodIds
,
conditionType
:
vm
.
goodCondition
.
conditionType
,
number
:
vm
.
goodCondition
.
number
,
numberText
:
vm
.
goodCondition
.
number
,
intro
:
vm
.
goodCondition
.
intro
,
introId
:
vm
.
goodCondition
.
introId
,
tradeGoods
:
vm
.
setTradeGoods
(
vm
.
goodCondition
.
goodIds
)
,
});
}
},
setTradeGoods
(
goodIds
){
setTradeGoods
(
goodIds
)
{
let
tradeGoods
=
[];
if
(
goodIds
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
goodIds
.
length
;
i
++
)
{
for
(
let
j
=
0
;
j
<
vm
.
nameList
.
length
;
j
++
)
{
if
(
goodIds
[
i
]
==
vm
.
nameList
[
j
].
id
)
{
tradeGoods
.
push
({
id
:
vm
.
nameList
[
j
].
id
,
goodsType
:
vm
.
nameList
[
j
].
goodsType
})
}
if
(
goodIds
.
length
>
0
)
{
for
(
let
i
=
0
;
i
<
goodIds
.
length
;
i
++
)
{
for
(
let
j
=
0
;
j
<
vm
.
nameList
.
length
;
j
++
)
{
if
(
goodIds
[
i
]
==
vm
.
nameList
[
j
].
id
)
{
tradeGoods
.
push
({
id
:
vm
.
nameList
[
j
].
id
,
goodsType
:
vm
.
nameList
[
j
].
goodsType
,
});
}
}
}
}
return
tradeGoods
;
}
},
},
};
</
script
>
...
...
@@ -862,9 +1003,4 @@ export default {
}
}
}
</
style
>
写
预览
Markdown
格式
0%
请重试
or
附加一个文件
附加文件
取消
您添加了
0
人
到此讨论。请谨慎行事。
先完成此消息的编辑!
取消
想要评论请
注册
或
登录