Files
FreeERP.Applet/miniprogram/pages/base/processChildConfig/processChildConfig.ts

84 lines
1.7 KiB
TypeScript
Raw Normal View History

import { onPageLoadInitAuth, post } from '@/utils/https';
2026-02-13 12:38:48 +08:00
import { getAuthInfo, toArray } from '@/utils/util';
Page({
/**
*
*/
data: {
process_id: '',
list: [] as any[],
authInfo: {} as any,
},
handleLogin(e: any) {
this.setData({ isLogin: e.detail });
if (e.detail) {
this.init();
this.getList();
2026-02-13 12:38:48 +08:00
}
},
init() {
this.setData({ authInfo: getAuthInfo() });
},
getList() {
return new Promise<void>((resolve, reject) => {
post('CompanyProcessV2/getChildProcess', { process_id: this.data.process_id })
.then((res: any) => {
this.setData({ list: toArray(res.data), isLogin: true });
resolve(res);
})
.catch((res) => {
this.setData({ isLogin: false });
reject(res);
});
});
2026-02-13 12:38:48 +08:00
},
/**
* --
*/
onLoad(options) {
const { process_id = '', title } = options || {};
if (title) {
wx.setNavigationBarTitle({ title: decodeURIComponent(title) });
}
this.data.process_id = process_id;
onPageLoadInitAuth(this, () => this.getList());
2026-02-13 12:38:48 +08:00
},
/**
* --
*/
onReady() {},
/**
* --
*/
onShow() {},
/**
* --
*/
onHide() {},
/**
* --
*/
onUnload() {},
/**
* --
*/
onPullDownRefresh() {},
/**
*
*/
onReachBottom() {},
/**
*
*/
onShareAppMessage() {},
});