|
import { buildUUID } from '../../../utils/uuid';
|
import { ApiAction, ApiActionPage } from '../../model/baseModel';
|
import {
|
OtheroutorderListItem,
|
OtheroutorderPageListGetResultModel,
|
OtheroutorderPageParams,
|
|
OtheroutorderDetailPageListGetResultModel,
|
OtheroutorderDetailPageParams,
|
OtheroutorderPageDetailSNListGetResultModel,
|
OtheroutorderDetailSNPageParams,
|
} from '../model/warehoueseModel';
|
import { genAction, Api, genActionPage } from '../system';
|
import { useUserStore } from '/@/store/modules/user';
|
import { defHttp } from '/@/utils/http/axios';
|
import { isNullOrEmpty } from '/@/utils/is';
|
|
/*
|
* 获取其他出库单分页列表
|
*/
|
export const getOtheroutorderListByPage = async (params: OtheroutorderPageParams) => {
|
let order = ''
|
if (params.order != undefined) {
|
order = params.order == 'descend' ? (params.field + ' desc') : params.field
|
}
|
let sqlcmd = '1=1';
|
if (params?.BILLCODE != undefined && params?.BILLCODE != '') {
|
sqlcmd += " And BILLCODE like '%" + params?.BILLCODE + "%'";
|
}
|
// 日期
|
if (params?.BILLDATE != undefined && params?.BILLDATE != '') {
|
sqlcmd += " And BILLDATE > '" + params?.BILLDATE[0] + "'";
|
}
|
if (params?.BILLDATE != undefined && params?.BILLDATE != '') {
|
sqlcmd += " And BILLDATE < '" + params?.BILLDATE[1] + "'";
|
}
|
if (!isNullOrEmpty(params?.STATUS)) {
|
sqlcmd += " And STATUS = '" + params?.STATUS + "'";
|
}
|
var option = {
|
UserId: useUserStore().getUserInfo.userId as string,
|
ByOrg: true,
|
OrgCode: useUserStore().getUserInfo.orgCode as string
|
}
|
// const rParams = genActionPage('BIZ_ERP_OTH_OUT', sqlcmd, params.page, params.pageSize, option);
|
// return getOtheroutorderListByPageAsync(rParams);
|
const usParams = genAction('BIZ_ERP_OTH_OUT', {
|
QueryAble_T: '',
|
where: sqlcmd,
|
order: order,
|
page: {
|
pageAble_T: 'string',
|
draw: 1,
|
pageIndex: params.page,
|
pageSize: params.pageSize,
|
},
|
option
|
},option);
|
//const rParams = genActionPage('V_BIZ_ERP_OTH_OUT_DTL', sqlcmd, params.page, params.pageSize,option);
|
return getOtheroutorderListByPageAsync(usParams);
|
};
|
async function getOtheroutorderListByPageAsync(params: any) {
|
const data = await defHttp.post(
|
{ url: Api.QueryUrl, params },
|
{
|
isTransformResponse: false,
|
},
|
);
|
const model = {
|
items: data.Data.page.data,
|
total: data.Data.page.totals,
|
};
|
return model;
|
}
|
/*
|
* 获取其他出库单明细分页列表
|
*/
|
export const getOtheroutorderDetailListByPage = async (params: any) => {
|
let order = ''
|
if (params.order != undefined) {
|
order = params.order == 'descend' ? (params.field + ' desc') : params.field
|
}
|
let sqlcmd = '1=1';
|
if (params?.BILLCODE != undefined && params?.BILLCODE != '') {
|
sqlcmd += " And BILLCODE like '%" + params?.BILLCODE + "%'";
|
}
|
if (params?.ITEM_CODE != undefined && params?.ITEM_CODE != '') {
|
sqlcmd += " And ITEM_CODE like '%" + params?.ITEM_CODE + "%'";
|
}
|
if (!isNullOrEmpty(params?.LINESTATUS)) {
|
sqlcmd += " And LINESTATUS = '" + params?.LINESTATUS + "'";
|
}
|
var option = {
|
UserId: useUserStore().getUserInfo.userId as string,
|
ByOrg: true,
|
OrgCode: useUserStore().getUserInfo.orgCode as string
|
}
|
if (!isNullOrEmpty(params.page)) {
|
const usParams = genAction('V_BIZ_ERP_OTH_OUT_DTL', {
|
QueryAble_T: '',
|
where: sqlcmd,
|
order: 'BILLLINE*1 '+order,
|
page: {
|
pageAble_T: 'string',
|
draw: 1,
|
pageIndex: params.page,
|
pageSize: params.pageSize,
|
},
|
option
|
},option);
|
//const rParams = genActionPage('V_BIZ_ERP_OTH_OUT_DTL', sqlcmd, params.page, params.pageSize,option);
|
return getOtheroutorderDetailListByPageAsync(usParams);
|
} else {
|
const usParams = genAction('V_BIZ_ERP_OTH_OUT_DTL', {
|
QueryAble_T: '',
|
where: sqlcmd,
|
order: 'BILLLINE*1',
|
option
|
},option);
|
//const rParams = genActionPage('V_BIZ_ERP_OTH_OUT_DTL', sqlcmd, params.page, params.pageSize,option);
|
return getOtheroutorderDetailListByPageAsync(usParams);
|
}
|
};
|
async function getOtheroutorderDetailListByPageAsync(params: any) {
|
const data = await defHttp.post(
|
{ url: Api.QueryUrl, params, timeout: 3 * 60 * 1000 },
|
{
|
isTransformResponse: false,
|
},
|
);
|
let model = {}
|
if (isNullOrEmpty(data.Data.page)) {
|
model = {
|
items: data.Data.Items,
|
};
|
} else {
|
model = {
|
items: data.Data.page.data,
|
total: data.Data.page.totals,
|
};
|
}
|
return model;
|
}
|
/*
|
* 获取其他出库单分页列表条码明细
|
*/
|
export const getOtheroutorderDetailSNListByPage = async (params: any) => {
|
let order = ''
|
if (params.order != undefined) {
|
order = params.order == 'descend' ? (params.field + ' desc') : params.field
|
}
|
let sqlcmd = '1=1';
|
if (params?.BILLCODE != undefined && params?.BILLCODE != '') {
|
sqlcmd += " And ORDER_NO like '%" + params?.BILLCODE + "%'";
|
}
|
if (params?.ITEM_CODE != undefined && params?.ITEM_CODE != '') {
|
sqlcmd += " And ITEM_CODE like '%" + params?.ITEM_CODE + "%'";
|
}
|
if (params?.SN != undefined && params?.SN != '') {
|
sqlcmd += " And SN like '%" + params?.SN + "%'";
|
}
|
if (!isNullOrEmpty(params?.STATUS)) {
|
sqlcmd += " And STATUS = '" + params?.STATUS + "'";
|
}
|
var option = {
|
UserId: useUserStore().getUserInfo.userId as string,
|
ByOrg: true,
|
OrgCode: useUserStore().getUserInfo.orgCode as string
|
}
|
if (!isNullOrEmpty(params.page)) {
|
const usParams = genAction('BIZ_ERP_OTH_OUT_SN', {
|
QueryAble_T: '',
|
where: sqlcmd,
|
order:order,
|
page: {
|
pageAble_T: 'string',
|
draw: 1,
|
pageIndex: params.page,
|
pageSize: params.pageSize,
|
},
|
option
|
},option);
|
//const rParams = genActionPage('V_BIZ_ERP_OTH_OUT_DTL', sqlcmd, params.page, params.pageSize,option);
|
return getOtheroutorderDetailSNListByPageAsync(usParams);
|
} else {
|
const usParams = genAction('BIZ_ERP_OTH_OUT_SN', {
|
QueryAble_T: '',
|
where: sqlcmd,
|
option
|
},option);
|
//const rParams = genActionPage('V_BIZ_ERP_OTH_OUT_DTL', sqlcmd, params.page, params.pageSize,option);
|
return getOtheroutorderDetailSNListByPageAsync(usParams);
|
}
|
|
};
|
async function getOtheroutorderDetailSNListByPageAsync(params: any) {
|
const data = await defHttp.post(
|
{ url: Api.QueryUrl, params },
|
{
|
isTransformResponse: false,
|
},
|
);
|
let model = {}
|
if (isNullOrEmpty(data.Data.page)) {
|
model = {
|
items: data.Data.Items,
|
};
|
} else {
|
model = {
|
items: data.Data.page.data,
|
total: data.Data.page.totals,
|
};
|
}
|
return model;
|
}
|
//下拉列表
|
// STATUSs 单据状态
|
export const optionsOthOutListApi = async (params: Recordable) => {
|
const usParams = genAction('BIZ_ERP_OTH_OUT+STATUSs', '');
|
return await defHttp.post(
|
{ url: Api.urlQueryEnum, params: usParams },
|
{
|
errorMessageMode: 'none',
|
isTransformResponse: false,
|
// apiUrl: globSetting.taskApiUrl
|
},
|
);
|
};
|