lhl 2 роки тому
батько
коміт
ab8a72aaf2
3 змінених файлів з 131 додано та 108 видалено
  1. 126 103
      src/views/order/orderList.vue
  2. 3 3
      src/views/settle/settleOrder.vue
  3. 2 2
      src/views/user/jssq.vue

+ 126 - 103
src/views/order/orderList.vue

@@ -24,7 +24,8 @@
 							<el-button>重新导入</el-button>
 							<input type="file" ref="fileInputt" @change="readTxtFile('fileInputt')" class="dr-int" />
 						</div>
-						<el-button type="primary" @click="goyj(list)" :loading="yjloading">一键处理订单</el-button>
+						<el-button type="primary" @click="goyj(list)" :loading="yjloading"
+							v-if="list.length > 0">一键处理订单</el-button>
 					</div>
 				</el-col>
 				<!-- <el-col :span="8">
@@ -112,7 +113,7 @@
 								<el-button
 									v-if="scope.row.status ==4 && scope.row.auth_status == 1 && scope.row.refund_status == 0">运输中</el-button>
 								<el-button
-									v-if="scope.row.status ==4 && scope.row.auth_status == 1 && scope.row.refund_status == 1">已退</el-button>
+									v-if="scope.row.status ==4 && scope.row.auth_status == 1 && scope.row.refund_status == 1">已退</el-button>
 							</div>
 
 
@@ -205,7 +206,7 @@
 						label: '已收货'
 					}, {
 						value: 4,
-						label: '退中'
+						label: '退中'
 					}, {
 						value: 5,
 						label: '理赔中'
@@ -257,6 +258,13 @@
 			...mapState(['orderToken', 'userInfo']),
 			showStatus() {
 				return this.queryInfo.status
+			},
+			pageNum() {
+				if (this.total > 0) {
+					return Math.ceil(this.total / this.queryInfo.limit)
+				} else {
+					return 0
+				}
 			}
 		},
 		mounted() {
@@ -294,7 +302,7 @@
 							str = '已收货'
 							break;
 						case 4:
-							str = '退'
+							str = '退'
 							break;
 						case 5:
 							str = '赔付'
@@ -377,11 +385,11 @@
 								// console.log(res);
 								item.loading = false
 								item.tag = res.msg
-								if(item.status == 3 && res.data.status == 4) {
+								if (item.status == 3 && res.data.status == 4) {
 									item.auth_status = 0
 								}
 								item.status = res.data.status
-								console.log(item.status,'ddddddddddd');
+								console.log(item.status, 'ddddddddddd');
 								this.$msg.success('已提交,请等待审核处理')
 								this.loading = false
 							}).catch(err => {
@@ -405,18 +413,21 @@
 					item.tag = res.msg
 					item.lasttime = (that.today / 1000).toFixed(0)
 					// if(res.msg == '')
-					if(item.status == 3 && res.data.status == 4) {
+					if (item.status == 3 && res.data.status == 4) {
 						item.auth_status = 0
 					}
 					item.status = res.data.status
-					console.log(item.status,'ddddddddddd');
+					console.log(item.status, 'ddddddddddd');
 					item.loading = false
 					item.loaded = true
 					// this.getList()
 				})
 			},
 			goyj(arr, i = 0) {
+				let that = this
 				this.auth = true
+				//获取第一个处理的数据
+				console.log(that.pageNum);
 				try {
 					this.oneWork(arr, i)
 				} catch (e) {
@@ -424,113 +435,125 @@
 				}
 
 			},
-			chooseNest() {
-				let that = this;
-				that.order = that.list.find((item, index) => {
-					if (item.status < 5 && item.lasttime * 1000 < that.today) {
-						// if (item.status < 5 ) {
-						that.currentIndex = index
-						return item
-					} else {
-						++that.num
-					}
-				})
-				return that.order
-				// if (that.list.length == 0) {
-				// 	return that.$msg.error('当前没有订单需要处理')
-				// } else {
-
-				that.order = that.list.find((item, index) => {
-					if (item.status < 5 && item.lasttime * 1000 < that.today) {
-						// if (item.status < 5 ) {
-						that.currentIndex = index
-						return item
-					} else {
-						++that.num
-					}
-				})
-				// 	console.log(that.num,'that.num');
-				// 	if (!that.order) {
-				// 		that.$msg.error('当前页面订单处理完成,请勿重复处理')
-				// 	} else {
-
-				// 	}
-				// }
-			},
 			oneWork(arr, i = 0) {
-				// batchOrder({
-				// 	id: 0
-				// }).then(res => {
-				// 	this.$msg.success(res.msg)
-				// 	this.getList()
-				// })
-				// console.log('ddd');
 				let that = this
 				if (!this.auth) {
 					return
 				}
-				that.order = that.list.find((item, index) => {
-					if (item.status < 5 && item.lasttime * 1000 < that.today) {
-						// if (item.status < 5 ) {
-						that.currentIndex = index
-						return item
-					}
-				})
-				if (!that.order) {
-					return that.$msg.error('当前页面订单已处理完成,请勿重复处理')
-					
-				}
+				console.log(i,'i');
 				that.yjloading = true
-				if (i < arr.length) {
-
-					if (arr[i].status < 5 && arr[i].lasttime * 1000 < this.today) {
-						// if (arr[i].status < 5 ) {
-						if (arr[i].loaded) {
+				if (i <= arr.length - 1) {
+					arr[i].loading = true
+					setTimeout(() => {
+						batchOrder({
+							id: arr[i].id,
+							status: arr[i].status
+						}).then(res => {
+							arr[i].tag = res.msg
+							arr[i].loading = false
+							arr[i].loaded = true
+							if (arr[i].status == 3 && res.data.status == 4) {
+								arr[i].auth_status = 0
+							}
+							arr[i].status = res.data.status
+							that.yjloading = false
 							that.oneWork(arr, ++i)
-						} else {
-							arr[i].loading = true
-							setTimeout(() => {
-
-								batchOrder({
-									id: arr[i].id,
-									status: arr[i].status
-								}).then(res => {
-									arr[i].tag = res.msg
-									arr[i].loading = false
-									arr[i].loaded = true
-									if(arr[i].auth_status == 3 && res.data.status == 4) {
-										arr[i].auth_status = 0
-									}
-									arr[i].status = res.data.status
-									
-									that.yjloading = false
-									
-									that.oneWork(arr, ++i)
-								}).catch(err => {
-									console.log(i);
-									arr[i].loading = false
-									that.yjloading = false
-								})
-							}, 2000)
-						}
-					} else {
-						++this.num
-						console.log('daozhe');
-						that.oneWork(arr, ++i)
-					}
+						}).catch(err => {
+							console.log(i);
+							arr[i].loading = false
+							that.yjloading = false
+						})
+					}, 1500)
 				} else {
 					that.yjloading = false
-					this.auth = false
-					console.log(that.num);
-					if (that.num != that.list.length) {
-						that.num = 0
-						// console.log('yjcl');
-
-						this.getList('yjcl')
-					} else {
+					++that.num
+					if(that.num < that.pageNum) {
+						that.getList('yjcl')
+					}else {
+						
+						that.auth = false
 						that.$msg.success('一键处理完成')
 					}
+					
 				}
+
+
+				// batchOrder({
+				// 	id: 0
+				// }).then(res => {
+				// 	this.$msg.success(res.msg)
+				// 	this.getList()
+				// })
+				// console.log('ddd');
+
+				// let that = this
+				// if (!this.auth) {
+				// 	return
+				// }
+				// that.order = that.list.find((item, index) => {
+				// 	if (item.status < 5 && item.lasttime * 1000 < that.today) {
+				// 		// if (item.status < 5 ) {
+				// 		that.currentIndex = index
+				// 		return item
+				// 	}
+				// })
+				// if (!that.order) {
+				// 	return that.$msg.error('当前页面订单已处理完成,请勿重复处理')
+
+				// }
+				// that.yjloading = true
+				// if (i < arr.length) {
+
+				// 	// if (arr[i].status < 5 && arr[i].lasttime * 1000 < this.today) {
+				// 	if (arr[i].status < 5 ) {
+				// 		if (arr[i].loaded) {
+				// 			that.oneWork(arr, ++i)
+				// 		} else {
+				// 			arr[i].loading = true
+				// 			setTimeout(() => {
+
+				// 				batchOrder({
+				// 					id: arr[i].id,
+				// 					status: arr[i].status
+				// 				}).then(res => {
+				// 					arr[i].tag = res.msg
+				// 					arr[i].loading = false
+				// 					arr[i].loaded = true
+				// 					if(arr[i].auth_status == 3 && res.data.status == 4) {
+				// 						arr[i].auth_status = 0
+				// 					}
+				// 					arr[i].status = res.data.status
+
+				// 					that.yjloading = false
+
+				// 					that.oneWork(arr, ++i)
+				// 				}).catch(err => {
+				// 					console.log(i);
+				// 					arr[i].loading = false
+				// 					that.yjloading = false
+				// 				})
+				// 			}, 2000)
+				// 		}
+				// 	} else {
+				// 		++this.num
+				// 		console.log('daozhe');
+				// 		that.oneWork(arr, ++i)
+				// 	}
+				// } else {
+				// 	that.yjloading = false
+				// 	this.auth = false
+				// 	console.log(that.num);
+				// 	if (that.num != that.list.length) {
+				// 		that.num = 0
+				// 		// console.log('yjcl');
+
+				// 		this.getList('yjcl')
+				// 	} else {
+				// 		that.$msg.success('一键处理完成')
+				// 	}
+				// }
+
+				// this.getList('yjcl')
 			},
 			handleSelectionChange(val) {
 				console.log(val);

+ 3 - 3
src/views/settle/settleOrder.vue

@@ -31,7 +31,7 @@
 					<div style="padding-top: 20px;">
 						<el-button>订单总数:{{js.order_count || 0}}</el-button>
 						<el-button>结算订单数:{{js.settlement_count || 0}}</el-button>
-						<el-button>单数量:{{js.prohibit_refund || 0}}</el-button>
+						<el-button>单数量:{{js.prohibit_refund || 0}}</el-button>
 					</div>
 					<div style="padding-top: 20px;">
 						<el-button>赔付金额:{{js.compensation_sum || 0}}</el-button>
@@ -58,9 +58,9 @@
 					<div style="padding-top: 20px;">
 						<el-button>赔付金额14块的订单数:{{js.compensation_14_count || 0}}</el-button>
 					</div>
-					<div style="padding-top: 20px;">
+					<!-- <div style="padding-top: 20px;">
 						<el-button>赔付金额15块的订单数:{{js.compensation_15_count || 0}}</el-button>
-					</div>
+					</div> -->
 				</template>
 				
 				

+ 2 - 2
src/views/user/jssq.vue

@@ -14,8 +14,8 @@
 			<el-table :data="list" border style="width: 100%" max-height="620">
 				<el-table-column prop="id" label="id" width="50">
 				</el-table-column>
-				<el-table-column prop="expenses_sum" label="物流费" width="100">
-				</el-table-column>
+				<!-- <el-table-column prop="expenses_sum" label="物流费" width="100">
+				</el-table-column> -->
 				<el-table-column prop="commission_sum" label="手续费" width="100">
 				</el-table-column>
 				<el-table-column prop="compensation_sum" label="赔付金额" width="100">