zhangwencui
2026-03-02 38bf4054f02933390d2bbdd44b5eaa91c83de1f3
src/pages/equipmentManagement/upkeep/index.vue
@@ -41,7 +41,9 @@
              <u-tag v-if="item.status === 1"
                     type="success">完结</u-tag>
              <u-tag v-if="item.status === 0"
                     type="error">待保养</u-tag>
                     type="warning">待保养</u-tag>
              <u-tag v-if="item.status === 2"
                     type="error">失败</u-tag>
            </view>
          </view>
          <up-divider></up-divider>
@@ -72,35 +74,24 @@
            </view>
            <view class="detail-row">
              <text class="detail-label">保养结果</text>
              <view class="detail-value">
                <u-tag v-if="item.maintenanceResult === 1"
                       type="success"
                       size="mini">
                  完好
                </u-tag>
                <u-tag v-if="item.maintenanceResult === 0"
                       type="error"
                       size="mini">
                  维修
                </u-tag>
                <text v-if="item.maintenanceResult === undefined || item.maintenanceResult === null">-</text>
              </view>
              <text class="detail-value">{{item.maintenanceResult || '-'}}
              </text>
            </view>
          </view>
          <!-- 按钮区域 -->
          <view class="action-buttons">
            <u-button type="primary"
            <!-- <u-button type="primary"
                      size="small"
                      class="action-btn"
                      :disabled="item.status === 1"
                      @click.stop="edit(item.id)">
              编辑
            </u-button>
            </u-button> -->
            <u-button type="warning"
                      size="small"
                      class="action-btn"
                      :disabled="item.status === 1"
                      @click.stop="addMaintain(item.id)">
                      @click.stop="addMaintain(item.id, item)">
              保养
            </u-button>
            <u-button type="error"
@@ -110,12 +101,18 @@
                      @click.stop="delUpkeepByIds(item.id)">
              删除
            </u-button>
            <u-button type="warning"
            <u-button type="info"
                      size="small"
                      class="action-btn"
                      @click.stop="viewDetail(item)">
              详情
            </u-button>
            <!-- <u-button type="warning"
                      size="small"
                      class="action-btn"
                      @click.stop="addFile(item.id)">
              附件
            </u-button>
            </u-button> -->
          </view>
        </view>
      </view>
@@ -236,19 +233,34 @@
  };
  // 新增保养 - 跳转到保养页面
  const addMaintain = id => {
  const addMaintain = (id, item) => {
    if (!id && multipleList.value.length !== 1) {
      showToast("请选择一条记录");
      return;
    }
    const targetId = id || multipleList.value[0].id;
    // 使用本地存储传递id
    const targetItem = item || multipleList.value[0];
    // 使用本地存储传递id和完整数据
    uni.setStorageSync("repairId", targetId);
    uni.setStorageSync("upkeepItemData", JSON.stringify(targetItem));
    uni.navigateTo({
      url: "/pages/equipmentManagement/upkeep/maintain",
    });
  };
  // 查看详情 - 跳转到详情页面
  const viewDetail = item => {
    if (!item) {
      showToast("参数错误");
      return;
    }
    // 使用本地存储传递整条数据
    uni.setStorageSync("upkeepDetailData", JSON.stringify(item));
    uni.navigateTo({
      url: "/pages/equipmentManagement/upkeep/detail",
    });
  };
  // 新增计划 - 跳转到新增页面
  const addPlan = () => {
    uni.navigateTo({