chenrui 3 years ago
parent
commit
05e2c69df3
3 changed files with 126 additions and 28 deletions
  1. 11 0
      api/stock.js
  2. 9 0
      pages.json
  3. 106 28
      pages/sales/chooseProduct.vue

+ 11 - 0
api/stock.js

@@ -40,4 +40,15 @@ export const stockFlowList = (params) => {
     data: params,
     method: 'post'
   })
+}
+//  库存 详情列表  分页
+export const querySumByProductLocation = (params) => {
+  const url = `stock/detail/querySumByProductLocation/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  })
 }

+ 9 - 0
pages.json

@@ -216,6 +216,15 @@
 				"enablePullDownRefresh": false
 			}
 		},
+		{
+			"path": "pages/sales/chooseProduct", // 选择产品
+			"style": {
+				"navigationBarTitleText": "选择产品",
+				"enablePullDownRefresh": false,
+				"navigationStyle":"custom",
+				"navigationBarTextStyle": "white"
+			}
+		},
 		{
 			"path": "pages/sales/chooseCustomer", // 销售单  选择客户
 			"style": {

+ 106 - 28
pages/sales/chooseProduct.vue

@@ -9,40 +9,50 @@
 		<!-- 产品列表 -->
 		<view class="product-list-box">
 			<scroll-view class="product-list-con" :style="{height: scrollH+'upx'}" scroll-y @scrolltolower="onreachBottom">
-				<view class="product-list-item border-b font_13 flex justify_between" v-for="(item, index) in listData" :key="item.id">
+				<view class="product-list-item font_13" v-for="(item, index) in listData" :key="item.id">
 					<view class="list-item-tit">
-						<u-section :title="item.productName":right="false" :line-color="$config('primaryColor')"></u-section>
+						<view class="item-tit ellipsis-one" :style="{borderColor: $config('primaryColor')}">{{item.productName}}</view>
 					</view>
-					<!-- <view class="pimgs">
-						<u-image :src="item.productMainMsg?item.productMainMsg:`../../static/${theme}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
-						<view v-if="item.oosFlag == 1" class="sign" :style="{backgroundColor: $config('errorColor')}">急</view>
-						<view v-if="item.price < item.cost" class="sign" :style="{backgroundColor: $config('errorColor')}">亏</view>
-						<view v-if="item.price == 0" class="sign" :style="{backgroundColor: $config('errorColor')}">赠</view>
+					<view class="list-item-con flex align_center justify_between">
+						<view class="pimgs">
+							<u-image :src="item.productMainPic&&item.productMainPic.imageUrl?item.productMainPic.imageUrl:`../../static/${theme}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
+						</view>
+						<view class="flex_1">
+							<view>产品编码:{{item.productCode || '--'}}</view>
+							<view class="padding_3 flex align_center justify_between">
+								<view>原厂编码:{{item.productOrigCode || '--'}}</view>
+								<u-icon name="plus-circle" :color="$config('primaryColor')" size="40" class="close-circle" @click="clearWarehouse"></u-icon>
+							</view>
+							<view v-if="item.warehouseName || item.warehouseLocationName">仓库仓位:{{item.warehouseName}} > {{item.warehouseLocationName}}</view>
+						</view>
 					</view>
-					<view class="product-item-main flex_1">
-						<view class="product-item-name">{{item.productName || '--'}}</view>
-						<view class="product-item-txt flex align_center justify_between">
-							<view>{{item.productCode || '--'}}</view>
-							<u-icon @click="handleDel(item)" name="trash-fill" :color="$config('errorColor')" size="34"></u-icon>
+					<view class="list-item-footer flex align_center justify_between">
+						<view class="footer-item">
+							<view>{{toThousands(item.currentQty||0)}}{{item.unit}}</view>
+							<view class="color_6">库存数量</view>
 						</view>
-						<view class="product-item-txt color_6" style="font-size: 24upx;" v-if="item.warehouseEntity&&item.warehouseEntity.name || item.warehouseLocationEntity&&item.warehouseLocationEntity.name">{{item.warehouseEntity&&item.warehouseEntity.name}} > {{item.warehouseLocationEntity&&item.warehouseLocationEntity.name}}</view>
-						<view class="product-item-txt flex align_center justify_between">
-							<view class="product-item-priceInfo">
-								<view :style="{color: $config('errorColor'), display: 'inline-block'}">¥<text style="font-size: 30upx;">{{toThousands(item.price||0, 2)}}</text></view>
-								<text style="display: inline-block;margin: 0 10upx;">*</text> 
-								<text style="font-size: 30upx;">{{toThousands(item.qty||0)}}</text>
-								{{item.productUnit}}
+						<view class="footer-item">
+							<view>
+								<text :style="{color: $config('errorColor')}">{{toThousands((item.lastSalePrice ? item.lastSalePrice : item.salePrice)||0, 2)}}</text>
+								<text v-if="item.origSalePriceFlag == 1">(原)</text>
 							</view>
-							<view class="product-item-price">¥{{toThousands(item.totalAmount||0, 2)}}</view>
+							<view class="color_6">参考售价</view>
 						</view>
-						<view class="product-item-price">折后¥{{toThousands(item.discountedAmount||0, 2)}}</view>
-					</view> -->
+					</view>
 				</view>
 				<view v-if="listData && listData.length == 0">
 					<u-empty :text="noDataText" mode="list" :img-width="200" :margin-top="30"></u-empty>
 				</view>
 			</scroll-view>
 		</view>
+		<!-- 已选产品 -->
+		<view ref="productTotal" class="selected-box flex align_center justify_between">
+			<view class="choose-info flex_1 flex align_center justify_between" @click="lookProduct">
+				<text>已选 3 款,合计 ¥96.00</text>
+				<u-icon name="arrow-up" :color="$config('primaryColor')" size="34" class="close-circle"></u-icon>
+			</view>
+			<view class="choose-btn" @click="handleChoose" :style="{backgroundColor: $config('primaryColor')}">选好了</view>
+		</view>
 		<!-- 查询右侧弹框 -->
 		<productSearch :openModal="openModal" :defaultParams="searchForm" @refresh="refresh" @close="openModal=false" />
 	</view>
@@ -84,11 +94,10 @@
 			this.getList()
 			
 			const _this = this
-			let footerH = _this.$refs.productTotal && _this.$refs.productTotal.$el && _this.$refs.productTotal.$el.offsetHeight || 0
 			uni.getSystemInfo({
 				success: function (res) {
 					const winH = res.windowHeight * 2
-					_this.scrollH = winH - footerH - 85
+					_this.scrollH = winH - 200
 				}
 			})
 		},
@@ -97,9 +106,7 @@
 			refresh(params){
 				const _this = this
 				this.searchParams = Object.assign(params, this.searchForm)
-				this.$nextTick(function(){
-					// _this.$refs.productList.getList(1)
-				})
+				this.getList(1)
 			},
 			// 列表
 			getList(pageNo){
@@ -111,7 +118,7 @@
 					pageNo: this.pageNo,
 					pageSize: this.pageSize
 				}
-				querySumByProductLocation(Object.assign(params, this.params)).then(res => {
+				querySumByProductLocation(Object.assign(params, this.searchParams)).then(res => {
 					if (res.status == 200) {
 						if(this.pageNo>1){
 							this.listData = this.listData.concat(res.data.list || [])
@@ -133,6 +140,12 @@
 					this.getList()
 				}
 			},
+			// 选好了
+			handleChoose(){},
+			// 查看已选产品
+			lookProduct(){
+				
+			}
 		}
 	}
 </script>
@@ -140,8 +153,73 @@
 <style lang="scss">
 	.chooseProduct-wrap{
 		width: 100%;
+		position: relative;
+		.padding_3{
+			padding: 6upx 0;
+		}
+		.color_6{
+			color: #666;
+		}
 		.product-list-box{
 			padding: 20upx 20upx;
+			.product-list-con{
+				.product-list-item{
+					background: #ffffff;
+					padding: 20upx 20upx 0;
+					margin-bottom: 25upx;
+					border-radius: 25upx;
+					box-shadow: 1px 1px 3px #EEEEEE;
+					.list-item-tit{
+						padding-bottom: 12upx;
+						border-bottom: 1px solid #e4e7ed;
+						.item-tit{
+							font-weight: bold;
+							color: rgb(48, 49, 51);
+							font-size: 28upx;
+							padding-left: 10upx;
+							border-left: 6upx solid #000;
+							line-height: 1;
+						}
+					}
+					.list-item-con{
+						padding: 14upx 14upx 16upx;
+						font-size: 26upx;
+						.pimgs{
+							margin-right: 16upx;
+						}
+					}
+					.list-item-footer{
+						border-top: 1px solid #e4e7ed;
+						.footer-item{
+							width: 50%;
+							text-align: center;
+							border-right: 1px solid #e4e7ed;
+							font-size: 26upx;
+							padding: 8upx 0 12upx;
+						}
+						.footer-item:last-child{
+							border: none;
+						}
+					}
+				}
+			}
+		}
+		.selected-box{
+			position: fixed;
+			bottom: 0;
+			left: 0;
+			width: 100%;
+			background-color: #fff;
+			box-shadow: 1px -1px 3px #EEEEEE;
+			.choose-info{
+				padding: 0 30upx;
+			}
+			.choose-btn{
+				color: #fff;
+				width: 28%;
+				padding: 26upx 0;
+				text-align: center;
+			}
 		}
 	}
 </style>