소스 검색

对接补货单

chenrui 3 년 전
부모
커밋
7df9c565ba

+ 8 - 0
api/shelfReplenish.js

@@ -69,3 +69,11 @@ export const shelfReplenishQrCode = (params) => {
     method: 'post'
   })
 }
+//  补货单 查询每个状态的数据条数
+export const shelfReplenishStateCount = (params) => {
+  return axios.request({
+    url: 'shelfReplenish/queryStateCount',
+    data: params,
+    method: 'post'
+  })
+}

+ 2 - 1
config/index.js

@@ -6,7 +6,8 @@ const getConfig = (theme) => {
 			themePath: 'default',
 			pro_URL: 'https://car.zyucgj.com/saas/clz/', // 生产地址
 			uat_URL: 'http://md.test.zyucgj.com/saas/clz/', // 预发布地址
-			dev_URL: 'http://192.168.16.107:7300/mock/61aad8ea5688cb3878d81e39/qpls-md/', // 本地地址
+			// dev_URL: 'http://192.168.16.107:7300/mock/61aad8ea5688cb3878d81e39/qpls-md/', // 本地地址
+			dev_URL: 'http://frps.chelingzhu.com:7800/qpls-md/', // 本地地址
 			appName: 'iSCM智慧供应链', // app 名称
 			company: '陕西山海高科信息技术有限公司',
 			loadText:{

+ 3 - 2
libs/axios.js

@@ -12,7 +12,8 @@ const request = (opts, hasToken) => {
 			'Version': curVer.version?curVer.version.replace(/\./g,''):''
 		}
 	if(!hasToken){
-		header.authorization = authorization
+		// header.authorization = authorization
+		header['access-token'] = authorization
 	}	
 	//此token是登录成功后后台返回保存在storage中的
 	let DefaultOpts = {
@@ -75,7 +76,7 @@ const request = (opts, hasToken) => {
 					}
 					resolve(ret)
 				}
-				ret.status = ret.statusCode  // mock数据结构改造
+				// ret.status = ret.statusCode  // mock数据结构改造
 				resolve(ret)
 			}
 		).catch(

+ 5 - 0
libs/validate.js

@@ -2,4 +2,9 @@
 export const isvalidPhone = function (str) {
   const reg = /^1[0-9]{10}$/
   return reg.test(str)
+}
+//  正则数字或大小写字母
+export const isvalidNumLetter = function (str) {
+  const reg = /^[0-9A-Za-z]+$/
+  return reg.test(str)
 }

+ 19 - 7
pages/index/index.vue

@@ -20,6 +20,7 @@
 </template>
 <script>
 	import iconItemsList from '@/components/icon-items-list/icon-items-list.vue';
+	import { shelfReplenishStateCount } from '@/api/shelfReplenish'
 	export default {
 		components: {
 			iconItemsList,
@@ -59,16 +60,16 @@
 					id: 'scanVin',
 					icon: `/static/${this.theme}/navIcon/home_icon_confirm@3x.png`,
 					name: '待确认',
-					url: '/pages/replenishmentManage/replenishmentList?state=1',
+					url: '/pages/replenishmentManage/replenishmentList?billState=WAIT_CONFIRM',
 					target: 'page',
-					count: 10,
+					count: 0,
 					auth: true
 				},
 				{
 					id: 'scanGoods',
 					icon: `/static/${this.theme}/navIcon/home_icon_out@3x.png`,
 					name: '待出库',
-					url: '/pages/replenishmentManage/replenishmentList?state=2',
+					url: '/pages/replenishmentManage/replenishmentList?billState=WAIT_OUT_STOCK',
 					target: 'page',
 					count: 0,
 					auth: true
@@ -76,8 +77,8 @@
 				{
 					id: 'bhrk',
 					icon: `/static/${this.theme}/navIcon/home_icon_warehousing@3x.png`,
-					name: '待入库',
-					url: '/pages/replenishmentManage/replenishmentList?state=3',
+					name: '待签收',
+					url: '/pages/replenishmentManage/replenishmentList?billState=WAIT_CHECK',
 					target: 'page',
 					count: 0,
 					auth: true
@@ -86,12 +87,13 @@
 					id: 'jsgl',
 					icon: `/static/${this.theme}/navIcon/home_icon_entire@3x.png`,
 					name: '全部',
-					url: '/pages/replenishmentManage/replenishmentList?state=0',
+					url: '/pages/replenishmentManage/replenishmentList?billState=ALL',
 					target: 'page',
 					count: 0,
 					auth: true
 				}
 			];
+			this.queryByTypeSum()
 		},
 		onShow() {
 			
@@ -101,7 +103,17 @@
 				uni.navigateTo({
 					url:url
 				})
-			}
+			},
+			// 查询补货单每个状态的数据条数
+			queryByTypeSum () {
+				shelfReplenishStateCount({}).then(res => {
+					if (res.data && res.status == 200) {
+						this.storageRacksNavList[0].count = res.data.WAIT_CONFIRM || 0
+						this.storageRacksNavList[1].count = res.data.WAIT_OUT_STOCK || 0
+						this.storageRacksNavList[2].count = res.data.WAIT_CHECK || 0
+					}
+				})
+			},
 		}
 	}
 </script>

+ 38 - 36
pages/login/login.vue

@@ -7,10 +7,10 @@
 			<image :src="`../../static/${theme}/logo.png`" class="logo"></image>
 			<form class="login-form" @submit="AndroidCheckUpdate">
 				<view class="form-item">
-					<u-input v-model="form.username" :custom-style="{fontSize:'34upx'}" height="110" type="number" clearable maxlength="11" placeholder="请输入手机号/用户名" />
+					<u-input v-model="form.username" :custom-style="{fontSize:'34upx'}" height="110" type="text" clearable placeholder="请输入用户账号" />
 				</view>
 				<view class="form-item">
-					<u-input v-model="form.password" :custom-style="{fontSize:'34upx'}" height="110" type="password" :password-icon="true" maxlength="12" placeholder="请输入密码"/>
+					<u-input v-model="form.password" :custom-style="{fontSize:'34upx'}" height="110" type="password" :password-icon="true" maxlength="50" placeholder="请输入密码"/>
 				</view>
 				<view class="flex-box mt20">
 					<view class="remember-pass">
@@ -43,7 +43,7 @@
 
 <script>
 import { checkVersionToLoadUpdate, setStorageForAppVersion,clzConfirm } from '@/libs/tools'
-import { isvalidPhone } from '@/libs/validate.js';
+import { isvalidNumLetter } from '@/libs/validate.js';
 import { login } from '@/api/user.js';
 import { getSysVersion } from '@/api/data.js'
 export default {
@@ -88,17 +88,18 @@ export default {
 	methods: {
 		// 版本更新
 		AndroidCheckUpdate(){
-			let _this = this
-			let version = getApp().globalData.version
-			uni.showLoading({
-				title: '正在登录...'
-			});
-			getSysVersion({versionType:version.platform=='android'?'ANDROID':'IOS'}).then(ret => {
-				if(ret.status == 200){
-					this.$store.state.vuex_versionInfo = ret.data
-					checkVersionToLoadUpdate(ret.data,0,_this.formSubmit);
-				}
-			})
+			// let _this = this
+			// let version = getApp().globalData.version
+			// uni.showLoading({
+			// 	title: '正在登录...'
+			// });
+			// getSysVersion({versionType:version.platform=='android'?'ANDROID':'IOS'}).then(ret => {
+			// 	if(ret.status == 200){
+			// 		this.$store.state.vuex_versionInfo = ret.data
+			// 		checkVersionToLoadUpdate(ret.data,0,_this.formSubmit);
+			// 	}
+			// })
+			this.formSubmit()
 		},
 		// 过滤权限code
 		fiterAuthCode(data) {
@@ -110,19 +111,19 @@ export default {
 			const _this = this;
 			//  表单校验
 			if (_this.form.username == '') {
-				uni.showToast({ icon: 'none', title: '请输入用户' });
+				uni.showToast({ icon: 'none', title: '请输入用户账号' });
 				return;
 			}
-			if (!isvalidPhone(_this.form.username)) {
-				uni.showToast({ icon: 'none', title: '请输入正确的手机号码' });
+			if (!isvalidNumLetter(_this.form.username)) {
+				uni.showToast({ icon: 'none', title: '用户账号为数字或大小写字母组成!' });
 				return;
 			}
 			if (_this.form.password == '') {
 				uni.showToast({ icon: 'none', title: '请输入密码' });
 				return;
 			}
-			if (_this.form.password.length < 6 || _this.form.password.length > 12) {
-				uni.showToast({ icon: 'none', title: '请输入6-12位密码' });
+			if (_this.form.password.length < 6 || _this.form.password.length > 50) {
+				uni.showToast({ icon: 'none', title: '请输入6-50位密码' });
 				return;
 			}
 			if (!_this.isAuthuserYs) {
@@ -134,22 +135,24 @@ export default {
 			login(_this.form).then(res => {
 				uni.hideLoading();
 				if (res.status == 200) {
-					// _this.$u.vuex('vuex_token', 'Bearer ' + res.access_token);
-					// _this.$u.vuex('vuex_userData', _this.fiterAuthCode(res.auth_user));
-					// getApp().globalData.token = 'Bearer ' + res.access_token;
-					// //登录成功将用户名密码存储到用户本地
-					// if (_this.isRemember) {
-					// 	//用户勾选“记住密码”
-					// 	_this.$u.vuex('vuex_user.account', _this.form.username);
-					// 	_this.$u.vuex('vuex_user.password', _this.form.password);
-					// } else {
-					// 	//用户没有勾选“记住密码”
-					// 	_this.$u.vuex('vuex_user.account', '');
-					// 	_this.$u.vuex('vuex_user.password', '');
-					// 	_this.form.username = '';
-					// 	_this.form.password = '';
-					// }
-					// uni.setStorageSync('loginTimeOut', 'NO');
+					// _this.$u.vuex('vuex_token', 'Bearer ' + res.data.access_token);
+					// _this.$u.vuex('vuex_userData', _this.fiterAuthCode(res.data.auth_user));
+					// getApp().globalData.token = 'Bearer ' + res.data.access_token;
+					_this.$u.vuex('vuex_token', res.data.access_token);
+					getApp().globalData.token = res.data.access_token;
+					//登录成功将用户名密码存储到用户本地
+					if (_this.isRemember) {
+						//用户勾选“记住密码”
+						_this.$u.vuex('vuex_user.account', _this.form.username);
+						_this.$u.vuex('vuex_user.password', _this.form.password);
+					} else {
+						//用户没有勾选“记住密码”
+						_this.$u.vuex('vuex_user.account', '');
+						_this.$u.vuex('vuex_user.password', '');
+						_this.form.username = '';
+						_this.form.password = '';
+					}
+					uni.setStorageSync('loginTimeOut', 'NO');
 					_this.toMain();
 				} else {
 					uni.showToast({ icon: 'none', title: res.message });
@@ -157,7 +160,6 @@ export default {
 			});
 		},
 		toMain() {
-			console.log('toMain')
 			// 跳转到首页
 			uni.switchTab({
 				url: '/pages/index/index'

+ 11 - 2
pages/replenishmentManage/confirm.vue

@@ -14,8 +14,9 @@
 					</view>
 				</view>
 			</view>
+			<u-empty :src="`/static/${$config('themePath')}/def_no_data@3x.png`" icon-size="240" :text="noDataText" img-width="120" v-if="listdata.length==0 && status!='loading'" mode="list"></u-empty>
 		</scroll-view>
-		<view class="replenishment-confirm-footer">
+		<view class="replenishment-confirm-footer" v-if="listdata.length>0">
 			<u-button @click="confirmModal=true" type="success" :custom-style="customStyle" hover-class="none" shape="circle">确定补货({{confirmQty}}/{{totalQty}})</u-button>
 		</view>
 		<!-- 确认弹框 -->
@@ -34,6 +35,8 @@
 		data() {
 			return {
 				listdata: [],
+				status: 'loadmore',
+				noDataText: '暂无数据',
 				theme: '',
 				customStyle: {
 					borderRadius:'100rpx',
@@ -99,12 +102,15 @@
 					if (item.confirmQty || item.confirmQty == 0) {
 						arr.push({
 							productSn: item.productSn,
-							confirmQty: item.confirmQty
+							confirmQty: item.confirmQty,
+							replenishBillDetailSn: item.replenishBillDetailSn
 						})
 					}
 				})
 				const params = {
+					shelfSn: this.listdata[0].shelfSn,
 					replenishBillSn: this.replenishBillSn,
+					replenishBillNo: this.listdata[0].replenishBillNo,
 					detailList: arr
 				}
 				// 校验产品库存是否足够
@@ -143,6 +149,9 @@
 </script>
 
 <style lang="scss" scoped>
+	page {
+		height: 100%;
+	}
 	.replenishment-confirm-wrap{
 		background-color: #fff;
 		position: relative;

+ 2 - 2
pages/replenishmentManage/detail.vue

@@ -14,7 +14,7 @@
 				</view>
 				<view>
 					<view class="label"><u-icon name="ison_shelf" custom-prefix="iscm-icon" size="32"></u-icon><text>货架名称</text></view>
-					<view class="info-txt">{{basicInfoData.shelfName || '--'}}</view>
+					<view class="info-txt">{{basicInfoData.shelfInfo&&basicInfoData.shelfInfo.shelfName || '--'}}</view>
 				</view>
 				<view v-if="pageType=='success'">
 					<view class="label"><u-icon name="icon_delivery" custom-prefix="iscm-icon" size="32"></u-icon><text>配送方式</text></view>
@@ -58,7 +58,7 @@
 			})
 		},
 		onLoad(option) {
-			this.replenishBillSn = option.replenishBillSn
+			this.replenishBillSn = option.sn
 			this.pageType = option.type
 			this.getDetail()
 			this.getPartList()

+ 1 - 1
pages/replenishmentManage/manualPrint.vue

@@ -37,7 +37,7 @@
 			})
 		},
 		onLoad(option) {
-			this.replenishBillSn = option.replenishBillSn
+			this.replenishBillSn = option.sn
 			this.getDetail()
 			this.getPartList()
 		},

+ 3 - 3
pages/replenishmentManage/outWarehousing.vue

@@ -10,11 +10,11 @@
 				</view>
 				<view>
 					<view class="label"><u-icon name="ison_shelf" custom-prefix="iscm-icon" size="32"></u-icon><text>货架名称</text></view>
-					<view class="info-txt">{{basicInfoData.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 class="info-txt">{{basicInfoData.remarks || '--'}}</view>
+					<view class="info-txt">{{basicInfoData.customerAddr || '--'}}</view>
 				</view>
 			</view>
 			<view class="part-list">
@@ -63,7 +63,7 @@
 			})
 		},
 		onLoad(option) {
-			this.replenishBillSn = option.replenishBillSn
+			this.replenishBillSn = option.sn
 			this.getDetail()
 			this.getPartList()
 		},

+ 85 - 61
pages/replenishmentManage/replenishmentList.vue

@@ -13,7 +13,7 @@
 					:key="item.id+'-'+sindex"
 					@click="viewRow(item)" >
 						<view class="check-row">
-							<view>{{item.shelfName}}</view>
+							<view>{{item.shelfInfo&&item.shelfInfo.shelfName}}</view>
 							<view>
 								<text :style="{color: item.billState=='FINISH'?$config('successColor'):item.billState=='CANCEL'?$config('infoColor'):$config('errorColor')}">{{item.billStateDictValue}}</text>
 							</view>
@@ -35,7 +35,7 @@
 </template>
 
 <script>
-	import { shelfReplenishList } from '@/api/shelfReplenish'
+	import { shelfReplenishList, shelfReplenishStateCount } from '@/api/shelfReplenish'
 	export default {
 		components: {},
 		data() {
@@ -43,38 +43,37 @@
 				status: 'loadmore',
 				noDataText: '暂无数据',
 				tabList: [
-					  {
+					{
 						dispName: '全部',
-						typeId: 0,
-						status: ''
-					   },
-					  {
-					    dispName: '待确认',
-					  	typeId: 1,
-						status: '',
-						count: 12
-					  },
-					  {
-					    dispName: '待出库',
-					  	typeId: 2,
-						status: ''
-					  },
-					  {
-					    dispName: '待签收',
-					  	typeId: 3,
-						status: ''
-					  },
-					  {
-					    dispName: '已完成',
-					  	typeId: 4,
-					  	status: ''
-					  },
-					  {
-					    dispName: '已取消',
-					  	typeId: 5,
-					  	status: ''
-					  },
-				  ],
+						status: 'ALL',
+						count: 0
+					},
+					{
+						dispName: '待确认',
+						status: 'WAIT_CONFIRM',
+						count: 0
+					},
+					{
+						dispName: '待出库',
+						status: 'WAIT_OUT_STOCK',
+						count: 0
+					},
+					{
+						dispName: '待签收',
+						status: 'WAIT_CHECK',
+						count: 0
+					},
+					{
+						dispName: '已完成',
+						status: 'FINISH',
+						count: 0
+					},
+					{
+						dispName: '已取消',
+						status: 'CANCEL',
+						count: 0
+					},
+				],
 				current: 0,
 				swiperCurrent: 0,
 				pageNo: 1,
@@ -90,13 +89,25 @@
 				backgroundColor: this.$config('primaryColor')
 			})
 		},
-		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.getRow)
-			this.getRow(1)
+			uni.$on('refreshBL', this.queryByTypeSum)
+			this.queryByTypeSum()
 		},
 		onUnload() {
-			uni.$off('refreshBL',this.getRow)
+			uni.$off('refreshBL', this.queryByTypeSum)
 		},
 		methods:{
 			// tabs通知swiper切换
@@ -138,30 +149,30 @@
 			},
 			// 查询列表
 			getRow (pageNo) {
-			  if (pageNo) {
-			    this.pageNo = pageNo
-			  }
-			  let params = {
-			    pageNo: this.pageNo,
-			    pageSize: this.pageSize,
-			    billState: this.tabList[this.current].status,
-			  }
-			  this.status = "loading"
-			  shelfReplenishList(params).then(res => {
-				if (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
+				if (pageNo) {
+					this.pageNo = pageNo
 				}
-				this.status = "loadmore"
-			  })
+				let params = {
+					pageNo: this.pageNo,
+					pageSize: this.pageSize,
+					billState: this.tabList[this.current].status=='ALL'?'':this.tabList[this.current].status,
+				}
+				this.status = "loading"
+				shelfReplenishList(params).then(res => {
+					if (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 = "loadmore"
+				})
 			},
 			resetPage(){
 				this.status = 'loading';
@@ -189,7 +200,20 @@
 				}else if(item.billState=='CANCEL'){ // 已取消
 					uni.navigateTo({ url: "/pages/replenishmentManage/detail?sn="+item.replenishBillSn+"&type=cancel" })
 				}
-			}
+			},
+			// 查询每个状态的数据条数
+			queryByTypeSum () {
+				shelfReplenishStateCount({}).then(res => {
+					if (res.data && res.status == 200) {
+						this.tabList[1].count = res.data.WAIT_CONFIRM || 0
+						this.tabList[2].count = res.data.WAIT_OUT_STOCK || 0
+						this.tabList[3].count = res.data.WAIT_CHECK || 0
+						this.tabList[4].count = res.data.FINISH || 0
+						this.tabList[5].count = res.data.CANCEL || 0
+						this.getRow(1)
+					}
+				})
+			},
 		}
 	}
 </script>

+ 8 - 2
pages/replenishmentManage/signWarehousing.vue

@@ -58,7 +58,7 @@
 			})
 		},
 		onLoad(option) {
-			this.replenishBillSn = option.replenishBillSn
+			this.replenishBillSn = option.sn
 			this.getDetail()
 			this.getPartList()
 		},
@@ -101,7 +101,13 @@
 				const arr = []
 				this.partList.map((item, index) => {
 				  if (item.putQty || item.putQty == 0) {
-				    arr.push({ productSn: item.productSn, putQty: item.putQty })
+				    arr.push({
+						productSn: item.productSn,
+						putQty: item.putQty,
+						replenishBillDetailSn: item.replenishBillDetailSn,
+						shelfPlaceSn: item.shelfPlaceSn,
+						shelfPlaceCode: item.shelfPlaceCode
+					})
 				  }
 				})
 				const params = {