当月核销数量
This commit is contained in:
parent
8192dc3c8f
commit
115e5dae09
|
@ -145,6 +145,7 @@
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
:height="tableMaxHeight"
|
:height="tableMaxHeight"
|
||||||
@selection-change="handleSelectionChange"
|
@selection-change="handleSelectionChange"
|
||||||
|
@sort-change="orderSort"
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="55"> </el-table-column>
|
<el-table-column type="selection" width="55"> </el-table-column>
|
||||||
<el-table-column align="center" fixed width="200" label="操作">
|
<el-table-column align="center" fixed width="200" label="操作">
|
||||||
|
@ -272,7 +273,7 @@
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column align="center" label="状态" width="80" @sort-change="orderSort">
|
<el-table-column align="center" label="状态" width="80" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div
|
<div
|
||||||
style="padding: 1px 5px; border-radius: 3px"
|
style="padding: 1px 5px; border-radius: 3px"
|
||||||
|
@ -708,6 +709,10 @@ export default {
|
||||||
{ required: true, message: "请选择流转对象", trigger: "change" },
|
{ required: true, message: "请选择流转对象", trigger: "change" },
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
currentSort: {
|
||||||
|
prop: null, // 排序字段
|
||||||
|
order: null // 排序顺序
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
async created() {
|
async created() {
|
||||||
|
@ -775,8 +780,21 @@ export default {
|
||||||
});
|
});
|
||||||
await this.onOneClickRepair({ id: arr.join() });
|
await this.onOneClickRepair({ id: arr.join() });
|
||||||
},
|
},
|
||||||
orderSort(data) {
|
orderSort({ column, prop, order }) {
|
||||||
console.log(data);
|
if (column.order == 'ascending') {
|
||||||
|
this.listQuery.order_by = 'verify_date_asc'
|
||||||
|
}
|
||||||
|
if (column.order == 'descending') {
|
||||||
|
this.listQuery.order_by = 'verify_date_desc'
|
||||||
|
}
|
||||||
|
if (this.currentSort.prop !== prop) {
|
||||||
|
this.currentSort = { prop, order };
|
||||||
|
} else {
|
||||||
|
// 如果排序字段没变,则切换排序顺序
|
||||||
|
this.currentSort.order = this.currentSort.order === 'ascending' ? 'descending' : 'ascending';
|
||||||
|
}
|
||||||
|
console.log({ column, prop, order });
|
||||||
|
this.getList();
|
||||||
},
|
},
|
||||||
async getList($is_excel) {
|
async getList($is_excel) {
|
||||||
this.listQuery.excel = null;
|
this.listQuery.excel = null;
|
||||||
|
|
|
@ -98,7 +98,7 @@ class DataController extends base
|
||||||
// 当月核销率(按销售额)
|
// 当月核销率(按销售额)
|
||||||
$list[$k]['month_write_rate_price'] = 0;
|
$list[$k]['month_write_rate_price'] = 0;
|
||||||
// 当月核销数(按核销时间)
|
// 当月核销数(按核销时间)
|
||||||
$list[$k]['month_write_num'] = Orders::query()->where('verification_date', '>', date('Y-m-01'))->count();
|
$list[$k]['month_write_num'] = Orders::query()->where('admin_id', $v['admin_id'])->where('verification_date', '>', date('Y-m-01'))->count();
|
||||||
if (isset($currentList[$v['admin_id']])) {
|
if (isset($currentList[$v['admin_id']])) {
|
||||||
$currentAdmin = $currentList[$v['admin_id']];
|
$currentAdmin = $currentList[$v['admin_id']];
|
||||||
$list[$k]['month_write_rate'] = number_format(($currentAdmin['assets']/$currentAdmin['orders'])*100,2);
|
$list[$k]['month_write_rate'] = number_format(($currentAdmin['assets']/$currentAdmin['orders'])*100,2);
|
||||||
|
|
|
@ -305,6 +305,10 @@ class OrderController extends base
|
||||||
// $item->save();
|
// $item->save();
|
||||||
// return $this->success($item);
|
// return $this->success($item);
|
||||||
// }else{
|
// }else{
|
||||||
|
// 记录核销日期
|
||||||
|
if ($status == 2 && $item->status !=2) {
|
||||||
|
$item->verification_date = date('Y-m-d H:i:s');
|
||||||
|
}
|
||||||
//修改状态
|
//修改状态
|
||||||
$item->check_sn = $check_sn;
|
$item->check_sn = $check_sn;
|
||||||
$item->status = $status;
|
$item->status = $status;
|
||||||
|
@ -316,11 +320,6 @@ class OrderController extends base
|
||||||
$item->next_follow = strtotime($next_follow??'') * 1000;
|
$item->next_follow = strtotime($next_follow??'') * 1000;
|
||||||
$item->remark = $desc;
|
$item->remark = $desc;
|
||||||
|
|
||||||
// 记录核销日期
|
|
||||||
if ($status == 2 && $item->status !=2) {
|
|
||||||
$item->verification_date = date('Y-m-d H:i:s');
|
|
||||||
}
|
|
||||||
|
|
||||||
$back = $item->save();
|
$back = $item->save();
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
|
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
||||||
.pagination-container[data-v-28fdfbeb]{padding:32px 16px;position:fixed;bottom:0;left:0;width:100%;background:#fff;padding:40px 280px;-webkit-box-shadow:0 -2px 10px rgba(0,0,0,.1);box-shadow:0 -2px 10px rgba(0,0,0,.1);z-index:100}.pagination-container.hidden[data-v-28fdfbeb]{display:none}.app-container[data-v-4d8f2a06]{position:relative;padding-bottom:60px}.el-table[data-v-4d8f2a06],.filter-container[data-v-4d8f2a06]{padding-bottom:5px}
|
.pagination-container[data-v-28fdfbeb]{padding:32px 16px;position:fixed;bottom:0;left:0;width:100%;background:#fff;padding:40px 280px;-webkit-box-shadow:0 -2px 10px rgba(0,0,0,.1);box-shadow:0 -2px 10px rgba(0,0,0,.1);z-index:100}.pagination-container.hidden[data-v-28fdfbeb]{display:none}.app-container[data-v-491981b6]{position:relative;padding-bottom:60px}.el-table[data-v-491981b6],.filter-container[data-v-491981b6]{padding-bottom:5px}
|
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
||||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0de3a1"],{"856d":function(t,e,l){"use strict";l.r(e);var i=function(){var t=this,e=t.$createElement,l=t._self._c||e;return l("div",{staticClass:"app-container"},[l("div",{staticClass:"filter-container"},[l("el-date-picker",{staticClass:"filter-item",attrs:{type:"datetimerange","default-time":["00:00:00","23:59:59"],"range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期"},model:{value:t.listQuery.times,callback:function(e){t.$set(t.listQuery,"times",e)},expression:"listQuery.times"}}),l("el-select",{staticClass:"filter-item",attrs:{filterable:"",placeholder:"请选择"},model:{value:t.listQuery.os,callback:function(e){t.$set(t.listQuery,"os",e)},expression:"listQuery.os"}},[l("el-option",{key:"",attrs:{label:"请选择",value:""}}),t._l(t.oss,(function(t,e){return l("el-option",{key:e,attrs:{label:t,value:e}})}))],2),l("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search"},on:{click:t.getList}},[t._v(" 搜索 ")]),l("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search"},on:{click:function(e){return t.getList(1)}}},[t._v(" 导出 ")])],1),l("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{data:t.list,border:"",fit:"","highlight-current-row":""}},[l("el-table-column",{attrs:{align:"center",fixed:"",label:"姓名",width:"120",prop:"admin.name"}}),l("el-table-column",{attrs:{align:"center",label:"订单数",width:"120",prop:"orders"}}),l("el-table-column",{attrs:{align:"center",label:"订单总金额"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.total_price/100)+" ")]}}])}),l("el-table-column",{attrs:{align:"center",label:"核销数",width:"120",prop:"assets"}}),l("el-table-column",{attrs:{align:"center",label:"核销金额"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.asset_price/100)+" ")]}}])}),l("el-table-column",{attrs:{align:"center",label:"未付款订单",width:"120",prop:"nopays"}}),l("el-table-column",{attrs:{align:"center",label:"未付款金额"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.nopay_price/100)+" ")]}}])}),l("el-table-column",{attrs:{align:"center",label:"核销率(按订单)",width:"160"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.write_rate)+"% ")]}}])}),l("el-table-column",{attrs:{align:"center",width:"180",label:"核销率(按销售额)"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.write_rate_price)+"% ")]}}])}),l("el-table-column",{attrs:{align:"center",label:"当月核销率(按订单)",width:"160"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.month_write_rate)+"% ")]}}])}),l("el-table-column",{attrs:{align:"center",width:"180",label:"当月核销率(按销售额)"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.month_write_rate_price)+"% ")]}}])})],1)],1)},a=[],n=l("5530"),s=(l("a15b"),l("d81d"),l("b64b"),{name:"Datalist",data:function(){return{oss:null,list:[],listLoading:!0,listQuery:{}}},created:function(){this.getList()},methods:{getList:function(t){var e=this;if(1!=t)this.listQuery.excel=0,this.$axios.get("/admin/data/index",{params:this.listQuery}).then((function(t){e.list=t.data,e.oss=t.ext.oss,e.listLoading=!1}));else{if(this.listQuery.excel=1,!this.listQuery.times)return void this.$message({message:"请选择日期",type:"warning"});var l=this.listQuery.times[0]instanceof Date,i=Object(n["a"])(Object(n["a"])({},this.listQuery),{},{times:[l?this.listQuery.times[0].toISOString():"",l?this.listQuery.times[1].toISOString():""]});window.open("/admin/data/index?"+this.objectToQuery(i))}},objectToQuery:function(t){return Object.keys(t).map((function(e){var l=t[e];return void 0==l||null==l?"":encodeURIComponent(e)+"="+encodeURIComponent(l)})).join("&")}}}),r=s,o=l("2877"),c=Object(o["a"])(r,i,a,!1,null,null,null);e["default"]=c.exports}}]);
|
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d0de3a1"],{"856d":function(t,e,l){"use strict";l.r(e);var i=function(){var t=this,e=t.$createElement,l=t._self._c||e;return l("div",{staticClass:"app-container"},[l("div",{staticClass:"filter-container"},[l("el-date-picker",{staticClass:"filter-item",attrs:{type:"datetimerange","default-time":["00:00:00","23:59:59"],"range-separator":"至","start-placeholder":"开始日期","end-placeholder":"结束日期"},model:{value:t.listQuery.times,callback:function(e){t.$set(t.listQuery,"times",e)},expression:"listQuery.times"}}),l("el-select",{staticClass:"filter-item",attrs:{filterable:"",placeholder:"请选择"},model:{value:t.listQuery.os,callback:function(e){t.$set(t.listQuery,"os",e)},expression:"listQuery.os"}},[l("el-option",{key:"",attrs:{label:"请选择",value:""}}),t._l(t.oss,(function(t,e){return l("el-option",{key:e,attrs:{label:t,value:e}})}))],2),l("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search"},on:{click:t.getList}},[t._v(" 搜索 ")]),l("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search"},on:{click:function(e){return t.getList(1)}}},[t._v(" 导出 ")])],1),l("el-table",{directives:[{name:"loading",rawName:"v-loading",value:t.listLoading,expression:"listLoading"}],staticStyle:{width:"100%"},attrs:{data:t.list,border:"",fit:"","highlight-current-row":""}},[l("el-table-column",{attrs:{align:"center",fixed:"",label:"姓名",width:"120",prop:"admin.name"}}),l("el-table-column",{attrs:{align:"center",label:"订单数",width:"120",prop:"orders"}}),l("el-table-column",{attrs:{align:"center",label:"订单总金额"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.total_price/100)+" ")]}}])}),l("el-table-column",{attrs:{align:"center",label:"核销数",width:"120",prop:"assets"}}),l("el-table-column",{attrs:{align:"center",label:"核销金额"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.asset_price/100)+" ")]}}])}),l("el-table-column",{attrs:{align:"center",label:"未付款订单",width:"120",prop:"nopays"}}),l("el-table-column",{attrs:{align:"center",label:"未付款金额"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.nopay_price/100)+" ")]}}])}),l("el-table-column",{attrs:{align:"center",label:"核销率(按订单)",width:"160"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.write_rate)+"% ")]}}])}),l("el-table-column",{attrs:{align:"center",width:"180",label:"核销率(按销售额)"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.write_rate_price)+"% ")]}}])}),l("el-table-column",{attrs:{align:"center",label:"当月核销数量(按核销时间)",width:"160"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.month_write_num)+" ")]}}])}),l("el-table-column",{attrs:{align:"center",label:"当月核销率(按订单)",width:"160"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.month_write_rate)+"% ")]}}])}),l("el-table-column",{attrs:{align:"center",width:"180",label:"当月核销率(按销售额)"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(e.row.month_write_rate_price)+"% ")]}}])})],1)],1)},n=[],a=l("5530"),s=(l("a15b"),l("d81d"),l("b64b"),{name:"Datalist",data:function(){return{oss:null,list:[],listLoading:!0,listQuery:{}}},created:function(){this.getList()},methods:{getList:function(t){var e=this;if(1!=t)this.listQuery.excel=0,this.$axios.get("/admin/data/index",{params:this.listQuery}).then((function(t){e.list=t.data,e.oss=t.ext.oss,e.listLoading=!1}));else{if(this.listQuery.excel=1,!this.listQuery.times)return void this.$message({message:"请选择日期",type:"warning"});var l=this.listQuery.times[0]instanceof Date,i=Object(a["a"])(Object(a["a"])({},this.listQuery),{},{times:[l?this.listQuery.times[0].toISOString():"",l?this.listQuery.times[1].toISOString():""]});window.open("/admin/data/index?"+this.objectToQuery(i))}},objectToQuery:function(t){return Object.keys(t).map((function(e){var l=t[e];return void 0==l||null==l?"":encodeURIComponent(e)+"="+encodeURIComponent(l)})).join("&")}}}),r=s,o=l("2877"),c=Object(o["a"])(r,i,n,!1,null,null,null);e["default"]=c.exports}}]);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -30,4 +30,10 @@ WHERE
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ALTER TABLE `orders`
|
||||||
|
ADD COLUMN `verification_date` datetime NULL COMMENT '核销日期';
|
||||||
|
|
||||||
|
ALTER TABLE `follows`
|
||||||
|
ADD INDEX `idx_order_id`(`order_id`) USING HASH;
|
||||||
|
|
||||||
|
update orders set verification_date =( SELECT FROM_UNIXTIME(create_time) FROM `follows` where status = 2 and order_id = orders.id limit 1)
|
||||||
|
|
Loading…
Reference in New Issue