Browse Source

新功能

lilei 2 years ago
parent
commit
a9bbbaa309
2 changed files with 80 additions and 42 deletions
  1. 43 1
      pages/batchShelves/cartList.vue
  2. 37 41
      pages/soldOut/creatOrder.vue

+ 43 - 1
pages/batchShelves/cartList.vue

@@ -58,6 +58,9 @@
 		<!-- 合计弹框 -->
 		<u-popup mode="bottom" closeable v-model="showPop" :z-index="100">
 			<view class="heji-content">
+				<view style="color: red;margin-top: -35rpx;margin-bottom: 15rpx;">
+					<text @click="showDelLay=true"><u-icon name="trash"></u-icon>批量删除</text>
+				</view>
 				<scroll-view scroll-y="true" style="height: 400rpx;">
 					<view class="heji-con-list">
 						<view class="flex align_center" v-for="item in countData" :key="item.shelfTierCode">
@@ -89,6 +92,26 @@
 				 </view>
 			</view>
 		</u-popup>
+		<!-- 选择层删除 -->
+		<u-popup mode="center" width="80%" :mask-close-able="false" closeable @close="delLayer=[]" v-model="showDelLay" border-radius="15">
+			<view class="layer-content">
+				 <view class="tits">
+					 <view>请选择需要删除的层</view>
+					 <view>删除后,该层所有已录入的产品都会删除</view>
+				 </view>
+				 <view class="tagbox flex">
+				 	<view>
+				 		<view class="tag" :class="delLayer.indexOf(item)>=0?'active':''" v-for="item in layerList" :key="item" @click="chooseDelLay(item)">
+				 			{{item}}层
+				 		</view>
+				 	</view>
+				 </view>
+				 <view class="newbtn flex justify_between">
+				 	<u-button shape="circle" @click="showDelLay=false" size="medium">取消</u-button>
+				 	<u-button type='primary' @click="confirmDel" shape="circle" size="medium">确定删除</u-button>
+				 </view>
+			</view>
+		</u-popup>
 		<!-- 上架确认 -->
 		<choose-type-modal v-if="chooseModal" :totalKs="totalKs" :totalNums="totalNums" :openModal="chooseModal" @confirm="confirmPut" @close="chooseModal = false" />
 		<printStickerModal v-if="showPrintModal" :layer="curTab" :openModal="showPrintModal" @confirm="confirmPrint" @close="showPrintModal = false"></printStickerModal>
@@ -121,7 +144,9 @@
 				countData: [],
 				layerList: [],
 				showLayer: false,
-				curLayer: ''
+				showDelLay: false,
+				curLayer: '',
+				delLayer: []
 			}
 		},
 		onShow() {
@@ -328,6 +353,23 @@
 				  }
 				})
 			},
+			// 批量删除
+			chooseDelLay(val){
+				const i = this.delLayer.findIndex(item => item == val)
+				if(i>=0){
+					this.delLayer.splice(i,1)
+				}else{
+					this.delLayer.push(val)
+				}
+			},
+			confirmDel(){
+				console.log(this.delLayer)
+				if(this.delLayer.length){
+					
+				}else{
+					this.toashMsg("请选择层号")
+				}
+			},
 			// 修改数量
 			updateNums(e){
 				console.log(e)

+ 37 - 41
pages/soldOut/creatOrder.vue

@@ -6,7 +6,7 @@
 				<view class="shelfName">
 					<view>{{nowData.shelfName}}</view>
 				</view>
-				<view v-if="placeTab.length" class="btns" @click="showTab = true">筛选<u-icon size="20" name="arrow-down"></u-icon></view>
+				<view class="btns" @click="showTab = true">筛选<u-icon size="20" name="arrow-down"></u-icon></view>
 			</view>
 			<view class="search flex align_center">
 				<view class="input">
@@ -129,13 +129,13 @@
 		<u-popup v-model="showTab" mode="right" width="70%">
 			<view class="tabBox flex flex_column">
 				<view class="tabs">
-					<view>
-						<view :class="'available'==curType?'active':''" @click="curType=curType=='available'?'':'available'">有可用库存的产品</view>
-						<view :class="'blocked'==curType?'active':''" @click="curType=curType=='blocked'?'':'blocked'">有冻结库存的产品</view>
-					</view>
-					<view class="flex">
-						<view :class="item==curTab?'active':''" v-for="item in placeTab" :key="item" @click="curTab=curTab==item?'':item">{{item}}层</view>
-					</view>
+					<u-checkbox-group wrap @change="checkboxGroupChange">
+						<u-checkbox 
+							v-model="item.checked" 
+							v-for="(item, index) in queryKeys" :key="index" 
+							:name="item.code"
+						>{{item.name}}</u-checkbox>
+					</u-checkbox-group>
 				</view>
 				<view class="btns">
 					<u-button class="handle-btn" shape="circle" size="medium" hover-class="none" @click="handleClear">重置</u-button>
@@ -176,9 +176,7 @@
 				partList: [],
 				allChecked: false,
 				showTab: false,
-				placeTab: [],
-				curTab: '',
-				curType: '',
+				curType: [],
 				customBtnStyle: {  //  自定义按钮样式
 					borderColor: this.$config('primaryColor'),
 					backgroundColor: this.$config('primaryColor'),
@@ -195,6 +193,23 @@
 							backgroundColor: '#dd524d'
 						}
 					}
+				],
+				queryKeys: [
+					{
+						name: '库存充足',
+						code: '1',
+						checked: false
+					},
+					{
+						name: '部分缺货',
+						code: '2',
+						checked: false
+					},
+					{
+						name: '全部缺货',
+						code: '3',
+						checked: false
+					}
 				]
 			}
 		},
@@ -216,7 +231,6 @@
 			this.nowData = JSON.parse(decodeURIComponent(opts.data));
 			this.stockCheckSn = this.nowData.stockCheckSn
 			this.getpartList()
-			this.getShelfPlace()
 			
 			if(this.stockCheckSn){
 				// 获取盘点单明细
@@ -234,6 +248,10 @@
 			uni.$off("resetStockCheck")
 		},
 		methods: {
+			checkboxGroupChange(e) {
+				console.log(e);
+				this.curType = e
+			},
 			// 全选
 			allCheckeChange(e){
 				this.$refs.productList.allSelect(e.value)
@@ -337,26 +355,9 @@
 					})
 				}
 			},
-			// 获取货位号
-			getShelfPlace(flag){
-				getProductPlace({ shelfSn: this.nowData.shelfSn }).then(res => {
-				  if (res.status == 200) {
-					for(let a in res.data){
-						this.placeTab.push(a)
-					}
-					// 排序
-					this.placeTab.sort(function(a,b){ return (a+'').localeCompare(b+'');});
-					if(!flag){
-					  this.curTab = ''
-					}
-				  } else {
-				    this.placeTab = []
-				  }
-				})
-			},
 			handleClear(){
-				this.curTab = ''
-				this.curType = ''
+				this.curType = []
+				this.queryKeys.map(item => item.checked = false)
 				this.clearSearch()
 			},
 			clearSearch(){
@@ -376,7 +377,6 @@
 				    pageSize: this.pageSize,
 					shelfSn: this.nowData.shelfSn,
 					queryWord: this.queryWord,
-					shelfPlaceCodeHead: this.curTab,
 					currQtyFlag: this.curType=='available' ? 1 : '',
 					freezeQtyFlag: this.curType=='blocked' ? 1 : '',
 				}
@@ -385,7 +385,6 @@
 					uni.hideLoading()
 					if(res.status == 200){
 						let list = res.data.list
-						console.log(list)
 						if (list && list.length){
 							// 分页 拼接数据
 							if (_this.pageNo != 1) {
@@ -653,24 +652,21 @@
 	.tabBox{
 		height: 100vh;
 		.tabs{
-			flex-grow: 1;
 			overflow: auto;
 			padding: 20rpx;
 			> view{
 				flex-wrap: wrap;
 				justify-content: space-between;
 				> view{
-					width: 45%;
+					width: 98%;
 					border: 1rpx solid #eee;
 					padding: 15rpx;
 					border-radius: 50rpx;
 					text-align: center;
 					margin-bottom: 15rpx;
-				}
-				.active{
-					border:0;
-					background-color: #0485F6;
-					color: #fff;
+					/deep/ .u-checkbox__label{
+						flex-grow: 1;
+					}
 				}
 				&:first-child{
 					> view{
@@ -681,7 +677,7 @@
 		}
 		.btns{
 			display: flex;
-			padding: 20upx;
+			padding: 40upx 20upx 20upx;
 			justify-content: space-between;
 			.handle-btn {
 				font-size: 28upx;