Browse Source

库存盘点

lilei 2 years ago
parent
commit
f12611d509

+ 10 - 2
api/stockCheck.js

@@ -2,7 +2,7 @@ import axios from '@/libs/axios.js'
 
 // 盘点完成
 export const stockCheckConfirm = (params) => {
-	let url = `shelfStockCheck/confirm/${params.stockCheckSn}`
+	let url = `shelfStockCheck/confirm`
 	return axios.request({
 		url: url,
 		data: params,
@@ -20,7 +20,15 @@ export const stockCheckDeleteBySn = (params) => {
 }
 // 盘点明细-删除
 export const stockCheckDetailDelete = (params) => {
-	let url = `shelfStockCheck/detail/deleteBySn/${params.stockCheckDetailSn}`
+	let url = `shelfStockCheck/detail/deleteByStockCheckDetailSn/${params.stockCheckDetailSn}`
+	return axios.request({
+		url: url,
+		method: 'post'
+	})
+}
+// 整单删除
+export const deleteByStockCheckSn = (params) => {
+	let url = `shelfStockCheck/detail/deleteByStockCheckSn/${params.stockCheckSn}`
 	return axios.request({
 		url: url,
 		data: params,

+ 30 - 1
pages.json

@@ -444,9 +444,38 @@
         }
         ,{
             "path" : "pages/stockCheck/startCheck",
+            "style": {
+            	"navigationBarTitleText": "库存盘点",
+            	"navigationStyle":"custom",
+            	"app-plus":{
+            		"titleNView": {
+            			"titleAlign": "auto",
+            			"buttons": [ //原生标题栏按钮配置,
+            				{
+            					"text": "\ue694 盘点历史" ,//原生标题栏增加分享按钮,点击事件可通过页面的 onNavigationBarButtonTap 函数进行监听u
+            					"fontSrc": "/static/iconfont/iconfont.ttf",
+            					"fontSize": "16",
+            					"width":"120px"
+            				}
+            			]
+            		}
+            	}
+            }
+        }
+        ,{
+            "path" : "pages/stockCheck/submitStockCheck",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "提交盘点单",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/stockCheck/checkRecord",
             "style" :                                                                                    
             {
-                "navigationBarTitleText": "库存盘点",
+                "navigationBarTitleText": "盘点历史",
                 "enablePullDownRefresh": false
             }
             

+ 147 - 0
pages/stockCheck/checkRecord.vue

@@ -0,0 +1,147 @@
+<template>
+	<view class="sockQuery flex flex_column">
+		<swiper class="list-box">
+			<swiper-item class="swiper-item" style="height: 100%;width: 100%;overflow: hidden;">
+				<scroll-view scroll-y style="height: 100%;width: 100%;overflow: auto;" @scrolltolower="onreachBottom">
+					 <view
+					  class="list-item flex align_center justify_between" 
+					 v-for="item in list" 
+					 :key="item.id"
+					 @click="detail(item)"
+					 >
+					 	<view>
+					 		<view class="vin-text">
+					 			<text>{{item.checkFinishDate}}</text>
+					 		</view>
+					 		<view class="time-text">
+					 			{{item.checkFinishPersonName}}
+								<view>{{item.stockCheckNo}}</view>
+					 		</view>
+					 	</view>
+						<view>
+							¥{{item.totalProfitLossCost}}
+						</view>
+					 </view>
+					 <view style="padding: 20upx;">
+						 <u-empty :src="`/static/nodata.png`" icon-size="180" :text="noDataText" img-width="120" v-if="list.length==0 && status!='loading'" mode="list"></u-empty>
+						 <u-loadmore v-if="(total>=list.length&&list.length)||status=='loading'" :status="status" />
+					 </view>
+				</scroll-view>
+			</swiper-item>
+		</swiper>
+	</view>
+</template>
+
+<script>
+	import { stockCheckQueryPage } from '@/api/stockCheck'
+	export default {
+		data() {
+			return {
+				status: 'loading',
+				noDataText: '暂无记录',
+				pageNo: 1,
+				pageSize: 20,
+				total: 0,
+				list: []
+			}
+		},
+		onLoad() {
+			this.getList()
+		},
+		methods: {
+			pageInit(){
+				this.total = 0
+				this.pageNo = 1
+				this.list = []
+				this.getList()
+			},
+			detail(item){
+				uni.navigateTo({
+					url: '/pages/stockCheck/submitStockCheck?stockCheckSn='+item.stockCheckSn+'&type=view'
+				})
+			},
+			// 查询列表
+			getList (pageNo) {
+			  let _this = this
+			  if (pageNo) {
+			    this.pageNo = pageNo
+			  }
+			  // 状态条件
+			  let params = {
+			    pageNo: this.pageNo,
+			    pageSize: this.pageSize,
+				checkState: 'FINISH'
+			  }
+			  this.status = "loading"
+			  stockCheckQueryPage(params).then(res => {
+				if (res.code == 200 || res.status == 204 || res.status == 200) {
+				  if(_this.pageNo>1){
+					  _this.list = _this.list.concat(res.data.list || [])
+				  }else{
+					  _this.list = res.data.list || []
+				  }
+				  _this.total = res.data.count || 0
+				} else {
+				  _this.list = []
+				  _this.total = 0
+				  _this.noDataText = res.message
+				}
+				_this.status = _this.total>=_this.list.length ? "nomore" : 'loadmore'
+			  })
+			},
+			// scroll-view到底部加载更多
+			onreachBottom() {
+				if(this.list.length < this.total){
+					this.pageNo += 1
+					this.getList()
+				}else{
+					this.status = "nomore"
+				}
+			},
+		}
+	}
+</script>
+
+<style lang="less">
+.sockQuery{
+	width: 100%;
+	height: 100vh;
+	background: #f8f8f8;
+	.search-box{
+		padding: 20rpx 30rpx;
+	}
+	.list-box{
+		flex-grow: 1;
+		overflow: auto;
+	}
+	.list-item{
+		margin: 20rpx 30rpx;
+		border:2rpx solid #f8f8f8;
+		box-shadow: 2rpx 2rpx 6rpx #eee;
+		border-radius: 20rpx;
+		padding: 20rpx 15rpx;
+		background: #ffffff;
+		> view{
+			padding: 0 10rpx;
+			&:first-child{
+				flex-grow: 1;
+				width: 70%;
+			}
+			&:last-child{
+				text-align: right;
+				font-weight: bold;
+				font-size: 34upx;
+				width: 30%;
+			}
+		}
+		.time-text{
+			margin-top: 10upx;
+			font-size: 24upx;
+			color: #999;
+			text{
+				color: #333;
+			}
+		}
+	}
+}
+</style>

+ 46 - 22
pages/stockCheck/editModal.vue

@@ -18,7 +18,7 @@
 				 	<text>冻结库存</text>
 					<view class="flex align_center">
 						{{infoData.freezeQty}}
-						<view>
+						<view v-if="infoData.freezeQty">
 							<text>冻结明细</text>
 							<u-icon name="arrow-right"></u-icon>
 						</view>
@@ -27,13 +27,14 @@
 				 <view class="p-info flex align_center">
 				 	<text>结算价格</text>
 					<view>
-						<text>{{infoData.price}}</text>
+						<text>{{infoData.price}}</text>
 					</view>
 				 </view>
 				 <view class="p-info flex align_center">
 				 	<text>实际可用库存</text>
 					<view>
-						<u-number-box v-model="infoData.checkQty" :index="infoData.id" :min="0" :max="infoData.maxQty||999999"></u-number-box>
+						<view></view>
+						<u-number-box v-model="infoData.checkQty" :index="infoData.id" :min="0" :max="999999"></u-number-box>
 					</view>
 				 </view>
 			</view>
@@ -46,7 +47,6 @@
 </template>
 
 <script>
-	import { stockCheckDetailSave } from '@/api/stockCheck'
 	export default {
 		props: {
 			openModal: { //  弹框显示状态
@@ -68,15 +68,26 @@
 		methods: {
 			// 确认
 			handleConfirm(){
-				this.$emit('addProduct',{
-					shelfSn: this.infoData.shelfSn,
-					shelfPlaceSn: this.infoData.shelfPlaceSn,
-					shelfPlaceCode: this.infoData.shelfPlaceCode,
-					productCode: this.infoData.productCode,
-					stockQty: this.infoData.stockQty,
-					freezeQty: this.infoData.freezeQty,
-					checkQty: this.infoData.checkQty,
-				})
+				if(this.infoData.checkQty){
+					this.$emit('addProduct',{
+						shelfSn: this.infoData.shelfSn,
+						shelfPlaceSn: this.infoData.shelfPlaceSn,
+						shelfPlaceCode: this.infoData.shelfPlaceCode,
+						productCode: this.infoData.productCode,
+						productSn: this.infoData.productSn,
+						stockQty: this.infoData.stockQty,
+						freezeQty: this.infoData.freezeQty,
+						stockQty: this.infoData.qty,
+						checkQty: this.infoData.checkQty,
+						stockCheckDetailSn: this.infoData.stockCheckDetailSn || undefined,
+						cost: this.infoData.cost
+					})
+				}else{
+					uni.showToast({
+						icon: "none",
+						title: '请输入实际可用库存'
+					})
+				}
 			},
 		},
 		watch: {
@@ -97,33 +108,46 @@
 <style lang="scss" scoped>
 	.productModal{
 		width: 100%;
-		height: 100%;
+		height: 100vh;
+		font-size: 24upx;
 		.text-c{
 			text-align: center;
 		}
 		.product-con{
-			width: 78%;
-			margin: 30vh auto 0;
+			width: 75%;
+			margin: 25vh auto 0;
 			background-color: #fff;
 			border-radius: 24upx;
 			.product-main{
-				padding: 60upx 20upx 50upx;
+				padding: 30upx;
 				max-height: 50vh;
 				overflow: auto;
 				.p-title{
-					padding: 20upx 30upx;
-					background-color: #999;
+					padding: 15upx 20upx;
+					background-color: #ededed;
 					border-radius: 60upx;
+					text-align: center;
+					> text{
+						margin-right: 15rpx;
+					}
 				}
 				.p-info{
-					padding: 20upx 30upx;
+					padding: 20upx 10upx;
 					> text{
-						width: 100upx;
-						color: #999;
+						width: 150upx;
+						color: #666;
 					}
 					> view{
 						flex-grow:1;
+						display: flex;
+						justify-content: space-between;
+						>view{
+							> text{
+								color:#55aaff;
+							}
+						}
 					}
+					border-bottom: 2rpx solid #eee;
 				}
 			}
 			.product-footer{

+ 1 - 9
pages/stockCheck/shelfList.vue

@@ -79,16 +79,8 @@
 				showModal: false
 			}
 		},
-		onLoad(opts) {
+		onShow() {
 			this.getShelfList()
-			uni.$on("setCustome",(data)=>{
-				this.pageNo = 1
-				this.shelfList = []
-				this.getShelfList()
-			})
-		},
-		onUnload() {
-			uni.$off("setCustome")
 		},
 		methods: {
 			clearSearch(){

+ 239 - 40
pages/stockCheck/startCheck.vue

@@ -29,6 +29,7 @@
 					<view class="product" @click="toEdit(item)">
 						<view class="flex align_center flex_1">
 							<view class="pimgs">
+								<text v-if="hasChecked(item)">已选</text>
 								<u-image :src="item.productEntity&&item.productEntity.images?item.productEntity.images:`../../static/${$config('themePath')}/def_img@2x.png`" width="128" height="128" border-radius="10"></u-image>
 							</view>
 							<view class="pinfo">
@@ -66,16 +67,18 @@
 		</view>
 		<!-- 底部栏 -->
 		<view class="footer-bar flex align_center">
-			<view class="f-left" :style="{background:orderTotal?$config('primaryColor'):''}">
+			<view class="f-left" :style="{background:orderTotal?$config('primaryColor'):''}" @click="openCart">
 				<u-icon name="order" size="45"></u-icon>
 				<u-badge type="error" size="mini" :offset="[-10,-10]" :count="orderTotal"></u-badge>
 			</view>
 			<view class="f-mid">
-				盘盈总数:<text>3</text>
-				盘亏总数:<text>3</text>
+				<view v-if="detail">
+					盘盈总数:<text>{{detail.totalProfitQty}}</text>
+					盘亏总数:<text>{{detail.totalLossQty}}</text>
+				</view>
 			</view>
 			<view class="f-btns">
-				<u-button size="medium" :custom-style="customBtnStyle" shape="circle" type="primary" hover-class="none" >提交盘点单</u-button>
+				<u-button size="medium" @click="submitOrder" :custom-style="customBtnStyle" shape="circle" type="primary" hover-class="none" >提交盘点单</u-button>
 			</view>
 		</view>
 		<!-- 已选配件 购物车 -->
@@ -87,58 +90,76 @@
 				<div class="cpb_cart-tit">
 					<view>已选配件</view>
 					<view class="cpb_heji flex align_center justify_between">
-						<text>清空列表</text>
-						<view>
+						<text @click="clearDetail">清空列表</text>
+						<view v-if="detail">
 							盈亏总数量:
 							<text>
-								-2334
+								{{detail.totalProfitLossQty}}
 							</text>
 							盈亏总金额:
 							<text>
-								¥-254
+								¥{{detail.totalProfitLossCost}}
 							</text>
 						</view>
 					</view>
 				</div>
 				<div class="cpb_cart-list">
-					<view class="nav-right-item flex" v-for="(item, index) in chooseList" :key="item.id">
+					<u-swipe-action 
+					:show="item.show" 
+					:btn-width="120"
+					:index="index" 
+					@click="delDetail"
+					v-for="(item, index) in chooseList" 
+					:key="item.id" 
+					:options="options"
+					>
+					<view class="nav-right-item flex">
 						<view class="uni-col-2">
-							<u-image :src="item.productEntity&&item.productEntity.images?item.productEntity.images:`../../static/${$config('themePath')}/def_img@2x.png`" width="100" height="100" border-radius="30"></u-image>
+							<u-image :src="item.product&&item.product.images?item.product.images:`../../static/${$config('themePath')}/def_img@2x.png`" width="100" height="100" border-radius="30"></u-image>
 						</view>
 						<view class="item-info uni-col-10">
 							<view class="item-name">
-								<text>{{item.productEntity&&item.productEntity.code}}</text>
-								{{item.productEntity&&item.productEntity.productName}}
+								<text>{{item.productCode}}</text>
+								{{item.product.productName}}
 							</view>
 							<view class="item-detail">
 								<view class="item-detail-info">
 									<view class="flex justify_end">
 										<text class="item-detail-text">
-											可用:{{item.qty?item.qty:0}} {{item.productEntity&&item.productEntity.unit}}
+											可用:{{item.stockQty?item.stockQty:0}} {{item.product&&item.product.unit}}
 										</text>
 										<text class="item-detail-text">
-											冻结:{{item.freezeQty?item.freezeQty:0}} {{item.productEntity&&item.productEntity.unit}}
+											冻结:{{item.freezeQty?item.freezeQty:0}} {{item.product&&item.product.unit}}
 										</text>
 									</view>
 								</view>
 							</view>
 							<view class="item-detail">
 								<view class="item-detail-info">
-									<view class="flex justify_end">
+									<view class="flex justify_between">
+										<view></view>
 										 <view class="item-detail-text">
 										 	实际可用:
-										 	<u-number-box v-model="item.qty" :index="'cart_'+item.id" :min="0" :max="item.qty||999999"></u-number-box>
+										 	<u-number-box 
+											v-model="item.checkQty" 
+											@minus="cartChangeNums" 
+											@plus="cartChangeNums" 
+											@blur="cartChangeNums"
+											:index="'cart_'+item.id" 
+											:min="0" 
+											:max="item.stockQty||999999"></u-number-box>
 										 </view>
 									</view>
 								</view>
 							</view>
 						</view>
 					</view>
+				</u-swipe-action>
 				</div>
 			</div>
 		</div>
 		<!-- 编辑弹框 -->
-		<editModal :openModal="editModal" :infoData="tempData" @close="editModal=false"></editModal>
+		<editModal v-if="editModal" :openModal="editModal" :infoData="tempData" @close="editModal=false" @addProduct="addProduct"></editModal>
 		<!-- 筛选项 -->
 		<u-popup v-model="showTab" mode="right" width="70%">
 			<view class="tabBox flex flex_column">
@@ -162,8 +183,16 @@
 
 <script>
 	import { getShelfProductList,getProductPlace } from '@/api/shelf'
-	import { stockCheckDetailQueryList, stockCheckDetailDelete, stockCheckSave, stockCheckBySn } from '@/api/stockCheck'
+	import { 
+		stockCheckDetailQueryList, 
+		stockCheckDetailDelete, 
+		stockCheckSave, 
+		stockCheckBySn, 
+		stockCheckDetailSave,
+		deleteByStockCheckSn
+	} from '@/api/stockCheck'
 	import editModal from './editModal'
+	import { clzConfirm } from '@/libs/tools'
 	export default {
 		components: {
 			editModal
@@ -172,6 +201,7 @@
 			return {
 				queryWord: '',
 				nowData:null,
+				stockCheckSn: null,
 				detail:null,
 				pageNo:1,
 				pageSize: 10,
@@ -192,62 +222,132 @@
 				showCart: false,
 				chooseList: [],
 				editModal: false,
-				tempData: null
+				tempData: null,
+				options: [
+					{
+						text: '删除',
+						style: {
+							backgroundColor: '#dd524d'
+						}
+					}
+				]
+			}
+		},
+		onNavigationBarButtonTap(e) {
+			if(e.index == 1){
+				uni.navigateTo({
+					url: '/pages/stockCheck/checkRecord'
+				})
 			}
 		},
 		onLoad(opts) {
 			this.nowData = JSON.parse(decodeURIComponent(opts.data));
+			this.stockCheckSn = this.nowData.stockCheckSn
 			this.getpartList()
 			this.getShelfPlace()
 			
-			if(this.nowData.stockCheckSn){
+			if(this.stockCheckSn){
 				// 获取盘点单明细
 				this.getDetail()
 				// 获取盘点明细列表
 				this.getChooseList()
 			}
+			
+			// 重置盘点单
+			uni.$on("resetStockCheck",()=>{
+				this.resetStockCheck()
+			})
+		},
+		onUnload() {
+			uni.$off("resetStockCheck")
 		},
 		methods: {
+			// 重置盘点单
+			resetStockCheck(){
+				this.chooseList = []
+				this.orderTotal = 0
+				this.stockCheckSn = null
+				this.detail = null
+				this.tempData = null
+				this.queryWord = ''
+				this.showCart = false
+				this.handleClear()
+			},
 			// 获取盘点明细列表
 			getChooseList(){
 				stockCheckDetailQueryList({
-					stockCheckSn: this.nowData.stockCheckSn
+					stockCheckSn: this.stockCheckSn
 				}).then(res => {
 					this.chooseList = res.data || []
+					this.orderTotal = this.chooseList.length
 				})
 			},
 			// 详细
 			getDetail(){
-				stockCheckBySn({stockCheckSn: this.nowData.stockCheckSn}).then(res => {
+				stockCheckBySn({stockCheckSn: this.stockCheckSn}).then(res => {
 					this.detail = res.data || null
 				})
 			},
 			//添加产品
 			toEdit(item){
-				item.checkQty = item.qty
-				this.tempData = item
+				const data = this.hasChecked(item)
+				console.log(data)
+				// 修改
+				if(data){
+					data.productEntity = data.product
+					data.qty = data.stockQty
+					this.tempData = data
+				}else{
+					// 添加
+					item.checkQty = item.qty
+					this.tempData = item
+				}
 				this.editModal = true
 			},
 			// 添加产品明细
 			addProduct(data){
+				const _this = this
+				this.editModal = false
 				// 是否第一次添加产品
-				if(this.chooseList.length==0){
-					// 先创建盘点单
-					stockCheckSave({
-						 shelfSn: this.nowData.shelfSn,
-						 totalCategory: this.nowData.totalCategory,
-						 totalStockQty: this.nowData.totalStockQty,
-						 totalFreezeQty: this.nowData.totalFreezeQty
-					}).then(res => {
-						 if(res.status == 200){
-							 this.detail = res.data || null
-							 this.saveProduct(data)
-						 }
+				if(this.orderTotal==0){
+					clzConfirm({
+					  title: '提示',
+					  content: '开始盘点后,不能再使用与出入库有关的功能,确认开始盘点吗?',
+					  success (ret) {
+						if (ret.confirm || ret.index == 0) {
+							// 先创建盘点单
+							_this.creatOrder(data)
+						}
+					  }
 					})
 				}else{
+					uni.showLoading({
+						title:"正在保存.."
+					})
 					this.saveProduct(data)
 				}
 			},
+			// 创建盘点单
+			creatOrder(data){
+				uni.showLoading({
+					title:"正在保存.."
+				})
+				stockCheckSave({
+					 shelfSn: this.nowData.shelfSn,
+					 totalCategory: this.nowData.totalCategory,
+					 totalStockQty: this.nowData.totalStockQty,
+					 totalFreezeQty: this.nowData.totalFreezeQty
+				}).then(res => {
+					 if(res.status == 200){
+						 this.detail = res.data || null
+						 this.stockCheckSn = res.data.stockCheckSn
+						 this.saveProduct(data)
+					 }else{
+						 uni.hideLoading()
+					 }
+				})
+			},
+			// 添加产品
 			saveProduct(data){
 				stockCheckDetailSave({
 					stockCheckSn: this.detail.stockCheckSn,
@@ -255,9 +355,76 @@
 					...data
 				}).then(res => {
 					if(res.status == 200){
+						this.getDetail()
+						this.getChooseList()
 					}
+					uni.hideLoading()
 				})
 			},
+			// 打开购物车
+			openCart(){
+				if(this.orderTotal){
+					this.showCart = !this.showCart
+				}else{
+					uni.showToast({
+						icon: 'none',
+						title: '请先添加产品'
+					})
+				}
+			},
+			// 清空购物车
+			clearDetail(){
+				const _this = this
+				clzConfirm({
+				  title: '提示',
+				  content: '确认将所有产品移出盘点单吗?',
+				  success (ret) {
+					if (ret.confirm || ret.index == 0) {
+						uni.showLoading({
+							title:"正在删除.."
+						})
+						deleteByStockCheckSn({ stockCheckSn: _this.stockCheckSn }).then(res => {
+						  if (res.status == 200) {
+							   _this.showCart = false
+							   _this.getDetail()
+							   _this.getChooseList()
+						  }
+						  uni.hideLoading()
+						})
+					}
+				  }
+				})
+			},
+			// 修改数量
+			cartChangeNums(v){
+				console.log(v,this.showCart)
+				const data = this.chooseList.find(item => item.id == v.index.split('_')[1])
+				uni.showLoading({
+					title:"正在保存.."
+				})
+				this.saveProduct(data)
+			},
+			// 删除盘点详细
+			delDetail(a,b){
+				if(b==0){
+					const data = this.chooseList[a]
+					stockCheckDetailDelete({stockCheckDetailSn: data.stockCheckDetailSn}).then(res=>{
+						if(res.status == 200){
+							this.chooseList.splice(a,1)
+							// 删除最后一个后刷新列表
+							if(this.chooseList.length == 0){
+								this.showCart = false
+								this.getDetail()
+								this.getChooseList()
+							}
+						}
+					})
+				}
+			},
+			// 是否已选
+			hasChecked(data){
+				return this.chooseList.find(item => item.shelfPlaceCode == data.shelfPlaceCode && item.productSn == data.productSn)
+			},
 			// 获取货位号
 			getShelfPlace(flag){
 				getProductPlace({ shelfSn: this.nowData.shelfSn }).then(res => {
@@ -344,6 +511,19 @@
 					this.status = "nomore"
 				}
 			},
+			// 提交盘点单
+			submitOrder(){
+				if(this.chooseList.length){
+					uni.navigateTo({
+						url: '/pages/stockCheck/submitStockCheck?stockCheckSn='+this.stockCheckSn+'&type=submit'
+					})
+				}else{
+					uni.showToast({
+						icon: 'none',
+						title: '请先添加产品'
+					})
+				}
+			},
 			// 扫描
 			toScan(){
 				this.mpaasScanModule = uni.requireNativePlugin("wss-scan")
@@ -359,7 +539,6 @@
 					}
 				},
 				(result) => {
-					console.log(result)
 					if(result.scanStatus == 1){
 						this.scanResult(result)
 					}
@@ -379,7 +558,6 @@
 				}else{
 					params.qrCode = data.scanValue
 				}
-				
 				getShelfProductList(params).then(res => {
 					console.log(res)
 					if(res.status == 200){
@@ -467,6 +645,23 @@
 					opacity: 0.6;
 					background-color: #f8f8f8;
 				}
+				.pimgs{
+					position: relative;
+					border:2rpx solid #eee;
+					border-radius: 15rpx;
+					padding: 5rpx;
+					> text{
+						position: absolute;
+						left: 0;
+						bottom:0;
+						z-index: 500;
+						width: 100%;
+						text-align: center;
+						background: rgba(255, 0, 0, 0.3);
+						color: #fff;
+						font-size: 20upx;
+					}
+				}
 				.item-detail{
 					margin-top: 10rpx;
 					display: flex;
@@ -587,7 +782,7 @@
 		position: fixed;
 		width: 100%;
 		background: rgba(0,0,0,0.5);
-		z-index: 10000;
+		z-index: 900;
 		bottom: 100rpx;
 		top: 0;
 	}
@@ -633,12 +828,15 @@
 			}
 		}
 		.cpb_cart-list{
-			padding: 20rpx 30rpx;
+			padding: 20rpx 0;
 			overflow: auto;
 			flex-grow: 1;
 			> view{
 				margin-bottom: 20rpx;
 			}
+			.nav-right-item{
+				padding: 0 30upx;
+			}
 			.item-name{
 				font-size: 30rpx;
 				text{
@@ -664,6 +862,7 @@
 						align-items: center;
 						.item-detail-text{
 							color: #999;
+							margin-left: 20upx;
 						}
 					}
 				}

+ 260 - 0
pages/stockCheck/submitStockCheck.vue

@@ -0,0 +1,260 @@
+<template>
+	<view class="content flex flex_column">
+		<view class="head-info" v-if="detail">
+			<view>
+				<text>货架名称</text>
+				<view>{{detail.shelfName}}</view>
+			</view>
+			<view>
+				<text>盘点日期</text>
+				<view>{{detail.checkDate}}</view>
+			</view>
+			<view>
+				<text>盘点人</text>
+				<view>{{detail.checkPersonName}}</view>
+			</view>
+			<view>
+				<text>备注</text>
+				<view>
+					<u-input v-if="type=='submit'" v-model="remarks" placeholder="请输入备注" input-align="right" type="textarea" :height="60" :auto-height="true" />
+					<text v-else>{{detail.remarks}}</text>
+				</view>
+			</view>
+		</view>
+		<view class="detail flex_1">
+			<view class="detail-tongji" v-if="detail">
+				<view>盘盈总数量:<text>{{detail.totalProfitQty}}</text>;盘盈总金额:<text>{{detail.totalProfitCost}}</text>;</view>
+				<view>盘亏总数量:<text>{{detail.totalLossQty}}</text>;盘亏总金额:<text>{{detail.totalLossCost}}</text>;</view>
+				<view>盈亏总数量:<text>{{detail.totalProfitLossQty}}</text>;盈亏总金额:<text>{{detail.totalProfitLossCost}}</text>;</view>
+			</view>
+			<view class="cpb_cart-list">
+				<view class="nav-right-item flex" v-for="(item, index) in chooseList" :key="item.id" >
+					<view class="uni-col-2">
+						<u-image :src="item.product&&item.product.images?item.product.images:`../../static/${$config('themePath')}/def_img@2x.png`" width="100" height="100" border-radius="30"></u-image>
+					</view>
+					<view class="item-info uni-col-10">
+						<view class="item-name">
+							<text>{{item.shelfPlaceCode}}</text>
+							{{item.productCode}}
+						</view>
+						<view class="item-detail">
+							<view class="item-detail-info">
+								<view class="flex justify_between">
+									<view>
+										<text class="item-detail-text">
+											可用:
+										</text>
+										{{item.stockQty||0}}
+									</view>
+									<view>
+										<text class="item-detail-text">
+											冻结:
+										</text>
+										{{item.freezeQty||0}}
+									</view>
+									<view>
+										<text class="item-detail-text">
+											实际可用:
+										</text>
+										<text class="red">
+											{{item.checkQty||0}}
+										</text>
+									</view>
+								</view>
+								<view class="flex justify_between">
+									<view>
+										<text class="item-detail-text">
+											结算价:
+										</text>
+										¥{{item.cost||0}}
+									</view>
+									<view>
+										<text class="item-detail-text">
+											盈亏:
+										</text>
+										{{item.checkProfitLossQty||0}}
+										(¥{{item.checkProfitLossCost||0}})
+									</view>
+								</view>
+							</view>
+						</view>
+					</view>
+				</view>
+			</view>
+		</view>
+		<!-- 底部栏 -->
+		<view class="footer-bar flex justify_between align_center" v-if="type=='submit'">
+			<u-button size="medium" @click="goback" shape="circle" type="default" hover-class="none" >继续盘点</u-button>
+			<u-button size="medium" @click="submitOrder" :custom-style="customBtnStyle" shape="circle" type="primary" hover-class="none" >盘点完成</u-button>
+		</view>
+	</view>
+</template>
+
+<script>
+	import {
+		stockCheckDetailQueryList, 
+		stockCheckBySn, 
+		stockCheckConfirm
+	} from '@/api/stockCheck'
+	import { clzConfirm } from '@/libs/tools'
+	export default {
+		data() {
+			return {
+				customBtnStyle: {  //  自定义按钮样式
+					borderColor: this.$config('primaryColor'),
+					backgroundColor: this.$config('primaryColor'),
+					color: '#fff'
+				},
+				stockCheckSn: null,
+				remarks: '',
+				detail: null,
+				chooseList: [],
+				type: ''
+			}
+		},
+		onLoad(opts) {
+			this.stockCheckSn = opts.stockCheckSn
+			this.type = opts.type
+			this.getDetail()
+			this.getChooseList()
+			if(this.type == 'view'){
+				uni.setNavigationBarTitle({
+					title: '盘点单详情'
+				})
+			}
+		},
+		methods: {
+			// 详细
+			getDetail(){
+				stockCheckBySn({stockCheckSn: this.stockCheckSn}).then(res => {
+					this.detail = res.data || null
+				})
+			},
+			// 获取盘点明细列表
+			getChooseList(){
+				stockCheckDetailQueryList({
+					stockCheckSn: this.stockCheckSn
+				}).then(res => {
+					this.chooseList = res.data || []
+				})
+			},
+			// 盘点完成
+			submitOrder(){
+				const _this = this
+				clzConfirm({
+				  title: '提示',
+				  content: '盘点完成后,无法再修改数据,确认盘点完成吗?',
+				  success (ret) {
+					if (ret.confirm || ret.index == 0) {
+						uni.showLoading({
+							title:"正在提交.."
+						})
+						stockCheckConfirm({
+							remarks: _this.remarks,
+							stockCheckSn: _this.stockCheckSn
+						}).then(res => {
+							if(res.status == 200 && res.data){
+								_this.goback()
+								uni.$emit("resetStockCheck")
+							}
+							uni.hideLoading()
+						})
+					}
+				  }
+				})
+			},
+			goback(){
+				uni.navigateBack()
+			}
+		}
+	}
+</script>
+
+<style lang="less">
+	.content{
+		width:100%;
+		height: 100vh;
+		background-color: #fff;
+		.head-info{
+			padding: 0 30upx;
+			> view{
+				display: flex;
+				justify-content: space-between;
+				padding: 15upx 10upx;
+				color:#666;
+				> text{
+					color: #999;
+					width: 150rpx;
+				}
+				border-bottom:2rpx solid #f8f8f8;
+				> view{
+					width: 80%;
+					text-align: right;
+					word-break: break-all;
+				}
+			}
+		}
+		.detail{
+			flex-grow: 1;
+			overflow: auto;
+			.detail-tongji{
+				padding: 15upx 30upx;
+				> view{
+					padding: 10upx;
+					color:#999;
+					text{
+						color: #666;
+					}
+				}
+				border-top:10rpx solid #f8f8f8;
+				border-bottom:10rpx solid #f8f8f8;
+			}
+		}
+		.cpb_cart-list{
+			padding: 10upx 30upx;
+			> view{
+				border-bottom:2rpx solid #f8f8f8;
+				padding: 15upx 0;
+			}
+			.item-name{
+				font-size: 30rpx;
+				text{
+					background: #eef6ff;
+					color: #174b76;
+					border-radius: 1em;
+					font-size: 0.8em;
+					padding: 0 0.5em;
+					margin-right: 10upx;
+				}
+				margin-bottom: 10upx;
+			}
+			.item-info{
+				flex-grow: 1;
+				padding-left: 0.2em;
+			}
+			.item-detail{
+				.item-detail-info{
+					padding: 10upx 0 4upx;
+					font-size: 24upx;
+					> view{
+						padding-bottom: 10rpx;
+						align-items: center;
+						.item-detail-text{
+							color: #999;
+						}
+						.red{
+							color: red;
+						}
+					}
+				}
+			}
+		}
+		.footer-bar{
+			background-color: #f8f8f8;
+			padding: 20upx;
+			button{
+				width: 300upx;
+			}
+		}
+	}
+</style>