diff --git a/src/api/eam/item/applicationRecordDetail/index.ts b/src/api/eam/item/applicationRecordDetail/index.ts new file mode 100644 index 0000000..0e5a01c --- /dev/null +++ b/src/api/eam/item/applicationRecordDetail/index.ts @@ -0,0 +1,57 @@ +import request from '@/config/axios' + +export interface ItemApplyDetailVO { + number: string + name: string + type: string + applyId: number + applyDeptId: number + approveId: number + approveTime: Date + outId: number + outTime: Date + siteId: string + available: string + concurrencyStamp: number +} + +// 查询备件申领记录主列表 +export const getItemApplyDetailPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/item-apply-detail/senior', data }) + } else { + return await request.get({ url: `/eam/item-apply-detail/page`, params }) + } +} + +// 查询备件申领记录主详情 +export const getItemApplyDetail = async (id: number) => { + return await request.get({ url: `/eam/item-apply-detail/get?id=` + id }) +} + +// 新增备件申领记录主 +export const createItemApplyDetail = async (data: ItemApplyDetailVO) => { + return await request.post({ url: `/eam/item-apply-detail/create`, data }) +} + +// 修改备件申领记录主 +export const updateItemApplyDetail = async (data: ItemApplyDetailVO) => { + return await request.put({ url: `/eam/item-apply-detail/update`, data }) +} + +// 删除备件申领记录主 +export const deleteItemApplyDetail = async (id: number) => { + return await request.delete({ url: `/eam/item-apply-detail/delete?id=` + id }) +} + +// 导出备件申领记录主 Excel +export const exportItemApplyDetail = async (params) => { + return await request.download({ url: `/eam/item-apply-detail/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/item-apply-detail/get-import-template' }) +} diff --git a/src/api/eam/item/applicationRecordMain/index.ts b/src/api/eam/item/applicationRecordMain/index.ts new file mode 100644 index 0000000..fd0e19e --- /dev/null +++ b/src/api/eam/item/applicationRecordMain/index.ts @@ -0,0 +1,57 @@ +import request from '@/config/axios' + +export interface ItemApplyMainVO { + number: string + name: string + type: string + applyId: number + applyDeptId: number + approveId: number + approveTime: Date + outId: number + outTime: Date + siteId: string + available: string + concurrencyStamp: number +} + +// 查询备件申领记录主列表 +export const getItemApplyMainPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/item-apply-main/senior', data }) + } else { + return await request.get({ url: `/eam/item-apply-main/page`, params }) + } +} + +// 查询备件申领记录主详情 +export const getItemApplyMain = async (id: number) => { + return await request.get({ url: `/eam/item-apply-main/get?id=` + id }) +} + +// 新增备件申领记录主 +export const createItemApplyMain = async (data: ItemApplyMainVO) => { + return await request.post({ url: `/eam/item-apply-main/create`, data }) +} + +// 修改备件申领记录主 +export const updateItemApplyMain = async (data: ItemApplyMainVO) => { + return await request.put({ url: `/eam/item-apply-main/update`, data }) +} + +// 删除备件申领记录主 +export const deleteItemApplyMain = async (id: number) => { + return await request.delete({ url: `/eam/item-apply-main/delete?id=` + id }) +} + +// 导出备件申领记录主 Excel +export const exportItemApplyMain = async (params) => { + return await request.download({ url: `/eam/item-apply-main/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/item-apply-main/get-import-template' }) +} \ No newline at end of file diff --git a/src/api/eam/item/itemOrderMain/index.ts b/src/api/eam/item/itemOrderMain/index.ts index cd41d81..125851b 100644 --- a/src/api/eam/item/itemOrderMain/index.ts +++ b/src/api/eam/item/itemOrderMain/index.ts @@ -54,6 +54,12 @@ export const deleteItemOrderMain = async (id: number) => { return await request.delete({ url: `/eam/item-order-main/delete?id=` + id }) } +// 关闭采购订单主 +export const closeItemOrderMain = async (id: number) => { + return await request.post({ url: `/eam/item-order-main/close?id=` + id }) +} + + // 导出备件采购订单主 Excel export const exportItemOrderMain = async (params) => { return await request.download({ url: `/eam/item-order-main/export-excel`, params }) @@ -62,4 +68,4 @@ export const exportItemOrderMain = async (params) => { // 下载用户导入模板 export const importTemplate = () => { return request.download({ url: '/eam/item-order-main/get-import-template' }) -} \ No newline at end of file +} diff --git a/src/utils/dict.ts b/src/utils/dict.ts index 1da1f92..03804d8 100644 --- a/src/utils/dict.ts +++ b/src/utils/dict.ts @@ -286,4 +286,8 @@ export enum DICT_TYPE { JX_STATUS = 'JX_STATUS', //检修状态, EXECUTION_CYCLE = 'execution_cycle', //模具保养周期 MOLD_EXECUTION_CYCLE = 'mold_execution_cycle', //模具保养周期 + GET_ORDER_STATUS = 'get_order_status', //模具保养周期 + IS_OPEN = 'is_open', //是否打开 + + } diff --git a/src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts b/src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts index b998313..26b0201 100644 --- a/src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts +++ b/src/views/eam/basic/deviceMaintenance/deviceMaintenance.data.ts @@ -99,21 +99,6 @@ export const DeviceMaintenance = useCrudSchemas(reactive([ } }, }, - { - label: '保养类型', - field: 'maintenanceType', - dictType: DICT_TYPE.MAINTENANCE_TYPE, - dictClass: 'string', - sort: 'custom', - isSearch: false, - form: { - component: 'Select', - value: 'CYCLE', - componentProps: { - disabled: true - } - }, - }, { label: '保养类型', field: 'executionCycle', @@ -121,9 +106,9 @@ export const DeviceMaintenance = useCrudSchemas(reactive([ dictClass: 'string', sort: 'custom', isSearch: false, - form: { - component: 'Select' - }, + form: { + component: 'Select' + }, }, { label: '是否可用', @@ -159,4 +144,4 @@ export const DeviceMaintenance = useCrudSchemas(reactive([ fixed: 'right' } } -])) +])) \ No newline at end of file diff --git a/src/views/eam/basic/item/index.vue b/src/views/eam/basic/item/index.vue index 3cebf94..39c6638 100644 --- a/src/views/eam/basic/item/index.vue +++ b/src/views/eam/basic/item/index.vue @@ -126,7 +126,7 @@ const searchTableRef = ref() const openItem = (number : String) => { itemNumber.value = number; - searchTableRef.value.open('设备列表', DeviceAccounts.allSchemas, DeviceAccountsApi.getDeviceAccountsPage, null, Item.allSchemas.searchSchema, true, null, null, null, null); + searchTableRef.value.open('设备列表', DeviceAccounts.allSchemas, DeviceAccountsApi.getDeviceAccountsPage(), null, Item.allSchemas.searchSchema, true, null, null, null, null); } const submitItem = async (formFieldRef, searchFieldRef, selections, typeRef, rowRef) => { @@ -217,4 +217,4 @@ onMounted(async () => { getList() }) - \ No newline at end of file + diff --git a/src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts b/src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts index e53eb78..1578537 100644 --- a/src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts +++ b/src/views/eam/basic/moldMaintenance/moldMaintenance.data.ts @@ -99,18 +99,6 @@ export const MoldMaintenance = useCrudSchemas(reactive([ } }, }, - { - label: '保养类型', - field: 'maintenanceType', - dictType: DICT_TYPE.MAINTENANCE_TYPE, - dictClass: 'string', - sort: 'custom', - isSearch: false, - form: { - component: 'Select' - }, - }, - { label: '保养周期', field: 'executionCycle', diff --git a/src/views/eam/item/applicationRecord/index.vue b/src/views/eam/item/applicationRecord/index.vue new file mode 100644 index 0000000..8a9a020 --- /dev/null +++ b/src/views/eam/item/applicationRecord/index.vue @@ -0,0 +1,285 @@ + + + \ No newline at end of file diff --git a/src/views/eam/item/applicationRecord/itemApplyMain.data.ts b/src/views/eam/item/applicationRecord/itemApplyMain.data.ts new file mode 100644 index 0000000..5a49b10 --- /dev/null +++ b/src/views/eam/item/applicationRecord/itemApplyMain.data.ts @@ -0,0 +1,269 @@ +import type { CrudSchema } from '@/hooks/web/useCrudSchemas' +import { dateFormatter } from '@/utils/formatTime' +import { Item } from '@/views/eam/basic/item/item.data' +import * as ItemApi from '@/api/eam/basic/item' +import { validateHanset, validateEmail } from '@/utils/validator' +const { t } = useI18n() // 国际化 + +/** + * @returns {Array} 备件申请主表 + */ +export const ItemApplyMain = useCrudSchemas(reactive([ + { + label: '领用编号', + field: 'number', + sort: 'custom', + isForm: false, + isSearch: true, + table: { + width: 180, + fixed: 'left' + }, + }, + { + label: '申领人', + field: 'applyId', + sort: 'custom', + isForm: false, + isSearch: false, + }, + { + label: '审批人', + field: 'approveId', + sort: 'custom', + isForm: false, + isSearch: false, + }, + { + label: '出库人', + field: 'outId', + sort: 'custom', + isForm: false, + isSearch: false, + }, + { + label: '描述', + field: 'name', + sort: 'custom', + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: false, + isTable: true, + sort: 'custom', + table: { + width: 150 + }, + tableForm: { + type: 'Select', + inactiveValue: 'FALSE', + disabled: true + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false, + table: { + width: 200, + fixed: 'right' + } + } +])) + +//表单校验 +export const ItemApplyMainRules = reactive({ + name: [ + { required: true, message: '请填写描述', trigger: 'change' } + ], + remark: [ + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 备件申请子表 + */ +export const ItemApplyDetail = useCrudSchemas(reactive([ + { + label: '备件编号', + field: 'itemNumber', + sort: 'custom', + isSearch: true, + tableForm: { + isInpuFocusShow: true, + searchListPlaceholder: '请选择备件编号', + searchField: 'number', + searchTitle: '库区信息', + searchAllSchemas: Item.allSchemas, // 查询弹窗所需类 + searchPage: ItemApi.getItemPage, // 查询弹窗所需分页方法 + searchCondition: [{ + key: 'available', + value: 'TRUE', + isMainValue: false + } + ] + }, + }, + { + label: '数量', + field: 'qty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + componentProps: { + min: 1, + precision: 6 + } + }, + tableForm: { + type: 'InputNumber', + min: 1, + precision: 6 + } + }, + { + label: '库存数量', + field: 'currentQty', + sort: 'custom', + table: { + width: 150 + }, + form: { + component: 'InputNumber', + componentProps: { + min: 1, + precision: 6 + } + }, + tableForm: { + type: 'InputNumber', + min: 1, + precision: 6 + } + }, + { + label: '是否可用', + field: 'available', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 150 + }, + tableForm: { + type: 'Select', + disabled: true + } + }, + + + { + label: '是否以旧换新', + field: 'isRadeIn', + sort: 'custom', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 150 + }, + tableForm: { + type: 'Select', + disabled: true + } + }, + { + label: '备注', + field: 'remark', + table: { + width: 150 + }, + }, + + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false, + table: { + width: 150, + fixed: 'right' + }, + isTableForm: false, + } +])) + +//表单校验 +export const ItemApplyDetailRules = reactive({ + lineNumber: [ + { required: true, message: '请输入行号', trigger: 'blur' }, + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + stdPackQty: [ + { required: true, message: '请输入标包数量', trigger: 'blur' } + ], + stdPackUnit: [ + { required: true, message: '请选择标包单位', trigger: 'change' } + ], + convertRate: [ + { required: true, message: '请输入转换率', trigger: 'blur' } + ], + taxRate: [ + { required: true, message: '请输入税率', trigger: 'blur' } + ], + shippedQty: [ + { required: true, message: '请输入已发货数量', trigger: 'blur' } + ], + receivedQty: [ + { required: true, message: '请输入已收货数量', trigger: 'blur' } + ], + returnedQty: [ + { required: true, message: '请输入已退货数量', trigger: 'blur' } + ], + putawayQty: [ + { required: true, message: '请输入已上架数量', trigger: 'blur' } + ], + overReceivingPercent: [ + { required: true, message: '请输入超收百分比', trigger: 'blur' } + ], + orderQty: [ + { required: true, message: '请输入订单数量', trigger: 'blur' } + ], + uom: [ + { required: true, message: '请选择计量单位', trigger: 'change' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], + nuumber: [ + { required: true, message: '请输入单据号', trigger: 'blur' } + ], + itemCode: [ + { required: true, message: '请选择物品代码', trigger: 'change' } + ], + remark: [ + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], +}) diff --git a/src/views/eam/item/itemOrderMain/index.vue b/src/views/eam/item/itemOrderMain/index.vue index 2dc882d..d6c0ebc 100644 --- a/src/views/eam/item/itemOrderMain/index.vue +++ b/src/views/eam/item/itemOrderMain/index.vue @@ -102,9 +102,7 @@ } // 子表新增的时候选择表格之后需要会显得字段 - // const Echo = ['ppNumber','poLine', 'batch', 'altBatch', 'itemCode', 'itemName', 'itemDesc1', 'itemDesc2', 'projectCode', 'qty', 'uom'] const Echo = [] - const { tableObject, tableMethods } = useTable({ getListApi: ItemOrderMainApi.getItemOrderMainPage // 分页接口 }) @@ -145,10 +143,10 @@ console.log('其他按钮', item) } } - + // 根据状态返回该按钮是否显示 const isShowMainButton = (row, val) => { - if (val.indexOf(row.status) > -1) { + if (val.indexOf(row.available) > -1) { return false } else { return true @@ -158,6 +156,7 @@ // 列表-操作按钮 const butttondata = (row) => { return [ + defaultButtons.mainListOrderCloBtn({ hide: isShowMainButton(row, ['TRUE']) }), // 关闭 defaultButtons.mainListEditBtn(null), // 编辑 defaultButtons.mainListDeleteBtn(null), // 删除 ] @@ -167,7 +166,11 @@ const buttonTableClick = async (val, row) => { if (val == 'edit') { // 编辑 openForm('update', row) - } else if (val == 'delete') { // 删除 + } + else if (val == 'mainOrderClo') { // 关闭 + handleClose(row.id) + } + else if (val == 'delete') { // 删除 handleDelete(row.id) } } @@ -197,6 +200,19 @@ await getList() } catch { } } + + /** 关闭按钮操作 */ + const handleClose = async (id : number) => { + try { + // 关闭的二次确认 + await message.confirm('是否关闭所选中数据?') + // 发起关闭 + await ItemOrderMainApi.closeItemOrderMain(id) + message.success(t('关闭成功!')) + // 刷新列表 + await getList() + } catch { } + } /** 导出按钮操作 */ const exportLoading = ref(false) // 导出的加载中 @@ -282,4 +298,4 @@ getList() importTemplateData.templateUrl = await ItemOrderMainApi.importTemplate() }) - \ No newline at end of file + diff --git a/src/views/eam/item/itemOrderMain/itemOrderMain.data.ts b/src/views/eam/item/itemOrderMain/itemOrderMain.data.ts index 50c351a..ec205e1 100644 --- a/src/views/eam/item/itemOrderMain/itemOrderMain.data.ts +++ b/src/views/eam/item/itemOrderMain/itemOrderMain.data.ts @@ -47,40 +47,39 @@ export const ItemOrderMain = useCrudSchemas(reactive([ sort: 'custom', }, { - label: '是否可用', - field: 'available', - dictType: DICT_TYPE.TRUE_FALSE, + label: '接收备件状态', + field: 'status', + sort: 'custom', + dictType: DICT_TYPE.GET_ORDER_STATUS, dictClass: 'string', - isSearch: false, isTable: true, + isForm: false, + tableForm: { + type: 'Select' + } + }, + { + label: '状态', + field: 'available', sort: 'custom', - table: { - width: 150 - }, + dictType: DICT_TYPE.IS_OPEN, + dictClass: 'string', + isTable: true, + isForm: true, tableForm: { - type: 'Select', - inactiveValue: 'FALSE', - disabled: true - }, - form: { - component: 'Switch', - value: 'TRUE', - componentProps: { - inactiveValue: 'FALSE', - activeValue: 'TRUE' - } + type: 'Select' } }, - { - label: '操作', - field: 'action', - isDetail: false, - isForm: false, - table: { - width: 200, - fixed: 'right' - } - } + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false, + table: { + width: 200, + fixed: 'right' + } + } ])) //表单校验 @@ -176,8 +175,8 @@ export const ItemOrderDetail = useCrudSchemas(reactive([ disabled: true } }, - - + + { label: '是否以旧换新', field: 'isRadeIn',