344 行
14 KiB
HTML
可执行文件
344 行
14 KiB
HTML
可执行文件
<!DOCTYPE html>
|
||
<html>
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
|
||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/vue/element-ui.2.8.2.css">
|
||
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/vue/js/vue2.5.16.js"></script>
|
||
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/vue/element-ui.2.8.2.js"></script>
|
||
<script type="text/javascript" charset="utf-8" src="__PUBLIC__/js/common.js"></script>
|
||
<title>码科配送</title>
|
||
<style>
|
||
[v-cloak] {
|
||
display: none;
|
||
}
|
||
|
||
.main {
|
||
width: 98%;
|
||
padding: 0 1%;
|
||
font-size: 20px;
|
||
}
|
||
|
||
/* 功能按钮 */
|
||
.main-functions {
|
||
display: flex;
|
||
padding: 15px 0;
|
||
}
|
||
|
||
.main-functions > div {
|
||
margin-right: 30px;
|
||
}
|
||
|
||
/* 表格 */
|
||
.main-forms {
|
||
margin-top: 10px;
|
||
}
|
||
|
||
.slots {
|
||
display: flex;
|
||
}
|
||
|
||
.slots > div:nth-child(1) {
|
||
margin-right: 10px;
|
||
}
|
||
|
||
/* 领取记录详情 */
|
||
.dialog-function {
|
||
display: flex;
|
||
line-height: 50px;
|
||
padding-bottom: 20px;
|
||
}
|
||
|
||
.dialog-function > div:nth-child(1) {
|
||
margin-right: 10px;
|
||
}
|
||
|
||
.dialog-function > div:nth-child(3) {
|
||
margin: 0 30px;
|
||
}
|
||
|
||
/* 领取详情分页 */
|
||
.dialog-paging {
|
||
margin: 20px 0 0 300px;
|
||
}
|
||
|
||
.seek-div {
|
||
margin: 10px;
|
||
}
|
||
|
||
.seek-div .el-input {
|
||
margin-bottom: 10px;
|
||
}
|
||
</style>
|
||
</head>
|
||
<body>
|
||
<div id="app" v-cloak>
|
||
<!-- 搜索 -->
|
||
<div class="seek-div" style="margin-bottom: 10px;">
|
||
<date-picker-range :date-time.sync="add_time"></date-picker-range>
|
||
|
||
<el-input v-model="order_number" clearable placeholder="门店订单号" size="small"
|
||
style="width:180px;"></el-input>
|
||
<el-select size="small" v-model="store_id" placeholder="所有门店">
|
||
<el-option
|
||
v-for="item in storeList"
|
||
:key="item.id"
|
||
:label="item.storetag"
|
||
:value="item.id">
|
||
</el-option>
|
||
</el-select>
|
||
<el-select v-model="status" placeholder="状态" size="small" clearable>
|
||
<el-option value="" label="所有状态"></el-option>
|
||
<el-option value="1" label="待接单"></el-option>
|
||
<el-option value="2" label="待取件"></el-option>
|
||
<el-option value="3" label="待收件"></el-option>
|
||
<el-option value="4" label="已完成"></el-option>
|
||
<el-option value="5" label="已取消"></el-option>
|
||
</el-select>
|
||
<if condition="$authArr['search'] eq true">
|
||
<el-button type="primary" @click="search" size="small">查询</el-button>
|
||
</if>
|
||
<if condition="$authArr['orderExport'] eq true">
|
||
<el-button type="primary" @click="orderExport()" size="small">导出</el-button>
|
||
</if>
|
||
<if condition="$authArr['MakeSet'] eq true">
|
||
<el-button type="primary" @click="MakeSet" size="small">码科对接</el-button>
|
||
</if>
|
||
<el-button type="primary" @click="updateToken" size="small">更新令牌</el-button>
|
||
<if condition="$authArr['seeToken'] eq true">
|
||
<el-button type="primary" @click="seeToken" size="small">查看令牌</el-button>
|
||
</if>
|
||
</div>
|
||
<!-- 列表 -->
|
||
<div style="max-width: calc(100vw - 20px);">
|
||
<el-table border :data="makeList" style="width: calc(100vw - 40px);margin: 0 auto"
|
||
size="mini"
|
||
max-height="500"
|
||
v-loading="loading"
|
||
element-loading-text="数据获取中"
|
||
element-loading-spinner="el-icon-loading">
|
||
<el-table-column prop="index" label="序号" show-overflow-tooltip width="50"></el-table-column>
|
||
<el-table-column prop="bill_order_number" label="门店订单" show-overflow-tooltip></el-table-column>
|
||
<el-table-column prop="order_number" label="码科订单" show-overflow-tooltip></el-table-column>
|
||
<el-table-column prop="storetag" label="门店名称" show-overflow-tooltip></el-table-column>
|
||
<el-table-column prop="rider_name" label="骑手姓名" show-overflow-tooltip></el-table-column>
|
||
<el-table-column prop="rider_mobile" label="骑手手机号" show-overflow-tooltip></el-table-column>
|
||
<el-table-column prop="distance" label="配送距离" show-overflow-tooltip></el-table-column>
|
||
<el-table-column prop="total_price" label="配送费" show-overflow-tooltip></el-table-column>
|
||
<el-table-column prop="accept_time" label="接单时间" show-overflow-tooltip></el-table-column>
|
||
<el-table-column prop="complete_time" label="送达时间" show-overflow-tooltip></el-table-column>
|
||
<el-table-column prop="status_name" label="状态" show-overflow-tooltip></el-table-column>
|
||
</el-table>
|
||
<el-pagination
|
||
@size-change="handleSizeChange"
|
||
@current-change="handleCurrentChange"
|
||
:current-page="currentPage"
|
||
:page-sizes="[10, 15, 20, 25, 30, 35, 40, 45, 50]"
|
||
:page-size="100"
|
||
layout="total, sizes, prev, pager, next, jumper"
|
||
:total="currentLen">
|
||
</el-pagination>
|
||
</div>
|
||
<!-- 弹出层(码科设置) -->
|
||
<el-dialog title="码科设置" :visible.sync="showSetting" width="60%" height="500" top="7vh"
|
||
:close-on-click-modal="false">
|
||
<el-form :model="make_set" :rules="ruleForm" ref="make_set" size="mini" label-width="140px">
|
||
<el-form-item label="是否开启:">
|
||
<el-switch
|
||
v-model="make_set.status"
|
||
active-value="1"
|
||
inactive-value="2">
|
||
</el-switch>
|
||
</el-form-item>
|
||
<el-form-item label="码科配送域名:" prop="domain_name">
|
||
<el-input v-model="make_set.domain_name_title" clearable style="width:90px;" disabled></el-input>
|
||
<el-input v-model="make_set.domain_name" clearable style="width:300px;"></el-input>
|
||
</el-form-item>
|
||
<el-form-item label="token:" prop="token">
|
||
<el-input v-model="make_set.token" clearable style="width:300px;"></el-input>
|
||
<span>配送端获取</span>
|
||
</el-form-item>
|
||
<el-form-item label="APPID" prop="app_id">
|
||
<el-input v-model="make_set.app_id" clearable style="width:300px;"></el-input>
|
||
<span>请输入配送端小程序的appid</span>
|
||
</el-form-item>
|
||
<el-form-item label="">
|
||
<el-button type="primary" size="small" @click="setUpdate('make_set')">保存</el-button>
|
||
</el-form-item>
|
||
</el-form>
|
||
</el-dialog>
|
||
</div>
|
||
</body>
|
||
<script type="text/javascript" src="__PUBLIC__/jquery/js/jquery-3.2.1.min.js"></script>
|
||
<script type="text/javascript">
|
||
var app = new Vue({
|
||
el: '#app',
|
||
data: function () {
|
||
return {
|
||
loading: true,
|
||
add_time: '',
|
||
order_number: '',
|
||
store_id: '',
|
||
status: '',
|
||
currentPage: 1,
|
||
currentLimit: 10,
|
||
currentLen: 0,
|
||
makeList: [],
|
||
storeList: {$storeList},
|
||
make_set: {
|
||
status: "{$info['status']}",
|
||
domain_name: "{$info['domain_name']}",
|
||
domain_name_title: 'https://',
|
||
token: "{$info['token']}",
|
||
app_id: "{$info['app_id']}"
|
||
},
|
||
ruleForm: {
|
||
domain_name: [{message: '请输入配送端域名', required: true, trigger: 'change'}],
|
||
token: [{message: '请输入配送端token', required: true, trigger: 'change'}],
|
||
app_id: [{message: '请输入配送端小程序的app_id', required: true, trigger: 'change'}],
|
||
},
|
||
showSetting: false,
|
||
}
|
||
},
|
||
methods: {
|
||
orderExport: function (page = 1, type = 1, directory_name = '') {
|
||
var that = this;
|
||
that.loading = true;
|
||
that.loadingText = '文件生成中,请耐心等待';
|
||
if (type == 1) {
|
||
$.ajax({
|
||
url: "{:U('export')}",
|
||
type: 'POST',
|
||
data: {
|
||
page: page,
|
||
limit: 500,
|
||
add_time: that.add_time,
|
||
order_number: that.order_number,
|
||
store_id: that.store_id,
|
||
status: that.status,
|
||
type: type,
|
||
directory_name: directory_name
|
||
},
|
||
success: function (res) {
|
||
that.loading = false;
|
||
if (res.status == 1) {
|
||
that.orderExport(++page, res.data.type, res.data.directory_name);
|
||
} else {
|
||
that.$confirm(res.msg, '提示', {
|
||
confirmButtonText: '确定',
|
||
type: 'warning'
|
||
}).then(() => {
|
||
|
||
}).catch(() => {
|
||
});
|
||
}
|
||
},
|
||
});
|
||
} else {
|
||
that.loading = false;
|
||
window.open(`{:U('exportFile')}?file_path=${directory_name}`);
|
||
}
|
||
},
|
||
|
||
search: function () {
|
||
this.getMakeList();
|
||
},
|
||
handleSizeChange: function (val) {
|
||
this.currentLimit = val;//切换每页数量
|
||
this.currentPage = 1;
|
||
this.getMakeList();
|
||
},
|
||
handleCurrentChange: function (val) {
|
||
this.currentPage = val;
|
||
this.getMakeList();//切换页数
|
||
},
|
||
getMakeList: function () {
|
||
var that = this;
|
||
$.ajax({
|
||
url: "{:U('makeOrder')}",
|
||
type: "post",
|
||
data: {
|
||
add_time: that.add_time,
|
||
order_number: that.order_number,
|
||
store_id: that.store_id,
|
||
status: that.status,
|
||
page: that.currentPage,
|
||
limit: that.currentLimit
|
||
},
|
||
success: function (res) {
|
||
that.loading = false;
|
||
that.makeList = res.data.list;
|
||
that.$nextTick(function () {
|
||
that.currentLen = parseInt(res.data.count);
|
||
})
|
||
}
|
||
})
|
||
},
|
||
MakeSet() {
|
||
this.showSetting = true;
|
||
},
|
||
//查看令牌
|
||
seeToken: function () {
|
||
var that = this;
|
||
$.ajax({
|
||
url: "{:U('seeToken')}",
|
||
type: "post",
|
||
data: {},
|
||
success: function (res) {
|
||
if (res.status == 1) {
|
||
that.$message.success(res.message);
|
||
} else {
|
||
that.$message.error(res.message);
|
||
}
|
||
}
|
||
})
|
||
},
|
||
//更新Token
|
||
updateToken() {
|
||
var that = this;
|
||
$.ajax({
|
||
url: "{:U('updateToken')}",
|
||
type: "post",
|
||
data: {},
|
||
success: function (res) {
|
||
if (res.status == 1) {
|
||
that.$message.success(res.message);
|
||
} else {
|
||
that.$message.error(res.message);
|
||
}
|
||
}
|
||
})
|
||
},
|
||
//配送设置
|
||
setUpdate: function (formName) {
|
||
var that = this;
|
||
that.$refs[formName].validate((valid) => {
|
||
if (valid) {
|
||
var make_set = that.make_set;
|
||
$.ajax({
|
||
url: "{:U('DockingSet')}",
|
||
type: "post",
|
||
data: {
|
||
make_set: make_set
|
||
},
|
||
success: function (res) {
|
||
if (res.status == 1) {
|
||
that.showSetting = false;
|
||
that.$message.success(res.message)
|
||
} else {
|
||
that.$message.error(res.message)
|
||
}
|
||
}
|
||
})
|
||
} else {
|
||
that.$message({message: '请完善必填项', type: 'error'});
|
||
}
|
||
});
|
||
}
|
||
},
|
||
created: function () {
|
||
this.getMakeList();
|
||
}
|
||
})
|
||
</script>
|
||
</html> |