添加onPageLoadInitAuth函数判断登录
This commit is contained in:
@@ -82,7 +82,7 @@ Component({
|
|||||||
this.triggerEvent('handleLogin', false);
|
this.triggerEvent('handleLogin', false);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
wx.showToast({ title: e.detail.errMsg, icon: 'none' });
|
// wx.showToast({ title: e.detail.errMsg, icon: 'none' });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
login2(e: any) {
|
login2(e: any) {
|
||||||
|
|||||||
@@ -5,5 +5,6 @@
|
|||||||
"tab-bar-plugin": "/pages/components/tab-bar-plugin/tab-bar-plugin",
|
"tab-bar-plugin": "/pages/components/tab-bar-plugin/tab-bar-plugin",
|
||||||
"pagination-plugin": "/pages/components/pagination-plugin/pagination-plugin",
|
"pagination-plugin": "/pages/components/pagination-plugin/pagination-plugin",
|
||||||
"search-popup": "/pages/components/search-popup/search-popup"
|
"search-popup": "/pages/components/search-popup/search-popup"
|
||||||
}
|
},
|
||||||
|
"enablePullDownRefresh": true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { post, onPageLoadInitAuth } from '@/utils/https';
|
||||||
import { menuConfig } from '@/utils/menuConfig';
|
import { menuConfig } from '@/utils/menuConfig';
|
||||||
import { getDataSet, toArray, toObject } from '@/utils/util';
|
import { getDataSet, toArray, toObject } from '@/utils/util';
|
||||||
|
|
||||||
@@ -55,6 +55,7 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getIndex();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
@@ -76,7 +77,6 @@ Page({
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
this.getIndex();
|
|
||||||
this.setData({
|
this.setData({
|
||||||
authInfo: this.data.authInfo,
|
authInfo: this.data.authInfo,
|
||||||
menuList: this.data.menuList,
|
menuList: this.data.menuList,
|
||||||
@@ -84,12 +84,23 @@ Page({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
getIndex() {
|
getIndex() {
|
||||||
post('Index/index', {}).then((res: any) => {
|
return new Promise<void>((resolve, reject) => {
|
||||||
const block = toArray(res?.block);
|
post('Index/index', {})
|
||||||
if (block.length % 2 != 0) {
|
.then((res: any) => {
|
||||||
block.push({ value: '', name: '工作量查看', unit: '' });
|
const block = toArray(res?.block);
|
||||||
}
|
if (block.length % 2 != 0) {
|
||||||
this.setData({ block });
|
block.push({ value: '', name: '工作量查看', unit: '' });
|
||||||
|
}
|
||||||
|
this.setData({ block, isLogin: true });
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
wx.stopPullDownRefresh();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onBlockNavTo(e: any) {
|
onBlockNavTo(e: any) {
|
||||||
@@ -118,7 +129,7 @@ Page({
|
|||||||
* 生命周期函数--监听页面显示
|
* 生命周期函数--监听页面显示
|
||||||
*/
|
*/
|
||||||
onShow() {
|
onShow() {
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getIndex());
|
||||||
wx.hideHomeButton();
|
wx.hideHomeButton();
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -135,7 +146,13 @@ Page({
|
|||||||
/**
|
/**
|
||||||
* 页面相关事件处理函数--监听用户下拉动作
|
* 页面相关事件处理函数--监听用户下拉动作
|
||||||
*/
|
*/
|
||||||
onPullDownRefresh() {},
|
onPullDownRefresh() {
|
||||||
|
if (this.data.isLogin) {
|
||||||
|
this.getIndex();
|
||||||
|
} else {
|
||||||
|
wx.stopPullDownRefresh();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 页面上拉触底事件的处理函数
|
* 页面上拉触底事件的处理函数
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import { getAuthInfo, getDataSet, showModal, sleep, toArray, toastSuccess } from '@/utils/util';
|
import { getAuthInfo, getDataSet, showModal, sleep, toArray, toastSuccess } from '@/utils/util';
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
@@ -7,26 +7,34 @@ 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('Orders/getLiteOrders')
|
return new Promise<void>((resolve, reject) => {
|
||||||
.then((res: any) => {
|
post('Orders/getLiteOrders')
|
||||||
const list = toArray(res.data);
|
.then((res: any) => {
|
||||||
this.setData({ list });
|
const list = toArray(res.data);
|
||||||
})
|
this.setData({ list, isLogin: true });
|
||||||
.finally(() => {
|
resolve(res);
|
||||||
wx.stopPullDownRefresh();
|
})
|
||||||
});
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
wx.stopPullDownRefresh();
|
||||||
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
onOrderToTop(e: any) {
|
onOrderToTop(e: any) {
|
||||||
const data = getDataSet(e);
|
const data = getDataSet(e);
|
||||||
@@ -55,7 +63,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,27 +29,36 @@ 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('Orders/saleDetail', temp).then((res: any) => {
|
return new Promise<void>((resolve, reject) => {
|
||||||
this.setData({
|
post('Orders/saleDetail', temp)
|
||||||
info: toObject(res.info),
|
.then((res: any) => {
|
||||||
files: toArray(res.files).map((el) => {
|
this.setData({
|
||||||
el._file_type = getFileType(el.file_name);
|
info: toObject(res.info),
|
||||||
el.file_path = `${OSSBaseUrl}${el.file_path}`;
|
files: toArray(res.files).map((el) => {
|
||||||
el._file_size = formatFileSize(el.file_size);
|
el._file_type = getFileType(el.file_name);
|
||||||
return el;
|
el.file_path = `${OSSBaseUrl}${el.file_path}`;
|
||||||
}),
|
el._file_size = formatFileSize(el.file_size);
|
||||||
detail: toArray(res.detail),
|
return el;
|
||||||
});
|
}),
|
||||||
|
detail: toArray(res.detail),
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onPreview(e: any) {
|
onPreview(e: any) {
|
||||||
@@ -72,7 +81,7 @@ Page({
|
|||||||
const { order_no } = options;
|
const { order_no } = options;
|
||||||
this.data.params.order_no = order_no;
|
this.data.params.order_no = order_no;
|
||||||
wx.setNavigationBarTitle({ title: `${order_no} 详情` });
|
wx.setNavigationBarTitle({ title: `${order_no} 详情` });
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import {
|
import {
|
||||||
SaleOrderProcessStateOption,
|
SaleOrderProcessStateOption,
|
||||||
PayedStateOption,
|
PayedStateOption,
|
||||||
@@ -59,11 +59,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();
|
|
||||||
this.getOrderStep();
|
this.getOrderStep();
|
||||||
},
|
},
|
||||||
searchChange(e: any) {
|
searchChange(e: any) {
|
||||||
@@ -116,17 +116,25 @@ Page({
|
|||||||
} else {
|
} else {
|
||||||
delete temp.process_state;
|
delete temp.process_state;
|
||||||
}
|
}
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
post('Orders/list', temp).then((res: any) => {
|
post('Orders/list', temp)
|
||||||
const list = toArray(res.data);
|
.then((res: any) => {
|
||||||
if (list.length == 0 && this.data.params.curr_page > 1) {
|
const list = toArray(res.data);
|
||||||
this.getList(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.setData({
|
}
|
||||||
count: toNumber(res.count),
|
this.setData({
|
||||||
list: list,
|
count: toNumber(res.count),
|
||||||
amount: toObject(res.amount),
|
list: list,
|
||||||
});
|
amount: toObject(res.amount),
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onOrderPay(e: any) {
|
onOrderPay(e: any) {
|
||||||
@@ -192,7 +200,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 { formatTime, getAuthInfo, getDataSet, isArray, toArray, toObject } from '@/utils/util';
|
import { formatTime, getAuthInfo, getDataSet, isArray, toArray, toObject } from '@/utils/util';
|
||||||
import { voiceRequest } from '@/utils/voiceUtil';
|
import { voiceRequest } from '@/utils/voiceUtil';
|
||||||
|
|
||||||
@@ -67,6 +67,7 @@ Page({
|
|||||||
this.setData({ isLogin: e.detail });
|
this.setData({ isLogin: e.detail });
|
||||||
if (e.detail) {
|
if (e.detail) {
|
||||||
this.init();
|
this.init();
|
||||||
|
this.getExecProcess();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
backChange(e: any) {
|
backChange(e: any) {
|
||||||
@@ -110,17 +111,26 @@ Page({
|
|||||||
this.getProcessName();
|
this.getProcessName();
|
||||||
},
|
},
|
||||||
getExecProcess() {
|
getExecProcess() {
|
||||||
post('CompanyProcessV2/getProcessByCode').then((res: any) => {
|
return new Promise<void>((resolve, reject) => {
|
||||||
this.data.processItems = toArray(res.data);
|
post('CompanyProcessV2/getProcessByCode')
|
||||||
if (this.data.processItems.length == 1) {
|
.then((res: any) => {
|
||||||
this.data.selectedProcessCode = this.data.processItems[0].process_code;
|
this.data.processItems = toArray(res.data);
|
||||||
this.getProcessName();
|
if (this.data.processItems.length == 1) {
|
||||||
} else {
|
this.data.selectedProcessCode = this.data.processItems[0].process_code;
|
||||||
this.getProcessName();
|
this.getProcessName();
|
||||||
}
|
} else {
|
||||||
this.setData({
|
this.getProcessName();
|
||||||
processItems: this.data.processItems,
|
}
|
||||||
});
|
this.setData({
|
||||||
|
processItems: this.data.processItems,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
init() {
|
init() {
|
||||||
@@ -139,7 +149,6 @@ Page({
|
|||||||
process_code: code,
|
process_code: code,
|
||||||
logType: logType || 0,
|
logType: logType || 0,
|
||||||
});
|
});
|
||||||
this.getExecProcess();
|
|
||||||
},
|
},
|
||||||
voiceChange(event: any) {
|
voiceChange(event: any) {
|
||||||
this.setData({
|
this.setData({
|
||||||
@@ -340,7 +349,7 @@ Page({
|
|||||||
loading: true,
|
loading: true,
|
||||||
voice: wx.getStorageSync('processEntryVoice') == 'false' ? false : true,
|
voice: wx.getStorageSync('processEntryVoice') == 'false' ? false : true,
|
||||||
});
|
});
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getExecProcess());
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { loginStatusPage, post } from '@/utils/https';
|
import { onPageLoadInitAuth, post } from '@/utils/https';
|
||||||
import { SaleOrderProcessStateOption } from '@/utils/config';
|
import { SaleOrderProcessStateOption } from '@/utils/config';
|
||||||
import {
|
import {
|
||||||
cloneLite,
|
cloneLite,
|
||||||
@@ -22,16 +22,17 @@ Page({
|
|||||||
saleOrderProcessStateOption: SaleOrderProcessStateOption,
|
saleOrderProcessStateOption: SaleOrderProcessStateOption,
|
||||||
sort: [{ label: '创建日期', value: 'create_date' }],
|
sort: [{ label: '创建日期', value: 'create_date' }],
|
||||||
detail: { show: false, title: '', data: [] as any[] },
|
detail: { show: false, title: '', data: [] 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();
|
|
||||||
},
|
},
|
||||||
searchChange(e: any) {
|
searchChange(e: any) {
|
||||||
const key = getDataSet(e).key;
|
const key = getDataSet(e).key;
|
||||||
@@ -67,13 +68,20 @@ Page({
|
|||||||
} else {
|
} else {
|
||||||
delete temp.process_state;
|
delete temp.process_state;
|
||||||
}
|
}
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
post('ProduceOrder/getListV2', temp).then((res: any) => {
|
post('ProduceOrder/getListV2', temp)
|
||||||
const list = toArray(res.data);
|
.then((res: any) => {
|
||||||
if (list.length == 0 && this.data.params.curr_page > 1) {
|
const list = toArray(res.data);
|
||||||
this.getList(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.setData({ count: toNumber(res.count), list });
|
}
|
||||||
|
this.setData({ count: toNumber(res.count), list, isLogin: true });
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -115,7 +123,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, getDataSet, toArray } from '@/utils/util';
|
import { getAuthInfo, getDataSet, toArray } from '@/utils/util';
|
||||||
|
|
||||||
Page({
|
Page({
|
||||||
@@ -25,26 +25,33 @@ 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/getAllProcessNum')
|
return new Promise<void>((resolve, reject) => {
|
||||||
.then((res: any) => {
|
post('CompanyProcessV2/getAllProcessNum')
|
||||||
this.setData({ process: toArray(res.data) });
|
.then((res: any) => {
|
||||||
})
|
this.setData({ process: toArray(res.data), isLogin: true });
|
||||||
.finally(() => {
|
resolve(res);
|
||||||
wx.stopPullDownRefresh();
|
})
|
||||||
});
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
wx.stopPullDownRefresh();
|
||||||
|
});
|
||||||
|
});
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 生命周期函数--监听页面加载
|
* 生命周期函数--监听页面加载
|
||||||
*/
|
*/
|
||||||
onLoad() {
|
onLoad() {
|
||||||
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,
|
||||||
@@ -29,16 +29,17 @@ Page({
|
|||||||
{ value: 4, label: '无需结算' },
|
{ value: 4, 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;
|
||||||
@@ -74,16 +75,24 @@ Page({
|
|||||||
} else {
|
} else {
|
||||||
delete temp.pay_state;
|
delete temp.pay_state;
|
||||||
}
|
}
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
post('ErpDepot/depotHeadList', temp).then((res: any) => {
|
post('ErpDepot/depotHeadList', temp)
|
||||||
const list = toArray(res.data);
|
.then((res: any) => {
|
||||||
if (list.length == 0 && this.data.params.curr_page > 1) {
|
const list = toArray(res.data);
|
||||||
this.getList(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.setData({
|
}
|
||||||
count: toNumber(res.count),
|
this.setData({
|
||||||
list: list,
|
count: toNumber(res.count),
|
||||||
});
|
list: list,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onOrderDel(e: any) {
|
onOrderDel(e: any) {
|
||||||
@@ -131,7 +140,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,
|
||||||
@@ -24,34 +24,44 @@ Page({
|
|||||||
info: {} as any,
|
info: {} as any,
|
||||||
files: [] as any,
|
files: [] as any,
|
||||||
detail: [] as any,
|
detail: [] 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() {
|
||||||
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) => {
|
||||||
const info = toObject(res.info);
|
post('ErpDepot/info', temp)
|
||||||
wx.setNavigationBarTitle({ title: `${info.bill_no} 详情` });
|
.then((res: any) => {
|
||||||
this.setData({
|
const info = toObject(res.info);
|
||||||
files: toArray(res.files).map((el) => {
|
wx.setNavigationBarTitle({ title: `${info.bill_no} 详情` });
|
||||||
el._file_type = getFileType(el.file_name);
|
this.setData({
|
||||||
el.file_path = `${OSSBaseUrl}${el.file_path}`;
|
files: toArray(res.files).map((el) => {
|
||||||
el._file_size = formatFileSize(el.file_size);
|
el._file_type = getFileType(el.file_name);
|
||||||
return el;
|
el.file_path = `${OSSBaseUrl}${el.file_path}`;
|
||||||
}),
|
el._file_size = formatFileSize(el.file_size);
|
||||||
detail: toArray(res.rows),
|
return el;
|
||||||
info: info,
|
}),
|
||||||
});
|
detail: toArray(res.rows),
|
||||||
|
info: info,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onPreview(e: any) {
|
onPreview(e: any) {
|
||||||
@@ -73,7 +83,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,16 +30,17 @@ Page({
|
|||||||
{ value: 3, label: '完成结算' },
|
{ value: 3, label: '完成结算' },
|
||||||
{ value: 4, label: '无需结算' },
|
{ value: 4, label: '无需结算' },
|
||||||
],
|
],
|
||||||
|
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;
|
||||||
@@ -70,16 +71,24 @@ 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/depotHeadList', temp).then((res: any) => {
|
post('ErpDepot/depotHeadList', temp)
|
||||||
const list = toArray(res.data);
|
.then((res: any) => {
|
||||||
if (list.length == 0 && this.data.params.curr_page > 1) {
|
const list = toArray(res.data);
|
||||||
this.getList(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.setData({
|
}
|
||||||
count: toNumber(res.count),
|
this.setData({
|
||||||
list: list,
|
count: toNumber(res.count),
|
||||||
});
|
list: list,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onOrderDel(e: any) {
|
onOrderDel(e: any) {
|
||||||
@@ -133,7 +142,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,
|
||||||
@@ -24,34 +24,44 @@ Page({
|
|||||||
info: {} as any,
|
info: {} as any,
|
||||||
files: [] as any,
|
files: [] as any,
|
||||||
detail: [] as any,
|
detail: [] 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() {
|
||||||
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) => {
|
||||||
const info = toObject(res.info);
|
post('ErpDepot/info', temp)
|
||||||
wx.setNavigationBarTitle({ title: `${info.bill_no} 详情` });
|
.then((res: any) => {
|
||||||
this.setData({
|
const info = toObject(res.info);
|
||||||
files: toArray(res.files).map((el) => {
|
wx.setNavigationBarTitle({ title: `${info.bill_no} 详情` });
|
||||||
el._file_type = getFileType(el.file_name);
|
this.setData({
|
||||||
el.file_path = `${OSSBaseUrl}${el.file_path}`;
|
files: toArray(res.files).map((el) => {
|
||||||
el._file_size = formatFileSize(el.file_size);
|
el._file_type = getFileType(el.file_name);
|
||||||
return el;
|
el.file_path = `${OSSBaseUrl}${el.file_path}`;
|
||||||
}),
|
el._file_size = formatFileSize(el.file_size);
|
||||||
detail: toArray(res.rows),
|
return el;
|
||||||
info: info,
|
}),
|
||||||
});
|
detail: toArray(res.rows),
|
||||||
|
info: info,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onPreview(e: any) {
|
onPreview(e: any) {
|
||||||
@@ -73,7 +83,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,
|
||||||
@@ -28,16 +28,17 @@ Page({
|
|||||||
{ value: 3, label: '完成入库' },
|
{ value: 3, 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;
|
||||||
@@ -74,15 +75,24 @@ Page({
|
|||||||
delete temp.states;
|
delete temp.states;
|
||||||
}
|
}
|
||||||
|
|
||||||
post('ErpDepot/depotHeadList', temp).then((res: any) => {
|
return new Promise<void>((resolve, reject) => {
|
||||||
const list = toArray(res.data);
|
post('ErpDepot/depotHeadList', temp)
|
||||||
if (list.length == 0 && this.data.params.curr_page > 1) {
|
.then((res: any) => {
|
||||||
this.getList(this.data.params.curr_page - 1);
|
const list = toArray(res.data);
|
||||||
}
|
if (list.length == 0 && this.data.params.curr_page > 1) {
|
||||||
this.setData({
|
this.getList(this.data.params.curr_page - 1);
|
||||||
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);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onOrderDel(e: any) {
|
onOrderDel(e: any) {
|
||||||
@@ -136,7 +146,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,
|
||||||
@@ -24,34 +24,44 @@ Page({
|
|||||||
info: {} as any,
|
info: {} as any,
|
||||||
files: [] as any,
|
files: [] as any,
|
||||||
detail: [] as any,
|
detail: [] 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() {
|
||||||
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) => {
|
||||||
const info = toObject(res.info);
|
post('ErpDepot/info', temp)
|
||||||
wx.setNavigationBarTitle({ title: `${info.bill_no} 详情` });
|
.then((res: any) => {
|
||||||
this.setData({
|
const info = toObject(res.info);
|
||||||
files: toArray(res.files).map((el) => {
|
wx.setNavigationBarTitle({ title: `${info.bill_no} 详情` });
|
||||||
el._file_type = getFileType(el.file_name);
|
this.setData({
|
||||||
el.file_path = `${OSSBaseUrl}${el.file_path}`;
|
files: toArray(res.files).map((el) => {
|
||||||
el._file_size = formatFileSize(el.file_size);
|
el._file_type = getFileType(el.file_name);
|
||||||
return el;
|
el.file_path = `${OSSBaseUrl}${el.file_path}`;
|
||||||
}),
|
el._file_size = formatFileSize(el.file_size);
|
||||||
detail: toArray(res.rows),
|
return el;
|
||||||
info: info,
|
}),
|
||||||
});
|
detail: toArray(res.rows),
|
||||||
|
info: info,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onPreview(e: any) {
|
onPreview(e: any) {
|
||||||
@@ -73,7 +83,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,
|
||||||
@@ -28,16 +28,17 @@ Page({
|
|||||||
// { value: 3, label: '完成入库' },
|
// { value: 3, 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;
|
||||||
@@ -73,16 +74,24 @@ Page({
|
|||||||
// } else {
|
// } else {
|
||||||
// delete temp.states;
|
// delete temp.states;
|
||||||
// }
|
// }
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
post('ErpDepot/depotHeadList', temp).then((res: any) => {
|
post('ErpDepot/depotHeadList', temp)
|
||||||
const list = toArray(res.data);
|
.then((res: any) => {
|
||||||
if (list.length == 0 && this.data.params.curr_page > 1) {
|
const list = toArray(res.data);
|
||||||
this.getList(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.setData({
|
}
|
||||||
count: toNumber(res.count),
|
this.setData({
|
||||||
list: list,
|
count: toNumber(res.count),
|
||||||
});
|
list: list,
|
||||||
|
isLogin: true,
|
||||||
|
});
|
||||||
|
resolve(res);
|
||||||
|
})
|
||||||
|
.catch((res) => {
|
||||||
|
this.setData({ isLogin: false });
|
||||||
|
reject(res);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
onOrderDetail(e: any) {
|
onOrderDetail(e: any) {
|
||||||
@@ -140,7 +149,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,
|
||||||
@@ -24,24 +24,23 @@ Page({
|
|||||||
info: {} as any,
|
info: {} as any,
|
||||||
files: [] as any,
|
files: [] as any,
|
||||||
detail: [] as any,
|
detail: [] 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() {
|
||||||
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/depotItemList', temp).then((res: any) => {
|
|
||||||
this.setData({ detail: toArray(res.data) });
|
|
||||||
});
|
|
||||||
post('ErpDepot/fileList', { head_id: temp.head_id }).then((res: any) => {
|
post('ErpDepot/fileList', { head_id: temp.head_id }).then((res: any) => {
|
||||||
this.setData({
|
this.setData({
|
||||||
files: toArray(res.data).map((el) => {
|
files: toArray(res.data).map((el) => {
|
||||||
@@ -52,6 +51,18 @@ Page({
|
|||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return new Promise<void>((resolve, reject) => {
|
||||||
|
post('ErpDepot/depotItemList', temp)
|
||||||
|
.then((res: any) => {
|
||||||
|
this.setData({ detail: toArray(res.data), 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);
|
||||||
@@ -78,10 +89,10 @@ Page({
|
|||||||
const record = toObject(res.data);
|
const record = toObject(res.data);
|
||||||
wx.setNavigationBarTitle({ title: `${record.bill_no} 详情` });
|
wx.setNavigationBarTitle({ title: `${record.bill_no} 详情` });
|
||||||
this.setData({ info: record });
|
this.setData({ info: record });
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
loginStatusPage(this);
|
onPageLoadInitAuth(this, () => this.getList());
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -3,15 +3,7 @@
|
|||||||
* YangXB 2021.11.24
|
* YangXB 2021.11.24
|
||||||
* */
|
* */
|
||||||
import { base, http } from './config';
|
import { base, http } from './config';
|
||||||
import {
|
import { getStorage, isArray, setStorage, toArray, toastError } from './util';
|
||||||
getCurrentPage,
|
|
||||||
getStorage,
|
|
||||||
goIndexPage,
|
|
||||||
isArray,
|
|
||||||
setStorage,
|
|
||||||
toArray,
|
|
||||||
toastError,
|
|
||||||
} from './util';
|
|
||||||
/**
|
/**
|
||||||
* 请求
|
* 请求
|
||||||
*/
|
*/
|
||||||
@@ -58,15 +50,15 @@ const request = (url: string, options: any, config = { showLoading: true, showEr
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (request.data.err_code == 110000) {
|
if (request.data.err_code == 110000) {
|
||||||
const currentPage = getCurrentPage();
|
// const currentPage = getCurrentPage();
|
||||||
console.log(currentPage);
|
// console.log(currentPage);
|
||||||
if (
|
// if (
|
||||||
!['pages/index/index', 'pages/processEntry/processEntry', 'pages/my/my'].includes(
|
// !['pages/index/index', 'pages/processEntry/processEntry', 'pages/my/my'].includes(
|
||||||
currentPage.route,
|
// currentPage.route,
|
||||||
)
|
// )
|
||||||
) {
|
// ) {
|
||||||
goIndexPage();
|
// goIndexPage();
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
reject(request.data);
|
reject(request.data);
|
||||||
}
|
}
|
||||||
@@ -197,6 +189,28 @@ export const loginStatusPage = (that: WechatMiniprogram.Page.Instance<any, any>)
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 页面初始化
|
||||||
|
*/
|
||||||
|
export const onPageLoadInitAuth = (
|
||||||
|
that: WechatMiniprogram.Page.Instance<any, any>,
|
||||||
|
initFun: () => Promise<void>,
|
||||||
|
) => {
|
||||||
|
if (typeof initFun == 'function') {
|
||||||
|
that.setData({ loading: true });
|
||||||
|
initFun()
|
||||||
|
.then((_res) => {
|
||||||
|
// console.log('onPageLoadInitAuth', res);
|
||||||
|
that.setData({ isLogin: true, loading: false });
|
||||||
|
that.init?.();
|
||||||
|
})
|
||||||
|
.catch((_res) => {
|
||||||
|
// console.log('onPageLoadInitAuth catch', res);
|
||||||
|
that.setData({ isLogin: false, loading: false });
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {*} config { showLoading: true, showError: true }
|
* @param {*} config { showLoading: true, showError: true }
|
||||||
|
|||||||
Reference in New Issue
Block a user