Browse Source

维修备件退货申请--编辑功能

hella_online_20241017
yufei_wang 2 months ago
parent
commit
60c69ef589
  1. 5
      src/api/wms/purchasereturnRequestDetail/index.ts
  2. 7
      src/api/wms/purchasereturnRequestMain/index.ts
  3. 46
      src/views/wms/purchasereceiptManage/purchasereturnspare/purchasereturnRequestSpareMain/index.vue
  4. 2
      src/views/wms/purchasereceiptManage/purchasereturnspare/purchasereturnRequestSpareMain/purchasereturnRequestSpareMainNew.data.ts

5
src/api/wms/purchasereturnRequestDetail/index.ts

@ -129,4 +129,9 @@ export const queryPurchasereceiptSpareRecordBySupplier = async (params) => {
// 维修退货申请子表数据
export const queryBalancePurchaseReceiptSpareReturn = async (params) => {
return await request.get({ url: `/wms/purchasereturn-request-main/queryBalancePurchaseReceiptSpareReturn`, params })
}
// 查询采购退货申请子列表
export const editReturnSpareNew = async (params) => {
return await request.get({ url: `/wms/purchasereturn-request-main/editReturnSpareNew`, params })
}

7
src/api/wms/purchasereturnRequestMain/index.ts

@ -170,3 +170,10 @@ export const handlePurchasereturnRequestMainNew = async (id) => {
export const genLabel = async (data) => {
return await request.post({ url: `/wms/purchasereturn-request-main/genLabel`, data })
}
// 修改采购退货申请主
export const updateReturnSpareNew = async (data) => {
return await request.post({ url: `/wms/purchasereturn-request-main/updateReturnSpareNew
`, data })
}

46
src/views/wms/purchasereceiptManage/purchasereturnspare/purchasereturnRequestSpareMain/index.vue

@ -82,7 +82,7 @@
:tableAllSchemas="PurchasereturnRequestDetailNew.allSchemas"
:tableFormRules="PurchasereturnRequestDetailRulesNew"
:tableData="tableData"
:apiUpdate="PurchasereturnRequestMainApi.updatePurchasereturnRequestMain"
:apiUpdate="PurchasereturnRequestMainApi.updateReturnSpareNew"
:apiCreate="PurchasereturnRequestMainApi.createPurchasereturnRequestMain"
:isBusiness="true"
:isShowButton="false"
@ -200,7 +200,6 @@ const tableColumns = ref([
...PurchasereturnRequestDetail.allSchemas.tableMainColumns
])
const isShowButton = ref(true)
//
const updataTableColumns = (val) => {
@ -628,32 +627,35 @@ const formRef = ref()
const openForm = async (type: string, row?: number) => {
originTableData.value = [] //
tableData.value = [] //
isShowButton.value = true
if (type == 'create') {
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => {
if (item.field == 'supplierCode') {
item.componentProps.disabled = true
item.componentProps.isSearchList = true
}
if (item.field == 'purchaseReceiptRecordNumber') {
item.componentProps.disabled = true
item.componentProps.isSearchList = true
}
})
}
if (type == 'update') {
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => {
let updateData = await PurchasereturnRequestDetailApi.editReturnSpareNew({
masterId:row.masterId
})
if(updateData&&updateData['receiptNumber']){
updateData['hahaha'] = updateData['receiptNumber']
}else{
updateData['hehehe'] = updateData['poNumber']
}
updateData['masterId'] = row['masterId']
PurchasereturnRequestMainNew.allSchemas.formSchema.forEach((item) => {
if (item.field == 'supplierCode') {
item.componentProps.disabled = true
item.componentProps.isSearchList = false
}
if (item.field == 'purchaseReceiptRecordNumber') {
item.componentProps.disabled = true
item.componentProps.isSearchList = false
})
console.log('updateData',updateData)
console.log('row',row)
tableData.value = updateData.subList||[]
formRef.value.open(type, updateData)
}else{
PurchasereturnRequestMainNew.allSchemas.formSchema.forEach((item) => {
if (item.field == 'supplierCode') {
item.componentProps.disabled = false
item.componentProps.isSearchList = true
}
})
formRef.value.open(type,null)
}
formRef.value.open(type, row)
}
//
@ -797,7 +799,6 @@ const handleDeleteTable = (item, index, formRef) => {
tableData.value.splice(itemIndex, 1)
}
if (tableData.value.length == 0) {
isShowButton.value = true
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => {
if (item.field == 'supplierCode') {
item.componentProps.disabled = false
@ -808,7 +809,6 @@ const handleDeleteTable = (item, index, formRef) => {
const tableSelectionDelete = (selection) => {
tableData.value = tableData.value.filter((item) => !selection.includes(item))
if (tableData.value.length == 0) {
isShowButton.value = true
PurchasereturnRequestMain.allSchemas.formSchema.forEach((item) => {
if (item.field == 'supplierCode') {
item.componentProps.disabled = false
@ -863,7 +863,7 @@ const submitForm = async (formType, submitData) => {
message.success(t('common.createSuccess'))
} else {
data.returnSourceType='2'
await PurchasereturnRequestMainApi.updatePurchasereturnRequestMain(data)
await PurchasereturnRequestMainApi.updateReturnSpareNew(data)
message.success(t('common.updateSuccess'))
}
formRef.value.dialogVisible = false

2
src/views/wms/purchasereceiptManage/purchasereturnspare/purchasereturnRequestSpareMain/purchasereturnRequestSpareMainNew.data.ts

@ -376,7 +376,7 @@ export const PurchasereturnRequestMainRulesNew = reactive({
// { required: true, message: '请选择订单行', trigger: 'blur' }
// ],
locationCode: [
{ required: true, message: '请选择收货单明细', trigger: 'blur' }
{ required: true, message: '请选择退货库位', trigger: 'blur' }
]
})

Loading…
Cancel
Save