-
+
@@ -50,12 +50,12 @@
已退款
-->
-
+
@@ -70,30 +70,27 @@
-
-
-
+
-
-
+
+
+
+
+
+
-
-
+
+
-
@@ -119,23 +116,8 @@
数据列表
-
-
+
@@ -177,17 +159,6 @@
{{ scope.row.payType | formatPayType }}
-
-
{{ scope.row.status | formatStatus }}
@@ -196,14 +167,6 @@
查看订单
-
-
-
-
@@ -225,10 +188,10 @@
} from '@/utils/index';
import {
fetchList,
- closeOrder,
- deleteOrder,
- orderData
- } from '@/api/order';
+ orderData,
+ getValueszd,
+ getValueqhd
+ } from '@/api/orderStatistic';
import {
formatDate
} from '@/utils/date';
@@ -236,11 +199,10 @@
const defaultListQuery = {
pageNum: 1,
pageSize: 10,
- status: 0,
- orderSn: null,
- receiverPhone: null,
- createTimeStart: null,
- createTimeEnd: null
+ status: 2,
+ valueszd: null,
+ valueqhd: null,
+ receiverPhone: null
};
export default {
@@ -250,145 +212,34 @@
},
data() {
return {
- delLoading: false,
- status: '0',
- orderType: '0',
- createTime: '',
- checkList: [],
- printChecked: false,
- batchHandle: '',
- batchExport: '',
- listContent: [],
+ rangeszd: [],
+ rangeqhd: [],
+ status: "2",
listQuery: Object.assign({}, defaultListQuery),
listLoading: true,
list: null,
total: null,
- operateType: null,
- multipleSelection: [],
- closeOrder: {
- dialogVisible: false,
- content: null,
- orderIds: []
- },
- statusOptions: [{
- label: '待付款',
- value: 12
- },
- {
- label: '待发货',
- value: 2
- },
- {
- label: '已发货',
- value: 3
- },
- {
- label: '已完成',
- value: 5
- },
- {
- label: '申请退款',
- value: 13
- },
- {
- label: '已退款',
- value: 14
- },
- {
- label: '已关闭',
- value: 15
- }
- ],
- orderTypeOptions: [{
- label: '正常订单',
- value: 1
- },
- {
- label: '秒杀订单',
- value: 6
- },
- {
- value: 7,
- label: '门店自取订单'
- },
- {
- label: ' 拼团订单',
- value: 2
- },
- {
- label: '团购订单',
- value: 3
- },
- {
- label: '砍价订单',
- value: 4
- },
- {
- label: '积分订单',
- value: 5
- }
- ],
- sourceTypeOptions: [{
- label: '小程序订单',
- value: 1
- },
- {
- label: 'APP订单',
- value: 4
- },
- {
- label: 'h5订单',
- value: 2
- },
- {
- label: 'pc订单',
- value: 3
- }
- ],
- operateOptions: [{
- label: '批量发货',
- value: 1
- },
- {
- label: '关闭订单',
- value: 2
- },
- {
- label: '删除订单',
- value: 3
- }
- ],
- logisticsDialogVisible: false,
-
- handleOptions: [{
- value: '',
- label: '批量操作'
- }, {
- value: '0',
- label: '批量打印'
- }],
- exportOptions: [{
- value: '',
- label: '批量导出'
- }, {
- value: '0',
- label: '导出全部'
- }, {
- value: '1',
- label: '导出选中'
- }],
caculateInfo: {
orderCount: 0,
orderPay: 0,
memberCount: 0
- }
+ },
+
};
},
created() {
this.$nextTick(() => {
this.getList();
- this.orderDatas(0);
+ this.orderDatas(2);
});
+
+ getValueszd().then(response => {
+ console.log("getValueszd>>>>>", response.data)
+ // this.list = response.data.records;
+ this.rangeszd = response.data
+
+ });
+
},
filters: {
formatCreateTime(time) {
@@ -406,34 +257,6 @@
return '积分兑换';
}
},
- formatSourceType(value) { //订单来源:0->PC订单;1->app订单
- if (value === 4) {
- return '小程序';
- } else if (value === 2) {
- return 'h5订单';
- } else if (value === 3) {
- return 'PC订单';
- } else if (value === 1) {
- return 'android订单';
- } else if (value === 5) {
- return 'ios订单';
- }
- },
- formatOrderType(value) {
- if (value === 2) {
- return '拼团订单';
- } else if (value === 3) {
- return '团购订单';
- } else if (value === 6) {
- return '秒杀订单';
- } else if (value === 1) {
- return '普通订单';
- } else if (value === 4) {
- return '砍价订单';
- } else if (value === 5) {
- return '积分订单';
- }
- },
formatStatus(value) { //订单状态:0->待付款;1->待发货;2->已发货;3->已完成;4->已关闭;5->无效订单
if (value === 12) {
return '待付款';
@@ -467,25 +290,52 @@
}
}
},
+
methods: {
- formatTime,
- checkPermission,
+ changeszd(res) {
+ console.log("res1111111>>>>", res)
+ this.listQuery.valueszd = res
+ this.rangeqhd = []
+ this.listQuery.valueqhd = ""
+
+ const data = this.rangeszd.filter((item) => item.name == res)
+ getValueqhd({
+ id: data[0].id
+ }).then(response => {
+ console.log("getValueqhd>>>", response.data)
+ this.rangeqhd = response.data
+ });
+
+ },
+ changeqhd(res) {
+ console.log("res22222222>>>>", res)
+ this.listQuery.valueqhd = res
+ },
+
handleOrder(tab, event) {
this.listQuery.status = tab.name;
+ this.status = tab.name;
this.getList();
this.orderDatas(tab.name);
console.log("tab", tab)
},
handleResetSearch() {
- this.listQuery = Object.assign({}, defaultListQuery);
+ this.listQuery = {
+ pageNum: 1,
+ pageSize: 10,
+ status:this.status,
+ valueszd: null,
+ valueqhd: null,
+ receiverPhone: null
+ };
},
handleSearchList() {
+
+ console.log("listQuery", this.listQuery)
+
this.listQuery.pageNum = 1;
this.getList();
},
- handleSelectionChange(val) {
- this.multipleSelection = val;
- },
handleViewOrder(index, row) {
this.$router.push({
path: '/oms/orderDetail',
@@ -494,75 +344,6 @@
}
});
},
- handleCloseOrder(index, row) {
- this.closeOrder.dialogVisible = true;
- this.closeOrder.orderIds = [row.id];
- },
- handleDeliveryOrder(index, row) {
- let listItem = this.covertOrder(row);
- console.log("listItem", listItem)
- this.$router.push({
- path: '/oms/deliverOrderList',
- query: {
- list: [listItem]
- }
- });
- },
- handleViewLogistics(index, row) {
- this.logisticsDialogVisible = true;
- },
- handleDeleteOrder(index, row) { //删除订单
- let id = [];
- id.push(row.id);
- this.deleteOrder(id);
- },
- handleBatchOperate() {
- if (this.multipleSelection == null || this.multipleSelection.length < 1) {
- this.$message({
- message: '请选择要操作的订单',
- type: 'warning',
- duration: 1000
- });
- return;
- }
- if (this.operateType === 1) {
- //批量发货
- let list = [];
- for (let i = 0; i < this.multipleSelection.length; i++) {
- if (this.multipleSelection[i].status === 1) {
- list.push(this.covertOrder(this.multipleSelection[i]));
- }
- }
- if (list.length === 0) {
- this.$message({
- message: '选中订单中没有可以发货的订单',
- type: 'warning',
- duration: 1000
- });
- return;
- }
- this.$router.push({
- path: '/oms/deliverOrderList',
- query: {
- list: list
- }
- });
- } else if (this.operateType === 2) {
- //关闭订单
- this.closeOrder.orderIds = [];
- for (let i = 0; i < this.multipleSelection.length; i++) {
- this.closeOrder.orderIds.push(this.multipleSelection[i].id);
- }
- this.closeOrder.dialogVisible = true;
- } else if (this.operateType === 3) {
- //删除订单
- let ids = [];
- for (let i = 0; i < this.multipleSelection.length; i++) {
- ids.push(this.multipleSelection[i].id);
- }
- this.deleteOrder(ids);
- }
- },
// 设置每页几条
handleSizeChange(val) {
this.listQuery.pageNum = 1;
@@ -574,37 +355,11 @@
this.listQuery.pageNum = val;
this.getList();
},
- handleCloseOrderConfirm() {
- if (this.closeOrder.content == null || this.closeOrder.content === '') {
- this.$message({
- message: '操作备注不能为空',
- type: 'warning',
- duration: 1000
- });
- return;
- }
- let params = new URLSearchParams();
- params.append('ids', this.closeOrder.orderIds);
- params.append('note', this.closeOrder.content);
- closeOrder(params).then(response => {
- this.closeOrder.orderIds = [];
- this.closeOrder.dialogVisible = false;
- this.getList();
- this.$message({
- message: '修改成功',
- type: 'success',
- duration: 1000
- });
- });
- },
getList() {
this.listLoading = true;
if (this.listQuery.status == 0)
this.listQuery.status = null
- if (this.listQuery.orderSn == "")
- this.listQuery.orderSn = null
-
if (this.listQuery.receiverPhone == "")
this.listQuery.receiverPhone = null
@@ -625,157 +380,6 @@
});
},
- deleteOrder(id) {
- this.$confirm('是否要进行该删除操作?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- let params = new URLSearchParams();
- params.append('id', id);
- deleteOrder(params).then(response => {
- this.$message({
- message: '删除成功!',
- type: 'success',
- duration: 1000
- });
- this.getList();
- });
- });
- },
- covertOrder(order) {
- let address = order.receiverRegion + order
- .receiverDetailAddress;
-
- let listItem = {
- orderId: order.id,
- orderSn: order.orderSn,
- receiverName: order.receiverName,
- receiverPhone: order.receiverPhone,
- receiverPostCode: order.receiverPostCode,
- address: address,
- deliveryCompany: null,
- deliverySn: null
- };
- return listItem;
- },
- beforeInit() {
- this.url = 'api/yxStoreOrder';
- const sort = 'id,desc';
- this.params = {
- page: this.page,
- size: this.size,
- sort: sort,
- orderStatus: this.status,
- orderType: this.orderType,
- addTime: this.createTime,
- listContent: this.listContent
- };
- const query = this.query;
- const type = query.type;
-
- return true;
- },
-
- getCaculateInfo() {},
- clearCaculateInfo() {
- this.caculateInfo = {
- orderCount: 0,
- orderPay: 0,
- memberCount: 0
- };
- },
-
- batchSelection(val) {
- let rows = this.data;
- if (val) {
- rows.forEach(row => {
- this.$refs.multipleTable.toggleRowSelection(row);
- });
- } else {
- this.$refs.multipleTable.clearSelection();
- }
- },
- handlePrintOption(val) {
- switch (val) {
- case '0':
- this.getPrintList();
- this.batchHandle = '';
- break;
- default:
- break;
- }
- },
- handleExportOption(val) {
- let list = this.checkList;
- this.page = 0;
- this.size = 10000;
- switch (val) {
- case '0':
- this.listContent = '';
- this.beforeInit();
- this.downloadMethod();
- break;
- case '1':
- if (list.length == 0) {
- this.$message({
- message: '请选择订单',
- type: 'warning'
- });
- } else {
- this.listContent = [];
- list.forEach(item => {
- this.listContent.push(item.orderId);
- });
- this.listContent = JSON.stringify(this.listContent);
- this.beforeInit();
- this.downloadMethod();
- }
- break;
- default:
- break;
- }
- this.batchExport = '';
- },
- downloadMethod() {
- this.beforeInit();
- this.downloadLoading = true;
- download(process.env.BASE_API + '/download', this.params)
- .then(result => {
- this.downloadFile(result, this.title + '数据', 'xlsx');
- this.downloadLoading = false;
- })
- .catch(() => {
- this.downloadLoading = false;
- });
- },
- // 下载文件
- downloadFile(obj, name, suffix) {
- const url = window.URL.createObjectURL(new Blob([obj]));
- const link = document.createElement('a');
- link.style.display = 'none';
- link.href = url;
- const fileName = parseTime(new Date()) + '-' + name + '.' + suffix;
- link.setAttribute('download', fileName);
- document.body.appendChild(link);
- link.click();
- document.body.removeChild(link);
- },
- getPrintList() {
- let list = this.checkList;
- if (list.length == 0) {
- this.$message({
- message: '请选择订单',
- type: 'warning'
- });
- } else {
- const _this = this.$refs.form5;
- _this.dialog = true;
- }
- },
- checkboxT(row, rowIndex) {
- return row.id !== 1;
- }
}
};