| | |
| | | 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; |
| | | } |