| | |
| | | }, |
| | | |
| | | columns: [ |
| | | {type: 'seq', fixed: "left", title: ' ', slots: {content: 'content'}, width: 50}, |
| | | {type: 'seq', title: t('basicData.Number'), width: 80}, |
| | | {field: 'order_number', title: '订序', width: 70}, |
| | | {field: 'child_width', |
| | | {field: 'width', |
| | | width: 100, |
| | | title: t('order.width'), |
| | | sortable: true |
| | | }, |
| | | { |
| | | field: 'child_height', |
| | | field: 'height', |
| | | width: 100, |
| | | title: t('order.height'), |
| | | sortable: true |
| | |
| | | sortable: true |
| | | }, |
| | | { |
| | | field: 'process_cards', |
| | | field: 'process_id', |
| | | width: 150, |
| | | title: '流程卡号', |
| | | filters: [{data: ''}], |
| | |
| | | }, |
| | | |
| | | { |
| | | field: 'shelf_number', |
| | | field: 'layout_id', |
| | | width: 150, |
| | | title: '架号', |
| | | filters: [{data: ''}], |
| | |
| | | request.post(`/glassOptimize/projectInfo/${projectNo.value}`).then((res) => { |
| | | if ((Number(res.code) === 200)) { |
| | | const data = res.data.data; |
| | | data.forEach(item => { |
| | | item.longGrind1 = 0; |
| | | item.longGrind2 = 0; |
| | | item.shortGrind1 = 0; |
| | | item.shortGrind2 = 0; |
| | | item.shelf_number = 0; |
| | | }); |
| | | xGrid.value.loadData(res.data.data); |
| | | gridOptions.data = res.data.data; |
| | | projectName.value = res.data.data[0].project_name; |
| | | const grindingTrimming = res.data.grindingTrimming; |
| | | if(grindingTrimming!==null){ |
| | | const formattedData = grindingTrimming.map(item => { |
| | | const formattedItem = {}; |
| | | for (const key in item) { |
| | | if (typeof item[key] === 'string') { |
| | | //去除字符串属性值开头和结尾的双引号 |
| | | formattedItem[key] = item[key].replace(/^\"|\"$/g, ''); |
| | | } else { |
| | | formattedItem[key] = item[key]; |
| | | } |
| | | } |
| | | return formattedItem; |
| | | }); |
| | | data.forEach(item => { |
| | | if(formattedData[0].autoFillEdge==="true"){ |
| | | item.longGrind1=0 |
| | | item.longGrind2=0 |
| | | item.shortGrind1=0 |
| | | item.shortGrind2=0 |
| | | if(item.width>=formattedData[0].minAutoLenght){ |
| | | item.width+=parseFloat(formattedData[0].leftEdge) |
| | | item.width+=parseFloat(formattedData[0].rightEdge) |
| | | item.longGrind1 = formattedData[0].leftEdge; |
| | | item.longGrind2 = formattedData[0].rightEdge; |
| | | } |
| | | if(item.height>=formattedData[0].minAutoLenght){ |
| | | item.height+=parseFloat(formattedData[0].upEdge) |
| | | item.height+=parseFloat(formattedData[0].downEdge) |
| | | item.shortGrind1 = formattedData[0].upEdge; |
| | | item.shortGrind2 = formattedData[0].downEdge; |
| | | } |
| | | } |
| | | item.height=parseFloat(item.height.toFixed(2)) |
| | | item.width=parseFloat(item.width.toFixed(2)) |
| | | |
| | | }); |
| | | } |
| | | xGrid.value.loadData(data); |
| | | gridOptions.data = data; |
| | | projectName.value = data[0].project_name; |
| | | } else { |
| | | ElMessage.warning(res.msg); |
| | | } |
| | |
| | | |
| | | // 从子组件SetAmount获取磨量值,并更新表格数据 |
| | | const Amount = (amountData) => { |
| | | nextTick(() => { |
| | | fetchData() |
| | | /*nextTick(() => { |
| | | const data = gridOptions.data; |
| | | if (data) { |
| | | try { |
| | |
| | | } else { |
| | | console.warn('表格数据为空,无法更新磨量值'); |
| | | } |
| | | }); |
| | | });*/ |
| | | }; |
| | | |
| | | //中转站接受SetTrimming的值(设置修边) |