Browse Source

bug 修复

lilei 3 years ago
parent
commit
794e61b1bf
3 changed files with 32 additions and 14 deletions
  1. 19 8
      pages/sales/chooseProduct.vue
  2. 2 2
      pages/sales/productSearch.vue
  3. 11 4
      pages/sales/selectedProductsModal.vue

+ 19 - 8
pages/sales/chooseProduct.vue

@@ -19,8 +19,7 @@
 							</view>
 						</view>
 						<view class="list-item-btn">
-							<u-icon class="item-btn-add" v-if="!item.saleQty" name="plus-circle" :color="$config('primaryColor')" size="40" @click="handleAdd(item, 'add')"></u-icon>
-							<u-tag v-else text="已添加" type="info" mode="light" shape="circle" size="mini" style="vertical-align: text-top;" />
+							<u-icon class="item-btn-add" name="plus-circle" :color="$config('primaryColor')" size="42" @click="handleAdd(item, 'add')"></u-icon>
 						</view>
 					</view>
 					<view class="list-item-footer flex align_center justify_between">
@@ -38,7 +37,7 @@
 						</view>
 						<view class="footer-item">
 							<view>
-								<text :style="{color: $config('errorColor')}">{{toThousands(item.price||0, 2)}}</text>
+								<text :style="{color: $config('errorColor')}">{{toThousands(item.price||0, 2)}}</text>
 								<text v-if="item.origSalePriceFlag == 1">(原)</text>
 							</view>
 							<view class="color_6">参考售价</view>
@@ -48,6 +47,9 @@
 				<view v-if="listData && listData.length == 0">
 					<u-empty :text="noDataText" mode="list" :img-width="200" :margin-top="30"></u-empty>
 				</view>
+				<view style="padding-bottom: 20upx;">
+					<u-loadmore v-if="totalNum>listData.length || status=='loading'" :status="status" />
+				</view>
 			</scroll-view>
 		</view>
 		<!-- 合计 -->
@@ -86,6 +88,7 @@
 				pageNo: 1,
 				pageSize: 6,
 				totalNum: 0,
+				status: 'loadmore',
 				noDataText: '暂无数据',
 				searchParams: null,
 				openModal: false,
@@ -107,6 +110,9 @@
 		onNavigationBarButtonTap(e){  // 标题栏 按钮操作
 			this.openModal = true
 		},
+		onBackPress() {
+			uni.$emit("refreshBL")
+		},
 		onLoad(opt) {
 			this.theme = getApp().globalData.theme
 			if(opt){
@@ -164,6 +170,7 @@
 					searchParams.cost = undefined
 					searchParams.cityPrice = undefined
 				}
+				this.status = "loading"
 				querySumByProductLocation(Object.assign(params, searchParams, { customerSn: this.salesInfo.buyerSn, salePriceType: this.salesInfo.priceType, salesBillSn: this.salesInfo.salesBillSn })).then(res => {
 					if (res.status == 200) {
 						if(res.data && res.data.list){
@@ -184,6 +191,7 @@
 						this.totalNum = 0
 						this.noDataText = res.message
 					}
+					this.status = "loadmore"
 				})
 			},
 			// scroll-view到底部加载更多
@@ -228,7 +236,9 @@
 			},
 			// 选好了
 			handleChoose(){
-				uni.redirectTo({ url: '/pages/sales/edit?pageType=edit&data='+JSON.stringify(this.detailData) })
+				// uni.redirectTo({ url: '/pages/sales/edit?pageType=edit&data='+JSON.stringify(this.detailData) })
+				uni.$emit("refreshBL")
+				uni.navigateBack()
 			},
 			// 查看已选产品
 			lookProduct(){
@@ -431,6 +441,8 @@
 	.chooseProduct-wrap{
 		width: 100%;
 		position: relative;
+		height: 100vh;
+		overflow: hidden;
 		.padding_3{
 			padding: 6upx 0;
 		}
@@ -438,7 +450,7 @@
 			color: #666;
 		}
 		.product-list-box{
-			padding: 20upx 20upx;
+			padding: 14upx 20upx;
 			.product-list-con{
 				.product-list-item{
 					background: #ffffff;
@@ -465,9 +477,8 @@
 							margin-right: 16upx;
 						}
 						.list-item-btn{
-							.item-btn-add{
-								padding: 30upx 30upx;
-							}
+							width: 10%;
+							text-align: center;
 						}
 					}
 					.list-item-footer{

+ 2 - 2
pages/sales/productSearch.vue

@@ -37,8 +37,8 @@
 				</u-form-item>
 			</u-form>
 			<view class="uni-list-btns">
-				<u-button class="handle-btn" size="medium" hover-class="none" @click="resetForm">重置</u-button>
-				<u-button class="handle-btn search-btn" size="medium" hover-class="none" :custom-style="customBtnStyle" @click="handleSearch">查询</u-button>
+				<u-button class="handle-btn" size="medium" hover-class="none" shape="circle" @click="resetForm">重置</u-button>
+				<u-button class="handle-btn search-btn" size="medium" shape="circle" hover-class="none" :custom-style="customBtnStyle" @click="handleSearch">查询</u-button>
 			</view>
 		</u-popup>
 		<!-- 产品品牌 -->

+ 11 - 4
pages/sales/selectedProductsModal.vue

@@ -5,26 +5,29 @@
 			<scroll-view class="product-list-con" scroll-y @scrolltolower="onreachBottom">
 				<view class="product-list-item flex align_center justify_between" v-for="(item, index) in listData" :key="item.id">
 					<view class="product-item-main font_13 flex_1" @click="handleEdit(item)">
+						<view class="product-item-name">{{item.productName || '--'}}</view>
 						<view class="flex align_center justify_between">
 							<view>{{item.productCode || '--'}}</view>
 							<view class="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>
 							<u-tag v-if="item.oosFlag==1" text="急件" type="error" mode="light" shape="circle" size="mini" style="vertical-align: text-top;" />
 						</view>
-						<view class="product-item-name">{{item.productName || '--'}}</view>
 						<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="display: inline-block;margin: 0 10upx;">X</text> 
 							<text style="font-size: 30upx;">{{toThousands(item.qty||0)}}</text>
 							{{item.productUnit}}
 						</view>
 					</view>
 					<view class="btn-box">
-						<u-icon @click="handleDel(item, index)" name="trash-fill" :color="$config('errorColor')" size="34"></u-icon>
+						<u-icon @click="handleDel(item, index)" name="trash" :color="$config('errorColor')" size="34"></u-icon>
 					</view>
 				</view>
 				<view v-if="listData && listData.length == 0">
 					<u-empty :text="noDataText" mode="list" :img-width="200" :margin-top="30"></u-empty>
 				</view>
+				<view style="padding: 20upx;">
+					<u-loadmore v-if="totalNum>listData.length || status=='loading'" :status="status" />
+				</view>
 			</scroll-view>
 			<!-- 合计 -->
 			<view ref="productTotal" class="selected-box flex align_center justify_between">
@@ -66,6 +69,7 @@
 				pageSize: 6,
 				totalNum: 0,
 				noDataText: '暂无数据',
+				status: 'loadmore',
 				toThousands,
 				theme: '',
 				commonModal: false,
@@ -88,6 +92,7 @@
 					pageSize: this.pageSize,
 					salesBillSn: this.nowData && this.nowData.salesBillSn
 				}
+				this.status = "loading"
 				salesDetailList(params).then(res => {
 					if (res.status == 200) {
 						if(res.data && res.data.list){
@@ -110,6 +115,7 @@
 						this.totalNum = 0
 						this.noDataText = res.message
 					}
+					this.status = "loadmore"
 				})
 			},
 			// scroll-view到底部加载更多
@@ -179,7 +185,7 @@
 			box-sizing: border-box;
 			.product-list-item{
 				border-bottom: 1px solid #e4e7ed;
-				padding: 10upx 0;
+				padding: 20upx 0;
 				.product-item-main{
 					.product-item-name{
 						padding: 6upx 0;
@@ -189,6 +195,7 @@
 						-webkit-line-clamp: 1;
 						line-clamp: 1;
 						-webkit-box-orient: vertical;
+						font-weight: bold;
 					}
 				}
 				.btn-box{