Browse Source

feat:二期基础内容

maliang 14 hours ago
parent
commit
7718e3778d

+ 143 - 134
components/good-item/good-item.vue

@@ -1,141 +1,150 @@
 <template>
-	<view>
-		<view class="good-item">
-			<view class="" @click="toDetail">
-			<view class="good-msg">
-				<u-image
-					:src="item.imgNameArr[0] || ''"
-					width="128rpx"
-					height="128rpx"
-				></u-image>
-				<view class="ss-m-l-16">
-					<view class="good-msg-name">{{item.materialName}}</view>
-					<view class="good-msg-txm">条形码:{{item.barCode}}</view>
-				</view>
-			</view>
-			<view class="good-cont">
-				<view class="good-cont-item">
-					<view class="item-label">规格</view>
-					<view class="item-value">{{item.materialStandard || '-'}}</view>
-				</view>
-			<!-- 	<view class="good-cont-item">
-					<view class="item-label">批次号</view>
-					<view class="item-value">{{item.batchNumber || '-'}}</view>
-				</view> -->
-				<view class="good-cont-item" @click.stop="calendarClick">
-					<view class="item-label">生产日期</view>
-					<view class="item-value">{{item.productionDate ? $u.timeFormat(item.productionDate, 'yyyy-mm-dd') : '-'}}</view>
-				</view>
-				<view class="good-cont-item">
-					<view class="item-label">库存</view>
-					<view class="item-value">{{item.inventory ? (item.inventory * 1).toFixed(0) : '0'}}{{item.commodityUnit || ''}}</view>
-				</view>
-				<view class="good-cont-item">
-					<view class="item-label">库位</view>
-					<view class="item-value">{{item.position || '-'}}</view>
-				</view>
-				<view class="good-cont-item">
-					<view class="item-label">订单数量</view>
-					<view class="item-value">{{item.operNumber || '0'}}{{item.materialUnit || ''}}</view>
-				</view>
-			</view>
-			</view>
-			<slot></slot>
-			<view class="action-btn-box" v-if="showPrint">
-				<view class="print-btn" @click="clickPrint">
-					打印条码
-				</view>
-			</view>
-		</view>
-	</view>
+  <view>
+    <view class="good-item">
+      <view class="" @click="toDetail">
+        <view class="good-msg">
+          <u-image
+            :src="item.imgNameArr[0] || ''"
+            width="128rpx"
+            height="128rpx"
+          ></u-image>
+          <view class="ss-m-l-16">
+            <view class="good-msg-name">{{ item.materialName }}</view>
+            <view class="good-msg-txm">条形码:{{ item.barCode }}</view>
+          </view>
+        </view>
+        <view class="good-cont">
+          <view class="good-cont-item">
+            <view class="item-label">规格</view>
+            <view class="item-value">{{ item.materialStandard || "-" }}</view>
+          </view>
+          <view class="good-cont-item" @click.stop="calendarClick">
+            <view class="item-label">生产日期</view>
+            <view class="item-value">{{
+              item.productionDate
+                ? $u.timeFormat(item.productionDate, "yyyy-mm-dd")
+                : "-"
+            }}</view>
+          </view>
+          <view class="good-cont-item">
+            <view class="item-label">库存</view>
+            <view class="item-value"
+              >{{ item.inventory ? (item.inventory * 1).toFixed(0) : "0"
+              }}{{ item.commodityUnit || "" }}</view
+            >
+          </view>
+          <view
+            class="good-cont-item"
+            @click.stop="handleClickField('position')"
+          >
+            <view class="item-label">库位</view>
+            <view class="item-value">{{ item.position || "-" }}</view>
+          </view>
+          <view class="good-cont-item">
+            <view class="item-label">订单数量</view>
+            <view class="item-value"
+              >{{ item.operNumber || "0" }}{{ item.materialUnit || "" }}</view
+            >
+          </view>
+        </view>
+      </view>
+      <slot></slot>
+      <view class="action-btn-box" v-if="showPrint">
+        <view class="print-btn" @click="clickPrint"> 打印条码 </view>
+      </view>
+    </view>
+  </view>
 </template>
 
 <script>
-	export default{
-		props:{
-			item:{
-				type:Object,
-				default:()=>{}
-			},
-			showPrint:{
-				type:Boolean,
-				default: false
-			}
-		},
-		data() {
-			return {
-				calendarShow:false,
-				value1: Number(new Date()),
-				maxDate:Number(new Date()),
-			}
-		},
-		methods:{
-			toDetail() {
-				this.$emit('toDetail',this.item)
-			},
-			calendarClick() {
-				this.$emit('calendarClick',this.item)
-			},
-			clickPrint(){
-				this.$emit('print',this.item)
-			}
-		}
-	}
+export default {
+  props: {
+    item: {
+      type: Object,
+      default: () => {},
+    },
+    showPrint: {
+      type: Boolean,
+      default: false,
+    },
+  },
+  data() {
+    return {
+      calendarShow: false,
+      value1: Number(new Date()),
+      maxDate: Number(new Date()),
+    };
+  },
+  methods: {
+    toDetail() {
+      this.$emit("toDetail", this.item);
+    },
+    calendarClick() {
+      this.$emit("calendarClick", this.item);
+    },
+    handleClickField(field) {
+      this.$emit("handleClickField", field, { ...this.item });
+    },
+    clickPrint() {
+      this.$emit("print", this.item);
+    },
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-	.good-item {
-		padding: 24rpx 0;
-		border-bottom: 4rpx solid #F0F6FB;
-		.good-msg {
-			display: flex;
-			align-items: center;
-			padding: 0 24rpx;
-			
-			&-name {
-				color: #333;
-				font-family: "PingFang SC";
-				font-size: 28rpx;
-				font-weight: 500;
-				margin-bottom: 16rpx;
-			}
-			&-txm {
-				color: #999;
-				font-family: "PingFang SC";
-				font-size: 28rpx;
-				font-weight: 400;
-			}
-		}
-		.good-cont {
-			display: grid;
-			grid-template-columns: 25% 45% 30%;
-			margin-top: 16rpx;
-			padding: 0 24rpx;
-			&-item {
-				font-family: "PingFang SC";
-				font-weight: 400;
-				margin-bottom: 24rpx;
-				.item-label {
-					color: #999;
-					font-size: 24rpx;
-					margin-bottom: 16rpx;
-				}
-				.item-value {
-					color: #000;
-					font-size: 28rpx;
-				}
-			}
-		}
-	}
-	.action-btn-box{
-		text-align: right;
-		padding: 30rpx 48rpx 0 26rpx;
-		
-		.print-btn{
-			font-family: PingFang SC;
-			font-weight: 500;
-			font-size: 28rpx;
-			color: #0256FF;
-		}
-	}
-</style>
+.good-item {
+  padding: 24rpx 0;
+  border-bottom: 4rpx solid #f0f6fb;
+  .good-msg {
+    display: flex;
+    align-items: center;
+    padding: 0 24rpx;
+
+    &-name {
+      color: #333;
+      font-family: "PingFang SC";
+      font-size: 28rpx;
+      font-weight: 500;
+      margin-bottom: 16rpx;
+    }
+    &-txm {
+      color: #999;
+      font-family: "PingFang SC";
+      font-size: 28rpx;
+      font-weight: 400;
+    }
+  }
+  .good-cont {
+    display: grid;
+    grid-template-columns: 25% 45% 30%;
+    margin-top: 16rpx;
+    padding: 0 24rpx;
+    &-item {
+      font-family: "PingFang SC";
+      font-weight: 400;
+      margin-bottom: 24rpx;
+      .item-label {
+        color: #999;
+        font-size: 24rpx;
+        margin-bottom: 16rpx;
+      }
+      .item-value {
+        color: #000;
+        font-size: 28rpx;
+      }
+    }
+  }
+}
+.action-btn-box {
+  text-align: right;
+  padding: 30rpx 48rpx 0 26rpx;
+
+  .print-btn {
+    font-family: PingFang SC;
+    font-weight: 500;
+    font-size: 28rpx;
+    color: #0256ff;
+  }
+}
+</style>

+ 7 - 0
pages/goods-enter/addGood.vue

@@ -0,0 +1,7 @@
+<template></template>
+
+<script>
+export default {};
+</script>
+
+<style lang="scss" scoped></style>

+ 206 - 0
pages/goods-enter/index.vue

@@ -0,0 +1,206 @@
+<template>
+  <view class="goods-page">
+    <u-navbar
+      height="40px"
+      title="货物信息录入"
+      bgColor="#fff"
+      autoBack
+      placeholder
+    >
+      <view class="u-nav-slot depot-label" slot="right" @click="stashClick">
+        <view class="name">{{ curDepotName }}</view>
+      </view>
+    </u-navbar>
+    <view class="container_main">
+      <u-sticky :offsetTop="offsetTop" bgColor="#fff">
+        <view class="search-box">
+          <u-search
+            placeholder="请输入单据编号或名称"
+            shape="square"
+            v-model="query.number"
+            :showAction="false"
+            :clearabled="true"
+            @search="handleSearch"
+            @clear="handleSearch"
+          ></u-search>
+        </view>
+      </u-sticky>
+      <view class="content-box">
+        <view class="content-box-val"> </view>
+        <u-empty
+          mode="data"
+          text="暂无内容"
+          marginTop="60"
+          icon="https://xiangli-erp.oss-cn-hangzhou.aliyuncs.com/APP/no-notifcations.png"
+          v-if="list.length == 0"
+        ></u-empty>
+        <!-- 加载更多 -->
+        <u-loadmore
+          v-if="list.length > 0"
+          :status="loadStatus"
+          @loadmore="onLoadMore"
+        />
+      </view>
+    </view>
+
+    <error-pop
+      v-model="actionPop.errorShow"
+      isCenter
+      cancelBtnText="取消"
+      confirmBtnText="确定"
+      @close="actionPop.errorShow = false"
+      @confirm="submit"
+      :content="actionPop.errorText"
+    ></error-pop>
+  </view>
+</template>
+
+<script>
+import checkItem from "./components/check-item.vue";
+
+import {
+  taskStocktakingList,
+  startTask,
+  taskComplete,
+  taskStocktakingDetail,
+} from "@/common/request/apis/inventoryTask";
+import { mapGetters } from "vuex";
+
+export default {
+  components: {
+    checkItem,
+    errorPop,
+  },
+  data() {
+    return {
+      offsetTop: 0,
+      query: {
+        number: "",
+      },
+      currentPage: 1,
+      pageSize: 10,
+      loadStatus: "loadmore", //加载前值为loadmore,加载中为loading,没有数据为nomore
+      list: [],
+
+      // 中心仓
+      cangName: "",
+    };
+  },
+  computed: {
+    ...mapGetters(["depotInfo"]),
+    curDepotId() {
+      return this.depotInfo ? this.depotInfo.id : "";
+    },
+    curDepotName() {
+      return this.depotInfo ? this.depotInfo.depotName : "";
+    },
+  },
+  onLoad() {
+    let systemInfo = uni.getSystemInfoSync();
+    let statusBarHeight = systemInfo.statusBarHeight;
+    this.offsetTop = statusBarHeight + 40;
+    this.loadData();
+  },
+  onShow() {},
+  onPullDownRefresh() {
+    // 下拉刷新
+    this.onRefresh();
+  },
+  onReachBottom() {
+    // 触底加载更多
+    this.onLoadMore();
+  },
+  methods: {
+    async onRefresh() {
+      try {
+        await this.loadData(true);
+      } finally {
+        uni.stopPullDownRefresh();
+      }
+    },
+    async onLoadMore() {
+      if (this.loadStatus !== "loadmore") return;
+      this.loadStatus = "loading";
+      try {
+        await this.loadData();
+      } catch (e) {
+        this.loadStatus = "loadmore";
+      }
+    },
+    async loadData(isRefresh = false) {
+      if (isRefresh) {
+        this.currentPage = 1;
+        this.list = [];
+      }
+
+      try {
+        this.loadStatus = "loading";
+        const currentPage = this.currentPage;
+        const pageSize = this.pageSize;
+        const params = {
+          currentPage,
+          pageSize,
+          ...this.query,
+          depotId: this.curDepotId,
+        };
+        console.log("params=====", params);
+        const res = await taskStocktakingList(params);
+        const { rows, total } = res.data;
+        this.list = [...this.list, ...rows];
+        if (currentPage * pageSize < Number(total)) {
+          this.currentPage++;
+          this.loadStatus = "loadmore";
+        } else {
+          this.loadStatus = "nomore";
+        }
+      } catch (error) {}
+    },
+    handleSearch(value) {
+      this.loadData(true);
+    },
+  },
+};
+</script>
+
+<style lang="scss" scoped>
+.goods-page {
+  min-height: 100vh;
+  background-color: #f0f6fb;
+  .container_main {
+    .search-box {
+      background-color: rgba(191, 200, 219, 0.2);
+      margin: 0 32rpx;
+      display: flex;
+      align-items: center;
+      justify-content: space-between;
+      border-radius: 8rpx;
+
+      ::v-deep .u-search__content {
+        background-color: transparent !important;
+
+        .u-search__content__input {
+          background-color: transparent !important;
+        }
+      }
+
+      .scan-icon {
+        width: 100rpx;
+        height: 100%;
+
+        image {
+          width: 40rpx;
+          height: 40rpx;
+        }
+      }
+    }
+
+    .content-box {
+      padding: 24rpx;
+      &-val {
+        border-radius: 16rpx 16rpx 0 0;
+        overflow: hidden;
+      }
+    }
+  }
+}
+</style>

+ 15 - 12
pages/index/index.vue

@@ -143,18 +143,18 @@ export default {
           num: 0,
           url: "/pages/inventory-task/index",
         },
-        {
-          src: require("@/static/image/home/icon-fhrw.png"),
-          text: "复核任务",
-          num: 0,
-          url: "/pages/inventory-task/index",
-        },
-        {
-          src: require("@/static/image/home/icon-hwlr.png"),
-          text: "货物录入",
-          num: 0,
-          url: "/pages/inventory-task/index",
-        },
+        // {
+        //   src: require("@/static/image/home/icon-fhrw.png"),
+        //   text: "复核任务",
+        //   num: 0,
+        //   url: "",
+        // },
+        // {
+        //   src: require("@/static/image/home/icon-hwlr.png"),
+        //   text: "货物录入",
+        //   num: 0,
+        //   url: "/pages/goods-enter/index",
+        // },
       ],
       meunShow: false,
       noticeShow: true,
@@ -207,6 +207,9 @@ export default {
       }
     },
     operateClick(item) {
+      if (!item.url) {
+        return;
+      }
       uni.navigateTo({
         url: item.url,
       });

+ 71 - 63
pages/index/notice-page.vue

@@ -1,70 +1,78 @@
 <template>
-	<view class="notice-page">
-		<u-navbar height="40px" title="消息通知" bgColor="#fff" autoBack placeholder>
-		</u-navbar>
-		<view class="container_main">
-			<view class="time-box">
-				2025-04-03 星期四
-			</view>
-			<notice-item v-for="(item,i) in noticeList" :key="i" :item="item"></notice-item>
-		</view>
-	</view>
+  <view class="notice-page">
+    <u-navbar
+      height="40px"
+      title="消息通知"
+      bgColor="#fff"
+      autoBack
+      placeholder
+    >
+    </u-navbar>
+    <view class="container_main">
+      <view class="time-box"> 2025-04-03 星期四 </view>
+      <notice-item
+        v-for="(item, i) in noticeList"
+        :key="i"
+        :item="item"
+      ></notice-item>
+    </view>
+  </view>
 </template>
 
 <script>
-	import noticeItem from './components/notice-item.vue'
-	export default{
-		components:{
-			noticeItem
-		},
-		data() {
-			return {
-				noticeList:[
-					{
-						type:1,
-						sn:'123654',
-						time:'',
-						isRead:false
-					},
-					{
-						type:2,
-						sn:'aa123654',
-						time:'',
-						isRead:true
-					}
-				]
-			}
-		}
-	}
+import noticeItem from "./components/notice-item.vue";
+export default {
+  components: {
+    noticeItem,
+  },
+  data() {
+    return {
+      noticeList: [
+        {
+          type: 1,
+          sn: "123654",
+          time: "",
+          isRead: false,
+        },
+        {
+          type: 2,
+          sn: "aa123654",
+          time: "",
+          isRead: true,
+        },
+      ],
+    };
+  },
+};
 </script>
 
 <style lang="scss" scoped>
-	.notice-page {
-		min-height: 100vh;
-		background-color: #F0F6FB;
-		.container_main {
-			padding: 32rpx 24rpx;
-			.time-box {
-				position: relative;
-				color: #000;
-				font-family: "PingFang SC";
-				font-size: 28rpx;
-				font-weight: 400;
-				padding-left: 20rpx;
-				margin-bottom: 24rpx;
-				&::before {
-					content: '';
-					display: block;
-					width: 6rpx;
-					height: 30rpx;
-					border-radius: 100rpx;
-					background: #0256FF;
-					position: absolute;
-					left: 0;
-					top: 50%;
-					transform: translateY(-50%);
-				}
-			}
-		}
-	}
-</style>
+.notice-page {
+  min-height: 100vh;
+  background-color: #f0f6fb;
+  .container_main {
+    padding: 32rpx 24rpx;
+    .time-box {
+      position: relative;
+      color: #000;
+      font-family: "PingFang SC";
+      font-size: 28rpx;
+      font-weight: 400;
+      padding-left: 20rpx;
+      margin-bottom: 24rpx;
+      &::before {
+        content: "";
+        display: block;
+        width: 6rpx;
+        height: 30rpx;
+        border-radius: 100rpx;
+        background: #0256ff;
+        position: absolute;
+        left: 0;
+        top: 50%;
+        transform: translateY(-50%);
+      }
+    }
+  }
+}
+</style>

+ 42 - 15
pages/purchase/put-storage.vue

@@ -17,7 +17,7 @@
             <text>收入仓库</text>
           </view>
           <view class="info-line-value">
-            {{ depotInfo ? cangName.depotName : "" }}
+            {{ curDepotName }}
           </view>
         </view>
         <view class="info-line">
@@ -89,10 +89,6 @@
             <text>连续扫描</text>
           </view>
         </view>
-        <!-- <view class="scan-box-r" @click="manualClick">
-					<u-image width="120rpx" height="120rpx" src="@/static/image/shoudong-saoma-img.png"></u-image>
-					<view class="tips-text">手动选择</view>
-				</view> -->
       </view>
       <!-- 货物清单 -->
       <view class="cargo-list">
@@ -105,6 +101,7 @@
             :item="item"
             @toDetail="toDetail"
             @calendarClick="calendarClick"
+            @handleClickField="handleClickField"
             :show-print="true"
             @print="(e) => handlePrint(e.id, '1', status)"
           >
@@ -115,13 +112,6 @@
                 min="0"
                 :inputWidth="56"
               >
-                <!-- <view slot="minus" class="minus">
-									<u-icon name="minus" color="#0256FF" size="12"></u-icon>
-								</view>
-								<text slot="input" class="input">{{item.materialNumber}}</text>
-								<view slot="plus" class="plus">
-									<u-icon name="plus" color="#FFFFFF" size="12"></u-icon>
-								</view> -->
               </u-number-box>
             </view>
           </good-item>
@@ -172,7 +162,12 @@
       @confirm="calendarConfirm"
       @cancel="calendarShow = false"
     ></u-datetime-picker>
-
+    <!-- 修改库位 -->
+    <categoryPopup
+      :show.sync="actionPop.showCategoryPop"
+      :original-location="actionPop.originalLocation"
+      @confirm="haandleComfirmLocation"
+    />
     <!-- 打印条码弹框 -->
     <print-pop
       :show.sync="blePrintPop.show"
@@ -205,6 +200,7 @@ import errorPop from "@/components/error-pop/error-pop.vue";
 import successPop from "@/components/success-pop/success-pop.vue";
 import scanedPop from "@/components/scaned-pop/scaned-pop.vue";
 import goodsPop from "@/components/goods-pop/goods-pop.vue";
+import categoryPopup from "@/pages/inventory-task/components/categoryPopup.vue";
 import {
   orderDetail,
   orderInfo,
@@ -220,6 +216,7 @@ export default {
     successPop,
     scanedPop,
     goodsPop,
+    categoryPopup,
   },
   data() {
     return {
@@ -248,6 +245,11 @@ export default {
       scanIndex: -1,
       scanNum: 1,
       status: null,
+      actionPop: {
+        // 修改库位弹框状态
+        showCategoryPop: false,
+        originalLocation: "",
+      },
     };
   },
   onLoad(e) {
@@ -274,6 +276,12 @@ export default {
   },
   computed: {
     ...mapGetters(["depotInfo"]),
+    curDepotId() {
+      return this.depotInfo ? this.depotInfo.id : "";
+    },
+    curDepotName() {
+      return this.depotInfo ? this.depotInfo.depotName : "";
+    },
     speciesNum() {
       let num = 0;
       if (this.goodsList.length == 0 || !this.goodsList) {
@@ -374,6 +382,7 @@ export default {
           productionDate: item.productionDate
             ? this.$u.timeFormat(item.productionDate, "yyyy-mm-dd")
             : "",
+          position: item.position,
         };
       });
       let params = {
@@ -382,12 +391,16 @@ export default {
         voucherPicture: this.voucherPicture || "",
         remark: this.orderInfo.mark || "",
       };
+      console.log("params", params);
       orderSubmit(params).then((res) => {
+        console.log("res", res);
         if (res.code == 200) {
           if (this.errorShow) {
             this.errorShow = false;
           }
           this.successShow = true;
+        } else {
+          this.$u.toast(res.msg, 2000);
         }
       });
     },
@@ -404,8 +417,22 @@ export default {
       this.goodsList[this.scanIndex].materialNumber = Number(val);
       this.scanedShow = false;
     },
-    manualClick() {
-      // this.goodsShow = true
+    handleClickField(field, item) {
+      console.log("field", field);
+      console.log("item", item);
+      this.chooseGoodsInfo = item;
+      if (field == "position") {
+        this.actionPop.showCategoryPop = true;
+        this.actionPop.originalLocation = item.position;
+      }
+    },
+    haandleComfirmLocation(val) {
+      this.goodsList.forEach((item) => {
+        if (item.id == this.chooseGoodsInfo.id) {
+          item.position = val;
+        }
+      });
+      this.actionPop.showCategoryPop = false;
     },
     toDetail(val) {
       uni.navigateTo({