Browse Source

补货签收

chenrui 3 năm trước cách đây
mục cha
commit
e967e72669

+ 18 - 0
api/shelfReplenish.js

@@ -11,6 +11,16 @@ export const shelfReplenishList = (params) => {
 		method: 'post'
 	})
 }
+//  补货单  详情
+export const shelfReplenishDetail = (params) => {
+  const url = `shelfReplenish/findBySn/${params.sn}`
+  delete params.sn
+  return axios.request({
+    url: url,
+    data: params,
+    method: 'get'
+  })
+}
 //  补货单 明细列表 不分页
 export const shelfReplenishDetailList = (params) => {
   return axios.request({
@@ -34,4 +44,12 @@ export const shelfReplenishConfirm = (params) => {
     data: params,
     method: 'post'
   })
+}
+//  补货单 确认签收
+export const shelfReplenishPutStock = (params) => {
+  return axios.request({
+    url: 'shelfReplenish/putStock',
+    data: params,
+    method: 'post'
+  })
 }

+ 8 - 0
pages.json

@@ -93,6 +93,14 @@
 				"navigationBarTitleText": "补货确认",
 				"enablePullDownRefresh": false
 			}
+		},
+		{
+			"path" : "pages/replenishmentManage/signWarehousing",
+			"style" :
+			{
+				"navigationBarTitleText": "补货签收",
+				"enablePullDownRefresh": false
+			}
 		}
         ,{
             "path" : "pages/common/printTag/printTag",

+ 39 - 17
pages/common/partList.vue

@@ -1,10 +1,8 @@
 <template>
 	<view class="partList-box">
 		<view class="partList-title flex align_center justify_between">
-			<text>配件列表</text>
-			<view>
-                  {{list.length}}款,共<text>{{totalNums}}</text>件
-            </view>
+			<text>{{title}}</text>
+			<view>{{list.length}}款,共<text>{{totalNums}}</text>件</view>
 		</view>
 		<view class="partList-list">
 			<view class="partList-list-box" v-for="item in partList" :key="item.id">
@@ -12,41 +10,52 @@
 					<view class="checkbox" v-if="model == 'checkbox'"><u-checkbox v-model="item.checked" :name="item.id" @change="checkChange" size="40" shape="circle"></u-checkbox></view>
 					<view class="flex align_center flex_1">
 						<view class="pimgs">
-							<u-image width="128" height="128" border-radius="10"></u-image>
+							<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="pinfo">
-							<view class="pname">
-								{{item.productName}}
-							</view>
+							<view class="pname" v-if="pageType=='replenishmentSign'">{{item.product&&item.product.name?item.product.name:'--'}}</view>
+							<view class="pname" v-else>{{item.productName}}</view>
 							<view class="ptxt flex align_center justify_between">
 								<view>
-									<text class="pcode">{{item.productCode}}</text>
+									<text class="pcode" v-if="pageType=='replenishmentSign'">{{item.product&&item.product.code?item.product.code:'--'}}</text>
+									<text class="pcode" v-else>{{item.productCode}}</text>
 								</view>
-								<view v-if="pageType=''">
-								  数量:<text class="pnums">{{item.qty}}个</text>
+								<view v-if="pageType=='replenishmentSign'">
+								  实发数量:<text class="pnums">{{item.confirmQty}}个</text>
 								</view>
-								<view v-if="pageType='recall'">
+								<view v-if="pageType=='recall'">
 								  调回数量:<text class="pnums">{{item.qty}}个</text>
 								</view>
 							</view>
 						</view>
 					</view>
 				</view>
+				<!-- 有复选框 -->
 				<view v-if="model == 'checkbox'" class="ptools flex align_center justify_between">
 					<view></view>
-					<view class="pcurnums flex align_center" v-if="pageType=''">
+					<view class="pcurnums flex align_center" v-if="pageType==''">
 						<text>数量</text>
 						<view class="u-ninput">
 							<u-number-box color="#000" bg-color="#fff" v-model="item.retQty" :min="1" :max="item.qty"></u-number-box>
 						</view>
 					</view>
-					<view class="pcurnums flex align_center" v-if="pageType='recall'">
+					<view class="pcurnums flex align_center" v-if="pageType=='recall'">
 						<text>实退数量</text>
 						<view class="u-ninput">
 							<u-number-box color="#000" bg-color="#fff" v-model="item.quitQty" :min="1" :max="item.qty"></u-number-box>
 						</view>
 					</view>
 				</view>
+				<!-- 无复选框 -->
+				<view v-if="model == 'view'" class="ptools flex align_center justify_between">
+					<view></view>
+					<view class="pcurnums flex align_center" v-if="pageType=='replenishmentSign'">
+						<text>入库数量</text>
+						<view class="u-ninput">
+							<u-number-box color="#000" bg-color="#fff" v-model="item.putQty" @change="numberChange" :min="0" :max="item.confirmQty"></u-number-box>
+						</view>
+					</view>
+				</view>
 			</view>
 			<view class="nodata" v-if="list.length==0">
 				<u-empty :src="`/static/${$config('themePath')}/def_no_data@3x.png`" icon-size="120" :text="noDataText" img-width="120" mode="list"></u-empty>
@@ -77,7 +86,7 @@
 				type: String,
 				default: 'checkbox'
 			},
-			// 那个功能页面调用,展示不同的字段,recall: 调回单,
+			// 那个功能页面调用,展示不同的字段,recall: 调回单,replenishmentSign:补货签收
 			fromPage: {
 				type: String,
 				default: ''
@@ -85,8 +94,13 @@
 		},
 		watch: {
 			list(newValue, oldValue) {
+				const _this = this
 				newValue.map(item => {
-					this.totalNums = this.totalNums + item.qty
+					if(_this.pageType=='replenishmentSign'){  // 补货签收
+						this.totalNums = this.totalNums + item.putQty
+					}else{
+						this.totalNums = this.totalNums + item.qty
+					}
 					item.quitQty = item.qty
 					item.checked = false
 				})
@@ -94,11 +108,15 @@
 				this.pageType = this.fromPage
 			}
 		},
+		onLoad() {
+			this.theme = getApp().globalData.theme
+		},
 		data() {
 			return {
 				partList: this.list,
 				totalNums: 0,
-				pageType: this.fromPage
+				pageType: this.fromPage,
+				theme: ''
 			}
 		},
 		methods: {
@@ -127,6 +145,10 @@
 			// 获取所有数据
 			getAllData(){
 				return this.partList
+			},
+			// 数量 change
+			numberChange(value, index){
+				this.$emit('numberChange', value, index)
 			}
 		}
 	}

+ 47 - 20
pages/replenishmentManage/confirm.vue

@@ -8,7 +8,9 @@
 					<view class="item-code">{{item.product&&item.product.code?item.product.code:'--'}}</view>
 					<view class="item-num">
 						<view class="num-t">x {{item.qty||item.qty==0?item.qty:'--'}} {{item.product&&item.product.unit?item.product.unit:'--'}}</view>
-						<u-number-box class="num-v" v-model="item.confirmQty" @change="handlerChange" :min="0" :max="item.qty" color="#000"></u-number-box>
+						<view class="num-v">
+							<u-number-box color="#000" bg-color="#fff" v-model="item.confirmQty" @change="handlerChange" :min="0" :max="item.qty"></u-number-box>
+						</view>
 					</view>
 				</view>
 			</view>
@@ -16,15 +18,19 @@
 		<view class="replenishment-confirm-footer">
 			<u-button @click="confirmModal=true" type="success" :custom-style="customStyle" hover-class="none" shape="circle">确定补货({{confirmQty}}/{{totalQty}})</u-button>
 		</view>
+		<!-- 确认弹框 -->
 		<common-modal :openModal="confirmModal" content="确认对该数字货架进行补货吗?" confirmText="确认补货" @confirm="modalConfirm" @close="confirmModal=false" />
+		<!-- 库存不足 弹框 -->
+		<stock-modal :openModal="stockModal" :list="stockList" :params="paramsData" @confirm="modalStock" @close="stockModal=false" />
 	</view>
 </template>
 
 <script>
 	import commonModal from '@/pages/common/commonModal.vue'
+	import stockModal from './stockModal.vue'
 	import { shelfReplenishDetailList, shelfReplenishDetailStock, shelfReplenishConfirm } from '@/api/shelfReplenish'
 	export default {
-		components: { commonModal },
+		components: { commonModal, stockModal },
 		data() {
 			return {
 				listdata: [],
@@ -34,10 +40,13 @@
 					fontSize:'30rpx',
 					background: '#0485F6'
 				},
-				confirmQty: 0,  // 实发数量之合
-				totalQty: 0,  // 应发数量之合
+				confirmQty: 0,  // 实发数量之和
+				totalQty: 0,  // 应发数量之和
+				replenishBillSn: '',
 				confirmModal: false,
-				replenishBillSn: ''
+				stockModal: false,
+				stockList: [],
+				paramsData: null
 			}
 		},
 		onLoad(options){
@@ -95,14 +104,14 @@
 				// 校验产品库存是否足够
 				shelfReplenishDetailStock(params).then(res => {
 					if (res.status == 200) {
-						// if (res.data && res.data.length > 0) {
-							// this.stockList = res.data
-							// this.validateType = 'confirm'
-							// this.paramsData = params
-							// this.openStockModal = true
-						// } else {
+						if (res.data && res.data.length > 0) {
+							this.stockList = res.data || []
+							this.paramsData = params
+							this.confirmModal = false
+							this.stockModal = true
+						} else {
 							this.confirmFun(params)
-						// }
+						}
 					}
 				})
 			},
@@ -110,22 +119,26 @@
 			confirmFun (params) {
 				shelfReplenishConfirm(params).then(res => {
 					if (res.status == 200) {
-						uni.showToast({icon: 'none', title: '确认补货成功'})
-						uni.$emit('refreshBL')
-						uni.navigateTo({ url: "/pages/replenishmentManage/replenishmentList" })
+						if(res.status == 200){
+							uni.$emit('refreshBL')
+							uni.navigateBack()
+						}
+						this.toashMsg(res.message)
 					}
 				})
 			},
+			// 库存不足  confirm
+			modalStock(params){
+				this.stockModal = false
+				this.confirmFun(params)
+			}
 		}
 	}
 </script>
 
 <style lang="scss" scoped>
-	page {
-		height: 100%;
-		background-color: #fff;
-	}
 	.replenishment-confirm-wrap{
+		background-color: #fff;
 		position: relative;
 		width: 100%;
 		height: 100%;
@@ -165,7 +178,21 @@
 							font-size: 26upx;
 						}
 						.num-v{
-							
+							border: 2rpx solid #eee;
+							border-radius: 50rpx;
+							padding: 0 6rpx;
+						}
+						/deep/ .u-icon-disabled{
+							background: #fff!important;
+						}
+						/deep/ .u-number-input{
+							margin: 0 0;
+							border: 2rpx solid #eee;
+							border-top: 0;
+							border-bottom: 0;
+						}
+						/deep/ .u-icon-plus, /deep/ .u-icon-minus{
+							border-radius: 50rpx;
 						}
 					}
 				}

+ 1 - 1
pages/replenishmentManage/replenishmentList.vue

@@ -177,7 +177,7 @@
 				}else if(item.billState=='WAIT_OUT_STOCK'){ // 待出库
 					uni.navigateTo({ url: "/pages/replenishmentManage/replenishmentList?sn="+item.replenishBillSn })
 				}else if(item.billState=='WAIT_CHECK'){ // 待签收
-					uni.navigateTo({ url: "/pages/replenishmentManage/replenishmentList?sn="+item.replenishBillSn })
+					uni.navigateTo({ url: "/pages/replenishmentManage/signWarehousing?sn="+item.replenishBillSn })
 				}else{
 					uni.navigateTo({ url: "/pages/replenishmentManage/replenishmentList?sn="+item.replenishBillSn })
 				}

+ 204 - 0
pages/replenishmentManage/signWarehousing.vue

@@ -0,0 +1,204 @@
+<template>
+	<view class="replenishment-putWarehousing-wrap" :style="`backgroundImage:linear-gradient(180deg, ${$config('primaryColor')}, #F5F6F7 12%)`">
+		<view class="replenishment-putWarehousing-body">
+			<view class="head-info" v-if="basicInfoData">
+				<view class="states">
+					<view>
+						<u-icon name="icon_warehousing" custom-prefix="iscm-icon" size="48"></u-icon>
+						<text>待签收</text>
+					</view>
+				</view>
+				<view>
+					<view class="label"><u-icon name="icon_delivery" custom-prefix="iscm-icon" size="32"></u-icon><text>配送方式</text></view>
+					<view>{{basicInfoData.dispatchTypeDictValue || '--'}}</view>
+				</view>
+				<view>
+					<view class="label"><u-icon name="icon_remark" custom-prefix="iscm-icon" size="32"></u-icon><text>出库备注</text></view>
+					<view class="info-txt">{{basicInfoData.remarks || '--'}}</view>
+				</view>
+			</view>
+			<view class="part-list">
+				<!-- 补货产品 -->
+				<partList :list="partList" title="补货产品" model="view" fromPage="replenishmentSign" ref="partList" noDataText="暂无产品" @numberChange="numberChange"></partList>
+			</view>
+		</view>
+		<view class="replenishment-putWarehousing-footer">
+			<u-button @click="confirmModal=true" type="success" :custom-style="customStyle" hover-class="none" shape="circle">确定签收({{confirmQty}}/{{totalQty}})</u-button>
+		</view>
+		<!-- 确认弹框 -->
+		<common-modal :openModal="confirmModal" content="签收后数字货架的产品数量将增加,确认签收吗?" confirmText="确认签收" @confirm="modalConfirm" @close="confirmModal=false" />
+	</view>
+</template>
+
+<script>
+	import commonModal from '@/pages/common/commonModal.vue'
+	import { shelfReplenishDetail, shelfReplenishDetailList, shelfReplenishPutStock } from '@/api/shelfReplenish'
+	import partList from '@/pages/common/partList.vue'
+	export default {
+		components: { partList, commonModal },
+		data() {
+			return {
+				allChecked: false,
+				replenishBillSn: '',
+				basicInfoData:null,
+				partList: [],
+				confirmQty: 0,  // 实发数量之和
+				totalQty: 0,  // 应发数量之和
+				customStyle: {
+					borderRadius:'100rpx',
+					fontSize:'30rpx',
+					background: '#0485F6'
+				},
+				confirmModal: false
+			}
+		},
+		onReady() {
+			uni.setNavigationBarColor({
+				frontColor: '#ffffff',
+				backgroundColor: this.$config('primaryColor')
+			})
+		},
+		onLoad(option) {
+			this.replenishBillSn = option.replenishBillSn
+			this.getDetail()
+			this.getPartList()
+		},
+		methods: {
+			// 查询详情
+			getDetail(){
+				shelfReplenishDetail({ sn: this.replenishBillSn }).then(res => {
+					if(res.status == 200){
+						this.basicInfoData = res.data || null
+					}else{
+						this.basicInfoData = null
+					}
+				})
+			},
+			// 查询列表
+			getPartList(){
+				const _this = this
+				shelfReplenishDetailList({ replenishBillSn: this.replenishBillSn }).then(res => {
+					if(res.status == 200 && res.data){
+						_this.totalQty = 0
+						_this.confirmQty = 0
+						res.data.map(item =>{
+							item.confirmQty = item.confirmQty ? Number(item.confirmQty) : 0
+							item.putQty = item.confirmQty ? Number(item.confirmQty) : 0
+							if(item.confirmQty && Number(item.confirmQty)){
+								_this.totalQty += Number(item.confirmQty)
+							}
+							if(item.putQty && Number(item.putQty)){
+								_this.confirmQty += Number(item.putQty)
+							}
+						})
+						this.partList = res.data || []
+					}else{
+						this.partList = []
+					}
+				})
+			},
+			// 确认签收 confirm
+			modalConfirm(){
+				const arr = []
+				this.partList.map((item, index) => {
+				  if (item.putQty || item.putQty == 0) {
+				    arr.push({ productSn: item.productSn, putQty: item.putQty })
+				  }
+				})
+				const params = {
+				  replenishBillSn: this.replenishBillSn,
+				  detailList: arr
+				}
+				shelfReplenishPutStock(params).then(res => {
+					if(res.status == 200){
+						uni.$emit('refreshBL')
+						uni.navigateBack()
+					}
+					this.toashMsg(res.message)
+				})
+			},
+			// 数量 change
+			numberChange(value, index){
+				const _this = this
+				this.confirmQty = 0
+				let list = this.$refs.partList.getAllData()
+				list.map(item => {
+					if(item.putQty && Number(item.putQty)){
+						_this.confirmQty += Number(item.putQty)
+					}
+				})
+			}
+		}
+	}
+</script>
+
+<style lang="less">
+.replenishment-putWarehousing-wrap{
+	position: relative;
+	width: 100%;
+	height: 100%;
+	overflow: hidden;
+	padding-bottom: 136upx;
+	.replenishment-putWarehousing-body{
+		padding: 0 30rpx;
+		height: 100%;
+		overflow: auto;
+		> view{
+			padding: 10rpx 25rpx;
+			background-color: #fff;
+			margin-bottom: 20rpx;
+			border-radius: 25rpx;
+			box-shadow: 2rpx 3rpx 5rpx #eee;
+		}
+		.head-info{
+			.states{
+				border: 0;
+				padding: 20rpx 0;
+				> view{
+					color: #191919;
+					text-align: center;
+					font-size: 40rpx;
+					text{
+						margin-left: 20rpx;
+					}
+				}
+			}
+			.info-txt{
+				word-break: break-word;
+			}
+			font-size: 30rpx;
+			> view{
+				display: flex;
+				border-bottom: 2rpx solid #f5f5f5;
+				padding: 20rpx 0;
+				> view:last-child{
+					flex-grow: 1;
+					width: 80%;
+				}
+				&:last-child{
+					border:0;
+				}
+			}
+			.label{
+				display: flex;
+				align-items: center;
+				width: 220rpx;
+				height: 44rpx;
+				color: #7C7D7E;
+				text{
+					margin-left: 10rpx;
+				}
+			}
+		}
+	}
+	.replenishment-putWarehousing-footer{
+		padding: 26upx 32upx 30upx;
+		background-color: #fff;
+		position: fixed;
+		left: 0;
+		bottom: 0;
+		width: 100%;
+		box-shadow: 3px 1px 7px #eee;
+	}
+}
+</style>

+ 132 - 0
pages/replenishmentManage/stockModal.vue

@@ -0,0 +1,132 @@
+<template>
+	<u-mask class="stockModal" :show="isShow" :mask-click-able="false">
+		<view class="modal-con">
+			<view class="modal-title">以下产品库存不足<br/>确认继续补货吗?</view>
+			<scroll-view scroll-y class="modal-main">
+				<view class="modal-box" v-for="(item, index) in list" :key="index">
+					<view class="modal-p-header">
+						<view class="modal-p-code">{{item.product&&item.product.code?item.product.code:'--'}}</view>
+						<view class="modal-p-num">库存<text class="txt-red">{{item.stockQty||item.stockQty==0?item.stockQty:'--'}}</text>/补货<text class="txt-main">{{item.confirmQty||item.confirmQty==0?item.confirmQty:'--'}}</text>{{item.product&&item.product.unit?item.product.unit:'--'}}</view>
+					</view>
+					<view class="modal-p-footer">{{item.product&&item.product.name?item.product.name:'--'}}</view>
+				</view>
+			</scroll-view>	
+			<view class="modal-footer">
+				<view class="button-cancel" @click="isShow=false">返回修改</view>
+				<view class="button-confirm" @click="handleConfirm">仍然补货</view>
+			</view>
+		</view>
+	</u-mask>
+</template>
+
+<script>
+	export default {
+		props: {
+			openModal: { //  弹框显示状态
+				type: Boolean,
+				default: false
+			},
+			list: { //  库存不足产品信息
+				type: Array,
+				default: () => {
+					return []
+				}
+			},
+			params: {
+			  type: Object,
+			  default: () => {
+			    return {}
+			  }
+			}
+		},
+		data() {
+			return {
+				isShow: this.openModal, //  是否打开弹框
+			}
+		},
+		methods: {
+			// 确认
+			handleConfirm(){
+				this.$emit('confirm', this.params)
+			}
+		},
+		watch: {
+			//  父页面传过来的弹框状态
+			openModal (newValue, oldValue) {
+				this.isShow = newValue
+			},
+			//  重定义的弹框状态
+			isShow (newValue, oldValue) {
+			  if (!newValue) {
+			    this.$emit('close')
+			  }
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.stockModal{
+		width: 100%;
+		height: 100%;
+		position: absolute;
+		left: 0;
+		top: 0;
+		.modal-con{
+			width: 78%;
+			margin: 40% auto 0;
+			background-color: #fff;
+			border-radius: 24upx;
+			.modal-title{
+				text-align: center;
+				font-size: 28upx;
+				color: #000;
+				padding: 30upx 30upx 0;
+			}
+			.modal-main{
+				padding: 30upx 20upx 40upx;
+				box-sizing: border-box;
+				height: 400upx;
+				overflow: hidden;
+				.modal-box{
+					padding: 20upx 0;
+					border-top: 1upx dashed #E5E5E5;
+					.modal-p-header{
+						display: flex;
+						justify-content: space-between;
+						align-content: center;
+						color: #999999;
+						margin-bottom: 20upx;
+						.modal-p-num{
+							.txt-red{
+								color: red;
+							}
+							.txt-main{
+								color: #000;
+							}
+						}
+					}
+				}
+			}
+			.modal-footer{
+				font-size: 30upx;
+				display: flex;
+				justify-content: space-between;
+				align-items: center;
+				text-align: center;
+				border-top: 1upx solid #E5E5E5;
+				.button-cancel{
+					color: #999;
+					border-right: 1upx solid #E5E5E5;
+					flex-grow: 1;
+					padding: 20upx 0;
+				}
+				.button-confirm{
+					color: #2A86F4;
+					flex-grow: 1;
+					padding: 20upx 0;
+				}
+			}
+		}
+	}
+</style>