Browse Source

修改生成计划到备料计划及备料计划到发料申请逻辑

hella_online_20240829
陈薪名 4 months ago
parent
commit
9eca17d93d
  1. 6
      src/api/wms/preparetoissueMain/index.ts
  2. 5
      src/api/wms/productionMain/index.ts
  3. 32
      src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/index.vue
  4. 35
      src/views/wms/productionManage/productionplan/productionMain/index.vue
  5. 33
      src/views/wms/productionManage/productionplan/productionMainAssemble/index.vue
  6. 32
      src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/index.vue
  7. 35
      src/views/wms/productionManage/productionplan/productionMainPredictSparePart/index.vue

6
src/api/wms/preparetoissueMain/index.ts

@ -107,3 +107,9 @@ export const publish = (id) => {
export const resetting = (id) => {
return request.put({ url: '/wms/preparetoissue-main/resetting?id=' + id })
}
// 创建发料申请
export const generateIssueRequest = (number) => {
return request.post({ url: '/wms/preparetoissue-main/generateIssueRequest?number=' + number })
}

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

@ -189,6 +189,11 @@ export const generateProductreceiptRequest = (number) => {
return request.post({ url: '/wms/production-main/generateProductreceiptRequest?number=' + number })
}
// 创建发料申请
export const generateIssueRequest = (number) => {
return request.post({ url: '/wms/preparetoissue-main/generateIssueRequest?number=' + number })
}

32
src/views/wms/issueManage/preparetoissueplan/preparetoissueMain/index.vue

@ -252,7 +252,7 @@ const butttondata = (row,$index) => {
return []
}
return [
defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:preparetoissue-main:open'}), //
defaultButtons.mainListPlanOpeBtn({hide:isShowMainButton(row,['5']),hasPermi:'wms:preparetoissue-main:open'}), //
defaultButtons.mainListPlanCloBtn({hide:isShowMainButton(row,['1','2','3','4']),hasPermi:'wms:preparetoissue-main:close'}), //
defaultButtons.mainListPlanSubBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:preparetoissue-main:submit'}), //
defaultButtons.mainListPlanTurBtn({hide:isShowMainButton(row,['2']),hasPermi:'wms:preparetoissue-main:reject'}), //
@ -261,6 +261,16 @@ const butttondata = (row,$index) => {
defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4']),hasPermi:'wms:preparetoissue-main:resetting'}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:preparetoissue-main:update'}), //
// defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:preparetoissue-main:delete'}), //
{
label: '生成发料申请',
name: 'scflsq',
hide: isShowMainButton(row,['6']),
type: 'primary',
icon: 'Select',
hasPermi:'wms:preparetoissue-main:publish',
link: true, //
color: ''
},
]
}
@ -329,6 +339,7 @@ const buttonTableClick = async (val, row) => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
PreparetoissueMainApi.generateIssueRequest(row.number)
}).catch(err => {
tableObject.loading = false
console.log(err)
@ -344,6 +355,18 @@ const buttonTableClick = async (val, row) => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'scflsq') { //
if (row.available == 'FALSE') return message.warning('当前数据:【不可用】')
await message.confirm('确认要生成发料申请吗?')
tableObject.loading = true
await PreparetoissueMainApi.generateIssueRequest(row.number).then(() => {
message.success(t('common.createSuccess'))
tableObject.loading = false
getList()
}).catch(err => {
tableObject.loading = false
console.log(err)
})
} else if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
@ -458,7 +481,12 @@ const submitForm = async (formType, submitData) => {
data.subList = tableData.value //
try {
if (formType === 'create') {
await PreparetoissueMainApi.createPreparetoissueMain(data)
await PreparetoissueMainApi.createPreparetoissueMain(data).then((res) => {
if (res.status == '6') {
//
PreparetoissueMainApi.generateIssueRequest(res.number)
}
})
message.success(t('common.createSuccess'))
} else {
await PreparetoissueMainApi.updatePreparetoissueMain(data)

35
src/views/wms/productionManage/productionplan/productionMain/index.vue

@ -332,13 +332,8 @@ const buttonTableClick = async (val, row) => {
await ProductionMainApi.submit(row.masterId).then((res) => {
if (res.status == '6') {
//
// tableObject.loading = true
ProductionMainApi.generatePreparetoissue(row.number).then(() => {
// message.success(t('common.createSuccess'))
// tableObject.loading = false
// getList()
ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => {
//
// tableObject.loading = true
ProductionMainApi.generateProductreceiptRequest(row.number).then(() => {
message.success(t('common.createSuccess'))
tableObject.loading = false
@ -347,11 +342,11 @@ const buttonTableClick = async (val, row) => {
tableObject.loading = false
console.log(err)
})
//
ProductionMainApi.generateIssueRequest(PreparetoissueRes.number)
}).catch(err => {
// tableObject.loading = false
console.log(err)
//
// tableObject.loading = true
ProductionMainApi.generateProductreceiptRequest(row.number).then(() => {
message.success(t('common.createSuccess'))
tableObject.loading = false
@ -408,12 +403,8 @@ const buttonTableClick = async (val, row) => {
})
//
tableObject.loading = true
ProductionMainApi.generatePreparetoissue(row.number).then(() => {
// message.success(t('common.createSuccess'))
// tableObject.loading = false
// getList()
ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => {
//
// tableObject.loading = true
ProductionMainApi.generateProductreceiptRequest(row.number).then(() => {
message.success(t('common.createSuccess'))
tableObject.loading = false
@ -422,11 +413,11 @@ const buttonTableClick = async (val, row) => {
tableObject.loading = false
console.log(err)
})
//
ProductionMainApi.generateIssueRequest(PreparetoissueRes.number)
}).catch(err => {
// tableObject.loading = false
console.log(err)
//
// tableObject.loading = true
ProductionMainApi.generateProductreceiptRequest(row.number).then(() => {
message.success(t('common.createSuccess'))
tableObject.loading = false
@ -465,10 +456,12 @@ const buttonTableClick = async (val, row) => {
if (row.available == 'FALSE') return message.warning('当前数据:【不可用】')
await message.confirm('确认要生成备料计划吗?')
tableObject.loading = true
await ProductionMainApi.generatePreparetoissue(row.number).then(() => {
await ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => {
message.success(t('common.createSuccess'))
tableObject.loading = false
getList()
//
ProductionMainApi.generateIssueRequest(PreparetoissueRes.number)
}).catch(err => {
tableObject.loading = false
console.log(err)
@ -608,12 +601,8 @@ const submitForm = async (formType, submitData) => {
if (res.status == '6') {
//
tableObject.loading = true
ProductionMainApi.generatePreparetoissue(res.number).then(() => {
// message.success(t('common.createSuccess'))
// tableObject.loading = false
// getList()
ProductionMainApi.generatePreparetoissue(res.number).then((PreparetoissueRes) => {
//
// tableObject.loading = true
ProductionMainApi.generateProductreceiptRequest(res.number).then(() => {
message.success(t('common.createSuccess'))
tableObject.loading = false
@ -622,11 +611,11 @@ const submitForm = async (formType, submitData) => {
tableObject.loading = false
console.log(err)
})
//
ProductionMainApi.generateIssueRequest(PreparetoissueRes.number)
}).catch(err => {
// tableObject.loading = false
console.log(err)
//
// tableObject.loading = true
ProductionMainApi.generateProductreceiptRequest(res.number).then(() => {
message.success(t('common.createSuccess'))
tableObject.loading = false

33
src/views/wms/productionManage/productionplan/productionMainAssemble/index.vue

@ -329,13 +329,8 @@ const buttonTableClick = async (val, row) => {
await ProductionMainApi.submit(row.masterId).then((res) => {
if (res.status == '6') {
//
// tableObject.loading = true
ProductionMainApi.generatePreparetoissue(row.number).then(() => {
// message.success(t('common.createSuccess'))
// tableObject.loading = false
// getList()
ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => {
//
// tableObject.loading = true
ProductionMainApi.generateProductreceiptRequest(row.number).then(() => {
message.success(t('common.createSuccess'))
tableObject.loading = false
@ -344,6 +339,8 @@ const buttonTableClick = async (val, row) => {
tableObject.loading = false
console.log(err)
})
//
ProductionMainApi.generateIssueRequest(PreparetoissueRes.number)
}).catch(err => {
// tableObject.loading = false
console.log(err)
@ -405,12 +402,8 @@ const buttonTableClick = async (val, row) => {
})
//
tableObject.loading = true
ProductionMainApi.generatePreparetoissue(row.number).then(() => {
// message.success(t('common.createSuccess'))
// tableObject.loading = false
// getList()
ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => {
//
// tableObject.loading = true
ProductionMainApi.generateProductreceiptRequest(row.number).then(() => {
message.success(t('common.createSuccess'))
tableObject.loading = false
@ -419,11 +412,11 @@ const buttonTableClick = async (val, row) => {
tableObject.loading = false
console.log(err)
})
//
ProductionMainApi.generateIssueRequest(PreparetoissueRes.number)
}).catch(err => {
// tableObject.loading = false
console.log(err)
//
// tableObject.loading = true
ProductionMainApi.generateProductreceiptRequest(row.number).then(() => {
message.success(t('common.createSuccess'))
tableObject.loading = false
@ -462,10 +455,12 @@ const buttonTableClick = async (val, row) => {
if (row.available == 'FALSE') return message.warning('当前数据:【不可用】')
await message.confirm('确认要生成备料计划吗?')
tableObject.loading = true
await ProductionMainApi.generatePreparetoissue(row.number).then(() => {
await ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => {
message.success(t('common.createSuccess'))
tableObject.loading = false
getList()
//
ProductionMainApi.generateIssueRequest(PreparetoissueRes.number)
}).catch(err => {
tableObject.loading = false
console.log(err)
@ -604,12 +599,8 @@ const submitForm = async (formType, submitData) => {
if (res.status == '6') {
//
tableObject.loading = true
ProductionMainApi.generatePreparetoissue(res.number).then(() => {
// message.success(t('common.createSuccess'))
// tableObject.loading = false
// getList()
ProductionMainApi.generatePreparetoissue(res.number).then((PreparetoissueRes) => {
//
// tableObject.loading = true
ProductionMainApi.generateProductreceiptRequest(res.number).then(() => {
message.success(t('common.createSuccess'))
tableObject.loading = false
@ -618,11 +609,11 @@ const submitForm = async (formType, submitData) => {
tableObject.loading = false
console.log(err)
})
//
ProductionMainApi.generateIssueRequest(PreparetoissueRes.number)
}).catch(err => {
// tableObject.loading = false
console.log(err)
//
// tableObject.loading = true
ProductionMainApi.generateProductreceiptRequest(res.number).then(() => {
message.success(t('common.createSuccess'))
tableObject.loading = false

32
src/views/wms/productionManage/productionplan/productionMainAssembleSparePart/index.vue

@ -328,13 +328,8 @@ const buttonTableClick = async (val, row) => {
await ProductionMainApi.submit(row.masterId).then((res) => {
if (res.status == '6') {
//
// tableObject.loading = true
ProductionMainApi.generatePreparetoissue(row.number).then(() => {
// message.success(t('common.createSuccess'))
// tableObject.loading = false
// getList()
ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => {
//
// tableObject.loading = true
ProductionMainApi.generateProductreceiptRequest(row.number).then(() => {
message.success(t('common.createSuccess'))
tableObject.loading = false
@ -343,6 +338,8 @@ const buttonTableClick = async (val, row) => {
tableObject.loading = false
console.log(err)
})
//
ProductionMainApi.generateIssueRequest(PreparetoissueRes.number)
}).catch(err => {
// tableObject.loading = false
console.log(err)
@ -404,12 +401,8 @@ const buttonTableClick = async (val, row) => {
})
//
tableObject.loading = true
ProductionMainApi.generatePreparetoissue(row.number).then(() => {
// message.success(t('common.createSuccess'))
// tableObject.loading = false
// getList()
ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => {
//
// tableObject.loading = true
ProductionMainApi.generateProductreceiptRequest(row.number).then(() => {
message.success(t('common.createSuccess'))
tableObject.loading = false
@ -418,6 +411,8 @@ const buttonTableClick = async (val, row) => {
tableObject.loading = false
console.log(err)
})
//
ProductionMainApi.generateIssueRequest(PreparetoissueRes.number)
}).catch(err => {
// tableObject.loading = false
console.log(err)
@ -461,10 +456,12 @@ const buttonTableClick = async (val, row) => {
if (row.available == 'FALSE') return message.warning('当前数据:【不可用】')
await message.confirm('确认要生成备料计划吗?')
tableObject.loading = true
await ProductionMainApi.generatePreparetoissue(row.number).then(() => {
await ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => {
message.success(t('common.createSuccess'))
tableObject.loading = false
getList()
//
ProductionMainApi.generateIssueRequest(PreparetoissueRes.number)
}).catch(err => {
tableObject.loading = false
console.log(err)
@ -598,16 +595,11 @@ const submitForm = async (formType, submitData) => {
if (formType === 'create') {
data.subList = tableData.value //
await ProductionMainApi.createProductionMain(data).then((res) => {
// console.log(565,res)
if (res.status == '6') {
//
tableObject.loading = true
ProductionMainApi.generatePreparetoissue(res.number).then(() => {
// message.success(t('common.createSuccess'))
// tableObject.loading = false
// getList()
ProductionMainApi.generatePreparetoissue(res.number).then((PreparetoissueRes) => {
//
// tableObject.loading = true
ProductionMainApi.generateProductreceiptRequest(res.number).then(() => {
message.success(t('common.createSuccess'))
tableObject.loading = false
@ -616,11 +608,11 @@ const submitForm = async (formType, submitData) => {
tableObject.loading = false
console.log(err)
})
//
ProductionMainApi.generateIssueRequest(PreparetoissueRes.number)
}).catch(err => {
// tableObject.loading = false
console.log(err)
//
// tableObject.loading = true
ProductionMainApi.generateProductreceiptRequest(res.number).then(() => {
message.success(t('common.createSuccess'))
tableObject.loading = false

35
src/views/wms/productionManage/productionplan/productionMainPredictSparePart/index.vue

@ -328,13 +328,8 @@ const buttonTableClick = async (val, row) => {
await ProductionMainApi.submit(row.masterId).then((res) => {
if (res.status == '6') {
//
// tableObject.loading = true
ProductionMainApi.generatePreparetoissue(row.number).then(() => {
// message.success(t('common.createSuccess'))
// tableObject.loading = false
// getList()
ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => {
//
// tableObject.loading = true
ProductionMainApi.generateProductreceiptRequest(row.number).then(() => {
message.success(t('common.createSuccess'))
tableObject.loading = false
@ -343,11 +338,11 @@ const buttonTableClick = async (val, row) => {
tableObject.loading = false
console.log(err)
})
//
ProductionMainApi.generateIssueRequest(PreparetoissueRes.number)
}).catch(err => {
// tableObject.loading = false
console.log(err)
//
// tableObject.loading = true
ProductionMainApi.generateProductreceiptRequest(row.number).then(() => {
message.success(t('common.createSuccess'))
tableObject.loading = false
@ -404,12 +399,8 @@ const buttonTableClick = async (val, row) => {
})
//
tableObject.loading = true
ProductionMainApi.generatePreparetoissue(row.number).then(() => {
// message.success(t('common.createSuccess'))
// tableObject.loading = false
// getList()
ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => {
//
// tableObject.loading = true
ProductionMainApi.generateProductreceiptRequest(row.number).then(() => {
message.success(t('common.createSuccess'))
tableObject.loading = false
@ -418,11 +409,11 @@ const buttonTableClick = async (val, row) => {
tableObject.loading = false
console.log(err)
})
//
ProductionMainApi.generateIssueRequest(PreparetoissueRes.number)
}).catch(err => {
// tableObject.loading = false
console.log(err)
//
// tableObject.loading = true
ProductionMainApi.generateProductreceiptRequest(row.number).then(() => {
message.success(t('common.createSuccess'))
tableObject.loading = false
@ -461,10 +452,12 @@ const buttonTableClick = async (val, row) => {
if (row.available == 'FALSE') return message.warning('当前数据:【不可用】')
await message.confirm('确认要生成备料计划吗?')
tableObject.loading = true
await ProductionMainApi.generatePreparetoissue(row.number).then(() => {
await ProductionMainApi.generatePreparetoissue(row.number).then((PreparetoissueRes) => {
message.success(t('common.createSuccess'))
tableObject.loading = false
getList()
//
ProductionMainApi.generateIssueRequest(PreparetoissueRes.number)
}).catch(err => {
tableObject.loading = false
console.log(err)
@ -603,12 +596,8 @@ const submitForm = async (formType, submitData) => {
if (res.status == '6') {
//
tableObject.loading = true
ProductionMainApi.generatePreparetoissue(res.number).then(() => {
// message.success(t('common.createSuccess'))
// tableObject.loading = false
// getList()
ProductionMainApi.generatePreparetoissue(res.number).then((PreparetoissueRes) => {
//
// tableObject.loading = true
ProductionMainApi.generateProductreceiptRequest(res.number).then(() => {
message.success(t('common.createSuccess'))
tableObject.loading = false
@ -617,11 +606,11 @@ const submitForm = async (formType, submitData) => {
tableObject.loading = false
console.log(err)
})
//
ProductionMainApi.generateIssueRequest(PreparetoissueRes.number)
}).catch(err => {
// tableObject.loading = false
console.log(err)
//
// tableObject.loading = true
ProductionMainApi.generateProductreceiptRequest(res.number).then(() => {
message.success(t('common.createSuccess'))
tableObject.loading = false

Loading…
Cancel
Save