高敬炎 vor 2 Jahren
Ursprung
Commit
9822a643fd

+ 6 - 17
pages.json

@@ -1360,25 +1360,13 @@
 				"navigationBarTitleText": "库点收购",
 				"enablePullDownRefresh": true,
 				"app-plus": {
-					"softinputNavBar": "none",
-					"scrollIndicator": "none",
-					"softinputMode": "adjustPan",
 					"titleNView": {
-						"autoBackButton": false,
-						"backgroundColor": "#fff",
 						"buttons": [{
-								"fontSrc": "/pageC/static/car/iconfont.ttf",
-								"float": "right",
-								"text": "\ue639",
-								"fontSize": "18px"
-							},
-							{
-								"fontSrc": "pageC/static/iconfont/iconfont.ttf",
-								"float": "left",
-								"text": "\ue6f2",
-								"fontSize": "20px"
-							}
-						]
+							"float": "right",
+							"text": "记录",
+							// "color": "#18b566",
+							"fontSize": "15"
+						}]
 					}
 				}
 			}
@@ -1404,6 +1392,7 @@
 			"style": {
 				"navigationBarTitleText": "贸易粮叫号",
 				"enablePullDownRefresh": false
+				
 			}
 		
 		},

+ 5 - 3
pages/erpbusiness/customer.vue

@@ -34,11 +34,13 @@
 			<view class="dj-customer" v-for="(item,index) in registeredCustomer"
 				@click="registeredCustomerClick(item,item1)">
 				<view class="left">{{item.carNo}}</view>
-				<view class="right">
-					<view class="span1">{{item.shipperName}}()</view>
+				<view v-if='item.callFlag==1' class="right">
+					<view class="span1">{{item.shipperName}}(自产)</view>
 					<view class="">{{item.supplier}}(商)</view>
 				</view>
-
+				<view v-if='item.callFlag==2' class="right">
+					<view class="span1">{{item.shipperName}}(贸易)</view>
+				</view>
 			</view>
 			<!-- </view> -->
 		</view>

+ 5 - 2
pages/erpbusiness/customercar.vue

@@ -34,10 +34,13 @@
 			<view class="dj-customer" v-for="(item,index) in registeredCustomer"
 				@click="registeredCustomerClick(item,item1)">
 				<view class="left">{{item.carNo}}</view>
-				<view class="right">
-					<view class="span1">{{item.shipperName}}()</view>
+				<view v-if='item.callFlag==1' class="right">
+					<view class="span1">{{item.shipperName}}(自产)</view>
 					<view class="">{{item.supplier}}(商)</view>
 				</view>
+				<view v-if='item.callFlag==2' class="right">
+					<view class="span1">{{item.shipperName}}(贸易)</view>
+				</view>
 
 			</view>
 			<!-- </view> -->

+ 40 - 5
pages/user/depotAcquisition/depotAcquisition.vue

@@ -36,12 +36,33 @@
 			</view>
 			<view class="row4">
 				<view class="time">{{item.updateDate}}</view>
-				<view class="btn"
-					@click='naviageToPage("/pages/user/depotAcquisition/grainDeliveryRegistration?warehouseName="+item.warehouseName+"&warehouseId="+item.warehouseId+"&warehousePrivate="+item.warehousePrivate+"&warehouseCity="+item.warehouseCity+"&warehouseArea="+item.warehouseArea+"&detailedAddress="+item.detailedAddress)'>
-					我要送粮
+				
+			</view>
+			<view class="row4">
+				<view></view>
+				<view class='flex'>
+					<view class="btn"
+						@click='naviageToPage("/pages/user/depotAcquisition/grainDeliveryRegistration1?warehouseName="+item.warehouseName+"&warehouseId="+item.warehouseId+"&warehousePrivate="+item.warehousePrivate+"&warehouseCity="+item.warehouseCity+"&warehouseArea="+item.warehouseArea+"&detailedAddress="+item.detailedAddress+"&compId="+item.compId)'>
+						贸易粮叫号
+					</view>
+					<view class="btn"
+						@click='naviageToPage("/pages/user/depotAcquisition/grainDeliveryRegistration?warehouseName="+item.warehouseName+"&warehouseId="+item.warehouseId+"&warehousePrivate="+item.warehousePrivate+"&warehouseCity="+item.warehouseCity+"&warehouseArea="+item.warehouseArea+"&detailedAddress="+item.detailedAddress+"&compId="+item.compId)'>
+						自产粮叫号
+					</view>
+					
 				</view>
+				
+				
 			</view>
 		</view>
+		<u-modal confirm-color='#22C572' @confirm="confirm" show-cancel-button='false' class='radio' title='查看叫号记录' v-model="show" >
+			<view class="slot-content ">
+					<u-radio-group active-color='#22C572' v-model="value" @change="radioGroupChange">
+						<u-radio name="贸易粮叫号记录">贸易粮叫号记录</u-radio>
+						<u-radio name="自产粮叫号记录">自产粮叫号记录</u-radio>
+					</u-radio-group>
+			</view>
+		</u-modal>
 		<u-modal v-model="isShowAlert" :title-style="{fontSize: '18px',fontWeight:'500'}"
 			:content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='确定' title='提示'
 			:showCancelButton='false' :content="content" @confirm="alertBtn" @cancel="cancelClick"></u-modal>
@@ -58,6 +79,8 @@
 		},
 		data() {
 			return {
+				show:false,
+				value:'贸易粮叫号记录',
 				isShowAlert: false,
 				content: '当前登入信息验证失败,是否重新登录?',
 				currentCityName: '',
@@ -84,8 +107,7 @@
 			if (index == 1) {
 				uni.navigateBack()
 			} else {
-
-				this.naviageToPage("/pages/user/depotAcquisition/grainDeliveryRecord")
+				this.show=true
 			}
 		},
 		// #endif
@@ -129,6 +151,13 @@
 			console.log("hasLogin", this.hasLogin)
 		},
 		methods: {
+			confirm(){
+				if(this.value=='自产粮叫号记录') this.naviageToPage("/pages/user/depotAcquisition/grainDeliveryRecord")
+				else uni.navigateTo({url:'/pages/user/depotAcquisition/grainDeliveryRecord1'})
+			},
+			radioGroupChange(e){
+				this.value=e
+			},
 			getListData() {
 				if (this.currentCityName == '全国') this.currentCityName = ''
 				this.$api.doRequest('get', '/acquisitionInfo/selectAcquisitionPage', {
@@ -301,6 +330,7 @@
 			font-weight: 400;
 			color: #FFFFFF;
 			padding: 10rpx 30rpx;
+			margin:10rpx;
 		}
 
 		.time {
@@ -349,4 +379,9 @@
 			}
 		}
 	}
+	.slot-content{
+		text-align:center;
+		height:120rpx;
+		line-height: 120rpx;
+	}
 </style>

+ 2 - 1
pages/user/depotAcquisition/grainDeliveryRecord.vue

@@ -105,7 +105,8 @@
 		methods: {
 			getData(size, page, type) {
 				let _obj = {
-					commonId: uni.getStorageSync("userInfo").id
+					commonId: uni.getStorageSync("userInfo").id,
+					callFlag:1
 				}
 				this.$api.doRequest('get', '/grainDeliveryRegistration/selectGrainDeliveryRegistration', _obj)
 					.then(res => {

+ 47 - 47
pages/user/depotAcquisition/grainDeliveryRecord1.vue

@@ -3,31 +3,18 @@
 		<view class="content">
 			<view class="content1" v-for="(item,index) in dataList" :key="index">
 				<view class="top">
-					<view class="left">{{item.warehouseName}}</view>
-					<view class="right">{{item.validityDate}}</view>
+					<view class="left">{{item.currectDate}}</view>
 				</view>
-				<view v-for="(item1,index) in item.shippingInformationList">
-					<view class="hz-content">
-						<view class="row1">
-							<view class="hz-name">
-								{{item1.shipperName}}
-							</view>
-							<view class="car">
-								({{item1.carList.length}}车)
-							</view>
+				<view v-for="(item1,index) in item.carList">
+					<view class="flex justify-between">
+						<view class="hz-name">
+							{{item1.shipperName}}
 						</view>
-						<view class="car-list">
-							<view v-for="(item2,index) in item1.carList" class="number">
-								{{item2}}
-							</view>
+						<view class="car">
+							{{item1.carNo}}
 						</view>
 					</view>
 				</view>
-				
-				<view class="del-row">
-					<view>{{item.createDate}}</view>
-					<view class="del" @click='del(item)'>删除</view>
-				</view>
 			</view>
 			<u-modal v-model="isShowAlert1" :title-style="{fontSize: '18px',fontWeight:'500'}"
 				:content-style="{fontSize: '14px',fontWeight:'400'}" confirm-color='#22C572' confirm-text='确定'
@@ -105,48 +92,61 @@
 		methods: {
 			getData(size, page, type) {
 				let _obj = {
-					commonId: uni.getStorageSync("userInfo").id
+					commonId: uni.getStorageSync("userInfo").id,
+					callFlag:2
 				}
 				this.$api.doRequest('get', '/grainDeliveryRegistration/selectGrainDeliveryRegistration', _obj)
 					.then(res => {
 						if (res.data.code == 200) {
-							let curPageData = []
 							for (let i = 0; i < res.data.data.length; i++) {
 								let _data = res.data.data[i];
-								//判断是记录是否失效
-								let _isUserd = function() {
-									let _startTime = new Date((_data.validityDate + ' 00:00:00')).getTime();
-									let _endTime = Date.parse(new Date());
-									if (_endTime - _startTime > 0) {
-										_data.validityDate = '已失效'
-									} else {
-										_data.validityDate = _data.validityDate + ' 0时前有效'
-									}
-								}()
-								let _carNumberList=[]
+								let date = new Date(_data.createDate)
+								_data.currectDate = date.getFullYear()+'-'+((date.getMonth()+1)>=10?(date.getMonth()+1):'0'+(date.getMonth()+1))+'-'+(date.getDate()>=10?date.getDate():'0'+date.getDate())
 								for (var q = 0; q < _data.shippingInformationList.length; q++) {
 									console.log(_data.shippingInformationList[q].carNo.split(','))
-									_data.shippingInformationList[q].carList = _data.shippingInformationList[q].carNo.split(',')
-								}
-								let __obj = {
-									warehouseName: _data.warehouseName,
-									id: _data.id,
-									shipperName: _data.shipperName,
-									shippingInformationList: _data.shippingInformationList,
-									validityDate: _data.validityDate,
-									createDate:_data.createDate
-
+									var carArr=_data.shippingInformationList[q].carNo.split(',')
+									_data.shippingInformationList[q].carList = carArr.map(item=>{return {carNo:item,shipperName:_data.shippingInformationList[q].shipperName}})
 								}
-								curPageData.push(__obj)
 							}
+							let newList = res.data.data.map(item=>{return {currectDate:item.currectDate,carList:[]}})
+							let hash={};
+							newList = newList.reduce((item,next)=>{
+								console.log(item,next,11111)
+								hash[next.currectDate]?"":hash[next.currectDate]=true && item.push(next)
+								return item
+							},[])
+							// console.log(newList)
+							res.data.data.forEach((item,index)=>{
+								for(let i in newList){
+									if(item.currectDate==newList[i].currectDate){
+										newList[i].carList.push(...item.shippingInformationList[0].carList)
+									}
+								}
+							})
+							console.log(newList)
+							// let _carNumberList=[]
+							// for (var q = 0; q < _data.shippingInformationList.length; q++) {
+							// 	console.log(_data.shippingInformationList[q].carNo.split(','))
+							// 	_data.shippingInformationList[q].carList = _data.shippingInformationList[q].carNo.split(',')
+							// }
+							// let __obj = {
+							// 	warehouseName: _data.warehouseName,
+							// 	id: _data.id,
+							// 	shipperName: _data.shipperName,
+							// 	shippingInformationList: _data.shippingInformationList,
+							// 	validityDate: _data.validityDate,
+							// 	createDate:_data.createDate
+							
+							// }
+							// curPageData.push(__obj)
 							if (type == 'down') {
 								this.mescroll.endSuccess();
 								this.dataList = []
 							} else {
-								this.mescroll.endBySize(curPageData.length, curPageData.length); //必传参数(当前页的数据个数, 总数据量)
+								this.mescroll.endBySize(newList.length, newList.length); //必传参数(当前页的数据个数, 总数据量)
 							}
-							console.log(curPageData)
-							this.dataList = this.dataList.concat(curPageData);
+							console.log(newList)
+							this.dataList = this.dataList.concat(newList);
 						}
 					})
 			},

+ 3 - 0
pages/user/depotAcquisition/grainDeliveryRegistration.vue

@@ -121,6 +121,7 @@
 					warehouseName: "",
 					validityDate: '',
 					commonId: uni.getStorageSync("userInfo").id,
+					compId:'',
 					shippingInformationList: [{
 						identityId: '',
 						shipperName: '',
@@ -143,6 +144,7 @@
 		onLoad(options) {
 			this.warehouseId = options.warehouseId
 			this.dataList.warehouseName = options.warehouseName
+			this.dataList.compId=options.compId
 			this.startDate = this.getTime()[0]
 			this.dataList.validityDate = this.getTime()[1]
 			this.warehouseNameAddress = options.warehousePrivate + options.warehouseCity + options
@@ -292,6 +294,7 @@
 				if (_isCanSubmit) {
 					// 处理车牌号数据
 					for (let i = 0; i < this.dataList.shippingInformationList.length; i++) {
+						this.dataList.shippingInformationList[i].compId= this.dataList.compId
 						let _data = this.dataList.shippingInformationList[i]
 						let _index = 0
 						for (let k = 0; k < _data.carNumberList.length; k++) {

+ 49 - 14
pages/user/depotAcquisition/grainDeliveryRegistration1.vue

@@ -3,14 +3,26 @@
 
 		<view class="content2">
 			<view v-if='!status'>
-				<view class="wrap wrap1"  >
+				<view v-for='(item,index1) in dataList.shippingInformationList' class="wrap wrap1"  >
 					<view class="row1 row">
 						<!-- -{{item.customerName}} -->
-						<view class="customerName">货主</view>
-						<image src="../../../static/img/sign/shanchu@2x.png" @click="reduceBtn(index)"></image>
+						<view class="customerName">交易信息</view>
 					</view>
-
-					<view class="row4 row" v-for="(item1,index1) in dataList.carNumberList" :key='index1'>
+					<view class="row4 row">
+						<view class="left">
+							货主
+						</view>
+						<view class="right" >
+							<input  style='text-align:right;' class="car-uumber" v-model='item.shipperName'
+								 placeholder="输入货主姓名"
+								name="input"></input>
+						<!-- 	<view>{{item.shipperName}}</view>
+							<u-picker @confirm="nameConfirm" range-key='customerName' mode="selector"
+									v-model="item.showCustomerName" :range="nameList"></u-picker>
+							<u-icon name="arrow-right"></u-icon> -->
+						</view>
+					</view>
+					<view class="row4 row" v-for="(item1,index1) in item.carNumberList" :key='index1'>
 						<view class="left">
 							车牌号-{{index1+1}}
 						</view>
@@ -20,12 +32,12 @@
 								name="input"></input>
 							<!-- <u-input v-model="item1.carNo" placeholder="输入7位车牌号" /> -->
 							<view class="btn">
-								<view @click="addCarNumber()" style="margin-right: 20rpx;">
+								<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(index1)">
+								<view @click="delCarNumber(item.carNumberList,index1)">
 									<image class='row4-img'
 										src="https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/jian%402x.png">
 									</image>
@@ -76,9 +88,20 @@
 				goodsName: '',
 				status: false,
 				dataList: {
-					carNumberList: [{
-					carNo: ''
+					warehouseName: "",
+					commonId:uni.getStorageSync("userInfo").id,
+					compId:'',
+					shippingInformationList:[{
+						identityId:'',
+						shipperName:'',
+						supplier:'',
+						carNo:'',
+						compId:uni.getStorageSync('pcUserInfo').compId,
+						carNumberList: [{
+						carNo: ''
+						}]
 					}]
+					
 				},
 				goodsnameList: [],
 				selectObj: {},
@@ -91,6 +114,7 @@
 		onLoad(options) {
 			this.warehouseId = options.warehouseId
 			this.dataList.warehouseName = options.warehouseName
+			this.dataList.compId=options.compId
 			this.startDate = this.getTime()[0]
 			this.dataList.validityDate = this.getTime()[1]
 			this.warehouseNameAddress = options.warehousePrivate + options.warehouseCity + options
@@ -112,10 +136,16 @@
 					if (res.data.data == "INVALID") {
 						this.isShowAlert = true;
 					}
-					this.getCustomer()
+					// this.getCustomer()
 				})
 			})
 		},
+		onNavigationBarButtonTap(e){
+			console.log(111111)
+			uni.navigateTo({
+				url:'/pages/user/depotAcquisition/grainDeliveryRecord1'
+			})
+		},
 		methods: {
 			keyClose(){
 				this.keyShow = false
@@ -240,8 +270,10 @@
 				if (_isCanSubmit) {
 					// 处理车牌号数据
 					for (let i = 0; i < this.dataList.shippingInformationList.length; i++) {
+						this.dataList.shippingInformationList[i].compId= this.dataList.compId
 						let _data = this.dataList.shippingInformationList[i]
 						let _index = 0
+						_data.carNo=''
 						for (let k = 0; k < _data.carNumberList.length; k++) {
 							_index++
 							if (_data.carNumberList.length < 1) {
@@ -261,6 +293,7 @@
 						delete _data.index
 						delete _data.showCustomerName
 					}
+					console.log(_dataList)
 					this.$api.doRequest('post', '/grainDeliveryRegistration/api/insertInfo', _dataList).then(res => {
 						if (res.data.code == 200) {
 							this.$api.msg('添加成功!')
@@ -316,11 +349,13 @@
 
 			},
 			addCarNumber(val) {
-				this.dataList.carNumberList.push({carNo: ''})
+				val.push({
+					carNo: ''
+				})
 			},
-			delCarNumber( index) {
-				if (this.dataList.carNumberList.length > 1) {
-					this.dataList.carNumberList.splice(index, 1)
+			delCarNumber(val, index) {
+				if (val.length > 1) {
+					val.splice(index, 1)
 					this.$forceUpdate()
 				} else {
 					this.$api.msg('至少保留一个车牌号!')

+ 1 - 0
store/index.js

@@ -125,6 +125,7 @@ const store = new Vuex.Store({
 		logout(state) {
 			state.hasLogin = false;
 			state.userInfo = {};
+			uni.removeStorageSync("depotAcquisition_warehouseName")
 			uni.removeStorageSync('userInfo')
 			uni.removeStorageSync('pcUserInfo')
 		},