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) => { export const createSupplieritem = async (data: SupplieritemVO) => {
return await request.post({ url: `/wms/supplieritem/create`, data }) 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) => { export const updateSupplieritem = async (data: SupplieritemVO) => {
return await request.put({ url: `/wms/supplieritem/update`, data }) 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) => { export const deleteSupplieritem = async (id: number) => {
return await request.delete({ url: `/wms/supplieritem/delete?id=` + id }) 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 // 导出供应商物料 Excel
export const exportSupplieritem = async (params) => { export const exportSupplieritem = async (params) => {

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

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

Loading…
Cancel
Save