<template>
|
<div class="row">
|
<el-row type="flex" justify="left">
|
<el-col :span="24" style="position: relative">
|
<el-menu :default-active="activeIndex" class="el-menu" mode="horizontal" @select="handleSelect">
|
<el-menu-item index="0" @click="changeUnit(null, '全部')">
|
全部单位(430)
|
</el-menu-item>
|
<el-menu-item index="1">
|
自流井运维单位(70)
|
</el-menu-item>
|
<el-menu-item index="2">
|
大安运维(50)
|
</el-menu-item>
|
<el-menu-item index="3">富顺运维单位(70)</el-menu-item>
|
<el-menu-item index="4">高新运维单位(15)</el-menu-item>
|
<el-menu-item index="5">荣县运维单位(90)</el-menu-item>
|
<el-menu-item index="6">贡井运维单位(45)</el-menu-item>
|
<el-menu-item index="7">沿滩运维单位(70)</el-menu-item>
|
</el-menu>
|
<el-popover
|
placement="right"
|
width="400"
|
trigger="click">
|
<el-form :model="settingForm" :rules="settingRules" ref="settingForm" label-width="120px">
|
<el-form-item label="录像质量" prop="videoQuality">
|
<el-select style="width: 100%" v-model="settingForm.videoQuality" placeholder="最低录像质量">
|
<el-option label="全录像" value="全录像"/>
|
<el-option label="部分录像" value="部分录像"/>
|
<el-option label="无录像" value="无录像"/>
|
</el-select>
|
</el-form-item>
|
<el-form-item label="点位离线时长" prop="outLine">
|
<el-input type="number" v-model="settingForm.outLine" placeholder="不能超过多久">
|
<template slot="append">分钟</template>
|
</el-input>
|
</el-form-item>
|
<el-form-item label="视频标注准确率" prop="videoLabel">
|
<el-input type="number" v-model="settingForm.videoLabel" placeholder="最低准确率">
|
<template slot="append">%</template>
|
</el-input>
|
</el-form-item>
|
<el-form-item>
|
<el-button type="primary" @click="submitSetting">保存</el-button>
|
</el-form-item>
|
</el-form>
|
<el-button title="自动生成工单设置" slot="reference" class="setting" style="" type="success" icon="el-icon-s-tools" circle></el-button>
|
</el-popover>
|
</el-col>
|
</el-row>
|
|
<el-row class="op-warp" type="flex" justify="left" >
|
<el-col :span="24">
|
<el-button size="small" type="info" @click="selectedDistribute" class="op">下发选中工单</el-button>
|
<el-popconfirm
|
@confirm="allDistribute"
|
title="确定要下发所有工单吗?"
|
>
|
<el-button size="small" type="danger" class="op" slot="reference">全部下发</el-button>
|
</el-popconfirm>
|
|
<el-popover
|
class="op"
|
placement="right"
|
width="300px"
|
trigger="click">
|
<span style="font-weight: bold;font-size: 16px">快捷下发</span>
|
<el-form ref="fastDistributeForm" :model="fastDistributeForm" :rules="fastDistributeRules" label-width="80px">
|
<el-form-item label="快捷方式" prop="fastWay">
|
<el-radio v-model="fastDistributeForm.fastWay" label="0">最近30分钟</el-radio>
|
<el-radio v-model="fastDistributeForm.fastWay" label="01">最近1小时</el-radio>
|
<el-radio v-model="fastDistributeForm.fastWay" label="10">最近2小时</el-radio>
|
<el-radio v-model="fastDistributeForm.fastWay" label="11">最近1天</el-radio>
|
<el-radio v-model="fastDistributeForm.fastWay" label="101">自定义</el-radio>
|
</el-form-item>
|
<el-form-item v-if="fastDistributeForm.fastWay === '101'" label="时间范围">
|
<el-date-picker
|
style="width: 100%"
|
v-model="fastTimeRange"
|
type="datetimerange"
|
range-separator="至"
|
start-placeholder="开始日期"
|
end-placeholder="结束日期">
|
</el-date-picker>
|
</el-form-item>
|
<el-form-item label="数量限制" prop="fastNumLimit">
|
<el-input v-model="fastDistributeForm.fastNumLimit" size="small" type="number" placeholder="此次工单下发最大数量"></el-input>
|
</el-form-item>
|
<el-form-item>
|
<el-button type="primary" size="small" @click="fastDistribute">立即下发</el-button>
|
</el-form-item>
|
</el-form>
|
<el-button slot="reference" type="primary" size="small">快捷下发</el-button>
|
</el-popover>
|
<el-button size="small" type="primary" @click="page" class="op">刷新</el-button>
|
</el-col>
|
</el-row>
|
|
<el-row class="content-warp" type="flex" justify="left">
|
<el-col :span="24">
|
<el-table v-loading="loading" :data="workOrderList" @selection-change="handleSelectionChange">
|
<el-table-column type="selection" width="55" align="center" />
|
<el-table-column label="工单号" align="center" prop="workOrderNo"/>
|
<el-table-column label="运维单位" align="center" prop="unitName"/>
|
<el-table-column label="工单来源" align="center" prop="source"/>
|
<el-table-column label="故障类型" align="center" prop="errorType"/>
|
<el-table-column label="产生时间" align="center" prop="createTime"/>
|
</el-table>
|
|
<pagination
|
v-show="total>0"
|
:total="total"
|
:page.sync="queryParams.pageNum"
|
:limit.sync="queryParams.pageSize"
|
@pagination="getList"
|
/>
|
</el-col>
|
|
</el-row>
|
</div>
|
</template>
|
|
<script>
|
import {distributeWorkOrder, fastDistribute} from '@/api/platform/work-order'
|
export default {
|
name: 'index',
|
data() {
|
return {
|
settingForm: {
|
// 离线
|
outLine: null,
|
// 视频可用
|
videoQuality: "",
|
// 视频标注
|
videoLabel: ""
|
},
|
// 当前运维单位
|
unitId: null,
|
unitName: "",
|
// 多选
|
multipleSelection: [],
|
// 下发时间范围
|
fastTimeRange: [],
|
// 下发
|
fastDistributeForm: {
|
fastWay: null,
|
fastNumLimit: null,
|
start: null,
|
end: null,
|
unitId: null
|
},
|
// 自动生成工单规则
|
settingRules: {
|
outLine: [
|
{ required: true, message: "请填写点位离线时长", trigger: "blur" }
|
],
|
videoQuality: [
|
{ required: true, message: "请填写视频可用程度", trigger: "change" }
|
],
|
videoLabel: [
|
{ required: true, message: "请填写点视频标注准确率", trigger: "blur" }
|
],
|
},
|
// 下发表单验证
|
fastDistributeRules: {
|
fastWay: [
|
{ required: true, message: "请选择快速分发方式", trigger: "change" }
|
],
|
fastNumLimit: [
|
{ required: true, message: "请输入快速分发数量限制", trigger: "change" }
|
],
|
},
|
queryParams: {
|
unitId: null,
|
pageNum: 1,
|
pageSize: 20,
|
},
|
// 总条数
|
total: 0,
|
// 非多个禁用
|
multiple: true,
|
activeIndex: '0',
|
loading: false,
|
workOrderList: [],
|
}
|
},
|
mounted() {
|
this.page();
|
},
|
methods: {
|
submitSetting() {
|
this.$refs['settingForm'].validate((valid) => {
|
if (valid) {
|
this.$modal.msgSuccess("保存成功")
|
} else {
|
console.log('error submit!!');
|
return false;
|
}
|
});
|
},
|
page() {
|
this.loading = true;
|
distributeWorkOrder(this.queryParams).then(res => {
|
this.workOrderList = res.data;
|
this.total = res.total;
|
this.loading = false;
|
})
|
},
|
changeUnit(unitId, unitName) {
|
this.unitId = unitId;
|
this.queryParams.unitId = unitId;
|
this.unitName = unitName;
|
this.page()
|
},
|
clearFastDistributeForm() {
|
this.fastDistributeForm.fastWay = ''
|
this.fastDistributeForm.start = null
|
this.fastDistributeForm.end = null
|
this.fastDistributeForm.fastNumLimit = null
|
this.fastTimeRange = []
|
},
|
// 全部下发
|
allDistribute() {
|
this.fastDistribute();
|
},
|
// 快速下发
|
fastDistribute() {
|
// this.$refs['fastDistributeForm'].validate((valid) => {
|
// if (valid) {
|
// 如果是自定义方式,那么时间段必填
|
if (this.fastDistributeForm.fastWay === '101' && !this.fastTimeRange.length > 0) {
|
this.$message.warning("请选择时间范围")
|
return false
|
}
|
if (this.fastTimeRange.length > 0) {
|
this.fastDistributeForm.start = this.fastTimeRange[0]
|
this.fastDistributeForm.end = this.fastTimeRange[1]
|
}
|
this.fastDistributeForm.unitId = this.unitId
|
fastDistribute(this.fastDistributeForm).then(res => {
|
// this.clearFastDistributeForm();
|
this.page();
|
})
|
// } else {
|
// return false
|
// }
|
// })
|
},
|
// 选中工单下发
|
selectedDistribute() {
|
if (this.multipleSelection.length < 1) {
|
this.$message.warning("请先选择要下发的工单")
|
return
|
}
|
this.fastDistribute();
|
},
|
handleSelect(key, keyPath) {
|
console.log(key, keyPath);
|
},
|
getList() {
|
|
},
|
// 多选框选中数据
|
handleSelectionChange(selection) {
|
this.multipleSelection = selection.map(item => item.id)
|
},
|
}
|
}
|
</script>
|
|
<style scoped>
|
.row {
|
padding: 0 20px;
|
}
|
.op-warp {
|
margin-top: 10px;
|
}
|
.content-warp {
|
margin-top: 10px;
|
}
|
.op {
|
margin-right: 5px;
|
}
|
.setting {
|
position: absolute;
|
top: 10px;
|
right:5px
|
}
|
|
</style>
|