| | |
| | | |
| | | const orderId = route.query.orderId |
| | | const productionId = route.query.productionId |
| | | const orderQuantity = route.query.quantity |
| | | |
| | | const orderOtherMoney = ref(null) |
| | | |
| | |
| | | path: '/main/processCard/AddProcessCard', |
| | | query: {orderId: orderId, |
| | | productionId: productionId, |
| | | quantity: orderQuantity, |
| | | random:Math.random() |
| | | } |
| | | }) |
| | |
| | | gridLeftOptions.toolbarConfig.buttons[0].disabled=false |
| | | return; |
| | | } |
| | | |
| | | // 计算 $table 里 quantity 字段的总和 |
| | | let totalQuantity = selectRecords.reduce((sum, record) => sum + (Number(record.quantity) || 0), 0); |
| | | // 对比全局变量 orderQuantity |
| | | if (totalQuantity !== orderQuantity*1) { |
| | | ElMessage.warning(`所选数据的数量总和 (${totalQuantity}) 与订单数量 (${orderQuantity}) 不匹配,请检查后重试!`); |
| | | gridLeftOptions.toolbarConfig.buttons[0].disabled = false; |
| | | return; |
| | | } |
| | | // if (leftData.length!=selectRecords.length){ |
| | | // ElMessage.warning('请勾选所有数据进行保存') |
| | | // gridLeftOptions.toolbarConfig.buttons[0].disabled=false |
| | |
| | | |
| | | let quantit = ref('') |
| | | let weight = ref('') |
| | | const handleCheckboxChange = ({row}) => { |
| | | const $grid = xGrid.value |
| | | //获取右边表格checkbox选中的数据 |
| | | const checkedList = $grid.getCheckboxRecords() |
| | | const handleCheckboxChange = ({ row }) => { |
| | | const $grid = xGrid.value; |
| | | // 获取右边表格 checkbox 选中的数据 |
| | | const checkedList = $grid.getCheckboxRecords(); |
| | | let quantitySum = 0; |
| | | let weightsum = 0; |
| | | |
| | | checkedList.forEach(item => { |
| | | quantitySum += item.baiscQuantity; |
| | | quantitySum += Number(item.baiscQuantity) || 0; // 确保转换为数字 |
| | | weightsum += weightSum(item); |
| | | }); |
| | | quantit.value = quantitySum; |
| | | |
| | | quantit.value = Number(quantitySum) || 0; // 确保最终值是数字 |
| | | weight.value = parseFloat(weightsum.toFixed(2)); |
| | | } |
| | | }; |
| | | |
| | | </script> |
| | | |
| | | <template> |
| | |
| | | <div height="100%" style="margin: 5px" width="11%"> |
| | | <el-main style=""> |
| | | <div> |
| | | <span><el-input v-model="quantit" style="width: 80px;"/></span> |
| | | <span><el-input v-model="weight" style="width: 80px;"/></span> |
| | | <span><el-input :readonly="true" v-model="quantit" style="width: 80px;"/></span> |
| | | <span><el-input :readonly="true" v-model="weight" style="width: 80px;"/></span> |
| | | </div> |
| | | <span>{{ $t('processCard.selectedQuantity') }}:<el-input id="checkedNum" v-model="checkedNum" clearable |
| | | type="number"></el-input></span><br> |
| | |
| | | v-bind="gridOptions" |
| | | v-on="gridEventsRight" |
| | | @checkbox-change="handleCheckboxChange" |
| | | @checkbox-all="handleCheckboxChange" |
| | | > |
| | | <!-- @toolbar-button-click="toolbarButtonClickEvent"--> |
| | | <!-- 下拉显示所有信息插槽--> |