yejiaxing
10 months ago
5 changed files with 567 additions and 280 deletions
@ -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' }) |
|||
} |
@ -1,111 +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() // 国际化
|
|||
|
|||
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<CrudSchema[]>([ |
|||
{ |
|||
label: '订单号', |
|||
label: '申请编号', |
|||
field: 'number', |
|||
sort: 'custom', |
|||
isForm: false, |
|||
isSearch: true, |
|||
table: { |
|||
width: 180, |
|||
fixed: 'left' |
|||
}, |
|||
}, |
|||
{ |
|||
label: '日期', |
|||
field: 'date', |
|||
label: '申领人', |
|||
field: 'applyId', |
|||
sort: 'custom', |
|||
formatter: dateFormatter, |
|||
form: { |
|||
component: 'DatePicker', |
|||
componentProps: { |
|||
type: 'datetime', |
|||
valueFormat: 'x' |
|||
} |
|||
isForm: false, |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '审批人', |
|||
field: 'approveId', |
|||
sort: 'custom', |
|||
isForm: false, |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '采购员', |
|||
field: 'purchaser', |
|||
label: '出库人', |
|||
field: 'outId', |
|||
sort: 'custom', |
|||
isForm: false, |
|||
isSearch: true, |
|||
}, |
|||
{ |
|||
label: '供应商编号', |
|||
field: 'supplierNumber', |
|||
label: '描述', |
|||
field: 'name', |
|||
sort: 'custom', |
|||
}, |
|||
{ |
|||
label: '是否可用', |
|||
field: 'available', |
|||
dictType: DICT_TYPE.TRUE_FALSE, |
|||
dictClass: 'string', |
|||
isSearch: true, |
|||
isTable: true, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
tableForm: { |
|||
type: 'Select', |
|||
inactiveValue: 'FALSE', |
|||
disabled: true |
|||
}, |
|||
form: { |
|||
// labelMessage: '信息提示说明!!!',
|
|||
component: 'Switch', |
|||
value: 'TRUE', |
|||
componentProps: { |
|||
isSearchList: true, // 开启查询弹窗
|
|||
searchListPlaceholder: '请选择库区编号', // 输入框占位文本
|
|||
searchField: 'number', // 查询弹窗赋值字段
|
|||
searchTitle: '库区信息', // 查询弹窗标题
|
|||
searchAllSchemas: Supplier.allSchemas, // 查询弹窗所需类
|
|||
searchPage: SupplierApi.getSupplierPage, // 查询弹窗所需分页方法
|
|||
searchCondition: [ |
|||
{ |
|||
key: 'available', |
|||
value: "TRUE", |
|||
isMainValue: false |
|||
}] |
|||
inactiveValue: 'FALSE', |
|||
activeValue: 'TRUE' |
|||
} |
|||
} |
|||
}, |
|||
{ |
|||
label: '供应商名称', |
|||
field: 'supplierName', |
|||
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<CrudSchema[]>([ |
|||
{ |
|||
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: 'contacts', |
|||
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: 'contactsPhone', |
|||
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, |
|||
sort: 'custom', |
|||
table: { |
|||
width: 150 |
|||
}, |
|||
tableForm: { |
|||
type: 'Select', |
|||
inactiveValue: 'FALSE', |
|||
disabled: true |
|||
}, |
|||
form: { |
|||
component: 'Switch', |
|||
value: 'TRUE', |
|||
componentProps: { |
|||
inactiveValue: 'FALSE', |
|||
activeValue: '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 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' } |
|||
], |
|||
}) |
|||
|
Loading…
Reference in new issue