chenrui vor 2 Jahren
Ursprung
Commit
31687a17d4
2 geänderte Dateien mit 74 neuen und 92 gelöschten Zeilen
  1. 64 91
      pages/shuntBackManage/addBackOrder.vue
  2. 10 1
      pages/shuntBackManage/detailModal.vue

+ 64 - 91
pages/shuntBackManage/addBackOrder.vue

@@ -23,7 +23,7 @@
 						:show-action="false"
 					></u-search>
 				</view>
-				<view class="searchBox_r"><u-icon color="#666666" size="40" name="saomiao" custom-prefix="iscm-icon"></u-icon></view>
+				<view class="searchBox_r" @click="handleScanCode"><u-icon color="#666666" size="40" name="saomiao" custom-prefix="iscm-icon"></u-icon></view>
 			</view>
 		</view>
 		<view class="backOrderCon">
@@ -41,7 +41,7 @@
 										<text>{{item.shelfPlaceCode}}</text>
 										{{item.productCode}}
 									</view>
-									<view class="productName u-line-1">
+									<view class="productName u-line-2">
 										{{item.productName}}
 									</view>
 									<view class="ptxt flex align_center">
@@ -74,7 +74,7 @@
 							</view>
 							<view class="pcurnums flex align_center">
 								<text>调回数量</text>
-								<view class="u-ninput"><u-number-box color="#000" :input-height="60" bg-color="#fff" v-model="item.confirmQty" :min="0" :max="item.qty"></u-number-box></view>
+								<view class="u-ninput"><u-number-box color="#000" :input-height="60" bg-color="#fff" v-model="item.confirmQty" :min="0" :max="item.qty" @minus="minus" @plus="plus" @change="numberBoxChange"></u-number-box></view>
 							</view>
 						</view>
 					</view>
@@ -108,18 +108,18 @@
 			<view class="choosePopup">
 				<view class="chooseTit">滞销天数</view>
 				<view class="chooseDay u-flex">
-					<u-input v-model="startDay" input-align="center" placeholder="起始天数" type="number" />
+					<u-input v-model="queryParam.unsalableDaysBegin" input-align="center" placeholder="起始天数" type="number" />
 					<text>至</text>
-					<u-input v-model="endDay" input-align="center" placeholder="截止天数" type="number" />
+					<u-input v-model="queryParam.unsalableDaysEnd" input-align="center" placeholder="截止天数" type="number" />
 				</view>
 				<view class="butBox u-flex">
 					<u-button hover-class="none" shape="circle" size="medium" @click="reset">重置</u-button>
-					<u-button hover-class="none" :custom-style="customBtnStyle" size="medium" shape="circle" @click="handelSort">查询</u-button>
+					<u-button hover-class="none" :custom-style="customBtnStyle" size="medium" shape="circle" @click="handelFilter">查询</u-button>
 				</view>
 			</view>
 		</u-popup>
 		<!-- 查看明细弹窗 -->
-		<detailModal @clearList='clearOneList' @clearAllList="clearAll" :detailShow="detailFlag" :chooseData="chooseArr"  @close="detailFlag=false"></detailModal>
+		<detailModal @clearList='clearOneList' @clearAllList="clearAll" @changeNumRecount="recount" :detailShow="detailFlag" :chooseData="chooseArr"  @close="detailFlag=false"></detailModal>
 	</view>
 </template>
 
@@ -139,33 +139,8 @@ export default {
 			chooseArr:[],
 			noDataText: '暂无调回单',
 			totalNum: 0,
-			
 			detailFlag:false,//查看详情
-			
-			chooseShow: false,
-			checked: true,
-			keyword: '',
-			sortList: [
-				{
-					id: 1,
-					name: '最近一次VIN扫描时间降序'
-				},
-				{
-					id: 2,
-					name: '适配有货降序'
-				},
-				{
-					id: 3,
-					name: '适配无货降序'
-				}
-			],
-			isSortFlag: 0,
-			list: [],
-			
-			
-			status: 'loading',
-			
-			total: 0,
+			chooseShow: false,//滞销天数弹窗
 			theme: '',
 			customBtnStyle: {
 				//  自定义按钮样式
@@ -173,9 +148,16 @@ export default {
 				backgroundColor: this.$config('primaryColor'),
 				color: '#fff'
 			},
-			startDay: null,
-			endDay: null,
-			allChecked: false
+			allChecked: false,
+			keyword: '',//搜索
+			queryParam: { //  查询条件
+			  shelfSn:this.shelfSn,
+			  productCode: undefined,
+			  productName: undefined,
+			  unsalableDaysBegin: undefined,
+			  unsalableDaysEnd: undefined,
+			  queryWord:undefined
+			},
 		};
 	},
 	onLoad(options) {
@@ -195,10 +177,12 @@ export default {
 		}
 	},
 	methods: {
-		// 获取数字货架列表
+		// 获取列表
 		loadData(params) {
 			const _this = this;
-			_this.status = 'loading';
+			uni.showLoading({
+				title: '加载中...'
+			});
 			controlQueryList(params).then(res => {
 				if (res.status == 200) {
 					res.data.forEach(item=>{
@@ -207,6 +191,7 @@ export default {
 					})
 					this.recallBillList=res.data;
 				}
+				uni.hideLoading()
 			});
 		},
 		
@@ -276,76 +261,64 @@ export default {
 			})
 			this.chooseArr = []
 		},
-		
+		//进步器change事件
+		numberBoxChange(){
+			this.calculateTotal();
+		},
+		minus(){
+			this.calculateTotal();
+		},
+		plus(){
+			this.calculateTotal();
+		},
+		// 详情改变重新计算总件数
+		recount(){
+			this.calculateTotal();
+		},
+		// 重置
 		reset() {
-			this.isSortFlag = 0;
-			this.pageNo = 1;
 			let ajaxData = {
-				pageNo: 1,
-				pageSize: this.pageSize,
-				shelfSn: this.shelfSn
+				shelfSn:this.shelfSn,
+				productCode: undefined,
+				productName: undefined,
+				unsalableDaysBegin: undefined,
+				unsalableDaysEnd: undefined,
+				queryWord:undefined
 			};
-			this.loadData(ajaxData);
+			this.queryParam = ajaxData;
+			this.loadData(this.queryParam);
+		},
+		handelFilter(){
+			this.queryParam.shelfSn = this.shelfSn;
+			this.loadData(this.queryParam);
 		},
 		// 搜索
 		getSearchCon() {
-			this.pageNo = 1;
 			var reg = new RegExp('[\\u4E00-\\u9FFF]+', 'g');
-			var ajaxData = null;
 			if (reg.test(this.keyword)) {
 				//包含汉字
-				ajaxData = {
-					pageNo: 1,
-					pageSize: this.pageSize,
-					shelfSn: this.shelfSn,
-					productName: this.keyword.trim()
-				};
+				this.queryParam.productName = this.keyword.trim()
 			} else {
-				ajaxData = {
-					pageNo: 1,
-					pageSize: this.pageSize,
-					shelfSn: this.shelfSn,
-					productCode: this.keyword.trim()
-				};
+				this.queryParam.productCode=this.keyword.trim()
 			}
-			if (this.isSortFlag == 0) {
-				ajaxData.orderBy = 'xvfp.scan_vin_date desc,xp.code asc';
-			} else if (this.isSortFlag == 1) {
-				ajaxData.orderBy = 'xvfp.in_stock_count desc,xp.code asc';
-			} else {
-				ajaxData.orderBy = 'xvfp.not_stock_count desc,xp.code asc';
-			}
-			this.loadData(ajaxData);
+			this.queryParam.shelfSn = this.shelfSn
+			this.loadData(this.queryParam);
 		},
 		// 清空搜索内容
 		clearSearch() {
 			this.keyword = '';
 			this.reset();
 		},
-		handelSort() {
-			this.pageNo = 1;
-			var ajaxData = {
-				shelfSn: this.shelfSn,
-				pageNo: 1,
-				pageSize: this.pageSize
-			};
-			if (this.keyword) {
-				var reg = new RegExp('[\\u4E00-\\u9FFF]+', 'g');
-				if (reg.test(this.keyword)) {
-					ajaxData.productName = this.keyword.trim();
-				} else {
-					ajaxData.productCode = this.keyword.trim();
+		//扫码
+		handleScanCode(){
+			uni.scanCode({
+				success: (res)=> {
+					console.log('条码类型:' + res.scanType);
+					console.log('条码内容:' + res.result);
+					this.queryParam.queryWord = res.result;
 				}
-			}
-			if (this.isSortFlag == 0) {
-				ajaxData.orderBy = 'xvfp.scan_vin_date desc,xp.code asc';
-			} else if (this.isSortFlag == 1) {
-				ajaxData.orderBy = 'xvfp.in_stock_count desc,xp.code asc';
-			} else {
-				ajaxData.orderBy = 'xvfp.not_stock_count desc,xp.code asc';
-			}
-			this.sortShow = false;
-			this.loadData(ajaxData);
+			});
+			this.loadData(this.queryParam);
 		}
 	}
 };
@@ -439,7 +412,7 @@ export default {
 						}
 					}
 					.productName{
-						width: 90%;
+						width: 100%;
 						font-size: 32rpx;
 						color: #191919;
 						font-weight: bold;

+ 10 - 1
pages/shuntBackManage/detailModal.vue

@@ -52,7 +52,7 @@
 					</view>
 					<view class="pcurnums flex align_center">
 						<text>调回数量</text>
-						<view class="u-ninput"><u-number-box color="#000" :input-height="60" bg-color="#fff" v-model="con.confirmQty" :min="0" :max="10"></u-number-box></view>
+						<view class="u-ninput"><u-number-box color="#000" :input-height="60" bg-color="#fff" v-model="con.confirmQty" :min="0" :max="10" @minus="minus" @plus="plus" @change="change"></u-number-box></view>
 					</view>
 				</view>
 			</view>
@@ -87,6 +87,15 @@
 			clearAllList(){
 				this.list = [];
 				 this.$emit("clearAllList")
+			},
+			minus(){
+				this.$emit("changeNumRecount")
+			},
+			plus(){
+				this.$emit("changeNumRecount")
+			},
+			change(){
+				this.$emit("changeNumRecount")
 			}
 		},
 		watch: {