| | |
| | | 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 |
| | | }, |
| | |
| | | }, |
| | | |
| | | |
| | | mergeCells:[], |
| | | toolbarConfig: { |
| | | slots:{ |
| | | buttons: "title", |
| | | tools: 'type' |
| | | }, |
| | | zoom: true, |
| | | // custom: true |
| | | custom: true |
| | | }, |
| | | spanMethod ({ row, rowIndex,column, columnIndex}) { |
| | | const field = column.field |
| | | if (xGrid.value.isFilter() || orderType.value!==1) { |
| | | 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){ |
| | | 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 |
| | |
| | | }else{ |
| | | copyTableCellValueShow(row,column) |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | let props = defineProps({ |
| | | orderId:null, |
| | | row: {} |
| | | row: {}, |
| | | processId:null//用于后端数据返回,结果筛选 |
| | | }) |
| | | const columns = [ |
| | | {field: 'order_number',fixed:"left", width: 90,title: t('order.OrderNum'),showOverflow:"ellipsis",filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | |
| | | {field: 'quantity',slots: { default: 'show'}, width: 90,title: t('order.quantity')}, |
| | | {field: 'glassQuantity', width: 90,title: t('order.glassQuantity')}, |
| | | {field: 'grossArea',slots: { default: 'show'}, width: 90,title: t('order.area')}, |
| | | {field: 'shippedQuantity',slots: { default: 'show'},width: 120, title: t('delivery.deliveryQuantity')}, |
| | | {field: 'shippedArea',slots: { default: 'show'},width: 120, title: t('report.shippedArea')}, |
| | | // {field: 'shippedQuantity',slots: { default: 'show'},width: 120, title: t('delivery.deliveryQuantity'),visible:false}, |
| | | // {field: 'shippedArea',slots: { default: 'show'},width: 120, title: t('report.shippedArea'),visible:false}, |
| | | {field: 'Storage',slots: { default: 'show'},width: 120, title: t('report.inventoryNum')}, |
| | | // {field: 'inventoryArea',slots: { default: 'show'},width: 120, title: t('report.inventoryArea')}, |
| | | {field: 'StorageArea',slots: { default: 'show'},width: 120, title: t('report.StorageArea')}, |
| | | {field: 'broken_num',width: 90, title: t('reportingWorks.quantityBroken')}, |
| | | ] |
| | | let column = [0,1,3,8,10,11,12,13,14] |
| | | let column = ['order_number','product_name','order_type','quantity','grossArea','Storage','StorageArea'] |
| | | let orderType = ref(1) |
| | | |
| | | onMounted(()=>{ |
| | |
| | | switch (orderType.value) { |
| | | case 1 :{ |
| | | xGrid.value.loadData(data.value) |
| | | xGrid.value.setMergeCells(mergeCells.value) |
| | | xGrid.value.updateFooter() |
| | | break |
| | | } |
| | | case 2 :{ |
| | | xGrid.value.loadData(data.value) |
| | | xGrid.value.clearMergeCells() |
| | | xGrid.value.clearMergeFooterItems() |
| | | xGrid.value.updateFooter() |
| | | |
| | | break |
| | | } |
| | | case 3:{ |
| | | xGrid.value.clearMergeCells() |
| | | xGrid.value.clearMergeFooterItems() |
| | | xGrid.value.updateFooter() |
| | | const lastProcess = title.value[title.value.length-1].process |
| | |
| | | const allFinish = item.glassQuantity*1 |
| | | return allFinish>lastFinish |
| | | }) |
| | | // console.log(filter) |
| | | xGrid.value.loadData(filter) |
| | | break |
| | | } |
| | |
| | | }) |
| | | list.value = ['quantity','Storage','grossArea','shippedQuantity','shippedArea','glassQuantity','StorageArea','broken_num'] |
| | | title.value = res.data.title |
| | | |
| | | 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) |
| | |
| | | }) |
| | | orderType.value = 1 |
| | | await xGrid.value.loadData(res.data.data) |
| | | await xGrid.value.setMergeCells(res.data.mergeCells) |
| | | mergeCells.value = res.data.mergeCells |
| | | data.value = res.data.data |
| | | gridOptions.loading = false |
| | | xGrid.value.commitProxy('reset_custom') |
| | | |
| | | } else { |
| | | ElMessage.warning(res.msg) |
| | |
| | | const filterChange = () =>{ |
| | | if(orderType.value === 1) { |
| | | if (xGrid.value.isFilter()) { |
| | | xGrid.value.clearMergeCells() |
| | | //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() || orderType.value!==1) { |
| | | count += Number(item[field+'Show']) || Number(item[field]) || 0 |
| | | } else { |
| | | count += Number(item[field]) || 0 |
| | | } |
| | | |
| | | } |
| | | }) |
| | | return count.toFixed(2).replace(/\.?0+$/, ''); |
| | |
| | | const changeZoom = ()=> { |
| | | showTitle.value = !showTitle.value |
| | | } |
| | | |
| | | const rowStyle = ({ row,rowIndex }) => { |
| | | if(row.termination_status==1){ |
| | | return { |
| | | backgroundColor: 'rgb(186 188 192)' |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | ref="xGrid" |
| | | v-bind="gridOptions" |
| | | v-on="gridEvents" |
| | | :row-style="rowStyle" |
| | | > |
| | | <template #num1_filter="{ column, $panel }"> |
| | | <div> |
| | |
| | | <template #title> |
| | | <span style="font-weight: bold" v-show="showTitle"> |
| | | {{ row.orderId }} |
| | | {{ row.project?'--':'' }} |
| | | {{ row.customerName?'--':'' }} |
| | | {{ row.customerName}} |
| | | {{row.project?'--':'' }} |
| | | {{row.project}} |
| | | {{ row.batch?'--':'' }} |
| | | {{row.batch}} |