| | |
| | | }, |
| | | toolbarConfig: {//表头按钮 |
| | | buttons: [ |
| | | // {code: 'empty', name: '清空报工数量'}, |
| | | // {code: 'sameCompletion', name: '完工相同'}, |
| | | // {code: 'sameDamage', name: '次破相同'}, |
| | | // {code: 'sameOneCompletion', name: '完工一列相同'}, |
| | | // {code: 'sameOneDamage', name: '次破一列相同'}, |
| | | {code: 'saveReportingWork', name: t('basicData.save'), status: 'primary', icon: 'vxe-icon-save',disabled:true}, |
| | | {code: 'saveReportingWorkReview', name: t('reportingWorks.saveAndReview'), status: 'primary', icon: 'vxe-icon-save',disabled:true}, |
| | | {code: 'saveWorkStorage', name: t('reportingWorks.saveWorkStorage'), status: 'primary', icon: 'vxe-icon-save'}, |
| | | ], |
| | | // import: false, |
| | | // export: true, |
| | | // print: true, |
| | | zoom: true, |
| | | custom: true |
| | | }, |
| | |
| | | |
| | | //下拉款选择工序时查询 |
| | | const getWork = () => { |
| | | |
| | | let processId = titleUploadData.value.processId |
| | | if (processId == "" || processId == null) { |
| | | ElMessage.warning(t('reportingWorks.theProcessCardNumberCannotBeEmpty')) |
| | |
| | | } |
| | | }); |
| | | xGrid.value.reloadData(modifiedCollection) |
| | | hideButton() |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | | } |
| | |
| | | } |
| | | |
| | | const hideButton = () => { |
| | | if (btnValue == false){ |
| | | const els = document.querySelectorAll('.inventory_content'); |
| | | //获取最后一道工序 |
| | | const parts = technologicalProcess.split('->'); |
| | | let last = parts[parts.length - 1]; |
| | | if (last === '') { |
| | | last = null; |
| | | } |
| | | const els = document.querySelectorAll('.inventory_content'); |
| | | //是否显示报工入库相关按钮内容 |
| | | if (btnValue == false || last != titleUploadData.value.thisProcess){ |
| | | els.forEach(el => { |
| | | el.style.display = 'none'; |
| | | }); |
| | | } else { |
| | | els.forEach(el => { |
| | | el.style.display = ''; |
| | | }); |
| | | let buttons = { |
| | | code: 'saveWorkStorage', |
| | | name: t('reportingWorks.saveWorkStorage'), |
| | | status: 'primary', |
| | | icon: 'vxe-icon-save' |
| | | } |
| | | gridOptions.toolbarConfig.buttons.push(buttons) |
| | | } |
| | | gridOptions.toolbarConfig.buttons = gridOptions.toolbarConfig.buttons.filter(button => { |
| | | // 如果 type 不为空时,隐藏 print 按钮 |
| | | if (btnValue == false && button.code === 'saveWorkStorage') { |
| | | if (btnValue == false || last != titleUploadData.value.thisProcess && button.code === 'saveWorkStorage' ) { |
| | | return false; // 隐藏 print 按钮 |
| | | } |
| | | |