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 }) 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.mainListPlanResBtn({hide:isShowMainButton(row,['4']),hasPermi:'wms:production-main:resetting'}), //
defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:update'}), // defaultButtons.mainListEditBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:update'}), //
// defaultButtons.mainListDeleteBtn({hide:isShowMainButton(row,['1']),hasPermi:'wms:production-main:delete'}), // // 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) => { const buttonTableClick = async (val, row) => {
if (val == 'mainPlanOpe') { // if (val == 'mainPlanOpe') { //
tableObject.loading = true 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')) message.success(t('common.updateSuccess'))
tableObject.loading = false tableObject.loading = false
getList() getList()
@ -233,7 +247,7 @@ const buttonTableClick = async (val, row) => {
} else if (val == 'mainPlanClo') { // } else if (val == 'mainPlanClo') { //
await message.confirm('确认要关闭吗?') await message.confirm('确认要关闭吗?')
tableObject.loading = true tableObject.loading = true
ProductionMainApi.close(row.id).then(() => { await ProductionMainApi.close(row.id).then(() => {
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
tableObject.loading = false tableObject.loading = false
getList() getList()
@ -245,7 +259,11 @@ const buttonTableClick = async (val, row) => {
if (row.available == 'FALSE') return message.warning('当前数据:【不可用】') if (row.available == 'FALSE') return message.warning('当前数据:【不可用】')
await message.confirm('确认要提交审批吗?') await message.confirm('确认要提交审批吗?')
tableObject.loading = true 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')) message.success(t('common.updateSuccess'))
tableObject.loading = false tableObject.loading = false
getList() getList()
@ -256,7 +274,7 @@ const buttonTableClick = async (val, row) => {
} else if (val == 'mainPlanTur') { // } else if (val == 'mainPlanTur') { //
await message.confirm('确认要驳回吗?') await message.confirm('确认要驳回吗?')
tableObject.loading = true tableObject.loading = true
ProductionMainApi.reject(row.id).then(() => { await ProductionMainApi.reject(row.id).then(() => {
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
tableObject.loading = false tableObject.loading = false
getList() getList()
@ -268,7 +286,11 @@ const buttonTableClick = async (val, row) => {
if (row.available == 'FALSE') return message.warning('当前数据:【不可用】') if (row.available == 'FALSE') return message.warning('当前数据:【不可用】')
await message.confirm('确认要审批通过吗?') await message.confirm('确认要审批通过吗?')
tableObject.loading = true 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')) message.success(t('common.updateSuccess'))
tableObject.loading = false tableObject.loading = false
getList() getList()
@ -296,7 +318,11 @@ const buttonTableClick = async (val, row) => {
return return
} }
tableObject.loading = true 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')) message.success(t('common.updateSuccess'))
tableObject.loading = false tableObject.loading = false
getList() getList()
@ -307,7 +333,7 @@ const buttonTableClick = async (val, row) => {
} else if (val == 'mainPlanRes') { // } else if (val == 'mainPlanRes') { //
await message.confirm('确认要重置吗?') await message.confirm('确认要重置吗?')
tableObject.loading = true tableObject.loading = true
ProductionMainApi.resetting(row.id).then(() => { await ProductionMainApi.resetting(row.id).then(() => {
message.success(t('common.updateSuccess')) message.success(t('common.updateSuccess'))
tableObject.loading = false tableObject.loading = false
getList() getList()
@ -315,11 +341,24 @@ const buttonTableClick = async (val, row) => {
tableObject.loading = false tableObject.loading = false
console.log(err) 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') { // } else if (val == 'edit') { //
openForm('update', row) openForm('update', row)
} else if (val == 'delete') { // } else if (val == 'delete') { //
handleDelete(row.id) handleDelete(row.id)
} }
} }
/** 添加/修改操作 */ /** 添加/修改操作 */
@ -421,7 +460,12 @@ const submitForm = async (formType, data) => {
try { try {
if (formType === 'create') { if (formType === 'create') {
data.subList = tableData.value // 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')) message.success(t('common.createSuccess'))
} else { } else {
await ProductionMainApi.updateProductionMain(data) await ProductionMainApi.updateProductionMain(data)

Loading…
Cancel
Save