张诺
9 小时以前 b14930d7ac2ce362403ea28d0bae724161bc1f3c
src/pages/procurementManagement/procurementLedger/index.vue
@@ -3,7 +3,7 @@
    <!-- 使用通用页面头部组件 -->
    <PageHeader title="采购台账"
                @back="goBack" />
    <!-- 搜索和筛选区域 -->
    <!-- 搜索和筛选区 -->
    <view class="search-section">
      <view class="search-bar">
        <view class="search-input">
@@ -63,7 +63,7 @@
            </view>
            <view class="detail-row">
              <text class="detail-label">合同金额(元)</text>
              <text class="detail-value highlight">{{ item.contractAmount }}</text>
              <text class="detail-value highlight">{{ formatNumber(item.contractAmount) }}</text>
            </view>
            <up-divider></up-divider>
            <view class="detail-info">
@@ -77,20 +77,16 @@
              </view>
            </view>
            <!-- 仅非“审批通过”的台账展示删除按钮 -->
            <view
              class="detail-row"
              v-if="item.approvalStatus !== 3"
              style="justify-content: flex-end; margin-top: 8px;"
            >
              <up-button
                type="error"
                size="small"
                plain
                @click.stop="handleDelete(item)"
              >
            <!-- <view class="detail-row"
                  v-if="item.approvalStatus !== 3"
                  style="justify-content: flex-end; margin-top: 8px;">
              <up-button type="error"
                         size="small"
                         plain
                         @click.stop="handleDelete(item)">
                删除
              </up-button>
            </view>
            </view> -->
          </view>
        </view>
      </view>
@@ -100,12 +96,12 @@
      <text>暂无采购台账数据</text>
    </view>
    <!-- 浮动操作按钮 -->
    <view class="fab-button"
    <!-- <view class="fab-button"
          @click="handleInfo('add')">
      <up-icon name="plus"
               size="24"
               color="#ffffff"></up-icon>
    </view>
    </view> -->
  </view>
</template>
@@ -114,18 +110,21 @@
  import { onShow } from "@dcloudio/uni-app";
  import useUserStore from "@/store/modules/user";
  import PageHeader from "@/components/PageHeader.vue";
  import { purchaseListPage, delPurchase } from "@/api/procurementManagement/procurementLedger";
  import {
    purchaseListPage,
    delPurchase,
  } from "@/api/procurementManagement/procurementLedger";
  const userStore = useUserStore();
  const approvalStatusText = {
    1: "待审核",
    1: "待审批",
    2: "审批中",
    3: "审批通过",
    4: "审批失败",
  };
  // 获取审批状态标签类型
  // 获取审批状态标签类�?
  const getApprovalStatusType = status => {
    const typeMap = {
      1: "info", // 待审核 - 灰色
      1: "info", // 待审批 - 灰色
      2: "warning", // 审批中 - 橙色
      3: "success", // 审批通过 - 绿色
      4: "error", // 审批失败 - 红色
@@ -137,6 +136,11 @@
  // 采购台账数据
  const ledgerList = ref([]);
  // 格式化金额
  const formatNumber = value => {
    return parseFloat(value || 0).toFixed(3);
  };
  // 返回上一页
  const goBack = () => {
@@ -180,6 +184,7 @@
    try {
      // 设置操作类型
      uni.setStorageSync("operationType", type);
      uni.removeStorageSync("editData");
      // 如果是查看或编辑操作
      if (type !== "add") {
@@ -258,14 +263,17 @@
              });
            })
            .catch(error => {
              // 对于 request 封装返回的 '500' 或其他 code,错误提示已经在 request 里 toast 过了,这里不再重复覆盖
              // 对于 request 封装返回的 '500' 或其code,错误提示已经在 request 中处理了,这里不再重复覆盖
              if (error === "500" || typeof error === "number") {
                return;
              }
              // 只有在真正异常时,才在这里兜底提示
              const msg =
                (error && error.msg) ||
                (error && error.response && error.response.data && error.response.data.msg) ||
                (error &&
                  error.response &&
                  error.response.data &&
                  error.response.data.msg) ||
                (error && error.message) ||
                "删除失败";
              uni.showToast({
@@ -287,5 +295,5 @@
<style scoped lang="scss">
  @import "@/styles/procurement-common.scss";
  // 采购台账特有样式(如有需要可在此添加)
  // 采购台账特有样式(如 需要可在此添加)
</style>