| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353 | <template>	<!-- 扫码入库确认页面 -->	<view>		<u-modal v-model="show" :show-title="false" @confirm="confirm">			<view style="width: 100%;height: 42rpx;margin-top: 30rpx;margin-bottom: 10rpx;text-align: center;">成功信息</view>			<u-table border-color="#f2f2f2">				<u-tr class="u-tr">					<u-td class="u-td">{{successCount}}条</u-td>					<u-td class="u-td">成功入库轮胎</u-td>				</u-tr>			</u-table>			<view style="width: 100%;height: 42rpx;margin-top: 30rpx;margin-bottom: 10rpx;text-align: center;">失败信息</view>			<u-table border-color="#f2f2f2">				<u-tr class="u-tr">					<u-th class="u-th">轮胎胎号</u-th>					<u-th class="u-th">失败原因</u-th>				</u-tr>				<u-tr class="u-tr" v-for="(item,index) in notBelongStoreBrandTyreNumbers" :key="index">					<u-td class="u-td">{{item}}</u-td>					<u-td class="u-td">非门店经营品牌</u-td>				</u-tr>				<u-tr class="u-tr" v-for="(item,index) in nonRegularTyreNumbers" :key="index">					<u-td class="u-td">{{item}}</u-td>					<u-td class="u-td">非正规胎号</u-td>				</u-tr>				<u-tr class="u-tr" v-for="(item,index) in alreadyExistsTyreNumbers" :key="index">					<u-td class="u-td">{{item}}</u-td>					<u-td class="u-td">库存中已存在</u-td>				</u-tr>			</u-table>			<view style="width: 100%;height: 42rpx;margin-top: 30rpx;margin-bottom: 10rpx;text-align: center;">奖励明细</view>			<u-table border-color="#f2f2f2">				<u-tr class="u-tr">					<u-td class="u-td">{{rewardMoney}}奖励</u-td>					<u-td class="u-td">{{rewardIntegral}}积分</u-td>				</u-tr>			</u-table>		</u-modal>		<view class="header">			<view class="behind"></view>			<view class="content">				<view class="content-one">					<view>胎号</view>					<view>物料</view>					<view>预计奖励</view>				</view>				<view v-for="(item,index) in dalist" :key="index">					<view class="content-two">						<view>{{item.tireNumber}}</view>						<view>{{item.maktx}}</view>						<view>{{item.rewardMoney}}元</view>					</view>				</view>				<view class="content-three">					<view>						合计:{{total}}元					</view>				</view>			</view>			<view class="content-four">				注:请完善请完善请完善请完善请完善请完善请完善			</view>		</view>		<u-toast ref="repeat" position="bottom" />		<view class="tail" @click="location">			扫码确认		</view>	</view></template><script>	const app = getApp()	var QQMapWX = require('../../../components/mi-map/qqmap-wx-jssdk.min.js')	var qqmapsdk = new QQMapWX({		key: 'LXCBZ-NNIKD-UZ64F-H6AFI-UNJLH-OCFGE'	})	import {		request	} from '../../../common/request/request'	require("promise.prototype.finally").shim()	import {		mapMutations	} from 'vuex'	export default {		data() {			return {				dalist: [],				total: 0,				show: false,				successCount: '', //成功条数				notBelongStoreBrandTyreNumbers: [], //非门店经营品牌胎号				nonRegularTyreNumbers: [], //非正规胎号				alreadyExistsTyreNumbers: [], //库存中已存在轮胎号				rewardMoney: '', //奖励金额				rewardIntegral: '', //奖励积分				longitude: '', //经度				latitude: '', //纬度				address: '' //中文地址			}		},		created() {			uni.getNetworkType({				success: function(res) {					let none = res.networkType					console.log(res.networkType);					if (none == 'none') {						uni.showToast({							icon: 'none',							title: '无网络,请连接网络后再试~',							position: "bottom"						})					}				}			});			this.getDatalist()		},		onBackPress(options) {			if (options.from == 'backbutton') {				this.$u.route({					url: 'pages/home/scancode/index'				})				uni.$emit('data', {					lisi: this.datalist				})				console.log(this.datalist)				console.log("到此一游")			}			return true;		},		methods: {			...mapMutations(["inStore"]),			confirm() {				this.$u.route({					type: 'redirectTo',					url: 'pages/me/Warehousing-details/index'				})			},			getDatalist() {				uni.showLoading({					title: '加载中...'				});				setTimeout(function() {					uni.hideLoading();				}, 1000);				uni.$on('update', data => {					this.datalist = data.materialList					request({						url: '/storeScan/getTyreReword',						method: 'Post',						data: {							storeId: this.$store.state.storeInfo.storeId,							userId: this.$store.state.storeInfo.userId,							materialList: this.datalist						}					}).then(res => {						console.log(res.data.code)						if (res.data.code == 0) {							this.dalist = res.data.data							for (let i = 0; i < this.dalist.length; i++) {								this.total += parseInt(this.dalist[i].rewardMoney)							}							this.inStore()							return this.total						} else {							uni.showToast({								icon: 'none',								title: '出错啦~'							})						}					}).catch(err => {						console.log(err)						uni.showToast({							icon: 'none',							title: '无网络,请连接网络后再试~'						})					}).finally(() => {						// Loading.close()					})				})			},			location() {				uni.getNetworkType({					success: function(res) {						let none = res.networkType						console.log(res.networkType);						if (none == 'none') {							uni.showToast({								icon: 'none',								title: '无网络,请连接网络后再试~',								position: "bottom"							})						}					}				});				let this_s = this				uni.getLocation({					type: 'wgs84', // 返回国测局坐标					geocode: true,					success: function(res) {						console.log(res);						this_s.longitude = res.longitude						this_s.latitude = res.latitude						this_s.address = res.address.country + res.address.province + res.address.city + res.address.district + res.address							.street						if (res.address.length == 0) {							uni.showToast({								icon: 'none',								title: '获取地址失败, 请检查是否开启定位权限~~',								position: "bottom"							})							console.log("定位失败出去啦")							return						}						this_s.Submit()					},					fail: function(e) {						uni.showToast({							icon: 'none',							title: '获取地址失败, 请检查是否开启定位权限~~'						})					}				})			},			Submit() {				this.show = true;				request({					url: '/storeScan/storeScanTyres',					method: 'Post',					data: {						storeId: this.$store.state.storeInfo.storeId,						userId: this.$store.state.storeInfo.userId,						scanAddress: this.address, //地址						longitude: this.longitude, //纬度						latitude: this.latitude, //经度						materialList: this.datalist //轮胎参数					}				}).then(res => {					console.log(res)					console.log(res.data.msg)					if (res.data.code == 500) {						this.$refs.repeat.show({							title: res.data.msg,							type: 'default',							position: 'bottom'						})					}					this.notBelongStoreBrandTyreNumbers = res.data.data.notBelongStoreBrandTyreNumbers //非门店经营品牌胎号					this.successCount = res.data.data.successCount //成功条数					this.nonRegularTyreNumbers = res.data.data.nonRegularTyreNumbers //非正规胎号					this.alreadyExistsTyreNumbers = res.data.data.alreadyExistsTyreNumbers //库存中已存在轮胎号					this.rewardMoney = res.data.data.rewardMoney //奖励金额					this.rewardIntegral = res.data.data.rewardIntegral //奖励积分					console.log(res)					this.datalist = ''				}).catch(err => {					console.log(err.data.msg)				}).finally(() => {					// Loading.close()				})			}		},	}</script><style lang="scss" scoped>	.behind {		width: 100%;		height: 230rpx;		margin-bottom: -200rpx;		background-color: #0094FE;	}	.header {		width: 100%;	}	.content {		width: 711rpx;		// height: 852rpx;		background: #FFFFFF;		box-shadow: 0rpx 0rpx 24rpx 0rpx rgba(101, 176, 249, 0.41);		border-radius: 20rpx;		padding-top: 10rpx;		padding-bottom: 10rpx;		margin: 0 auto;	}	.content-one {		display: flex;		justify-content: space-between;	}	.content-one:nth-child(1) {		margin-left: 90rpx;		margin-right: 50rpx;		font-weight: bold;		margin-top: 30rpx;	}	.content-two {		display: flex;		justify-content: space-between;		margin-top: 30rpx;		line-height: 115rpx;		width: 666rpx;		margin: 0 auto;		color: #9c9c9c;		font-size: 28rpx;		border-bottom: 1rpx solid #E8E8E8;	}	.content-two>view:nth-child(2) {		width: 240rpx;		line-height: 53rpx;		text-align: center;		margin-right: 100rpx;	}	.content-two>view:nth-child(3) {		color: #149EE2;		margin-right: 50rpx;	}	.tail {		width: 678rpx;		line-height: 83rpx;		background: #0095FF;		color: #fff;		text-align: center;		margin: 0 auto;		margin-top: 60rpx;		border-radius: 15rpx;	}	.content-three>view:nth-child(1) {		margin-left: 500rpx;		line-height: 80rpx;		font-weight: bolder;	}	.content-four {		color: #acacac;		font-size: 24rpx;		margin-top: 30rpx;		margin-left: 20rpx;		margin-bottom: 50rpx;	}</style>
 |