| | |
| | | <text class="detail-value">{{ item.updateTime }}</text> |
| | | </view> |
| | | </view> |
| | | <view class="action-buttons"> |
| | | <u-button size="small" |
| | | class="action-btn" |
| | | @click="openDetail(item)">详情</u-button> |
| | | </view> |
| | | </view> |
| | | <up-loadmore :status="loadStatus" /> |
| | | </scroll-view> |
| | |
| | | </scroll-view> |
| | | </view> |
| | | </up-popup> |
| | | <view class="fab-button" |
| | | @click="openAddPopup"> |
| | | <up-icon name="plus" |
| | | size="24" |
| | | color="#ffffff"></up-icon> |
| | | </view> |
| | | </view> |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, reactive, onMounted } from "vue"; |
| | | import { ref, reactive, onMounted, onUnmounted } from "vue"; |
| | | import { getStockInventoryListPageCombined } from "@/api/inventoryManagement/stockInventory.js"; |
| | | |
| | | const props = defineProps({ |
| | |
| | | const loading = ref(false); |
| | | const loadStatus = ref("loadmore"); |
| | | const page = reactive({ current: 1, size: 10 }); |
| | | const total = ref(0); |
| | | const searchForm = reactive({ |
| | | productName: "", |
| | | topParentProductId: props.productId, |
| | |
| | | size: page.size, |
| | | }) |
| | | .then(res => { |
| | | loading.value = false; |
| | | const records = res.data.records || []; |
| | | const records = res?.data?.records || []; |
| | | tableData.value = |
| | | page.current === 1 ? records : [...tableData.value, ...records]; |
| | | total.value = res.data.total; |
| | | const total = Number(res?.data?.total || 0); |
| | | loadStatus.value = |
| | | tableData.value.length >= total.value ? "nomore" : "loadmore"; |
| | | total > 0 && tableData.value.length >= total ? "nomore" : "loadmore"; |
| | | }) |
| | | .catch(() => { |
| | | loading.value = false; |
| | | loadStatus.value = "loadmore"; |
| | | }) |
| | | .finally(() => { |
| | | loading.value = false; |
| | | }); |
| | | }; |
| | | |
| | |
| | | return batchNo.length > 25 || batchNo.includes(",") || batchNo.includes(","); |
| | | }; |
| | | |
| | | const openDetail = row => { |
| | | if (!row?.productId || !row?.productModelId) return; |
| | | const productName = encodeURIComponent(row.productName || ""); |
| | | const model = encodeURIComponent(row.model || ""); |
| | | const unit = encodeURIComponent(row.unit || ""); |
| | | uni.navigateTo({ |
| | | url: `/pages/inventoryManagement/stockManagement/detail?topParentProductId=${props.productId}&productId=${row.productId}&productModelId=${row.productModelId}&productName=${productName}&model=${model}&unit=${unit}`, |
| | | }); |
| | | }; |
| | | |
| | | const openAddPopup = () => { |
| | | uni.navigateTo({ |
| | | url: `/pages/inventoryManagement/stockManagement/add?topParentProductId=${props.productId}`, |
| | | }); |
| | | }; |
| | | |
| | | const onRefresh = payload => { |
| | | if (!payload) return; |
| | | if (String(payload.topParentProductId) !== String(props.productId)) return; |
| | | handleQuery(); |
| | | }; |
| | | |
| | | onMounted(() => { |
| | | getList(); |
| | | uni.$on("stockManagement:refresh", onRefresh); |
| | | }); |
| | | |
| | | onUnmounted(() => { |
| | | uni.$off("stockManagement:refresh", onRefresh); |
| | | }); |
| | | </script> |
| | | |
| | | <style scoped lang="scss"> |
| | | @import "@/static/scss/form-common.scss"; |
| | | |
| | | .record-container { |
| | | height: 100%; |
| | | display: flex; |
| | |
| | | padding: 30rpx; |
| | | margin-bottom: 20rpx; |
| | | box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.05); |
| | | } |
| | | |
| | | .action-buttons { |
| | | display: flex; |
| | | gap: 12px; |
| | | padding-top: 10px; |
| | | } |
| | | |
| | | .action-btn { |
| | | flex: 1; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | |
| | | .item-header { |
| | |
| | | .no-data { |
| | | padding-top: 200rpx; |
| | | } |
| | | |
| | | .fab-button { |
| | | position: fixed; |
| | | bottom: calc(30px + env(safe-area-inset-bottom)); |
| | | right: 30px; |
| | | width: 56px; |
| | | height: 56px; |
| | | background: #2979ff; |
| | | border-radius: 50%; |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | box-shadow: 0 4px 16px rgba(41, 121, 255, 0.3); |
| | | z-index: 1000; |
| | | } |
| | | |
| | | .detail-popup { |
| | | background-color: #fff; |
| | | max-height: 75vh; |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | |
| | | .detail-summary { |
| | | padding: 0 30rpx 20rpx 30rpx; |
| | | } |
| | | |
| | | .summary-row { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-top: 16rpx; |
| | | } |
| | | |
| | | .summary-label { |
| | | font-size: 24rpx; |
| | | color: #909399; |
| | | } |
| | | |
| | | .summary-value { |
| | | font-size: 24rpx; |
| | | color: #303133; |
| | | text-align: right; |
| | | margin-left: 20rpx; |
| | | flex: 1; |
| | | } |
| | | |
| | | .detail-list-scroll { |
| | | flex: 1; |
| | | min-height: 0; |
| | | } |
| | | |
| | | .detail-list { |
| | | padding: 20rpx 30rpx 40rpx 30rpx; |
| | | } |
| | | |
| | | .detail-card { |
| | | background-color: #f8f9fa; |
| | | border-radius: 16rpx; |
| | | padding: 24rpx; |
| | | margin-bottom: 20rpx; |
| | | } |
| | | |
| | | .detail-card-header { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | margin-bottom: 16rpx; |
| | | } |
| | | |
| | | .detail-card-title { |
| | | font-size: 28rpx; |
| | | color: #303133; |
| | | font-weight: 600; |
| | | } |
| | | |
| | | .detail-card-body { |
| | | .detail-row { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | margin-bottom: 12rpx; |
| | | font-size: 24rpx; |
| | | } |
| | | |
| | | .detail-label { |
| | | color: #909399; |
| | | } |
| | | |
| | | .detail-value { |
| | | color: #303133; |
| | | font-weight: 500; |
| | | text-align: right; |
| | | margin-left: 20rpx; |
| | | flex: 1; |
| | | } |
| | | } |
| | | |
| | | .product-select-popup { |
| | | background-color: #fff; |
| | | max-height: 75vh; |
| | | display: flex; |
| | | flex-direction: column; |
| | | } |
| | | |
| | | .product-search { |
| | | padding: 20rpx 30rpx; |
| | | display: flex; |
| | | gap: 16rpx; |
| | | } |
| | | |
| | | .product-list-scroll { |
| | | flex: 1; |
| | | min-height: 0; |
| | | } |
| | | |
| | | .product-model-list { |
| | | padding: 0 30rpx 40rpx 30rpx; |
| | | } |
| | | |
| | | .product-model-item { |
| | | background-color: #f8f9fa; |
| | | border-radius: 16rpx; |
| | | padding: 24rpx; |
| | | margin-top: 20rpx; |
| | | } |
| | | |
| | | .pm-name { |
| | | display: block; |
| | | font-size: 26rpx; |
| | | color: #303133; |
| | | font-weight: 600; |
| | | } |
| | | |
| | | .pm-model { |
| | | display: block; |
| | | margin-top: 8rpx; |
| | | font-size: 24rpx; |
| | | color: #909399; |
| | | } |
| | | </style> |