|
|
@ -236,6 +236,33 @@ const isShowMainButton = (row,val) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 根据状态返回该按钮是否显示-针对生成备料计划 |
|
|
|
const isShowMainButtonBl = (row,val) => { |
|
|
|
if (val.indexOf(row.status) > -1) { |
|
|
|
if (row.preparetoissueIsCreate == 'TRUE') { |
|
|
|
return true |
|
|
|
} else { |
|
|
|
return false |
|
|
|
} |
|
|
|
} else { |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 根据状态返回该按钮是否显示-针对生收货申请 |
|
|
|
const isShowMainButtonSh = (row,val) => { |
|
|
|
if (val.indexOf(row.status) > -1) { |
|
|
|
if (row.productreceiptIsCreate == 'TRUE') { |
|
|
|
return true |
|
|
|
} else { |
|
|
|
return false |
|
|
|
} |
|
|
|
} else { |
|
|
|
return true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 列表-操作按钮 |
|
|
|
const butttondata = (row,$index) => { |
|
|
|
const findIndex = row['masterId']?tableObject.tableList.findIndex(item=>item['masterId'] == row['masterId']):-1 |
|
|
@ -252,20 +279,20 @@ const butttondata = (row,$index) => { |
|
|
|
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: '' |
|
|
|
// }, |
|
|
|
{ |
|
|
|
label: '生成备料计划', |
|
|
|
name: 'scbljh', |
|
|
|
hide: isShowMainButtonBl(row,['6']), |
|
|
|
type: 'primary', |
|
|
|
icon: 'Select', |
|
|
|
hasPermi:'wms:production-main:publish', |
|
|
|
link: true, // 文本展现按钮 |
|
|
|
color: '' |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: '生成收货申请', |
|
|
|
name: 'scshsq', |
|
|
|
hide: isShowMainButton(row,['6']), |
|
|
|
hide: isShowMainButtonSh(row,['6']), |
|
|
|
type: 'primary', |
|
|
|
icon: 'Select', |
|
|
|
hasPermi:'wms:production-main:publish', |
|
|
@ -302,7 +329,29 @@ const buttonTableClick = async (val, row) => { |
|
|
|
if (row.available == 'FALSE') return message.warning('当前数据:【不可用】') |
|
|
|
await message.confirm('确认要提交审批吗?') |
|
|
|
tableObject.loading = true |
|
|
|
await ProductionMainApi.submit(row.masterId).then(() => { |
|
|
|
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() |
|
|
|
}).catch(err => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
// 生成收货申请 |
|
|
|
tableObject.loading = true |
|
|
|
ProductionMainApi.generateProductreceiptRequest(row.number).then(() => { |
|
|
|
// message.success(t('common.createSuccess')) |
|
|
|
tableObject.loading = false |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} |
|
|
|
message.success(t('common.updateSuccess')) |
|
|
|
tableObject.loading = false |
|
|
|
getList() |
|
|
@ -347,6 +396,26 @@ const buttonTableClick = async (val, row) => { |
|
|
|
await message.confirm('物料:【'+rs +'】目前为不可用状态,是否继续发布?').catch(() => { |
|
|
|
isAvailable = false |
|
|
|
}) |
|
|
|
// 生成备料计划 |
|
|
|
tableObject.loading = true |
|
|
|
await ProductionMainApi.generatePreparetoissue(row.number).then(() => { |
|
|
|
// message.success(t('common.createSuccess')) |
|
|
|
tableObject.loading = false |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
// 生成收货申请 |
|
|
|
tableObject.loading = true |
|
|
|
await ProductionMainApi.generateProductreceiptRequest(row.number).then(() => { |
|
|
|
// message.success(t('common.createSuccess')) |
|
|
|
tableObject.loading = false |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
if (!isAvailable) { |
|
|
@ -514,7 +583,31 @@ const submitForm = async (formType, submitData) => { |
|
|
|
try { |
|
|
|
if (formType === 'create') { |
|
|
|
data.subList = tableData.value // 拼接子表数据参数 |
|
|
|
await ProductionMainApi.createProductionMain(data) |
|
|
|
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() |
|
|
|
}).catch(err => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
// 生成收货申请 |
|
|
|
tableObject.loading = true |
|
|
|
ProductionMainApi.generateProductreceiptRequest(res.number).then(() => { |
|
|
|
// message.success(t('common.createSuccess')) |
|
|
|
tableObject.loading = false |
|
|
|
getList() |
|
|
|
}).catch(err => { |
|
|
|
tableObject.loading = false |
|
|
|
console.log(err) |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
message.success(t('common.createSuccess')) |
|
|
|
} else { |
|
|
|
await ProductionMainApi.updateProductionMain(data) |
|
|
@ -523,6 +616,7 @@ const submitForm = async (formType, submitData) => { |
|
|
|
formRef.value.dialogVisible = false |
|
|
|
// 刷新当前列表 |
|
|
|
getList() |
|
|
|
|
|
|
|
} finally { |
|
|
|
formRef.value.formLoading = false |
|
|
|
} |
|
|
|