| | |
| | | ElMessage.warning(t('report.noDataFoundForThisOrder')) |
| | | return |
| | | } |
| | | //gridOptions.columns = JSON.parse(JSON.stringify(columns)) |
| | | // 动态添加列 |
| | | res.data.title.forEach((item, index) => { |
| | | let column = { slots: { default: 'quantitySum' }, width: 90, title: item.process, |
| | | let column = { |
| | | slots: { default: 'quantitySum' }, |
| | | width: 150, |
| | | title: item.process, |
| | | field: `dynamicColumn${index}` // 为动态列添加唯一的 field |
| | | }; |
| | | const insertIndex = 5; // 设置插入位置的索引 |
| | | gridOptions.columns = [ |
| | | ...gridOptions.columns.slice(0, insertIndex + index), // 取插入位置之前的部分 |
| | | column, |
| | | ...gridOptions.columns.slice(insertIndex + index) // 取插入位置之后的部分 |
| | | ]; |
| | | }); |
| | | } |
| | | gridOptions.columns.push(column) |
| | | }) |
| | | res.data.data.forEach(item => { |
| | | item.reportWorkQuantity=JSON.parse(item.reportWorkQuantity) |
| | | item.reportWorkQuantityCount=JSON.parse(item.reportWorkQuantityCount) |
| | | item.reportWorkQuantityShow=JSON.parse(item.reportWorkQuantityShow) |
| | | }) |
| | | mergeCells.value = res.data.mergeCell |
| | | xGrid.value.loadData(res.data.data) |
| | |
| | | return sum.toFixed(2); |
| | | } |
| | | const quantitySum = ( row,column )=>{ |
| | | const reportWorkQuantity = row.reportWorkQuantity[column.title] || 0 |
| | | const reportWorkQuantityCount = row.reportWorkQuantityCount[column.title] || 0 |
| | | if(reportWorkQuantity===reportWorkQuantityCount){ |
| | | return reportWorkQuantity |
| | | const reportWorkQuantityCount = row.reportWorkQuantityCount[column.title] || '' |
| | | const reportWorkQuantityShow = row.reportWorkQuantityShow[column.title] || '' |
| | | if(reportWorkQuantityShow === reportWorkQuantityCount ){ |
| | | return reportWorkQuantityShow |
| | | } |
| | | |
| | | return (reportWorkQuantity |
| | | return (reportWorkQuantityShow |
| | | +'(' |
| | | +reportWorkQuantityCount |
| | | +')' ) |
| | | //return |
| | | } |
| | | |
| | | |
| | |
| | | </select> |
| | | |
| | | <select id="productionScheduleMp"> |
| | | select a.order_number, |
| | | if(a.shape='' || ISNULL(a.shape),'普形',if(a.shape = 1, '普形', if(a.shape = 2, '异形', ''))) as shape, |
| | | a.product_name, |
| | | select a.product_name, |
| | | b.glass_child, |
| | | d.order_type, |
| | | concat(c.process_id, '/', c.technology_number) as process_id, |
| | | c.process_id as 'processId', |
| | | c.order_id, |
| | | c.order_number, |
| | | c.technology_number, |
| | | b.child_width, |
| | | b.child_height, |
| | | c.quantity - ifnull(c.termination_quantity,0) as quantity, |
| | | c.technology_number, |
| | | b.glass_child, |
| | | ifnull(e.reportWorkQuantity, 0) as reportWorkQuantity, |
| | | ifnull(e.reportWorkQuantityCount, 0) as reportWorkQuantityCount, |
| | | ifnull(c.received_quantity, 0) as inventoryNum, |
| | | round(ifnull(c.received_quantity, 0) * a.area, 2) as inventoryArea, |
| | | ifnull(dd.quantity, 0) as shippedQuantity, |
| | | ifnull(dd.area, 0) as area, |
| | | ifnull(JSON_UNQUOTE(JSON_EXTRACT(a.other_columns, '$.S01')),'') AS glassNumber |
| | | c.quantity, |
| | | |
| | | from flow_card as c |
| | | c.quantity-ifnull(c.termination_quantity,0) as thisQuantity,/*用于判断是否改变颜色*/ |
| | | e.reportWorkQuantity, |
| | | e.reportWorkQuantityShow, |
| | | e.reportWorkQuantityCount, |
| | | e.reportWorkTime, |
| | | e.broken_num, |
| | | c.quantity-ifnull(c.termination_quantity,0) as glassQuantity, |
| | | |
| | | c.quantity-ifnull(c.termination_quantity,0) as quantityShow, |
| | | round( (c.quantity-ifnull(c.termination_quantity,0))*a.compute_area,2) as grossAreaShow, |
| | | ifnull(c.received_quantity, 0) as inventoryNum, |
| | | ifnull(dd.quantity, 0) as shippedQuantityShow, -- 发货数量 |
| | | round(ifnull(dd.quantity, 0)*a.compute_area,2) as shippedAreaShow, -- 发货面积 |
| | | round((ifnull(c.received_quantity, 0))*a.compute_area,2) as inventoryArea,-- 入库面积 |
| | | |
| | | round((c.quantity-ifnull(c.termination_quantity,0))*a.compute_area,2)as grossArea, |
| | | ifnull(c.received_quantity, 0) as Storage, |
| | | ifnull(dd.quantity, 0) as shippedQuantity, |
| | | round(ifnull(dd.quantity, 0)*a.compute_area,2) as shippedArea, |
| | | round((ifnull(c.received_quantity, 0))*a.compute_area,2) as StorageArea, |
| | | |
| | | |
| | | ifnull(JSON_UNQUOTE(JSON_EXTRACT(a.other_columns, '$.S01')),'') AS glassNumber, |
| | | b.`group` |
| | | |
| | | from pp.flow_card as c |
| | | left join |
| | | sd.order_detail as a |
| | | on c.order_id = a.order_id |
| | |
| | | and c.technology_number = b.technology_number |
| | | left join sd.`order` as d |
| | | on c.order_id = d.order_id |
| | | left join mm.finished_goods_inventory as f |
| | | on c.order_id = f.order_id and f.order_number = c.order_number |
| | | left join (SELECT process_id, |
| | | order_number, |
| | | technology_number, |
| | | sum(a.broken_num) as broken_num, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"", process, "\":\"", reporting_work_num, "\"")), |
| | | '}' |
| | | ) as reportWorkQuantity, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"", process, "\":\"", reporting_work_num_count, "\"")), |
| | | '}' |
| | | ) as reportWorkQuantityCount |
| | | FROM sd.order_process_detail as a |
| | | where a.order_id = #{orderId} |
| | | GROUP BY process_id, a.order_number,a.technology_number) as e |
| | | on e.process_id = c.process_id |
| | | and e.order_number=c.order_number |
| | | and e.technology_number = c.technology_number |
| | | left join sd.delivery_detail as dd on dd.order_id = a.order_id and dd.order_number = a.order_number |
| | | where a.order_id = #{orderId} and d.create_order>0 and c.quantity - ifnull(c.termination_quantity,0)>0 |
| | | group by c.order_number,c.technology_number |
| | | ORDER BY a.order_number |
| | | # left join mm.finished_goods_inventory as f |
| | | # on c.order_id = f.order_id and f.order_number = c.order_number |
| | | left join sd.delivery_detail as dd on dd.order_id = a.order_id and dd.order_number = a.order_number |
| | | left join (SELECT process_id, |
| | | order_number, |
| | | technology_number, |
| | | sum(a.broken_num) as broken_num, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"", process, "\":\"", if(technology_number!=1 and (bd.nickname='stepD' || bd.nickname='stepB' ) ,0,reporting_work_num), "\"")), |
| | | '}' |
| | | ) as reportWorkQuantity, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"", process, "\":\"", reporting_work_num, "\"")), |
| | | '}' |
| | | ) as reportWorkQuantityShow, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"", process, "\":\"", reporting_work_num_count, "\"")), |
| | | '}' |
| | | ) as reportWorkQuantityCount, |
| | | concat('{', |
| | | GROUP_CONCAT(concat("\"", process, "\":\"", IFNULL(date(update_time),''), "\"")), |
| | | '}' |
| | | ) as reportWorkTime |
| | | FROM sd.order_process_detail as a |
| | | left join (SELECT DISTINCT basic_name,nickname from sd.basic_data as bd where bd.basic_category = 'process') as bd |
| | | on a.process = bd.basic_name |
| | | where a.order_id =#{orderId} |
| | | GROUP BY process_id, a.order_number, a.technology_number |
| | | |
| | | |
| | | ) as e |
| | | on e.process_id = c.process_id |
| | | and e.technology_number = c.technology_number |
| | | and e.order_number = c.order_number |
| | | where a.order_id = #{orderId} and d.create_order>0 and c.quantity-ifnull(c.termination_quantity,0)>0 |
| | | group by c.order_number, |
| | | c.technology_number, |
| | | c.process_id |
| | | order by c.process_id, c.order_number, c.technology_number |
| | | </select> |
| | | |
| | | <select id="taskCompletionStatusMp"> |