Commit 0469ac27 by LJM

js

parent c5db6b3c
......@@ -2,7 +2,7 @@
<view class="index">
<view class="head row bothSide">
<view class="column">
<text class="t1">深圳市猎芯科技有限公司</text>
<text class="t1">{{ company_id == 1 ? '深圳市猎芯科技有限公司' : '深贸电子有限公司' }}</text>
<view class="row verCenter">
<text class="iconfont icon-juxing"></text>
<text class="t2">{{ info.user_info.name }}</text>
......@@ -59,10 +59,12 @@ import { API } from '@/util/api.js';
export default {
data() {
return {
company_id: 1,
info: {}
};
},
onShow() {
this.company_id = uni.getStorageSync('company_id') || 1;
this.getData();
},
methods: {
......
......@@ -35,11 +35,34 @@ export default {
passwd: '123456789'
};
},
onLoad() {
uni.removeStorageSync('oa_skey');
uni.removeStorageSync('oa_user_id');
uni.removeStorageSync('company_id');
},
methods: {
bindPickerChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value);
this.index = e.detail.value;
},
/**
* 组织切换
*/
changeOrgId() {
this.request(API.changeOrgId, 'POST', { org_id: Number(this.index) + 1 }, false).then(res => {
if (res.code === 0) {
} else {
uni.showModal({
title: '提示',
content: res.msg,
showCancel: false
});
}
});
},
/**
* 提交
*/
submit() {
if (!this.name) {
uni.showToast({
......@@ -60,7 +83,8 @@ export default {
if (res.retcode === 0) {
uni.setStorageSync('oa_skey', res.data.skey);
uni.setStorageSync('oa_user_id', res.data.userId);
uni.setStorageSync('company_id', Number(this.index) + 1);
this.changeOrgId();
uni.showToast({
title: '登录成功',
icon: 'success'
......
......@@ -3,15 +3,7 @@ const API_BASE_ORDER = 'http://order.liexindev.net'; //订单系统
const API_BASE_PUR = 'http://pur.liexindev.net'; //采购系统
const API_BASE_SUPPLIER = 'http://supplier.liexin.net'; //供应商系统
const API_BASE_CRM = 'http://crmnew.liexindev.net'; //CRM系统
const API_BASE = 'http://api.liexin.com';
// const API_BASE_USER = 'https://user.ichunt.net'; //用户系统
// const API_BASE_ORDER = 'https://order.ichunt.net'; //订单系统
// const API_BASE_PUR = 'https://purchase.ichunt.net'; //采购系统
// const API_BASE_SUPPLIER = 'https://supplier.ichunt.net'; //供应商系统
// const API_BASE_CRM = 'https://crm.ichunt.net'; //CRM系统
// const API_BASE = 'https://api.ichunt.com';
const API_BASE = 'http://wms.liexindev.net'; //WMS系统
const API = {
/**
......@@ -22,6 +14,10 @@ const API = {
* 小程序审核数量统计
* */
getStatisticsInfo: API_BASE_PUR + '/api/approve/getStatisticsInfo',
/**
* 组织切换
* */
changeOrgId: API_BASE + '/api/index/changeOrgId',
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment