diff --git a/src/api/eam/item/itemOrderDetail/index.ts b/src/api/eam/item/itemOrderDetail/index.ts new file mode 100644 index 0000000..339c348 --- /dev/null +++ b/src/api/eam/item/itemOrderDetail/index.ts @@ -0,0 +1,65 @@ +import request from '@/config/axios' + +export interface ItemOrderDetailVO { + number: string + date: string + phone: string + fax: string + purchaser: string + supplierNumber: string + supplierName: string + supplierAddress: string + shipTo: string + invoiceTo: string + contacts: string + contactsPhone: string + paymentType: string + registLocation: string + bank: string + account: string + dutyParagraph: string + siteId: string + available: string + concurrencyStamp: number +} + +// 查询备件采购订单主列表 +export const getItemOrderDetailPage = async (params) => { + if (params.isSearch) { + delete params.isSearch + const data = {...params} + return await request.post({ url: '/eam/item-order-detail/senior', data }) + } else { + return await request.get({ url: `/eam/item-order-detail/page`, params }) + } +} + +// 查询备件采购订单主详情 +export const getItemOrderDetail = async (id: number) => { + return await request.get({ url: `/eam/item-order-detail/get?id=` + id }) +} + +// 新增备件采购订单主 +export const createItemOrderDetail = async (data: ItemOrderDetailVO) => { + return await request.post({ url: `/eam/item-order-detail/create`, data }) +} + +// 修改备件采购订单主 +export const updateItemOrderDetail = async (data: ItemOrderDetailVO) => { + return await request.put({ url: `/eam/item-order-detail/update`, data }) +} + +// 删除备件采购订单主 +export const deleteItemOrderDetail = async (id: number) => { + return await request.delete({ url: `/eam/item-order-detail/delete?id=` + id }) +} + +// 导出备件采购订单主 Excel +export const exportItemOrderDetail = async (params) => { + return await request.download({ url: `/eam/item-order-detail/export-excel`, params }) +} + +// 下载用户导入模板 +export const importTemplate = () => { + return request.download({ url: '/eam/item-order-detail/get-import-template' }) +} diff --git a/src/views/eam/item/itemApplyMain/index.vue b/src/views/eam/item/itemApplyMain/index.vue index c27930f..8a9a020 100644 --- a/src/views/eam/item/itemApplyMain/index.vue +++ b/src/views/eam/item/itemApplyMain/index.vue @@ -29,15 +29,15 @@ + :apiUpdate="ItemApplyMainApi.updateItemApplyMain" :apiCreate="ItemApplyMainApi.createItemApplyMain" + :isBusiness="true" @handleAddTable="handleAddTable" @handleDeleteTable="handleDeleteTable" + @searchTableSuccess="searchTableSuccess" @submitForm="submitForm" /> @@ -47,7 +47,7 @@ + \ No newline at end of file diff --git a/src/views/eam/item/itemApplyMain/itemApplyMain.data.ts b/src/views/eam/item/itemApplyMain/itemApplyMain.data.ts index f56c6da..f3202e5 100644 --- a/src/views/eam/item/itemApplyMain/itemApplyMain.data.ts +++ b/src/views/eam/item/itemApplyMain/itemApplyMain.data.ts @@ -71,15 +71,16 @@ export const ItemApplyMain = useCrudSchemas(reactive([ } } }, - { - label: '操作', - field: 'action', - isForm: false, - table: { - width: 150, - fixed: 'right' - } - } + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false, + table: { + width: 200, + fixed: 'right' + } + } ])) //表单校验 diff --git a/src/views/eam/item/itemOrderMain/index.vue b/src/views/eam/item/itemOrderMain/index.vue index beb75f3..2dc882d 100644 --- a/src/views/eam/item/itemOrderMain/index.vue +++ b/src/views/eam/item/itemOrderMain/index.vue @@ -4,219 +4,282 @@ - - + + - - + + /** 初始化 **/ + onMounted(async () => { + 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 3f9fa3e..06c1008 100644 --- a/src/views/eam/item/itemOrderMain/itemOrderMain.data.ts +++ b/src/views/eam/item/itemOrderMain/itemOrderMain.data.ts @@ -1,77 +1,49 @@ 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() // 国际化 -import * as SupplierApi from '@/api/eam/basic/supplier' -import { Supplier } from '@/views/eam/basic/supplier/supplier.data' - -// 表单校验 -export const ItemOrderMainRules = reactive({ - number: [required], - date: [required], - concurrencyStamp: [required], -}) - +/** + * @returns {Array} 备件申请主表 + */ export const ItemOrderMain = useCrudSchemas(reactive([ { - label: '订单号', + label: '申请编号', field: 'number', sort: 'custom', + isForm: false, isSearch: true, - }, - { - label: '日期', - field: 'date', - sort: 'custom', - formatter: dateFormatter, - form: { - component: 'DatePicker', - componentProps: { - type: 'datetime', - valueFormat: 'x' - } + table: { + width: 180, + fixed: 'left' }, }, { - label: '采购员', - field: 'purchaser', - sort: 'custom', - }, - { - label: '供应商编号', - field: 'supplierNumber', + label: '申领人', + field: 'applyId', sort: 'custom', + isForm: false, 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', + label: '审批人', + field: 'approveId', sort: 'custom', + isForm: false, + isSearch: true, }, { - label: '联系人', - field: 'contacts', + label: '出库人', + field: 'outId', sort: 'custom', + isForm: false, + isSearch: true, }, { - label: '联系电话', - field: 'contactsPhone', + label: '描述', + field: 'name', sort: 'custom', }, { @@ -99,13 +71,199 @@ export const ItemOrderMain = useCrudSchemas(reactive([ } } }, + { + label: '操作', + field: 'action', + isDetail: false, + isForm: false, + table: { + width: 200, + fixed: 'right' + } + } +])) + +//表单校验 +export const ItemOrderMainRules = reactive({ + name: [ + { required: true, message: '请填写描述', trigger: 'change' } + ], + remark: [ + { max: 50, message: '不得超过50个字符', trigger: 'blur' } + ], + available: [ + { required: true, message: '请选择是否可用', trigger: 'change' } + ], +}) + +/** + * @returns {Array} 备件申请子表 + */ +export const ItemOrderDetail = 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, } -])) \ No newline at end of file +])) + +//表单校验 +export const ItemOrderDetailRules = 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' } + ], +})