123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521 |
- <template>
- <view class="inventory-detail">
- <!-- 导航栏 -->
- <u-navbar
- :title="pageTitle"
- :autoBack="true"
- fixed
- safe-area-inset-top
- placeholder
- >
- <template #right>
- <view class="nav-right">
- <u-icon name="search" size="20" color="#333"></u-icon>
- </view>
- </template>
- </u-navbar>
- <!-- 基本信息 吸顶 -->
- <view class="info-card">
- <view class="info-item">
- <text class="info-label">盘点单号:</text>
- <text class="info-value">{{ inventoryInfo.code }}</text>
- </view>
- <view class="info-item">
- <text class="info-label">盘点人:</text>
- <text class="info-value">{{ inventoryInfo.operator }}</text>
- </view>
- <view class="progress-box">
- <text class="progress-label">盘点进度</text>
- <view class="progress-bar-wrap">
- <u-line-progress
- :percentage="getProgressPercentage"
- height="4"
- :show-text="false"
- activeColor="#4080FF"
- >
- </u-line-progress>
- </view>
- <text class="progress-value"
- >{{ inventoryInfo.progress }}/{{ inventoryInfo.total }}</text
- >
- </view>
- </view>
- <!-- 筛选按钮 -->
- <u-sticky bgColor="#F5F6F7" :offsetTop="44">
- <view class="filter-wrap">
- <view class="filter-btn" @click="filterPopupVisible = true">
- <text>筛选</text>
- <u-icon name="arrow-down" size="12" color="#666"></u-icon>
- </view>
- </view>
- </u-sticky>
- <!-- 商品列表 -->
- <view class="goods-list">
- <view class="goods-item" v-for="(item, index) in goodsList" :key="index">
- <view class="location-row">
- <view class="location-left">
- <text class="location-label">库位:</text>
- <text class="location-value">{{ item.location }}</text>
- <u-icon name="arrow-right" size="14" color="#4080FF"></u-icon>
- </view>
- <text class="category-text">{{ item.category }}</text>
- </view>
- <view class="goods-content">
- <image
- class="goods-image"
- :src="item.image"
- mode="aspectFill"
- ></image>
- <view class="goods-info">
- <text class="goods-name u-line-2">{{ item.name }}</text>
- <view class="goods-spec">
- <text class="spec-label">规格:</text>
- <text class="spec-value">{{ item.spec }}</text>
- </view>
- <view class="check-user">
- <text class="check-label">盘点人:</text>
- <text class="check-value">{{ item.checkUser }}</text>
- </view>
- <view class="check-time">
- <text class="time-label">盘点时间:</text>
- <text class="time-value">{{ item.checkTime }}</text>
- </view>
- </view>
- </view>
- <view class="stock-row">
- <view class="stock-item">
- <text class="stock-label">系统库存</text>
- <text class="stock-value">{{ item.systemStock }}瓶</text>
- </view>
- <view class="stock-item">
- <text class="stock-label">已盘库存</text>
- <text
- class="stock-value"
- :class="{
- 'stock-value-zero': item.actualStock === '未盘',
- 'stock-value-warning': item.actualStock === '0瓶',
- }"
- >{{ item.actualStock }}</text
- >
- </view>
- </view>
- <view class="action-row">
- <u-button
- type="primary"
- size="mini"
- @click="handleCheck(item)"
- class="action-btn"
- >盘点</u-button
- >
- <u-button
- type="primary"
- size="mini"
- @click="handleRecheck(item)"
- class="action-btn"
- >重新盘点
- </u-button>
- <u-button
- type="warning"
- size="mini"
- plain
- @click="handleCheck2(item)"
- class="action-btn action-btn-secondary"
- >盘点2</u-button
- >
- </view>
- </view>
- <!-- 加载更多 -->
- <u-loadmore :status="loadMoreStatus" @loadmore="onLoadMore" />
- </view>
- <InventoryFilterPopup
- :show.sync="filterPopupVisible"
- :defaultValues="defaultFilterValues"
- @confirm="handleFilterConfirm"
- />
- <actionNumPopup :show.sync="actionPop.showNumPop" />
- <categoryPopup :show.sync="actionPop.showCategoryPop" />
- <error-pop v-model="actionPop.errorShow" isCenter cancelBtnText="取消" confirmBtnText="确定" @close="actionPop.errorShow = false" @confirm="confirm" :content="actionPop.errorText"></error-pop>
- </view>
- </template>
- <script>
- import InventoryFilterPopup from "./components/inventoryFilterPopup.vue";
- import actionNumPopup from "./components/actionNumPopup.vue";
- import categoryPopup from "./components/categoryPopup.vue";
- import errorPop from '@/components/error-pop/error-pop.vue'
- export default {
- components: {
- InventoryFilterPopup,
- actionNumPopup,
- errorPop,
- categoryPopup
- },
- data() {
- return {
- pageTitle: "2025年中心仓第三季度食品盘点",
- isRefreshing: false,
- loadMoreStatus: "loadmore",
- pageNum: 1,
- pageSize: 10,
- inventoryInfo: {
- code: "2024202244",
- operator: "刘双秀",
- progress: 105,
- total: 604,
- },
- goodsList: [
- {
- location: "C6-2-2",
- category: "母婴用品-家居旅行",
- image: "/static/demo/goods1.png",
- name: "4层汗巾儿童全棉幼儿类吸汗巾婴儿纱布毛巾1条装",
- spec: "4层-随机",
- checkUser: "刘双秀",
- checkTime: "2025-04-03",
- systemStock: "5瓶",
- actualStock: "未盘",
- isChecked: false,
- },
- {
- location: "C6-2-2",
- category: "母婴用品-家居旅行",
- image: "/static/demo/goods1.png",
- name: "4层汗巾儿童全棉幼儿类吸汗巾婴儿纱布毛巾1条装",
- spec: "4层-随机",
- checkUser: "刘双秀",
- checkTime: "2025-04-03",
- systemStock: "5瓶",
- actualStock: "0瓶",
- isChecked: true,
- },
- ],
- filterPopupVisible: false,
- defaultFilterValues: {
- goods: "",
- user: "",
- category: "",
- location: "",
- },
- actionPop:{
- // 盘点数量弹框状态
- showNumPop: false,
- // 警告提示弹框状态
- errorShow: false,
- errorText: '是否提交盘点?',
- // 修改库位弹框状态
- showCategoryPop: false
- }
- };
- },
- computed: {
- getProgressPercentage() {
- return (this.inventoryInfo.progress / this.inventoryInfo.total) * 100;
- },
- },
- onLoad() {
- // 初始化数据
- this.loadData();
- },
- onPullDownRefresh() {
- // 下拉刷新
- this.onRefresh();
- },
- onReachBottom() {
- // 触底加载更多
- this.onLoadMore();
- },
- methods: {
- async onRefresh() {
- try {
- await this.loadData(true);
- } finally {
- uni.stopPullDownRefresh();
- }
- },
- async onLoadMore() {
- if (this.loadMoreStatus !== "loadmore") return;
- this.loadMoreStatus = "loading";
- try {
- await this.loadData();
- } catch (e) {
- this.loadMoreStatus = "loadmore";
- }
- },
- async loadData(isRefresh = false) {
- if (isRefresh) {
- this.pageNum = 1;
- this.goodsList = [];
- }
- // 模拟数据加载
- await new Promise((resolve) => setTimeout(resolve, 1000));
- // 模拟新数据
- const mockData = [
- {
- location: "C6-2-2",
- category: "母婴用品-家居旅行",
- image: "/static/demo/goods1.png",
- name: "4层汗巾儿童全棉幼儿类吸汗巾婴儿纱布毛巾1条装",
- spec: "4层-随机",
- checkUser: "刘双秀",
- checkTime: "2025-04-03",
- systemStock: "5瓶",
- actualStock: isRefresh ? "未盘" : "0瓶",
- isChecked: !isRefresh,
- },
- ];
- this.goodsList = [...this.goodsList, ...mockData];
- this.pageNum++;
- // 模拟没有更多数据
- if (this.pageNum > 3) {
- this.loadMoreStatus = "nomore";
- } else {
- this.loadMoreStatus = "loadmore";
- }
- },
- handleCheck(item) {
- uni.showToast({
- title: "开始盘点",
- icon: "none",
- });
- },
- handleRecheck(item) {
- uni.showToast({
- title: "开始重新盘点",
- icon: "none",
- });
- },
- handleCheck2(item) {
- uni.showToast({
- title: "开始盘点2",
- icon: "none",
- });
- },
- handleFilterConfirm(values) {
- this.defaultFilterValues = values;
- this.filterPopupVisible = false;
- },
- },
- };
- </script>
- <style lang="scss">
- .inventory-detail {
- min-height: 100vh;
- background-color: #f0f6fb;
- padding-bottom: 40rpx;
- .nav-right {
- padding: 0 24rpx;
- }
- .info-card {
- background-color: #fff;
- border-radius: 16rpx;
- padding: 32rpx;
- .info-item {
- display: flex;
- font-size: 28rpx;
- margin-bottom: 24rpx;
- .info-label {
- color: #666;
- margin-right: 8rpx;
- }
- .info-value {
- color: #333;
- }
- }
- .progress-box {
- .progress-label {
- font-size: 28rpx;
- color: #666;
- display: block;
- margin-bottom: 16rpx;
- }
- .progress-bar-wrap {
- margin-bottom: 16rpx;
- }
- .progress-value {
- font-size: 24rpx;
- color: #4080ff;
- display: block;
- text-align: right;
- }
- }
- }
- .filter-wrap {
- display: flex;
- justify-content: flex-end;
- padding: 20rpx;
- .filter-btn {
- display: flex;
- align-items: center;
- padding: 12rpx 24rpx;
- border-radius: 8rpx;
- font-size: 24rpx;
- color: #666;
- .u-icon {
- margin-left: 8rpx;
- }
- }
- }
- .goods-list {
- padding: 0 24rpx;
- .goods-item {
- background-color: #fff;
- border-radius: 16rpx;
- margin-bottom: 24rpx;
- overflow: hidden;
- .location-row {
- display: flex;
- justify-content: space-between;
- align-items: center;
- padding: 24rpx 32rpx;
- border-bottom: 1rpx solid #f5f6f7;
- .location-left {
- display: flex;
- align-items: center;
- .location-label {
- font-size: 28rpx;
- color: #333;
- }
- .location-value {
- font-size: 28rpx;
- color: #4080ff;
- margin: 0 8rpx;
- }
- }
- .category-text {
- font-size: 24rpx;
- color: #999;
- }
- }
- .goods-content {
- padding: 24rpx 32rpx;
- display: flex;
- .goods-image {
- width: 160rpx;
- height: 160rpx;
- border-radius: 8rpx;
- background-color: #f5f6f7;
- }
- .goods-info {
- flex: 1;
- margin-left: 24rpx;
- .goods-name {
- font-size: 28rpx;
- line-height: 1.4;
- color: #333;
- margin-bottom: 16rpx;
- }
- .goods-spec {
- font-size: 24rpx;
- color: #666;
- margin-bottom: 16rpx;
- .spec-label {
- color: #999;
- }
- .spec-value {
- color: #666;
- }
- }
- .check-user,
- .check-time {
- font-size: 24rpx;
- margin-bottom: 8rpx;
- .check-label,
- .time-label {
- color: #999;
- }
- .check-value,
- .time-value {
- color: #666;
- }
- }
- }
- }
- .stock-row {
- display: flex;
- padding: 0 32rpx 24rpx;
- gap: 48rpx;
- .stock-item {
- .stock-label {
- font-size: 24rpx;
- color: #999;
- margin-right: 16rpx;
- }
- .stock-value {
- font-size: 24rpx;
- color: #333;
- &-zero {
- color: #999;
- }
- &-warning {
- color: #ff9900;
- }
- }
- }
- }
- .action-row {
- padding: 0 32rpx 32rpx;
- display: flex;
- justify-content: flex-end;
- gap: 24rpx;
- .action-btn {
- width: 140rpx;
- height: 56rpx;
- padding: 0;
- &-secondary {
- background-color: transparent;
- border-color: #ff9900;
- color: #ff9900;
- }
- }
- }
- }
- }
- }
- </style>
|