gjy 3 éve
szülő
commit
e6319e5a01
2 módosított fájl, 100 hozzáadás és 69 törlés
  1. 84 32
      pageB/contract/contract_detail.vue
  2. 16 37
      pageB/contract/look.vue

+ 84 - 32
pageB/contract/contract_detail.vue

@@ -11,7 +11,7 @@
 			</view>
 			<view class="cu-form-group">
 				<view class="title">司机手机号</view>
-				<input placeholder="请输入司机身份认证的手机号" name="input" v-model="goods.driverPhone"></input>
+				<input  maxlength='11' placeholder="请输入司机身份认证的手机号" name="input" v-model="goods.driverPhone"></input>
 			</view>
 			<view class="cu-form-group">
 				<view class="title">毛重(吨)</view>
@@ -27,11 +27,8 @@
 			</view>
 			<view class="cu-form-group">
 				<view class="title">发货日期</view>
-				<picker mode="date"  :start="startDate" :end="endDate" :value="goods.sendDateStart"  @change="DateChange">
-					<view class="picker">
-						{{goods.sendDateStart}}
-					</view>
-				</picker>
+				<view @click="show = true">{{goods.sendDateStart!=''?goods.sendDateStart:time}}</view>
+				<u-picker  :params='params' :default-time='time' @confirm="DateChange" v-model="show" mode="time"></u-picker>
 			</view>
 			<view class="cu-bar bg-white margin-top">
 				<view class="action">
@@ -76,9 +73,14 @@
 						loadPoundImg:'',
 						 contractNo:'',
 						 goodsName:'',
-						 sendDateStart:'请选择'
+						 sendDateStart:''
 						
 					},
+					params:{
+						year: true,
+						month: true,
+						day: true,
+					},
 					carNo:'',
 					PageCur: "trust",
 					TabCur: 0,
@@ -92,6 +94,7 @@
 					exsitCount:0,
 					origin:'',
 					stock:'',
+					show:false,
 					goodsName:'',
 					verifyCode:'',
 					sendText0:'获取验证码',
@@ -121,11 +124,22 @@
 					driverNoImg1:'',
 					carNoImg:'',
 					carNoImg1:'',
+					goodsName:'',
 					showTran:true
 				};
 			},
 			computed: {
 				...mapState(['hasLogin','userInfo']),
+					time() {
+						var date=new Date()
+						var year=date.getFullYear()
+						var month=date.getMonth()
+						var date1=date.getDate()
+						if(month+1<10){
+							month="0"+(month+1)
+						}
+						return year+'-'+month+"-"+date1
+					},
 					startDate() {
 					//限制开始时间;
 					//也可以直接限定为当天日期 var date= new Date(); return date
@@ -138,6 +152,8 @@
 			onShow() {
 			},
 			onLoad(option) {
+				this.goodsName=option.goodsName
+				this.contractNo = option.contractNo
 				this.goods.goodsName=option.goodsName
 				this.goods.contractNo = option.contractNo
 				this.goods.tranCarNo=option.tranCarNo
@@ -145,7 +161,8 @@
 			},
 			methods: {
 				 DateChange(e) {
-				 	this.goods.sendDateStart = e.detail.value
+					 this.goods.sendDateStart=e.year+'-'+e.month+'-'+e.day
+				 	// this.goods.sendDateStart = e.detail.value
 				 },
 				commit1(item){
 					uni.navigateTo({				
@@ -199,30 +216,65 @@
 						this.$api.msg('皮重输入错误')
 						return
 					}
-				this.$api.doRequest('post','/tranCarInfo/api/addTranTask',this.goods).then(res => {
-				    if(res.data.code==200){
-						uni.showToast({
-						 title: '添加发车信息成功',
-						 icon:'none',
-						 duration: 2000
-						})
-						uni.navigateBack();
-					}else if(res.data.code==11015){
-						uni.showToast({
-						 title: '该司机未认证身份,请司机认证后再操作',
-						 icon:'none',
-						 duration: 2000
-						})
-					}
-				    })
-				    .catch(res => {
-				     uni.showToast({
-				      title: res.errmsg,
-				      icon:'none',
-				      duration: 2000
-				     })
-				    });
-				   },
+					var that=this
+					uni.showModal({
+						content: '确定提交发车信息?',
+						success: function (res) {
+							if (res.confirm) {
+								that.$api.doRequest('post','/tranCarInfo/api/addTranTask',that.goods).then(res => {
+								    if(res.data.code==200){
+										console.log(that.goods)
+										uni.showModal({
+											content: '提交成功!',
+											success: function (res) {
+												if (res.confirm) {
+													var result = that.goods.tranCarNo.substr(that.goods.tranCarNo.indexOf("C") + 1,that.goods.tranCarNo.length);
+												    var num=Number(result)+1
+													if(num<=9){
+														num='C00'+num
+													}else if(num<100&&num>9){
+														num='C0'+num
+													}else  if(num<1000&&num>99){
+														num='C'+num
+													}
+													that.goods={
+														tranCarNo:num,
+														carNo:'',
+														grossWeight:'',
+														tare:'',
+														loadNetWeight:'',
+														loadPoundImg:'',
+														 contractNo:that.contractNo,
+														 goodsName:that.goodsName,
+														 sendDateStart:''
+														
+													}
+												}else if (res.cancel) {
+													uni.navigateBack();
+												}
+											}
+										});
+									}else if(res.data.code==11015){
+										uni.showToast({
+										 title: '该司机未认证身份,请司机认证后再操作',
+										 icon:'none',
+										 duration: 2000
+										})
+									}
+								    })
+								    .catch(res => {
+								     uni.showToast({
+								      title: res.errmsg,
+								      icon:'none',
+								      duration: 2000
+								     })
+								    });
+							} else if (res.cancel) {
+							
+							}
+						}
+					});
+				},
 				ChooseImagePerson() {
 					uni.chooseImage({
 						count: 1, //默认9

+ 16 - 37
pageB/contract/look.vue

@@ -21,7 +21,7 @@
 				<view class="c-row b-b">
 					<text class="tit">累计收发:</text>
 					<view class="con-list">
-						<text>发收</text>
+						<text>{{sendout}}&nbsp&nbsp{{collect}}收</text>
 						<!-- <text>{{goods.level}}收</text> -->
 					</view>
 				</view>
@@ -68,41 +68,6 @@
 				</view>
 			</view>
 			<view class="c-list">
-<<<<<<< HEAD
-=======
-				<view  class="c-row b-b">
-					<view class="con-list">
-						<text>{{goods.carNo}}</text>
-						<text>{{goods.sendDateStart}}发</text>
-					</view>
-				</view>
-				<view   class="c-row b-b">
-					<text class="tit">结算价(元/吨)</text>
-					<view class="con-list">
-						<text>{{goods.settlementPrice}}</text>
-					</view>
-				</view>
-				
-				<view  class="c-row b-b">
-					<text class="tit">净重(吨)</text>
-					<view class="con-list">
-						<text>{{goods.netWeight}}发&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp{{goods.packing}}收</text>
-					</view>
-				</view>
-				<view class="c-row b-b">
-					<text class="tit">扣款(元/吨)</text>
-					<view class="con-list">
-						<text>{{goods.minSale}}</text>
-					</view>
-				</view>
-				<view class="c-row b-b">
-					
-					<!-- <view class="con-list"> -->
-					<text><button class="cu-btn commit margin-tb-sm lg" style="background-color:  #4CD964; width: 210rpx;height: 30px;"  @click="commit">发货磅单</button></text>
-					
-					<!-- </view> -->
-				</view>
->>>>>>> 3b8362d62bd4fd79152708e10a20cdac52f16392
 				<view class="padding flex flex-direction">
 					<button class="cu-btn commit margin-tb-sm lg" style="background-color: #4CD964; " @click="commit1(goods)">添加发车信息</button>
 				</view>
@@ -172,7 +137,21 @@
 		
 		},
 		computed: {
-			...mapState(['hasLogin','userInfo'])
+			...mapState(['hasLogin','userInfo']),
+			sendout(){
+				var num=0
+				for(var i=0;i<this.carlist.length;i++){
+					num+=this.carlist[i].loadNetWeight
+				}
+				return num
+			},
+			collect(){
+				var num=0
+				for(var i=0;i<this.carlist.length;i++){
+					num+=this.carlist[i].unloadNetWeight
+				}
+				return num
+			}
 		},
 		methods: {
 			unload(item){