gjy 3 年之前
父節點
當前提交
a9f21869ff

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

@@ -154,7 +154,7 @@
 					id: val.id,
 					commonId: uni.getStorageSync("userInfo").id,
 					loginPhone:uni.getStorageSync("userInfo").phone,
-					warehouseName:val.warehouseName
+					warehouseName:val.warehouseName,
 				}).then(res => {
 					if (res.data.code == "200") {
 						if (val.follow == '未关注') {

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

@@ -14,53 +14,64 @@
 					<view class="position">{{warehouseNameAddress}}</view>
 				</view>
 			</view>
+			<view style='justify-content: space-between;' class="flex">
+				<view class="left">货名</view>
+				<view class="flex" @click='showgoodsName'>
+					<view>{{goodsName}}</view>
+					<u-picker @confirm="goodsnameConfirm" range-key='goodsName' mode="selector"
+						v-model="goodsNameshow" :range="goodsnameList"></u-picker>
+					<u-icon name="arrow-right"></u-icon>
+				</view>
+			</view>
 		</view>
 		<view class="content2">
-			<view class="wrap wrap1" v-for="(item,index) in dataList.shippingInformationList" :key='index'>
-				<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"
-							v-model="item.showCustomerName" :range="nameList"></u-picker>
-						<u-icon name="arrow-right"></u-icon>
+			<view v-if='!status'>
+				<view  class="wrap wrap1" v-for="(item,index) in dataList.shippingInformationList" :key='index'>
+					<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>
-				<view class="row3 row">
-					<view class="left">
-						供应商(送粮人)
+					<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"
+								v-model="item.showCustomerName" :range="nameList"></u-picker>
+							<u-icon name="arrow-right"></u-icon>
+						</view>
 					</view>
-					<view class="right">{{item.supplier}}</view>
-				</view>
-				<view class="row4 row" v-for="(item1,index1) in item.carNumberList" :key='index1'>
-					<view class="left">
-						车牌号-{{index1+1}}
+					<view class="row3 row">
+						<view class="left">
+							供应商(送粮人)
+						</view>
+						<view class="right">{{item.supplier}}</view>
 					</view>
-					<view class="right">
-						<input v-model='item1.carNo' @click.stop="handleShowKeyboard(index,index1)":disabled="true" placeholder="输入7位车牌号" name="input"></input>
-						
-						<!-- <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 class="row4 row" v-for="(item1,index1) in item.carNumberList" :key='index1'>
+						<view class="left">
+							车牌号-{{index1+1}}
+						</view>
+						<view class="right">
+							<input v-model='item1.carNo' @click.stop="handleShowKeyboard(index,index1)":disabled="true" placeholder="输入7位车牌号" name="input"></input>
+							
+							<!-- <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 class='add-good-people' @click='addGoodPeople'>
+			<view  v-if='!status' 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>增加货主
@@ -103,6 +114,8 @@
 				carNo:'',
 				warehouseNameAddress: '',
 				startDate: "",
+				goodsName:'',
+				status:false,
 				dataList: {
 					warehouseName: "",
 					validityDate: '',
@@ -118,13 +131,17 @@
 						}]
 					}]
 				},
+				goodsnameList:[],
 				selectObj: {},
+				goodsNameshow:false,
 				nameListCopy: []
 			}
 		},
 
 		onLoad(options) {
+			
 			let _pageToData = JSON.parse(options.itemValue)
+			this.warehouseId=_pageToData.warehouseId
 			this.dataList.warehouseName = _pageToData.warehouseName
 			this.startDate = this.getTime()[0]
 			this.dataList.validityDate = this.getTime()[1]
@@ -142,9 +159,24 @@
 				}
 				this.getCustomer()
 			})
+			this.$api.doRequest('get', '/qualityInspectionManagement/api/goodsName', {
+				warehouseId: this.warehouseId
+			}).then(res => {
+				if (res.data.code == 200) {
+					this.goodsName=res.data.data[0].goodsName
+					this.goodsnameList = res.data.data
+				}
+			})
 			console.log("hasLogin", this.hasLogin)
 		},
 		methods: {
+			goodsnameConfirm(e){
+				this.goodsName=this.goodsnameList[e[0]].goodsName
+				this.getCustomer()
+			},
+			showgoodsName(){
+				this.goodsNameshow=true
+			},
 			hidden(){
 				this.carNo=''
 				if(this.$refs.keyboard.open){
@@ -182,62 +214,27 @@
 				this.selectObj = value
 				this.selectObj.index = index
 				value.showCustomerName = true
-				that.$api.doRequest('get', '/paymentManagement/cumulant', {
-					compId: JSON.parse(localStorage.getItem('pcUserInfo')).data.compId,
-					customerNumberCard: that.detailData.customerNumberCard,
-					goodsName: that.detailData.goodsName,
-				}).then(res => {
-					if (res.data.code == 200) {
-						for (let i = 0; i < that.purchasePriceList.length; i++) {
-							if (
-								that.detailData.goodsName == that.purchasePriceList[i]
-								.goodsName
-							) {
-								let count = (that.purchasePriceList[i].saleLimit -
-									res.data.data / 1000).toFixed(2)
-								if (Number(count) - that.detailData.grossWeight / 1000 <= 0) {
-									that.$api.msg('该客户累计销售' + that.detailData.goodsName + (
-											res.data.data / 1000).toFixed(2) +
-										'吨,还可售粮' +
-										count + '吨', )
-				
-								} else {
-									that.$api.doRequest('post',
-										'/weighingManagement/api/editGrossWeight', that
-										.detailData).then(res => {
-										if (res.data.code == 200) {
-											that.$refs.uToast.show({
-												title: '提交成功',
-												type: 'success'
-											})
-											uni.navigateBack({})
-										} else {
-											that.$refs.uToast.show({
-												title: '提交失败',
-												type: 'error',
-											})
-										}
-									})
-				
-								}
-							}
-						}
-					}
-				})
 			},
 			getCustomer() {
+				var that=this
 				let _data = {
 					commonId: uni.getStorageSync("userInfo").id,
+					warehouseId:this.warehouseId,
+					goodsName:this.goodsName
 				}
 				this.$api.doRequest('get', '/identityAuthenticationInfo/identityAuthenticationInfoUser', _data).then(
 					res => {
 						if (res.data.code == 200) {
 							this.nameList = res.data.data
 							if(res.data.data.length>0){
+							that.status=false
 								this.dataList.shippingInformationList[0].identityId = res.data.data[0].id
 								this.dataList.shippingInformationList[0].shipperName = res.data.data[0].customerName
 								this.dataList.shippingInformationList[0].supplier = res.data.data[0].supplier ? res.data
 									.data[0].supplier : '无'
+							}else{
+								that.status=true
+								this.$api.msg('当前客户的'+this.goodsName+'送粮量达到上限')
 							}
 						}
 					})
@@ -342,6 +339,10 @@
 				this.isShowAlert1 = false
 			},
 			addGoodPeople() {
+				if(this.status==true){
+					this.$api.msg('当前客户的'+this.goodsName+'送粮量达到上限')
+					return
+				}
 				// 判断是否还有剩余的货主
 				if (this.nameList.length != this.dataList.shippingInformationList.length) {
 					this.dataList.shippingInformationList.push({
@@ -353,6 +354,7 @@
 							carNo: ''
 						}]
 					})
+					this.$forceUpdate()
 				} else {
 					this.$api.msg('无更多认证货主!')
 				}