瀏覽代碼

报单水印

caojunjie 1 年之前
父節點
當前提交
84dbce180f
共有 6 個文件被更改,包括 167 次插入145 次删除
  1. 3 2
      api/particulars.js
  2. 7 6
      manifest.json
  3. 5 2
      pages/listview.vue
  4. 4 0
      pages/login.vue
  5. 96 94
      pages/particulars/claimExpense/index.vue
  6. 52 41
      pages/particulars/index.vue

+ 3 - 2
api/particulars.js

@@ -81,9 +81,10 @@ export function audit(data) {
 }
 
 // 提交报账单
-export function upReceipts(orderNo) {
+export function upReceipts(orderNo,data) {
   return request({
     'url': '/order-bills-plans/up-receipts/' + orderNo,
-    'method': 'get'
+    'method': 'get',
+	'data': data
   })
 }

+ 7 - 6
manifest.json

@@ -1,6 +1,6 @@
 {
     "name" : "途宝报单",
-    "appid" : "__UNI__E902AAE",
+    "appid" : "__UNI__8B25AD8",
     "description" : "",
     "versionName" : "1.1.0",
     "versionCode" : "100",
@@ -16,7 +16,6 @@
         },
         "modules" : {
             "Camera" : {},
-            "Contacts" : {},
             "Geolocation" : {}
         },
         "distribute" : {
@@ -31,14 +30,11 @@
                     "<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
                     "<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
                     "<uses-permission android:name=\"android.permission.FLASHLIGHT\"/>",
-                    "<uses-permission android:name=\"android.permission.GET_ACCOUNTS\"/>",
                     "<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
-                    "<uses-permission android:name=\"android.permission.READ_CONTACTS\"/>",
                     "<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
                     "<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
                     "<uses-permission android:name=\"android.permission.VIBRATE\"/>",
                     "<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
-                    "<uses-permission android:name=\"android.permission.WRITE_CONTACTS\"/>",
                     "<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>"
                 ]
             },
@@ -101,7 +97,12 @@
             "subPackages" : true
         },
         "usingComponents" : true,
-        "permission" : {}
+        "permission" : {
+            "scope.userLocation" : {
+                "desc" : "图片水印"
+            }
+        },
+        "requiredPrivateInfos" : [ "getLocation" ]
     },
     "vueVersion" : "2",
     "h5" : {

+ 5 - 2
pages/listview.vue

@@ -44,7 +44,7 @@
 		<view class="dataList">
 
 			<!-- 列表 -->
-			<view class="list" v-for="(item,index) in orderBillsPlansList"
+			<view class="list" v-for="(item,index) in orderBillsPlansList" :key="index"
 				@click="jumpDetails(item.orderNo, item.status)">
 				<!-- 头部 -->
 				<view class="head vertical-layout">
@@ -189,6 +189,10 @@
 				this.condition.flowType = '未提交'
 			}
 			this.getCurrentMonthFirst();
+			// this.getOrderBillsPlansList();
+		},
+		onShow() {
+			this.orderBillsPlansList = []
 			this.getOrderBillsPlansList();
 		},
 		onReachBottom() {
@@ -201,7 +205,6 @@
 		},
 		methods: {
 			datetimePickerChange(date) {
-				console.log(date);
 				this.condition.range = date
 				this.getOrderBillsPlansList();
 			},

+ 4 - 0
pages/login.vue

@@ -69,6 +69,10 @@
 		},
 		onLoad() {
 			this.mima();
+			// 判断是否有token
+			if(uni.getStorageSync('App-Token')) {
+				this.$tab.reLaunch('/pages/index')
+			}
 		},
 		created() {
 			this.getCode()

+ 96 - 94
pages/particulars/claimExpense/index.vue

@@ -226,7 +226,7 @@
 
 
 		
-		<view v-if="formData.ifStarted != 'A'">
+		<view v-if="formData.ifStarted && formData.ifStarted != 'A'">
 			<!-- 驾驶员 -->
 			<view v-if="button" class="bottom" style="z-index: 4;">
 				<view class="row">
@@ -242,7 +242,7 @@
 			</view>
 			
 			<!-- 队长 -->
-			<view v-if="!button" class="bottom" style="z-index: 4;">
+			<view v-else class="bottom" style="z-index: 4;">
 				<view class="row">
 					<view class="button">
 						<u-button iconColor="#3c9cff" shape="circle" type="primary" :disabled="sDisabled"
@@ -355,7 +355,7 @@
 				// 审核按钮禁用
 				sDisabled: true,
 				// 底部按钮
-				button: true,
+				button: null,
 				status376: 0,
 				selectionLength: 0,
 				fileList1: [],
@@ -393,6 +393,7 @@
 				this.disabled = true;
 			}
 			this.getData();
+			this.getLoadFeeItemsfun()
 		},
 		methods: {
 			change(item) {
@@ -420,96 +421,97 @@
 					}
 					getItems().then(res => {
 						this.itemsList = res.data
-
-						getLoadFeeItems(this.orderNo).then(res => {
-
-							res.data.loadetc == 0 ? res.data.loadetc = null : res.data.loadetc
-							res.data.loadtoll == 0 ? res.data.loadtoll = null : res.data.loadtoll
-							res.data.oilhomeQty == 0 ? res.data.oilhomeQty = null : res.data.oilhomeQty
-							res.data.oilhomeAmt == 0 ? res.data.oilhomeAmt = null : res.data.oilhomeAmt
-							res.data.oilappoint1Qty == 0 ? res.data.oilappoint1Qty = null : res.data.oilappoint1Qty
-							res.data.oilappoint1Amt == 0 ? res.data.oilappoint1Amt = null : res.data.oilappoint1Amt
-							res.data.oilappoint2Qty == 0 ? res.data.oilappoint2Qty = null : res.data.oilappoint2Qty
-							res.data.oilappoint2Amt == 0 ? res.data.oilappoint2Amt = null : res.data.oilappoint2Amt
-							res.data.oilappoint3Qty == 0 ? res.data.oilappoint3Qty = null : res.data.oilappoint3Qty
-							res.data.oilappoint3Amt == 0 ? res.data.oilappoint3Amt = null : res.data.oilappoint3Amt
-							res.data.oilcash1Qty == 0 ? res.data.oilcash1Qty = null : res.data.oilcash1Qty
-							res.data.oilcash1Amt == 0 ? res.data.oilcash1Amt = null : res.data.oilcash1Amt
-							res.data.oilcardQty == 0 ? res.data.oilcardQty = null : res.data.oilcardQty
-							res.data.oilcardAmt == 0 ? res.data.oilcardAmt = null : res.data.oilcardAmt
-								
-								for (let item of this.itemsList) {
-									if (item == 0) {
-										item.amt = null
-									}
-								}
-
-							// 角色
-							for (let role of res.data.roleList) {
-								if (role == 'DZ') {
-									this.button = false;
-									this.disabled = true;
-								}
-								if (role == 'JSY') {
-									this.disabled = false;
-								}
-							}
-
-							// 审核中
-							if (
-								res.data.ifStarted == "S") {
-								this.disabled = true;
-								this.saveDisabled = true;
-								this.upDisabled = true;
-								this.sDisabled = false;
-							}
-							// 审核完成
-							if (
-								res.data.ifStarted == "A") {
-								this.disabled = true;
-								this.saveDisabled = true;
-								this.upDisabled = true;
-							}
-
-							// 未提交
-							// if (res.data.ifLoaded != "T" ||
-							// 	res.data.ifUnLoaded != "T") {
-							// 	this.disabled = false;
-							// 	this.saveDisabled = false;
-							// 	this.upDisabled = true;
-							// }
-
-							this.formData = res.data;
-							var costBreakdownList = res.data.loadFeeItemsList;
-							this.itemsList = costBreakdownList;
-
-							for (const key in this.itemsList) {
-								if (this.itemsList[key].amt == 0) {
-									this.itemsList[key].amt = null;
-								}
-							}
-
-							this.fileList1 = res.data.fileList1;
-							this.loading = false;
-
-							// isMileage(this.orderNo).then(res => {
-							// 	if (res.msg == 410) {
-							// 		// this.disabled = true;
-							// 		// this.upDisabled = true;
-							// 		// this.$refs.uToast.show({
-							// 		// 	type: 'warning',
-							// 		// 	icon: false,
-							// 		// 	message: "当前报单有待提交里程!",
-							// 		// 	iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
-							// 		// })
-							// 	}
-							// })
-
-							// this.calculatMoney();
-						})
 					})
 				})
 			},
+			getLoadFeeItemsfun(){
+				getLoadFeeItems(this.orderNo).then(res => {
+					res.data.loadetc == 0 ? res.data.loadetc = null : res.data.loadetc
+					res.data.loadtoll == 0 ? res.data.loadtoll = null : res.data.loadtoll
+					res.data.oilhomeQty == 0 ? res.data.oilhomeQty = null : res.data.oilhomeQty
+					res.data.oilhomeAmt == 0 ? res.data.oilhomeAmt = null : res.data.oilhomeAmt
+					res.data.oilappoint1Qty == 0 ? res.data.oilappoint1Qty = null : res.data.oilappoint1Qty
+					res.data.oilappoint1Amt == 0 ? res.data.oilappoint1Amt = null : res.data.oilappoint1Amt
+					res.data.oilappoint2Qty == 0 ? res.data.oilappoint2Qty = null : res.data.oilappoint2Qty
+					res.data.oilappoint2Amt == 0 ? res.data.oilappoint2Amt = null : res.data.oilappoint2Amt
+					res.data.oilappoint3Qty == 0 ? res.data.oilappoint3Qty = null : res.data.oilappoint3Qty
+					res.data.oilappoint3Amt == 0 ? res.data.oilappoint3Amt = null : res.data.oilappoint3Amt
+					res.data.oilcash1Qty == 0 ? res.data.oilcash1Qty = null : res.data.oilcash1Qty
+					res.data.oilcash1Amt == 0 ? res.data.oilcash1Amt = null : res.data.oilcash1Amt
+					res.data.oilcardQty == 0 ? res.data.oilcardQty = null : res.data.oilcardQty
+					res.data.oilcardAmt == 0 ? res.data.oilcardAmt = null : res.data.oilcardAmt
+						
+						for (let item of this.itemsList) {
+							if (item == 0) {
+								item.amt = null
+							}
+						}
+				
+					// // 角色
+					for (let role of res.data.roleList) {
+						if (role == 'DZ') {
+							this.button = false;
+							this.disabled = true;
+						}
+						if (role == 'JSY') {
+							this.button = true;
+							this.disabled = false;
+						}
+					}
+				
+					// 审核中
+					if (
+						res.data.ifStarted == "S") {
+						this.disabled = true;
+						this.saveDisabled = true;
+						this.upDisabled = true;
+						this.sDisabled = false;
+					}
+					// 审核完成
+					if (
+						res.data.ifStarted == "A") {
+						this.disabled = true;
+						this.saveDisabled = true;
+						this.upDisabled = true;
+					}
+				
+					// 未提交
+					// if (res.data.ifLoaded != "T" ||
+					// 	res.data.ifUnLoaded != "T") {
+					// 	this.disabled = false;
+					// 	this.saveDisabled = false;
+					// 	this.upDisabled = true;
+					// }
+				
+					this.formData = res.data;
+					var costBreakdownList = res.data.loadFeeItemsList;
+					this.itemsList = costBreakdownList;
+				
+					for (const key in this.itemsList) {
+						if (this.itemsList[key].amt == 0) {
+							this.itemsList[key].amt = null;
+						}
+					}
+				
+					this.fileList1 = res.data.fileList1;
+					this.loading = false;
+				
+					// isMileage(this.orderNo).then(res => {
+					// 	if (res.msg == 410) {
+					// 		// this.disabled = true;
+					// 		// this.upDisabled = true;
+					// 		// this.$refs.uToast.show({
+					// 		// 	type: 'warning',
+					// 		// 	icon: false,
+					// 		// 	message: "当前报单有待提交里程!",
+					// 		// 	iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
+					// 		// })
+					// 	}
+					// })
+				
+					// this.calculatMoney();
+				})
+			},
 			// 事件审核按钮
 			upButtonClick(type) {
 				if(this.formData.loadQty == null) {
@@ -553,7 +555,7 @@
 					this.$refs.uToast.show({
 						type: 'warning',
 						icon: false,
-						message: "请先提交报账单!",
+						message: "请先提交卸车信息!",
 						iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
 					}) 
 				} else {
@@ -1134,17 +1136,17 @@
 			},
 			// 定点加油1清空
 			gasstation1Change() {
-				this.formData.oilappoint1Qty = 0;
+				this.formData.oilappoint1Qty = '';
 				this.formData.oilappoint1Amt = 0;
 			},
 			// 定点加油2清空
 			gasstation2Change() {
-				this.formData.oilappoint2Qty = 0;
+				this.formData.oilappoint2Qty = '';
 				this.formData.oilappoint2Amt = 0;
 			},
 			// 定点加油3清空
 			gasstation3Change() {
-				this.formData.oilappoint3Qty = 0;
+				this.formData.oilappoint3Qty = '';
 				this.formData.oilappoint3Amt = 0;
 			},
 			// 点击拨打电话

+ 52 - 41
pages/particulars/index.vue

@@ -134,7 +134,7 @@
 					</view>
 					<view class="box-two">
 						<text class="key" style="width: 300rpx;">绕路里程重(公里)</text>
-						<input class="value-two"selection-start="0" selection-end="9999" :disabled="disabled"
+						<input class="value-two" selection-start="0" selection-end="9999" :disabled="disabled"
 							@input="checkUnDetourLoadMile" v-model="formData.detourLoadMile" />
 					</view>
 					<view class="box-two">
@@ -149,7 +149,7 @@
 			</view>
 			<view class="box-box" style="margin-top: 40rpx;">
 				<view style="margin-bottom: 20rpx;">
-					<text style="color: #3c9cff;">单据拍照存档</text>
+					<text style="color: #3c9cff;">单据拍照存档 (请上传图片大小为1MB以下的图片)</text>
 				</view>
 				<u-upload :fileList="fileList1" accept="image" :sizeType="['compressed']" capture="camera"
 					@afterRead="imgUploading" :disabled="disabled" @delete="deletePic" name="1" multiple :previewFullImage="true"
@@ -214,14 +214,14 @@
 		</view>
 
 		<view class="bottom" style="z-index: 4;">
-			<view class="row" v-if="formData.ifLoaded == 'T' && (formData.ifUnLoaded == 'T' || formData.ifUnLoaded == 'F') && formData.ifOrder2ed == 'F'">
+			<view class="row" v-if="formData.ifLoaded == 'T' && (formData.ifUnLoaded == 'T' || formData.ifUnLoaded == 'F') && (formData.ifOrder2ed == 'T' || formData.ifOrder2ed == 'F')">
 				<view class="button" style="width: 300rpx;">
 					<u-button iconColor="#3c9cff" shape="circle" type="primary" :disabled="disabled"
 						@click="disabledClick" text="保存数据"></u-button>
 				</view>
 				<view class="button" style="width: 300rpx;">
 					<u-button iconColor="#fe8c00;" color="#fe8c00" shape="circle" type="primary" :disabled="disabled"
-						@click="upDisabledClick" text="提交报账单"></u-button>
+						@click="upDisabledClick" text="卸车确认"></u-button>
 				</view>
 			</view>
 			
@@ -269,7 +269,7 @@
 		<u-modal :show="upCancel" title="提示" showCancelButton @confirm="upReceipts"
 			@cancel="upCancel = false">
 			<view class="slot-content">
-				<rich-text nodes="确定要提交报账单吗?"></rich-text>
+				<rich-text nodes="确定要卸车吗?"></rich-text>
 			</view>
 		</u-modal>
 	</view>
@@ -369,7 +369,6 @@
 					if (res.data.ifDetour == "T") {
 						this.detour.push("行程绕路")
 					}
-
 					for (let role of res.data.roleList) {
 						if (role == 'DZ') {
 							this.disabled = true;
@@ -379,14 +378,14 @@
 						}
 					}
 
-					// 审核中
-					if (res.data.ifStarted == "S") {
-						this.disabled = true;
-					}
-					// 审核完成
-					if (res.data.ifStarted == "A") {
-						this.disabled = true;
-					}
+					// // 审核中
+					// if (res.data.ifStarted == "S") {
+					// 	this.disabled = true;
+					// }
+					// // 审核完成
+					// if (res.data.ifStarted == "A") {
+					// 	this.disabled = true;
+					// }
 					
 					// 提交报账单
 					if (res.data.ifOrder2ed == "S" || res.data.ifOrder2ed == "O") {
@@ -536,14 +535,14 @@
 								}
 							}
 						
-							// 审核中
-							if (res.data.ifStarted == "S") {
-								this.disabled = true;
-							}
-							// 审核完成
-							if (res.data.ifStarted == "A") {
-								this.disabled = true;
-							}
+							// // 审核中
+							// if (res.data.ifStarted == "S") {
+							// 	this.disabled = true;
+							// }
+							// // 审核完成
+							// if (res.data.ifStarted == "A") {
+							// 	this.disabled = true;
+							// }
 							
 							// 提交报账单
 							if (res.data.ifOrder2ed == "S" || res.data.ifOrder2ed == "O") {
@@ -613,6 +612,17 @@
 				
 				putOrderBillsPlansByid(this.formData).then(ress => {
 					if (ress.code == 200) {
+						// 提交订单
+						// actId entityId
+						upReceipts(this.orderNo,{actId:this.formData.actId,entityId:this.formData.entityId}).then(res => {
+							// 提交报账单成功
+							this.$refs.uToast.show({
+								type: 'success',
+								message: "提交报账单成功!",
+								iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
+							})
+						})
+						// 获取详情数据
 						getOrderBillsPlansByid(this.orderNo).then(res => {
 						
 							res.data.loadQty == 0 ? res.data.loadQty = null : res.data.loadQty
@@ -634,13 +644,13 @@
 							}
 						
 							// 审核中
-							if (res.data.ifStarted == "S") {
-								this.disabled = true;
-							}
-							// 审核完成
-							if (res.data.ifStarted == "A") {
-								this.disabled = true;
-							}
+							// if (res.data.ifStarted == "S") {
+							// 	this.disabled = true;
+							// }
+							// // 审核完成
+							// if (res.data.ifStarted == "A") {
+							// 	this.disabled = true;
+							// }
 							
 							// 提交报账单
 							if (res.data.ifOrder2ed == "S" || res.data.ifOrder2ed == "O") {
@@ -658,15 +668,15 @@
 							
 							this.upCancel = false
 							
-							upReceipts(this.orderNo).then(res => {
-							
-								// 提交报账单成功
-								this.$refs.uToast.show({
-									type: 'success',
-									message: "提交报账单成功!",
-									iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
-								})
-							})
+							// upReceipts(this.orderNo).then(res => {
+							// 	console.log(res,'662');
+							// 	// 提交报账单成功
+							// 	this.$refs.uToast.show({
+							// 		type: 'success',
+							// 		message: "提交报账单成功!",
+							// 		iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
+							// 	})
+							// })
 							
 						})
 						
@@ -720,7 +730,7 @@
 			},
 			// 删除图片
 			deletePic(event) {
-				if (this.formData.ifOrder2ed == 'S' || this.formData.ifOrder2ed == 'O' || this.formData.ifStarted == 'S' || this.formData.ifStarted == 'A') {
+				if (this.formData.ifOrder2ed == 'S' || this.formData.ifOrder2ed == 'O') {
 					this.$refs.uToast.show({
 						type: 'warning',
 						icon: false,
@@ -796,7 +806,8 @@
 										attachId: res.data,
 										longitude: longitude,
 										latitude: latitude,
-										updateDate: dateHHmmss
+										updateDate: dateHHmmss,
+										carRegNo:this.formData.carRegNo
 									}
 									// 上传图片
 									pictureUploading(data, dataForm).then(res => {
@@ -809,7 +820,7 @@
 											}))
 										fileListLen++
 									})
-								}
+								},
 							});
 							
 						}