| | |
| | | console.log("扫码结果:", res); |
| | | // 解析扫码结果并跳转到生产报工页面 |
| | | try { |
| | | const scanResult = JSON.parse(res.result); |
| | | const scanRaw = res.result; |
| | | const scanResult = |
| | | typeof scanRaw === "string" ? JSON.parse(scanRaw) : scanRaw; |
| | | console.log("scanResult", scanResult); |
| | | uni.navigateTo({ |
| | | url: `/pages/productionManagement/productionReport/index?orderRow=${encodeURIComponent(JSON.stringify(scanResult))}` |
| | | // 传递整个 orderRow 对象(扫码对象)给报工页 |
| | | url: `/pages/productionManagement/productionReport/index?orderRow=${encodeURIComponent(JSON.stringify(scanResult))}`, |
| | | }); |
| | | } catch (e) { |
| | | console.error("扫码结果解析失败:", e); |
| | |
| | | }, |
| | | fail: (err) => { |
| | | console.error("扫码失败:", err); |
| | | } |
| | | } |
| | | }); |
| | | return; |
| | | } |
| | |
| | | console.log("工单数据:", workData); |
| | | |
| | | orderRow = JSON.stringify({ |
| | | id: workData.id || workOrderId, |
| | | workOrderId: workData.id || workOrderId, |
| | | planQuantity: workData.planQuantity - workData.completeQuantity, |
| | | productProcessRouteItemId: |
| | | workData.productProcessRouteItemId || |
| | |
| | | } |
| | | // 扫码成功后跳转到生产报工页面,并传递orderRow参数 |
| | | uni.navigateTo({ |
| | | url: `/pages/productionManagement/productionReport/index?orderRow=${orderRow}`, |
| | | url: `/pages/productionManagement/productionReport/index?orderRow=${encodeURIComponent(orderRow)}`, |
| | | }); |
| | | }, |
| | | fail: err => { |