|
@@ -31,7 +31,7 @@ Component({
|
|
|
name: ""
|
|
name: ""
|
|
|
},
|
|
},
|
|
|
users: {
|
|
users: {
|
|
|
- active: {}
|
|
|
|
|
|
|
+ active: ''
|
|
|
},
|
|
},
|
|
|
isleave: 1,
|
|
isleave: 1,
|
|
|
tabs: [{
|
|
tabs: [{
|
|
@@ -55,10 +55,12 @@ Component({
|
|
|
methods: {
|
|
methods: {
|
|
|
userList() {
|
|
userList() {
|
|
|
const nowUserid = wx.getStorageSync('userMsg').userid
|
|
const nowUserid = wx.getStorageSync('userMsg').userid
|
|
|
- const userid = this.data.users.active != nowUserid ? this.data.users.active : nowUserid
|
|
|
|
|
-
|
|
|
|
|
- console.log(wx.getStorageSync('userMsg').userid)
|
|
|
|
|
- console.log(userid,'userid555')
|
|
|
|
|
|
|
+ console.log(this.data.users.active)
|
|
|
|
|
+ console.log(nowUserid)
|
|
|
|
|
+ console.log(this.data.users.active != nowUserid)
|
|
|
|
|
+ const userid = this.data.users.active !== nowUserid && this.data.users.active !== '' ? this.data.users.active : nowUserid
|
|
|
|
|
+ const accountno = wx.getStorageSync('userMsg').accountno
|
|
|
|
|
+ console.log(userid,'userid')
|
|
|
this.setData({
|
|
this.setData({
|
|
|
'users.active':userid
|
|
'users.active':userid
|
|
|
})
|
|
})
|
|
@@ -66,20 +68,22 @@ Component({
|
|
|
"id": 2025122211095302,
|
|
"id": 2025122211095302,
|
|
|
"content": {}
|
|
"content": {}
|
|
|
}).then(res => {
|
|
}).then(res => {
|
|
|
- console.log(res,'数据222')
|
|
|
|
|
res.data.unshift({
|
|
res.data.unshift({
|
|
|
name:"我",
|
|
name:"我",
|
|
|
- userid: 2800
|
|
|
|
|
|
|
+ userid: nowUserid,
|
|
|
|
|
+ accountno:accountno
|
|
|
})
|
|
})
|
|
|
|
|
+
|
|
|
this.setData({
|
|
this.setData({
|
|
|
- 'users.list':res.data
|
|
|
|
|
|
|
+ 'users.list':res.data,
|
|
|
|
|
+ 'users.active':userid
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
searchChange({
|
|
searchChange({
|
|
|
detail
|
|
detail
|
|
|
}) {
|
|
}) {
|
|
|
- console.log('输出底层', detail)
|
|
|
|
|
|
|
+
|
|
|
if (detail.length == 0) return this.searchClear()
|
|
if (detail.length == 0) return this.searchClear()
|
|
|
let list = JSON.parse(JSON.stringify(this.data.users.copyList));
|
|
let list = JSON.parse(JSON.stringify(this.data.users.copyList));
|
|
|
this.setData({
|
|
this.setData({
|
|
@@ -91,100 +95,8 @@ Component({
|
|
|
'users.list': JSON.parse(JSON.stringify(this.data.users.copyList))
|
|
'users.list': JSON.parse(JSON.stringify(this.data.users.copyList))
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- changLeave(e) {
|
|
|
|
|
- this.setData({
|
|
|
|
|
- isleave: e.currentTarget.dataset.value,
|
|
|
|
|
- 'result.isleave': e.currentTarget.dataset.value
|
|
|
|
|
- })
|
|
|
|
|
- console.log("result", this.data.result)
|
|
|
|
|
- this.initDepAndUser(false);
|
|
|
|
|
- },
|
|
|
|
|
- initDepAndUser(init = true) {
|
|
|
|
|
- if (init) this.setData({
|
|
|
|
|
- takeEffect: "", //生效筛选项
|
|
|
|
|
- result: {},
|
|
|
|
|
- })
|
|
|
|
|
- let content = {
|
|
|
|
|
- isleave: this.data.isleave
|
|
|
|
|
- }
|
|
|
|
|
- return new Promise((resolve) => {
|
|
|
|
|
- _Http.basic({
|
|
|
|
|
- "id": 20230620102004,
|
|
|
|
|
- content
|
|
|
|
|
- }).then(res => {
|
|
|
|
|
- console.log("获取部门", res)
|
|
|
|
|
- if (this.data.isdep && this.data.depGroud.length == 0) this.setData({
|
|
|
|
|
- depGroud: [{
|
|
|
|
|
- label: "部门",
|
|
|
|
|
- list: res.data.dep,
|
|
|
|
|
- active: ""
|
|
|
|
|
- }]
|
|
|
|
|
- })
|
|
|
|
|
- console.log("depGroud", this.data.depGroud)
|
|
|
|
|
- console.log("result", this.data.result)
|
|
|
|
|
- console.log("active", this.data.active)
|
|
|
|
|
-
|
|
|
|
|
- if (this.data.isusers) {
|
|
|
|
|
- let active = this.data.users.active;
|
|
|
|
|
- if (this.data.defaultMy && this.data.result.name == '') {
|
|
|
|
|
- let user = res.data.hr.find(v => v.userid == wx.getStorageSync('userMsg').userid)
|
|
|
|
|
- if (user) {
|
|
|
|
|
- active = user.userid;
|
|
|
|
|
- resolve(user)
|
|
|
|
|
- this.setData({
|
|
|
|
|
- takeEffect: "user",
|
|
|
|
|
- result: user
|
|
|
|
|
- })
|
|
|
|
|
- } else {
|
|
|
|
|
- this.setData({
|
|
|
|
|
- takeEffect: "",
|
|
|
|
|
- result: {}
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- this.setData({
|
|
|
|
|
- users: {
|
|
|
|
|
- label: "业务员",
|
|
|
|
|
- list: res.data.hr,
|
|
|
|
|
- copyList: res.data.hr,
|
|
|
|
|
- active
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- if (init) this.setData({
|
|
|
|
|
- isleave: this.data.defaultIsleave
|
|
|
|
|
- })
|
|
|
|
|
- resolve({})
|
|
|
|
|
- })
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
- selectDep(e) {
|
|
|
|
|
- const {
|
|
|
|
|
- item,
|
|
|
|
|
- index
|
|
|
|
|
- } = e.currentTarget.dataset;
|
|
|
|
|
- let depGroud = this.data.depGroud.slice(0, index + 1);
|
|
|
|
|
- depGroud[index].active = item.sa_saleareaid;
|
|
|
|
|
- if (item.subdep.length) {
|
|
|
|
|
- item.subdep.unshift(JSON.parse(JSON.stringify(item)))
|
|
|
|
|
- item.subdep[0].depname = getApp().globalData.Language.getMapText('全部');
|
|
|
|
|
- item.subdep[0].subdep = [];
|
|
|
|
|
- depGroud.push({
|
|
|
|
|
- label: item.depname + getApp().globalData.Language.getMapText('下级部门'),
|
|
|
|
|
- list: item.subdep,
|
|
|
|
|
- active: item.sa_saleareaid
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- item.name = item.depname
|
|
|
|
|
- item.isleave = this.data.isleave;
|
|
|
|
|
- this.setData({
|
|
|
|
|
- depGroud,
|
|
|
|
|
- takeEffect: "dep",
|
|
|
|
|
- result: item
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
|
|
+
|
|
|
selectUser(e) {
|
|
selectUser(e) {
|
|
|
- console.log(e,'输出3333')
|
|
|
|
|
const {
|
|
const {
|
|
|
item
|
|
item
|
|
|
} = e.currentTarget.dataset;
|
|
} = e.currentTarget.dataset;
|