文件
mashangyoujiu/Public/Retail/js/order/dada-order.js

218 行
11 KiB
JavaScript
可执行文件

/**
* 查看uu订单
*/
Vue.component('manager-dada-order', {
template: `<div>
<el-form :inline="true" size="small">
<el-form-item>
<date-picker-range :date-time.sync="searchForm.time"></date-picker-range>
</el-form-item>
<el-form-item>
<el-input placeholder="门店订单号" style="width: 200px"
v-model="searchForm.order_id"
@keydown.enter.exact.native.prevent="searchData"
clearable></el-input>
</el-form-item>
<el-form-item v-if="userType==1">
<select-store :store-id.sync="searchForm.store_id"
:show-status="true"
@change="searchData"></select-store>
</el-form-item>
<el-form-item>
<el-select v-model="searchForm.status" clearable
@change="searchData"
placeholder="订单状态" style="width: 200px;">
<el-option label="未完成订单" value="1"></el-option>
<el-option label="完成订单" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-select v-model="searchForm.order_type" clearable
@change="searchData"
placeholder="订单类型" style="width: 200px;">
<el-option label="商城订单" value="1"></el-option>
<el-option label="拼团订单" value="2"></el-option>
<el-option label="秒杀订单" value="3"></el-option>
<el-option label="预售订单" value="4"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="searchData">查询</el-button>
<el-button v-if="operate.export" @click="exportExcel">导出</el-button>
</el-form-item>
</el-form>
<div class="table-top-card-box">
<div class="table-top-card">
<div class="table-top-card-header">订单总数</div>
<div class="table-top-card-body">{{ sumData.order_count }}</div>
</div>
<div class="table-top-card">
<div class="table-top-card-header">完成订单总数</div>
<div class="table-top-card-body">{{ sumData.complete }}</div>
</div>
<div class="table-top-card">
<div class="table-top-card-header">使用总费用</div>
<div class="table-top-card-body">{{ sumData.cost_total }}</div>
</div>
<div class="table-top-card">
<div class="table-top-card-header">违约金</div>
<div class="table-top-card-body">{{ sumData.default_total }}</div>
</div>
</div>
<div>
<el-table :data="orderList" border size="small" :header-cell-style="{background:'#F5F7FA',color:'#606266'}">
<el-table-column align="center" type="index" label="序号" width="50" fixed="left"></el-table-column>
<el-table-column align="center" prop="order_no" label="门店订单号" min-width="146px" fixed="left" :show-overflow-tooltip="true"></el-table-column>
<el-table-column align="center" prop="client_id" label="达达订单号" min-width="140px" fixed="left" :show-overflow-tooltip="true"></el-table-column>
<el-table-column align="center" prop="store_name" label="门店名称" min-width="100px" :show-overflow-tooltip="true"></el-table-column>
<el-table-column align="center" prop="add_time" label="添加时间" min-width="140px" :show-overflow-tooltip="true"></el-table-column>
<el-table-column align="center" prop="dm_name" label="配送员姓名" min-width="100px" :show-overflow-tooltip="true"></el-table-column>
<el-table-column align="center" prop="dm_mobile" label="配送员手机号" min-width="120px" :show-overflow-tooltip="true"></el-table-column>
<el-table-column align="center" prop="distance" label="配送距离(米)" min-width="110px" :show-overflow-tooltip="true"></el-table-column>
<el-table-column align="center" prop="fee" label="实际配送费" min-width="100px" :show-overflow-tooltip="true"></el-table-column>
<el-table-column align="center" prop="deliver_fee" label="配送费" min-width="100px" :show-overflow-tooltip="true"></el-table-column>
<el-table-column align="center" prop="order_status" label="状态" min-width="80px" :show-overflow-tooltip="true"></el-table-column>
<el-table-column align="center" prop="cancel_reason" label="商家取消订单原因" min-width="140px" :show-overflow-tooltip="true"></el-table-column>
<el-table-column align="center" prop="deduct_fee" label="违约金" min-width="100px" :show-overflow-tooltip="true"></el-table-column>
<el-table-column align="center" prop="order_type" label="订单类型" min-width="80px" :show-overflow-tooltip="true"></el-table-column>
<el-table-column align="center" prop="update_time" label="操作时间" min-width="140px" :show-overflow-tooltip="true"></el-table-column>
</el-table>
<el-pagination
@size-change="sizeChange"
@current-change="currentChange"
layout="total, sizes, prev, pager, next, jumper"
:current-page="searchForm.page"
:pager-count="5"
:page-sizes="[10,20,30,40,50,60,70,80,90]"
:page-size="10"
:total="count">
</el-pagination>
</div>
</div>`,
props: {
'userType': {
type: Number,
default: 1,
},//1商户 2门店
},
data() {
return {
operate: {},
orderList: [],
count: 0,
searchForm: {
order_type: '',
order_id: '',
store_id: '',
status: '',
time: [],
page: 1,
limit: 10,
},
sumData: {
order_count: 0,
complete: 0,
cost_total: 0,
default_total: 0,
},
requestUrl: {
sumData: {
1: '/index.php/Retail/Delivery/getMerDeliveryTotal',
2: '/index.php/Retail/Delivery/getStoreDeliveryTotal',
},
dataList: {
1: '/index.php/Retail/Delivery/getMerDeliveryList',
2: '/index.php/Retail/Delivery/getStoreDeliveryList',
},
export: {
1: '/index.php/Retail/Delivery/merExport',
2: '/index.php/Retail/Delivery/storeExport',
}
}
};
},
methods: {
//获取统计数据
getSumData() {
this.sendRequest(this.requestUrl.sumData[this.userType], {
data: this.searchForm,
success: (res) => {
if (res.status == 1) {
this.sumData = {
order_count: res.data.order_count,
complete: res.data.complete,
cost_total: res.data.cost_total,
default_total: res.data.default_total,
};
} else {
this.$message.warning(res.message);
}
}
})
},
searchData() {
this.getSumData();
this.currentChange(1);
},
getOrderData() {
this.sendRequest(this.requestUrl.dataList[this.userType], {
data: this.searchForm,
success: (res) => {
if (res.status == 1) {
this.orderList = res.data.list;
this.count = res.data.count;
}
}
});
},
/**
* 分页
* @param int val 当前选择的页数
*/
currentChange(val) {
this.searchForm.page = val;
this.getOrderData();
},
/**
* 每页显示数量
* @param int val 数量
*/
sizeChange(val) {
this.searchForm.limit = val;
this.searchForm.page = 1;
this.getOrderData();
},
//导出
exportExcel() {
let order_id = this.searchForm.order_id;
let store_id = this.searchForm.store_id;
let status = this.searchForm.status;
let order_type = this.searchForm.order_type;
let time = this.searchForm.time;
if(!this.searchForm.time.length){
this.$confirm('不选择时间则默认导出当日记录', '确定导出数据吗?', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
window.location.href = this.requestUrl.export[this.userType] + "?order_id=" + order_id + "&store_id=" + store_id + "&status=" + status + "&order_type=" + order_type + "&time=" + time;
}).catch(() => {
})
}else{
window.location.href = this.requestUrl.export[this.userType] + "?order_id=" + order_id + "&store_id=" + store_id + "&status=" + status + "&order_type=" + order_type + "&time=" + time;
}
},
},
created() {
this.getSumData();
this.getOrderData();
this.checkOperateAuth({
export: this.requestUrl.export[this.userType]
}, (data) => {
this.operate = data;
})
}
});