Browse Source

途宝报单新需求

wangzhuo 2 years ago
parent
commit
63ec6b907f
6 changed files with 530 additions and 188 deletions
  1. 2 1
      manifest.json
  2. 1 1
      pages.json
  3. 62 9
      pages/listview.vue
  4. 1 1
      pages/mine/index.vue
  5. 294 111
      pages/particulars/claimExpense/index.vue
  6. 170 65
      pages/particulars/index.vue

+ 2 - 1
manifest.json

@@ -51,7 +51,8 @@
                     "system" : {
                         "__platform__" : [ "ios", "android" ]
                     }
-                }
+                },
+                "maps" : {}
             },
             "icons" : {
                 "android" : {

+ 1 - 1
pages.json

@@ -16,7 +16,7 @@
 		}, {
 			"path": "pages/index",
 			"style": {
-				"navigationBarTitleText": "报单",
+				"navigationBarTitleText": "报单系统",
 				"navigationBarBackgroundColor": "#3c9cff",
 				// "navigationStyle": "custom",
 				"navigationBarTextStyle": "white" //状态栏字体颜色

+ 62 - 9
pages/listview.vue

@@ -8,12 +8,33 @@
 			<!-- <view style="width: 100%; height: 98rpx"></view> -->
 			<view class="falseSearch">
 				<u-search bgColor="#fff" hover-class="search" @search="getOrderBillsPlansList()"
-					@confirm="getOrderBillsPlansList()" :showAction="false" placeholder="请输入"
+					@confirm="getOrderBillsPlansList()" :showAction="false" placeholder="模糊检索装卸厂家品名"
 					v-model="condition.orderNo">
 				</u-search>
 				<text class="search" hover-class="search-click" @click="getOrderBillsPlansList()">搜索</text>
 			</view>
 		</view>
+		<!-- tab -->
+		<view style="background-color: #3c9cff;">
+			<u-tabs :list="tabs" lineColor="#fff" lineWidth="60" @change="change" :activeStyle="{
+					width: '180rpx',
+					height: '60rpx',
+					color: '#fff',
+					backgroundColor: '#3c9cff',
+					borderRadius: '80rpx',
+					lineHeight: '60rpx',
+					textAlign: 'center'
+					}" :inactiveStyle="{
+					width: '180rpx',
+					height: '60rpx',
+					color: '#fff',
+					backgroundColor: '#3c9cff',
+					borderRadius: '80rpx',
+					lineHeight: '60rpx',
+					textAlign: 'center'
+					}"></u-tabs>
+		</view>
+		
 		<!-- 日期 -->
 		<view style="position: sticky;top: 120rpx;">
 			<view style="background-color: white">
@@ -40,12 +61,20 @@
 							v-if="item.status317 == 6 && item.status376 == 6">{{ item.billStatusName }}</text> -->
 						<!-- <text class="true" v-if="condition.type == 'BD'">{{ item.billStatusName }}</text>
 						<text class="yellow" v-if="condition.type == 'BX'">{{ item.billStatusName }}</text> -->
-						<text style="color: #3c9cff;" v-if="item.billStatusName == '费用已提交'">{{ item.billStatusName }}</text>
+						<!-- <text style="color: #3c9cff;" v-if="item.billStatusName == '费用已提交'">{{ item.billStatusName }}</text>
 						<text style="color: green;" v-if="item.billStatusName == '审核通过'">{{ item.billStatusName }}</text>
 						<text style="color: #fa4434;" v-if="item.billStatusName == '审核驳回'">{{ item.billStatusName }}</text>
 						<text style="color: #3c9cff;" v-if="item.billStatusName == '里程已提交'">{{ item.billStatusName }}</text>
 						<text style="color: #fcbd71;" v-if="item.billStatusName == '里程待提交'">{{ item.billStatusName }}</text>
-						<text style="color: #fcbd71;" v-if="item.billStatusName == '费用待提交'">{{ item.billStatusName }}</text>
+						<text style="color: #fcbd71;" v-if="item.billStatusName == '费用待提交'">{{ item.billStatusName }}</text> -->
+						
+						<text style="color: #55aaff;" v-if="item.billStatusName == '未装车'">{{ item.billStatusName }}</text>
+						<text style="color: #fcbd71;" v-if="item.billStatusName == '未卸车'">{{ item.billStatusName }}</text>
+						<text style="color: #3c9cff;" v-if="item.billStatusName == '已卸车'">{{ item.billStatusName }}</text>
+						<text style="color: #3c9cff;" v-if="item.billStatusName == '已提交'">{{ item.billStatusName }}</text>
+						<text style="color: green;" v-if="item.billStatusName == '已通过'">{{ item.billStatusName }}</text>
+						<text style="color: #fa4434;" v-if="item.billStatusName == '已退回'">{{ item.billStatusName }}</text>
+						<text style="color: #fcbd71;" v-if="item.billStatusName == '未提交'">{{ item.billStatusName }}</text>
 					</view>
 				</view>
 				<view class="details">
@@ -95,6 +124,8 @@
 			</view>
 
 		</view>
+		<!-- 加载页 -->
+		<u-loading-page bg-color="rgba(0,0,0,0.5)" color="#fff" loadingColor="#fff" style="z-index: 999;" :loading="loadingPageLoading"></u-loading-page>
 	</view>
 </template>
 
@@ -112,10 +143,13 @@
 					head: 1,
 					tail: 9
 				},
+				// tabs
+				tabs: [],
 				// 数据
 				orderBillsPlansList: [],
 				show: false,
-
+				// 加载页
+				loadingPageLoading: true
 			}
 		},
 		computed: {
@@ -125,17 +159,33 @@
 		},
 		onLoad(option) {
 			this.condition.type = option.type;
-
 			if (option.type == 'BD') {
 				uni.setNavigationBarTitle({
 					title: '报单列表'
 				});
+				this.tabs = [{
+                    name: '未装车',
+                }, {
+                    name: '未卸车'
+                }, {
+                    name: '已卸车'
+                }]
+				this.condition.flowType = '未装车'
 			} else if (option.type == 'BX'){
 				uni.setNavigationBarTitle({
 					title: '报销列表'
 				});
+				this.tabs = [{
+				    name: '未提交',
+				}, {
+				    name: '已提交'
+				}, {
+				    name: '已通过'
+				}, {
+				    name: '已退回'
+				}]
+				this.condition.flowType = '未提交'
 			}
-
 			this.getCurrentMonthFirst();
 			this.getOrderBillsPlansList();
 		},
@@ -150,26 +200,25 @@
 		methods: {
 			// 查询主页数据
 			getOrderBillsPlansList(type) {
+				this.loadingPageLoading = true
 				this.condition.head = 1;
 				this.condition.tail = 9;
 				orderBillsPlansList(this.condition).then(res => {
 					this.orderBillsPlansList = res.data;
+					this.loadingPageLoading = false
 				})
 			},
 			// 跳转详情
 			jumpDetails(orderNo, status) {
 
 				if (this.condition.type == 'BD') {
-
 					uni.navigateTo({
 						url: 'particulars/index?orderNo=' + orderNo + '&status=' + status
 					});
 				} else if (this.condition.type == 'BX') {
-
 					uni.navigateTo({
 						url: '/pages/particulars/claimExpense/index?orderNo=' + orderNo + '&status=' + status
 					});
-
 				}
 
 			},
@@ -180,6 +229,10 @@
 				});
 
 			},
+			change(item) {
+				this.condition.flowType = item.name
+				this.getOrderBillsPlansList();
+			},
 			//获取当前月份第一天和最后一天
 			getCurrentMonthFirst() {
 				var date = new Date();

+ 1 - 1
pages/mine/index.vue

@@ -20,7 +20,7 @@
 							用户名:{{ name }}
 						</view>
 						<view class="u_no">
-							身份证:{{ user.remark }}
+							备注:{{ user.remark }}
 							<!-- 身份证:222222222222222222 -->
 						</view>
 					</view>

+ 294 - 111
pages/particulars/claimExpense/index.vue

@@ -14,8 +14,8 @@
 				<view>
 					<text>{{formData.loadAddr}}</text>
 				</view>
-				<span class="icon iconfont"
-					style="font-size: 100rpx; color: #fcbd71; height: 80rpx;">&#xe6fb;</span>
+				<!-- <span class="icon iconfont" style="font-size: 100rpx; color: #fcbd71; height: 80rpx;">&#xe6fb;</span> -->
+				<view><text>【到】</text></view>
 				<view>
 					<text>{{formData.unLoadAddr}}</text>
 				</view>
@@ -81,15 +81,15 @@
 				</view>
 				<view class="box">
 					<view class="data">
-						<text class="key">升数</text>
+						<text class="key">升&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;数</text>
 						<input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
-							@input="checkUnOilappoint1Qty" placeholder="请输入升数" v-model="formData.oilappoint1Qty" />
+							@input="checkUnOilappoint1Qty" placeholder-style="font-size:24rpx" placeholder="请输入升数" v-model="formData.oilappoint1Qty" />
 					</view>
 					<view class="data">
-						<text class="key">金额</text>
+						<text class="key">金&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;额</text>
 
 						<input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
-							@input="checkUnOilappoint1Amt" placeholder="请输入金额" v-model="formData.oilappoint1Amt" />
+							@input="checkUnOilappoint1Amt" placeholder-style="font-size:24rpx" placeholder="请输入金额" v-model="formData.oilappoint1Amt" />
 					</view>
 				</view>
 
@@ -104,15 +104,15 @@
 				</view>
 				<view class="box">
 					<view class="data">
-						<text class="key">升数</text>
+						<text class="key">升&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;数</text>
 						<input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
-							@input="checkUnOilappoint2Qty" placeholder="请输入升数" v-model="formData.oilappoint2Qty" />
+							@input="checkUnOilappoint2Qty" placeholder-style="font-size:24rpx" placeholder="请输入升数" v-model="formData.oilappoint2Qty" />
 					</view>
 					<view class="data">
-						<text class="key">金额</text>
+						<text class="key">金&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;额</text>
 
 						<input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
-							@input="checkUnOilappoint2Amt" placeholder="请输入金额" v-model="formData.oilappoint2Amt" />
+							@input="checkUnOilappoint2Amt" placeholder-style="font-size:24rpx" placeholder="请输入金额" v-model="formData.oilappoint2Amt" />
 					</view>
 				</view>
 
@@ -127,15 +127,15 @@
 				</view>
 				<view class="box">
 					<view class="data">
-						<text class="key">升数</text>
+						<text class="key">升&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;数</text>
 						<input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
-							@input="checkUnOilappoint3Qty" placeholder="请输入升数" v-model="formData.oilappoint3Qty" />
+							@input="checkUnOilappoint3Qty" placeholder-style="font-size:24rpx" placeholder="请输入升数" v-model="formData.oilappoint3Qty" />
 					</view>
 					<view class="data">
-						<text class="key">金额</text>
+						<text class="key">金&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;额</text>
 
 						<input class="value" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
-							@input="checkUnOilappoint3Amt" placeholder="请输入金额" v-model="formData.oilappoint3Amt" />
+							@input="checkUnOilappoint3Amt" placeholder-style="font-size:24rpx" placeholder="请输入金额" v-model="formData.oilappoint3Amt" />
 					</view>
 				</view>
 
@@ -198,7 +198,7 @@
 					</view>
 
 					<view class="remarks" style="border-bottom: 2rpx dotted #000;">
-						<input v-model="item.remarks" placeholder="请输入备注">
+						<input v-model="item.remarks" placeholder-style="font-size:24rpx" placeholder="请输入备注">
 					</view>
 				</view>
 			</view>
@@ -235,7 +235,7 @@
 					</view>
 					<view class="button">
 						<u-button iconColor="#3c9cff" shape="circle" type="primary" :disabled="upDisabled"
-							@click="upAuditShow = true" text="提交报账单"></u-button>
+							@click="upButtonClick('TJ')" text="提交报账单"></u-button>
 					</view>
 				</view>
 			</view>
@@ -257,7 +257,7 @@
 					</view>
 				</view>
 			</view>
-			
+
 		</view>
 
 		<!-- 遮盖罩 -->
@@ -271,10 +271,10 @@
 				<rich-text nodes="确定要保存数据吗?"></rich-text>
 			</view>
 		</u-modal>
-		
+
 		<u-modal :show="upAuditShow" title="提示" showCancelButton @confirm="upReview" @cancel="upAuditShow = false">
 			<view class="slot-content">
-				<rich-text nodes="确定要提交审核吗?"></rich-text>
+				<rich-text nodes="确定要提交账单吗?"></rich-text>
 			</view>
 		</u-modal>
 
@@ -283,13 +283,13 @@
 				<rich-text nodes="确定删除这张图片吗?"></rich-text>
 			</view>
 		</u-modal>
-		
+
 		<u-modal :show="auditTShow" title="提示" showCancelButton @confirm="check('T')" @cancel="auditTShow = false">
 			<view class="slot-content">
 				<rich-text nodes="确定要审核通过吗?"></rich-text>
 			</view>
 		</u-modal>
-		
+
 		<u-modal :show="auditFShow" title="提示" showCancelButton @confirm="check('F')" @cancel="auditFShow = false">
 			<view class="slot-content">
 				<rich-text nodes="确定要驳回审核吗?"></rich-text>
@@ -408,38 +408,37 @@
 
 							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
+							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') {
+									console.log(123);
 									this.button = false;
+									this.disabled = true;
+								}
+								if (role == 'JSY') {
+									this.disabled = false;
 								}
 							}
-							
+
 							// 审核中
 							if (
 								res.data.ifStarted == "S") {
@@ -455,7 +454,7 @@
 								this.saveDisabled = true;
 								this.upDisabled = true;
 							}
-							
+
 							// 未提交
 							// if (res.data.ifLoaded != "T" ||
 							// 	res.data.ifUnLoaded != "T") {
@@ -495,6 +494,46 @@
 					})
 				})
 			},
+			// 事件审核按钮
+			upButtonClick(type) {
+				if(this.formData.loadQty == null) {
+					this.$refs.uToast.show({
+						type: 'warning',
+						icon: false,
+						message: "没有装车吨位!",
+						iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
+					})
+				} else if(this.formData.loadDate == null) {
+					this.$refs.uToast.show({
+						type: 'warning',
+						icon: false,
+						message: "没有装车时间!",
+						iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
+					})
+				} else if(this.formData.unLoadQty == null) {
+					this.$refs.uToast.show({
+						type: 'warning',
+						icon: false,
+						message: "没有卸车吨位!",
+						iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
+					})
+				} else if(this.formData.unLoadDate == null) {
+					this.$refs.uToast.show({
+						type: 'warning',
+						icon: false,
+						message: "没有卸车时间!",
+						iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
+					})
+				} else {
+					if (type == 'BX') {
+						this.submitShow = true
+					} else if (type == 'TJ') {
+						this.upAuditShow = true
+					}
+					
+				}
+				
+			},
 			// 保存内容
 			submit() {
 				if (this.status376 == 6) {
@@ -566,51 +605,116 @@
 					}
 
 					this.loading = true;
-					var list = [];
-					for (var item in this.itemsList) {
-						var amt = this.itemsList[item].amt;
-						if (amt != null) {
-							var items = this.itemsList[item];
-							list.push(items);
-						}
-					}
-					this.formData.itemsVoList = list;
+					// var list = [];
+					// for (var item in this.itemsList) {
+					// 	var amt = this.itemsList[item].amt;
+					// 	if (amt != null) {
+					// 		var items = this.itemsList[item];
+					// 		list.push(items);
+					// 	}
+					// }
+					
+					// for (let item of this.itemsList) {
+					// 	if (item == 0) {
+					// 		item.amt = null
+					// 	}
+					// }
+					// this.formData.itemsVoList = list;
+					this.formData.itemsVoList = this.itemsList;
 					insertLoadFeeItems(this.formData).then(res => {
 						this.submitShow = false;
-						this.loading = false;
 						if (res.code == 200) {
-							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
-							// 保存成功弹窗提示
-							this.$refs.uToast.show({
-								type: 'success',
-								message: "保存成功!",
-								iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
+							// 报销费用下拉选
+							getGasStations().then(res => {
+								// this.gasStationList = res.data
+								for (var item in res.data) {
+									var data = {
+										text: res.data[item].cname,
+										value: res.data[item].cname
+									};
+									this.gasStationList.push(data);
+								}
+								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;
+											}
+										}
+							
+										// 审核中
+										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.$refs.uToast.show({
+											type: 'success',
+											message: "保存成功!",
+											iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
+										})
+										this.loading = false;
+									})
+								})
 							})
+								
+							// this.getData();
+							// 保存成功弹窗提示
+							// this.$refs.uToast.show({
+							// 	type: 'success',
+							// 	message: "保存成功!",
+							// 	iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
+							// })
 						} else {
 							// 保存失败消息
 							this.$refs.uToast.show({
@@ -694,27 +798,105 @@
 						this.formData.gasstation3 = 0;
 					}
 					this.loading = true;
-					var list = [];
-					for (var item in this.itemsList) {
-						var amt = this.itemsList[item].amt;
-						if (amt != null) {
-							var items = this.itemsList[item];
-							list.push(items);
-						}
-					}
-					this.formData.itemsVoList = list;
+					// var list = [];
+					// for (var item in this.itemsList) {
+					// 	var amt = this.itemsList[item].amt;
+					// 	if (amt != null) {
+					// 		var items = this.itemsList[item];
+					// 		list.push(items);
+					// 	}
+					// }
+					this.formData.itemsVoList = this.itemsList;
 					submitAudit(this.formData).then(res => {
 						this.submitShow = false
-						this.loading = false;
 						this.upAuditShow = false;
 						if (res.msg == 'ok') {
-							
-							// 保存成功弹窗提示
-							this.$refs.uToast.show({
-								type: 'success',
-								message: "提交审核成功!",
-								iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
-							})
+								getGasStations().then(res => {
+									for (var item in res.data) {
+										var data = {
+											text: res.data[item].cname,
+											value: res.data[item].cname
+										};
+										this.gasStationList.push(data);
+									}
+									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;
+												}
+											}
+											// 审核中
+											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.$refs.uToast.show({
+												type: 'success',
+												message: "提交审核成功!",
+												iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
+											})
+											this.loading = false;
+										})
+									})
+								})
+							// this.getData();
+							// // 保存成功弹窗提示
+							// this.$refs.uToast.show({
+							// 	type: 'success',
+							// 	message: "提交审核成功!",
+							// 	iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
+							// })
 						} else {
 							// 保存失败消息
 							this.$refs.uToast.show({
@@ -730,11 +912,11 @@
 			// 审核
 			check(type) {
 				var data = {
-					orderNo : this.orderNo,
-					entityId : this.formData.entityId,
-					auditType : type
+					orderNo: this.orderNo,
+					entityId: this.formData.entityId,
+					auditType: type
 				}
-				
+
 				audit(data).then(res => {
 					if (res.msg == 'ok') {
 						this.getData();
@@ -743,7 +925,7 @@
 							this.auditTShow = false;
 						} else if (type == 'F') {
 							this.auditFShow = false;
-						} 
+						}
 						// 保存成功弹窗提示
 						this.$refs.uToast.show({
 							type: 'success',
@@ -1103,6 +1285,7 @@
 
 <style lang="scss">
 	@import url("/font/iconfont.css");
+
 	// 修改布局方向为纵向布局
 	.vertical-layout {
 		display: flex;
@@ -1151,7 +1334,7 @@
 			// display: table-cell;
 			display: flex;
 			align-items: flex-end;
-			
+
 			justify-content: space-between;
 			box-sizing: border-box;
 

+ 170 - 65
pages/particulars/index.vue

@@ -14,7 +14,8 @@
 				<view>
 					<text>{{formData.loadAddr}}</text>
 				</view>
-				<span class="icon iconfont" style="font-size: 100rpx; color: #fcbd71; height: 80rpx;">&#xe6fb;</span>
+				<!-- <span class="icon iconfont" style="font-size: 100rpx; color: #fcbd71; height: 80rpx;">&#xe6fb;</span> -->
+				<view><text>【到】</text></view>
 				<view>
 					<text>{{formData.unLoadAddr}}</text>
 				</view>
@@ -49,27 +50,30 @@
 		<view v-if="isTabs == '装卸确认'">
 			<view class="box-box">
 				<view class="box-two">
-					<text class="key">装车吨位<text style="color: red;">*</text></text>
+					<!-- <text style="color: red;">*</text> -->
+					<text class="key">装车吨位</text>
 					<input class="value-two" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
 						@input="checkLoadQty" v-model="formData.loadQty" />
 				</view>
 
 				<view class="box-two">
-					<text class="key">装车时间<text style="color: red;">*</text></text>
+					<text class="key">装车时间</text>
 					<uni-datetime-picker class="value-two" :start="startDate" :end="new Date + ''" :disabled="disabled"
-						v-model="formData.loadDateString" :border="false" />
+						:hide-second="true" v-model="formData.loadDateString" :border="false" />
+						<view class="today" @click="today('ZC')"><text>今天</text></view>
 				</view>
 
 				<view class="box-two">
-					<text class="key">卸车吨位<text style="color: red;">*</text></text>
+					<text class="key">卸车吨位</text>
 					<input class="value-two" selection-start="0" selection-end="9999" :disabled="disabled" type="digit"
 						@input="checkUnLoadQty" v-model="formData.unLoadQty" />
 				</view>
 
 				<view class="box-two">
-					<text class="key">卸车时间<text style="color: red;">*</text></text>
+					<text class="key">卸车时间</text>
 					<uni-datetime-picker class="value-two" :start="formData.loadDateString" :end="new Date + ''"
-						:disabled="disabled" :clear-icon="false" v-model="formData.unLoadDateString" :border="false" />
+						:hide-second="true" :disabled="disabled" v-model="formData.unLoadDateString" :border="false" />
+						<view class="today" @click="today('XC')"><text>今天</text></view>
 				</view>
 
 				<!-- <view class="box">
@@ -131,7 +135,8 @@
 				</view>
 				<u-upload :fileList="fileList1" accept="image" :sizeType="['compressed']" capture="camera"
 					@afterRead="imgUploading" @delete="deletePic" name="1" multiple :previewFullImage="true"
-					:disabled="disabled"></u-upload>
+					></u-upload>
+					<!-- :disabled="disabled" -->
 			</view>
 
 			<view class="box-box">
@@ -144,6 +149,7 @@
 
 
 			<view class="attention">
+				<view style="color: red;"><text>注意事项:</text></view>
 				<!-- <text class="text-grey1">请查看</text>
 				<text @click="attention()" class="text-blue">注意事项</text> -->
 				{{this.formData.remarks}}
@@ -337,9 +343,12 @@
 					}
 
 					for (let role of res.data.roleList) {
-						if (role.roleKey == 'DZ') {
+						if (role == 'DZ') {
 							this.disabled = true;
 						}
+						if (role == 'JSY') {
+							this.disabled = false;
+						}
 					}
 
 					// 审核中
@@ -369,46 +378,59 @@
 			change(item) {
 				this.isTabs = item.name;
 			},
+			// 当天日期
+			today(type) {
+				if (this.disabled) {
+					return
+				}
+				if (type == "ZC") {
+					this.formData.loadDateString = Date.parse(new Date());
+				} else if (type == "XC") {
+					this.formData.unLoadDateString = Date.parse(new Date());
+				}
+			},
 			// 数据校验
 			dataVerify() {
-				if (this.formData.loadQty == '' || 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.formData.loadDateString == '' || 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.formData.unLoadQty == '' || 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.formData.unLoadDateString == '' || this.formData.unLoadDateString == null) {
-					this.$refs.uToast.show({
-						type: 'warning',
-						icon: false,
-						message: "请选择卸车时间!",
-						iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
-					})
-				} else if (this.fileList1.length < 2) {
-					return this.$refs.uToast.show({
-						type: 'warning',
-						icon: false,
-						message: "图片最少两张!",
-						iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
-					})
-				} else {
+				// if (this.formData.loadQty == '' || 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.formData.loadDateString == '' || 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.formData.unLoadQty == '' || 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.formData.unLoadDateString == '' || this.formData.unLoadDateString == null) {
+				// 	this.$refs.uToast.show({
+				// 		type: 'warning',
+				// 		icon: false,
+				// 		message: "请选择卸车时间!",
+				// 		iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
+				// 	})
+				// } 
+				// else if (this.fileList1.length < 2) {
+				// 	return this.$refs.uToast.show({
+				// 		type: 'warning',
+				// 		icon: false,
+				// 		message: "图片最少两张!",
+				// 		iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/warning.png'
+				// 	})
+				// }
+				 // else {
 					return 'ok';
-				}
+				// }
 			},
 			// 提交里程点击事件
 			disabledClick() {
@@ -427,16 +449,25 @@
 			// 保存订单
 			setOrderBillsPlansByid(id) {
 
-				this.formData.loadQty = this.formData.loadQty == null || this.formData.loadQty == '' ? 0 : this
-					.formData.loadQty
-				this.formData.unLoadQty = this.formData.unLoadQty == null || this.formData.unLoadQty == '' ? 0 :
-					this.formData.unLoadQty
-				this.formData.odometerstart = this.formData.odometerstart == null || this.formData.odometerstart ==
-					'' ? 0 : this.formData.odometerstart
-				this.formData.odometerend = this.formData.odometerend == null || this.formData.odometerend == '' ?
-					0 : this.formData.odometerend
-				this.formData.loadmile = this.formData.loadmile == null || this.formData.loadmile == '' ? 0 : this
-					.formData.loadmile
+				this.formData.loadQty = this.formData.loadQty == null || this.formData.loadQty == '' ? 0 : this.formData.loadQty
+				this.formData.unLoadQty = this.formData.unLoadQty == null || this.formData.unLoadQty == '' ? 0 : this.formData.unLoadQty
+				
+				if(this.formData.loadDateString != null && this.formData.loadDateString != '') {
+					this.formData.loadDateString = this.dateToStringS("yyyy-MM-dd HH:mm:ss", new Date(this.formData.loadDateString))
+				} else {
+					this.formData.loadDateString = null
+				}
+				// 
+				if(this.formData.unLoadDateString != null && this.formData.unLoadDateString != '') {
+					this.formData.unLoadDateString = this.dateToStringS("yyyy-MM-dd HH:mm:ss", new Date(this.formData.unLoadDateString))
+				} else {
+					this.formData.unLoadDateString = null
+				}
+			
+				
+				this.formData.odometerstart = this.formData.odometerstart == null || this.formData.odometerstart == '' ? 0 : this.formData.odometerstart
+				this.formData.odometerend = this.formData.odometerend == null || this.formData.odometerend == '' ? 0 : this.formData.odometerend
+				this.formData.loadmile = this.formData.loadmile == null || this.formData.loadmile == '' ? 0 : this.formData.loadmile
 
 
 
@@ -447,15 +478,58 @@
 					this.formData.ifDetour = "F"
 				}
 
-				putOrderBillsPlansByid(this.formData).then(res => {
-					this.submitShow = false
-					if (res.code == 200) {
-						// 保存成功弹窗提示
-						this.$refs.uToast.show({
-							type: 'success',
-							message: "保存成功!",
-							iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
+				putOrderBillsPlansByid(this.formData).then(ress => {
+					if (ress.code == 200) {
+						getOrderBillsPlansByid(this.orderNo).then(res => {
+						
+							res.data.loadQty == 0 ? res.data.loadQty = null : res.data.loadQty
+							res.data.unLoadQty == 0 ? res.data.unLoadQty = null : res.data.unLoadQty
+							res.data.odometerstart == 0 ? res.data.odometerstart = null : res.data.odometerstart
+							res.data.odometerend == 0 ? res.data.odometerend = null : res.data.odometerend
+							res.data.loadmile == 0 ? res.data.loadmile = null : res.data.loadmile
+						
+							if (res.data.ifDetour == "T") {
+								this.detour.push("行程绕路")
+							}
+						
+							for (let role of res.data.roleList) {
+								if (role.roleKey == 'DZ') {
+									this.disabled = true;
+								}
+							}
+						
+							// 审核中
+							if (res.data.ifLoaded == "T" &&
+								res.data.ifUnLoaded == "T" &&
+								res.data.ifStarted == "S") {
+								this.disabled = true;
+							}
+							// 审核完成
+							if (res.data.ifLoaded == "T" &&
+								res.data.ifUnLoaded == "T" &&
+								res.data.ifStarted == "A") {
+								this.disabled = true;
+							}
+						
+							this.formData = res.data;
+							this.fileList1 = res.data.fileList1;
+							this.loading = false;
+						
+							if (this.status317 == 6) {
+								this.disabled = true;
+							}
+							this.startDate = this.GetTime(60)
+							
+							this.submitShow = false
+							
+							// 保存成功弹窗提示
+							this.$refs.uToast.show({
+								type: 'success',
+								message: "保存成功!",
+								iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
+							})
 						})
+						
 					} else {
 						// 保存失败消息
 						this.$refs.uToast.show({
@@ -573,7 +647,8 @@
 							uni.getLocation({
 								type: 'wgs84',
 								isHighAccuracy: true,
-								success: function(res) {
+								geocode: true,
+								success: (res) => {
 									longitude = res.longitude
 									latitude = res.latitude
 									console.log('当前位置的经度:' + res.longitude);
@@ -621,6 +696,24 @@
 							k]) : (("00" + o[k]).substr(("" + o[k]).length)));
 				return fmt;
 			},
+			dateToStringS(fmt, date) {
+				var o = {
+					"M+": date.getMonth() + 1, //月份 
+					"d+": date.getDate(), //日 
+					"H+": date.getHours(), //小时 
+					"m+": date.getMinutes(), //分 
+					"s+": date.getSeconds(), //秒 
+					"q+": Math.floor((date.getMonth() + 3) / 3), //季度 
+					"S": date.getMilliseconds() //毫秒 
+				};
+				if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1
+					.length));
+				for (var k in o)
+					if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ?
+						(o[
+							k]) : (("00" + o[k]).substr(("" + o[k]).length)));
+				return fmt;
+			},
 			uploadFilePromise(url) {
 
 				insertTmsAttachMngs(this.formData).then(res => {
@@ -695,6 +788,18 @@
 
 <style lang="scss">
 	@import url("/font/iconfont.css");
+	
+	// 当天按钮样式
+	.today {
+		width: 80rpx;
+		height: 60rpx;
+		background-color: #3c9cff;
+		color: #fff;
+		border-radius: 80rpx;
+		
+		text-align: center;
+		line-height: 60rpx;
+	}
 
 	// 修改布局方向为纵向布局
 	.vertical-layout {