| | |
| | | gridOptions.columns.forEach(item =>{ |
| | | item.filterMethod = filterChanged |
| | | }) |
| | | list.value = ['quantity','Storage','gross_area','shippedQuantity','shippedArea','glassQuantity','StorageArea'] |
| | | list.value = ['quantity','Storage','grossArea','shippedQuantity','shippedArea','glassQuantity','StorageArea','broken_num'] |
| | | title.value = res.data.title |
| | | res.data.title.forEach((item,index) =>{ |
| | | list.value.push('reportWorkQuantity.'+item.process) |
| | |
| | | mergeCells:[], |
| | | toolbarConfig: { |
| | | zoom: true, |
| | | /*custom: true*/ |
| | | // custom: true |
| | | }, |
| | | cellClassName ({ row, column,columnIndex}) { |
| | | if (columnIndex>10 && row.thisQuantity*1 === row.reportWorkQuantity[column.title]*1){ |
| | |
| | | orderId:null |
| | | }) |
| | | const columns = [ |
| | | {field: 'order_number',fixed:"left", width: 90,title: t('order.OrderNum'),showOverflow:"ellipsis"}, |
| | | // {type:'expand',fixed:"left",slots: { content:'content' },width: 50}, |
| | | {field: 'product_name', width: 150, title: t('order.product'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'glass_child',width: 130, title: t('reportingWorks.glassChild') ,filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'order_type', width: 120,title: t('order.orderType'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'process_id',width: 110, title: t('processCard.processId'),filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'technology_number', width: 90,title: t('processCard.technologyNumber'),showOverflow:"ellipsis"}, |
| | | {field: 'child_width', width: 90,title: t('order.width'),showOverflow:"ellipsis"}, |
| | | {field: 'child_height', width: 90,title: t('order.height'),showOverflow:"ellipsis"}, |
| | | {field: 'technology_number', width: 90,title: t('processCard.technologyNumber'),showOverflow:"ellipsis",filters:[{ data: '' }],slots: { filter: 'num1_filter' }}, |
| | | {field: 'quantity', width: 90,title: t('order.quantity')}, |
| | | {field: 'glassQuantity', width: 90,title: t('order.glassQuantity')}, |
| | | {field: 'thisQuantity', width: 90,title: t('order.glassQuantity')}, |
| | | {field: 'gross_area', width: 90,title: t('order.area')}, |
| | | {field: 'shippedQuantity',width: 120, title: t('delivery.deliveryQuantity')}, |
| | | {field: 'inventory',width: 120, title: t('productStock.inventoryQuantity')}, |
| | | {field: 'inventoryArea',width: 120, title: t('report.inventoryArea')}, |
| | | {field: 'inventory',width: 120, title: t('report.inventoryNum')}, |
| | | {field: 'inventoryArea',width: 120, title: t('report.StorageArea')}, |
| | | {field: 'broken_num',width: 90, title: t('reportingWorks.quantityBroken')}, |
| | | ] |
| | | let column = [0,1,3,6,7,8,10,11,12,13] |
| | | let column = [0,2,3,5,7,8,9] |
| | | |
| | | |
| | | onMounted(()=>{ |
| | |
| | | gridOptions.columns.forEach(item =>{ |
| | | item.filterMethod = filterChanged |
| | | }) |
| | | list.value = ['quantity','inventory','inventoryArea','gross_area','shippedQuantity','glassQuantity'] |
| | | console.log(res) |
| | | |
| | | list.value = ['quantity','thisQuantity','inventory','inventoryArea','gross_area','glassQuantity','broken_num'] |
| | | res.data.title.forEach((item,index) =>{ |
| | | list.value.push('reportWorkQuantity.'+item.process) |
| | | let column = {slots: { default: 'quantitySum'}, |
| | |
| | | res.data.data.forEach(item => { |
| | | item.reportWorkQuantity=JSON.parse(item.reportWorkQuantity) |
| | | item.reportWorkQuantityCount=JSON.parse(item.reportWorkQuantityCount) |
| | | item.reportWorkQuantityShow=JSON.parse(item.reportWorkQuantityShow) |
| | | item.reportWorkQuantityShow=JSON.parse(item.reportWorkQuantityShow) |
| | | }) |
| | | |
| | | await xGrid.value.loadData(res.data.data) |
| | |
| | | |
| | | } |
| | | const footSum =(list, field) => { |
| | | if(xGrid.value.isFilter()){ |
| | | return |
| | | } |
| | | let count = 0 |
| | | list.forEach(item => { |
| | | if(field.indexOf('.')>-1){ |
| | | let array = field.split('.') |
| | | count += Number(item[array[0]][array[1]]) || 0 |
| | | //判断是否为筛选状态和非订单合并状态 |
| | | if(xGrid.value.isFilter() ){ |
| | | count += Number(item[array[0]+'Show'][array[1]]) || 0 |
| | | }else{ |
| | | count += Number(item[array[0]][array[1]]) || 0 |
| | | } |
| | | |
| | | }else { |
| | | count += Number(item[field]) || 0 |
| | | } |
| | | }) |
| | | return count.toFixed(2) |
| | | return count.toFixed(2).replace(/\.?0+$/, ''); |
| | | } |
| | | |
| | | const quantitySum = ( row,column )=>{ |
| | |
| | | import PrintSheet3 from "@/components/sd/order/PrintSheet3.vue" |
| | | import PrintSheet4 from "@/components/sd/order/PrintSheet4.vue" |
| | | import PrintSheet5 from "@/components/sd/order/PrintSheet5.vue" |
| | | import OrderProcessCollect from "@/components/sd/order/OrderProcessCollect.vue"; |
| | | const { t } = useI18n() |
| | | const orderInfo = useOrderInfoStore() |
| | | const userStore = useUserInfoStore() |
| | |
| | | :row="rowClickIndex===null?{}:rowClickIndex" |
| | | /> |
| | | </el-tab-pane> |
| | | <el-tab-pane :label="'流程卡汇总'" name="4"> |
| | | <order-process-collect |
| | | v-if="tabsValue==='4'" |
| | | :orderId="rowClickIndex===null?null:rowClickIndex.orderId" |
| | | :row="rowClickIndex===null?{}:rowClickIndex" |
| | | /> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | |
| | | </div> |
| | |
| | | package com.example.erp.mapper.pp; |
| | | |
| | | import com.baomidou.mybatisplus.core.assist.ISqlRunner; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.example.erp.entity.pp.DamageDetails; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | public interface DamageDetailsMapper extends BaseMapper<DamageDetails> { |
| | | Integer getBehindDamageSum(String processId, String orderNumber, String technologyNumber, String behindProcess); |
| | | Integer getBehindDamageSum(String processId, String orderNumber, String technologyNumber, String behindProcess,Integer needOrderNumber); |
| | | |
| | | List<DamageDetails> getNotReview(String processId, String orderNumber,String technologyNumber); |
| | | } |
| | |
| | | List<Map<String,String>> filterOrderProcess(String orderId); |
| | | |
| | | List<Map<String,Object>> getGlassLRow(String orderId); |
| | | List<Map<String,Object>> getProcessGlassLRow(String orderId); |
| | | |
| | | List<Map<String, String>> filterLastProcess(String orderId, String orderNumber, String technologyNumber,String id); |
| | | |
| | |
| | | }); |
| | | //判断后工序此流程卡号是否有次破 |
| | | List<DamageDetails> hasBreak = damageDetailsMapper |
| | | .selectList(new LambdaQueryWrapper<DamageDetails>() |
| | | .eq(DamageDetails::getProcessId, dataList.get(i).get("processId")) |
| | | .eq(DamageDetails::getOrderNumber, dataList.get(i).get("order_number")) |
| | | .eq(DamageDetails::getTechnologyNumber, dataList.get(i).get("technology_number")) |
| | | .eq(DamageDetails::getPatchStatus, 0) |
| | | .gt(DamageDetails::getBreakageQuantity,0) |
| | | |
| | | .getNotReview(dataList.get(i).get("process_id"), |
| | | String.valueOf(dataList.get(i).get("order_number")), |
| | | String.valueOf(dataList.get(i).get("technology_number")) |
| | | ); |
| | | |
| | | if(!hasBreak.isEmpty()){ |
| | | int finalI = i; |
| | | data.forEach((thisProcess, index)->{ |
| | |
| | | dataList.get(finalI).get("processId"), |
| | | String.valueOf(dataList.get(finalI).get("order_number")), |
| | | String.valueOf(dataList.get(finalI).get("technology_number")), |
| | | behindProcess |
| | | behindProcess,1 |
| | | ); |
| | | if(behindDamageSum>0){ |
| | | data.put(thisProcess, String.valueOf(Integer.parseInt(data.get(thisProcess) )- behindDamageSum)); |
| | |
| | | List<Map<String, String>> dataList = reportMapper.processCardProgressCollectMp(orderId); |
| | | //获取表头工序筛选数据 |
| | | List<Map<String, String>> uniqueList = orderProcessDetailMapper.filterOrderProcess(orderId); |
| | | |
| | | map.put("title", uniqueList); |
| | | return null; |
| | | Map<String,Map<String,Object>> clos = new HashMap<>(); |
| | | for (int i=0;i<uniqueList.size();i++){ |
| | | //根据流程查询基础数据 |
| | | BasicData basicData = basicDataMapper.selectOne( |
| | | new QueryWrapper<BasicData>() |
| | | .eq("basic_category","process") |
| | | .eq("basic_name",uniqueList.get(i).get("process")) |
| | | .last("limit 1") |
| | | ); |
| | | Map<String,Object> getCol = new HashMap<>(); |
| | | //判断夹胶和夹胶后工序 |
| | | //Objects.equals(basicData.getNickname(), "stepA") || Objects.equals(basicData.getNickname(), "stepC") |
| | | if(Objects.equals(basicData.getNickname(), "stepA") || Objects.equals(basicData.getNickname(), "stepC")){ |
| | | getCol.put("col", 11+i); |
| | | getCol.put("step","stepA"); |
| | | clos.put(uniqueList.get(i).get("process"), getCol); |
| | | } |
| | | //判断中空和中空后工序 |
| | | //Objects.equals(basicData.getNickname(), "stepB") || Objects.equals(basicData.getNickname(), "stepD") |
| | | if(Objects.equals(basicData.getNickname(), "stepB") || Objects.equals(basicData.getNickname(), "stepD")){ |
| | | columns.add(11+i); |
| | | getCol.put("col", 11+i); |
| | | getCol.put("step","stepB"); |
| | | clos.put(uniqueList.get(i).get("process"), getCol); |
| | | } |
| | | } |
| | | List<Map<String, Object>> getRowCount = orderProcessDetailMapper.getGlassLRow(orderId); |
| | | List<Map<String, Integer>> rowCount = new ArrayList<>(); |
| | | columns.forEach(col -> { |
| | | getRowCount.forEach(row -> { |
| | | Map<String, Integer> getRow = new HashMap<>(); |
| | | // { row: 0, col: 1, rowspan: 3, colspan: 0}, |
| | | getRow.put("row", ((Number) row.get("RowNum")).intValue()); |
| | | getRow.put("col", col); |
| | | getRow.put("rowspan", ((Number) row.get("rowCount")).intValue()); |
| | | getRow.put("colspan", 0); |
| | | rowCount.add(getRow); |
| | | }); |
| | | }); |
| | | |
| | | //循环结果 |
| | | for (int i=0;i<dataList.size();i++ ) { |
| | | dataList.get(i).put("reportWorkQuantityShow",dataList.get(i).get("reportWorkQuantity")); |
| | | Map<String, String> data = JSON.parseObject(dataList.get(i).get("reportWorkQuantity"), |
| | | new TypeReference<Map<String, String>>() { |
| | | }); |
| | | Map<String, String> dataShow = JSON.parseObject(dataList.get(i).get("reportWorkQuantityShow"), |
| | | new TypeReference<Map<String, String>>() { |
| | | }); |
| | | //判断后工序此流程卡号是否有次破 |
| | | List<DamageDetails> hasBreak = damageDetailsMapper |
| | | .getNotReview(dataList.get(i).get("process_id"), |
| | | null, |
| | | String.valueOf(dataList.get(i).get("technology_number")) |
| | | ); |
| | | |
| | | if(!hasBreak.isEmpty()){ |
| | | int finalI = i; |
| | | data.forEach((thisProcess, index)->{ |
| | | String behindProcess = orderProcessDetailMapper.getBehindProcess( |
| | | dataList.get(finalI).get("process_id"), |
| | | String.valueOf(dataList.get(finalI).get("order_number")), |
| | | String.valueOf(dataList.get(finalI).get("technology_number")), |
| | | thisProcess, |
| | | orderId |
| | | ); |
| | | |
| | | if(behindProcess!=null &&!behindProcess.isEmpty()){ |
| | | Integer behindDamageSum = damageDetailsMapper.getBehindDamageSum( |
| | | dataList.get(finalI).get("process_id"), |
| | | String.valueOf(dataList.get(finalI).get("order_number")), |
| | | String.valueOf(dataList.get(finalI).get("technology_number")), |
| | | behindProcess, |
| | | null |
| | | ); |
| | | if(behindDamageSum>0){ |
| | | data.put(thisProcess, String.valueOf(Integer.parseInt(data.get(thisProcess) )- behindDamageSum)); |
| | | dataShow.put(thisProcess, String.valueOf(Integer.parseInt(dataShow.get(thisProcess) )- behindDamageSum)); |
| | | } |
| | | |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |
| | | if(!clos.isEmpty()){ |
| | | Integer max = orderGlassDetailMapper |
| | | .getMaxTechnologyNumberByGroup(dataList.get(i).get("order_id"), |
| | | String.valueOf(dataList.get(i).get("order_number")), |
| | | String.valueOf(dataList.get(i).get("group")) |
| | | ); |
| | | Integer min = orderGlassDetailMapper |
| | | .getMinTechnologyNumberByGroup(dataList.get(i).get("order_id"), |
| | | String.valueOf(dataList.get(i).get("order_number")), |
| | | String.valueOf(dataList.get(i).get("group")) |
| | | ); |
| | | |
| | | for (String key : clos.keySet()) { |
| | | if(data.get(key) != null){ |
| | | //判断是夹胶工序 |
| | | if( clos.get(key).get("step")=="stepA"){ |
| | | if(min == Integer.parseInt(String.valueOf(dataList.get(i).get("technology_number"))) ){ |
| | | Map<String, Integer> getRow = new HashMap<>(); |
| | | getRow.put("row", i ); |
| | | getRow.put("col", (Integer) clos.get(key).get("col")); |
| | | getRow.put("rowspan", max-min+1); |
| | | getRow.put("colspan", 0); |
| | | rowCount.add(getRow); |
| | | }else{ |
| | | data.put(key,"0"); |
| | | } |
| | | }else{//中空,中空后工序 |
| | | //小片序号不是1 的时候赋值0 |
| | | if(Integer.parseInt(String.valueOf(dataList.get(i).get("technology_number"))) !=1){ |
| | | data.put(key,"0"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | dataList.get(i).put("reportWorkQuantity",JSON.toJSONString(data)); |
| | | dataList.get(i).put("reportWorkQuantityShow",JSON.toJSONString(dataShow)); |
| | | |
| | | } |
| | | |
| | | map.put("mergeCells", rowCount); |
| | | |
| | | map.put("data",dataList); |
| | | |
| | | |
| | | return map; |
| | | } |
| | | |
| | | public Map<String, Object> processCardProgressReportSv(String orderId, List<Integer> columns) { |
| | |
| | | left join pp.reporting_work as b |
| | | on a.reporting_work_id = b.reporting_work_id |
| | | WHERE a.process_id = #{processId} |
| | | <if test="needOrderNumber!=null"> |
| | | and a.order_number = #{orderNumber} |
| | | </if> |
| | | and a.technology_number =#{technologyNumber} |
| | | and a.breakage_quantity>0 |
| | | and a.patch_status=0 |
| | |
| | | WHERE REGEXP_SUBSTR(#{behindProcess}, '[^,]+', 1, n) IS NOT NULL) |
| | | |
| | | </select> |
| | | <select id="getNotReview"> |
| | | select a.* |
| | | from damage_details as a |
| | | left join reporting_work as b |
| | | on a.reporting_work_id = b.reporting_work_id |
| | | where a.process_id=#{processId} |
| | | and b.reviewed_state>=0 |
| | | <if test="orderNumber!=null"> |
| | | and a.order_number = #{orderNumber} |
| | | </if> |
| | | and a.technology_number = #{technologyNumber} |
| | | and a.patch_status=0 |
| | | and a.breakage_quantity>0 |
| | | |
| | | </select> |
| | | </mapper> |
| | |
| | | |
| | | |
| | | <select id="processCardProgressCollectMp"> |
| | | select * from (select b.product_name, |
| | | c.detail as 'glassName', |
| | | select * from (select |
| | | a.order_id, |
| | | a.order_number, |
| | | c.glass_group as 'group', |
| | | a.technology_number, |
| | | b.product_name, |
| | | c.detail as glass_child, |
| | | d.order_type, |
| | | concat(a.process_id,'/',a.technology_number) as processID, |
| | | a.process_id, |
| | | a.quantity, |
| | | a.received_quantity, |
| | | round(sum(a.received_quantity*b.area),2) as received_area, |
| | | if(a.technology_number=1,sum(a.quantity-ifnull(a.termination_quantity,0)),0) as quantity, |
| | | sum(a.quantity)-ifnull(a.termination_quantity,0) as thisQuantity,/*用于判断是否改变颜色*/ |
| | | if(a.technology_number=1, round(sum((a.quantity-ifnull(a.termination_quantity,0)))*b.compute_area,2),0) as gross_area, |
| | | if(a.technology_number=1, sum(a.received_quantity),0) as inventory, |
| | | if(a.technology_number=1, round(sum(a.received_quantity*b.area),2),0) as inventoryArea, |
| | | |
| | | a.technology_number |
| | | -- show |
| | | sum(a.quantity-ifnull(a.termination_quantity,0)) as quantityShow , |
| | | round(sum((a.quantity-ifnull(a.termination_quantity,0)))*b.compute_area,2) as gross_areaShow, |
| | | sum(a.received_quantity) as inventoryShow, |
| | | round(sum(a.received_quantity*b.area),2) as inventoryAreaShow |
| | | |
| | | |
| | | |
| | | |
| | | from pp.flow_card as a |
| | | left join sd.order_detail as b |
| | | on a.order_id = b.order_id and a.order_number = b.order_number |
| | | left join sd.product_detail as c |
| | | on c.prod_id = b.product_id and c.glass_sort = a.technology_number |
| | | LEFT JOIN sd.`order` as d |
| | | on a.order_id = d.order_id |
| | | where a.order_id = #{orderId} group by processID |
| | | ) as a |
| | | left join (SELECT process_id, |
| | | technology_number, |
| | | sum(broken_num) as broken_num, |
| | | concat('{',GROUP_CONCAT(reporting_work_nums),'}') as reporting_work_num |
| | | concat('{',GROUP_CONCAT(reporting_work_nums),'}') as reportWorkQuantity, |
| | | concat('{',GROUP_CONCAT(reporting_work_counts),'}') as reportWorkQuantityCount |
| | | from (select |
| | | opd.process_id, |
| | | opd.technology_number, |
| | | concat("\"", process, "\":\"", SUM(reporting_work_num), "\"") as reporting_work_nums, |
| | | concat("\"", process, "\":\"", SUM(reporting_work_num_count), "\"") as reporting_work_counts, |
| | | sum(broken_num) as broken_num |
| | | from sd.order_process_detail as opd |
| | | where opd.order_id = #{orderId} |
| | |
| | | order by RowNum |
| | | |
| | | </select> |
| | | |
| | | <select id="getProcessGlassLRow"> |
| | | select |
| | | max(a.technology_number) as rowCount, |
| | | RowNum |
| | | from pp.flow_card as a |
| | | left join |
| | | (select min((@i:=@i+1)) AS RowNum,c.* |
| | | from pp.flow_card as c, |
| | | (SELECT @i:=-1) as d |
| | | where order_id = #{orderId} |
| | | GROUP BY process_id |
| | | ) as b |
| | | on b.id = a.id |
| | | where a.order_id = #{orderId} |
| | | group by a.process_id |
| | | order by RowNum |
| | | |
| | | </select> |
| | | <update id="insertByReportingWorkDetail"> |
| | | update sd.order_process_detail as a |
| | | set |