Browse Source

备料计划 拆分发布和生产申请

master_hella_20240701
陈薪名 9 months ago
parent
commit
217bec31d0
  1. 5
      src/api/wms/productionMain/index.ts
  2. 60
      src/views/wms/productionManage/productionplan/productionMain/index.vue

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

@ -108,6 +108,11 @@ export const resetting = (id) => {
return request.put({ url: '/wms/production-main/resetting?id=' + id })
}
// 创建备料计划/制品收货申请
export const generateRequest = (number) => {
return request.post({ url: '/wms/production-main/generateRequest?number=' + number })
}

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

@ -215,6 +215,16 @@ const butttondata = (row) => {
defaultButtons.mainListPlanResBtn({hide:isShowMainButton(row,['4']),hasPermi:'wms:production-main:resetting'}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:update'}), //
// defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:delete'}), //
{
label: '生成备料计划/收货申请',
name: 'scbljh',
hide: isShowMainButton(row,['6']),
type: 'primary',
icon: 'Select',
hasPermi:'wms:production-main:publish',
link: true, //
color: ''
},
]
}
@ -222,7 +232,11 @@ const butttondata = (row) => {
const buttonTableClick = async (val, row) => {
if (val == 'mainPlanOpe') { //
tableObject.loading = true
ProductionMainApi.open(row.id).then(() => {
await ProductionMainApi.open(row.id).then(async () => {
await ProductionMainApi.generateRequest(row.number).then(() => {
}).catch(err => {
console.log(err)
})
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
@ -233,7 +247,7 @@ const buttonTableClick = async (val, row) => {
} else if (val == 'mainPlanClo') { //
await message.confirm('确认要关闭吗?')
tableObject.loading = true
ProductionMainApi.close(row.id).then(() => {
await ProductionMainApi.close(row.id).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
@ -245,7 +259,11 @@ const buttonTableClick = async (val, row) => {
if (row.available == 'FALSE') return message.warning('当前数据:【不可用】')
await message.confirm('确认要提交审批吗?')
tableObject.loading = true
ProductionMainApi.submit(row.id).then(() => {
await ProductionMainApi.submit(row.id).then(async () => {
await ProductionMainApi.generateRequest(row.number).then(() => {
}).catch(err => {
console.log(err)
})
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
@ -256,7 +274,7 @@ const buttonTableClick = async (val, row) => {
} else if (val == 'mainPlanTur') { //
await message.confirm('确认要驳回吗?')
tableObject.loading = true
ProductionMainApi.reject(row.id).then(() => {
await ProductionMainApi.reject(row.id).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
@ -268,7 +286,11 @@ const buttonTableClick = async (val, row) => {
if (row.available == 'FALSE') return message.warning('当前数据:【不可用】')
await message.confirm('确认要审批通过吗?')
tableObject.loading = true
ProductionMainApi.agree(row.id).then(() => {
await ProductionMainApi.agree(row.id).then(async () => {
await ProductionMainApi.generateRequest(row.number).then(() => {
}).catch(err => {
console.log(err)
})
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
@ -296,7 +318,11 @@ const buttonTableClick = async (val, row) => {
return
}
tableObject.loading = true
ProductionMainApi.publish(row.id).then(() => {
await ProductionMainApi.publish(row.id).then(async () => {
await ProductionMainApi.generateRequest(row.number).then(() => {
}).catch(err => {
console.log(err)
})
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
@ -307,7 +333,7 @@ const buttonTableClick = async (val, row) => {
} else if (val == 'mainPlanRes') { //
await message.confirm('确认要重置吗?')
tableObject.loading = true
ProductionMainApi.resetting(row.id).then(() => {
await ProductionMainApi.resetting(row.id).then(() => {
message.success(t('common.updateSuccess'))
tableObject.loading = false
getList()
@ -315,11 +341,24 @@ const buttonTableClick = async (val, row) => {
tableObject.loading = false
console.log(err)
})
} else if(val == 'scbljh') {
if (row.available == 'FALSE') return message.warning('当前数据:【不可用】')
await message.confirm('确认要生成备料计划/收货申请吗?')
tableObject.loading = true
await ProductionMainApi.generateRequest(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') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
@ -421,7 +460,12 @@ const submitForm = async (formType, data) => {
try {
if (formType === 'create') {
data.subList = tableData.value //
await ProductionMainApi.createProductionMain(data)
await ProductionMainApi.createProductionMain(data).then(async res => {
await ProductionMainApi.generateRequest(res).catch(err => {
formRef.value.formLoading = false
console.log(err)
})
})
message.success(t('common.createSuccess'))
} else {
await ProductionMainApi.updateProductionMain(data)

Loading…
Cancel
Save