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. 44
      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

@ -130,3 +130,8 @@ export const queryPurchasereceiptSpareRecordBySupplier = async (params) => {
export const queryBalancePurchaseReceiptSpareReturn = async (params) => { export const queryBalancePurchaseReceiptSpareReturn = async (params) => {
return await request.get({ url: `/wms/purchasereturn-request-main/queryBalancePurchaseReceiptSpareReturn`, 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) => { export const genLabel = async (data) => {
return await request.post({ url: `/wms/purchasereturn-request-main/genLabel`, 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 })
}

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

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

Loading…
Cancel
Save