| | |
| | | getProductOrderSource, |
| | | updateProductOrder, |
| | | } from "@/api/productionManagement/productionOrder.js"; |
| | | import { productWorkOrderPage } from "@/api/productionManagement/workOrder.js"; |
| | | import { listMain as getOrderProcessRouteMain } from "@/api/productionManagement/productProcessRoute.js"; |
| | | import MaterialLedgerDialog from "@/views/productionManagement/productionOrder/components/MaterialLedgerDialog.vue"; |
| | | import MaterialDetailDialog from "@/views/productionManagement/productionOrder/components/MaterialDetailDialog.vue"; |
| | |
| | | }; |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | // 构造一个新的对象,不包含entryDate字段 |
| | | const params = { ...searchForm.value, ...page }; |
| | | params.entryDate = undefined; |
| | | productOrderListPage(params) |
| | | .then(async res => { |
| | | const records = res.data.records || []; |
| | | // 为每个订单查询对应的工序进度数据 |
| | | const processPromises = records.map(async item => { |
| | | if (item.npsNo) { |
| | | try { |
| | | const workOrderRes = await productWorkOrderPage({ |
| | | npsNo: item.npsNo, |
| | | size: 100, |
| | | }); |
| | | const workOrders = workOrderRes.data.records || []; |
| | | // 按照工序顺序排序(如果有顺序字段,假设为 orderNum 或按返回顺序) |
| | | // 转换为 processRouteStatus 格式 |
| | | const processRouteStatus = workOrders.map(wo => ({ |
| | | name: wo.operationName || "未知工序", |
| | | percentage: wo.completionStatus > 100 ? 100 : wo.completionStatus, |
| | | })); |
| | | return { ...item, processRouteStatus }; |
| | | } catch (error) { |
| | | console.error(`获取工单 ${item.npsNo} 进度失败:`, error); |
| | | return { ...item, processRouteStatus: [] }; |
| | | } |
| | | } |
| | | return { ...item, processRouteStatus: [] }; |
| | | }); |
| | | |
| | | tableData.value = await Promise.all(processPromises); |
| | | .then(res => { |
| | | tableData.value = res.data.records || []; |
| | | page.total = res.data.total; |
| | | tableLoading.value = false; |
| | | }) |
| | |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button type="primary" |
| | | :loading="reportLoading" |
| | | @click="handleReport">确定</el-button> |
| | | <el-button @click="reportDialogVisible = false">取消</el-button> |
| | | </span> |
| | |
| | | const transferCardQrUrl = ref(""); |
| | | const transferCardRowData = ref(null); |
| | | const reportDialogVisible = ref(false); |
| | | const reportLoading = ref(false); |
| | | const fileDialogVisible = ref(false); |
| | | const currentWorkOrderId = ref(null); |
| | | const reportFormRef = ref(null); |
| | |
| | | const reportForm = reactive({ |
| | | planQuantity: 0, |
| | | quantity: null, |
| | | scrapQty: null, |
| | | scrapQty: 0, |
| | | userName: "", |
| | | workOrderId: "", |
| | | reportWork: "", |
| | |
| | | reportForm.workOrderId = row.id; |
| | | reportForm.reportWork = row.reportWork; |
| | | reportForm.productMainId = row.productMainId; |
| | | reportForm.scrapQty = |
| | | row.scrapQty !== undefined && row.scrapQty !== null ? row.scrapQty : null; |
| | | reportForm.productionOrderRoutingOperationId = |
| | | row.productionOrderRoutingOperationId; |
| | | reportForm.scrapQty = 0; |
| | | reportForm.productionOrderRoutingOperationId = row.productionOrderRoutingOperationId; |
| | | reportForm.productionOrderId = row.productionOrderId; |
| | | if (row.type == 0) { |
| | | reportForm.workHour = row.workHour || 0; |
| | |
| | | productionOperationParamList: productionOperationParamList, |
| | | }; |
| | | |
| | | reportLoading.value = true; |
| | | addProductMain(submitParams) |
| | | .then(res => { |
| | | proxy.$modal.msgSuccess("报工成功"); |
| | |
| | | ElMessageBox.alert("报工失败", "提示", { |
| | | confirmButtonText: "确定", |
| | | }); |
| | | }) |
| | | .finally(() => { |
| | | reportLoading.value = false; |
| | | }); |
| | | }); |
| | | }; |
| | |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button type="primary" |
| | | :loading="mergeSubmitLoading" |
| | | @click="handleMergeSubmit">确定下发</el-button> |
| | | <el-button @click="isShowNewModal = false">取消</el-button> |
| | | </span> |
| | |
| | | |
| | | // 合并下发弹窗控制 |
| | | const isShowNewModal = ref(false); |
| | | const mergeSubmitLoading = ref(false); |
| | | // 合并下发表单数据 |
| | | const mergeForm = reactive({ |
| | | productName: "", |
| | |
| | | const payload = { |
| | | ...mergeForm, |
| | | }; |
| | | mergeSubmitLoading.value = true; |
| | | productionPlanCombine(payload) |
| | | .then(res => { |
| | | if (res.code === 200) { |
| | |
| | | .catch(err => { |
| | | console.error("合并下发异常:", err); |
| | | ElMessage.error("系统异常,合并下发失败"); |
| | | }) |
| | | .finally(() => { |
| | | mergeSubmitLoading.value = false; |
| | | }); |
| | | // 可以选择刷新列表或其他操作 |
| | | }; |
| | |
| | | </div> |
| | | <InspectionFormDia ref="inspectionFormDia" @close="handleQuery"></InspectionFormDia> |
| | | <FormDia ref="formDia" @close="handleQuery"></FormDia> |
| | | <files-dia ref="filesDia" @close="handleQuery"></files-dia> |
| | | <files-dia ref="filesDia" ></files-dia> |
| | | <el-dialog v-model="dialogFormVisible" title="编辑检验员" width="30%" |
| | | @close="closeDia"> |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | |
| | | clickFun: (row) => { |
| | | submit(row.id); |
| | | }, |
| | | loading: (row) => submitLoadingId.value === row.id, |
| | | disabled: (row) => { |
| | | // 已提交则禁用 |
| | | if (row.inspectState == 1) return true; |
| | |
| | | const tableData = ref([]); |
| | | const selectedRows = ref([]); |
| | | const tableLoading = ref(false); |
| | | const submitLoadingId = ref(null); |
| | | const currentRow = ref(null) |
| | | const page = reactive({ |
| | | current: 1, |
| | |
| | | }); |
| | | }; |
| | | |
| | | // 提价 |
| | | // 提交 |
| | | const submit = async (id) => { |
| | | const res = await submitQualityInspect({id: id}) |
| | | if (res.code === 200) { |
| | | proxy.$modal.msgSuccess("提交成功"); |
| | | getList(); |
| | | submitLoadingId.value = id; |
| | | try { |
| | | const res = await submitQualityInspect({ id }); |
| | | if (res.code === 200) { |
| | | proxy.$modal.msgSuccess("提交成功"); |
| | | const row = tableData.value.find(item => item.id === id); |
| | | if (row) { |
| | | row.inspectState = 1; |
| | | } |
| | | } |
| | | } finally { |
| | | submitLoadingId.value = null; |
| | | } |
| | | } |
| | | |
| | |
| | | </div> |
| | | <InspectionFormDia ref="inspectionFormDia" @close="handleQuery"></InspectionFormDia> |
| | | <FormDia ref="formDia" @close="handleQuery"></FormDia> |
| | | <files-dia ref="filesDia" @close="handleQuery"></files-dia> |
| | | <files-dia ref="filesDia"></files-dia> |
| | | <el-dialog v-model="dialogFormVisible" title="编辑检验员" width="30%" |
| | | @close="closeDia"> |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | |
| | | clickFun: (row) => { |
| | | submit(row.id); |
| | | }, |
| | | loading: (row) => submitLoadingId.value === row.id, |
| | | disabled: (row) => { |
| | | // 已提交则禁用 |
| | | if (row.inspectState == 1) return true; |
| | |
| | | const tableData = ref([]); |
| | | const selectedRows = ref([]); |
| | | const tableLoading = ref(false); |
| | | const submitLoadingId = ref(null); |
| | | const dialogFormVisible = ref(false); |
| | | const form = ref({ |
| | | checkName: "" |
| | |
| | | filesDia.value?.openDialog(type, row) |
| | | }) |
| | | }; |
| | | // 提价 |
| | | // 提交 |
| | | const submit = async (id) => { |
| | | const res = await submitQualityInspect({id: id}) |
| | | if (res.code === 200) { |
| | | proxy.$modal.msgSuccess("提交成功"); |
| | | getList(); |
| | | submitLoadingId.value = id; |
| | | try { |
| | | const res = await submitQualityInspect({ id }); |
| | | if (res.code === 200) { |
| | | proxy.$modal.msgSuccess("提交成功"); |
| | | const row = tableData.value.find(item => item.id === id); |
| | | if (row) { |
| | | row.inspectState = 1; |
| | | } |
| | | } |
| | | } finally { |
| | | submitLoadingId.value = null; |
| | | } |
| | | } |
| | | const open = async (row) => { |
| | |
| | | </div> |
| | | <InspectionFormDia ref="inspectionFormDia" @close="handleQuery"></InspectionFormDia> |
| | | <FormDia ref="formDia" @close="handleQuery"></FormDia> |
| | | <files-dia ref="filesDia" @close="handleQuery"></files-dia> |
| | | <files-dia ref="filesDia"></files-dia> |
| | | <el-dialog v-model="dialogFormVisible" title="编辑检验员" width="30%" |
| | | @close="closeDia"> |
| | | <el-form :model="form" label-width="140px" label-position="top" :rules="rules" ref="formRef"> |
| | |
| | | const res = await submitQualityInspect({ id }); |
| | | if (res.code === 200) { |
| | | proxy.$modal.msgSuccess("提交成功"); |
| | | getList(); |
| | | const row = tableData.value.find(item => item.id === id); |
| | | if (row) { |
| | | row.inspectState = 1; |
| | | } |
| | | } |
| | | } finally { |
| | | submitLoadingId.value = null; |
| | |
| | | <template #footer> |
| | | <div class="dialog-footer"> |
| | | <el-button type="primary" |
| | | :loading="deliveryLoading" |
| | | @click="submitDelivery">确认发货 |
| | | </el-button> |
| | | <el-button @click="closeDeliveryDia">取消</el-button> |
| | |
| | | |
| | | // 发货相关 |
| | | const deliveryFormVisible = ref(false); |
| | | const deliveryLoading = ref(false); |
| | | const currentDeliveryRow = ref(null); |
| | | const getDeliveryBatchQuantity = item => { |
| | | const quantity = |
| | |
| | | const productModelId = |
| | | currentDeliveryRow.value.productModelId || |
| | | currentDeliveryRow.value.modelId; |
| | | deliveryLoading.value = true; |
| | | addShippingInfo({ |
| | | salesLedgerId: salesLedgerId, |
| | | salesLedgerProductId: currentDeliveryRow.value.id, |
| | |
| | | }); |
| | | } |
| | | }); |
| | | }).finally(() => { |
| | | deliveryLoading.value = false; |
| | | }); |
| | | } |
| | | }); |