| | |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true,gt:13 },//开启虚拟滚动 |
| | | scrollX:{ enabled: true,gt:15 },//开启虚拟滚动 |
| | | // scrollY:{ enabled: true,gt:13 },//开启虚拟滚动 |
| | | // scrollX:{ enabled: true,gt:15 },//开启虚拟滚动 |
| | | filterConfig: { //筛选配置项 |
| | | // remote: true |
| | | }, |
| | |
| | | columns:[ |
| | | |
| | | ], |
| | | mergeCells:[], |
| | | toolbarConfig: { |
| | | zoom: true, |
| | | // custom: true |
| | | custom: true |
| | | }, |
| | | spanMethod ({ row, rowIndex,column, columnIndex}) { |
| | | const field = column.field |
| | | if (xGrid.value.isFilter() ) { |
| | | return { rowspan: 1, colspan: 1 } |
| | | } |
| | | if(mergeCells.value!==undefined){ |
| | | if(mergeCells.value[field] !== undefined && mergeCells.value[field][rowIndex+"_"+field] !== undefined){ |
| | | return mergeCells.value[field][rowIndex+"_"+field] |
| | | } |
| | | } |
| | | |
| | | return { rowspan: 1, colspan: 1 } |
| | | }, |
| | | cellClassName ({ row, column,columnIndex}) { |
| | | if (columnIndex>10 && row.thisQuantity*1 === row.reportWorkQuantity[column.title]*1){ |
| | | return 'row-green' |
| | | if(column.field === undefined){ |
| | | return null |
| | | } |
| | | if (column?.field.indexOf('reportWorkQuantity.')>-1 && row.thisQuantity*1 === row.reportWorkQuantity[column.title]*1){ |
| | | return 'row-green' |
| | | } |
| | | return null |
| | | }, |
| | |
| | | {field: 'inventoryArea',slots: { default: 'show'},width: 120, title: t('report.StorageArea')}, |
| | | {field: 'broken_num',width: 90, title: t('reportingWorks.quantityBroken')}, |
| | | ] |
| | | let column = [0,2,3,5,7,8,9] |
| | | //let column = [0,2,3,5,7,8,9] |
| | | let column = ['product_name','order_type','process_id','quantity','gross_area','inventory','inventoryArea'] |
| | | |
| | | |
| | | onMounted(()=>{ |
| | |
| | | gridOptions.columns.forEach(item =>{ |
| | | item.filterMethod = filterChanged |
| | | }) |
| | | console.log(res) |
| | | |
| | | list.value = ['quantity','thisQuantity','inventory','inventoryArea','gross_area','glassQuantity','broken_num'] |
| | | |
| | | const processList = { |
| | | title:t('report.workingProcedure'), |
| | | field:'process', |
| | | children:[] |
| | | } |
| | | res.data.title.forEach((item,index) =>{ |
| | | list.value.push('reportWorkQuantity.'+item.process) |
| | | let column = {slots: { default: 'quantitySum'}, |
| | | width: 90, |
| | | title: item.process, |
| | | field:'reportWorkQuantity.'+item.process} |
| | | gridOptions.columns.push(column) |
| | | processList.children.push(column) |
| | | |
| | | }) |
| | | gridOptions.columns.push(processList) |
| | | res.data.data.forEach(item => { |
| | | item.reportWorkQuantity=JSON.parse(item.reportWorkQuantity) |
| | | item.reportWorkQuantityCount=JSON.parse(item.reportWorkQuantityCount) |
| | | item.reportWorkQuantityShow=JSON.parse(item.reportWorkQuantityShow) |
| | | }) |
| | | |
| | | await xGrid.value.loadData(res.data.data) |
| | | await xGrid.value.setMergeCells(res.data.mergeCells) |
| | | mergeCells.value = res.data.mergeCells |
| | | gridOptions.loading = false |
| | | |
| | |
| | | |
| | | const filterChange = () =>{ |
| | | if(xGrid.value.isFilter()){ |
| | | xGrid.value.clearMergeCells() |
| | | xGrid.value.clearMergeFooterItems() |
| | | }else{ |
| | | xGrid.value.setMergeCells(mergeCells.value) |
| | | xGrid.value.updateFooter() |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | }else { |
| | | count += Number(item[field]) || 0 |
| | | if(xGrid.value.isFilter() ) { |
| | | count += Number(item[field+'Show']) || Number(item[field]) || 0 |
| | | } else { |
| | | count += Number(item[field]) || 0 |
| | | } |
| | | } |
| | | }) |
| | | return count.toFixed(2).replace(/\.?0+$/, ''); |