This commit is contained in:
faiz 2024-09-02 18:03:02 +08:00
parent 9f05d996e7
commit 411f0d4b3a
3 changed files with 227 additions and 138 deletions

View File

@ -1,6 +1,11 @@
<template> <template>
<div class="navbar"> <div class="navbar">
<hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container" @toggleClick="toggleSideBar" /> <hamburger
id="hamburger-container"
:is-active="sidebar.opened"
class="hamburger-container"
@toggleClick="toggleSideBar"
/>
<breadcrumb id="breadcrumb-container" class="breadcrumb-container" /> <breadcrumb id="breadcrumb-container" class="breadcrumb-container" />
@ -13,26 +18,54 @@
<el-tooltip content="Global Size" effect="dark" placement="bottom"> <el-tooltip content="Global Size" effect="dark" placement="bottom">
<size-select id="size-select" class="right-menu-item hover-effect" /> <size-select id="size-select" class="right-menu-item hover-effect" />
</el-tooltip> --> </el-tooltip> -->
</template> </template>
<!-- <div class="right-menu-item hover-effect"> <!-- <div class="right-menu-item hover-effect">
<el-button @click="drawer = true">QA常见问题</el-button> <el-button @click="drawer = true">QA常见问题</el-button>
</div>--> </div>-->
<div v-if="$store.getters.is_anchor" class="right-menu-item hover-effect"> <div v-if="appointment_num" class="right-menu-item hover-effect">
<el-button @click="dialogWorks = true">预约待处理10</el-button> <el-button style="color: red" @click="handleAppointemnet()"
>预约待处理({{ appointment_num }})</el-button
>
</div> </div>
<div v-if="$store.getters.is_anchor" class="right-menu-item hover-effect"> <div v-if="$store.getters.is_anchor" class="right-menu-item hover-effect">
<el-button @click="dialogWorks = true">排班{{ $store.getters.name }}</el-button> <el-button @click="dialogWorks = true"
>排班{{ $store.getters.name }}</el-button
>
</div> </div>
<div class="right-menu-item hover-effect"> <div class="right-menu-item hover-effect">
<el-button :style="{backgroundColor:!workstatus?'#409EFF':'#fff',color:workstatus?'#979797':'#fff'}" @click="startWorks">{{ workstatus?'上班':'上班中' }}</el-button> <el-button
<el-button :style="{backgroundColor:workstatus?'#409EFF':'#fff',color:workstatus?'#fff':'#979797'}" @click="endWorks">{{ workstatus?'下班中':'下班' }}</el-button> :style="{
backgroundColor: !workstatus ? '#409EFF' : '#fff',
color: workstatus ? '#979797' : '#fff',
}"
@click="startWorks"
>{{ workstatus ? "上班" : "上班中" }}</el-button
>
<el-button
:style="{
backgroundColor: workstatus ? '#409EFF' : '#fff',
color: workstatus ? '#fff' : '#979797',
}"
@click="endWorks"
>{{ workstatus ? "下班中" : "下班" }}</el-button
>
</div> </div>
<el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click"> <el-dropdown
class="avatar-container right-menu-item hover-effect"
trigger="click"
>
<div class="avatar-wrapper"> <div class="avatar-wrapper">
<img :src="avatar+'?imageView2/1/w/80/h/80'" class="user-avatar" alt=""> <img
<i class="el-icon-camera" style="position: absolute;" @click.stop="showAvatar = true" /> :src="avatar + '?imageView2/1/w/80/h/80'"
class="user-avatar"
alt=""
/>
<i
class="el-icon-camera"
style="position: absolute"
@click.stop="showAvatar = true"
/>
<i class="el-icon-caret-bottom" /> <i class="el-icon-caret-bottom" />
</div> </div>
<el-dropdown-menu slot="dropdown"> <el-dropdown-menu slot="dropdown">
@ -46,18 +79,12 @@
<el-dropdown-item>修改密码</el-dropdown-item> <el-dropdown-item>修改密码</el-dropdown-item>
</div> </div>
<el-dropdown-item divided @click.native="logout"> <el-dropdown-item divided @click.native="logout">
<span style="display:block;">退出登录</span> <span style="display: block">退出登录</span>
</el-dropdown-item> </el-dropdown-item>
</el-dropdown-menu> </el-dropdown-menu>
</el-dropdown> </el-dropdown>
</div> </div>
<el-dialog <el-dialog title="提示" :visible.sync="showAvatar" width="30%" center>
title="提示"
:visible.sync="showAvatar"
width="30%"
center
>
<el-upload <el-upload
class="avatar-uploader" class="avatar-uploader"
action="/admin/index/avatar" action="/admin/index/avatar"
@ -65,10 +92,9 @@
:on-success="handleAvatarSuccess" :on-success="handleAvatarSuccess"
:before-upload="beforeAvatarUpload" :before-upload="beforeAvatarUpload"
> >
<img v-if="imageUrl" :src="imageUrl" class="avatar" alt=""> <img v-if="imageUrl" :src="imageUrl" class="avatar" alt="" />
<i v-else class="el-icon-plus avatar-uploader-icon" /> <i v-else class="el-icon-plus avatar-uploader-icon" />
</el-upload> </el-upload>
</el-dialog> </el-dialog>
<el-dialog title="修改密码" :visible.sync="dialogPWD"> <el-dialog title="修改密码" :visible.sync="dialogPWD">
@ -88,7 +114,7 @@
<el-dialog title="排班" width="90%" :visible.sync="dialogWorks"> <el-dialog title="排班" width="90%" :visible.sync="dialogWorks">
<el-form :rules="rules"> <el-form :rules="rules">
<el-row style="margin-bottom: 10px;"> <el-row style="margin-bottom: 10px">
<el-col :span="24"> <el-col :span="24">
<el-date-picker <el-date-picker
v-model="times[0]" v-model="times[0]"
@ -98,7 +124,7 @@
/> />
</el-col> </el-col>
</el-row> </el-row>
<el-row style="margin-bottom: 10px;"> <el-row style="margin-bottom: 10px">
<el-col :span="24"> <el-col :span="24">
<el-date-picker <el-date-picker
v-model="times[1]" v-model="times[1]"
@ -108,10 +134,15 @@
/> />
</el-col> </el-col>
</el-row> </el-row>
<el-row style="margin-bottom: 10px;"> <el-row style="margin-bottom: 10px">
<el-col :span="24"> <el-col :span="24">
<el-checkbox-group v-model="os"> <el-checkbox-group v-model="os">
<el-checkbox v-for="(v,i,k) in $store.getters.oss" :key="k" :label="i">{{ v }}</el-checkbox> <el-checkbox
v-for="(v, i, k) in $store.getters.oss"
:key="k"
:label="i"
>{{ v }}</el-checkbox
>
</el-checkbox-group> </el-checkbox-group>
</el-col> </el-col>
</el-row> </el-row>
@ -129,10 +160,21 @@
:modal="false" :modal="false"
> >
<div v-clickoutside="handleClose" class="drawer"> <div v-clickoutside="handleClose" class="drawer">
<el-button v-if="QaShow" type="success" @click="drawer = false"> </el-button> <el-button v-if="QaShow" type="success" @click="drawer = false"
<el-button v-if="!QaShow" type="success" @click="QaShow = true"> </el-button> > </el-button
>
<el-button v-if="!QaShow" type="success" @click="QaShow = true"
> </el-button
>
<div v-if="QaShow" class="mod"> <div v-if="QaShow" class="mod">
<el-button v-for="item in getQaCityList" :key="item.city_id" style="width: 150px;" size="medium" type="primary" @click="clickQaList(item)"> <el-button
v-for="item in getQaCityList"
:key="item.city_id"
style="width: 150px"
size="medium"
type="primary"
@click="clickQaList(item)"
>
{{ item.city_name }} {{ item.city_name }}
</el-button> </el-button>
</div> </div>
@ -148,17 +190,17 @@
</template> </template>
<script> <script>
import { mapGetters } from 'vuex' import { mapGetters } from "vuex";
import Breadcrumb from '@/components/Breadcrumb' import Breadcrumb from "@/components/Breadcrumb";
import Hamburger from '@/components/Hamburger' import Hamburger from "@/components/Hamburger";
import Screenfull from '@/components/Screenfull' import Screenfull from "@/components/Screenfull";
import SizeSelect from '@/components/SizeSelect' import SizeSelect from "@/components/SizeSelect";
import Search from '@/components/HeaderSearch' import Search from "@/components/HeaderSearch";
import { color } from 'echarts/lib/export' import { color } from "echarts/lib/export";
import sidebar from '@/layout/components/Sidebar/index.vue' import sidebar from "@/layout/components/Sidebar/index.vue";
import avatar from 'element-ui/packages/avatar' import avatar from "element-ui/packages/avatar";
import {getQaCityList, getQaList} from '@/api/qa' import { getQaCityList, getQaList } from "@/api/qa";
import clickoutside from 'element-ui/src/utils/clickoutside' import clickoutside from "element-ui/src/utils/clickoutside";
export default { export default {
directives: { clickoutside }, directives: { clickoutside },
components: { components: {
@ -167,20 +209,22 @@ export default {
Screenfull, Screenfull,
SizeSelect, SizeSelect,
// eslint-disable-next-line vue/no-unused-Wangeditor // eslint-disable-next-line vue/no-unused-Wangeditor
Search Search,
},
props: {
appointment_num: {
type: Number,
default: 0,
},
}, },
computed: { computed: {
avatar() { avatar() {
return avatar return avatar;
}, },
sidebar() { sidebar() {
return sidebar return sidebar;
}, },
...mapGetters([ ...mapGetters(["sidebar", "avatar", "device"]),
'sidebar',
'avatar',
'device'
])
}, },
// eslint-disable-next-line vue/order-in-Wangeditor // eslint-disable-next-line vue/order-in-Wangeditor
data() { data() {
@ -198,112 +242,143 @@ export default {
getQaLists: [], getQaLists: [],
times: [], times: [],
form: { form: {
oldpwd: '', oldpwd: "",
pwd: '' pwd: "",
}, },
QaInfo: { QaInfo: {
title: '', title: "",
content: '' content: "",
}, },
rules: { rules: {
oldpwd: [ oldpwd: [
{ required: true, message: '请输入旧密码', trigger: 'blur' }, { required: true, message: "请输入旧密码", trigger: "blur" },
{ min: 6, max: 20, message: '长度在 6 到 20 个字符', trigger: 'blur' } {
min: 6,
max: 20,
message: "长度在 6 到 20 个字符",
trigger: "blur",
},
], ],
pwd: [ pwd: [
{ required: true, message: '请输入密码', trigger: 'blur' }, { required: true, message: "请输入密码", trigger: "blur" },
{ min: 6, max: 20, message: '长度在 6 到 20 个字符', trigger: 'blur' } {
] min: 6,
} max: 20,
} message: "长度在 6 到 20 个字符",
trigger: "blur",
},
],
},
};
}, },
created() { created() {
this.getworkstatus() this.getworkstatus();
getQaCityList().then(res => { getQaCityList().then((res) => {
this.getQaCityList = res.data this.getQaCityList = res.data;
}) });
}, },
methods: { methods: {
color, color,
toggleSideBar() { toggleSideBar() {
this.$store.dispatch('app/toggleSideBar') this.$store.dispatch("app/toggleSideBar");
}, },
handleClose() { handleClose() {
this.drawer = false this.drawer = false;
this.QaShow = true this.QaShow = true;
}, },
clickQaList(data) { clickQaList(data) {
getQaList(data.city_id).then(res => { getQaList(data.city_id).then((res) => {
this.getQaLists = res.data this.getQaLists = res.data;
}) });
console.log(JSON.stringify(this.getQaLists)) console.log(JSON.stringify(this.getQaLists));
if (!this.getQaLists) { if (!this.getQaLists) {
return this.$message({ return this.$message({
message: '暂无QA问题', message: "暂无QA问题",
type: 'warning', type: "warning",
duration: 1500 duration: 1500,
}) });
} }
this.QaShow = false this.QaShow = false;
}, },
async logout() { async logout() {
await this.$store.dispatch('user/logout') await this.$store.dispatch("user/logout");
this.$router.push(`/login?redirect=${this.$route.fullPath}`) this.$router.push(`/login?redirect=${this.$route.fullPath}`);
}, },
handleAvatarSuccess(res, file) { handleAvatarSuccess(res, file) {
this.imageUrl = URL.createObjectURL(file.raw) this.imageUrl = URL.createObjectURL(file.raw);
}, },
pwd() { pwd() {
this.$axios.post('/admin/admin/pwd', this.form).then(res => { this.$axios
this.dialogPWD = false .post("/admin/admin/pwd", this.form)
this.form = {} .then((res) => {
}).catch(err => { this.dialogPWD = false;
console.log(err) this.form = {};
}) })
.catch((err) => {
console.log(err);
});
}, },
saveWork() { saveWork() {
this.$axios.post('/admin/work/save2', { times: this.times, os: this.os }).then(res => { this.$axios
console.log(res) .post("/admin/work/save2", { times: this.times, os: this.os })
.then((res) => {
console.log(res);
this.$message({ this.$message({
showClose: true, showClose: true,
message: '添加成功' message: "添加成功",
}) });
this.dialogWorks = false this.dialogWorks = false;
}).catch(err => {
console.log(err)
}) })
.catch((err) => {
console.log(err);
});
}, },
startWorks() { startWorks() {
this.$axios.post('/admin/admin/editInfo', { is_order: 1 }).then(res => { this.$axios
console.log(res) .post("/admin/admin/editInfo", { is_order: 1 })
.then((res) => {
console.log(res);
this.$message({ this.$message({
showClose: true, showClose: true,
message: '上班成功' message: "上班成功",
}) });
this.getworkstatus() this.getworkstatus();
}).catch(err => {
console.log(err)
}) })
.catch((err) => {
console.log(err);
});
}, },
endWorks() { endWorks() {
this.$axios.post('/admin/admin/editInfo', { is_order: 0 }).then(res => { this.$axios
console.log(res) .post("/admin/admin/editInfo", { is_order: 0 })
.then((res) => {
console.log(res);
this.$message({ this.$message({
showClose: true, showClose: true,
message: '下班成功' message: "下班成功",
}) });
this.getworkstatus() this.getworkstatus();
}).catch(err => {
console.log(err)
}) })
.catch((err) => {
console.log(err);
});
}, },
getworkstatus() { getworkstatus() {
this.$axios.post('/admin/work/getworkstatus', { id: this.id }).then(res => { this.$axios
console.log(res) .post("/admin/work/getworkstatus", { id: this.id })
this.workstatus = res.data .then((res) => {
}).catch(err => { console.log(res);
console.log(err) this.workstatus = res.data;
}) })
.catch((err) => {
console.log(err);
});
},
handleAppointemnet() {
this.$router.push({
path: "/order/index/",
query: { appointment_status: "1", refresh: Date.now() },
});
}, },
beforeAvatarUpload(file) { beforeAvatarUpload(file) {
/*const isJPG = file.type === 'image/jpeg' /*const isJPG = file.type === 'image/jpeg'
@ -316,9 +391,9 @@ export default {
this.$message.error('上传头像图片大小不能超过 2MB!') this.$message.error('上传头像图片大小不能超过 2MB!')
} }
return isJPG && isLt2M*/ return isJPG && isLt2M*/
} },
} },
} };
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@ -351,18 +426,18 @@ export default {
overflow: hidden; overflow: hidden;
position: relative; position: relative;
background: #fff; background: #fff;
box-shadow: 0 1px 4px rgba(0,21,41,.08); box-shadow: 0 1px 4px rgba(0, 21, 41, 0.08);
.hamburger-container { .hamburger-container {
line-height: 46px; line-height: 46px;
height: 100%; height: 100%;
float: left; float: left;
cursor: pointer; cursor: pointer;
transition: background .3s; transition: background 0.3s;
-webkit-tap-highlight-color: transparent; -webkit-tap-highlight-color: transparent;
&:hover { &:hover {
background: rgba(0, 0, 0, .025) background: rgba(0, 0, 0, 0.025);
} }
} }
@ -394,10 +469,10 @@ export default {
&.hover-effect { &.hover-effect {
cursor: pointer; cursor: pointer;
transition: background .3s; transition: background 0.3s;
&:hover { &:hover {
background: rgba(0, 0, 0, .025) background: rgba(0, 0, 0, 0.025);
} }
} }
} }
@ -436,7 +511,7 @@ export default {
overflow: hidden; overflow: hidden;
} }
.avatar-uploader .el-upload:hover { .avatar-uploader .el-upload:hover {
border-color: #409EFF; border-color: #409eff;
} }
.avatar-uploader-icon { .avatar-uploader-icon {
border: 1px solid #979797; border: 1px solid #979797;

View File

@ -8,7 +8,7 @@
<sidebar class="sidebar-container" /> <sidebar class="sidebar-container" />
<div :class="{ hasTagsView: needTagsView }" class="main-container"> <div :class="{ hasTagsView: needTagsView }" class="main-container">
<div :class="{ 'fixed-header': fixedHeader }"> <div :class="{ 'fixed-header': fixedHeader }">
<navbar /> <navbar :appointment_num="appointment_num" />
<tags-view v-if="needTagsView" /> <tags-view v-if="needTagsView" />
</div> </div>
<app-main /> <app-main />
@ -57,6 +57,7 @@ export default {
data() { data() {
return { return {
iswork: null, iswork: null,
appointment_num: 0,
}; };
}, },
created() { created() {
@ -66,6 +67,11 @@ export default {
this.$axios this.$axios
.get("/admin/index/iswork") .get("/admin/index/iswork")
.then((res) => { .then((res) => {
// console.log(res);
this.appointment_num = res.data.appointment_num;
console.log(this.appointment_num);
if (res && res.data.new > 0) { if (res && res.data.new > 0) {
this.$notify({ this.$notify({
title: "新的订单提醒", title: "新的订单提醒",
@ -133,7 +139,7 @@ export default {
.catch((err) => { .catch((err) => {
console.log(err); console.log(err);
}); });
}, 30000); }, 3000);
}, },
methods: { methods: {
handleClickOutside() { handleClickOutside() {

View File

@ -171,12 +171,13 @@
同步 同步
</el-button> </el-button>
<el-button v-if="scope.row.appointment_status == 1" <el-button
v-if="scope.row.appointment_status == 1"
size="small" size="small"
icon="el-icon-edit" icon="el-icon-edit"
@click="onOneClickYyHandle(scope.row)" @click="onOneClickYyHandle(scope.row)"
> >
预约处理 预约处理
</el-button> </el-button>
</el-button-group> </el-button-group>
</template> </template>
@ -249,7 +250,13 @@
}" }"
type="primary" type="primary"
> >
{{ scope.row.appointment_status == 1 ? "已预约(未处理)" : (scope.row.appointment_status == 2 ? "已预约(已处理)":"未预约") }} {{
scope.row.appointment_status == 1
? "已预约(未处理)"
: scope.row.appointment_status == 2
? "已预约(已处理)"
: "未预约"
}}
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
@ -699,6 +706,7 @@ export default {
this.setQuery("status"); this.setQuery("status");
this.setQuery("os_status"); this.setQuery("os_status");
this.setQuery("times"); this.setQuery("times");
this.setQuery("appointment_status");
// await this.getList(); // await this.getList();
// if (!this.$route.query.id) { // if (!this.$route.query.id) {
// await this.setOneClickRepair(); // await this.setOneClickRepair();