Browse Source

叫号功能

wangchao 3 years ago
parent
commit
36157d8571

+ 43 - 18
pages/user/depotAcquisition/depotAcquisition.vue

@@ -32,12 +32,11 @@
 				</view>
 				</view>
 			</view>
 			</view>
 			<view class="row4">
 			<view class="row4">
-				<view class='' @click='naviageToPage("/pages/grain_pulse/position/position")'>
-					<!-- <image class='location' src="../../../static/img/liangmai/icon_ditu@2x.png" mode=""></image> -->
+				<view class='position'>
+					<image class='location' src="../../../static/img/liangmai/icon_ditu.png" mode=""></image>
 					{{item.warehousePrivate}}{{item.warehouseCity}}{{item.warehouseArea}}{{item.detailedAddress}}
 					{{item.warehousePrivate}}{{item.warehouseCity}}{{item.warehouseArea}}{{item.detailedAddress}}
 				</view>
 				</view>
-				<u-button
-					@click='naviageToPage("/pages/user/depotAcquisition/grainDeliveryRegistration?itemValue="+JSON.stringify(item))'>
+				<u-button class="btn" @click='naviageToPage("/pages/user/depotAcquisition/grainDeliveryRegistration?itemValue="+JSON.stringify(item))'>
 					我要送粮
 					我要送粮
 				</u-button>
 				</u-button>
 			</view>
 			</view>
@@ -79,12 +78,13 @@
 
 
 		},
 		},
 		// #ifndef MP
 		// #ifndef MP
-		onNavigationBarButtonTap(e) {debugger
+		onNavigationBarButtonTap(e) {
+			debugger
 			const index = e.index;
 			const index = e.index;
-			if(index==1){
+			if (index == 1) {
 				uni.navigateBack()
 				uni.navigateBack()
-			}else{
-				
+			} else {
+
 				this.naviageToPage("/pages/user/depotAcquisition/grainDeliveryRecord")
 				this.naviageToPage("/pages/user/depotAcquisition/grainDeliveryRecord")
 			}
 			}
 		},
 		},
@@ -213,7 +213,7 @@
 		justify-content: space-between;
 		justify-content: space-between;
 		align-items: center;
 		align-items: center;
 		position: relative;
 		position: relative;
-		
+
 		/deep/.u-content {
 		/deep/.u-content {
 			padding-left: 180rpx;
 			padding-left: 180rpx;
 		}
 		}
@@ -258,22 +258,46 @@
 
 
 	.row4 {
 	.row4 {
 		display: flex;
 		display: flex;
+		align-items: center;
+		justify-content: space-between;
+		.btn{
+			background: #22C572;
+			border-radius: 40rpx;
+			font-size: 28rpx;
+			font-weight: 400;
+			color: #FFFFFF;
+			margin: 0;
+		}
+		.position {
+			font-size: 12px;
+			color: #676E80;
+			background: #F5F6FA;
+			padding: 0rpx 20rpx;
+			height: 50rpx;
+			display: flex;
+			align-items: center;
+			border-radius: 50rpx;
+		}
 	}
 	}
-	.icon-jt{
+
+	.icon-jt {
 		margin-left: 20rpx;
 		margin-left: 20rpx;
 	}
 	}
-	.content1{
+
+	.content1 {
 		background: white;
 		background: white;
 		margin: 20rpx;
 		margin: 20rpx;
 		padding: 30rpx;
 		padding: 30rpx;
 		border-radius: 20rpx;
 		border-radius: 20rpx;
-		.row1{
-			.title{
+
+		.row1 {
+			.title {
 				font-size: 32rpx;
 				font-size: 32rpx;
 				font-weight: 500;
 				font-weight: 500;
 				color: #333333;
 				color: #333333;
 			}
 			}
-			.follow{
+
+			.follow {
 				border: 1px solid #EEEEEE;
 				border: 1px solid #EEEEEE;
 				font-weight: 400;
 				font-weight: 400;
 				color: #878C9C;
 				color: #878C9C;
@@ -281,12 +305,13 @@
 				border-radius: 40rpx;
 				border-radius: 40rpx;
 			}
 			}
 		}
 		}
-		.row2{
-			.time{
-color: #878C9C;
+
+		.row2 {
+			.time {
+				color: #878C9C;
 				margin: 20rpx 0;
 				margin: 20rpx 0;
 			}
 			}
-			
+
 		}
 		}
 	}
 	}
 </style>
 </style>

+ 222 - 81
pages/user/depotAcquisition/grainDeliveryRegistration.vue

@@ -1,54 +1,64 @@
 <template>
 <template>
-	<view class="">
+	<view class="content">
 		<view class="content1">
 		<view class="content1">
-			<view>{{dataList.warehouseName}}</view>
+			<view class="row1">
+				<view class="title">{{dataList.warehouseName}}</view>
+				<view class="validityDate">有效期{{dataList.validityDate}} 0时</view>
+			</view>
 			<view class="row2">
 			<view class="row2">
-				<view class='locationwrap'>
-					<image class='location' src="../../../static/img/liangmai/icon_ditu@2x.png" mode=""></image>
-					{{warehouseNameAddress}}
-				</view>
+				<view class="start-time">{{startDate}}创建</view>
 			</view>
 			</view>
 			<view class="row3">
 			<view class="row3">
-				<view>{{startDate}}创建(有效期{{dataList.validityDate}})</view>
+				<view class='locationwrap'>
+					<image class='location' src="../../../static/img/liangmai/icon_ditu.png" mode=""></image>
+					<view class="position">{{warehouseNameAddress}}</view>
+				</view>
 			</view>
 			</view>
 		</view>
 		</view>
 		<view class="content2">
 		<view class="content2">
-			<view class="title">送货信息</view>
 			<view class="wrap wrap1" v-for="(item,index) in dataList.shippingInformationList" :key='index'>
 			<view class="wrap wrap1" v-for="(item,index) in dataList.shippingInformationList" :key='index'>
-				<view class="row1">
-					<view class="left">
-						<view>货主{{index+1}}-{{item.customerName}}</view>
-						<view @click="reduceBtn(index)">--</view>
-					</view>
-					<view class="right" @click='showCustomerName(item)'>
-						<view>{{item.customerName}}</view>
-						<u-icon name="arrow-right" color=""></u-icon>
+				{{item}}
+				<view class="row1 row">
+					<!-- -{{item.customerName}} -->
+					<view class="customerName">货主-{{index+1}}</view>
+					<image src="../../../static/img/sign/shanchu@2x.png" @click="reduceBtn(index)"></image>
+				</view>
+				<view class="row2 row">
+					<view class="left">姓名</view>
+					<view class="right" @click='showCustomerName(item,index)'>
+						<view>{{item.shipperName}}</view>
 						<u-picker @confirm="nameConfirm" range-key='customerName' mode="selector"
 						<u-picker @confirm="nameConfirm" range-key='customerName' mode="selector"
 							v-model="item.showCustomerName" :range="nameList"></u-picker>
 							v-model="item.showCustomerName" :range="nameList"></u-picker>
+						<u-icon name="arrow-right"></u-icon>
 					</view>
 					</view>
 				</view>
 				</view>
-				<view class="row2">
+				<view class="row3 row">
 					<view class="left">
 					<view class="left">
 						供应商(送粮人)
 						供应商(送粮人)
 					</view>
 					</view>
 					<view class="right">{{item.supplier}}</view>
 					<view class="right">{{item.supplier}}</view>
 				</view>
 				</view>
-				<view class="row2" v-for="(item1,index1) in item.carNumberList" :key='index1'>
+				<view class="row4 row" v-for="(item1,index1) in item.carNumberList" :key='index1'>
 					<view class="left">
 					<view class="left">
 						车牌号-{{index1+1}}
 						车牌号-{{index1+1}}
 					</view>
 					</view>
-					<u-input v-model="item1.carNo" placeholder="输入7为车牌号" />
-					<view>
-						<view @click="addCarNumber(item.carNumberList)">+</view>
-						<view @click="delCarNumber(item.carNumberList,index1)">-</view>
+					<view class="right">
+						<u-input v-model="item1.carNo" placeholder="输入7为车牌号" />
+						<view class="btn">
+							<view @click="addCarNumber(item.carNumberList)" style="margin-right: 20rpx;">
+								<image class='row4-img' src="https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/jia%402x.png"></image>
+							</view>
+							<view @click="delCarNumber(item.carNumberList,index1)">
+								<image class='row4-img' src="https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/jian%402x.png"></image>
+							</view>
+						</view>
 					</view>
 					</view>
-				</view>
-
 
 
+				</view>
 			</view>
 			</view>
-			<u-button @click='addGoodPeople'>增加货主</u-button>
+			<view class='add-good-people' @click='addGoodPeople'><image class="img" src="https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/ic_join_dialing_norm%402x.png" @click="reduceBtn(index)"></image>增加货主</view>
 		</view>
 		</view>
-		<u-button @click='submit'>提交</u-button>
+		<u-button class='submit' @click='submit'>提交</u-button>
 		<u-modal v-model="isShowAlert" :title-style="{fontSize: '18px',fontWeight:'500'}"
 		<u-modal v-model="isShowAlert" :title-style="{fontSize: '18px',fontWeight:'500'}"
 			:content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='确定' title='登录提示'
 			:content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='确定' title='登录提示'
 			showCancelButton='false' :content="content" @confirm="alertBtn" @cancel="cancelClick"></u-modal>
 			showCancelButton='false' :content="content" @confirm="alertBtn" @cancel="cancelClick"></u-modal>
@@ -87,46 +97,27 @@
 					commonId: uni.getStorageSync("userInfo").id,
 					commonId: uni.getStorageSync("userInfo").id,
 					shippingInformationList: [{
 					shippingInformationList: [{
 						shipperName: '',
 						shipperName: '',
-						supplier: '',
+						supplier: '',
 						carNo: '',
 						carNo: '',
+						showCustomerName: false,
 						carNumberList: [{
 						carNumberList: [{
 							carNo: ''
 							carNo: ''
 						}]
 						}]
 					}]
 					}]
-
-				}
+				},
+				selectObj: {},
+				nameListCopy:[]
 			}
 			}
 		},
 		},
 
 
 		onLoad(options) {
 		onLoad(options) {
-			debugger
-			// let _pageToData = JSON.parse(options.itemValue)
-			// this.dataList.warehouseName = _pageToData.warehouseName
-			// this.startDate = this.getTime()[0]
-			// this.dataList.validityDate = this.getTime()[1]
-			// this.warehouseNameAddress = _pageToData.warehousePrivate + _pageToData.warehouseCity + _pageToData
-			// 	.warehouseArea + _pageToData.detailedAddress
-		},
-		// #ifndef MP
-		onNavigationBarButtonTap(e) {
-			const index = e.index;
-			if (index === 0) {
-				this.navTo('/pages/set/set');
-			} else if (index === 1) {
-				// #ifdef APP-PLUS
-				const pages = getCurrentPages();
-				const page = pages[pages.length - 1];
-				const currentWebview = page.$getAppWebview();
-				currentWebview.hideTitleNViewButtonRedDot({
-					index
-				});
-				// #endif
-				uni.navigateTo({
-					url: '/pages/notice/notice'
-				})
-			}
+			let _pageToData = JSON.parse(options.itemValue)
+			this.dataList.warehouseName = _pageToData.warehouseName
+			this.startDate = this.getTime()[0]
+			this.dataList.validityDate = this.getTime()[1]
+			this.warehouseNameAddress = _pageToData.warehousePrivate + _pageToData.warehouseCity + _pageToData
+				.warehouseArea + _pageToData.detailedAddress
 		},
 		},
-		// #endif
 		computed: {
 		computed: {
 			...mapState(['hasLogin', 'userInfo']),
 			...mapState(['hasLogin', 'userInfo']),
 		},
 		},
@@ -141,10 +132,13 @@
 			console.log("hasLogin", this.hasLogin)
 			console.log("hasLogin", this.hasLogin)
 		},
 		},
 		methods: {
 		methods: {
-			showCustomerName(value) {debugger
-			for(let i = 0;i<this.dataList.shippingInformationList.length;i++){
-				this.dataList.shippingInformationList[i].showCustomerName = false
-			}
+			showCustomerName(value, index) {
+				debugger
+				this.selectObj = value
+				this.selectObj.index = index
+				// for (let i = 0; i < this.dataList.shippingInformationList.length; i++) {
+				// 	this.dataList.shippingInformationList[i].showCustomerName = false
+				// }
 				value.showCustomerName = true
 				value.showCustomerName = true
 			},
 			},
 			getCustomer() {
 			getCustomer() {
@@ -156,10 +150,6 @@
 						if (res.data.code == 200) {
 						if (res.data.code == 200) {
 							// debugger
 							// debugger
 							this.nameList = res.data.data
 							this.nameList = res.data.data
-							// for (let i = 0; i < this.nameList.length; i++) {
-							// 	this.nameList[i].showCustomerName = false
-							// }
-							this.customerName = res.data.data[0].customerName
 						}
 						}
 					})
 					})
 			},
 			},
@@ -174,12 +164,22 @@
 				if (this.dataList.shippingInformationList.length > 1) {
 				if (this.dataList.shippingInformationList.length > 1) {
 					this.dataList.shippingInformationList.splice(index, 1)
 					this.dataList.shippingInformationList.splice(index, 1)
 					this.$forceUpdate()
 					this.$forceUpdate()
+				} else {
+					this.$api.msg('至少保留一位货主!')
 				}
 				}
 			},
 			},
 			submit() {
 			submit() {
 				this.isShowAlert1 = true
 				this.isShowAlert1 = true
 			},
 			},
-			nameConfirm() {},
+			nameConfirm(e) {
+				console.log(e)
+				this.dataList.shippingInformationList[this.selectObj["index"]].shipperName = this.nameList[e[0]].customerName
+				this.dataList.shippingInformationList[this.selectObj["index"]].supplier = this.nameList[e[0]].supplier
+				// 备份货主列表,用于删除货主操作
+				this.nameListCopy=this.$u.deepClone(this.nameList);
+				this.nameListCopy.splice(e[0],1)
+
+			},
 			/**
 			/**
 			 * 统一跳转接口,拦截未登录路由
 			 * 统一跳转接口,拦截未登录路由
 			 * navigator标签现在默认没有转场动画,所以用view
 			 * navigator标签现在默认没有转场动画,所以用view
@@ -193,28 +193,42 @@
 				})
 				})
 			},
 			},
 			alertBtn() {
 			alertBtn() {
-				for (let i = 0; i < this.dataList.shippingInformationList.length; i++) {
-					delete this.dataList.shippingInformationList[i].carNumberList
-				}
-				this.$api.doRequest('post', '/grainDeliveryRegistration/api/insertInfo', this.dataList).then(res => {
-					if (res.data.code == 200) {
-
+				let _isCanSubmit = this.validate()
+				if(_isCanSubmit){
+					for (let i = 0; i < this.dataList.shippingInformationList.length; i++) {
+						delete this.dataList.shippingInformationList[i].carNumberList
 					}
 					}
-				})
+					this.$api.doRequest('post', '/grainDeliveryRegistration/api/insertInfo', this.dataList).then(res => {
+						if (res.data.code == 200) {
+					
+						}
+					})
+				}
+			},
+			validate(){
+				let _val = false
+				return _val
 			},
 			},
 			cancelClick() {
 			cancelClick() {
 				this.isShowAlert = false
 				this.isShowAlert = false
 				this.isShowAlert1 = false
 				this.isShowAlert1 = false
 			},
 			},
 			addGoodPeople() {
 			addGoodPeople() {
-				this.dataList.shippingInformationList.push({
-					shipperName: '',
-					supplier: '',
-					carNo: '',
-					carNumberList: [{
-						carNo: ''
-					}]
-				})
+				// 判断是否还有剩余的货主
+				if(this.nameListCopy.length!=0){
+					this.dataList.shippingInformationList.push({
+						shipperName: '',
+						supplier: '无',
+						carNo: '',
+						showCustomerName: false,
+						carNumberList: [{
+							carNo: ''
+						}]
+					})
+				}else{
+					this.$api.msg('无更多认证货主!')
+				}
+		
 			},
 			},
 			addCarNumber(val) {
 			addCarNumber(val) {
 				val.push({
 				val.push({
@@ -225,6 +239,8 @@
 				if (val.length > 1) {
 				if (val.length > 1) {
 					val.splice(index, 1)
 					val.splice(index, 1)
 					this.$forceUpdate()
 					this.$forceUpdate()
+				}else{
+					this.$api.msg('至少保留一个车牌号!')
 				}
 				}
 			}
 			}
 		}
 		}
@@ -246,11 +262,136 @@
 		width: 32rpx;
 		width: 32rpx;
 		height: 32rpx;
 		height: 32rpx;
 		margin-right: 10rpx;
 		margin-right: 10rpx;
+		position: absolute;
+		left: 20rpx
 	}
 	}
 
 
 	.locationwrap {
 	.locationwrap {
-		font-size: 16px;
 		display: flex;
 		display: flex;
 		align-items: center;
 		align-items: center;
+		position: relative;
+	}
+
+	.position {
+		font-size: 24rpx;
+		padding: 6rpx 16rpx 6rpx 60rpx;
+		border-radius: 30rpx;
+		background: #F5F6FA;
+	}
+
+	.content1 {
+		background: white;
+		margin: 20rpx;
+		padding: 30rpx 20rpx;
+		border-radius: 20rpx;
+
+		.row1 {
+			display: flex;
+			justify-content: space-between;
+
+			.title {
+				font-size: 32rpx;
+				color: #333;
+				font-weight: 700;
+			}
+
+			.validityDate {
+				font-size: 24rpx;
+				color: #FD714F;
+				position: relative;
+				top: -10rpx;
+			}
+		}
+
+		.row2 {
+			.start-time {
+				font-size: 24rpx;
+				color: #878C9C;
+				margin: 6rpx 0;
+			}
+		}
+	}
+
+	.content2 {
+		.row {
+			margin: 20rpx 0;
+		}
+
+		.row1 {
+			display: flex;
+			justify-content: space-between;
+
+			image {
+				width: 32rpx;
+				height: 32rpx;
+			}
+
+			.customerName {
+				font-size: 28rpx;
+				font-weight: 700;
+				color: #333333;
+			}
+		}
+
+		.row2,
+		.row3,
+		.row4 {
+			display: flex;
+			justify-content: space-between;
+
+			.right {
+				display: flex;
+			}
+		}
+	}
+
+	.row4 {
+		display: flex;
+		align-items: center;
+
+		.right {
+			.btn {
+				display: flex;
+				align-items: center;
+			}
+		}
+	}
+
+	.row4-img {
+		width: 32rpx;
+		height: 32rpx;
+	}
+	.add-good-people{
+		border-radius: 45rpx;
+		width: 96%;
+		margin: 20rpx auto;
+		text-align: center;
+		background-color: white;
+		font-size: 34rpx;
+		font-weight: 500;
+		color: #00C265;
+		padding: 20rpx 0;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+		.img{
+			width: 32rpx;
+			height: 32rpx;
+			margin-right: 10rpx;
+		}
+	}
+	.submit{
+		position: fixed;
+		bottom: 20rpx;
+		background: #22C572;
+		border-radius: 46px;
+		font-size: 34rpx;
+		font-weight: 500;
+		color: #FFFFFF;
+		width: 96%;
+		margin-left: 2%;
+	}
+	.content{
+		padding-bottom: 200rpx;
 	}
 	}
 </style>
 </style>

+ 1 - 1
pages/user/user.vue

@@ -241,7 +241,7 @@
 						num: 8,
 						num: 8,
 						name: '库点收购',
 						name: '库点收购',
 						// icon: 'cuIcon-edit',
 						// icon: 'cuIcon-edit',
-						src: '../../static/img/sign/kudianjiankong@2x.png',
+						src: '../../static/img/sign/kdsg.png',
 						tips: 0,
 						tips: 0,
 						url: `/pages/user/depotAcquisition/depotAcquisition`,
 						url: `/pages/user/depotAcquisition/depotAcquisition`,
 						show: true
 						show: true

BIN
static/img/sign/ic_join_dialing_norm@2x.png


BIN
static/img/sign/jia@2x.png


BIN
static/img/sign/jian@2x.png


BIN
static/img/sign/kdsg.png


BIN
static/img/sign/shanchu@2x.png