|
|
@ -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) |
|
|
|