| | |
| | | {code: 'delete', name: t('basicData.delete'), status: 'primary'}, |
| | | {code: 'rack', name: t('processCard.combinedFrame'), status: 'primary'}, |
| | | ], |
| | | slots: { |
| | | tools: 'toolbar_buttons' |
| | | }, |
| | | import: false, |
| | | // export: true, |
| | | // print: true, |
| | |
| | | |
| | | let composingData = ref({ |
| | | composing: selectRecords, |
| | | userId: user.user.userId, |
| | | userName:user.user.userName |
| | | }) |
| | | |
| | | //修改排版状态 |
| | |
| | | reserve: true |
| | | } |
| | | |
| | | function exportExcel(url, fileName,date) { |
| | | if(date===null){ |
| | | ElMessage.warning(t('report.pleaseSelectADateFirst')) |
| | | return |
| | | } |
| | | |
| | | |
| | | const date1 = new Date(date[0]); |
| | | const date2 = new Date(date[1]); |
| | | const timeDiff = Math.abs(date2.getTime() - date1.getTime()); |
| | | const daysDiff = timeDiff / (1000 * 3600 * 24); |
| | | if(Math.floor(daysDiff)>180){ |
| | | ElMessage.warning(t('report.theFilteringTimeForExportCannotExceed180Days')) |
| | | return |
| | | } |
| | | let dataMp = ref({ |
| | | date: date, |
| | | }) |
| | | request.post(url,dataMp.value,{responseType :'blob'}).then(res => { |
| | | const blob = new Blob([res]) |
| | | if ('download' in document.createElement('a')) { // 非IE下载 |
| | | const elink = document.createElement('a') |
| | | elink.download = `${fileName}.xlsx` |
| | | elink.style.display = 'none' |
| | | elink.href = URL.createObjectURL(blob) |
| | | document.body.appendChild(elink) |
| | | elink.click() |
| | | URL.revokeObjectURL(elink.href) // 释放URL 对象 |
| | | document.body.removeChild(elink) |
| | | } else { // IE10+下载 |
| | | navigator.msSaveBlob(blob, fileName) |
| | | } |
| | | |
| | | }) |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | > |
| | | </vxe-pager> |
| | | </template> |
| | | <template #toolbar_buttons> |
| | | <vxe-button style="margin-right: 0.5rem" |
| | | @click="exportExcel('/processCard/exportDateProcess', |
| | | t('order.processCard'), |
| | | orderInfo.workOrderDate)"> |
| | | {{t('basicData.export')}}</vxe-button> |
| | | </template> |
| | | |
| | | </vxe-grid> |
| | | </div> |