Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-web
/
glsx-oss-task
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 159cd230
authored
Feb 20, 2023
by
前端
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
处理编辑回显名称问题
1 parent
bce7f7bb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
235 deletions
src/views/task/addTask/components/selectMembers.vue
src/views/task/addTask/index.vue
src/views/task/addTask/components/selectMembers.vue
View file @
159cd23
...
...
@@ -132,13 +132,16 @@ export default {
type
:
String
,
},
selectRobot
:
{
type
:
Array
||
String
,
type
:
[
Array
,
String
]
,
},
type
:
{
type
:
Boolean
,
},
errorType
:
{
type
:
Boolean
,
},
robotNo
:
{
type
:
Number
||
String
,
type
:
[
Number
,
String
]
,
},
},
watch
:
{
...
...
@@ -191,36 +194,34 @@ export default {
// },
},
mounted
()
{
console
.
log
(
this
.
type
,
this
.
robotNo
,
this
.
selectRobot
)
console
.
log
(
this
.
type
,
this
.
errorType
,
this
.
robotNo
,
this
.
selectRobot
)
if
(
this
.
type
&&
this
.
robotNo
)
this
.
getlistDepartmentTree
(
this
.
robotNo
)
if
(
this
.
errorType
&&
this
.
robotNo
)
this
.
getlistDepartmentTree
(
this
.
robotNo
)
},
methods
:
{
async
dealVal
(
val
)
{
await
this
.
initData
(
val
)
this
.
robotListTree
=
val
console
.
log
(
this
.
robotListTree
)
},
getlistDepartmentTree
(
merchantId
)
{
let
params
=
{
addChildrensFlag
:
true
,
queryMerchantId
:
merchantId
}
taskApi
.
getlistDepartmentTree
(
params
).
then
(
async
(
res
)
=>
{
console
.
log
(
res
)
if
(
res
)
{
this
.
robotListTree
=
res
.
data
.
data
await
this
.
initData
(
this
.
robotListTree
)
console
.
log
(
this
.
robotListTree
,
'=======22'
)
if
(
this
.
selectRobot
&&
this
.
selectRobot
.
length
)
{
this
.
$refs
[
this
.
memberRef
].
setCheckedKeys
(
this
.
selectRobot
)
if
(
this
.
errorType
)
{
this
.
$refs
[
this
.
memberRef
].
setCheckedKeys
([
this
.
selectRobot
])
}
else
{
this
.
$refs
[
this
.
memberRef
].
setCheckedKeys
(
this
.
selectRobot
)
}
let
treeArrInfo
=
this
.
getTreeName
(
this
.
robotListTree
,
this
.
selectRobot
[
0
]
this
.
errorType
?
this
.
selectRobot
:
this
.
selectRobot
[
0
]
)
this
.
treeArr
.
push
(
treeArrInfo
)
console
.
log
(
this
.
treeArr
)
}
}
})
},
getTreeName
(
treeList
,
id
)
{
console
.
log
(
treeList
,
id
)
for
(
let
i
=
0
;
i
<
treeList
.
length
;
i
++
)
{
let
treeItem
=
treeList
[
i
]
if
(
treeItem
.
id
==
id
)
{
...
...
@@ -236,7 +237,6 @@ export default {
}
},
initData
(
data
)
{
console
.
log
(
11
)
data
.
forEach
((
item
,
index
)
=>
{
this
.
$set
(
item
,
...
...
@@ -284,56 +284,10 @@ export default {
children
.
length
&&
this
.
initData
(
children
)
})
},
getMerchantBrandList
()
{
let
getCheckedNodes
=
this
.
$refs
[
this
.
memberRef
].
getCheckedNodes
()
const
getCheckedKeys
=
this
.
$refs
[
this
.
memberRef
].
getCheckedKeys
()
const
getHalfCheckedNodes
=
this
.
$refs
[
this
.
memberRef
].
getHalfCheckedNodes
()
let
merchantBrandList
=
getHalfCheckedNodes
.
map
((
car
)
=>
{
let
merchantBrandId
=
[]
car
.
children
.
forEach
((
item
)
=>
{
if
(
getCheckedKeys
.
includes
(
item
.
id
))
{
merchantBrandId
.
push
(
item
.
id
)
}
})
return
{
cars
:
car
.
id
,
merchantBrandId
,
}
})
let
checkNodes
=
getCheckedNodes
.
filter
((
item
)
=>
item
.
children
)
let
noCheckNodes
=
getCheckedNodes
.
filter
((
item
)
=>
item
.
children
===
null
)
.
map
((
i
)
=>
{
return
{
cars
:
i
.
id
,
}
})
let
merchantBrandList2
=
checkNodes
.
map
((
car
)
=>
{
let
merchantBrandId
=
[]
car
.
children
.
forEach
((
item
)
=>
{
if
(
getCheckedKeys
.
includes
(
item
.
id
))
{
merchantBrandId
.
push
(
item
.
id
)
}
})
return
{
cars
:
car
.
id
,
merchantBrandId
,
}
})
return
merchantBrandList
.
concat
(
merchantBrandList2
).
concat
(
noCheckNodes
)
},
//勾选
handleCheck
(
val
)
{
// this.treeArr = this.getTreeArray()
console
.
log
(
val
)
// this.currentCheckData = this.$refs[this.memberRef]
// .getCheckedNodes()
// .filter((item) => item.children && item.children.length == 0)
this
.
currentCheckData
=
val
this
.
$refs
[
this
.
memberRef
].
setCheckedKeys
([
val
.
id
])
console
.
log
(
this
.
currentCheckData
.
staffId
)
// console.log(this.treeArr[0].staffId)
if
(
!
this
.
treeArr
.
length
)
{
this
.
treeArr
=
[
this
.
currentCheckData
]
}
...
...
@@ -348,43 +302,36 @@ export default {
this
.
treeArr
.
length
>
0
&&
this
.
treeArr
.
length
<
this
.
ids
.
length
this
.
checkedAll
=
this
.
treeArr
.
length
===
this
.
ids
.
length
},
getCheckList
(
checkArr
=
[])
{
checkArr
.
forEach
((
item
)
=>
(
item
=
parseInt
(
item
)))
this
.
$refs
[
this
.
memberRef
].
setCheckedKeys
(
checkArr
)
this
.
$nextTick
(()
=>
{
this
.
handleCheck
()
})
},
//获取选择项
getTreeArray
()
{
let
tree_arr
=
[]
this
.
robotListTree
.
forEach
((
k
)
=>
{
let
child
=
k
.
children
if
(
child
&&
child
.
length
>
0
)
{
child
.
forEach
((
j
)
=>
{
tree_arr
.
push
(
j
.
id
)
})
}
else
{
tree_arr
.
push
(
k
.
id
)
}
})
return
tree_arr
},
//全选
selectAll
()
{
this
.
loading
=
true
this
.
treeArr
=
this
.
getTreeArray
()
if
(
this
.
getCheckedArr
.
length
==
this
.
treeArr
.
length
)
{
this
.
checkedAll
=
false
this
.
$refs
[
this
.
memberRef
].
setCheckedKeys
([])
}
else
{
this
.
checkedAll
=
true
this
.
$refs
[
this
.
memberRef
].
setCheckedKeys
(
this
.
treeArr
)
}
setTimeout
(()
=>
{
this
.
loading
=
false
},
1000
)
},
// //获取选择项
// getTreeArray() {
// let tree_arr = []
// this.robotListTree.forEach((k) => {
// let child = k.children
// if (child && child.length > 0) {
// child.forEach((j) => {
// tree_arr.push(j.id)
// })
// } else {
// tree_arr.push(k.id)
// }
// })
// return tree_arr
// },
// //全选
// selectAll() {
// this.loading = true
// this.treeArr = this.getTreeArray()
// if (this.getCheckedArr.length == this.treeArr.length) {
// this.checkedAll = false
// this.$refs[this.memberRef].setCheckedKeys([])
// } else {
// this.checkedAll = true
// this.$refs[this.memberRef].setCheckedKeys(this.treeArr)
// }
// setTimeout(() => {
// this.loading = false
// }, 1000)
// },
//重置
selectClear
()
{
this
.
treeArr
=
[]
...
...
@@ -404,10 +351,10 @@ export default {
return
data
.
label
.
indexOf
(
value
)
!==
-
1
},
// 显示隐藏
switchBrand
()
{
this
.
brandTree
=
!
this
.
brandTree
this
.
$emit
(
'clickBrand'
,
this
.
brandTree
)
},
//
switchBrand() {
//
this.brandTree = !this.brandTree
//
this.$emit('clickBrand', this.brandTree)
//
},
},
}
</
script
>
...
...
src/views/task/addTask/index.vue
View file @
159cd23
...
...
@@ -336,8 +336,9 @@
'missionList' + (itm.taskid || itm.id) + 'robot'
"
:type=
"isEditor"
:errorType=
"isSubmit"
:robotNo=
"itm.robotMerchantNo"
:selectRobot=
"i
sEditor ? itm.enterMicroRobot : []
"
:selectRobot=
"i
tm.enterMicroRobot
"
:memberRef=
"
'missionList' + (itm.taskid || itm.id) + 'robot'
"
...
...
@@ -729,6 +730,7 @@ export default {
isEditor
:
false
,
// 是否是克隆
isClone
:
false
,
isSubmit
:
false
,
// 活动弹框
activityDiaVisible
:
false
,
// 选择任务开始日期弹框
...
...
@@ -814,10 +816,6 @@ export default {
textType
:
1
,
textContent
:
''
,
showArticle
:
true
,
// autoReminderFlag: '',
// autoReminderTime: '',
// groupChat: '',
// enterMicroRobot: '',
},
// 浏览指标任务类型
browseObj
:
{
...
...
@@ -830,10 +828,6 @@ export default {
textType
:
1
,
textContent
:
''
,
showArticle
:
true
,
// autoReminderFlag: '',
// autoReminderTime: '',
// groupChat: '',
// enterMicroRobot: '',
},
// 访客指标任务类型
visitorObj
:
{
...
...
@@ -844,10 +838,6 @@ export default {
textType
:
1
,
textContent
:
''
,
showArticle
:
true
,
// autoReminderFlag: '',
// autoReminderTime: '',
// groupChat: '',
// enterMicroRobot: '',
},
// 成单指标任务类型
orderObj
:
{
...
...
@@ -858,24 +848,11 @@ export default {
textType
:
1
,
textContent
:
''
,
showArticle
:
true
,
// autoReminderFlag: '',
// autoReminderTime: '',
// groupChat: '',
// enterMicroRobot: '',
},
// 添加福利官任务类型
walefaleObj
:
{
// autoReminderFlag: '',
// autoReminderTime: '',
// groupChat: '',
// enterMicroRobot: '',
},
walefaleObj
:
{},
// 添加一客一群任务类型
customerObj
:
{
// autoReminderFlag: '',
// autoReminderTime: '',
// groupChat: '',
// enterMicroRobot: '',
rewardCount
:
''
,
triggerValue
:
''
,
},
...
...
@@ -1002,7 +979,6 @@ export default {
// 查询发送企微
findEntmicroList
()
{
taskApi
.
findEntmicroList
({}).
then
((
res
)
=>
{
console
.
log
(
res
)
if
(
res
.
code
==
0
)
this
.
entmicroList
=
res
.
data
})
},
...
...
@@ -1147,77 +1123,10 @@ export default {
// this.getlistDepartmentTree(val)
// this.taskList = []
},
getTree
()
{
console
.
log
(
111
)
},
// 根据商户获取机器人列表
// getlistDepartmentTree(merchantId) {
// return new Promise((resolve) => {
// let params = { addChildrensFlag: true, queryMerchantId: merchantId }
// taskApi.getlistDepartmentTree(params).then((res) => {
// console.log(res)
// if (res) {
// this.brandListTree = res.data.data
// resolve()
// // this.initData(this.brandListTree)
// // console.log(this.brandListTree, '=======22')
// }
// })
// })
// },
// initData(data) {
// data.forEach((item, index) => {
// this.$set(
// item,
// 'label',
// item.staffName ? item.staffName : item.departmentName
// )
// let entmicroStaffResponses =
// this.$Utils.deepClone(item.entmicroStaffResponses) || []
// entmicroStaffResponses = entmicroStaffResponses.filter((staff, idx) => {
// if (staff.staffName) {
// this.$set(staff, 'label', staff.staffName)
// } else {
// this.$set(staff, 'label', staff.departmentName)
// }
// if (staff.staffId && !this.ids.includes(staff.staffId)) {
// this.ids.push(staff.staffId)
// return true
// } else if (staff.staffId && this.ids.includes(staff.staffId)) {
// return false
// }
// })
// let child = this.$Utils.deepClone(item.children) || []
// child = child.filter((staff, idx) => {
// if (staff.staffName) {
// this.$set(staff, 'label', staff.staffName)
// } else {
// this.$set(staff, 'label', staff.departmentName)
// }
// if (staff.staffId && !this.ids.includes(staff.staffId)) {
// this.ids.push(staff.staffId)
// return true
// } else if (staff.staffId && this.ids.includes(staff.staffId)) {
// return false
// } else if (staff.entmicroStaffResponses) {
// staff.staffId = staff.id
// return true
// }
// })
// const children = [...child, ...entmicroStaffResponses]
// item.children = children
// //清除没有员工的部门
// if (!item.staffName && item.entmicroStaffResponses === null) {
// data.splice(index, 1)
// }
// children.length && this.initData(children)
// })
// },
// 获取选中机器人
getSelectRobot
(
treeArr
)
{
this
.
selectRobot
=
treeArr
.
map
((
item
)
=>
item
.
staffId
)
this
.
selectRobotName
=
treeArr
.
map
((
item
)
=>
item
.
staffName
)
console
.
log
(
this
.
selectRobot
)
},
getMenbers
(
dateTask
,
dateTaskIndex
,
task
,
taskIndex
)
{
this
.
$set
(
...
...
@@ -1231,11 +1140,9 @@ export default {
this
.
selectRobotName
[
0
]
)
this
.
$refs
[
'taskForm'
][
dateTaskIndex
].
clearValidate
()
console
.
log
(
this
.
taskList
[
dateTaskIndex
].
missionList
[
taskIndex
],
'000'
)
},
// 获取群聊数据
getGroupList
(
item
,
index
,
itm
,
index1
)
{
console
.
log
(
itm
)
if
(
!
itm
.
enterMicroRobot
)
{
this
.
$message
({
message
:
'请先选择企微机器人'
,
...
...
@@ -1245,7 +1152,6 @@ export default {
}
let
membersIds
=
itm
.
enterMicroRobot
.
join
(
','
)
taskApi
.
getGroupList
({
msgStaffIdList
:
membersIds
}).
then
((
res
)
=>
{
console
.
log
(
res
,
'list'
)
if
(
res
.
data
.
code
==
0
)
{
this
.
groupListData
=
res
.
data
.
data
}
...
...
@@ -1253,8 +1159,6 @@ export default {
},
// 选择群聊数据
changeGroup
(
val
,
item
,
index
,
itm
,
index1
)
{
console
.
log
(
val
)
console
.
log
(
item
,
index
,
itm
,
index1
)
let
groupList
=
this
.
groupListData
.
find
((
item
)
=>
item
.
roomChatId
==
val
)
this
.
$set
(
this
.
taskList
[
index
].
missionList
[
index1
],
'groupChat'
,
val
)
this
.
$set
(
...
...
@@ -1432,7 +1336,6 @@ export default {
missionList
:
[],
})
// 如果没有传时间值,直接返回
console
.
log
(
this
.
taskList
)
if
(
!
startTime
)
return
this
.
taskList
// 如果是编辑/复制页面,任务计划回显
if
(
this
.
isEditor
||
(
this
.
isClone
&&
!
this
.
basicForm
.
activityName
))
...
...
@@ -1506,14 +1409,6 @@ export default {
})
}
},
// 根据日期获取天数
// getDateByDays(startDate, endDdate) {
// let d1 = Date.parse(new Date(startDate))
// let d2 = Date.parse(new Date(endDdate))
// // 时间戳相减 / 天数
// let day = parseInt((d2 - d1) / (1000 * 60 * 60 * 24)) + 1
// return day
// },
// 处理复制任务活动天数大于选择活动天数
getNextDate
(
date
,
day
=
1
,
format
=
'{y}-{m}-{d}'
)
{
if
(
date
)
{
...
...
@@ -1551,11 +1446,9 @@ export default {
?
this
.
taskList
[
index
].
missionList
.
length
-
1
:
0
this
.
taskList
[
index
].
missionList
[
listLength
].
taskid
=
this
.
getUuid
()
console
.
log
(
this
.
taskList
)
},
// 任务选择类型切换
selectTaskType
(
dateTask
,
dateTaskIndex
,
task
,
taskIndex
)
{
console
.
log
(
this
.
taskList
)
// dateTask -- 具体哪一天的任务对象
// dateTaskIndex -- 具体哪一天的任务对象索引
// task -- 具体哪个任务
...
...
@@ -1580,11 +1473,9 @@ export default {
}
// 判断任务类型,将任务类型参数push进taskList
let
taskItem
console
.
log
(
task
.
missonType
)
switch
(
task
.
missonType
)
{
case
1
:
taskItem
=
Object
.
assign
({},
this
.
basicObj
)
console
.
log
(
taskItem
)
break
case
2
:
taskItem
=
Object
.
assign
({},
this
.
basicObj
,
this
.
shareObj
)
...
...
@@ -1631,7 +1522,6 @@ export default {
)
return
this
.
$nextTick
(()
=>
{
// this.$set(this.taskList[dateTaskIndex].missionList, taskIndex, taskItem)
var
box
=
document
.
getElementById
(
'missionList'
+
task
.
taskid
+
'welcome'
)
...
...
@@ -1642,11 +1532,9 @@ export default {
let
textId
=
task
.
taskid
||
task
.
id
this
.
getTextBox
(
textId
,
dateTaskIndex
,
taskIndex
)
})
console
.
log
(
this
.
taskList
,
'==='
)
},
// 获取分享素材内容
getEditor
(
dateTask
,
dateTaskIndex
,
task
,
taskIndex
)
{
console
.
log
(
111
)
// dateTask -- 具体哪一天的任务对象
// dateTaskIndex -- 具体哪一天的任务对象索引
// task -- 具体哪个任务
...
...
@@ -1739,11 +1627,6 @@ export default {
})
})
},
// handleBlur(dateTask) {
// if (dateTask.repeatCount) {
// dateTask.repeatFlag = false
// }
// },
// 重复次数选择框改变
repeatChange
(
listindex
,
dateTask
,
type
,
taskIndex
)
{
if
(
type
)
{
...
...
@@ -1863,6 +1746,13 @@ export default {
if
(
itm
.
enterMicroRobot
)
{
itm
.
enterMicroRobot
=
itm
.
enterMicroRobot
.
split
(
','
)
}
// 处理目标群聊回显
if
(
itm
.
groupChat
)
{
this
.
groupListData
.
push
({
roomName
:
itm
.
groupChatName
,
roomChatId
:
itm
.
groupChat
,
})
}
})
})
// 获取其为机器人列表
...
...
@@ -1870,7 +1760,6 @@ export default {
// 判断场景(代运营只有完整周期)
if
(
businessScene
==
4
)
{
this
.
taskList
=
this
.
taskEditList
.
missionDateList
console
.
log
(
this
.
taskList
)
}
else
{
this
.
setHouseRatesColumn
(
startTime
,
endTime
)
}
...
...
@@ -1936,7 +1825,6 @@ export default {
// 企业机器人切换
robotMerchantChange
(
itm
)
{
let
refLable
=
'missionList'
+
(
itm
.
taskid
||
itm
.
id
)
+
'robot'
console
.
log
(
this
.
$refs
[
refLable
])
this
.
$refs
[
refLable
][
0
].
getlistDepartmentTree
(
itm
.
robotMerchantNo
)
},
// 基础信息表单验证
...
...
@@ -1977,6 +1865,7 @@ export default {
submitTask
()
{
// 遍历
// let submitList = JSON.parse(JSON.stringify(this.taskList))
this
.
isSubmit
=
true
this
.
taskList
.
map
((
item
)
=>
{
item
.
missionList
.
map
((
itm
)
=>
{
// 重复次数处理
...
...
@@ -2048,11 +1937,6 @@ export default {
}
// 处理软文表情太大
if
(
itm
.
textContent
)
{
// let regErr = /<img\b/gi
// itm.textContent = itm.textContent.replace(
// regErr,
// `<img style="width: 18px;height 18px"`
// )
var
regex0
=
new
RegExp
(
'(i?)(\<img)([^\>]+\>)'
,
'gmi'
)
itm
.
textContent
=
itm
.
textContent
...
...
@@ -2067,11 +1951,6 @@ export default {
if
(
itm
.
enterMicroRobot
)
{
itm
.
enterMicroRobot
=
itm
.
enterMicroRobot
.
join
(
','
)
}
// 处理完整周期时间
// if (item.activityTime == -1 && itm.autoReminderTime) {
// console.log(111)
// itm.autoReminderTime = '0000-00-00 ' + itm.autoReminderTime
// }
})
})
let
params
=
JSON
.
parse
(
JSON
.
stringify
(
this
.
basicForm
))
...
...
@@ -2087,7 +1966,6 @@ export default {
}
params
.
missionDateList
=
this
.
taskList
params
.
id
=
this
.
taskId
console
.
log
(
params
,
'==='
)
// 创建
if
(
!
this
.
isEditor
)
{
taskApi
.
creatMission
(
params
).
then
(
...
...
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