| | |
| | | @click="openProducerPicker" |
| | | suffix-icon="arrow-down" /> |
| | | </u-form-item> |
| | | <!-- 工时 --> |
| | | <u-form-item label="工时" |
| | | v-if="form.type == 0" |
| | | prop="workHour"> |
| | | <u-input v-model="form.workHour" |
| | | placeholder="请输入工时" |
| | | type="number" /> |
| | | <text class="param-unit">h</text> |
| | | </u-form-item> |
| | | </view> |
| | | <!-- 动态参数区域 --> |
| | | <view class="form-section" |
| | |
| | | import { addProductMain } from "@/api/productionManagement/productionReporting"; |
| | | import { getInfo } from "@/api/login"; |
| | | import { userListNoPageByTenantId } from "@/api/system/user"; |
| | | import { findProcessParamListOrder } from "@/api/productionManagement/productProcessRoute.js"; |
| | | import { |
| | | findProcessParamListOrder, |
| | | listMaterialPickingDetail, |
| | | } from "@/api/productionManagement/productionOrder.js"; |
| | | import { getDicts } from "@/api/system/dict/data"; |
| | | import { formatDateToYMD, parseTime } from "@/utils/ruoyi"; |
| | | |
| | |
| | | scrapQty: "", |
| | | userName: "", |
| | | workOrderId: "", |
| | | productProcessRouteItemId: "", |
| | | userId: "", |
| | | schedulingUserId: "", |
| | | reportWork: "", |
| | | productMainId: null, |
| | | productionOrderRoutingOperationId: "", |
| | | productionOrderId: "", |
| | | workHour: 0, |
| | | type: null, |
| | | paramGroups: {}, |
| | | }); |
| | | |
| | |
| | | userId: form.value.userId, |
| | | userName: form.value.userName, |
| | | productionOperationTaskId: form.value.workOrderId, |
| | | productProcessRouteItemId: form.value.productProcessRouteItemId, |
| | | reportWork: form.value.reportWork, |
| | | productMainId: form.value.productMainId, |
| | | productionOrderRoutingOperationId: |
| | | form.value.productionOrderRoutingOperationId, |
| | | productionOrderId: form.value.productionOrderId, |
| | | workHour: form.value.workHour, |
| | | productionOperationParamList: productionOperationParamList, |
| | | }; |
| | | |
| | |
| | | }); |
| | | }; |
| | | |
| | | onLoad(options => { |
| | | onLoad(async options => { |
| | | console.log(options, "options"); |
| | | if (!options.orderRow) { |
| | | console.log("从首页跳转,无订单数据"); |
| | |
| | | const orderRow = JSON.parse(decodeURIComponent(options.orderRow)); |
| | | console.log("构造的orderRow:", orderRow); |
| | | |
| | | // 参照 PC 端逻辑:未领料无法报工 |
| | | if (orderRow.productionOrderId) { |
| | | try { |
| | | const res = await listMaterialPickingDetail(orderRow.productionOrderId); |
| | | const records = Array.isArray(res.data) |
| | | ? res.data |
| | | : res.data?.records || []; |
| | | if (res.code === 200 && records.length === 0) { |
| | | uni.showModal({ |
| | | title: "提示", |
| | | content: "未领料无法报工", |
| | | showCancel: false, |
| | | success: () => { |
| | | goBack(); |
| | | }, |
| | | }); |
| | | return; |
| | | } |
| | | } catch (error) { |
| | | console.error("查询领料详情失败:", error); |
| | | } |
| | | } |
| | | |
| | | form.value.planQuantity = |
| | | orderRow.planQuantity != null ? String(orderRow.planQuantity) : ""; |
| | | form.value.productProcessRouteItemId = |
| | | orderRow.productProcessRouteItemId || ""; |
| | | form.value.workOrderId = orderRow.id || ""; |
| | | form.value.reportWork = orderRow.reportWork || ""; |
| | | form.value.productMainId = orderRow.productMainId || null; |
| | | form.value.productionOrderRoutingOperationId = |
| | | orderRow.productionOrderRoutingOperationId || ""; |
| | | form.value.productionOrderId = orderRow.productionOrderId || ""; |
| | | form.value.type = orderRow.type; |
| | | |
| | | if (orderRow.type == 0) { |
| | | form.value.workHour = orderRow.workHour || 0; |
| | | } else { |
| | | form.value.workHour = 0; |
| | | } |
| | | |
| | | getInfo().then(res => { |
| | | form.value.userId = res.user.userId; |