Ver código fonte

添加合同

wangchao 3 anos atrás
pai
commit
da5ccdf907

+ 15 - 0
common/helper.js

@@ -0,0 +1,15 @@
+const selectContractNo = {}
+const detailData = {}
+const now = Date.now || function () {  
+    return new Date().getTime();  
+};  
+const isArray = Array.isArray || function (obj) {  
+    return obj instanceof Array;  
+};  
+
+export default {  
+	detailData,
+	selectContractNo,
+    now,  
+    isArray  
+}

+ 9 - 0
pages.json

@@ -794,6 +794,15 @@
 		        "enablePullDownRefresh": false
 		    }
 		    
+		},
+		{
+		    "path" : "pages/erpbusiness/acquisitionInspection/selectContractNo",
+		    "style" :                                                                                    
+		    {
+		        "navigationBarTitleText": "选择合同",
+		        "enablePullDownRefresh": false
+		    }
+		    
 		}
     ],
 	"subpackages": [{

+ 87 - 36
pages/erpbusiness/QRCode/QRCode.vue

@@ -1,7 +1,8 @@
 <template>
 	<view class="content" @click="maskClick">
 		<view class="qrcode">
-			<uqrcode ref="uqrcode"></uqrcode>
+			<!-- <uqrcode ref="uqrcode"></uqrcode> -->
+			<img :src="imgSrc" alt="" class="img">
 			<view class="qrcode-text">客户扫码</view>
 		</view>
 	</view>
@@ -14,54 +15,104 @@
 	export default {
 		data() {
 			return {
-
+				imgSrc: ""
 			};
 		},
 		onReady() {
-			console.log(this.userInfo)
-			this.$refs
-				.uqrcode
-				.make({
-					size: 300,
-					margin:50,
-					text: JSON.stringify(this.userInfo.userName)
-				})
-				.then(res => {
-					// 返回的res与uni.canvasToTempFilePath返回一致
-					console.log(res)
+			this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
+					if (res.data.data == "INVALID") {
+						uni.showModal({
+							title: "登录提示",
+							content: "Session过期需要重新登录,是否立即登录",
+							showCancel: true,
+							confirmText: '登录',
+							success(e) {
+								if (e.confirm) {
+									uni.navigateTo({
+										url: '/pages/public/login'
+									})
+								}
+							}
+						})
+					} else {
+						this.getQRCode()
+					}
 				})
+				.catch(res => {
+					if (res.message) {
+						uni.showToast({
+							title: res.message,
+							icon: 'none',
+							duration: 2000
+						})
+					}
+				});
+			// console.log(this.userInfo)
+			// this.$refs
+			// 	.uqrcode
+			// 	.make({
+			// 		size: 300,
+			// 		margin:50,
+			// 		text: JSON.stringify({
+			// 			userName:this.userInfo.userName,
+			// 		})
+			// 	})
+			// 	.then(res => {
+			// 		// 返回的res与uni.canvasToTempFilePath返回一致
+			// 		console.log(res)
+			// 	})
 		},
 		computed: {
 			...mapState(['hasLogin', 'userInfo'])
 		},
 		methods: {
-			maskClick(){
-			uni.navigateBack(-1)
+			maskClick() {
+				uni.navigateBack(-1)
+			},
+			getQRCode() {
+				this.$api.doRequest('get', '/identityAuthenticationInfo/generateQRCodeImage').then(res => {
+						console.log(res)
+						this.imgSrc = res.data.data
+					})
+					.catch(res => {
+						if (res.message) {
+							uni.showToast({
+								title: res.message,
+								icon: 'none',
+								duration: 2000
+							})
+						}
+					});
 			}
 		}
 	}
 </script>
 
 <style lang="scss">
-.content{
-	background: rgba(0, 0, 0, 0.4);
-	height: 100vh;
-	display: flex;
-	justify-content: center;
-	align-items: center;
-}
-.qrcode-text{
-	text-align: center;
-	position: relative;
-	font-size: 24rpx;
-	font-weight: 400;
-	color: #878C9C;
-	top: -60rpx;
-}
-.qrcode{
-	position: fixed;
-	top: 30%;
-	margin: auto;
-	
-}
+	.content {
+		background: rgba(0, 0, 0, 0.4);
+		height: 100vh;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+	}
+
+	.qrcode-text {
+		text-align: center;
+		position: relative;
+		font-size: 24rpx;
+		font-weight: 400;
+		color: #878C9C;
+		top: -60rpx;
+	}
+
+	.qrcode {
+		position: fixed;
+		top: 30%;
+		margin: auto;
+	}
+
+	.img {
+		width: 400rpx;
+	}
 </style>

+ 126 - 44
pages/erpbusiness/acquisitionInspection/acquisitionInspection.vue

@@ -1,10 +1,10 @@
 <template>
 	<view class="content">
 		<view class="top">
-			<u-search placeholder="输入编号/客户号/车牌号" v-model="inputKeyword"></u-search>
+			<u-search placeholder="输入编号/客户号/车牌号" v-model="inputKeyword" @search="getList()"></u-search>
 			<view class="dropdown">
 				<view class="left" @click="selectWarehouse">
-					<view >{{warehouseName}}</view>
+					<view>{{warehouseName}}</view>
 					<u-icon name="arrow-down" color=""></u-icon>
 				</view>
 				<view class="right">
@@ -12,40 +12,49 @@
 					<view class="default">默认</view>
 				</view>
 			</view>
-			<u-select v-model="isShowWarehouse" :list="warehouseList" @confirm="confirmWarehouse"></u-select>
+			<u-select v-model="isShowWarehouse" :default-value='[0]' :list="warehouseList" @confirm="confirmWarehouse">
+			</u-select>
 		</view>
 		<view class="middle">
 			<view class="item-style" v-for="(item,index) in dataList" :key="index">
 				<view class="row1">
 					<view class="row1-left">
-						<view class="left">检</view>
+						<view class="left status1" v-if="item.status=='已质检'">检</view>
+						<view class="left status2" v-if="item.status=='已称皮重'">皮</view>
+						<view class="left status3" v-if="item.status=='已称毛重'">毛</view>
 						<view>
 							<view class="top-title">
-								RKZJ20210823xxxxxxx
+								{{item.number}}
 							</view>
-							<view class="bottom">2021-07-05</view>
+							<view class="bottom">{{item.updateDate}}</view>
 						</view>
 					</view>
-					<view class="right">李四</view>
+					<view class="right">{{item.customer}}</view>
 				</view>
-				<view class="row2">
-					<view>张三</view>
-					<view>辽H12345</view>
-					<view>玉米(20水)</view>
+				<view class="row2" v-if="item.paymentManagement">
+					<view>{{item.paymentManagement.customerName}}</view>
+					<view>{{item.paymentManagement.carNo}}</view>
+					<view>{{item.paymentManagement.goodsName}}({{item.waterContent}}水)</view>
 				</view>
 				<view class="row3">
 					<view class="row3-item">
 						<view class="left">毛</view>
-						<view>未承重</view>
+						<view>{{item.grossWeight?item.grossWeight:'未称重'}}</view>
 					</view>
 					<view class="row3-item">
 						<view class="left">皮</view>
-						<view>未承重</view>
+						<view>{{item.tare?item.tare:'未称重'}}</view>
+					</view>
+					<view class="row3-item">
+						<view class="left">净</view>
+						<view>{{item.netWeight?item.netWeight:'未称重'}}</view>
 					</view>
 				</view>
 				<view class="row4">
-					<view class="right" @click="grossWeightClick(item)">毛重</view>
-					<view class="right" @click="tareClick(item)">皮重</view>
+					<view v-if="item.status!='已称皮重'" class="right" @click="grossWeightClick(item)">毛重</view>
+					<view v-if="!(item.paymentManagement&&item.paymentManagement.status=='已收款')||
+					!(item.paymentManagement&&item.paymentManagement.status=='部分收款')
+					" class="right" @click="tareClick(item)">皮重</view>
 				</view>
 			</view>
 		</view>
@@ -57,44 +66,97 @@
 		data() {
 			return {
 				inputKeyword: '',
-				warehouseName:'',
+				warehouseName: '',
 				isShowWarehouse: false,
-				warehouseList: [{
-						label: '仓库1',
-						value: 1,
-					},
-					{
-						label: '仓库2',
-						value: 2,
-					},
-					{
-						label: '仓库3',
-						value: 3,
-					}
-				],
-				dataList: [{name:1}, {}, {}]
+				warehouseList: [],
+				dataList: []
 			}
 		},
 		onShow() {
-			this.warehouseName = this.warehouseList[0].label
+			this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
+					if (res.data.data == "INVALID") {
+						uni.showModal({
+							title: "登录提示",
+							content: "Session过期需要重新登录,是否立即登录",
+							showCancel: true,
+							confirmText: '登录',
+							success(e) {
+								if (e.confirm) {
+									uni.navigateTo({
+										url: '/pages/public/login'
+									})
+								}
+							}
+						})
+					} else {
+						this.compId = uni.getStorageSync('pcUserInfo').compId
+						console.log("compId", this.compId)
+						this.loadData()
+					}
+				})
+				.catch(res => {
+					if (res.message) {
+						uni.showToast({
+							title: res.message,
+							icon: 'none',
+							duration: 2000
+						})
+					}
+				});
 		},
 		methods: {
+			loadData() {
+				this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouseSelf', {
+					compId: this.compId
+				}).then(res => {
+					console.log("warehouseBaseInfo", res)
+					let _resData = res.data.data
+					for (let i = 0; i < _resData.length; i++) {
+						let _obj = {
+							"label": _resData[i].warehouseName,
+							"value": _resData[i].id,
+						}
+						this.warehouseList.push(_obj)
+					}
+					this.warehouseName = this.warehouseList[0].label
+					this.getList()
+				})
+			},
+			//获取列表
+			getList() {
+				this.$api.doRequest('get', '/weighingManagement/selectWeighingManagement', {
+					compId: this.compId,
+					currentPage: 1,
+					pageSize: 10,
+					searchKeyWord: this.inputKeyword,
+					warehouseName: this.warehouseName,
+					managementType: 1,
+				}).then(res => {
+					this.dataList = res.data.data.records
+					console.log(res.data.data.records)
+					console.log("--------------------------------")
+					console.log("this.dataList",this.dataList)
+				})
+			},
 			selectWarehouse() {
 				this.isShowWarehouse = true
-			},confirmWarehouse(e){
+			},
+			confirmWarehouse(e) {
 				console.log(e)
-				this.warehouseName =e[0].label
+				this.warehouseName = e[0].label
+				this.dataList.warehouseName = e[0].label;
+				this.getList()
 			},
 			//毛重
-			grossWeightClick(val){
+			grossWeightClick(val) {
 				console.log(val)
 				uni.navigateTo({
-					url:'./grossWeightDetail?detailData='+JSON.stringify(val)
+					url: './grossWeightDetail?detailData=' + JSON.stringify(val)
 				})
 			},
-			tareClick(val){debugger
+			tareClick(val) {
 				uni.navigateTo({
-					url:'./tareDetail?detailData='+JSON.stringify(val)
+					url: './tareDetail?detailData=' + JSON.stringify(val)
 				})
 			}
 		}
@@ -114,7 +176,7 @@
 		align-items: center;
 		position: relative;
 		margin: 20rpx 0;
-		padding:0 13rpx;
+		padding: 0 13rpx;
 
 		.right,
 		.left {
@@ -160,7 +222,8 @@
 
 			}
 		}
-		.row2{
+
+		.row2 {
 			display: flex;
 			background: #F9F9FA;
 			border-radius: 10rpx;
@@ -169,12 +232,15 @@
 			margin: 20rpx;
 			color: #878C9C;
 		}
-		.row3{
+
+		.row3 {
 			display: flex;
-			.row3-item{
+			margin-top: 30rpx;
+			.row3-item {
 				display: flex;
 				margin-right: 40rpx;
-				.left{
+
+				.left {
 					background: #22C572;
 					border-radius: 10rpx;
 					padding: 2rpx 10rpx;
@@ -185,11 +251,13 @@
 				}
 			}
 		}
-		.row4{
+
+		.row4 {
 			display: flex;
 			justify-content: flex-end;
 			margin-top: 10px;
-			.right{
+
+			.right {
 				border: 1px solid #CDCDCD;
 				border-radius: 45rpx;
 				padding: 10rpx 30rpx;
@@ -198,4 +266,18 @@
 		}
 
 	}
+	.status1,.status2,.status3{
+		padding: 8rpx 12rpx;
+		border-radius: 50%;
+		color: white;
+	}
+	.status1{
+		background: #FD714F;
+	}
+	.status2{
+		background: #22C572;
+	}
+	.status3{
+		background: #3296FA;
+	}
 </style>

+ 34 - 14
pages/erpbusiness/acquisitionInspection/grossWeightDetail.vue

@@ -6,39 +6,39 @@
 		<view class="content">
 			<view class="row">
 				<view class="left">仓库</view>
-				<view class="right">仓库仓库仓库仓库仓库1</view>
+				<view class="right">{{detailData.warehouseName}}</view>
 			</view>
 			<view class="row">
 				<view class="left">编号</view>
-				<view class="right">仓库仓库仓库仓库仓库1</view>
+				<view class="right">{{detailData.number}}</view>
 			</view>
 			<view class="row">
 				<view class="left">客户</view>
-				<view class="right">仓库仓库仓库仓库仓库1</view>
+				<view class="right">{{detailData.customer}}</view>
 			</view>
 			<view class="row">
 				<view class="left">车牌号</view>
-				<view class="right">仓库仓库仓库仓库仓库1</view>
+				<view class="right">{{detailData.carNumber}}</view>
 			</view>
 			<view class="row">
 				<view class="left">仓位号</view>
-				<view class="right">仓库仓库仓库仓库仓库1</view>
+				<view class="right">{{detailData.binNumber}}</view>
 			</view>
 			<view class="row">
 				<view class="left">囤位号</view>
-				<view class="right">仓库仓库仓库仓库仓库1</view>
+				<view class="right">{{detailData.storageNumber}}</view>
 			</view>
 			<view class="row">
 				<view class="left">货名</view>
-				<view class="right">仓库仓库仓库仓库仓库1</view>
+				<view class="right">{{detailData.goodsName}}</view>
 			</view>
 			<view class="row row-bottom">
 				<view class="left">毛重</view>
-				<input class="right-bottom" placeholder="输入毛重"></input>
+				<input class="right-bottom" placeholder="输入毛重" v-model="detailData.grossWeight"></input>
 			</view>
 		</view>
 		<u-button type="primary" class="submit" @click="submit">提交</u-button>
-
+		<u-toast ref="uToast" />
 	</view>
 </template>
 
@@ -47,21 +47,41 @@
 		data() {
 			return {
 				detailData: {
-					name: ""
+					grossWeight:''
 				}
 			}
 		},
 		onShow() {},
 		onLoad(options) {
-			debugger
-			// this.detailData = JSON.parse(options.detailData)
+			this.detailData = JSON.parse(options.detailData)
+			console.log(this.detailData)
 		},
 		methods: {
 			submit(){
+				let that = this
 				uni.showModal({
 					content:"确定提交检斤信息?",
-					success() {
-						console.log("提交")
+					success:function(res) {
+						   if (res.confirm) {
+						           that.$api.doRequest('post', '/weighingManagement/api/editGrossWeight',that.detailData).then(res => {
+						           	if(res.data.code==200){
+						           		that.$refs.uToast.show({
+						           			title: '提交成功',
+						           			type: 'success',
+						           			url: '/pages/erpbusiness/acquisitionInspection/acquisitionInspection'
+						           		})
+						           	}else{
+						           		that.$refs.uToast.show({
+						           			title: '提交失败',
+						           			type: 'error',
+						           		})
+						           	}
+						           })
+						        } else if (res.cancel) {
+						            console.log('用户点击取消');
+						        }
+						console.log(that.detailData)
+				
 					}
 				})
 			}

+ 119 - 0
pages/erpbusiness/acquisitionInspection/selectContractNo.vue

@@ -0,0 +1,119 @@
+<template>
+	<view class="warp">
+		<view class="content1">
+			<u-search placeholder="输入合同编号" :show-action="false" v-model="inputKeyword"></u-search>
+		</view>
+		<view class="content2" v-if="!inputKeyword">
+			<view class="title">最新合同</view>
+			<view class="item-contnet">
+				<view class="item-list" v-for="(item,index) in newList" :key="index" @click="confirm(item)">
+					{{item.contractNo}}
+				</view>
+			</view>
+		</view>
+		<view class="content3" v-if="inputKeyword">
+			<view class="search-item-list" v-for="(item,index) in filterNewList" :key="index" @click="confirm(item)">
+				{{item.contractNo}}
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	 import helper from '@/common/helper.js'; 
+	export default {
+		data() {
+			return {
+				inputKeyword: '',
+				newList: [],
+				filterNewList: [],
+				compId: ''
+			}
+		},
+		onShow() {},
+		onLoad(options) {
+			this.compId = options.compId
+			console.log(helper.selectContractNo); 
+			this.getContractNoList()
+		},
+		watch: {
+			inputKeyword(val) {
+				this.filterNewList = this.newList.filter(function(item) {
+					if (item.contractNo.indexOf(val) > -1) {
+						return item
+					}
+				})
+			}
+		},
+		methods: {
+			confirm(item){
+				uni.navigateTo({
+					url:'tareDetail1',
+					  success: function(res) {
+					   helper.selectContractNo = item
+					  }
+				})
+			},
+			getContractNoList() {
+				this.$api.doRequest('get', '/warehouseBaseInfo/selectContractNoList', {
+					compId: this.compId,
+					flag: 5,
+				}).then(res => {
+					if (res.data.code == 200) {
+						console.log(res)
+						this.newList = res.data.data
+					}
+				})
+			},
+		}
+	}
+</script>
+
+<style scoped lang="scss">
+	.content1 {
+		background: white;
+		padding: 20rpx;
+		border-radius: 0 0 20rpx 20rpx;
+	}
+
+	.content2 {
+		background: white;
+		margin-top: 20rpx;
+		padding: 20rpx;
+		border-radius: 20rpx 20rpx 0 0;
+
+		.title {
+			font-size: 28rpx;
+			font-weight: 400;
+			color: #AFB3BF;
+		}
+
+		.item-contnet {
+			display: flex;
+			flex-wrap: wrap;
+			justify-content: space-between;
+		}
+
+		.item-list {
+			width: 45%;
+			background: #F5F6F9;
+			margin: 20rpx 0;
+			padding: 10rpx 15rpx;
+			border-radius: 30rpx;
+			text-align: center;
+		}
+	}
+
+	.content3 {
+		height: calc(100vh - 192rpx);
+		background: white;
+		padding: 20rpx;
+		box-sizing: border-box;
+	}
+
+	.search-item-list {
+		margin: 20rpx;
+		border-bottom: 1px solid #EEEEEE;
+		padding-bottom: 20rpx;
+	}
+</style>

+ 44 - 18
pages/erpbusiness/acquisitionInspection/tareDetail.vue

@@ -6,51 +6,51 @@
 		<view class="content">
 			<view class="row">
 				<view class="left">仓库</view>
-				<view class="right">仓库仓库仓库仓库仓库1</view>
+				<view class="right">{{detailData.warehouseName}}</view>
 			</view>
 			<view class="row">
 				<view class="left">编号</view>
-				<view class="right">仓库仓库仓库仓库仓库1</view>
+				<view class="right">{{detailData.number}}</view>
 			</view>
 			<view class="row">
 				<view class="left">客户</view>
-				<view class="right">仓库仓库仓库仓库仓库1</view>
+				<view class="right">{{detailData.customer}}</view>
 			</view>
 			<view class="row">
 				<view class="left">车牌号</view>
-				<view class="right">仓库仓库仓库仓库仓库1</view>
+				<view class="right">{{detailData.carNumber}}</view>
 			</view>
 			<view class="row">
 				<view class="left">仓位号</view>
-				<view class="right">仓库仓库仓库仓库仓库1</view>
+				<view class="right">{{detailData.binNumber}}</view>
 			</view>
 			<view class="row">
 				<view class="left">囤位号</view>
-				<view class="right">仓库仓库仓库仓库仓库1</view>
+				<view class="right">{{detailData.storageNumber}}</view>
 			</view>
 			<view class="row">
 				<view class="left">货名</view>
-				<view class="right">仓库仓库仓库仓库仓库1</view>
+				<view class="right">{{detailData.goodsName}}</view>
 			</view>
 			<view class="row row-bottom">
 				<view class="left">毛重(公斤)</view>
-				<view class="right">仓库仓库仓库仓库仓库1</view>
+				<view class="right">{{detailData.grossWeight}}</view>
 			</view>
 			<view class="row row-bottom">
 				<view class="left">皮重(公斤)</view>
-				<input class="right-bottom" placeholder="输入皮重"></input>
+				<input class="right-bottom" placeholder="输入皮重" v-model="tare"></input>
 			</view>
 			<view class="row row-bottom">
 				<view class="left">扣杂(公斤)</view>
-				<input class="right-bottom" placeholder="输入扣杂"></input>
+				<input class="right-bottom" placeholder="输入扣杂" v-model="buckleMiscellaneous"></input>
 			</view>
 			<view class="row row-bottom" style="border: 0;">
 				<view class="left">净重(公斤)</view>
-				<input class="right-bottom" disabled placeholder="自动计算"></input>
+				<input class="right-bottom" disabled placeholder="自动计算" v-model="detailData.netWeight"></input>
 			</view>
 		</view>
 		<u-button type="primary" class="submit" @click="submit">提交</u-button>
-
+		<u-toast ref="uToast" />
 	</view>
 </template>
 
@@ -58,22 +58,48 @@
 	export default {
 		data() {
 			return {
-				detailData: {
-					name: ""
-				}
+				detailData: {},
+				tare:0,
+				buckleMiscellaneous:0
 			}
 		},
 		onShow() {},
 		onLoad(options) {
-			debugger
-			// this.detailData = JSON.parse(options.detailData)
+			this.detailData = JSON.parse(options.detailData)
+		},
+		watch:{
+			tare(val){
+				console.log(val)
+				this.detailData.tare = val
+				this.detailData.netWeight = parseFloat(this.detailData.grossWeight)-parseFloat(this.detailData.tare)-parseFloat(this.detailData.buckleMiscellaneous)
+			},
+			buckleMiscellaneous(val){
+				this.detailData.buckleMiscellaneous = val
+				this.detailData.netWeight = parseFloat(this.detailData.grossWeight)-parseFloat(this.detailData.tare)-parseFloat(this.detailData.buckleMiscellaneous)
+			}
 		},
 		methods: {
 			submit(){
+				let that = this;
 				uni.showModal({
 					content:"确定提交检斤信息?",
 					success() {
-						console.log("提交")
+						debugger
+						console.log(that.detailData)
+						that.$api.doRequest('post', '/weighingManagement/api/editTare',that.detailData).then(res => {
+							if(res.data.code==200){
+								that.$refs.uToast.show({
+									title: '提交成功',
+									type: 'success',
+									url: '/pages/erpbusiness/acquisitionInspection/acquisitionInspection'
+								})
+							}else{
+								that.$refs.uToast.show({
+									title: '提交失败',
+									type: 'error',
+								})
+							}
+						})
 					}
 				})
 			}

+ 24 - 9
pages/erpbusiness/acquisitionInspection/tareDetail1.vue

@@ -6,7 +6,7 @@
 			</view>
 			<view class="row">
 				<view class="left">仓库</view>
-				<view class="right">仓库仓库仓库仓库仓库1</view>
+				<view class="right">{{detailData.warehouseName}}</view>
 			</view>
 			<view class="row" @click="contractNoClick">
 				<view class="left">合同编号</view>
@@ -42,7 +42,7 @@
 				<input class="right-bottom" placeholder="输入毛重"></input>
 			</view>
 		</div>
-		<u-select v-model="isShowContractNo" :list="contractNoList" @confirm="confirmContractNo"></u-select>
+		<!-- <u-select v-model="isShowContractNo" :list="contractNoList" @confirm="confirmContractNo"></u-select> -->
 		<u-select v-model="isShowBinNo" :list="binNoList" @confirm="confirmBinNo"></u-select>
 		<u-select v-model="isShowIssueType" :list="issueTypeList" @confirm="confirmIssueTypeNo"></u-select>
 		<u-button type="primary" class="submit" @click="submit">提交</u-button>
@@ -51,16 +51,16 @@
 </template>
 
 <script>
+	import helper from '@/common/helper.js'; 
 	export default {
 		data() {
 			return {
-				isShowContractNo: false,
+				// isShowContractNo: false,
 				isShowBinNo: false,
 				isShowIssueType: false,
 				issueTypeVal: "销售出库",
-				detailData: {
-					name: ""
-				},
+				detailData: {},
+				id:'',
 				contractNoList: [],
 				binNoList: [],
 				issueTypeList: [{
@@ -84,12 +84,27 @@
 		},
 		onShow() {},
 		onLoad(options) {
-			debugger
-			// this.detailData = JSON.parse(options.detailData)
+			console.log(helper.detailData); 
+			if(helper.selectContractNo){
+				
+			}
+			this.id = helper.detailData.id
+			this.getWeighingManagement()
 		},
 		methods: {
+			getWeighingManagement(){
+					this.$api.doRequest('get', '/weighingManagement/getWeighingManagement',
+					{id: this.id}).then(res => {
+						if(res.data.code==200){
+						console.log(res)
+						this.detailData = res.data.data
+						}
+					})
+			},
 			contractNoClick() {
-				this.isShowContractNo = true
+				uni.navigateTo({
+					url:"selectContractNo?compId="+this.detailData.compId
+				})
 			},
 			binNoClick() {
 				this.isShowBinNo = true

+ 0 - 1
pages/erpbusiness/acquisitionInspection/tareDetail2.vue

@@ -72,7 +72,6 @@
 		},
 		onShow() {},
 		onLoad(options) {
-			debugger
 			// this.detailData = JSON.parse(options.detailData)
 		},
 		methods: {

+ 167 - 49
pages/erpbusiness/acquisitionInspection/warehouseWeighing.vue

@@ -1,10 +1,10 @@
 <template>
 	<view class="content">
 		<view class="top">
-			<u-search placeholder="输入编号/客户号/车牌号" v-model="inputKeyword"></u-search>
+			<u-search placeholder="输入编号/客户号/车牌号" v-model="inputKeyword" @search="getList()"></u-search>
 			<view class="dropdown">
 				<view class="left" @click="selectWarehouse">
-					<view >{{warehouseName}}</view>
+					<view>{{warehouseName}}</view>
 					<u-icon name="arrow-down" color=""></u-icon>
 				</view>
 				<view class="right">
@@ -18,96 +18,185 @@
 			<view class="item-style" v-for="(item,index) in dataList" :key="index" @click="toDetail">
 				<view class="row1">
 					<view class="row1-left">
-						<view class="left">检</view>
+						<view class="left status1" v-if="item.status=='已质检'">检</view>
+						<view class="left status2" v-if="item.status=='已称皮重'">皮</view>
+						<view class="left status3" v-if="item.status=='已称毛重'">毛</view>
 						<view>
 							<view class="top-title">
-								RKZJ20210823xxxxxxx
+								{{item.contractNo}}
 							</view>
-							<view class="bottom">2021-07-05</view>
+							<view class="bottom">{{item.updateDate}}</view>
 						</view>
 					</view>
-					<view class="right">李四</view>
+					<view class="right">{{item.customer}}</view>
 				</view>
-				<view class="row2">
-					<view>张三</view>
-					<view>辽H12345</view>
-					<view>玉米(20水)</view>
+				<view class="row2" v-if="item.paymentManagement">
+					<view>{{item.paymentManagement.customerName}}</view>
+					<view>{{item.paymentManagement.carNo}}</view>
+					<view>{{item.paymentManagement.goodsName}}({{item.waterContent}}水)</view>
 				</view>
 				<view class="row3">
 					<view class="row3-item">
-						<view class="left"></view>
-						<view>未承重</view>
+						<view class="left"></view>
+						<view>{{item.tare?item.tare:'未称重'}}</view>
 					</view>
 					<view class="row3-item">
-						<view class="left"></view>
-						<view>未承重</view>
+						<view class="left"></view>
+						<view>{{item.grossWeight?item.grossWeight:'未称重'}}</view>
 					</view>
 					<view class="row3-item">
 						<view class="left">净</view>
-						<view>未承重</view>
+						<view>{{item.netWeight?item.netWeight:'未称重'}}</view>
 					</view>
 				</view>
 				<view class="row4">
-					<view class="right" @click.stop="tareClick(item)">皮重</view>
-					<view class="right" @click.stop="grossWeightClick(item)">毛重</view>
+					<view v-if="item.status!='已称毛重'" class="right" @click.stop="tareClick(item)">皮重</view>
+					<view v-if="!(item.paymentManagement&&item.paymentManagement.status=='已收款')||
+					!(item.paymentManagement&&item.paymentManagement.status=='部分收款')
+					" class="right" :class="item.status=='已质检'?'gray':''" @click.stop="grossWeightClick(item)">毛重</view>
 					<view class="right" @click.stop="delClick(item)">删除</view>
 				</view>
 			</view>
 		</view>
+		<u-toast ref="uToast" />
 	</view>
 </template>
 
 <script>
+	import helper from '@/common/helper.js'; 
 	export default {
 		data() {
 			return {
 				inputKeyword: '',
-				warehouseName:'',
+				warehouseName: '',
 				isShowWarehouse: false,
-				warehouseList: [{
-						label: '仓库1',
-						value: 1,
-					},
-					{
-						label: '仓库2',
-						value: 2,
-					},
-					{
-						label: '仓库3',
-						value: 3,
-					}
-				],
-				dataList: [{name:1}, {}, {}]
+				warehouseList: [],
+				dataList: []
 			}
 		},
 		onShow() {
-			this.warehouseName = this.warehouseList[0].label
+			this.$api.doRequest('get', '/commonUser/api/checkSession').then(res => {
+					if (res.data.data == "INVALID") {
+						uni.showModal({
+							title: "登录提示",
+							content: "Session过期需要重新登录,是否立即登录",
+							showCancel: true,
+							confirmText: '登录',
+							success(e) {
+								if (e.confirm) {
+									uni.navigateTo({
+										url: '/pages/public/login'
+									})
+								}
+							}
+						})
+					} else {
+						this.compId = uni.getStorageSync('pcUserInfo').compId
+						console.log("compId", this.compId)
+						this.loadData()
+					}
+				})
+				.catch(res => {
+					if (res.message) {
+						uni.showToast({
+							title: res.message,
+							icon: 'none',
+							duration: 2000
+						})
+					}
+				});
 		},
 		methods: {
+			loadData() {
+				this.$api.doRequest('get', '/warehouseBaseInfo/selectWarehouseSelf', {
+					compId: this.compId
+				}).then(res => {
+					console.log("warehouseBaseInfo", res)
+					let _resData = res.data.data
+					for (let i = 0; i < _resData.length; i++) {
+						let _obj = {
+							"label": _resData[i].warehouseName,
+							"value": _resData[i].id,
+						}
+						this.warehouseList.push(_obj)
+					}
+					this.warehouseName = this.warehouseList[0].label
+					this.getList()
+				})
+			},
+			//获取列表
+			getList() {
+				this.$api.doRequest('get', '/weighingManagement/selectWeighingManagement', {
+					compId: this.compId,
+					currentPage: 1,
+					pageSize: 10,
+					searchKeyWord: this.inputKeyword,
+					warehouseName: this.warehouseName,
+					managementType: 3,
+				}).then(res => {
+					this.dataList = res.data.data.records
+					console.log(res.data.data.records)
+					// console.log("--------------------------------")
+					// console.log("this.dataList",this.dataList)
+				})
+			},
 			selectWarehouse() {
 				this.isShowWarehouse = true
-			},confirmWarehouse(e){
+			},
+			confirmWarehouse(e) {
 				console.log(e)
-				this.warehouseName =e[0].label
+				this.warehouseName = e[0].label
 			},
 			//毛重
-			grossWeightClick(val){
+			grossWeightClick(val) {
+				if (val.status == "已质检") return;
 				console.log(val)
 				uni.navigateTo({
-					url:'./grossWeightDetail1?detailData='+JSON.stringify(val)
+					url: './grossWeightDetail1?detailData=' + JSON.stringify(val)
 				})
 			},
-			tareClick(val){
+			tareClick(val) {debugger
+				helper.detailData = val
 				uni.navigateTo({
-					url:'./tareDetail1?detailData='+JSON.stringify(val)
+					url: './tareDetail1?detailData=' + JSON.stringify(val)
 				})
 			},
-			delClick(val){
+			delClick(val) {
 				console.log(val)
+				let that = this;
+				uni.showModal({
+					content: "确定删除检斤信息?",
+					success: function(res) {
+						if (res.confirm) {
+							console.log(that.detailData)
+							that.$api.doRequest('post', '/weighingManagement/api/deleteWeightcheck', {
+								id: val.id
+							}).then(res => {
+								if (res.data.code == 200) {
+									that.$refs.uToast.show({
+										title: '删除成功',
+										type: 'success',
+										url: '/pages/erpbusiness/acquisitionInspection/warehouseWeighing'
+									})
+								} else {
+									that.$refs.uToast.show({
+										title: '删除失败',
+										type: 'error',
+									})
+								}
+							})
+						} else if (res.cancel) {
+							console.log('用户点击取消');
+						}
+						debugger
+
+					}
+				})
+
 			},
-			toDetail(val){
+			toDetail(val) {
 				uni.navigateTo({
-					url:'./tareDetail2?detailData='+JSON.stringify(val)
+					url: './tareDetail2?detailData=' + JSON.stringify(val)
 				})
 			}
 		}
@@ -127,7 +216,7 @@
 		align-items: center;
 		position: relative;
 		margin: 20rpx 0;
-		padding:0 13rpx;
+		padding: 0 13rpx;
 
 		.right,
 		.left {
@@ -173,7 +262,8 @@
 
 			}
 		}
-		.row2{
+
+		.row2 {
 			display: flex;
 			background: #F9F9FA;
 			border-radius: 10rpx;
@@ -182,12 +272,16 @@
 			margin: 20rpx;
 			color: #878C9C;
 		}
-		.row3{
+
+		.row3 {
 			display: flex;
-			.row3-item{
+			margin-top: 20rpx;
+
+			.row3-item {
 				display: flex;
 				margin-right: 40rpx;
-				.left{
+
+				.left {
 					background: #22C572;
 					border-radius: 10rpx;
 					padding: 2rpx 10rpx;
@@ -198,11 +292,13 @@
 				}
 			}
 		}
-		.row4{
+
+		.row4 {
 			margin-top: 10px;
 			display: flex;
 			justify-content: flex-end;
-			.right{
+
+			.right {
 				border: 1px solid #CDCDCD;
 				border-radius: 45rpx;
 				padding: 10rpx 30rpx;
@@ -211,4 +307,26 @@
 		}
 
 	}
+
+	.status1,
+	.status2,
+	.status3 {
+		padding: 8rpx 12rpx;
+		border-radius: 50%;
+		color: white;
+	}
+
+	.status1 {
+		background: #FD714F;
+	}
+
+	.status2 {
+		background: #22C572;
+	}
+
+	.status3 {
+		background: #3296FA;
+	}
+
+	.gray {}
 </style>

+ 1 - 1
pages/erpbusiness/index.vue

@@ -267,7 +267,7 @@
 				// 	uni.hideLoading()
 				// })
 			},
-			gridClick(item, index) {debugger
+			gridClick(item, index) {
 				var that = this
 				if (item.name == "退出登录") {
 					this.logout()

+ 91 - 39
pages/erpbusiness/sm/sm.vue

@@ -7,7 +7,7 @@
 			</view>
 			<view class="top-content-2">
 				<view>来自</view>
-				<view class="top-content-green">{{title}}</view>
+				<view class="top-content-green">{{user.title}}</view>
 				<view>的邀请。</view>
 			</view>
 			<view class="top-content-3">
@@ -18,7 +18,7 @@
 				<view v-if="grainMerchantList.length>0">
 					<view v-for="(item,index) in grainMerchantList" :key="index">
 						<view v-if="item.cover!=1" :class="item.check?'item-select':'item'" @click="selectItem(item)">
-							<img v-if="item.check" class="img" src="../../../static/img/select.png" alt="">
+							<image v-if="item.check" class="img" :src="img1" alt=""></image>
 							<view class="name">{{item.customerName}}</view>
 							<view class="phone">
 								<view class="number">{{item.customerPhone}}</view>
@@ -29,11 +29,11 @@
 				</view>
 
 				<view class="nolist" v-if="grainMerchantList.length==0">
-					<img class="img" src="../../../static/img/nolist.png" alt="">
+					<image class="img" :src="img2" alt=""></image>
 					<view class="text">您还未认证个人粮商身份</view>
 				</view>
-				<button v-if="grainMerchantList.length>0" class="custom-style" @click="submit">接受邀请</button>
-				<button v-if="grainMerchantList.length==0" class="custom-style" @click="attestation">接受并去认证</button>
+				<button v-if="grainMerchantList.length>0" :class="isAllselect?'':'custom-style'" @click="submit">{{btnVal}}</button>
+				<button v-if="grainMerchantList.length==0" class="custom-style" @click="toGrainMerchantCertification()">接受并去认证</button>
 			</div>
 		</u-popup>
 	</view>
@@ -46,23 +46,18 @@
 	export default {
 		data() {
 			return {
+				img1:require("../../../static/img/select.png"),
+				img2:require("../../../static/img/nolist.png"),
 				show: true,
 				identityAuthenticationInfo: {},
-				title: "",
-				grainMerchantList: []
-				// grainMerchantList: [{
-				// 		name: "张三",
-				// 		phone: "189****9999",
-				// 		state: "已认证",
-				// 		check: false
-				// 	},
-				// 	{
-				// 		name: "李四",
-				// 		phone: "189****9999",
-				// 		state: "审核中",
-				// 		check: false
-				// 	}
-				// ]
+				grainMerchantList: [],
+				selectID: "",
+				btnVal: "接受邀请",
+				user: {
+					title: '',
+					companyId: ''
+				},
+				isAllselect:false
 			}
 		},
 		computed: {
@@ -71,14 +66,31 @@
 		methods: {
 			selectItem(item) {
 				console.log("item", item)
-				item.check = !item.check
+				if(item.authenticationStatus=="已接受") return
+				for (let i = 0; i < this.grainMerchantList.length; i++) {
+					if (this.grainMerchantList[i].id == item.id) {
+						this.grainMerchantList[i].check = !this.grainMerchantList[i].check
+						if (this.grainMerchantList[i].check) {
+							this.selectID = this.grainMerchantList[i].id
+						}
+					} 
+				}
 			},
 			//查询粮商身份
 			selectGrainMerchantList() {
 				//
 			},
-			onLoad(e) {
-				this.title = e.name
+			//粮商认证
+			toGrainMerchantCertification(){
+				uni.navigateTo({
+					url:'/pages/attestation/indexTwo'
+				})
+			},
+			onLoad(options) {
+				  //#ifdef APP-PLUS
+				  this.user.title = options.data.split(',')[2]
+				  this.user.companyId = options.data.split(',')[1]
+				  //#endif
 			},
 			onShow() {
 				this.getList()
@@ -90,7 +102,8 @@
 						pageSize: 100,
 						currentPage: 1,
 						commonId: this.userInfo.id,
-						flag: 0
+						compId:this.user.companyId,
+						flag: 3
 					}, 'application/json;charset=UTF-8').then(res => {
 						for (var i = 0; i < res.data.data.records.length; i++) {
 							res.data.data.records[i].basis = "false"
@@ -105,6 +118,16 @@
 									data[i].compName = data[i].compName.substring(0, 10) + "..."
 								}
 							}
+							if (data[i].authenticationStatus == "已接受") {
+								data[i].check = true
+								this.isAllselect = true
+							} else {
+								data[i].check = false
+								this.isAllselect = false
+							}
+						}
+						if(this.isAllselect){
+							this.btnVal = "已接受"
 						}
 						this.grainMerchantList = res.data.data.records
 						console.log(this.grainMerchantList)
@@ -127,22 +150,51 @@
 					});
 			},
 			submit() {
-				let _isAllCheck = false
-				for (let i = 0; i < this.grainMerchantList.length; i++) {
-					if (this.grainMerchantList[i].check) {
-						_isAllCheck = true
-					}
-				}
-				if (!_isAllCheck) {
-					this.$refs.uToast.show({
-						title: '至少选择一个身份',
-						type: "error",
-						icon: false
+				if(this.isAllselect) return
+				// let _isAllCheck = false
+				// for (let i = 0; i < this.grainMerchantList.length; i++) {
+				// 	if (this.grainMerchantList[i].check) {
+				// 		_isAllCheck = true
+				// 	}
+				// }
+				// if (!_isAllCheck) {
+				// 	this.$refs.uToast.show({
+				// 		title: '至少选择一个身份',
+				// 		type: "error",
+				// 		icon: false
+				// 	})
+				// }
+				console.log("this.user.compId",this.user.companyId)
+				this.$api.doRequest('get', '/identityAuthenticationInfo/saveCompanyIdentity', {
+						id: this.selectID,
+						compId:this.user.companyId,
+					}, 'application/json;charset=UTF-8').then(res => {
+						console.log(res);
+						if (res.statusCode == 200) {
+							
+							this.getList()
+							
+						}
+
+
 					})
-				}
+					.catch(res => {
+						if (res.message) {
+							uni.showToast({
+								title: res.message,
+								icon: 'none',
+								duration: 2000
+							})
+						} else {
+							uni.showToast({
+								title: "接受邀请失败,请稍后再试。",
+								icon: 'none',
+								duration: 2000
+							})
+						}
+					});
+
 			},
-			//接受并认证
-			attestation() {},
 			close() {
 				uni.navigateBack(-1)
 			}
@@ -164,7 +216,7 @@
 	}
 
 	.content-bottom {
-		padding: 50rpx 50rpx 0 50rpx;
+		padding: 50rpx 50rpx 50rpx 50rpx;
 
 		.title {
 			font-size: 32rpx;

+ 1 - 1
pages/grain_pulse/distribution/distribution.nvue

@@ -125,7 +125,7 @@
 					let newmarker =[];
 					var id=1;
 						console.log('res',res)
-					if (res.data.code == 200) {debugger
+					if (res.data.code == 200) {
 					
 						this.datalist = res.data.data.records
 						let lat1 = this.nowLocation.latitude

+ 1 - 1
pages/grain_pulse/distribution/distribution.vue

@@ -111,7 +111,7 @@
 					detailedAddress:detailedAddress
 				}).then(res => {
 						console.log('res',res)
-					if (res.data.code == 200) {debugger
+					if (res.data.code == 200) {
 						this.datalist = res.data.data.records
 						let lat1 = this.nowLocation.latitude
 						let lng1 = this.nowLocation.longitude

+ 1 - 2
pages/user/user.vue

@@ -1,6 +1,5 @@
 <template>
 	<view class="container">
-
 		<!-- <view class="user-section">
 			<view class="bg">
 				<image class="bg_ware" src="https://moyv.top/wechat/images/bg_wave.gif"></image>
@@ -296,7 +295,7 @@
 				    success: function (res) {
 				        console.log('条码内容:' + res.result);
 						uni.navigateTo({
-							url:"/pages/erpbusiness/sm/sm?name="+res.result
+							url:"/pages/erpbusiness/sm/sm?data="+res.result
 						})
 				    }
 				});