| | |
| | | <div class="row"> |
| | | <el-row type="flex" justify="left"> |
| | | <el-col :span="24" style="position: relative"> |
| | | <el-menu :default-active="activeIndex" class="el-menu-demo" mode="horizontal" @select="handleSelect"> |
| | | <el-menu :default-active="activeIndex" class="el-menu" mode="horizontal" @select="handleSelect"> |
| | | <el-menu-item index="0" @click="changeUnit(null, '全部')"> |
| | | 全部单位 |
| | | </el-menu-item> |
| | |
| | | <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-button size="small" type="danger" @click="allDistribute" 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> |
| | | <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> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {distributeWorkOrder, fastDistribute} from '@/api/platform/work-order' |
| | | export default { |
| | | name: 'index', |
| | | data() { |
| | |
| | | fastTimeRange: [], |
| | | // 下发 |
| | | fastDistributeForm: { |
| | | fastWay: '', |
| | | fastWay: null, |
| | | fastNumLimit: null, |
| | | start: null, |
| | | end: null, |
| | |
| | | ], |
| | | }, |
| | | queryParams: { |
| | | unitId: null, |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | pageSize: 20, |
| | | }, |
| | | // 总条数 |
| | | total: 0, |
| | |
| | | workOrderList: [], |
| | | } |
| | | }, |
| | | mounted() { |
| | | this.page(); |
| | | }, |
| | | methods: { |
| | | 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; |
| | | // todo 触发数据查询 |
| | | this.page() |
| | | }, |
| | | clearFastDistributeForm() { |
| | | this.fastDistributeForm.fastWay = '' |
| | |
| | | allDis() {}, |
| | | // 全部下发 |
| | | allDistribute() { |
| | | this.$modal.confirm("确定要下发" + (this.unitId ? this.unitName + "下的" : "所有工单") + "吗?").then(function() { |
| | | return this.allDis(); |
| | | }).then(() => { |
| | | // this.getList(); |
| | | // this.$modal.msgSuccess("删除成功"); |
| | | }).catch(() => {}); |
| | | this.fastDistribute(); |
| | | }, |
| | | // 快速下发 |
| | | fastDistribute() { |
| | | this.$refs['fastDistributeForm'].validate((valid) => { |
| | | if (valid) { |
| | | // this.$refs['fastDistributeForm'].validate((valid) => { |
| | | // if (valid) { |
| | | // 如果是自定义方式,那么时间段必填 |
| | | if (this.fastDistributeForm.fastWay === '101' && !this.fastTimeRange.length > 0) { |
| | | this.$message.warning("请选择时间范围") |
| | |
| | | this.fastDistributeForm.end = this.fastTimeRange[1] |
| | | } |
| | | this.fastDistributeForm.unitId = this.unitId |
| | | // todo 提交快速发布请求 |
| | | } else { |
| | | return false |
| | | } |
| | | }) |
| | | fastDistribute(this.fastDistributeForm).then(res => { |
| | | // this.clearFastDistributeForm(); |
| | | this.page(); |
| | | }) |
| | | // } else { |
| | | // return false |
| | | // } |
| | | // }) |
| | | }, |
| | | // 选中工单下发 |
| | | selectedDistribute() { |
| | |
| | | this.$message.warning("请先选择要下发的工单") |
| | | return |
| | | } |
| | | // todo 下发工单 |
| | | this.fastDistribute(); |
| | | }, |
| | | handleSelect(key, keyPath) { |
| | | console.log(key, keyPath); |
| | |
| | | top: 10px; |
| | | right:5px |
| | | } |
| | | |
| | | </style> |