From 2111bd98bc9bc5295fd76c4f1b0f4a68f86a6d14 Mon Sep 17 00:00:00 2001 From: chenfang Date: Tue, 12 Mar 2024 08:55:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E8=B4=A7=E6=A8=A1=E5=9D=97=E5=89=8D?= =?UTF-8?q?=E7=AB=AF=E5=B1=95=E7=A4=BA=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/wms/stockupDetailRequest/index.ts | 16 +- src/api/wms/stockupMainRequest/index.ts | 29 + .../stockup/stockupMainRequest/index.vue | 339 +++++++++--- .../stockupMainRequest.data.ts | 500 +++++++++++++++--- 4 files changed, 720 insertions(+), 164 deletions(-) diff --git a/src/api/wms/stockupDetailRequest/index.ts b/src/api/wms/stockupDetailRequest/index.ts index 6390e2e16..333596286 100644 --- a/src/api/wms/stockupDetailRequest/index.ts +++ b/src/api/wms/stockupDetailRequest/index.ts @@ -28,38 +28,38 @@ export const getStockupDetailRequestPage = async (params) => { if (params.isSearch) { delete params.isSearch const data = {...params} - return await request.post({ url: '/request/stockup-detail-request/senior', data }) + return await request.post({ url: '/wms/stockup-detail-request/senior', data }) } else { - return await request.get({ url: `/request/stockup-detail-request/page`, params }) + return await request.get({ url: `/wms/stockup-detail-request/page`, params }) } } // 查询备货申请子详情 export const getStockupDetailRequest = async (id: number) => { - return await request.get({ url: `/request/stockup-detail-request/get?id=` + id }) + return await request.get({ url: `/wms/stockup-detail-request/get?id=` + id }) } // 新增备货申请子 export const createStockupDetailRequest = async (data: StockupDetailRequestVO) => { - return await request.post({ url: `/request/stockup-detail-request/create`, data }) + return await request.post({ url: `/wms/stockup-detail-request/create`, data }) } // 修改备货申请子 export const updateStockupDetailRequest = async (data: StockupDetailRequestVO) => { - return await request.put({ url: `/request/stockup-detail-request/update`, data }) + return await request.put({ url: `/wms/stockup-detail-request/update`, data }) } // 删除备货申请子 export const deleteStockupDetailRequest = async (id: number) => { - return await request.delete({ url: `/request/stockup-detail-request/delete?id=` + id }) + return await request.delete({ url: `/wms/stockup-detail-request/delete?id=` + id }) } // 导出备货申请子 Excel export const exportStockupDetailRequest = async (params) => { - return await request.download({ url: `/request/stockup-detail-request/export-excel`, params }) + return await request.download({ url: `/wms/stockup-detail-request/export-excel`, params }) } // 下载用户导入模板 export const importTemplate = () => { - return request.download({ url: '/request/stockup-detail-request/get-import-template' }) + return request.download({ url: '/wms/stockup-detail-request/get-import-template' }) } \ No newline at end of file diff --git a/src/api/wms/stockupMainRequest/index.ts b/src/api/wms/stockupMainRequest/index.ts index b9e749376..f84d52e2a 100644 --- a/src/api/wms/stockupMainRequest/index.ts +++ b/src/api/wms/stockupMainRequest/index.ts @@ -70,4 +70,33 @@ export const exportStockupMainRequest = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/wms/stockup-main-request/get-import-template' }) +} +// 关闭 +export const close = (id) => { + return request.put({ url: '/wms/stockup-main-request/close?id=' + id }) +} + +// 重新添加 +export const reAdd = (id) => { + return request.put({ url: '/wms/stockup-main-request/reAdd?id=' + id }) +} + +// 提交审批 +export const submit = (id) => { + return request.put({ url: '/wms/stockup-main-request/submit?id=' + id }) +} + +// 驳回 +export const refused = (id) => { + return request.put({ url: '/wms/stockup-main-request/refused?id=' + id }) +} + +// 审批通过 +export const agree = (id) => { + return request.put({ url: '/wms/stockup-main-request/agree?id=' + id }) +} + +// 处理 +export const handle = (id) => { + return request.put({ url: '/wms/stockup-main-request/handle?id=' + id }) } \ No newline at end of file diff --git a/src/views/wms/deliversettlementManage/stockup/stockupMainRequest/index.vue b/src/views/wms/deliversettlementManage/stockup/stockupMainRequest/index.vue index 4d7d0f5d8..c8c0af90a 100644 --- a/src/views/wms/deliversettlementManage/stockup/stockupMainRequest/index.vue +++ b/src/views/wms/deliversettlementManage/stockup/stockupMainRequest/index.vue @@ -27,69 +27,70 @@ v-model:currentPage="tableObject.currentPage" v-model:sort="tableObject.sort" > - diff --git a/src/views/wms/deliversettlementManage/stockup/stockupMainRequest/stockupMainRequest.data.ts b/src/views/wms/deliversettlementManage/stockup/stockupMainRequest/stockupMainRequest.data.ts index f3e52938a..6369ff33b 100644 --- a/src/views/wms/deliversettlementManage/stockup/stockupMainRequest/stockupMainRequest.data.ts +++ b/src/views/wms/deliversettlementManage/stockup/stockupMainRequest/stockupMainRequest.data.ts @@ -1,8 +1,42 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { TableColumn } from '@/types/table' + import { dateFormatter } from '@/utils/formatTime' +import * as getRequestsettingApi from '@/api/wms/requestsetting/index' + +import * as DeliverPlanMainApi from '@/api/wms/deliverPlanMain' +import { DeliverPlanMain } from '../../deliverplan/deliverPlanMain/deliverPlanMain.data' + +import * as BalanceApi from '@/api/wms/balance' +import { Balance } from '@/views/wms/inventoryManage/balance/balance.data' + +import * as locationApi from '@/api/wms/location' +import { Location } from '../../../basicDataManage/factoryModeling/location/location.data' + +const { t } = useI18n() // 国际化 + +// 获取自动提交自动通过自动执行,跳过任务直接删生成记录的默认值 +const queryParams = { + pageSize:10, + pageNo:1, + code:'StockupRequest' +} + const data = await getRequestsettingApi.getRequestsettingPage(queryParams) + const requestsettingData =data?.list[0]||{} + + // 获取当前操作人的部门 +import { useUserStore } from '@/store/modules/user' +const userStore = useUserStore() +const userDept = userStore.userSelfInfo.dept + // id 转str 否则form回显匹配不到 + userDept.id = userDept.id.toString() +const userDeptArray:any = [userDept] // 表单校验 export const StockupMainRequestRules = reactive({ + // deliverPlanNumber: [ + // { required: true, message: '请选择客户代码', trigger: 'change' } + // ], }) export const StockupMainRequest = useCrudSchemas(reactive([ @@ -11,36 +45,98 @@ export const StockupMainRequest = useCrudSchemas(reactive([ field: 'number', sort: 'custom', isSearch: true, + table: { + width: 180, + fixed: 'left' + }, + isForm: false, }, { label: '发货计划单号', field: 'deliverPlanNumber', sort: 'custom', - isSearch: true, + table: { + width: 140 + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择发货计划单号', // 输入框占位文本 + searchField: 'number', // 查询弹窗赋值字段 + searchTitle: '发货计划信息', // 查询弹窗标题 + searchAllSchemas: DeliverPlanMain.allSchemas, // 查询弹窗所需类 + searchPage: DeliverPlanMainApi.getDeliverPlanMainPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }, + { + key: 'status', + value: '6', + isMainValue: false + }] + } + } }, { label: '从仓库代码', field: 'fromWarehouseCode', sort: 'custom', isSearch: false, + table: { + width: 120 + }, + // form: { + // // labelMessage: '信息提示说明!!!', + // componentProps: { + // isSearchList: true, // 开启查询弹窗 + // searchListPlaceholder: '请选择从仓库代码', // 输入框占位文本 + // searchField: 'number', // 查询弹窗赋值字段 + // searchTitle: '仓库信息', // 查询弹窗标题 + // searchAllSchemas: Itemwarehouse.allSchemas, // 查询弹窗所需类 + // searchPage: WarehouseApi.getWarehousePage, // 查询弹窗所需分页方法 + // searchCondition: [{ + // key: 'available', + // value: 'TRUE', + // isMainValue: false + // }] + // } + // } + isForm: false }, { label: '到仓库代码', field: 'toWarehouseCode', sort: 'custom', isSearch: false, + table: { + width: 120 + }, + isForm: false, }, { label: '从库区类型范围', field: 'fromAreaTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isTable: true, sort: 'custom', - isSearch: false, + table: { + width: 150 + }, + isForm: false, }, { label: '从库区代码范围', field: 'fromAreaCodes', sort: 'custom', isSearch: false, + table: { + width: 160 + }, + isForm: false }, { label: '业务类型', @@ -48,18 +144,38 @@ export const StockupMainRequest = useCrudSchemas(reactive([ sort: 'custom', isSearch: false, form: { - component: 'SelectV2' + value: 'Stockup', + componentProps: { + disabled: true, + } }, + table: { + width: 110 + }, + isForm: false, }, { - label: '备注', - field: 'remark', + label: '创建时间', + field: 'createTime', sort: 'custom', + formatter: dateFormatter, isSearch: false, + search: { + component: 'DatePicker', + componentProps: { + valueFormat: 'YYYY-MM-DD HH:mm:ss', + type: 'daterange', + defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] + } + }, + table: { + width: 180 + }, + isForm: false, }, { - label: '创建时间', - field: 'createTime', + label: '发货日期', + field: 'deliverDate', sort: 'custom', formatter: dateFormatter, isSearch: false, @@ -71,7 +187,16 @@ export const StockupMainRequest = useCrudSchemas(reactive([ defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] } }, - isForm: false, + form: { + component: 'DatePicker', + componentProps: { + type: 'datetime', + valueFormat: 'x' + } + }, + table: { + width: 180 + }, }, { label: '申请时间', @@ -94,6 +219,9 @@ export const StockupMainRequest = useCrudSchemas(reactive([ valueFormat: 'x' } }, + table: { + width: 180 + }, }, { label: '截止时间', @@ -116,91 +244,190 @@ export const StockupMainRequest = useCrudSchemas(reactive([ valueFormat: 'x' } }, + table: { + width: 180 + }, }, { label: '部门', field: 'departmentCode', sort: 'custom', - isSearch: false, + table: { + width: 150 + }, + formatter: (_: Recordable, __: TableColumn, cellValue: number) => { + return userDeptArray.find((account) => account.id == cellValue)?.name + }, + form: { + value: userDept.id, + component: 'Select', + api: () => userDeptArray, + componentProps: { + disabled: true, + optionsAlias: { + labelField: 'name', + valueField: 'id' + } + } + } }, { label: '状态', field: 'status', + dictType: DICT_TYPE.REQUEST_STATUS, + dictClass: 'string', + isSearch: true, + isTable: true, sort: 'custom', - isSearch: false, - form: { - component: 'Radio' + table: { + width: 150 }, + isForm: false, }, { - label: '自动提交', - field: 'autoCommit', - sort: 'custom', - isSearch: false, - }, - { - label: '自动通过', - field: 'autoAgree', - sort: 'custom', - isSearch: false, - }, - { - label: '自动执行', - field: 'autoExecute', - sort: 'custom', - isSearch: false, - }, - { - label: '直接生成记录', - field: 'directCreateRecord', + label: '备注', + field: 'remark', sort: 'custom', isSearch: false, }, + { + label: '自动提交', + field: 'autoCommit', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: requestsettingData.autoCommit, + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE', + disabled: true + } + } + }, + { + label: '自动通过', + field: 'autoAgree', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: requestsettingData.autoAgree, + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE', + disabled: true + } + } + }, + { + label: '自动执行', + field: 'autoExecute', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: requestsettingData.autoExecute, + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE', + disabled: true + } + } + }, + { + label: '直接生成记录', + field: 'directCreateRecord', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'Switch', + value: requestsettingData.directCreateRecord, + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE', + disabled: true + } + } + }, + { label: '到库区类型范围', field: 'toAreaTypes', + dictType: DICT_TYPE.LOCATION_TYPE, + dictClass: 'string', + isTable: true, sort: 'custom', - isSearch: false, + table: { + width: 150 + }, + isForm: false, }, { - label: '到库区范围', + label: '到库区代码范围', field: 'toAreaCodes', sort: 'custom', isSearch: false, - }, - { - label: '发货日期', - field: 'deliverDate', - sort: 'custom', - formatter: dateFormatter, - isSearch: false, - search: { - component: 'DatePicker', - componentProps: { - valueFormat: 'YYYY-MM-DD HH:mm:ss', - type: 'daterange', - defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] - } - }, - form: { - component: 'DatePicker', - componentProps: { - type: 'datetime', - valueFormat: 'x' - } + table: { + width: 120 }, + isForm: false }, { label: '入库库存状态范围', field: 'inInventoryStatuses', - sort: 'custom', isSearch: false, + table: { + width: 170 + }, + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isTable: true, + sort: 'custom', + tableForm: { + disabled: true, + type: 'Select', + width: 150 + }, + isForm: false }, { label: '出库库存状态范围', field: 'outInventoryStatuses', sort: 'custom', isSearch: false, + table: { + width: 170 + }, + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isTable: true, + tableForm: { + disabled: true, + type: 'Select', + width: 150 + }, + isForm: false }, { label: '操作', @@ -215,16 +442,70 @@ export const StockupMainRequest = useCrudSchemas(reactive([ // 表单校验 export const StockupDetailRequestRules = reactive({ - itemCode: [required], + packingNumber: [ + { required: true, message: '请选择包装号', trigger: 'change' } + ], + batch: [ + { required: true, message: '请选择批次', trigger: 'change' } + ], + inventoryStatus: [ + { required: true, message: '请选择库存状态', trigger: 'change' } + ], + uom: [ + { required: true, message: '请选择计量单位', trigger: 'change' } + ], + itemCode: [ + { required: true, message: '请选择物料代码', trigger: 'change' } + ], + toLocationCode : [ + { required: true, message: '请选择计量单位', trigger: 'change' } + ] }) -//子表 +// //子表 export const StockupDetailRequest = useCrudSchemas(reactive([ { label: '包装号', field: 'packingNumber', sort: 'custom', - isSearch: true, + table: { + width: 150 + }, + tableForm:{ + isInpuFocusShow: true, // 开启查询弹窗 + searchListPlaceholder: '请选择包装号', + searchField: 'packingNumber', + searchTitle: '库存余额信息', + searchAllSchemas: Balance.allSchemas, + searchPage: BalanceApi.getBalanceItemPage, + searchCondition: [ + // { + // key:'customerCode', // 查询列表中字段 + // value:'customerCode', // 指主表某字段 + // message: '请选择客户代码!', // 当前置条件为空时 弹出信息提示 + // isMainValue: true // 表示查询条件是主表的字段的值 + // } + ] + }, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择包装号', + searchField: 'packingNumber', + searchTitle: '库存余额信息', + searchAllSchemas: Balance.allSchemas, + searchPage: BalanceApi.getBalanceItemPage, + searchCondition: [ + // { + // key:'customerCode', // 查询列表中字段 + // value:'customerCode', // 指主表某字段 + // message: '请选择客户代码!', // 当前置条件为空时 弹出信息提示 + // isMainValue: true // 表示查询条件是主表的字段的值 + // } + ] + } + } }, { label: '器具号', @@ -241,45 +522,77 @@ export const StockupDetailRequest = useCrudSchemas(reactive([ { label: '库存状态', field: 'inventoryStatus', + dictType: DICT_TYPE.INVENTORY_STATUS, + dictClass: 'string', + isTable: true, sort: 'custom', - isSearch: true, - form: { - component: 'Radio' + table: { + width: 150 }, + tableForm: { + disabled: true, + type: 'Select' + }, + form: { + componentProps: { + disabled: true + } + } }, { label: '到货主代码', field: 'toOwnerCode', sort: 'custom', isSearch: true, + isTableForm: false, }, { label: '到库位代码', field: 'toLocationCode', sort: 'custom', isSearch: true, + tableForm:{ + isInpuFocusShow: true, // 开启查询弹窗 + searchListPlaceholder: '请选择库位代码', + searchField: 'location', + searchTitle: '库位基础信息', + searchAllSchemas: Location.allSchemas, + searchPage: locationApi.getLocationPage, + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + }, + form: { + componentProps: { + isSearchList: true, + searchListPlaceholder: '请选择库位代码', + searchField: 'location', + searchTitle: '库位基础信息', + searchAllSchemas: Location.allSchemas, + searchPage: locationApi.getLocationPage, + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + }] + } + } }, { label: '主表ID', field: 'masterId', sort: 'custom', isSearch: true, - form: { - component: 'InputNumber', - value: 0 - }, + isTableForm: false, }, { label: '单据号', field: 'number', sort: 'custom', isSearch: true, - }, - { - label: '备注', - field: 'remark', - sort: 'custom', - isSearch: true, + isTableForm: false, }, { label: '创建时间', @@ -295,37 +608,49 @@ export const StockupDetailRequest = useCrudSchemas(reactive([ defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')] } }, - isForm: false, + isTableForm: false, }, { label: '物品代码', field: 'itemCode', sort: 'custom', isSearch: true, + tableForm: { + disabled: true + }, + form: { + componentProps: { + disabled: true + } + } }, { label: '物品名称', field: 'itemName', sort: 'custom', isSearch: true, + isTableForm: false, }, { label: '物品描述1', field: 'itemDesc1', sort: 'custom', isSearch: true, + isTableForm: false, }, { label: '物品描述2', field: 'itemDesc2', sort: 'custom', isSearch: true, + isTableForm: false, }, { label: '项目代码', field: 'projectCode', sort: 'custom', isSearch: true, + isTableForm: false, }, { label: '数量', @@ -336,6 +661,25 @@ export const StockupDetailRequest = useCrudSchemas(reactive([ { label: '计量单位', field: 'uom', + dictType: DICT_TYPE.UOM, + dictClass: 'string', + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + tableForm: { + disabled: true + }, + form: { + componentProps: { + disabled: true + } + } + }, + { + label: '备注', + field: 'remark', sort: 'custom', isSearch: true, }, @@ -344,15 +688,7 @@ export const StockupDetailRequest = useCrudSchemas(reactive([ field: 'fromOwnerCode', sort: 'custom', isSearch: true, - }, - { - label: '操作', - field: 'action', - isForm: false, - table: { - width: 150, - fixed: 'right' - } + isTableForm: false, } ]))