|
@@ -211,14 +211,16 @@ export default {
|
|
|
},
|
|
},
|
|
|
handleConfirm (data) {
|
|
handleConfirm (data) {
|
|
|
this.selectorVisible = false
|
|
this.selectorVisible = false
|
|
|
|
|
+ const userIdArr = data.map((d) => { return d.id })
|
|
|
addRoleUser({
|
|
addRoleUser({
|
|
|
roleId: this.id,
|
|
roleId: this.id,
|
|
|
- userIds: data.map((d) => { return d.id }).join(',')
|
|
|
|
|
|
|
+ userIds: userIdArr.join(',')
|
|
|
}).then(response => {
|
|
}).then(response => {
|
|
|
this.selectorVisible = false
|
|
this.selectorVisible = false
|
|
|
ActionUtils.success('加入人员成功!')
|
|
ActionUtils.success('加入人员成功!')
|
|
|
this.search()
|
|
this.search()
|
|
|
})
|
|
})
|
|
|
|
|
+ this.handleUpemployee('add', userIdArr.join(','))
|
|
|
},
|
|
},
|
|
|
/**
|
|
/**
|
|
|
* 处理删除
|
|
* 处理删除
|
|
@@ -241,6 +243,56 @@ export default {
|
|
|
ActionUtils.removeSuccessMessage()
|
|
ActionUtils.removeSuccessMessage()
|
|
|
this.search()
|
|
this.search()
|
|
|
}).catch(() => {})
|
|
}).catch(() => {})
|
|
|
|
|
+ this.handleUpemployee('remove', ids)
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 根据所选择的人员信息,修改对应人员的job_信息
|
|
|
|
|
+ */
|
|
|
|
|
+ handleUpemployee (type, ids) {
|
|
|
|
|
+ const tableName = 'ibps_party_employee'
|
|
|
|
|
+ // 更新ibps_party_employee里job_信息
|
|
|
|
|
+ const sql = `select *from ${tableName} where find_in_set(id_,'${ids}')`
|
|
|
|
|
+ this.$common.request('sql', sql).then((res) => {
|
|
|
|
|
+ const resDatas = res.variables.data
|
|
|
|
|
+ const updListDatas = []
|
|
|
|
|
+ for (const i of resDatas) {
|
|
|
|
|
+ const updListData = {
|
|
|
|
|
+ where: {
|
|
|
|
|
+ id_: i.ID_
|
|
|
|
|
+ },
|
|
|
|
|
+ param: {
|
|
|
|
|
+ JOB_: this.fixAddJob(type, i.JOB_, this.id)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ updListDatas.push(updListData)
|
|
|
|
|
+ }
|
|
|
|
|
+ const updateParams = {
|
|
|
|
|
+ tableName,
|
|
|
|
|
+ updList: updListDatas
|
|
|
|
|
+ }
|
|
|
|
|
+ this.$common.request('update', updateParams).then(() => {
|
|
|
|
|
+ console.log('更新数据成功')
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 在oldIds里剔除fixId,或者增加fixId
|
|
|
|
|
+ */
|
|
|
|
|
+ fixAddJob (type, oldIds, fixId) {
|
|
|
|
|
+ const oldIdsArr = oldIds.split(',')
|
|
|
|
|
+ if (type === 'remove') {
|
|
|
|
|
+ oldIdsArr.splice(oldIdsArr.indexOf(fixId), 1)
|
|
|
|
|
+ oldIds = oldIdsArr.join(',')
|
|
|
|
|
+ } else {
|
|
|
|
|
+ if (oldIds && oldIds.indexOf(fixId) < 0) {
|
|
|
|
|
+ oldIdsArr.push(fixId)
|
|
|
|
|
+ oldIds = oldIdsArr.join(',')
|
|
|
|
|
+ } else if (!oldIds) {
|
|
|
|
|
+ oldIds = fixId
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return oldIds
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|