浏览代码

bug 修复

lilei 3 年之前
父节点
当前提交
e88089d168

+ 1 - 1
pages/common/copyText.vue

@@ -1,5 +1,5 @@
 <template>
-	<text class="copyText" @click="copyText">复制</text>
+	<text class="copyText" @click.stop="copyText">复制</text>
 </template>
 
 <script>

+ 18 - 7
pages/common/productBrand.vue

@@ -3,7 +3,9 @@
 		<view class="brand-header flex justify_between align_center">
 			<text class="brand-picker-btn" @click="onClean">清空</text>
 			<text>产品品牌</text>
-			<text class="brand-picker-btn color-blue" @click="isShow=false">X</text>
+			<text class="brand-picker-btn color-blue" @click="isShow=false">
+				<u-icon name="close"></u-icon>
+			</text>
 		</view>
 		<view class="search-box">
 			<u-search
@@ -24,8 +26,11 @@
 					<view class="item-name">{{item.brandName}}</view>
 					<u-icon v-show="item.brandSn==brandSn" class="item-icon" name="checkbox-mark" :color="$config('primaryColor')" size="28"></u-icon>
 				</view>
-				<view v-if="listData && listData.length == 0">
-					<u-empty text="数据为空" mode="list" :img-width="200" :margin-top="-60"></u-empty>
+				<view v-if="listData && listData.length == 0 && status!='loading'">
+					<u-empty text="没有找到品牌" mode="list" :img-width="150" :margin-top="-60"></u-empty>
+				</view>
+				<view style="padding-bottom: 20upx;">
+					<u-loadmore v-if="totalNum>listData.length || status=='loading'" :status="status" />
 				</view>
 			</view>
 		</scroll-view>
@@ -51,7 +56,9 @@
 				listData: [],
 				queryWord: '',
 				isGobleSearch: false,
-				brandSn: this.itemSn || null
+				brandSn: this.itemSn || null,
+				status: 'loadmore',
+				totalNum: 0
 			}
 		},
 		mounted() {
@@ -60,9 +67,8 @@
 		methods: {
 			// 搜索品牌
 			searchBrand(){
-				if(this.queryWord != ''){
-					this.getBrandList()
-				}
+				this.brandSn = null
+				this.getBrandList()
 			},
 			clearSearch(){
 				this.queryWord = ''
@@ -70,12 +76,16 @@
 				this.getBrandList()
 			},
 			getBrandList(){
+				this.status = "loading"
 				dealerProductBrandQuery({ brandName: this.queryWord }).then(res => {
 					if(res.status == 200 && res.data){
 						this.listData = res.data
+						this.totalNum = res.data.count || 0
 					}else{
 						this.listData = []
+						this.totalNum = 0
 					}
+					this.status = "loadmore"
 				})
 			},
 			//  选择
@@ -86,6 +96,7 @@
 			},
 			// 清空
 			onClean(){
+				this.queryWord = ''
 				this.brandSn = null
 				this.$emit('clean')
 				this.isShow = false

+ 3 - 1
pages/common/productType.vue

@@ -3,7 +3,9 @@
 		<view class="type-header flex justify_between align_center">
 			<text class="type-picker-btn" @click="onClean">清空</text>
 			<text>产品分类</text>
-			<text class="type-picker-btn color-blue" @click="isShow=false">X</text>
+			<text class="type-picker-btn color-blue" @click="isShow=false">
+				<u-icon name="close"></u-icon>
+			</text>
 		</view>
 		<u-row class="choose-info">
 			<u-col :span="3">当前已选:</u-col>

+ 47 - 33
pages/sales/index.vue

@@ -1,48 +1,53 @@
 <template>
 	<view class="sales-warp">
-		<!--销售数据统计 -->
-		<view class="content-data">
-			<view class="date-type">
-				<text v-for="(item, index) in tabNav" :key="index" :class="[index == navInd ? 'active_day' : '']" @click="seleteTime(index)">{{item.name}}</text>
-			</view>
-			<view class="total">
-				<view class="item-box">
-					<u-count-to v-if="navInd==0" :end-val="bizData&&bizData.sales&&(bizData.sales.dayTotalQty || bizData.sales.dayTotalQty==0) ? bizData.sales.dayTotalQty : 0" separator=","></u-count-to>
-					<u-count-to v-if="navInd==1" :end-val="bizData&&bizData.sales&&(bizData.sales.weekSalesQty || bizData.sales.weekSalesQty==0) ? bizData.sales.weekSalesQty : 0" separator=","></u-count-to>
-					<u-count-to v-if="navInd==2" :end-val="bizData&&bizData.sales&&(bizData.sales.monthSalesQty || bizData.sales.monthSalesQty==0) ? bizData.sales.monthSalesQty : 0" separator=","></u-count-to>
-					<view>销售总单量(个)</view>
+		<view id="tjCons">
+			<!--销售数据统计 -->
+			<view class="content-data">
+				<view class="date-type">
+					<text v-for="(item, index) in tabNav" :key="index" :class="[index == navInd ? 'active_day' : '']" @click="seleteTime(index)">{{item.name}}</text>
 				</view>
-				<view class="item-box">
-					<u-count-to v-if="navInd==0" :end-val="bizData&&bizData.sales&&(bizData.sales.dayTotalAmount || bizData.sales.dayTotalAmount==0) ? bizData.sales.dayTotalAmount : 0" separator="," :decimals="2"></u-count-to>
-					<u-count-to v-if="navInd==1" :end-val="bizData&&bizData.sales&&(bizData.sales.weekSalesAmount || bizData.sales.weekSalesAmount==0) ? bizData.sales.weekSalesAmount : 0" separator="," :decimals="2"></u-count-to>
-					<u-count-to v-if="navInd==2" :end-val="bizData&&bizData.sales&&(bizData.sales.monthSalesAmount || bizData.sales.monthSalesAmount==0) ? bizData.sales.monthSalesAmount : 0" separator="," :decimals="2"></u-count-to>
-					<view>销售总金额(¥)</view>
+				<view class="total">
+					<view class="item-box">
+						<u-count-to v-if="navInd==0" :end-val="bizData&&bizData.sales&&(bizData.sales.dayTotalQty || bizData.sales.dayTotalQty==0) ? bizData.sales.dayTotalQty : 0" separator=","></u-count-to>
+						<u-count-to v-if="navInd==1" :end-val="bizData&&bizData.sales&&(bizData.sales.weekSalesQty || bizData.sales.weekSalesQty==0) ? bizData.sales.weekSalesQty : 0" separator=","></u-count-to>
+						<u-count-to v-if="navInd==2" :end-val="bizData&&bizData.sales&&(bizData.sales.monthSalesQty || bizData.sales.monthSalesQty==0) ? bizData.sales.monthSalesQty : 0" separator=","></u-count-to>
+						<view>销售总单量(个)</view>
+					</view>
+					<view class="item-box">
+						<u-count-to v-if="navInd==0" :end-val="bizData&&bizData.sales&&(bizData.sales.dayTotalAmount || bizData.sales.dayTotalAmount==0) ? bizData.sales.dayTotalAmount : 0" separator="," :decimals="2"></u-count-to>
+						<u-count-to v-if="navInd==1" :end-val="bizData&&bizData.sales&&(bizData.sales.weekSalesAmount || bizData.sales.weekSalesAmount==0) ? bizData.sales.weekSalesAmount : 0" separator="," :decimals="2"></u-count-to>
+						<u-count-to v-if="navInd==2" :end-val="bizData&&bizData.sales&&(bizData.sales.monthSalesAmount || bizData.sales.monthSalesAmount==0) ? bizData.sales.monthSalesAmount : 0" separator="," :decimals="2"></u-count-to>
+						<view>销售总金额(¥)</view>
+					</view>
 				</view>
 			</view>
-		</view>
-		<!-- 产品报价及新增销售单 -->
-		<view class="nav-cont flex align_center justify_between">
-			<view class="nav-item" @click="toPage('/pages/sales/productPricing')">
-				<u-image class="nav-pic" style="margin-top: 5upx;" :src="`../../static/${theme}/navIcon/price_icon.png`" width="60" height="60"></u-image>
-				<text class="nav-txt" style="margin-top: 5upx;">产品报价</text>
-			</view>
-			<!-- <view class="nav-item" @click="toPage('/pages/sales/chooseCustomer')">
-				<u-image class="nav-pic" :src="`../../static/${theme}/navIcon/sale_icon.png`" width="70" height="70"></u-image>
-				<text class="nav-txt">新增销售单</text>
-			</view> -->
-			<view class="nav-item" @click="toPage('/pages/webviews/openview?title=产品查询&url=https://jgqp.51cjml.com/h5/#!/')">
-				<u-image class="nav-pic" :src="`../../static/${theme}/navIcon/pfind.png`" width="64" height="64"></u-image>
-				<text class="nav-txt">产品查询</text>
+			<!-- 产品报价及新增销售单 -->
+			<view class="nav-cont flex align_center justify_between">
+				<view class="nav-item" @click="toPage('/pages/sales/productPricing')">
+					<u-image class="nav-pic" style="margin-top: 5upx;" :src="`../../static/${theme}/navIcon/price_icon.png`" width="60" height="60"></u-image>
+					<text class="nav-txt" style="margin-top: 5upx;">产品报价</text>
+				</view>
+				<!-- <view class="nav-item" @click="toPage('/pages/sales/chooseCustomer')">
+					<u-image class="nav-pic" :src="`../../static/${theme}/navIcon/sale_icon.png`" width="70" height="70"></u-image>
+					<text class="nav-txt">新增销售单</text>
+				</view> -->
+				<view class="nav-item" @click="toPage('/pages/webviews/openview?title=产品查询&url=https://jgqp.51cjml.com/h5/#!/')">
+					<u-image class="nav-pic" :src="`../../static/${theme}/navIcon/pfind.png`" width="64" height="64"></u-image>
+					<text class="nav-txt">产品查询</text>
+				</view>
 			</view>
 		</view>
 		<!-- 销售单 -->
 		<view class="sales-list">
 			<view class="title">
-				<text class="title-name">销售单</text>
+				<text class="title-name" @click="$refs.salesList.refash()">
+					销售单 
+					<u-icon name="reload" color="#2979ff" size="28"></u-icon>
+				</text>
 				<view class="title-all" @click="toPage('/pages/sales/list')">查看全部<u-icon name="arrow-right" color="rgb(144, 147, 153)" size="28"></u-icon></view>
 			</view>
 			<!-- 销售单列表 -->
-			<listComponent ref="salesList" height="458" />
+			<listComponent ref="salesList" :height="listHeight" />
 		</view>
 	</view>
 </template>
@@ -62,9 +67,16 @@
 				],
 				navInd: 0,
 				bizData: null, // 销售数据统计
-				theme: ''
+				theme: '',
+				listHeight: 400
 			}
 		},
+		onReady() {
+			const query = uni.createSelectorQuery().in(this);
+			query.select('#tjCons').boundingClientRect(data => {
+			  this.listHeight = data.height
+			}).exec();
+		},
 		onLoad() {
 			const _this = this
 			this.$nextTick(function(){
@@ -109,6 +121,7 @@
 			uni.$off('refreshBL')
 		},
 		onShow() {
+			this.navInd = 0
 			this.getBizData()
 		},
 		methods:{
@@ -125,6 +138,7 @@
 					} else {
 						this.bizData = null
 					}
+					uni.stopPullDownRefresh();
 				})
 			}
 		}

+ 2 - 2
pages/sales/list.vue

@@ -86,7 +86,7 @@
 				this.searchParams = data
 				console.log(this.searchParams,'this.searchParams')
 				this.$nextTick(function(){
-					_this.$refs.salesList.getList(1)
+					_this.$refs.salesList.refash()
 				})
 			},
 			// 状态  change
@@ -96,7 +96,7 @@
 				}else if(type == 'financial'){
 					this.searchParams.financialStatus = this.searchForm.financialStatus
 				}
-				this.$refs.salesList.getList(1)
+				this.$refs.salesList.refash()
 			},
 			// 配送方式
 			getLookUpItem (type) {

+ 37 - 19
pages/sales/listComponent.vue

@@ -3,8 +3,11 @@
 		<scroll-view class="sales-list-con" :style="{height: scrollH+'upx'}" scroll-y @scrolltolower="onreachBottom">
 			<view class="sales-list-main">
 				<view class="sales-list-item" v-for="(item, index) in listData" :key="item.id" @click="getDetail(item)">
-					<view class="list-item-tit">
-						<u-section :title="item.buyerName" :sub-title="item.billStatusDictValue" :line-color="$config('primaryColor')"></u-section>
+					<view class="list-item-tit flex align_center justify_between">
+						<!-- <u-section :title="item.buyerName" :sub-title="item.billStatusDictValue" :line-color="$config('primaryColor')"></u-section> -->
+						<view class="u-line" :style="{background: $config('primaryColor')}"></view>
+						<view class="buyer">{{item.buyerName}}</view>
+						<view>{{item.billStatusDictValue}} <u-icon name="arrow-right" color="#969da3" size="28"></u-icon></view>
 					</view>
 					<view class="list-item-con">
 						<view class="list-item-line flex align_center justify_between">
@@ -34,7 +37,7 @@
 						<u-button @click="handleFun('cancel', item)" size="mini" :hair-line="false" shape="circle" plain type="primary" hover-class="none" v-if="item.salesBillSource == 'PURCHASE' && (item.billStatus == 'WAIT_AUDIT' || item.billStatus == 'SUPERIOR_CHANGE')">取消</u-button>
 					</view> -->
 				</view>
-				<view v-if="listData && listData.length == 0">
+				<view v-if="listData && listData.length == 0 && status!='loading'">
 					<u-empty :text="noDataText" mode="list" :img-width="200" :margin-top="30"></u-empty>
 				</view>
 				<view style="padding-bottom: 20upx;">
@@ -60,7 +63,7 @@
 		components: { commonModal, copyText },
 		props: {
 			height: {  // 非滚动区域高度   upx
-				type: String || Number,
+				type: [String ,Number],
 				default: 300
 			},
 			params: {  // 列表查询条件
@@ -87,17 +90,22 @@
 				scrollH: 300
 			}
 		},
+		watch:{
+			height(a,b){
+				console.log(a)
+				this.scrollH = (uni.getSystemInfoSync().windowHeight - a - 69)*2
+			},
+		},
 		mounted() {
-			const _this = this
-			uni.getSystemInfo({
-				success: function (res) {
-					const winH = res.windowHeight * 2
-					_this.scrollH = winH - _this.height - 85
-				}
-			})
 			this.getList()
+			this.scrollH = (uni.getSystemInfoSync().windowHeight - 85)*2
 		},
 		methods:{
+			refash(){
+				this.listData = []
+				this.totalNum = 0
+				this.getList(1)
+			},
 			// 列表
 			getList(pageNo){
 				const _this = this
@@ -109,6 +117,7 @@
 					pageSize: this.pageSize
 				}
 				this.status = "loading"
+				console.log(Object.assign(params, this.params))
 				salesList(Object.assign(params, this.params)).then(res => {
 					if (res.status == 200) {
 						if(this.pageNo>1){
@@ -198,7 +207,7 @@
 	}
 </script>
 
-<style lang="scss">
+<style lang="less">
 	.sales-list-component{
 		.color_6{
 			color: #666;
@@ -218,16 +227,25 @@
 						padding-bottom: 18upx;
 						padding-top: 10upx;
 						border-bottom: 1px solid #e4e7ed;
-						white-space: nowrap;
-						overflow: hidden;
-						text-overflow: ellipsis;
 						.u-line{
 							display: inline-block;
-							width: 8upx;
-							height: 40upx;
-							background-color: red;
+							width: 6upx;
+							height: 30upx;
 							vertical-align: bottom;
-							margin: 0 20upx 0 10upx;
+							margin: 0 10upx;
+							border-radius: 5upx;
+						}
+						.buyer{
+							flex-grow: 1;
+							font-size: 30upx;
+							font-weight: bold;
+						}
+						>view{
+							&:last-child{
+								width: 150upx;
+								text-align: right;
+								color: #666;
+							}
 						}
 					}
 					.list-item-con{

+ 1 - 0
pages/sales/productPricing.vue

@@ -24,6 +24,7 @@
 						<view class="flex_1">
 							<view class="padding_3">产品编码:{{item.code}} </view>
 							<view class="padding_3">原厂编码:{{(item.origCode&&item.origCode!=' ')?item.origCode:'--'}} </view>
+							<view class="padding_3">品牌:{{item.productBrandName || '--'}} </view>
 							<view class="flex align_center justify_between">
 								<view class="font_13">
 									库存数:<text>{{toThousands(item.stockQty|| 0)}} 个</text>

+ 4 - 0
pages/sales/salesSearch.vue

@@ -34,7 +34,11 @@
 
 <script>
 	import { settleStyleQueryAll } from '@/api/sales'
+	import vSelect from '@/components/select/v-select'
 	export default{
+		components:{
+			vSelect
+		},
 		props: {
 			openModal: { //  弹框显示状态
 				type: Boolean,

+ 53 - 27
pages/stock/detaiList.vue

@@ -6,7 +6,8 @@
 			</view>
 			<view class="st-detailList-info">
 				<view class="st-detailList-tit">
-					<view class="u-line" :style="{backgroundColor: $config('primaryColor')}"></view>{{stockInfo&&stockInfo.productName || '--'}}
+					<!-- <view class="u-line" :style="{backgroundColor: $config('primaryColor')}"></view> -->
+					{{stockInfo&&stockInfo.productName || '--'}}
 				</view>
 				<view class="st-detailList-info-con flex align_center">
 					<view class="pimgs">
@@ -17,13 +18,22 @@
 						<view class="padding_3">原厂编码:{{stockInfo&&stockInfo.productOrigCode || '--'}}</view>
 						<view class="flex align_center justify_between">
 							<view class="font_13">
-								可用数量:{{toThousands(stockInfo&&stockInfo.currentStockQty||0)}}{{stockInfo&&stockInfo.productUnit||''}}
+								可用数量:{{toThousands(stockInfo&&stockInfo.currentStockQty||0)}}{{stockInfo&&stockInfo.productUnit||''}}
 							</view>
 							<view class="font_13">
-								库存成本:
+								可用总成本:
 								¥{{toThousands(stockInfo&&stockInfo.currentStockCost||0, 2)}}
 							</view>
 						</view>
+						<view class="flex align_center justify_between">
+							<view class="font_13">
+								冻结总数量:{{toThousands(stockInfo&&stockInfo.freezeQty||0)}}{{stockInfo&&stockInfo.productUnit||''}}
+							</view>
+							<view class="font_13">
+								冻结总成本:
+								¥{{toThousands(stockInfo&&stockInfo.freezeCost||0, 2)}}
+							</view>
+						</view>
 					</view>
 				</view>
 			</view>
@@ -32,30 +42,40 @@
 		<scroll-view class="st-detailList-con" scroll-y @scrolltolower="onreachBottom">
 			<view class="st-detailList-main">
 				<!-- 库存详情 -->
-				<view v-if="curNow==0" class="st-detailList-main-item" v-for="(item, index) in listData" :key="item.id" @click="getDetail(item)">
-					<view class="flex align_center justify_between margin-b20">
-						<view :style="{color: $config('infoColor')}">{{item.putTime || '--'}}</view>
-						<u-tag v-if="item.putBizTypeDictValue" :text="item.putBizTypeDictValue" :border-color="$config('primaryColor')" shape="circle" size="mini" />
+				<view v-if="curNow==0" class="st-detailList-main-item flex align_center" v-for="(item, index) in listData" :key="item.id" @click="getDetail(item)">
+					<view>
+						<view class="flex align_center justify_between margin-b20">
+							<view :style="{color: $config('infoColor')}">{{item.putTime || '--'}}</view>
+							<u-tag v-if="item.putBizTypeDictValue" :text="item.putBizTypeDictValue" :border-color="$config('primaryColor')" shape="circle" size="mini" />
+						</view>
+						<view class="flex align_center justify_between">
+							<view v-if="item.warehouseName || item.warehouseLocationName">{{item.warehouseName}} > {{item.warehouseLocationName}}</view>
+							<view v-else>--</view>
+							<view>¥{{toThousands(item.putCost||0, 2)}} * {{toThousands(item.currentQty||0)}}{{item.unit}}</view>
+						</view>
 					</view>
-					<view class="flex align_center justify_between">
-						<view v-if="item.warehouseName || item.warehouseLocationName">{{item.warehouseName}} > {{item.warehouseLocationName}}</view>
-						<view v-else>--</view>
-						<view>¥{{toThousands(item.putCost||0, 2)}} * {{toThousands(item.currentQty||0)}}{{item.unit}}</view>
+					<view>
+						<u-icon name="arrow-right" color="#969da3" size="28"></u-icon>
 					</view>
 				</view>
 				<!-- 出入库明细 -->
-				<view v-if="curNow==1" class="st-detailList-main-item" v-for="(item, index) in listData" :key="item.id" @click="getDetail(item)">
-					<view class="flex align_center justify_between margin-b20">
-						<view :style="{color: $config('infoColor')}">{{item.auditTime || '--'}}</view>
-						<u-tag v-if="item.bizTypeDictValue" :text="item.bizTypeDictValue" :border-color="$config('primaryColor')" shape="circle" size="mini" />
-					</view>
-					<view class="flex align_center justify_between">
-						<view>{{item.unitName || '--'}}</view>
-						<view>
-							<view :style="{color: item.qty && item.qty!=0 ? (item.flowType=='PUT' ? 'green':'red'):'', display:'inline-block'}"><text v-if="item.qty && item.qty!=0">{{ item.flowType=='PUT' ? '+':'-' }}</text>{{ toThousands(item.qty||0) }}</view>
-							{{item.product && item.product.unit}}
+				<view v-if="curNow==1" class="st-detailList-main-item flex align_center" v-for="(item, index) in listData" :key="item.id" @click="getDetail(item)">
+					<view>
+						<view class="flex align_center justify_between margin-b20">
+							<view :style="{color: $config('infoColor')}">{{item.auditTime || '--'}}</view>
+							<u-tag v-if="item.bizTypeDictValue" :text="item.bizTypeDictValue" :border-color="$config('primaryColor')" shape="circle" size="mini" />
+						</view>
+						<view class="flex align_center justify_between">
+							<view>{{item.unitName || '--'}}</view>
+							<view>
+								<view :style="{color: item.qty && item.qty!=0 ? (item.flowType=='PUT' ? 'green':'red'):'', display:'inline-block'}"><text v-if="item.qty && item.qty!=0">{{ item.flowType=='PUT' ? '+':'-' }}</text>{{ toThousands(item.qty||0) }}</view>
+								{{item.product && item.product.unit}}
+							</view>
 						</view>
 					</view>
+					<view>
+						<u-icon name="arrow-right" color="#969da3" size="28"></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>
@@ -168,7 +188,7 @@
 	}
 </script>
 
-<style lang="scss">
+<style lang="less">
 	.st-detailList-wrap{
 		width: 100%;
 		height: 100vh;
@@ -189,9 +209,7 @@
 				.st-detailList-tit{
 					padding-bottom: 20upx;
 					border-bottom: 1px solid #e4e7ed;
-					white-space: nowrap;
-					overflow: hidden;
-					text-overflow: ellipsis;
+					font-weight: bold;
 					.u-line{
 						display: inline-block;
 						width: 6upx;
@@ -217,17 +235,25 @@
 			}
 		}
 		.st-detailList-con{
-			height: calc(100vh - 356upx);
+			height: calc(100vh - 370upx);
 			.st-detailList-main{
 				.st-detailList-main-item{
 					background-color: #fff;
 					margin: 0 20upx 10upx;
-					border-radius: 25upx;
+					border-radius: 15upx;
 					box-shadow: 1px 1px 3px #EEEEEE;
 					padding: 20upx 20upx;
 					.margin-b20{
 						margin-bottom: 20upx;
 					}
+					> view{
+						&:first-child{
+							flex-grow: 1;
+						}
+						&:last-child{
+							padding: 0 0 0 20upx;
+						}
+					}
 				}
 			}
 			

+ 60 - 13
pages/stock/index.vue

@@ -1,7 +1,7 @@
 <template>
 	<view class="stock-wrap">
 		<!-- 统计 -->
-		<view class="panel-box">
+		<view class="panel-box" v-if="totalData">
 			<view class="item-box">
 				<u-count-to :end-val="totalData&&totalData.totalCurrentStockQty ? totalData.totalCurrentStockQty : 0" separator=","></u-count-to>
 				<view>库存总数量(个)</view>
@@ -13,8 +13,9 @@
 		</view>
 		<!-- 库存查询 -->
 		<view class="stock-con">
-			<view class="stock-tit">
-				<view class="u-line"></view>库存查询
+			<view class="stock-tit flex align_center">
+				<view class="u-line" :style="{background: $config('primaryColor')}"></view>
+				库存查询
 			</view>
 			<u-form :model="form" ref="uForm" label-width="180">
 				<u-form-item label="产品编码"><u-input v-model.trim="form.productCode" placeholder="请输入产品编码" input-align="right" /></u-form-item>
@@ -22,7 +23,13 @@
 				<u-form-item label="产品名称"><u-input v-model.trim="form.productName" placeholder="请输入产品名称" input-align="right" /></u-form-item>
 				<u-form-item label="产品品牌"><u-input v-model="brandName" @click="brandModal=true" disabled placeholder="请选择产品品牌" input-align="right" /></u-form-item>
 				<u-form-item label="产品分类"><u-input v-model="productTypeNameArr" @click="showTypeModal=true" disabled placeholder="请选择产品分类" input-align="right" /></u-form-item>
+				<u-form-item label="滞销天数">
+					<u-input type="number" :min="0" :max="999999" v-model.trim="form.minUnsalableDays" placeholder="起始天数" input-align="left" />
+					<text style="display: block;text-align: center;line-height: 32px;">至</text>
+					<u-input type="number" :min="0" :max="999999" v-model.trim="form.maxUnsalableDays" placeholder="截止天数" input-align="right" />
+				</u-form-item>
 				<u-form-item label="只查看有库存"><u-switch slot="right" v-model="form.zeroQtyFlag"></u-switch></u-form-item>
+				<u-form-item label="包括禁用产品"><u-switch slot="right" v-model="form.productEnabledFlag"></u-switch></u-form-item>
 			</u-form>
 			<view class="form-footer-btn">
 				<u-button size="medium" shape="circle" hover-class="none" @click="handleClean">清空</u-button>
@@ -53,7 +60,10 @@
 					productTypeSn1: undefined, //  产品分类1
 					productTypeSn2: undefined, //  产品分类2
 					productTypeSn3: undefined, //  产品分类3
-					zeroQtyFlag: false //  库存情况
+					zeroQtyFlag: false ,//  库存情况
+					productEnabledFlag: true, // 显示禁用产品
+					minUnsalableDays: undefined, // 滞销天数最小值
+					maxUnsalableDays: undefined // 滞销天数最大值
 				},
 				totalData: null,
 				brandModal: false,
@@ -79,10 +89,45 @@
 				return str ? str.substr(0, str.length-3) : ''
 			}
 		},
+		watch: {
+		  'form.productEnabledFlag' (newValue, oldValue) {
+		    uni.setStorageSync('productEnabledFlag-' + this.$store.state.vuex_userData.orgId, newValue)
+		  },
+		},
 		onLoad() {
+			// 是否默认包括禁用产品
+			this.form.productEnabledFlag = uni.getStorageSync('productEnabledFlag-' + this.$store.state.vuex_userData.orgId)
 			this.getTotal()
 		},
 		methods: {
+			$message(msg){
+				uni.showToast({
+					icon: 'none',
+					title: msg
+				})
+			},
+			// 校验滞销天数数值范围
+			checkValueRange () {
+			  const a =	!this.form.minUnsalableDays
+			  const b = !this.form.maxUnsalableDays
+			  
+			  if(a && !b){
+				  this.$message('请输入滞销天数的起始天数!')
+				  return false
+			  } 
+			  if(b && !a){
+				  this.$message('请输入滞销天数的截止天数!')
+				  return false
+			  }
+			  console.log(this.form.minUnsalableDays , this.form.maxUnsalableDays,this.form.minUnsalableDays > this.form.maxUnsalableDays)
+			  if (Number(this.form.minUnsalableDays) > Number(this.form.maxUnsalableDays)) {
+			    this.$message('截止天数应大于起始天数!')
+			    return false
+			  }
+			  this.form.minUnsalableDays = this.form.minUnsalableDays > 999999 ? 999999 : this.form.minUnsalableDays
+			  this.form.maxUnsalableDays = this.form.maxUnsalableDays > 999999 ? 999999 : this.form.maxUnsalableDays
+			  return true
+			},
 			// 合计
 			getTotal () {
 				stockCount({}).then(res => {
@@ -109,16 +154,17 @@
 				this.form.productTypeSn2 = undefined
 				this.form.productTypeSn3 = undefined
 				this.form.zeroQtyFlag = false
+				this.queryParam.minUnsalableDays = undefined // 滞销天数最小值
+				this.queryParam.maxUnsalableDays = undefined // 滞销天数最大值
 			},
 			// 查询
 			handleSearch(){
-				let params = JSON.parse(JSON.stringify(this.form))
-				if (params.zeroQtyFlag) {
-					params.zeroQtyFlag = '0'
-				} else {
-					params.zeroQtyFlag = ''
+				if (this.checkValueRange()) {
+					let params = JSON.parse(JSON.stringify(this.form))
+					params.zeroQtyFlag = params.zeroQtyFlag ? '0' : ''
+					params.productEnabledFlag = params.productEnabledFlag ? '' : '1'
+					uni.navigateTo({ url: "/pages/stock/stockSearch?data="+JSON.stringify(params) })
 				}
-				uni.navigateTo({ url: "/pages/stock/stockSearch?data="+JSON.stringify(params) })
 			},
 			// 选择品牌
 			brandChoose(data){
@@ -183,13 +229,14 @@
 			box-shadow: 3upx 2upx 6upx #eee;
 			padding: 20upx;
 			.stock-tit{
+				font-weight: bold;
 				.u-line{
 					display: inline-block;
 					width: 6upx;
-					height: 40upx;
-					background-color: red;
+					height: 30upx;
 					vertical-align: bottom;
-					margin: 0 20upx 0 10upx;
+					margin: 0 10upx;
+					border-radius: 5upx;
 				}
 			}
 			.form-footer-btn{

+ 9 - 4
pages/stock/stockDetail.vue

@@ -2,11 +2,11 @@
 	<view class="stockDetail-wrap">
 		<view class="panel-box flex align_center justify_between">
 			<view class="pimgs">
-				<u-image :src="productData && productData.productMsg||`../../static/${theme}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
+				<u-image :src="productData && productData.productMsg||`../../static/${theme}/def_img@2x.png`" width="120" height="120" border-radius="10"></u-image>
 			</view>
 			<view class="info-con flex_1">
-				<view>{{productData && productData.productCode || '--'}}</view>
 				<view class="padding_7">{{productData && productData.productName || '--'}}</view>
+				<view>{{productData && productData.productCode || '--'}}</view>
 			</view>
 		</view>
 		<view class="stockDetail-info">
@@ -27,12 +27,16 @@
 				<view>{{paramsData && paramsData.putBizTypeDictValue || '--'}}</view>
 			</view>
 			<view class="info-item flex align_center justify_between">
-				<view class="info-name">库存数量</view>
+				<view class="info-name">可用库存数量</view>
 				<view>{{toThousands(paramsData && paramsData.currentQty || 0)}}</view>
 			</view>
+			<view class="info-item flex align_center justify_between">
+				<view class="info-name">冻结库存数量</view>
+				<view>{{toThousands(paramsData && paramsData.freezeQty || 0)}}</view>
+			</view>
 			<view class="info-item flex align_center justify_between">
 				<view class="info-name">成本单价</view>
-				<view>{{toThousands(paramsData && paramsData.putCost || 0, 2)}}</view>
+				<view>{{toThousands(paramsData && paramsData.putCost || 0, 2)}}</view>
 			</view>
 		</view>
 	</view>
@@ -75,6 +79,7 @@
 				margin-left: 20upx;
 				.padding_7{
 					padding: 14upx 0 0;
+					font-size: 28upx;
 				}
 			}
 		}

+ 68 - 17
pages/stock/stockSearch.vue

@@ -19,7 +19,7 @@
 		<scroll-view class="stockSearch-con" scroll-y @scrolltolower="onreachBottom">
 			<view class="stockSearch-main">
 				<view class="stockSearch-main-item" v-for="(item, index) in listData" :key="item.id" @click.stop="getDetail(item)">
-					<view class="stockSearch-tit flex">
+					<view class="stockSearch-tit flex align_center">
 						<!-- <view class="u-line" :style="{backgroundColor: $config('primaryColor')}"></view> -->
 						<view class="u-name">
 							{{item.productName}}
@@ -34,15 +34,24 @@
 						</view>
 						<view class="flex_1">
 							<view>产品编码:{{item.productCode || '--'}}</view>
-							<view class="padding_3">原厂编码:{{item.productOrigCode || '--'}}</view>
-							<view class="flex align_center justify_between">
-								<view class="font_13">
-									可用数量:{{toThousands(item.currentStockQty||0)}}{{item.productUnit}}
-								</view>
-								<view class="font_13">
-									库存成本:
-									¥{{toThousands(item.currentStockCost||0, 2)}}
-								</view>
+							<view class="padding_3">原厂编码:{{item.productOrigCode && item.productOrigCode !== ' '? item.productOrigCode : '--'}}</view>
+						</view>
+					</view>
+					<view class="stockSearch-item-footer flex align_center justify_between">
+						<view class="font_13">
+							可用库存数量
+							<view>{{toThousands(item.currentStockQty||0)}}{{item.productUnit}}</view>
+						</view>
+						<view class="font_13">
+							可用库存成本
+							<view>¥{{toThousands(item.currentStockCost||0, 2)}}</view>
+						</view>
+						<view class="font_13">
+							滞销天数
+							<view>
+								<span v-if="item.unsalableDays>=180&&item.unsalableDays<=360" style="color:#FF9900">{{ num(item.unsalableDays) }}</span>
+								<span v-else-if="item.unsalableDays>360" style="color:#FF0000">{{ num(item.unsalableDays) }}</span>
+								<span v-else >{{ num(item.unsalableDays) }}</span>
 							</view>
 						</view>
 					</view>
@@ -84,6 +93,26 @@
 			this.getList()
 		},
 		methods: {
+			// 格式化滞销天数为几个月零几天
+			num (val) {
+			  let days
+			  if (val != null && val != undefined) {
+			    if (val >= 30) {
+			      const a = Math.floor(val / 30)
+			      const b = val - a * 30
+			      if (b > 0) {
+			        days = a + '个月' + b + '天'
+			      } else {
+			        days = a + '个月'
+			      }
+			    } else {
+			      days = val + '天'
+			    }
+			  } else {
+			    days = '--'
+			  }
+			  return days
+			},
 			// 列表
 			getList(pageNo){
 				const _this = this
@@ -150,7 +179,7 @@
 	}
 </script>
 
-<style lang="scss">
+<style lang="less">
 	.stockSearch-wrap{
 		width: 100%;
 		height: 100vh;
@@ -177,9 +206,12 @@
 				.stockSearch-main-item{
 					background: #ffffff;
 					padding: 20upx;
-					margin-bottom: 25upx;
+					margin: 20upx;
 					border-radius: 25upx;
 					box-shadow: 1px 1px 3px #EEEEEE;
+					&:first-child{
+						margin-top: 0;
+					}
 					.stockSearch-tit{
 						padding-bottom: 20upx;
 						border-bottom: 1px solid #e4e7ed;
@@ -195,18 +227,37 @@
 							vertical-align: bottom;
 							margin: 0 20upx 0 10upx;
 						}
+						.u-name{
+							flex-grow: 1;
+							width: 80%;
+						}
+						.u-last{
+							width: 100upx;
+							text-align: center;
+						}
 					}
 					.stockSearch-item-con{
-						padding: 20upx 20upx 6upx;
-						font-size: 26upx;
+						padding: 20upx;
+						font-size: 28upx;
 						.pimgs{
 							margin-right: 16upx;
 						}
-						.font_13{
-							font-size: 26upx;
-						}
 						.padding_3{
 							padding: 6upx 0;
+							word-break: break-all;
+						}
+					}
+					.stockSearch-item-footer{
+						border-top: 2upx solid #eee;
+						.font_13{
+							width: 33%;
+							font-size: 26upx;
+							text-align: center;
+							border-left: 2upx solid #eee;
+							padding-top: 20upx;
+							&:first-child{
+								border: 0;
+							}
 						}
 					}
 				}

+ 10 - 2
pages/stock/warehouseDetail.vue

@@ -46,6 +46,10 @@
 				<view class="info-name">批次号</view>
 				<view>{{paramsData && paramsData.stockBatchNo || '--'}}</view>
 			</view>
+			<view class="info-item flex align_center justify_between">
+				<view class="info-name">关联单据号</view>
+				<view>{{paramsData && paramsData.bizNo || '--'}}</view>
+			</view>
 			<view class="info-item flex align_center justify_between">
 				<view class="info-name">仓库</view>
 				<view>{{paramsData && paramsData.warehouseName || '--'}}</view>
@@ -56,11 +60,15 @@
 			</view>
 			<view class="info-item flex align_center justify_between">
 				<view class="info-name">总成本</view>
-				<view>{{toThousands(paramsData && paramsData.totalCost || 0, 2)}}</view>
+				<view>{{toThousands(paramsData && paramsData.totalCost || 0, 2)}}</view>
 			</view>
 			<view class="info-item flex align_center justify_between">
 				<view class="info-name">总售价</view>
-				<view>{{toThousands(paramsData && paramsData.totalPrice || 0, 2)}}</view>
+				<view>¥{{toThousands(paramsData && paramsData.totalPrice || 0, 2)}}</view>
+			</view>
+			<view class="info-item flex align_center justify_between">
+				<view class="info-name">出入库状态</view>
+				<view>{{paramsData && paramsData.stateDictValue || '--'}}</view>
 			</view>
 		</view>
 	</view>