zhangwencui
8 小时以前 7a0790d8224db45a039bf33d0ef4e24ae879a243
src/pages/basicData/supplierManage/index.vue
@@ -1,16 +1,6 @@
<template>
  <view class="sales-account">
    <PageHeader title="供应商管理" @back="goBack">
      <template #right>
        <up-button
          type="primary"
          size="small"
          text="新增"
          :customStyle="{ marginRight: '12px' }"
          @click="goAdd"
        />
      </template>
    </PageHeader>
    <PageHeader title="供应商管理" @back="goBack"/>
    <view class="search-section">
      <view class="search-bar">
        <view class="search-input">
@@ -58,16 +48,8 @@
              <text class="detail-value">{{ item.taxpayerIdentificationNum || "-" }}</text>
            </view>
            <view class="detail-row">
              <text class="detail-label">公司电话</text>
              <text class="detail-value">{{ item.companyPhone || "-" }}</text>
            </view>
            <view class="detail-row">
              <text class="detail-label">联系人</text>
              <text class="detail-value">{{ item.contactUserName || "-" }}</text>
            </view>
            <view class="detail-row">
              <text class="detail-label">联系电话</text>
              <text class="detail-value">{{ item.contactUserPhone || "-" }}</text>
              <text class="detail-label">公司地址</text>
              <text class="detail-value">{{ item.companyAddress || "-" }}</text>
            </view>
            <view class="detail-row">
              <text class="detail-label">维护人</text>
@@ -80,14 +62,7 @@
          </view>
          <view class="action-buttons">
            <u-button size="small" class="action-btn" @click="goEdit(item)">编辑</u-button>
            <u-button
              type="error"
              size="small"
              class="action-btn"
              @click="handleDelete(item)"
            >
              删除
            </u-button>
            <u-button size="small" class="action-btn" type="error" @click="handleDelete(item)">删除</u-button>
          </view>
        </view>
      </view>
@@ -95,16 +70,17 @@
    <view v-else class="no-data">
      <text>暂无供应商数据</text>
    </view>
    <view class="fab-button" @click="goAdd">
      <up-icon name="plus" size="24" color="#ffffff"></up-icon>
    </view>
  </view>
</template>
<script setup>
  import { reactive, ref } from "vue";
  import { onShow } from "@dcloudio/uni-app";
  import useUserStore from "@/store/modules/user";
  import { delSupplier, listSupplier } from "@/api/basicData/supplierManageFile";
  const userStore = useUserStore();
  const supplierName = ref("");
  const list = ref([]);
@@ -144,7 +120,14 @@
      isWhite: tabValue.value,
    })
      .then(res => {
        list.value = res?.data?.records || [];
        const payload = res?.data;
        if (Array.isArray(payload)) {
          list.value = payload;
        } else if (payload && typeof payload === "object") {
          list.value = payload.records || payload.rows || [];
        } else {
          list.value = [];
        }
      })
      .catch(() => {
        uni.showToast({ title: "查询失败", icon: "error" });
@@ -156,10 +139,6 @@
  const handleDelete = item => {
    if (!item?.id) return;
    if (item.maintainUserName && item.maintainUserName !== userStore.nickName) {
      uni.showToast({ title: "不可删除他人维护的数据", icon: "none" });
      return;
    }
    uni.showModal({
      title: "删除提示",
      content: "确定要删除吗?删除后无法恢复",
@@ -182,7 +161,6 @@
  };
  onShow(() => {
    userStore.getInfo();
    getList();
  });
</script>