|
|
|
@ -50,17 +50,23 @@ Scene({ |
|
|
|
const item = element.factoryInfos[nIndex] |
|
|
|
if(item.factoryId == app.userInfo.factoryId){ |
|
|
|
this.data.mActiveIndex = mIndex |
|
|
|
if(element.isEnterprisePrimary){ |
|
|
|
app.userInfo.type = 'ADMIN' |
|
|
|
} else { |
|
|
|
app.userInfo.type = item.type || '' |
|
|
|
} |
|
|
|
} |
|
|
|
if(nIndex >= 1){ |
|
|
|
this.data.arrow = true |
|
|
|
} |
|
|
|
var factory = { id: item.factoryId } |
|
|
|
if(item.applicationStatus == 0 && !element.isAdmin){ |
|
|
|
if(item.applicationStatus == 0 && !element.isEnterprisePrimary){ |
|
|
|
factory.text = item.factoryName + '(申请中)' |
|
|
|
factory.disabled = true |
|
|
|
} else { |
|
|
|
factory.text = item.factoryName |
|
|
|
} |
|
|
|
factory.index = nIndex |
|
|
|
children.push(factory) |
|
|
|
} |
|
|
|
enterprise.children = children |
|
|
|
@ -131,6 +137,12 @@ Scene({ |
|
|
|
wx.showLoading({ title: '正在切换', mask: true }) |
|
|
|
app.userInfo.factoryId = detail.id |
|
|
|
storage.put('X-FACTORY-ID' + app.userInfo.userId, detail.id) |
|
|
|
const element = app.userInfo.enterpriseInfos[this.data.mActiveIndex] |
|
|
|
if(element.isEnterprisePrimary){ |
|
|
|
app.userInfo.type = 'ADMIN' |
|
|
|
} else { |
|
|
|
app.userInfo.type = element.factoryInfos[detail.index].type || '' |
|
|
|
} |
|
|
|
headerFactoryId(detail.id) |
|
|
|
var pageView = this.selectComponent('#' + this.data.tabList[this.data.tabIndex].value) |
|
|
|
if (pageView && this.data.tabIndex != 3) { |
|
|
|
|