فهرست منبع

隐藏单趟提成

lichao 3 سال پیش
والد
کامیت
7d9526917c
1فایلهای تغییر یافته به همراه67 افزوده شده و 24 حذف شده
  1. 67 24
      pages/home/myorder/operation/index.vue

+ 67 - 24
pages/home/myorder/operation/index.vue

@@ -104,9 +104,9 @@
 				<u-form-item :border-bottom="false" label-width="155rpx" label="油气费:">
 					<u-input type="digit" :height="35" :clearable="false" v-model="form.oilAmt"/>
 				</u-form-item>
-				<u-form-item :border-bottom="false" label-width="155rpx" label="单趟提成:">
+				<!-- <u-form-item :border-bottom="false" label-width="155rpx" label="单趟提成:">
 					<u-input type="digit" :height="35" :clearable="false" v-model="form.driverbonus" />
-				</u-form-item>
+				</u-form-item> -->
 				<u-form-item :border-bottom="false" label-width="155rpx" label="其他费用:">
 					<u-input type="digit" :height="35" :clearable="false" v-model="form.costOth" />
 				</u-form-item>
@@ -143,7 +143,7 @@
 				</u-form-item>
 			</view>
 		</view>
-		<view class="ordertop" style="margin-bottom: 120rpx;">
+		<view class="ordertop" style="margin-bottom: 120rpx;" v-if="operationType !== 'acceptDate'">
 			<view>
 				<view class="iconblue"></view>
 				<text class="license">附件上传</text>
@@ -201,7 +201,7 @@
 					unLoadAddrL: '', //卸车地点
 					unLadDate: '', //卸车时间
 					unLoadAttnTel: '' //卸车联系
-				}
+				},
 			}
 		},
 		onLoad: function(option) { //option为object类型,会序列化上个页面传递的参数
@@ -272,6 +272,9 @@
 				let dateYear = date.getFullYear(); //获取年 
 				let dateMonth = date.getMonth(); //获取月  
 				let dateDate = date.getDate(); //获取当日
+				if (dateDate < 10) {
+					dateDate = "0" + dateDate
+				}
 				uni.setNavigationBarTitle({
 					title: this.title
 				})
@@ -335,15 +338,17 @@
 			submit() {
 				// console.log(this.$refs.uUpload.lists)
 				let lists = []
-				for (let item in this.$refs.uUpload.lists) {
-					lists.push({
-						attachUrl: this.$refs.uUpload.lists[item].response.url,
-						thumbnailUrl: this.$refs.uUpload.lists[item].response.thumbnailUrl,
-						attachName: this.$refs.uUpload.lists[item].response.fileName
-					})
+				if(this.operationType !== 'acceptDate'){
+					for (let item in this.$refs.uUpload.lists) {
+						lists.push({
+							attachUrl: this.$refs.uUpload.lists[item].response.url,
+							thumbnailUrl: this.$refs.uUpload.lists[item].response.thumbnailUrl,
+							attachName: this.$refs.uUpload.lists[item].response.fileName
+						})
+					}
 				}
 				console.log(lists)
-				if (lists.length == this.$refs.uUpload.lists.length) {
+				if(this.operationType == 'acceptDate'){
 					request({
 						url: '/fleet/ftmsorderbillscars/wechatInsertDriver',
 						method: 'post',
@@ -355,19 +360,19 @@
 						}
 					}).then(res => {
 						console.log(res)
-						if (res.data.code == 500) {
-							if(res.data.msg == 'parseDecimal error, field : oilAmt'){
-								uni.showToast({
-									icon: 'none',
-									title: '数字不正确,请检查后再提交',
-									position: "bottom"
-								})
-							}else{
-								uni.showToast({
-									icon: 'none',
-									title: res.data.msg,
-									position: "bottom"
-								})
+						if (res.data.code == 500) {
+							if(res.data.msg == 'parseDecimal error, field : oilAmt'){
+								uni.showToast({
+									icon: 'none',
+									title: '数字不正确,请检查后再提交',
+									position: "bottom"
+								})
+							}else{
+								uni.showToast({
+									icon: 'none',
+									title: res.data.msg,
+									position: "bottom"
+								})
 							}
 						} else if (res.data.code == 200) {
 							uni.navigateBack();
@@ -379,6 +384,44 @@
 							position: "bottom"
 						})
 					})
+				}else{
+					if (lists.length == this.$refs.uUpload.lists.length) {
+						request({
+							url: '/fleet/ftmsorderbillscars/wechatInsertDriver',
+							method: 'post',
+							data: {
+								cars: JSON.stringify(this.form),
+								attachs: JSON.stringify(lists),
+								fees: "[]",
+								operationType: this.operationType
+							}
+						}).then(res => {
+							console.log(res)
+							if (res.data.code == 500) {
+								if(res.data.msg == 'parseDecimal error, field : oilAmt'){
+									uni.showToast({
+										icon: 'none',
+										title: '数字不正确,请检查后再提交',
+										position: "bottom"
+									})
+								}else{
+									uni.showToast({
+										icon: 'none',
+										title: res.data.msg,
+										position: "bottom"
+									})
+								}
+							} else if (res.data.code == 200) {
+								uni.navigateBack();
+							}
+						}).catch(err => {
+							uni.showToast({
+								icon: 'none',
+								title: '网络繁忙请稍后再试',
+								position: "bottom"
+							})
+						})
+					}
 				}
 			}
 		}