|
|
@@ -14,6 +14,8 @@
|
|
|
<el-col>
|
|
|
|
|
|
<div class="flex" style="justify-content: flex-end;padding-bottom: 20px;">
|
|
|
+ <el-button style="margin-right: 20px;">物流费用:{{expenses || '0'}}</el-button>
|
|
|
+ <el-button style="margin-right: 20px;">退单申请数量:{{refund_count || '0'}}</el-button>
|
|
|
<el-select v-model="queryInfo.status" placeholder="请选择订单状态">
|
|
|
<el-option
|
|
|
v-for="item in options"
|
|
|
@@ -25,7 +27,7 @@
|
|
|
<el-button>重新导入</el-button>
|
|
|
<input type="file" ref="fileInputt" @change="readTxtFile('fileInputt')" class="dr-int" />
|
|
|
</div>
|
|
|
- <el-button type="primary" @click="oneWork(list)" :loading="yjloading">一键处理订单</el-button>
|
|
|
+ <el-button type="primary" @click="goyj(list)" :loading="yjloading">一键处理订单</el-button>
|
|
|
</div>
|
|
|
</el-col>
|
|
|
<!-- <el-col :span="8">
|
|
|
@@ -150,7 +152,10 @@
|
|
|
</el-timeline-item>
|
|
|
</el-timeline>
|
|
|
</el-dialog>
|
|
|
- <div class="mb" v-if="yjloading"></div>
|
|
|
+ <div class="mb" v-if="yjloading && auth">
|
|
|
+ <i class="el-icon-loading mask-loading"></i>
|
|
|
+ <el-button @click="auth = false" style="margin-top: 20px;" type="primary">停止一键处理</el-button>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -168,7 +173,8 @@
|
|
|
} from '@/request/agent.js'
|
|
|
import {
|
|
|
getOrderList,
|
|
|
- batchOrder
|
|
|
+ batchOrder,
|
|
|
+ getUserInfo
|
|
|
} from '@/request/user.js'
|
|
|
import {
|
|
|
showTime
|
|
|
@@ -180,6 +186,9 @@
|
|
|
name: 'Order',
|
|
|
data() {
|
|
|
return {
|
|
|
+ refund_count: 0,
|
|
|
+ expenses: 0,
|
|
|
+ auth:false,
|
|
|
options: [{
|
|
|
value: -1,
|
|
|
label: '全部'
|
|
|
@@ -188,7 +197,7 @@
|
|
|
label: '待发货',
|
|
|
}, {
|
|
|
value: 2,
|
|
|
- label: '待收货'
|
|
|
+ label: '已发货'
|
|
|
}, {
|
|
|
value: 3,
|
|
|
label: '已收货'
|
|
|
@@ -239,10 +248,10 @@
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
-
|
|
|
+ this.getUserInfo()
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapState(['orderToken']),
|
|
|
+ ...mapState(['orderToken','userInfo']),
|
|
|
showStatus() {
|
|
|
return this.queryInfo.status
|
|
|
}
|
|
|
@@ -275,7 +284,7 @@
|
|
|
str = '待发货'
|
|
|
break;
|
|
|
case 2:
|
|
|
- str = '待收货'
|
|
|
+ str = '已发货'
|
|
|
break;
|
|
|
case 3:
|
|
|
str = '已收货'
|
|
|
@@ -300,7 +309,12 @@
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- ...mapMutations(['setOrderToken']),
|
|
|
+ ...mapMutations(['setOrderToken','setUserInfo']),
|
|
|
+ getUserInfo() {
|
|
|
+ getUserInfo().then(res => {
|
|
|
+ this.setUserInfo(res.data)
|
|
|
+ })
|
|
|
+ },
|
|
|
showTime,
|
|
|
showBtn(time) {
|
|
|
return this.newTime >= time * 1000
|
|
|
@@ -383,6 +397,17 @@
|
|
|
item.loaded = true
|
|
|
// this.getList()
|
|
|
})
|
|
|
+ },
|
|
|
+ goyj(arr,i = 0) {
|
|
|
+ this.auth = true
|
|
|
+ try{
|
|
|
+ this.oneWork(arr, i)
|
|
|
+ }catch(e){
|
|
|
+ //TODO handle the exception
|
|
|
+ this.auth = false
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
oneWork(arr, i = 0) {
|
|
|
// batchOrder({
|
|
|
@@ -393,6 +418,9 @@
|
|
|
// })
|
|
|
console.log('ddd');
|
|
|
let that = this
|
|
|
+ if(!this.auth) {
|
|
|
+ return
|
|
|
+ }
|
|
|
that.yjloading = true
|
|
|
if (i < arr.length) {
|
|
|
if(arr[i].lasttime*1000 > this.today) {
|
|
|
@@ -412,6 +440,7 @@
|
|
|
arr[i].tag = res.msg
|
|
|
arr[i].loading = false
|
|
|
arr[i].loaded = true
|
|
|
+ that.yjloading = false
|
|
|
that.oneWork(arr, ++i)
|
|
|
}).catch(err => {
|
|
|
console.log(i);
|
|
|
@@ -425,6 +454,7 @@
|
|
|
}
|
|
|
} else {
|
|
|
that.yjloading = false
|
|
|
+ this.auth = false
|
|
|
console.log(that.num);
|
|
|
if(that.num != that.list.length) {
|
|
|
that.num = 0
|
|
|
@@ -473,6 +503,8 @@
|
|
|
that.dataloading = true
|
|
|
getOrderList(that.queryInfo).then(res => {
|
|
|
that.total = res.data.count
|
|
|
+ that.expenses = res.data.expenses
|
|
|
+ that.refund_count = res.data.refund_count
|
|
|
that.list = res.data.data.map(item => {
|
|
|
item.loading = false
|
|
|
item.loaded = false
|
|
|
@@ -480,7 +512,8 @@
|
|
|
})
|
|
|
that.dataloading = false
|
|
|
if (type == 'yjcl') {
|
|
|
- that.oneWork(this.list)
|
|
|
+ // that.oneWork(this.list)
|
|
|
+ that.goyj(this.list)
|
|
|
}
|
|
|
}).catch(err => {
|
|
|
that.dataloading = false
|
|
|
@@ -566,10 +599,17 @@
|
|
|
position: absolute;
|
|
|
top: 0;
|
|
|
left: 0;
|
|
|
- z-index: 999;
|
|
|
- margin: auto;
|
|
|
width: 100%;
|
|
|
height: 100%;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: center;
|
|
|
+
|
|
|
+ .mask-loading {
|
|
|
+ font-size: 100px;
|
|
|
+ color: #409eff;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/deep/ .el-table__cell {
|