415 行
15 KiB
HTML
可执行文件
415 行
15 KiB
HTML
可执行文件
<!DOCTYPE html>
|
|
<html>
|
|
<!--[1.4.13]-->
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
|
|
<link rel="stylesheet" href="__PUBLIC__/vue/element-ui.css">
|
|
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Retail/css/myscroll.css"/>
|
|
<link rel="stylesheet" href="__PUBLIC__/css/common-upload.css">
|
|
<link rel="stylesheet" href="__STATIC__/plugins/layui/css/layui.css">
|
|
<title>中奖记录</title>
|
|
</head>
|
|
<body>
|
|
<include file="./Application/Admin/View/Upload/index.html"/>
|
|
|
|
<!--<?php print_r( session('merchant_userinfo')); ?>-->
|
|
|
|
<div id="app">
|
|
<el-form :inline="true" size="small" class="demo-form-inline">
|
|
<el-form-item>
|
|
<el-input
|
|
placeholder="请输入昵称/手机号码"
|
|
v-model="searchData.title"
|
|
clearable>
|
|
</el-input>
|
|
</el-form-item>
|
|
|
|
<el-form-item>
|
|
<el-select
|
|
v-model="searchData.turntable_id"
|
|
filterable
|
|
clearable
|
|
remote
|
|
:remote-method="remoteMethod"
|
|
reserve-keyword
|
|
placeholder="请输入活动名称关键词"
|
|
:loading="loading_turntable_id">
|
|
<el-option
|
|
v-for="item in turntables"
|
|
:key="item.id"
|
|
:label="item.turntable_name"
|
|
:value="item.id">
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
|
|
<el-form-item>
|
|
<el-select v-model="searchData.grant_type" clearable placeholder="发放方式">
|
|
<el-option
|
|
v-for="item in grant_types"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value">
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
|
|
<el-form-item>
|
|
<el-select v-model="searchData.grant_status" clearable placeholder="发放状态">
|
|
<el-option
|
|
v-for="item in grant_statuss"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value">
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
|
|
<el-form-item>
|
|
<el-select v-model="searchData.prize_type" clearable placeholder="奖品类型">
|
|
<el-option
|
|
v-for="item in prize_types"
|
|
:key="item.value"
|
|
:label="item.label"
|
|
:value="item.value">
|
|
</el-option>
|
|
</el-select>
|
|
</el-form-item>
|
|
<br>
|
|
<el-form-item label="中奖日期">
|
|
<el-date-picker
|
|
v-model="searchData.dateRange"
|
|
type="daterange"
|
|
format="yyyy-MM-dd"
|
|
value-format="yyyy-MM-dd"
|
|
range-separator="至"
|
|
start-placeholder="开始日期"
|
|
end-placeholder="结束日期">
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
|
|
<el-form-item><el-button @click="search" v-loading="loading" type="primary">查询</el-button></el-form-item>
|
|
|
|
|
|
</el-form>
|
|
|
|
|
|
<el-table
|
|
:data="tableData"
|
|
v-loading="loading"
|
|
border
|
|
style="width: 100%">
|
|
<el-table-column prop="id" label="id"></el-table-column>
|
|
<el-table-column prop="id" label="活动名称"></el-table-column>
|
|
<el-table-column prop="order_num" label="订单号"></el-table-column>
|
|
<el-table-column prop="username" label="姓名"></el-table-column>
|
|
<el-table-column prop="id" label="昵称"></el-table-column>
|
|
<el-table-column prop="phone" label="手机号码"></el-table-column>
|
|
<el-table-column prop="add_time" label="中奖日期">
|
|
<template slot-scope="scope">{{scope.row.add_time|normalTime}}</template>
|
|
</el-table-column>
|
|
<el-table-column prop="prize_name" label="奖品"></el-table-column>
|
|
<el-table-column prop="delivery_type" label="发放方式">
|
|
<template slot-scope="scope">{{scope.row.delivery_type|grant_types}}</template>
|
|
</el-table-column>
|
|
<el-table-column prop="delivery_status" label="发放状态">
|
|
<template slot-scope="scope">{{scope.row.delivery_status|grant_statuss}}</template>
|
|
</el-table-column>
|
|
<el-table-column prop="receive_time" label="领取日期">
|
|
<template slot-scope="scope">{{scope.row.receive_time|normalTime}}</template>
|
|
</el-table-column>
|
|
<el-table-column prop="storetag" label="领取门店"></el-table-column>
|
|
<!--<el-table-column prop="receive_time" label="领取日期">-->
|
|
<!--<template slot-scope="scope">{{scope.row.receive_time|normalTime}}</template>-->
|
|
<!--</el-table-column>-->
|
|
<!--<el-table-column prop="receive_time" label="领取日期">-->
|
|
<!--<template slot-scope="scope">{{scope.row.receive_time|normalTime}}</template>-->
|
|
<!--</el-table-column>-->
|
|
<el-table-column label="操作">
|
|
<template slot-scope="scope">
|
|
<el-button v-if="scope.row.delivery_type==1 && scope.row.delivery_status==1" type="text" size="small" @click="sendGoods(scope.row)">快递发货</el-button>
|
|
<!--<el-button type="text" size="small" @click="wifi(scope.row)">wifi打印</el-button>-->
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
<br>
|
|
<div style="text-align: center" v-if="searchData.data_total>0">
|
|
<el-pagination
|
|
v-loading="loading"
|
|
background
|
|
@size-change="sizeChange"
|
|
@current-change="currentChange"
|
|
:current-page="searchData.page"
|
|
:page-sizes="[10, 50, 100, 300]"
|
|
:page-size="searchData.page_size"
|
|
layout="total, sizes, prev, pager, next, jumper"
|
|
:total="searchData.data_total">
|
|
>
|
|
</el-pagination>
|
|
</div>
|
|
|
|
<el-dialog
|
|
title="物流发货"
|
|
:visible.sync="expressDialogVisible"
|
|
>
|
|
|
|
<el-input placeholder="请输入物流单号" v-model="sendGood.cur_exp_num" class="input-with-select">
|
|
<el-select v-model="sendGood.cur_exp_index" slot="prepend" placeholder="请选择物流公司" style="width: 200px">
|
|
<el-option
|
|
v-for="(item,index) in express"
|
|
:key="index"
|
|
:label="item.kd_name"
|
|
:value="index">
|
|
</el-option>
|
|
</el-select>
|
|
</el-input>
|
|
<span slot="footer" class="dialog-footer">
|
|
<el-button @click="expressDialogVisible = false">取 消</el-button>
|
|
<el-button type="primary" @click="send">确 定</el-button>
|
|
</span>
|
|
</el-dialog>
|
|
|
|
</div>
|
|
</body>
|
|
<style>
|
|
|
|
</style>
|
|
<script type="text/javascript" src="__PUBLIC__/jquery/js/jquery-3.2.1.min.js"></script>
|
|
<script type="text/javascript" src="__PUBLIC__/layui/layui.all.js"></script>
|
|
<script type="text/javascript">
|
|
function getQueryVariable(variable)
|
|
{
|
|
var query = window.location.search.substring(1);
|
|
var vars = query.split("&");
|
|
for (var i=0;i<vars.length;i++) {
|
|
var pair = vars[i].split("=");
|
|
if(pair[0] == variable){return pair[1];}
|
|
}
|
|
return(false);
|
|
}
|
|
|
|
var filters={
|
|
normalTime : value => {
|
|
if(!value) return '';
|
|
let date = new Date(parseInt(value) * 1000);
|
|
let y = date.getFullYear();
|
|
let MM = date.getMonth() + 1;
|
|
MM = MM < 10 ? ('0' + MM) : MM;
|
|
let d = date.getDate();
|
|
d = d < 10 ? ('0' + d) : d;
|
|
let h = date.getHours();
|
|
h = h < 10 ? ('0' + h) : h;
|
|
let m = date.getMinutes();
|
|
m = m < 10 ? ('0' + m) : m;
|
|
let s = date.getSeconds();
|
|
s = s < 10 ? ('0' + s) : s;
|
|
return y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s;
|
|
},
|
|
grant_statuss:status=>{
|
|
return ['','待配送','已发放'][status];
|
|
},
|
|
grant_types:type=>{
|
|
return ['','配送','自提','自动发放'][type];
|
|
}
|
|
};
|
|
|
|
Object.keys(filters).forEach(key => {
|
|
Vue.filter(key, filters[key]);
|
|
});
|
|
|
|
var app = new Vue({
|
|
el: '#app',
|
|
data: function () {
|
|
return {
|
|
expressDialogVisible:false,
|
|
loading: false,
|
|
loading_turntable_id: false,
|
|
turntables:[],
|
|
grant_types:[
|
|
{value:1,label:'配送'},
|
|
{value:2,label:'自提'},
|
|
{value:3,label:'自动发放'},
|
|
],
|
|
grant_statuss:[
|
|
{value:1,label:'待配送'},
|
|
{value:2,label:'已发放'},
|
|
],
|
|
prize_types:[
|
|
{value:1,label:'实物'},
|
|
{value:2,label:'门店商品'},
|
|
{value:3,label:'积分'},
|
|
{value:4,label:'余额'},
|
|
{value:5,label:'谢谢惠顾'},
|
|
],
|
|
searchData:{
|
|
title:'',
|
|
turntable_id:'',
|
|
grant_status:'',
|
|
prize_type:'',
|
|
dateRange:['',''],
|
|
grant_type:'',
|
|
page_size:10,
|
|
page:1,
|
|
data_total: 1
|
|
},
|
|
tableData: [],
|
|
sendGood:{
|
|
cur_order_num:'', //中奖订单编号
|
|
cur_id:0, // 中奖订单id
|
|
cur_exp_index:'', //物流编码
|
|
cur_exp_num:'', //物流单号
|
|
},
|
|
express:[],
|
|
}
|
|
},
|
|
mounted:function(){
|
|
var id=getQueryVariable('id');
|
|
if (id) this.searchData.turntable_id=id;
|
|
this.search();
|
|
this.getExpress();
|
|
console.log(getQueryVariable('id'));
|
|
},
|
|
methods: {
|
|
search:function () {
|
|
this.loading=true;
|
|
var t=this;
|
|
if (this.searchData.dateRange.length===2){
|
|
this.searchData.start_time=this.searchData.dateRange[0];
|
|
this.searchData.end_time=this.searchData.dateRange[1];
|
|
} else{
|
|
this.searchData.start_time='';
|
|
this.searchData.end_time='';
|
|
}
|
|
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "/index.php/Retail/Turntable/winTurntableList",
|
|
data: this.searchData,
|
|
success: function(msg){
|
|
if (msg.code===0){
|
|
t.tableData=msg.data.data;
|
|
t.searchData.data_total= parseInt(msg.data.page_info.data_total);
|
|
} else {
|
|
t.$message({
|
|
showClose: true,
|
|
message: '查询失败:'+msg.msg,
|
|
type: 'error'
|
|
});
|
|
}
|
|
t.loading=false;
|
|
}
|
|
});
|
|
},
|
|
getExpress:function(){
|
|
let t=this;
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "{:U('Express/getExpress')}?flag=turnable",
|
|
data: {},
|
|
success: function (res) {
|
|
t.express=res.data;
|
|
console.log(res);
|
|
}
|
|
});
|
|
},
|
|
remoteMethod:function (key) {
|
|
if (key.length>=0) {
|
|
this.turntableList(key,res=>{
|
|
this.turntables=res.data.data;
|
|
console.log(res.data.data);
|
|
});
|
|
}
|
|
|
|
},
|
|
turntableList:function (key,seccess){
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "/index.php/Retail/Turntable/turntableList",
|
|
data: {
|
|
title:key,
|
|
status:'',
|
|
turntable_type:'',
|
|
start_time:'',
|
|
end_time:'',
|
|
page:1,
|
|
page_size:100,
|
|
},
|
|
success: seccess
|
|
});
|
|
},
|
|
currentChange:function (index) {
|
|
this.searchData.page=index;
|
|
this.search();
|
|
},
|
|
sizeChange:function (size) {
|
|
this.searchData.page_size=size;
|
|
this.searchData.page=1;
|
|
this.search();
|
|
},
|
|
|
|
sendGoods:function(row){
|
|
console.log(row);
|
|
if (this.sendGood.cur_order_num!=row.order_num) {
|
|
this.sendGood.cur_id=row.id;
|
|
this.sendGood.cur_order_num=row.order_num;
|
|
this.sendGood.cur_exp_num='';
|
|
}
|
|
this.cur_row=row;
|
|
this.expressDialogVisible=true;
|
|
},
|
|
send(){
|
|
if (!this.sendGood.cur_exp_index) {
|
|
this.$message({
|
|
showClose: true,
|
|
message: '请选择物流公司',
|
|
type: 'error'
|
|
});
|
|
return;
|
|
}
|
|
if (!this.sendGood.cur_exp_num) {
|
|
this.$message({
|
|
showClose: true,
|
|
message: '请输入物流单号',
|
|
type: 'error'
|
|
});
|
|
return;
|
|
}
|
|
|
|
var data={
|
|
id:this.sendGood.cur_id,
|
|
bill_id:this.sendGood.cur_order_num,
|
|
express_no:this.sendGood.cur_exp_num,
|
|
express_name:this.express[this.sendGood.cur_exp_index].kd_name,
|
|
express_code:this.express[this.sendGood.cur_exp_index].kd_com,
|
|
};
|
|
console.log(data);
|
|
|
|
$.ajax({
|
|
url: "{:U('Turntable/sendGoods')}",
|
|
type: "post",
|
|
data: data,
|
|
success: res=> {
|
|
if (res.code === 0) {
|
|
this.cur_row.delivery_status="2";
|
|
this.expressDialogVisible=false;
|
|
this.$message({
|
|
showClose: true,
|
|
message: '发货成功',
|
|
type: 'success'
|
|
});
|
|
}else{
|
|
this.$message({
|
|
showClose: true,
|
|
message: '发货失败',
|
|
type: 'error'
|
|
});
|
|
console.log(res);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
}
|
|
})
|
|
</script>
|
|
</html> |