Просмотр исходного кода

Merge branch 'develop_szhj' of http://git.chelingzhu.com/jianguan-web/qpls-md-app into develop_szhj

zhangdan 3 лет назад
Родитель
Сommit
444f02bcc7
4 измененных файлов с 71 добавлено и 24 удалено
  1. 5 0
      App.vue
  2. 13 6
      pages/common/printTag/printTag.vue
  3. 52 17
      pages/sales/chooseProduct.vue
  4. 1 1
      pages/sales/list.vue

+ 5 - 0
App.vue

@@ -211,4 +211,9 @@
 	    -webkit-flex: 1;
 	    flex: 1;    
 	}
+	// ios15原生input的type=search时会默认自带搜索图标。
+	// 在全局的公共样式隐藏ios自带搜索图标即可
+	[type="search"]::-webkit-search-decoration {
+		display: none;
+	}
 </style>

+ 13 - 6
pages/common/printTag/printTag.vue

@@ -16,8 +16,8 @@
 			<view>{{fromPage == 'smdy'?'实发':'库存'}}数量:{{fromPage == 'smdy'?infoData.confirmQty : infoData.qty}}</view>
 		</view>
 		<view class="buttons flex align_center justify_center">
-			<view v-if="fromPage == 'bdtq'"><u-button @click="cansel" shape="circle" plain>返回列表</u-button></view>
-			<view v-if="fromPage == 'smdy'"><u-button @click="cansel" shape="circle" plain>重新扫描</u-button></view>
+			<view v-if="fromPage == 'bdtq'"><u-button @click="cancel" shape="circle" plain>返回列表</u-button></view>
+			<view v-if="fromPage == 'smdy'"><u-button @click="cancel" shape="circle" plain>重新扫描</u-button></view>
 			<view>
 				<kk-printer ref="kkprinter" @startPrint="startPrint"></kk-printer>
 			</view>
@@ -60,12 +60,19 @@
 		},
 		// 监听页面返回,返回 event = {from:backbutton、 navigateBack} ,backbutton 表示来源是左上角返回按钮或 android 返回键;navigateBack表示来源是 uni.navigateBack
 		onBackPress(event){
-			this.cansel()
+			if(event.from == 'backbutton'){
+				this.cancel()
+				return true  // 阻止默认返回行为(会导致无限循环)
+			}
 		},
 		methods: {
-			cansel(){
-				uni.$emit('refreshBL')
-				uni.navigateBack()
+			cancel(){
+				if(this.fromPage == 'bdtq'){  // 补打贴签
+					uni.navigateBack({delta: 1})
+				}else if(this.fromPage == 'smdy'){  // 扫码打印
+					uni.$emit('refreshBL')
+					uni.navigateBack({delta: 1})
+				}
 			},
 			// 获取打印内容
 			getPrintContent(){

+ 52 - 17
pages/sales/chooseProduct.vue

@@ -2,38 +2,41 @@
 	<view class="chooseProduct-wrap">
 		<!-- 标题 -->
 		<u-navbar title="选择产品" :safeAreaInsetTop="false" :border-bottom="true">
-			<view class="u-nav-slot" slot="right" style="padding-right: 30rpx;">
+			<view class="u-nav-slot" slot="right" style="padding-right: 40rpx;">
 				<u-icon name="search" color="#999" size="28" @click="openModal=true"></u-icon>查询
 			</view>
 		</u-navbar>
 		<!-- 产品列表 -->
 		<view class="product-list-box">
-			<scroll-view class="sales-list-con" :style="{height: scrollH+'upx'}" scroll-y @scrolltolower="onreachBottom">
-				<view class="sales-list-item border-b font_13 flex justify_between" v-for="(item, index) in listData" :key="item.id">
-					<view class="pimgs">
+			<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="list-item-tit">
+						<u-section :title="item.productName":right="false" :line-color="$config('primaryColor')"></u-section>
+					</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>
-					<view class="sales-item-main flex_1">
-						<view class="sales-item-name">{{item.productName || '--'}}</view>
-						<view class="sales-item-txt flex align_center justify_between">
+					<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 v-if="pageData.type=='edit'" @click="handleDel(item)" name="trash-fill" :color="$config('errorColor')" size="34"></u-icon>
+							<u-icon @click="handleDel(item)" name="trash-fill" :color="$config('errorColor')" size="34"></u-icon>
 						</view>
-						<view class="sales-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="sales-item-txt flex align_center justify_between">
-							<view class="sales-item-priceInfo">
+						<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>
-							<view class="sales-item-price">¥{{toThousands(item.totalAmount||0, 2)}}</view>
+							<view class="product-item-price">¥{{toThousands(item.totalAmount||0, 2)}}</view>
 						</view>
-						<view class="sales-item-price">折后¥{{toThousands(item.discountedAmount||0, 2)}}</view>
-					</view>
+						<view class="product-item-price">折后¥{{toThousands(item.discountedAmount||0, 2)}}</view>
+					</view> -->
 				</view>
 				<view v-if="listData && listData.length == 0">
 					<u-empty :text="noDataText" mode="list" :img-width="200" :margin-top="30"></u-empty>
@@ -48,6 +51,7 @@
 <script>
 	import ProductSearch from './productSearch.vue'
 	import { toThousands } from '@/libs/tools'
+	import { querySumByProductLocation } from '@/api/stock'
 	export default{
 		components: { ProductSearch },
 		data(){
@@ -94,10 +98,41 @@
 				const _this = this
 				this.searchParams = Object.assign(params, this.searchForm)
 				this.$nextTick(function(){
-					// _this.$refs.salesList.getList(1)
+					// _this.$refs.productList.getList(1)
 				})
 			},
-			getList(){}
+			// 列表
+			getList(pageNo){
+				const _this = this
+				if (pageNo) {
+					this.pageNo = pageNo
+				}
+				let params = {
+					pageNo: this.pageNo,
+					pageSize: this.pageSize
+				}
+				querySumByProductLocation(Object.assign(params, this.params)).then(res => {
+					if (res.status == 200) {
+						if(this.pageNo>1){
+							this.listData = this.listData.concat(res.data.list || [])
+						}else{
+							this.listData = res.data.list || []
+						}
+						this.totalNum = res.data.count || 0
+					} else {
+						this.listData = []
+						this.totalNum = 0
+						this.noDataText = res.message
+					}
+				})
+			},
+			// scroll-view到底部加载更多
+			onreachBottom() {
+				if(this.listData.length < this.totalNum){
+					this.pageNo += 1
+					this.getList()
+				}
+			},
 		}
 	}
 </script>
@@ -105,7 +140,7 @@
 <style lang="scss">
 	.chooseProduct-wrap{
 		width: 100%;
-		.list-box{
+		.product-list-box{
 			padding: 20upx 20upx;
 		}
 	}

+ 1 - 1
pages/sales/list.vue

@@ -2,7 +2,7 @@
 	<view class="sales-list-wrap">
 		<!-- 标题 -->
 		<u-navbar title="销售单" :safeAreaInsetTop="false" :border-bottom="true">
-			<view class="u-nav-slot" slot="right" style="padding-right: 30rpx;">
+			<view class="u-nav-slot" slot="right" style="padding-right: 40rpx;">
 				<u-icon name="search" color="#999" size="28" @click="openModal=true"></u-icon>查询
 			</view>
 		</u-navbar>