| | |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | const params = { ...searchForm.value, current: page.current, size: page.size }; |
| | | productWorkOrderPage(params) |
| | | return productWorkOrderPage(params) |
| | | .then(res => { |
| | | tableLoading.value = false; |
| | | const records = res.data.records || []; |
| | |
| | | }) |
| | | .catch(() => { |
| | | tableLoading.value = false; |
| | | }); |
| | | }; |
| | | |
| | | // 重新加载指定父行的子工序数据 |
| | | const reloadExpandedChildren = () => { |
| | | const expandedIds = expandedRowKeys.value; |
| | | if (expandedIds.length === 0) return; |
| | | expandedIds.forEach(parentId => { |
| | | const parentRow = tableData.value.find( |
| | | item => String(item.productionOrderId) === String(parentId) |
| | | ); |
| | | if (parentRow) { |
| | | parentRow.childrenLoading = true; |
| | | getWorkOrdersByOrderId(parentId) |
| | | .then(res => { |
| | | parentRow.childrenLoading = false; |
| | | const idx = tableData.value.findIndex( |
| | | item => String(item.productionOrderId) === String(parentId) |
| | | ); |
| | | if (idx > -1) { |
| | | tableData.value[idx].children = res.data || []; |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | parentRow.childrenLoading = false; |
| | | }); |
| | | } |
| | | }); |
| | | }; |
| | | |
| | |
| | | reportForm.workOrderId = row.id; |
| | | reportForm.reportWork = row.reportWork; |
| | | reportForm.productMainId = row.productMainId; |
| | | reportForm.scrapQty = |
| | | row.scrapQty !== undefined && row.scrapQty !== null ? row.scrapQty : null; |
| | | reportForm.scrapQty = 0; |
| | | reportForm.productionOrderRoutingOperationId = |
| | | row.productionOrderRoutingOperationId; |
| | | reportForm.productionOrderId = row.productionOrderId; |
| | |
| | | .then(res => { |
| | | proxy.$modal.msgSuccess("报工成功"); |
| | | reportDialogVisible.value = false; |
| | | getList(); |
| | | getList().then(() => { |
| | | reloadExpandedChildren(); |
| | | }); |
| | | }) |
| | | .catch(() => { |
| | | ElMessageBox.alert("报工失败", "提示", { |