Browse Source

供应商物料SCP区分

master_hella_20240701
wangyufei 4 months ago
parent
commit
c167421658
  1. 11
      src/api/wms/supplieritem/index.ts
  2. 22
      src/views/wms/basicDataManage/supplierManage/supplieritem/index.vue

11
src/api/wms/supplieritem/index.ts

@ -51,16 +51,27 @@ export const getSupplieritem = async (id: number) => {
export const createSupplieritem = async (data: SupplieritemVO) => {
return await request.post({ url: `/wms/supplieritem/create`, data })
}
export const createSupplieritemSCP = async (data: SupplieritemVO) => {
return await request.post({ url: `/wms/supplieritem/createSCP`, data })
}
// 修改供应商物料
export const updateSupplieritem = async (data: SupplieritemVO) => {
return await request.put({ url: `/wms/supplieritem/update`, data })
}
// 修改供应商物料
export const updateSupplieritemSCP = async (data: SupplieritemVO) => {
return await request.put({ url: `/wms/supplieritem/updateSCP`, data })
}
// 删除供应商物料
export const deleteSupplieritem = async (id: number) => {
return await request.delete({ url: `/wms/supplieritem/delete?id=` + id })
}
export const deleteSupplieritemSCP = async (id: number) => {
return await request.delete({ url: `/wms/supplieritem/deleteSCP?id=` + id })
}
// 导出供应商物料 Excel
export const exportSupplieritem = async (params) => {

22
src/views/wms/basicDataManage/supplierManage/supplieritem/index.vue

@ -44,8 +44,8 @@
@success="formsSuccess"
:rules="SupplieritemRules"
:formAllSchemas="Supplieritem.allSchemas"
:apiUpdate="SupplieritemApi.updateSupplieritem"
:apiCreate="SupplieritemApi.createSupplieritem"
:apiUpdate="routeName.includes('SCP')?SupplieritemApi.updateSupplieritemSCP:SupplieritemApi.updateSupplieritem"
:apiCreate="routeName.includes('SCP')?SupplieritemApi.createSupplieritemSCP:SupplieritemApi.createSupplieritem"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
@ -189,10 +189,18 @@ const formsSuccess = async (formType,data) => {
if(data.activeTime==0)data.activeTime = null;
if(data.expireTime==0)data.expireTime = null;
if (formType === 'create') {
await SupplieritemApi.createSupplieritem(data)
if(routeName.value.includes('SCP')){
await SupplieritemApi.createSupplieritemSCP(data)
}else{
await SupplieritemApi.createSupplieritem(data)
}
message.success(t('common.createSuccess'))
} else {
await SupplieritemApi.updateSupplieritem(data)
if(routeName.value.includes('SCP')){
await SupplieritemApi.updateSupplieritemSCP(data)
}else{
await SupplieritemApi.updateSupplieritem(data)
}
message.success(t('common.updateSuccess'))
}
basicFormRef.value.dialogVisible = false
@ -221,7 +229,11 @@ const handleDelete = async (id: number) => {
await message.delConfirm()
tableObject.loading = true
//
await SupplieritemApi.deleteSupplieritem(id)
if(routeName.value.includes('SCP')){
await SupplieritemApi.deleteSupplieritem(id)
}else{
await SupplieritemApi.deleteSupplieritem(id)
}
tableObject.loading = false
message.success(t('common.delSuccess'))
//

Loading…
Cancel
Save