Parcourir la source

自动更新功能,以及旧代码bug修改

asd26269546 il y a 2 ans
Parent
commit
378db7c07a

+ 9 - 0
libs/utils/request.js

@@ -65,6 +65,15 @@ export default{
 			uni.request(options)
 		});
 	},
+	post2(url,data,options={}){
+		// 于测试切换ip
+		options.url = config.baseUrl + url;
+		// console.log(options.url, 'url');
+		// options.url = config.baseUrl + url;
+		options.data = data;
+		options.method = 'POST';
+		return this.request(options)
+	},
 	post(url,data,options={}){
 		// 于测试切换ip
 		options.url = config.baseUrl + url;

+ 13 - 48
libs/utils/util.js

@@ -447,14 +447,18 @@ export default {
 	/* 检测增量更新 */
 	updateVersion () {
 		http.DownloadApkFile().then(res => {
+			console.log(res)
 			if(res.code === 0) {
-				if(res.result.updateApkType === 0 && res.result.ossUrl) {
+				// if(res.result.updateApkType === 0 && res.result.ossUrl) {
 					plus.runtime.getProperty(plus.runtime.appid, (wgtinfo) => {
-						
+						console.log(res.result.version, wgtinfo.version)
 						let version = storage.getStorageSync('version')
 						if (res.result.version !== wgtinfo.version) {
-							console.log('版本不同 准备更新')
 							
+							uni.showLoading({
+								title: '新版本下载中,请稍后',
+								mask:true
+							});
 							let downloadTask = uni.downloadFile({
 								url: res.result.ossUrl, //下载地址,必传
 								success: (downloadResult) => {
@@ -482,7 +486,7 @@ export default {
 									}
 								},
 								fail: (item => {
-									console.log(12312,'')
+									uni.hideLoading();
 								})
 							})
 							// downloadTask.onProgressUpdate(item => {
@@ -495,51 +499,11 @@ export default {
 							// })
 							
 						}else{
-							console.log('版本一样')
-							return
-							//测试自动更新不影响正式,记得删除
-							let downloadTask = uni.downloadFile({
-								url: res.result.ossUrl, //下载地址,必传
-								success: (downloadResult) => {
-									if (downloadResult.statusCode === 200) {
-										plus.runtime.install(downloadResult
-											.tempFilePath, { //安装api
-												force: true
-											},
-											function() {
-												plus.runtime.quit();
-												console.log('install success...');
-												plus.nativeUI.showWaiting('更新完成');
-												storage.setStorageSync('version', res.result.version)
-												setTimeout(() => {
-													plus.nativeUI
-														.closeWaiting();
-													plus.runtime
-												.restart(); //重启app
-												}, 1500)
-											},
-											function(e) {
-												console.error('install fail...');
-											});
-									}
-								},
-								fail: (item => {
-									console.log(item)
-								})
-							})
-							// downloadTask.onProgressUpdate(item => {
-							// 	if (item.progress < 100) {
-							// 		plus.nativeUI.showWaiting('正在下载' + item.progress +
-							// 		'%');
-							// 	} else if (item.progress >= 100) {
-							// 		plus.nativeUI.closeWaiting();
-							// 	}
-							// })
 						}
 					})
-				} else {
-					this.checkVersion(res.result.version, res.result.ossUrl)
-				}
+				// } else {
+				// 	this.checkVersion(res.result.version, res.result.ossUrl)
+				// }
 			}
 		})
 	},
@@ -576,7 +540,8 @@ export default {
 							force: true
 						},
 						function(res) {
-							plus.runtime.restart();
+							plus.runtime.quit();
+							// plus.runtime.restart();
 						}
 					);
 				}

+ 1 - 1
manifest.json

@@ -2,7 +2,7 @@
     "name" : "智能仓储2",
     "appid" : "__UNI__4E49201",
     "description" : "",
-    "versionName" : "1.0.3",
+    "versionName" : "1.0.3.3",
     "versionCode" : 200,
     "transformPx" : false,
     /* 5+App特有相关 */

+ 1 - 1
pages/login/login.vue

@@ -125,7 +125,7 @@ import config from '@/libs/config/config.js'
 		onLoad() {
 			this.form.account = this.userInfo.account
 			
-			//this.$utils.updateVersion()
+			this.$utils.updateVersion()
 		},
 		onReady() {
 			this.$refs.uForm.setRules(this.rules);

+ 234 - 28
pages/store-manage/user-check/location-edit.vue

@@ -1,32 +1,54 @@
 <template>
 	<view class="location-edit">
 		<ul>
-			<li>
+			<li v-for="(i,index) in listData" :key="i.id">
 				<view class="label">
-					物料编码:xxxxxxx
-					<view class="">
-						删除图标
+					物料编码:{{i.materialCode}}
+					<view class="" @click="deteleFn(i,index)">
+						<image style="width:36rpx;height:36rpx" src="@/static/images/delete.png" mode=""></image>
 					</view>
 				</view>
 				<view class="label">
-					物料名:嘻嘻嘻嘻嘻嘻、
+					物料名:{{i.materialName}}
 				</view>
 				<view class="label">
 					<view class="">
-						数量:1111
+						数量:{{i.quantity}}
 					</view>
 					<view class="">
-						所在仓库:xxxxx
+						所在仓库:{{i.houseName}}
 					</view>
 				</view>
-				<view class="label">
-					货架:xxxxxx
+				<view class="label" @click="open(i,index)">
+					货架:{{ i.PlaceAreaName || '点击选择货架'}} >
 				</view>
 			</li>
 		</ul>
-		<button @click="scan">
-			扫描
-		</button>
+		<view class="footer-btn">
+			<view class="shaomiao" @click="scan()">
+				<image style="width:36rpx;height:36rpx" src="@/static/images/shaomiao.png" mode=""></image>
+				扫描
+			</view>
+			<view class="set"  @click="open()">
+				批量设置库存
+			</view>
+		</view>
+		<view class="fixed-btn">
+			<button style="background-color: #1A3AF0;color:#fff" @click="submitFn">提交</button>
+			<button @click="backFn">取消</button>
+		</view>
+		<uni-popup ref="popup" type="top">
+			<view class="search-box">
+				<view class="">
+					<input v-model="searchText" @input="search" class="uni-input" @ placeholder="输入货架名称进行搜索如A5" />
+				</view>
+				<ul>
+					<li @click="selectMaterialList(i)"  v-for="(i,index) in range" :key="i.id">
+						{{i.name}}
+					</li>
+				</ul>
+			</view>
+		</uni-popup>
 	</view>
 </template>
 
@@ -39,42 +61,226 @@
 				data: {},
 				isReading: true,
 				rfidCode: '',
-				scanCode: ''
+				scanCode: '',
+				listData:[],
+				range:[],
+				rangeCopy:[],
+				searchText:'',
+				setIndex:0,
 			}
 		},
+		created(){
+			this.getStockArea()
+		},
 		methods:{
+			deteleFn(item,index){
+				this.listData.splice(index,1)
+			},
+			backFn(){
+				uni.navigateBack()
+			},
+			submitFn(){
+				const req = [];
+				if(this.listData.length == 0){
+					uni.showToast({
+						icon:"none",
+					    title: '请扫描物料',
+					    duration: 1000
+					})
+					return
+				}
+				for (var i = 0; i < this.listData.length; i++) {
+					if(this.listData[i].PlaceAreaName == null){
+						uni.showToast({
+							icon:"none",
+						    title: '请选择货架',
+						    duration: 1000
+						})
+						return
+					}
+					req.push({
+						placeareaid:this.listData[i].PlaceAreaId,
+						id:this.listData[i].id
+					})
+				}
+				
+				uni.request({
+					url: 'http://120.79.80.64:8050' + '/cloudApi/stockDetail/setAreaId',
+					data: req,
+					method: 'POST',
+					success: (res) => {
+						console.log(res)
+						if(res.data.code == 200){
+							uni.showToast({
+							    title: '设置成功',
+							    duration: 1000
+							})
+							setTimeout(()=>{
+								uni.navigateBack()
+							},1000)
+						}
+					},
+					fail: (err) => {
+						console.log(err)
+					}
+				});
+				
+			},
+			search(){
+				const v  = this
+				v.range = []
+				const range = JSON.parse(JSON.stringify(v.rangeCopy))
+				for (var i = 0; i < range.length; i++) {
+					if(range[i].name.indexOf(v.searchText) != -1){
+						v.range.push(range[i])
+					}
+				}
+			},
+			open(item,index){
+				console.log(index)
+				if(index != undefined){
+					this.$refs.popup.open('top')
+					this.setIndex = index
+				}else{
+					this.$refs.popup.open('top')
+					this.setIndex = 'all'
+				}
+				
+			},
+			selectMaterialList(i){
+				const v = this
+				console.log(i)
+				if(this.setIndex == 'all'){
+					for (var j = 0; j < v.listData.length; j++) {
+						v.listData[j].PlaceAreaId = i.id
+						v.listData[j].PlaceAreaName = i.name
+					}
+				}else{
+					v.listData[v.setIndex].PlaceAreaId = i.id
+					v.listData[v.setIndex].PlaceAreaName = i.name
+				}
+				console.log(v.listData)
+				this.$refs.popup.close()
+			},
+			getStockArea(){
+				const v = this
+				uni.request({
+					url: 'http://120.79.80.64:8050' + '/cloudApi/stockArea/list',
+					data: {},
+					method: 'POST',
+					success: (res) => {
+						console.log(res)
+						if(res.data.code == 200){
+							this.range = res.data.data
+							this.rangeCopy = res.data.data
+						}
+					},
+					fail: (err) => {
+						console.log(err)
+					}
+				});
+			},
 			scan() {
+				const v = this
 				uni.scanCode({
 					success(res) {
-						console.log(res.result)
+						uni.request({
+							url: 'http://120.79.80.64:8050' + '/cloudApi/stockDetail/getMaterialInfoByQrCode',
+							data: {
+								qrCode:res.result
+							},
+							method: 'POST',
+							success: (res) => {
+								console.log(res.data)
+								if(res.data.code == 200){
+									for (var i = 0; i < v.listData.length; i++) {
+										if(v.listData[i].materialCode == res.data.data.materialCode){
+											uni.showToast({
+												icon:"none",
+											    title: '此物料已扫描',
+											    duration: 1000
+											})
+											return
+										}
+									}
+									v.listData.push({...res.data.data,PlaceAreaName:null})
+								}
+							},
+							fail: (err) => {
+								
+							}
+						});
 					}
 				})
-				// clearTimeout(this.timer)
-				// this.$msg.showLoading('扫描中...')
-				// console.log(pda)
-				// pda.scanCode({}, res => {
-				// 	this.$msg.hideLoading()
-				// 	this.scanCode = res.replace('\n', '')
-				// 	this.getlist(res)
-				// 	clearTimeout(this.timer)
-				// })
-				// this.timer = setTimeout(() => {
-				// 	this.$msg.hideLoading()
-				// }, 3000)
 			},
 		},
 	}
 </script>
 
-<style lang="less">
+<style scoped lang="less">
+	.fixed-btn{
+		display: flex;
+		position: fixed;
+		bottom: 10rpx;
+		left: 0;
+		right: 0;
+		button{
+			width: 40%;
+			margin: 0 5%;
+		}
+	}
+	.search-box{
+		height: 80vh;
+		overflow-y: scroll;
+		background-color: #fff;
+		ul{
+			height: 70vh;
+			overflow-y: scroll;
+		}
+		input{
+				height: 70rpx;
+				padding: 10rpx;
+				border:1rpx solid #dcdcdc;
+				margin: 10rpx;
+		}
+		ul{
+			
+		}
+	}
 	.location-edit{
+		.footer-btn{
+			.set{
+				height: 70rpx;
+				line-height: 70rpx;
+				background: #EF0000;
+				text-align: center;
+				margin: 20rpx 20rpx;
+				border-radius: 10rpx;
+				color: #fff;
+			}
+			.shaomiao{
+				height: 70rpx;
+				line-height: 70rpx;
+				background: #fff;
+				text-align: center;
+				margin: 0 20rpx;
+				border:2rpx solid #979797;
+				border-radius: 10rpx;
+				image{
+					margin-right: 20rpx;
+					position: relative;
+					top: 10rpx;
+				}
+			}
+		}
 		ul{
 			padding: 0;
-			margin: 30rpx 18rpx 0;
+			margin: 30rpx 18rpx 20rpx;
 			li{
 				padding: 5rpx 40rpx;
 				list-style: none;
 				background-color: #fff;
+				margin-top: 20rpx;
 				.label{
 					height: 66rpx;
 					line-height: 66rpx;

+ 33 - 14
pages/store-out-manage/return-apply/return-apply.vue

@@ -87,23 +87,42 @@
 				applyAccount: '',
 				isReading: false,
 				scanList: []
-			};
+			}; 
 		},
 		methods: {
 			cfm(){
-				this.$http.AddApplyStockOutBill({
-					// applyAccount: this.applyAccount,
-					stockOutType: 0,
-					materialList: this.scanList
-				}).then(res => {
-					console.log(res)
-					if(res.code === 0) {
-						this.$msg.showToast(res.msg || '操作成功!')
-						setTimeout(() => {
-							this.$utils.back()
-						}, 2000)
-					}
-				})
+				const v = this
+				
+				for (var i = 0; i < v.scanList.length; i++) {	
+					v.$http.AddApplyStockOutBill({
+						// applyAccount: this.applyAccount,
+						stockOutType: 0,
+						materialList: [v.scanList[i]]
+					}).then(res => {
+						console.log(res)
+						if(res.code === 0) {
+							if(i == v.scanList.length - 1){
+								this.$msg.showToast(res.msg || '操作成功!')
+								setTimeout(() => {
+									this.$utils.back()
+								}, 2000)
+							}
+						}
+					})
+				}
+				// this.$http.AddApplyStockOutBill({
+				// 	// applyAccount: this.applyAccount,
+				// 	stockOutType: 0,
+				// 	materialList: this.scanList
+				// }).then(res => {
+				// 	console.log(res)
+				// 	if(res.code === 0) {
+				// 		this.$msg.showToast(res.msg || '操作成功!')
+				// 		setTimeout(() => {
+				// 			this.$utils.back()
+				// 		}, 2000)
+				// 	}
+				// })
 			},
 			/* 扫描添加 */
 			scan() {

BIN
static/images/delete.png


BIN
static/images/shaomiao.png


+ 1 - 1
unpackage/cache/apk/apkurl

@@ -1 +1 @@
-https://ide.dcloud.net.cn/build/download/52faae40-1306-11ed-952e-1b24d8a888e3
+https://ide.dcloud.net.cn/build/download/5a4c6f20-1951-11ed-9c40-33d6c6ec4002

Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
unpackage/cache/apk/cmManifestCache.json


+ 3 - 3
unpackage/cache/certdata

@@ -1,3 +1,3 @@
-andrCertfile=C:/Users/hf/Desktop/HBuilderX/plugins/app-safe-pack/Test.keystore
-andrCertAlias=android
-andrCertPass=ep/Tdjka4Y7WYqDB6/S7dw==
+andrCertfile=D:/hongxing/手持机证书/Storage.keystore
+andrCertAlias=Storage
+andrCertPass=IgONOm153ld7NADWfs8tmw==

BIN
unpackage/cache/wgt/__UNI__4E49201/.manifest/google-keystore.keystore


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
unpackage/cache/wgt/__UNI__4E49201/app-service.js


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
unpackage/cache/wgt/__UNI__4E49201/app-view.js


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
unpackage/cache/wgt/__UNI__4E49201/manifest.json


BIN
unpackage/cache/wgt/__UNI__4E49201/static/images/delete.png


BIN
unpackage/cache/wgt/__UNI__4E49201/static/images/shaomiao.png


Fichier diff supprimé car celui-ci est trop grand
+ 11 - 11
unpackage/dist/dev/app-plus/app-service.js


Fichier diff supprimé car celui-ci est trop grand
+ 544 - 50
unpackage/dist/dev/app-plus/app-view.js


Fichier diff supprimé car celui-ci est trop grand
+ 0 - 0
unpackage/dist/dev/app-plus/manifest.json


BIN
unpackage/dist/dev/app-plus/static/images/delete.png


BIN
unpackage/dist/dev/app-plus/static/images/shaomiao.png


Certains fichiers n'ont pas été affichés car il y a eu trop de fichiers modifiés dans ce diff