Merge remote-tracking branch 'origin/master'

master
wanghao 3 months ago
commit 2e5fa1ab2a

@ -0,0 +1,77 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { MaterialBomVO, MaterialBomForm, MaterialBomQuery } from '@/api/mes/materialBom/types';
/**
* BOM
* @param query
* @returns {*}
*/
export const listMaterialBom = (query?: MaterialBomQuery): AxiosPromise<MaterialBomVO[]> => {
return request({
url: '/mes/materialBom/list',
method: 'get',
params: query
});
};
/**
* BOM
* @param materialBomId
*/
export const getMaterialBom = (materialBomId: string | number): AxiosPromise<MaterialBomVO> => {
return request({
url: '/mes/materialBom/' + materialBomId,
method: 'get'
});
};
/**
* BOM
* @param data
*/
export const addMaterialBom = (data: MaterialBomForm) => {
return request({
url: '/mes/materialBom',
method: 'post',
data: data
});
};
/**
* BOM
* @param data
*/
export const updateMaterialBom = (data: MaterialBomForm) => {
return request({
url: '/mes/materialBom',
method: 'put',
data: data
});
};
/**
* BOM
* @param materialBomId
*/
export const delMaterialBom = (materialBomId: string | number | Array<string | number>) => {
return request({
url: '/mes/materialBom/' + materialBomId,
method: 'delete'
});
};
/**
* BOM
* @param query
* @returns {*}
*/
export function getMaterialBomList(query) {
return request({
url: '/mes/materialBom/getMaterialBomList',
method: 'get',
params: query
});
};

@ -0,0 +1,280 @@
export interface MaterialBomVO {
/**
*
*/
materialBomId: string | number;
/**
*
*/
parentId: string | number;
/**
* ID
*/
materialId: string | number;
/**
*
*/
materialName: string;
/**
* bom
*/
materialBomDesc: string;
/**
* bom
*/
materialBomVersion: string;
/**
*
*/
ancestors: string;
/**
*
*/
standardAmount: number;
/**
* (1 0)
*/
topFlag: number;
/**
* (0 1 2)
*/
checkType: string;
/**
* ID
*/
projectId: string | number;
/**
* ()
*/
assembleTime: number;
/**
* 1ERP 2 3MES
*/
materialClassfication: string;
/**
*
*/
attachId: string | number;
/**
* 1 0
*/
activeFlag: string;
/**
*
*/
remark: string;
/**
*
*/
createDept: number;
/**
*
*/
createBy: number;
/**
*
*/
createTime: string;
/**
*
*/
updateBy: number;
/**
*
*/
updateTime: string;
/**
*
*/
children: MaterialBomVO[];
}
export interface MaterialBomForm extends BaseEntity {
/**
*
*/
materialBomId?: string | number;
/**
*
*/
parentId?: string | number;
/**
* ID
*/
materialId?: string | number;
/**
*
*/
materialName?: string;
/**
* bom
*/
materialBomDesc?: string;
/**
* bom
*/
materialBomVersion?: string;
/**
*
*/
ancestors?: string;
/**
*
*/
standardAmount?: number;
/**
* (1 0)
*/
topFlag?: number;
/**
* (0 1 2)
*/
checkType?: string;
/**
* ID
*/
projectId?: string | number;
/**
* ()
*/
assembleTime?: number;
/**
* 1ERP 2 3MES
*/
materialClassfication?: string;
/**
*
*/
attachId?: string | number;
/**
* 1 0
*/
activeFlag?: string;
/**
*
*/
remark?: string;
}
export interface MaterialBomQuery {
/**
*
*/
materialBomId?: string | number;
/**
*
*/
parentId?: string | number;
/**
* ID
*/
materialId?: string | number;
/**
*
*/
materialName?: string;
/**
* bom
*/
materialBomDesc?: string;
/**
* bom
*/
materialBomVersion?: string;
/**
*
*/
ancestors?: string;
/**
*
*/
standardAmount?: number;
/**
* (1 0)
*/
topFlag?: number;
/**
* (0 1 2)
*/
checkType?: string;
/**
* ID
*/
projectId?: string | number;
/**
* ()
*/
assembleTime?: number;
/**
* 1ERP 2 3MES
*/
materialClassfication?: string;
/**
*
*/
attachId?: string | number;
/**
* 1 0
*/
activeFlag?: string;
/**
*
*/
params?: any;
}

@ -0,0 +1,79 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { InstockDetailVO, InstockDetailForm, InstockDetailQuery } from '@/api/wms/instockDetail/types';
/**
* -
* @param query
* @returns {*}
*/
export const listInstockDetail = (query?: InstockDetailQuery): AxiosPromise<InstockDetailVO[]> => {
return request({
url: '/wms/instockDetail/list',
method: 'get',
params: query
});
};
export const getMaterialListVo = (query) => {
return request({
url: '/wms/baseMaterialInfo/materialList',
method: 'get',
params: query
});
};
export const getMaterailCount = (query) => {
return request({
url: '/wms/inventory/materailCount',
method: 'get',
params: query
});
};
/**
* -
* @param instockDetailId
*/
export const getInstockDetail = (instockDetailId: string | number): AxiosPromise<InstockDetailVO> => {
return request({
url: '/wms/instockDetail/' + instockDetailId,
method: 'get'
});
};
/**
* -
* @param data
*/
export const addInstockDetail = (data: InstockDetailForm) => {
return request({
url: '/wms/instockDetail',
method: 'post',
data: data
});
};
/**
* -
* @param data
*/
export const updateInstockDetail = (data: InstockDetailForm) => {
return request({
url: '/wms/instockDetail',
method: 'put',
data: data
});
};
/**
* -
* @param instockDetailId
*/
export const delInstockDetail = (instockDetailId: string | number | Array<string | number>) => {
return request({
url: '/wms/instockDetail/' + instockDetailId,
method: 'delete'
});
};

@ -0,0 +1,216 @@
export interface InstockDetailVO {
/**
*
*/
instockDetailId: string | number;
/**
*
*/
instockId: string | number;
/**
*
*/
instockCode: string;
/**
* -
*/
dnDId: string | number;
/**
* -
*/
poDId: string | number;
/**
* id
*/
materialId: string | number;
/**
*
*/
materialCode: string;
/**
*
*/
materialName: string;
/**
*
*/
instockQty: number;
/**
*
*/
printedNum: number;
/**
*
*/
materialSpe: string;
/**
*
*/
unitName: string;
/**
*
*/
codeYesNo: string;
/**
*
*/
materialCategories: string;
}
export interface InstockDetailForm extends BaseEntity {
/**
*
*/
instockDetailId?: string | number;
/**
*
*/
instockId?: string | number;
/**
*
*/
instockCode?: string;
/**
* -
*/
dnDId?: string | number;
/**
* -
*/
poDId?: string | number;
/**
* id
*/
materialId?: string | number;
/**
*
*/
materialCode?: string;
/**
*
*/
materialName?: string;
/**
*
*/
instockQty?: number;
/**
*
*/
materialSpe?: string;
/**
*
*/
unitName?: string;
/**
*
*/
codeYesNo?: string;
/**
*
*/
materialCategories?: string;
}
export interface InstockDetailQuery extends PageQuery {
/**
*
*/
instockDetailId?: string | number;
/**
*
*/
instockId?: string | number;
/**
*
*/
instockCode?: string;
/**
* -
*/
dnDId?: string | number;
/**
* -
*/
poDId?: string | number;
/**
* id
*/
materialId?: string | number;
/**
*
*/
materialCode?: string;
/**
*
*/
materialName?: string;
/**
*
*/
instockQty?: number;
/**
*
*/
materialSpe?: string;
/**
*
*/
unitName?: string;
/**
*
*/
codeYesNo?: string;
/**
*
*/
materialCategories?: string;
/**
*
*/
params?: any;
}

@ -0,0 +1,63 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { InstockOrderVO, InstockOrderForm, InstockOrderQuery } from '@/api/wms/instockOrder/types';
/**
*
* @param query
* @returns {*}
*/
export const listInstockOrder = (query?: InstockOrderQuery): AxiosPromise<InstockOrderVO[]> => {
return request({
url: '/wms/instockOrder/list',
method: 'get',
params: query
});
};
/**
*
* @param instockId
*/
export const getInstockOrder = (instockId: string | number): AxiosPromise<InstockOrderVO> => {
return request({
url: '/wms/instockOrder/' + instockId,
method: 'get'
});
};
/**
*
* @param data
*/
export const addInstockOrder = (data: InstockOrderForm) => {
return request({
url: '/wms/instockOrder',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateInstockOrder = (data: InstockOrderForm) => {
return request({
url: '/wms/instockOrder',
method: 'put',
data: data
});
};
/**
*
* @param instockId
*/
export const delInstockOrder = (instockId: string | number | Array<string | number>) => {
return request({
url: '/wms/instockOrder/' + instockId,
method: 'delete'
});
};

@ -0,0 +1,166 @@
export interface InstockOrderVO {
/**
*
*/
instockId: string | number;
/**
*
*/
instockCode: string;
/**
*
*/
materialCategories: string;
/**
* (1,2,3,4)
*/
instockType: string;
/**
*
*/
orderNo: string;
/**
*
*/
auditBy: string;
/**
*
*/
auditTime: string;
/**
* (0,1,2)
*/
auditStatus: string;
/**
*
*/
auditComments: string;
/**
* ID
*/
warehouseId: string | number;
}
export interface InstockOrderForm extends BaseEntity {
/**
*
*/
instockId?: string | number;
/**
*
*/
instockCode?: string;
/**
*
*/
materialCategories?: string;
/**
* (1,2,3,4)
*/
instockType?: string;
/**
*
*/
orderNo?: string;
/**
*
*/
auditBy?: string;
/**
*
*/
auditTime?: string;
/**
* (0,1,2)
*/
auditStatus?: string;
/**
*
*/
auditComments?: string;
/**
* ID
*/
warehouseId?: string | number;
}
export interface InstockOrderQuery extends PageQuery {
/**
*
*/
instockId?: string | number;
/**
*
*/
instockCode?: string;
/**
*
*/
materialCategories?: string;
/**
* (1,2,3,4)
*/
instockType?: string;
/**
*
*/
orderNo?: string;
/**
*
*/
auditBy?: string;
/**
*
*/
auditTime?: string;
/**
* (0,1,2)
*/
auditStatus?: string;
/**
*
*/
auditComments?: string;
/**
* ID
*/
warehouseId?: string | number;
/**
*
*/
params?: any;
}

@ -0,0 +1,75 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { InstockPrintVO, InstockPrintForm, InstockPrintQuery } from '@/api/wms/instockPrint/types';
/**
* -
* @param query
* @returns {*}
*/
export const listInstockPrint = (query?: InstockPrintQuery): AxiosPromise<InstockPrintVO[]> => {
return request({
url: '/wms/instockPrint/list',
method: 'get',
params: query
});
};
/**
* -
* @param instockPrintId
*/
export const getInstockPrint = (instockPrintId: string | number): AxiosPromise<InstockPrintVO> => {
return request({
url: '/wms/instockPrint/' + instockPrintId,
method: 'get'
});
};
/**
* -
* @param data
*/
export const addInstockPrint = (data: InstockPrintForm) => {
return request({
url: '/wms/instockPrint',
method: 'post',
data: data
});
};
/**
* -
* @param data
*/
export const updateInstockPrint = (data: InstockPrintForm) => {
return request({
url: '/wms/instockPrint',
method: 'put',
data: data
});
};
/**
* -
* @param instockPrintId
*/
export const delInstockPrint = (instockPrintId: string | number | Array<string | number>) => {
return request({
url: '/wms/instockPrint/' + instockPrintId,
method: 'delete'
});
};
/**
* -
* @param instockPrintId
*/
export const printInstockPrint = (data: Array<InstockPrintVO>) => {
return request({
url: '/wms/instockPrint/print',
method: 'post',
data: data
});
};

@ -0,0 +1,196 @@
export interface InstockPrintVO {
/**
*
*/
instockPrintId: string | number;
/**
*
*/
instockCode: string;
/**
*
*/
batchCode: string;
/**
*
*/
materialQty: number;
/**
*
*/
apportionQty: number;
/**
* id
*/
materialId: string | number;
/**
*
*/
materialCode: string;
/**
*
*/
materialName: string;
/**
*
*/
materialSpe: string;
/**
*
*/
unitName: string;
/**
*
*/
codeYesNo: string;
/**
*
*/
materialCategories: string;
}
export interface InstockPrintForm extends BaseEntity {
/**
*
*/
instockPrintId?: string | number;
/**
*
*/
instockCode?: string;
/**
*
*/
batchCode?: string;
/**
*
*/
materialQty?: number;
/**
*
*/
apportionQty?: number;
/**
* id
*/
materialId?: string | number;
/**
*
*/
materialCode?: string;
/**
*
*/
materialName?: string;
/**
*
*/
materialSpe?: string;
/**
*
*/
unitName?: string;
/**
*
*/
codeYesNo?: string;
/**
*
*/
materialCategories?: string;
}
export interface InstockPrintQuery extends PageQuery {
/**
*
*/
instockPrintId?: string | number;
/**
*
*/
instockCode?: string;
/**
*
*/
batchCode?: string;
/**
*
*/
materialQty?: number;
/**
*
*/
apportionQty?: number;
/**
* id
*/
materialId?: string | number;
/**
*
*/
materialCode?: string;
/**
*
*/
materialName?: string;
/**
*
*/
materialSpe?: string;
/**
*
*/
unitName?: string;
/**
*
*/
codeYesNo?: string;
/**
*
*/
materialCategories?: string;
/**
*
*/
params?: any;
}

@ -0,0 +1,63 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { InventoryVO, InventoryForm, InventoryQuery } from '@/api/wms/inventory/types';
/**
*
* @param query
* @returns {*}
*/
export const listInventory = (query?: InventoryQuery): AxiosPromise<InventoryVO[]> => {
return request({
url: '/wms/inventory/list',
method: 'get',
params: query
});
};
/**
*
* @param inventoryId
*/
export const getInventory = (inventoryId: string | number): AxiosPromise<InventoryVO> => {
return request({
url: '/wms/inventory/' + inventoryId,
method: 'get'
});
};
/**
*
* @param data
*/
export const addInventory = (data: InventoryForm) => {
return request({
url: '/wms/inventory',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateInventory = (data: InventoryForm) => {
return request({
url: '/wms/inventory',
method: 'put',
data: data
});
};
/**
*
* @param inventoryId
*/
export const delInventory = (inventoryId: string | number | Array<string | number>) => {
return request({
url: '/wms/inventory/' + inventoryId,
method: 'delete'
});
};

@ -0,0 +1,151 @@
export interface InventoryVO {
/**
*
*/
inventoryId: string | number;
/**
*
*/
batchCode: string;
/**
* id
*/
materialId: string | number;
/**
*
*/
locationCode: string;
/**
*
*/
materialCategories: number;
/**
*
*/
inventoryQty: number;
/**
* 01
*/
lockState: string;
/**
* 001
*/
inventoryStatus: string;
/**
* ID
*/
storeId: string | number;
}
export interface InventoryForm extends BaseEntity {
/**
*
*/
inventoryId?: string | number;
/**
*
*/
batchCode?: string;
/**
* id
*/
materialId?: string | number;
/**
*
*/
locationCode?: string;
/**
*
*/
materialCategories?: number;
/**
*
*/
inventoryQty?: number;
/**
* 01
*/
lockState?: string;
/**
* 001
*/
inventoryStatus?: string;
/**
* ID
*/
storeId?: string | number;
}
export interface InventoryQuery extends PageQuery {
/**
*
*/
inventoryId?: string | number;
/**
*
*/
batchCode?: string;
/**
* id
*/
materialId?: string | number;
/**
*
*/
locationCode?: string;
/**
*
*/
materialCategories?: number;
/**
*
*/
inventoryQty?: number;
/**
* 01
*/
lockState?: string;
/**
* 001
*/
inventoryStatus?: string;
/**
* ID
*/
storeId?: string | number;
/**
*
*/
params?: any;
}

@ -0,0 +1,63 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { OutstockDetailVO, OutstockDetailForm, OutstockDetailQuery } from '@/api/wms/outstockDetail/types';
/**
* -
* @param query
* @returns {*}
*/
export const listOutstockDetail = (query?: OutstockDetailQuery): AxiosPromise<OutstockDetailVO[]> => {
return request({
url: '/wms/outstockDetail/list',
method: 'get',
params: query
});
};
/**
* -
* @param outstockDetailId
*/
export const getOutstockDetail = (outstockDetailId: string | number): AxiosPromise<OutstockDetailVO> => {
return request({
url: '/wms/outstockDetail/' + outstockDetailId,
method: 'get'
});
};
/**
* -
* @param data
*/
export const addOutstockDetail = (data: OutstockDetailForm) => {
return request({
url: '/wms/outstockDetail',
method: 'post',
data: data
});
};
/**
* -
* @param data
*/
export const updateOutstockDetail = (data: OutstockDetailForm) => {
return request({
url: '/wms/outstockDetail',
method: 'put',
data: data
});
};
/**
* -
* @param outstockDetailId
*/
export const delOutstockDetail = (outstockDetailId: string | number | Array<string | number>) => {
return request({
url: '/wms/outstockDetail/' + outstockDetailId,
method: 'delete'
});
};

@ -0,0 +1,110 @@
export interface OutstockDetailVO {
/**
*
*/
outstockDetailId: string | number;
/**
*
*/
outstockCode: string;
/**
*
*/
outstockId: string | number;
/**
* id
*/
materialId: string | number;
/**
*
*/
outstockQty: number;
/**
*
*/
materialCategories: string;
/**
*
*/
materialCode: string;
}
export interface OutstockDetailForm extends BaseEntity {
/**
*
*/
outstockDetailId?: string | number;
/**
*
*/
outstockCode?: string;
/**
*
*/
outstockId?: string | number;
/**
* id
*/
materialId?: string | number;
/**
*
*/
outstockQty?: number;
/**
*
*/
materialCategories?: string;
}
export interface OutstockDetailQuery extends PageQuery {
/**
*
*/
outstockDetailId?: string | number;
/**
*
*/
outstockCode?: string;
/**
*
*/
outstockId?: string | number;
/**
* id
*/
materialId?: string | number;
/**
*
*/
outstockQty?: number;
/**
*
*/
materialCategories?: string;
/**
*
*/
params?: any;
}

@ -0,0 +1,63 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { OutstockOrderVO, OutstockOrderForm, OutstockOrderQuery } from '@/api/wms/outstockOrder/types';
/**
*
* @param query
* @returns {*}
*/
export const listOutstockOrder = (query?: OutstockOrderQuery): AxiosPromise<OutstockOrderVO[]> => {
return request({
url: '/wms/outstockOrder/list',
method: 'get',
params: query
});
};
/**
*
* @param outstockId
*/
export const getOutstockOrder = (outstockId: string | number): AxiosPromise<OutstockOrderVO> => {
return request({
url: '/wms/outstockOrder/' + outstockId,
method: 'get'
});
};
/**
*
* @param data
*/
export const addOutstockOrder = (data: OutstockOrderForm) => {
return request({
url: '/wms/outstockOrder',
method: 'post',
data: data
});
};
/**
*
* @param data
*/
export const updateOutstockOrder = (data: OutstockOrderForm) => {
return request({
url: '/wms/outstockOrder',
method: 'put',
data: data
});
};
/**
*
* @param outstockId
*/
export const delOutstockOrder = (outstockId: string | number | Array<string | number>) => {
return request({
url: '/wms/outstockOrder/' + outstockId,
method: 'delete'
});
};

@ -0,0 +1,181 @@
export interface OutstockOrderVO {
/**
*
*/
outstockId: string | number;
/**
* ID
*/
warehouseId: string | number;
/**
*
*/
outstockCode: string;
/**
*
*/
outstockType: string;
/**
*
*/
materialCategories: string;
/**
* (1,2,3,4)
*/
orderType: string;
/**
*
*/
orderNo: string;
/**
*
*/
auditBy: string;
/**
*
*/
auditTime: string;
/**
* (0,1,2)
*/
auditStatus: string;
/**
*
*/
auditComments: string;
}
export interface OutstockOrderForm extends BaseEntity {
/**
*
*/
outstockId?: string | number;
/**
* ID
*/
warehouseId?: string | number;
/**
*
*/
outstockCode?: string;
/**
*
*/
outstockType?: string;
/**
*
*/
materialCategories?: string;
/**
* (1,2,3,4)
*/
orderType?: string;
/**
*
*/
orderNo?: string;
/**
*
*/
auditBy?: string;
/**
*
*/
auditTime?: string;
/**
* (0,1,2)
*/
auditStatus?: string;
/**
*
*/
auditComments?: string;
}
export interface OutstockOrderQuery extends PageQuery {
/**
*
*/
outstockId?: string | number;
/**
* ID
*/
warehouseId?: string | number;
/**
*
*/
outstockCode?: string;
/**
*
*/
outstockType?: string;
/**
*
*/
materialCategories?: string;
/**
* (1,2,3,4)
*/
orderType?: string;
/**
*
*/
orderNo?: string;
/**
*
*/
auditBy?: string;
/**
*
*/
auditTime?: string;
/**
* (0,1,2)
*/
auditStatus?: string;
/**
*
*/
auditComments?: string;
/**
*
*/
params?: any;
}

@ -0,0 +1,63 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ReturnOrderVO, ReturnOrderForm, ReturnOrderQuery } from '@/api/wms/returnOrder/types';
/**
* 退
* @param query
* @returns {*}
*/
export const listReturnOrder = (query?: ReturnOrderQuery): AxiosPromise<ReturnOrderVO[]> => {
return request({
url: '/wms/returnOrder/list',
method: 'get',
params: query
});
};
/**
* 退
* @param roId
*/
export const getReturnOrder = (roId: string | number): AxiosPromise<ReturnOrderVO> => {
return request({
url: '/wms/returnOrder/' + roId,
method: 'get'
});
};
/**
* 退
* @param data
*/
export const addReturnOrder = (data: ReturnOrderForm) => {
return request({
url: '/wms/returnOrder',
method: 'post',
data: data
});
};
/**
* 退
* @param data
*/
export const updateReturnOrder = (data: ReturnOrderForm) => {
return request({
url: '/wms/returnOrder',
method: 'put',
data: data
});
};
/**
* 退
* @param roId
*/
export const delReturnOrder = (roId: string | number | Array<string | number>) => {
return request({
url: '/wms/returnOrder/' + roId,
method: 'delete'
});
};

@ -0,0 +1,256 @@
export interface ReturnOrderVO {
/**
*
*/
roId: string | number;
/**
* ID
*/
materialId: string | number;
/**
*
*/
materialCategories: string;
/**
*
*/
batchCode: string;
/**
*
*/
planAmount: number;
/**
* ID
*/
warehouseId: string | number;
/**
* 退
*/
planLocationCode: string;
/**
* 退
*/
orderStatus: string;
/**
*
*/
returnAmount: number;
/**
* 退
*/
returnLocationCode: string;
/**
*
*/
auditBy: string;
/**
*
*/
auditTime: string;
/**
* (0,1,2)
*/
auditStatus: string;
/**
*
*/
auditComments: string;
/**
* erp
*/
erpSynchronousStatus: string;
/**
* erp
*/
erpSynchronousQty: number;
}
export interface ReturnOrderForm extends BaseEntity {
/**
*
*/
roId?: string | number;
/**
* ID
*/
materialId?: string | number;
/**
*
*/
materialCategories?: string;
/**
*
*/
batchCode?: string;
/**
*
*/
planAmount?: number;
/**
* ID
*/
warehouseId?: string | number;
/**
* 退
*/
planLocationCode?: string;
/**
* 退
*/
orderStatus?: string;
/**
*
*/
returnAmount?: number;
/**
* 退
*/
returnLocationCode?: string;
/**
*
*/
auditBy?: string;
/**
*
*/
auditTime?: string;
/**
* (0,1,2)
*/
auditStatus?: string;
/**
*
*/
auditComments?: string;
/**
* erp
*/
erpSynchronousStatus?: string;
/**
* erp
*/
erpSynchronousQty?: number;
}
export interface ReturnOrderQuery extends PageQuery {
/**
*
*/
roId?: string | number;
/**
* ID
*/
materialId?: string | number;
/**
*
*/
materialCategories?: string;
/**
*
*/
batchCode?: string;
/**
*
*/
planAmount?: number;
/**
* ID
*/
warehouseId?: string | number;
/**
* 退
*/
planLocationCode?: string;
/**
* 退
*/
orderStatus?: string;
/**
*
*/
returnAmount?: number;
/**
* 退
*/
returnLocationCode?: string;
/**
*
*/
auditBy?: string;
/**
*
*/
auditTime?: string;
/**
* (0,1,2)
*/
auditStatus?: string;
/**
*
*/
auditComments?: string;
/**
* erp
*/
erpSynchronousStatus?: string;
/**
* erp
*/
erpSynchronousQty?: number;
/**
*
*/
params?: any;
}

@ -75,6 +75,32 @@ export const constantRoutes: RouteRecordRaw[] = [
}
]
},
{
path: '/wms',
component: Layout,
redirect: '/index',
children: [
{
path: 'instockDetail',
component: () => import('@/views/wms/instockDetail/index.vue'),
name: 'instockDetail',
meta: { title: '入库明细', icon: 'dashboard', affix: true }
}
]
},
{
path: '/wms',
component: Layout,
redirect: '/index',
children: [
{
path: 'outStockDetail',
component: () => import('@/views/wms/outstockDetail/index.vue'),
name: 'outstockDetail',
meta: { title: '出库明细', icon: 'dashboard', affix: true }
}
]
},
{
path: '/user',
component: Layout,

@ -314,7 +314,7 @@ const initFormData: BaseClassTeamInfoForm = {
processId: undefined,
stationId: undefined,
deviceId: undefined,
activeFlag: undefined,
activeFlag: '1',
createDept: undefined,
createBy: undefined,
createTime: undefined,
@ -345,16 +345,13 @@ const data = reactive<PageData<BaseClassTeamInfoForm, BaseClassTeamInfoQuery>>({
}
},
rules: {
classTeamId: [
{ required: true, message: "主键标识不能为空", trigger: "blur" }
],
teamCode: [
{ required: true, message: "班组编号不能为空", trigger: "blur" }
],
teamName: [
{ required: true, message: "班组名称不能为空", trigger: "blur" }
],
teamHead: [
/*teamHead: [
{ required: true, message: "班组负责人不能为空", trigger: "blur" }
],
shiftId: [
@ -368,7 +365,7 @@ const data = reactive<PageData<BaseClassTeamInfoForm, BaseClassTeamInfoQuery>>({
],
deviceId: [
{ required: true, message: "设备ID不能为空", trigger: "blur" }
],
],*/
activeFlag: [
{ required: true, message: "激活标识不能为空", trigger: "change" }
],

@ -170,7 +170,7 @@ const initFormData: BaseEqualMaterialInfoForm = {
equalMaterialInfoId: undefined,
materialId: undefined,
equalMaterialId: undefined,
activeFlag: undefined,
activeFlag: '1',
remark: undefined,
}
const data = reactive<PageData<BaseEqualMaterialInfoForm, BaseEqualMaterialInfoQuery>>({

@ -22,8 +22,8 @@
<el-form-item label="物料类型ID" prop="materialTypeId">
<el-input v-model="queryParams.materialTypeId" placeholder="请输入物料类型ID" clearable @keyup.enter="handleQuery" />
</el-form-item>-->
<el-form-item label="物料大类(1原材料 2半成品 3成品)" prop="materialCategories">
<el-select v-model="queryParams.materialCategories" placeholder="请选择物料大类(1原材料 2半成品 3成品)" clearable >
<el-form-item label="物料大类" prop="materialCategories">
<el-select v-model="queryParams.materialCategories" placeholder="请选择物料大类" clearable >
<el-option v-for="dict in mes_material_categories" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
@ -719,7 +719,7 @@ const initFormData: BaseMaterialInfoForm = {
createOrgId: undefined,
useOrgId: undefined,
prodLineId: undefined,
activeFlag: undefined,
activeFlag: '1',
deletedFlag: undefined,
purchasePriceUnitId: undefined,
approveDate: undefined,

@ -226,7 +226,7 @@ const initFormData: BaseMaterialTypeForm = {
materialCategories: undefined,
materialSubclass: undefined,
processId: undefined,
activeFlag: undefined,
activeFlag: '1',
remark: undefined,
}

@ -71,7 +71,11 @@
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="激活标识(1是 0否)" align="center" prop="activeFlag" />
<el-table-column label="激活标识" align="center" prop="activeFlag">
<template #default="scope">
<dict-tag :options="active_flag" :value="scope.row.activeFlag"/>
</template>
</el-table-column>
<!-- <el-table-column label="创建部门" align="center" prop="createDept" />
<el-table-column label="创建人" align="center" prop="createBy" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
@ -102,7 +106,7 @@
</el-card>
<!-- 添加或修改计量单位信息对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="baseMeasurementUnitInfoFormRef" :model="form" :rules="rules" label-width="80px">
<el-form ref="baseMeasurementUnitInfoFormRef" :model="form" :rules="rules" label-width="120px">
<!-- <el-form-item label="主键标识" prop="unitId">
<el-input v-model="form.unitId" placeholder="请输入主键标识" />
</el-form-item>-->
@ -123,7 +127,8 @@
<el-input v-model="form.unitName" placeholder="请输入计量单位名称" />
</el-form-item>
<el-form-item label="计量单位转换" prop="unitConversion">
<el-input v-model="form.unitConversion" placeholder="请输入计量单位转换" />
<!-- <el-input v-model="form.unitConversion" placeholder="请输入计量单位转换" />-->
<el-input-number v-model="form.unitConversion" />
</el-form-item>
<!-- <el-form-item label="祖级列表" prop="ancestors">
<el-input v-model="form.ancestors" placeholder="请输入祖级列表" />
@ -142,7 +147,13 @@
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="激活标识" prop="activeFlag">
<el-input v-model="form.activeFlag" placeholder="请输入激活标识" />
<el-radio-group v-model="form.activeFlag">
<el-radio
v-for="dict in active_flag"
:key="dict.value"
:value="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<template #footer>
@ -168,6 +179,7 @@ type BaseMeasurementUnitInfoOption = {
const { proxy } = getCurrentInstance() as ComponentInternalInstance;;
const { unit_type } = toRefs<any>(proxy?.useDict('unit_type'));
const { active_flag } = toRefs<any>(proxy?.useDict('active_flag'));
const baseMeasurementUnitInfoList = ref<BaseMeasurementUnitInfoVO[]>([]);
const baseMeasurementUnitInfoOptions = ref<BaseMeasurementUnitInfoOption[]>([]);
@ -195,7 +207,7 @@ const initFormData: BaseMeasurementUnitInfoForm = {
ancestors: undefined,
unitType: undefined,
remark: undefined,
activeFlag: undefined,
activeFlag: '1',
}
const data = reactive<PageData<BaseMeasurementUnitInfoForm, BaseMeasurementUnitInfoQuery>>({

@ -407,7 +407,7 @@ const routeProcessUpdate = async (row: BaseRouteVO) => {
dialog.title = '维护工艺路线步骤';
};
// rowProdBaseRouteProcessIndex
/** 修改rowProdBaseRouteProcessIndex方法返回类名字符串 */
const rowProdBaseRouteProcessIndex = ({ row, rowIndex }: {
row: ProdBaseRouteProcess;
rowIndex: number
@ -422,11 +422,20 @@ const rowProdBaseRouteProcessIndex = ({ row, rowIndex }: {
//
return '';
};
/** 工艺路线组成信息添加按钮操作 */
const handleAddProdBaseRouteProcess = () => {
// routeProcessBoList processOrder
const maxProcessOrder = routeProcessBoList.value.reduce((max, item) => {
return Math.max(max, item.processOrder || 0);
}, 0);
// processOrder maxProcessOrder + 10
const newProcessOrder = maxProcessOrder + 10;
routeProcessBoList.value.push({
processId: '',
processOrder: '',
processId: '', // ID
processOrder: newProcessOrder,
remark: '',
createBy: '',
createTime: '',
@ -435,6 +444,7 @@ const handleAddProdBaseRouteProcess = () => {
});
};
/** 工艺路线组成信息删除按钮操作 */
const handleDeleteProdBaseRouteProcess = () => {
// 线
@ -443,15 +453,23 @@ const handleDeleteProdBaseRouteProcess = () => {
} else {
// 线
routeProcessBoList.value = routeProcessBoList.value.filter(
item => !checkedProdBaseRouteProcess.value.includes(item.index)
item => !checkedProdBaseRouteProcess.value.includes(item.processId)
);
// processOrder
routeProcessBoList.value.forEach((item, index) => {
item.processOrder = (index + 1) * 10;
});
//
checkedProdBaseRouteProcess.value = [];
}
};
/** 复选框选中数据 */
const handleProdBaseRouteProcessSelectionChange = (selection: any[]) => {
// checkedProdBaseRouteProcess.value
checkedProdBaseRouteProcess.value = selection.map(item => item.index);
// processId checkedProdBaseRouteProcess.value
checkedProdBaseRouteProcess.value = selection.map(item => item.processId);
};
const getProcessList = async () => {

@ -307,7 +307,7 @@ const initFormData: BaseShiftInfoForm = {
endTime: undefined,
endCrossFlag: undefined,
workHour: undefined,
activeFlag: undefined,
activeFlag: '1',
createDept: undefined,
createBy: undefined,
createTime: undefined,
@ -350,7 +350,7 @@ const data = reactive<PageData<BaseShiftInfoForm, BaseShiftInfoQuery>>({
shiftName: [
{ required: true, message: "班次名称不能为空", trigger: "blur" }
],
startTime: [
/* startTime: [
{ required: true, message: "开始时间不能为空", trigger: "blur" }
],
startCrossFlag: [
@ -361,7 +361,7 @@ const data = reactive<PageData<BaseShiftInfoForm, BaseShiftInfoQuery>>({
],
endCrossFlag: [
{ required: true, message: "结束跨天标识不能为空", trigger: "change" }
],
],*/
/* workHour: [
{ required: true, message: "标准工作时长不能为空", trigger: "blur" }
],*/

@ -244,7 +244,7 @@ const initFormData: BaseToolingInfoForm = {
materialCode: undefined,
weight: undefined,
remark: undefined,
activeFlag: undefined,
activeFlag: '1',
}
const data = reactive<PageData<BaseToolingInfoForm, BaseToolingInfoQuery>>({
form: {...initFormData},

@ -0,0 +1,408 @@
<template>
<div class='p-2'>
<transition :enter-active-class='proxy?.animate.searchAnimate.enter'
:leave-active-class='proxy?.animate.searchAnimate.leave'>
<div v-show='showSearch' class='mb-[10px]'>
<el-card shadow='hover'>
<el-form ref='queryFormRef' :model='queryParams' :inline='true'>
<el-form-item label='物料名称' prop='materialName'>
<el-input v-model='queryParams.materialName' placeholder='请输入物料名称' clearable @keyup.enter='handleQuery' />
</el-form-item>
<!-- <el-form-item label='顶级标识' prop='topFlag'>-->
<!-- <el-input v-model='queryParams.topFlag' placeholder='请输入顶级标识' clearable-->
<!-- @keyup.enter='handleQuery' />-->
<!-- </el-form-item>-->
<!-- <el-form-item label='校验类型' prop='checkType'>-->
<!-- <el-select v-model='queryParams.checkType' placeholder='请选择校验类型' clearable>-->
<!-- <el-option v-for='dict in mes_check_type' :key='dict.value' :label='dict.label' :value='dict.value' />-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item label='激活标识' prop='activeFlag'>
<el-input v-model='queryParams.activeFlag' placeholder='请输入激活标识' clearable @keyup.enter='handleQuery' />
</el-form-item>
<el-form-item>
<el-button type='primary' icon='Search' @click='handleQuery'>搜索</el-button>
<el-button icon='Refresh' @click='resetQuery'>重置</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</transition>
<el-card shadow='never'>
<template #header>
<el-row :gutter='10' class='mb8'>
<el-col :span='1.5'>
<el-button type='primary' plain icon='Plus' @click='handleAdd()' v-hasPermi="['mes:materialBom:add']">
</el-button>
</el-col>
<el-col :span='1.5'>
<el-button type='info' plain icon='Sort' @click='handleToggleExpandAll'>展开/折叠</el-button>
</el-col>
<right-toolbar v-model:showSearch='showSearch' @queryTable='getList'></right-toolbar>
</el-row>
</template>
<el-table
ref='materialBomTableRef'
v-loading='loading'
:data='materialBomList'
row-key='materialName'
:default-expand-all='isExpandAll'
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
>
<!-- <el-table-column label='主键标识' align='center' prop='materialBomId' />-->
<!-- <el-table-column label='父级标识' align='center' prop='parentId' />-->
<el-table-column label='物料ID' align='center' prop='materialId' />
<el-table-column label='物料名称' align='center' prop='materialName' />
<el-table-column label='bom说明' align='center' prop='materialBomDesc' />
<el-table-column label='bom版本' align='center' prop='materialBomVersion' />
<!-- <el-table-column label='祖级列表' align='center' prop='ancestors' />-->
<el-table-column label='标准数量' align='center' prop='standardAmount' />
<el-table-column label='顶级标识' align='center' prop='topFlag'>
<template #default='scope'>
<dict-tag :options='active_flag' :value='scope.row.topFlag' />
</template>
</el-table-column>
<el-table-column label='校验类型' align='center' prop='checkType'>
<template #default='scope'>
<dict-tag :options='mes_check_type' :value='scope.row.checkType' />
</template>
</el-table-column>
<!-- <el-table-column label='项目ID' align='center' prop='projectId' />-->
<!-- <el-table-column label='装配时长(秒)' align='center' prop='assembleTime' />-->
<el-table-column label='物料分类' align='center' prop='materialClassfication'>
<template #default='scope'>
<dict-tag :options='material_classfication' :value='scope.row.materialClassfication' />
</template>
</el-table-column>
<!-- <el-table-column label='附件信息' align='center' prop='attachId' />-->
<el-table-column label='激活标识' align='center' prop='activeFlag'>
<template #default='scope'>
<dict-tag :options='active_flag' :value='scope.row.activeFlag' />
</template>
</el-table-column>
<el-table-column label='备注' align='center' prop='remark' />
<!-- <el-table-column label='创建部门' align='center' prop='createDept' />-->
<!-- <el-table-column label='创建人' align='center' prop='createBy' />-->
<!-- <el-table-column label='创建时间' align='center' prop='createTime' width='180'>-->
<!-- <template #default='scope'>-->
<!-- <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<!-- <el-table-column label='更新人' align='center' prop='updateBy' />-->
<!-- <el-table-column label='更新时间' align='center' prop='updateTime' width='180'>-->
<!-- <template #default='scope'>-->
<!-- <span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label='操作' align='center' class-name='small-padding fixed-width'>
<template #default='scope'>
<el-tooltip content='修改' placement='top'>
<el-button link type='primary' icon='Edit' @click='handleUpdate(scope.row)'
v-hasPermi="['mes:materialBom:edit']" />
</el-tooltip>
<el-tooltip content='新增' placement='top'>
<el-button link type='primary' icon='Plus' @click='handleAdd(scope.row)'
v-hasPermi="['mes:materialBom:add']" />
</el-tooltip>
<el-tooltip content='删除' placement='top'>
<el-button link type='primary' icon='Delete' @click='handleDelete(scope.row)'
v-hasPermi="['mes:materialBom:remove']" />
</el-tooltip>
</template>
</el-table-column>
</el-table>
</el-card>
<!-- 添加或修改物料BOM信息对话框 -->
<el-dialog :title='dialog.title' v-model='dialog.visible' width='500px' append-to-body>
<el-form ref='materialBomFormRef' :model='form' :rules='rules' label-width='80px'>
<el-form-item label='父级标识' prop='parentId'>
<el-tree-select
v-model='form.parentId'
:data='materialBomOptions'
:props="{ value: 'materialBomId', label: 'materialName', children: 'children' }"
value-key='materialBomId'
placeholder='请选择父级标识'
check-strictly
/>
</el-form-item>
<el-form-item label='物料ID' prop='materialId'>
<el-input v-model='form.materialId' placeholder='请输入物料ID' />
</el-form-item>
<el-form-item label='物料名称' prop='materialName'>
<el-input v-model='form.materialName' placeholder='请输入物料名称' />
</el-form-item>
<el-form-item label='bom说明' prop='materialBomDesc'>
<el-input v-model='form.materialBomDesc' placeholder='请输入bom说明' />
</el-form-item>
<el-form-item label='bom版本' prop='materialBomVersion'>
<el-input v-model='form.materialBomVersion' placeholder='请输入bom版本' />
</el-form-item>
<!-- <el-form-item label='祖级列表' prop='ancestors'>-->
<!-- <el-input v-model='form.ancestors' placeholder='请输入祖级列表' />-->
<!-- </el-form-item>-->
<el-form-item label='标准数量' prop='standardAmount'>
<el-input-number v-model='form.standardAmount' placeholder='请输入标准数量' />
</el-form-item>
<!-- <el-form-item label='顶级标识' prop='topFlag'>-->
<!-- <el-input v-model='form.topFlag' placeholder='请输入顶级标识' />-->
<!-- </el-form-item>-->
<el-form-item label='校验类型' prop='checkType'>
<el-radio-group v-model='form.checkType'>
<el-radio
v-for='dict in mes_check_type'
:key='dict.value'
:value='dict.value'
>{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<!-- <el-form-item label='项目ID' prop='projectId'>-->
<!-- <el-input v-model='form.projectId' placeholder='请输入项目ID' />-->
<!-- </el-form-item>-->
<!-- <el-form-item label='装配时长(秒)' prop='assembleTime'>-->
<!-- <el-input v-model='form.assembleTime' placeholder='请输入装配时长(秒)' />-->
<!-- </el-form-item>-->
<!-- <el-form-item label='物料分类' prop='materialClassfication'>-->
<!-- <el-radio-group v-model='form.materialClassfication'>-->
<!-- <el-radio-->
<!-- v-for='dict in material_classfication'-->
<!-- :key='dict.value'-->
<!-- :value='dict.value'-->
<!-- >{{ dict.label }}-->
<!-- </el-radio>-->
<!-- </el-radio-group>-->
<!-- </el-form-item>-->
<!-- <el-form-item label='附件信息' prop='attachId'>-->
<!-- <el-input v-model='form.attachId' placeholder='请输入附件信息' />-->
<!-- </el-form-item>-->
<el-form-item label='激活标识' prop='activeFlag'>
<el-radio-group v-model='form.activeFlag'>
<el-radio
v-for='dict in active_flag'
:key='dict.value'
:value='dict.value'
>{{ dict.label }}
</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label='备注' prop='remark'>
<el-input v-model='form.remark' placeholder='请输入备注' />
</el-form-item>
</el-form>
<template #footer>
<div class='dialog-footer'>
<el-button :loading='buttonLoading' type='primary' @click='submitForm'> </el-button>
<el-button @click='cancel'> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name='MaterialBom' lang='ts'>
import {
listMaterialBom,
getMaterialBom,
delMaterialBom,
addMaterialBom,
updateMaterialBom
} from '@/api/mes/materialBom';
import { MaterialBomVO, MaterialBomQuery, MaterialBomForm } from '@/api/mes/materialBom/types';
type MaterialBomOption = {
materialBomId: number;
materialName: string;
children?: MaterialBomOption[];
}
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
;
const { mes_check_type, material_classfication, active_flag } = toRefs<any>(proxy?.useDict('mes_check_type', 'material_classfication', 'active_flag'));
const materialBomList = ref([]);
const materialBomOptions = ref<MaterialBomOption[]>([]);
const buttonLoading = ref(false);
const showSearch = ref(true);
const isExpandAll = ref(true);
const loading = ref(false);
const queryFormRef = ref<ElFormInstance>();
const materialBomFormRef = ref<ElFormInstance>();
const materialBomTableRef = ref<ElTableInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
const initFormData: MaterialBomForm = {
materialBomId: undefined,
parentId: undefined,
materialId: undefined,
materialName: undefined,
materialBomDesc: undefined,
materialBomVersion: undefined,
ancestors: undefined,
standardAmount: undefined,
topFlag: undefined,
checkType: '1',
projectId: undefined,
assembleTime: undefined,
materialClassfication: undefined,
attachId: undefined,
activeFlag: '1',
remark: undefined
};
const data = reactive<PageData<MaterialBomForm, MaterialBomQuery>>({
form: { ...initFormData },
queryParams: {
materialBomId: undefined,
parentId: undefined,
materialId: undefined,
materialName: undefined,
materialBomDesc: undefined,
materialBomVersion: undefined,
ancestors: undefined,
standardAmount: undefined,
topFlag: undefined,
checkType: undefined,
projectId: undefined,
assembleTime: undefined,
materialClassfication: undefined,
attachId: undefined,
activeFlag: undefined,
params: {}
},
rules: {
materialBomId: [
{ required: true, message: '主键标识不能为空', trigger: 'blur' }
],
parentId: [
{ required: true, message: '父级标识不能为空', trigger: 'blur' }
],
materialId: [
{ required: true, message: '物料ID不能为空', trigger: 'blur' }
]
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询物料BOM信息列表 */
const getList = async () => {
loading.value = true;
const res = await listMaterialBom(queryParams.value);
const data = proxy?.handleTree<MaterialBomVO>(res.data, 'materialBomId', 'parentId');
if (data) {
materialBomList.value = data;
loading.value = false;
}
};
/** 查询物料BOM信息下拉树结构 */
const getTreeselect = async () => {
const res = await listMaterialBom();
materialBomOptions.value = [];
const data: MaterialBomOption = { materialBomId: 0, materialName: '顶级节点', children: [] };
data.children = proxy?.handleTree<MaterialBomOption>(res.data, 'materialBomId', 'parentId');
materialBomOptions.value.push(data);
};
//
const cancel = () => {
reset();
dialog.visible = false;
};
//
const reset = () => {
form.value = { ...initFormData };
materialBomFormRef.value?.resetFields();
};
/** 搜索按钮操作 */
const handleQuery = () => {
getList();
};
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
};
/** 新增按钮操作 */
const handleAdd = (row?: MaterialBomVO) => {
reset();
getTreeselect();
if (row != null && row.materialBomId) {
form.value.parentId = row.materialBomId;
} else {
form.value.parentId = 0;
}
dialog.visible = true;
dialog.title = '添加物料BOM信息';
};
/** 展开/折叠操作 */
const handleToggleExpandAll = () => {
isExpandAll.value = !isExpandAll.value;
toggleExpandAll(materialBomList.value, isExpandAll.value);
};
/** 展开/折叠操作 */
const toggleExpandAll = (data: MaterialBomVO[], status: boolean) => {
data.forEach((item) => {
materialBomTableRef.value?.toggleRowExpansion(item, status);
if (item.children && item.children.length > 0) toggleExpandAll(item.children, status);
});
};
/** 修改按钮操作 */
const handleUpdate = async (row: MaterialBomVO) => {
reset();
await getTreeselect();
if (row != null) {
form.value.parentId = row.parentId;
}
const res = await getMaterialBom(row.materialBomId);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = '修改物料BOM信息';
};
/** 提交按钮 */
const submitForm = () => {
materialBomFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.materialBomId) {
await updateMaterialBom(form.value).finally(() => buttonLoading.value = false);
} else {
await addMaterialBom(form.value).finally(() => buttonLoading.value = false);
}
proxy?.$modal.msgSuccess('操作成功');
dialog.visible = false;
getList();
}
});
};
/** 删除按钮操作 */
const handleDelete = async (row: MaterialBomVO) => {
await proxy?.$modal.confirm('是否确认删除物料BOM信息编号为"' + row.materialBomId + '"的数据项?');
loading.value = true;
await delMaterialBom(row.materialBomId).finally(() => loading.value = false);
await getList();
proxy?.$modal.msgSuccess('删除成功');
};
onMounted(() => {
getList();
});
</script>

@ -169,7 +169,7 @@ const initFormData: DictDataForm = {
dictLabel: '',
dictValue: '',
cssClass: '',
listClass: 'primary',
listClass: 'default',
dictSort: 0,
remark: ''
};

@ -63,11 +63,23 @@
<el-table-column label="表主键" align="center" prop="configurationId" v-if="columns[0].visible"/>
<el-table-column label="节点代码" align="center" prop="nodeCode" v-if="columns[3].visible"/>
<el-table-column label="节点名称" align="center" prop="nodeName" v-if="columns[4].visible"/>
<el-table-column label="审批是否" align="center" prop="approveYesNo" v-if="columns[5].visible"/>
<el-table-column label="审批类型" align="center" prop="approveType" v-if="columns[6].visible"/>
<el-table-column label="审批是否" align="center" prop="approveYesNo" v-if="columns[5].visible">
<template #default="scope">
<dict-tag :options="wms_approve" :value="scope.row.approveYesNo"/>
</template>
</el-table-column>
<el-table-column label="审批类型" align="center" prop="approveType" v-if="columns[6].visible">
<template #default="scope">
<dict-tag :options="approve_type" :value="scope.row.approveType"/>
</template>
</el-table-column>
<el-table-column label="审批代码" align="center" prop="approveRoleCode" v-if="columns[7].visible"/>
<el-table-column label="仓库ID" align="center" prop="warehouseId" v-if="columns[8].visible"/>
<el-table-column label="审批范围" align="center" prop="approveRange" v-if="columns[9].visible"/>
<el-table-column label="仓库" align="center" prop="warehouseCode" v-if="columns[8].visible"/>
<el-table-column label="审批范围" align="center" prop="approveRange" v-if="columns[9].visible">
<template #default="scope">
<dict-tag :options="approve_range" :value="scope.row.approveRange"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="修改" placement="top">
@ -94,9 +106,15 @@
<el-form-item label="节点名称" prop="nodeName">
<el-input v-model="form.nodeName" placeholder="请输入节点名称" />
</el-form-item>
<el-form-item label="审批是否" prop="approveYesNo">
<el-input v-model="form.approveYesNo" placeholder="请输入审批是否" />
</el-form-item>
<!-- <el-form-item label="审批是否" prop="approveYesNo">
<el-radio-group v-model="form.approveYesNo">
<el-radio
v-for="dict in dict.type.dms_inspect_level"
:key="dict.value"
:label="parseInt(dict.value)"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item> -->
<el-form-item label="审批类型" prop="approveType">
<el-select v-model="form.approveType" placeholder="请选择审批类型">
<el-option
@ -111,10 +129,24 @@
<el-input v-model="form.approveRoleCode" placeholder="请输入审批代码" />
</el-form-item>
<el-form-item label="仓库ID" prop="warehouseId">
<el-input v-model="form.warehouseId" placeholder="请输入仓库ID" />
<el-select v-model="form.warehouseId" placeholder="请选择所属仓库">
<el-option
v-for="item in baseStoreList"
:key="item.warehouseId"
:label="item.warehouseName"
:value="item.warehouseId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="审批范围" prop="approveRange">
<el-input v-model="form.approveRange" placeholder="请输入审批范围" />
<el-select v-model="form.approveRange" placeholder="审批范围">
<el-option
v-for='dict in approve_range'
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
</el-form>
<template #footer>
@ -130,9 +162,11 @@
<script setup name="Configuration" lang="ts">
import { listConfiguration, getConfiguration, delConfiguration, addConfiguration, updateConfiguration } from '@/api/wms/configuration';
import { ConfigurationVO, ConfigurationQuery, ConfigurationForm } from '@/api/wms/configuration/types';
import {getBaseWarehouseList} from "@/api/wms/baseWarehouse";
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { approve_type } = toRefs<any>(proxy?.useDict('approve_type'));
const { wms_approve } = toRefs<any>(proxy?.useDict('wms_approve'));
const { approve_range } = toRefs<any>(proxy?.useDict('approve_range'));
const configurationList = ref<ConfigurationVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
@ -141,7 +175,7 @@ const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
let locationList = ref([]);
const queryFormRef = ref<ElFormInstance>();
const configurationFormRef = ref<ElFormInstance>();
@ -219,7 +253,12 @@ const data = reactive<PageData<ConfigurationForm, ConfigurationQuery>>({
});
const { queryParams, form, rules } = toRefs(data);
let baseStoreList = ref([]);
/** 查询车间下拉树结构 */
const getBaseWarehouseListsss = async () => {
let res = await getBaseWarehouseList(null);
baseStoreList.value = res.data;
};
/** 查询仓库模块配置列表 */
const getList = async () => {
loading.value = true;
@ -228,6 +267,11 @@ const getList = async () => {
total.value = res.total;
loading.value = false;
}
/** 查询仓库下拉树结构 */
const getWorkshopListSelect = async () => {
// let res = await getWorkshopList(null);
// locationList.value = res.data;
};
/** 取消按钮 */
const cancel = () => {
@ -306,12 +350,13 @@ const handleDelete = async (row?: ConfigurationVO) => {
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download('system/configuration/export', {
proxy?.download('wms/configuration/export', {
...queryParams.value
}, `configuration_${new Date().getTime()}.xlsx`)
}
onMounted(() => {
getBaseWarehouseListsss();
getList();
});
</script>

@ -0,0 +1,422 @@
<template>
<div class="p-2">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<!-- <el-form-item label="入库单子表主键" prop="instockDetailId">
<el-input v-model="queryParams.instockDetailId" placeholder="请输入入库单子表主键" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="入库单 主键" prop="instockId">
<el-input v-model="queryParams.instockId" placeholder="请输入入库单 主键" clearable @keyup.enter="handleQuery" />
</el-form-item> -->
<!-- <el-form-item label="入库单号" prop="instockCode">
<el-input v-model="queryParams.instockCode" placeholder="请输入入库单号" clearable @keyup.enter="handleQuery" />
</el-form-item> -->
<el-form-item label="送货-物料表主键" prop="dnDId">
<el-input v-model="queryParams.dnDId" placeholder="请输入送货-物料表主键" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="采购-物料表主键" prop="poDId">
<el-input v-model="queryParams.poDId" placeholder="请输入采购-物料表主键" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="物料id" prop="materialId">
<el-input v-model="queryParams.materialId" placeholder="请输入物料id" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="物料编码" prop="materialCode">
<el-input v-model="queryParams.materialCode" placeholder="请输入物料编码" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="物料名称" prop="materialName">
<el-input v-model="queryParams.materialName" placeholder="请输入物料名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="入库数量" prop="instockQty">
<el-input v-model="queryParams.instockQty" placeholder="请输入入库数量" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="物料规格" prop="materialSpe">
<el-input v-model="queryParams.materialSpe" placeholder="请输入物料规格" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="计量单位名称" prop="unitName">
<el-input v-model="queryParams.unitName" placeholder="请输入计量单位名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="是否有条码" prop="codeYesNo">
<el-input v-model="queryParams.codeYesNo" placeholder="请输入是否有条码" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="物料大类" prop="materialCategories">
<el-input v-model="queryParams.materialCategories" placeholder="请输入物料大类" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</transition>
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:instockDetail:add']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:instockDetail:edit']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:instockDetail:remove']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['system:instockDetail:export']"></el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" :columns="columns" :search="true" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" :data="instockDetailList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="入库单子表主键" align="center" prop="instockDetailId" v-if="columns[0].visible"/>
<el-table-column label="入库单 主键" align="center" prop="instockId" v-if="columns[1].visible"/> -->
<!-- <el-table-column label="入库单号" align="center" prop="instockCode" v-if="columns[2].visible"/> -->
<!-- <el-table-column label="送货-物料表主键" align="center" prop="dnDId" v-if="columns[4].visible"/>
<el-table-column label="采购-物料表主键" align="center" prop="poDId" v-if="columns[5].visible"/> -->
<!-- <el-table-column label="物料id" align="center" prop="materialId" v-if="columns[6].visible"/> -->
<el-table-column label="物料编码" align="center" prop="materialCode" v-if="columns[7].visible"/>
<el-table-column label="物料名称" align="center" prop="materialName" v-if="columns[8].visible"/>
<el-table-column label="入库数量" align="center" prop="instockQty" v-if="columns[9].visible"/>
<el-table-column label="已分包数量" align="center" prop="printedNum" />
<el-table-column label="物料规格" align="center" prop="materialSpe" v-if="columns[10].visible"/>
<el-table-column label="计量单位名称" align="center" prop="unitName" v-if="columns[11].visible"/>
<el-table-column label="是否有条码" align="center" prop="codeYesNo" v-if="columns[12].visible">
<template #default="scope">
<dict-tag :options="wms_barcode_if" :value="scope.row.codeYesNo"/>
</template>
</el-table-column>
<el-table-column label="物料大类" align="center" prop="materialCategories" v-if="columns[13].visible">
<template #default="scope">
<dict-tag :options="material_mategories" :value="scope.row.materialCategories"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:instockDetail:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:instockDetail:remove']"></el-button>
</el-tooltip>
<el-tooltip content="打印" placement="top">
<el-button link type="primary" icon="Check" @click="handlePrint(scope.row)"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改入库单-物料对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="instockDetailFormRef" :model="form" :rules="rules" label-width="80px">
<!-- <el-form-item label="送货物料" :disabled="true" prop="dnDId" >
<el-input v-model="form.dnDId" placeholder="请输入送货-物料表主键" />
</el-form-item>
<el-form-item label="采购物料" prop="poDId">
<el-input v-model="form.poDId" placeholder="请输入采购-物料表主键" />
</el-form-item> -->
<el-form-item label="物料" prop="materialId">
<el-select v-model="form.materialId" placeholder="请选择物料">
<el-option
v-for="item in materialList"
:key="item.materialId"
:label="item.materialCode"
:value="item.materialId"
/>
</el-select>
</el-form-item>
<el-form-item label="入库数量" prop="instockQty">
<el-input v-model="form.instockQty" placeholder="请输入入库数量" />
</el-form-item>
<el-form-item label="有无条码" prop="codeYesNo">
<el-radio-group v-model="form.codeYesNo">
<el-radio
v-for="dict in wms_barcode_if"
:key="dict.value"
:value="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="已包数量" prop="printedNum" v-if="ifPrint">
<el-input v-model="form.printedNum" placeholder="" />
</el-form-item>
<el-form-item label="分包数量" prop="printNum" v-if="ifPrint">
<el-input v-model="form.printNum" placeholder="请输入分包数量" />
</el-form-item>
<el-form-item label="打印数量" prop="barcodeNum" v-if="ifPrint">
<el-input v-model="form.barcodeNum" placeholder="请输入打印条码数量" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="InstockDetail" lang="ts">
import { listInstockDetail, getInstockDetail, delInstockDetail, addInstockDetail, updateInstockDetail, getMaterialListVo } from '@/api/wms/instockDetail';
import { InstockDetailVO, InstockDetailQuery, InstockDetailForm } from '@/api/wms/instockDetail/types';
import { Printer } from '@element-plus/icons-vue';
import { useRoute } from 'vue-router';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { material_mategories, wms_barcode_if } = toRefs<any>(proxy?.useDict('material_mategories', 'wms_barcode_if'));
const router = useRoute();
const instockDetailList = ref<InstockDetailVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
let materialCode = ref('');
let ifPrint = ref(false);
const materialList = ref([]);
const queryFormRef = ref<ElFormInstance>();
const instockDetailFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
const printer = reactive<DialogOption>({
visible: false,
title: ''
});
//
const columns = ref<FieldOption[]>([
{ key: 0, label: `入库单子表主键`, visible: true },
{ key: 1, label: `入库单 主键`, visible: true },
{ key: 2, label: `入库单号`, visible: true },
{ key: 3, label: `创建时间`, visible: true },
{ key: 4, label: `送货-物料表主键`, visible: true },
{ key: 5, label: `采购-物料表主键`, visible: true },
{ key: 6, label: `物料id`, visible: true },
{ key: 7, label: `物料编码`, visible: true },
{ key: 8, label: `物料名称`, visible: true },
{ key: 9, label: `入库数量`, visible: true },
{ key: 10, label: `物料规格`, visible: true },
{ key: 11, label: `计量单位名称`, visible: true },
{ key: 12, label: `是否有条码`, visible: true },
{ key: 13, label: `物料大类`, visible: true },
]);
const initFormData: InstockDetailForm = {
instockDetailId: undefined,
instockId: undefined,
instockCode: undefined,
dnDId: undefined,
poDId: undefined,
materialId: undefined,
materialCode: undefined,
materialName: undefined,
instockQty: undefined,
materialSpe: undefined,
unitName: undefined,
codeYesNo: undefined,
materialCategories: undefined
}
const data = reactive<PageData<InstockDetailForm, InstockDetailQuery>>({
form: {...initFormData},
queryParams: {
pageNum: 1,
pageSize: 10,
instockDetailId: undefined,
instockId: undefined,
instockCode: undefined,
dnDId: undefined,
poDId: undefined,
materialId: undefined,
materialCode: undefined,
materialName: undefined,
instockQty: undefined,
materialSpe: undefined,
unitName: undefined,
codeYesNo: undefined,
materialCategories: undefined,
params: {
}
},
rules: {
dnDId: [
{ required: true, message: "送货-物料表主键不能为空", trigger: "blur" }
],
poDId: [
{ required: true, message: "采购-物料表主键不能为空", trigger: "blur" }
],
materialId: [
{ required: true, message: "物料id不能为空", trigger: "blur" }
],
// materialCode: [
// { required: true, message: "", trigger: "blur" }
// ],
// materialName: [
// { required: true, message: "", trigger: "blur" }
// ],
instockQty: [
{ required: true, message: "入库数量不能为空", trigger: "blur" }
],
// materialSpe: [
// { required: true, message: "", trigger: "blur" }
// ],
// unitName: [
// { required: true, message: "", trigger: "blur" }
// ],
codeYesNo: [
{ required: true, message: "是否有条码不能为空", trigger: "blur" }
],
// materialCategories: [
// { required: true, message: "", trigger: "blur" }
// ]
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询入库单-物料列表 */
const getList = async () => {
queryParams.value.instockId = router.query.instockId;
console.log(queryParams);
loading.value = true;
const res = await listInstockDetail(queryParams.value);
instockDetailList.value = res.rows;
total.value = res.total;
loading.value = false;
}
/** 查询入库单大类下物料列表 */
const getMaterialList = async () => {
const materialCategories = router.query.materialCategories
const res = await getMaterialListVo({'materialCategories':materialCategories});
console.log(res.data);
materialList.value = res.data;
}
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
ifPrint.value = false;
}
/** 表单重置 */
const reset = () => {
form.value = {...initFormData};
instockDetailFormRef.value?.resetFields();
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
}
/** 多选框选中数据 */
const handleSelectionChange = (selection: InstockDetailVO[]) => {
ids.value = selection.map(item => item.instockDetailId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = "添加入库单-物料";
}
/** 修改按钮操作 */
const handleUpdate = async (row?: InstockDetailVO) => {
reset();
const _instockDetailId = row?.instockDetailId || ids.value[0]
const res = await getInstockDetail(_instockDetailId);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = "修改入库单-物料";
}
/** 打印按钮操作 */
const handlePrint = async (row?: InstockDetailVO) => {
reset();
const _instockDetailId = row?.instockDetailId || ids.value[0]
const res = await getInstockDetail(_instockDetailId);
Object.assign(form.value, res.data);
dialog.visible = true;
ifPrint.value = true;
dialog.title = "修改入库单-打印";
}
/** 提交按钮 */
const submitForm = () => {
instockDetailFormRef.value?.validate(async (valid: boolean) => {
form.value.materialCategories = router.query.materialCategories;
form.value.instockId = router.query.instockId;
form.value.instockCode = router.query.instockCode;
if (valid) {
buttonLoading.value = true;
if (form.value.instockDetailId) {
await updateInstockDetail(form.value).finally(() => buttonLoading.value = false);
} else {
await addInstockDetail(form.value).finally(() => buttonLoading.value = false);
}
proxy?.$modal.msgSuccess("操作成功");
dialog.visible = false;
ifPrint.value = false;
await getList();
}
});
}
/** 提交打印按钮 */
const submitPrintForm = () => {
instockDetailFormRef.value?.validate(async (valid: boolean) => {
form.value.instockId = router.query.instockId;
buttonLoading.value = true;
await updateInstockDetail(form.value).finally(() => buttonLoading.value = false);
proxy?.$modal.msgSuccess("操作成功");
printer.visible = false;
await getList();
});
}
/** 删除按钮操作 */
const handleDelete = async (row?: InstockDetailVO) => {
const _instockDetailIds = row?.instockDetailId || ids.value;
await proxy?.$modal.confirm('是否确认删除入库单-物料编号为"' + _instockDetailIds + '"的数据项?').finally(() => loading.value = false);
await delInstockDetail(_instockDetailIds);
proxy?.$modal.msgSuccess("删除成功");
await getList();
}
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download('system/instockDetail/export', {
...queryParams.value
}, `instockDetail_${new Date().getTime()}.xlsx`)
}
onMounted(() => {
getMaterialList();
const materialCategories = router.query.materialCategories
console.log(materialCategories)
getList();
});
</script>

@ -0,0 +1,433 @@
<template>
<div class="p-2">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<!-- <el-form-item label="入库单 主键" prop="instockId">
<el-input v-model="queryParams.instockId" placeholder="请输入入库单 主键" clearable @keyup.enter="handleQuery" />
</el-form-item> -->
<el-form-item label="入库单号" prop="instockCode">
<el-input v-model="queryParams.instockCode" placeholder="请输入入库单号" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="物料大类" prop="materialCategories">
<el-input v-model="queryParams.materialCategories" placeholder="请输入物料大类" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="工单类型" prop="instockType">
<el-select v-model="queryParams.instockType" placeholder="请选择工单类型(1采购订单,2生产订单,3手工,4系统生成)" clearable >
<el-option v-for="dict in wms_instock_type" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item label="订单编号" prop="orderNo">
<el-input v-model="queryParams.orderNo" placeholder="请输入订单编号" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="审核人" prop="auditBy">
<el-input v-model="queryParams.auditBy" placeholder="请输入审核人" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="审核时间" prop="auditTime">
<el-date-picker clearable
v-model="queryParams.auditTime"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择审核时间"
/>
</el-form-item>
<el-form-item label="审核状态" prop="auditStatus">
<el-select v-model="queryParams.auditStatus" placeholder="请选择审核状态(0待审核,1审核通过,2审核未通过)" clearable >
<el-option v-for="dict in wms_instock_type" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item label="审核意见" prop="auditComments">
<el-input v-model="queryParams.auditComments" placeholder="请输入审核意见" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="仓库ID" prop="warehouseId">
<el-select v-model="form.warehouseId" placeholder="请选择所属仓库">
<el-option
v-for="item in baseStoreList"
:key="item.warehouseId"
:label="item.warehouseName"
:value="item.warehouseId"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</transition>
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['wms:instockOrder:add']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['wms:instockOrder:edit']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['wms:instockOrder:remove']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['wms:instockOrder:export']"></el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" :columns="columns" :search="true" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" :data="instockOrderList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="入库单 主键" align="center" prop="instockId" v-if="columns[0].visible"/>
<el-table-column label="入库单号" align="center" prop="instockCode" v-if="columns[1].visible"/>
<el-table-column label="物料大类" align="center" prop="materialCategories" v-if="columns[7].visible">
<template #default="scope">
<dict-tag :options="material_mategories" :value="scope.row.materialCategories"/>
</template>
</el-table-column>
<el-table-column label="工单类型" align="center" prop="instockType" v-if="columns[8].visible">
<template #default="scope">
<dict-tag :options="wms_instock_type" :value="scope.row.instockType"/>
</template>
</el-table-column>
<el-table-column label="订单编号" align="center" prop="orderNo" v-if="columns[9].visible"/>
<el-table-column label="审核人" align="center" prop="auditBy" v-if="columns[10].visible"/>
<el-table-column label="审核时间" align="center" prop="auditTime" width="180" v-if="columns[11].visible">
<template #default="scope">
<span>{{ parseTime(scope.row.auditTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="审核状态" align="center" prop="auditStatus" v-if="columns[12].visible">
<template #default="scope">
<dict-tag :options="approve_status" :value="scope.row.auditStatus"/>
</template>
</el-table-column>
<el-table-column label="审核意见" align="center" prop="auditComments" v-if="columns[13].visible"/>
<el-table-column label="仓库ID" align="center" prop="warehouseCode" v-if="columns[14].visible"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['wms:instockOrder:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['wms:instockOrder:remove']"></el-button>
</el-tooltip>
<el-tooltip content="详情" placement="top">
<el-button link type="primary" icon="Star" @click="HandleInfo(scope.row)"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改入库单对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="instockOrderFormRef" :model="form" :rules="rules" label-width="80px">
<!-- <el-form-item label="入库单 主键" prop="instockId">
<el-input v-model="form.instockId" placeholder="请输入入库单 主键" />
</el-form-item> -->
<!-- <el-form-item label="入库单号" prop="instockCode">
<el-input v-model="form.instockCode" placeholder="请输入入库单号" />
</el-form-item> -->
<el-form-item label="物料大类" prop="materialCategories">
<el-select v-model="form.materialCategories" placeholder="请选择物料大类">
<el-option
v-for="dict in material_mategories"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="工单类型" prop="instockType">
<el-select v-model="form.instockType" placeholder="请选择工单类型(1采购订单,2生产订单,3手工,4系统生成)">
<el-option
v-for="dict in wms_instock_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<!-- <el-form-item label="订单编号" prop="orderNo">
<el-input v-model="form.orderNo" placeholder="请输入订单编号" />
</el-form-item> -->
<el-form-item label="审核人" prop="auditBy">
<el-select v-model="form.auditBy" placeholder="请选择审核人">
<el-option
v-for="item in userList"
:key="item.userId"
:label="item.userName"
:value="item.userName"
/>
</el-select>
</el-form-item>
<!-- <el-form-item label="审核时间" prop="auditTime">
<el-date-picker clearable
v-model="form.auditTime"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
placeholder="请选择审核时间">
</el-date-picker>
</el-form-item>
<el-form-item label="审核状态" prop="auditStatus">
<el-radio-group v-model="form.auditStatus">
<el-radio
v-for="dict in wms_instock_type"
:key="dict.value"
:value="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="审核意见" prop="auditComments">
<el-input v-model="form.auditComments" placeholder="请输入审核意见" />
</el-form-item> -->
<el-form-item label="仓库ID" prop="warehouseId">
<el-select v-model="form.warehouseId" placeholder="请选择所属仓库">
<el-option
v-for="item in baseStoreList"
:key="item.warehouseId"
:label="item.warehouseName"
:value="item.warehouseId"
></el-option>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="InstockOrder" lang="ts">
import api from '@/api/system/user';
import { UserForm, UserQuery, UserVO } from '@/api/system/user/types';
import { listInstockOrder, getInstockOrder, delInstockOrder, addInstockOrder, updateInstockOrder } from '@/api/wms/instockOrder';
import { InstockOrderVO, InstockOrderQuery, InstockOrderForm } from '@/api/wms/instockOrder/types';
import { useRouter } from 'vue-router';
import {getBaseWarehouseList} from "@/api/wms/baseWarehouse";
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { wms_instock_type, approve_status, material_mategories } = toRefs<any>(proxy?.useDict('wms_instock_type', 'approve_status', 'material_mategories'));
const instockOrderList = ref<InstockOrderVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
let router = useRouter();
const queryFormRef = ref<ElFormInstance>();
const instockOrderFormRef = ref<ElFormInstance>();
const userList = ref<UserVO[]>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
//
const columns = ref<FieldOption[]>([
{ key: 0, label: `入库单 主键`, visible: true },
{ key: 1, label: `入库单号`, visible: true },
{ key: 2, label: `租户号`, visible: true },
{ key: 3, label: `创建人`, visible: true },
{ key: 4, label: `创建时间`, visible: true },
{ key: 5, label: `更新人`, visible: true },
{ key: 6, label: `更新时间`, visible: true },
{ key: 7, label: `物料大类`, visible: true },
{ key: 8, label: `工单类型(1采购订单,2生产订单,3手工,4系统生成)`, visible: true },
{ key: 9, label: `订单编号`, visible: true },
{ key: 10, label: `审核人`, visible: true },
{ key: 11, label: `审核时间`, visible: true },
{ key: 12, label: `审核状态(0待审核,1审核通过,2审核未通过)`, visible: true },
{ key: 13, label: `审核意见`, visible: true },
{ key: 14, label: `仓库ID`, visible: true },
]);
const initFormData: InstockOrderForm = {
instockId: undefined,
instockCode: undefined,
materialCategories: undefined,
instockType: undefined,
orderNo: undefined,
auditBy: undefined,
auditTime: undefined,
auditStatus: undefined,
auditComments: undefined,
warehouseId: undefined
}
const data = reactive<PageData<InstockOrderForm, InstockOrderQuery>>({
form: {...initFormData},
queryParams: {
pageNum: 1,
pageSize: 10,
instockId: undefined,
instockCode: undefined,
materialCategories: undefined,
instockType: undefined,
orderNo: undefined,
auditBy: undefined,
auditTime: undefined,
auditStatus: undefined,
auditComments: undefined,
warehouseId: undefined,
params: {
}
},
rules: {
instockId: [
{ required: true, message: "入库单 主键不能为空", trigger: "blur" }
],
instockCode: [
{ required: true, message: "入库单号不能为空", trigger: "blur" }
],
materialCategories: [
{ required: true, message: "物料大类不能为空", trigger: "blur" }
],
instockType: [
{ required: true, message: "工单类型(1采购订单,2生产订单,3手工,4系统生成)不能为空", trigger: "change" }
],
orderNo: [
{ required: true, message: "订单编号不能为空", trigger: "blur" }
],
auditBy: [
{ required: true, message: "审核人不能为空", trigger: "blur" }
],
auditTime: [
{ required: true, message: "审核时间不能为空", trigger: "blur" }
],
auditStatus: [
{ required: true, message: "审核状态(0待审核,1审核通过,2审核未通过)不能为空", trigger: "change" }
],
auditComments: [
{ required: true, message: "审核意见不能为空", trigger: "blur" }
],
warehouseId: [
{ required: true, message: "仓库ID不能为空", trigger: "blur" }
]
}
});
const { queryParams, form, rules } = toRefs(data);
let baseStoreList = ref([]);
/** 查询车间下拉树结构 */
const getBaseWarehouseListsss = async () => {
let res = await getBaseWarehouseList(null);
baseStoreList.value = res.data;
};
/** 查询用户列表 */
const getUserList = async () => {
const res = await api.listUser(null);
userList.value = res.rows;
};
/** 查询入库单列表 */
const getList = async () => {
loading.value = true;
const res = await listInstockOrder(queryParams.value);
instockOrderList.value = res.rows;
total.value = res.total;
loading.value = false;
}
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
}
/** 表单重置 */
const reset = () => {
form.value = {...initFormData};
instockOrderFormRef.value?.resetFields();
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
}
/** 多选框选中数据 */
const handleSelectionChange = (selection: InstockOrderVO[]) => {
ids.value = selection.map(item => item.instockId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = "添加入库单";
}
/** 修改按钮操作 */
const handleUpdate = async (row?: InstockOrderVO) => {
reset();
const _instockId = row?.instockId || ids.value[0]
const res = await getInstockOrder(_instockId);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = "修改入库单";
}
/** 提交按钮 */
const submitForm = () => {
instockOrderFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.instockId) {
await updateInstockOrder(form.value).finally(() => buttonLoading.value = false);
} else {
await addInstockOrder(form.value).finally(() => buttonLoading.value = false);
}
proxy?.$modal.msgSuccess("操作成功");
dialog.visible = false;
await getList();
}
});
}
/** 删除按钮操作 */
const handleDelete = async (row?: InstockOrderVO) => {
const _instockIds = row?.instockId || ids.value;
await proxy?.$modal.confirm('是否确认删除入库单编号为"' + _instockIds + '"的数据项?').finally(() => loading.value = false);
await delInstockOrder(_instockIds);
proxy?.$modal.msgSuccess("删除成功");
await getList();
}
const HandleInfo = async (row?: InstockOrderVO) => {
const instockId = row?.instockId;
const materialCategories = row?.materialCategories;
const instockCode = row?.instockCode;
router.push({
path: '/wms/instockDetail',query: {'instockId': instockId,'materialCategories': materialCategories,'instockCode':instockCode}
});
}
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download('wms/instockOrder/export', {
...queryParams.value
}, `instockOrder_${new Date().getTime()}.xlsx`)
}
onMounted(() => {
getBaseWarehouseListsss();
getUserList();
getList();
});
</script>

@ -0,0 +1,381 @@
<template>
<div class="p-2">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<el-form-item label="入库单子表主键" prop="instockPrintId">
<el-input v-model="queryParams.instockPrintId" placeholder="请输入入库单子表主键" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="入库单号" prop="instockCode">
<el-input v-model="queryParams.instockCode" placeholder="请输入入库单号" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="批次码" prop="batchCode">
<el-input v-model="queryParams.batchCode" placeholder="请输入批次码" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="条码数量" prop="materialQty">
<el-input v-model="queryParams.materialQty" placeholder="请输入条码数量" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="分包数量" prop="apportionQty">
<el-input v-model="queryParams.apportionQty" placeholder="请输入分包数量" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="物料id" prop="materialId">
<el-input v-model="queryParams.materialId" placeholder="请输入物料id" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="物料编码" prop="materialCode">
<el-input v-model="queryParams.materialCode" placeholder="请输入物料编码" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="物料名称" prop="materialName">
<el-input v-model="queryParams.materialName" placeholder="请输入物料名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="物料规格" prop="materialSpe">
<el-input v-model="queryParams.materialSpe" placeholder="请输入物料规格" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="计量单位名称" prop="unitName">
<el-input v-model="queryParams.unitName" placeholder="请输入计量单位名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="是否有条码" prop="codeYesNo">
<el-input v-model="queryParams.codeYesNo" placeholder="请输入是否有条码" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="物料大类" prop="materialCategories">
<el-input v-model="queryParams.materialCategories" placeholder="请输入物料大类" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</transition>
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:instockPrint:add']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:instockPrint:edit']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:instockPrint:remove']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['system:instockPrint:export']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handlePrint"></el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" :columns="columns" :search="true" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" :data="instockPrintList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="入库单子表主键" align="center" prop="instockPrintId" v-if="columns[0].visible"/>
<el-table-column label="入库单号" align="center" prop="instockCode" v-if="columns[1].visible"/>
<el-table-column label="批次码" align="center" prop="batchCode" v-if="columns[3].visible"/>
<el-table-column label="条码数量" align="center" prop="materialQty" v-if="columns[4].visible"/>
<el-table-column label="分包数量" align="center" prop="apportionQty" v-if="columns[5].visible"/>
<el-table-column label="物料id" align="center" prop="materialId" v-if="columns[6].visible"/>
<el-table-column label="物料编码" align="center" prop="materialCode" v-if="columns[7].visible"/>
<el-table-column label="物料名称" align="center" prop="materialName" v-if="columns[8].visible"/>
<el-table-column label="物料规格" align="center" prop="materialSpe" v-if="columns[9].visible"/>
<el-table-column label="计量单位名称" align="center" prop="unitName" v-if="columns[10].visible"/>
<el-table-column label="是否有条码" align="center" prop="codeYesNo" v-if="columns[11].visible">
<template #default="scope">
<dict-tag :options="wms_barcode_if" :value="scope.row.codeYesNo"/>
</template>
</el-table-column>
<el-table-column label="物料大类" align="center" prop="materialCategories" v-if="columns[12].visible">
<template #default="scope">
<dict-tag :options="material_mategories" :value="scope.row.materialCategories"/>
</template>
</el-table-column>
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:instockPrint:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:instockPrint:remove']"></el-button>
</el-tooltip>
</template>
</el-table-column> -->
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改入库单-物料打印条码对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="instockPrintFormRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="入库单子表主键" prop="instockPrintId">
<el-input v-model="form.instockPrintId" placeholder="请输入入库单子表主键" />
</el-form-item>
<el-form-item label="入库单号" prop="instockCode">
<el-input v-model="form.instockCode" placeholder="请输入入库单号" />
</el-form-item>
<el-form-item label="批次码" prop="batchCode">
<el-input v-model="form.batchCode" placeholder="请输入批次码" />
</el-form-item>
<el-form-item label="条码数量" prop="materialQty">
<el-input v-model="form.materialQty" placeholder="请输入条码数量" />
</el-form-item>
<el-form-item label="分包数量" prop="apportionQty">
<el-input v-model="form.apportionQty" placeholder="请输入分包数量" />
</el-form-item>
<el-form-item label="物料id" prop="materialId">
<el-input v-model="form.materialId" placeholder="请输入物料id" />
</el-form-item>
<el-form-item label="物料编码" prop="materialCode">
<el-input v-model="form.materialCode" placeholder="请输入物料编码" />
</el-form-item>
<el-form-item label="物料名称" prop="materialName">
<el-input v-model="form.materialName" placeholder="请输入物料名称" />
</el-form-item>
<el-form-item label="物料规格" prop="materialSpe">
<el-input v-model="form.materialSpe" placeholder="请输入物料规格" />
</el-form-item>
<el-form-item label="计量单位名称" prop="unitName">
<el-input v-model="form.unitName" placeholder="请输入计量单位名称" />
</el-form-item>
<el-form-item label="是否有条码" prop="codeYesNo">
<el-input v-model="form.codeYesNo" placeholder="请输入是否有条码" />
</el-form-item>
<el-form-item label="物料大类" prop="materialCategories">
<el-input v-model="form.materialCategories" placeholder="请输入物料大类" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="InstockPrint" lang="ts">
import { listInstockPrint, getInstockPrint, delInstockPrint, addInstockPrint, updateInstockPrint, printInstockPrint } from '@/api/wms/instockPrint';
import { InstockPrintVO, InstockPrintQuery, InstockPrintForm } from '@/api/wms/instockPrint/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { material_mategories, wms_barcode_if } = toRefs<any>(proxy?.useDict('material_mategories', 'wms_barcode_if'));
const instockPrintList = ref<InstockPrintVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const vos = ref<Array<InstockPrintVO>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const instockPrintFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
//
const columns = ref<FieldOption[]>([
{ key: 0, label: `入库单子表主键`, visible: true },
{ key: 1, label: `入库单号`, visible: true },
{ key: 2, label: `创建时间`, visible: true },
{ key: 3, label: `批次码`, visible: true },
{ key: 4, label: `条码数量`, visible: true },
{ key: 5, label: `分包数量`, visible: true },
{ key: 6, label: `物料id`, visible: true },
{ key: 7, label: `物料编码`, visible: true },
{ key: 8, label: `物料名称`, visible: true },
{ key: 9, label: `物料规格`, visible: true },
{ key: 10, label: `计量单位名称`, visible: true },
{ key: 11, label: `是否有条码`, visible: true },
{ key: 12, label: `物料大类`, visible: true },
]);
const initFormData: InstockPrintForm = {
instockPrintId: undefined,
instockCode: undefined,
batchCode: undefined,
materialQty: undefined,
apportionQty: undefined,
materialId: undefined,
materialCode: undefined,
materialName: undefined,
materialSpe: undefined,
unitName: undefined,
codeYesNo: undefined,
materialCategories: undefined
}
const data = reactive<PageData<InstockPrintForm, InstockPrintQuery>>({
form: {...initFormData},
queryParams: {
pageNum: 1,
pageSize: 10,
instockPrintId: undefined,
instockCode: undefined,
batchCode: undefined,
materialQty: undefined,
apportionQty: undefined,
materialId: undefined,
materialCode: undefined,
materialName: undefined,
materialSpe: undefined,
unitName: undefined,
codeYesNo: undefined,
materialCategories: undefined,
params: {
}
},
rules: {
instockPrintId: [
{ required: true, message: "入库单子表主键不能为空", trigger: "blur" }
],
instockCode: [
{ required: true, message: "入库单号不能为空", trigger: "blur" }
],
batchCode: [
{ required: true, message: "批次码不能为空", trigger: "blur" }
],
materialQty: [
{ required: true, message: "条码数量不能为空", trigger: "blur" }
],
apportionQty: [
{ required: true, message: "分包数量不能为空", trigger: "blur" }
],
materialId: [
{ required: true, message: "物料id不能为空", trigger: "blur" }
],
materialCode: [
{ required: true, message: "物料编码不能为空", trigger: "blur" }
],
materialName: [
{ required: true, message: "物料名称不能为空", trigger: "blur" }
],
materialSpe: [
{ required: true, message: "物料规格不能为空", trigger: "blur" }
],
unitName: [
{ required: true, message: "计量单位名称不能为空", trigger: "blur" }
],
codeYesNo: [
{ required: true, message: "是否有条码不能为空", trigger: "blur" }
],
materialCategories: [
{ required: true, message: "物料大类不能为空", trigger: "blur" }
]
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询入库单-物料打印条码列表 */
const getList = async () => {
loading.value = true;
const res = await listInstockPrint(queryParams.value);
instockPrintList.value = res.rows;
total.value = res.total;
loading.value = false;
}
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
}
/** 表单重置 */
const reset = () => {
form.value = {...initFormData};
instockPrintFormRef.value?.resetFields();
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
}
/** 多选框选中数据 */
const handleSelectionChange = (selection: InstockPrintVO[]) => {
vos.value = selection
console.log(vos.value)
ids.value = selection.map(item => item.instockPrintId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = "添加入库单-物料打印条码";
}
/** 修改按钮操作 */
const handleUpdate = async (row?: InstockPrintVO) => {
reset();
const _instockPrintId = row?.instockPrintId || ids.value[0]
const res = await getInstockPrint(_instockPrintId);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = "修改入库单-物料打印条码";
}
/** 提交按钮 */
const submitForm = () => {
instockPrintFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.instockPrintId) {
await updateInstockPrint(form.value).finally(() => buttonLoading.value = false);
} else {
await addInstockPrint(form.value).finally(() => buttonLoading.value = false);
}
proxy?.$modal.msgSuccess("操作成功");
dialog.visible = false;
await getList();
}
});
}
/** 删除按钮操作 */
const handleDelete = async (row?: InstockPrintVO) => {
const _instockPrintIds = row?.instockPrintId || ids.value;
await proxy?.$modal.confirm('是否确认删除入库单-物料打印条码编号为"' + _instockPrintIds + '"的数据项?').finally(() => loading.value = false);
await delInstockPrint(_instockPrintIds);
proxy?.$modal.msgSuccess("删除成功");
await getList();
}
/** 打印按钮操作 */
const handlePrint = async (row?: InstockPrintVO) => {
console.log(vos.value)
const _instockPrintVOs = vos.value;
// await proxy?.$modal.confirm('-"' + _instockPrintIds + '"').finally(() => loading.value = false);
await printInstockPrint({'vos':_instockPrintVOs});
// proxy?.$modal.msgSuccess("");
await getList();
}
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download('wms/instockPrint/export', {
...queryParams.value
}, `instockPrint_${new Date().getTime()}.xlsx`)
}
onMounted(() => {
getList();
});
</script>

@ -0,0 +1,363 @@
<template>
<div class="p-2">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<el-form-item label="表主键" prop="inventoryId">
<el-input v-model="queryParams.inventoryId" placeholder="请输入表主键" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="批次码" prop="batchCode">
<el-input v-model="queryParams.batchCode" placeholder="请输入批次码" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="物料id" prop="materialId">
<el-input v-model="queryParams.materialId" placeholder="请输入物料id" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="库位编码" prop="locationCode">
<el-input v-model="queryParams.locationCode" placeholder="请输入库位编码" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="物料大类" prop="materialCategories">
<el-input v-model="queryParams.materialCategories" placeholder="请输入物料大类" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="库存数量" prop="inventoryQty">
<el-input v-model="queryParams.inventoryQty" placeholder="请输入库存数量" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="锁定状态" prop="lockState">
<el-input v-model="queryParams.lockState" placeholder="请输入锁定状态" clearable @keyup.enter="handleQuery" />
</el-form-item>
<!-- <el-form-item label="库存状态" prop="inventoryStatus">
<el-select v-model="queryParams.inventoryStatus" placeholder="请选择库存状态" clearable >
<el-option v-for="dict in ${dictType}" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item> -->
<el-form-item label="仓库ID" prop="storeId">
<el-select v-model="form.warehouseId" placeholder="请选择所属仓库">
<el-option
v-for="item in baseStoreList"
:key="item.warehouseId"
:label="item.warehouseName"
:value="item.warehouseId"
></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</transition>
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:inventory:add']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:inventory:edit']"></el-button>
</el-col> -->
<!-- <el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:inventory:remove']"></el-button>
</el-col> -->
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['system:inventory:export']"></el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" :columns="columns" :search="true" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" :data="inventoryList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="表主键" align="center" prop="inventoryId" v-if="columns[0].visible"/> -->
<el-table-column label="批次码" align="center" prop="batchCode" v-if="columns[2].visible"/>
<!-- <el-table-column label="物料id" align="center" prop="materialId" v-if="columns[3].visible"/> -->
<el-table-column label="库位编码" align="center" prop="locationCode" v-if="columns[4].visible"/>
<el-table-column label="物料大类" align="center" prop="materialCategories" v-if="columns[5].visible">
<template #default="scope">
<dict-tag :options="material_mategories" :value="scope.row.materialCategories"/>
</template>
</el-table-column>
<el-table-column label="库存数量" align="center" prop="inventoryQty" v-if="columns[6].visible"/>
<el-table-column label="锁定状态" align="center" prop="lockState" v-if="columns[8].visible">
<template #default="scope">
<dict-tag :options="lock_state" :value="scope.row.lockState"/>
</template>
</el-table-column>
<el-table-column label="库存状态" align="center" prop="inventoryStatus" v-if="columns[9].visible">
<template #default="scope">
<dict-tag :options="inventory_status" :value="scope.row.inventoryStatus"/>
</template>
</el-table-column>
<el-table-column label="仓库ID" align="center" prop="warehouseCode" v-if="columns[10].visible"/>
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:inventory:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:inventory:remove']"></el-button>
</el-tooltip>
</template>
</el-table-column> -->
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改物料库存对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="inventoryFormRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="表主键" prop="inventoryId">
<el-input v-model="form.inventoryId" placeholder="请输入表主键" />
</el-form-item>
<el-form-item label="批次码" prop="batchCode">
<el-input v-model="form.batchCode" placeholder="请输入批次码" />
</el-form-item>
<el-form-item label="物料id" prop="materialId">
<el-input v-model="form.materialId" placeholder="请输入物料id" />
</el-form-item>
<el-form-item label="库位编码" prop="locationCode">
<el-input v-model="form.locationCode" placeholder="请输入库位编码" />
</el-form-item>
<el-form-item label="物料大类" prop="materialCategories">
<el-input v-model="form.materialCategories" placeholder="请输入物料大类" />
</el-form-item>
<el-form-item label="库存数量" prop="inventoryQty">
<el-input v-model="form.inventoryQty" placeholder="请输入库存数量" />
</el-form-item>
<!-- <el-form-item label="锁定状态" prop="lockState">
<el-input v-model="form.lockState" placeholder="请输入锁定状态" />
</el-form-item>
<el-form-item label="库存状态" prop="inventoryStatus">
<el-radio-group v-model="form.inventoryStatus">
<el-radio
v-for="dict in ${dictType}"
:key="dict.value"
:value="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item> -->
<el-form-item label="仓库ID" prop="storeId">
<el-select v-model="form.warehouseId" placeholder="请选择所属仓库">
<el-option
v-for="item in baseStoreList"
:key="item.warehouseId"
:label="item.warehouseName"
:value="item.warehouseId"
></el-option>
</el-select>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="Inventory" lang="ts">
import { listInventory, getInventory, delInventory, addInventory, updateInventory } from '@/api/wms/inventory';
import { InventoryVO, InventoryQuery, InventoryForm } from '@/api/wms/inventory/types';
import {getBaseWarehouseList} from "@/api/wms/baseWarehouse";
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { lock_state, inventory_status, material_mategories } = toRefs<any>(proxy?.useDict('lock_state', 'inventory_status', 'material_mategories'));
const inventoryList = ref<InventoryVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const inventoryFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
//
const columns = ref<FieldOption[]>([
{ key: 0, label: `表主键`, visible: true },
{ key: 1, label: `租户号`, visible: true },
{ key: 2, label: `批次码`, visible: true },
{ key: 3, label: `物料id`, visible: true },
{ key: 4, label: `库位编码`, visible: true },
{ key: 5, label: `物料大类`, visible: true },
{ key: 6, label: `库存数量`, visible: true },
{ key: 7, label: `更新时间`, visible: true },
{ key: 8, label: `锁定状态`, visible: true },
{ key: 9, label: `库存状态`, visible: true },
{ key: 10, label: `仓库ID`, visible: true },
// { key: 11, label: `${comment}`, visible: true },
// { key: 12, label: `${comment}`, visible: true },
// { key: 13, label: `${comment}`, visible: true },
]);
const initFormData: InventoryForm = {
inventoryId: undefined,
batchCode: undefined,
materialId: undefined,
locationCode: undefined,
materialCategories: undefined,
inventoryQty: undefined,
lockState: undefined,
inventoryStatus: undefined,
storeId: undefined,
}
const data = reactive<PageData<InventoryForm, InventoryQuery>>({
form: {...initFormData},
queryParams: {
pageNum: 1,
pageSize: 10,
inventoryId: undefined,
batchCode: undefined,
materialId: undefined,
locationCode: undefined,
materialCategories: undefined,
inventoryQty: undefined,
lockState: undefined,
inventoryStatus: undefined,
storeId: undefined,
params: {
}
},
rules: {
inventoryId: [
{ required: true, message: "表主键不能为空", trigger: "blur" }
],
batchCode: [
{ required: true, message: "批次码不能为空", trigger: "blur" }
],
materialId: [
{ required: true, message: "物料id不能为空", trigger: "blur" }
],
locationCode: [
{ required: true, message: "库位编码不能为空", trigger: "blur" }
],
materialCategories: [
{ required: true, message: "物料大类不能为空", trigger: "blur" }
],
inventoryQty: [
{ required: true, message: "库存数量不能为空", trigger: "blur" }
],
lockState: [
{ required: true, message: "锁定状态不能为空", trigger: "blur" }
],
inventoryStatus: [
{ required: true, message: "库存状态不能为空", trigger: "change" }
],
storeId: [
{ required: true, message: "仓库ID不能为空", trigger: "blur" }
],
}
});
const { queryParams, form, rules } = toRefs(data);
let baseStoreList = ref([]);
/** 查询车间下拉树结构 */
const getBaseWarehouseListsss = async () => {
let res = await getBaseWarehouseList(null);
baseStoreList.value = res.data;
};
/** 查询物料库存列表 */
const getList = async () => {
loading.value = true;
const res = await listInventory(queryParams.value);
inventoryList.value = res.rows;
total.value = res.total;
loading.value = false;
}
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
}
/** 表单重置 */
const reset = () => {
form.value = {...initFormData};
inventoryFormRef.value?.resetFields();
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
}
/** 多选框选中数据 */
const handleSelectionChange = (selection: InventoryVO[]) => {
ids.value = selection.map(item => item.inventoryId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = "添加物料库存";
}
/** 修改按钮操作 */
const handleUpdate = async (row?: InventoryVO) => {
reset();
const _inventoryId = row?.inventoryId || ids.value[0]
const res = await getInventory(_inventoryId);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = "修改物料库存";
}
/** 提交按钮 */
const submitForm = () => {
inventoryFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.inventoryId) {
await updateInventory(form.value).finally(() => buttonLoading.value = false);
} else {
await addInventory(form.value).finally(() => buttonLoading.value = false);
}
proxy?.$modal.msgSuccess("操作成功");
dialog.visible = false;
await getList();
}
});
}
/** 删除按钮操作 */
const handleDelete = async (row?: InventoryVO) => {
const _inventoryIds = row?.inventoryId || ids.value;
await proxy?.$modal.confirm('是否确认删除物料库存编号为"' + _inventoryIds + '"的数据项?').finally(() => loading.value = false);
await delInventory(_inventoryIds);
proxy?.$modal.msgSuccess("删除成功");
await getList();
}
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download('wms/inventory/export', {
...queryParams.value
}, `inventory_${new Date().getTime()}.xlsx`)
}
onMounted(() => {
getBaseWarehouseListsss();
getList();
});
</script>

@ -0,0 +1,318 @@
<template>
<div class="p-2">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<el-form-item label="表主键" prop="outstockDetailId">
<el-input v-model="queryParams.outstockDetailId" placeholder="请输入表主键" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="出库单号" prop="outstockCode">
<el-input v-model="queryParams.outstockCode" placeholder="请输入出库单号" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="出库单 主键" prop="outstockId">
<el-input v-model="queryParams.outstockId" placeholder="请输入出库单 主键" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="物料id" prop="materialId">
<el-input v-model="queryParams.materialId" placeholder="请输入物料id" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="出库数量" prop="outstockQty">
<el-input v-model="queryParams.outstockQty" placeholder="请输入出库数量" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="物料大类" prop="materialCategories">
<el-input v-model="queryParams.materialCategories" placeholder="请输入物料大类" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</transition>
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:outstockDetail:add']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:outstockDetail:edit']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:outstockDetail:remove']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['system:outstockDetail:export']"></el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" :columns="columns" :search="true" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" :data="outstockDetailList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="表主键" align="center" prop="outstockDetailId" v-if="columns[0].visible"/> -->
<el-table-column label="出库单号" align="center" prop="outstockCode" v-if="columns[1].visible"/>
<!-- <el-table-column label="出库单 主键" align="center" prop="outstockId" v-if="columns[2].visible"/> -->
<el-table-column label="物料" align="center" prop="materialCode" v-if="columns[4].visible"/>
<el-table-column label="出库数量" align="center" prop="outstockQty" v-if="columns[5].visible"/>
<el-table-column label="物料大类" align="center" prop="materialCategories" v-if="columns[6].visible">
<template #default="scope">
<dict-tag :options="material_mategories" :value="scope.row.materialCategories"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:outstockDetail:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:outstockDetail:remove']"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改出库单-物料对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="outstockDetailFormRef" :model="form" :rules="rules" label-width="80px">
<!-- <el-form-item label="表主键" prop="outstockDetailId">
<el-input v-model="form.outstockDetailId" placeholder="请输入表主键" />
</el-form-item> -->
<!-- <el-form-item label="出库单号" prop="outstockCode">
<el-input v-model="form.outstockCode" placeholder="请输入出库单号" />
</el-form-item> -->
<!-- <el-form-item label="出库单 主键" prop="outstockId">
<el-input v-model="form.outstockId" placeholder="请输入出库单 主键" />
</el-form-item> -->
<el-form-item label="物料" prop="materialId">
<el-select v-model="form.materialId" @change="getMaterialCount()" placeholder="请选择物料">
<el-option
v-for="item in materialList"
:key="item.materialId"
:label="item.materialCode"
:value="item.materialId"
/>
</el-select>
</el-form-item>
<el-form-item label="库存数量" prop="stockQty" v-if="form.materialId != null">
<el-input v-model="form.stockQty" placeholder="" disabled="true"/>
</el-form-item>
<el-form-item label="出库数量" prop="outstockQty">
<el-input v-model="form.outstockQty" placeholder="请输入出库数量" />
</el-form-item>
<!-- <el-form-item label="物料大类" prop="materialCategories">
<el-input v-model="form.materialCategories" placeholder="请输入物料大类" />
</el-form-item> -->
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="OutstockDetail" lang="ts">
import { getMaterialListVo, getMaterailCount } from '@/api/wms/instockDetail';
import { listOutstockDetail, getOutstockDetail, delOutstockDetail, addOutstockDetail, updateOutstockDetail } from '@/api/wms/outstockDetail';
import { OutstockDetailVO, OutstockDetailQuery, OutstockDetailForm } from '@/api/wms/outstockDetail/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { material_mategories } = toRefs<any>(proxy?.useDict('material_mategories'));
const outstockDetailList = ref<OutstockDetailVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const materialList = ref([]);
const queryFormRef = ref<ElFormInstance>();
const outstockDetailFormRef = ref<ElFormInstance>();
import { useRoute } from 'vue-router';
const router = useRoute();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
//
const columns = ref<FieldOption[]>([
{ key: 0, label: `表主键`, visible: true },
{ key: 1, label: `出库单号`, visible: true },
{ key: 2, label: `出库单 主键`, visible: true },
{ key: 3, label: `创建时间`, visible: true },
{ key: 4, label: `物料id`, visible: true },
{ key: 5, label: `出库数量`, visible: true },
{ key: 6, label: `物料大类`, visible: true },
]);
const initFormData: OutstockDetailForm = {
outstockDetailId: undefined,
outstockCode: undefined,
outstockId: undefined,
materialId: undefined,
outstockQty: undefined,
materialCategories: undefined
}
const data = reactive<PageData<OutstockDetailForm, OutstockDetailQuery>>({
form: {...initFormData},
queryParams: {
pageNum: 1,
pageSize: 10,
outstockDetailId: undefined,
outstockCode: undefined,
outstockId: undefined,
materialId: undefined,
outstockQty: undefined,
materialCategories: undefined,
params: {
}
},
rules: {
outstockDetailId: [
{ required: true, message: "表主键不能为空", trigger: "blur" }
],
outstockCode: [
{ required: true, message: "出库单号不能为空", trigger: "blur" }
],
outstockId: [
{ required: true, message: "出库单 主键不能为空", trigger: "blur" }
],
materialId: [
{ required: true, message: "物料id不能为空", trigger: "blur" }
],
outstockQty: [
{ required: true, message: "出库数量不能为空", trigger: "blur" }
],
materialCategories: [
{ required: true, message: "物料大类不能为空", trigger: "blur" }
]
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询出库单-物料列表 */
const getList = async () => {
loading.value = true;
const res = await listOutstockDetail(queryParams.value);
outstockDetailList.value = res.rows;
total.value = res.total;
loading.value = false;
}
/** 查询出库单大类下物料列表 */
const getMaterialList = async () => {
const materialCategories = router.query.materialCategories
const res = await getMaterialListVo({'materialCategories':materialCategories});
console.log(res.data);
materialList.value = res.data;
}
/** 查询出库单大类下物料数量接口 */
const getMaterialCount = async () => {
const materialId = form.value.materialId
console.log(materialId)
const res = await getMaterailCount({'materialId':materialId});
console.log(res.data);
form.value.stockQty = res.data;
console.log(form.stockQty)
}
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
}
/** 表单重置 */
const reset = () => {
form.value = {...initFormData};
outstockDetailFormRef.value?.resetFields();
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
}
/** 多选框选中数据 */
const handleSelectionChange = (selection: OutstockDetailVO[]) => {
ids.value = selection.map(item => item.outstockDetailId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = "添加出库单-物料";
}
/** 修改按钮操作 */
const handleUpdate = async (row?: OutstockDetailVO) => {
reset();
const _outstockDetailId = row?.outstockDetailId || ids.value[0]
const res = await getOutstockDetail(_outstockDetailId);
Object.assign(form.value, res.data);
getMaterialCount();
dialog.visible = true;
dialog.title = "修改出库单-物料";
}
/** 提交按钮 */
const submitForm = () => {
form.value.materialCategories = router.query.materialCategories;
form.value.outstockId = router.query.outstockId;
form.value.outstockCode = router.query.outstockCode;
outstockDetailFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.outstockDetailId) {
await updateOutstockDetail(form.value).finally(() => buttonLoading.value = false);
} else {
await addOutstockDetail(form.value).finally(() => buttonLoading.value = false);
}
proxy?.$modal.msgSuccess("操作成功");
dialog.visible = false;
await getList();
}
});
}
/** 删除按钮操作 */
const handleDelete = async (row?: OutstockDetailVO) => {
const _outstockDetailIds = row?.outstockDetailId || ids.value;
await proxy?.$modal.confirm('是否确认删除出库单-物料编号为"' + _outstockDetailIds + '"的数据项?').finally(() => loading.value = false);
await delOutstockDetail(_outstockDetailIds);
proxy?.$modal.msgSuccess("删除成功");
await getList();
}
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download('wms/outstockDetail/export', {
...queryParams.value
}, `outstockDetail_${new Date().getTime()}.xlsx`)
}
onMounted(() => {
getMaterialList();
getList();
});
</script>

@ -0,0 +1,451 @@
<template>
<div class="p-2">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<el-form-item label="出库单 主键" prop="outstockId">
<el-input v-model="queryParams.outstockId" placeholder="请输入出库单 主键" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="仓库ID" prop="warehouseId">
<el-select v-model="form.warehouseId" placeholder="请选择所属仓库">
<el-option
v-for="item in baseStoreList"
:key="item.warehouseId"
:label="item.warehouseName"
:value="item.warehouseId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="出库单号" prop="outstockCode">
<el-input v-model="queryParams.outstockCode" placeholder="请输入出库单号" clearable @keyup.enter="handleQuery" />
</el-form-item>
<!-- <el-form-item label="出库类型" prop="outstockType">
<el-select v-model="queryParams.outstockType" placeholder="请选择出库类型" clearable >
<el-option v-for="dict in ${dictType}" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item> -->
<el-form-item label="物料大类" prop="materialCategories">
<el-input v-model="queryParams.materialCategories" placeholder="请输入物料大类" clearable @keyup.enter="handleQuery" />
</el-form-item>
<!-- <el-form-item label="工单类型(字典1销售订单,2生产订单,3手工,4系统生成)" prop="orderType">
<el-select v-model="queryParams.orderType" placeholder="请选择工单类型(字典1销售订单,2生产订单,3手工,4系统生成)" clearable >
<el-option v-for="dict in ${dictType}" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item> -->
<el-form-item label="订单编号" prop="orderNo">
<el-input v-model="queryParams.orderNo" placeholder="请输入订单编号" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="审核人" prop="auditBy">
<el-input v-model="queryParams.auditBy" placeholder="请输入审核人" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="审核时间" prop="auditTime">
<el-date-picker clearable
v-model="queryParams.auditTime"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择审核时间"
/>
</el-form-item>
<!-- <el-form-item label="审核状态(0待审核,1审核通过,2审核未通过)" prop="auditStatus">
<el-select v-model="queryParams.auditStatus" placeholder="请选择审核状态(0待审核,1审核通过,2审核未通过)" clearable >
<el-option v-for="dict in ${dictType}" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item> -->
<el-form-item label="审核意见" prop="auditComments">
<el-input v-model="queryParams.auditComments" placeholder="请输入审核意见" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</transition>
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:outstockOrder:add']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:outstockOrder:edit']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:outstockOrder:remove']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['system:outstockOrder:export']"></el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" :columns="columns" :search="true" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" :data="outstockOrderList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<!-- <el-table-column label="出库单 主键" align="center" prop="outstockId" v-if="columns[0].visible"/> -->
<el-table-column label="仓库ID" align="center" prop="warehouseCode" v-if="columns[1].visible"/>
<el-table-column label="出库单号" align="center" prop="outstockCode" v-if="columns[2].visible"/>
<el-table-column label="出库类型" align="center" prop="outstockType" v-if="columns[3].visible">
<template #default="scope">
<dict-tag :options="wms_out_type" :value="scope.row.outstockType"/>
</template>
</el-table-column>
<el-table-column label="物料大类" align="center" prop="materialCategories" v-if="columns[9].visible">
<template #default="scope">
<dict-tag :options="material_mategories" :value="scope.row.materialCategories"/>
</template>
</el-table-column>
<el-table-column label="工单类型" align="center" prop="orderType" v-if="columns[10].visible">
<template #default="scope">
<dict-tag :options="wms_instock_type" :value="scope.row.orderType"/>
</template>
</el-table-column>
<el-table-column label="订单编号" align="center" prop="orderNo" v-if="columns[11].visible"/>
<el-table-column label="审核人" align="center" prop="auditBy" v-if="columns[12].visible"/>
<el-table-column label="审核时间" align="center" prop="auditTime" width="180" v-if="columns[13].visible">
<template #default="scope">
<span>{{ parseTime(scope.row.auditTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="审核状态" align="center" prop="auditStatus" v-if="columns[14].visible">
<template #default="scope">
<dict-tag :options="approve_status" :value="scope.row.auditStatus"/>
</template>
</el-table-column>
<el-table-column label="审核意见" align="center" prop="auditComments" v-if="columns[15].visible"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:outstockOrder:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:outstockOrder:remove']"></el-button>
</el-tooltip>
<el-tooltip content="详情" placement="top">
<el-button link type="primary" icon="Star" @click="HandleInfo(scope.row)"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改出库单对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="outstockOrderFormRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="仓库ID" prop="warehouseId">
<el-select v-model="form.warehouseId" placeholder="请选择所属仓库">
<el-option
v-for="item in baseStoreList"
:key="item.warehouseId"
:label="item.warehouseName"
:value="item.warehouseId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="出库类型" prop="outstockType">
<el-select v-model="form.outstockType" placeholder="请选择出库类型">
<el-option
v-for="dict in wms_out_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="物料大类" prop="materialCategories">
<el-select v-model="form.materialCategories" placeholder="请选择物料大类">
<el-option
v-for="dict in material_mategories"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="工单类型" prop="orderType">
<el-select v-model="form.orderType" placeholder="请选择工单类型(字典1销售订单,2生产订单,3手工,4系统生成)">
<el-option
v-for="dict in wms_instock_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="审核人" prop="auditBy">
<el-select v-model="form.auditBy" placeholder="请选择审核人">
<el-option
v-for="item in userList"
:key="item.userId"
:label="item.userName"
:value="item.userName"
/>
</el-select>
</el-form-item>
<el-form-item label="审核时间" prop="auditTime">
<el-date-picker clearable
v-model="form.auditTime"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
placeholder="请选择审核时间">
</el-date-picker>
</el-form-item>
<!-- <el-form-item label="审核状态(0待审核,1审核通过,2审核未通过)" prop="auditStatus">
<el-radio-group v-model="form.auditStatus">
<el-radio
v-for="dict in ${dictType}"
:key="dict.value"
:value="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item> -->
<!-- <el-form-item label="审核意见" prop="auditComments">
<el-input v-model="form.auditComments" placeholder="请输入审核意见" />
</el-form-item> -->
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="OutstockOrder" lang="ts">
import { listOutstockOrder, getOutstockOrder, delOutstockOrder, addOutstockOrder, updateOutstockOrder } from '@/api/wms/outstockOrder';
import { OutstockOrderVO, OutstockOrderQuery, OutstockOrderForm } from '@/api/wms/outstockOrder/types';
import { UserForm, UserQuery, UserVO } from '@/api/system/user/types';
import api from '@/api/system/user';
import {getBaseWarehouseList} from "@/api/wms/baseWarehouse";
import { useRouter } from 'vue-router';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { wms_instock_type, approve_status, material_mategories, wms_out_type } = toRefs<any>(proxy?.useDict('wms_instock_type', 'approve_status', 'material_mategories', 'wms_out_type'));
const outstockOrderList = ref<OutstockOrderVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const userList = ref<UserVO[]>();
const queryFormRef = ref<ElFormInstance>();
const outstockOrderFormRef = ref<ElFormInstance>();
let router = useRouter();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
//
const columns = ref<FieldOption[]>([
{ key: 0, label: `出库单 主键`, visible: true },
{ key: 1, label: `仓库ID`, visible: true },
{ key: 2, label: `出库单号`, visible: true },
{ key: 3, label: `出库类型`, visible: true },
{ key: 4, label: `租户号`, visible: true },
{ key: 5, label: `创建人`, visible: true },
{ key: 6, label: `创建时间`, visible: true },
{ key: 7, label: `更新人`, visible: true },
{ key: 8, label: `更新时间`, visible: true },
{ key: 9, label: `物料大类`, visible: true },
{ key: 10, label: `工单类型(字典1销售订单,2生产订单,3手工,4系统生成)`, visible: true },
{ key: 11, label: `订单编号`, visible: true },
{ key: 12, label: `审核人`, visible: true },
{ key: 13, label: `审核时间`, visible: true },
{ key: 14, label: `审核状态(0待审核,1审核通过,2审核未通过)`, visible: true },
{ key: 15, label: `审核意见`, visible: true },
]);
const initFormData: OutstockOrderForm = {
outstockId: undefined,
warehouseId: undefined,
outstockCode: undefined,
outstockType: undefined,
materialCategories: undefined,
orderType: undefined,
orderNo: undefined,
auditBy: undefined,
auditTime: undefined,
auditStatus: undefined,
auditComments: undefined
}
const data = reactive<PageData<OutstockOrderForm, OutstockOrderQuery>>({
form: {...initFormData},
queryParams: {
pageNum: 1,
pageSize: 10,
outstockId: undefined,
warehouseId: undefined,
outstockCode: undefined,
outstockType: undefined,
materialCategories: undefined,
orderType: undefined,
orderNo: undefined,
auditBy: undefined,
auditTime: undefined,
auditStatus: undefined,
auditComments: undefined,
params: {
}
},
rules: {
outstockId: [
{ required: true, message: "出库单 主键不能为空", trigger: "blur" }
],
warehouseId: [
{ required: true, message: "仓库ID不能为空", trigger: "blur" }
],
outstockCode: [
{ required: true, message: "出库单号不能为空", trigger: "blur" }
],
outstockType: [
{ required: true, message: "出库类型不能为空", trigger: "change" }
],
materialCategories: [
{ required: true, message: "物料大类不能为空", trigger: "blur" }
],
orderType: [
{ required: true, message: "工单类型(字典1销售订单,2生产订单,3手工,4系统生成)不能为空", trigger: "change" }
],
orderNo: [
{ required: true, message: "订单编号不能为空", trigger: "blur" }
],
auditBy: [
{ required: true, message: "审核人不能为空", trigger: "blur" }
],
auditTime: [
{ required: true, message: "审核时间不能为空", trigger: "blur" }
],
auditStatus: [
{ required: true, message: "审核状态(0待审核,1审核通过,2审核未通过)不能为空", trigger: "change" }
],
auditComments: [
{ required: true, message: "审核意见不能为空", trigger: "blur" }
]
}
});
const { queryParams, form, rules } = toRefs(data);
let baseStoreList = ref([]);
/** 查询车间下拉树结构 */
const getBaseWarehouseListsss = async () => {
let res = await getBaseWarehouseList(null);
baseStoreList.value = res.data;
};
/** 查询出库单列表 */
const getList = async () => {
loading.value = true;
const res = await listOutstockOrder(queryParams.value);
outstockOrderList.value = res.rows;
total.value = res.total;
loading.value = false;
}
/** 查询用户列表 */
const getUserList = async () => {
const res = await api.listUser(null);
userList.value = res.rows;
};
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
}
/** 表单重置 */
const reset = () => {
form.value = {...initFormData};
outstockOrderFormRef.value?.resetFields();
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
}
/** 多选框选中数据 */
const handleSelectionChange = (selection: OutstockOrderVO[]) => {
ids.value = selection.map(item => item.outstockId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
const handleAdd = () => {
reset();
getUserList();
dialog.visible = true;
dialog.title = "添加出库单";
}
/** 修改按钮操作 */
const handleUpdate = async (row?: OutstockOrderVO) => {
reset();
const _outstockId = row?.outstockId || ids.value[0]
const res = await getOutstockOrder(_outstockId);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = "修改出库单";
}
/** 提交按钮 */
const submitForm = () => {
outstockOrderFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.outstockId) {
await updateOutstockOrder(form.value).finally(() => buttonLoading.value = false);
} else {
await addOutstockOrder(form.value).finally(() => buttonLoading.value = false);
}
proxy?.$modal.msgSuccess("操作成功");
dialog.visible = false;
await getList();
}
});
}
/** 删除按钮操作 */
const handleDelete = async (row?: OutstockOrderVO) => {
const _outstockIds = row?.outstockId || ids.value;
await proxy?.$modal.confirm('是否确认删除出库单编号为"' + _outstockIds + '"的数据项?').finally(() => loading.value = false);
await delOutstockOrder(_outstockIds);
proxy?.$modal.msgSuccess("删除成功");
await getList();
}
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download('wms/outstockOrder/export', {
...queryParams.value
}, `outstockOrder_${new Date().getTime()}.xlsx`)
}
const HandleInfo = async (row?: OutstockOrderVO) => {
const outstockId = row?.outstockId;
const materialCategories = row?.materialCategories;
const outstockCode = row?.outstockCode;
router.push({
path: '/wms/outStockDetail',query: {'outstockId': outstockId,'materialCategories': materialCategories,'outstockCode':outstockCode}
});
}
onMounted(() => {
getBaseWarehouseListsss();
getList();
});
</script>

@ -0,0 +1,464 @@
<template>
<div class="p-2">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
<!-- <el-form-item label="表主键" prop="roId">
<el-input v-model="queryParams.roId" placeholder="请输入表主键" clearable @keyup.enter="handleQuery" />
</el-form-item> -->
<el-form-item label="物料ID" prop="materialId">
<el-input v-model="queryParams.materialId" placeholder="请输入物料ID" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="物料大类" prop="materialCategories">
<el-input v-model="queryParams.materialCategories" placeholder="请输入物料大类" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="批次条码" prop="batchCode">
<el-input v-model="queryParams.batchCode" placeholder="请输入批次条码" clearable @keyup.enter="handleQuery" />
</el-form-item>
<!-- <el-form-item label="计划数量" prop="planAmount">
<el-input v-model="queryParams.planAmount" placeholder="请输入计划数量" clearable @keyup.enter="handleQuery" />
</el-form-item> -->
<el-form-item label="仓库ID" prop="warehouseId">
<el-input v-model="queryParams.warehouseId" placeholder="请输入仓库ID" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="计划库位" prop="planLocationCode">
<el-input v-model="queryParams.planLocationCode" placeholder="请输入计划退库库位" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="退库状态" prop="orderStatus">
<el-select v-model="queryParams.orderStatus" placeholder="请选择退库工单状态" clearable >
<el-option v-for="dict in wms_return_status" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<el-form-item label="实际数量" prop="returnAmount">
<el-input v-model="queryParams.returnAmount" placeholder="请输入实际数量" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="实际库位" prop="returnLocationCode">
<el-input v-model="queryParams.returnLocationCode" placeholder="请输入实际退库库位" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="审核人" prop="auditBy">
<el-input v-model="queryParams.auditBy" placeholder="请输入审核人" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="审核时间" prop="auditTime">
<el-date-picker clearable
v-model="queryParams.auditTime"
type="date"
value-format="YYYY-MM-DD"
placeholder="请选择审核时间"
/>
</el-form-item>
<el-form-item label="审核状态" prop="auditStatus">
<el-select v-model="queryParams.auditStatus" placeholder="请选择审核状态(0待审核,1审核通过,2审核未通过)" clearable >
<el-option v-for="dict in approve_status" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<!-- <el-form-item label="审核意见" prop="auditComments">
<el-input v-model="queryParams.auditComments" placeholder="请输入审核意见" clearable @keyup.enter="handleQuery" />
</el-form-item> -->
<el-form-item label="erp同步状态" prop="erpSynchronousStatus">
<el-select v-model="queryParams.erpSynchronousStatus" placeholder="请选择erp同步状态" clearable >
<el-option v-for="dict in erp_synchronous_status" :key="dict.value" :label="dict.label" :value="dict.value"/>
</el-select>
</el-form-item>
<!-- <el-form-item label="erp同步数量" prop="erpSynchronousQty">
<el-input v-model="queryParams.erpSynchronousQty" placeholder="请输入erp同步数量" clearable @keyup.enter="handleQuery" />
</el-form-item> -->
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery"></el-button>
<el-button icon="Refresh" @click="resetQuery"></el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</transition>
<el-card shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:returnOrder:add']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:returnOrder:edit']"></el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:returnOrder:remove']"></el-button>
</el-col> -->
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['system:returnOrder:export']"></el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" :columns="columns" :search="true" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" :data="returnOrderList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="表主键" align="center" prop="roId" v-if="columns[0].visible"/>
<el-table-column label="物料ID" align="center" prop="materialId" v-if="columns[6].visible"/>
<el-table-column label="物料大类" align="center" prop="materialCategories" v-if="columns[7].visible">
<template #default="scope">
<dict-tag :options="material_mategories" :value="scope.row.materialCategories"/>
</template>
</el-table-column>
<el-table-column label="批次条码" align="center" prop="batchCode" v-if="columns[8].visible"/>
<el-table-column label="计划数量" align="center" prop="planAmount" v-if="columns[9].visible"/>
<el-table-column label="仓库ID" align="center" prop="warehouseId" v-if="columns[10].visible"/>
<el-table-column label="计划退库库位" align="center" prop="planLocationCode" v-if="columns[11].visible"/>
<el-table-column label="退库工单状态" align="center" prop="orderStatus" v-if="columns[12].visible">
<template #default="scope">
<dict-tag :options="wms_return_status" :value="scope.row.orderStatus"/>
</template>
</el-table-column>
<el-table-column label="实际数量" align="center" prop="returnAmount" v-if="columns[13].visible"/>
<el-table-column label="实际退库库位" align="center" prop="returnLocationCode" v-if="columns[14].visible"/>
<el-table-column label="审核人" align="center" prop="auditBy" v-if="columns[15].visible"/>
<el-table-column label="审核时间" align="center" prop="auditTime" width="180" v-if="columns[16].visible">
<template #default="scope">
<span>{{ parseTime(scope.row.auditTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="审核状态" align="center" prop="auditStatus" v-if="columns[17].visible"/>
<el-table-column label="审核意见" align="center" prop="auditComments" v-if="columns[18].visible"/>
<el-table-column label="erp同步状态" align="center" prop="erpSynchronousStatus" v-if="columns[19].visible">
<template #default="scope">
<dict-tag :options="erp_synchronous_status" :value="scope.row.erpSynchronousStatus"/>
</template>
</el-table-column>
<el-table-column label="erp同步数量" align="center" prop="erpSynchronousQty" v-if="columns[20].visible"/>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:returnOrder:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['system:returnOrder:remove']"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改退库工单对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="returnOrderFormRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="表主键" prop="roId">
<el-input v-model="form.roId" placeholder="请输入表主键" />
</el-form-item>
<el-form-item label="物料ID" prop="materialId">
<el-input v-model="form.materialId" placeholder="请输入物料ID" />
</el-form-item>
<el-form-item label="物料大类" prop="materialCategories">
<el-input v-model="form.materialCategories" placeholder="请输入物料大类" />
</el-form-item>
<el-form-item label="批次条码" prop="batchCode">
<el-input v-model="form.batchCode" placeholder="请输入批次条码" />
</el-form-item>
<el-form-item label="计划数量" prop="planAmount">
<el-input v-model="form.planAmount" placeholder="请输入计划数量" />
</el-form-item>
<el-form-item label="仓库ID" prop="warehouseId">
<el-input v-model="form.warehouseId" placeholder="请输入仓库ID" />
</el-form-item>
<el-form-item label="计划退库库位" prop="planLocationCode">
<el-input v-model="form.planLocationCode" placeholder="请输入计划退库库位" />
</el-form-item>
<!-- <el-form-item label="退库工单状态" prop="orderStatus">
<el-radio-group v-model="form.orderStatus">
<el-radio
v-for="dict in wms_return_status"
:key="dict.value"
:value="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item> -->
<el-form-item label="实际数量" prop="returnAmount">
<el-input v-model="form.returnAmount" placeholder="请输入实际数量" />
</el-form-item>
<el-form-item label="实际退库库位" prop="returnLocationCode">
<el-input v-model="form.returnLocationCode" placeholder="请输入实际退库库位" />
</el-form-item>
<!-- <el-form-item label="审核人" prop="auditBy">
<el-input v-model="form.auditBy" placeholder="请输入审核人" />
</el-form-item>
<el-form-item label="审核时间" prop="auditTime">
<el-date-picker clearable
v-model="form.auditTime"
type="datetime"
value-format="YYYY-MM-DD HH:mm:ss"
placeholder="请选择审核时间">
</el-date-picker>
</el-form-item> -->
<!-- <el-form-item label="审核状态(0待审核,1审核通过,2审核未通过)" prop="auditStatus">
<el-radio-group v-model="form.auditStatus">
<el-radio
v-for="dict in ${dictType}"
:key="dict.value"
:value="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item> -->
<!-- <el-form-item label="审核意见" prop="auditComments">
<el-input v-model="form.auditComments" placeholder="请输入审核意见" />
</el-form-item> -->
<!-- <el-form-item label="erp同步状态" prop="erpSynchronousStatus">
<el-radio-group v-model="form.erpSynchronousStatus">
<el-radio
v-for="dict in ${dictType}"
:key="dict.value"
:value="dict.value"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item> -->
<!-- <el-form-item label="erp同步数量" prop="erpSynchronousQty">
<el-input v-model="form.erpSynchronousQty" placeholder="请输入erp同步数量" />
</el-form-item>-->
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="ReturnOrder" lang="ts">
import { listReturnOrder, getReturnOrder, delReturnOrder, addReturnOrder, updateReturnOrder } from '@/api/wms/returnOrder';
import { ReturnOrderVO, ReturnOrderQuery, ReturnOrderForm } from '@/api/wms/returnOrder/types';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { material_mategories, wms_return_status, erp_synchronous_status, approve_status } = toRefs<any>(proxy?.useDict('material_mategories','wms_return_status','erp_synchronous_status','approve_status'));
const returnOrderList = ref<ReturnOrderVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const returnOrderFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
//
const columns = ref<FieldOption[]>([
{ key: 0, label: `表主键`, visible: true },
{ key: 1, label: `租户号`, visible: true },
{ key: 2, label: `工单创建人`, visible: true },
{ key: 3, label: `工单创建时间`, visible: true },
{ key: 4, label: `实际退库人`, visible: true },
{ key: 5, label: `实际退库时间`, visible: true },
{ key: 6, label: `物料ID`, visible: true },
{ key: 7, label: `物料大类`, visible: true },
{ key: 8, label: `批次条码`, visible: true },
{ key: 9, label: `计划数量`, visible: true },
{ key: 10, label: `仓库ID`, visible: true },
{ key: 11, label: `计划退库库位`, visible: true },
{ key: 12, label: `退库工单状态`, visible: true },
{ key: 13, label: `实际数量`, visible: true },
{ key: 14, label: `实际退库库位`, visible: true },
{ key: 15, label: `审核人`, visible: true },
{ key: 16, label: `审核时间`, visible: true },
{ key: 17, label: `审核状态(0待审核,1审核通过,2审核未通过)`, visible: true },
{ key: 18, label: `审核意见`, visible: true },
{ key: 19, label: `erp同步状态`, visible: true },
{ key: 20, label: `erp同步数量`, visible: true },
]);
const initFormData: ReturnOrderForm = {
roId: undefined,
materialId: undefined,
materialCategories: undefined,
batchCode: undefined,
planAmount: undefined,
warehouseId: undefined,
planLocationCode: undefined,
orderStatus: undefined,
returnAmount: undefined,
returnLocationCode: undefined,
auditBy: undefined,
auditTime: undefined,
auditStatus: undefined,
auditComments: undefined,
erpSynchronousStatus: undefined,
erpSynchronousQty: undefined
}
const data = reactive<PageData<ReturnOrderForm, ReturnOrderQuery>>({
form: {...initFormData},
queryParams: {
pageNum: 1,
pageSize: 10,
roId: undefined,
materialId: undefined,
materialCategories: undefined,
batchCode: undefined,
planAmount: undefined,
warehouseId: undefined,
planLocationCode: undefined,
orderStatus: undefined,
returnAmount: undefined,
returnLocationCode: undefined,
auditBy: undefined,
auditTime: undefined,
auditStatus: undefined,
auditComments: undefined,
erpSynchronousStatus: undefined,
erpSynchronousQty: undefined,
params: {
}
},
rules: {
roId: [
{ required: true, message: "表主键不能为空", trigger: "blur" }
],
materialId: [
{ required: true, message: "物料ID不能为空", trigger: "blur" }
],
materialCategories: [
{ required: true, message: "物料大类不能为空", trigger: "blur" }
],
batchCode: [
{ required: true, message: "批次条码不能为空", trigger: "blur" }
],
planAmount: [
{ required: true, message: "计划数量不能为空", trigger: "blur" }
],
warehouseId: [
{ required: true, message: "仓库ID不能为空", trigger: "blur" }
],
planLocationCode: [
{ required: true, message: "计划退库库位不能为空", trigger: "blur" }
],
orderStatus: [
{ required: true, message: "退库工单状态不能为空", trigger: "change" }
],
returnAmount: [
{ required: true, message: "实际数量不能为空", trigger: "blur" }
],
returnLocationCode: [
{ required: true, message: "实际退库库位不能为空", trigger: "blur" }
],
auditBy: [
{ required: true, message: "审核人不能为空", trigger: "blur" }
],
auditTime: [
{ required: true, message: "审核时间不能为空", trigger: "blur" }
],
auditStatus: [
{ required: true, message: "审核状态(0待审核,1审核通过,2审核未通过)不能为空", trigger: "change" }
],
auditComments: [
{ required: true, message: "审核意见不能为空", trigger: "blur" }
],
erpSynchronousStatus: [
{ required: true, message: "erp同步状态不能为空", trigger: "change" }
],
erpSynchronousQty: [
{ required: true, message: "erp同步数量不能为空", trigger: "blur" }
]
}
});
const { queryParams, form, rules } = toRefs(data);
/** 查询退库工单列表 */
const getList = async () => {
loading.value = true;
const res = await listReturnOrder(queryParams.value);
returnOrderList.value = res.rows;
total.value = res.total;
loading.value = false;
}
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
}
/** 表单重置 */
const reset = () => {
form.value = {...initFormData};
returnOrderFormRef.value?.resetFields();
}
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
}
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
}
/** 多选框选中数据 */
const handleSelectionChange = (selection: ReturnOrderVO[]) => {
ids.value = selection.map(item => item.roId);
single.value = selection.length != 1;
multiple.value = !selection.length;
}
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = "添加退库工单";
}
/** 修改按钮操作 */
const handleUpdate = async (row?: ReturnOrderVO) => {
reset();
const _roId = row?.roId || ids.value[0]
const res = await getReturnOrder(_roId);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = "修改退库工单";
}
/** 提交按钮 */
const submitForm = () => {
returnOrderFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.roId) {
await updateReturnOrder(form.value).finally(() => buttonLoading.value = false);
} else {
await addReturnOrder(form.value).finally(() => buttonLoading.value = false);
}
proxy?.$modal.msgSuccess("操作成功");
dialog.visible = false;
await getList();
}
});
}
/** 删除按钮操作 */
const handleDelete = async (row?: ReturnOrderVO) => {
const _roIds = row?.roId || ids.value;
await proxy?.$modal.confirm('是否确认删除退库工单编号为"' + _roIds + '"的数据项?').finally(() => loading.value = false);
await delReturnOrder(_roIds);
proxy?.$modal.msgSuccess("删除成功");
await getList();
}
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download('wms/returnOrder/export', {
...queryParams.value
}, `returnOrder_${new Date().getTime()}.xlsx`)
}
onMounted(() => {
getList();
});
</script>
Loading…
Cancel
Save