Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-3
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-3
Commits
5a92a08c
Commit
5a92a08c
authored
Oct 28, 2022
by
huaying
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/十月我的客户' into dev
parents
c2b76ccc
4d9402d2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
35 deletions
+43
-35
addGroupTemplate.vue
src/views/apps/customerApp/addGroupTemplate.vue
+43
-35
No files found.
src/views/apps/customerApp/addGroupTemplate.vue
View file @
5a92a08c
...
...
@@ -77,7 +77,7 @@ import limitInput from '@/components/limit-input.vue';
import
showMsg
from
'@/common/js/showmsg'
;
import
errMsg
from
'@/common/js/error'
;
import
{
_debounce
}
from
'@/common/js/public'
;
import
{
postRequest
,
getRequest
}
from
'@/api/api'
;
import
{
postRequest
}
from
'@/api/api'
;
export
default
{
name
:
'app-detail'
,
props
:
{
...
...
@@ -102,7 +102,8 @@ export default {
formData
:
{
templateId
:
''
,
templateName
:
''
,
groupIds
:
[]
groupIds
:
[],
topFlags
:
[]
},
rules
:
{
templateName
:
[{
required
:
true
,
message
:
'请输入模板名称'
,
trigger
:
'blur'
}],
...
...
@@ -126,42 +127,45 @@ export default {
methods
:
{
// 获取置顶数
getToppingNum
(
val
)
{
getRequest
(
'/haoban-app-customer-web/get-template-top-count'
,
{
templateId
:
this
.
$route
.
query
.
templateId
}).
then
(
res
=>
{
if
(
res
.
data
.
errorCode
==
1
)
{
this
.
toppingNum
=
res
.
data
.
result
;
}
});
//
let sortList = val.filter(item => item.topFlag == 1);
//
this.toppingNum = sortList.length;
//
getRequest('/haoban-app-customer-web/get-template-top-count', { templateId: this.$route.query.templateId }).then(res => {
//
if (res.data.errorCode == 1) {
//
this.toppingNum = res.data.result;
//
}
//
});
let
sortList
=
val
.
filter
(
item
=>
item
.
topFlag
==
1
);
this
.
toppingNum
=
sortList
.
length
;
},
// 置顶事件
isTopping
(
itemIndex
,
item
,
n
)
{
let
para
=
{
memberTagGroupId
:
item
.
memberTagGroupId
,
templateId
:
this
.
$route
.
query
.
templateId
,
topFlag
:
n
};
//
let para = {
//
memberTagGroupId: item.memberTagGroupId,
//
templateId: this.$route.query.templateId,
//
topFlag: n
//
};
this
.
loading
=
true
;
getRequest
(
'/haoban-app-customer-web/update-template-group-topflag'
,
para
)
.
then
(
res
=>
{
if
(
res
.
data
.
errorCode
==
1
)
{
this
.
tableData
[
itemIndex
].
topFlag
=
n
;
let
setItem
=
this
.
tableData
[
itemIndex
];
this
.
tableData
.
splice
(
itemIndex
,
1
);
if
(
n
==
1
)
{
this
.
tableData
.
splice
(
0
,
0
,
setItem
);
}
else
if
(
n
==
0
)
{
this
.
tableData
.
splice
(
this
.
toppingNum
-
1
,
0
,
setItem
);
}
this
.
$message
.
success
(
'操作成功!'
);
// this.getTemplateSet(this.brandId);
}
else
{
this
.
$message
.
error
(
res
.
data
.
message
);
}
})
.
finally
(()
=>
{
this
.
loading
=
false
;
});
// getRequest('/haoban-app-customer-web/update-template-group-topflag', para)
// .then(res => {
// if (res.data.errorCode == 1) {
this
.
tableData
[
itemIndex
].
topFlag
=
n
;
let
setItem
=
this
.
tableData
[
itemIndex
];
this
.
tableData
.
splice
(
itemIndex
,
1
);
if
(
n
==
1
)
{
this
.
tableData
.
splice
(
0
,
0
,
setItem
);
}
else
if
(
n
==
0
)
{
this
.
tableData
.
splice
(
this
.
toppingNum
-
1
,
0
,
setItem
);
}
setTimeout
(()
=>
{
this
.
loading
=
false
;
this
.
$message
.
success
(
'操作成功!'
);
},
500
);
// this.getTemplateSet(this.brandId);
// } else {
// this.$message.error(res.data.message);
// }
// })
// .finally(() => {
// this.loading = false;
// });
},
/**
* 确认新建
...
...
@@ -171,6 +175,7 @@ export default {
that
.
loadingBtn
=
true
;
if
(
that
.
tableData
.
length
)
{
that
.
formData
.
groupIds
=
that
.
tableData
.
map
(
ele
=>
ele
.
memberTagGroupId
);
that
.
formData
.
topFlags
=
that
.
tableData
.
map
(
ele
=>
ele
.
topFlag
);
}
that
.
$refs
[
formName
].
validate
(
valid
=>
{
...
...
@@ -187,6 +192,8 @@ export default {
templateId
:
that
.
formData
.
templateId
,
templateName
:
that
.
formData
.
templateName
,
groupIds
:
that
.
tableData
.
map
(
ele
=>
ele
.
memberTagGroupId
).
join
(
','
),
// topFlags: that.tableData.map(ele => ele.topFlag).join(','),
topFlags
:
that
.
tableData
.
map
(
ele
=>
ele
.
topFlag
),
editPerson
:
that
.
editPerson
,
enterpriseId
:
that
.
brandId
};
...
...
@@ -313,7 +320,8 @@ export default {
that
.
formData
=
{
templateId
:
''
,
templateName
:
''
,
groupIds
:
[]
groupIds
:
[],
topFlags
:
[]
};
that
.
tableData
=
[];
}
...
...
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