|
|
@@ -9,20 +9,20 @@
|
|
|
</view>
|
|
|
<view class="bottom">
|
|
|
<view class="bottom_box">
|
|
|
- <view class="box_num">100</view>
|
|
|
+ <view class="box_num">{{ workCount }}</view>
|
|
|
<view class="box_info">工单数</view>
|
|
|
</view>
|
|
|
|
|
|
<view class="bottom_box">
|
|
|
- <view class="box_num">10</view>
|
|
|
+ <view class="box_num">{{ processCount }}</view>
|
|
|
<view class="box_info">处理中</view>
|
|
|
</view>
|
|
|
<view class="bottom_box">
|
|
|
- <view class="box_num">50</view>
|
|
|
+ <view class="box_num">{{ finishCount }}</view>
|
|
|
<view class="box_info">已完成</view>
|
|
|
</view>
|
|
|
<view class="bottom_box">
|
|
|
- <view class="box_num">60</view>
|
|
|
+ <view class="box_num">{{ timeoutCount }}</view>
|
|
|
<view class="box_info">已超时</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -31,26 +31,26 @@
|
|
|
<!-- 状态统计区域 维修师傅端 -->
|
|
|
<view class="top_types" v-else>
|
|
|
<view class="types_box">
|
|
|
- <view class="box_num">100</view>
|
|
|
+ <view class="box_num">{{ workCount }}</view>
|
|
|
<view class="box_info">工单数</view>
|
|
|
</view>
|
|
|
|
|
|
<view class="types_box">
|
|
|
- <view class="box_num">10</view>
|
|
|
+ <view class="box_num">{{ processCount }}</view>
|
|
|
<view class="box_info">处理中</view>
|
|
|
</view>
|
|
|
<view class="types_box">
|
|
|
- <view class="box_num">50</view>
|
|
|
+ <view class="box_num">{{ finishCount }}</view>
|
|
|
<view class="box_info">已完成</view>
|
|
|
</view>
|
|
|
<view class="types_box">
|
|
|
- <view class="box_num">60</view>
|
|
|
+ <view class="box_num">{{ timeoutCount }}</view>
|
|
|
<view class="box_info">已超时</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<!-- 排班区域 -->
|
|
|
- <view class="watch">
|
|
|
+ <view class="watch" v-if="tableData.length">
|
|
|
<view class="watch_title">
|
|
|
<img src="../../static/images/repairsImg/watch.png" />
|
|
|
排班
|
|
|
@@ -60,27 +60,26 @@
|
|
|
<!-- 表头行 -->
|
|
|
<uni-tr>
|
|
|
<uni-th width="80" align="center">姓名</uni-th>
|
|
|
- <uni-th width="50" align="center">工种</uni-th>
|
|
|
+ <uni-th width="60" align="center">工种</uni-th>
|
|
|
<uni-th width="80" align="center">接单状态</uni-th>
|
|
|
<uni-th width="70" align="center">值班班次</uni-th>
|
|
|
</uni-tr>
|
|
|
<!-- 表格数据行 -->
|
|
|
<uni-tr v-for="(item, index) in tableData" :key="index">
|
|
|
<!-- 姓名区域 -->
|
|
|
- <uni-td align="center">{{ item.name }}</uni-td>
|
|
|
+ <uni-td align="center">{{ item.userName }}</uni-td>
|
|
|
<!-- 工种区域 -->
|
|
|
- <uni-td align="center">{{ item.type }}</uni-td>
|
|
|
+ <uni-td align="center">{{ item.workTypeName }}</uni-td>
|
|
|
<!-- 状态区域 -->
|
|
|
<uni-td align="center">
|
|
|
<picker :disabled="!btns.includes('表格编辑')" @change="bindPickerChange($event, item)" :range="typeArray">
|
|
|
- <view class="watch_color" v-if="item.status == '0'">{{ typeArray[item.status] }}</view>
|
|
|
- <view class="watch_color2" v-if="item.status == '1'">{{ typeArray[item.status] }}</view>
|
|
|
- <view class="watch_color3" v-if="item.status == '2'">{{ typeArray[item.status] }}</view>
|
|
|
+ <view class="watch_color2" v-if="item.state === 1">{{ typeArray[item.state - 1] }}</view>
|
|
|
+ <view class="watch_color3" v-if="item.state === 2">{{ typeArray[item.state - 1] }}</view>
|
|
|
</picker>
|
|
|
</uni-td>
|
|
|
<!-- 是否值班 -->
|
|
|
<uni-td align="center">
|
|
|
- <view @click="handleChange(item, index)">{{ getCutting(item.work) }}</view>
|
|
|
+ <view @click="handleChange(item, index)">{{ getCutting(item.shifts || []) || '暂无排班' }}</view>
|
|
|
</uni-td>
|
|
|
</uni-tr>
|
|
|
</uni-table>
|
|
|
@@ -96,9 +95,9 @@
|
|
|
<view class="poop_body">
|
|
|
<view class="body_item" v-for="item in workArray" :key="item.id" @click="handleChangeWork(item)">
|
|
|
<view class="body_item_info">
|
|
|
- {{ item.text }}
|
|
|
+ {{ item.name }}
|
|
|
</view>
|
|
|
- <view class="body_item_icon" v-if="defaultList.some((ele) => ele.text == item.text)">✔</view>
|
|
|
+ <view class="body_item_icon" v-if="defaultList.some((ele) => ele.name == item.name)">✔</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
</view>
|
|
|
@@ -106,7 +105,7 @@
|
|
|
</view>
|
|
|
|
|
|
<!-- 排行榜区域 -->
|
|
|
- <view class="rank">
|
|
|
+ <view class="rank" v-if="btns.includes('图表')">
|
|
|
<view class="rank_title">
|
|
|
<img src="../../static/images/repairsImg/rank.png" />
|
|
|
工单完成排行榜
|
|
|
@@ -114,14 +113,14 @@
|
|
|
<!-- 排行榜柱状图 -->
|
|
|
<view class="rank_charts">
|
|
|
<!-- 加上canvas2d属性后 模拟器上图表显示异常,真机调试没有问题,开发时不添加canvas2d属性,发布时添加canvas2d属性 -->
|
|
|
- <qiun-data-charts canvas2d type="bar" :opts="opts" :chartData="chartData" />
|
|
|
+ <qiun-data-charts type="bar" :opts="opts" :chartData="chartData" />
|
|
|
</view>
|
|
|
</view>
|
|
|
|
|
|
<!-- 悬浮按钮区域 -->
|
|
|
<view class="fixed">
|
|
|
<img src="../../static/images/repairsImg/add.png" @click="handleGoRepairs" />
|
|
|
- <uni-badge :offset="[5, 5]" absolute="rightTop" text="8">
|
|
|
+ <uni-badge :offset="[5, 5]" absolute="rightTop" :text="msgTotal">
|
|
|
<img class="img" src="../../static/images/repairsImg/message.png" @click="handleGoMsg" />
|
|
|
</uni-badge>
|
|
|
</view>
|
|
|
@@ -139,36 +138,28 @@ export default {
|
|
|
// 改变的是第几个索引
|
|
|
changeIndex: 0,
|
|
|
// 排班状态数组
|
|
|
- typeArray: ['接单中', '订单饱和', '停止接单'],
|
|
|
+ typeArray: ['大量接单', '停止接单'],
|
|
|
// 值班状态数组
|
|
|
- workArray: [
|
|
|
- {
|
|
|
- id: 0,
|
|
|
- text: '正常班次'
|
|
|
- },
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- text: '值班班次'
|
|
|
- }
|
|
|
- ],
|
|
|
+ workArray: [],
|
|
|
// 分段器数组数据
|
|
|
items: ['团队数据统计', '个人数据统计'],
|
|
|
// 分段器当前索引
|
|
|
current: 0,
|
|
|
// 柱状图数据
|
|
|
chartData: {
|
|
|
- categories: ['张三', '李四', '王五', '老六', '刘八'],
|
|
|
+ categories: [],
|
|
|
series: [
|
|
|
{
|
|
|
name: '好评数',
|
|
|
- data: [45, 36, 31, 33, 13]
|
|
|
+ data: []
|
|
|
},
|
|
|
{
|
|
|
name: '完成数',
|
|
|
- data: [18, 27, 21, 24, 6]
|
|
|
+ data: []
|
|
|
}
|
|
|
]
|
|
|
},
|
|
|
+ // 柱状图配置
|
|
|
opts: {
|
|
|
color: ['#1890FF', '#91CB74'],
|
|
|
padding: [15, 30, 0, 5],
|
|
|
@@ -192,121 +183,185 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 表格数据
|
|
|
- // status状态: 0 接单中 1 订单饱和 2 停止接单
|
|
|
- // work状态: 0 正常班次 1 值班班次
|
|
|
- tableData: [
|
|
|
- {
|
|
|
- name: '张三',
|
|
|
- type: '电工',
|
|
|
- status: 0,
|
|
|
- work: [
|
|
|
- {
|
|
|
- id: 0,
|
|
|
- text: '正常班次'
|
|
|
- },
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- text: '值班班次'
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- name: '张三三',
|
|
|
- type: '泥工',
|
|
|
- status: 1,
|
|
|
- work: [
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- text: '值班班次'
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- name: '张三',
|
|
|
- type: '电工',
|
|
|
- status: 2,
|
|
|
- work: [
|
|
|
- {
|
|
|
- id: 0,
|
|
|
- text: '正常班次'
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- name: '张三三',
|
|
|
- type: '泥工',
|
|
|
- status: 0,
|
|
|
- work: [
|
|
|
- {
|
|
|
- id: 1,
|
|
|
- text: '值班班次'
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- name: '张三',
|
|
|
- type: '电工',
|
|
|
- status: 1,
|
|
|
- work: [
|
|
|
- {
|
|
|
- id: 0,
|
|
|
- text: '正常班次'
|
|
|
- }
|
|
|
- ]
|
|
|
- },
|
|
|
- {
|
|
|
- name: '张三三',
|
|
|
- type: '泥工',
|
|
|
- status: 2,
|
|
|
- work: [
|
|
|
- {
|
|
|
- id: 0,
|
|
|
- text: '正常班次'
|
|
|
- }
|
|
|
- ]
|
|
|
- }
|
|
|
- ]
|
|
|
+ tableData: [],
|
|
|
+ schoolId: '',
|
|
|
+ userId: '',
|
|
|
+ // 工单数单数
|
|
|
+ workCount: '',
|
|
|
+ // 处理中单数
|
|
|
+ processCount: '',
|
|
|
+ // 已完成单数
|
|
|
+ finishCount: '',
|
|
|
+ // 已超时单数
|
|
|
+ timeoutCount: '',
|
|
|
+ // 当前页
|
|
|
+ currentPage: 1,
|
|
|
+ // 每页多少条数据
|
|
|
+ pageCount: 100,
|
|
|
+ // 总条数
|
|
|
+ total: null,
|
|
|
+ // 信息列表
|
|
|
+ msgList: [],
|
|
|
+ // 信息总数
|
|
|
+ msgTotal: 0
|
|
|
}
|
|
|
},
|
|
|
mounted() {
|
|
|
console.log('主页页面加载')
|
|
|
const repairsUserInfo = uni.getStorageSync('repairsUserInfo')
|
|
|
this.btns = repairsUserInfo.btns
|
|
|
+ this.schoolId = repairsUserInfo.schoolId
|
|
|
+ this.userId = repairsUserInfo.userId
|
|
|
console.log(this.btns)
|
|
|
+ if (this.btns.includes('图表')) {
|
|
|
+ this.getChartData()
|
|
|
+ }
|
|
|
+ if (this.btns.includes('表格编辑')) {
|
|
|
+ this.getWatchClass()
|
|
|
+ }
|
|
|
+ if (this.btns.includes('首页分段器')) {
|
|
|
+ this.getTeamCount()
|
|
|
+ } else {
|
|
|
+ this.getCount()
|
|
|
+ }
|
|
|
+ this.getWatchData()
|
|
|
+ this.getMsgList()
|
|
|
},
|
|
|
methods: {
|
|
|
- // 是否值班弹窗确定按钮回调
|
|
|
- handlePopConfirm() {
|
|
|
- uni.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '确定修改是否值班状态吗?',
|
|
|
- success: (res) => {
|
|
|
- if (res.confirm) {
|
|
|
- this.tableData[this.changeIndex].work = this.defaultList
|
|
|
- console.log('用户点击确定')
|
|
|
- } else if (res.cancel) {
|
|
|
- console.log('用户点击取消')
|
|
|
- }
|
|
|
+ // 获取信息列表数据
|
|
|
+ async getMsgList() {
|
|
|
+ const res = await this.$myRequest_repairs({
|
|
|
+ url: '/repairSystemMessages/querySystemMessagePage',
|
|
|
+ data: {
|
|
|
+ currentPage: 1,
|
|
|
+ pageCount: 10,
|
|
|
+ userId: this.userId
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // console.log(res)
|
|
|
+ if (res.code === '200') {
|
|
|
+ this.msgTotal = res.data.totalCount
|
|
|
+ this.msgList = res.data.list
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取图表数据
|
|
|
+ async getChartData() {
|
|
|
+ const res = await this.$myRequest_repairs({
|
|
|
+ url: '/repairUser/queryPositiveReviewPage',
|
|
|
+ data: {
|
|
|
+ currentPage: 1,
|
|
|
+ pageCount: 100,
|
|
|
+ schoolId: this.schoolId
|
|
|
}
|
|
|
})
|
|
|
+ // console.log(res)
|
|
|
+ if (res.code === '200') {
|
|
|
+ // 姓名数组
|
|
|
+ this.chartData.categories = res.data.list.map((ele) => ele.userName)
|
|
|
+ // 好评数数组
|
|
|
+ this.chartData.series[0].data = res.data.list.map((ele) => ele.evaluateCount)
|
|
|
+ // 完成数数组
|
|
|
+ this.chartData.series[1].data = res.data.list.map((ele) => ele.finishCount)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取排班班次数组
|
|
|
+ async getWatchClass() {
|
|
|
+ const res = await this.$myRequest_repairs({
|
|
|
+ url: '/repairShiftSettings/queryPageRepairShiftSettings',
|
|
|
+ data: {
|
|
|
+ currentPage: 1,
|
|
|
+ pageCount: 100,
|
|
|
+ name: ''
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // console.log(res)
|
|
|
+ if (res.code === '200') {
|
|
|
+ this.workArray = res.data.list
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取排班数据
|
|
|
+ async getWatchData() {
|
|
|
+ const res = await this.$myRequest_repairs({
|
|
|
+ url: '/repairClassesSettings/queryPageUserClasses',
|
|
|
+ data: {
|
|
|
+ currentPage: this.currentPage,
|
|
|
+ pageCount: this.pageCount,
|
|
|
+ schoolId: this.schoolId
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // console.log(res)
|
|
|
+ if (res.code === '200') {
|
|
|
+ this.total = res.data.totalCount
|
|
|
+ this.tableData = res.data.list
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取团队数据统计单数
|
|
|
+ async getTeamCount() {
|
|
|
+ const res = await this.$myRequest_repairs({
|
|
|
+ url: '/repairRecord/queryLogisticHomeCount',
|
|
|
+ data: {
|
|
|
+ schoolId: this.schoolId
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // console.log(res)
|
|
|
+ if (res.code === '200') {
|
|
|
+ this.workCount = res.data.workCount
|
|
|
+ this.processCount = res.data.processCount
|
|
|
+ this.finishCount = res.data.finishCount
|
|
|
+ this.timeoutCount = res.data.timeoutCount
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 获取个人数据统计单数
|
|
|
+ async getCount() {
|
|
|
+ const res = await this.$myRequest_repairs({
|
|
|
+ url: '/repairRecord/queryMasterHomeCount',
|
|
|
+ data: {
|
|
|
+ userId: this.userId
|
|
|
+ }
|
|
|
+ })
|
|
|
+ // console.log(res)
|
|
|
+ if (res.code === '200') {
|
|
|
+ this.workCount = res.data.workCount
|
|
|
+ this.processCount = res.data.processCount
|
|
|
+ this.finishCount = res.data.finishCount
|
|
|
+ this.timeoutCount = res.data.timeoutCount
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 是否值班弹窗确定按钮回调
|
|
|
+ handlePopConfirm() {
|
|
|
+ // uni.showModal({
|
|
|
+ // title: '提示',
|
|
|
+ // content: '确定修改是否值班状态吗?',
|
|
|
+ // success: (res) => {
|
|
|
+ // if (res.confirm) {
|
|
|
+ // this.tableData[this.changeIndex].shifts = this.defaultList
|
|
|
+ // console.log('用户点击确定')
|
|
|
+ // } else if (res.cancel) {
|
|
|
+ // console.log('用户点击取消')
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // })
|
|
|
this.$refs.popup_work.close()
|
|
|
+ this.tableData[this.changeIndex].shifts = this.defaultList
|
|
|
+ // console.log(this.tableData[this.changeIndex])
|
|
|
+ this.handleEdit(this.tableData[this.changeIndex])
|
|
|
},
|
|
|
// 点击值班状态回调
|
|
|
handleChange(item, index) {
|
|
|
if (this.btns.includes('表格编辑')) {
|
|
|
this.$refs.popup_work.open('bottom')
|
|
|
this.changeIndex = index
|
|
|
- this.defaultList = JSON.parse(JSON.stringify(item.work))
|
|
|
+ this.defaultList = JSON.parse(JSON.stringify(item.shifts || []))
|
|
|
}
|
|
|
},
|
|
|
// 切换值班状态回调
|
|
|
handleChangeWork(item) {
|
|
|
let temIndex
|
|
|
let flag = this.defaultList.some((ele, index) => {
|
|
|
- if (ele.text == item.text) {
|
|
|
+ if (ele.name == item.name) {
|
|
|
temIndex = index
|
|
|
}
|
|
|
- return ele.text == item.text
|
|
|
+ return ele.name == item.name
|
|
|
})
|
|
|
if (flag) {
|
|
|
this.defaultList.splice(temIndex, 1)
|
|
|
@@ -319,24 +374,60 @@ export default {
|
|
|
|
|
|
// 切换接单状态回调
|
|
|
bindPickerChange(e, item) {
|
|
|
- uni.showModal({
|
|
|
- title: '提示',
|
|
|
- content: '确定修改接单状态吗?',
|
|
|
- success: (res) => {
|
|
|
- if (res.confirm) {
|
|
|
- item.status = e.detail.value
|
|
|
- console.log('用户点击确定')
|
|
|
- } else if (res.cancel) {
|
|
|
- console.log('用户点击取消')
|
|
|
- }
|
|
|
+ // uni.showModal({
|
|
|
+ // title: '提示',
|
|
|
+ // content: '确定修改接单状态吗?',
|
|
|
+ // success: (res) => {
|
|
|
+ // if (res.confirm) {
|
|
|
+ // item.state = e.detail.value + 1
|
|
|
+ // console.log('用户点击确定')
|
|
|
+ // } else if (res.cancel) {
|
|
|
+ // console.log('用户点击取消')
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ item.state = e.detail.value * 1 + 1
|
|
|
+ if (item.state === 1) {
|
|
|
+ item.stateStr = '大量接单'
|
|
|
+ } else {
|
|
|
+ item.stateStr = '停止接单'
|
|
|
+ }
|
|
|
+ this.handleEdit(item)
|
|
|
+ },
|
|
|
+ // 修改排班表请求
|
|
|
+ async handleEdit(item) {
|
|
|
+ const res = await this.$myRequest_repairs({
|
|
|
+ url: '/repairClassesSettings/updateUserClasses',
|
|
|
+ method: 'post',
|
|
|
+ data: {
|
|
|
+ id: item.id,
|
|
|
+ userName: item.userName,
|
|
|
+ userPhone: item.userPhone,
|
|
|
+ workTypeName: item.workTypeName,
|
|
|
+ state: item.state,
|
|
|
+ stateStr: item.stateStr,
|
|
|
+ classId: item.classId,
|
|
|
+ shifts: item.shifts
|
|
|
}
|
|
|
})
|
|
|
+ // console.log(res)
|
|
|
+ if (res.code === '200') {
|
|
|
+ uni.showToast({
|
|
|
+ title: '编辑成功',
|
|
|
+ icon: 'success'
|
|
|
+ })
|
|
|
+ setTimeout(() => {
|
|
|
+ this.getWatchData()
|
|
|
+ this.getWatchClass()
|
|
|
+ }, 1500)
|
|
|
+ }
|
|
|
},
|
|
|
|
|
|
// 点击悬浮消息按钮回调
|
|
|
handleGoMsg() {
|
|
|
+ const list = JSON.stringify(this.msgList)
|
|
|
uni.navigateTo({
|
|
|
- url: '/pagesRepairs/message/message'
|
|
|
+ url: `/pagesRepairs/message/message?list=${list}&total=${this.msgTotal}`
|
|
|
})
|
|
|
},
|
|
|
// 点击悬浮加号按钮回调
|
|
|
@@ -351,16 +442,23 @@ export default {
|
|
|
if (this.current != e.currentIndex) {
|
|
|
this.current = e.currentIndex
|
|
|
console.log(this.current)
|
|
|
+ if (this.current === 0) {
|
|
|
+ // 团队数据
|
|
|
+ this.getTeamCount()
|
|
|
+ } else {
|
|
|
+ // 个人数据
|
|
|
+ this.getCount()
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
// 把数组每一项的第一个文字切割出来
|
|
|
getCutting(list) {
|
|
|
let str = ''
|
|
|
list.forEach((ele, index) => {
|
|
|
- if (index + 1 == list.length && list.length > 1) {
|
|
|
- str += '、' + ele.text.substring(0, 1)
|
|
|
+ if (index !== 0 && list.length > 1) {
|
|
|
+ str += '、' + ele.name.substring(0, 1)
|
|
|
} else {
|
|
|
- str += ele.text.substring(0, 1)
|
|
|
+ str += ele.name.substring(0, 1)
|
|
|
}
|
|
|
})
|
|
|
return str
|
|
|
@@ -470,10 +568,6 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- .watch_color {
|
|
|
- color: #6fb6b8;
|
|
|
- }
|
|
|
-
|
|
|
.watch_color2 {
|
|
|
color: #1e7dfb;
|
|
|
}
|