Browse Source

问题列表

master
huxinglu 4 years ago
parent
commit
265353c1b2
9 changed files with 733 additions and 3 deletions
  1. +8
    -0
      src/api/business/inspect.js
  2. +4
    -1
      src/api/permission/admin.js
  3. +43
    -0
      src/api/question/list.js
  4. +1
    -1
      src/views/business/inspectDriver/inspectReport.vue
  5. +68
    -0
      src/views/business/realVideo.vue
  6. +184
    -0
      src/views/problem/detailDialog.vue
  7. +44
    -0
      src/views/problem/index.vue
  8. +379
    -0
      src/views/problem/list.vue
  9. +2
    -1
      src/vuex/getters.js

+ 8
- 0
src/api/business/inspect.js View File

@@ -33,6 +33,14 @@ export default {
})
},

getLiveList(){
return axios({
method: "GET",
url: '/api/front/equipment/index',
params:{}
})
}

}



+ 4
- 1
src/api/permission/admin.js View File

@@ -33,7 +33,10 @@ export default {
},
getBaseData(params) {
return axios.get('/api/front/useradmin/getBaseData',JSON.stringify(params))
}
},
getUserAdminList(params) {
return axios.post('/api/front/useradmin/getUserAdminList',JSON.stringify(params))
},
}



+ 43
- 0
src/api/question/list.js View File

@@ -0,0 +1,43 @@
import axios from '../api'

export default {
getList(params) {
return axios({
method: "POST",
url: '/api/front/inspectquestion/index',
data: params
})
},
getDetail(id) {
return axios({
method: "GET",
url: '/api/front/inspectquestion/detail',
params: {
id
}
})
},
assign(params) {
return axios({
method: "POST",
url: '/api/front/inspectquestion/assign',
data:params
})
},
dealWith(params) {
return axios({
method: "POST",
url: '/api/front/inspectquestion/dealWith',
data:params
})
},
finished(params) {
return axios({
method: "POST",
url: '/api/front/inspectquestion/finished',
data:params
})
}
}



+ 1
- 1
src/views/business/inspectDriver/inspectReport.vue View File

@@ -112,7 +112,7 @@
<img :title="item.description" :key="index" v-for="(item,index) in reportData.inspectFileList" v-lazy="item.thumbImg" :data-source="item.originalImg">
</viewer>
</div>
<div v-if="reportData.status!=2&&reportData.status!=3" class="video-detail">
<div v-if="reportData.status!=2&&reportData.status!=3&&reportData.driverVideo" class="video-detail">
<h4 style="margin-top: 15px">航拍视频</h4>
<pcVideo style="margin-top:15px;width: 300px;height: 200px" :videoUrl="reportData.driverVideo"></pcVideo>
</div>

+ 68
- 0
src/views/business/realVideo.vue View File

@@ -0,0 +1,68 @@
<template>
<div :style="{height:height+'px'}" class="realVideo">
<el-table style="width: 200px" stripe ref="table" size="medium"
:height="tableHeight" v-loading="tableLoading" :data="dataList">
<el-table-column label="设备名称" prop="name" align="center"/>
<el-table-column label="实时视频" align="center">
<template slot-scope="scoped">
<el-button v-if="scoped.row.liveUrl" @click="play(scoped.row)" type="primary" size="mini"
icon="el-icon-video-play">
</el-button>
</template>
</el-table-column>
</el-table>
<div>
<iframe allowfullscreen="true" allowtransparency="true" v-if="liveUrl" width="100%" height="100%" :src="liveUrl" frameborder="0"/>
</div>
</div>
</template>

<script>
import inspectApi from '@/api/business/inspect'
export default {
name: "realVideo",
data() {
return {
height: document.body.clientHeight - 150,
tableHeight: document.body.clientHeight - 170,
tableLoading: false,
dataList: [],
liveUrl:''
}
},
mounted(){
this.getList()
},
components:{},
methods:{
getList(){
inspectApi.getLiveList().then(res => {
this.dataList=res.data
}).catch(e => {
this.dataList=[]
})
},
play(row){
this.liveUrl=''
this.$nextTick(function () {
this.liveUrl = row.liveUrl
})
}
}
}
</script>

<style lang="less">
.realVideo {
background-color: #fff;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, .12), 0 0 6px 0 rgba(0, 0, 0, .04);
padding: 15px;
display: flex;
>div:first-child{
flex: inherit;
}
>div:last-child{
flex: 1;
}
}
</style>

+ 184
- 0
src/views/problem/detailDialog.vue View File

@@ -0,0 +1,184 @@
<template>
<div class="detail-diaog">
<el-steps :active="childData.status" align-center>
<el-step title="问题确认">
<div slot="description">
<span class="step-title" v-if="childData.creatUserName">{{childData.creatUserName}}</span>
<br />
<span class="step-title" v-if="childData.createTime">{{childData.createTime}}</span>
</div>
</el-step>
<el-step title="问题指派">
<div slot="description">
<span class="step-title" v-if="childData.assignUserName">{{childData.assignUserName}}</span>
<br />
<span class="step-title" v-if="childData.assignTime">{{childData.assignTime}}</span>
</div>
</el-step>
<el-step title="问题处理">
<div slot="description">
<span class="step-title" v-if="childData.handlerUserName">{{childData.handlerUserName}}</span>
<br />
<span class="step-title" v-if="childData.handlerTime">{{childData.handlerTime}}</span>
</div>
</el-step>
<el-step title="问题完成">
<div slot="description">
<span class="step-title" v-if="childData.handlerUserName">{{childData.handlerUserName}}</span>
<br />
<span class="step-title" v-if="childData.handlerTime">{{childData.handlerTime}}</span>
</div>
</el-step>
</el-steps>
<div style="margin-top:30px" class="dialog-item">
<div>问题编号:</div>
<div>{{childData.questionNo}}</div>
</div>
<div class="dialog-item">
<div>问题类型:</div>
<div>{{childData.questionType}}</div>
</div>
<div class="dialog-item">
<div>区属:</div>
<div>{{childData.driverAreaName}}</div>
</div>
<div class="dialog-item">
<div>河湖名称:</div>
<div>{{childData.driverName}}</div>
</div>
<div class="dialog-item">
<div>拍摄时间:</div>
<div>{{childData.inspectTime}}</div>
</div>
<div class="dialog-item">
<div>问题位置:</div>
<div>{{childData.location}}</div>
</div>
<div id="reportMap" style="margin-left:152px;width: 300px;height: 220px;margin-top: 10px"></div>
<div class="dialog-item">
<div>问题图片:</div>
<div>
<viewer v-if="childData.fileSrc">
<img
style="width:300px;height:200px"
v-lazy="childData.fileSrc"
:data-source="childData.originalImg"
/>
</viewer>
</div>
</div>
<div v-if="childData.handlerImage" class="dialog-item">
<div>处理后图片:</div>
<div>
<viewer v-if="childData.handlerImage">
<img style="width:300px;height:200px" v-lazy="childData.handlerImage" />
</viewer>
</div>
</div>
</div>
</template>

<script>
import api from "@/api/question/list";
import AMap from "AMap";

export default {
name: "detail-diaog",
data() {
return {
drawerWidth: document.body.clientWidth - 190 + "px",
direction: "rtl",
childData: {},
map: {}
};
},
props: {
visible: {
type: Boolean,
default() {
return false;
}
},
id: {
type: Number,
default() {
return 0;
}
}
},
components: {},
created() {},
mounted() {
this.getDetail();
},
methods: {
initMap() {
let me = this;
this.map = new AMap.Map("reportMap", {
zooms: [10, 18]
});
this.map.setCity("南京市");
this.map.on("complete", function() {
if (me.childData.latitude && me.childData.longitude) {
let point = new AMap.LngLat(
me.childData.longitude,
me.childData.latitude
);
let icon = new AMap.Icon({
// 图标尺寸
size: new AMap.Size(25, 25),
// 图标的取图地址
image: require("../../assets/img/marker-img.png"),
// 图标所用图片大小
imageSize: new AMap.Size(25, 25)
});
let marker = new AMap.Marker({
position: point,
icon: icon,
offset: new AMap.Pixel(-12, -12)
});
marker.setDraggable(true);
marker.setMap(me.map);
me.map.setZoomAndCenter(10, point);
}
});
},
getDetail() {
api
.getDetail(this.id)
.then(res => {
if (res.data.status == 3) {
res.data.status == 4;
}
this.childData = res.data;
this.initMap();
})
.catch(err => {
this.childData = {};
});
}
}
};
</script>

<style lang="less">
.detail-diaog {
.step-title {
font-size: 14px;
color: #333333;
}
.dialog-item {
margin-top: 15px;
display: flex;
line-height: 20px;
align-items: center;
> div:first-child {
width: 150px;
text-align: right;
}
> div:last-child {
flex: 1;
}
}
}
</style>

+ 44
- 0
src/views/problem/index.vue View File

@@ -0,0 +1,44 @@
<template>
<div class="problem-index">
<el-tabs v-model="activeName" type="border-card">
<el-tab-pane label="全部问题" :name="'0'">
<cList :status="activeName" v-if="activeName==='0'"></cList>
</el-tab-pane>
<el-tab-pane label="待指派" :name="'1'">
<cList :status="activeName" v-if="activeName==='1'"></cList>
</el-tab-pane>
<el-tab-pane label="处理中" :name="'2'">
<cList :status="activeName" v-if="activeName==='2'"></cList>
</el-tab-pane>
<el-tab-pane label="已完成" :name="'3'">
<cList :status="activeName" v-if="activeName==='3'"></cList>
</el-tab-pane>
</el-tabs>
</div>
</template>

<script>
import cList from './list'
export default {
name: "problem-index",
data() {
return {
activeName: '0'
}
},
created(){
},
components:{
cList
}
}
</script>

<style lang="less">
.problem-index {
height: fit-content;
background-color: #fff;
box-shadow: 0 2px 4px 0 rgba(0, 0, 0, .12), 0 0 6px 0 rgba(0, 0, 0, .04);
padding: 15px;
}
</style>

+ 379
- 0
src/views/problem/list.vue View File

@@ -0,0 +1,379 @@
<template>
<div class="problem-container">
<el-form :inline="true" :model="searchParam" class="demo-form-inline">
<el-form-item label="问题单号">
<el-input
clearable
v-model="searchParam.questionNo"
size="small"
placeholder="请输入问题单号"
style="width: 150px"
/>
</el-form-item>
<el-form-item label="区划">
<driverAreaSelect v-model="searchParam.driverArea"></driverAreaSelect>
</el-form-item>
<el-form-item label="河湖名称">
<el-input
clearable
v-model="searchParam.driverName"
size="small"
placeholder="请输入河道名称"
style="width: 150px"
/>
</el-form-item>
<el-form-item label="日期">
<el-date-picker
style="width: 220px"
placeholder="日期"
clearable
size="small"
value-format="yyyy-MM-dd"
v-model="searchParam.inspectTime"
type="daterange"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
></el-date-picker>
</el-form-item>
<el-form-item>
<el-button
:loading="tableLoading"
@click="search"
size="small"
icon="el-icon-search"
type="primary"
>搜索
</el-button>
<el-button
@click="initSearchParam();search()"
icon="el-icon-refresh-right"
type="primary"
size="small"
style="background-color: #fff; border: 1px solid #ccc ; color: #666"
>清空
</el-button>
</el-form-item>
</el-form>
<div>
<el-button v-if="btnRule.inspectquestion_assign&&(status==1||status==='0')"
:disabled="multipleSelection.length>0?false:true" size="small" type="primary">批量指派
</el-button>
<el-button v-if="btnRule.inspectquestion_finished&&(status==1||status==='0'||status==2)"
:disabled="multipleSelection.length>0?false:true" size="small" type="success">批量标记完成
</el-button>
</div>
<el-table
style="margin-top: 15px"
stripe
@selection-change="handleSelectionChange"
ref="table"
:height="tableHeight"
v-loading="tableLoading"
:data="dataList"
size="medium"
border
>
<el-table-column
:selectable="filterSelectable"
type="selection"
width="55">
</el-table-column>
<el-table-column :index="indexMethod" label="序号" type="index" width="80" align="center"/>
<el-table-column
show-overflow-tooltip
prop="name"
label="问题单号"
align="center"
min-width="120"
>
<template slot-scope="scoped">
<a
v-if="btnRule.inspectquestion_detail"
href="javascript:void(0);"
@click="handleEdit(scoped.row,1)"
>{{scoped.row.questionNo}}</a>
<span v-else>{{scoped.row.questionNo}}</span>
</template>
</el-table-column>
<el-table-column show-overflow-tooltip label="问题图片" align="center" min-width="80">
<template slot-scope="{row}">
<img style="width:20px;height:20px" :src="row.fileSrc"/>
</template>
</el-table-column>
<el-table-column
show-overflow-tooltip
prop="driverAreaName"
label="区划"
align="center"
min-width="80"
/>
<el-table-column
show-overflow-tooltip
prop="driverName"
label="河湖名称"
align="center"
min-width="100"
></el-table-column>
<el-table-column
show-overflow-tooltip
prop="inspectTime"
label="巡检时间"
min-width="120"
align="center"
/>
<el-table-column show-overflow-tooltip prop="questionType" label="问题类型" align="center"/>
<el-table-column show-overflow-tooltip prop="statusName" label="问题状态" align="center"/>
<el-table-column label="操作" align="left" width="180">
<template slot-scope="scope">
<el-button v-if="btnRule.inspectquestion_assign&&scope.row.status==1" type="primary" size="mini"
icon="el-icon-s-operation" @click="assign(scope.row)">指派
</el-button>
<el-button v-if="btnRule.inspectquestion_dealWith&&scope.row.status==2&&scope.row.assignUser==info.id" type="primary" size="mini"
icon="el-icon-monitor" @click="handleAddRole(scope.row)">处理
</el-button>
<el-button v-if="btnRule.inspectquestion_finished&&(scope.row.status==1||scope.row.status==2)" type="success"
size="mini" icon="el-icon-finished" @click="handleAddRole(scope.row)">标记完成
</el-button>
</template>
</el-table-column>
</el-table>
<!-- 分页 -->
<div class="page-current">
<el-pagination
background
:current-page="currentPage"
:page-size="pageSize"
prev-text="上一页"
next-text="下一页"
layout="total, prev, pager, next, jumper"
style="display: inline-block;"
@current-change="handleCurrentChange"
:total="count"
/>
</div>
<el-drawer
class="detail-diaog"
title="问题详情"
:visible.sync="visible"
:direction="direction"
:size="drawerWidth"
:before-close="beforeClose"
>
<detailDialog @handleClose="visible=false" :visible="visible" v-if="visible" :id="id"></detailDialog>
<div style="width: 100%;text-align: center;margin-top: 20px;margin-bottom: 20px">
<el-button size="medium" icon="el-icon-back" @click="visible=false">返回</el-button>
</div>
</el-drawer>
<el-dialog v-if="assignVisible" :close-on-press-escape="false" :close-on-click-modal="false" ref="assignDialog"
top="5vh" center title="指派"
class="assign-dialog" :visible.sync="assignVisible">
<el-form ref="ruleForm" :model="ruleForm" size="small" label-width="100px"
class="form">
<el-form-item label="责任人" prop="assignUser"
:rules="{
required: true, message: '责任人不能为空', trigger: 'change'
}">
<el-select @change="assignUserClick" clearable filterable v-model="ruleForm.assignUser">
<el-option :key="index" :value="item.id" :label="item.realname" v-for="(item,index) in userList"></el-option>
</el-select>
</el-form-item>
<el-form-item label="联系方式" prop="assignContact">
<el-input :disabled="true" v-model="ruleForm.assignContact"></el-input>
</el-form-item>
<el-form-item label="备注" prop="assignNote">
<el-input
rows="4"
type="textarea"
placeholder="备注"
v-model="ruleForm.assignNote"
maxlength="99"
show-word-limit
>
</el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer no-print">
<el-button :loading="submitLoading" @click="assignSubmit('ruleForm')" type="primary" size="medium"
icon="el-icon-printer">指派</el-button>
<el-button size="medium" icon="el-icon-back"
@click="assignVisible = false">返回
</el-button>
</span>
</el-dialog>
</div>
</template>

<script>
import api from "@/api/question/list";
import adminApi from '@/api/permission/admin'
import driverAreaSelect from "@/components/driverAreaSelect";
import detailDialog from "./detailDialog";
import {mapGetters} from "vuex";

export default {
name: "problem-container",
data() {
return {
submitLoading:false,
assignVisible: false,
drawerWidth: document.body.clientWidth - 190 + "px",
direction: "rtl",
id: "",
visible: false,
typeList: {
1: "待指派",
2: "处理中",
3: "已完成"
},
searchParam: {
questionNo: "",
driverName: "",
inspectTime: "",
driverArea: ""
},
ruleForm:{},
dataList: [],
currentPage: 1,
pageSize: parseInt((document.body.clientHeight - 365 - 43) / 47),
count: 0,
tableLoading: false,
tableHeight: document.body.clientHeight - 365,
multipleSelection: [],
userList: [],
ids:''
};
},
components: {driverAreaSelect, detailDialog},
computed: {
...mapGetters(["btnRule", "info"])
},
props: {
status: {
type: String,
default() {
return ''
}
}
},
created() {
// console.log(this.info.id)
},
mounted() {
this.tableLoading = true;
let me = this;
this.getUserAdminList()
me.getAllList();
},
watch: {},
methods: {
assignSubmit(formName){
this.$refs[formName].validate((valid) => {
if (valid) {
}
})
},
assignUserClick(){
let ruleForm=JSON.parse(JSON.stringify(this.ruleForm))
if(ruleForm.assignUser){
let child = this.userList.find(item=>item.id==ruleForm.assignUser)
if(child){
ruleForm.assignContact=child.mobile
}
}else{
ruleForm.assignContact=''
}
this.ruleForm=Object.assign({},ruleForm)
},
assign(row){
this.ruleForm={
id:row.id,
assignUser:'',
assignContact:'',
assignNote:''
}
this.assignVisible=true
},
getUserAdminList() {
adminApi.getUserAdminList().then(res => {
this.userList = res.data ? res.data : []
}).catch(err => {
this.userList = []
});
},
handleSelectionChange(val) {
this.multipleSelection = val;
},
filterSelectable(row, index) {
return true
},
beforeClose() {
this.visible = false
},
handleEdit(row) {
this.id = row.id;
this.visible = true;
},
indexMethod(index) {
return index + 1 + (this.currentPage - 1) * this.pageSize;
},
getAllList() {
let searchParam = JSON.parse(JSON.stringify(this.searchParam));
searchParam.page = this.currentPage;
searchParam.pageSize = this.pageSize;
if (searchParam.inspectTime && searchParam.inspectTime.length > 0) {
searchParam.inspectTime = searchParam.inspectTime[0] + '~' + searchParam.inspectTime[1];
} else {
searchParam.inspectTime = ''
}
this.$refs.table.clearSelection();
this.multipleSelection = []
searchParam.status = this.status === '0' ? '' : this.status
api.getList(searchParam).then(res => {
this.count = res.data.total;
this.dataList = res.data.records;
this.tableLoading = false;
}).catch(err => {
this.dataList = [];
this.tableLoading = false;
});
},
search() {
this.currentPage = 1;
this.tableLoading = true;
this.$refs.table.bodyWrapper.scrollTop = 0;
this.getAllList();
},
handleCurrentChange(val) {
this.currentPage = val;
this.tableLoading = true;
this.$refs.table.bodyWrapper.scrollTop = 0;
this.getAllList();
},
initSearchParam() {
this.searchParam = {
questionNo: "",
driverName: "",
inspectTime: "",
driverArea: ""
};
}
}
};
</script>

<style lang="less">
.problem-container {

.el-input.is-disabled .el-input__inner {
background-color: #fff !important;
color: #333 !important;
}

.detail-dialog {
.assign-dialog {
width: 400px !important;
}
}
}
</style>

+ 2
- 1
src/vuex/getters.js View File

@@ -1,5 +1,6 @@
const getters = {
fontSize: state => state.user.fontSize,
btnRule: state => state.user.btnRule
btnRule: state => state.user.btnRule,
info:state => state.user.info
}
export default getters

Loading…
Cancel
Save