|
|
@ -1,6 +1,6 @@ |
|
|
// pages/home/employee/index.js
|
|
|
// pages/home/employee/index.js
|
|
|
import Scene from '../../index/scene' |
|
|
import Scene from '../../index/scene' |
|
|
import { getCheckList, auditEmploye, adminEmploye, deleteEmploye, generateCode } from "../../../api/user" |
|
|
|
|
|
|
|
|
import { getCheckList, auditEmploye, generateCode } from "../../../api/user" |
|
|
import { getEmployeList } from "../../../api/saas" |
|
|
import { getEmployeList } from "../../../api/saas" |
|
|
const util = require('../../../utils/util') |
|
|
const util = require('../../../utils/util') |
|
|
const app = getApp() |
|
|
const app = getApp() |
|
|
@ -46,9 +46,9 @@ Scene({ |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
lookItem: function(e){ |
|
|
lookItem: function(e){ |
|
|
|
|
|
var that = this |
|
|
this.data.nowIndex = e.currentTarget.dataset.index |
|
|
this.data.nowIndex = e.currentTarget.dataset.index |
|
|
var item = this.data.memberList[this.data.nowIndex] |
|
|
var item = this.data.memberList[this.data.nowIndex] |
|
|
item.apply = 0 |
|
|
|
|
|
wx.navigateTo({ |
|
|
wx.navigateTo({ |
|
|
url: `/pages/home/employee-info/index?id=${item.enterpriseMemberId}`, |
|
|
url: `/pages/home/employee-info/index?id=${item.enterpriseMemberId}`, |
|
|
events: { |
|
|
events: { |
|
|
@ -63,62 +63,36 @@ Scene({ |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
// setAdmin: function(index, item){
|
|
|
|
|
|
// wx.showLoading({ title: '加载中', mask: true })
|
|
|
|
|
|
// if(item.position == 'ADMINISTRATOR'){
|
|
|
|
|
|
// var sindex = -1
|
|
|
|
|
|
// for (var i = 0; i < this.data.eemidList.length; i++) {
|
|
|
|
|
|
// if (this.data.eemidList[i] == item.id){
|
|
|
|
|
|
// sindex = i
|
|
|
|
|
|
// break
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// this.data.eemidList.splice(sindex, 1)
|
|
|
|
|
|
// } else {
|
|
|
|
|
|
// if(this.data.eemidList.indexOf(item.id) < 0){
|
|
|
|
|
|
// this.data.eemidList.push(item.id)
|
|
|
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
|
|
|
// adminEmploye({ids: this.data.eemidList }).then(result => {
|
|
|
|
|
|
// this.setData({ ['memberList[' + index + '].position'] : item.position == 'ADMINISTRATOR' ? 'ORDINARY' : 'ADMINISTRATOR'})
|
|
|
|
|
|
// wx.hideLoading()
|
|
|
|
|
|
// }).catch(err => {
|
|
|
|
|
|
// wx.hideLoading()
|
|
|
|
|
|
// util.showToast(err)
|
|
|
|
|
|
// })
|
|
|
|
|
|
// },
|
|
|
|
|
|
// deleteItem: function(index, item){
|
|
|
|
|
|
// wx.showLoading({ title: '加载中', mask: true })
|
|
|
|
|
|
// deleteEmploye({idList: [item.enterpriseMemberId] }).then(result => {
|
|
|
|
|
|
// this.fetchMemberList()
|
|
|
|
|
|
// }).catch(err => {
|
|
|
|
|
|
// wx.hideLoading()
|
|
|
|
|
|
// util.showToast(err)
|
|
|
|
|
|
// })
|
|
|
|
|
|
// },
|
|
|
|
|
|
// agreeItem: function(e){
|
|
|
|
|
|
// wx.showLoading({ title: '加载中', mask: true })
|
|
|
|
|
|
// var item = this.data.checkList[e.currentTarget.dataset.index]
|
|
|
|
|
|
// auditEmploye({id: item.id, status: 1 }).then(result => {
|
|
|
|
|
|
// this.fetchMemberList()
|
|
|
|
|
|
// }).catch(err => {
|
|
|
|
|
|
// wx.hideLoading()
|
|
|
|
|
|
// console.log(err)
|
|
|
|
|
|
// util.showToast(err)
|
|
|
|
|
|
// })
|
|
|
|
|
|
// },
|
|
|
|
|
|
// refuseItem: function(e){
|
|
|
|
|
|
// wx.showLoading({ title: '加载中', mask: true })
|
|
|
|
|
|
// var item = this.data.checkList[e.currentTarget.dataset.index]
|
|
|
|
|
|
// auditEmploye({id: item.id, status: 2 }).then(result => {
|
|
|
|
|
|
// this.setData({ ['checkList[' + e.currentTarget.dataset.index + '].status']: 2})
|
|
|
|
|
|
// wx.hideLoading()
|
|
|
|
|
|
// }).catch(err => {
|
|
|
|
|
|
// wx.hideLoading()
|
|
|
|
|
|
// console.log(err)
|
|
|
|
|
|
// util.showToast(err)
|
|
|
|
|
|
// })
|
|
|
|
|
|
// },
|
|
|
|
|
|
|
|
|
agreeItem: function(e){ |
|
|
|
|
|
var that = this |
|
|
|
|
|
this.data.nowIndex = e.currentTarget.dataset.index |
|
|
|
|
|
var item = this.data.checkList[this.data.nowIndex] |
|
|
|
|
|
wx.navigateTo({ |
|
|
|
|
|
url: `/pages/home/employee-info/index?id=${item.enterpriseMemberId}`, |
|
|
|
|
|
events: { |
|
|
|
|
|
onCallback: (data) => { |
|
|
|
|
|
if (data.what == 120) { |
|
|
|
|
|
that.fetchMemberList() |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
success: function(res) { |
|
|
|
|
|
res.eventChannel.emit('onParam', item) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
refuseItem: function(e){ |
|
|
|
|
|
wx.showLoading({ title: '加载中', mask: true }) |
|
|
|
|
|
var item = this.data.checkList[e.currentTarget.dataset.index] |
|
|
|
|
|
auditEmploye({id: item.id, status: 2 }).then(result => { |
|
|
|
|
|
this.setData({ ['checkList[' + e.currentTarget.dataset.index + '].status']: 2}) |
|
|
|
|
|
wx.hideLoading() |
|
|
|
|
|
}).catch(err => { |
|
|
|
|
|
wx.hideLoading() |
|
|
|
|
|
console.log(err) |
|
|
|
|
|
util.showToast(err) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
onClickHideEmbedded: function(){ |
|
|
onClickHideEmbedded: function(){ |
|
|
this.setData({ showEmbedded: false }) |
|
|
this.setData({ showEmbedded: false }) |
|
|
}, |
|
|
}, |
|
|
|