Browse Source

修改扫码入库明细

chensibo 7 months ago
parent
commit
ad0cca6db1

+ 2 - 0
main.js

@@ -36,8 +36,10 @@ import {
 // uni.$baseUrl = "";
 // uni.$baseUrl = "http://113.105.183.190:48028";
 uni.$baseUrl = "http://192.168.1.32:48080";
+// uni.$baseUrl = "http://113.105.183.190:15980";
 // uni.$baseUrl = "http://192.168.1.26:48080";
 // uni.$baseUrl = "http://113.105.183.190:15980";
+// uni.$baseUrl = "http://113.105.183.190:48159";
 // uni.$baseUrl = "http://61.155.26.34:36936";
 // uni.$baseUrl = "http://2227el9013.iok.la";
 // uni.$baseUrl = "http://218.2.10.30:48080";

+ 20 - 0
pages.json

@@ -753,6 +753,26 @@
 				}
 			}
 		},
+		{
+			"path": "pages/workbranch/warehouse/scanInOut/In/businessType3/returnMaterial",
+			"style": {
+				"navigationBarTitleText": "扫码物料(生产退料的时候)",
+				"navigationStyle": "custom",
+				"app-plus": {
+					"background": "#FFFFFF"
+				}
+			}
+		},
+		{
+			"path": "pages/workbranch/warehouse/scanInOut/In/businessType3/businessType3Detail",
+			"style": {
+				"navigationBarTitleText": "扫码明细(生产退料的时候)",
+				"navigationStyle": "custom",
+				"app-plus": {
+					"background": "#FFFFFF"
+				}
+			}
+		},
 		{
 			"path": "pages/workbranch/warehouse/scanInOut/In/materialsDetail",
 			"style": {

+ 131 - 121
pages/login/loginPage.vue

@@ -9,8 +9,6 @@
         <view class="gui-flex gui-row gui-justify-content-center login-title">
           <image src="../../static/logo.png" style="width: 90rpx;height: 90rpx;" mode="aspectFit" />
           <text class="login-title-text">东智-MOMPlus</text>
-          <!-- <text
-								class="login-logo gui-icons gui-color-white gui-block gui-border-box gui-bg-primary gui-box-shadow gui-box">&#xe620;</text> -->
         </view>
         <view style="margin-top:80rpx;">
           <form @submit="submit">
@@ -54,60 +52,55 @@
             </view>
           </form>
         </view>
-
-        <!-- <view class="gui-flex gui-rows gui-nowrap gui-align-items-center"
-							style="margin-top:80rpx; display: flex;justify-content: center;">
-							<view class="gui-title-line"></view>
-							<text class="gui-primary-color gui-h6"
-								style="padding-left:50rpx; padding-right:50rpx;">其他方式登录</text>
-							<view class="gui-title-line"></view>
-						</view>
-						<view class="gui-flex gui-rows gui-nowrap gui-justify-content-center gui-margin-top">
-							<view hover-class="gui-tap">
-								<text class="other-login-icons gui-icons gui-color-gray">&#xe63e;</text>
-							</view>
-							<view hover-class="gui-tap">
-								<text class="other-login-icons gui-icons gui-color-gray">&#xe6cd;</text>
-							</view>
-						</view> -->
       </view>
     </template>
   </gui-page>
 </template>
+
 <script>
 import graceChecker from '@/Grace6/js/checker.js'
-import {
-  getFileStorage
-} from '@/unit/fileStorage.js'
+import { getFileStorage } from '@/unit/fileStorage.js'
+
 export default {
   data() {
     return {
       isLoading: false,
       loginForm: {
-        // username: 'admin',
-        // password: 'admin123',
-		username: '',
-		password: '',
-        // username: "",
-        // password: "",
+        username: '',
+        password: '',
         validCode: 'akiooa'
       }
     }
   },
   beforeCreate() {
     // #ifdef APP-PLUS
+    // 3秒超时保护,防止文件读取卡死
+    const timeout = setTimeout(() => {
+      console.warn('读取服务配置超时,使用默认配置')
+      uni.$baseUrl = ''
+    }, 3000)
+
     getFileStorage('serverConfig.txt')
       .then(data => {
+        clearTimeout(timeout)
         if (data === null) {
           uni.$baseUrl = ''
         } else {
-          const ipconfig = JSON.parse(data)
-          uni.$baseUrl = ipconfig.deal + '://' + ipconfig.ip + ':' + ipconfig.port
+          try {
+            const ipconfig = JSON.parse(data)
+            uni.$baseUrl = ipconfig.deal + '://' + ipconfig.ip + ':' + ipconfig.port
+          } catch (e) {
+            console.error('解析服务配置失败:', e)
+            uni.$baseUrl = ''
+          }
         }
       })
       .catch((e) => {
+        clearTimeout(timeout)
+        uni.$baseUrl = ''
+        console.error('获取服务配置失败:', e)
         uni.showToast({
-          title: '获取服务配置失败, 请检查本地文件是否丢失',
+          title: '获取服务配置失败, 请检查本地文件',
           duration: 2000,
           icon: 'none'
         })
@@ -122,115 +115,132 @@ export default {
         url: '/pages/personCenter/accountConfig'
       })
     },
+    
     submit: async function(e) {
       // 表单数据
       var formData = e.detail.value
-      // 利用 graceUI 的表单验证工具进行验证
+      
       // 定义表单规则
-      var rule = [{
-        name: 'username',
-        checkType: 'string',
-        checkRule: '4,50',
-        errorMsg: '登录账户输入有误, 至少4个字符'
-      },
-      {
-        name: 'password',
-        checkType: 'string',
-        checkRule: '4,16',
-        errorMsg: '登录密码至少4个字符'
-      }
+      var rule = [
+        {
+          name: 'username',
+          checkType: 'string',
+          checkRule: '4,50',
+          errorMsg: '登录账户输入有误, 至少4个字符'
+        },
+        {
+          name: 'password',
+          checkType: 'string',
+          checkRule: '4,16',
+          errorMsg: '登录密码至少4个字符'
+        }
       ]
+      
       var checkRes = graceChecker.check(formData, rule)
-      if (checkRes) {
-        uni.$grace.showLoading('登录中...')
-        await uni.$reqPost('login', {
+      if (!checkRes) {
+        uni.showToast({
+          title: graceChecker.error,
+          icon: 'none'
+        })
+        return
+      }
+
+      // 使用原生 Loading,更可靠
+      uni.showLoading({
+        title: '登录中...',
+        mask: true  // 防止触摸穿透
+      })
+
+      try {
+        // 1. 调用登录接口
+        const loginRes = await uni.$reqPost('login', {
           ...formData,
           tenantName: '瑞泰克',
-		  tenantId: 1,
+          tenantId: 1,
           rememberMe: true
         })
-          .then(({
-            code,
-            data,
-            msg
-          }) => {
-            if (code === 0) {
-              uni.setStorageSync('token', data?.accessToken)
-              // uni.setStorageSync("ACCESS_TOKEN", data?.accessToken);
-              // uni.setStorageSync("REFRESH_TOKEN", data?.refreshToken);
-              uni.$reqGet('loginInfo')
-                .then(({
-                  data
-                }) => {
-                  uni.setStorageSync('permissions', JSON.stringify(data?.permissions))
-                  uni.setStorageSync('user', JSON.stringify(data?.user))
-                })
-              uni.$emit('loginSuccess', true)
-              uni.switchTab({
-                url: '/pages/tabbar/tabbarPanel',
-                success: function(e) { // 跳转成功后刷新页面
-                  // var page = getCurrentPages().pop()
-                  // if (page === undefined || page === null) return
-                  // page.onLoad();
-                }
-              })
-            } else {
-              uni.showToast({
-                title: msg ?? '服务器配置错误!',
-                duration: 2000,
-                icon: 'none'
-              })
-            }
+
+        if (loginRes.code !== 0) {
+          uni.showToast({
+            title: loginRes.msg || '登录失败',
+            duration: 2000,
+            icon: 'none'
           })
-      } else {
+          return
+        }
+
+        // 保存 token
+        uni.setStorageSync('token', loginRes.data?.accessToken)
+
+        // 2. 获取用户信息(await 等待完成)
+        const infoRes = await uni.$reqGet('loginInfo')
+        
+        if (infoRes.data) {
+          uni.setStorageSync('permissions', JSON.stringify(infoRes.data.permissions || []))
+          uni.setStorageSync('user', JSON.stringify(infoRes.data.user || {}))
+        }
+
+        // 3. 登录成功,跳转首页
+        uni.$emit('loginSuccess', true)
+        uni.switchTab({
+          url: '/pages/tabbar/tabbarPanel'
+        })
+
+      } catch (err) {
+        console.error('登录异常:', err)
         uni.showToast({
-          title: graceChecker.error,
+          title: err?.message || '网络异常,请检查网络连接',
+          duration: 3000,
           icon: 'none'
         })
+      } finally {
+        // 确保 Loading 一定关闭,避免卡住
+        uni.hideLoading()
       }
     }
   }
 }
 </script>
+
 <style lang="scss" scoped>
-	.login-logo {
-		width: 180rpx;
-		height: 180rpx;
-		font-size: 80rpx;
-		text-align: center;
-		line-height: 120rpx;
-		padding: 30rpx;
-		border-radius: 18rpx;
-	}
-
-	.login-title {
-		height: 140rpx;
-		display: flex;
-		align-items: center;
-
-		.login-title-text {
-			font-size: 54rpx;
-			font-weight: bold;
-			color: rgba(0, 160, 233, 1);
-		}
-	}
-
-	.other-login-icons {
-		width: 88rpx;
-		height: 88rpx;
-		text-align: center;
-		font-size: 70rpx;
-		margin: 20rpx;
-	}
-
-	.server-config {
-		position: fixed;
-		top: 20px;
-		right: 20px;
-
-		text {
-			font-size: 32px;
-			color: #808080;
-		}
-	}
+  .login-logo {
+    width: 180rpx;
+    height: 180rpx;
+    font-size: 80rpx;
+    text-align: center;
+    line-height: 120rpx;
+    padding: 30rpx;
+    border-radius: 18rpx;
+  }
+
+  .login-title {
+    height: 140rpx;
+    display: flex;
+    align-items: center;
+
+    .login-title-text {
+      font-size: 54rpx;
+      font-weight: bold;
+      color: rgba(0, 160, 233, 1);
+    }
+  }
+
+  .other-login-icons {
+    width: 88rpx;
+    height: 88rpx;
+    text-align: center;
+    font-size: 70rpx;
+    margin: 20rpx;
+  }
+
+  .server-config {
+    position: fixed;
+    top: 20px;
+    right: 20px;
+
+    text {
+      font-size: 32px;
+      color: #808080;
+    }
+  }
 </style>

+ 305 - 0
pages/workbranch/warehouse/scanInOut/In/businessType3/businessType3Detail.vue

@@ -0,0 +1,305 @@
+<template>
+  <gui-page :custom-header="true" :header-class="['gui-theme-background-color']">
+    <template #gHeader>
+      <view style="height:44px;" class="gui-flex gui-nowrap gui-rows gui-align-items-center">
+        <text
+          style="font-size:44rpx;"
+          class="gui-header-leader-btns gui-color-white font-icons"
+          @tap="goBack"
+        >&#xe6c5;</text>
+        <text
+          class="gui-h4 gui-blod gui-flex1 gui-text-center gui-ellipsis gui-color-white gui-primary-text"
+        >扫描清单资源档(生产退料)</text>
+        <view style="width:40px;" />
+      </view>
+    </template>
+
+    <template #gBody>
+      <view class="list-content">
+        <view class="table-title">
+          <span>已扫物料资源清单</span>
+        </view>
+
+        <!-- 数据列表 -->
+        <view v-if="cardList?.length" class="scroll-box">
+          <view
+            v-for="(item, idx) in cardList"
+            :key="item.id"
+            class="swipe-card"
+            :data-index="idx"
+            @touchstart="touchStart"
+            @touchmove="touchMove"
+            @touchend="touchEnd"
+          >
+            <!-- 原来整套卡片结构原封不动 -->
+            <view class="card-content" :style="{ transform: `translateX(${item.slideX || 0}px)` }">
+              <view class="card-list-flexbox">
+                <view class="card-list-item">
+                  <text class="text-1 gui-color-gray">物料号</text>
+                  <text class="text-2 gui-color-gray">{{ item.materialNo }}</text>
+                </view>
+                <view class="card-list-item">
+                  <text class="text-1 gui-color-gray">物料名称</text>
+                  <text class="text-2 gui-color-gray">{{ item.materialName }}</text>
+                </view>
+                <view class="card-list-item">
+                  <text class="text-1 gui-color-gray">数量</text>
+                  <text class="text-2" style="color: orange;font-weight: bold;">{{ item.batchQty }}</text>
+                </view>
+                <view class="card-list-item">
+                  <text class="text-1 gui-color-gray">剩余数量</text>
+                  <text class="text-2" style="color: #00a0e9;font-weight: bold;">{{ item.leftQty }}</text>
+                </view>
+                <view class="card-list-item">
+                  <text class="text-1 gui-color-gray">批号</text>
+                  <text class="text-2" style="color: orange;font-weight: bold;">{{ item.batchNumber }}</text>
+                </view>
+              </view>
+            </view>
+            <!-- 删除按钮移出来,和card-content同级 -->
+            <view class="btn-delete" @tap.stop="deleteItem(item, idx)">删除</view>
+          </view>
+        </view>
+
+        <!-- 空态 -->
+        <view v-else>
+          <view class="bg-image">
+            <image src="@/static/empty.png" mode="heightFix" />
+            <text>这里什么都没有...</text>
+          </view>
+        </view>
+      </view>
+    </template>
+  </gui-page>
+</template>
+
+<script>
+import { onReachBottom } from '@dcloudio/uni-app'
+import { ref, defineComponent, onMounted, onBeforeMount } from 'vue'
+
+export default defineComponent({
+  setup() {
+    const parentRow = uni.getStorageSync('mixMaterialDetail') ?? {}
+    const detailId = ref('')
+    const queryParams = ref({ pageSize: 10, pageNo: 1, id: '' })
+    const cardList = ref([])
+	const hasMore = ref(true)
+
+    onBeforeMount(() => {
+      detailId.value = JSON.parse(parentRow)?.id
+    })
+
+    onMounted(() => {
+      search()
+    })
+
+    const search = () => {
+      // uni.$reqGet('getScannedInSendResourcePage', { ...queryParams.value, id: detailId.value }).then(
+	  uni.$reqGet('getScannedInSendResourcePage', { id: detailId.value }).then(
+        ({ data }) => {
+          const list = data?.inRequestSubdetailList ?? []
+		  console.log('返回数据:', list)  // ← 添加调试,看数据是否存在
+		  console.log('数据长度:', list.length)
+          cardList.value = list
+          // 如果首次加载不足10条,标记为没有更多数据
+          hasMore.value = list.length >= queryParams.value.pageSize
+        }
+      )
+    }
+
+    const goBack = () => {
+      uni.removeStorageSync('mixMaterialDetail')
+      uni.$goBack('/pages/workbranch/warehouse/scanInOut/In/businessType3/returnMaterial')
+    }
+
+    /* ===== 左滑删除 ===== */
+    const touchStart = e => {
+      const idx = e.currentTarget.dataset.index
+      cardList.value.forEach((v, i) => {
+        if (i !== idx) v.slideX = 0
+      })
+      const row = cardList.value[idx]
+      row.startX = e.touches[0].pageX
+      row.slideX = row.slideX || 0
+    }
+
+    const touchMove = e => {
+      const idx = e.currentTarget.dataset.index
+      const row = cardList.value[idx]
+      const delta = e.touches[0].pageX - row.startX
+      row.slideX = delta < 0 ? Math.max(delta, -70) : Math.min(delta, 0)
+    }
+
+    const touchEnd = e => {
+      const idx = e.currentTarget.dataset.index
+      const row = cardList.value[idx]
+      row.slideX = row.slideX <= -35 ? -70 : 0
+    }
+
+    const deleteItem = (item, idx) => {
+      // 调用删除接口
+      uni.$reqDelete('deleteScanInMaterial', { id: item.id }).then(res => {
+        if (res.code === 0) {
+          // 后端返回成功,删除本地数据
+          cardList.value.splice(idx, 1)
+          uni.showToast({
+            title: '删除成功',
+            icon: 'success'
+          })
+        } else {
+          // 后端返回失败,提示错误信息
+          uni.showToast({
+            title: res.data || '删除失败',
+            icon: 'none'
+          })
+        }
+      }).catch(err => {
+        uni.showToast({
+          title: '网络错误',
+          icon: 'none'
+        })
+      })
+    }
+
+    /* 下拉加载更多 */
+   //  onReachBottom(() => {
+	  // // 如果没有更多数据,直接返回不调用接口
+	  // if (!hasMore.value) return
+   //    queryParams.value.pageNo += 1
+   //    uni.$reqGet('getScannedInSendResourcePage', { ...queryParams.value, id: detailId.value }).then(
+   //      ({ data }) => {
+   //        const list = data?.inRequestSubdetailList ?? []
+   //        cardList.value.push(...list)
+   //        // 如果本次返回数据不足10条,标记为没有更多数据
+   //        hasMore.value = list.length >= queryParams.value.pageSize
+   //      }
+   //    )
+   //  })
+
+    return { goBack, cardList, touchStart, touchMove, touchEnd, deleteItem }
+  }
+})
+</script>
+
+<style lang="scss" scoped>
+	.gui-header-leader-btns {
+		color: black;
+		font-size: 24px !important;
+		margin-left: 24rpx;
+	}
+
+	.list-content {
+		margin-top: 80px;
+		background-color: #edeeee;
+	}
+
+	.card-list-flexbox {
+		display: flex;
+		flex-direction: row;
+		align-items: center;
+		flex-wrap: wrap;
+		margin: 3px 2px;
+
+		.card-list-item {
+			width: 750rpx;
+			min-height: 40px;
+			margin: 2rpx 0;
+			display: flex;
+			flex-direction: row;
+			align-items: center;
+			justify-content: space-between;
+			background-color: #fff;
+
+			uni-text {
+				font-size: 14px;
+				min-height: 40px;
+				text-align: left;
+				padding: 0 12px;
+				display: flex;
+				flex-direction: row;
+				align-items: center;
+			}
+
+			.text-1 {
+				flex: 1;
+				min-height: 40px;
+				justify-content: flex-start;
+			}
+
+			.text-2 {
+				flex: 3;
+				min-height: 40px;
+				justify-content: flex-end;
+				margin-right: 4px;
+				padding: 2px 6px;
+			}
+		}
+
+		.card-list-item:nth-of-type(1) {
+
+			.text-1 {
+				flex: 9;
+				font-weight: bold;
+				color: black !important;
+			}
+
+			.text-2 {
+				flex: 4;
+				display: flex;
+				flex-direction: row;
+				justify-content: flex-end;
+				align-items: center;
+				color: limegreen !important;
+			}
+		}
+
+	}
+
+	.font-icons {
+		width: 40px;
+		font-size: 20px;
+	}
+
+	.table-title {
+		height: 40px;
+		line-height: 40px;
+		margin: 0 0 4px 0;
+		padding: 0 12px;
+		font-size: 16px;
+		font-weight: bold;
+		background-color: white;
+	}
+
+	/* 左滑删除样式 */
+	.scroll-box{ padding: 0 12px; }
+	.swipe-card {
+		position: relative;
+		overflow: hidden; // ✅ 关键
+		margin-bottom: 8px;
+		border-radius: 6px;
+	}
+	.card-content {
+		position: relative; // ✅ 关键
+		z-index: 2;
+		background: #fff;
+		transition: transform 0.25s;
+		width: 100%;
+	}
+	.btn-delete {
+		position: absolute;
+		right: 0;
+		top: 0;
+		bottom: 0;
+		margin: auto 0;        // 上下 auto → 垂直居中
+		width: 70px;
+		height: 80rpx;         // ✅ 固定高度
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		background: #e54d42;
+		color: #fff;
+		font-size: 14px;
+		border-radius: 0 6px 6px 0;
+		z-index: 1;
+	}
+</style>

+ 1022 - 0
pages/workbranch/warehouse/scanInOut/In/businessType3/returnMaterial.vue

@@ -0,0 +1,1022 @@
+<template>
+	<gui-page :custom-header="true" :header-class="['gui-theme-background-color']">
+		<template #gHeader>
+			<view style="height:44px;" class="gui-flex gui-nowrap gui-rows gui-align-items-center">
+				<text style="font-size:44rpx;" class="gui-header-leader-btns gui-color-white font-icons"
+					@tap="goBack">&#xe6c5;</text>
+				<text class="gui-h4 gui-blod gui-flex1 gui-text-center gui-ellipsis gui-color-white gui-primary-text">扫描入库明细(退料)</text>
+				<view style="width:40px;" />
+			</view>
+		</template>
+		<template #gBody>
+			<view class="list-content">
+				<!-- 库位扫描输入框 -->
+				<view class="scan">
+					<view class="scan-card">
+						<uni-easyinput ref="easyinputStore" v-model="storeName" :input-border="false"
+							:clearable="false" type="text" placeholder="请扫描库位信息"
+							@confirm="confirmStore" />
+						<text class="font-icons" @click="handleScanStore">&#xe6b7;</text>
+					</view>
+				</view>
+
+				<!-- 物料扫描输入框 -->
+				<view class="scan">
+					<view class="scan-card">
+						<uni-easyinput ref="easyinput" v-model="scanBatchNumber" :input-border="false"
+							:clearable="false" type="text" placeholder="请扫描物料二维码"
+							@confirm="handleKeydown" />
+						<text class="font-icons" @click="handleScanMaterial">&#xe6b7;</text>
+					</view>
+				</view>
+				
+				<!-- 仓库和货位信息展示 -->
+				<view class="info-row">
+					<text class="info-label">仓库:</text>
+					<text class="info-value">{{ erpStockName }}</text>
+					<text class="info-label">货位:</text>
+					<text class="info-value">{{ wmsStoreName }}</text>
+				</view>
+			
+				<view class="tabs">
+					<div class="tabs-list">
+						<text :class="!isBefore?'tabs-item-active':'tabs-item'" @click="isBefore = false">物料需求</text>
+						<text :class="isBefore?'tabs-item-active':'tabs-item'" @click="isBefore = true">已扫物料</text>
+					</div>
+				</view>
+				
+				<!-- 物料需求列表 -->
+				<view v-if="!isBefore" class="custom-table">
+					<uni-table border stripe empty-text="暂无更多数据">
+						<uni-tr class="custom-table-head">
+							<uni-th align="center" width="180px" class="break-col">推荐库位(数量)</uni-th>
+							<uni-th align="center" width="180px">物料</uni-th>
+							<uni-th align="center" width="120px">应备数</uni-th>
+							<uni-th align="center" width="120px">已扫数量</uni-th>
+						</uni-tr>
+						<uni-tr v-for="(item, key) in tableData" :key="key" @click="handleToDetails(item)">
+							<uni-td align="center" class="break-cell">{{ item.recommendStockLocation }}</uni-td>
+							<uni-td align="center">{{ item.materialNo }}({{ item.materialName }})</uni-td>
+							<uni-td align="center">{{ item.nowDeliveredQty }}</uni-td>
+							<uni-td align="center" style="color: orange;font-weight: bold;">{{ item.completedQty }}</uni-td>
+						</uni-tr>
+					</uni-table>
+				</view>
+				
+				<!-- 已扫物料 -->
+				<view v-else class="custom-table">
+					<scroll-view scroll-y class="scroll-box" style="height: 300px;">
+						<view class="cell-row">
+							<view class="cell">物料</view>
+							<view class="cell">数量</view>
+							<view class="cell">批号</view>
+							<!-- <view class="cell">剩余数量</view> -->
+						</view>
+						<view
+							v-for="(item, idx) in beforeTableData"
+							:key="item.uniqueId || idx"
+							class="swipe-row"
+							:data-index="idx"
+							@touchstart="touchStart"
+							@touchmove="touchMove"
+							@touchend="touchEnd"
+						>
+							<view class="content-area" :style="{ transform: `translateX(${item.slideX || 0}px)` }">
+								<view class="cell">{{ item.materialNo }}({{ item.materialName }})</view>
+								<view class="cell">{{ item.batchQty }}</view>
+								<view class="cell">{{ item.batchNumber }}</view>
+								<!-- <view class="cell" style="color: #00a0e9;">{{ item.leftQty ?? '-' }}</view> -->
+							</view>
+							<view class="btn-area" @tap.stop="deleteItem(idx)">删除</view>
+						</view>
+					</scroll-view>
+				</view>
+				
+				<view class="card-list-item" style="margin: 12px 0;display: grid;grid-template-columns: 1fr 1fr;grid-template-rows: 1fr;gap: 10px;">
+					<view class="sign-btn" :class="{ disabled: saveDisabled }" @click="handleSave">
+						<text :style="saveBtnTextStyle">保存</text>
+					</view>
+					<view class="sign-btn" :class="{ disabled: submitDisabled }" @click="handleSubmit">
+						<text :style="submitBtnTextStyle">提交</text>
+					</view>
+				</view>
+				
+				<!-- 错误提示弹窗 -->
+				<uni-popup ref="errorTip" type="dialog">
+					<uni-popup-dialog type="error" cancel-text="关闭" confirm-text="确认" title="提示"
+						:content="errorTipMessage" @confirm="handleCloseErrorTipsModal"
+						@close="handleCloseErrorTipsModal" />
+				</uni-popup>
+				
+				<!-- leftQty 输入弹窗 -->
+				<uni-popup ref="leftQtyPopup" type="dialog">
+					<uni-popup-dialog
+						title="请输入剩余数量"
+						mode="input"
+						type="number"
+						placeholder="请输入剩余数量"
+						:value="leftQtyInputValue"
+						@confirm="handleLeftQtyConfirm"
+						@close="handleLeftQtyCancel"
+					/>
+				</uni-popup>
+			</view>
+		</template>
+	</gui-page>
+</template>
+
+<script>
+import { onReachBottom } from '@dcloudio/uni-app'
+import { ref, onMounted, defineComponent, onBeforeMount, computed, nextTick } from 'vue'
+
+export default defineComponent({
+	setup(options) {
+		// ============ 基础变量 ============
+		const easyinput = ref('')
+		const easyinputStore = ref('')
+		const errorTip = ref(null)
+		const errorTipMessage = ref('')
+		const errorState = ref(0)
+		const scanBatchNumber = ref('')
+		const isBefore = ref(false)
+		const tableData = ref([])
+		const beforeTableData = ref([])
+		const localScannedList = ref([])
+		const saveDisabled = ref(false)
+		const submitDisabled = ref(false)
+		const receiveList = ref([])
+		const currentScanMaterial = ref([])
+		const fdIndex = ref(-1)
+		
+		// ============ 库位相关 ============
+		const storeName = ref('')
+		const erpStockName = ref('')
+		const wmsStoreName = ref('')
+		
+		// ============ leftQty 弹窗相关 ============
+		const leftQtyPopup = ref(null)
+		const leftQtyInputValue = ref('')
+		const pendingQrCode = ref('')
+		
+		// ============ 按钮样式 ============
+		const isLightText = ref(false)
+		const isSubmitLight = ref(false)
+		
+		// ============ 父级数据 ============
+		const parentRow = uni.getStorageSync('masterId') ?? {}
+		const masterId = ref('')
+		
+		onBeforeMount(() => {
+			const parsedData = JSON.parse(parentRow)
+			masterId.value = parsedData?.id
+		})
+		
+		// ============ 数据加载 ============
+		const search = function() {
+			uni.$reqGet('getScannedInMatersDetails', { id: masterId.value })
+				.then(({ code, data, msg }) => {
+					if (code === 0) {
+						receiveList.value = data
+						uni.setStorageSync('ids', JSON.stringify(data?.inRequestDetailPDAList?.[0] || {}))
+						tableData.value = data?.inRequestDetailPDAList || []
+						
+						// 重建本地已扫列表
+						localScannedList.value = []
+						tableData.value.forEach(item => {
+							if (item.inRequestSubdetailList?.length) {
+								localScannedList.value.push(...item.inRequestSubdetailList)
+							}
+						})
+						flushBeforeTableData()
+					} else {
+						uni.showToast({ title: msg, icon: 'none', duration: 2000 })
+					}
+				})
+		}
+		
+		onMounted(() => { search() })
+		
+		// ============ 返回 ============
+		const goBack = function() {
+			uni.removeStorageSync('masterId')
+			uni.removeStorageSync('ids')
+			uni.$goBack('/pages/workbranch/warehouse/scanInOut/In/scanInPage')
+		}
+		
+		// ============ 库位扫码 ============
+		const handleScanStore = function() {
+			// #ifdef APP-PLUS
+			const mpaasScanModule = uni.requireNativePlugin('Mpaas-Scan-Module')
+			mpaasScanModule.mpaasScan(
+				{ scanType: ['qrCode', 'barCode'], hideAlbum: false },
+				(ret) => { if (ret.resp_code === 1000) confirmStore(ret.resp_result) }
+			)
+			// #endif
+			// #ifdef H5
+			confirmStore('PC-1')
+			// #endif
+		}
+		
+		const confirmStore = function(e) {
+			storeName.value = e
+			uni.$reqGet('getStockLocaltionByCode', { code: e })
+				.then(({ code, data, msg }) => {
+					if (code === 0 && data?.erpStockName && data?.wmsStoreName) {
+						erpStockName.value = data.erpStockName
+						wmsStoreName.value = data.wmsStoreName
+						nextTick(() => easyinput.value.onFocus())
+					} else {
+						showError('请扫描正确的库位')
+						storeName.value = ''
+					}
+				})
+		}
+		
+		// ============ 核心:扫描物料(businessType=3 特殊流程) ============
+		const handleScanMaterial = async function() {
+			// #ifdef APP-PLUS 
+			if (!storeName.value) {
+				showError('请先扫描库位信息')
+				return
+			}
+			
+			const mpaasScanModule = uni.requireNativePlugin('Mpaas-Scan-Module')
+			const ret = await new Promise(resolve =>
+				mpaasScanModule.mpaasScan(
+					{ scanType: ['qrCode', 'barCode'], hideAlbum: false },
+					resolve
+				)
+			)
+			if (ret.resp_code !== 1000) return
+			
+			await processScanWithLeftQty(ret.resp_result)
+			// #endif
+		}
+		
+		const handleKeydown = async function(e) {
+			if (!storeName.value) {
+				showError('请先扫描库位信息')
+				return
+			}
+			await processScanWithLeftQty(e)
+		}
+		
+		// ============ 退料专用:先校验 → 弹窗输入剩余数量 → 确认添加 ============
+		const processScanWithLeftQty = async function(qrCode) {
+			try {
+				const { code, data, msg } = await uni.$reqGet('scanPrepareMaterial', {
+					qrCode: qrCode,
+					locationCode: storeName.value
+				})
+				
+				if (code !== 0) {
+					showError(msg)
+					return
+				}
+				
+				// 缓存数据
+				pendingQrCode.value = qrCode
+				currentScanMaterial.value = data[0] ?? []
+				
+				// 校验批号重复
+				if (isBatchExist(currentScanMaterial.value.batchNumber)) {
+					showError('该批号已存在,请勿重复扫描')
+					return
+				}
+				
+				// 校验物料是否在需求列表
+				fdIndex.value = tableData.value.findIndex(item => item?.materialNo === data[0]?.materialNo)
+				if (fdIndex.value === -1) {
+					showError('请扫描所需物料的物料条码')
+					return
+				}
+				
+				// 校验数量是否已满
+				const row = tableData.value[fdIndex.value]
+				if (row.nowDeliveredQty <= row.completedQty) {
+					showError('已备数量已满,无需再扫')
+					return
+				}
+				
+				// 更新仓库货位
+				erpStockName.value = data[0]?.erpStockName || ''
+				wmsStoreName.value = data[0]?.wmsStoreName || ''
+				
+				// 弹出 leftQty 输入框
+				leftQtyInputValue.value = ''
+				leftQtyPopup.value.open()
+				
+			} catch (err) {
+				showError(err.msg || '获取物料信息失败')
+			}
+		}
+		
+		// ============ leftQty 弹窗确认 ============
+		const handleLeftQtyConfirm = (e) => {
+			const val = String(e).trim()
+			if (!val || isNaN(Number(val)) || Number(val) < 0) {
+				uni.showToast({ title: '请输入有效的数量', icon: 'none' })
+				return false
+			}
+			
+			const leftQtyNum = Number(val)
+			const receiptQty = currentScanMaterial.value?.receiptQty || 1
+			
+			if (leftQtyNum > receiptQty) {
+				uni.showToast({
+					title: `退料数量不能大于领料条码数量:${receiptQty}`,
+					icon: 'none',
+					duration: 3000
+				})
+				leftQtyInputValue.value = ''
+				nextTick(() => leftQtyPopup.value.open())
+				return false
+			}
+			
+			leftQtyInputValue.value = val
+			leftQtyPopup.value.close()
+			
+			// 添加数据到列表
+			addScannedMaterial(leftQtyNum)
+			return true
+		}
+		
+		// ============ leftQty 弹窗取消 ============
+		const handleLeftQtyCancel = () => {
+			leftQtyPopup.value.close()
+			pendingQrCode.value = ''
+			currentScanMaterial.value = []
+			leftQtyInputValue.value = ''
+			fdIndex.value = -1
+		}
+		
+		// ============ 添加已扫物料(退料专用) ============
+		const addScannedMaterial = (leftQty) => {
+			scanBatchNumber.value = pendingQrCode.value
+			const row = tableData.value[fdIndex.value]
+			
+			// 累加到"已备数"
+			row.completedQty += leftQty || 0
+			
+			// 扔进本地已扫池
+			localScannedList.value.push({
+				...currentScanMaterial.value,
+				batchQty: leftQty || 0,
+				supplierName: currentScanMaterial.value.supplierName || '',
+				leftQty: leftQty
+			})
+			
+			// 刷新已扫物料列表
+			flushBeforeTableData()
+			
+			// 复位输入框
+			setInputFocus()
+		}
+		
+		// ============ 公共方法 ============
+		const setInputFocus = function() {
+			scanBatchNumber.value = ''
+			easyinput.value.onBlur()
+			easyinput.value.onFocus()
+		}
+		
+		const flushBeforeTableData = function() {
+			const map = new Map()
+			localScannedList.value.forEach(it => {
+				const key = `${it.materialNo}__${it.batchNumber}`
+				if (map.has(key)) {
+					map.get(key).batchQty += it.batchQty
+				} else {
+					map.set(key, { ...it })
+				}
+			})
+			beforeTableData.value = Array.from(map.values()).map((v, i) => ({
+				...v,
+				uniqueId: `${v.materialNo}_${v.batchNumber}_${i}`,
+				slideX: 0
+			}))
+		}
+		
+		const isBatchExist = (batchNo) =>
+			beforeTableData.value.some((it) => it.batchNumber === batchNo)
+		
+		const showError = (msg) => {
+			// #ifdef APP-PLUS
+			plus.device.beep(2)
+			// #endif
+			errorTipMessage.value = msg
+			errorTip.value.open()
+			errorState.value = 0
+		}
+		
+		const handleCloseErrorTipsModal = async function() {
+			errorTip.value.close()
+			if (errorState.value === 0) await setInputFocus()
+		}
+		
+		// ============ 左滑删除 ============
+		const touchStart = (e) => {
+			const idx = e.currentTarget.dataset.index
+			beforeTableData.value.forEach((v, i) => { if (i !== idx) v.slideX = 0 })
+			beforeTableData.value[idx].startX = e.touches[0].pageX
+			beforeTableData.value[idx].slideX = beforeTableData.value[idx].slideX || 0
+		}
+		
+		const touchMove = (e) => {
+			const idx = e.currentTarget.dataset.index
+			const row = beforeTableData.value[idx]
+			const delta = e.touches[0].pageX - row.startX
+			row.slideX = delta < 0 ? Math.max(delta, -70) : Math.min(delta, 0)
+		}
+		
+		const touchEnd = (e) => {
+			const idx = e.currentTarget.dataset.index
+			const row = beforeTableData.value[idx]
+			row.slideX = row.slideX <= -35 ? -70 : 0
+		}
+		
+		const deleteItem = async (idx) => {
+			const target = beforeTableData.value[idx]
+			
+			// 有 id 先调接口删后端
+			if (target.id) {
+				try {
+					const { code, msg } = await uni.$reqPost('deleteScanInMaterial', { id: target.id })
+					if (code !== 0) {
+						showError(msg || '后端删除失败')
+						return
+					}
+				} catch (err) {
+					showError(err.errMsg || '网络异常,删除失败')
+					return
+				}
+			}
+			
+			// 删本地
+			const key = `${target.materialNo}__${target.batchNumber}`
+			const listIdx = localScannedList.value.findIndex(
+				v => `${v.materialNo}__${v.batchNumber}` === key
+			)
+			if (listIdx > -1) localScannedList.value.splice(listIdx, 1)
+			
+			flushBeforeTableData()
+			
+			// 回退已备数
+			const row = tableData.value.find(r => r.materialNo === target.materialNo)
+			if (row) row.completedQty -= target.batchQty
+		}
+		
+		// ============ 合并数据 ============
+		const mergeBeforeIntoTable = () => {
+			const mergedTableData = JSON.parse(JSON.stringify(tableData.value))
+			const map = {}
+			mergedTableData.forEach(row => {
+				if (!row.inRequestSubdetailList) row.inRequestSubdetailList = []
+				map[row.materialNo] = row
+			})
+			
+			beforeTableData.value.forEach(item => {
+				const target = map[item.materialNo]
+				if (target) {
+					const subItem = { ...item }
+					if (item.leftQty !== undefined) subItem.leftQty = item.leftQty
+					target.inRequestSubdetailList.push(subItem)
+				}
+			})
+			return mergedTableData
+		}
+		
+		// ============ 保存 ============
+		const handleSave = async function() {
+			if (saveDisabled.value) return
+			saveDisabled.value = true
+			try {
+				isLightText.value = true
+				const mergedData = mergeBeforeIntoTable()
+				await uni.$reqPost('saveScannedInMaterials', {
+					id: receiveList.value?.id,
+					requestNo: receiveList.value?.requestNo,
+					requestType: receiveList.value?.requestType,
+					businessType: receiveList.value?.businessType,
+					businessSubType: receiveList.value?.businessSubType,
+					status: receiveList.value?.status,
+					priority: receiveList.value?.priority,
+					inRequestDetailPDAList: mergedData
+				}).then(({ code, data, msg }) => {
+					if (code === 0) {
+						uni.showModal({ title: '提示', content: '保存成功', showCancel: false })
+						search()
+					} else {
+						showError(msg)
+					}
+				})
+			} finally {
+				saveDisabled.value = false
+			}
+		}
+		
+		// ============ 提交 ============
+		const handleSubmit = async function() {
+			if (submitDisabled.value) return
+			submitDisabled.value = true
+			try {
+				isSubmitLight.value = true
+				const mergedData = mergeBeforeIntoTable()
+				await uni.$reqPut('submitScannedInMaterials', {
+					id: receiveList.value?.id,
+					requestNo: receiveList.value?.requestNo,
+					requestType: receiveList.value?.requestType,
+					businessType: receiveList.value?.businessType,
+					businessSubType: receiveList.value?.businessSubType,
+					status: receiveList.value?.status,
+					priority: receiveList.value?.priority,
+					inRequestDetailPDAList: mergedData
+				}).then(({ code, data, msg }) => {
+					if (code === 0) {
+						uni.showModal({ title: '提示', content: '提交成功', showCancel: false })
+						search()
+					} else {
+						showError(msg)
+					}
+				})
+			} finally {
+				submitDisabled.value = false
+			}
+		}
+		
+		// ============ 跳转详情 ============
+		const handleToDetails = function(ret) {
+			uni.navigateTo({
+				url: '/pages/workbranch/warehouse/scanInOut/In/businessType3/businessType3Detail'
+			})
+			uni.setStorageSync('mixMaterialDetail', JSON.stringify(ret))
+		}
+		
+		// ============ 触底加载 ============
+		onReachBottom(() => {
+			queryParams.value.pageNo += 1
+			uni.$reqGet('getPrepareMaterialList', queryParams.value)
+				.then(({ data }) => {
+					Array.prototype.push.call(scanMaterialList.value, ...data?.list ?? [])
+				})
+		})
+		
+		// ============ 样式计算 ============
+		const saveBtnTextStyle = computed(() => ({
+			fontSize: '14px',
+			fontWeight: 'bold',
+			color: saveDisabled.value ? '#ccc' : (isLightText.value ? 'rgba(0,160,233,1)' : '')
+		}))
+		
+		const submitBtnTextStyle = computed(() => ({
+			fontSize: '14px',
+			fontWeight: 'bold',
+			color: submitDisabled.value ? '#ccc' : (isSubmitLight.value ? 'rgba(0,160,233,1)' : '')
+		}))
+		
+		return {
+			goBack,
+			isBefore,
+			tableData,
+			beforeTableData,
+			easyinput,
+			easyinputStore,
+			errorTip,
+			errorTipMessage,
+			handleCloseErrorTipsModal,
+			handleKeydown,
+			scanBatchNumber,
+			handleScanMaterial,
+			handleToDetails,
+			handleSave,
+			handleSubmit,
+			saveDisabled,
+			submitDisabled,
+			saveBtnTextStyle,
+			submitBtnTextStyle,
+			// 库位
+			storeName,
+			erpStockName,
+			wmsStoreName,
+			handleScanStore,
+			confirmStore,
+			// 删除
+			touchStart,
+			touchMove,
+			touchEnd,
+			deleteItem,
+			// leftQty
+			leftQtyPopup,
+			leftQtyInputValue,
+			handleLeftQtyConfirm,
+			handleLeftQtyCancel
+		}
+	}
+})
+</script>
+
+<style lang="scss" scoped>
+	/* 左滑删除样式 */
+	.scroll-box{
+		height:100%;                 /* 继承父级高度 */
+	}
+  .cell-row {
+		display: flex;
+		background-color: #f5f7fa;
+		font-weight: bold;
+		border-radius: 4px;
+		margin-bottom: 5px;
+	}
+	.swipe-row{
+		position:relative;
+		width:100%;
+		height:44px;
+		overflow:hidden;
+		border-bottom:1px solid #eee;
+	}
+	.content-area{
+		position:absolute;
+		left:0;
+		top:0;
+		right:0;
+		bottom:0;
+		z-index:2;
+		background:#fff;
+		display:flex;
+		align-items:center;
+		transition: transform .25s;
+	}
+	.cell{
+		flex:1;
+		text-align:center;
+		font-size:14px;
+		color:#333;
+	}
+	.btn-area{
+		position:absolute;
+		right:0;
+		top:0;
+		width:70px;
+		height:100%;
+		background:#e54d42;
+		color:#fff;
+		display:flex;
+		align-items:center;
+		justify-content:center;
+		font-size:14px;
+		z-index:1;
+	}
+
+	.gui-header-leader-btns {
+		color: black;
+		font-size: 24px !important;
+		margin-left: 24rpx;
+	}
+
+	.list-content {
+		margin-top: 80px;
+		background-color: #edeeee;
+	}
+
+	.scan {
+		margin-top: 10px;
+		height: 55px;
+		display: flex;
+		justify-content: center;
+		background-color: white;
+	}
+
+	.scan-card {
+		display: flex;
+		flex-direction: row;
+		justify-content: space-between;
+		align-items: center;
+		width: 100%;
+		padding-left: 10px;
+		padding-right: 10px;
+	}
+
+	.store-info {
+		margin-top: 10px;
+		height: 140px;
+		display: flex;
+		justify-content: center;
+		background-color: white;
+	}
+
+	.store-info-card {
+		display: flex;
+		flex-direction: column;
+		
+		.row-space-between {
+			flex: 1;
+			width: calc(100vw - 40px);
+			display: flex;
+			flex-direction: row;
+			justify-content: space-between;
+			align-items: center;
+			padding-top: 12px;
+			padding-bottom: 12px;
+		}
+	}
+
+	.card-list-flexbox {
+		display: flex;
+		flex-direction: row;
+		align-items: center;
+		flex-wrap: wrap;
+		margin: 3px 2px;
+
+		.card-list-item {
+			width: 750rpx;
+			height: 40px;
+		}
+	}
+	
+	.card-list-item {
+		margin: 2rpx 0;
+		display: flex;
+		flex-direction: row;
+		align-items: center;
+		justify-content: space-between;
+		background-color: #fff;
+
+		uni-text {
+			font-size: 14px;
+			height: 50rpx;
+			text-align: left;
+			padding: 0 12px;
+			display: flex;
+			flex-direction: row;
+			align-items: center;
+		}
+
+		.text-1 {
+			flex: 1;
+			height: 40px;
+			justify-content: flex-start;
+		}
+
+		.text-2 {
+			flex: 3;
+			height: 40px;
+			justify-content: flex-end;
+			margin-right: 4px;
+			padding: 2px 6px;
+		}
+	}
+
+	.card-list-flexbox:nth-of-type(2) {
+		margin-top: 48px;
+	}
+
+	.fixedTop {
+		bottom: 0 !important;
+		top: 3.25rem !important;
+	}
+
+	.popup-content {
+		height: 75vh;
+		overflow-y: scroll;
+		background-color: #edeeee;
+	}
+
+	.font-icons {
+		width: 40px;
+		font-size: 20px;
+	}
+
+	.scan {
+		height: 45px;
+		width: calc(100% - 48px);
+		margin: 12px;
+		padding: 0 12px;
+		display: flex;
+		justify-content: space-between;
+		align-items: center;
+		border-radius: 6px;
+		background-color: white;
+
+		.scan-card {
+			width: 100%;
+			display: grid;
+			grid-template-rows: 1fr;
+			grid-template-columns: 7fr 2fr;
+			align-items: center;
+
+			input {
+				height: 35px;
+				line-height: 35px;
+			}
+
+			text {
+				width: 100%;
+				text-align: right;
+			}
+		}
+	}
+
+	.custom-table {
+		height: calc(100vh - 265px);
+		min-height: 230px;
+		margin: 5px 0;
+		// min-height: 600px;
+		overflow-y: scroll;
+	}
+
+  .custom-table-head .uni-th {
+    color: #333;
+    font-weight: bold;
+  }
+
+  .custom-table .uni-tr:nth-child(even) {
+    background-color: #f5f7fa;
+  }
+
+  .custom-table .uni-tr:nth-child(odd) {
+    background-color: #ffffff;
+  }
+
+  /* 仓库和货位信息展示样式 */
+  .info-row {
+    display: flex;
+    align-items: center;
+    padding: 10rpx 20rpx;
+    background-color: #f0f2f5;
+    border-radius: 8rpx;
+    margin: 10rpx 20rpx;
+  }
+
+  .info-label {
+    color: #666;
+    font-size: 28rpx;
+    margin-right: 8rpx;
+  }
+
+  .info-value {
+    color: #333;
+    font-size: 28rpx;
+    margin-right: 20rpx;
+    font-weight: 500;
+  }
+
+  /* 不良品是否入库单选按钮样式 */
+  .bad-material-radio {
+    display: flex;
+    align-items: center;
+    padding: 10rpx 24rpx;
+    background-color: #fff;
+    margin: 0 24rpx 10rpx 24rpx;
+    border-radius: 6px;
+    
+    .radio-label {
+      font-size: 28rpx;
+      color: #333;
+      margin-right: 20rpx;
+      white-space: nowrap;
+    }
+    
+    .radio-group {
+      display: flex;
+      flex-direction: row;
+    }
+    
+    .radio-item {
+      display: flex;
+      align-items: center;
+      margin-right: 30rpx;
+      
+      radio {
+        transform: scale(0.8);
+      }
+      
+      text {
+        font-size: 28rpx;
+        color: #333;
+        margin-left: 8rpx;
+      }
+    }
+  }
+
+	.modal-btns {
+		height: 100rpx;
+		line-height: 100rpx;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+	}
+
+	.line {
+		margin-top: 10rpx;
+		height: 80rpx;
+		width: 1rpx;
+		background-color: #dcdcdc;
+	}
+
+	.tabs {
+		width: 100%;
+		height: 45px;
+		display: flex;
+		align-items: flex-end;
+		padding: 0 2px;
+		background-color: white;
+		
+		.tabs-list {
+			border-radius: 3px;
+			overflow: hidden;
+		}
+	
+		.tabs-item {
+			display: inline-block;
+			width: 72px;
+			height: 30px;
+			line-height: 30px;
+			padding: 0 8px;
+			font-size: 14px;
+			font-weight: bold;
+			text-align: center;
+			color: black;
+			border-bottom: 1.5px dashed #00a0e9;
+			transition: all .5s ease-in-out;
+		}
+	
+		.tabs-item-active {
+			position: relative;
+			display: inline-block;
+			width: 72px;
+			height: 30px;
+			line-height: 30px;
+			padding: 0 8px;
+			font-size: 14px;
+			font-weight: bold;
+			text-align: center;
+			color: white;
+			border-left: 1px solid #00a0e9;
+			border-top: 1px solid #00a0e9;
+			border-right: 1px solid #00a0e9;
+			border-bottom: 1.5px solid #00a0e9;
+			border-radius: 5px 5px 0 0;
+			animation: .3s linear show;
+			background-color: #00a0e9;
+		}
+	
+		.tabs-item-active::before {
+			content: '';
+			position: absolute;
+			left: -10px;
+			bottom: 0;
+			width: 10px;
+			height: 10px;
+			background: radial-gradient(circle at 0% 25%, transparent 10px, #00a0e9 0)
+		}
+	
+		.tabs-item-active::after {
+			content: '';
+			position: absolute;
+			right: -10px;
+			bottom: 0;
+			width: 10px;
+			height: 10px;
+			background: radial-gradient(circle at 100% 25%, transparent 10px, #00a0e9 0)
+		}
+	}
+	
+	@keyframes show {
+		from {
+			transform: translateY(5%);
+		}
+	
+		to {
+			transform: translateY(0%);
+		}
+	}
+
+	.sign-btn {
+		display: flex;
+		align-items: center;
+		justify-content: center;
+		margin: 0 8px;
+		border: 1px solid #999999;
+		background-color: white;
+		border-radius: 6px;
+	}
+
+	.sign-btn.disabled {
+		opacity: 0.5;
+		pointer-events: none;
+	}
+	// /* 表头也允许换行,保证与列宽对齐 */
+	// ::v-deep .break-col {
+	//   white-space: normal !important;
+	//   word-break: break-all !important;
+	//   line-height: 1.2;
+	// }
+	
+	// /* 单元格超长自动分段 */
+	// ::v-deep .break-cell {
+	//   white-space: normal !important;
+	//   word-break: break-all !important;
+	//   line-height: 1.2;
+	//   padding: 4px 2px;          /* 上下留一点空隙,视觉更舒服 */
+	// }
+</style>

+ 21 - 15
pages/workbranch/warehouse/scanInOut/In/materialsDetail.vue

@@ -46,6 +46,11 @@
                   <text class="text-1 gui-color-gray">数量</text>
                   <text class="text-2" style="color: orange;font-weight: bold;">{{ item.batchQty }}</text>
                 </view>
+                <!-- 当 leftQty 有值时显示剩余数量 -->
+                <view v-if="item.leftQty !== undefined && item.leftQty !== null" class="card-list-item">
+                  <text class="text-1 gui-color-gray">剩余数量</text>
+                  <text class="text-2" style="color: #00a0e9;font-weight: bold;">{{ item.leftQty }}</text>
+                </view>
                 <view class="card-list-item">
                   <text class="text-1 gui-color-gray">批号</text>
                   <text class="text-2" style="color: orange;font-weight: bold;">{{ item.batchNumber }}</text>
@@ -90,7 +95,8 @@ export default defineComponent({
     })
 
     const search = () => {
-      uni.$reqGet('getScannedInSendResourcePage', { ...queryParams.value, id: detailId.value }).then(
+      // uni.$reqGet('getScannedInSendResourcePage', { ...queryParams.value, id: detailId.value }).then(
+	  uni.$reqGet('getScannedInSendResourcePage', { id: detailId.value }).then(
         ({ data }) => {
           const list = data?.inRequestSubdetailList ?? []
 		  console.log('返回数据:', list)  // ← 添加调试,看数据是否存在
@@ -157,19 +163,19 @@ export default defineComponent({
     }
 
     /* 下拉加载更多 */
-    onReachBottom(() => {
-	  // 如果没有更多数据,直接返回不调用接口
-	  if (!hasMore.value) return
-      queryParams.value.pageNo += 1
-      uni.$reqGet('getScannedInSendResourcePage', { ...queryParams.value, id: detailId.value }).then(
-        ({ data }) => {
-          const list = data?.inRequestSubdetailList ?? []
-          cardList.value.push(...list)
-          // 如果本次返回数据不足10条,标记为没有更多数据
-          hasMore.value = list.length >= queryParams.value.pageSize
-        }
-      )
-    })
+   //  onReachBottom(() => {
+	  // // 如果没有更多数据,直接返回不调用接口
+	  // if (!hasMore.value) return
+   //    queryParams.value.pageNo += 1
+   //    uni.$reqGet('getScannedInSendResourcePage', { ...queryParams.value, id: detailId.value }).then(
+   //      ({ data }) => {
+   //        const list = data?.inRequestSubdetailList ?? []
+   //        cardList.value.push(...list)
+   //        // 如果本次返回数据不足10条,标记为没有更多数据
+   //        hasMore.value = list.length >= queryParams.value.pageSize
+   //      }
+   //    )
+   //  })
 
     return { goBack, cardList, touchStart, touchMove, touchEnd, deleteItem }
   }
@@ -297,4 +303,4 @@ export default defineComponent({
 		border-radius: 0 6px 6px 0;
 		z-index: 1;
 	}
-</style>
+</style>

+ 16 - 9
pages/workbranch/warehouse/scanInOut/In/scanInPage.vue

@@ -153,15 +153,22 @@
 			}
 
 			const handleToScanMaterials = function(params) {
-				// 存储数据,使用abc页面需要的键名
-				uni.setStorageSync('masterId', JSON.stringify({
-					id: params?.id,
-					businessType: params?.businessType
-				}))
-				// 跳转到abc页面
-				uni.navigateTo({
-					url: `/pages/workbranch/warehouse/scanInOut/In/scannedMaterials`
-				})
+			    // 存储数据,使用abc页面需要的键名
+			    uni.setStorageSync('masterId', JSON.stringify({
+			        id: params?.id,
+			        businessType: params?.businessType
+			    }))
+			    
+			    // 根据 businessType 判断跳转页面:3=退料,其他=普通入库
+			    const isReturnMaterial = String(params?.businessType).trim() == '3'
+			    const targetUrl = isReturnMaterial
+			        ? '/pages/workbranch/warehouse/scanInOut/In/businessType3/returnMaterial'
+			        : '/pages/workbranch/warehouse/scanInOut/In/scannedMaterials'
+			    
+			    // 跳转到对应页面
+			    uni.navigateTo({
+			        url: targetUrl
+			    })
 			}
 			
 			// 同步搜索条件到queryParams

+ 49 - 2
pages/workbranch/warehouse/scanInOut/In/scannedMaterials.vue

@@ -177,6 +177,18 @@
 								@confirm="fifoContinue"
 								@close="fifoCancel" />
 						</uni-popup>
+						<!-- 剩余数量输入弹窗 - 仅在 businessType 为 '3' 时使用 -->
+						<uni-popup ref="leftQtyPopup" type="dialog">
+						  <uni-popup-dialog
+						    title="请输入剩余数量"
+						    mode="input"
+						    type="number"
+						    placeholder="请输入剩余数量"
+						    :value="leftQtyInputValue"
+						    @confirm="handleLeftQtyConfirm"
+						    @close="handleLeftQtyCancel"
+						  />
+						</uni-popup>
 			</view>
 		</template>
 	</gui-page>
@@ -237,6 +249,11 @@ export default defineComponent({
     // 控制提交按钮能否点击
     const submitDisabled = ref(false)
     const receiveList = ref([])
+	/* -------------------- 剩余数量相关变量 -------------------- */
+	const leftQtyPopup = ref(null)
+	const leftQtyInputValue = ref('')
+	const pendingQrCode = ref('') // 缓存待处理的二维码
+	const leftQtyMap = ref(new Map()) // 存储每条已扫物料的leftQty,key为 batchNumber
     
     /* -------------------- 不良品是否入库字段 -------------------- */
     const badMaterialInStockFlag = ref(null)
@@ -250,6 +267,35 @@ export default defineComponent({
     const fifoCheckOrderTypeDict = ref([])
     // 标记businessType是否在fifo_check_order_type字典内
     const isBusinessTypeInFifoDict = ref(false)
+	// 打开 剩余数量 弹窗
+	const openLeftQtyModal = (qrCode) => {
+	  pendingQrCode.value = qrCode
+	  leftQtyInputValue.value = ''
+	  leftQtyPopup.value.open()
+	}
+	
+	// 确认输入 剩余数量
+	const handleLeftQtyConfirm = (e) => {
+	  const val = e.trim()
+	  if (!val || isNaN(Number(val)) || Number(val) < 0) {
+	    uni.showToast({
+	      title: '请输入有效的数量',
+	      icon: 'none'
+	    })
+	    return
+	  }
+	  leftQtyInputValue.value = val
+	  leftQtyPopup.value.close()
+	  // 继续处理扫码逻辑,传入剩余数量
+	  processScanMaterial(pendingQrCode.value, Number(val))
+	}
+	
+	// 取消输入 剩余数量
+	const handleLeftQtyCancel = () => {
+	  leftQtyPopup.value.close()
+	  pendingQrCode.value = ''
+	  leftQtyInputValue.value = ''
+	}
     
     /* -------------------- FIFO校验核心方法 -------------------- */
     // 真正继续扫码(关闭弹窗并置标志)
@@ -801,7 +847,8 @@ const checkFifo = (qrCode) => {
         const target = map[item.materialNo]
         if (target) {
           target.inRequestSubdetailList.push({ 
-            ...item
+            ...item,
+			leftQty: null
           }) // 整条记录丢进去
         }
         // 不存在就跳过
@@ -1388,4 +1435,4 @@ const checkFifo = (qrCode) => {
 	//   line-height: 1.2;
 	//   padding: 4px 2px;          /* 上下留一点空隙,视觉更舒服 */
 	// }
-</style>
+</style>

+ 15 - 14
pages/workbranch/warehouse/scanInOut/Out/materialsDetail.vue

@@ -90,7 +90,8 @@ export default defineComponent({
     })
 
     const search = () => {
-      uni.$reqGet('getScannedOutSendResourcePage', { ...queryParams.value, id: detailId.value }).then(
+      // uni.$reqGet('getScannedOutSendResourcePage', { ...queryParams.value, id: detailId.value }).then(
+	  uni.$reqGet('getScannedOutSendResourcePage', { id: detailId.value }).then(
         ({ data }) => {
           const list = data?.inoutRequestSubdetailList ?? []
 		  cardList.value = list
@@ -157,21 +158,21 @@ export default defineComponent({
     }
 
     /* 下拉加载更多 */
-    onReachBottom(() => {
-      // 如果没有更多数据,直接返回不调用接口
-      if (!hasMore.value) return
+    // onReachBottom(() => {
+    //   // 如果没有更多数据,直接返回不调用接口
+    //   if (!hasMore.value) return
       
-      queryParams.value.pageNo += 1
+    //   queryParams.value.pageNo += 1
       
-      uni.$reqGet('getScannedOutSendResourcePage', { ...queryParams.value, id: detailId.value }).then(
-        ({ data }) => {
-          const list = data?.inoutRequestSubdetailList ?? []
-          cardList.value.push(...list)
-          // 如果本次返回数据不足10条,标记为没有更多数据
-          hasMore.value = list.length >= queryParams.value.pageSize
-        }
-      )
-    })
+    //   uni.$reqGet('getScannedOutSendResourcePage', { ...queryParams.value, id: detailId.value }).then(
+    //     ({ data }) => {
+    //       const list = data?.inoutRequestSubdetailList ?? []
+    //       cardList.value.push(...list)
+    //       // 如果本次返回数据不足10条,标记为没有更多数据
+    //       hasMore.value = list.length >= queryParams.value.pageSize
+    //     }
+    //   )
+    // })
 
     return { goBack, cardList, touchStart, touchMove, touchEnd, deleteItem }
   }

+ 4 - 0
pages/workbranch/warehouse/scanInOut/Out/scannedMaterials.vue

@@ -813,6 +813,10 @@ export default defineComponent({
     /* ===================== 公共校验函数 ===================== */
     // 仓库ID校验函数
     const validateWarehouseId = (scanData) => {
+	  // businessType 为 '1' 时跳过仓库ID校验
+		if (businessType.value == '1') {
+		return true;
+		}
       const cur = Array.isArray(scanData) ? scanData[0] : scanData;
       if (cur && cur.warehouseId && currentWarehouseId.value && cur.warehouseId !== currentWarehouseId.value) {
         // #ifdef APP-PLUS