zhangwencui
13 小时以前 7a0790d8224db45a039bf33d0ef4e24ae879a243
src/pages/basicData/supplierManage/index.vue
@@ -48,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>
@@ -68,11 +60,18 @@
              <text class="detail-value">{{ item.maintainTime || "-" }}</text>
            </view>
          </view>
          <view class="action-buttons">
            <u-button size="small" class="action-btn" @click="goEdit(item)">编辑</u-button>
            <u-button size="small" class="action-btn" type="error" @click="handleDelete(item)">删除</u-button>
          </view>
        </view>
      </view>
    </view>
    <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>
@@ -80,10 +79,8 @@
<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([]);
@@ -123,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" });
@@ -135,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: "确定要删除吗?删除后无法恢复",
@@ -161,7 +161,6 @@
  };
  onShow(() => {
    userStore.getInfo();
    getList();
  });
</script>