| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | // 根据单位id查找合同 |
| | | export function timeRange(unitId) { |
| | | return request({ |
| | | url: '/system/contract/time/' + unitId, |
| | | method: 'get' |
| | | }) |
| | | } |
| | |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-popover> |
| | | <p>导入点位只做更新操作</p> |
| | | <div class="bottom_"> |
| | | <el-select v-model="importUnitId" size="small" placeholder="运维单位"> |
| | | <el-select @change="getUnitContractTime" v-model="importUnitId" size="small" placeholder="运维单位"> |
| | | <el-option v-for="unit in unitList" :key="unit.id" :label="unit.value" :value="unit.id"></el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="bottom_"> |
| | | <el-select @change="showTimeRange" v-model="contractId" size="small" placeholder="运维合同"> |
| | | <el-option v-for="(time, index) in timeList" :key="index" :label="time.name" :value="time.id"></el-option> |
| | | </el-select> |
| | | <span style="margin-left: 10px;color: #8a8989" v-show="importUnitId">该单位有{{timeList.length}}个合同</span> |
| | | </div> |
| | | <div class="bottom_"> |
| | | <el-date-picker |
| | |
| | | <el-button type="primary" size="mini" plain icon="el-icon-top" slot="reference">导入点位</el-button> |
| | | </el-popover> |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button type="danger" plain icon="el-icon-receiving" size="mini" @click="handleEditBatch" |
| | | v-hasPermi="['point:edit']">批量修改</el-button> |
| | | </el-col> |
| | | <!-- <el-col :span="1.5">--> |
| | | <!-- <el-button type="danger" plain icon="el-icon-receiving" size="mini" @click="handleEditBatch"--> |
| | | <!-- v-hasPermi="['point:edit']">批量修改</el-button>--> |
| | | <!-- </el-col>--> |
| | | <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> |
| | | </el-row> |
| | | |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { listPoint, getPoint, delPoint, addPoint, batchEdit, updatePoint, exportData, importData } from "@/api/platform/point"; |
| | | import { listPoint, getPoint, delPoint, addPoint, batchEdit, updatePoint, exportData, importData, timeRange } from "@/api/platform/point"; |
| | | import { unitSelect } from "@/api/platform/unit"; |
| | | import { getCascader } from '@/api/platform/region' |
| | | import { cascader } from '@/api/system/dept' |
| | |
| | | dicts: ['point_tag'], |
| | | data() { |
| | | return { |
| | | timeList: [], |
| | | timezone: [], |
| | | ywTimes: [], |
| | | fileList: [], |
| | | importFile: null, |
| | | importUrl: '', |
| | | importUnitId: null, |
| | | contractId: null, |
| | | download: false, |
| | | upload: false, |
| | | deptOptions: [], |
| | |
| | | this.getDeptCascader(); |
| | | }, |
| | | methods: { |
| | | getUnitContractTime(unitId) { |
| | | this.ywTimes = [] |
| | | this.contractId = null; |
| | | timeRange(unitId).then(res => { |
| | | this.timeList = res.data; |
| | | }) |
| | | }, |
| | | showTimeRange(contractId) { |
| | | let a = this.timeList.filter(item => item.id === contractId) |
| | | if (a.length < 1) { |
| | | this.ywTimes = [] |
| | | return |
| | | } |
| | | let target = a[0] |
| | | this.ywTimes = [target.startTime, target.endTime] |
| | | }, |
| | | beforeUpload(file) { |
| | | this.importFile = file |
| | | this.fileList = [file] |