Merge remote-tracking branch 'origin/master'
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,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,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,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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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>
|
@ -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,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,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…
Reference in New Issue