gaoluyang
3 天以前 8e5ede49987bcfa4e56e98641fb11070210f4f35
src/pages/index.vue
@@ -213,7 +213,7 @@
    label: "生产报工",
    icon: "/static/images/icon/shengchanbaogong@2x.png",
    bgColor: "linear-gradient(135deg,#3b82f6,#2563eb)",
    route: "/pages/productionManagement/productionReport/index",
    action: "scan",
  },
  {
    label: "设备巡检",
@@ -250,6 +250,28 @@
}
function handleQuickTool(item) {
  if (item?.action === "scan") {
    // 生产报工 - 调用扫码
    uni.scanCode({
      success: (res) => {
        console.log("扫码结果:", res);
        // 解析扫码结果并跳转到生产报工页面
        try {
          const scanResult = JSON.parse(res.result);
          uni.navigateTo({
            url: `/pages/productionManagement/productionReport/index?orderRow=${encodeURIComponent(JSON.stringify(scanResult))}`
          });
        } catch (e) {
          console.error("扫码结果解析失败:", e);
          uni.showToast({ title: "无效的二维码", icon: "none" });
        }
      },
      fail: (err) => {
        console.error("扫码失败:", err);
      }
    });
    return;
  }
  if (!item?.route) return;
  uni.navigateTo({ url: item.route });
}