chenrui преди 3 години
родител
ревизия
0fd891c804

+ 1 - 1
pages.json

@@ -71,7 +71,7 @@
             "path" : "pages/shuntBackManage/cancellingStocks",
             "style" :                                                                                    
             {
-                "navigationBarTitleText": "调回退",
+                "navigationBarTitleText": "调回退",
                 "enablePullDownRefresh": false,
 				"titleView":false,
 				// 将回弹属性关掉

+ 6 - 14
pages/common/partList.vue

@@ -13,12 +13,10 @@
 							<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" v-if="pageType=='replenishmentSign'||pageType=='replenishmentOut'||pageType=='manualPrint'||pageType=='replenishmentDetail'||pageType=='replenishmentDetailc'||pageType=='scanCodePrint'">{{item.product&&item.product.name?item.product.name:'--'}}</view>
-							<view class="pname" v-else>{{item.productName}}</view>
+							<view class="pname">{{item.product&&item.product.name?item.product.name:'--'}}</view>
 							<view class="ptxt flex align_center justify_between">
 								<view>
-									<text class="pcode" v-if="pageType=='replenishmentSign'||pageType=='replenishmentOut'||pageType=='manualPrint'||pageType=='replenishmentDetail'||pageType=='replenishmentDetailc'||pageType=='scanCodePrint'">{{item.product&&item.product.code?item.product.code:'--'}}</text>
-									<text class="pcode" v-else>{{item.productCode}}</text>
+									<text class="pcode">{{item.product&&item.product.code?item.product.code:'--'}}</text>
 								</view>
 								<view v-if="pageType=='replenishmentSign'||pageType=='manualPrint'||pageType=='scanCodePrint'">
 									实发数量:<text class="pnums">{{item.confirmQty||item.confirmQty==0?item.confirmQty:'--'}}{{item.product&&item.product.unit?item.product.unit:'--'}}</text>
@@ -36,7 +34,8 @@
 									{{item.product&&item.product.unit?item.product.unit:'--'}}
 								</view>
 								<view v-if="pageType=='recall'">
-								  调回数量:<text class="pnums">{{item.qty}}个</text>
+								  调回数量:<text class="pnums">{{item.qty||item.qty==0?item.qty:'--'}}</text>
+									{{item.product&&item.product.unit?item.product.unit:'--'}}
 								</view>
 							</view>
 						</view>
@@ -45,16 +44,10 @@
 				<!-- 有复选框 -->
 				<view v-if="model == 'checkbox'" class="ptools flex align_center justify_between">
 					<view></view>
-					<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'">
 						<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>
+							<u-number-box color="#000" bg-color="#fff" v-model="item.confirmQty" :min="1" :max="item.qty"></u-number-box>
 						</view>
 					</view>
 					<view class="pcurnums flex align_center" v-if="pageType=='manualPrint'">
@@ -104,7 +97,7 @@
 				type: String,
 				default: 'checkbox'
 			},
-			// 那个功能页面调用,展示不同的字段,recall: 调回,replenishmentSign:补货签收,replenishmentOut:补货出库,manualPrint:手动打印,replenishmentDetail:补货详情-已完成,replenishmentDetailc:补货详情-已取消,scanCodePrint:扫码打印
+			// 那个功能页面调用,展示不同的字段,recall: 调回退库,replenishmentSign:补货签收,replenishmentOut:补货出库,manualPrint:手动打印,replenishmentDetail:补货详情-已完成,replenishmentDetailc:补货详情-已取消,scanCodePrint:扫码打印
 			fromPage: {
 				type: String,
 				default: ''
@@ -130,7 +123,6 @@
 					}else{
 						this.totalNums = this.totalNums + item.qty
 					}
-					item.quitQty = item.qty
 					item.checked = false
 				})
 				this.partList = JSON.parse(JSON.stringify(newValue))

+ 10 - 14
pages/latePlay/chooseBulk.vue

@@ -3,12 +3,12 @@
 		<view class="moreShelfPart-search">
 			<u-search
 			placeholder="请输入货柜名称搜索" 
-			v-model="queryWord" 
+			v-model="shelfName" 
 			:show-action="isGobleSearch" 
 			@focus="isGobleSearch=true"
 			@blur="isGobleSearch=false"
-			@custom="searchPart" 
-			@search="searchPart" 
+			@custom="getShelfList" 
+			@search="getShelfList" 
 			@clear="clearSearch"
 			:action-style="{'color': '#fff', 'font-size': '24upx', 'background-color': '#57a3f3', 'border-radius': '6upx', 'padding': '12upx 0'}">
 			</u-search>
@@ -24,7 +24,9 @@
 							<text>{{item.shelfName}}</text>
 						</view>
 						<view class="item-detail">
-							<text class="item-detail-text">西安市未央区常青二路与贞观路交叉口向东100米</text>
+							<text class="item-detail-text">
+								{{item.customerEntity&&item.customerEntity.provinceName}}{{item.customerEntity&&item.customerEntity.cityName}}{{item.customerEntity&&item.customerEntity.countyName}}{{item.customerEntity&&item.customerEntity.customerAddr}}
+							</text>
 						</view>
 					</view>
 				</view>
@@ -44,7 +46,7 @@
 	export default {
 		data() {
 			return {
-				queryWord: '',
+				shelfName: '',
 				isGobleSearch: false,
 				shelfList: [],
 				pageNo:1,
@@ -60,24 +62,18 @@
 		},
 		methods: {
 			clearSearch(){
-				this.queryWord = ''
+				this.shelfName = ''
 				this.pageNo = 1
 				this.shelfList = []
 				this.getShelfList()
 			},
-			// 搜索配件
-			searchPart(){
-				if(this.queryWord != ''){
-					this.getShelfList()
-				}
-			},
 			// 获取数字货架列表
 			getShelfList(){
 				const _this = this
 				let params = {
 				    pageNo: this.pageNo,
 				    pageSize: this.pageSize,
-					queryWord: this.queryWord
+					shelfName: this.shelfName
 				}
 				_this.status = 'loading'
 				getShelfList(params).then(res => {
@@ -114,7 +110,7 @@
 			// 加载更多
 			onreachBottom () {
 				if(this.shelfList.length < this.total ){
-					if(this.isGobleSearch&&this.queryWord==''){
+					if(this.isGobleSearch&&this.shelfName==''){
 						return
 					}
 					this.pageNo++

+ 1 - 1
pages/replenishmentManage/outWarehousing.vue

@@ -14,7 +14,7 @@
 				</view>
 				<view>
 					<view class="label"><u-icon name="icon_position" custom-prefix="iscm-icon" size="32"></u-icon><text>客户地址</text></view>
-					<view class="info-txt">{{basicInfoData.customerAddr || '--'}}</view>
+					<view class="info-txt">{{basicInfoData.customerAddr}}</view>
 				</view>
 			</view>
 			<view class="part-list">

+ 4 - 10
pages/replenishmentManage/replenishmentList.vue

@@ -83,12 +83,6 @@
 				action:'swiperChange', // 操作类型,上划分页,或左右滑动
 			}
 		},
-		onReady() {
-			uni.setNavigationBarColor({
-				frontColor: '#ffffff',
-				backgroundColor: this.$config('primaryColor')
-			})
-		},
 		onLoad(options) {
 			const _this = this
 			if(options&&options.billState){  // 指定单据状态
@@ -107,7 +101,7 @@
 			this.queryByTypeSum()
 		},
 		onUnload() {
-			uni.$off('refreshBL', this.queryByTypeSum)
+			uni.$off('refreshBL')
 		},
 		methods:{
 			// tabs通知swiper切换
@@ -155,7 +149,7 @@
 				let params = {
 					pageNo: this.pageNo,
 					pageSize: this.pageSize,
-					billState: this.tabList[this.current].status=='ALL'?'':this.tabList[this.current].status,
+					billState: this.tabList[this.current].status=='ALL'?'':this.tabList[this.current].status
 				}
 				this.status = "loading"
 				shelfReplenishList(params).then(res => {
@@ -183,8 +177,8 @@
 				}
 				// 左右切换tab
 				if(this.action == 'swiperChange'){
-					this.list = [];
-					this.getRow(1);
+					this.list = []
+					this.getRow(1)
 				}
 			},
 			// 详细页

+ 76 - 29
pages/shuntBackManage/cancellingStocks.vue

@@ -1,20 +1,20 @@
 <template>
 	<view class="cancelStockPages" :style="`backgroundImage:linear-gradient(180deg, ${$config('primaryColor')}, #F5F6F7 12%)`">
 		<view class="cancelStockPages-body">
-			<view class="head-info" v-if="info">
+			<view class="head-info" v-if="basicInfoData">
 				<view class="states">
 					<view>
 						<u-icon name="icon_withdrawal" custom-prefix="iscm-icon" size="48"></u-icon>
-						<text>待退</text>
+						<text>待退</text>
 					</view>
 				</view>
 				<view>
 					<view class="label"><u-icon name="ison_shelf" custom-prefix="iscm-icon" size="32"></u-icon><text>货架名称</text></view>
-					<view>{{info.shelfName}}</view>
+					<view class="info-txt">{{basicInfoData.shelfInfo&&basicInfoData.shelfInfo.shelfName || '--'}}</view>
 				</view>
 				<view>
 					<view class="label"><u-icon name="icon_position" custom-prefix="iscm-icon" size="32"></u-icon><text>客户地址</text></view>
-					<view>{{info.shelfAddress}}</view>
+					<view class="info-txt">{{basicInfoData.customerAddr || '--'}}</view>
 				</view>
 			</view>
 			<view class="part-list">
@@ -30,22 +30,24 @@
 				<u-button @click="submit" shape="circle" :custom-style="{background:$config('primaryColor')}" type="primary">确定退库</u-button>
 			</view>
 		</view>
+		<!-- 确认弹框 -->
+		<common-modal :openModal="confirmModal" content="调回产品将退回至经销商仓库,确认退库吗?" confirmText="确认退库" @confirm="modalConfirm" @close="confirmModal=false" />
 	</view>
 </template>
 
 <script>
+	import commonModal from '@/pages/common/commonModal.vue'
+	import partList from '@/pages/common/partList.vue'
 	import { shelfRecallFindBySn, detailQueryCount, shelfRecallDetail, shelfRecallConfirm } from '@/api/shelfRecall.js'
-	import partList from '../common/partList.vue'
 	export default {
-		components: {
-			partList
-		},
+		components: { commonModal, partList },
 		data() {
 			return {
 				allChecked: false,
 				recallBillSn: '',
-				info:null,
-				partList: []
+				basicInfoData: null,
+				partList: [],
+				confirmModal: false,
 			}
 		},
 		onReady() {
@@ -55,7 +57,7 @@
 			})
 		},
 		onLoad(option) {
-			this.recallBillSn = option.recallBillSn
+			this.recallBillSn = option.sn
 			this.getDetail()
 			this.getPartList()
 		},
@@ -69,17 +71,26 @@
 			},
 			// 查询详情
 			getDetail(){
-				shelfRecallFindBySn({sn:this.recallBillSn}).then(res => {
+				shelfRecallFindBySn({sn: this.recallBillSn}).then(res => {
 					if(res.status == 200){
-						this.info = res.data
+						if(res.status == 200){
+							this.basicInfoData = res.data || null
+						}else{
+							this.basicInfoData = null
+						}
 					}
 				})
 			},
 			// 查询配件列表
 			getPartList(){
-				shelfRecallDetail({recallBillSn:this.recallBillSn}).then(res => {
-					if(res.status == 200){
-						this.partList = res.data.data
+				shelfRecallDetail({ recallBillSn: this.recallBillSn }).then(res => {
+					if(res.status == 200 && res.data){
+						res.data.map(item =>{
+							item.confirmQty = item.qty ? Number(item.qty) : 0
+						})
+						this.partList = res.data || []
+					}else{
+						this.partList = []
 					}
 				})
 			},
@@ -87,30 +98,55 @@
 			submit(){
 				const result =this.$refs.partList.getAllChecked()
 				if(result.length){
-					shelfRecallConfirm().then(res => {
-						if(res.status == 200){
-							uni.$emit("refreshBL")
-							uni.navigateBack()
-						}
-						this.toashMsg(res.message)
-					})
+					this.confirmModal = true
 				}else{
 					this.toashMsg("请选择配件!")
 				}
+			},
+			// 确认退库 confirm
+			modalConfirm(){
+				const result =this.$refs.partList.getAllChecked()
+				const arr = []
+				result.map((item, index) => {
+					if (item.confirmQty || item.confirmQty == 0) {
+						arr.push({
+							productSn: item.productSn,
+							confirmQty: item.confirmQty,
+							recallBillDetailSn: item.recallBillDetailSn
+						})
+					}
+				})
+				const params = {
+					shelfSn: result[0].shelfSn,
+					recallBillSn: this.recallBillSn,
+					recallBillNo: result[0].recallBillNo,
+					detailList: arr
+				}
+				shelfRecallConfirm(params).then(res => {
+					if(res.status == 200){
+						uni.$emit("refreshBL")
+						uni.navigateBack()
+					}
+					this.toashMsg(res.message)
+				})
 			}
 		}
 	}
 </script>
 
 <style lang="less">
+	page {
+		height: 100vh;
+	}
 .cancelStockPages{
+	position: relative;
 	width: 100%;
-	height: 100vh;
-	display: flex;
-	flex-direction: column;
+	height: 100%;
+	overflow: hidden;
+	padding-bottom: 136upx;
 	.cancelStockPages-body{
 		padding: 0 30rpx;
-		flex-grow: 1;
+		height: 100%;
 		overflow: auto;
 		> view{
 			padding: 10rpx 25rpx;
@@ -132,6 +168,9 @@
 					}
 				}
 			}
+			.info-txt{
+				word-break: break-word;
+			}
 			font-size: 30rpx;
 			> view{
 				display: flex;
@@ -158,11 +197,19 @@
 		}
 	}
 	.cancelStockPages-footer{
+		padding: 26upx 32upx 30upx;
 		background-color: #fff;
-		padding: 20rpx 40rpx;
+		position: fixed;
+		left: 0;
+		bottom: 0;
+		width: 100%;
+		box-shadow: 3px 1px 7px #eee;
 		display: flex;
-		align-items: center;
 		justify-content: space-between;
+		align-items: center;
+		.button{
+			width: 45%;
+		}
 	}
 }
 </style>

+ 62 - 63
pages/shuntBackManage/shuntBackList.vue

@@ -1,8 +1,7 @@
 <template>
 	<view class="pagesCons">
 		    <view class="utabs">
-				<u-tabs-swiper ref="uTabs" :list="tabList" name="dispName" :current="current" @change="tabsChange" :is-scroll="false"
-				 swiperWidth="750"></u-tabs-swiper>
+				<u-tabs-swiper ref="uTabs" :list="tabList" name="dispName" :current="current" @change="tabsChange" :is-scroll="false" swiperWidth="750"></u-tabs-swiper>
 			</view>
 			<swiper class="check-list" :current="swiperCurrent" @transition="transition" @change="swiperChange" @animationfinish="animationfinish">
 				<swiper-item class="swiper-item" v-for="(tabs, index) in tabList" :key="index">
@@ -12,17 +11,16 @@
 						v-if="index==current"
 						v-for="(item,sindex) in list" 
 						:key="item.id+'-'+sindex"
-						@click="viewRow(item)"
-						>
+						@click="viewRow(item)" >
 							<view class="check-row">
-								<view>{{item.shelfName}}</view>
+								<view>{{item.shelfInfo&&item.shelfInfo.shelfName}}</view>
 								<view>
-									<text :style="{color:$config('errorColor')}">待退库</text>
+									<text :style="{color: item.billState=='FINISH'?$config('successColor'):item.billState=='CANCEL'?$config('infoColor'):$config('errorColor')}">{{item.billStateDictValue}}</text>
 								</view>
 							</view>
 							<view class="check-col">
 								<view>调货单号:{{item.recallBillNo}}</view>
-								<view>调回数量:{{item.totalConfirmQty}}</view>
+								<view>调回数量:{{(item.totalConfirmQty || item.totalConfirmQty==0)?item.totalConfirmQty:'--'}}</view>
 								<view>{{item.createDate}}</view>
 							</view>
 						 </view>
@@ -46,28 +44,27 @@
 				status: 'loadmore',
 				noDataText: '暂无数据',
 				tabList: [
-					  {
+					{
 						dispName: '全部',
-						typeId: 0,
-						status: ''
-					   },
-					  {
-					    dispName: '待退库',
-					  	typeId: 1,
-						status: '',
-						count: 12
-					  },
-					  {
-					    dispName: '已完成',
-					  	typeId: 2,
-						status: ''
-					  },
-					  {
-					    dispName: '已取消',
-					  	typeId: 3,
-						status: ''
-					  },
-				  ],
+						status: 'ALL',
+						count: 0
+					},
+					{
+						dispName: '待退库',
+						status: 'WAIT_CONFIRM',
+						count: 0
+					},
+					{
+						dispName: '已完成',
+						status: 'FINISH',
+						count: 0
+					},
+					{
+						dispName: '已取消',
+						status: 'CANCEL',
+						count: 0
+					}
+				],
 				current: 0,
 				swiperCurrent: 0,
 				pageNo: 1,
@@ -77,9 +74,21 @@
 				action:'swiperChange', // 操作类型,上划分页,或左右滑动
 			}
 		},
-		onLoad() {
+		onLoad(options) {
+			const _this = this
+			if(options&&options.billState){  // 指定单据状态
+				this.tabList.map((item,index) => {
+					if(item.status == options.billState){
+						_this.swiperCurrent = index
+						_this.current = index
+					}
+				})
+			}else{
+				_this.swiperCurrent = 0
+				_this.current = 0
+			}
 			// 监听整改完成后刷新事件
-			uni.$on('refreshBL',this.pageInit)
+			uni.$on('refreshBL', this.pageInit)
 			this.pageInit()
 		},
 		onUnload() {
@@ -87,14 +96,16 @@
 		},
 		methods:{
 			pageInit(){
-				queryStateCount({billState:'待退货'}).then(res =>{
-					this.tabList[1].count = res.data.totalConfirmQty
+				queryStateCount({}).then(res =>{
+					this.tabList[1].count = res.data.WAIT_CONFIRM || 0
+					this.tabList[2].count = res.data.FINISH || 0
+					this.tabList[3].count = res.data.CANCEL || 0
 					this.getRow(1)
 				})
 			},
 			// tabs通知swiper切换
 			tabsChange(index) {
-				this.swiperCurrent = index;
+				this.swiperCurrent = index
 			},
 			swiperChange(event){
 				this.action = 'swiperChange'
@@ -102,21 +113,21 @@
 			},
 			// swiper-item左右移动,通知tabs的滑块跟随移动
 			transition(e) {
-				let dx = e.detail.dx;
-				this.$refs.uTabs.setDx(dx);
+				let dx = e.detail.dx
+				this.$refs.uTabs.setDx(dx)
 			},
 			// 由于swiper的内部机制问题,快速切换swiper不会触发dx的连续变化,需要在结束时重置状态
 			// swiper滑动结束,分别设置tabs和swiper的状态
 			animationfinish(e) {
-				let current = e.detail.current;
+				let current = e.detail.current
 				let isCurtab = this.current == current
 				if(this.status!="nomore"){
-					let loadData = this.action == 'swiperChange' ? !isCurtab : isCurtab;
+					let loadData = this.action == 'swiperChange' ? !isCurtab : isCurtab
 					if(loadData){
-						this.$refs.uTabs.setFinishCurrent(current);
-						this.swiperCurrent = current;
-						this.current = current;
-						this.resetPage();
+						this.$refs.uTabs.setFinishCurrent(current)
+						this.swiperCurrent = current
+						this.current = current
+						this.resetPage()
 					}
 				}
 			},
@@ -137,7 +148,7 @@
 			  let params = {
 			    pageNo: this.pageNo,
 			    pageSize: this.pageSize,
-			    billState: this.tabList[this.current].status,
+			    billState: this.tabList[this.current].status=='ALL'?'':this.tabList[this.current].status
 			  }
 			  this.status = "loading"
 			  shelfRecallList(params).then(res => {
@@ -165,30 +176,18 @@
 				}
 				// 左右切换tab
 				if(this.action == 'swiperChange'){
-					this.list = [];
-					this.getRow(1);
+					this.list = []
+					this.getRow(1)
 				}
 			},
-			// 待退库
+			// 详细页
 			viewRow(item){
-				// 已完成的
-				uni.navigateTo({
-					url: "/pages/shuntBackManage/cancellingStocks?recallBillSn="+item.recallBillSn
-				})
-			},
-			// 状态颜色处理
-			clsStatus(status){
-				if(status == 'CHECK_PENDING'){
-					return 'dsh'
-				}
-				if(status == 'PENDING'){
-					return 'dzg'
-				}
-				if(status == 'FINISHED'){
-					return 'ywc'
-				}
-				if(status == 'EXPIRED'){
-					return 'ygq'
+				if(item.billState=='WAIT_CONFIRM'){ // 待退库
+					uni.navigateTo({ url: "/pages/shuntBackManage/cancellingStocks?sn="+item.recallBillSn })
+				}else if(item.billState=='FINISH'){ // 已完成
+					// uni.navigateTo({ url: "/pages/replenishmentManage/detail?sn="+item.replenishBillSn+"&type=success" })
+				}else if(item.billState=='CANCEL'){ // 已取消
+					// uni.navigateTo({ url: "/pages/replenishmentManage/detail?sn="+item.replenishBillSn+"&type=cancel" })
 				}
 			}
 		}