chenrui 2 rokov pred
rodič
commit
55c45d1385

+ 76 - 53
pages/shuntBackManage/addBackOrder.vue

@@ -1,34 +1,82 @@
 <template>
 	<view class="modal-box">
-		<view class="header_box">
-			<view class="headerName u-flex">
-				<text class="barBox"></text>
-				<view class="shelfName u-line-1">{{ shelfName }}</view>
-				<view class="screeningBox" @click="chooseShow = true">
-					<text>滞销天数</text>
-					<u-icon color="#666666" size="36" name="shaixuan" custom-prefix="iscm-icon"></u-icon>
-				</view>
-			</view>
-			<view class="searchBox">
-				<view class="searchBox_l">
-					<u-search
-						placeholder="请输入产品编码或产品名称搜索"
-						@change="getSearchCon"
-						@search="getSearchCon"
-						@custom="getSearchCon"
-						@clear="clearSearch"
-						v-model="keyword"
-						bg-color="#FFF"
-						shape="round"
-						:show-action="false"
-					></u-search>
-				</view>
-				<view class="searchBox_r" @click="handleScanCode"><u-icon name="scan"></u-icon></view>
+		<view class="headerName u-flex">
+			<text class="barBox"></text>
+			<view class="shelfName u-line-1">{{ shelfName }}</view>
+			<view class="screeningBox" @click="chooseShow = true">
+				<text>滞销天数</text>
+				<u-icon color="#666666" size="36" name="shaixuan" custom-prefix="iscm-icon"></u-icon>
 			</view>
 		</view>
 		<view class="backOrderCon">
 			<scroll-view scroll-y class="scroll-view" v-if="recallBillList && recallBillList.length>0" >
-				
+				<div class="cpb_cart-list">
+					<view 
+					v-for="(item, index) in recallBillList" 
+					:key="'cpb_'+item.id" 
+					>
+					<view class="nav-right-item flex align_center">
+						<view class="uni-col-1" @click="delDetail(item,index)">
+							<u-icon name="close-circle" color="#999" size="35"></u-icon>
+						</view>
+						<view class="uni-col-9 flex">
+							<view class="item-imgs">
+								<u-image :src="item.productImageUrl?item.productImageUrl:`../../static/${$config('themePath')}/def_img@2x.png`" width="120" height="120" border-radius="10"></u-image>
+							</view>
+							<view class="item-info">
+								<view class="item-name">
+									<text>{{item.shelfPlaceCode}}</text>
+									{{item.productCode}}
+								</view>
+								<view class="item-name">
+									{{item.productName}}
+								</view>
+								<view class="item-detail">
+									<view class="item-detail-info align_center flex justify_between">
+										<view></view>
+										<view class="flex justify_end">
+											<view class="item-detail-text">
+											最大库容:<text class="pnums">{{item.maxQty||0}}</text>
+											货架库存:<text class="pnums">{{item.qty||0}}</text>
+											门店库存:<text class="pnums">{{item.qplsStockQty||0}}</text>
+											</view>
+										</view>
+									</view>
+								</view>
+							</view>
+						</view>
+					</view>
+					<view class="nav-right-item">
+						<view class="item-detail">
+							<view class="item-detail-info">
+								<view class="flex justify_between">
+									<view class="item-detail-text flex">
+										<view v-if="item.replenishBillQty">补货在途:<text class="pnums1">{{item.replenishBillQty||0}}</text></view>
+										<view v-if="item.recallBillQty">调回在途:<text class="pnums1">{{item.recallBillQty||0}}</text></view>
+									</view>
+									 <view class="item-detail-text">
+										补货数量:
+										<u-number-box 
+										v-model="item.replenishQty" 
+										:index="'cart_'+item.id" 
+										:min="1"
+										@change="numsChange(item)"
+										:max="999999"></u-number-box>
+									 </view>
+								</view>
+							</view>
+						</view>
+					</view>
+				</view>
+				<view v-if="recallBillList.length==0">
+					<view class="nodata">
+						暂无产品,请点击 
+						<view>
+							<text @click="toChooseProduct">选择产品</text>
+						</view>
+					</view>
+				</view>
+				</div>
 			</scroll-view>
 			<u-empty :src="`/static/${$config('themePath')}/def_no_data@3x.png`" icon-size="200" :text="noDataText" img-width="120" v-else></u-empty>
 		</view>
@@ -43,10 +91,10 @@
 						<text>{{chooseArr.length}}</text>
 					</view>
-					<!-- <view class="middle_r" @click="seeDetail">
+					<view class="middle_r" @click="seeDetail">
 						<text>查看明细</text>
 						<u-icon name="arrow-up" color="#999" size="28"></u-icon>
-					</view> -->
+					</view>
 				</view>
 				<view class="footerBox_r"><u-button type="primary" shape="circle"  @click="addBackOrder">确定</u-button></view>
 			</view>
@@ -66,15 +114,12 @@
 				</view>
 			</view>
 		</u-popup>
-		<!-- 查看明细弹窗 -->
-		<detailModal ref="detailPopup" @clearList='clearOneList' @clearAllList="clearAll" @changeNumRecount="recount" :detailShow="detailFlag" :chooseData="chooseArr"  @close="detailFlag=false"></detailModal>
 	</view>
 </template>
 
 <script>
 import { reportPage } from '@/api/vinLog';
 import { controlQueryList,insert } from '@/api/shelf';
-import detailModal from './detailModal'
 import productList from './productList.vue'
 export default {
 	components: {
@@ -401,10 +446,6 @@ export default {
 	width: 100%;
 	height: 100vh;
 	box-sizing: border-box;
-	.header_box {
-		width: 100%;
-		height: 142rpx;
-		padding: 0 20rpx 20rpx;
 		.headerName {
 			padding-bottom: 15rpx;
 			color: #222;
@@ -429,25 +470,7 @@ export default {
 					vertical-align: top;
 				}
 			}
-		}
-		.searchBox {
-			width: 100%;
-			display: flex;
-			align-items: center;
-			padding: 0 20rpx;
-			border: 1rpx solid #e0e0e0;
-			border-radius: 50rpx;
-			box-sizing: border-box;
-			.searchBox_l {
-				width: 87%;
-			}
-			.searchBox_r {
-				width: 13%;
-				text-align: right;
-				font-size: 46rpx;
-				color: #999;
-			}
-		}
+		
 	}
 	.backOrderCon {
 		width: 100%;

+ 0 - 43
pages/shuntBackManage/addShuntBack.vue

@@ -1,43 +0,0 @@
-<template>
-	<view class="shuntBackList">
-		<view class="check-list">
-			<productList ref="productList" noDataText="暂无产品" @updateNums="updateNums" @allChecked="allCheckedCallback"></productList>
-		</view>
-		<view class="backOrderFooter u-flex u-row-between">
-			<view class="footerBox_m u-flex">
-				<view class="middle_l">
-					已选
-					<text>{{chooseArr.length}}</text>
-					款/
-					<text>{{totalNum}}</text>
-					件
-				</view>
-				<view class="middle_r" @click="seeDetail">
-					<text>查看明细</text>
-					<u-icon name="arrow-up" color="#999" size="28"></u-icon>
-				</view>
-			</view>
-			<view class="footerBox_r"><u-button type="primary" shape="circle"  @click="addBackOrder">新增调回单</u-button></view>
-		</view>
-	</view>
-</template>
-
-<script>
-	import productList from './productList.vue'
-	export default{
-		components: {
-			productList
-		},
-		data(){
-			return{
-				
-			}
-		},
-		methods:{
-			
-		}
-	}
-</script>
-
-<style>
-</style>

+ 412 - 0
pages/shuntBackManage/chooseProduct.vue

@@ -0,0 +1,412 @@
+<template>
+	<view class="content flex flex_column">
+		<view class="searchBar">
+			<view class="p-title flex align_center">
+				<text></text>
+				<view class="shelfName">
+					<view>{{nowData.shelfName}}</view>
+				</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">
+					<u-search 
+					v-model="queryWord" 
+					@custom="getpartList" 
+					@search="getpartList" 
+					@clear="clearSearch" 
+					@input="$u.debounce(changeSearch, 800)"
+					bg-color="#fff" 
+					:show-action="false"
+					placeholder="请输入产品编码或名称搜索"></u-search>
+				</view>
+				<view class="icon" @click="toScan">
+					<u-icon name="scan"></u-icon>
+				</view>
+			</view>
+		</view>
+		<view class="check-list">
+			<productList ref="productList" noDataText="暂无产品" @updateNums="updateNums" @allChecked="allCheckedCallback"></productList>
+		</view>
+		<!-- 底部栏 -->
+		<view class="footer-bar flex align_center" v-if="partList.length">
+			<view class="f-left">
+				<u-checkbox size="40" @change="allCheckeChange" v-model="allChecked" shape="circle">{{allChecked?'取消全选':'全选'}}</u-checkbox>
+			</view>
+			<view class="f-mid">
+				<view v-if="totalCategory">
+					已选<text>{{totalCategory}}</text>款产品
+				</view>
+			</view>
+			<view class="f-btns">
+				<u-button size="medium" @click="submitOrder" :custom-style="customBtnStyle" shape="circle" type="primary" hover-class="none" >确定选择</u-button>
+			</view>
+		</view>
+		<!-- 筛选项 -->
+		<u-popup v-model="showTab" mode="right" width="70%">
+			<view class="tabBox flex flex_column">
+				<view class="tabs">
+					<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>
+					<u-button class="handle-btn" shape="circle" size="medium" hover-class="none" :custom-style="customBtnStyle" @click="changeSearch">查询</u-button>
+				</view>
+			</view>
+		</u-popup>
+	</view>
+</template>
+
+<script>
+	import { queryProductListForReplenish } from '@/api/shelf'
+	import { saveMainAndDetail } from '@/api/shelfReplenish'
+	import productList from './productList.vue'
+	import { clzConfirm } from '@/libs/tools'
+	export default {
+		components: {
+			productList
+		},
+		data() {
+			return {
+				queryWord: '',
+				nowData:null,
+				detail:null,
+				pageNo:1,
+				pageSize: 20,
+				total: 0, // 列表总数
+				noDataText: '暂无产品',
+				status: 'loading',
+				partList: [],
+				allChecked: false,
+				showTab: false,
+				customBtnStyle: {  //  自定义按钮样式
+					borderColor: this.$config('primaryColor'),
+					backgroundColor: this.$config('primaryColor'),
+					color: '#fff'
+				},
+				orderTotal: 0,
+				chooseList: [],
+				tempData: null,
+				queryKeys: [
+					{
+						name: '库存充足',
+						code: 'stockEnough',
+						checked: false
+					},
+					{
+						name: '部分缺货',
+						code: 'portionStockout',
+						checked: false
+					},
+					{
+						name: '全部缺货',
+						code: 'allStockout',
+						checked: false
+					}
+				],
+				stockStateList:[]
+			}
+		},
+		onNavigationBarButtonTap(e) {
+			if(e.index == 0){
+				uni.navigateTo({
+					url: '/pages/stockCheck/checkRecord?shelfSn='+this.nowData.shelfSn
+				})
+			}
+		},
+		onBackPress(e) {
+		  if(this.showTab) {  
+			this.showTab = false;
+			return true;  
+		  } 
+		},
+		onLoad(opts) {
+			this.nowData = JSON.parse(decodeURIComponent(opts.data));
+			this.getpartList()
+		},
+		computed: {
+			totalCategory () {
+			  return this.chooseList.length
+			},
+		},
+		methods: {
+			checkboxGroupChange(e) {
+				console.log(e);
+				this.stockStateList = e
+			},
+			// 全选
+			allCheckeChange(e){
+				this.$refs.productList.allSelect(e.value)
+				this.chooseList = this.$refs.productList.getAllChecked()
+			},
+			allCheckedCallback(val){
+				this.allChecked = val
+				this.chooseList = this.$refs.productList.getAllChecked()
+			},
+			// 创建补货单
+			creatOrder(data){
+				uni.showLoading({
+					title:"正在保存.."
+				})
+				stockCheckSave({
+					 shelfSn: this.nowData.shelfSn,
+					 totalCategory: this.nowData.totalCategory,
+					 totalStockQty: this.nowData.totalStockQty,
+					 totalFreezeQty: this.nowData.totalFreezeQty
+				}).then(res => {
+					 if(res.status == 200){
+						 this.detail = res.data || null
+						 this.stockCheckSn = res.data.stockCheckSn
+					 }else{
+						 uni.hideLoading()
+					 }
+				})
+			},
+			// 清空已选数据
+			clearChoose(){
+				this.chooseList = []
+				this.allChecked = false
+				if(this.$refs.productList){
+					this.$refs.productList.allSelect(false)
+				}
+			},
+			updateNums(){
+				this.chooseList = this.$refs.productList.getAllChecked()
+			},
+			clearSearch(){
+				this.queryWord = ''
+				this.changeSearch()
+			},
+			handleClear(){
+				this.stockStateList = []
+				this.queryKeys.map(item => item.checked = false)
+				this.changeSearch()
+			},
+			changeSearch(){
+				this.pageNo = 1
+				this.partList = []
+				this.getpartList()
+			},
+			// 获取数字货架列表
+			getpartList(){
+				const _this = this
+				let params = {
+					shelfSn: this.nowData.shelfSn,
+					queryWord: this.queryWord,
+					stockStateList: this.stockStateList
+				}
+				_this.clearChoose()
+				_this.partList = []
+				_this.$refs.productList && _this.$refs.productList.setData(_this.partList)
+				_this.status = 'loading'
+				uni.showLoading({
+					mask:true,
+					title:"正在加载..."
+				})
+				queryProductListForReplenish(params).then(res => {
+					if(res.status == 200){
+						let list = res.data
+						if (list && list.length){
+							_this.partList = list
+						} else {
+							_this.partList = list || []
+						}
+					}else{
+						_this.partList = []
+					}
+					this.showTab = false
+					// 赋值
+					if(_this.nowData.chooseKey.length){
+						_this.partList = _this.partList.filter(item => {
+							const row = _this.nowData.chooseKey.findIndex(k => k == item.id)
+							return !(row>=0)
+						})
+					}
+					this.$refs.productList.setData(_this.partList)
+					setTimeout(()=>{
+						uni.hideLoading()
+					},_this.partList.length*40)
+				})
+			},
+			// 提交
+			submitOrder(){
+				if(this.totalCategory){
+					uni.$emit("chooseDbhProduct",this.chooseList)
+					uni.navigateBack()
+				}else{
+					uni.showToast({
+						icon: 'none',
+						title: '请选择产品'
+					})
+				}
+			},
+			// 扫描
+			toScan(){
+				this.mpaasScanModule = uni.requireNativePlugin("wss-scan")
+				this.mpaasScanModule.scan(
+				{
+					"scanMode":"Customized",
+					"scanStyle":{
+						"scanFrameSizePlus":{"width":250,"height":250},
+						"scanFrameSize":200,
+						"scanLight":"visible",
+						"scanText":"对准条形码/二维码进行识别",
+						"scanTitle":"扫码搜索货位产品",
+					}
+				},
+				(result) => {
+					if(result.scanStatus == 1){
+						this.scanResult(result)
+					}
+				})
+			},
+			// 扫描结果
+			scanResult(data){
+				// 二维码
+				if(data.scanType == 'QRCODE'){
+					const ret = data.scanValue.split("&")
+					this.queryWord = ret[1] // 产品编码
+				}else{
+					this.queryWord = data.scanValue
+				}
+				this.stockStateList = []
+				this.getpartList()
+			}
+		}
+	}
+</script>
+
+<style lang="less">
+.content{
+	height: 100vh;
+	width: 100%;
+	background: #fff;
+	.searchBar{
+		padding: 0 0.8rem 0.3rem;
+		.p-title{
+			padding: 0 15rpx;
+			display: flex;
+			align-items: center;
+			color: #222;
+			font-size: 30rpx;
+			> text{
+					display: block;
+					height: 30rpx;
+					width: 6rpx;
+					background: #0485F6;
+					margin-right: 10rpx;
+					border-radius: 10rpx;
+				}
+			.shelfName{
+				flex-grow: 1;
+				font-weight: bold;
+				width: 80%;
+				> view{
+					overflow: hidden;
+					white-space: nowrap;
+					text-overflow: ellipsis;
+				}
+			}
+			.btns{
+				width:100rpx;
+				text-align: right;
+				font-size: 28rpx;
+				color: #0485F6;
+			}
+		}
+		.search{
+			margin-top: 15upx;
+			padding: 0.1rem;
+			border-radius: 50rpx;
+			border:1rpx solid #eee;
+			.input{
+				flex-grow: 1;
+				padding: 4rpx;
+			}
+			.icon{
+				width: 13%;
+				text-align: center;
+				font-size: 46rpx;
+				color: #999;
+			}
+		}
+	}
+	.check-list{
+		padding: 0 0.8rem;
+		flex-grow: 1;
+		overflow: auto; 
+	 }
+	.footer-bar{
+		background-color: #f8f8f8;
+		padding: 20upx;
+		.f-left{
+			color: #fff;
+		}
+		.active{
+			background-color: #0485F6;
+		}
+		.f-mid{
+			flex-grow: 1;
+			color: #666;
+			> view{
+				padding: 0 5upx;
+				&:first-child{
+					text{
+						color: red;
+					}
+				}
+				&:last-child{
+					font-size: 0.8rem;
+				}
+			}
+		}
+		.f-btns{
+			button{
+				width: 200upx;
+			}
+		}
+	}
+	// 筛选
+	.tabBox{
+		height: 100vh;
+		.tabs{
+			overflow: auto;
+			padding: 20rpx;
+			> view{
+				flex-wrap: wrap;
+				justify-content: space-between;
+				> view{
+					width: 98%;
+					border: 1rpx solid #eee;
+					padding: 15rpx;
+					border-radius: 50rpx;
+					text-align: center;
+					margin-bottom: 15rpx;
+					/deep/ .u-checkbox__label{
+						flex-grow: 1;
+					}
+				}
+				&:first-child{
+					> view{
+						width: 100%;
+					}
+				}
+			}
+		}
+		.btns{
+			display: flex;
+			padding: 40upx 20upx 20upx;
+			justify-content: space-between;
+			.handle-btn {
+				font-size: 28upx;
+			}
+		}
+	}
+}
+</style>

+ 0 - 233
pages/shuntBackManage/detailModal.vue

@@ -1,233 +0,0 @@
-<template>
-	<u-popup v-model="isShow" mode="bottom" height="800" border-radius="25">
-		<view class="head u-flex u-row-between">
-			<text>已选产品</text>
-			<text @click="clearAllList">清空列表</text>
-		</view>
-		<scroll-view scroll-y class="scroll-view" v-if="list.length>0">
-			<view class="partList-list-box" v-for="(con,i) in list" :key="con.id">
-				<view class="product flex align_center">
-					<view class="checkbox" @click="clearList(con.id,i)">
-						<u-icon name="close-circle" color="#999" size="40"></u-icon>
-					</view>
-					<view class="checkboxRight flex align_center flex_1">
-						<view class="pimgs">
-							<u-image :src="con.productImageUrl?con.productImageUrl:`../../static/${$config('themePath')}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
-						</view>
-						<view class="pinfo">
-							<view class="pname">
-								<text>{{con.shelfPlaceCode}}</text>
-								{{con.productCode}}
-							</view>
-							<view class="productName u-line-1">
-								{{con.productName}}
-							</view>
-							<view class="ptxt flex align_center">
-								<view>
-									最大库容
-									<text class="pnums">{{con.maxQty}}</text>
-								</view>
-								<view>
-									/货架库存
-									<text class="pnums">{{con.qty}}</text>
-								</view>
-								<view>
-									/滞销
-									<text class="pnums">{{!con.unsalableDays || (con.unsalableDays&& con.unsalableDays == 0) ?'--天':con.unsalableDays}}</text>
-								</view>
-							</view>
-						</view>
-					</view>
-				</view>
-				<view class="ptools flex align_center justify_between">
-					<view class="ptools_l u-flex">
-						<view v-if="con.replenishBillQty && con.replenishBillQty!=0">
-							补货在途
-							<text class="pnums">{{con.replenishBillQty}}</text>
-						</view>
-						<view v-if="con.recallBillQty && con.recallBillQty!=0">
-							{{con.replenishBillQty && con.replenishBillQty!=0 ? '/':''}}调回在途
-							<text class="pnums">{{con.recallBillQty}}</text>
-						</view>
-					</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="1" :max="con.qty" @minus="minus" @plus="plus" @change="change"></u-number-box></view>
-					</view>
-				</view>
-			</view>
-		</scroll-view>
-		<u-empty :src="`/static/${$config('themePath')}/def_no_data@3x.png`" icon-size="200" text="暂无选中回调单" img-width="120" v-else></u-empty>
-	</u-popup>
-</template>
-
-<script>
-	export default {
-		props: {
-			detailShow: { //  弹框显示状态
-				type: Boolean,
-				default: false
-			},
-			chooseData:{
-				type: Array,
-				default:()=>[]
-			}
-		},
-		data() {
-			return {
-				isShow:this.detailShow,
-				list:[]
-			}
-		},
-		methods: {
-			clearList(id,i){
-				this.list.splice(i,1);
-				this.$emit("clearList",id)
-				 if(this.list.length == 0){
-					  this.$emit('close')
-				 }
-			},
-			clearAllList(){
-				this.list = [];
-				 this.$emit("clearAllList")
-				 this.$emit('close')
-			},
-			
-			minus(){
-				this.$emit("changeNumRecount")
-			},
-			plus(){
-				this.$emit("changeNumRecount")
-			},
-			change(){
-				this.$emit("changeNumRecount")
-			}
-		},
-		watch: {
-			//  父页面传过来的弹框状态
-			detailShow (newValue, oldValue) {
-				this.isShow = newValue
-			},
-			//  重定义的弹框状态
-			isShow (newValue, oldValue) {
-				if (!newValue) {
-					this.$emit('close')
-				}else{
-					this.list = this.chooseData
-				}
-			}
-		}
-	}
-</script>
-
-<style lang="less" scoped>
-	.head{
-		width: 100%;
-		box-sizing: border-box;
-		padding:30rpx 20rpx;
-		background: #e0e0e0;
-		text{
-			&:first-child{
-				font-weight: bold;
-			}
-		}
-	}
-	.scroll-view{
-		height: 584rpx;
-	}
-	.partList-list-box {
-		padding: 20rpx;
-		border-bottom: 2rpx solid #f5f5f5;
-		&:last-child {
-			border: 0;
-		}
-		.product {
-			flex-grow: 1;
-			.checkbox {
-				width: 60rpx;
-			}
-			.checkboxRight{
-				width: calc(100% - 60rpx);
-			}
-			.pinfo {
-				width: calc(100% - 148rpx);
-				flex-grow: 1;
-				padding-left: 20rpx;
-				.pname {
-					font-size: 32rpx;
-					color: #191919;
-					margin-bottom: 10rpx;
-					text {
-						font-weight: normal;
-						margin-right: 6rpx;
-						padding: 0 10rpx;
-						background: rgba(3, 54, 146, 0.15);
-						border-radius: 100rpx;
-						color: #033692;
-						font-size: 28rpx;
-					}
-				}
-				.productName{
-					width: 100%;
-					font-size: 32rpx;
-					color: #191919;
-					font-weight: bold;
-					margin:10rpx 0;
-				}
-				.pno {
-					background-color: rgba(3, 54, 146, 0.15);
-					border-radius: 50rpx;
-					padding: 0 20rpx;
-					color: #033692;
-					font-size: 24rpx;
-					margin-right: 10rpx;
-				}
-				.ptxt {
-					font-size: 24rpx;
-					color: #999;
-					.pnums {
-						color: #222;
-						padding: 0 4upx;
-					}
-				}
-			}
-		}
-		.ptools {
-			margin-top: 30rpx;
-			margin-left: 60rpx;
-			.ptools_l{
-				font-size: 24rpx;
-				color: #999;
-				.pnums {
-					color: #ff5500;
-					padding: 0 4rpx;
-				}
-			}
-			.pcurnums {
-				> text {
-					font-size: 24rpx;
-					color: #999;
-					margin-right: 20rpx;
-				}
-			}
-			.u-ninput {
-				border: 2rpx solid #eee;
-				border-radius: 50rpx;
-				padding: 0 6rpx;
-			}
-			/deep/ .u-icon-disabled {
-				background: #fff !important;
-			}
-			/deep/ .u-number-input {
-				margin: 0 0;
-				border: 2rpx solid #eee;
-				border-top: 0;
-				border-bottom: 0;
-			}
-			/deep/ .u-icon-plus,
-			/deep/ .u-icon-minus {
-				border-radius: 50rpx;
-			}
-		}
-	}
-</style>

+ 228 - 0
pages/shuntBackManage/productList.vue

@@ -0,0 +1,228 @@
+<template>
+	<view class="partList-box flex flex_column">
+		<view class="partList-list">
+			<view class="partList-list-box" v-for="item in partList" :key="item.productSn">
+				<view class="product flex align_center">
+					<view class="checkbox">
+						<u-checkbox v-model="item.checked" :name="item.productSn" @change="checkChange" size="40" shape="circle"></u-checkbox>
+					</view>
+					<view class="flex align_center flex_1" @click="checkChange({name:item.productSn})">
+						<view class="pimgs">
+							<u-image :src="item.productImageUrl?item.productImageUrl:`../../static/${$config('themePath')}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
+						</view>
+						<view class="pinfo">
+							<view class="pname">
+								<text>{{item.shelfPlaceCode}}</text>
+								{{item.productCode}}
+							</view>
+							<view class="pname pname1">
+								{{item.productName}}
+							</view>
+						</view>
+					</view>
+				</view>
+				<view class="ptxt flex align_center justify_end">
+					<view>
+					最大库容:<text class="pnums">{{item.maxQty||0}}</text>
+					货架库存:<text class="pnums">{{item.qty||0}}</text>
+					门店库存:<text class="pnums">{{item.qplsStockQty||0}}</text>
+					</view>
+				</view>
+				<view class="ptools flex align_center justify_between">
+					<view class="flex align_center">
+						<view v-if="item.replenishBillQty">
+							补货在途:<text class="pnums">{{item.replenishBillQty||0}}</text>
+						</view>
+						<view v-if="item.recallBillQty">
+							调回在途:<text class="pnums">{{item.recallBillQty||0}}</text>
+						</view>
+					</view>
+					<view class="pcurnums flex align_center flex">
+						<!-- <text>补货数量</text>
+						<view class="u-ninput">
+							<u-number-box 
+							color="#000" 
+							@minus="updateNums" 
+							@plus="updateNums" 
+							@blur="updateNums" 
+							:long-press="false" 
+							:input-height="60" 
+							bg-color="#fff" 
+							v-model="item.replenishQty" 
+							:min="1"></u-number-box>
+						</view> -->
+					</view>
+				</view>
+			</view>
+			<view class="nodata" v-if="partList.length==0">
+				<u-empty :src="`/static/${$config('themePath')}/def_no_data@3x.png`" icon-size="120" :text="noDataText" img-width="120" mode="list"></u-empty>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		props: {
+			list: {
+				type: Array,
+				default: function(){
+					return []
+				}
+			},
+			noDataText: {
+				type: String,
+				default: '暂无产品'
+			},
+			title: {
+				type: String,
+				default: '列表'
+			},
+			// model: checkbox 可选择模式,view 只显示
+			model: {
+				type: String,
+				default: 'checkbox'
+			},
+		},
+		data() {
+			return {
+				partList: [],
+			}
+		},
+		methods: {
+			setData(list){
+				list.map(item => {
+					item.replenishQty = item.replenishBillWaitQty || 1
+				})
+				this.partList = list
+			},
+			// 全选
+			allSelect(val){
+				this.partList.map(item => {
+					item.checked = val
+				})
+				this.partList.splice()
+			},
+			setChecked(id,val){
+				const row = this.partList.find(item => item.id == id)
+				row.checked = val
+				this.partList.splice()
+			},
+			checkChange(e){
+				const row = this.partList.find(item => item.productSn == e.name)
+				if(row){
+					row.checked = !row.checked
+					this.partList.splice()
+				}
+				// 判断是否全选
+				const isAllNoChecked = this.partList.filter(item => !item.checked)
+				this.$emit('allChecked',isAllNoChecked.length == 0)
+			},
+			// 获取所有选择的
+			getAllChecked(){
+				const newArr = []
+				this.partList.map(item => {
+					if(item.checked){
+						newArr.push(item)
+					}
+				})
+				return newArr
+			},
+			// 获取所有数据
+			getAllData(){
+				return this.partList
+			},
+			updateNums(e){
+				this.$emit("updateNums",e)
+			},
+			// 更新数量
+			changeNums(id,val){
+				const row = this.partList.find(item => item.id == id)
+				row.replenishQty = val
+				this.partList.splice()
+			}
+		}
+	}
+</script>
+
+<style lang="less" scoped>
+.partList-box{
+	height: 100%;
+	position: relative;
+	.nodata{
+		padding: 10vh 0;
+	}
+	.partList-list{
+		flex-grow: 1;
+	}
+	.partList-list-box{
+		padding: 10px 0;
+		border-bottom: 2rpx solid #f5f5f5;
+		.product{
+			flex-grow: 1;
+			.checkbox{
+				width: 60rpx;
+			}
+			.pinfo{
+				flex-grow: 1;
+				padding-left: 20rpx;
+				.pname{
+					color: #191919;
+					margin-bottom: 5rpx;
+					text{
+						font-weight: normal;
+						margin-right: 10rpx;
+						padding: 0 10rpx;
+						background: rgba(3, 54, 146, 0.15);
+						border-radius: 30rpx;
+						color: #033692;
+						font-size: 24rpx;
+					}
+				}
+				.pname1{
+					font-size: 28rpx;
+				}
+			}
+		}
+		.ptxt{
+			font-size: 26rpx;
+			color: #999;
+			.pnums{
+				color: #222;
+				margin-right: 20upx;
+			}
+		}
+		.ptools{
+			font-size: 26rpx;
+			margin-top: 10rpx;
+			color: #999;
+			.pnums{
+				color: #ff5500;
+				margin-right: 20upx;
+			}
+			.pcurnums{
+				> text{
+					margin-right: 20rpx;
+				}
+			}
+			.u-ninput{
+				border: 2rpx solid #eee;
+				border-radius: 50rpx;
+				padding: 0 6rpx;
+			}
+			/deep/ .u-icon-disabled{
+				background: #fff!important;
+			}
+			/deep/ .u-number-input{
+				margin: 0 0;
+				border: 2rpx solid #eee;
+				border-top: 0;
+				border-bottom: 0;
+			}
+			/deep/ .u-icon-plus, /deep/ .u-icon-minus{
+				border-radius: 50rpx;
+			}
+		}
+	}
+}
+</style>