|
@@ -28,7 +28,7 @@
|
|
<div class="ques-list" v-show="showQues">
|
|
<div class="ques-list" v-show="showQues">
|
|
<template v-for="item of questData">
|
|
<template v-for="item of questData">
|
|
<el-checkbox :label="item.id" v-if="item.isShow == 1" :key="item.value">{{ item.type
|
|
<el-checkbox :label="item.id" v-if="item.isShow == 1" :key="item.value">{{ item.type
|
|
- }}</el-checkbox>
|
|
|
|
|
|
+ }}</el-checkbox>
|
|
</template>
|
|
</template>
|
|
</div>
|
|
</div>
|
|
</el-collapse-transition>
|
|
</el-collapse-transition>
|
|
@@ -210,8 +210,9 @@ import ExpressDeliveryModal from "./components/expressDeliveryModal.vue";
|
|
import ImportExcelModel from "./components/importExcelModal.vue";
|
|
import ImportExcelModel from "./components/importExcelModal.vue";
|
|
import autoSplit from './components/autoSplit.vue'
|
|
import autoSplit from './components/autoSplit.vue'
|
|
import AutoAudit from './components/autoAudit.vue'
|
|
import AutoAudit from './components/autoAudit.vue'
|
|
-import { query, getProvince, smt, unSmt, purchaseQty, unCancel, resetQuestion, archive, merge, queryTimeOut, queryByBarCode, autoAudit } from '@/api/omsOrder'
|
|
|
|
|
|
+import { query, getProvince, smt, unSmt, purchaseQty, unCancel, resetQuestion, archive, merge, queryTimeOut, queryByBarCode, autoAudit, tipOrderTimeOut } from '@/api/omsOrder'
|
|
import { queryAll } from '@/api/question'
|
|
import { queryAll } from '@/api/question'
|
|
|
|
+import { IOrderTimeConfigItem, IOrderTimeResponse, queryOrderTimeConfig } from "@/api/orderConfig";
|
|
@Component({
|
|
@Component({
|
|
components: {
|
|
components: {
|
|
filterInput, OrderCheckbox, OrderRadio, filterDate, OrderTool, OrderTable, AddOrder, InputSelect, OrderProduct,
|
|
filterInput, OrderCheckbox, OrderRadio, filterDate, OrderTool, OrderTable, AddOrder, InputSelect, OrderProduct,
|
|
@@ -510,11 +511,16 @@ export default class Order extends Vue {
|
|
//省份
|
|
//省份
|
|
provinceOptions: Array<any> = []
|
|
provinceOptions: Array<any> = []
|
|
|
|
|
|
|
|
+ //订单超时配置
|
|
|
|
+ orderTimeConfigOptions: IOrderTimeConfigItem[] = []
|
|
|
|
+
|
|
mounted() {
|
|
mounted() {
|
|
this.getList();
|
|
this.getList();
|
|
this.getProvince();
|
|
this.getProvince();
|
|
this.getQuestionList();
|
|
this.getQuestionList();
|
|
this.getQuesttion();
|
|
this.getQuesttion();
|
|
|
|
+ this.getOrderTimeOutList();
|
|
|
|
+ this.tipOrderTimeOut();
|
|
}
|
|
}
|
|
//自动拆分
|
|
//自动拆分
|
|
autoSplit() {
|
|
autoSplit() {
|
|
@@ -1181,6 +1187,7 @@ export default class Order extends Vue {
|
|
this.page.pageNo = res.data.current;
|
|
this.page.pageNo = res.data.current;
|
|
this.page.total = res.data.total;
|
|
this.page.total = res.data.total;
|
|
this.load = false;
|
|
this.load = false;
|
|
|
|
+ this.handleTimeOutData();
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
}).catch((err: any) => {
|
|
}).catch((err: any) => {
|
|
this.load = false;
|
|
this.load = false;
|
|
@@ -1214,6 +1221,7 @@ export default class Order extends Vue {
|
|
this.page.pageNo = res.data.current;
|
|
this.page.pageNo = res.data.current;
|
|
this.page.total = res.data.total;
|
|
this.page.total = res.data.total;
|
|
this.load = false;
|
|
this.load = false;
|
|
|
|
+ this.handleTimeOutData();
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
}).catch((err: any) => {
|
|
}).catch((err: any) => {
|
|
this.load = false;
|
|
this.load = false;
|
|
@@ -1336,6 +1344,67 @@ export default class Order extends Vue {
|
|
(this.$refs.loadOrder as any).setShow(true);
|
|
(this.$refs.loadOrder as any).setShow(true);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ //获得订单超时设置
|
|
|
|
+ getOrderTimeOutList() {
|
|
|
|
+ this.load = true;
|
|
|
|
+ queryOrderTimeConfig({ pageSize: 20, pageNum: 1 }).then(res => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ this.orderTimeConfigOptions = res.rows
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //处理超时数据
|
|
|
|
+ handleTimeOutData() {
|
|
|
|
+ if (this.orderTimeConfigOptions.length == 0) return;
|
|
|
|
+ //遍历this.data
|
|
|
|
+ for (let i = 0; i < this.data.length; i++) {
|
|
|
|
+ if (!this.data[i].orderTimeout) continue;
|
|
|
|
+ //orderTimeout属性YYYY-MM-DD HH:mm:ss和当前时间比较,返回相差多少小时多少分钟,如:超时2小时23分
|
|
|
|
+ let time = this.data[i].orderTimeout.split(' ');
|
|
|
|
+ let date = time[0];
|
|
|
|
+ let time1 = time[1];
|
|
|
|
+ let date1 = date.split('-');
|
|
|
|
+ let time2 = time1.split(':');
|
|
|
|
+ let date2 = new Date();
|
|
|
|
+ date2.setFullYear(parseInt(date1[0]));
|
|
|
|
+ date2.setMonth(parseInt(date1[1]) - 1);
|
|
|
|
+ date2.setDate(parseInt(date1[2]));
|
|
|
|
+ date2.setHours(parseInt(time2[0]));
|
|
|
|
+ date2.setMinutes(parseInt(time2[1]));
|
|
|
|
+ date2.setSeconds(parseInt(time2[2]));
|
|
|
|
+ let diff = date2.getTime() - new Date().getTime();
|
|
|
|
+ let diffHour = diff / 1000 / 60 / 60;
|
|
|
|
+ if (diffHour < 0) {
|
|
|
|
+ //diffHour保留两位小数
|
|
|
|
+ let out = Math.abs(Math.round(diffHour * 100)) / 100;
|
|
|
|
+ //计算分钟,取整
|
|
|
|
+ let outMin = Math.abs(Math.round(diff / 1000 / 60)) % 60;
|
|
|
|
+ //out取整
|
|
|
|
+ out = Math.floor(out);
|
|
|
|
+
|
|
|
|
+ this.data[i].orderTimeout = "超时" + out + "小时" + outMin + "分";
|
|
|
|
+ if (out >= this.orderTimeConfigOptions[0].timeout!) {
|
|
|
|
+ this.data[i].isOrderTimeout = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ this.$forceUpdate();
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ //提示超时订单
|
|
|
|
+ tipOrderTimeOut() {
|
|
|
|
+ tipOrderTimeOut({ pageSize: 20, pageNum: 1 }).then(res => {
|
|
|
|
+ if (res.code === 200) {
|
|
|
|
+ if (res.total === 0) return;
|
|
|
|
+ this.$notify.error({
|
|
|
|
+ title: '提示',
|
|
|
|
+ message: '有' + res.total + '条订单处理超时,请及时查看!',
|
|
|
|
+ position: 'bottom-right'
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|
|
|
|
|