Commit ac87c76b by 怪兽?别跑

质检接口调试

1 parent 62f32555
...@@ -74,3 +74,18 @@ export function statisticRecordList(data) { ...@@ -74,3 +74,18 @@ export function statisticRecordList(data) {
params: data params: data
}) })
} }
// 质检周报 列表
export function qualityWeekly(data) {
return request({
url: service + '/qi/weekly/list',
params: data
})
}
// 质检周报 详情汇总卡片
export function qualityWeeklyDetailTotal(id) {
return request({
url: service + '/qi/weekly/getDetail/' + id
})
}
<template>
<div>
<CardGroupIndex :data="cardData"></CardGroupIndex>
<div class="g-card">
<div class="g-card-title">数据报表</div>
<div style="display: flex; align-items: center;">
<search-title :showMore="true" @search="getTableFn"> </search-title>
<el-input
style="width: 150px;"
:value="userName"
readonly
size="mini"
@focus="dialogVisible = true"
placeholder="请选择成员"
/>
<el-input
style="width: 150px; margin: 0 20px;"
:value="deptName"
readonly
size="mini"
@focus="dialogDeptVisible = true"
placeholder="请选择部门"
/>
<el-button size="mini" type="primary" @click="handleSearch">查询</el-button>
<el-button size="mini" @click="resetQuery">重置</el-button>
</div>
<el-table v-loading="loading" :data="tableList" style="width: 100%;">
<el-table-column
label="成员名称"
align="center"
prop="userName"
min-width="100"
show-overflow-tooltip
></el-table-column>
<el-table-column label="所属部门" align="center" prop="deptName" show-overflow-tooltip></el-table-column>
<el-table-column label="所属会话" align="center" prop="chatName" show-overflow-tooltip></el-table-column>
<el-table-column label="会话类型" align="center" prop="chatType" show-overflow-tooltip>
<template slot-scope="{ row }">
<div>
{{ row.chatType == 1 ? '客户会话' : '客群会话' }}
</div>
</template>
</el-table-column>
<el-table-column label="超时时长" align="center" prop="timeout" show-overflow-tooltip></el-table-column>
<el-table-column
label="触发时间"
align="center"
prop="createTime"
width="180"
show-overflow-tooltip
></el-table-column>
<el-table-column label="操作" align="center" fixed="right" width="180" class-name="small-padding fixed-width">
<template slot-scope="{ row }">
<el-button type="text">查看</el-button>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="query.pageNum"
:limit.sync="query.pageSize"
@pagination="getTableChangeSize()"
/>
</div>
<SelectWeUser
:visible.sync="dialogVisible"
title="组织架构"
:defaultValues="userArray"
@success="getSelectUser"
></SelectWeUser>
<SelectDept
:defaultValues="deptArray"
:visible.sync="dialogDeptVisible"
title="选择部门"
@success="selectedDept"
></SelectDept>
</div>
</template>
<script>
import ChartLine from '@/components/ChartLine.vue'
import SearchTitle from '@/components/SearchTitle.vue'
import { qualityWeeklyDetailTotal, statisticTable, statisticRecordList } from './api.js'
import SelectDept from '@/components/SelectDept'
export default {
name: 'records-statistic',
components: {
SearchTitle,
ChartLine,
SelectDept
},
data() {
return {
deptArray: [],
deptName: '',
dialogDeptVisible: false,
dialogVisible: false,
userArray: [],
userName: '',
cardData: [
{
title: '总超时次数',
tips: '成员在会话中未能及时回复的次数,仅计算产生双方参与的会话次数',
value: 0
},
{
title: '总超时率',
tips: '成员在会话中未能及时回复的次数/双方共产生会话的次数',
value: 0
},
{
title: '今日超时人数',
tips: '今日未能及时回复用户会话的成员人数',
value: 0
},
{
title: '今日超时次数',
tips: '今日成员在会话中未能及时回复的次数',
value: 0
},
{
title: '今日超时率',
tips: '今日成员在会话中未能及时回复的次数/今日双方共产生会话的次数',
value: 0
}
],
value: [],
id: '',
exportLoading: false,
tableList: [],
loading: false,
total: 0,
query: {
pageSize: 10,
pageNum: 1,
beginTime: '',
endTime: '',
deptIds: '',
userIds: ''
},
tableSearch: {}
}
},
methods: {
handleSearch() {
this.getTableChangeSize()
},
resetQuery() {
this.query = {
pageSize: 10,
pageNum: 1,
beginTime: '',
endTime: '',
deptIds: '',
userIds: ''
}
this.userArray = []
this.userName = ''
this.deptArray = []
this.deptName = ''
this.getTableChangeSize()
},
getSelectUser(data) {
this.userArray = data
this.userName = this.userArray
.map(function (obj, index) {
return obj.name
})
.join(',')
this.query.userIds = this.userArray
.map(function (obj, index) {
return obj.userId
})
.join(',')
},
selectedDept(data) {
this.deptArray = data
this.deptName = this.deptArray
.map(function (obj, index) {
return obj.deptName
})
.join(',')
this.query.deptIds = this.userArray
.map(function (obj, index) {
return obj.deptId
})
.join(',')
},
getTabTotalFn() {
qualityWeeklyDetailTotal(this.id).then((res) => {
this.cardData[0].value = res.data.timeOutTotalNum
this.cardData[1].value = res.data.timeOutTotalRate
this.cardData[2].value = res.data.todayTimeOutUserNum
this.cardData[3].value = res.data.todayTimeOutNum
this.cardData[4].value = res.data.todayTimeOutRate
})
},
getTableChangeSize() {
this.loading = true
statisticTable(this.id, Object.assign({}, this.query)).then((res) => {
this.tableList = res.rows
this.total = Number(res.total)
this.loading = false
})
},
getTableFn(data) {
this.tableSearch = data
this.loading = true
// this.query.id = this.id
this.query.beginTime = data.beginTime
this.query.endTime = data.endTime
this.getTableChangeSize()
}
},
created() {
this.id = this.$route.query.id
this.getTabTotalFn()
}
}
</script>
<style lang="scss" scoped></style>
<template> <template>
<div> <div>
<el-form ref="queryForm" :model="query" inline class="top-search" label-position="left" label-width=""> <el-form ref="queryForm" :model="query" inline class="top-search" label-position="left" label-width="">
<el-form-item label="适用成员" prop="userIds"> <el-form-item label="成员" prop="userIds">
<el-input :value="userName" readonly @focus="dialogVisible = true" placeholder="请选择适用成员" /> <el-input v-model="query.userName" placeholder="请输入成员名称" />
</el-form-item> </el-form-item>
<el-form-item label="操作时间"> <el-form-item label="选择时间">
<el-date-picker <el-date-picker
v-model="searchDate" v-model="query.dateTime"
format="yyyy-MM-dd" format="yyyy-MM-dd"
value-format="yyyyMMdd" value-format="yyyy-MM-dd"
type="daterange" type="date"
range-separator="-"
@change="setDateChange"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker> ></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label=""> <el-form-item label="">
...@@ -23,95 +19,73 @@ ...@@ -23,95 +19,73 @@
</el-form> </el-form>
<div class="g-card"> <div class="g-card">
<el-table v-loading="loading" :data="list"> <el-table v-loading="loading" :data="list">
<el-table-column label="质检周期" align="center" min-width="100" prop="name" show-overflow-tooltip /> <el-table-column label="质检周期" align="center" width="180" prop="weeklyTime" show-overflow-tooltip />
<el-table-column label="目标发送成员" align="center" prop="qiRuleScope" min-width="160px"> <el-table-column label="目标发送成员" align="center" prop="userName">
<template slot-scope="{ row }"> <!-- <template slot-scope="{ row }">
<TagEllipsis :list="row.qiRuleScope" defaultProps="userName" /> <TagEllipsis :list="row.qiRuleScope" defaultProps="userName" />
</template> </template> -->
</el-table-column> </el-table-column>
<el-table-column label="发送时间" align="center" prop="updateTime" width="180"></el-table-column> <el-table-column label="发送时间" align="center" prop="sendTime" width="180"></el-table-column>
<el-table-column label="操作" align="center" fixed="right" width="180" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" fixed="right" width="180" class-name="small-padding fixed-width">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<el-button type="text" @click="goRoute('detail', row.id)">统计</el-button> <el-button type="text" @click="goRoute('recordsStatistic', row.id)">统计</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination :total="total" :page.sync="query.pageNum" :limit.sync="query.pageSize" @pagination="getList()" /> <pagination :total="total" :page.sync="query.pageNum" :limit.sync="query.pageSize" @pagination="getList()" />
</div> </div>
<SelectWeUser
:visible.sync="dialogVisible"
title="组织架构"
:defaultValues="userArray"
@success="getSelectUser"
></SelectWeUser>
</div> </div>
</template> </template>
<script> <script>
import {} from './api.js' import { qualityWeekly } from './api.js'
export default { export default {
name: 'quality-records', name: 'quality-records',
data() { data() {
return { return {
dialogVisible: false, dialogVisible: false,
query: { query: {
beginTime: '', dateTime: '',
endTime: '', userName: '',
userIds: '',
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
}, },
searchDate: [],
userName: '',
userArray: [],
list: [], list: [],
loading: false, loading: false,
total: 0 total: 0
} }
}, },
created() {
this.getList()
},
methods: { methods: {
getSelectUser(data) { goRoute(path, id) {
this.userArray = data this.$router.push({ path: path, query: { id } })
this.userName = this.userArray
.map(function (obj, index) {
return obj.name
})
.join(',')
this.query.userIds = this.userArray
.map(function (obj, index) {
return obj.userId
})
.join(',')
},
setDateChange(data) {
if (data && data[0]) {
this.query.beginTime = data[0]
} else {
this.query.beginTime = ''
}
if (data && data[1]) {
this.query.endTime = data[1]
} else {
this.query.endTime = ''
}
}, },
handleSearch() { handleSearch() {
this.query.pageNum = 1 this.query.pageNum = 1
this.getList() this.getList()
}, },
getList() {}, getList() {
this.loading = true
qualityWeekly(this.query)
.then((res) => {
if (res.code == 200) {
this.list = res.rows
this.total = Number(res.total)
}
})
.catch(() => {
this.loading = false
})
},
resetQuery() { resetQuery() {
this.query = { this.query = {
pageSize: 10, pageSize: 10,
pageNum: 1, pageNum: 1,
name: '', dateTime: '',
userIds: '', userName: ''
startTime: '',
endTime: '',
chatType: 1
} }
this.userName = ''
this.userArray = []
this.getList() this.getList()
} }
} }
......
...@@ -77,14 +77,13 @@ ...@@ -77,14 +77,13 @@
</div> </div>
</template> </template>
<script> <script>
import { dateFormat } from '@/utils/index'
import ChartLine from '@/components/ChartLine.vue' import ChartLine from '@/components/ChartLine.vue'
import SearchTitle from '@/components/SearchTitle.vue' import SearchTitle from '@/components/SearchTitle.vue'
import { statisticData, statisticTable, statisticRecordList } from './api.js' import { statisticData, statisticTable, statisticRecordList } from './api.js'
import SelectDept from '@/components/SelectDept' import SelectDept from '@/components/SelectDept'
export default { export default {
name: 'fission-statistics', name: 'quality-statistics',
components: { components: {
SearchTitle, SearchTitle,
ChartLine, ChartLine,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!