Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
saas_plus
/
dj-car-life-system
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 55867b90
authored
Feb 23, 2024
by
张立顺
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
feat 功能联调
1 parent
804da921
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
1116 additions
and
91 deletions
src/api/inStoreTargetConfig.js
src/common/format.js
src/router/modules/906_systemSettings.js
src/views/systemConfig/inStoreGoalsConfig/addInStoreConfig.vue
src/views/systemConfig/inStoreGoalsConfig/components/drawerPeriodItemEdit.vue
src/views/systemConfig/inStoreGoalsConfig/components/selectGoodsDialog.vue
src/views/systemConfig/inStoreGoalsConfig/components/selectGoodsTypeDialog.vue
src/api/inStoreTargetConfig.js
View file @
55867b9
...
...
@@ -53,5 +53,8 @@ export function getStaffTaskDetailApi(data) {
return
request
(
data
,
"post"
)
}
// dj.api.smartcarlife.merchantTargetConfig.getDetail/1.0.0
// 查看店面目标配置详情
export
function
merchantTargetConfigDetail
(
data
)
{
data
.
method
=
`dj.api.smartcarlife.merchantTargetConfig.getDetail`
return
request
(
data
,
"post"
)
}
src/common/format.js
View file @
55867b9
...
...
@@ -13,6 +13,14 @@ export function limitPrice(
maxValue
,
regRule
)
{
console
.
log
(
newValue
,
minValue
,
newValue
&&
((
minValue
&&
newValue
<
minValue
)
||
(
maxValue
&&
newValue
>
maxValue
)),
"limitPrice"
)
var
reg
=
{
priceReg
:
/^
\d[\d\.]
*$/
,
// eslint-disable-line
numReg
:
/^
[
1-9
]\d
*$/
,
...
...
@@ -49,9 +57,9 @@ export function limitPrice(
}
}
//允许输入负数的输入框限制
//
允许输入负数的输入框限制
export
function
limitPriceForNegative
(
newValue
)
{
//用来检索整数且不超过七位数
//
用来检索整数且不超过七位数
const
limitDigit
=
/
[
0-9
]{1,7}
/
// 用来检索小数且小数点后不超过两位数
const
limitDigitdot
=
/
[
0-9
]{1,7}
.
[\d]{0,2}
/
...
...
@@ -114,10 +122,10 @@ export const afterTodayOptions = {
/**
* 时间控件-限制选择30天时间范围,且不大于当前时间
*/
export
var
pickerMinDate
=
""
//获取开始选择时间
export
var
pickerMaxDate
=
""
//获取结束选择时间
export
var
pickerMinDate
=
""
//
获取开始选择时间
export
var
pickerMaxDate
=
""
//
获取结束选择时间
export
const
rangePickerOptions_30day
=
{
//时间范围选择控制
//
时间范围选择控制
onPick
({
maxDate
,
minDate
})
{
console
.
log
(
"minDate"
,
minDate
)
console
.
log
(
"maxDate"
,
maxDate
)
...
...
@@ -143,7 +151,7 @@ export const rangePickerOptions_30day = {
return
time
.
getTime
()
>
maxTime
||
time
.
getTime
()
>
Date
.
now
()
-
86400000
}
if
(
pickerMaxDate
!==
""
&&
!
pickerMinDate
)
{
le
t
minTime
=
pickerMaxDate
-
day31
cons
t
minTime
=
pickerMaxDate
-
day31
return
time
.
getTime
()
<
minTime
||
time
.
getTime
()
>
Date
.
now
()
-
86400000
}
return
time
.
getTime
()
>
Date
.
now
()
-
86400000
...
...
@@ -155,7 +163,7 @@ export const rangePickerOptions_30day = {
*/
export
var
selectDate
=
""
export
const
rangePickerOptions_30day2
=
{
//时间范围选择控制
//
时间范围选择控制
onPick
({
maxDate
,
minDate
})
{
selectDate
=
minDate
.
getTime
()
if
(
maxDate
)
{
...
...
@@ -164,8 +172,8 @@ export const rangePickerOptions_30day2 = {
},
disabledDate
(
time
)
{
if
(
selectDate
!==
""
)
{
le
t
one
=
30
*
24
*
3600
*
1000
le
t
minTime
=
selectDate
-
one
cons
t
one
=
30
*
24
*
3600
*
1000
cons
t
minTime
=
selectDate
-
one
let
maxTime
=
selectDate
+
one
if
(
maxTime
>
new
Date
())
{
maxTime
=
new
Date
()
...
...
src/router/modules/906_systemSettings.js
View file @
55867b9
...
...
@@ -1009,7 +1009,7 @@ export const routerName = {
sideHidden
:
true
,
activePath
:
"/inStoreGoalsConfig"
},
component
:
_import
(
"systemConfig/inStoreGoalsConfig/
inStoreConfigView
"
)
component
:
_import
(
"systemConfig/inStoreGoalsConfig/
addInStoreConfig
"
)
},
// 查看驻店员工任务
90628
:
{
...
...
src/views/systemConfig/inStoreGoalsConfig/addInStoreConfig.vue
View file @
55867b9
...
...
@@ -9,31 +9,40 @@
</div>
<div
class=
"itemCon"
>
<el-form-item
label=
"选择门店"
prop=
"merchantId"
required
>
<el-select
style=
"width: 300px;"
width=
"300px"
v-model=
"storeConfigConObj.merchantId"
filterable
placeholder=
"请选择门店"
@
change=
"restData"
>
<el-select
:disabled=
"routerParams.idEdit == 'true' || routerForView"
style=
"width: 300px;"
width=
"300px"
v-model=
"storeConfigConObj.merchantId"
filterable
placeholder=
"请选择门店"
@
change=
"restData"
>
<el-option
v-for=
"item in baseData.merchantList "
:key=
"item.merchantId"
:label=
"item.merchantName"
:value=
"item.merchantId"
/>
</el-select>
</el-form-item>
<el-form-item
label=
"场景名称"
prop=
"sceneType"
required
>
<el-checkbox-group
v-model=
"storeConfigConObj.sceneType"
@
change=
"restData"
>
<el-checkbox
false-label=
"null"
true-label=
"1"
name=
"state"
>
精品升级
</el-checkbox>
<el-checkbox
false-label=
"null"
true-label=
"0"
name=
"state"
>
会员权益/升级
</el-checkbox>
<el-checkbox-group
:disabled=
"routerParams.idEdit == 'true' || routerForView"
v-model=
"storeConfigConObj.sceneType"
@
change=
"restData"
>
<el-checkbox
false-label=
"null"
:true-label=
"1"
name=
"state"
>
精品升级
</el-checkbox>
<el-checkbox
false-label=
"null"
:true-label=
"0"
name=
"state"
>
会员权益/升级
</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item
label=
"驻店员工"
>
<div
class=
"nothingTips"
>
<div>
未配置
</div>
<div
v-if=
"storeConfigConObj.merchantId && storeConfigConObj.sceneType"
>
<el-table
style=
"width: 600px;"
v-if=
"merchantTargetConfigGetStaffList.length"
:data=
"merchantTargetConfigGetStaffList"
border
stripe
:header-cell-style=
"rowClass"
>
<el-table-column
label=
"员工"
prop=
"staffName"
align=
"center"
>
</el-table-column>
<el-table-column
label=
"联系方式"
prop=
"phoneNumber"
align=
"center"
>
</el-table-column>
<el-table-column
label=
"账号创建时间"
prop=
"registerTime"
align=
"center"
>
</el-table-column>
</el-table>
<div
v-else
class=
"nothingTips"
>
<div>
未配置
</div>
<el-alert
title=
"为不影响员工查看驻店目标,请尽快配置员工账号。"
type=
"warning"
show-icon
>
</el-alert>
</div>
</div>
<!--
<el-table>
</el-table>
-->
<!--
<el-checkbox-group
v-model=
"storeConfigConObj.sceneType"
>
<el-checkbox
false-label=
"null"
true-label=
"1"
name=
"state"
>
精品升级
</el-checkbox>
<el-checkbox
false-label=
"null"
true-label=
"0"
name=
"state"
>
会员权益/升级
</el-checkbox>
</el-checkbox-group>
-->
</el-form-item>
</div>
...
...
@@ -51,7 +60,7 @@
</el-form-item>
<el-form-item
label=
"考核方案"
prop=
"periodList"
>
<!--
<span>
半个月1次
</span>
style="width: 60%" 'text-align': 'center', -->
<el-button
type=
"primary"
@
click=
"addLine"
>
新增方案
</el-button>
<el-button
v-if=
"!routerForView"
type=
"primary"
@
click=
"addLine"
>
新增方案
</el-button>
<el-table
:data=
"tableData"
border
stripe
:header-cell-style=
"rowClass"
>
<el-table-column
label=
"月度"
align=
"center"
>
<template
slot-scope=
"scope"
>
...
...
@@ -109,7 +118,7 @@
</div>
</template>
</el-table-column> -->
<el-table-column
label=
"操作"
align=
"center"
>
<el-table-column
label=
"操作"
v-if=
"!routerForView"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<span>
<!-- v-if="scope.$index != (form.tableData.length - 1)" form.tableData, -->
...
...
@@ -123,16 +132,20 @@
</el-table-column>
</el-table>
</el-form-item>
<div
class=
"footer"
>
<div
class=
"footer"
v-if=
"!routerForView"
>
<el-button
@
click=
"saveDraft"
type=
"primary"
>
存草稿
</el-button>
<el-button
@
click=
"submitForm"
type=
"primary"
>
保存
</el-button>
<el-button
@
click=
"drawerShow = false"
>
取消
</el-button>
<el-button
@
click=
"routerBack"
>
取消
</el-button>
</div>
<div
class=
"footer"
v-if=
"routerForView"
>
<el-button
@
click=
"routerBack"
type=
"primary"
>
返回
</el-button>
</div>
</div>
</el-form>
<drawerPeriodItemEdit
:visible
.
sync=
"drawerShow"
:mode=
"mode"
:period-item=
"editPeriodObj"
@
submitPeriodItem=
"submitPeriodItem"
>
@
submitPeriodItem=
"submitPeriodItem"
:store-config-con-obj-search-obj=
"storeConfigConObjSearchObj"
>
</drawerPeriodItemEdit>
<!-- </div> -->
...
...
@@ -144,7 +157,7 @@
import
{
deepClone
}
from
'@/common/util'
import
drawerPeriodItemEdit
from
'./components/drawerPeriodItemEdit.vue'
import
{
getList
}
from
'@api/merchant.js'
import
{
merchantTargetConfigUpdate
,
merchantTargetConfigGetStaffList
}
from
'@api/inStoreTargetConfig.js'
import
{
merchantTargetConfigUpdate
,
merchantTargetConfigGetStaffList
,
merchantTargetConfigDetail
}
from
'@api/inStoreTargetConfig.js'
const
periodList
=
[
{
checkMonth
:
'1'
,
...
...
@@ -243,6 +256,8 @@ export default {
},
data
()
{
return
{
merchantTargetConfigGetStaffList
:
[],
// drawerShow: true,
drawerShow
:
false
,
checkMonthObj
:
{
1
:
'首月'
,
...
...
@@ -254,7 +269,7 @@ export default {
2
:
'下半月'
},
selectCarTypeObj
:
{
0
:
'
-
'
,
0
:
'
无
'
,
1
:
'车辆价格'
,
2
:
'车辆类型'
},
...
...
@@ -295,12 +310,40 @@ export default {
// set(newVal) {
// this.$emit('dialogClose', { flag: newVal, attrName: 'addVisible' })
// }
},
routerParams
()
{
return
this
.
$route
.
query
},
routerForView
()
{
return
this
.
$route
.
name
==
'inStoreConfigView'
},
storeConfigConObjSearchObj
()
{
return
{
merchantIds
:
[
this
.
storeConfigConObj
.
merchantId
],
sceneType
:
this
.
storeConfigConObj
.
sceneType
}
}
},
mounted
()
{
this
.
getMerchantList
()
if
(
this
.
routerParams
.
merchantId
)
{
this
.
getDetail
()
}
},
methods
:
{
routerBack
()
{
this
.
$router
.
go
(
-
1
)
},
getDetail
()
{
const
{
merchantId
,
sceneType
}
=
this
.
routerParams
merchantTargetConfigDetail
({
merchantId
,
sceneType
}).
then
(
res
=>
{
console
.
log
(
res
)
this
.
storeConfigConObj
=
deepClone
(
res
)
this
.
getStaff
()
}).
catch
((
err
)
=>
{
console
.
log
(
err
)
})
},
restData
()
{
// this. = periodList
this
.
storeConfigConObj
=
deepClone
({
...
this
.
storeConfigConObj
,
periodList
})
...
...
@@ -315,7 +358,9 @@ export default {
merchantTargetConfigGetStaffList
({
merchantId
,
sceneType
}).
then
(
res
=>
{
this
.
merchantTargetConfigGetStaffList
=
res
||
[]
console
.
log
(
res
,
'merchantTargetConfigGetStaffList'
)
// this
}).
catch
((
err
)
=>
{
console
.
log
(
err
)
})
...
...
@@ -361,13 +406,13 @@ export default {
defaultFlag
:
'N'
,
checkMonth
:
'2'
,
checkPeriod
:
'1'
,
selectCarType
:
'0'
,
selectGoodsType
:
'0'
,
selectPackageType
:
'0'
,
conversionRate
:
'1'
,
conversionRatePercentage
:
'1'
,
customerUnitPrice
:
'1'
,
customerUnitPricePercentage
:
'1'
selectCarType
:
0
,
selectGoodsType
:
0
,
selectPackageType
:
1
,
conversionRate
:
1
,
conversionRatePercentage
:
1
,
customerUnitPrice
:
1
,
customerUnitPricePercentage
:
1
}
},
handleMove
()
{
...
...
@@ -381,6 +426,11 @@ export default {
const
params
=
deepClone
(
this
.
storeConfigConObj
)
merchantTargetConfigUpdate
(
params
).
then
(
res
=>
{
console
.
log
(
res
,
'merchantTargetConfigUpdate'
)
this
.
$notify
({
type
:
'success'
,
title
:
'保存成功'
})
this
.
$router
.
push
(
'/inStoreGoalsConfig'
)
}).
catch
((
err
)
=>
{
console
.
log
(
err
)
})
...
...
src/views/systemConfig/inStoreGoalsConfig/components/drawerPeriodItemEdit.vue
View file @
55867b9
...
...
@@ -18,38 +18,45 @@
</el-form-item>
<el-form-item
label=
"车主类型"
prop=
"selectCarType"
required
>
<el-radio-group
v-model=
"periodItemForm.selectCarType"
>
<el-radio
:label=
"
'0'
"
>
无
</el-radio>
<el-radio
:label=
"
'1'
"
>
车辆价格
</el-radio>
<el-radio
:label=
"
'2'
"
>
车辆类型
</el-radio>
<el-radio
:label=
"
0
"
>
无
</el-radio>
<el-radio
:label=
"
1
"
>
车辆价格
</el-radio>
<el-radio
:label=
"
2
"
>
车辆类型
</el-radio>
</el-radio-group>
<div
v-if=
"periodItemForm.selectCarType == '1'"
>
<el-input
v-model=
"periodItemForm.minCarPrice"
@
input=
"(e) =>
{ handleUpgradeNum(e, 'minCarPrice') }"
style="width: 140px;">
<i
slot=
"suffix"
style=
"font-style:normal;"
>
万
</i>
</el-input>
-
<el-input
v-model=
"periodItemForm.maxCarPrice"
@
input=
"(e) =>
{ handleUpgradeNum(e, 'maxCarPrice') }" style="width: 140px;">
<i
slot=
"suffix"
style=
"font-style:normal;"
>
万
</i>
</el-input>
<div
v-if=
"periodItemForm.selectCarType == '1'"
class=
"inputCon"
>
<!-- @input="(e) =>
{ handleUpgradeNum(e, 'minCarPrice') }" -->
<el-form-item
prop=
"minCarPrice"
:rules=
"[
{ required: true, message: '请输入最低价格', trigger: 'blur' }, { validator: validateStart, trigger: 'blur' },]"
required>
<el-input
v-model=
"periodItemForm.minCarPrice"
style=
"width: 140px;"
@
input=
"(e) =>
{ handleUpgradeNum(e, 'minCarPrice') }">
<i
slot=
"suffix"
style=
"font-style:normal;"
>
万
</i>
</el-input>
</el-form-item>
<span
style=
"margin: 0 10px;"
>
-
</span>
<el-form-item
prop=
"maxCarPrice"
:rules=
"[
{ required: true, message: '请输入最高价格', trigger: 'blur' }, { validator: validateEnd, trigger: 'blur' },]"
required>
<el-input
v-model=
"periodItemForm.maxCarPrice"
@
input=
"(e) =>
{ handleUpgradeNum(e, 'maxCarPrice') }"
style="width: 140px;">
<i
slot=
"suffix"
style=
"font-style:normal;"
>
万
</i>
</el-input>
</el-form-item>
</div>
<!-- el -->
</el-form-item>
<el-form-item
label=
"商品分类"
prop=
"selectGoodsType"
required
>
<el-radio-group
v-model=
"periodItemForm.selectGoodsType"
>
<el-radio
:label=
"
'0'
"
>
无
</el-radio>
<el-radio
:label=
"
'1'
"
>
选择分类
</el-radio>
<el-radio
:label=
"
0
"
>
无
</el-radio>
<el-radio
:label=
"
1
"
>
选择分类
</el-radio>
</el-radio-group>
<div
v-if=
"periodItemForm.selectGoodsType == '1'"
>
<el-button
type=
"primary"
@
click=
"selectGoodsType"
>
选择分类
</el-button>
<el-table
:data=
"periodItemForm.goodsTypeList"
border
stripe
:header-cell-style=
"rowClass"
>
<el-table-column
label=
"序号"
type=
"index"
:align=
"align"
/>
<el-button
type=
"primary"
@
click=
"selectGoodsTypeDialog"
>
选择分类
</el-button>
<el-table
:data=
"periodItemForm.goodsTypeList"
border
stripe
:header-cell-style=
"rowClass"
style=
"width: 500px;"
>
<el-table-column
label=
"序号"
type=
"index"
align=
"center"
width=
"100px"
/>
<el-table-column
label=
"分类名称"
align=
"center"
>
<template
slot-scope=
"scope"
>
{{
scope
.
row
.
goodsType
}}
</
template
>
</el-table-column>
<el-table-column
label=
"所属场景"
align=
"center"
>
<
template
slot-scope=
"scope"
>
<!--
{{
checkMonthObj
[
scope
.
row
.
checkMonth
]
}}
-->
{{
scope
.
row
.
categoryName
}}
</
template
>
</el-table-column>
</el-table>
...
...
@@ -57,71 +64,108 @@
</el-form-item>
<el-form-item
label=
"主推产品套餐"
prop=
"selectPackageType"
required
>
<el-radio-group
v-model=
"periodItemForm.selectPackageType"
>
<el-radio
:label=
"
'0'
"
>
无
</el-radio>
<el-radio
:label=
"
'1'
"
>
单商品或多个商品
</el-radio>
<el-radio
:label=
"
'2'
"
>
商品组合
</el-radio>
<el-radio-group
v-model=
"periodItemForm.selectPackageType"
@
change=
"restPackList"
>
<el-radio
:label=
"
0
"
>
无
</el-radio>
<el-radio
:label=
"
1
"
>
单商品或多个商品
</el-radio>
<el-radio
:label=
"
2
"
>
商品组合
</el-radio>
</el-radio-group>
<el-table
v-if=
"periodItemForm.selectPackageType == '1'"
:data=
"periodItemForm.packageList"
border
stripe
:header-cell-style=
"rowClass"
>
<el-table-column
label=
"月度"
align=
"center"
>
<div>
<el-button
v-if=
"periodItemForm.selectPackageType != '0'"
type=
"primary"
@
click=
"goodsDialogVisible = true"
>
选择商品
</el-button>
</div>
<el-table
v-if=
"periodItemForm.selectPackageType == 2"
:data=
"periodItemForm.packageList"
border
stripe
:header-cell-style=
"rowClass"
style=
"width: 800px;"
>
<el-table-column
label=
"序号"
type=
"index"
align=
"center"
width=
"50px"
/>
<el-table-column
prop=
"goodsName"
align=
"center"
label=
"商品名称"
></el-table-column>
<el-table-column
prop=
"categoryName"
align=
"center"
label=
"商品图"
>
<
template
slot-scope=
"scope"
>
{{
checkMonthObj
[
scope
.
row
.
checkMonth
]
}}
<img
:src=
"scope.row.goodsInfo.thumbUrl"
style=
"width: 50px; height: 50px"
/>
</
template
>
</el-table-column>
<el-table-column
label=
"goodsType"
align=
"center
"
>
<el-table-column
prop=
"categoryName"
align=
"center"
label=
"价格
"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
goodsType
}}
<span>
{{
scope
.
row
.
goodsInfo
.
shopPrice
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"月度"
align=
"center"
>
</el-table>
<el-table
v-if=
"periodItemForm.selectPackageType == 1"
:data=
"periodItemForm.packageList"
border
stripe
:header-cell-style=
"rowClass"
style=
"width: 750px;"
>
<el-table-column
label=
"序号"
type=
"index"
align=
"center"
width=
"50px"
/>
<el-table-column
prop=
"goodsName"
align=
"center"
label=
"商品名称"
></el-table-column>
<el-table-column
prop=
"categoryName"
align=
"center"
label=
"商品图"
>
<
template
slot-scope=
"scope"
>
{{
checkMonthObj
[
scope
.
row
.
checkMonth
]
}}
<img
:src=
"scope.row.goodsInfo.thumbUrl"
style=
"width: 50px; height: 50px"
/>
</
template
>
</el-table-column>
</el-table>
<el-table
v-if=
"periodItemForm.selectPackageType == '2'"
:data=
"periodItemForm.packageList"
border
stripe
:header-cell-style=
"rowClass"
>
<el-table-column
label=
"月度"
align=
"center"
>
<el-table-column
prop=
"categoryName"
align=
"center"
label=
"价格"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
goodsInfo
.
shopPrice
}}
</span>
</
template
>
</el-table-column>
<el-table-column
prop=
"categoryName"
align=
"center"
label=
"目标转化率"
>
<
template
slot-scope=
"scope"
>
{{
checkMonthObj
[
scope
.
row
.
checkMonth
]
}}
<!--
<span>
{{
scope
.
row
.
goodsInfo
.
shopPrice
}}
</span>
-->
<el-input
v-model=
"scope.row.conversionRate"
style=
"width: 70px;"
@
input=
"(e) =>
{ handleUpgradeNumTable(e, 'conversionRate', 0, scope.$index,) }">
<i
slot=
"suffix"
style=
"font-style:normal;"
>
%
</i>
</el-input>
</
template
>
</el-table-column>
<el-table-column
label=
"goodsType"
align=
"center
"
>
<el-table-column
prop=
"conversionRatePercentage"
align=
"center"
label=
"提成系数
"
>
<
template
slot-scope=
"scope"
>
{{
scope
.
row
.
goodsType
}}
<!--
<span>
{{
scope
.
row
.
goodsInfo
.
shopPrice
}}
</span>
-->
<el-input
v-model=
"scope.row.conversionRatePercentage"
@
input=
"(e) =>
{ handleUpgradeNumTable(e, 'conversionRatePercentage', 0, scope.$index,) }"
style="width: 70px;">
<i
slot=
"suffix"
style=
"font-style:normal;"
>
%
</i>
</el-input>
</
template
>
</el-table-column>
<el-table-column
label=
"月度"
align=
"center
"
>
<el-table-column
prop=
"customerUnitPrice"
align=
"center"
label=
"目标客单价
"
>
<
template
slot-scope=
"scope"
>
{{
checkMonthObj
[
scope
.
row
.
checkMonth
]
}}
<!--
<span>
{{
scope
.
row
.
goodsInfo
.
shopPrice
}}
</span>
-->
<el-input
v-model=
"scope.row.customerUnitPrice"
@
input=
"(e) =>
{ handleUpgradeNumTable(e, 'customerUnitPrice', 3, scope.$index,) }"
style="width: 70px;">
<i
slot=
"suffix"
style=
"font-style:normal;"
>
元
</i>
</el-input>
</
template
>
</el-table-column>
<el-table-column
prop=
"customerUnitPricePercentage"
align=
"center"
label=
"提成系数"
>
<
template
slot-scope=
"scope"
>
<!--
<span>
{{
scope
.
row
.
goodsInfo
.
shopPrice
}}
</span>
-->
<el-input
v-model=
"scope.row.customerUnitPricePercentage"
@
input=
"(e) =>
{ handleUpgradeNumTable(e, 'customerUnitPricePercentage', 0, scope.$index,) }"
style="width: 70px;">
<i
slot=
"suffix"
style=
"font-style:normal;"
>
%
</i>
</el-input>
</
template
>
</el-table-column>
</el-table>
</el-form-item>
<div
v-if=
"periodItemForm.selectPackageType != '1'"
>
<el-form-item
label=
"目标转化率"
:rules=
"[{ required: true, message: '请输入目标转化率', trigger:
'change' }
]"
<el-form-item
label=
"目标转化率"
:rules=
"[{ required: true, message: '请输入目标转化率', trigger:
['blur', 'change'] },
]"
prop=
"conversionRate"
required
>
<el-input
v-model=
"periodItemForm.conversionRate"
@
input=
"(e) => { handleUpgradeNum(e, 'conversionRate') }"
style=
"width: 300px;"
>
<i
slot=
"suffix"
style=
"font-style:normal;"
>
%
</i>
</el-input>
</el-form-item>
<el-form-item
label=
"提成系数"
:rules=
"[{ required: true, message: '请输入提成系数', trigger:
'change'
}]"
<el-form-item
label=
"提成系数"
:rules=
"[{ required: true, message: '请输入提成系数', trigger:
['blur', 'change']
}]"
prop=
"conversionRatePercentage"
required
>
<el-input
v-model=
"periodItemForm.conversionRatePercentage"
@
input=
"(e) => { handleUpgradeNum(e, 'conversionRatePercentage') }"
style=
"width: 300px;"
>
<i
slot=
"suffix"
style=
"font-style:normal;"
>
%
</i>
</el-input>
</el-form-item>
<el-form-item
label=
"目标客单价"
:rules=
"[{ required: true, message: '请输入目标客单价', trigger:
'change'
}]"
<el-form-item
label=
"目标客单价"
:rules=
"[{ required: true, message: '请输入目标客单价', trigger:
['blur', 'change']
}]"
prop=
"customerUnitPrice"
required
>
<el-input
v-model=
"periodItemForm.customerUnitPrice"
@
input=
"(e) => { handleUpgradeNum(e, 'customerUnitPrice') }"
style=
"width: 300px;"
>
<i
slot=
"suffix"
style=
"font-style:normal;"
>
元
</i>
</el-input>
</el-form-item>
<el-form-item
label=
"提成系数"
:rules=
"[{ required: true, message: '请输入提成系数', trigger:
'change'
}]"
<el-form-item
label=
"提成系数"
:rules=
"[{ required: true, message: '请输入提成系数', trigger:
['blur', 'change']
}]"
prop=
"customerUnitPricePercentage"
required
>
<el-input
v-model=
"periodItemForm.customerUnitPricePercentage"
@
input=
"(e) => { handleUpgradeNum(e, 'customerUnitPricePercentage') }"
style=
"width: 300px;"
>
...
...
@@ -148,21 +192,40 @@
</div>
</el-drawer>
<selectGoodsTypeDialog
:store-config-con-obj-search-obj=
"storeConfigConObjSearchObj"
:goods-type-list=
"periodItemForm.goodsTypeList"
:dialog-visible
.
sync=
"dialogVisible"
@
handleAddConfirm=
"handleAddConfirmSelectGoodsType"
v-if=
"dialogVisible"
>
</selectGoodsTypeDialog>
<selectGoodsDialog
:store-config-con-obj-search-obj=
"storeConfigConObjSearchObj"
:package-list=
"periodItemForm.packageList"
:goods-type-list=
"periodItemForm.goodsTypeList"
:dialog-visible
.
sync=
"goodsDialogVisible"
@
handleAddConfirm=
"handleAddConfirmSelectGoods"
v-if=
"goodsDialogVisible"
>
</selectGoodsDialog>
</div>
</template>
<
script
>
import
{
deepClone
}
from
'@/common/util'
import
{
limitPrice
}
from
'@/common/format'
import
{
getCarInfo
}
from
'@api/editCustomer'
import
{
queryMerchantGoodsCategoryList
}
from
'@api/inStoreTargetConfig'
import
selectGoodsTypeDialog
from
'./selectGoodsTypeDialog'
import
selectGoodsDialog
from
'./selectGoodsDialog'
export
default
{
name
:
'DrawerPeriodItemEdit'
,
components
:
{
selectGoodsTypeDialog
,
selectGoodsDialog
},
props
:
{
visible
:
{
type
:
Boolean
,
default
:
false
},
storeConfigConObjSearchObj
:
{
type
:
Object
,
default
:
()
=>
({})
},
periodItem
:
{
type
:
Object
,
default
:
()
=>
({})
...
...
@@ -171,9 +234,12 @@ export default {
type
:
String
,
default
:
'add'
}
},
data
()
{
return
{
dialogVisible
:
false
,
goodsDialogVisible
:
false
,
baseData
:
{
MonthList
:
[{
value
:
'1'
,
...
...
@@ -195,12 +261,16 @@ export default {
checkMonth
:
'1'
,
checkPeriod
:
'1'
,
selectCarType
:
'0'
,
selectGoodsType
:
'
0
'
,
selectPackageType
:
'
0
'
,
selectGoodsType
:
'
1
'
,
selectPackageType
:
'
2
'
,
conversionRate
:
'1'
,
conversionRatePercentage
:
'1'
,
customerUnitPrice
:
'1'
,
customerUnitPricePercentage
:
'1'
customerUnitPricePercentage
:
'1'
,
minCarPrice
:
''
,
maxCarPrice
:
''
,
goodsTypeList
:
[],
packageList
:
[]
// sceneType: ''
},
rulesItem
:
{
...
...
@@ -241,14 +311,142 @@ export default {
}
},
methods
:
{
restPackList
()
{
// this.periodItemForm.packageList = []
this
.
periodItemForm
=
{
...
this
.
periodItemForm
,
packageList
:
[],
conversionRate
:
''
,
conversionRatePercentage
:
''
,
customerUnitPrice
:
''
,
customerUnitPricePercentage
:
''
}
},
handleUpgradeNumTable
(
newValue
,
name
,
type
,
index
)
{
// 'expenseCategoryValue'
// expenseCategoryValue
// debugger
console
.
log
(
name
,
this
.
periodItemForm
[
index
],
"this.classificationObj"
)
// let valueName
// if (ChildrenIndex != undefined) {
// valueName = this.classificationObj[name][index].children[ChildrenIndex]
// } else {
// }
const
valueName
=
this
.
periodItemForm
.
packageList
[
index
]
console
.
log
(
valueName
,
"valueName"
)
// debugger
// const obj = this.classificationObj[name][index]
// console.log(obj)
// // obj.expenseCategoryValue = newValue
// // this.$set(this.classificationObj[name], index, obj)
// return
newValue
=
newValue
.
replace
(
/
[^\d
.
]
/g
,
""
)
// 清除“数字”和“.”以外的字符
console
.
log
(
newValue
)
console
.
log
(
name
,
"name"
,
type
,
"type"
,
index
,
"index"
)
// const handleName = this.classificationObj[name][index]
// 按金额
if
(
type
==
3
)
{
// this.classificationObj[name][index].expenseCategoryValue = limitPrice(newValue, this.accountSecondSetForm[name], 10, 2)
valueName
[
name
]
=
limitPrice
(
newValue
,
valueName
[
name
],
10
,
2
)
// 按百分比
}
else
{
// console.log(newValue)
// 验证第一个字符是数字
newValue
=
newValue
.
replace
(
/^
\.
/g
,
""
)
// 只保留第一个, 清除多余的
newValue
=
newValue
.
replace
(
/
\.{2,}
/g
,
"."
)
newValue
=
newValue
.
replace
(
"."
,
"$#$"
)
.
replace
(
/
\.
/g
,
""
)
.
replace
(
"$#$"
,
"."
)
// 只能输入两个小数
// eslint-disable-next-line no-useless-escape
newValue
=
newValue
.
replace
(
/^
(\-)
*
(\d
+
)\.(\d\d)
.*$/
,
"$1$2.$3"
)
if
(
newValue
>
100
)
newValue
=
100
if
(
newValue
<
0
)
newValue
=
0
console
.
log
(
newValue
)
valueName
[
name
]
=
newValue
// this.$set(this.classificationObj[name][index], 'expenseCategoryValue', newValue)
// console.log(this.classificationObj[name][index].expenseCategoryValue)
}
this
.
$forceUpdate
()
// 强制更新
},
handleAddConfirmSelectGoods
(
list
)
{
console
.
log
(
list
,
'handleAddConfirmSelectGoods'
)
// const newList = [...list, ...this.periodItemForm.packageList]
// // 根据id去重
// const obj = {}
// const setList = newList.reduce((cur, next) => {
// obj[next.id] ? "" : obj[next.id] = true && cur.push(next)
// return cur
// }, [])
if
(
this
.
periodItemForm
.
selectPackageType
==
'1'
)
{
// this.periodItemForm.packageList = deepClone(list)
list
=
list
.
map
(
item
=>
{
return
{
conversionRate
:
''
,
conversionRatePercentage
:
''
,
customerUnitPrice
:
''
,
customerUnitPricePercentage
:
''
,
...
item
// goodsInfo: {
// ...item.goodsInfo,
// shopPrice: item.goodsInfo.shopPrice / 100
// }
}
})
}
else
{
// this.periodItemForm.packageList = deepClone(list)
}
this
.
periodItemForm
.
packageList
=
deepClone
(
list
)
},
handleAddConfirmSelectGoodsType
(
list
)
{
this
.
periodItemForm
.
goodsTypeList
=
deepClone
(
list
)
},
selectGoodsTypeDialog
()
{
this
.
dialogVisible
=
true
},
validateStart
(
rule
,
value
,
callback
)
{
if
(
this
.
periodItemForm
.
maxCarPrice
)
{
this
.
$refs
.
periodItem
.
validateField
(
'endObj'
)
}
callback
()
},
validateEnd
(
rule
,
value
,
callback
)
{
if
(
this
.
periodItemForm
.
minCarPrice
)
{
if
(
Number
(
this
.
periodItemForm
.
minCarPrice
)
<
Number
(
value
))
{
callback
()
}
else
{
callback
(
new
Error
(
'最高价格必须大于最小价格'
))
}
}
else
{
callback
()
}
},
selectGoodsType
()
{
},
// 设置表头的颜色
rowClass
({
row
,
rowIndex
})
{
// console.log(rowIndex) // 表头行标号为0
return
'background:#F4F6FC'
},
// handleUpgradeNumPrice(newVal, name) {
// console.log('newVal', newVal, name)
// this.periodItemForm[name] = limitPrice(parseInt(newVal), this.oldVal[name], 5, 2, parseInt(this.periodItemForm.minCarPrice || 0), 999999)
// this.oldVal[name] = deepClone(this.periodItemForm[name])
// },
handleUpgradeNum
(
newVal
,
name
)
{
console
.
log
(
'newVal'
,
newVal
,
name
)
let
maxLength
=
5
let
maxNum
=
100
if
(
name
==
'customerUnitPrice'
)
{
if
(
[
'customerUnitPrice'
,
'minCarPrice'
,
'maxCarPrice'
].
includes
(
name
)
)
{
maxLength
=
6
maxNum
=
999999
}
...
...
@@ -280,6 +478,10 @@ export default {
</
script
>
<
style
lang=
"scss"
scoped
>
.inputCon
{
display
:
flex
;
}
.shoppingCartDrawerCon
{
//
position
:
relative
;
...
...
@@ -291,6 +493,11 @@ export default {
font-size
:
20px
;
}
::v-deep
.el-drawer__body
{
//
padding
:
0
20px
;
overflow
:
auto
;
}
.footer
{
text-align
:
center
;
}
...
...
src/views/systemConfig/inStoreGoalsConfig/components/selectGoodsDialog.vue
0 → 100644
View file @
55867b9
<
template
>
<baseDialog
:dialog-config=
"dialogConfig"
:is-show
.
sync=
"visible"
class=
"accountDailog"
@
handleClick=
"handleAddConfirm"
>
<div
class=
"tableBox"
>
<!--
<span>
<p
class=
"edit-title"
style=
"textAlign:center"
>
{{
showData
[
sourcePage
].
title
}}
<el-button
type=
"text"
style=
"paddingLeft:20px"
v-if=
"sourcePage == 'serviceStore'"
@
click=
"resetCheck"
>
重新选择
</el-button>
</p>
</span>
-->
<!--
<div
class=
"checkSpan"
>
<p
v-for=
"item in selectedDataShow"
>
已选:
<span
style=
"paddingRight:20px"
>
{{
item
.
merchantName
}}
</span><span>
{{
item
.
merchantId
}}
</span>
</p>
</div>
-->
<div
style=
"padding: 10px 50px;"
>
<el-input
v-model=
"upgradeGoodsName"
placeholder=
"搜索商品名称"
maxlength=
"20"
style=
"width:300px;paddingRight:20px"
/>
<el-button
size=
"small"
type=
"primary"
@
click=
"search"
>
查询
</el-button>
</div>
<!-- @select="selectFn"-->
<el-table
ref=
"selectingTable"
height=
"464px"
:row-key=
"rowKey"
:data=
"selectedTableData"
class=
"table"
border
@
select-all=
"handleAll"
@
select=
"selectFn"
:header-cell-class-name=
"cellClass"
>
<!-- :selectable="selectable" -->
<el-table-column
type=
"selection"
:reserve-selection=
"true"
width=
"55"
align=
"center"
/>
<el-table-column
prop=
"goodsName"
align=
"center"
label=
"商品名称"
></el-table-column>
<el-table-column
prop=
"categoryName"
align=
"center"
label=
"商品图"
>
<template
slot-scope=
"scope"
>
<img
:src=
"scope.row.goodsInfo.thumbUrl"
style=
"width: 50px; height: 50px"
/>
</
template
>
</el-table-column>
<el-table-column
prop=
"categoryName"
align=
"center"
label=
"价格"
>
<
template
slot-scope=
"scope"
>
<span>
{{
scope
.
row
.
goodsInfo
.
shopPrice
}}
</span>
</
template
>
</el-table-column>
</el-table>
<el-pagination
small
background
:page-sizes=
"[10, 20, 30, 40]"
@
size-change=
"handleSizeChange"
@
current-change=
"handleCurrentChange"
:current-page
.
sync=
"currentPage"
:page-size=
"pageSize"
layout=
"total,sizes, prev, pager, next,jumper"
:total=
"total"
/>
</div>
</baseDialog>
</template>
<
script
>
import
{
getGroundingManageList
}
from
'@api/grounding'
// import { queryMerchantGoodsCategoryList } from '@api/inStoreTargetConfig'
import
{
deepClone
}
from
'@/common/util'
export
default
{
name
:
'SelectGoodsDialog'
,
props
:
{
dialogVisible
:
{
type
:
Boolean
,
default
:
false
},
storeConfigConObjSearchObj
:
{
type
:
Object
,
default
:
()
=>
({})
},
// 页面来源
// sourcePage: {
// type: String,
// default: ''
// },
// storeApi: {
// type: Function,
// default: () => { }
// },
selectedRecord
:
{
type
:
Array
,
default
:
()
=>
[]
},
goodsTypeList
:
{
type
:
Array
,
default
:
()
=>
[]
},
packageList
:
{
type
:
Array
,
default
:
()
=>
[]
}
// storeSearchForm: {
// type: Object,
// default: () => { }
// }
},
data
()
{
return
{
upgradeGoodsName
:
''
,
selectedTableData
:
[],
selectedTableList
:
[],
// selectedDataShow: [],
// selectingData: [],
// needTip: ['editProduct'],
// 分页
total
:
0
,
currentPage
:
1
,
pageSize
:
10
,
// baseData: {
// RefStoreList: []
// },
searchFormSearch
:
{},
dialogConfig
:
{
title
:
'商品分类'
,
width
:
'800px'
}
}
},
computed
:
{
visible
:
{
get
()
{
return
this
.
dialogVisible
},
set
(
val
)
{
this
.
$emit
(
'update:dialogVisible'
,
val
)
}
}
},
watch
:
{
},
mounted
()
{
this
.
queryMerchantGoodsCategoryList
()
this
.
selectedTableList
=
deepClone
(
this
.
packageList
)
// console.log('this.queryMerchantGoodsCategoryList')
},
methods
:
{
rowKey
(
row
)
{
return
row
.
id
},
search
()
{
this
.
currentPage
=
1
this
.
pageSize
=
10
this
.
queryMerchantGoodsCategoryList
()
},
queryMerchantGoodsCategoryList
()
{
const
goodsTypeList
=
this
.
goodsTypeList
.
map
(
item
=>
item
.
categoryType
)
const
params
=
{
goodsSource
:
0
,
upgradeProductFlag
:
'Y'
,
...
this
.
storeConfigConObjSearchObj
,
upgradeGoodsName
:
this
.
upgradeGoodsName
,
goodsTypeList
,
currentPage
:
this
.
currentPage
,
pageSize
:
this
.
pageSize
}
getGroundingManageList
(
params
).
then
(
res
=>
{
this
.
selectedTableData
=
res
.
list
.
map
(
item
=>
{
item
.
merchantGoodsId
=
item
.
id
delete
item
.
createdDate
delete
item
.
updatedDate
return
item
})
this
.
total
=
res
.
total
console
.
log
(
res
,
'getGroundingManageList'
)
this
.
$nextTick
(()
=>
{
this
.
selectedTableData
.
forEach
(
item
=>
{
this
.
packageList
.
forEach
(
d
=>
{
if
(
d
.
id
==
item
.
id
)
{
this
.
$refs
.
selectingTable
.
toggleRowSelection
(
item
,
true
)
}
})
})
})
console
.
log
(
res
,
this
.
selectedTableData
)
// this.goodsTypeList =
// console.log
}).
catch
((
err
)
=>
{
console
.
log
(
err
)
})
},
handleAddConfirm
()
{
const
selectItemList
=
this
.
$refs
.
selectingTable
.
selection
if
(
selectItemList
.
length
||
this
.
selectedTableList
.
length
)
{
this
.
visible
=
false
this
.
$emit
(
"handleAddConfirm"
,
selectItemList
)
}
else
{
this
.
$message
.
warning
(
'请勾选商品'
)
}
// console.log(selectItemList)
// this.$emit('handleAddConfirm')
},
// cellClass(row) {
// // if (this.showData[this.sourcePage].selectMethod == 'Single') { // 单选时隐藏全选按钮
// if (row.columnIndex === 0) {
// return 'disabledCheck'
// }
// // }
// },
selectFn
(
selection
,
row
)
{
console
.
log
(
JSON
.
stringify
(
selection
).
indexOf
(
JSON
.
stringify
(
row
))
==
-
1
,
'selectFn'
)
if
(
JSON
.
stringify
(
selection
).
indexOf
(
JSON
.
stringify
(
row
))
==
-
1
)
{
this
.
selectedTableList
=
this
.
packageList
.
filter
(
item
=>
item
.
id
!==
row
.
id
)
}
else
{
console
.
log
(
selection
,
row
,
'selectFn'
)
this
.
selectedTableList
.
push
(
row
)
}
// if (this.showData[this.sourcePage].selectMethod == 'Single') {
// this.dialogCheck(selection, row)
// } else {
// this.handleChange(selection, row)
// }
},
// dialogCheck: function (selection, row) {
// this.$refs[this.seletingTable].clearSelection()
// this.selectedData = []
// this.selectedDataShow = []
// if (row) {
// this.$refs[this.seletingTable].toggleRowSelection(row, true)
// this.selectedDataShow.push({ merchantName: row.merchantName, merchantId: row.merchantNo })
// this.selectedData.push(row)
// }
// this.$emit('chooseData', this.selectedData)
// },
// selectable(row, index) {
// if (row.isDisable) {
// return false
// }
// return true
// },
// getSelectingList() {
// // console.log('this.selectedRecord_2', this.selectedRecord);
// // console.log('this.selectedData_2', this.selectedData);
// const params = {
// currentPage: this.currentPage,
// pageSize: this.pageSize,
// categoryName: this.categoryName
// }
// if (this.sourcePage != '4sStore') { // 只有4s点列表需要分页
// params.currentPage = 1
// params.pageSize = 100000
// }
// this.storeApi(params).then(res => {
// this.selectingData = res.list
// this.total = res.total
// })
// },
// searchList() {
// this.getSelectingList()
// },
// handleChange(selection, row) {
// // console.log('handleChange');
// // console.log('selection', selection);
// // console.log('row', row);
// // console.log('JSON.stringify(selection).indexOf(JSON.stringify(row)) == -1', JSON.stringify(selection).indexOf(JSON.stringify(row)) == -1);
// if (this.sourcePage == 'serviceStore') { // 服务商
// if (JSON.stringify(selection).indexOf(JSON.stringify(row)) == -1) { // 判断是否取消选中
// // 如果是取消,则判断是否存在财务规则
// const showIndex = this.selectedDataShow.findIndex(item => (item.merchantId == row.merchantNo))
// const dataIndex = this.selectedData.findIndex(item => (item.merchantNo == row.merchantNo))
// let showHtml = ''
// switch (row.ruleFlag) {
// case 1:
// showHtml = '该商户配置有财务规则,取消关联会重置财务配置;被修改的关联关系保存后,系统自动重置对应4s在对应场景的财务规则'
// break
// case 2:
// showHtml = '该商户配置有对账规则,取消关联会重置对账配置;被修改的关联关系保存后,系统自动重置对应4s在对应场景的对账规则'
// break
// case 3:
// showHtml = '该商户配置有财务规则和对账规则,取消关联会重置财务配置和对账配置;被修改的关联关系保存后,系统自动重置对应4s在对应场景的财务规则和对账规则'
// break
// default:
// showHtml = ''
// }
// if (row.ruleFlag == 1 || row.ruleFlag == 2 || row.ruleFlag == 3) {
// this.$confirm(showHtml, '提示', {
// confirmButtonText: '确定',
// showCancelButton: true,
// type: 'warning'
// }).then(() => {
// this.selectedDataShow.splice(showIndex, 1)
// this.selectedData.splice(dataIndex, 1)
// }).catch(err => {
// this.$refs[this.seletingTable].toggleRowSelection(row, true)
// })
// } else {
// this.selectedDataShow.splice(showIndex, 1)
// this.selectedData.splice(dataIndex, 1)
// }
// } else {
// // 新增则添加
// this.selectedDataShow.push({ merchantName: row.merchantName, merchantId: row.merchantNo })
// this.selectedData.push(row)
// }
// }
// if (this.selectedRecord.length == 0) {
// this.$emit('chooseData', this.selectedData)
// }
// },
handleAll
(
selection
)
{
this
.
selectedData
=
selection
this
.
selectedDataShow
=
selection
this
.
$emit
(
'chooseData'
,
selection
)
},
handleSizeChange
(
val
)
{
this
.
pageSize
=
val
this
.
pageSize
=
1
this
.
queryMerchantGoodsCategoryList
()
},
handleCurrentChange
(
val
)
{
this
.
currentPage
=
val
this
.
queryMerchantGoodsCategoryList
()
},
cellClass
(
row
)
{
if
(
row
.
columnIndex
===
0
)
{
return
'disableheadselection'
}
}
// handleRelateStoreConfirm() {
// this.$emit('handleRelateStoreConfirm', this.selectedData)
// },
// handleRelateStoreClose() {
// this.$emit('handleRelateStoreClose')
// },
// resetCheck() {
// const allCheck = this.$refs[this.seletingTable].selection
// const flag = allCheck.some((item) => {
// return item.ruleFlag == 1 || item.ruleFlag == 2 || item.ruleFlag == 3
// })
// if (flag) {
// this.$confirm('选择的商户中配置有财务规则或对账规则,取消关联会重置财务配置或对账配置', '提示', {
// confirmButtonText: '确定',
// showCancelButton: true,
// type: 'warning'
// }).then(() => {
// this.$refs[this.seletingTable].clearSelection()
// this.selectedData = []
// this.selectedDataShow = []
// this.$emit('chooseData', this.selectedData)
// }).catch(err => {
// console.log(err)
// })
// } else {
// this.$refs[this.seletingTable].clearSelection()
// this.selectedData = []
// this.selectedDataShow = []
// this.$emit('chooseData', this.selectedData)
// }
// },
// clearSelect() {
// const checkItem = this.$refs[this.seletingTable].selection
// if (checkItem && checkItem.length > 0) {
// this.$refs[this.seletingTable].clearSelection()
// }
// this.selectedData = []
// this.selectedDataShow = []
// }
}
}
</
script
>
<
style
lang=
"scss"
scoped
>
::v-deep
.disableheadselection
>
.cell
.el-checkbox__inner
{
display
:
none
;
}
</
style
>
src/views/systemConfig/inStoreGoalsConfig/components/selectGoodsTypeDialog.vue
0 → 100644
View file @
55867b9
<
template
>
<baseDialog
:dialog-config=
"dialogConfig"
:is-show
.
sync=
"visible"
class=
"accountDailog"
@
handleClick=
"handleAddConfirm"
>
<div
class=
"tableBox"
>
<!--
<span>
<p
class=
"edit-title"
style=
"textAlign:center"
>
{{
showData
[
sourcePage
].
title
}}
<el-button
type=
"text"
style=
"paddingLeft:20px"
v-if=
"sourcePage == 'serviceStore'"
@
click=
"resetCheck"
>
重新选择
</el-button>
</p>
</span>
-->
<!--
<div
class=
"checkSpan"
>
<p
v-for=
"item in selectedDataShow"
>
已选:
<span
style=
"paddingRight:20px"
>
{{
item
.
merchantName
}}
</span><span>
{{
item
.
merchantId
}}
</span>
</p>
</div>
-->
<div
style=
"padding: 10px 50px;"
>
<el-input
v-model=
"categoryName"
placeholder=
"搜索商品分类名称"
maxlength=
"20"
style=
"width:300px;paddingRight:20px"
/>
<el-button
size=
"small"
type=
"primary"
@
click=
"queryMerchantGoodsCategoryList"
>
查询
</el-button>
</div>
<!-- height="464px" @select="selectFn"-->
<el-table
ref=
"selectingTable"
:row-key=
"rowKey"
:data=
"selectedTableData"
class=
"table"
border
@
select-all=
"handleAll"
:header-cell-class-name=
"cellClass"
>
<!-- :selectable="selectable" -->
<el-table-column
type=
"selection"
:reserve-selection=
"true"
width=
"55"
align=
"center"
/>
<el-table-column
prop=
"categoryName"
align=
"center"
label=
"分类名称"
>
</el-table-column>
</el-table>
<!--
<el-pagination
v-if=
"sourcePage == '4sStore'"
small
background
@
current-change=
"handleCurrentChange"
:current-page
.
sync=
"currentPage"
:page-size=
"pageSize"
layout=
"total, prev, pager, next"
:total=
"total"
/>
-->
</div>
</baseDialog>
</
template
>
<
script
>
import
{
queryMerchantGoodsCategoryList
}
from
'@api/inStoreTargetConfig'
import
{
deepClone
}
from
'@/common/util'
export
default
{
name
:
'SelectGoodsTypeDialog'
,
props
:
{
dialogVisible
:
{
type
:
Boolean
,
default
:
false
},
storeConfigConObjSearchObj
:
{
type
:
Object
,
default
:
()
=>
({})
},
// 页面来源
// sourcePage: {
// type: String,
// default: ''
// },
// storeApi: {
// type: Function,
// default: () => { }
// },
selectedRecord
:
{
type
:
Array
,
default
:
()
=>
[]
},
goodsTypeList
:
{
type
:
Array
,
default
:
()
=>
[]
}
// storeSearchForm: {
// type: Object,
// default: () => { }
// }
},
data
()
{
return
{
// showData: {
// '4sStore': {
// title: '4S店列表',
// selectMethod: 'Single'
// },
// yqStore: {
// title: '园区店列表',
// selectMethod: 'Single'
// },
// serviceStore: {
// title: '服务商列表',
// selectMethod: 'Multiple'
// }
// },
// seletingTable: this.sourcePage + 'SeletingTable',
categoryName
:
''
,
selectedTableData
:
[],
// selectedDataShow: [],
// selectingData: [],
// needTip: ['editProduct'],
// 分页
total
:
0
,
currentPage
:
1
,
pageSize
:
20
,
// baseData: {
// RefStoreList: []
// },
searchFormSearch
:
{},
// getListApi: '',
// searchSelectObj: {},
// searchForm: {},
dialogConfig
:
{
title
:
'商品分类'
,
width
:
'800px'
}
// tableParams: {
// btnId: new Date().getTime() + parseInt(Math.random() * 1000),
// listName: 'list',
// mutiSelectUniqueKey: 'id',
// mutiSelectName: 'orderSupplement',
// tableOption: { width: '200px' },
// tableColumns: [{
// label: '交易参考号',
// prop: 'tradeNo',
// width: '160px'
// }]
// },
// showFormData: [{
// label: '订单时间',
// name: 'payDate',
// type: 'datePicker',
// isClear: true,
// pickerOptions: 'rangePickerOptions'
// }
// ]
}
},
computed
:
{
visible
:
{
get
()
{
return
this
.
dialogVisible
},
set
(
val
)
{
this
.
$emit
(
'update:dialogVisible'
,
val
)
}
}
},
watch
:
{
// selectedRecord(val) {
// // console.log('selectedRecord_1', val);
// this.selectedData = []
// this.selectedDataShow = []
// this.$refs[this.seletingTable].clearSelection()
// if (val.length > 0) {
// this.selectedDataShow = deepClone(val)
// this.selectingData.forEach(d => {
// this.selectedRecord.forEach(item => {
// if (d.merchantNo == item.merchantId) {
// d.ruleFlag = item.ruleFlag
// this.selectedData.push(d)
// this.$refs[this.seletingTable].toggleRowSelection(d, true)
// }
// })
// })
// }
// // console.log('this.selectedData_1', this.selectedData)
// this.$emit('chooseData', this.selectedData)
// },
// selectingData(val) {
// // console.log('watch selectingData', val);
// // console.log('watch selectingData this.selectedData', this.selectedData);
// if (val.length > 0 && this.selectedData.length > 0) {
// val.forEach(d => {
// this.selectedData.forEach(item => {
// if (d.merchantNo == item.merchantNo) {
// d.ruleFlag = item.ruleFlag
// this.$nextTick(_ => {
// this.$refs[this.seletingTable].toggleRowSelection(d, true)
// })
// }
// })
// })
// }
// }
},
mounted
()
{
this
.
queryMerchantGoodsCategoryList
()
// console.log('this.queryMerchantGoodsCategoryList')
},
methods
:
{
rowKey
(
row
)
{
return
row
.
categoryType
},
queryMerchantGoodsCategoryList
()
{
const
params
=
{
goodsSource
:
0
,
...
this
.
storeConfigConObjSearchObj
,
categoryName
:
this
.
categoryName
}
queryMerchantGoodsCategoryList
(
params
).
then
(
res
=>
{
this
.
selectedTableData
=
res
this
.
$nextTick
(()
=>
{
this
.
selectedTableData
.
forEach
(
item
=>
{
this
.
goodsTypeList
.
forEach
(
d
=>
{
if
(
d
.
categoryType
==
item
.
categoryType
)
{
this
.
$refs
.
selectingTable
.
toggleRowSelection
(
item
,
true
)
}
})
})
})
console
.
log
(
res
,
this
.
selectedTableData
)
// this.goodsTypeList =
// console.log
}).
catch
((
err
)
=>
{
console
.
log
(
err
)
})
},
handleAddConfirm
()
{
const
selectItemList
=
this
.
$refs
.
selectingTable
.
selection
if
(
selectItemList
.
length
)
{
this
.
visible
=
false
this
.
$emit
(
"handleAddConfirm"
,
selectItemList
)
}
else
{
this
.
$message
(
'请勾选分类'
)
}
// console.log(selectItemList)
// this.$emit('handleAddConfirm')
},
cellClass
(
row
)
{
// if (this.showData[this.sourcePage].selectMethod == 'Single') { // 单选时隐藏全选按钮
if
(
row
.
columnIndex
===
0
)
{
return
'disabledCheck'
}
// }
},
// selectFn(selection, row) {
// if (this.showData[this.sourcePage].selectMethod == 'Single') {
// this.dialogCheck(selection, row)
// } else {
// this.handleChange(selection, row)
// }
// },
// dialogCheck: function (selection, row) {
// this.$refs[this.seletingTable].clearSelection()
// this.selectedData = []
// this.selectedDataShow = []
// if (row) {
// this.$refs[this.seletingTable].toggleRowSelection(row, true)
// this.selectedDataShow.push({ merchantName: row.merchantName, merchantId: row.merchantNo })
// this.selectedData.push(row)
// }
// this.$emit('chooseData', this.selectedData)
// },
// selectable(row, index) {
// if (row.isDisable) {
// return false
// }
// return true
// },
// getSelectingList() {
// // console.log('this.selectedRecord_2', this.selectedRecord);
// // console.log('this.selectedData_2', this.selectedData);
// const params = {
// currentPage: this.currentPage,
// pageSize: this.pageSize,
// categoryName: this.categoryName
// }
// if (this.sourcePage != '4sStore') { // 只有4s点列表需要分页
// params.currentPage = 1
// params.pageSize = 100000
// }
// this.storeApi(params).then(res => {
// this.selectingData = res.list
// this.total = res.total
// })
// },
// searchList() {
// this.getSelectingList()
// },
// handleChange(selection, row) {
// // console.log('handleChange');
// // console.log('selection', selection);
// // console.log('row', row);
// // console.log('JSON.stringify(selection).indexOf(JSON.stringify(row)) == -1', JSON.stringify(selection).indexOf(JSON.stringify(row)) == -1);
// if (this.sourcePage == 'serviceStore') { // 服务商
// if (JSON.stringify(selection).indexOf(JSON.stringify(row)) == -1) { // 判断是否取消选中
// // 如果是取消,则判断是否存在财务规则
// const showIndex = this.selectedDataShow.findIndex(item => (item.merchantId == row.merchantNo))
// const dataIndex = this.selectedData.findIndex(item => (item.merchantNo == row.merchantNo))
// let showHtml = ''
// switch (row.ruleFlag) {
// case 1:
// showHtml = '该商户配置有财务规则,取消关联会重置财务配置;被修改的关联关系保存后,系统自动重置对应4s在对应场景的财务规则'
// break
// case 2:
// showHtml = '该商户配置有对账规则,取消关联会重置对账配置;被修改的关联关系保存后,系统自动重置对应4s在对应场景的对账规则'
// break
// case 3:
// showHtml = '该商户配置有财务规则和对账规则,取消关联会重置财务配置和对账配置;被修改的关联关系保存后,系统自动重置对应4s在对应场景的财务规则和对账规则'
// break
// default:
// showHtml = ''
// }
// if (row.ruleFlag == 1 || row.ruleFlag == 2 || row.ruleFlag == 3) {
// this.$confirm(showHtml, '提示', {
// confirmButtonText: '确定',
// showCancelButton: true,
// type: 'warning'
// }).then(() => {
// this.selectedDataShow.splice(showIndex, 1)
// this.selectedData.splice(dataIndex, 1)
// }).catch(err => {
// this.$refs[this.seletingTable].toggleRowSelection(row, true)
// })
// } else {
// this.selectedDataShow.splice(showIndex, 1)
// this.selectedData.splice(dataIndex, 1)
// }
// } else {
// // 新增则添加
// this.selectedDataShow.push({ merchantName: row.merchantName, merchantId: row.merchantNo })
// this.selectedData.push(row)
// }
// }
// if (this.selectedRecord.length == 0) {
// this.$emit('chooseData', this.selectedData)
// }
// },
handleAll
(
selection
)
{
this
.
selectedData
=
selection
this
.
selectedDataShow
=
selection
this
.
$emit
(
'chooseData'
,
selection
)
},
handleCurrentChange
(
val
)
{
this
.
currentPage
=
val
// this.getSelectingList()
}
// handleRelateStoreConfirm() {
// this.$emit('handleRelateStoreConfirm', this.selectedData)
// },
// handleRelateStoreClose() {
// this.$emit('handleRelateStoreClose')
// },
// resetCheck() {
// const allCheck = this.$refs[this.seletingTable].selection
// const flag = allCheck.some((item) => {
// return item.ruleFlag == 1 || item.ruleFlag == 2 || item.ruleFlag == 3
// })
// if (flag) {
// this.$confirm('选择的商户中配置有财务规则或对账规则,取消关联会重置财务配置或对账配置', '提示', {
// confirmButtonText: '确定',
// showCancelButton: true,
// type: 'warning'
// }).then(() => {
// this.$refs[this.seletingTable].clearSelection()
// this.selectedData = []
// this.selectedDataShow = []
// this.$emit('chooseData', this.selectedData)
// }).catch(err => {
// console.log(err)
// })
// } else {
// this.$refs[this.seletingTable].clearSelection()
// this.selectedData = []
// this.selectedDataShow = []
// this.$emit('chooseData', this.selectedData)
// }
// },
// clearSelect() {
// const checkItem = this.$refs[this.seletingTable].selection
// if (checkItem && checkItem.length > 0) {
// this.$refs[this.seletingTable].clearSelection()
// }
// this.selectedData = []
// this.selectedDataShow = []
// }
}
}
</
script
>
<
style
></
style
>
Write
Preview
Markdown
is supported
Attach a file
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 post a comment