Parcourir la source

修复退料单列表的bug

695593266@qq.com il y a 2 mois
Parent
commit
55c0140f02

+ 1 - 5
api/pda/material.js

@@ -5,11 +5,7 @@ import Vue from "vue";
  * 退料列表
  */
 export async function returnPage(params) {
-  let par = new URLSearchParams(params);
-  const data = await get(
-    Vue.prototype.apiUrl + `/mes/returnmaterials/page?` + par,
-    {}
-  );
+  const data = await get(Vue.prototype.apiUrl + `/mes/returnmaterials/page`, params);
   if (data.code == 0) {
     return data.data;
   }

+ 1 - 1
manifest.json

@@ -2,7 +2,7 @@
     "name" : "智慧工厂",
     "appid" : "__UNI__45B3907",
     "description" : "",
-    "versionName" : "V1.0.3.62",
+    "versionName" : "V1.0.3.65",
     "versionCode" : "100",
     "transformPx" : false,
     "h5" : {

+ 22 - 4
pages/pda/material_return/components/addMaterialReturn.vue

@@ -157,8 +157,10 @@
 
     <!-- 底部操作按钮 -->
     <view class="footer-btn">
-      <button @click="close" size="mini">取消</button>
-      <button type="primary" @click="save" size="mini">提交</button>
+      <button class="footer-btn__item footer-btn__item--cancel" @click="close">
+        取消
+      </button>
+      <button class="footer-btn__item" type="primary" @click="save">提交</button>
     </view>
   </view>
 </template>
@@ -437,13 +439,29 @@ export default {
   left: 0;
   width: 100%;
   background: #fff;
-  padding: 16rpx;
+  box-sizing: border-box;
+  padding: 20rpx 24rpx calc(20rpx + env(safe-area-inset-bottom));
   display: flex;
-  justify-content: space-between;
+  align-items: center;
+  gap: 24rpx;
   box-shadow: 0 -2rpx 6rpx rgba(0, 0, 0, 0.05);
   z-index: 20;
 }
 
+.footer-btn__item {
+  flex: 1;
+  margin: 0;
+  height: 80rpx;
+  line-height: 80rpx;
+  border-radius: 12rpx;
+  font-size: 30rpx;
+}
+
+.footer-btn__item--cancel {
+  color: #666;
+  background: #f2f3f5;
+}
+
 /deep/ .uni-easyinput__content-input {
   padding-left: 0;
 }

+ 22 - 9
pages/pda/material_return/index/index.vue

@@ -28,11 +28,7 @@
     </view>
 
     <view class="list_box">
-      <u-list
-        @scrolltolower="scrolltolower"
-        key="list"
-        :preLoadScreen="page * 10"
-      >
+      <u-list @scrolltolower="scrolltolower" key="list">
         <u-list-item v-for="(item, index) in dataList" :key="index">
           <view class="card_box" @click="handleDetail">
             <view class="item_box rx-bc">
@@ -123,6 +119,7 @@ export default {
 
   onShow() {
     this.getByCodeFn();
+    this.page = 1;
     this.getList();
   },
 
@@ -134,12 +131,22 @@ export default {
     async getList() {
       let params = {
         pageNum: this.page,
+        pageNo: this.page,
         size: this.size,
+        pageSize: this.size,
         ...this.searchFrom,
       };
 
       isEnd = false;
-      const res = await returnPage(params);
+      const res = await returnPage(params).catch((err) => {
+        console.error("returnPage error:", err);
+        uni.showToast({
+          title: (err && err.message) || "退料单加载失败",
+          icon: "none",
+        });
+        return null;
+      });
+      if (!res) return;
 
       if (params.pageNum === 1) {
         this.dataList = [];
@@ -181,6 +188,7 @@ export default {
     },
 
     doSearch() {
+      this.page = 1;
       this.getList();
     },
 
@@ -238,14 +246,19 @@ export default {
   }
 }
 
-/* ✅ 列表区 */
+/* ✅ 列表区:App 端 scroll-view 需要确定的 flex 高度,避免 height:100% 解析为 0 */
 .list_box {
   flex: 1;
+  min-height: 0;
   overflow: hidden;
   padding: 16rpx 0;
+  display: flex;
+  flex-direction: column;
 
-  .u-list {
-    height: 100% !important;
+  /deep/ .u-list {
+    flex: 1;
+    height: 0 !important;
+    min-height: 0;
     padding: 20rpx;
   }