Browse Source

途宝报单新需求

wangzhuo 1 year ago
parent
commit
d97ec782e0
3 changed files with 182 additions and 97 deletions
  1. 5 2
      pages/listview.vue
  2. 151 93
      pages/particulars/claimExpense/index.vue
  3. 26 2
      pages/particulars/index.vue

+ 5 - 2
pages/listview.vue

@@ -16,7 +16,7 @@
 		</view>
 		<!-- tab -->
 		<view style="background-color: #3c9cff;">
-			<u-tabs :list="tabs" lineColor="#fff" lineWidth="60" @change="change" :activeStyle="{
+			<u-tabs :list="tabs" lineColor="#fff" lineWidth="60" @change="change" :current="tabIndex" :activeStyle="{
 					width: '140rpx',
 					height: '60rpx',
 					color: '#fff',
@@ -138,6 +138,7 @@ import tab from "../plugins/tab"
 	export default {
 		data() {
 			return {
+				tabName: '未装车',
 				// 查询条件
 				condition: {
 					range: [],
@@ -241,7 +242,7 @@ import tab from "../plugins/tab"
 
 				if (this.condition.type == 'BD') {
 					uni.navigateTo({
-						url: 'particulars/index?orderNo=' + orderNo + '&status=' + status
+						url: 'particulars/index?orderNo=' + orderNo + '&status=' + status + '&tabName=' + this.tabName
 					});
 				} else if (this.condition.type == 'BX') {
 					uni.navigateTo({
@@ -258,6 +259,8 @@ import tab from "../plugins/tab"
 
 			},
 			change(item) {
+				
+				this.tabName = item.name
 				this.condition.flowType = item.name
 				this.getOrderBillsPlansList();
 			},

+ 151 - 93
pages/particulars/claimExpense/index.vue

@@ -2,7 +2,6 @@
 	<view class="content">
 		<u-sticky>
 			<view class="head" style="background-color: #3c9cff; color: #fff;">
-				<!-- <text>订单号: {{formData.orderNo}}</text> -->
 				<view>
 					<text>{{ formData.carRegNo == null ? '' : formData.carRegNo }}</text>
 				</view>
@@ -22,9 +21,6 @@
 			</view>
 		</u-sticky>
 		<view class="striping"></view>
-		<!-- <view class="head" @click="telFun">
-			<text>驾驶员: {{formData.driver1Name == null ? '' : formData.driver1Name}}&nbsp;电话:&nbsp;{{formData.driver1mobile == null ? '' : formData.driver1mobile}}</text>
-		</view> -->
 
 		<u-tabs :list="tabs" @change="change" :activeStyle="{
 				width: '180rpx',
@@ -47,9 +43,12 @@
 			<view class="box-box">
 				<view class="box">
 					<view class="data">
-						<text class="key">ETC金额</text>
+						<!-- <text class="key">ETC金额</text>
+						<input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
+							@input="checkUnLoadetc" v-model="formData.loadetc" /> -->
+						<text class="key">公司加油(升)</text>
 						<input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
-							@input="checkUnLoadetc" v-model="formData.loadetc" />
+							@input="checkUnOilhomeQty" v-model="formData.oilhomeQty" />
 					</view>
 					<view class="data">
 						<text class="key">现金过路费</text>
@@ -58,18 +57,20 @@
 					</view>
 				</view>
 
-				<view class="box">
+			<!-- 	<view class="box">
 					<view class="data">
 						<text class="key">公司加油(升)</text>
 						<input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
 							@input="checkUnOilhomeQty" v-model="formData.oilhomeQty" />
 					</view>
-					<view class="data">
+					<view class="data"> -->
+					
 						<!-- <text class="key">加油金额</text>
 						<input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
 							@input="checkUnOilhomeAmt" v-model="formData.oilhomeAmt" /> -->
-					</view>
-				</view>
+							
+					<!-- </view>
+				</view> -->
 				<view class="box">
 					<view class="data-two">
 						<text class="key">定点加油1</text>
@@ -161,10 +162,23 @@
 					</view>
 					<view class="data">
 						<text class="key">加油金额</text>
-						<input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
+						<input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"	
 							@input="checkUnOilcardAmt" v-model="formData.oilcardAmt" />
 					</view>
 				</view>
+				
+				<view class="box-two">
+					<text class="key">定点尿素</text>
+					<input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
+						@input="checkUnRepairamt" v-model="formData.repairamt" />
+				</view>
+				
+				<view class="box-two">
+					<text class="key">是否加满</text>
+					<view class="u-page__tag-item" v-for="(item, index) in radios" :key="index">
+						<uni-tag :disabled="disabled" size="normal" type="primary" :text="item.name" :inverted="!item.checked" @click="radioClick(index)"></uni-tag>
+					</view>
+				</view>
 
 				<view class="box-two">
 					<text class="key">备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注</text>
@@ -177,12 +191,16 @@
 			<view class="box-box" style="margin-top: 40rpx;">
 				<view style="margin-bottom: 20rpx;">
 					<!-- <text style="color: #3c9cff;">单据拍照存档</text> -->
-					<text style="color: #3c9cff;">单据拍照存档 (请上传图片大小为1MB以下的图片)</text>
+					<text style="color: #3c9cff;">单据拍照存档</text>
 				</view>
 				<u-upload :fileList="fileList1":sizeType="['compressed']"
 					@afterRead="imgUploading" @delete="deletePic" name="1" multiple :disabled="disabled"
 					:previewFullImage="true"></u-upload>
 			</view>
+			<view style="text-align: end; padding-right: 20rpx; font-size: 32rpx;">
+				<text>报销:</text> {{' '}}
+				<text style="color: #ff9f1c;">¥ {{money}} 元</text>
+			</view>
 
 		</view>
 
@@ -350,6 +368,13 @@
 	export default {
 		data() {
 			return {
+				radios: [{
+					name: '加满了',
+					checked: false,
+				}, {
+					name: '没加满',
+					checked: false,
+				}],
 				orderNo: '',
 				// 遮盖罩
 				loading: true,
@@ -421,6 +446,23 @@
 			this.getLoadFeeItemsfun()
 		},
 		methods: {
+			radioClick(index) {
+				for (var i = 0; i < this.radios.length; i++) {
+					if (i == index) {
+						if (index == 0) {
+							this.radios[i].checked = true
+							this.formData.oilfilLed = 'T'
+						} else if (index == 1) {
+							this.radios[i].checked = true
+							this.formData.oilfilLed = 'F'
+						}
+					} else {
+						this.radios[i].checked = false
+					}
+				}
+				
+				console.log(this.formData.oilfilLed);
+			},
 			change(item) {
 				this.isTabs = item.name;
 			},
@@ -467,6 +509,15 @@
 					res.data.oilcardAmt == 0 ? res.data.oilcardAmt = null : res.data.oilcardAmt
 					res.data.detourEmptyMile == 0 ? res.data.detourEmptyMile = null : res.data.detourEmptyMile
 					res.data.detourLoadMile == 0 ? res.data.detourLoadMile = null : res.data.detourLoadMile
+					res.data.repairamt == 0 ? res.data.repairamt = null : res.data.repairamt
+					
+					if (res.data.oilfilLed != null) {
+						if (res.data.oilfilLed == 'F') {
+							this.radios[1].checked = true
+						} else if (res.data.oilfilLed == 'T') {
+							this.radios[0].checked = true
+						}
+					}
 						
 						for (let item of this.itemsList) {
 							if (item == 0) {
@@ -565,6 +616,14 @@
 						iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
 					})
 					return
+				} else if(this.formData.oilfilLed == null || this.formData.oilfilLed == '') {
+					this.$refs.uToast.show({
+						type: 'warning',
+						icon: false,
+						message: "请选择是否加满",
+						iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
+					})
+					return false
 				} else if(this.formData.unLoadQty == null) {
 					this.$refs.uToast.show({
 						type: 'warning',
@@ -731,6 +790,15 @@
 				}
 			},
 			submitVerify() {
+				if (this.formData.oilfilLed == null || this.formData.oilfilLed == '') {
+					this.$refs.uToast.show({
+						type: 'warning',
+						icon: false,
+						message: "请选择是否加满",
+						iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
+					})
+					return false
+				}
 				if (this.formData.gasstation1 != null && this.formData.gasstation1 != '') {
 					if (this.formData.oilappoint1Qty == 0) {
 						this.$refs.uToast.show({
@@ -928,6 +996,9 @@
 					if (this.formData.gasstation3 == null) {
 						this.formData.gasstation3 = 0;
 					}
+					if (this.formData.repairamt == null) {
+						this.formData.repairamt = 0;
+					}
 
 					this.loading = true;
 					// var list = [];
@@ -978,6 +1049,16 @@
 										res.data.oilcardAmt == 0 ? res.data.oilcardAmt = null : res.data.oilcardAmt
 										res.data.detourEmptyMile == 0 ? res.data.detourEmptyMile = null : res.data.detourEmptyMile
 										res.data.detourLoadMile == 0 ? res.data.detourLoadMile = null : res.data.detourLoadMile
+										res.data.repairamt == 0 ? res.data.repairamt = null : res.data.repairamt
+										
+										if (res.data.oilfilLed != null) {
+											if (res.data.oilfilLed == 'F') {
+												this.radios[1].checked = true
+											} else if (res.data.oilfilLed == 'T') {
+												this.radios[0].checked = true
+											}
+										}
+										
 											for (let item of this.itemsList) {
 												if (item == 0) {
 													item.amt = null
@@ -1134,6 +1215,9 @@
 					if (this.formData.gasstation3 == null) {
 						this.formData.gasstation3 = 0;
 					}
+					if (this.formData.repairamt == null) {
+						this.formData.repairamt = 0;
+					}
 					this.loading = true;
 					// var list = [];
 					// for (var item in this.itemsList) {
@@ -1175,6 +1259,16 @@
 											res.data.oilcardAmt == 0 ? res.data.oilcardAmt = null : res.data.oilcardAmt
 											res.data.detourEmptyMile == 0 ? res.data.detourEmptyMile = null : res.data.detourEmptyMile
 											res.data.detourLoadMile == 0 ? res.data.detourLoadMile = null : res.data.detourLoadMile
+											res.data.repairamt == 0 ? res.data.repairamt = null : res.data.repairamt
+										
+											if (res.data.oilfilLed != null) {
+												if (res.data.oilfilLed == 'F') {
+													this.radios[1].checked = true
+												} else if (res.data.oilfilLed == 'T') {
+													this.radios[0].checked = true
+												}
+											}
+										
 												for (let item of this.itemsList) {
 													if (item == 0) {
 														item.amt = null
@@ -1455,37 +1549,37 @@
 			},
 
 			// 计算报销金额
-			// calculatMoney() {
-			// 	let loadetc = this.formData.loadetc == null ? 0 : this.formData.loadetc;
-			// 	let loadtoll = this.formData.loadtoll == null ? 0 : this.formData.loadtoll;
-			// 	let oilhomeAmt = this.formData.oilhomeAmt == null ? 0 : this.formData.oilhomeAmt;
-			// 	let oilappoint1Amt = this.formData.oilappoint1Amt == null ? 0 : this.formData.oilappoint1Amt;
-			// 	let oilappoint2Amt = this.formData.oilappoint2Amt == null ? 0 : this.formData.oilappoint2Amt;
-			// 	let oilappoint3Amt = this.formData.oilappoint3Amt == null ? 0 : this.formData.oilappoint3Amt;
-			// 	let oilcash1Amt = this.formData.oilcash1Amt == null ? 0 : this.formData.oilcash1Amt;
-			// 	let oilcardAmt = this.formData.oilcardAmt == null ? 0 : this.formData.oilcardAmt;
-
-			// 	let itemsMoney = 0;
-
-			// 	for (const key in this.itemsList) {
-			// 		let a = this.itemsList[key].amt == null ? 0 : this.itemsList[key].amt;
-			// 		itemsMoney += Number(a);
-			// 	}
-
-			// 	loadetc = Number(loadetc)
-			// 	loadtoll = Number(loadtoll)
-			// 	oilhomeAmt = Number(oilhomeAmt)
-			// 	oilappoint1Amt = Number(oilappoint1Amt)
-			// 	oilappoint2Amt = Number(oilappoint2Amt)
-			// 	oilappoint3Amt = Number(oilappoint3Amt)
-			// 	oilcash1Amt = Number(oilcash1Amt)
-			// 	oilcardAmt = Number(oilcardAmt)
-			// 	itemsMoney = Number(itemsMoney)
-
-
-			// 	this.money = loadetc + loadtoll + oilhomeAmt + oilappoint1Amt + oilappoint2Amt + oilcash1Amt + oilcardAmt +
-			// 		oilappoint3Amt + itemsMoney;
-			// },
+			calculatMoney() {
+				let loadetc = this.formData.loadetc == null ? 0 : this.formData.loadetc;
+				let loadtoll = this.formData.loadtoll == null ? 0 : this.formData.loadtoll;
+				let oilhomeAmt = this.formData.oilhomeAmt == null ? 0 : this.formData.oilhomeAmt;
+				let oilappoint1Amt = this.formData.oilappoint1Amt == null ? 0 : this.formData.oilappoint1Amt;
+				let oilappoint2Amt = this.formData.oilappoint2Amt == null ? 0 : this.formData.oilappoint2Amt;
+				let oilappoint3Amt = this.formData.oilappoint3Amt == null ? 0 : this.formData.oilappoint3Amt;
+				let oilcash1Amt = this.formData.oilcash1Amt == null ? 0 : this.formData.oilcash1Amt;
+				let oilcardAmt = this.formData.oilcardAmt == null ? 0 : this.formData.oilcardAmt;
+
+				let itemsMoney = 0;
+
+				for (const key in this.itemsList) {
+					let a = this.itemsList[key].amt == null ? 0 : this.itemsList[key].amt;
+					itemsMoney += Number(a);
+				}
+
+				loadetc = Number(loadetc)
+				loadtoll = Number(loadtoll)
+				oilhomeAmt = Number(oilhomeAmt)
+				oilappoint1Amt = Number(oilappoint1Amt)
+				oilappoint2Amt = Number(oilappoint2Amt)
+				oilappoint3Amt = Number(oilappoint3Amt)
+				oilcash1Amt = Number(oilcash1Amt)
+				oilcardAmt = Number(oilcardAmt)
+				itemsMoney = Number(itemsMoney)
+
+
+				this.money = loadetc + loadtoll + oilhomeAmt + oilappoint1Amt + oilappoint2Amt + oilcash1Amt + oilcardAmt +
+					oilappoint3Amt + itemsMoney;
+			},
 			checkUnLoadetc(e) {
 				//正则表达试
 				e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
@@ -1625,6 +1719,16 @@
 				this.calculatMoney();
 
 			},
+			checkUnRepairamt(e) {
+				//正则表达试
+				e.target.value = (e.target.value.match(/^\d*(\.?\d{0,2})/g)[0]) || null
+				//重新赋值给input
+				this.$nextTick(() => {
+					this.formData.repairamt = e.target.value
+				})
+				this.calculatMoney();
+				
+			},
 			checkUnAmt(amt, index) {
 
 				var amt = (amt.match(/^\d*(\.?\d{0,2})/g)[0]) || null
@@ -1948,56 +2052,6 @@
 			padding-bottom: 40rpx;
 		}
 
-		// 底部提交按钮
-		// .bottom {
-		// 	height: 130rpx;
-		// 	display: block;
-		// 	position: fixed;
-		// 	bottom: calc(var(--window-bottom));
-		// 	width: 100%;
-		// 	// background-color: #f0f0f0f0;
-		// 	// background-color: pink;
-		// 	background-color: white;
-
-		// 	.bottom-bottom {
-		// 		width: 100%;
-		// 		height: 100%;
-
-		// 		position: relative;
-
-		// 		display: flex;
-
-		// 		// .submit {
-		// 		// 	width: 95%;
-		// 		// 	background-color: #0b68ffff;
-		// 		// }
-
-		// 		.money {
-
-		// 			font-size: 28rpx;
-		// 			height: 130rpx;
-		// 			margin-right: 80rpx;
-		// 			line-height: 130rpx;
-
-		// 			margin-left: 10%;
-		// 		}
-
-		// 		.button {
-		// 			width: 300rpx;
-		// 			position: absolute;
-		// 			right: 0;
-
-		// 			margin-right: 10%;
-
-		// 			.button-button {
-		// 				padding: 10% 0;
-		// 				background-clip: content-box;
-		// 			}
-
-		// 		}
-		// 	}
-		// }
-
 		.bottom {
 
 			position: fixed;
@@ -2036,4 +2090,8 @@
 
 
 	}
+	
+	.u-page__tag-item {
+			margin-right: 20px;
+		}
 </style>

+ 26 - 2
pages/particulars/index.vue

@@ -149,7 +149,7 @@
 			</view>
 			<view class="box-box" style="margin-top: 40rpx;">
 				<view style="margin-bottom: 20rpx;">
-					<text style="color: #3c9cff;">单据拍照存档 (请上传图片大小为1MB以下的图片)</text>
+					<text style="color: #3c9cff;">单据拍照存档</text>
 				</view>
 				<u-upload :fileList="fileList1" :sizeType="['compressed']"
 					@afterRead="imgUploading" :disabled="disabled" @delete="deletePic" name="1" multiple :previewFullImage="true"
@@ -338,6 +338,7 @@
 					name: '订单信息'
 				}],
 				isTabs: '装卸确认',
+				tabName: '',
 				// 绕路选项
 				detour: [],
 				end: new Date() + ''
@@ -347,6 +348,8 @@
 			this.status317 = option.status;
 			this.status376 = option.status;
 			this.orderNo = option.orderNo;
+			this.tabName = option.tabName;
+			
 			this.getData();
 		},
 		onUnload() {
@@ -463,13 +466,34 @@
 			// 提交里程点击事件
 			disabledClick() {
 				
-				if(this.formData.loadQty == null || this.formData.loadQty == 0) {
+				if(this.tabName == '未装车' && (this.formData.loadQty == null || this.formData.loadQty == 0)) {
 						this.$refs.uToast.show({
 							type: 'warning',
 							icon: false,
 							message: "请输入装车吨位!",
 							iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
 						})
+				} else if(this.tabName == '未装车' && (this.formData.loadDateString == null)) {
+						this.$refs.uToast.show({
+							type: 'warning',
+							icon: false,
+							message: "请选择装车时间!",
+							iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
+						})
+				} else if(this.tabName == '未卸车' && (this.formData.unLoadQty == null || this.formData.unLoadQty == 0)) {
+						this.$refs.uToast.show({
+							type: 'warning',
+							icon: false,
+							message: "请输入卸车吨位!",
+							iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
+						})
+				} else if(this.tabName == '未卸车' && (this.formData.unLoadDateString == null)) {
+						this.$refs.uToast.show({
+							type: 'warning',
+							icon: false,
+							message: "请选择卸车时间!",
+							iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
+						})
 				} else {
 					this.submitShow = true
 				}