Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-4
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
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
office
haoban-4
Commits
ff36bbbc
Commit
ff36bbbc
authored
Nov 20, 2020
by
Kyle_Li
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update: 接口完善
parent
5f9fbedb
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
433 additions
and
65 deletions
+433
-65
target-manage-app.js
src/api/target-manage-app.js
+25
-12
edit-store-quota.vue
src/views/apps/target-manage/edit-store-quota.vue
+61
-28
quota-set.vue
src/views/apps/target-manage/quota-set.vue
+21
-9
target-list.vue
src/views/apps/target-manage/target-list.vue
+16
-11
target-store.vue
src/views/apps/target-manage/target-store.vue
+310
-5
No files found.
src/api/target-manage-app.js
View file @
ff36bbbc
...
...
@@ -11,22 +11,22 @@ import getFetch from './get-fetch.js';
let
api
=
{
// 指标管理
getTargetList
:
'/perfromance/total-performance-list'
,
// 获取指标列表
getDaySet
:
'/'
,
// 获取日指标设置
saveDaySet
:
{
// 保存日指标设置
url
:
'/'
,
getTargetList
:
'/performance/total-performance-list'
,
// 获取指标列表
getStorePerformanceDetail
:
'/performance/list-store-performance'
,
// 指标列表-查看店列表
changeStorePerformanceMonth
:
'/performance/change-store-month-performance'
,
// 指标列表-修改门店月指标
getStorePerformanceDay
:
'/performance/list-day-performance'
,
// 指标列表-查看门店日列表
changeStorePerformanceDay
:
{
url
:
'/performance/save-day-performance'
,
// 指标列表-保存门店日列表
method
:
'post'
,
useFormData
:
true
,
useIntercept
:
false
useFormData
:
true
},
getS
aleSet
:
'/'
,
// 获取导购指标设置
saveSaleSet
:
{
// 保存导购指标设置
url
:
'/
'
,
getS
torePerformanceClerk
:
'/performance/list-clerk-performance'
,
// 指标列表-查看导购指标
changeStorePerformanceClerk
:
{
url
:
'/
performance/save-clerk-performance'
,
// 指标列表-保存导购指标
method
:
'post'
,
useFormData
:
true
,
useIntercept
:
false
useFormData
:
true
},
getYearList
:
'/setting/get-year-list'
,
// 获取年份
getStorePerformanceList
:
'/setting/list-store-performance'
,
// 指标设置-已设置门店指标列表
getNoStorePerformanceList
:
'/setting/list-no-store-performance'
,
// 指标设置-未设置门店指标列表
...
...
@@ -36,6 +36,19 @@ let api = {
useFormData
:
true
,
useIntercept
:
true
},
editStorePerformance
:
{
// 指标设置-编辑单个门店指标
url
:
'/setting/edit-single-store-performance'
,
method
:
'post'
,
useFormData
:
true
,
useIntercept
:
true
},
batchEditStorePerformance
:
{
// 指标设置-批量设置门店指标
url
:
'/setting/batch-setting-store-performance'
,
method
:
'post'
,
useFormData
:
true
,
useIntercept
:
true
},
batchSettingRight
:
'/setting/batch-setting-right'
,
// 指标设置-批量修改权限
};
api
=
getFetch
(
api
,
'/hb-app-performance-web'
);
...
...
src/views/apps/target-manage/edit-store-quota.vue
View file @
ff36bbbc
...
...
@@ -19,23 +19,27 @@
<el-form
:model=
"form"
ref=
"form"
:rules=
"rules"
label-width=
"180px"
hide-required-asterisk
>
<el-form-item
label=
"选择年份"
prop=
"performanceYear"
>
<el-select
v-model=
"form.performanceYear"
placeholder=
"请选择年份"
>
<el-select
v-model=
"form.performanceYear"
placeholder=
"请选择年份"
v-if=
"!edit"
>
<el-option
v-for=
"item in yearList"
:key=
"item"
:label=
"item"
:value=
"item"
></el-option>
</el-select>
<span
v-else
>
{{ form.performanceYear }}
</span>
</el-form-item>
<el-form-item
label=
"选择门店"
prop=
"storeValue"
>
<el-radio-group
v-model=
"form.storeMode"
>
<el-radio
:label=
"0"
>
所有门店
</el-radio>
<el-radio
:label=
"1"
>
选择分组
</el-radio>
<el-radio
:label=
"2"
>
选择门店
</el-radio>
</el-radio-group>
<customer-store-group
v-if=
"form.storeMode == 1"
:brand-id=
"brandId"
:select-group=
"storeValue"
@
checkGroupIds=
"checkGroupIds"
></customer-store-group>
<customer-store
v-if=
"form.storeMode == 2"
:brand-id=
"brandId"
:select-store=
"storeValue"
@
checkStoreIds=
"checkGroupIds"
></customer-store>
<
template
v-if=
"!edit"
>
<el-radio-group
v-model=
"form.storeMode"
>
<el-radio
:label=
"0"
>
所有门店
</el-radio>
<el-radio
:label=
"1"
>
选择分组
</el-radio>
<el-radio
:label=
"2"
>
选择门店
</el-radio>
</el-radio-group>
<customer-store-group
v-if=
"form.storeMode == 1"
:brand-id=
"brandId"
:select-group=
"storeValue"
@
checkGroupIds=
"checkGroupIds"
></customer-store-group>
<customer-store
v-if=
"form.storeMode == 2"
:brand-id=
"brandId"
:select-store=
"storeValue"
@
checkStoreIds=
"checkGroupIds"
></customer-store>
</
template
>
<span
v-else
>
{{ targetStoreInfoIds.map(item => item.storeName).join(';') }}
</span>
</el-form-item>
<el-form-item
label=
"指标类型(必填一项)"
prop=
"type"
>
<el-form-item
label=
"指标类型(必填一项)"
prop=
"type"
v-if=
"!edit"
>
<el-checkbox
v-model=
"form.performanceFlag"
:true-label=
"1"
:false-label=
"0"
>
业绩指标(元)
<el-select
v-model=
"form.performanceSubType"
style=
"width: 240px;margin: 0 20px 20px 48px"
:disabled=
"form.performanceFlag == 0"
>
...
...
@@ -57,7 +61,7 @@
</el-form-item>
<el-form-item
label=
"指标编辑权限"
prop=
"storeEdit"
>
<el-checkbox
v-model=
"storeEdit"
:true-label=
"1"
:false-label=
"0"
>
店长可修改指标
</el-checkbox>
<el-checkbox
v-model=
"
form.
storeEdit"
:true-label=
"1"
:false-label=
"0"
>
店长可修改指标
</el-checkbox>
</el-form-item>
<el-form-item
label=
""
>
...
...
@@ -73,7 +77,7 @@ import customerStoreGroup from '@/components/app/my-customer/customer-store-grou
import
customerStore
from
'@/components/app/my-customer/customer-store.vue'
;
import
MonthTarget
from
'./MonthTarget.vue'
;
import
fetch
from
'@/api/target-manage-app.js'
;
const
{
getYearList
,
saveStorePerformance
}
=
fetch
;
const
{
getYearList
,
saveStorePerformance
,
batchSettingRight
,
batchEditStorePerformance
,
editStorePerformance
}
=
fetch
;
export
default
{
name
:
'EditStoreQuota'
,
...
...
@@ -120,13 +124,26 @@ export default {
performanceVal
:
null
,
addMemberCallback
:
null
,
// 回显数据
addMemberVal
:
null
,
targetStoreInfoIds
:
[],
// 批量编辑的门店
edit
:
''
,
// 3:批量编辑权限
};
},
mounted
()
{
this
.
$emit
(
'showTab'
,
'/quota-set'
);
let
bread
=
[
{
name
:
'指标设置'
,
path
:
'/quota-set'
},
{
name
:
'编辑指标'
}
];
created
()
{
let
bread
=
[
{
name
:
'指标设置'
,
path
:
'/quota-set'
},
{
name
:
'新建指标'
}
];
// 修改面包屑
const
{
applicationId
,
edit
,
year
,
storeEdit
}
=
this
.
$route
.
query
;
bread
[
0
].
path
+=
`?applicationId=
${
applicationId
}
`
;
if
(
edit
===
'3'
)
{
// 批量权限
this
.
targetStoreInfoIds
=
JSON
.
parse
(
localStorage
.
getItem
(
'targetStoreInfoIds'
));
this
.
form
.
performanceYear
=
year
;
this
.
form
.
storeEdit
=
Number
(
storeEdit
);
}
this
.
edit
=
edit
;
this
.
$emit
(
'change-nav'
,
bread
);
},
mounted
()
{
this
.
$emit
(
'showTab'
,
'/quota-set'
);
this
.
getYearList
();
},
methods
:
{
...
...
@@ -142,24 +159,40 @@ export default {
confirm
()
{
this
.
$refs
.
form
.
validate
(
valid
=>
{
if
(
!
valid
)
return
;
const
{
performanceFlag
,
addMemberFlag
,
storeValue
,
performanceYear
,
storeMode
}
=
this
.
form
;
const
{
performanceFlag
,
addMemberFlag
,
storeValue
,
performanceYear
,
storeMode
,
storeEdit
}
=
this
.
form
;
if
(
performanceFlag
&&
this
.
$refs
.
monthTargetRef1
.
validate
())
return
this
.
$message
.
warning
(
'请完善业绩指标'
);
if
(
addMemberFlag
&&
this
.
$refs
.
monthTargetRef2
.
validate
())
return
this
.
$message
.
warning
(
'请完善新增会员指标'
);
this
.
loading
=
true
;
const
{
staffName
,
staffId
,
wxEnterpriseId
}
=
JSON
.
parse
(
localStorage
.
getItem
(
'haoBanUser'
));
let
params
=
{
...
this
.
form
,
wxEnterpriseId
,
submitStaffName
:
staffName
,
submitStaffId
:
staffId
,
enterpriseId
:
this
.
brandId
,
// eslint-disable-next-line
storeValue
:
storeValue
.
map
(
item
=>
storeMode
==
1
?
item
.
storeGroupId
:
item
.
storeInfoId
).
join
(
','
),
performanceValue
:
this
.
filterTargetVal
(
'performanceVal'
,
performanceYear
),
addMemebrValue
:
this
.
filterTargetVal
(
'addMemberVal'
,
performanceYear
)
};
saveStorePerformance
(
params
,
{
headers
:
{
sign
:
this
.
brandId
}
})
let
params
;
if
(
this
.
edit
===
'3'
)
{
// 批量权限
console
.
log
(
this
.
targetStoreInfoIds
);
params
=
{
wxEnterpriseId
,
submitStaffName
:
staffName
,
submitStaffId
:
staffId
,
enterpriseId
:
this
.
brandId
,
performanceYear
,
storeEdit
,
storeInfoIds
:
this
.
targetStoreInfoIds
.
map
(
item
=>
item
.
storeInfoId
).
join
(
','
),
};
}
else
if
(
!
this
.
edit
)
{
// 新增
params
=
{
...
this
.
form
,
wxEnterpriseId
,
submitStaffName
:
staffName
,
submitStaffId
:
staffId
,
enterpriseId
:
this
.
brandId
,
// eslint-disable-next-line
storeValue
:
storeValue
.
map
(
item
=>
storeMode
==
1
?
item
.
storeGroupId
:
item
.
storeInfoId
).
join
(
','
),
performanceValue
:
this
.
filterTargetVal
(
'performanceVal'
,
performanceYear
),
addMemebrValue
:
this
.
filterTargetVal
(
'addMemberVal'
,
performanceYear
)
};
}
[
saveStorePerformance
,
editStorePerformance
,
batchEditStorePerformance
,
batchSettingRight
][
this
.
edit
||
0
](
params
,
{
headers
:
{
sign
:
this
.
brandId
}
})
.
then
(
res
=>
{
this
.
$message
.
success
(
'保存成功'
);
this
.
$router
.
go
(
-
1
);
...
...
src/views/apps/target-manage/quota-set.vue
View file @
ff36bbbc
...
...
@@ -65,21 +65,21 @@
</div>
<el-select
placeholder=
"操作"
@
change=
"batchOperation"
>
<el-option
label=
"新增指标"
:value=
"1"
></el-option>
<el-option
label=
"编辑指标"
:value=
"2"
v-show=
"activeName === '0'"
></el-option>
<el-option
label=
"新增指标"
:value=
"1"
v-show=
"activeName === '0'"
></el-option>
<el-option
label=
"编辑指标"
:value=
"2"
></el-option>
<el-option
label=
"修改编辑权限"
:value=
"3"
v-show=
"activeName === '0'"
></el-option>
</el-select>
</div>
<div
class=
"content-data"
>
<div
class=
"content-data"
v-show=
"activeName === '1'"
>
<div>
<span
class=
"color2"
>
年业绩指标:¥
</span>
<
!--
<
span
class=
"color2"
>
年业绩指标:¥
</span>
<span
class=
"color1"
>
100,000
</span>
<span
class=
"color2"
>
年新增会员指标:¥
</span>
<span
class=
"color1"
>
100,000
</span>
<span
class=
"color1"
>
100,000
</span>
-->
</div>
<span
v-show=
"activeName === '1'"
>
<span>
<el-checkbox
v-model=
"search1.noPerformanceFlag"
:true-label=
"1"
:false-label=
"0"
@
change=
"searchChange"
>
未设置业绩指标门店
</el-checkbox>
<el-checkbox
v-model=
"search1.noAddMemberFlag"
:true-label=
"1"
:false-label=
"0"
@
change=
"searchChange"
>
未设置新增会员指标门店
</el-checkbox>
</span>
...
...
@@ -130,7 +130,7 @@
<
el
-
table
-
column
prop
=
"date"
label
=
"操作"
>
<
template
>
<
el
-
button
type
=
"text"
>
编辑
<
/el-button
>
<
el
-
button
type
=
"text"
>
删除
<
/el-button
>
<
el
-
button
type
=
"text"
v
-
show
=
"activeName === '0'"
>
删除
<
/el-button
>
<
/template
>
<
/el-table-column
>
<
/el-table
>
...
...
@@ -169,6 +169,7 @@ export default {
data
()
{
return
{
activeName
:
''
,
applicationId
:
''
,
haoban
:
{
}
,
search
:
{
...
...
@@ -203,8 +204,9 @@ export default {
}
,
created
()
{
const
{
tab
}
=
this
.
$route
.
query
;
const
{
tab
,
applicationId
}
=
this
.
$route
.
query
;
this
.
activeName
=
tab
||
'0'
;
this
.
applicationId
=
applicationId
;
const
{
staffId
,
wxEnterpriseId
}
=
JSON
.
parse
(
localStorage
.
getItem
(
'haoBanUser'
));
this
.
haoban
=
{
staffId
,
wxEnterpriseId
}
;
}
,
...
...
@@ -255,6 +257,15 @@ export default {
switch
(
val
)
{
case
1
:
return
this
.
$router
.
push
({
path
:
'/edit-store-quota'
,
query
:
{
applicationId
:
this
.
applicationId
}
}
);
case
3
:
if
(
!
this
.
multipleSelection
||
!
this
.
multipleSelection
.
length
)
return
this
.
$message
.
warning
(
'请选择指标门店'
);
// 判断是否一致
let
edit
=
this
.
multipleSelection
[
0
].
storeEdit
;
let
bool
=
this
.
multipleSelection
.
some
(
item
=>
item
.
storeEdit
!==
edit
);
if
(
bool
)
return
this
.
$message
.
warning
(
'选择的指标门店的 编辑权限 必须一致'
);
localStorage
.
setItem
(
'targetStoreInfoIds'
,
JSON
.
stringify
(
this
.
multipleSelection
));
return
this
.
$router
.
push
({
path
:
'/edit-store-quota'
,
query
:
{
applicationId
:
this
.
applicationId
,
edit
:
'3'
,
year
:
this
.
search
.
performanceYear
,
storeEdit
:
edit
}
}
);
default
:
break
;
}
...
...
@@ -344,6 +355,7 @@ export default {
.
content
-
search
{
display
:
flex
;
justify
-
content
:
space
-
between
;
margin
-
bottom
:
20
px
;
}
.
content
-
first
{
display
:
flex
;
...
...
@@ -352,7 +364,7 @@ export default {
.
content
-
data
{
display
:
flex
;
justify
-
content
:
space
-
between
;
margin
:
20
px
0
;
margin
-
bottom
:
20
px
;
}
.
color1
{
color
:
#
303133
;
...
...
src/views/apps/target-manage/target-list.vue
View file @
ff36bbbc
...
...
@@ -16,7 +16,7 @@
</el-tabs>
<div
class=
"list-content"
>
<el-select
v-model=
"search.date"
>
<el-select
v-model=
"search.date"
@
change=
"getData"
>
<el-option
v-for=
"item in yearList"
:key=
"item"
:label=
"item"
:value=
"item"
></el-option>
</el-select>
...
...
@@ -27,14 +27,16 @@
<el-table-column
prop=
"performanceYm"
label=
"月份"
></el-table-column>
<el-table-column
prop=
"storeCount"
label=
"门店总数"
></el-table-column>
<el-table-column
prop=
"totalPerformanceValue"
label=
"总业绩指标"
></el-table-column>
<el-table-column
label=
"业绩指标"
>
<template
slot-scope=
"
{row}">
{{
row
.
noPerfectCount
||
'--'
}}
未完善;
{{
row
.
prefectCount
||
'--'
}}
已完善
{{
row
.
noPerfectCount
}}
未完善;
{{
row
.
prefectCount
}}
已完善
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
>
<
template
slot-scope=
"{row}"
>
<el-button
type=
"text"
@
click=
"$router.push(
{ path: '/target-store', query: { tab: activeName,
id: row.i
d } })">查看门店
</el-button>
<el-button
type=
"text"
@
click=
"$router.push(
{ path: '/target-store', query: { tab: activeName,
year: row.performanceYm, applicationI
d } })">查看门店
</el-button>
</
template
>
</el-table-column>
</el-table>
...
...
@@ -60,28 +62,31 @@ export default {
},
data
()
{
return
{
wxEnterpriseId
:
localStorage
.
getItem
(
'haoBanUser'
)
?
JSON
.
parse
(
localStorage
.
getItem
(
'haoBanUser'
)).
wxEnterpriseId
:
''
,
tableData
:
[
{}
],
haoban
:
{}
,
tableData
:
[],
activeName
:
'1'
,
search
:
{
date
:
''
date
:
new
Date
().
getFullYear
()
},
yearList
:
[],
loading
:
false
};
},
created
()
{
const
{
tab
}
=
this
.
$route
.
query
;
const
{
tab
,
applicationId
}
=
this
.
$route
.
query
;
this
.
applicationId
=
applicationId
;
this
.
activeName
=
tab
||
'1'
;
const
{
staffId
,
wxEnterpriseId
}
=
JSON
.
parse
(
localStorage
.
getItem
(
'haoBanUser'
));
this
.
haoban
=
{
staffId
,
wxEnterpriseId
};
},
// 生命周期 - 挂载完成(访问DOM元素)
mounted
()
{
const
that
=
this
;
that
.
$emit
(
'showTab'
,
'/target-list'
);
that
.
$emit
(
'change-nav'
,
[
{
name
:
'指标管理'
}
]);
that
.
getYearList
();
if
(
!!
that
.
brandId
)
{
that
.
getData
();
that
.
getYearList
();
}
},
// methods
...
...
@@ -94,10 +99,10 @@ export default {
this
.
loading
=
true
;
const
that
=
this
;
const
para
=
{
wxEnterpriseId
:
that
.
wxEnterpriseId
,
...
that
.
haoban
,
enterpriseId
:
that
.
brandId
,
perfromanceType
:
th
is
.
activeName
,
performanceYear
:
th
is
.
search
.
date
perfromanceType
:
th
at
.
activeName
,
performanceYear
:
th
at
.
search
.
date
};
getTargetList
(
para
,
{
headers
:
{
sign
:
that
.
brandId
}
})
.
then
(
res
=>
{
...
...
src/views/apps/target-manage/target-store.vue
View file @
ff36bbbc
...
...
@@ -7,20 +7,325 @@
* @LastEditTime: 2020-11-09 10:40:34
-->
<
template
>
<div
class=
"common-app-right"
>
<el-button
type=
"text"
@
click=
"$router.push(
{ path: '/perfect-day-target' })">完善日指标
</el-button>
<div
class=
"common-app-right"
style=
"padding: 0"
v-loading=
"loading"
>
<el-tabs
v-model=
"activeName"
@
tab-click=
"getData"
>
<el-tab-pane
label=
"已设置指标门店"
name=
"0"
></el-tab-pane>
<el-tab-pane
label=
"未设置指标门店"
name=
"1"
></el-tab-pane>
</el-tabs>
<div
class=
"list-content"
>
<div
class=
"content-search"
>
<div
class=
"content-first"
>
<el-input
v-model
.
trim=
"search.search"
placeholder=
"请输入名称/code"
prefix-icon=
"el-icon-search"
@
keydown
.
enter
.
native=
"searchChange"
clearable
@
change=
"searchChange"
>
</el-input>
<el-select
v-model=
"search.performanceYear"
placeholder=
"选择年份"
style=
"width: 100px"
@
change=
"searchChange"
>
<el-option
v-for=
"item in yearList"
:key=
"item"
:label=
"item"
:value=
"item"
></el-option>
</el-select>
<span
v-show=
"activeName === '0'"
>
<el-select
v-model=
"search.type"
placeholder=
"全部指标类型"
clearable
@
change=
"searchChange"
>
<el-option
label=
"业绩指标日权重"
value=
"1"
></el-option>
<el-option
label=
"业绩指标日指标"
value=
"2"
></el-option>
<el-option
label=
"新增会员日权重"
value=
"3"
></el-option>
<el-option
label=
"新增会员日指标"
value=
"4"
></el-option>
</el-select>
<el-select
v-model=
"search.storeEdit"
placeholder=
"全部编辑权限"
clearable
@
change=
"searchChange"
>
<el-option
label=
"店长可编辑"
value=
"1"
></el-option>
<el-option
label=
"店长不可编辑"
value=
"0"
></el-option>
</el-select>
</span>
<el-select
v-model=
"search.storeType"
style=
"width: 106px;margin-right: -1px"
@
change=
"storeChange"
>
<el-option
label=
"门店分组"
value=
"1"
></el-option>
<el-option
label=
"门店标签"
value=
"2"
></el-option>
</el-select>
<gic-select-group-mult
v-if=
"search.storeType === '1'"
width=
"148px"
@
checkGroupIds=
"checkGroupIds"
>
</gic-select-group-mult>
<gic-select-tag
v-if=
"search.storeType === '2'"
width=
"148px"
@
returnTags=
"checkGroupIds"
>
</gic-select-tag>
</div>
<el-select
placeholder=
"操作"
@
change=
"batchOperation"
>
<el-option
label=
"新增指标"
:value=
"1"
v-show=
"activeName === '0'"
></el-option>
<el-option
label=
"编辑指标"
:value=
"2"
></el-option>
<el-option
label=
"修改编辑权限"
:value=
"3"
v-show=
"activeName === '0'"
></el-option>
</el-select>
</div>
<div
class=
"content-data"
v-show=
"activeName === '1'"
>
<div>
<!--
<span
class=
"color2"
>
年业绩指标:¥
</span>
<span
class=
"color1"
>
100,000
</span>
<span
class=
"color2"
>
年新增会员指标:¥
</span>
<span
class=
"color1"
>
100,000
</span>
-->
</div>
<span>
<el-checkbox
v-model=
"search1.noPerformanceFlag"
:true-label=
"1"
:false-label=
"0"
@
change=
"searchChange"
>
未设置业绩指标门店
</el-checkbox>
<el-checkbox
v-model=
"search1.noAddMemberFlag"
:true-label=
"1"
:false-label=
"0"
@
change=
"searchChange"
>
未设置新增会员指标门店
</el-checkbox>
</span>
</div>
<el-table
:data=
"tableData"
style=
"width: 100%"
ref=
"multipleTable"
@
selection-change=
"handleSelectionChange"
>
<el-table-column
type=
"selection"
width=
"55"
></el-table-column>
<el-table-column
label=
"门店"
show-overflow-tooltip
>
<template
slot-scope=
"
{row}">
<div>
{{
row
.
storeName
||
'--'
}}
</div>
<div
style=
"color: #909399;font-size:12px"
>
{{
row
.
storeCode
||
'--'
}}
</div>
</
template
>
</el-table-column>
<el-table-column
label=
"年业绩指标"
show-overflow-tooltip
>
<
template
slot-scope=
"{row}"
>
{{
row
.
performanceYearValue
?
`¥${row.performanceYearValue
}
`
:
'未设置'
}}
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"年新增会员指标"
show
-
overflow
-
tooltip
>
<
template
slot
-
scope
=
"{row
}
"
>
{{
row
.
addMemberValue
?
`¥${row.addMemberValue
}
`
:
'未设置'
}}
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"编辑权限"
show
-
overflow
-
tooltip
>
<
template
slot
-
scope
=
"{row
}
"
>
{{
[
'店长不可编辑'
,
'店长可编辑'
][
row
.
storeEdit
]
||
'--'
}}
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"更新时间"
show
-
overflow
-
tooltip
>
<
template
slot
-
scope
=
"{row
}
"
>
<
div
style
=
"line-height:18px"
>
{{
row
.
updateTime
|
formatDate
(
'ymd'
)
}}
<
br
/>
{{
row
.
updateTime
|
formatDate
(
'hms'
)
}}
<
/div
>
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
label
=
"提交人"
show
-
overflow
-
tooltip
>
<
template
slot
-
scope
=
"{row
}
"
>
{{
row
.
submitStaffName
||
'--'
}}
<
/template
>
<
/el-table-column
>
<
el
-
table
-
column
prop
=
"date"
label
=
"操作"
>
<
template
>
<
el
-
button
type
=
"text"
@
click
=
"$router.push({ path: '/perfect-day-target'
}
)"
>
完善日指标
<
/el-button
>
<
/template
>
<
/el-table-column
>
<
/el-table
>
<
dm
-
pagination
v
-
if
=
"tableData.length"
background
@
size
-
change
=
"handleSizeChange"
@
current
-
change
=
"handleCurrentChange"
:
current
-
page
=
"page.pageNum"
:
page
-
sizes
=
"[20, 40, 60, 80]"
:
page
-
size
=
"page.pageSize"
layout
=
"total, sizes, prev, pager, next"
:
total
=
"page.total"
style
=
"text-align:right"
>
<
/dm-pagination
>
<
/div
>
<
/div
>
<
/template
>
<
script
>
import
gicSelectGroupMult
from
'@/components/common/gic-select-group-mult.vue'
;
import
gicSelectTag
from
'@/components/common/gic-select-tag.vue'
;
import
fetch
from
'@/api/target-manage-app.js'
;
const
{
getYearList
,
getStorePerformanceList
,
getNoStorePerformanceList
}
=
fetch
;
export
default
{
name
:
'TargetStore'
,
components
:
{
gicSelectGroupMult
,
gicSelectTag
}
,
props
:
{
brandId
:
{
type
:
String
,
default
:
''
}
}
,
data
()
{
return
{
activeName
:
''
,
applicationId
:
''
,
haoban
:
{
}
,
search
:
{
search
:
''
,
performanceYear
:
new
Date
().
getFullYear
(),
type
:
''
,
storeEdit
:
''
,
// 1店长可编辑,0店长不可编辑
storeType
:
'1'
,
// 1门店分组,2门店标签
storeParam
:
''
,
}
,
search1
:
{
noPerformanceFlag
:
'0'
,
noAddMemberFlag
:
'0'
}
,
multipleSelection
:
[],
tableData
:
[],
loading
:
false
,
page
:
{
pageNum
:
1
,
pageSize
:
20
,
total
:
0
}
,
yearList
:
[],
typeList
:
[
{
performanceType
:
1
,
performanceSubType
:
1
}
,
{
performanceType
:
1
,
performanceSubType
:
2
}
,
{
performanceType
:
2
,
performanceSubType
:
1
}
,
{
performanceType
:
2
,
performanceSubType
:
2
}
,
]
}
;
}
,
created
()
{
const
{
tab
,
applicationId
}
=
this
.
$route
.
query
;
this
.
activeName
=
tab
||
'0'
;
this
.
applicationId
=
applicationId
;
const
{
staffId
,
wxEnterpriseId
}
=
JSON
.
parse
(
localStorage
.
getItem
(
'haoBanUser'
));
this
.
haoban
=
{
staffId
,
wxEnterpriseId
}
;
}
,
mounted
()
{
const
that
=
this
;
//
that.$emit('showTab', '/target-store');
that
.
$emit
(
'showTab'
,
'/target-store'
);
that
.
$emit
(
'change-nav'
,
[
{
name
:
'指标管理'
,
path
:
'/target-list'
}
,
{
name
:
'查看门店'
}
]);
if
(
!!
that
.
brandId
)
{
// that.getData();
this
.
getData
();
this
.
getYearList
();
}
,
methods
:
{
getData
()
{
this
.
loading
=
true
;
const
{
storeType
,
storeParam
,
type
}
=
this
.
search
;
let
params
=
{
...
this
.
search
,
...
this
.
haoban
,
...
this
.
page
,
enterpriseId
:
this
.
brandId
,
storeType
:
storeParam
?
storeType
:
''
,
}
;
if
(
this
.
activeName
===
'0'
)
{
// 已设置
params
=
{
...
params
,
...
this
.
typeList
[
type
-
1
]
}
;
}
else
if
(
this
.
activeName
===
'1'
)
{
// 未设置
params
=
{
...
params
,
...
this
.
search1
}
;
}
[
getStorePerformanceList
,
getNoStorePerformanceList
][
this
.
activeName
](
params
,
{
headers
:
{
sign
:
this
.
brandId
}
}
)
.
then
(
res
=>
{
const
{
result
,
totalCount
}
=
res
.
result
||
{
}
;
this
.
tableData
=
result
||
[];
this
.
page
.
total
=
totalCount
;
}
)
.
catch
(()
=>
this
.
tableData
=
[])
.
finally
(()
=>
this
.
loading
=
false
);
}
,
batchOperation
(
val
)
{
switch
(
val
)
{
case
1
:
return
this
.
$router
.
push
({
path
:
'/edit-store-quota'
,
query
:
{
applicationId
:
this
.
applicationId
}
}
);
case
3
:
if
(
!
this
.
multipleSelection
||
!
this
.
multipleSelection
.
length
)
return
this
.
$message
.
warning
(
'请选择指标门店'
);
// 判断是否一致
let
edit
=
this
.
multipleSelection
[
0
].
storeEdit
;
let
bool
=
this
.
multipleSelection
.
some
(
item
=>
item
.
storeEdit
!==
edit
);
if
(
bool
)
return
this
.
$message
.
warning
(
'选择的指标门店的 编辑权限 必须一致'
);
localStorage
.
setItem
(
'targetStoreInfoIds'
,
JSON
.
stringify
(
this
.
multipleSelection
));
return
this
.
$router
.
push
({
path
:
'/edit-store-quota'
,
query
:
{
applicationId
:
this
.
applicationId
,
edit
:
'3'
,
year
:
this
.
search
.
performanceYear
,
storeEdit
:
edit
}
}
);
default
:
break
;
}
}
,
handleSelectionChange
(
val
)
{
this
.
multipleSelection
=
val
;
}
,
handleClick
({
name
}
)
{
console
.
log
(
name
);
}
,
handleSizeChange
(
val
)
{
this
.
page
.
pageSize
=
val
;
this
.
page
.
pageNum
=
1
;
this
.
getData
();
}
,
handleCurrentChange
(
val
)
{
this
.
page
.
pageNum
=
val
;
this
.
getData
();
}
,
// 获取年份
getYearList
()
{
getYearList
(
''
,
{
headers
:
{
sign
:
this
.
brandId
}
}
).
then
(
res
=>
{
this
.
yearList
=
res
.
result
||
[];
}
);
}
,
// 筛选条件变更
searchChange
()
{
this
.
handleCurrentChange
(
1
);
}
,
// 门店分组change
checkGroupIds
(
nodes
)
{
console
.
log
(
nodes
);
this
.
search
.
storeParam
=
nodes
.
map
(
item
=>
item
[
this
.
form
.
storeType
===
'1'
?
'storeGroupId'
:
'tagId'
]).
join
(
','
);
}
,
storeChange
()
{
this
.
search
.
storeParam
=
''
;
this
.
searchChange
();
}
}
,
filters
:
{
formatDate
(
val
,
format
)
{
if
(
!
val
)
return
'--'
;
val
=
new
Date
(
val
);
let
y
=
val
.
getFullYear
();
let
m
=
(
val
.
getMonth
()
+
1
).
toString
().
padStart
(
2
,
'0'
);
let
d
=
val
.
getDate
().
toString
().
padStart
(
2
,
'0'
);
let
h
=
val
.
getHours
().
toString
().
padStart
(
2
,
'0'
);
let
mm
=
val
.
getMinutes
().
toString
().
padStart
(
2
,
'0'
);
let
s
=
val
.
getSeconds
().
toString
().
padStart
(
2
,
'0'
);
if
(
format
==
'ymd'
)
{
return
`${y
}
-${m
}
-${d
}
`
;
}
else
if
(
format
==
'hms'
)
{
return
`${h
}
:${mm
}
:${s
}
`
;
}
return
`${y
}
-${m
}
-${d
}
\xa0\xa0\xa0${h
}
:${mm
}
:${s
}
`
;
}
}
,
watch
:
{
brandId
(
val
)
{
val
&&
this
.
getData
();
}
}
,
}
;
...
...
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