| | |
| | | <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) |
| | | 全部单位({{ totalWorkOrders }}) |
| | | </el-menu-item> |
| | | <el-menu-item index="1"> |
| | | 自流井运维单位(70) |
| | | <el-menu-item :index="index + 1" v-for="(item, index) in unitList" :key="index" @click="changeUnit(item.id, item.value)"> |
| | | {{ item.unitName }}({{ item.workOrderCount }}) |
| | | </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" |
| | |
| | | <el-option |
| | | v-for="item in unitList" |
| | | :key="item.id" |
| | | :label="item.value" |
| | | :label="item.unitName" |
| | | :value="item.id"> |
| | | </el-option> |
| | | </el-select> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {distributeWorkOrder, fastDistribute, addWorkOrder, updateWorkOrder} from '@/api/platform/work-order' |
| | | import {unitSelect} from "@/api/platform/unit"; |
| | | import {distributeWorkOrder, fastDistribute, addWorkOrder, updateWorkOrder, selectedIdsDistribute} from '@/api/platform/work-order' |
| | | import {workList} from "@/api/platform/unit"; |
| | | import { pointSelectData } from "@/api/platform/point"; |
| | | export default { |
| | | name: 'index', |
| | | data() { |
| | | return { |
| | | unitList: [], |
| | | settingForm: { |
| | | // 离线 |
| | | outLine: null, |
| | |
| | | }, |
| | | mounted() { |
| | | this.page(); |
| | | this.selectUnit(); |
| | | }, |
| | | computed: { |
| | | totalWorkOrders() { |
| | | return this.unitList.reduce((total, item) => total + item.workOrderCount, 0); |
| | | }, |
| | | }, |
| | | methods: { |
| | | submitSetting() { |
| | |
| | | }, |
| | | page() { |
| | | this.loading = true; |
| | | this.selectUnit(); |
| | | distributeWorkOrder(this.queryParams).then(res => { |
| | | this.workOrderList = res.data; |
| | | this.total = res.total; |
| | |
| | | }, |
| | | // 全部下发 |
| | | allDistribute() { |
| | | this.fastDistribute(); |
| | | selectedIdsDistribute([]).then(res => { |
| | | this.$message.success("工单下发成功") |
| | | }) |
| | | }, |
| | | // 快速下发 |
| | | fastDistribute() { |
| | |
| | | if (this.multipleSelection.length < 1) { |
| | | this.$message.warning("请先选择要下发的工单") |
| | | return |
| | | } |
| | | this.fastDistribute(); |
| | | } |
| | | selectedIdsDistribute(this.multipleSelection).then(res => { |
| | | this.$message.success("工单下发成功") |
| | | }) |
| | | }, |
| | | handleSelect(key, keyPath) { |
| | | console.log(key, keyPath); |
| | |
| | | }, |
| | | // 运维公司下拉数据 |
| | | selectUnit() { |
| | | unitSelect().then(res => { |
| | | workList().then(res => { |
| | | this.unitList = res.data; |
| | | }) |
| | | }, |