This commit is contained in:
commit
32e060e597
|
@ -8,22 +8,11 @@ export function login(data) {
|
|||
})
|
||||
}
|
||||
|
||||
// 获取城市列表
|
||||
export function getCityList() {
|
||||
return request({
|
||||
url: '/admin/city/getCityList',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 获取子集列表
|
||||
export function getQaList(city_id) {
|
||||
export function getQaList() {
|
||||
return request({
|
||||
url: '/admin/qa/getQaList',
|
||||
method: 'get',
|
||||
params: {
|
||||
city_id
|
||||
}
|
||||
})
|
||||
}
|
||||
// 获取qa详情
|
||||
|
|
|
@ -129,7 +129,7 @@
|
|||
<el-button v-if="QaShow" type="success" @click="drawer = false">关 闭</el-button>
|
||||
<el-button v-if="!QaShow" type="success" @click="QaShow = true">返 回</el-button>
|
||||
<div v-if="QaShow" class="mod">
|
||||
<el-button v-for="item in getCityList" style="width: 150px;" size="medium" type="primary" @click="getQaDetail(item.city_id)">
|
||||
<el-button v-for="item in getQaList" style="width: 150px;" size="medium" type="primary" @click="getQaDetail(item)">
|
||||
{{ item.city_name }}
|
||||
</el-button>
|
||||
</div>
|
||||
|
@ -152,7 +152,7 @@ import Search from '@/components/HeaderSearch'
|
|||
import { color } from 'echarts/lib/export'
|
||||
import sidebar from '@/layout/components/Sidebar/index.vue'
|
||||
import avatar from 'element-ui/packages/avatar'
|
||||
import { getCityList, getQaList, getQaDetail } from '@/api/qa'
|
||||
import { getQaList } from '@/api/qa'
|
||||
import clickoutside from 'element-ui/src/utils/clickoutside'
|
||||
export default {
|
||||
directives: { clickoutside },
|
||||
|
@ -189,7 +189,7 @@ export default {
|
|||
imageUrl: false,
|
||||
QaShow: true,
|
||||
os: [],
|
||||
getCityList: [],
|
||||
getQaList: [],
|
||||
times: [],
|
||||
form: {
|
||||
oldpwd: '',
|
||||
|
@ -213,8 +213,8 @@ export default {
|
|||
},
|
||||
created() {
|
||||
this.getworkstatus()
|
||||
getCityList().then(res => {
|
||||
this.getCityList = res.data
|
||||
getQaList().then(res => {
|
||||
this.getQaList = res.data
|
||||
})
|
||||
},
|
||||
methods: {
|
||||
|
@ -226,9 +226,8 @@ export default {
|
|||
this.drawer = false
|
||||
this.QaShow = true
|
||||
},
|
||||
getQaDetail(id) {
|
||||
getQaDetail(id).then(res => {
|
||||
this.QaInfo = res.data
|
||||
getQaDetail(data) {
|
||||
this.QaInfo = data
|
||||
if (!this.QaInfo) {
|
||||
return this.$message({
|
||||
message: '暂无QA问题',
|
||||
|
@ -237,7 +236,6 @@ export default {
|
|||
})
|
||||
}
|
||||
this.QaShow = false
|
||||
})
|
||||
},
|
||||
async logout() {
|
||||
await this.$store.dispatch('user/logout')
|
||||
|
@ -267,7 +265,7 @@ export default {
|
|||
})
|
||||
},
|
||||
startWorks() {
|
||||
this.$axios.post('/admin/work/startworks', { id: this.id }).then(res => {
|
||||
this.$axios.post('/admin/admin/editInfo', { is_order: 1 }).then(res => {
|
||||
console.log(res)
|
||||
this.$message({
|
||||
showClose: true,
|
||||
|
@ -279,7 +277,7 @@ export default {
|
|||
})
|
||||
},
|
||||
endWorks() {
|
||||
this.$axios.post('/admin/work/endworks', { id: this.id }).then(res => {
|
||||
this.$axios.post('/admin/admin/editInfo', { is_order: 0 }).then(res => {
|
||||
console.log(res)
|
||||
this.$message({
|
||||
showClose: true,
|
||||
|
|
|
@ -98,7 +98,7 @@ export const asyncRoutes = [
|
|||
component: () => import('@/views/onlines/online.vue'),
|
||||
name: 'onlines',
|
||||
meta: {
|
||||
title: '客服在线列表',
|
||||
title: '在线客服',
|
||||
roles: ['admin']
|
||||
}
|
||||
}/*,
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
<el-table-column align="center" label="管理员" width="80" prop="admin.username" />
|
||||
|
||||
<el-table-column align="center" label="操作" width="100" prop="action_name" />
|
||||
<el-table-column align="center" label="操作" width="120" prop="action_name" />
|
||||
|
||||
<el-table-column align="center" label="订单号" width="220" prop="orders.sn" />
|
||||
<el-table-column align="center" label="产品" prop="orders.product_name" />
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<div class="app-container">
|
||||
<el-table v-loading="listLoading" :data="list" border fit highlight-current-row style="width: 100%">
|
||||
<el-table-column align="center" label="ID" width="60" prop="id" />
|
||||
<el-table-column align="center" label="姓名" width="80" prop="name" />
|
||||
<el-table-column align="center" label="姓名" width="80" prop="username" />
|
||||
<el-table-column align="center" label="状态" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.isOnline === 0" type="border-card">下线</el-tag>
|
||||
|
@ -10,37 +10,36 @@
|
|||
<el-tag v-if="scope.row.isOnline === 2" type="info">没上线</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column align="center" label="是否分单" width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.isEndWork === 0" type="border-card">否</el-tag>
|
||||
<el-tag v-if="scope.row.isEndWork === 1" type="success">是</el-tag>
|
||||
</template>
|
||||
</el-table-column>-->
|
||||
<el-table-column align="center" label="是否分单" width="100">
|
||||
<template #default="scope">
|
||||
<el-switch v-model="scope.row.isEndWork" :active-value="1" :inactive-value="0" @change="updateStatus(scope.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="剩余限制订单数量" width="190">
|
||||
<!-- <el-table-column align="center" label="剩余限制订单数量" width="190">
|
||||
<template #default="scope">
|
||||
<el-input-number v-model="scope.row.order_num" :max="9999999" :min="0" class="small-input-number" style="width: 160px; height: 36px;" @change="updateStatus(scope.row)" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column align="center" label="在线时长" width="80">
|
||||
</el-table-column>-->
|
||||
<el-table-column align="center" label="在线时长" width="120">
|
||||
<template slot-scope="scope">
|
||||
{{ Math.floor((scope.row.data ? scope.row.data.onlineTime : scope.row.onlineTime) / 3600) || '--' }} 分钟
|
||||
{{ Math.floor((scope.row.data ? scope.row.data.onlineTime : scope.row.onlineTime) / 60) || '--' }} 分钟
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="138px" align="center" label="上班时间">
|
||||
<el-table-column width="138px" align="center" label="上线时间">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.start_work_time | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="138px" align="center" label="下班时间">
|
||||
<el-table-column width="138px" align="center" label="停止分单时间">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.end_work_time | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column width="138px" align="center" label="下线时间">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.last_work_time | parseTime('{y}-{m}-{d} {h}:{i}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
@ -76,7 +75,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
getOnlineList() {
|
||||
this.listLoading = true // /admin/admin/getOnlineList /admin/shortcutContent/list
|
||||
this.listLoading = true
|
||||
this.$axios.get('/admin/admin/getOnlineList', { params: this.listQuery }).then(response => {
|
||||
this.list = response.data
|
||||
this.listLoading = false
|
||||
|
|
|
@ -121,7 +121,7 @@
|
|||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" width="500px" label="标题" prop="product_name" />
|
||||
<el-table-column width="138px" align="center" label="跟进备注" prop="remark" />
|
||||
<el-table-column width="500px" align="center" label="跟进备注" prop="remark" />
|
||||
|
||||
<el-table-column align="center" label="联系人" width="120" prop="contact" />
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
<el-table v-loading="listLoading" :data="list" border highlight-current-row style="width: 100%">
|
||||
|
||||
<el-table-column align="center" label="产品名称" width="220" prop="product_name" />
|
||||
<el-table-column align="center" label="产品名称" width="260" prop="product_name" />
|
||||
|
||||
<el-table-column align="center" label="平台" width="80" prop="os">
|
||||
<template slot-scope="scope">
|
||||
|
@ -30,7 +30,7 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column align="center" fixed label="订单数" width="80" prop="all" />
|
||||
<el-table-column align="center" label="订单数" width="80" prop="all"/>
|
||||
|
||||
<el-table-column align="center" label="订单金额" width="100">
|
||||
<template slot-scope="scope">
|
||||
|
|
|
@ -131,48 +131,35 @@ class AdminController extends base
|
|||
public function getOnlineList(Request $request)
|
||||
{
|
||||
$list = [];
|
||||
$todayStart = strtotime(date('Y-m-d'));
|
||||
$todayEnd = $todayStart + 86399;
|
||||
|
||||
// 获取今天在线的记录
|
||||
$onlines = Onlines::alias('o')
|
||||
->field('o.*, a.id as admin_id, a.name') // 选择需要的字段
|
||||
->join('admins a', 'o.admin_id = a.id', 'LEFT') // 关联admins表
|
||||
->where('start','>=',$todayStart)
|
||||
->where('end','<=',$todayEnd)
|
||||
->select();
|
||||
|
||||
foreach ($onlines as $online) {
|
||||
$adminId = $online->admin_id;
|
||||
$list[$adminId]['id'] = $adminId;
|
||||
$list[$adminId]['name'] = $online->name;
|
||||
$list[$adminId]['onlineTime'] = $list[$adminId]['onlineTime'] ?? 0 + (($online->end ? $online->end : $todayEnd) - $online->start);
|
||||
$list[$adminId]['isOnline'] = Redis::get('CRM:USER:ONLINE:'.$online->admin_id) ? 1 : 0;
|
||||
}
|
||||
|
||||
$users = Admins::where('status',1)->select();
|
||||
foreach ($users as $user){
|
||||
$adminId = $user->id;
|
||||
if (empty($list[$user->id])){
|
||||
$list[$adminId]['id'] = $adminId;
|
||||
$list[$adminId]['name'] = $user->name;
|
||||
$list[$adminId]['onlineTime'] = 0;
|
||||
$list[$adminId]['isOnline'] = 2;
|
||||
}
|
||||
|
||||
if (!isset($list[$adminId]['isOnline'])){
|
||||
$list[$adminId]['isOnline'] = 0;
|
||||
}
|
||||
|
||||
// if ($user->is_order == 1 && $list[$adminId]['isOnline'] ==1){
|
||||
$list[$adminId]['isEndWork'] = 0;
|
||||
if ($user->is_order == 1){
|
||||
$list[$adminId]['isEndWork'] = 1;//是否分单
|
||||
}
|
||||
|
||||
if (!empty($user->end_work_time)) {
|
||||
$list[$adminId]['onlineTime'] = strtotime(date('Y-m-d H:i:00',$user->end_work_time)) - strtotime(date('Y-m-d H:i:00',$user->start_work_time));
|
||||
}else{
|
||||
$list[$adminId]['isEndWork'] = 0;
|
||||
$list[$adminId]['onlineTime'] = $user->last_work_time > 0 ? strtotime(date('Y-m-d H:i:00',$user->last_work_time)) - strtotime(date('Y-m-d H:i:00',$user->start_work_time)) : 0;
|
||||
}
|
||||
if ($user->start_work_time <=0){
|
||||
$list[$adminId]['onlineTime'] = 0;
|
||||
}
|
||||
|
||||
$list[$adminId]['last_work_time'] = $user->last_work_time;
|
||||
$list[$adminId]['isOnline'] = 0;
|
||||
if (Redis::get('CRM:USER:ONLINE:'.$adminId)){
|
||||
$list[$adminId]['isOnline'] = 1;
|
||||
$list[$adminId]['last_work_time'] = 0;//在线时不用展示
|
||||
}
|
||||
$list[$adminId]['start_work_time'] = $user->start_work_time;
|
||||
$list[$adminId]['end_work_time'] = $user->end_work_time;
|
||||
$list[$adminId]['order_num'] = $user->order_num;
|
||||
$list[$adminId]['id'] = $adminId;
|
||||
$list[$adminId]['username'] = $user->username;
|
||||
}
|
||||
|
||||
return $this->success(array_values($list));
|
||||
|
@ -181,7 +168,15 @@ class AdminController extends base
|
|||
public function editInfo(Request $request)
|
||||
{
|
||||
$post = $request->post();
|
||||
if (empty($post['id'])) return $this->error(500, '参数错误');
|
||||
|
||||
if (empty($post['id'])){
|
||||
$post['id'] = $request->admin->id;
|
||||
}
|
||||
|
||||
$post['end_work_time'] = time();
|
||||
if ($post['is_order'] == 1){
|
||||
$post['end_work_time'] = 0;
|
||||
}
|
||||
|
||||
try {
|
||||
Admins::update($post);
|
||||
|
|
|
@ -1,14 +0,0 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\model\Citys;
|
||||
use support\Request;
|
||||
|
||||
class CityController extends base
|
||||
{
|
||||
public function getCityList(Request $request){
|
||||
$list = Citys::fieldRaw('city_id,city_name')->where('status','=',1)->order('sort','desc')->select();
|
||||
return $this->success($list);
|
||||
}
|
||||
}
|
|
@ -17,6 +17,7 @@ class IndexController extends base
|
|||
|
||||
public function isWork(Request $request)
|
||||
{
|
||||
Redis::set('CRM:USER:ONLINE:WATCH:' . $request->admin->id, time());
|
||||
|
||||
$lastTime = Redis::get('CRM:USER:ONLINE:' . $request->admin->id);
|
||||
$end = Redis::hGet('CRM:USER:ONLINE:END', $request->admin->id);
|
||||
|
@ -89,8 +90,8 @@ class IndexController extends base
|
|||
|
||||
public function orders(Request $request)
|
||||
{
|
||||
|
||||
$order = Orders::where('admin_id', $request->admin->id)->fieldRaw('
|
||||
$order = Orders::where('sn','>',0)
|
||||
->fieldRaw('
|
||||
SUM(IF(status=0,1,0)) as wait,
|
||||
SUM(IF(status=1,1,0)) as doing,
|
||||
SUM(total_price) as total,
|
||||
|
@ -105,9 +106,13 @@ class IndexController extends base
|
|||
WHEN (os = 1 AND STATUS = 5) OR (os = 3 AND STATUS = 4) OR (os = 2 AND STATUS = 1) THEN actual_price
|
||||
ELSE 0
|
||||
END) AS refund_price
|
||||
')->find();
|
||||
');
|
||||
|
||||
// Log::warning("=====",['sql'=>$order]);
|
||||
if ($request->admin->id !=1){
|
||||
$order = $order->where('admin_id', $request->admin->id);
|
||||
}
|
||||
|
||||
$order = $order->find();
|
||||
|
||||
return $this->success([
|
||||
'wait' => $order->wait ?? 0,
|
||||
|
@ -190,7 +195,7 @@ class IndexController extends base
|
|||
$limit = $request->get('limit', 10);
|
||||
$product_name = $request->get('product_name');
|
||||
$os = $request->get('os_status');
|
||||
$list = Orders::where('admin_id',$request->admin->id)
|
||||
$list = Orders::where('sn','>',0)
|
||||
->fieldRaw('
|
||||
os,product_name,
|
||||
SUM(IF(status=0,1,0)) as wait,
|
||||
|
@ -210,12 +215,17 @@ class IndexController extends base
|
|||
')
|
||||
->group('os,product_name')
|
||||
->order('total desc');
|
||||
|
||||
if ($request->admin->id !=1){
|
||||
$list = $list->where('admin_id', $request->admin->id);
|
||||
}
|
||||
if (!empty($os)){
|
||||
$list = $list->where('os',$os);
|
||||
}
|
||||
if (!empty($product_name)){
|
||||
$list = $list->where('product_name','like','%'.$product_name.'%');
|
||||
}
|
||||
|
||||
$list = $list->paginate($limit);
|
||||
return $this->success($list);
|
||||
}
|
||||
|
|
|
@ -35,6 +35,12 @@ class LoginController extends base
|
|||
return $this->error(1004,'管理员状态错误'); //管理员状态错误
|
||||
}
|
||||
|
||||
// 记录当天第一次上线时间
|
||||
if (date('Y-m-d') != date('Y-m-d',$admin->start_work_time)){
|
||||
$admin->start_work_time = $time;
|
||||
$admin->save();
|
||||
}
|
||||
|
||||
$data = [
|
||||
'id'=> $admin->id,
|
||||
'username' => $admin->username,
|
||||
|
|
|
@ -11,6 +11,7 @@ use stdClass;
|
|||
use support\Log;
|
||||
use support\Redis;
|
||||
use support\Request;
|
||||
use think\facade\Db;
|
||||
|
||||
class OrderController extends base
|
||||
{
|
||||
|
@ -37,7 +38,7 @@ class OrderController extends base
|
|||
->order('update_time','desc')
|
||||
->order('id','desc');
|
||||
|
||||
if($status!==null && $status >= 0) {
|
||||
if($status!=null && $status >= 0) {
|
||||
$query->where('status', $status);
|
||||
}
|
||||
|
||||
|
@ -304,7 +305,7 @@ class OrderController extends base
|
|||
$query->where('order_id', $order_id);
|
||||
}
|
||||
|
||||
if($status !== null) {
|
||||
if($status != null) {
|
||||
$query->where('status', $status);
|
||||
}
|
||||
|
||||
|
@ -336,19 +337,38 @@ class OrderController extends base
|
|||
if(empty($item)) return $this->error(2002, '订单没有找到');
|
||||
if($item->admin_id == $admin_id) return $this->error(2002, '订单已经在账号上,不需要再拉取!');
|
||||
|
||||
$back = Backs::create([
|
||||
//管理员不用审批
|
||||
$status = 0;
|
||||
if ($request->admin->is_super == 1 || $request->admin->id == 1){
|
||||
$status = 1;
|
||||
}
|
||||
|
||||
$backs = [
|
||||
'order_id' => $item->id,
|
||||
'admin_id' => $admin_id,
|
||||
'admin' => $item->admin_id,
|
||||
'apply_id' => $request->admin->id
|
||||
]);
|
||||
Logs::todo($item->id, $admin_id, 7);
|
||||
'apply_id' => $request->admin->id,
|
||||
'status' => $status
|
||||
];
|
||||
try {
|
||||
Db::transaction(function() use ($backs,$item) {
|
||||
Backs::create($backs);
|
||||
Logs::todo($backs['order_id'], $backs['apply_id'], $backs['status'] == 1 ? 12 : 7,$item->sn);
|
||||
|
||||
if($back) {
|
||||
return $this->success($back);
|
||||
}else{
|
||||
if ($backs['status'] == 1){//管理员审批处理
|
||||
Orders::where('id', $backs['order_id'])->where('admin_id', $backs['admin'])->update(['admin_id'=> $backs['admin_id']]);
|
||||
$other = Backs::where('order_id', $backs['order_id'])->where('status', 0)->lock()->select();
|
||||
foreach($other as $o) {
|
||||
Backs::where('id', $o->id)->where('status', 0)->update(['status' => 3]);
|
||||
Logs::todo($o->order_id, $o->admin, 10); //取消其他转单需求
|
||||
}
|
||||
}
|
||||
});
|
||||
}catch (\Exception $e){
|
||||
return $this->error(2003, '创建拉回记录失败了');
|
||||
}
|
||||
|
||||
return $this->success(true);
|
||||
}
|
||||
|
||||
public function toBack(Request $request) {
|
||||
|
@ -363,19 +383,38 @@ class OrderController extends base
|
|||
if(empty($item)) return $this->error(2002, '订单没有找到');
|
||||
if($item->admin_id == $admin_id) return $this->error(2002, '订单已经在账号上,不需要再拉取!');
|
||||
|
||||
$back = Backs::create([
|
||||
//管理员不用审批
|
||||
$status = 0;
|
||||
if ($request->admin->is_super == 1 || $request->admin->id == 1){
|
||||
$status = 1;
|
||||
}
|
||||
|
||||
$backs = [
|
||||
'order_id' => $item->id,
|
||||
'admin_id' => $admin_id,
|
||||
'admin' => $item->admin_id,
|
||||
'apply_id' => $request->admin->id
|
||||
]);
|
||||
Logs::todo($item->id, $admin_id, 7);
|
||||
'apply_id' => $request->admin->id,
|
||||
'status' => $status
|
||||
];
|
||||
try {
|
||||
Db::transaction(function() use ($backs,$item) {
|
||||
Backs::create($backs);
|
||||
Logs::todo($backs['order_id'], $backs['apply_id'], $backs['status'] == 1 ? 12 : 7,$item->sn);
|
||||
|
||||
if($back) {
|
||||
return $this->success($back);
|
||||
}else{
|
||||
if ($backs['status'] == 1){//管理员审批处理
|
||||
Orders::where('id', $backs['order_id'])->where('admin_id', $backs['admin'])->update(['admin_id'=> $backs['admin_id']]);
|
||||
$other = Backs::where('order_id', $backs['order_id'])->where('status', 0)->lock()->select();
|
||||
foreach($other as $o) {
|
||||
Backs::where('id', $o->id)->where('status', 0)->update(['status' => 3]);
|
||||
Logs::todo($o->order_id, $o->admin, 10); //取消其他转单需求
|
||||
}
|
||||
}
|
||||
});
|
||||
}catch (\Exception $e){
|
||||
return $this->error(2003, '创建拉回记录失败了');
|
||||
}
|
||||
|
||||
return $this->success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,24 +9,17 @@ class QaController extends base
|
|||
{
|
||||
public function getQaList(Request $request)
|
||||
{
|
||||
$cityId = $request->get('city_id');
|
||||
$limit = $request->get('limit', 10);
|
||||
|
||||
if (empty($cityId)) return $this->error(2001, 'city_id cannot be empty!');
|
||||
|
||||
$list = Qas::fieldRaw('city_id,title,content')->where('city_id', $cityId)->paginate($limit);
|
||||
$list = Qas::fieldRaw('city_name,title,content')->select();
|
||||
|
||||
return $this->success($list);
|
||||
}
|
||||
|
||||
public function getQaDetail(Request $request)
|
||||
{
|
||||
$cityId = $request->get('city_id');
|
||||
// $id = $request->get('id');
|
||||
$id = $request->get('id');
|
||||
if (empty($id)) return $this->error(2001, 'id data cannot be empty!');
|
||||
|
||||
if (empty($cityId)) return $this->error(2001, 'city_id cannot be empty!');
|
||||
|
||||
$data = Qas::fieldRaw('city_id,title,content')->where([/*'id' => $id, */'city_id' => $cityId])->find();
|
||||
$data = Qas::fieldRaw('id,city_name,title,content')->find();
|
||||
|
||||
return $this->success($data);
|
||||
}
|
||||
|
@ -34,7 +27,7 @@ class QaController extends base
|
|||
public function addQa(Request $request)
|
||||
{
|
||||
$post = $request->post();
|
||||
if (empty($post['city_id'])) return $this->error(2001, 'city_id data cannot be empty!');
|
||||
if (empty($post['city_name'])) return $this->error(2001, 'city_name data cannot be empty!');
|
||||
if (empty($post['title'])) return $this->error(2001, 'title data cannot be empty!');
|
||||
if (empty($post['content'])) return $this->error(2001, 'content data cannot be empty!');
|
||||
|
||||
|
|
|
@ -0,0 +1,44 @@
|
|||
<?php
|
||||
|
||||
namespace app\admin\controller;
|
||||
|
||||
use app\model\Admins;
|
||||
use support\Log;
|
||||
use support\Redis;
|
||||
use think\db\exception\DbException;
|
||||
|
||||
class WatchController extends base
|
||||
{
|
||||
public static function watchIsWork()
|
||||
{
|
||||
$nowTime = time();
|
||||
$datas = Admins::order('create_time desc')->select();
|
||||
foreach ($datas as $data) {
|
||||
$item = [];
|
||||
|
||||
//set admin/index/isWork
|
||||
$watch = Redis::get('CRM:USER:ONLINE:WATCH:'.$data->id);
|
||||
|
||||
//记录下线时间
|
||||
if (!empty($watch) && ($nowTime - $watch) > 6*60){
|
||||
$item['end_work_time'] = $watch + 5*60;
|
||||
}
|
||||
//实时更新在线时间
|
||||
if (($nowTime - $watch) <= 6*60){
|
||||
$item['last_work_time'] = $nowTime;
|
||||
}
|
||||
|
||||
//记录当天第一次上线时间 start_work_time admin/login/index
|
||||
|
||||
if (!empty($item)){
|
||||
try {
|
||||
Admins::where('id', $data->id)->update($item);
|
||||
} catch (DbException $e) {
|
||||
Log::error('watchIsWork',['error'=>$e]);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
|
@ -168,20 +168,6 @@ class WorkController extends base
|
|||
return $this->success($anchor->hidden(['password', 'remember_token']));
|
||||
}
|
||||
|
||||
public function endworks(Request $request)
|
||||
{
|
||||
// Redis::set("CRM:USER:ENDWORK:".$request->admin->id,10*3600);
|
||||
Admins::update(['id' => $request->admin->id, 'is_order' => 0, 'end_work_time' => time()]);
|
||||
return $this->success(null);
|
||||
}
|
||||
|
||||
public function startworks(Request $request)
|
||||
{
|
||||
// Redis::del("CRM:USER:ENDWORK:" . $request->admin->id);
|
||||
Admins::update(['id' => $request->admin->id, 'is_order' => 1,'start_work_time' => time()]);
|
||||
return $this->success(null);
|
||||
}
|
||||
|
||||
public function getworkstatus(Request $request)
|
||||
{
|
||||
// $workstatus = Redis::get("CRM:USER:ENDWORK:" . $request->admin->id);
|
||||
|
|
|
@ -58,18 +58,24 @@ class SpiderMt extends Command
|
|||
$_u->username = $u->id;
|
||||
$us[] = $_u;
|
||||
}*/
|
||||
if ($u->order_num > 0){
|
||||
$_u = new stdClass();
|
||||
$_u->username = $u->id;
|
||||
$us[] = $_u;
|
||||
if ($u->order_num != $this->order_num){
|
||||
Admins::where('id',$u->id)->decrement('order_num',1);
|
||||
/*if ($u->order_num > 0){
|
||||
if ($u->order_num !== $this->order_num){
|
||||
$data = Admins::where('id',$u->id)->find();
|
||||
$num = $data['order_num'] - 1;
|
||||
if ($num >= 0){
|
||||
Admins::where('id',$u->id)->update(['order_num'=>$num]);
|
||||
}
|
||||
}
|
||||
$_u = new stdClass();
|
||||
$_u->username = $u->id;
|
||||
$us[] = $_u;
|
||||
};
|
||||
}*/
|
||||
|
||||
$_u = new stdClass();
|
||||
$_u->username = $u->id;
|
||||
$us[] = $_u;
|
||||
}
|
||||
|
||||
$this->_users = $us;
|
||||
return $this->_users;
|
||||
}
|
||||
|
@ -250,6 +256,7 @@ class SpiderMt extends Command
|
|||
$order->is_check = 1;
|
||||
$order->check_sn = $json->check_sn;
|
||||
$order->admin_id = $json->admin_id;
|
||||
$order->give_time = time();
|
||||
$back = $order->save();
|
||||
} elseif (!empty($order) && $order->admin_id !== $json->admin_id) {
|
||||
echo '订单不在自己的名下,并且分人了。';
|
||||
|
@ -272,6 +279,7 @@ class SpiderMt extends Command
|
|||
$item->admin_id = $json->admin_id;
|
||||
$item->check_sn = $json->check_sn;
|
||||
$item->is_check = 1;
|
||||
$item->give_time = time();
|
||||
$back = $item->save();
|
||||
|
||||
$order->is_change = $json->admin_id;
|
||||
|
|
|
@ -3,7 +3,7 @@ namespace app\model;
|
|||
|
||||
class Logs extends base{
|
||||
|
||||
const Actions = [1 => '查看电话', 2 => '核销订单', 3=> '核销订单', 4 => '分单', 5 => '加微信', 6 => '公海领取', 7 => '申请拉回订单', 8 => '确认拉单请求', 9 => '拒绝拉单请求', 10 => '取消拉单请求',11 => '核销失败'];
|
||||
const Actions = [1 => '查看电话', 2 => '核销订单', 3=> '核销订单', 4 => '分单', 5 => '加微信', 6 => '公海领取', 7 => '申请拉回订单', 8 => '确认拉单请求', 9 => '拒绝拉单请求', 10 => '取消拉单请求',11 => '核销失败',12 => '管理员操作转单'];
|
||||
|
||||
public function getActionNameAttr($val) {
|
||||
return self::Actions[$this->action] ?? '未知';
|
||||
|
@ -14,7 +14,7 @@ class Logs extends base{
|
|||
}
|
||||
|
||||
public function orders(){
|
||||
return $this->belongsTo(Orders::class, 'admin_id');
|
||||
return $this->belongsTo(Orders::class, 'order_id');
|
||||
}
|
||||
|
||||
//查看详情
|
||||
|
|
|
@ -34,7 +34,8 @@
|
|||
"vlucas/phpdotenv": "^5.5",
|
||||
"qiniu/php-sdk": "^7.12",
|
||||
"webman/console": "^1.3",
|
||||
"mk-j/php_xlsxwriter": "^0.39.0"
|
||||
"mk-j/php_xlsxwriter": "^0.39.0",
|
||||
"workerman/crontab": "^1.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-event": "For better performance. "
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "ea0dd6c24e2c79f4af8509724c30fa0f",
|
||||
"content-hash": "c5d73376efb82db5d880157187b7a430",
|
||||
"packages": [
|
||||
{
|
||||
"name": "carbonphp/carbon-doctrine-types",
|
||||
|
@ -2768,6 +2768,56 @@
|
|||
},
|
||||
"time": "2023-04-23T14:40:18+00:00"
|
||||
},
|
||||
{
|
||||
"name": "workerman/crontab",
|
||||
"version": "v1.0.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/walkor/crontab.git",
|
||||
"reference": "b78f1556f2977715b9cb5653129e6d9cf160d966"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/walkor/crontab/zipball/b78f1556f2977715b9cb5653129e6d9cf160d966",
|
||||
"reference": "b78f1556f2977715b9cb5653129e6d9cf160d966",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.0",
|
||||
"workerman/workerman": ">=4.0.20"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Workerman\\Crontab\\": "./src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "walkor",
|
||||
"email": "walkor@workerman.net",
|
||||
"homepage": "http://www.workerman.net",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"description": "A crontab written in PHP based on workerman",
|
||||
"homepage": "http://www.workerman.net",
|
||||
"keywords": [
|
||||
"crontab"
|
||||
],
|
||||
"support": {
|
||||
"email": "walkor@workerman.net",
|
||||
"forum": "http://wenda.workerman.net/",
|
||||
"issues": "https://github.com/walkor/workerman/issues",
|
||||
"source": "https://github.com/walkor/crontab",
|
||||
"wiki": "http://doc.workerman.net/"
|
||||
},
|
||||
"time": "2022-10-17T01:59:19+00:00"
|
||||
},
|
||||
{
|
||||
"name": "workerman/webman-framework",
|
||||
"version": "v1.5.18",
|
||||
|
|
|
@ -14,10 +14,12 @@
|
|||
|
||||
namespace process;
|
||||
|
||||
use app\admin\controller\WatchController;
|
||||
use FilesystemIterator;
|
||||
use RecursiveDirectoryIterator;
|
||||
use RecursiveIteratorIterator;
|
||||
use SplFileInfo;
|
||||
use Workerman\Crontab\Crontab;
|
||||
use Workerman\Timer;
|
||||
use Workerman\Worker;
|
||||
|
||||
|
@ -240,4 +242,12 @@ class Monitor
|
|||
}
|
||||
return $memoryLimit;
|
||||
}
|
||||
|
||||
public function onWorkerStart()
|
||||
{
|
||||
// 每秒钟执行一次
|
||||
new Crontab('1 * * * * *', function(){
|
||||
WatchController::watchIsWork();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
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-24ed3445]{position:relative;padding-bottom:60px}.el-table[data-v-24ed3445],.filter-container[data-v-24ed3445]{padding-bottom:52px}
|
||||
.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-09b37c7e]{position:relative;padding-bottom:60px}.el-table[data-v-09b37c7e],.filter-container[data-v-09b37c7e]{padding-bottom:52px}
|
|
@ -1 +0,0 @@
|
|||
.day[data-v-8132912a]{display:inline-block;margin:10px;border:1px solid #409eff;border-radius:6px;overflow:hidden}.day p[data-v-8132912a]{background-color:#409eff;margin:0;color:#fff;padding:3px 10px}
|
|
@ -1 +0,0 @@
|
|||
.app-container[data-v-3784ad4e]{position:relative;padding-bottom:60px}.el-table[data-v-3784ad4e],.filter-container[data-v-3784ad4e]{padding-bottom:52px}.search[data-v-3784ad4e]{margin-left:10px}
|
|
@ -1 +0,0 @@
|
|||
.day[data-v-6e5382d8]{display:inline-block;margin:10px;border:1px solid #45af3c;border-radius:6px;overflow:hidden}.day p[data-v-6e5382d8]{background-color:#a3f39c;margin:0;padding:3px 10px}
|
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-09c03dba]{position:relative;padding-bottom:60px}.el-table[data-v-09c03dba],.filter-container[data-v-09c03dba]{padding-bottom:52px}
|
||||
.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-2bf5fa6e]{position:relative;padding-bottom:60px}.el-table[data-v-2bf5fa6e],.filter-container[data-v-2bf5fa6e]{padding-bottom:52px}
|
|
@ -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-c0783a8e]{position:relative;padding-bottom:60px}.el-table[data-v-c0783a8e],.filter-container[data-v-c0783a8e]{padding-bottom:52px}.search[data-v-c0783a8e]{margin-left:10px}
|
||||
.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-17b7299c]{position:relative;padding-bottom:60px}.el-table[data-v-17b7299c],.filter-container[data-v-17b7299c]{padding-bottom:52px}
|
|
@ -0,0 +1 @@
|
|||
.app-container[data-v-2926b996]{position:relative;padding-bottom:60px}.el-table[data-v-2926b996],.filter-container[data-v-2926b996]{padding-bottom:52px}.search[data-v-2926b996]{margin-left:10px}
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +1 @@
|
|||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5b015b61"],{"41bf":function(t,e,n){},"565d":function(t,e,n){},5779:function(t,e,n){"use strict";n("41bf")},"5e07":function(t,e,n){"use strict";n("ce52")},"9ed6":function(t,e,n){"use strict";n.r(e);var s=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"login-container"},[n("el-form",{ref:"loginForm",staticClass:"login-form",attrs:{model:t.loginForm,rules:t.loginRules,autocomplete:"on","label-position":"left"}},[n("div",{staticClass:"title-container"},[n("h3",{staticClass:"title"},[t._v("登陆订单中心")])]),n("el-form-item",{attrs:{prop:"username"}},[n("span",{staticClass:"svg-container"},[n("svg-icon",{attrs:{"icon-class":"user"}})],1),n("el-input",{ref:"username",attrs:{placeholder:"Username",name:"username",type:"text",tabindex:"1",autocomplete:"on"},model:{value:t.loginForm.username,callback:function(e){t.$set(t.loginForm,"username",e)},expression:"loginForm.username"}})],1),n("el-tooltip",{attrs:{content:"Caps lock is On",placement:"right",manual:""},model:{value:t.capsTooltip,callback:function(e){t.capsTooltip=e},expression:"capsTooltip"}},[n("el-form-item",{attrs:{prop:"password"}},[n("span",{staticClass:"svg-container"},[n("svg-icon",{attrs:{"icon-class":"password"}})],1),n("el-input",{key:t.passwordType,ref:"password",attrs:{type:t.passwordType,placeholder:"Password",name:"password",tabindex:"2",autocomplete:"on"},on:{blur:function(e){t.capsTooltip=!1}},nativeOn:{keyup:[function(e){return t.checkCapslock(e)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleLogin(e)}]},model:{value:t.loginForm.password,callback:function(e){t.$set(t.loginForm,"password",e)},expression:"loginForm.password"}}),n("span",{staticClass:"show-pwd",on:{click:t.showPwd}},[n("svg-icon",{attrs:{"icon-class":"password"===t.passwordType?"eye":"eye-open"}})],1)],1)],1),n("el-button",{staticStyle:{width:"100%","margin-bottom":"30px"},attrs:{loading:t.loading,type:"primary"},nativeOn:{click:function(e){return e.preventDefault(),t.handleLogin(e)}}},[t._v("登录")])],1)],1)},o=[],i=(n("13d5"),n("b64b"),n("d3b7"),n("61f7")),a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"social-signup-container"},[n("div",{staticClass:"sign-btn",on:{click:function(e){return t.wechatHandleClick("wechat")}}},[n("span",{staticClass:"wx-svg-container"},[n("svg-icon",{staticClass:"icon",attrs:{"icon-class":"wechat"}})],1),t._v(" WeChat ")]),n("div",{staticClass:"sign-btn",on:{click:function(e){return t.tencentHandleClick("tencent")}}},[n("span",{staticClass:"qq-svg-container"},[n("svg-icon",{staticClass:"icon",attrs:{"icon-class":"qq"}})],1),t._v(" QQ ")])])},r=[],c={name:"SocialSignin",methods:{wechatHandleClick:function(t){alert("ok")},tencentHandleClick:function(t){alert("ok")}}},l=c,u=(n("aa05"),n("2877")),p=Object(u["a"])(l,a,r,!1,null,"7309fbbb",null),d=p.exports,f={name:"Login",components:{SocialSign:d},data:function(){var t=function(t,e,n){Object(i["d"])(e)?n():n(new Error("请输入用户名"))},e=function(t,e,n){e.length<6?n(new Error("请输入密码")):n()};return{loginForm:{},loginRules:{username:[{required:!0,trigger:"blur",validator:t}],password:[{required:!0,trigger:"blur",validator:e}]},passwordType:"password",capsTooltip:!1,loading:!1,redirect:void 0,otherQuery:{}}},watch:{$route:{handler:function(t){var e=t.query;e&&(this.redirect=e.redirect,this.otherQuery=this.getOtherQuery(e))},immediate:!0}},created:function(){},mounted:function(){""===this.loginForm.username?this.$refs.username.focus():""===this.loginForm.password&&this.$refs.password.focus()},destroyed:function(){},methods:{checkCapslock:function(t){var e=t.key;this.capsTooltip=e&&1===e.length&&e>="A"&&e<="Z"},showPwd:function(){var t=this;"password"===this.passwordType?this.passwordType="":this.passwordType="password",this.$nextTick((function(){t.$refs.password.focus()}))},handleLogin:function(){var t=this;this.$refs.loginForm.validate((function(e){if(!e)return console.log("error submit!!"),!1;t.loading=!0,t.$store.dispatch("user/login",t.loginForm).then((function(){t.$router.push({path:t.redirect||"/",query:t.otherQuery}),t.loading=!1})).catch((function(){t.loading=!1}))}))},getOtherQuery:function(t){return Object.keys(t).reduce((function(e,n){return"redirect"!==n&&(e[n]=t[n]),e}),{})}}},m=f,g=(n("5779"),n("5e07"),Object(u["a"])(m,s,o,!1,null,"ef34595e",null));e["default"]=g.exports},aa05:function(t,e,n){"use strict";n("565d")},ce52:function(t,e,n){}}]);
|
||||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-0579811f"],{"41bf":function(t,e,n){},"565d":function(t,e,n){},5779:function(t,e,n){"use strict";n("41bf")},"5e07":function(t,e,n){"use strict";n("ce52")},"9ed6":function(t,e,n){"use strict";n.r(e);var s=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"login-container"},[n("el-form",{ref:"loginForm",staticClass:"login-form",attrs:{model:t.loginForm,rules:t.loginRules,autocomplete:"on","label-position":"left"}},[n("div",{staticClass:"title-container"},[n("h3",{staticClass:"title"},[t._v("登陆订单中心")])]),n("el-form-item",{attrs:{prop:"username"}},[n("span",{staticClass:"svg-container"},[n("svg-icon",{attrs:{"icon-class":"user"}})],1),n("el-input",{ref:"username",attrs:{placeholder:"Username",name:"username",type:"text",tabindex:"1",autocomplete:"on"},model:{value:t.loginForm.username,callback:function(e){t.$set(t.loginForm,"username",e)},expression:"loginForm.username"}})],1),n("el-tooltip",{attrs:{content:"Caps lock is On",placement:"right",manual:""},model:{value:t.capsTooltip,callback:function(e){t.capsTooltip=e},expression:"capsTooltip"}},[n("el-form-item",{attrs:{prop:"password"}},[n("span",{staticClass:"svg-container"},[n("svg-icon",{attrs:{"icon-class":"password"}})],1),n("el-input",{key:t.passwordType,ref:"password",attrs:{type:t.passwordType,placeholder:"Password",name:"password",tabindex:"2",autocomplete:"on"},on:{blur:function(e){t.capsTooltip=!1}},nativeOn:{keyup:[function(e){return t.checkCapslock(e)},function(e){return!e.type.indexOf("key")&&t._k(e.keyCode,"enter",13,e.key,"Enter")?null:t.handleLogin(e)}]},model:{value:t.loginForm.password,callback:function(e){t.$set(t.loginForm,"password",e)},expression:"loginForm.password"}}),n("span",{staticClass:"show-pwd",on:{click:t.showPwd}},[n("svg-icon",{attrs:{"icon-class":"password"===t.passwordType?"eye":"eye-open"}})],1)],1)],1),n("el-button",{staticStyle:{width:"100%","margin-bottom":"30px"},attrs:{loading:t.loading,type:"primary"},nativeOn:{click:function(e){return e.preventDefault(),t.handleLogin(e)}}},[t._v("登录")])],1)],1)},o=[],i=(n("13d5"),n("b64b"),n("d3b7"),n("61f7")),a=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"social-signup-container"},[n("div",{staticClass:"sign-btn",on:{click:function(e){return t.wechatHandleClick("wechat")}}},[n("span",{staticClass:"wx-svg-container"},[n("svg-icon",{staticClass:"icon",attrs:{"icon-class":"wechat"}})],1),t._v(" WeChat ")]),n("div",{staticClass:"sign-btn",on:{click:function(e){return t.tencentHandleClick("tencent")}}},[n("span",{staticClass:"qq-svg-container"},[n("svg-icon",{staticClass:"icon",attrs:{"icon-class":"qq"}})],1),t._v(" QQ ")])])},r=[],c={name:"SocialSignin",methods:{wechatHandleClick:function(t){alert("ok")},tencentHandleClick:function(t){alert("ok")}}},l=c,u=(n("aa05"),n("2877")),p=Object(u["a"])(l,a,r,!1,null,"7309fbbb",null),d=p.exports,f={name:"Login",components:{SocialSign:d},data:function(){var t=function(t,e,n){Object(i["d"])(e)?n():n(new Error("请输入用户名"))},e=function(t,e,n){e.length<6?n(new Error("请输入密码")):n()};return{loginForm:{},loginRules:{username:[{required:!0,trigger:"blur",validator:t}],password:[{required:!0,trigger:"blur",validator:e}]},passwordType:"password",capsTooltip:!1,loading:!1,redirect:void 0,otherQuery:{}}},watch:{$route:{handler:function(t){var e=t.query;e&&(this.redirect=e.redirect,this.otherQuery=this.getOtherQuery(e))},immediate:!0}},created:function(){},mounted:function(){""===this.loginForm.username?this.$refs.username.focus():""===this.loginForm.password&&this.$refs.password.focus()},destroyed:function(){},methods:{checkCapslock:function(t){var e=t.key;this.capsTooltip=e&&1===e.length&&e>="A"&&e<="Z"},showPwd:function(){var t=this;"password"===this.passwordType?this.passwordType="":this.passwordType="password",this.$nextTick((function(){t.$refs.password.focus()}))},handleLogin:function(){var t=this;this.$refs.loginForm.validate((function(e){if(!e)return console.log("error submit!!"),!1;t.loading=!0,t.$store.dispatch("user/login",t.loginForm).then((function(){t.$router.push({path:t.redirect||"/",query:t.otherQuery}),t.loading=!1})).catch((function(){t.loading=!1}))}))},getOtherQuery:function(t){return Object.keys(t).reduce((function(e,n){return"redirect"!==n&&(e[n]=t[n]),e}),{})}}},m=f,g=(n("5779"),n("5e07"),Object(u["a"])(m,s,o,!1,null,"ef34595e",null));e["default"]=g.exports},aa05:function(t,e,n){"use strict";n("565d")},ce52:function(t,e,n){}}]);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -1 +0,0 @@
|
|||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-31b50fe9"],{"1e76":function(t,e,a){"use strict";a("661b")},4057:function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"app-container"},[a("div",{staticClass:"filter-container"},[a("el-input",{staticClass:"filter-item",staticStyle:{width:"200px","margin-right":"10px"},attrs:{placeholder:"用户名"},model:{value:t.listQuery.admin,callback:function(e){t.$set(t.listQuery,"admin",e)},expression:"listQuery.admin"}}),a("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"}}),a("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search"},on:{click:t.getList}},[t._v(" 搜索 ")])],1),a("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":""}},[a("el-table-column",{attrs:{align:"center",fixed:"",label:"姓名",width:"120",prop:"name"}}),a("el-table-column",{attrs:{align:"center",label:"管理员",width:"120",prop:"username"}}),a("el-table-column",{attrs:{align:"center",width:"120",label:"头像"},scopedSlots:t._u([{key:"default",fn:function(t){return[a("el-avatar",{attrs:{size:50,src:t.row.avatar}})]}}])}),a("el-table-column",{attrs:{align:"center",label:"在线时长"},scopedSlots:t._u([{key:"default",fn:function(e){return t._l(e.row.works,(function(e){return a("div",{staticClass:"day"},[a("div",[t._v(t._s(t._f("parseTime")(e.start,"{d}")))]),a("p",[t._v(t._s(t._f("parseTime")(e.start,"{h}:{i}"))+" - "+t._s(t._f("parseTime")(e.end,"{h}:{i}")))]),t._v(" "+t._s((e.total/100).toFixed(2))+" ")])}))}}])})],1)],1)},s=[],l={name:"Datalist",data:function(){return{list:[],listLoading:!0,listQuery:{}}},created:function(){this.getList()},methods:{getList:function(){var t=this;this.$axios.get("/admin/data/anchor",{params:this.listQuery}).then((function(e){t.list=e.data,t.listLoading=!1}))}}},n=l,r=(a("1e76"),a("2877")),c=Object(r["a"])(n,i,s,!1,null,"8132912a",null);e["default"]=c.exports},"661b":function(t,e,a){}}]);
|
|
@ -1 +0,0 @@
|
|||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-567f2c35"],{"5c7c":function(t,e,i){"use strict";i.r(e);var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("div",{staticClass:"app-container"},[i("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":""}},[i("el-table-column",{attrs:{align:"center",label:"ID",width:"80",prop:"id"}}),i("el-table-column",{attrs:{align:"center",label:"姓名",width:"380",prop:"name"}}),i("el-table-column",{attrs:{align:"center",label:"状态",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[0===e.row.isOnline?i("el-tag",{attrs:{type:"border-card"}},[t._v("下线")]):t._e(),1===e.row.isOnline?i("el-tag",{attrs:{type:"success"}},[t._v("在线")]):t._e(),2===e.row.isOnline?i("el-tag",{attrs:{type:"info"}},[t._v("没上线")]):t._e()]}}])})],1)],1)},a=[],s={name:"GetOnlineList",components:{},data:function(){return{statusArr:{0:"禁用",1:"启用"},list:[],total:0,loading:!1,listLoading:!0,listQuery:{page:1,limit:10,status:null,content:""},dialogCreate:!1,dialogEdit:!1,item:{},anchors:{}}},created:function(){this.listQuery.status=this.$route.query.status||null,this.listQuery.content=this.$route.query.content||null,this.getOnlineList()},methods:{getOnlineList:function(){var t=this;this.listLoading=!0,this.$axios.get("/admin/admin/getOnlineList",{params:this.listQuery}).then((function(e){t.list=e.data,console.log("====list=="+t.list),t.listLoading=!1})).catch((function(){t.listLoading=!1}))}}},l=s,o=(i("6ec2"),i("2877")),r=Object(o["a"])(l,n,a,!1,null,"3784ad4e",null);e["default"]=r.exports},"6ec2":function(t,e,i){"use strict";i("ee48")},ee48:function(t,e,i){}}]);
|
|
@ -1 +0,0 @@
|
|||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-5e3ffa79"],{"19b0":function(t,e,a){"use strict";a("d794")},"2b91":function(t,e,a){"use strict";a.r(e);var i=function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"app-container"},[a("div",{staticClass:"filter-container"},[a("el-input",{staticClass:"filter-item",staticStyle:{width:"200px","margin-right":"10px"},attrs:{placeholder:"用户名"},model:{value:t.listQuery.admin,callback:function(e){t.$set(t.listQuery,"admin",e)},expression:"listQuery.admin"}}),a("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"}}),a("el-button",{staticClass:"filter-item",attrs:{type:"primary",icon:"el-icon-search"},on:{click:t.getList}},[t._v(" 搜索 ")])],1),a("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":""}},[a("el-table-column",{attrs:{align:"center",fixed:"",label:"姓名",width:"120",prop:"name"}}),a("el-table-column",{attrs:{align:"center",label:"管理员",width:"120",prop:"username"}}),a("el-table-column",{attrs:{align:"center",width:"120",label:"头像"},scopedSlots:t._u([{key:"default",fn:function(t){return[a("el-avatar",{attrs:{size:50,src:t.row.avatar}})]}}])}),a("el-table-column",{attrs:{align:"center",label:"时段"},scopedSlots:t._u([{key:"default",fn:function(e){return t._l(e.row.days,(function(e,i){return a("div",{staticClass:"day"},[a("p",[t._v(t._s(i))]),t._v(" "+t._s((e/3600).toFixed(1))+" ")])}))}}])})],1)],1)},l=[],s={name:"Datalist",data:function(){return{list:[],listLoading:!0,listQuery:{}}},created:function(){this.getList()},methods:{getList:function(){var t=this;this.$axios.get("/admin/data/online",{params:this.listQuery}).then((function(e){t.list=e.data,t.listLoading=!1}))}}},n=s,r=(a("19b0"),a("2877")),c=Object(r["a"])(n,i,l,!1,null,"6e5382d8",null);e["default"]=c.exports},d794:function(t,e,a){}}]);
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1 @@
|
|||
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-f14cda0a"],{4697:function(t,e,n){},"5c7c":function(t,e,n){"use strict";n.r(e);var i=function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"app-container"},[n("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":""}},[n("el-table-column",{attrs:{align:"center",label:"ID",width:"60",prop:"id"}}),n("el-table-column",{attrs:{align:"center",label:"姓名",width:"80",prop:"username"}}),n("el-table-column",{attrs:{align:"center",label:"状态",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[0===e.row.isOnline?n("el-tag",{attrs:{type:"border-card"}},[t._v("下线")]):t._e(),1===e.row.isOnline?n("el-tag",{attrs:{type:"success"}},[t._v("在线")]):t._e(),2===e.row.isOnline?n("el-tag",{attrs:{type:"info"}},[t._v("没上线")]):t._e()]}}])}),n("el-table-column",{attrs:{align:"center",label:"是否分单",width:"100"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("el-switch",{attrs:{"active-value":1,"inactive-value":0},on:{change:function(n){return t.updateStatus(e.row)}},model:{value:e.row.isEndWork,callback:function(n){t.$set(e.row,"isEndWork",n)},expression:"scope.row.isEndWork"}})]}}])}),n("el-table-column",{attrs:{align:"center",label:"在线时长",width:"120"},scopedSlots:t._u([{key:"default",fn:function(e){return[t._v(" "+t._s(Math.floor((e.row.data?e.row.data.onlineTime:e.row.onlineTime)/60)||"--")+" 分钟 ")]}}])}),n("el-table-column",{attrs:{width:"138px",align:"center",label:"上线时间"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("span",[t._v(t._s(t._f("parseTime")(e.row.start_work_time,"{y}-{m}-{d} {h}:{i}")))])]}}])}),n("el-table-column",{attrs:{width:"138px",align:"center",label:"停止分单时间"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("span",[t._v(t._s(t._f("parseTime")(e.row.end_work_time,"{y}-{m}-{d} {h}:{i}")))])]}}])}),n("el-table-column",{attrs:{width:"138px",align:"center",label:"下线时间"},scopedSlots:t._u([{key:"default",fn:function(e){return[n("span",[t._v(t._s(t._f("parseTime")(e.row.last_work_time,"{y}-{m}-{d} {h}:{i}")))])]}}])})],1)],1)},a=[],l={name:"GetOnlineList",components:{},data:function(){return{statusArr:{0:"禁用",1:"启用"},list:[],total:0,loading:!1,listLoading:!0,listQuery:{page:1,limit:10,status:null,content:""},dialogCreate:!1,dialogEdit:!1,item:{},anchors:{}}},created:function(){this.listQuery.status=this.$route.query.status||null,this.listQuery.content=this.$route.query.content||null,this.getOnlineList()},methods:{getOnlineList:function(){var t=this;this.listLoading=!0,this.$axios.get("/admin/admin/getOnlineList",{params:this.listQuery}).then((function(e){t.list=e.data,t.listLoading=!1})).catch((function(){t.listLoading=!1}))},updateStatus:function(t){var e=this;this.$axios.post("/admin/admin/editInfo",{id:t.id,order_num:t.order_num,is_order:t.isEndWork}).then((function(){e.getOnlineList()})).catch((function(){}))}}},s=l,o=(n("c1db"),n("2877")),r=Object(o["a"])(s,i,a,!1,null,"2926b996",null);e["default"]=r.exports},c1db:function(t,e,n){"use strict";n("4697")}}]);
|
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue