yyb
2 天以前 5e0d63ccef8c8fc5763cf663aee0c1778113a818
首页快捷入口替换
已修改1个文件
90 ■■■■■ 文件已修改
src/pages/index.vue 90 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/index.vue
@@ -209,25 +209,45 @@
const imgNum3 = "/static/images/index/num3.png";
const quickTools = [
  {
    label: "生产报工",
    icon: "/static/images/icon/shengchanbaogong.svg",
    action: "scan",
  // {
  //   label: "生产报工",
  //   icon: "/static/images/icon/shengchanbaogong.svg",
  //   action: "scan",
  // },
  // {
  //   label: "设备巡检",
  //   icon: "/static/images/icon/xunjianshangchuan.svg",
  //   route: "/pages/inspectionUpload/index",
  // },
  // {
  //   label: "设备保养",
  //   icon: "/static/images/icon/shebeibaoyang.svg",
  //   route: "/pages/equipmentManagement/upkeep/index",
  // },
  // {
  //   label: "设备报修",
  //   icon: "/static/images/icon/shebeibaoxiu.svg",
  //   route: "/pages/equipmentManagement/repair/index",
  // },
    {
    label: "销售台账",
    icon: "/static/images/icon/xiaoshoutaizhang.svg",
    route: "/pages/sales/salesAccount/index",
  },
  {
    label: "设备巡检",
    icon: "/static/images/icon/xunjianshangchuan.svg",
    route: "/pages/inspectionUpload/index",
    label: "采购台账",
    icon: "/static/images/icon/caigoutaizhang.svg",
    route: "/pages/procurementManagement/procurementLedger/index",
  },
  {
    label: "设备保养",
    icon: "/static/images/icon/shebeibaoyang.svg",
    route: "/pages/equipmentManagement/upkeep/index",
    label: "客户往来",
    icon: "/static/images/icon/kehuwanglai.svg",
    route: "/pages/sales/receiptPaymentLedger/index",
  },
  {
    label: "设备报修",
    icon: "/static/images/icon/shebeibaoxiu.svg",
    route: "/pages/equipmentManagement/repair/index",
    label: "库存管理",
    icon: "/static/images/icon/xiaoshoutaizhang.svg",
    route: "/pages/inventoryManagement/stockManagement/index",
  },
];
@@ -246,28 +266,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?.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 });
}