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
111d7e1c
Commit
111d7e1c
authored
Nov 24, 2020
by
无尘
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改禁用
parent
ede5cb0b
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
50 additions
and
23 deletions
+50
-23
public.js
src/common/js/public.js
+19
-1
gic-select-group-mult.vue
src/components/common/gic-select-group-mult.vue
+3
-3
emitter.js
src/mixins/emitter.js
+1
-1
perfect-day-target.vue
src/views/apps/target-manage/perfect-day-target.vue
+20
-14
perfect-sale-target.vue
src/views/apps/target-manage/perfect-sale-target.vue
+7
-4
No files found.
src/common/js/public.js
View file @
111d7e1c
...
...
@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2019-12-05 09:56:10
* @LastEditors: 无尘
* @LastEditTime: 2020-1
0-22 17:07:44
* @LastEditTime: 2020-1
1-24 15:27:59
*/
/**
...
...
@@ -123,3 +123,21 @@ export function emojiToStr(str) {
str
=
String
(
str
).
replace
(
/
\u
D83C
[\u
DF00-
\u
DFFF
]
|
\u
D83D
[\u
DC00-
\u
DE4F
]
|
[\u
D800-
\u
DBFF
]
|
[\u
DC00-
\u
DFFF
]
|
[^\u
0020-
\u
007E
\u
00A0-
\u
00BE
\u
2E80-
\u
A4CF
\u
F900-
\u
FAFF
\u
FE30-
\u
FE4F
\u
FF00-
\u
FFEF
\u
0080-
\u
009F
\u
2000-
\u
201f
\u
2026
\u
2022
\u
20ac
\r\n]
/g
,
''
);
return
unescape
(
escape
(
str
).
replace
(
/
\%
uD.
{3}
/g
,
''
));
}
/**
* @description: 判断是否禁用编辑(可编辑当月及未来的指标, 当月之前及当月月末三天不可编辑)
* @param {String} yearMonth
* @returns {Boolean}
* @author: 无尘
*/
export
function
checkDisEdit
(
yearMonth
)
{
const
arr
=
yearMonth
.
split
(
'-'
);
const
monthDays
=
new
Date
(
arr
[
0
],
arr
[
1
],
0
).
getDate
();
const
editTime
=
new
Date
(
yearMonth
).
getTime
()
+
(
monthDays
-
3
)
*
24
*
60
*
60
*
1000
;
const
nowTime
=
new
Date
().
getTime
();
if
(
nowTime
<
editTime
)
{
return
false
;
// 可编辑,不禁用
}
else
{
return
true
;
// 禁用
}
}
src/components/common/gic-select-group-mult.vue
View file @
111d7e1c
...
...
@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-11-08 10:27:21
* @LastEditors: 无尘
* @LastEditTime: 2020-11-24
09:18:42
* @LastEditTime: 2020-11-24
15:40:21
-->
<!--
<gic-select-group-mult
...
...
@@ -27,8 +27,8 @@
<div
class=
"select-tree-wrap m-t-10"
>
<!--:load="loadNode"-->
<el-tree
:filter-node-method=
"filterNode"
:data=
"groupData"
check-strictly
:default-checked-keys=
"checkedKeys"
node-key=
"storeGroupId"
ref=
"groupTree"
show-checkbox
default-expand-all
:props=
"defaultProps"
:expand-on-click-node=
"false"
@
check=
"checkGroup"
>
<span
class=
"custom-tree-node"
slot-scope=
"
{ node
, data
}">
<span
:class=
"['font-14 p-r-10 iconfont
', data.isStore == 1 ? 'icondianpu-kuai' : 'iconqiye-tianchong', data.bindFlag == 1 ? 'color-2f54eb' :
'color-dedfe6']"
></span><span
class=
"font-14 color-606266"
>
{{
node
.
label
}}
</span>
<span
class=
"custom-tree-node"
slot-scope=
"
{ node }">
<span
:class=
"['font-14 p-r-10 iconfont
iconqiye-tianchong',
'color-dedfe6']"
></span><span
class=
"font-14 color-606266"
>
{{
node
.
label
}}
</span>
</span>
</el-tree>
</div>
...
...
src/mixins/emitter.js
View file @
111d7e1c
...
...
@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-07-16 16:37:05
* @LastEditors: 无尘
* @LastEditTime: 2020-
09-15 10:12:49
* @LastEditTime: 2020-
11-24 15:27:25
*/
'use strict'
;
/**
...
...
src/views/apps/target-manage/perfect-day-target.vue
View file @
111d7e1c
...
...
@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-11-12 10:47:17
* @LastEditors: 无尘
* @LastEditTime: 2020-11-24 1
4:34:13
* @LastEditTime: 2020-11-24 1
5:37:01
-->
<
template
>
<div
class=
"common-app-right"
style=
"padding: 20px 0;color: #303133"
>
...
...
@@ -12,7 +12,7 @@
<el-form-item
label=
"门店名称"
>
{{
form
.
storeName
||
'--'
}}
</el-form-item>
<el-form-item
v-if=
"!form.multOpt"
label=
"指标额"
>
¥
{{
parseFloat
(
form
.
performanceValue
).
toFixed
(
2
)
}}
<el-button
type=
"text"
@
click=
"modMonthTarget"
>
修改
</el-button>
<el-button
:disabled=
"disableSetting"
type=
"text"
@
click=
"modMonthTarget"
>
修改
</el-button>
</el-form-item>
<el-form-item
label=
"指标类型"
>
{{
[
'业绩指标日权重'
,
'业绩指标日指标'
][
form
.
performanceSubType
-
1
]
}}
</el-form-item>
<el-form-item
v-if=
"!form.multOpt"
label=
""
>
...
...
@@ -27,7 +27,7 @@
<div
class=
"target-title"
>
<span>
{{
form
.
date
[
0
]
}}
年
{{
form
.
date
[
1
]
}}
月
</span>
<el-button
type=
"text"
@
click=
"setDefault"
v-if=
"form.flag == false && form.performanceSubType == 1
"
>
设置默认日权重
</el-button>
<el-button
v-if=
"form.flag == false && form.performanceSubType == 1"
type=
"text"
@
click=
"setDefault"
:disabled=
"disableSetting
"
>
设置默认日权重
</el-button>
</div>
<div
class=
"target-table"
>
...
...
@@ -46,7 +46,7 @@
<li
v-for=
"(item, i) in tableData"
:key=
"i"
>
<div>
{{
item
.
performanceDay
}}
</div>
<el-input-number
v-model=
"item.performanceValue"
:precision=
"2"
:controls=
"false"
:max=
"999999999"
style=
"width: 80px;margin-left:40px;margin-top:5px"
></el-input-number>
<el-input-number
v-model=
"item.performanceValue"
:
disabled=
"disableSetting"
:
precision=
"2"
:controls=
"false"
:max=
"999999999"
style=
"width: 80px;margin-left:40px;margin-top:5px"
></el-input-number>
</li>
<!-- 补充空白 -->
...
...
@@ -54,7 +54,7 @@
</ul>
</div>
<el-button
type=
"primary"
:loading=
"loading"
:disabled=
"$route.query.performanceSubType == 2 && totalDayTarget != form.performanceValue"
style=
"margin-left:20px"
@
click=
"confirm"
>
保存
</el-button>
<el-button
type=
"primary"
:loading=
"loading"
:disabled=
"$route.query.performanceSubType == 2 && totalDayTarget != form.performanceValue
|| disableSetting
"
style=
"margin-left:20px"
@
click=
"confirm"
>
保存
</el-button>
<el-dialog
title=
"修改指标"
...
...
@@ -95,6 +95,7 @@
<
script
>
// import errMsg from '@/common/js/error';
// import showMsg from '@/common/js/showmsg';
import
{
checkDisEdit
}
from
'@/common/js/public'
;
import
fetch
from
'@/api/target-manage-app.js'
;
const
{
changeStorePerformanceDay
,
getStorePerformanceDay
,
changeStorePerformanceMonth
}
=
fetch
;
export
default
{
...
...
@@ -135,27 +136,32 @@ export default {
},
dialogVisible
:
false
,
haoban
:
{},
disableSetting
:
false
// 是否禁用设置(false:不禁用设置,true:禁用设置)
};
},
created
()
{
this
.
form
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
$route
.
query
));
const
that
=
this
;
that
.
form
=
JSON
.
parse
(
JSON
.
stringify
(
that
.
$route
.
query
));
// 批量操作判断
if
(
!!
th
is
.
$route
.
query
.
multOpt
&&
this
.
$route
.
query
.
multOpt
==
1
)
{
th
is
.
form
.
multOpt
=
1
;
if
(
!!
th
at
.
$route
.
query
.
multOpt
&&
that
.
$route
.
query
.
multOpt
==
1
)
{
th
at
.
form
.
multOpt
=
1
;
}
else
{
th
is
.
form
.
multOpt
=
''
;
th
at
.
form
.
multOpt
=
''
;
}
// 禁用判断
that
.
disableSetting
=
checkDisEdit
(
that
.
$route
.
query
.
performanceYm
);
const
{
staffName
,
staffId
,
wxEnterpriseId
}
=
JSON
.
parse
(
localStorage
.
getItem
(
'haoBanUser'
));
th
is
.
haoban
=
{
staffName
,
staffId
,
wxEnterpriseId
};
th
at
.
haoban
=
{
staffName
,
staffId
,
wxEnterpriseId
};
let
bread
=
[
{
name
:
'指标管理'
,
path
:
'/target-list'
},
{
name
:
'查看门店'
,
path
:
'/target-store'
},
{
name
:
'完善日指标'
}
];
// 修改面包屑
const
{
tab
,
applicationId
,
performanceYm
}
=
th
is
.
$route
.
query
;
th
is
.
form
.
date
=
performanceYm
.
split
(
'-'
);
const
{
tab
,
applicationId
,
performanceYm
}
=
th
at
.
$route
.
query
;
th
at
.
form
.
date
=
performanceYm
.
split
(
'-'
);
bread
[
0
].
path
+=
`?applicationId=
${
applicationId
}
&tab=
${
tab
}
`
;
bread
[
1
].
path
+=
`?applicationId=
${
applicationId
}
&tab=
${
tab
}
&performanceYm=
${
performanceYm
}
`
;
th
is
.
$emit
(
'change-nav'
,
bread
);
th
is
.
init
();
th
at
.
$emit
(
'change-nav'
,
bread
);
th
at
.
init
();
},
mounted
()
{
this
.
$emit
(
'showTab'
,
'/target-list'
);
...
...
src/views/apps/target-manage/perfect-sale-target.vue
View file @
111d7e1c
...
...
@@ -4,7 +4,7 @@
* @Author: 无尘
* @Date: 2020-11-12 10:48:40
* @LastEditors: 无尘
* @LastEditTime: 2020-11-2
3 18:15:41
* @LastEditTime: 2020-11-2
4 15:39:27
-->
<
template
>
<div
class=
"common-app-right"
>
...
...
@@ -30,7 +30,7 @@
<el-table-column
label=
"月指标"
>
<
template
slot-scope=
"scope"
>
<div>
<el-input
class=
"w-120 p-l-8"
maxlength=
"50"
v-model=
"scope.row.performanceValue"
placeholder=
"请输入"
@
blur=
"value => inputPerformance(value, scope.$index, scope.row)"
>
<el-input
class=
"w-120 p-l-8"
maxlength=
"50"
v-model=
"scope.row.performanceValue"
placeholder=
"请输入"
:disabled=
"disableSetting"
@
blur=
"value => inputPerformance(value, scope.$index, scope.row)"
>
<i
slot=
"prefix"
style=
"font-style: normal;position: absolute;top: 4px;left: 12px;"
>
¥
</i>
</el-input>
</div>
...
...
@@ -59,7 +59,7 @@
</div>
</template>
<
script
>
import
{
_debounce
}
from
'@/common/js/public'
;
import
{
_debounce
,
checkDisEdit
}
from
'@/common/js/public'
;
import
errMsg
from
'@/common/js/error'
;
import
showMsg
from
'@/common/js/showmsg'
;
import
fetch
from
'@/api/target-manage-app.js'
;
...
...
@@ -88,7 +88,8 @@ export default {
settingAble
:
1
,
storePerformance
:
0
},
equalFlag
:
false
// 相等标志
equalFlag
:
false
,
// 相等标志
disableSetting
:
false
// 是否禁用设置(false:不禁用设置,true:禁用设置)
};
},
mounted
()
{
...
...
@@ -98,6 +99,8 @@ export default {
let
bread
=
[
{
name
:
'指标管理'
,
path
:
`/target-list?tab=
${
tab
}
&applicationId=
${
applicationId
}
`
},
{
name
:
'查看门店'
,
path
:
`/target-store?tab=
${
tab
}
&applicationId=
${
applicationId
}
&performanceYm=
${
performanceYm
}
`
},
{
name
:
'完善导购指标'
}
];
// 修改面包屑
that
.
$emit
(
'change-nav'
,
bread
);
// 禁用判断
that
.
disableSetting
=
checkDisEdit
(
performanceYm
);
if
(
!!
that
.
brandId
)
{
that
.
clerkObj
.
performanceYm
=
performanceYm
;
that
.
clerkObj
.
storeInfoId
=
storeInfoId
;
...
...
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