| | |
| | | <new-product-order v-if="isShowNewModal" |
| | | v-model:visible="isShowNewModal" |
| | | @completed="handleQuery"/> |
| | | |
| | | <!-- 清场记录弹框 --> |
| | | <clearance-record-dialog |
| | | v-model="clearanceDialogVisible" |
| | | :order-data="currentOrderData" |
| | | @save="handleSaveClearanceRecord" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | listProcessRoute, |
| | | bindingRoute, |
| | | delProductOrder, finishOrder, |
| | | saveCleanRecord, |
| | | } from "@/api/productionManagement/productionOrder.js"; |
| | | import {listMain as getOrderProcessRouteMain} from "@/api/productionManagement/productProcessRoute.js"; |
| | | import {fileDel} from "@/api/financialManagement/revenueManagement.js"; |
| | | import PIMTable from "@/components/PIMTable/PIMTable.vue"; |
| | | |
| | | const NewProductOrder = defineAsyncComponent(() => import("@/views/productionManagement/productionOrder/New.vue")); |
| | | const ClearanceRecordDialog = defineAsyncComponent(() => import("@/views/productionManagement/productionOrder/ClearanceRecordDialog.vue")); |
| | | |
| | | const {proxy} = getCurrentInstance(); |
| | | |
| | |
| | | handleFinishOrder(row); |
| | | }, |
| | | }, |
| | | { |
| | | name: "清场记录", |
| | | type: "text", |
| | | showHide: row => !row.isEnd, |
| | | clickFun: row => { |
| | | handleClearanceRecord(row); |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | ]); |
| | |
| | | const bindRouteLoading = ref(false); |
| | | const bindRouteSaving = ref(false); |
| | | const routeOptions = ref([]); |
| | | |
| | | // 清场记录弹框 |
| | | const clearanceDialogVisible = ref(false); |
| | | const currentOrderData = ref({}); |
| | | const bindForm = reactive({ |
| | | orderId: null, |
| | | routeId: null, |
| | |
| | | proxy.$modal.msg("已取消"); |
| | | }); |
| | | }; |
| | | |
| | | // 打开清场记录弹框 |
| | | const handleClearanceRecord = (row) => { |
| | | currentOrderData.value = row; |
| | | clearanceDialogVisible.value = true; |
| | | }; |
| | | |
| | | // 保存清场记录 |
| | | const handleSaveClearanceRecord = async (saveData, callback) => { |
| | | const orderId = currentOrderData.value?.id; |
| | | if (!orderId) { |
| | | proxy.$modal.msgError("订单ID不存在"); |
| | | return; |
| | | } |
| | | |
| | | try { |
| | | await saveCleanRecord(orderId, saveData); |
| | | proxy.$modal.msgSuccess("清场记录保存成功"); |
| | | currentOrderData.value.cleanRecord = saveData; |
| | | if (callback) callback(); |
| | | getList(); |
| | | } catch (error) { |
| | | console.error('保存清场记录失败:', error); |
| | | proxy.$modal.msgError("清场记录保存失败"); |
| | | } |
| | | }; |
| | | onMounted(() => { |
| | | getList(); |
| | | }); |