|
|
@ -422,6 +422,19 @@ const isShowMainButtonLabel = (row, val) => { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 根据状态返回该按钮是否显示 |
|
|
|
const isReGenLabelShowMainButtonLabel = (row, val) => { |
|
|
|
if (val.indexOf(row.status) > -1) { |
|
|
|
if(row.labelStatus == '1'){ |
|
|
|
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 |
|
|
@ -449,6 +462,16 @@ const butttondata = (row,$index) => { |
|
|
|
hasPermi: 'wms:supplierdeliver-request-main:genLabels', |
|
|
|
link: true // 文本展现按钮 |
|
|
|
}, |
|
|
|
{ |
|
|
|
label: t('ts.重新生成标签'), |
|
|
|
name: 'ressbq', |
|
|
|
hide: isReGenLabelShowMainButtonLabel(row, ['3']), |
|
|
|
type: 'primary', |
|
|
|
icon: '', |
|
|
|
color: '', |
|
|
|
hasPermi: 'wms:supplierdeliver-request-main:genLabels', |
|
|
|
link: true // 文本展现按钮 |
|
|
|
}, |
|
|
|
defaultButtons.mainListPointBtn({ hide: isShowMainButton(row, ['3','8']),hasPermi: 'wms:supplierdeliver-request-main:printLabel' }), // 标签打印 |
|
|
|
//defaultButtons.mainListDocumentPrintBtn({ hide: isShowMainButton(row, ['3','8']) }), // 单据打印 |
|
|
|
// 生成记录 |
|
|
@ -503,6 +526,26 @@ const buttonTableClick = async (val, row) => { |
|
|
|
genLabelId.value = row.masterId |
|
|
|
await getDetailList() |
|
|
|
formLabelRef.value.open('create', row, null,'createLabel')//创建标签页面 createLabel 标题 |
|
|
|
} else if( val == 'ressbq'){ |
|
|
|
console.log("重新生成标签") |
|
|
|
ElMessageBox.confirm(t('ts.重新生成标签会删除上次生成的标签,是否确认继续?'), '提示', { |
|
|
|
confirmButtonText: t('ts.确 认'), |
|
|
|
cancelButtonText: t('ts.取 消') |
|
|
|
}).then(() => { |
|
|
|
SupplierdeliverRequestMainApi.deleteOldLabels(row.masterId).then(async res =>{ |
|
|
|
if(res){ |
|
|
|
// 生成标签 |
|
|
|
detatableData.params = { |
|
|
|
masterId:row.masterId |
|
|
|
} |
|
|
|
genLabelId.value = row.masterId |
|
|
|
await getDetailList() |
|
|
|
formLabelRef.value.open('create', row, null,'createLabel')//创建标签页面 createLabel 标题 |
|
|
|
} |
|
|
|
}) |
|
|
|
}).catch(() => { |
|
|
|
console.info('操作取消') |
|
|
|
}) |
|
|
|
} else if (val == 'point') { |
|
|
|
// 标签打印 |
|
|
|
labelPrint(row) |
|
|
|