纸板小程序:订单/送货单:列表与详情功能
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
import { getCustomerList, getSupplierList } from '../api/index'
|
||||
import { getAppInstance } from './app';
|
||||
|
||||
// 获取客户数据
|
||||
export async function getCustomerData() {
|
||||
const app = getAppInstance();
|
||||
const res = await getCustomerList({ isGetAll: true, orderBy: 'sortnum asc' }).catch(() => {});
|
||||
if (res && res.data.list) {
|
||||
app.globalData.customerList = res.data.list.map(item => {
|
||||
item.label = item.name;
|
||||
item.value = item.id;
|
||||
return item;
|
||||
});
|
||||
app.globalData.customerList.unshift({label: '全部',value: 0})
|
||||
}else {
|
||||
app.globalData.customerList = [];
|
||||
}
|
||||
}
|
||||
// 获取供应商数据
|
||||
export async function getSupplierData() {
|
||||
const app = getAppInstance();
|
||||
const res = await getSupplierList({ isGetAll: true, orderBy: 'sortnum asc' }).catch(() => {});
|
||||
if (res && res.data.list) {
|
||||
app.globalData.supplierList = res.data.list.map(item => {
|
||||
item.label = item.name;
|
||||
item.value = item.id;
|
||||
return item;
|
||||
});
|
||||
app.globalData.supplierList.unshift({label: '全部',value: 0})
|
||||
}else {
|
||||
app.globalData.supplierList = [];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user