yyb
7 天以前 562816e645bc40841d7f65e4be87d7dc28aebcc0
src/pages/index.vue
@@ -19,10 +19,10 @@
            :key="item.label"
            @click="handleQuickTool(item)"
          >
            <view class="quick-icon" :style="{ background: item.bgColor }">
              <image :src="item.icon" class="quick-icon-img" mode="aspectFit" />
            <view class="icon-container">
              <image :src="item.icon" class="item-icon" mode="aspectFit" />
            </view>
            <text class="quick-text">{{ item.label }}</text>
            <text class="item-label">{{ item.label }}</text>
          </up-grid-item>
        </up-grid>
      </view>
@@ -209,29 +209,45 @@
const imgNum3 = "/static/images/index/num3.png";
const quickTools = [
  {
    label: "生产报工",
    icon: "/static/images/icon/shengchanbaogong@2x.png",
    bgColor: "linear-gradient(135deg,#3b82f6,#2563eb)",
    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@2x.png",
    bgColor: "linear-gradient(135deg,#22c55e,#16a34a)",
    route: "/pages/inspectionUpload/index",
    label: "采购台账",
    icon: "/static/images/icon/caigoutaizhang.svg",
    route: "/pages/procurementManagement/procurementLedger/index",
  },
  {
    label: "设备保养",
    icon: "/static/images/icon/shbeibaoyang@2x.png",
    bgColor: "linear-gradient(135deg,#f97316,#ea580c)",
    route: "/pages/equipmentManagement/upkeep/index",
    label: "客户往来",
    icon: "/static/images/icon/kehuwanglai.svg",
    route: "/pages/sales/receiptPaymentLedger/index",
  },
  {
    label: "设备报修",
    icon: "/static/images/icon/shbeibaoxiu@2x.png",
    bgColor: "linear-gradient(135deg,#a855f7,#7c3aed)",
    route: "/pages/equipmentManagement/repair/index",
    label: "库存管理",
    icon: "/static/images/icon/xiaoshoutaizhang.svg",
    route: "/pages/inventoryManagement/stockManagement/index",
  },
];
@@ -250,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 });
}
@@ -604,27 +620,47 @@
  padding: 6px 0 2px;
}
.quick-icon {
  width: 44px;
  height: 44px;
.icon-container {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
  margin-bottom: 0.375rem;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
  animation: fadeInScale 0.5s ease both;
}
.quick-icon-img {
  width: 26px;
  height: 26px;
.item-icon {
  width: 36px;
  height: 36px;
  display: block;
}
.quick-text {
  margin-top: 6px;
.icon-container:active {
  transform: scale(0.97);
}
.item-label {
  font-size: 12px;
  color: #555555;
  text-align: center;
  white-space: nowrap;
  display: block;
  line-height: 1.4;
  font-weight: 500;
  margin-top: 4px;
  margin-bottom: 6px;
}
:deep(.up-grid-item) {
  padding: 6px 0;
}
:deep(.up-grid-item__content) {
  padding: 0;
}
.section-header {
@@ -1050,4 +1086,15 @@
    color: #e9edf3;
  }
}
@keyframes fadeInScale {
  0% {
    opacity: 0;
    transform: translateY(0.5rem) scale(0.96);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
</style>