|
|
@ -1,7 +1,7 @@ |
|
|
|
const QQMapWX = require("../../utils/qqmap-wx-jssdk") |
|
|
|
import { $wuxActionSheet } from "../../../../dist/index" |
|
|
|
const config = require("../../../../utils/config") |
|
|
|
import { addIssue, getEventTagList } from "../../utils/api" |
|
|
|
import { addIssue, getEventTagList, getEventtagWorkuser } from "../../utils/api" |
|
|
|
|
|
|
|
Page({ |
|
|
|
data: { |
|
|
@ -21,6 +21,14 @@ Page({ |
|
|
|
tagIds: [], |
|
|
|
checkboxs: [], |
|
|
|
lock: false, //锁定发布状态,防止连击
|
|
|
|
showDialog: false, |
|
|
|
boxTitle: '', // checkbox 对话框标题
|
|
|
|
leaderList: [], |
|
|
|
pageIndex: 1, |
|
|
|
pageSize: 10, |
|
|
|
loadMoreType: "none", |
|
|
|
workuserId: '', // 选中工作人员id
|
|
|
|
workUserIds: [], // 选中工作人员id集合
|
|
|
|
}, |
|
|
|
onLoad () { |
|
|
|
this.getEventTagList() |
|
|
@ -46,6 +54,32 @@ Page({ |
|
|
|
addressContent: e.detail.value.trim('') |
|
|
|
}) |
|
|
|
}, |
|
|
|
//
|
|
|
|
getEventtagWorkuser () { |
|
|
|
let param = { |
|
|
|
pageIndex: this.data.pageIndex, |
|
|
|
pageSize: this.data.pageSize, |
|
|
|
eventTagId: this.data.workuserId |
|
|
|
} |
|
|
|
getEventtagWorkuser(param).then(res => { |
|
|
|
let leaderList = [ ...this.data.leaderList, ...res.data ] |
|
|
|
this.setData({ |
|
|
|
leaderList, |
|
|
|
loadMoreType: res.data.length === 10 ? "loading" : "none" |
|
|
|
}) |
|
|
|
if (this.data.leaderList.length > 0 && !this.data.showDialog) { |
|
|
|
this.setData({ |
|
|
|
showDialog: true |
|
|
|
}) |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
this.setData({ |
|
|
|
leaderList: [], |
|
|
|
loadMoreType: "none" |
|
|
|
}) |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
}, |
|
|
|
//获取事件标签列表
|
|
|
|
getEventTagList () { |
|
|
|
getEventTagList().then(res => { |
|
|
@ -252,7 +286,8 @@ Page({ |
|
|
|
issueLatitude: this.data.latitude, |
|
|
|
images: imagesList, |
|
|
|
isConReview: this.data.isConReview, |
|
|
|
tagIds: this.data.tagIds |
|
|
|
tagIds: this.data.tagIds, |
|
|
|
workUserIds: this.data.workUserIds |
|
|
|
} |
|
|
|
this.setData({ |
|
|
|
lock: true |
|
|
@ -330,9 +365,10 @@ Page({ |
|
|
|
}, |
|
|
|
|
|
|
|
checkboxClick (e) { |
|
|
|
this.data.tagIds = [] //当前版本标签单选
|
|
|
|
this.data.workUserIds = [] |
|
|
|
if (this.data.checkboxs[e.currentTarget.dataset.index].checked) { |
|
|
|
this.data.checkboxs[e.currentTarget.dataset.index].checked = false |
|
|
|
this.data.tagIds = [] //当前版本标签单选
|
|
|
|
} else { |
|
|
|
for(let i=0;i<this.data.checkboxs.length;i++) { |
|
|
|
this.data.checkboxs[i].checked = false |
|
|
@ -340,18 +376,58 @@ Page({ |
|
|
|
this.data.checkboxs[e.currentTarget.dataset.index].checked = true |
|
|
|
|
|
|
|
this.data.tagIds = [] //当前版本标签单选
|
|
|
|
this.data.tagIds.push(this.data.checkboxs[e.currentTarget.dataset.index].id) |
|
|
|
this.data.tagIds.push(this.data.checkboxs[e.currentTarget.dataset.index].id) |
|
|
|
|
|
|
|
this.setData({ |
|
|
|
boxTitle: e.currentTarget.dataset.title, |
|
|
|
workuserId: this.data.tagIds[0] |
|
|
|
}, () => { |
|
|
|
this.getEventtagWorkuser() |
|
|
|
}) |
|
|
|
} |
|
|
|
this.setData({ |
|
|
|
checkboxs: this.data.checkboxs |
|
|
|
}) |
|
|
|
console.log(this.data.tagIds) |
|
|
|
// console.log(this.data.tagIds)
|
|
|
|
}, |
|
|
|
// 关闭对话框
|
|
|
|
closeCheckboxDialog () { |
|
|
|
this.setData({ |
|
|
|
showDialog: false, |
|
|
|
leaderList: [], |
|
|
|
loadMoreType: "none", |
|
|
|
pageIndex: 1 |
|
|
|
}) |
|
|
|
}, |
|
|
|
//
|
|
|
|
confirmCheckboxDialog () { |
|
|
|
let list = [] |
|
|
|
this.data.leaderList.forEach(item => { |
|
|
|
if (item.checked) { |
|
|
|
list.push(item.id) |
|
|
|
} |
|
|
|
}) |
|
|
|
this.setData({ |
|
|
|
showDialog: false, |
|
|
|
leaderList: [], |
|
|
|
loadMoreType: "none", |
|
|
|
pageIndex: 1, |
|
|
|
workUserIds: [ ...list ] |
|
|
|
}) |
|
|
|
}, |
|
|
|
checkboxChange (e) { |
|
|
|
let item = this.data.leaderList[e.currentTarget.dataset.index] |
|
|
|
item.checked = !item.checked |
|
|
|
this.setData({ |
|
|
|
leaderList: this.data.leaderList |
|
|
|
}) |
|
|
|
}, |
|
|
|
dialogReachBottom () { |
|
|
|
if (this.data.loadMoreType === "loading") { |
|
|
|
this.setData({ |
|
|
|
pageIndex: this.data.pageIndex + 1 |
|
|
|
}) |
|
|
|
this.getEventtagWorkuser() |
|
|
|
} |
|
|
|
} |
|
|
|
// toOperationDesc(phrase) { //常用于点击事件
|
|
|
|
// // console.log(phrase.currentTarget.dataset.phrase)
|
|
|
|
// this.setData({
|
|
|
|
// issueContent: this.data.issueContent + phrase.currentTarget.dataset.phrase,
|
|
|
|
// })
|
|
|
|
// // console.log(phrase.currentTarget.dataset.phrase)
|
|
|
|
// },
|
|
|
|
}) |