gjy 1 éve
szülő
commit
5b45b77917
1 módosított fájl, 91 hozzáadás és 27 törlés
  1. 91 27
      pages/task/audit/sales_shift.vue

+ 91 - 27
pages/task/audit/sales_shift.vue

@@ -30,7 +30,7 @@
 				<u-form-item :border-bottom='false' label="原合同提示" prop="pointOut" label-width="140">
 					<u-input v-model="list.pointOut" input-align="right" placeholder="空" disabled />
 				</u-form-item>
-				<u-form-item :border-bottom='false' label="原出库任务" prop="processNo" label-width="140">
+				<u-form-item class='taskNo' :border-bottom='false' label="原出库任务" prop="processNo" label-width="140">
 					<view style='text-align:right;width: 100%;color:#000;min-height: 70rpx;line-height: 70rpx;' v-for='item in list.taskNoList'> {{item}}</view>
 				</u-form-item>
 				<u-form-item :border-bottom='false' label="新合同/移库编号" prop="goodsName" label-width="220">
@@ -47,19 +47,19 @@
 					<view v-else style='text-align:right;width: 100%;color:#000;min-height: 70rpx;line-height: 70rpx;'> 他运无运输任务</view>
 				</u-form-item>
 			</u-form>
-			<view style='margin-left:20rpx;font-weight:600;'>车辆信息</view>
-			<view v-for='item in list.tranCarInfoList'>
-				<view style='justify-content: space-between;margin:10rpx 20rpx;' class='flex'>
+			<view v-if='list.tranCarInfoList' style='margin-left:20rpx;font-weight:600;'>车辆信息</view>
+			<view v-for='(item,index) in list.tranCarInfoList'>
+				<view style='justify-content: space-between;margin:10rpx 20rpx;align-items: center;' class='flex'>
 					<view>{{item.carNo}} <text v-if='item.tranCarNo'>({{item.tranCarNo}})</text> </view>
 					<view class="">{{item.tranTaskOld?item.tranTaskOld:'他运无运输任务'}}</view>
 				</view>
-				<view style='justify-content: space-between;margin:10rpx 20rpx;' class='flex '>
+				<view style='align-items: center;justify-content: space-between;margin:10rpx 20rpx;' class='flex '>
 					<view v-if='item.tranTaskOld'>原运费{{item.tranPriceOld}}元/吨</view>
 					<view v-else>&nbsp;</view>
 					<view style='align-items: center;' class='flex ' v-if='list.tranTaskNew'>
 						新运费
-						<u-input style='border-bottom:1px solid #ccc;width:200rpx;margin:0 4rpx;padding-right:10rpx;' v-model="item.tranPrice" input-align="right" placeholder="" :disabled='!editstatus' />
-						元/吨
+						<u-input :style='!editstatus?"":"border-bottom:1px solid #ccc;"' style='width:200rpx;margin:0 4rpx;padding-right:10rpx;' v-model="item.tranPrice" input-align="right" placeholder="" :disabled='!editstatus' />
+						<text>{{item.billingMethod==1?'元/吨':'元/车'}}</text> <u-icon @click='downchange(index)' name="arrow-down-fill" color="#000" size="28"></u-icon>
 					</view>
 				</view>
 			</view>
@@ -158,6 +158,15 @@
 				<view @click='passSubmit()' class="confirm">确定</view>
 			</view>
 		</view>
+		<u-popup mode='center' :border-radius='10' :closeable='true' :width='"400"' :height='"200"' v-model="show1">
+			<view style='margin:50rpx 0 0 20rpx;'>
+				<u-radio-group @change='radiochange' v-model="value">
+					<u-radio name='1' shape="circle">元/吨</u-radio>
+					<u-radio name='2' shape="circle">元/车</u-radio>
+				</u-radio-group>
+			</view>
+			
+		</u-popup>
 		<view v-if='list.taskId' style='padding:10px;z-index: 12;' class='flex bottom-btn'>
 			<u-button v-if='list.approveStatus||isSHowBtn' @click='reject' type="error" class="btn1" hover-class='none'>
 				驳回
@@ -189,6 +198,9 @@
 				editstatus:false,
 				rejectInfo: "", //审核意见
 				title: '',
+				value:'1',
+				show1:false,
+				index:0,
 				auditMind: '',
 				auditList:[],
 				fileUrl:[],
@@ -214,6 +226,17 @@
 			...mapState(['hasLogin', 'userInfo']),
 		},
 		methods: {
+			downchange(index){
+				if(this.editstatus){
+					this.index=index
+					this.value=this.list.tranCarInfoList[this.index].billingMethod
+					this.show1=true
+				}
+			},
+			radiochange(e){
+				this.list.tranCarInfoList[this.index].billingMethod=e
+				console.log(e)
+			},
 			getImgUrl(res) {
 				this.fileUrl.push(res.data.appendixPath)
 			},
@@ -267,7 +290,6 @@
 						mask: true
 					});
 				if(this.editstatus){
-					
 					await that.$api.doRequest('post', '/salesTransferInfo/api/editInfo', {
 						id:this.list.id,
 						tranCarInfoList:this.list.tranCarInfoList
@@ -301,32 +323,44 @@
 				}
 			},
 			pass() {
-				console.log(11111111)
-				for (var i = 0; i < this.list.tranCarInfoList.length; i++) {
-					if(this.list.tranCarInfoList[i].tranPrice<0){
-						this.$api.msg('运费输入错误')
-						return
-					}
-					if(this.list.tranCarInfoList[i].tranPrice.indexOf('.')!=-1&&this.list.tranCarInfoList[i].tranPrice.split('.')[1].length>2){
-						this.$api.msg('运费输入错误')
-						return
+				if(this.list.tranCarInfoList){
+					for (var i = 0; i < this.list.tranCarInfoList.length; i++) {
+						if(!this.list.tranCarInfoList[i].tranPrice){
+							this.$api.msg('运费不能为空')
+							return
+						}
+						if(this.list.tranCarInfoList[i].tranPrice<0){
+							this.$api.msg('运费输入错误')
+							return
+						}
+						if(this.list.tranCarInfoList[i].tranPrice.indexOf('.')!=-1&&this.list.tranCarInfoList[i].tranPrice.split('.')[1].length>2){
+							this.$api.msg('运费输入错误')
+							return
+						}
 					}
 				}
-				console.log(22222222)
+				
 				this.show = true
 				this.title = '审核意见(通过)'
 			},
 			reject() {
-				for (var i = 0; i < this.list.tranCarInfoList.length; i++) {
-					if(this.list.tranCarInfoList[i].tranPrice<0){
-						this.$api.msg('运费输入错误')
-						return
-					}
-					if(this.list.tranCarInfoList[i].tranPrice.indexOf('.')!=-1&&this.list.tranCarInfoList[i].tranPrice.split('.')[1].length>2){
-						this.$api.msg('运费输入错误')
-						return
+				if(this.list.tranCarInfoList){
+					for (var i = 0; i < this.list.tranCarInfoList.length; i++) {
+						if(!this.list.tranCarInfoList[i].tranPrice){
+							this.$api.msg('运费不能为空')
+							return
+						}
+						if(this.list.tranCarInfoList[i].tranPrice<0){
+							this.$api.msg('运费输入错误')
+							return
+						}
+						if(this.list.tranCarInfoList[i].tranPrice.indexOf('.')!=-1&&this.list.tranCarInfoList[i].tranPrice.split('.')[1].length>2){
+							this.$api.msg('运费输入错误')
+							return
+						}
 					}
 				}
+				
 				this.show = true
 				this.title = '驳回原因(驳回)'
 			},
@@ -476,8 +510,13 @@
 						})
 					})
 					for (var i = 0; i < this.list.tranCarInfoList.length; i++) {
+						if(!this.list.tranCarInfoList[i].billingMethod){
+							this.list.tranCarInfoList[i].billingMethod=1
+						}
 						if(this.editstatus){
 							this.list.tranCarInfoList[i].tranPrice=this.list.tranCarInfoList[i].tranPriceOld
+						}else{
+							this.list.tranCarInfoList[i].tranPrice=	Number(this.list.tranCarInfoList[i].tranPrice).toFixed(2)
 						}
 					}
 				})
@@ -719,7 +758,7 @@
 		}
 	}
 	.warp{
-		padding-bottom:130rpx;
+		padding-bottom:252rpx;
 	}
 	.shade {
 		position: fixed;
@@ -832,4 +871,29 @@
 	/deep/.u-input__textarea {
 		height: 300rpx !important;
 	}
+	/deep/.taskNo .u-form-item--right__content__slot {
+		flex-direction: column;
+	}
+	.bottom-btn {
+		width: 100%;
+		position: fixed;
+		bottom: 0;
+		display: flex;
+		z-index: 2;
+		left: 0;
+		background-color: #f8f8f8;
+		flex-direction: column;
+	
+		.btn1,
+		.btn2 {
+			width: 100%;
+			margin-bottom: 26rpx;
+			border-radius: 90rpx;
+		}
+	
+		.btn1 {
+			background: white;
+			color: #00C265;
+		}
+	}
 </style>