From c44edecce30a290e9715c7e1fe8bd2484748679c Mon Sep 17 00:00:00 2001 From: zhaoyiran Date: Thu, 10 Oct 2024 15:18:51 +0800 Subject: [PATCH] =?UTF-8?q?YT-168=E9=87=87=E8=B4=AD=E6=8D=A2=E8=B4=A7?= =?UTF-8?q?=E7=94=B3=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wms/purchaseBarterRequestDetail/index.ts | 53 ++ .../wms/purchaseBarterRequestMain/index.ts | 96 +++ src/locales/zh-CN.ts | 3 + src/utils/disposition/defaultButtons.ts | 13 + .../purchaseBarterRequest/index.vue | 613 ++++++++++++++++++ .../purchaseBarterRequestMain.data.ts | 277 ++++++++ 6 files changed, 1055 insertions(+) create mode 100644 src/api/wms/purchaseBarterRequestDetail/index.ts create mode 100644 src/api/wms/purchaseBarterRequestMain/index.ts create mode 100644 src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/index.vue create mode 100644 src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/purchaseBarterRequestMain.data.ts diff --git a/src/api/wms/purchaseBarterRequestDetail/index.ts b/src/api/wms/purchaseBarterRequestDetail/index.ts new file mode 100644 index 000000000..f7622276c --- /dev/null +++ b/src/api/wms/purchaseBarterRequestDetail/index.ts @@ -0,0 +1,53 @@ +import request from '@/config/axios' + +export interface PurchaseBarterRequestDetailVO { + masterId: number + itemCode: string + itemName: string + uom: string + batch: string + packUnit: string + qty: number + reason: string +} + +// 查询采购换货申请明细列表 +export const getPurchaseBarterRequestDetailPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/wms/purchase-barter-request-detail/senior', data }) + } else { + return await request.get({ url: `/wms/purchase-barter-request-detail/page`, params }) + } +} + +// 查询采购换货申请明细详情 +export const getPurchaseBarterRequestDetail = async (id: number) => { + return await request.get({ url: `/wms/purchase-barter-request-detail/get?id=` + id }) +} + +// 新增采购换货申请明细 +export const createPurchaseBarterRequestDetail = async (data: PurchaseBarterRequestDetailVO) => { + return await request.post({ url: `/wms/purchase-barter-request-detail/create`, data }) +} + +// 修改采购换货申请明细 +export const updatePurchaseBarterRequestDetail = async (data: PurchaseBarterRequestDetailVO) => { + return await request.put({ url: `/wms/purchase-barter-request-detail/update`, data }) +} + +// 删除采购换货申请明细 +export const deletePurchaseBarterRequestDetail = async (id: number) => { + return await request.delete({ url: `/wms/purchase-barter-request-detail/delete?id=` + id }) +} + +// 导出采购换货申请明细 Excel +export const exportPurchaseBarterRequestDetail = async (params) => { + return await request.download({ url: `/wms/purchase-barter-request-detail/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/wms/purchase-barter-request-detail/get-import-template' }) +} \ No newline at end of file diff --git a/src/api/wms/purchaseBarterRequestMain/index.ts b/src/api/wms/purchaseBarterRequestMain/index.ts new file mode 100644 index 000000000..e8fc8e4f4 --- /dev/null +++ b/src/api/wms/purchaseBarterRequestMain/index.ts @@ -0,0 +1,96 @@ +import request from '@/config/axios' + +export interface PurchaseBarterRequestMainVO { + id: number + number: string + status: string + supplierCode: string + supplierName: string + available: string + creatorName: string + updaterName: string + deleteTime: Date + deleter: string + deleteName: string +} + +// 查询采购换货申请主列表 +export const getPurchaseBarterRequestMainPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/wms/purchase-barter-request-main/senior', data }) + } else { + return await request.get({ url: `/wms/purchase-barter-request-main/page`, params }) + } +} + +// 查询采购换货申请主详情 +export const getPurchaseBarterRequestMain = async (id: number) => { + return await request.get({ url: `/wms/purchase-barter-request-main/get?id=` + id }) +} + +// 新增采购换货申请主 +export const createPurchaseBarterRequestMain = async (data: PurchaseBarterRequestMainVO) => { + return await request.post({ url: `/wms/purchase-barter-request-main/create`, data }) +} + +// 修改采购换货申请主 +export const updatePurchaseBarterRequestMain = async (data: PurchaseBarterRequestMainVO) => { + return await request.put({ url: `/wms/purchase-barter-request-main/update`, data }) +} + +// 删除采购换货申请主 +export const deletePurchaseBarterRequestMain = async (id: number) => { + return await request.delete({ url: `/wms/purchase-barter-request-main/delete?id=` + id }) +} + +// 导出采购换货申请主 Excel +export const exportPurchaseBarterRequestMain = async (params) => { + return await request.download({ url: `/wms/purchase-barter-request-main/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/wms/purchase-barter-request-main/get-import-template' }) +} + +// 审批通过 +export async function agreePurchaseBarterRequestMain(id: number) { + return await request.put({ url: `/wms/purchase-barter-request-main/agree?id=` + id }) +} + +// 驳回 +export async function refusedPurchaseBarterRequestMain(id: number) { + return await request.put({ url: `/wms/purchase-barter-request-main/refused?id=` + id }) +} + +// 提交审批 +export async function submitPurchaseBarterRequestMain(id: number) { + return await request.put({ url: `/wms/purchase-barter-request-main/submit?id=` + id }) +} + +// 重新添加 +export async function reAddPurchaseBarterRequestMain(id: number) { + return await request.put({ url: `/wms/purchase-barter-request-main/reAdd?id=` + id }) +} + +// 关闭 +export async function closePurchaseBarterRequestMain(id: number) { + return await request.put({ url: `/wms/purchase-barter-request-main/close?id=` + id }) +} + +// 出库 +export async function outStoragePurchaseBarterRequestMain(id: number) { + return await request.put({ url: `/wms/purchase-barter-request-main/outStorage?id=` + id }) +} + +// 入库 +export async function inStoragePurchaseBarterRequestMain(id: number) { + return await request.put({ url: `/wms/purchase-barter-request-main/inStorage?id=` + id }) +} + +// 中止 +export async function suspendPurchaseBarterRequestMain(id: number) { + return await request.put({ url: `/wms/purchase-barter-request-main/suspend?id=` + id }) +} diff --git a/src/locales/zh-CN.ts b/src/locales/zh-CN.ts index 06fac580b..cbaf8fd59 100644 --- a/src/locales/zh-CN.ts +++ b/src/locales/zh-CN.ts @@ -79,6 +79,9 @@ export default { confirmAccept: '确认承接吗?', confirmGiveup: '确认放弃吗?', confirmPublish: '确认发布吗?', + confirmOutStorage: '确认出库吗?', + confirmInStorage: '确认入库吗?', + confirmSuspend: '确认中止吗?', }, error: { noPermission: `抱歉,您无权访问此页面。`, diff --git a/src/utils/disposition/defaultButtons.ts b/src/utils/disposition/defaultButtons.ts index 13fce99ac..6a9208e12 100644 --- a/src/utils/disposition/defaultButtons.ts +++ b/src/utils/disposition/defaultButtons.ts @@ -1404,6 +1404,19 @@ export function outBtn(option: any) { hasPermi: '' }) } + +export function inBtn(option: any) { + return __defaultBtnOption(option, { + label: '入库', + name: 'in', + hide: false, + type: 'danger', + color: '', + link: true, // 文本展现按钮 + hasPermi: '' + }) +} + // 主列表-重试 export function retryBtn(option: any) { return __defaultBtnOption(option, { diff --git a/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/index.vue b/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/index.vue new file mode 100644 index 000000000..28d01c6ce --- /dev/null +++ b/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/index.vue @@ -0,0 +1,613 @@ + + + diff --git a/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/purchaseBarterRequestMain.data.ts b/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/purchaseBarterRequestMain.data.ts new file mode 100644 index 000000000..4ada3c32d --- /dev/null +++ b/src/views/wms/purchasereceiptManage/purchaseBarter/purchaseBarterRequest/purchaseBarterRequestMain.data.ts @@ -0,0 +1,277 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import {Supplier} from "@/views/wms/basicDataManage/supplierManage/supplier/supplier.data"; +import * as SupplierApi from "@/api/wms/supplier"; +import * as ItembasicApi from "@/api/wms/itembasic"; +import { + Supplieritem +} from "@/views/wms/basicDataManage/supplierManage/supplieritem/supplieritem.data"; +import * as SupplieritemApi from "@/api/wms/supplieritem"; + +/** + * @returns {Array} 采购换货申请主表 + */ +export const PurchaseBarterRequestMain = useCrudSchemas(reactive([ + { + label: '申请单号', + field: 'number', + sort: 'custom', + isSearch: true, + isForm: false, + table: { + width: 180, + fixed: 'left' + } + }, + { + label: '状态', + field: 'status', + sort: 'custom', + isSearch: true, + isForm: false, + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + }, + { + label: '供应商代码', + field: 'supplierCode', + sort: 'custom', + isSearch: true, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + enterSearch: true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择供应商代码', // 输入框占位文本 + searchField: 'code', // 查询弹窗赋值字段 + searchTitle: '供应商', // 查询弹窗标题 + searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类 + searchPage: SupplierApi.getSupplierPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }], + verificationParams: [{ + key: 'code', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 + } + } + }, + { + label: '供应商名称', + field: 'supplierName', + sort: 'custom', + isSearch: false, + form: { + componentProps: { + disabled: true + } + }, + }, + { + label: '操作', + field: 'action', + isForm: false, + isDetail: false, + table: { + width: 250, + fixed: 'right' + } + } +])) + +//表单校验 +export const PurchaseBarterRequestMainRules = reactive({ + supplierCode: [ + { required: true, message: '请输入供应商代码', trigger: 'blur' } + ], +}) + +/** + * @returns {Array} 采购换货申请子表 + */ +export const PurchaseBarterRequestDetail = useCrudSchemas(reactive([ + { + label: '物料代码', + field: 'itemCode', + sort: 'custom', + isSearch: true, + table: { + width: 150 + }, + tableForm:{ + multiple:true,//多选 + isInpuFocusShow: true, // 开启查询弹窗 + searchListPlaceholder: '请选择物料代码',// 输入框占位文本 + searchField: 'itemCode', // 查询弹窗赋值字段 + searchTitle: '供应商物料信息', // 查询弹窗标题 + searchAllSchemas: Supplieritem.allSchemas, // 查询弹窗所需类 + searchPage: SupplieritemApi.getSupplieritemPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + action: '==', + isSearch: true, + isMainValue: false + },{ + key: 'supplierCode', + value: 'supplierCode', + action: '==', + message: '供应商代码不能为空!', + isFormModel:true, // filters中添加筛选的数据--取于formModel + required:true, // 前置添加必有,和isFormModel结合使用 + isSearch: true, + isMainValue: false + }], + verificationPage: ItembasicApi.getItemListByCodes, // tableForm下方输入框校验失去焦点之后是否正确的方法 + isShowTableFormSearch: false, //tableForm下方是否出现输入框 + verificationParams: [{ + key: 'itemCode', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true, + }], // 失去焦点校验参数 + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + disabled:true, + enterSearch: true, + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择物料代码', // 输入框占位文本 + searchField: 'itemCode', // 查询弹窗赋值字段 + searchTitle: '供应商物料信息', // 查询弹窗标题 + searchAllSchemas: Supplieritem.allSchemas, // 查询弹窗所需类 + searchPage: SupplieritemApi.getSupplieritemPage, // 查询弹窗所需分页方法 + searchCondition: [ + { + key: 'available', + value: 'TRUE', + isMainValue: false + },{ + key: 'supplierCode', + value: 'supplierCode', + message: '供应商代码不能为空!', + isMainValue:true + } + ], + verificationParams: [ + { + key: 'itemCode', + action: '==', + value: '', + isMainValue: false, + isSearch: true, + isFormModel: true + } + ] // 失去焦点校验参数 + } + } + }, + { + label: '物料名称', + field: 'itemName', + sort: 'custom', + isSearch: false, + tableForm: { + disabled: true + }, + form:{ + componentProps:{ + disabled:true + } + } + }, + { + label: '计量单位', + field: 'uom', + sort: 'custom', + isSearch: false, + tableForm: { + disabled: true + }, + form:{ + componentProps:{ + disabled:true + } + } + }, + { + label: '批次', + field: 'batch', + sort: 'custom', + isSearch: true, + tableForm: { + disabled: true + }, + form:{ + componentProps:{ + disabled:true + } + } + }, + { + label: '包装规格', + field: 'packUnit', + sort: 'custom', + isSearch: false, + tableForm: { + disabled: true + }, + form:{ + componentProps:{ + disabled:true + } + } + }, + { + label: '换货数量', + field: 'qty', + sort: 'custom', + isSearch: false, + form: { + component: 'InputNumber', + value: 0 + }, + }, + { + label: '换货原因 ', + field: 'reason', + sort: 'custom', + isSearch: false, + }, + { + label: '操作', + field: 'action', + isDetail: false, + hiddenInMain:true, + isForm: false , + table: { + width: 150, + fixed: 'right' + }, + isTableForm:false, + } +])) + +function validateQty(rule, value, callback) { + const numericValue = Number(value); + if (Number.isInteger(numericValue) && numericValue > 0) { + callback(); + } else { + callback(new Error('数量必须是一个正整数')); + } +} +//表单校验 +export const PurchaseBarterRequestDetailRules = reactive({ + qty:[ + { validator:validateQty, message: '数量必须是一个正整数', trigger: 'change'} + ], +})