gaoluyang
3 天以前 77861fcc5ee1c4f8e7c6412b373cb438c7313930
src/pages/equipmentManagement/ledger/index.vue
@@ -78,25 +78,25 @@
            </view>
          </view>
          
          <!-- 按钮区域,参考 invoiceLedger 的样式 -->
          <!-- 按钮区域 - 替换为 uview-plus 按钮 -->
          <view class="action-buttons">
            <van-button
            <u-button
              type="primary"
              size="small"
              class="action-btn"
              @click="edit(item.id)"
            >
              编辑
            </van-button>
            <van-button
              type="danger"
            </u-button>
            <u-button
              type="error"
              size="small"
              plain
              class="action-btn"
              @click="deleteRow(item.id)"
            >
              删除
            </van-button>
            </u-button>
          </view>
        </view>
      </view>
@@ -119,7 +119,14 @@
import PageHeader from '@/components/PageHeader.vue'
import { getLedgerPage, delLedger } from '@/api/equipmentManagement/ledger'
import useUserStore from "@/store/modules/user"
import { showToast } from 'vant';
// 替换 toast 方法
const showToast = (message) => {
  uni.showToast({
    title: message,
    icon: 'none'
  })
}
const userStore = useUserStore()
@@ -143,7 +150,7 @@
  }
  getLedgerPage(params)
    .then((res) => {
      ledgerList.value = res.records || res.data?.records || []
      ledgerList.value = res.data.records
    })
    .catch(() => {
      showToast('获取数据失败')
@@ -160,8 +167,9 @@
// 编辑 - 跳转到详情页面
const edit = (id) => {
  if (!id) return
  uni.setStorageSync('ledgerId', id)
  uni.navigateTo({
    url: `/pages/equipmentManagement/ledger/detail?id=${id}`
    url: '/pages/equipmentManagement/ledger/detail'
  })
}
@@ -330,7 +338,7 @@
  color: #999;
}
// 按钮样式,参考 invoiceLedger
// 按钮样式
.action-buttons {
  display: flex;
  gap: 12px;