@@ -168,14 +171,14 @@ import {
} from '@/api/admin/repair/repairStats'
//常量计算当前周的开始与结束
-const initStart=moment().startOf('isoWeek'),initEnd=moment().endOf('isoWeek');
+const initStart = moment().startOf('isoWeek'), initEnd = moment().endOf('isoWeek')
export default {
name: 'RepairStatistics',
components: {
STable
},
- data () {
+ data() {
return {
dateRange2: [initStart, initEnd],
dateRange3L: [initStart, initEnd],
@@ -258,7 +261,7 @@ export default {
loadData: []
}
},
- mounted () {
+ mounted() {
this.adminStats()//第一行工单统计
this.repairCount2()//第二行 工单统计
this.repairCount3L()//三行 工单完成情况
@@ -269,104 +272,112 @@ export default {
this.deviceTypeStats()//第五行 设备、品牌、评价 统计
},
methods: {
- onChange2 () {
- this.repairCount2();
+ // 跳转工单
+ dispatchCase(status) {
+ this.$router.push({ name: 'repair', query: { status } })
+ },
+ // 跳转通知
+ jumpInfo(tabKey) {
+ this.$router.push({ name: 'messageNotice', query: { tabKey } })
+ },
+ onChange2() {
+ this.repairCount2()
},
onChange3L() {
- this.repairCount3L();
+ this.repairCount3L()
},
onChange3R() {
- this.repairCount3R();
+ this.repairCount3R()
},
- onChange4L(){
- this.floorStats();
+ onChange4L() {
+ this.floorStats()
},
- onChange4R1(){
- this.deviceStats();
+ onChange4R1() {
+ this.deviceStats()
},
- onChange4R2(){
- this.failureStats();
+ onChange4R2() {
+ this.failureStats()
},
- onChange5(){
- this.deviceTypeStats();
+ onChange5() {
+ this.deviceTypeStats()
},
- adminStats () {
+ adminStats() {
repairAdminStats().then(res => {
this.adminStatsCount = res.repairAdminStats
})
},
- repairCount2 (){
- const startDate = this.dateRange2[0].format('YYYY-MM-DD');
- const endDate = this.dateRange2[1].format('YYYY-MM-DD');
+ repairCount2() {
+ const startDate = this.dateRange2[0].format('YYYY-MM-DD')
+ const endDate = this.dateRange2[1].format('YYYY-MM-DD')
repairStats({ startDate: startDate, endDate: endDate, type: 'repair' }).then(res => {
this.repairStatsCount = res.data.stats
})
},
- repairCount3L (){
- const startDate = this.dateRange3L[0].format('YYYY-MM-DD');
- const endDate = this.dateRange3L[1].format('YYYY-MM-DD');
- repairStats({startDate: startDate, endDate: endDate, type: 'end'}).then(res => {
- this.finishCount = res.data.wc
- this.timeout = res.data.timeout
- this.createEchartCake('echart1', {
- bottom: 10,
- left: 'right',
- orient: 'vertical'
- }, ['#91cd77', '#ef6567'], this.finishCount)
- this.createEchartCake('echart2', {
- bottom: 10,
- left: 'right',
- orient: 'vertical'
- }, ['#ef6567', '#fc8251', '#f9c956', '#91cd77'], this.timeout)
+ repairCount3L() {
+ const startDate = this.dateRange3L[0].format('YYYY-MM-DD')
+ const endDate = this.dateRange3L[1].format('YYYY-MM-DD')
+ repairStats({ startDate: startDate, endDate: endDate, type: 'end' }).then(res => {
+ this.finishCount = res.data.wc
+ this.timeout = res.data.timeout
+ this.createEchartCake('echart1', {
+ bottom: 10,
+ left: 'right',
+ orient: 'vertical'
+ }, ['#91cd77', '#ef6567'], this.finishCount)
+ this.createEchartCake('echart2', {
+ bottom: 10,
+ left: 'right',
+ orient: 'vertical'
+ }, ['#ef6567', '#fc8251', '#f9c956', '#91cd77'], this.timeout)
})
},
- repairCount3R (){
- const startDate = this.dateRange3R[0].format('YYYY-MM-DD');
- const endDate = this.dateRange3R[1].format('YYYY-MM-DD');
+ repairCount3R() {
+ const startDate = this.dateRange3R[0].format('YYYY-MM-DD')
+ const endDate = this.dateRange3R[1].format('YYYY-MM-DD')
repairStats({ startDate: startDate, endDate: endDate, type: 'eval' }).then(res => {
- this.pj = res.data.pj
- this.createEchartCake('echart3', {
- bottom: 10,
- left: 'right',
- orient: 'vertical'
- }, ['#91cd77','#fc8251','#ef6567'],this.pj)
+ this.pj = res.data.pj
+ this.createEchartCake('echart3', {
+ bottom: 10,
+ left: 'right',
+ orient: 'vertical'
+ }, ['#91cd77', '#fc8251', '#ef6567'], this.pj)
})
},
// 楼层负责人情况
- floorStats () {
- const startDate = this.dateRange4L[0].format('YYYY-MM-DD');
- const endDate = this.dateRange4L[1].format('YYYY-MM-DD');
- floorStats({startDate: startDate, endDate: endDate}).then(res => {
+ floorStats() {
+ const startDate = this.dateRange4L[0].format('YYYY-MM-DD')
+ const endDate = this.dateRange4L[1].format('YYYY-MM-DD')
+ floorStats({ startDate: startDate, endDate: endDate }).then(res => {
this.createEchartLine('echart4', res.data)
})
},
//故障统计
- deviceStats () {
- const startDate = this.dateRange4R1[0].format('YYYY-MM-DD');
- const endDate = this.dateRange4R1[1].format('YYYY-MM-DD');
+ deviceStats() {
+ const startDate = this.dateRange4R1[0].format('YYYY-MM-DD')
+ const endDate = this.dateRange4R1[1].format('YYYY-MM-DD')
deviceStats({ startDate: startDate, endDate: endDate }).then(res => {
- this.faultStatsCount = res.data
- this.createColumnEcharrt('echart5', res.data)
+ this.faultStatsCount = res.data
+ this.createColumnEcharrt('echart5', res.data)
})
},
//第四行 右下 故障类型统计
- failureStats () {
- const startDate = this.dateRange4R2[0].format('YYYY-MM-DD');
- const endDate = this.dateRange4R2[1].format('YYYY-MM-DD');
+ failureStats() {
+ const startDate = this.dateRange4R2[0].format('YYYY-MM-DD')
+ const endDate = this.dateRange4R2[1].format('YYYY-MM-DD')
failureStats({ startDate: startDate, endDate: endDate }).then(res => {
this.selectFaultStatsCount = res.data
this.createEchartCake('echart6', {
- bottom: 10,
- left: 'right',
- orient: 'vertical'
- },['#ef6567', '#fc8251', '#f9c956', '#91cd77'],this.selectFaultStatsCount)
+ bottom: 10,
+ left: 'right',
+ orient: 'vertical'
+ }, ['#ef6567', '#fc8251', '#f9c956', '#91cd77'], this.selectFaultStatsCount)
})
},
//第五行 设备、品牌、评价 统计
- deviceTypeStats () {
- const startDate = this.dateRange5[0].format('YYYY-MM-DD');
- const endDate = this.dateRange5[1].format('YYYY-MM-DD');
- deviceTypeStats({ startDate: startDate, endDate: endDate}).then(res => {
+ deviceTypeStats() {
+ const startDate = this.dateRange5[0].format('YYYY-MM-DD')
+ const endDate = this.dateRange5[1].format('YYYY-MM-DD')
+ deviceTypeStats({ startDate: startDate, endDate: endDate }).then(res => {
this.loadData = res.rows
})
},
@@ -416,7 +427,7 @@ export default {
myChart.setOption(option)
}
,
- createEchartLine (id, data) {
+ createEchartLine(id, data) {
// 基于准备好的dom,初始化echarts实例
let myChart = echarts.init(document.getElementById(id))
let option = {
@@ -427,7 +438,7 @@ export default {
}
},
legend: {},
- color: ['#75bedc','#f9c956'],
+ color: ['#75bedc', '#f9c956'],
grid: {
left: '3%',
right: '4%',
@@ -461,7 +472,7 @@ export default {
myChart.setOption(option)
}
,
- createColumnEcharrt (id, data) {
+ createColumnEcharrt(id, data) {
data.x = data.x.map(item => {
if (item && item.length > 4) {
item = item.substring(0, 4) + '..'
@@ -478,7 +489,7 @@ export default {
]
//计算,总数-已完成=未完成
for (let i = 0; i < rawData[0].length; ++i) {
- rawData[0][i]-=rawData[1][i];
+ rawData[0][i] -= rawData[1][i]
}
const grid = {
left: 100,
@@ -497,7 +508,7 @@ export default {
barWidth: '10px',
label: {
show: true,
- formatter: (params) => params.value>0 ? params.value : ""
+ formatter: (params) => params.value > 0 ? params.value : ''
},
data: rawData[sid].map((d, did) => rawData[sid][did])
}
@@ -506,7 +517,7 @@ export default {
legend: {
selectedMode: false
},
- color: ['#f9c956','#75bedc'],
+ color: ['#f9c956', '#75bedc'],
grid,
yAxis: {
type: 'value'
@@ -548,6 +559,7 @@ export default {
flex-direction: column;
justify-content: center;
align-items: center;
+ cursor: pointer;
}
@@ -555,15 +567,8 @@ export default {
width: 80px;
height: 80px;
border-radius: 80px;
- background: white;
}
-.topHeadView .itemView .imgView {
- width: 80px;
- height: 80px;
- border-radius: 80px;
- background: white;
-}
.topHeadView .itemView .label {
margin-top: 10px;
@@ -636,6 +641,8 @@ export default {
display: flex;
justify-content: space-between;
align-items: center;
+
+ cursor: pointer;
}
diff --git a/src/views/admin/repair/modules/RepairFailureTypeModal.vue b/src/views/admin/repair/modules/RepairFailureTypeModal.vue
index 0fcae9c..39728fa 100644
--- a/src/views/admin/repair/modules/RepairFailureTypeModal.vue
+++ b/src/views/admin/repair/modules/RepairFailureTypeModal.vue
@@ -59,6 +59,7 @@
this.edit({ id: 0 })
},
edit (record) {
+ console.log(record)
this.mdl = Object.assign(record)
this.visible = true
this.$nextTick(() => {