添加onPageLoadInitAuth函数判断登录
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
getAuthInfo,
|
getAuthInfo,
|
||||||
@@ -27,11 +27,11 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
searchChange(e: any) {
|
searchChange(e: any) {
|
||||||
const key = getDataSet(e).key;
|
const key = getDataSet(e).key;
|
||||||
@@ -62,8 +62,9 @@ Page({
|
|||||||
this.data.params.curr_page = curr;
|
this.data.params.curr_page = curr;
|
||||||
this.setData({ params: this.data.params });
|
this.setData({ params: this.data.params });
|
||||||
const temp = cloneLite(this.data.params);
|
const temp = cloneLite(this.data.params);
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
post('ErpAccount/list', temp).then((res: any) => {
|
post('ErpAccount/list', temp)
|
||||||
|
.then((res: any) => {
|
||||||
const list = toArray(res.data?.list);
|
const list = toArray(res.data?.list);
|
||||||
if (list.length == 0 && this.data.params.curr_page > 1) {
|
if (list.length == 0 && this.data.params.curr_page > 1) {
|
||||||
this.getList(this.data.params.curr_page - 1);
|
this.getList(this.data.params.curr_page - 1);
|
||||||
@@ -71,6 +72,13 @@ Page({
|
|||||||
this.setData({
|
this.setData({
|
||||||
count: toNumber(res.data?.count),
|
count: toNumber(res.data?.count),
|
||||||
list: list,
|
list: list,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -142,7 +150,7 @@ Page({
|
|||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
getAuthInfo,
|
getAuthInfo,
|
||||||
@@ -27,11 +27,11 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
searchChange(e: any) {
|
searchChange(e: any) {
|
||||||
const key = getDataSet(e).key;
|
const key = getDataSet(e).key;
|
||||||
@@ -62,8 +62,9 @@ Page({
|
|||||||
this.data.params.curr_page = curr;
|
this.data.params.curr_page = curr;
|
||||||
this.setData({ params: this.data.params });
|
this.setData({ params: this.data.params });
|
||||||
const temp = cloneLite(this.data.params);
|
const temp = cloneLite(this.data.params);
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
post('ErpCrm/list', temp).then((res: any) => {
|
post('ErpCrm/list', temp)
|
||||||
|
.then((res: any) => {
|
||||||
const list = toArray(res.data?.list);
|
const list = toArray(res.data?.list);
|
||||||
if (list.length == 0 && this.data.params.curr_page > 1) {
|
if (list.length == 0 && this.data.params.curr_page > 1) {
|
||||||
this.getList(this.data.params.curr_page - 1);
|
this.getList(this.data.params.curr_page - 1);
|
||||||
@@ -71,6 +72,13 @@ Page({
|
|||||||
this.setData({
|
this.setData({
|
||||||
count: toNumber(res.data?.count),
|
count: toNumber(res.data?.count),
|
||||||
list: list,
|
list: list,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -114,7 +122,7 @@ Page({
|
|||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
getAuthInfo,
|
getAuthInfo,
|
||||||
@@ -27,11 +27,11 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
searchChange(e: any) {
|
searchChange(e: any) {
|
||||||
const key = getDataSet(e).key;
|
const key = getDataSet(e).key;
|
||||||
@@ -62,8 +62,9 @@ Page({
|
|||||||
this.data.params.curr_page = curr;
|
this.data.params.curr_page = curr;
|
||||||
this.setData({ params: this.data.params });
|
this.setData({ params: this.data.params });
|
||||||
const temp = cloneLite(this.data.params);
|
const temp = cloneLite(this.data.params);
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
post('ErpDepot/list', temp).then((res: any) => {
|
post('ErpDepot/list', temp)
|
||||||
|
.then((res: any) => {
|
||||||
const list = toArray(res.data?.list);
|
const list = toArray(res.data?.list);
|
||||||
if (list.length == 0 && this.data.params.curr_page > 1) {
|
if (list.length == 0 && this.data.params.curr_page > 1) {
|
||||||
this.getList(this.data.params.curr_page - 1);
|
this.getList(this.data.params.curr_page - 1);
|
||||||
@@ -71,6 +72,13 @@ Page({
|
|||||||
this.setData({
|
this.setData({
|
||||||
count: toNumber(res.data?.count),
|
count: toNumber(res.data?.count),
|
||||||
list: list,
|
list: list,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -129,7 +137,7 @@ Page({
|
|||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { FinanceItemTypeArr, FinanceItemTypeObj } from '@/utils/config';
|
import { FinanceItemTypeArr, FinanceItemTypeObj } from '@/utils/config';
|
||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
getAuthInfo,
|
getAuthInfo,
|
||||||
@@ -30,11 +30,11 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
searchChange(e: any) {
|
searchChange(e: any) {
|
||||||
const key = getDataSet(e).key;
|
const key = getDataSet(e).key;
|
||||||
@@ -65,13 +65,20 @@ Page({
|
|||||||
this.data.params.curr_page = curr;
|
this.data.params.curr_page = curr;
|
||||||
this.setData({ params: this.data.params });
|
this.setData({ params: this.data.params });
|
||||||
const temp = cloneLite(this.data.params);
|
const temp = cloneLite(this.data.params);
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
post('ErpFinanceItem/list', temp).then((res: any) => {
|
post('ErpFinanceItem/list', temp)
|
||||||
|
.then((res: any) => {
|
||||||
const list = toArray(res.data?.list);
|
const list = toArray(res.data?.list);
|
||||||
// if (list.length == 0 && this.data.params.curr_page > 1) {
|
// if (list.length == 0 && this.data.params.curr_page > 1) {
|
||||||
// this.getList(this.data.params.curr_page - 1);
|
// this.getList(this.data.params.curr_page - 1);
|
||||||
// }
|
// }
|
||||||
this.setData({ count: toNumber(res.data?.count), list: list });
|
this.setData({ count: toNumber(res.data?.count), list: list, isLogin: true });
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -130,7 +137,7 @@ Page({
|
|||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
getAuthInfo,
|
getAuthInfo,
|
||||||
@@ -27,11 +27,11 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
searchChange(e: any) {
|
searchChange(e: any) {
|
||||||
const key = getDataSet(e).key;
|
const key = getDataSet(e).key;
|
||||||
@@ -62,13 +62,20 @@ Page({
|
|||||||
this.data.params.curr_page = curr;
|
this.data.params.curr_page = curr;
|
||||||
this.setData({ params: this.data.params });
|
this.setData({ params: this.data.params });
|
||||||
const temp = cloneLite(this.data.params);
|
const temp = cloneLite(this.data.params);
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
post('OrderCategory/list', temp).then((res: any) => {
|
post('OrderCategory/list', temp)
|
||||||
|
.then((res: any) => {
|
||||||
const list = toArray(res.data);
|
const list = toArray(res.data);
|
||||||
// if (list.length == 0 && this.data.params.curr_page > 1) {
|
// if (list.length == 0 && this.data.params.curr_page > 1) {
|
||||||
// this.getList(this.data.params.curr_page - 1);
|
// this.getList(this.data.params.curr_page - 1);
|
||||||
// }
|
// }
|
||||||
this.setData({ count: toNumber(res.count), list: list });
|
this.setData({ count: toNumber(res.count), list: list, isLogin: true });
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -127,7 +134,7 @@ Page({
|
|||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
getAuthInfo,
|
getAuthInfo,
|
||||||
@@ -27,11 +27,11 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
searchChange(e: any) {
|
searchChange(e: any) {
|
||||||
const key = getDataSet(e).key;
|
const key = getDataSet(e).key;
|
||||||
@@ -62,8 +62,9 @@ Page({
|
|||||||
this.data.params.curr_page = curr;
|
this.data.params.curr_page = curr;
|
||||||
this.setData({ params: this.data.params });
|
this.setData({ params: this.data.params });
|
||||||
const temp = cloneLite(this.data.params);
|
const temp = cloneLite(this.data.params);
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
post('OrderStep/list', temp).then((res: any) => {
|
post('OrderStep/list', temp)
|
||||||
|
.then((res: any) => {
|
||||||
const list = toArray(res.data);
|
const list = toArray(res.data);
|
||||||
// if (list.length == 0 && this.data.params.curr_page > 1) {
|
// if (list.length == 0 && this.data.params.curr_page > 1) {
|
||||||
// this.getList(this.data.params.curr_page - 1);
|
// this.getList(this.data.params.curr_page - 1);
|
||||||
@@ -71,6 +72,13 @@ Page({
|
|||||||
this.setData({
|
this.setData({
|
||||||
count: toNumber(res.count),
|
count: toNumber(res.count),
|
||||||
list: list,
|
list: list,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -128,7 +136,7 @@ Page({
|
|||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import { getAuthInfo, toArray } from '@/utils/util';
|
import { getAuthInfo, toArray } from '@/utils/util';
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
@@ -14,18 +14,24 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
getList() {
|
getList() {
|
||||||
post('CompanyProcessV2/getChildProcess', { process_id: this.data.process_id }).then(
|
return new Promise<void>((resolve, reject) => {
|
||||||
(res: any) => {
|
post('CompanyProcessV2/getChildProcess', { process_id: this.data.process_id })
|
||||||
this.setData({ list: toArray(res.data) });
|
.then((res: any) => {
|
||||||
},
|
this.setData({ list: toArray(res.data), isLogin: true });
|
||||||
);
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -37,7 +43,7 @@ Page({
|
|||||||
wx.setNavigationBarTitle({ title: decodeURIComponent(title) });
|
wx.setNavigationBarTitle({ title: decodeURIComponent(title) });
|
||||||
}
|
}
|
||||||
this.data.process_id = process_id;
|
this.data.process_id = process_id;
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<t-cell-group custom-style="margin: 0">
|
<t-cell-group custom-style="margin: 0">
|
||||||
<block wx:for="{{list}}" wx:key="index">
|
<block wx:for="{{list}}" wx:key="index">
|
||||||
<t-cell title="{{item.process_name}}" note="{{item.process_code}}" data-index="{{index}}"
|
<t-cell title="{{item.process_name}}" note="{{item.process_code}}" data-index="{{index}}"
|
||||||
bind:tap="onChildProcess" description="提成值: {{item.bonus_value || '未配置'}}">
|
description="提成值: {{item.bonus_value || '未配置'}}">
|
||||||
<view slot="left-icon" style="color: #999;line-height: 1.5;">
|
<view slot="left-icon" style="color: #999;line-height: 1.5;">
|
||||||
{{index + 1}}
|
{{index + 1}}
|
||||||
</view>
|
</view>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import { getAuthInfo, getDataSet, toArray } from '@/utils/util';
|
import { getAuthInfo, getDataSet, toArray } from '@/utils/util';
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
@@ -13,15 +13,23 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
getList() {
|
getList() {
|
||||||
post('CompanyProcessV2/getParentProcess').then((res: any) => {
|
return new Promise<void>((resolve, reject) => {
|
||||||
this.setData({ list: toArray(res.data) });
|
post('CompanyProcessV2/getParentProcess')
|
||||||
|
.then((res: any) => {
|
||||||
|
this.setData({ list: toArray(res.data), isLogin: true });
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onChildProcess(e: any) {
|
onChildProcess(e: any) {
|
||||||
@@ -38,7 +46,7 @@ Page({
|
|||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad(_options) {
|
onLoad(_options) {
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
getAuthInfo,
|
getAuthInfo,
|
||||||
@@ -27,11 +27,11 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
searchChange(e: any) {
|
searchChange(e: any) {
|
||||||
const key = getDataSet(e).key;
|
const key = getDataSet(e).key;
|
||||||
@@ -62,8 +62,9 @@ Page({
|
|||||||
this.data.params.curr_page = curr;
|
this.data.params.curr_page = curr;
|
||||||
this.setData({ params: this.data.params });
|
this.setData({ params: this.data.params });
|
||||||
const temp = cloneLite(this.data.params);
|
const temp = cloneLite(this.data.params);
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
post('ProductType/list', temp).then((res: any) => {
|
post('ProductType/list', temp)
|
||||||
|
.then((res: any) => {
|
||||||
const list = toArray(res.data);
|
const list = toArray(res.data);
|
||||||
// if (list.length == 0 && this.data.params.curr_page > 1) {
|
// if (list.length == 0 && this.data.params.curr_page > 1) {
|
||||||
// this.getList(this.data.params.curr_page - 1);
|
// this.getList(this.data.params.curr_page - 1);
|
||||||
@@ -71,6 +72,13 @@ Page({
|
|||||||
this.setData({
|
this.setData({
|
||||||
count: toNumber(res.count),
|
count: toNumber(res.count),
|
||||||
list: list,
|
list: list,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -130,7 +138,7 @@ Page({
|
|||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
getAuthInfo,
|
getAuthInfo,
|
||||||
@@ -27,11 +27,11 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
searchChange(e: any) {
|
searchChange(e: any) {
|
||||||
const key = getDataSet(e).key;
|
const key = getDataSet(e).key;
|
||||||
@@ -62,8 +62,9 @@ Page({
|
|||||||
this.data.params.curr_page = curr;
|
this.data.params.curr_page = curr;
|
||||||
this.setData({ params: this.data.params });
|
this.setData({ params: this.data.params });
|
||||||
const temp = cloneLite(this.data.params);
|
const temp = cloneLite(this.data.params);
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
post('ErpCrm/list', temp).then((res: any) => {
|
post('ErpCrm/list', temp)
|
||||||
|
.then((res: any) => {
|
||||||
const list = toArray(res.data?.list);
|
const list = toArray(res.data?.list);
|
||||||
if (list.length == 0 && this.data.params.curr_page > 1) {
|
if (list.length == 0 && this.data.params.curr_page > 1) {
|
||||||
this.getList(this.data.params.curr_page - 1);
|
this.getList(this.data.params.curr_page - 1);
|
||||||
@@ -71,6 +72,13 @@ Page({
|
|||||||
this.setData({
|
this.setData({
|
||||||
count: toNumber(res.data?.count),
|
count: toNumber(res.data?.count),
|
||||||
list: list,
|
list: list,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -114,7 +122,7 @@ Page({
|
|||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import { toArray, toNumber } from '@/utils/util';
|
import { toArray, toNumber } from '@/utils/util';
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
@@ -14,13 +14,13 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {},
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
|
|
||||||
getList() {
|
getList() {
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
post('Index/index')
|
post('Index/index')
|
||||||
.then((res: any) => {
|
.then((res: any) => {
|
||||||
const process_count = toArray(res.process_count).filter((el) => {
|
const process_count = toArray(res.process_count).filter((el) => {
|
||||||
@@ -43,11 +43,18 @@ Page({
|
|||||||
this.setData({
|
this.setData({
|
||||||
seven_process_count: [...map.values()],
|
seven_process_count: [...map.values()],
|
||||||
process_count: process_count,
|
process_count: process_count,
|
||||||
|
isLogin: true,
|
||||||
});
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
wx.stopPullDownRefresh();
|
wx.stopPullDownRefresh();
|
||||||
});
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -64,7 +71,7 @@ Page({
|
|||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { base, defaultAvatarUrl } from '@/utils/config';
|
import { base, defaultAvatarUrl } from '@/utils/config';
|
||||||
import { login } from '@/utils/https';
|
import { login } from '@/utils/https';
|
||||||
import { Subscribe } from '@/utils/subscribe';
|
import { Subscribe } from '@/utils/subscribe';
|
||||||
import { isArray, setStorage } from '@/utils/util';
|
import { getCurrentPageRoute, isArray } from '@/utils/util';
|
||||||
// import { IStorage } from "@/utils/storage";
|
// import { IStorage } from "@/utils/storage";
|
||||||
|
|
||||||
// const app = getApp();
|
// const app = getApp();
|
||||||
@@ -10,26 +10,26 @@ import { isArray, setStorage } from '@/utils/util';
|
|||||||
Component({
|
Component({
|
||||||
options: { addGlobalClass: true },
|
options: { addGlobalClass: true },
|
||||||
properties: {
|
properties: {
|
||||||
isLogin: Boolean,
|
// isLogin: Boolean,
|
||||||
loading: Boolean,
|
// loading: Boolean,
|
||||||
isAuth: null,
|
isAuth: null,
|
||||||
customStyle: null,
|
customStyle: null,
|
||||||
hasTabBar: null,
|
hasTabBar: null,
|
||||||
},
|
},
|
||||||
|
|
||||||
// attached() {
|
attached() {
|
||||||
// this.setData({ isLogin: getStorage("isLogin") == 1 });
|
// this.setData({ isLogin: getStorage('isLogin') == 1 });
|
||||||
|
// console.log('attached');
|
||||||
// console.log("attached");
|
Subscribe.on('isLogin', getCurrentPageRoute(), (data: any) => {
|
||||||
// Subscribe.on("isLogin", getCurrentPageRoute(), () => {
|
// console.log(data);
|
||||||
// this.setData({ isLogin: getStorage("isLogin") == 1 });
|
this.setData({ isLogin: data, loading: false });
|
||||||
// console.log("监听到 isLogin 变化:");
|
// console.log('监听到 isLogin 变化:');
|
||||||
// });
|
});
|
||||||
// },
|
},
|
||||||
// detached() {
|
detached() {
|
||||||
// console.log("detached");
|
// console.log('detached');
|
||||||
// Subscribe.off("isLogin", getCurrentPageRoute());
|
Subscribe.off('isLogin', getCurrentPageRoute());
|
||||||
// },
|
},
|
||||||
|
|
||||||
data: {
|
data: {
|
||||||
avatarUrl: defaultAvatarUrl,
|
avatarUrl: defaultAvatarUrl,
|
||||||
@@ -39,14 +39,14 @@ Component({
|
|||||||
companyList: [],
|
companyList: [],
|
||||||
encryptedData: '',
|
encryptedData: '',
|
||||||
iv: '',
|
iv: '',
|
||||||
|
isLogin: false,
|
||||||
|
loading: true,
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleLogin(e: any) {
|
handleLogin(e: any) {
|
||||||
this.triggerEvent('handleLogin', e.detail);
|
this.triggerEvent('handleLogin', e.detail);
|
||||||
},
|
},
|
||||||
getPhoneNumberToast() {
|
getPhoneNumberToast() {
|
||||||
setStorage('isLogin', 1);
|
|
||||||
Subscribe.set('isLogin', 'zzzuz');
|
|
||||||
wx.showToast({ title: '请先勾选协议', icon: 'none' });
|
wx.showToast({ title: '请先勾选协议', icon: 'none' });
|
||||||
},
|
},
|
||||||
changeAgreementCheck(event: any) {
|
changeAgreementCheck(event: any) {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
getAuthInfo,
|
getAuthInfo,
|
||||||
@@ -35,11 +35,12 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
this.getData();
|
this.getData();
|
||||||
},
|
},
|
||||||
searchChange(e: any) {
|
searchChange(e: any) {
|
||||||
@@ -87,8 +88,9 @@ Page({
|
|||||||
this.data.params.curr_page = curr;
|
this.data.params.curr_page = curr;
|
||||||
this.setData({ params: this.data.params });
|
this.setData({ params: this.data.params });
|
||||||
const temp = cloneLite(this.data.params);
|
const temp = cloneLite(this.data.params);
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
post('ErpAccount/flow', temp).then((res: any) => {
|
post('ErpAccount/flow', temp)
|
||||||
|
.then((res: any) => {
|
||||||
const list = toArray(res.data);
|
const list = toArray(res.data);
|
||||||
if (list.length == 0 && this.data.params.curr_page > 1) {
|
if (list.length == 0 && this.data.params.curr_page > 1) {
|
||||||
this.getList(this.data.params.curr_page - 1);
|
this.getList(this.data.params.curr_page - 1);
|
||||||
@@ -96,6 +98,13 @@ Page({
|
|||||||
this.setData({
|
this.setData({
|
||||||
count: toNumber(res.count),
|
count: toNumber(res.count),
|
||||||
list: list,
|
list: list,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -137,7 +146,7 @@ Page({
|
|||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
getAuthInfo,
|
getAuthInfo,
|
||||||
@@ -32,11 +32,11 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
searchChange(e: any) {
|
searchChange(e: any) {
|
||||||
const key = getDataSet(e).key;
|
const key = getDataSet(e).key;
|
||||||
@@ -78,8 +78,9 @@ Page({
|
|||||||
} else {
|
} else {
|
||||||
delete temp.process_state;
|
delete temp.process_state;
|
||||||
}
|
}
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
post('ErpFinance/list', temp).then((res: any) => {
|
post('ErpFinance/list', temp)
|
||||||
|
.then((res: any) => {
|
||||||
const list = toArray(res.data?.list);
|
const list = toArray(res.data?.list);
|
||||||
if (list.length == 0 && this.data.params.curr_page > 1) {
|
if (list.length == 0 && this.data.params.curr_page > 1) {
|
||||||
this.getList(this.data.params.curr_page - 1);
|
this.getList(this.data.params.curr_page - 1);
|
||||||
@@ -87,6 +88,13 @@ Page({
|
|||||||
this.setData({
|
this.setData({
|
||||||
count: toNumber(res.data?.count),
|
count: toNumber(res.data?.count),
|
||||||
list: list,
|
list: list,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -135,7 +143,7 @@ Page({
|
|||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { OSSBaseUrl } from '@/utils/config';
|
import { OSSBaseUrl } from '@/utils/config';
|
||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
formatFileSize,
|
formatFileSize,
|
||||||
@@ -29,25 +29,12 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
|
|
||||||
getList() {
|
|
||||||
this.setData({ params: this.data.params });
|
|
||||||
const temp = cloneLite(this.data.params);
|
const temp = cloneLite(this.data.params);
|
||||||
post('ErpFinance/info', temp).then((res: any) => {
|
|
||||||
const data = toObject(res.data);
|
|
||||||
const info = toObject(data.info);
|
|
||||||
wx.setNavigationBarTitle({ title: `${info.bill_no} 详情` });
|
|
||||||
this.setData({
|
|
||||||
detail: toArray(info.rows),
|
|
||||||
info: info,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
post('ErpFinance/fileList', temp).then((res: any) => {
|
post('ErpFinance/fileList', temp).then((res: any) => {
|
||||||
this.setData({
|
this.setData({
|
||||||
files: toArray(res.data).map((el) => {
|
files: toArray(res.data).map((el) => {
|
||||||
@@ -59,6 +46,29 @@ Page({
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getList() {
|
||||||
|
this.setData({ params: this.data.params });
|
||||||
|
const temp = cloneLite(this.data.params);
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
|
post('ErpFinance/info', temp)
|
||||||
|
.then((res: any) => {
|
||||||
|
const data = toObject(res.data);
|
||||||
|
const info = toObject(data.info);
|
||||||
|
wx.setNavigationBarTitle({ title: `${info.bill_no} 详情` });
|
||||||
|
this.setData({
|
||||||
|
detail: toArray(info.rows),
|
||||||
|
info: info,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
onPreview(e: any) {
|
onPreview(e: any) {
|
||||||
const data = getDataSet(e);
|
const data = getDataSet(e);
|
||||||
const index = data.index;
|
const index = data.index;
|
||||||
@@ -78,7 +88,7 @@ Page({
|
|||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
const { head_id } = options;
|
const { head_id } = options;
|
||||||
this.data.params.head_id = head_id;
|
this.data.params.head_id = head_id;
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
getAuthInfo,
|
getAuthInfo,
|
||||||
@@ -32,11 +32,11 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
searchChange(e: any) {
|
searchChange(e: any) {
|
||||||
const key = getDataSet(e).key;
|
const key = getDataSet(e).key;
|
||||||
@@ -78,8 +78,9 @@ Page({
|
|||||||
} else {
|
} else {
|
||||||
delete temp.process_state;
|
delete temp.process_state;
|
||||||
}
|
}
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
post('ErpFinance/list', temp).then((res: any) => {
|
post('ErpFinance/list', temp)
|
||||||
|
.then((res: any) => {
|
||||||
const list = toArray(res.data?.list);
|
const list = toArray(res.data?.list);
|
||||||
if (list.length == 0 && this.data.params.curr_page > 1) {
|
if (list.length == 0 && this.data.params.curr_page > 1) {
|
||||||
this.getList(this.data.params.curr_page - 1);
|
this.getList(this.data.params.curr_page - 1);
|
||||||
@@ -87,6 +88,13 @@ Page({
|
|||||||
this.setData({
|
this.setData({
|
||||||
count: toNumber(res.data?.count),
|
count: toNumber(res.data?.count),
|
||||||
list: list,
|
list: list,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -135,7 +143,7 @@ Page({
|
|||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { OSSBaseUrl } from '@/utils/config';
|
import { OSSBaseUrl } from '@/utils/config';
|
||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
formatFileSize,
|
formatFileSize,
|
||||||
@@ -29,25 +29,12 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
|
|
||||||
getList() {
|
|
||||||
this.setData({ params: this.data.params });
|
|
||||||
const temp = cloneLite(this.data.params);
|
const temp = cloneLite(this.data.params);
|
||||||
post('ErpFinance/info', temp).then((res: any) => {
|
|
||||||
const data = toObject(res.data);
|
|
||||||
const info = toObject(data.info);
|
|
||||||
wx.setNavigationBarTitle({ title: `${info.bill_no} 详情` });
|
|
||||||
this.setData({
|
|
||||||
detail: toArray(info.rows),
|
|
||||||
info: info,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
post('ErpFinance/fileList', temp).then((res: any) => {
|
post('ErpFinance/fileList', temp).then((res: any) => {
|
||||||
this.setData({
|
this.setData({
|
||||||
files: toArray(res.data).map((el) => {
|
files: toArray(res.data).map((el) => {
|
||||||
@@ -59,6 +46,29 @@ Page({
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getList() {
|
||||||
|
this.setData({ params: this.data.params });
|
||||||
|
const temp = cloneLite(this.data.params);
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
|
post('ErpFinance/info', temp)
|
||||||
|
.then((res: any) => {
|
||||||
|
const data = toObject(res.data);
|
||||||
|
const info = toObject(data.info);
|
||||||
|
wx.setNavigationBarTitle({ title: `${info.bill_no} 详情` });
|
||||||
|
this.setData({
|
||||||
|
detail: toArray(info.rows),
|
||||||
|
info: info,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
onPreview(e: any) {
|
onPreview(e: any) {
|
||||||
const data = getDataSet(e);
|
const data = getDataSet(e);
|
||||||
const index = data.index;
|
const index = data.index;
|
||||||
@@ -78,7 +88,7 @@ Page({
|
|||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
const { head_id } = options;
|
const { head_id } = options;
|
||||||
this.data.params.head_id = head_id;
|
this.data.params.head_id = head_id;
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
getAuthInfo,
|
getAuthInfo,
|
||||||
@@ -32,11 +32,11 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
searchChange(e: any) {
|
searchChange(e: any) {
|
||||||
const key = getDataSet(e).key;
|
const key = getDataSet(e).key;
|
||||||
@@ -78,8 +78,9 @@ Page({
|
|||||||
} else {
|
} else {
|
||||||
delete temp.process_state;
|
delete temp.process_state;
|
||||||
}
|
}
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
post('ErpFinance/list', temp).then((res: any) => {
|
post('ErpFinance/list', temp)
|
||||||
|
.then((res: any) => {
|
||||||
const list = toArray(res.data?.list);
|
const list = toArray(res.data?.list);
|
||||||
if (list.length == 0 && this.data.params.curr_page > 1) {
|
if (list.length == 0 && this.data.params.curr_page > 1) {
|
||||||
this.getList(this.data.params.curr_page - 1);
|
this.getList(this.data.params.curr_page - 1);
|
||||||
@@ -87,6 +88,13 @@ Page({
|
|||||||
this.setData({
|
this.setData({
|
||||||
count: toNumber(res.data?.count),
|
count: toNumber(res.data?.count),
|
||||||
list: list,
|
list: list,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -135,7 +143,7 @@ Page({
|
|||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { OSSBaseUrl } from '@/utils/config';
|
import { OSSBaseUrl } from '@/utils/config';
|
||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
formatFileSize,
|
formatFileSize,
|
||||||
@@ -29,25 +29,12 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
},
|
|
||||||
|
|
||||||
getList() {
|
|
||||||
this.setData({ params: this.data.params });
|
|
||||||
const temp = cloneLite(this.data.params);
|
const temp = cloneLite(this.data.params);
|
||||||
post('ErpFinance/info', temp).then((res: any) => {
|
|
||||||
const data = toObject(res.data);
|
|
||||||
const info = toObject(data.info);
|
|
||||||
wx.setNavigationBarTitle({ title: `${info.bill_no} 详情` });
|
|
||||||
this.setData({
|
|
||||||
detail: toArray(info.rows),
|
|
||||||
info: info,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
post('ErpFinance/fileList', temp).then((res: any) => {
|
post('ErpFinance/fileList', temp).then((res: any) => {
|
||||||
this.setData({
|
this.setData({
|
||||||
files: toArray(res.data).map((el) => {
|
files: toArray(res.data).map((el) => {
|
||||||
@@ -59,6 +46,29 @@ Page({
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getList() {
|
||||||
|
this.setData({ params: this.data.params });
|
||||||
|
const temp = cloneLite(this.data.params);
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
|
post('ErpFinance/info', temp)
|
||||||
|
.then((res: any) => {
|
||||||
|
const data = toObject(res.data);
|
||||||
|
const info = toObject(data.info);
|
||||||
|
wx.setNavigationBarTitle({ title: `${info.bill_no} 详情` });
|
||||||
|
this.setData({
|
||||||
|
detail: toArray(info.rows),
|
||||||
|
info: info,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
onPreview(e: any) {
|
onPreview(e: any) {
|
||||||
const data = getDataSet(e);
|
const data = getDataSet(e);
|
||||||
const index = data.index;
|
const index = data.index;
|
||||||
@@ -78,7 +88,7 @@ Page({
|
|||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
const { head_id } = options;
|
const { head_id } = options;
|
||||||
this.data.params.head_id = head_id;
|
this.data.params.head_id = head_id;
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
getAuthInfo,
|
getAuthInfo,
|
||||||
@@ -19,16 +19,17 @@ Page({
|
|||||||
list: [] as any[],
|
list: [] as any[],
|
||||||
count: 0,
|
count: 0,
|
||||||
sort: [{ label: '创建日期', value: 'create_date' }],
|
sort: [{ label: '创建日期', value: 'create_date' }],
|
||||||
|
isLogin: false,
|
||||||
},
|
},
|
||||||
handleLogin(e: any) {
|
handleLogin(e: any) {
|
||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
searchChange(e: any) {
|
searchChange(e: any) {
|
||||||
const key = getDataSet(e).key;
|
const key = getDataSet(e).key;
|
||||||
@@ -59,8 +60,9 @@ Page({
|
|||||||
this.data.params.curr_page = curr;
|
this.data.params.curr_page = curr;
|
||||||
this.setData({ params: this.data.params });
|
this.setData({ params: this.data.params });
|
||||||
const temp = cloneLite(this.data.params);
|
const temp = cloneLite(this.data.params);
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
post('Log/loginList', temp).then((res: any) => {
|
post('Log/loginList', temp)
|
||||||
|
.then((res: any) => {
|
||||||
const list = toArray(res.data?.list);
|
const list = toArray(res.data?.list);
|
||||||
if (list.length == 0 && this.data.params.curr_page > 1) {
|
if (list.length == 0 && this.data.params.curr_page > 1) {
|
||||||
this.getList(this.data.params.curr_page - 1);
|
this.getList(this.data.params.curr_page - 1);
|
||||||
@@ -78,6 +80,13 @@ Page({
|
|||||||
}
|
}
|
||||||
return el;
|
return el;
|
||||||
}),
|
}),
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -96,7 +105,7 @@ Page({
|
|||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
getAuthInfo,
|
getAuthInfo,
|
||||||
@@ -19,16 +19,17 @@ Page({
|
|||||||
list: [] as any[],
|
list: [] as any[],
|
||||||
count: 0,
|
count: 0,
|
||||||
sort: [{ label: '创建日期', value: 'create_date' }],
|
sort: [{ label: '创建日期', value: 'create_date' }],
|
||||||
|
isLogin: false,
|
||||||
},
|
},
|
||||||
handleLogin(e: any) {
|
handleLogin(e: any) {
|
||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
searchChange(e: any) {
|
searchChange(e: any) {
|
||||||
const key = getDataSet(e).key;
|
const key = getDataSet(e).key;
|
||||||
@@ -59,8 +60,9 @@ Page({
|
|||||||
this.data.params.curr_page = curr;
|
this.data.params.curr_page = curr;
|
||||||
this.setData({ params: this.data.params });
|
this.setData({ params: this.data.params });
|
||||||
const temp = cloneLite(this.data.params);
|
const temp = cloneLite(this.data.params);
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
post('Log/operateList', temp).then((res: any) => {
|
post('Log/operateList', temp)
|
||||||
|
.then((res: any) => {
|
||||||
const list = toArray(res.data?.list);
|
const list = toArray(res.data?.list);
|
||||||
if (list.length == 0 && this.data.params.curr_page > 1) {
|
if (list.length == 0 && this.data.params.curr_page > 1) {
|
||||||
this.getList(this.data.params.curr_page - 1);
|
this.getList(this.data.params.curr_page - 1);
|
||||||
@@ -68,6 +70,13 @@ Page({
|
|||||||
this.setData({
|
this.setData({
|
||||||
count: toNumber(res.data?.count),
|
count: toNumber(res.data?.count),
|
||||||
list: list,
|
list: list,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -86,7 +95,7 @@ Page({
|
|||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
getAuthInfo,
|
getAuthInfo,
|
||||||
@@ -30,11 +30,11 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
searchChange(e: any) {
|
searchChange(e: any) {
|
||||||
const key = getDataSet(e).key;
|
const key = getDataSet(e).key;
|
||||||
@@ -76,13 +76,20 @@ Page({
|
|||||||
} else {
|
} else {
|
||||||
delete temp.process_state;
|
delete temp.process_state;
|
||||||
}
|
}
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
post('Departments/list', temp).then((res: any) => {
|
post('Departments/list', temp)
|
||||||
|
.then((res: any) => {
|
||||||
const list = toArray(res.data);
|
const list = toArray(res.data);
|
||||||
if (list.length == 0 && this.data.params.curr_page > 1) {
|
if (list.length == 0 && this.data.params.curr_page > 1) {
|
||||||
this.getList(this.data.params.curr_page - 1);
|
this.getList(this.data.params.curr_page - 1);
|
||||||
}
|
}
|
||||||
this.setData({ list: list });
|
this.setData({ list: list, isLogin: true });
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -113,7 +120,7 @@ Page({
|
|||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
getAuthInfo,
|
getAuthInfo,
|
||||||
@@ -25,16 +25,17 @@ Page({
|
|||||||
{ value: '2', label: '已审核' },
|
{ value: '2', label: '已审核' },
|
||||||
],
|
],
|
||||||
sort: [{ label: '创建日期', value: 'create_date' }],
|
sort: [{ label: '创建日期', value: 'create_date' }],
|
||||||
|
isLogin: false,
|
||||||
},
|
},
|
||||||
handleLogin(e: any) {
|
handleLogin(e: any) {
|
||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
searchChange(e: any) {
|
searchChange(e: any) {
|
||||||
const key = getDataSet(e).key;
|
const key = getDataSet(e).key;
|
||||||
@@ -76,13 +77,20 @@ Page({
|
|||||||
} else {
|
} else {
|
||||||
delete temp.process_state;
|
delete temp.process_state;
|
||||||
}
|
}
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
post('Groups/list', temp).then((res: any) => {
|
post('Groups/list', temp)
|
||||||
|
.then((res: any) => {
|
||||||
const list = toArray(res.data);
|
const list = toArray(res.data);
|
||||||
if (list.length == 0 && this.data.params.curr_page > 1) {
|
if (list.length == 0 && this.data.params.curr_page > 1) {
|
||||||
this.getList(this.data.params.curr_page - 1);
|
this.getList(this.data.params.curr_page - 1);
|
||||||
}
|
}
|
||||||
this.setData({ list: list });
|
this.setData({ list: list, isLogin: true });
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onGroupTap(e: any) {
|
onGroupTap(e: any) {
|
||||||
@@ -122,7 +130,7 @@ Page({
|
|||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import { getAuthInfo, toArray } from '@/utils/util';
|
import { getAuthInfo, toArray } from '@/utils/util';
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
@@ -8,20 +8,23 @@ Page({
|
|||||||
data: {
|
data: {
|
||||||
list: [] as any[],
|
list: [] as any[],
|
||||||
group_id: '',
|
group_id: '',
|
||||||
|
isLogin: false,
|
||||||
},
|
},
|
||||||
handleLogin(e: any) {
|
handleLogin(e: any) {
|
||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getList() {
|
getList() {
|
||||||
post('Groups/getGrpRights', { group_id: this.data.group_id }).then((res: any) => {
|
return new Promise<void>((resolve, reject) => {
|
||||||
|
post('Groups/getGrpRights', { group_id: this.data.group_id })
|
||||||
|
.then((res: any) => {
|
||||||
const list = toArray(res.right_tree);
|
const list = toArray(res.right_tree);
|
||||||
const rights = `${res.rights || ''}`.split(',');
|
const rights = `${res.rights || ''}`.split(',');
|
||||||
this.data.list.length = 0;
|
this.data.list.length = 0;
|
||||||
@@ -54,7 +57,13 @@ Page({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
// console.log(this.data.list);
|
// console.log(this.data.list);
|
||||||
this.setData({ list: this.data.list });
|
this.setData({ list: this.data.list, isLogin: true });
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -65,7 +74,7 @@ Page({
|
|||||||
this.data.group_id = `${options.group_id}`;
|
this.data.group_id = `${options.group_id}`;
|
||||||
wx.setNavigationBarTitle({ title: `${decodeURIComponent(`${options.name}`)} 权限` });
|
wx.setNavigationBarTitle({ title: `${decodeURIComponent(`${options.name}`)} 权限` });
|
||||||
|
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import { getAuthInfo, toArray } from '@/utils/util';
|
import { getAuthInfo, toArray } from '@/utils/util';
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
@@ -7,20 +7,23 @@ Page({
|
|||||||
*/
|
*/
|
||||||
data: {
|
data: {
|
||||||
list: [] as any[],
|
list: [] as any[],
|
||||||
|
isLogin: false,
|
||||||
},
|
},
|
||||||
handleLogin(e: any) {
|
handleLogin(e: any) {
|
||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getList() {
|
getList() {
|
||||||
post('Groups/myAuth').then((res: any) => {
|
return new Promise<void>((resolve, reject) => {
|
||||||
|
post('Groups/myAuth')
|
||||||
|
.then((res: any) => {
|
||||||
const list = toArray(res.right_tree);
|
const list = toArray(res.right_tree);
|
||||||
const rights = `${res.rights || ''}`.split(',');
|
const rights = `${res.rights || ''}`.split(',');
|
||||||
this.data.list.length = 0;
|
this.data.list.length = 0;
|
||||||
@@ -53,7 +56,13 @@ Page({
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
// console.log(this.data.list);
|
// console.log(this.data.list);
|
||||||
this.setData({ list: this.data.list });
|
this.setData({ list: this.data.list, isLogin: true });
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -61,7 +70,7 @@ Page({
|
|||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad(_options) {
|
onLoad(_options) {
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
getAuthInfo,
|
getAuthInfo,
|
||||||
@@ -31,16 +31,17 @@ Page({
|
|||||||
user_id: wx.getStorageSync('user_id'),
|
user_id: wx.getStorageSync('user_id'),
|
||||||
depOption: [] as any[],
|
depOption: [] as any[],
|
||||||
groupsOption: [] as any[],
|
groupsOption: [] as any[],
|
||||||
|
isLogin: false,
|
||||||
},
|
},
|
||||||
handleLogin(e: any) {
|
handleLogin(e: any) {
|
||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
this.getOrderStep();
|
this.getOrderStep();
|
||||||
},
|
},
|
||||||
searchChange(e: any) {
|
searchChange(e: any) {
|
||||||
@@ -106,13 +107,20 @@ Page({
|
|||||||
this.data.params.curr_page = curr;
|
this.data.params.curr_page = curr;
|
||||||
this.setData({ params: this.data.params });
|
this.setData({ params: this.data.params });
|
||||||
const temp = cloneLite(this.data.params);
|
const temp = cloneLite(this.data.params);
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
post('Users/getStaff', temp).then((res: any) => {
|
post('Users/getStaff', temp)
|
||||||
|
.then((res: any) => {
|
||||||
const list = toArray(res.data);
|
const list = toArray(res.data);
|
||||||
if (list.length == 0 && this.data.params.curr_page > 1) {
|
if (list.length == 0 && this.data.params.curr_page > 1) {
|
||||||
this.getList(this.data.params.curr_page - 1);
|
this.getList(this.data.params.curr_page - 1);
|
||||||
}
|
}
|
||||||
this.setData({ count: toNumber(res.count), list: list });
|
this.setData({ count: toNumber(res.count), list: list, isLogin: true });
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onReinstatedStaff(e: any) {
|
onReinstatedStaff(e: any) {
|
||||||
@@ -170,7 +178,7 @@ Page({
|
|||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { base } from '@/utils/config';
|
import { base } from '@/utils/config';
|
||||||
import { checkSesskey, loginStatusPage, post } from '@/utils/https';
|
import { checkSesskey, loginStatusPage, post } from '@/utils/https';
|
||||||
|
import { Subscribe } from '@/utils/subscribe';
|
||||||
import { getStorage, toObject } from '@/utils/util';
|
import { getStorage, toObject } from '@/utils/util';
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
@@ -59,6 +60,7 @@ Page({
|
|||||||
complete: (res: any) => {
|
complete: (res: any) => {
|
||||||
if (res.confirm) {
|
if (res.confirm) {
|
||||||
post('Applet/loginOut').then(() => {
|
post('Applet/loginOut').then(() => {
|
||||||
|
Subscribe.set('isLogin', false);
|
||||||
this.setData({ isLogin: false });
|
this.setData({ isLogin: false });
|
||||||
checkSesskey({ showLoading: false, showError: false })
|
checkSesskey({ showLoading: false, showError: false })
|
||||||
.then(() => {})
|
.then(() => {})
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
getAuthInfo,
|
getAuthInfo,
|
||||||
@@ -28,11 +28,12 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
this.getData();
|
this.getData();
|
||||||
},
|
},
|
||||||
searchChange(e: any) {
|
searchChange(e: any) {
|
||||||
@@ -86,8 +87,9 @@ Page({
|
|||||||
this.data.params.curr_page = curr;
|
this.data.params.curr_page = curr;
|
||||||
this.setData({ params: this.data.params });
|
this.setData({ params: this.data.params });
|
||||||
const temp = cloneLite(this.data.params);
|
const temp = cloneLite(this.data.params);
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
post('GoodsBatch/goodsBatchList', temp).then((res: any) => {
|
post('GoodsBatch/goodsBatchList', temp)
|
||||||
|
.then((res: any) => {
|
||||||
const list = toArray(res.data);
|
const list = toArray(res.data);
|
||||||
if (list.length == 0 && this.data.params.curr_page > 1) {
|
if (list.length == 0 && this.data.params.curr_page > 1) {
|
||||||
this.getList(this.data.params.curr_page - 1);
|
this.getList(this.data.params.curr_page - 1);
|
||||||
@@ -95,6 +97,13 @@ Page({
|
|||||||
this.setData({
|
this.setData({
|
||||||
count: toNumber(res.count),
|
count: toNumber(res.count),
|
||||||
list: list,
|
list: list,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -124,7 +133,7 @@ Page({
|
|||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -32,9 +32,9 @@
|
|||||||
<view slot="header">{{ item.batch_no }}</view>
|
<view slot="header">{{ item.batch_no }}</view>
|
||||||
<view slot="content">
|
<view slot="content">
|
||||||
<card-item-plugin label="自定义批号" value="{{item.batch_custom_no}}" />
|
<card-item-plugin label="自定义批号" value="{{item.batch_custom_no}}" />
|
||||||
<card-item-plugin label="保质期" value="{{item.expire_date}}" />
|
|
||||||
<card-item-plugin label="商品名称" value="{{item.goods_name}}" />
|
<card-item-plugin label="商品名称" value="{{item.goods_name}}" />
|
||||||
<card-item-plugin label="商品编码" value="{{item.goods_code}}" />
|
<card-item-plugin label="商品编码" value="{{item.goods_code}}" />
|
||||||
|
<card-item-plugin label="保质期" value="{{item.expire_date}}" />
|
||||||
<card-item-plugin label="批次单位" value="{{item.unit_ch_name}}" />
|
<card-item-plugin label="批次单位" value="{{item.unit_ch_name}}" />
|
||||||
<card-item-plugin label="批次单价" value="{{item.batch_price}}" />
|
<card-item-plugin label="批次单价" value="{{item.batch_price}}" />
|
||||||
<card-item-plugin label="库存" value="{{item.batch_nums}}" />
|
<card-item-plugin label="库存" value="{{item.batch_nums}}" />
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
getAuthInfo,
|
getAuthInfo,
|
||||||
@@ -26,11 +26,12 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
this.getData();
|
this.getData();
|
||||||
},
|
},
|
||||||
searchChange(e: any) {
|
searchChange(e: any) {
|
||||||
@@ -74,8 +75,9 @@ Page({
|
|||||||
this.data.params.curr_page = curr;
|
this.data.params.curr_page = curr;
|
||||||
this.setData({ params: this.data.params });
|
this.setData({ params: this.data.params });
|
||||||
const temp = cloneLite(this.data.params);
|
const temp = cloneLite(this.data.params);
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
post('GoodsBatch/getBatchLogList', temp).then((res: any) => {
|
post('GoodsBatch/getBatchLogList', temp)
|
||||||
|
.then((res: any) => {
|
||||||
const list = toArray(res.data);
|
const list = toArray(res.data);
|
||||||
if (list.length == 0 && this.data.params.curr_page > 1) {
|
if (list.length == 0 && this.data.params.curr_page > 1) {
|
||||||
this.getList(this.data.params.curr_page - 1);
|
this.getList(this.data.params.curr_page - 1);
|
||||||
@@ -83,6 +85,13 @@ Page({
|
|||||||
this.setData({
|
this.setData({
|
||||||
count: toNumber(res.count),
|
count: toNumber(res.count),
|
||||||
list: list,
|
list: list,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -96,7 +105,7 @@ Page({
|
|||||||
if (title) {
|
if (title) {
|
||||||
wx.setNavigationBarTitle({ title });
|
wx.setNavigationBarTitle({ title });
|
||||||
}
|
}
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
getAuthInfo,
|
getAuthInfo,
|
||||||
@@ -28,11 +28,12 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
this.getData();
|
this.getData();
|
||||||
},
|
},
|
||||||
searchChange(e: any) {
|
searchChange(e: any) {
|
||||||
@@ -134,7 +135,9 @@ Page({
|
|||||||
if (!temp.goods_class) {
|
if (!temp.goods_class) {
|
||||||
delete temp.goods_class;
|
delete temp.goods_class;
|
||||||
}
|
}
|
||||||
post('ErpGoods/list', temp).then((res: any) => {
|
return new Promise<void>((resolve, reject) => {
|
||||||
|
post('ErpGoods/list', temp)
|
||||||
|
.then((res: any) => {
|
||||||
const list = toArray(res.data);
|
const list = toArray(res.data);
|
||||||
if (list.length == 0 && this.data.params.curr_page > 1) {
|
if (list.length == 0 && this.data.params.curr_page > 1) {
|
||||||
this.getList(this.data.params.curr_page - 1);
|
this.getList(this.data.params.curr_page - 1);
|
||||||
@@ -142,6 +145,13 @@ Page({
|
|||||||
this.setData({
|
this.setData({
|
||||||
count: toNumber(res.count),
|
count: toNumber(res.count),
|
||||||
list: list,
|
list: list,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -180,7 +190,7 @@ Page({
|
|||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad(_options) {
|
onLoad(_options) {
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
getAuthInfo,
|
getAuthInfo,
|
||||||
@@ -28,11 +28,11 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getGoodsAttr();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getGoodsAttr();
|
|
||||||
},
|
},
|
||||||
searchChange(e: any) {
|
searchChange(e: any) {
|
||||||
const key = getDataSet(e).key;
|
const key = getDataSet(e).key;
|
||||||
@@ -57,7 +57,9 @@ Page({
|
|||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
getGoodsAttr() {
|
getGoodsAttr() {
|
||||||
post('GoodsAttr/list').then((res: any) => {
|
return new Promise<void>((resolve, reject) => {
|
||||||
|
post('GoodsAttr/list')
|
||||||
|
.then((res: any) => {
|
||||||
this.data.goodsSubAttr = {};
|
this.data.goodsSubAttr = {};
|
||||||
toArray(res?.data?.list).forEach((el) => {
|
toArray(res?.data?.list).forEach((el) => {
|
||||||
toArray(el.sub_attr).forEach((ell) => {
|
toArray(el.sub_attr).forEach((ell) => {
|
||||||
@@ -68,8 +70,14 @@ Page({
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
// console.log(this.data.goodsSubAttr);
|
// console.log(this.data.goodsSubAttr);
|
||||||
this.setData({ goodsSubAttr: this.data.goodsSubAttr });
|
this.setData({ goodsSubAttr: this.data.goodsSubAttr, isLogin: true });
|
||||||
this.getList();
|
this.getList();
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
getList() {
|
getList() {
|
||||||
@@ -109,7 +117,7 @@ Page({
|
|||||||
if (title) {
|
if (title) {
|
||||||
wx.setNavigationBarTitle({ title: decodeURIComponent(title) });
|
wx.setNavigationBarTitle({ title: decodeURIComponent(title) });
|
||||||
}
|
}
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getGoodsAttr());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
getAuthInfo,
|
getAuthInfo,
|
||||||
@@ -33,11 +33,11 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
searchChange(e: any) {
|
searchChange(e: any) {
|
||||||
const key = getDataSet(e).key;
|
const key = getDataSet(e).key;
|
||||||
@@ -79,8 +79,9 @@ Page({
|
|||||||
} else {
|
} else {
|
||||||
delete temp.process_state;
|
delete temp.process_state;
|
||||||
}
|
}
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
post('ErpDepot/depotHeadList', temp).then((res: any) => {
|
post('ErpDepot/depotHeadList', temp)
|
||||||
|
.then((res: any) => {
|
||||||
const list = toArray(res.data);
|
const list = toArray(res.data);
|
||||||
if (list.length == 0 && this.data.params.curr_page > 1) {
|
if (list.length == 0 && this.data.params.curr_page > 1) {
|
||||||
this.getList(this.data.params.curr_page - 1);
|
this.getList(this.data.params.curr_page - 1);
|
||||||
@@ -88,6 +89,13 @@ Page({
|
|||||||
this.setData({
|
this.setData({
|
||||||
count: toNumber(res.count),
|
count: toNumber(res.count),
|
||||||
list: list,
|
list: list,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -142,7 +150,7 @@ Page({
|
|||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { OSSBaseUrl } from '@/utils/config';
|
import { OSSBaseUrl } from '@/utils/config';
|
||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
formatFileSize,
|
formatFileSize,
|
||||||
@@ -29,17 +29,19 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getList() {
|
getList() {
|
||||||
this.setData({ params: this.data.params });
|
this.setData({ params: this.data.params });
|
||||||
const temp = cloneLite(this.data.params);
|
const temp = cloneLite(this.data.params);
|
||||||
post('ErpDepot/info', temp).then((res: any) => {
|
return new Promise<void>((resolve, reject) => {
|
||||||
|
post('ErpDepot/info', temp)
|
||||||
|
.then((res: any) => {
|
||||||
const info = toObject(res.info);
|
const info = toObject(res.info);
|
||||||
wx.setNavigationBarTitle({ title: `${info.bill_no} 详情` });
|
wx.setNavigationBarTitle({ title: `${info.bill_no} 详情` });
|
||||||
this.setData({
|
this.setData({
|
||||||
@@ -51,6 +53,13 @@ Page({
|
|||||||
}),
|
}),
|
||||||
detail: toArray(res.rows),
|
detail: toArray(res.rows),
|
||||||
info: info,
|
info: info,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -73,7 +82,7 @@ Page({
|
|||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
const { head_id } = options;
|
const { head_id } = options;
|
||||||
this.data.params.head_id = head_id;
|
this.data.params.head_id = head_id;
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
getAuthInfo,
|
getAuthInfo,
|
||||||
@@ -32,11 +32,11 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
searchChange(e: any) {
|
searchChange(e: any) {
|
||||||
const key = getDataSet(e).key;
|
const key = getDataSet(e).key;
|
||||||
@@ -78,8 +78,9 @@ Page({
|
|||||||
} else {
|
} else {
|
||||||
delete temp.process_state;
|
delete temp.process_state;
|
||||||
}
|
}
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
post('ErpDepot/depotHeadList', temp).then((res: any) => {
|
post('ErpDepot/depotHeadList', temp)
|
||||||
|
.then((res: any) => {
|
||||||
const list = toArray(res.data);
|
const list = toArray(res.data);
|
||||||
if (list.length == 0 && this.data.params.curr_page > 1) {
|
if (list.length == 0 && this.data.params.curr_page > 1) {
|
||||||
this.getList(this.data.params.curr_page - 1);
|
this.getList(this.data.params.curr_page - 1);
|
||||||
@@ -87,6 +88,13 @@ Page({
|
|||||||
this.setData({
|
this.setData({
|
||||||
count: toNumber(res.count),
|
count: toNumber(res.count),
|
||||||
list: list,
|
list: list,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -135,7 +143,7 @@ Page({
|
|||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { OSSBaseUrl } from '@/utils/config';
|
import { OSSBaseUrl } from '@/utils/config';
|
||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
formatFileSize,
|
formatFileSize,
|
||||||
@@ -29,17 +29,19 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getList() {
|
getList() {
|
||||||
this.setData({ params: this.data.params });
|
this.setData({ params: this.data.params });
|
||||||
const temp = cloneLite(this.data.params);
|
const temp = cloneLite(this.data.params);
|
||||||
post('ErpDepot/info', temp).then((res: any) => {
|
return new Promise<void>((resolve, reject) => {
|
||||||
|
post('ErpDepot/info', temp)
|
||||||
|
.then((res: any) => {
|
||||||
const info = toObject(res.info);
|
const info = toObject(res.info);
|
||||||
wx.setNavigationBarTitle({ title: `${info.bill_no} 详情` });
|
wx.setNavigationBarTitle({ title: `${info.bill_no} 详情` });
|
||||||
this.setData({
|
this.setData({
|
||||||
@@ -51,6 +53,13 @@ Page({
|
|||||||
}),
|
}),
|
||||||
detail: toArray(res.rows),
|
detail: toArray(res.rows),
|
||||||
info: info,
|
info: info,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -73,7 +82,7 @@ Page({
|
|||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
const { head_id } = options;
|
const { head_id } = options;
|
||||||
this.data.params.head_id = head_id;
|
this.data.params.head_id = head_id;
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
getAuthInfo,
|
getAuthInfo,
|
||||||
@@ -30,11 +30,11 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getList();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
this.setData({ authInfo: getAuthInfo() });
|
this.setData({ authInfo: getAuthInfo() });
|
||||||
this.getList();
|
|
||||||
},
|
},
|
||||||
searchChange(e: any) {
|
searchChange(e: any) {
|
||||||
const key = getDataSet(e).key;
|
const key = getDataSet(e).key;
|
||||||
@@ -64,7 +64,9 @@ Page({
|
|||||||
getList(curr: number = 1) {
|
getList(curr: number = 1) {
|
||||||
this.data.params.curr_page = curr;
|
this.data.params.curr_page = curr;
|
||||||
this.setData({ params: this.data.params });
|
this.setData({ params: this.data.params });
|
||||||
post('CompanyProcessV2/processOrd', this.data.params).then((res: any) => {
|
return new Promise<void>((resolve, reject) => {
|
||||||
|
post('CompanyProcessV2/processOrd', this.data.params)
|
||||||
|
.then((res: any) => {
|
||||||
const list = toArray(res.data);
|
const list = toArray(res.data);
|
||||||
if (list.length == 0 && this.data.params.curr_page > 1) {
|
if (list.length == 0 && this.data.params.curr_page > 1) {
|
||||||
this.getList(this.data.params.curr_page - 1);
|
this.getList(this.data.params.curr_page - 1);
|
||||||
@@ -72,6 +74,13 @@ Page({
|
|||||||
this.setData({
|
this.setData({
|
||||||
count: toNumber(res.count),
|
count: toNumber(res.count),
|
||||||
list: list,
|
list: list,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
@@ -113,7 +122,7 @@ Page({
|
|||||||
title: decodeURIComponent(options.title || ''),
|
title: decodeURIComponent(options.title || ''),
|
||||||
});
|
});
|
||||||
this.data.params.process_id = `${options.process_id || ''}`;
|
this.data.params.process_id = `${options.process_id || ''}`;
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
* YangXB 2021.11.24
|
* YangXB 2021.11.24
|
||||||
* */
|
* */
|
||||||
import { base, http } from './config';
|
import { base, http } from './config';
|
||||||
|
import { Subscribe } from './subscribe';
|
||||||
import { getStorage, isArray, setStorage, toArray, toastError } from './util';
|
import { getStorage, isArray, setStorage, toArray, toastError } from './util';
|
||||||
/**
|
/**
|
||||||
* 请求
|
* 请求
|
||||||
@@ -44,12 +45,11 @@ const request = (url: string, options: any, config = { showLoading: true, showEr
|
|||||||
resolve(request.data);
|
resolve(request.data);
|
||||||
} else {
|
} else {
|
||||||
if (config.showError != false) {
|
if (config.showError != false) {
|
||||||
wx.showToast({
|
wx.showToast({ title: request.data.err_msg, icon: 'none' });
|
||||||
title: request.data.err_msg,
|
|
||||||
icon: 'none',
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
if (request.data.err_code == 110000) {
|
if (request.data.err_code == 110000) {
|
||||||
|
Subscribe.set('isLogin', false);
|
||||||
|
|
||||||
// const currentPage = getCurrentPage();
|
// const currentPage = getCurrentPage();
|
||||||
// console.log(currentPage);
|
// console.log(currentPage);
|
||||||
// if (
|
// if (
|
||||||
@@ -147,6 +147,7 @@ export const loginStatus = () => {
|
|||||||
setStorage('auth_info', res.auth_info);
|
setStorage('auth_info', res.auth_info);
|
||||||
setStorage('session_id', res.session_id);
|
setStorage('session_id', res.session_id);
|
||||||
getUsersConfigList();
|
getUsersConfigList();
|
||||||
|
Subscribe.set('isLogin', true);
|
||||||
resolve(res);
|
resolve(res);
|
||||||
})
|
})
|
||||||
.catch((err: any) => {
|
.catch((err: any) => {
|
||||||
@@ -155,7 +156,9 @@ export const loginStatus = () => {
|
|||||||
if (isArray(res.data)) {
|
if (isArray(res.data)) {
|
||||||
post('Applet/loginOut').then(() => {
|
post('Applet/loginOut').then(() => {
|
||||||
checkSesskey({ showLoading: false, showError: false })
|
checkSesskey({ showLoading: false, showError: false })
|
||||||
.then(() => {})
|
.then(() => {
|
||||||
|
Subscribe.set('isLogin', false);
|
||||||
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.log('checkSesskey', err);
|
console.log('checkSesskey', err);
|
||||||
});
|
});
|
||||||
@@ -201,6 +204,7 @@ export const onPageLoadInitAuth = (
|
|||||||
initFun()
|
initFun()
|
||||||
.then((_res) => {
|
.then((_res) => {
|
||||||
// console.log('onPageLoadInitAuth', res);
|
// console.log('onPageLoadInitAuth', res);
|
||||||
|
Subscribe.set('isLogin', true);
|
||||||
that.setData({ isLogin: true, loading: false });
|
that.setData({ isLogin: true, loading: false });
|
||||||
that.init?.();
|
that.init?.();
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -9,8 +9,8 @@ function triggerEvent(key: string, data: any) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
// 也可以触发一个通用的 'change' 事件
|
// 也可以触发一个通用的 'change' 事件
|
||||||
if (listeners["change"]) {
|
if (listeners['change']) {
|
||||||
listeners["change"].forEach((callback: any) => {
|
listeners['change'].forEach((callback: any) => {
|
||||||
callback({ key, data });
|
callback({ key, data });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -45,15 +45,15 @@ export const Subscribe = {
|
|||||||
* @param functionKey 唯一的函数key(用于取消订阅的)
|
* @param functionKey 唯一的函数key(用于取消订阅的)
|
||||||
* @param callback 回调函数
|
* @param callback 回调函数
|
||||||
*/
|
*/
|
||||||
on(key: string, functionKey: string, callback: () => void) {
|
on(key: string, functionKey: string, callback: (data: any) => void) {
|
||||||
if (!listeners[key]) {
|
if (!listeners[key]) {
|
||||||
listeners[key] = [];
|
listeners[key] = [];
|
||||||
}
|
}
|
||||||
if (typeof callback == "function") {
|
if (typeof callback == 'function') {
|
||||||
(callback as IFun)["$$functionKey"] = functionKey;
|
(callback as IFun)['$$functionKey'] = functionKey;
|
||||||
listeners[key].push(callback);
|
listeners[key].push(callback);
|
||||||
} else {
|
} else {
|
||||||
console.log("订阅事件 callback 必须是函数");
|
console.log('订阅事件 callback 必须是函数');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user