| | |
| | | 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", |
| | | }, |
| | | ]; |
| | | |
| | |
| | | } |
| | | |
| | | 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 }); |
| | | } |