Browse Source

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

lilei 3 years ago
parent
commit
7eb902f577

+ 34 - 0
api/sales.js

@@ -0,0 +1,34 @@
+import axios from '@/libs/axios.js'
+
+// 数据统计信息
+export const bizData = (params) => {
+  return axios.request({
+    url: `home/queryBizData`,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 销售单列表
+export const salesList = (params) => {
+  const url = `sales/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}
+
+// 产品报价列表
+export const dealerProductList = (params) => {
+  const url = `dealerProduct/queryPage/${params.pageNo}/${params.pageSize}`
+  delete params.pageNo
+  delete params.pageSize
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'post'
+  })
+}

+ 23 - 0
libs/tools.js

@@ -1,6 +1,29 @@
 let carmera = uni.requireNativePlugin('ziteng-maskcamera')
 let carmera = uni.requireNativePlugin('ziteng-maskcamera')
 let cameraModule = uni.requireNativePlugin("SMUniPlugin-CameraModule")
 let cameraModule = uni.requireNativePlugin("SMUniPlugin-CameraModule")
 
 
+// 处理数字千位分隔符  num 数值,decimal要保留的小数位数
+export const toThousands = (num, decimal) => {
+  if (decimal) {
+    num = formatDecimal(num, decimal)
+  }
+  return num.toString().replace(/\d+/, function (n) { // 先提取整数部分
+    return n.replace(/(\d)(?=(\d{3})+$)/g, function ($1) {
+      return $1 + ','
+    })
+  })
+}
+// 保留decimal位小数(不四舍五入)  num 数值,decimal要保留的小数位数
+export const formatDecimal = function (num, decimal) {
+  num = num.toString()
+  const index = num.indexOf('.')
+  if (index !== -1) {
+    num = num.substring(0, decimal + index + 1)
+  } else {
+    num = num.substring(0)
+  }
+  return parseFloat(num).toFixed(decimal)
+}
+
 export function objToUrl(obj) {
 export function objToUrl(obj) {
   let uri = '';
   let uri = '';
   let keys = Object.keys(obj);
   let keys = Object.keys(obj);

+ 31 - 12
pages.json

@@ -192,6 +192,20 @@
 				"navigationBarTitleText": "出入库明细",
 				"navigationBarTitleText": "出入库明细",
 				"enablePullDownRefresh": false
 				"enablePullDownRefresh": false
 			}
 			}
+		},
+		{
+			"path": "pages/sales/index", // 销售
+			"style": {
+				"navigationBarTitleText": "销售",
+				"enablePullDownRefresh": false
+			}
+		},
+		{
+			"path": "pages/sales/productPricing", // 产品报价
+			"style": {
+				"navigationBarTitleText": "产品报价",
+				"enablePullDownRefresh": false
+			}
 		}
 		}
     ],
     ],
 	"globalStyle": {
 	"globalStyle": {
@@ -208,17 +222,22 @@
 	"tabBar": {
 	"tabBar": {
 		"fontSize": "14px",
 		"fontSize": "14px",
 		"list": [
 		"list": [
-		{
-			"pagePath": "pages/stock/index",
-			"text": "库存"
-		},
-		{
-			"pagePath": "pages/index/index",
-			"text": "首页"
-		},
-		{
-			"pagePath": "pages/userCenter/index",
-			"text": "我的"
-		}]
+			{
+				"pagePath": "pages/sales/index",
+				"text": "销售"
+			},
+			{
+				"pagePath": "pages/stock/index",
+				"text": "库存"
+			},
+			{
+				"pagePath": "pages/index/index",
+				"text": "首页"
+			},
+			{
+				"pagePath": "pages/userCenter/index",
+				"text": "我的"
+			}
+		]
 	}
 	}
 }
 }

+ 6 - 1
pages/index/index.vue

@@ -43,11 +43,16 @@
 			})
 			})
 			uni.setTabBarItem({
 			uni.setTabBarItem({
 			  "index": 1,
 			  "index": 1,
+			  "iconPath": "static/"+theme+"/tabbar/stock.png",
+			  "selectedIconPath": "static/"+theme+"/tabbar/stock-active.png",
+			})
+			uni.setTabBarItem({
+			  "index": 2,
 			  "iconPath": "static/"+theme+"/tabbar/home.png",
 			  "iconPath": "static/"+theme+"/tabbar/home.png",
 			  "selectedIconPath": "static/"+theme+"/tabbar/home-active.png",
 			  "selectedIconPath": "static/"+theme+"/tabbar/home-active.png",
 			})
 			})
 			uni.setTabBarItem({
 			uni.setTabBarItem({
-			  "index": 2,
+			  "index": 3,
 			  "iconPath": "static/"+theme+"/tabbar/user.png",
 			  "iconPath": "static/"+theme+"/tabbar/user.png",
 			  "selectedIconPath": "static/"+theme+"/tabbar/user-active.png",
 			  "selectedIconPath": "static/"+theme+"/tabbar/user-active.png",
 			})
 			})

+ 223 - 0
pages/sales/index.vue

@@ -0,0 +1,223 @@
+<template>
+	<view class="sales-content">
+		<!--销售数据统计 -->
+		<view class="content-data">
+			<view class="date-type">
+				<text :class="['type',timeType=='day' ? 'active_day' : '']" @click="seleteTime(0)">今日</text>
+				<text :class="['type',timeType=='week' ? 'active_day' : '']" @click="seleteTime(1)">本周</text>
+				<text :class="['type',timeType=='mounth' ? 'active_day' : '']" @click="seleteTime(2)">本月</text>
+			</view>
+			<view class="total">
+				<view class="item-box">
+					<u-count-to  :end-val="salesCount" separator=","></u-count-to>
+					<view>销售总单量(个)</view>
+				</view>
+				<view class="item-box">
+					<u-count-to :end-val="salesAmount" separator="," :decimals="2"></u-count-to>
+					<view>销售总金额(¥)</view>
+				</view>
+			</view>
+		</view>
+		<!-- 销售报价及销售单创建 -->
+		<view class="sales-box">
+			 <view class="sales-box-1" @click="toPage('/pages/sales/productPricing')">
+				 <view class="title">产品报价</view>
+			 </view>
+			 <view class="sales-box-1" @click="toPage('/pages/latePlay/chooseBulk')">
+				 <view class="title">新增销售单</view>
+			 </view>
+		</view>
+		<!-- 销售单 -->
+		<view class="sales-list">
+			<view class="title">
+				<text class="title-name">销售单</text>
+				<text class="title-all">查看全部<u-icon name="arrow-right" color="#999" size="28"></u-icon></text>
+			</view>
+		</view>
+		<scroll-view class="st-detailList-con" scroll-y @scrolltolower="onreachBottom">
+			<view class="st-detailList-main">
+				<!-- <view class="st-detailList-main-item" v-for="(item, index) in listData" :key="item.id" @click="getDetail(item)">
+					<view class="st-detailList-tit">
+						<view class="u-line" :style="{backgroundColor: $config('primaryColor')}"></view>{{item.productName}}
+					</view>
+					<view class="st-detailList-item-con flex align_center">
+						<view class="pimgs">
+							<u-image :src="item.product&&item.product.productMsg?item.product.productMsg:`../../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">原厂编码:{{item.productOrigCode}}</view>
+							<view class="flex align_center justify_between">
+								<view class="font_13">
+									可用数量:
+									<u-count-to :end-val="item.currentStockQty ? item.currentStockQty : 0" separator="," font-size="26"></u-count-to>个
+								</view>
+								<view class="font_13">
+									库存成本:
+									¥<u-count-to :end-val="item.currentStockCost ? item.currentStockCost : 0" separator="," font-size="26" :decimals="2"></u-count-to>
+								</view>
+							</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> -->
+			</view>
+		</scroll-view>
+	</view>
+</template>
+
+<script>
+	import {bizData,salesList} from '@/api/sales'
+	export default{
+		data(){
+			return{
+				timeType:'day',
+				bizData:null, // 销售数据统计
+				salesCount:0, // 销售总单数
+				salesAmount:0, // 销售总金额
+			}
+		},
+		onLoad() {
+			this.getBizData()
+		},
+		methods:{
+			seleteTime(val){
+				if(val==0){
+					this.timeType='day'
+					// this.salesCount=this.bizData&&this.bizData.purchaseBill&&(this.bizData.purchaseBill.dayTotalQty || this.bizData.purchaseBill.dayTotalQty==0) ? this.bizData.purchaseBill.dayTotalQty : 0
+					// this.salesAmount=this.bizData&&this.bizData.purchaseBill&&(this.bizData.purchaseBill.dayDiscountedAmount || this.bizData.purchaseBill.dayDiscountedAmount==0) ? this.bizData.purchaseBill.dayDiscountedAmount : 0
+				}else if(val==1){
+					this.timeType='week'
+					// this.salesCount=this.bizData&&this.bizData.purchaseBill&&(this.bizData.purchaseBill.weekPurchaseQty || this.bizData.purchaseBill.weekPurchaseQty==0) ? this.bizData.purchaseBill.weekPurchaseQty : 0
+					// this.salesAmount=this.bizData&&this.bizData.purchaseBill&&(this.bizData.purchaseBill.weekDiscountedAmount || this.bizData.purchaseBill.weekDiscountedAmount==0) ? this.bizData.purchaseBill.weekDiscountedAmount : 0
+				}else{
+					this.timeType='mounth'
+					// this.salesCount=this.bizData&&this.bizData.purchaseBill&&(this.bizData.purchaseBill.monthPurchaseQty || this.bizData.purchaseBill.monthPurchaseQty==0) ? this.bizData.purchaseBill.monthPurchaseQty : 0
+					// this.salesAmount=this.bizData&&this.bizData.purchaseBill&&(this.bizData.purchaseBill.monthDiscountedAmount || this.bizData.purchaseBill.monthDiscountedAmount==0) ? this.bizData.purchaseBill.monthDiscountedAmount : 0
+				}
+				this.getBizData()
+				console.log(val,this.salesCount,this.salesAmount,'this.salesAmount')
+			},
+			toPage(url){
+				uni.navigateTo({
+					url:url
+				})
+			},
+			getBizData () {
+			  bizData({}).then(res => {
+			    if (res.status == 200) {
+			      this.bizData = res.data
+				  if(this.timeType=='day'){
+				  	this.salesCount=this.bizData&&this.bizData.purchaseBill&&(this.bizData.purchaseBill.dayTotalQty || this.bizData.purchaseBill.dayTotalQty==0) ? this.bizData.purchaseBill.dayTotalQty : 0
+				  	this.salesAmount=this.bizData&&this.bizData.purchaseBill&&(this.bizData.purchaseBill.dayDiscountedAmount || this.bizData.purchaseBill.dayDiscountedAmount==0) ? this.bizData.purchaseBill.dayDiscountedAmount : 0
+				  }else if(this.timeType=='week'){
+				  	this.salesCount=this.bizData&&this.bizData.purchaseBill&&(this.bizData.purchaseBill.weekPurchaseQty || this.bizData.purchaseBill.weekPurchaseQty==0) ? this.bizData.purchaseBill.weekPurchaseQty : 0
+				  	this.salesAmount=this.bizData&&this.bizData.purchaseBill&&(this.bizData.purchaseBill.weekDiscountedAmount || this.bizData.purchaseBill.weekDiscountedAmount==0) ? this.bizData.purchaseBill.weekDiscountedAmount : 0
+				  }else{
+				  	this.salesCount=this.bizData&&this.bizData.purchaseBill&&(this.bizData.purchaseBill.monthPurchaseQty || this.bizData.purchaseBill.monthPurchaseQty==0) ? this.bizData.purchaseBill.monthPurchaseQty : 0
+				  	this.salesAmount=this.bizData&&this.bizData.purchaseBill&&(this.bizData.purchaseBill.monthDiscountedAmount || this.bizData.purchaseBill.monthDiscountedAmount==0) ? this.bizData.purchaseBill.monthDiscountedAmount : 0
+				  }
+			    } else {
+			      this.bizData = null
+			    }
+			  })
+			},
+		}
+	}
+</script>
+
+<style lang="scss">
+	.sales-content{
+		width: 100%;
+		padding: 30rpx;
+		.content-data{
+			background-color: #fff;
+			padding: 20upx 20upx;
+			border-radius: 20upx;
+			box-shadow: 3upx 2upx 6upx #eee;
+			margin-bottom: 30upx;
+			.date-type{
+				margin: 0 120upx 30upx 120upx;
+				border-radius: 50upx;
+				border: 1upx solid #eee;
+				.type{
+					display: inline-block;
+					padding: 10upx 0;
+					width: 33%;
+					text-align: center;
+				}
+				.type:first-child{
+					border-top-left-radius: 50upx;
+					border-bottom-left-radius: 50upx;
+				}
+				.type:last-child{
+					border-top-right-radius: 50upx;
+					border-bottom-right-radius: 50upx;
+				}
+				.type:not(:last-child){
+					border-right: 1upx solid #eee;
+				}
+				.active_day {
+				  background: rgb(0, 122, 255);
+				  color: #fff;
+				}
+			}
+			.total{
+				display: flex;
+				.item-box{
+					text-align: center;
+					width: 50%;
+					color:#999;
+					
+				}
+				.item-box:first-child{
+					border-right: 1px solid #e4e7ed;
+				}
+			}
+		}
+		.sales-box{
+			display: flex;
+			align-items: center;
+			margin-bottom: 30upx;
+			.sales-box-1{
+				background-color: #ffffff;
+				border-radius: 20upx;
+				box-shadow: 3upx 2upx 6upx #eee;
+				padding: 30rpx;
+				width: 50%;
+				color: #424D5E;
+				text-align: center;
+				.title{
+					font-size: 32rpx;
+					color: rgb(0, 122, 255);
+					font-weight: bold;
+				}
+			}
+			> view{
+				&:first-child{
+					margin-right: 15rpx;
+				}
+				&:last-child{
+					margin-left: 15rpx;
+				}
+			}
+		}
+		.sales-list{
+			.title{
+				display: flex;
+				align-items: center;
+				justify-content: space-between;
+				.title-name{
+					font-size: 32upx;
+					color:#000 ;
+					font-weight: 1000;
+				}
+				.title-all{
+					color:#999;
+				}
+			}
+		}
+	}
+</style>

+ 189 - 0
pages/sales/productPricing.vue

@@ -0,0 +1,189 @@
+<template>
+	<view class="productPricing-content">
+		<view class="checkbox-price">
+			<u-checkbox-group  placement="row"  @change="checkboxChange">
+				<u-checkbox v-model="item.checked" activeColor="rgb(4, 133, 246)" v-for="(item,index) in priceList" :key="index" :name="item.name" :label="item.name">{{item.name}}</u-checkbox>
+			</u-checkbox-group>
+		</view>
+		<scroll-view class="product-list" scroll-y @scrolltolower="onreachBottom">
+			<view class="st-detailList-main">
+				<view class="st-detailList-main-item" v-for="(item, index) in listData" :key="item.id" @click="getDetail(item)">
+					<view class="st-detailList-tit">
+						<view class="u-line" :style="{backgroundColor: $config('primaryColor')}"></view>{{item.name}}
+					</view>
+					<view class="st-detailList-item-con flex align_center">
+						<view class="pimgs">
+							<u-image :src="item.product&&item.product.productMsg?item.product.productMsg:`../../static/${theme}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
+						</view>
+						<view class="flex_1">
+							<view>产品编码:{{item.code}}</view>
+							<view class="padding_3">原厂编码:{{item.origCode}}</view>
+							<view class="flex align_center justify_between">
+								<view class="font_13">
+									库存数量:
+									<u-count-to :end-val="item.stockQty ? item.stockQty : 0" separator="," font-size="26"></u-count-to>个
+								</view>
+								<view class="font_13">
+									车主价:
+									¥<u-count-to :end-val="item.carOwnersPrice ? item.carOwnersPrice : 0" separator="," font-size="26" :decimals="2"></u-count-to>
+								</view>
+							</view>
+						</view>
+					</view>
+					<view class="price-all flex justify_between">
+						<view class="price-item">
+							<u-count-to :end-val="item.offerCost ? item.offerCost : 0" separator="," font-size="26" :decimals="2"></u-count-to>
+							<view>成本价</view>
+						</view>
+						<view class="price-item">
+							<u-count-to :end-val="item.offerCost ? item.offerCost : 0" separator="," font-size="26" :decimals="2"></u-count-to>
+							<view>成本价</view>
+						</view>
+						<view class="price-item">
+							<u-count-to :end-val="item.offerCost ? item.offerCost : 0" separator="," font-size="26" :decimals="2"></u-count-to>
+							<view>成本价</view>
+						</view>
+						<view class="price-item">
+							<u-count-to :end-val="item.offerCost ? item.offerCost : 0" separator="," font-size="26" :decimals="2"></u-count-to>
+							<view>成本价</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>
+			</view>
+		</scroll-view>
+	</view>
+</template>
+
+<script>
+	import { dealerProductList } from '@/api/sales'
+	export default{
+		data(){
+			return{
+				listData:[],
+				totalNum:0,
+				priceList:[{name:'成本价',checked:false},{name:'市级价',checked:false},{name:'特约价',checked:false},{name:'市级终端价',checked:false}],
+				pageNo:1,
+				pageSize:10,
+				noDataText: '暂无数据',
+				theme: ''
+			}
+		},
+		onLoad() {
+			this.theme = getApp().globalData.theme
+			this.getList()
+		},
+		methods:{
+			// 价格显示
+			checkboxChange(e){
+				console.log(e,'val ,change')
+				// if(val&&val.length>0){
+				// 	const a= val.find(item=>{item=='成本价'})
+				// }
+			},
+			// 列表
+			getList(pageNo){
+				const _this = this
+				if (pageNo) {
+					this.pageNo = pageNo
+				}
+				let params =  { pageNo: this.pageNo, pageSize: this.pageSize }
+				dealerProductList(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>
+
+<style lang="scss">
+	.productPricing-content{
+		width:100%;
+		height: 100vh;
+		.checkbox-price{
+			background-color: #fff;
+			display: flex;
+			justify-content: space-around;
+			padding: 20rpx 0;
+			margin-bottom: 15rpx;
+			color: #191919;
+		}
+		.product-list{
+			height: calc(100vh - 94upx);
+				.st-detailList-main{
+					.st-detailList-main-item{
+						background: #ffffff;
+						padding: 20upx;
+						margin-bottom: 25upx;
+						border-radius: 25upx;
+						box-shadow: 1px 1px 3px #EEEEEE;
+						.st-detailList-tit{
+							padding-bottom: 20upx;
+							border-bottom: 1px solid #e4e7ed;
+							white-space: nowrap;
+							overflow: hidden;
+							text-overflow: ellipsis;
+							.u-line{
+								display: inline-block;
+								width: 6upx;
+								height: 40upx;
+								background-color: red;
+								vertical-align: bottom;
+								margin: 0 20upx 0 10upx;
+							}
+						}
+						.st-detailList-item-con{
+							padding: 20upx;
+							font-size: 26upx;
+							.pimgs{
+								margin-right: 16upx;
+							}
+							.font_13{
+								font-size: 26upx;
+							}
+							.padding_3{
+								padding: 6upx 0;
+							}
+						}
+						.price-all{
+							border-top: 1px solid #e4e7ed;
+							padding: 20upx 20upx 0;
+							.price-item{
+								width: 25%;
+								border-right:  1px solid #e4e7ed;
+								text-align: center;
+								>view{
+									color:#999;
+								}
+							}
+							.price-item:last-child{
+								border-right:  none;
+							}
+						}
+					}
+				}
+				
+				
+		}
+	}
+</style>

+ 46 - 17
pages/stock/detaiList.vue

@@ -6,23 +6,22 @@
 			</view>
 			</view>
 			<view class="st-detailList-info">
 			<view class="st-detailList-info">
 				<view class="st-detailList-tit">
 				<view class="st-detailList-tit">
-					<view class="u-line" :style="{backgroundColor: $config('primaryColor')}"></view>{{stockInfo&&stockInfo.productName ? stockInfo.productName : '--'}}
+					<view class="u-line" :style="{backgroundColor: $config('primaryColor')}"></view>{{stockInfo&&stockInfo.productName || '--'}}
 				</view>
 				</view>
 				<view class="st-detailList-info-con flex align_center">
 				<view class="st-detailList-info-con flex align_center">
 					<view class="pimgs">
 					<view class="pimgs">
-						<u-image :src="stockInfo&&stockInfo.product&&stockInfo&&stockInfo.product.productMsg?stockInfo&&stockInfo.product.productMsg:`../../static/${theme}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
+						<u-image :src="stockInfo&&stockInfo.productMsg||`../../static/${theme}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
 					</view>
 					</view>
 					<view class="flex_1">
 					<view class="flex_1">
-						<view>产品编码:{{stockInfo&&stockInfo.productCode ? stockInfo.productCode : '--'}}</view>
-						<view class="padding_3">原厂编码:{{stockInfo&&stockInfo.productOrigCode ? stockInfo.productOrigCode : '--'}}</view>
+						<view>产品编码:{{stockInfo&&stockInfo.productCode || '--'}}</view>
+						<view class="padding_3">原厂编码:{{stockInfo&&stockInfo.productOrigCode || '--'}}</view>
 						<view class="flex align_center justify_between">
 						<view class="flex align_center justify_between">
 							<view class="font_13">
 							<view class="font_13">
-								可用数量:
-								<u-count-to :end-val="stockInfo&&stockInfo.currentStockQty ? stockInfo&&stockInfo.currentStockQty : 0" separator="," font-size="26"></u-count-to>个
+								可用数量:{{toThousands(stockInfo&&stockInfo.currentStockQty||0)}}{{stockInfo&&stockInfo.productUnit||''}}
 							</view>
 							</view>
 							<view class="font_13">
 							<view class="font_13">
 								库存成本:
 								库存成本:
-								¥<u-count-to :end-val="stockInfo&&stockInfo.currentStockCost ? stockInfo&&stockInfo.currentStockCost : 0" separator="," font-size="26" :decimals="2"></u-count-to>
+								¥{{toThousands(stockInfo&&stockInfo.currentStockCost||0, 2)}}
 							</view>
 							</view>
 						</view>
 						</view>
 					</view>
 					</view>
@@ -36,23 +35,26 @@
 				<view v-if="curNow==0" class="st-detailList-main-item" v-for="(item, index) in listData" :key="item.id" @click="getDetail(item)">
 				<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 class="flex align_center justify_between margin-b20">
 						<view :style="{color: $config('infoColor')}">{{item.putTime || '--'}}</view>
 						<view :style="{color: $config('infoColor')}">{{item.putTime || '--'}}</view>
-						<u-tag :text="item.putBizTypeDictValue" :border-color="$config('primaryColor')" shape="circle" size="mini" />
+						<u-tag v-if="item.putBizTypeDictValue" :text="item.putBizTypeDictValue" :border-color="$config('primaryColor')" shape="circle" size="mini" />
 					</view>
 					</view>
 					<view class="flex align_center justify_between">
 					<view class="flex align_center justify_between">
 						<view v-if="item.warehouseName || item.warehouseLocationName">{{item.warehouseName}} > {{item.warehouseLocationName}}</view>
 						<view v-if="item.warehouseName || item.warehouseLocationName">{{item.warehouseName}} > {{item.warehouseLocationName}}</view>
 						<view v-else>--</view>
 						<view v-else>--</view>
-						<view>¥{{item.putCost}} * {{item.currentQty}}{{item.productUnit}}</view>
+						<view>¥{{toThousands(item.putCost||0, 2)}} * {{toThousands(item.currentQty||0)}}{{item.unit}}</view>
 					</view>
 					</view>
 				</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 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 class="flex align_center justify_between margin-b20">
 						<view :style="{color: $config('infoColor')}">{{item.auditTime || '--'}}</view>
 						<view :style="{color: $config('infoColor')}">{{item.auditTime || '--'}}</view>
-						<u-tag :text="item.bizTypeDictValue" :border-color="$config('primaryColor')" shape="circle" size="mini" />
+						<u-tag v-if="item.bizTypeDictValue" :text="item.bizTypeDictValue" :border-color="$config('primaryColor')" shape="circle" size="mini" />
 					</view>
 					</view>
 					<view class="flex align_center justify_between">
 					<view class="flex align_center justify_between">
 						<view>{{item.unitName || '--'}}</view>
 						<view>{{item.unitName || '--'}}</view>
-						<view :style="{color: item.flowType=='PUT' ? 'green':'red'}"><text v-if="item.qty!=0">{{ item.flowType=='PUT' ? '+':'-' }}</text>{{ item.qty }}{{item.productUnit}}</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>
 				</view>
 				<view v-if="listData && listData.length == 0">
 				<view v-if="listData && listData.length == 0">
@@ -64,6 +66,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
+	import { toThousands } from '@/libs/tools'
 	import { stockDetailList, stockFlowList } from '@/api/stock'
 	import { stockDetailList, stockFlowList } from '@/api/stock'
 	export default{
 	export default{
 		data(){
 		data(){
@@ -80,7 +83,8 @@
 				stockInfo: null,
 				stockInfo: null,
 				noDataText: '暂无数据',
 				noDataText: '暂无数据',
 				curNow: 0,
 				curNow: 0,
-				theme: ''
+				theme: '',
+				toThousands
 			}
 			}
 		},
 		},
 		onLoad(option) {
 		onLoad(option) {
@@ -95,20 +99,45 @@
 				if (pageNo) {
 				if (pageNo) {
 					this.pageNo = pageNo
 					this.pageNo = pageNo
 				}
 				}
+				let params = {}
 				let url = stockDetailList
 				let url = stockDetailList
 				if(this.curNow == 0){  // 库存详情
 				if(this.curNow == 0){  // 库存详情
 					url = stockDetailList
 					url = stockDetailList
+					params = {
+						pageNo: this.pageNo,
+						pageSize: this.pageSize,
+						stockSn: this.stockInfo && this.stockInfo.stockSn || '',
+						isSellOut: '0'
+					}
 				}else if(this.curNow == 1){  // 出入库明细
 				}else if(this.curNow == 1){  // 出入库明细
 					url = stockFlowList
 					url = stockFlowList
+					params = {
+						pageNo: this.pageNo,
+						pageSize: this.pageSize,
+						productSn: this.stockInfo && this.stockInfo.productSn || ''
+					}
 				}
 				}
-				url({ pageNo: this.pageNo, pageSize: this.pageSize }).then(res => {
+				url(params).then(res => {
 					if (res.status == 200) {
 					if (res.status == 200) {
-						if(this.pageNo>1){
-							this.listData = this.listData.concat(res.data.list || [])
+						if(res.data && res.data.list){
+							if(this.curNow == 1){  // 出入库明细
+								res.data.list.map(item => {
+									if(item.flowType == 'PUT'){
+										item.qty = item.putQty || 0
+									}else if(item.flowType == 'OUT'){
+										item.qty = item.outQty || 0
+									}
+								})
+							}
+							if(this.pageNo>1){
+								this.listData = this.listData.concat(res.data && res.data.list || [])
+							}else{
+								this.listData = res.data.list || []
+							}
 						}else{
 						}else{
-							this.listData = res.data.list || []
+							this.listData = []
 						}
 						}
-						this.totalNum = res.data.count || 0
+						this.totalNum = res.data && res.data.count || 0
 					} else {
 					} else {
 						this.listData = []
 						this.listData = []
 						this.totalNum = 0
 						this.totalNum = 0

+ 88 - 1
pages/stock/stockDetail.vue

@@ -1,8 +1,95 @@
 <template>
 <template>
+	<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>
+			</view>
+			<view class="info-con flex_1">
+				<view>{{productData && productData.productCode || '--'}}</view>
+				<view class="padding_7">{{productData && productData.productName || '--'}}</view>
+			</view>
+		</view>
+		<view class="stockDetail-info">
+			<view class="info-item flex align_center justify_between">
+				<view class="info-name">仓库</view>
+				<view>{{paramsData && paramsData.warehouseName || '--'}}</view>
+			</view>
+			<view class="info-item flex align_center justify_between">
+				<view class="info-name">仓位</view>
+				<view>{{paramsData && paramsData.warehouseLocationName || '--'}}</view>
+			</view>
+			<view class="info-item flex align_center justify_between">
+				<view class="info-name">入库时间</view>
+				<view>{{paramsData && paramsData.putTime || '--'}}</view>
+			</view>
+			<view class="info-item flex align_center justify_between">
+				<view class="info-name">入库类型</view>
+				<view>{{paramsData && paramsData.putBizTypeDictValue || '--'}}</view>
+			</view>
+			<view class="info-item flex align_center justify_between">
+				<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.putCost || 0, 2)}}</view>
+			</view>
+		</view>
+	</view>
 </template>
 </template>
 
 
 <script>
 <script>
+	import { toThousands } from '@/libs/tools'
+	export default{
+		data(){
+			return {
+				productData: null,
+				paramsData: null,
+				theme: '',
+				toThousands
+			}
+		},
+		onLoad(option) {
+			this.theme = getApp().globalData.theme
+			this.productData = option.productData ? JSON.parse(option.productData) : null
+			this.paramsData = option.data ? JSON.parse(option.data) : null
+		},
+		methods: {}
+	}
 </script>
 </script>
 
 
-<style>
+<style lang="scss">
+	.stockDetail-wrap{
+		width: 100%;
+		padding: 30upx;
+		.panel-box {
+			background-color: #ffffff;
+			padding: 20upx 20upx;
+			border-radius: 20upx;
+			box-shadow: 3upx 2upx 6upx #eee;
+			margin-bottom: 30upx;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			.info-con{
+				margin-left: 20upx;
+				.padding_7{
+					padding: 14upx 0 0;
+				}
+			}
+		}
+		.stockDetail-info{
+			background-color: #ffffff;
+			padding: 10upx 20upx 20upx;
+			border-radius: 20upx;
+			box-shadow: 3upx 2upx 6upx #eee;
+			.info-item{
+				border-bottom: 1px dashed #e4e7ed;
+				padding: 20upx 0;
+				.info-name{
+					color: #464646;
+				}
+			}
+		}
+	}
 </style>
 </style>

+ 9 - 8
pages/stock/stockSearch.vue

@@ -4,15 +4,15 @@
 		<view class="panel-box">
 		<view class="panel-box">
 			<view class="item-box">
 			<view class="item-box">
 				<view>查询结果</view>
 				<view>查询结果</view>
-				<u-count-to :end-val="totalNum ? totalNum : 0" separator="," font-size="30"></u-count-to>条
+				<view>{{toThousands(totalNum||0)}}条</view>
 			</view>
 			</view>
 			<view class="item-box">
 			<view class="item-box">
 				<view>可用库存数量</view>
 				<view>可用库存数量</view>
-				<u-count-to :end-val="totalData&&totalData.totalCurrentStockQty ? totalData.totalCurrentStockQty : 0" separator="," font-size="30"></u-count-to>个
+				<view>{{toThousands(totalData&&totalData.totalCurrentStockQty||0)}}个</view>
 			</view>
 			</view>
 			<view class="item-box">
 			<view class="item-box">
 				<view>可用库存成本</view>
 				<view>可用库存成本</view>
-				¥<u-count-to :end-val="totalData&&totalData.totalCurrentStockCost ? totalData.totalCurrentStockCost : 0" separator="," font-size="30" :decimals="2"></u-count-to>
+				<view>¥{{toThousands(totalData&&totalData.totalCurrentStockCost||0, 2)}}</view>
 			</view>
 			</view>
 		</view>
 		</view>
 		<!-- 查询结果 -->
 		<!-- 查询结果 -->
@@ -24,19 +24,18 @@
 					</view>
 					</view>
 					<view class="stockSearch-item-con flex align_center">
 					<view class="stockSearch-item-con flex align_center">
 						<view class="pimgs">
 						<view class="pimgs">
-							<u-image :src="item.product&&item.product.productMsg?item.product.productMsg:`../../static/${theme}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
+							<u-image :src="item.productMsg?item.productMsg:`../../static/${theme}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
 						</view>
 						</view>
 						<view class="flex_1">
 						<view class="flex_1">
 							<view>产品编码:{{item.productCode || '--'}}</view>
 							<view>产品编码:{{item.productCode || '--'}}</view>
 							<view class="padding_3">原厂编码:{{item.productOrigCode || '--'}}</view>
 							<view class="padding_3">原厂编码:{{item.productOrigCode || '--'}}</view>
 							<view class="flex align_center justify_between">
 							<view class="flex align_center justify_between">
 								<view class="font_13">
 								<view class="font_13">
-									可用数量:
-									<u-count-to :end-val="item.currentStockQty ? item.currentStockQty : 0" separator="," font-size="26"></u-count-to>{{item.productUnit}}
+									可用数量:{{toThousands(item.currentStockQty||0)}}{{item.productUnit}}
 								</view>
 								</view>
 								<view class="font_13">
 								<view class="font_13">
 									库存成本:
 									库存成本:
-									¥<u-count-to :end-val="item.currentStockCost ? item.currentStockCost : 0" separator="," font-size="26" :decimals="2"></u-count-to>
+									¥{{toThousands(item.currentStockCost||0, 2)}}
 								</view>
 								</view>
 							</view>
 							</view>
 						</view>
 						</view>
@@ -51,6 +50,7 @@
 </template>
 </template>
 
 
 <script>
 <script>
+	import { toThousands } from '@/libs/tools'
 	import { stockList, stockCount } from '@/api/stock'
 	import { stockList, stockCount } from '@/api/stock'
 	export default{
 	export default{
 		data(){
 		data(){
@@ -62,7 +62,8 @@
 				pageSize: 6,
 				pageSize: 6,
 				params: {},
 				params: {},
 				noDataText: '暂无数据',
 				noDataText: '暂无数据',
-				theme: ''
+				theme: '',
+				toThousands
 			}
 			}
 		},
 		},
 		onLoad(option) {
 		onLoad(option) {

+ 116 - 1
pages/stock/warehouseDetail.vue

@@ -1,8 +1,123 @@
 <template>
 <template>
+	<view class="warehouseDetail-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>
+			</view>
+			<view class="info-con flex_1">
+				<view>{{productData && productData.productCode || '--'}}</view>
+				<view class="padding_7">{{productData && productData.productName || '--'}}</view>
+			</view>
+		</view>
+		<view class="warehouseDetail-info">
+			<view class="info-item flex align_center justify_between">
+				<view class="info-name">变动类型</view>
+				<view v-if="paramsData && paramsData.flowType">{{paramsData.flowType=='OUT'?'出库':paramsData.flowType=='PUT'?'入库':'--'}}</view>
+				<view v-else>--</view>
+			</view>
+			<view class="info-item flex align_center justify_between">
+				<view class="info-name">变动数量</view>
+				<view v-if="paramsData && paramsData.flowType && paramsData.flowType=='PUT'">
+					<view style="color: green;display: inline-block">
+						<text v-if="paramsData && paramsData.putQty && paramsData.putQty!=0">+</text>{{ toThousands(paramsData && paramsData.putQty||0) }}
+					</view>
+					{{paramsData && paramsData.product && paramsData.product.unit}}
+				</view>
+				<view v-if="paramsData && paramsData.flowType && paramsData.flowType=='OUT'">
+					<view style="color: red;display: inline-block">
+						<text v-if="paramsData && paramsData.outQty && paramsData.outQty!=0">-</text>{{ toThousands(paramsData && paramsData.outQty||0) }}
+					</view>
+					{{paramsData && paramsData.product && paramsData.product.unit}}
+				</view>
+			</view>
+			<view class="info-item flex align_center justify_between">
+				<view class="info-name">单据类型</view>
+				<view>{{paramsData && paramsData.bizTypeDictValue || '--'}}</view>
+			</view>
+			<view class="info-item flex align_center justify_between">
+				<view class="info-name">单据审核时间</view>
+				<view>{{paramsData && paramsData.auditTime || '--'}}</view>
+			</view>
+			<view class="info-item flex align_center justify_between">
+				<view class="info-name">单位名称</view>
+				<view>{{paramsData && paramsData.unitName || '--'}}</view>
+			</view>
+			<view class="info-item flex align_center justify_between">
+				<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.warehouseName || '--'}}</view>
+			</view>
+			<view class="info-item flex align_center justify_between">
+				<view class="info-name">仓位</view>
+				<view>{{paramsData && paramsData.warehouseLocationName || '--'}}</view>
+			</view>
+			<view class="info-item flex align_center justify_between">
+				<view class="info-name">总成本</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>
+		</view>
+	</view>
 </template>
 </template>
 
 
 <script>
 <script>
+	import { toThousands } from '@/libs/tools'
+	export default{
+		data(){
+			return {
+				productData: null,
+				paramsData: null,
+				theme: '',
+				toThousands
+			}
+		},
+		onLoad(option) {
+			this.theme = getApp().globalData.theme
+			this.productData = option.productData ? JSON.parse(option.productData) : null
+			this.paramsData = option.data ? JSON.parse(option.data) : null
+		},
+		methods: {}
+	}
 </script>
 </script>
 
 
-<style>
+<style lang="scss">
+	.warehouseDetail-wrap{
+		width: 100%;
+		padding: 30upx;
+		.panel-box {
+			background-color: #ffffff;
+			padding: 20upx 20upx;
+			border-radius: 20upx;
+			box-shadow: 3upx 2upx 6upx #eee;
+			margin-bottom: 30upx;
+			display: flex;
+			justify-content: space-between;
+			align-items: center;
+			.info-con{
+				margin-left: 20upx;
+				.padding_7{
+					padding: 14upx 0 0;
+				}
+			}
+		}
+		.warehouseDetail-info{
+			background-color: #ffffff;
+			padding: 10upx 20upx 20upx;
+			border-radius: 20upx;
+			box-shadow: 3upx 2upx 6upx #eee;
+			.info-item{
+				border-bottom: 1px dashed #e4e7ed;
+				padding: 20upx 0;
+				.info-name{
+					color: #464646;
+				}
+			}
+		}
+	}
 </style>
 </style>