|
@@ -246,7 +246,7 @@
|
|
|
src: '../../static/img/myimg/erp.png',
|
|
|
tips: 0,
|
|
|
url: `/pages/erp/index`,
|
|
|
- show: uni.getStorageSync('pcUserInfo')?true:false
|
|
|
+ show: uni.getStorageSync('pcUserInfo') ? true : false
|
|
|
},
|
|
|
{
|
|
|
num: 1,
|
|
@@ -256,7 +256,7 @@
|
|
|
src: '../../static/img/myimg/sg.png',
|
|
|
tips: 0,
|
|
|
url: `/pages/erpbusiness/index`,
|
|
|
- show: uni.getStorageSync('pcUserInfo')?true:false
|
|
|
+ show: uni.getStorageSync('pcUserInfo') ? true : false
|
|
|
},
|
|
|
{
|
|
|
num: 2,
|
|
@@ -274,7 +274,7 @@
|
|
|
src: '../../static/img/sign/myTask@2x.png',
|
|
|
tips: 0,
|
|
|
url: '/pages/task/my_task',
|
|
|
- show: uni.getStorageSync('pcUserInfo')?true:false
|
|
|
+ show: uni.getStorageSync('pcUserInfo') ? true : false
|
|
|
},
|
|
|
{
|
|
|
num: 4,
|
|
@@ -300,8 +300,8 @@
|
|
|
// icon: 'cuIcon-edit',
|
|
|
src: '../../static/img/sign/shujubaobiao@2x.png',
|
|
|
tips: 0,
|
|
|
- url: `/pages/user/report`,
|
|
|
- show: uni.getStorageSync('pcUserInfo')?true:false
|
|
|
+ url: `/pages/user/newReport`,
|
|
|
+ show: uni.getStorageSync('pcUserInfo') ? true : false
|
|
|
},
|
|
|
{
|
|
|
num: 7,
|
|
@@ -310,7 +310,7 @@
|
|
|
src: '../../static/img/sign/kudianjiankong@2x.png',
|
|
|
tips: 0,
|
|
|
url: `/pages/user/depotMonitoring`,
|
|
|
- show: uni.getStorageSync('pcUserInfo')?true:false
|
|
|
+ show: uni.getStorageSync('pcUserInfo') ? true : false
|
|
|
},
|
|
|
{
|
|
|
num: 8,
|
|
@@ -319,7 +319,7 @@
|
|
|
src: '../../static/img/oa_office/oaOffice.png',
|
|
|
tips: 0,
|
|
|
url: `/pages/oa_office/the_oaOffice`,
|
|
|
- show: uni.getStorageSync('pcUserInfo')?true:false
|
|
|
+ show: uni.getStorageSync('pcUserInfo') ? true : false
|
|
|
},
|
|
|
// {
|
|
|
// num: 9,
|
|
@@ -384,7 +384,7 @@
|
|
|
},
|
|
|
// #endif
|
|
|
computed: {
|
|
|
- ...mapState(['hasLogin', 'userInfo','clientId']),
|
|
|
+ ...mapState(['hasLogin', 'userInfo', 'clientId']),
|
|
|
// 手机号中间4位加*
|
|
|
starUserphone() {
|
|
|
let reg = /^(\d{3})\d{4}(\d{4})$/;
|
|
@@ -398,18 +398,20 @@
|
|
|
},
|
|
|
onShow() {
|
|
|
// console.log(111111111)
|
|
|
- if(uni.getStorageSync('pcUserInfo')){
|
|
|
+ if (uni.getStorageSync('pcUserInfo')) {
|
|
|
// console.log(2222222)
|
|
|
for (var i = 0; i < this.gridList1.length; i++) {
|
|
|
- if(this.gridList1[i].num==0||this.gridList1[i].num==1||this.gridList1[i].num==3||this.gridList1[i].num==6||this.gridList1[i].num==7||this.gridList1[i].num==8){
|
|
|
- this.gridList1[i].show=true
|
|
|
+ if (this.gridList1[i].num == 0 || this.gridList1[i].num == 1 || this.gridList1[i].num == 3 || this
|
|
|
+ .gridList1[i].num == 6 || this.gridList1[i].num == 7 || this.gridList1[i].num == 8) {
|
|
|
+ this.gridList1[i].show = true
|
|
|
}
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
// console.log(33333333)
|
|
|
for (var i = 0; i < this.gridList1.length; i++) {
|
|
|
- if(this.gridList1[i].num==0||this.gridList1[i].num==1||this.gridList1[i].num==3||this.gridList1[i].num==6||this.gridList1[i].num==7||this.gridList1[i].num==8){
|
|
|
- this.gridList1[i].show=false
|
|
|
+ if (this.gridList1[i].num == 0 || this.gridList1[i].num == 1 || this.gridList1[i].num == 3 || this
|
|
|
+ .gridList1[i].num == 6 || this.gridList1[i].num == 7 || this.gridList1[i].num == 8) {
|
|
|
+ this.gridList1[i].show = false
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -427,7 +429,7 @@
|
|
|
index: 4
|
|
|
})
|
|
|
this.loadData()
|
|
|
- console.log("hasLogin", this.hasLogin)
|
|
|
+ console.log("hasLogin", this.hasLogin)
|
|
|
var that = this
|
|
|
if (this.userInfo) {
|
|
|
if (!this.userInfo.avatarUrl) {
|
|
@@ -467,7 +469,7 @@
|
|
|
// });
|
|
|
}
|
|
|
})
|
|
|
- console.log("this.1111")
|
|
|
+ console.log("this.1111")
|
|
|
// uni.getStorage({
|
|
|
// key: 'compName1',
|
|
|
// success: function (res) {
|
|
@@ -479,26 +481,26 @@
|
|
|
// }
|
|
|
// },
|
|
|
// fail() {
|
|
|
-
|
|
|
+
|
|
|
// }
|
|
|
// });
|
|
|
+ that.compName = uni.getStorageSync('compName1')
|
|
|
that.$api.doRequest('get', '/commonUser/getCompOwn', {
|
|
|
phone: that.userInfo.phone
|
|
|
}).then(res => {
|
|
|
if (res.data.data) {
|
|
|
that.companyList = res.data.data
|
|
|
- console.log("that.3333")
|
|
|
- console.log(that.companyList)
|
|
|
+ console.log("that.3333")
|
|
|
+ console.log(that.companyList)
|
|
|
if (that.companyList.length > 0) {
|
|
|
- if(!that.compName){
|
|
|
+ if (!that.compName) {
|
|
|
that.compName = that.companyList[0].compName
|
|
|
uni.setStorageSync('compName1', that.companyList[0].compName)
|
|
|
}
|
|
|
console.log("this.compName")
|
|
|
console.log(that.compName)
|
|
|
that.haveCompany = true
|
|
|
- }
|
|
|
- else{
|
|
|
+ } else {
|
|
|
that.haveCompany = false
|
|
|
}
|
|
|
}
|
|
@@ -520,100 +522,107 @@
|
|
|
this.isShowAlert = false
|
|
|
},
|
|
|
compconfirm(e) {
|
|
|
- var that=this
|
|
|
+ var that = this
|
|
|
uni.showLoading({
|
|
|
title: '登录中',
|
|
|
- mask:true
|
|
|
+ mask: true
|
|
|
})
|
|
|
- console.log("clinetId",this.clientId)
|
|
|
- this.$api.doRequest('get','/commonUser/login',{phone:this.userInfo.phone,password:"999999",cid:this.clientId}).then(res => {
|
|
|
- if(res.data.code==200){
|
|
|
- console.log("userInfo",res.data.data)
|
|
|
- uni.setStorageSync('userInfo', res.data.data)
|
|
|
- this.$api.doRequest('post','/commonUser/api/loginQuickly',{
|
|
|
- mobilePhone: this.userInfo.phone,
|
|
|
- companyName: this.companyList[e[0]].compName,
|
|
|
- veriCode: "123456",}).then(res1 => {
|
|
|
- console.log("loginQuickly",res)
|
|
|
- if(res1.data.code==200){
|
|
|
- uni.setStorageSync('pcUserInfo', res1.data.data)
|
|
|
- uni.setStorageSync('compName1', that.companyList[e[0]].compName)
|
|
|
- that.compName = that.companyList[e[0]].compName
|
|
|
- helper.getListByUserId()
|
|
|
- }
|
|
|
- else{
|
|
|
- // that.$api.doRequest('post','/commonUser/api/loginQuickly',{mobilePhone: '14444444444',
|
|
|
- // veriCode: "123456",}).then(res2 => {
|
|
|
- // uni.setStorageSync('pcUserInfo', res2.data.data)
|
|
|
- // helper.getListByUserId()
|
|
|
- // })
|
|
|
- }
|
|
|
- that.$store.commit('login', res.data.data)
|
|
|
- var name = 'userInfo';
|
|
|
- var value = res.data.data;
|
|
|
- that.$store.commit('$uStore', {
|
|
|
- name,
|
|
|
- value
|
|
|
- });
|
|
|
- // that.liangxinLogin()
|
|
|
-
|
|
|
- // uni.switchTab({
|
|
|
- // url: '/pages/sale/information'
|
|
|
- // });
|
|
|
- uni.hideLoading()
|
|
|
- uni.hideKeyboard()
|
|
|
- uni.showTabBar()
|
|
|
- uni.removeTabBarBadge({
|
|
|
- index: 4
|
|
|
- })
|
|
|
- that.loadData()
|
|
|
- that.username = that.userInfo.userName ? that.userInfo.userName : uni.getStorageSync("userInfo").data
|
|
|
- .userName
|
|
|
- that.userphone = that.userInfo.phone ? that.userInfo.phone : uni.getStorageSync("userInfo").data.phone
|
|
|
- that.$api.doRequest('get', '/newNoticeTask/query/noticeTasks').then(res => {
|
|
|
- console.log("noticeNumber", res)
|
|
|
- if (res.data.data) {
|
|
|
- let name = 'myTip';
|
|
|
- let value = res.data.data.total;
|
|
|
- that.$store.commit('$uStore', {
|
|
|
- name,
|
|
|
- value
|
|
|
- });
|
|
|
- if (value != 0 && value) {
|
|
|
- uni.setTabBarBadge({
|
|
|
- index: 4,
|
|
|
- text: value + ""
|
|
|
- })
|
|
|
- }
|
|
|
- name = 'taskTip';
|
|
|
- value = res.data.data.total;
|
|
|
- that.$store.commit('$uStore', {
|
|
|
- name,
|
|
|
- value
|
|
|
- });
|
|
|
- // name = 'contractTip';
|
|
|
- // value = res.data.data.contractTip;
|
|
|
- // that.$store.commit('$uStore', {
|
|
|
- // name,
|
|
|
- // value
|
|
|
- // });
|
|
|
+ console.log("clinetId", this.clientId)
|
|
|
+ this.$api.doRequest('get', '/commonUser/login', {
|
|
|
+ phone: this.userInfo.phone,
|
|
|
+ password: "999999",
|
|
|
+ cid: this.clientId
|
|
|
+ }).then(res => {
|
|
|
+ if (res.data.code == 200) {
|
|
|
+ console.log("userInfo", res.data.data)
|
|
|
+ uni.setStorageSync('userInfo', res.data.data)
|
|
|
+ this.$api.doRequest('post', '/commonUser/api/loginQuickly', {
|
|
|
+ mobilePhone: this.userInfo.phone,
|
|
|
+ companyName: this.companyList[e[0]].compName,
|
|
|
+ veriCode: "123456",
|
|
|
+ }).then(res1 => {
|
|
|
+ console.log("loginQuickly", res)
|
|
|
+ uni.setStorageSync("cangid",'')
|
|
|
+ if (res1.data.code == 200) {
|
|
|
+ uni.setStorageSync('pcUserInfo', res1.data.data)
|
|
|
+ uni.setStorageSync('compName1', that.companyList[e[0]].compName)
|
|
|
+ that.compName = that.companyList[e[0]].compName
|
|
|
+ helper.getListByUserId()
|
|
|
+ } else {
|
|
|
+ // that.$api.doRequest('post','/commonUser/api/loginQuickly',{mobilePhone: '14444444444',
|
|
|
+ // veriCode: "123456",}).then(res2 => {
|
|
|
+ // uni.setStorageSync('pcUserInfo', res2.data.data)
|
|
|
+ // helper.getListByUserId()
|
|
|
+ // })
|
|
|
}
|
|
|
+ that.$store.commit('login', res.data.data)
|
|
|
+ var name = 'userInfo';
|
|
|
+ var value = res.data.data;
|
|
|
+ that.$store.commit('$uStore', {
|
|
|
+ name,
|
|
|
+ value
|
|
|
+ });
|
|
|
+ // that.liangxinLogin()
|
|
|
+
|
|
|
+ // uni.switchTab({
|
|
|
+ // url: '/pages/sale/information'
|
|
|
+ // });
|
|
|
+ uni.hideLoading()
|
|
|
+ uni.hideKeyboard()
|
|
|
+ uni.showTabBar()
|
|
|
+ uni.removeTabBarBadge({
|
|
|
+ index: 4
|
|
|
+ })
|
|
|
+ that.loadData()
|
|
|
+ that.username = that.userInfo.userName ? that.userInfo.userName : uni
|
|
|
+ .getStorageSync("userInfo").data
|
|
|
+ .userName
|
|
|
+ that.userphone = that.userInfo.phone ? that.userInfo.phone : uni
|
|
|
+ .getStorageSync("userInfo").data.phone
|
|
|
+ that.$api.doRequest('get', '/newNoticeTask/query/noticeTasks').then(res => {
|
|
|
+ console.log("noticeNumber", res)
|
|
|
+ if (res.data.data) {
|
|
|
+ let name = 'myTip';
|
|
|
+ let value = res.data.data.total;
|
|
|
+ that.$store.commit('$uStore', {
|
|
|
+ name,
|
|
|
+ value
|
|
|
+ });
|
|
|
+ if (value != 0 && value) {
|
|
|
+ uni.setTabBarBadge({
|
|
|
+ index: 4,
|
|
|
+ text: value + ""
|
|
|
+ })
|
|
|
+ }
|
|
|
+ name = 'taskTip';
|
|
|
+ value = res.data.data.total;
|
|
|
+ that.$store.commit('$uStore', {
|
|
|
+ name,
|
|
|
+ value
|
|
|
+ });
|
|
|
+ // name = 'contractTip';
|
|
|
+ // value = res.data.data.contractTip;
|
|
|
+ // that.$store.commit('$uStore', {
|
|
|
+ // name,
|
|
|
+ // value
|
|
|
+ // });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ that.$api.msg('切换成功')
|
|
|
})
|
|
|
- that.$api.msg('切换成功')
|
|
|
- })
|
|
|
-
|
|
|
- }else{
|
|
|
- uni.hideLoading()
|
|
|
- uni.showToast({
|
|
|
- title: res.data.message,
|
|
|
- icon:'none',
|
|
|
- duration: 2000
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(res => {
|
|
|
- console.log(res);
|
|
|
- });
|
|
|
+
|
|
|
+ } else {
|
|
|
+ uni.hideLoading()
|
|
|
+ uni.showToast({
|
|
|
+ title: res.data.message,
|
|
|
+ icon: 'none',
|
|
|
+ duration: 2000
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(res => {
|
|
|
+ console.log(res);
|
|
|
+ });
|
|
|
|
|
|
|
|
|
|