|
|
@@ -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);
|