diff --git a/src/api/eam/basic/item/index.ts b/src/api/eam/basic/item/index.ts index f9ef0e0..f227cf4 100644 --- a/src/api/eam/basic/item/index.ts +++ b/src/api/eam/basic/item/index.ts @@ -33,6 +33,11 @@ export const getItemPage = async (params) => { } } +// 生成标签 +export const genDevice = async (data: ItemVO) => { + return await request.post({ url: `/eam/item/genDevice`,data}) +} + // 查询备件详情 export const getItem = async (id: number) => { return await request.get({ url: `/eam/item/get?id=` + id }) diff --git a/src/api/eam/item/itemApplyDetail/index.ts b/src/api/eam/item/itemApplyDetail/index.ts new file mode 100644 index 0000000..0e5a01c --- /dev/null +++ b/src/api/eam/item/itemApplyDetail/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/views/eam/basic/item/index.vue b/src/views/eam/basic/item/index.vue index 7a80ff1..951d821 100644 --- a/src/views/eam/basic/item/index.vue +++ b/src/views/eam/basic/item/index.vue @@ -34,7 +34,8 @@ - + diff --git a/src/views/eam/item/itemApplyMain/itemApplyMain.data.ts b/src/views/eam/item/itemApplyMain/itemApplyMain.data.ts index 628c851..d30b62a 100644 --- a/src/views/eam/item/itemApplyMain/itemApplyMain.data.ts +++ b/src/views/eam/item/itemApplyMain/itemApplyMain.data.ts @@ -1,13 +1,16 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' -// 表单校验 -export const ItemApplyMainRules = reactive({ - number: [required], - name: [required], - concurrencyStamp: [required], -}) +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: '申请编号', @@ -151,4 +154,163 @@ export const ItemApplyMain = useCrudSchemas(reactive([ fixed: 'right' } } -])) \ No newline at end of file +])) + +//表单校验 +export const ItemApplyMainRules = reactive({ + type: [ + { 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: 'remark', + table: { + width: 150 + }, + }, + { + label: '是否可用', + field: 'available', + dictType: DICT_TYPE.TRUE_FALSE, + dictClass: 'string', + isSearch: true, + isTable: true, + table: { + width: 150 + }, + tableForm: { + type: 'Select', + default: 'TRUE', + inactiveValue: 'FALSE', + activeValue: 'TRUE' + }, + form: { + component: 'Switch', + value: 'TRUE', + componentProps: { + inactiveValue: 'FALSE', + activeValue: 'TRUE' + } + } + }, + { + label: '创建时间', + field: 'createTime', + isTable: true, + isTableForm: false, + formatter: dateFormatter, + detail: { + dateFormat: 'YYYY-MM-DD HH:mm:ss' + }, + table: { + width: 180 + }, + isForm: false, + form: { + component: 'DatePicker', + componentProps: { + style: { width: '100%' }, + type: 'datetime', + dateFormat: 'YYYY-MM-DD HH:mm:ss', + valueFormat: 'x', + } + } + }, + { + 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/itemOrderMain.data.ts b/src/views/eam/item/itemOrderMain/itemOrderMain.data.ts index 3d31a85..3f9fa3e 100644 --- a/src/views/eam/item/itemOrderMain/itemOrderMain.data.ts +++ b/src/views/eam/item/itemOrderMain/itemOrderMain.data.ts @@ -1,6 +1,9 @@ import type { CrudSchema } from '@/hooks/web/useCrudSchemas' import { dateFormatter } from '@/utils/formatTime' +import * as SupplierApi from '@/api/eam/basic/supplier' +import { Supplier } from '@/views/eam/basic/supplier/supplier.data' + // 表单校验 export const ItemOrderMainRules = reactive({ number: [required], @@ -28,16 +31,6 @@ export const ItemOrderMain = useCrudSchemas(reactive([ } }, }, - { - label: '电话', - field: 'phone', - sort: 'custom', - }, - { - label: '传真', - field: 'fax', - sort: 'custom', - }, { label: '采购员', field: 'purchaser', @@ -47,27 +40,30 @@ export const ItemOrderMain = useCrudSchemas(reactive([ label: '供应商编号', field: 'supplierNumber', sort: 'custom', + isSearch: true, + form: { + // labelMessage: '信息提示说明!!!', + componentProps: { + isSearchList: true, // 开启查询弹窗 + searchListPlaceholder: '请选择库区编号', // 输入框占位文本 + searchField: 'number', // 查询弹窗赋值字段 + searchTitle: '库区信息', // 查询弹窗标题 + searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类 + searchPage: SupplierApi.getSupplierPage, // 查询弹窗所需分页方法 + searchCondition: [ + { + key: 'available', + value: "TRUE", + isMainValue: false + }] + } + } }, { label: '供应商名称', field: 'supplierName', sort: 'custom', }, - { - label: '供应商地址', - field: 'supplierAddress', - sort: 'custom', - }, - { - label: '发货至', - field: 'shipTo', - sort: 'custom', - }, - { - label: '开票至', - field: 'invoiceTo', - sort: 'custom', - }, { label: '联系人', field: 'contacts', @@ -78,50 +74,6 @@ export const ItemOrderMain = useCrudSchemas(reactive([ field: 'contactsPhone', sort: 'custom', }, - { - label: '付款方式', - field: 'paymentType', - sort: 'custom', - form: { - component: 'Select' - }, - }, - { - label: '注册地', - field: 'registLocation', - sort: 'custom', - }, - { - label: '开户行', - field: 'bank', - sort: 'custom', - }, - { - label: '账号', - field: 'account', - sort: 'custom', - }, - { - label: '税号', - field: 'dutyParagraph', - sort: 'custom', - }, - { - label: '创建时间', - field: 'createTime', - sort: 'custom', - formatter: dateFormatter, - isSearch: true, - 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')] - } - }, - isForm: false, - }, { label: '是否可用', field: 'available', @@ -156,4 +108,4 @@ export const ItemOrderMain = useCrudSchemas(reactive([ fixed: 'right' } } -])) +])) \ No newline at end of file