完善销售订单, 添加订单排序页
This commit is contained in:
@@ -16,17 +16,13 @@ export const colors = {
|
||||
export const defaultAvatarUrl =
|
||||
'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0';
|
||||
|
||||
const envVersion = wx.getAccountInfoSync().miniProgram.envVersion;
|
||||
|
||||
export const base = {
|
||||
appletName: '易宝赞普惠版',
|
||||
apiHost:
|
||||
wx.getAccountInfoSync().miniProgram.envVersion == 'release'
|
||||
? 'https://ebaozan.com/api/'
|
||||
: 'http://192.168.1.138:93/',
|
||||
apiHost: envVersion == 'release' ? 'https://f.ebaozan.com/api/' : 'http://192.168.1.138:93/',
|
||||
|
||||
webViewBaseUrl:
|
||||
wx.getAccountInfoSync().miniProgram.envVersion == 'release'
|
||||
? 'https://ebaozan.com/'
|
||||
: 'http://ebaozan.cf/',
|
||||
webViewBaseUrl: envVersion == 'release' ? 'https://f.ebaozan.com/' : 'http://free.erp/',
|
||||
cookieKey: 'OwCookie',
|
||||
};
|
||||
|
||||
@@ -38,3 +34,26 @@ export const http = {
|
||||
},
|
||||
unLoginCode: 110000,
|
||||
};
|
||||
|
||||
/**
|
||||
* 生产状态
|
||||
*/
|
||||
export const SaleOrderProcessStateOption = [
|
||||
{ label: '生产未完成', value: 200 },
|
||||
{ label: '生产已完成', value: 202 },
|
||||
];
|
||||
|
||||
export const SaleOrderProcessStateObj = {
|
||||
200: '生产未完成',
|
||||
202: '生产已完成',
|
||||
};
|
||||
|
||||
/**
|
||||
* 收款状态
|
||||
*/
|
||||
export const PayedStateOption = [
|
||||
{ label: '全部', value: '' },
|
||||
{ label: '未收款', value: '1' },
|
||||
{ label: '部分收款', value: '2' },
|
||||
{ label: '收款完成', value: '3' },
|
||||
];
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* YangXB 2021.11.24
|
||||
* */
|
||||
import { base, http } from './config';
|
||||
import { getStorage, goIndexPage, isArray, setStorage, toastError } from './util';
|
||||
import { getStorage, goIndexPage, isArray, setStorage, toArray, toastError } from './util';
|
||||
/**
|
||||
* 请求
|
||||
*/
|
||||
@@ -129,14 +129,24 @@ export const checkSession = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const getUsersConfigList = () => {
|
||||
post('ErpConfig/ErpConfigList').then((res: any) => {
|
||||
toArray(res?.data?.list).forEach((el) => {
|
||||
wx.setStorageSync(el.config_type_en, el.config_value);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
export const loginStatus = () => {
|
||||
return new Promise((resolve, reject) => {
|
||||
post('Applet/loginStatus', {}, { showLoading: false })
|
||||
.then((res: any) => {
|
||||
setStorage('user_info', res.user_info);
|
||||
setStorage('user_id', res.user_info?.user_id);
|
||||
setStorage('company_info', res.company_info);
|
||||
setStorage('auth_info', res.auth_info);
|
||||
setStorage('session_id', res.session_id);
|
||||
getUsersConfigList();
|
||||
resolve(res);
|
||||
})
|
||||
.catch((err: any) => {
|
||||
@@ -194,6 +204,7 @@ export const login = (encryptedData: any, iv: any, type?: any, company_id?: any)
|
||||
resolve(res);
|
||||
} else {
|
||||
setStorage('user_info', res.user_info);
|
||||
setStorage('user_id', res.user_info?.user_id);
|
||||
setStorage('company_info', res.companys_info);
|
||||
setStorage('auth_info', res.auth_info);
|
||||
loginStatus();
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { http } from './config';
|
||||
import Big from 'big.js';
|
||||
|
||||
export const formatTime = (date: Date) => {
|
||||
const year = date.getFullYear();
|
||||
@@ -19,12 +20,11 @@ export const formatNumber = (n: number | string) => {
|
||||
};
|
||||
|
||||
// 对话框
|
||||
export const showModal = (title: string, content: string, showCancel = false) => {
|
||||
export const showModal = (option: { title?: string; content: string }) => {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
wx.showModal({
|
||||
title,
|
||||
content,
|
||||
showCancel,
|
||||
title: option.title || '系统提示',
|
||||
content: option.content,
|
||||
success(res) {
|
||||
if (res.confirm) {
|
||||
resolve();
|
||||
@@ -306,3 +306,44 @@ export const getCurrentPageRoute = () => {
|
||||
const currentPage = pages[pages.length - 1]; // 获取当前页面对象
|
||||
return `/${currentPage.route}`; // 获取当前页面路径
|
||||
};
|
||||
|
||||
/** 价格保留位数 */
|
||||
export const priceRetentionDigits = (value?: number) => {
|
||||
return toNumber(
|
||||
Big(toNumber(value)).toFixed(toNumber(wx.getStorageSync('PRICE_HOLD_POINT') || 2)),
|
||||
);
|
||||
};
|
||||
|
||||
/** 价格保留位数字符串类型 */
|
||||
export const priceRetentionDigitsString = (value?: number) => {
|
||||
return Big(toNumber(value)).toFixed(toNumber(wx.getStorageSync('PRICE_HOLD_POINT') || 2));
|
||||
};
|
||||
|
||||
/** 数量保留位数 */
|
||||
export const numRetentionDigits = (value?: number) => {
|
||||
return toNumber(
|
||||
Big(toNumber(value)).toFixed(toNumber(wx.getStorageSync('NUMS_HOLD_POINT') || 2)),
|
||||
);
|
||||
};
|
||||
|
||||
/** 数量保留位数字符串类型 */
|
||||
export const numRetentionDigitsString = (value?: number) => {
|
||||
return Big(toNumber(value)).toFixed(toNumber(wx.getStorageSync('NUMS_HOLD_POINT') || 2));
|
||||
};
|
||||
|
||||
/**
|
||||
* sleep
|
||||
* @param callback 回调函数
|
||||
* @param ms 毫秒, 默认300ms
|
||||
* @returns
|
||||
*/
|
||||
export const sleep = (callback?: () => void, ms = 300): Promise<boolean> => {
|
||||
return new Promise((resolve) => {
|
||||
setTimeout(() => {
|
||||
callback?.();
|
||||
resolve(true);
|
||||
}, ms);
|
||||
});
|
||||
};
|
||||
|
||||
export const cloneLite = (data: any) => JSON.parse(JSON.stringify(data));
|
||||
|
||||
Reference in New Issue
Block a user