| | |
| | | <td>{{ item2.technologyNumber }}</td> |
| | | <td colspan="4"> {{item2.glassChild}}</td> |
| | | <td>{{item2.childWidth}}</td> |
| | | <td>{{item1.bendRadius}}</td> |
| | | <td>{{item2.arc}}</td> |
| | | <td>{{item2.childHeight}}</td> |
| | | <td>{{item1.archRise}}</td> |
| | | <td colspan="4"></td> |
| | |
| | | printConfig: {}, |
| | | importConfig: {}, |
| | | exportConfig: {}, |
| | | scrollY:{ enabled: true,gt:13 },//开启虚拟滚动 |
| | | scrollX:{ enabled: true,gt:7 },//开启虚拟滚动 |
| | | scrollY:{ enabled: true,gt:0 },//开启虚拟滚动 |
| | | scrollX:{ enabled: true,gt:0 },//开启虚拟滚动 |
| | | showOverflow:true, |
| | | menuConfig: { |
| | | body: { |
| | |
| | | ElMessage.error( t('order.msg.tableLengthNot')) |
| | | return |
| | | } |
| | | computedMoney() |
| | | if(!gridOptions.menuConfig.body.options[0][5].disabled){ |
| | | ElMessage.error(t('order.msg.amountReset')) |
| | | return |
| | |
| | | break |
| | | } |
| | | case 'computedMoney' :{ |
| | | const dataList = xGrid.value.getTableData().fullData |
| | | dataList.forEach((item,index) =>{ |
| | | item.area = area(item) |
| | | item.grossArea = countArea(item) |
| | | item.computeArea = item.area |
| | | item.computeGrossArea = item.grossArea |
| | | item.grossAmount=parseFloat((item.price * item.computeGrossArea).toFixed(2)) |
| | | }) |
| | | titleUploadData.value.money=countMoney(xGrid.value.getTableData().fullData).toString() |
| | | computedMoney() |
| | | |
| | | gridOptions.menuConfig.body.options[0][5].disabled=true |
| | | break |
| | | } |
| | | case 'errorArea' :{ |
| | |
| | | } |
| | | }) |
| | | } |
| | | const computedMoney = () => { |
| | | const dataList = xGrid.value.getTableData().fullData |
| | | dataList.forEach((item,index) =>{ |
| | | item.area = area(item) |
| | | item.grossArea = countArea(item) |
| | | item.computeArea = item.area |
| | | item.computeGrossArea = item.grossArea |
| | | item.grossAmount=parseFloat((item.price * item.computeGrossArea).toFixed(2)) |
| | | }) |
| | | titleUploadData.value.money=countMoney(xGrid.value.getTableData().fullData).toString() |
| | | |
| | | gridOptions.menuConfig.body.options[0][5].disabled=true |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | //页面第一次加载执行 |
| | |
| | | const data = event.target ? event.target.result : '' |
| | | const workbook = XLXS.read(data, { type: 'binary' }) |
| | | let jsonData = XLXS.utils.sheet_to_json(workbook.Sheets.Sheet1).slice(1) |
| | | |
| | | if(jsonData.length>maxTableLen.value){ |
| | | ElMessage.error(`${t('order.msg.importMaxCheckFailFirst')} |
| | | ${jsonData.length} |
| | |
| | | return |
| | | } |
| | | jsonData.forEach((item,index) => { |
| | | for(let key in item){ |
| | | if(key.indexOf('.')!==-1){ |
| | | const value = item[key]; |
| | | delete item[key]; // 删除原有的属性 |
| | | setNestedProperty(item, key, value); |
| | | } |
| | | } |
| | | |
| | | |
| | | if(item.computeArea === undefined){ |
| | | item.computeArea = area(item) |
| | | } |
| | |
| | | downLoadFile('/importTemplate.xlsx','importTemplate.xlsx') |
| | | } |
| | | |
| | | function setNestedProperty(obj, path, value) { |
| | | const keys = path.split('.'); |
| | | const lastKey = keys.pop(); |
| | | let cursor = obj; |
| | | |
| | | keys.forEach(key => { |
| | | cursor = cursor[key] !== undefined ? cursor[key] : (cursor[key] = {}); |
| | | }); |
| | | |
| | | cursor[lastKey] = value; |
| | | } |
| | | |
| | | |
| | | //字符串转object |
| | | |
| | | function getNestedProperty(obj, path) { |
| | |
| | | private Double childHeight; |
| | | private Double area; |
| | | private Double totalArea; |
| | | private Double arc;//弧长 |
| | | private String icon; |
| | | private String process; |
| | | private String productionId; |
| | |
| | | total_area, |
| | | |
| | | process, |
| | | `group`) |
| | | `group` |
| | | ,arc) |
| | | select |
| | | od.order_id, |
| | | od.order_number, |
| | |
| | | if(pd.glass_sort=1,'(外)',if(pd2.glass_sort=pd.glass_sort,'(内)','')), |
| | | pd.detail, |
| | | if( od.bend_radius!='', |
| | | round(od.width*(od.bend_radius-round(sum(t.thicknessCount),2))/od.bend_radius,1), |
| | | round(od.width* |
| | | (od.bend_radius-round( |
| | | sum(t.thicknessCount)-t1.thicknessCount/2 |
| | | ,2)) |
| | | /od.bend_radius |
| | | ,1), |
| | | od.width |
| | | ), |
| | | ) |
| | | , |
| | | |
| | | od.height, |
| | | od.area, |
| | | od.gross_area, |
| | | pd.process, |
| | | pd.glass_group |
| | | pd.glass_group, |
| | | if( od.bend_radius!='', |
| | | round((od.width*(od.bend_radius-(sum(t.thicknessCount)-t1.thicknessCount)))/od.bend_radius,1) |
| | | ,null) as 'arc' |
| | | |
| | | |
| | | from sd.product_detail as pd |
| | | left join order_detail as od |
| | | on od.product_id = pd.prod_id and pd.detail_type='glass' |
| | |
| | | a.prod_id, |
| | | a.sort_num, |
| | | a.glass_sort, |
| | | (case |
| | | when a.sort_num=1 |
| | | then left(detail,LOCATE('mm',detail)-1)/2 |
| | | else |
| | | left(detail,LOCATE('mm',detail)-1) |
| | | end) as 'thicknessCount' |
| | | left(detail,LOCATE('mm',detail)-1) as 'thicknessCount' |
| | | |
| | | from product_detail as a |
| | | group by prod_id,a.sort_num |
| | | ) as t |
| | | ON t.prod_id = od.product_id and t.sort_num <=pd.sort_num |
| | | left join ( |
| | | select |
| | | a.prod_id, |
| | | a.sort_num, |
| | | a.glass_sort, |
| | | left(detail,LOCATE('mm',detail)-1) as 'thicknessCount' |
| | | |
| | | from product_detail as a |
| | | group by prod_id,a.sort_num |
| | | ) as t1 |
| | | ON t1.prod_id = od.product_id and t1.sort_num =pd.sort_num |
| | | |
| | | where od.order_id = #{orderId} |
| | | group by od.order_number,pd.glass_sort |