| | |
| | | <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"> |
| | |
| | | <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> |
| | |
| | | </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> |
| | |
| | | <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([]); |
| | | |
| | |
| | | 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" }); |
| | |
| | | |
| | | const handleDelete = item => { |
| | | if (!item?.id) return; |
| | | if (item.maintainUserName && item.maintainUserName !== userStore.nickName) { |
| | | uni.showToast({ title: "不可删除他人维护的数据", icon: "none" }); |
| | | return; |
| | | } |
| | | uni.showModal({ |
| | | title: "删除提示", |
| | | content: "确定要删除吗?删除后无法恢复", |
| | |
| | | }; |
| | | |
| | | onShow(() => { |
| | | userStore.getInfo(); |
| | | getList(); |
| | | }); |
| | | </script> |