Commit 63efee99 authored by xinzhedeai's avatar xinzhedeai

地下矿山添加所属公司 公司添加所属区域

parent e85dea3f
......@@ -96,9 +96,9 @@ export default {
},
// 修改
set: (iotNormalMachine) => {
iotNormalMachine.enterpriseId = null
iotNormalMachine.mineType = null
iotNormalMachine.mineId = null
// iotNormalMachine.enterpriseId = null
// iotNormalMachine.mineType = null
// iotNormalMachine.mineId = null
iotNormalMachine.createDatetime = null
iotNormalMachine.createBy = null
iotNormalMachine.updateDatetime = null
......
......@@ -50,7 +50,7 @@ export default {
// 修改地下矿山
setUnderground: (mine) => {
mine.hasEnable = null
mine.enterpriseId = null
// mine.enterpriseId = null
mine.createDatetime = null
mine.createBy = null
mine.updateDatetime = null
......@@ -183,5 +183,14 @@ export default {
method: 'get',
params: mineSearchParam
})
},
// 根据企业查询所属矿山(含停产)enterpriseId
getAllMineByEnterpriseId: (mineSearchParam) => {
return request({
url: 'api/mine/underground/list',
method: 'get',
params: mineSearchParam
})
}
}
......@@ -198,12 +198,14 @@ export default {
id: value
}
}).then((res)=>{
Message({
this.$message({
message: '操作成功,正在重新加载页面',
type: 'success',
duration: 3000 // 消息显示的时间,单位为 ms
});
// window.location.reload()
setTimeout(() => {
window.location.reload()
}, 500);
})
},
// 跳转到大屏
......
......@@ -4,9 +4,16 @@
<div class="head-container">
<div>
<el-input v-model="searchParam.nameLike" clearable size="small" placeholder="企业名称" style="width: 200px;" class="filter-item" />
<el-select v-model="searchParam.auditState" placeholder="审核状态" clearable size="small" class="filter-item">
<el-cascader
v-model="searchParam.deptId"
:options="administrativeAreaList"
:props="{ checkStrictly: true, value: 'id' }"
:show-all-levels="false"
placeholder="所属区域"
></el-cascader>
<!-- <el-select v-model="searchParam.auditState" placeholder="审核状态" clearable size="small" class="filter-item">
<el-option v-for="e in enterpriseApi.auditStates()" :key="e.key" :label="e.value" :value="e.key" />
</el-select>
</el-select> -->
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="searchSubmit">搜索</el-button>
<el-button class="filter-item" size="mini" type="warning" icon="el-icon-refresh-left" @click="searchParamReset">重置</el-button>
<el-button class="filter-item" size="mini" type="warning" icon="el-icon-refresh-left" @click="add">新增</el-button>
......@@ -508,6 +515,8 @@
<!-- <el-table-column type="selection" width="55" /> -->
<el-table-column :show-overflow-tooltip="true" label="编号" prop="id" width="100px" align="center" />
<el-table-column :show-overflow-tooltip="true" label="企业名称" prop="name" align="center" />
<el-table-column :show-overflow-tooltip="true" label="所属区域" prop="deptName" align="center" />
<!-- <el-table-column :show-overflow-tooltip="true" label="审核状态" prop="auditState" align="center">
<template slot-scope="scope">
<span v-for="e in enterpriseApi.auditStates()" :key="e.key">
......@@ -581,7 +590,8 @@ const searchParam = {// 默认搜索条件
count: 10,
searchCount: true,
nameLike: '',
auditState: ''
auditState: '',
deptId: ''
}
export default {
name: 'CEnterprise', // 本页面名
......@@ -647,7 +657,8 @@ export default {
enterpriseApi: enterpriseApi,
searchParam: {
nameLike: '',
auditState: ''
auditState: '',
deptId: ''
},
searchResult: {
total: 0,
......@@ -877,7 +888,11 @@ export default {
},
searchSubmit() {
this.searching = true
enterpriseApi.getPage(this.searchParam).then(response => {
let deptId = this.searchParam.deptId[this.searchParam.deptId.length -1 ]
enterpriseApi.getPage({
...this.searchParam,
deptId
}).then(response => {
this.searchResult = response
this.searching = false
}).catch(() => {
......
......@@ -4,6 +4,8 @@
<div class="head-container">
<div>
<el-input v-model="searchParam.nameLike" clearable size="small" placeholder="测点名称" style="width: 200px;" class="filter-item" />
<el-input v-model="searchParam.enterpriseName" clearable size="small" placeholder="所属企业" style="width: 200px;" class="filter-item" />
<el-input v-model="searchParam.mineName" clearable size="small" placeholder="所属矿山" style="width: 200px;" class="filter-item" />
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="searchSubmit">搜索</el-button>
<el-button class="filter-item" size="mini" type="warning" icon="el-icon-refresh-left" @click="searchParamReset">重置</el-button>
<el-tooltip class="item" effect="dark" content="按当前查询条件导出" placement="top">
......@@ -28,6 +30,34 @@
<!--弹出框1-->
<el-dialog append-to-body :close-on-click-modal="true" :visible.sync="dialog1Show" :title="editState==1?'新增':editState==2?'修改':'查看'" width="960px">
<el-form ref="dialog1Form" :hide-required-asterisk="!dialog1Editing" :model="dialog1Data" :rules="dialog1Rules" size="mini" label-width="180px" style="margin-right: 80px;">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="所属企业:" prop="enterpriseId">
<span v-show="!dialog1Editing">{{ dialog1Data.enterpriseName }}</span>
<el-select
v-model="dialog1Data.enterpriseId"
placeholder="请选择"
@change="enterpriseChange"
>
<el-option
v-for="item in options4enterpriseIdList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属矿山" prop="mineId">
<span v-show="!dialog1Editing">{{ dialog1Data.mineName }}</span>
<el-select v-model="dialog1Data.mineId" placeholder="请选择" clearable size="small" class="filter-item" style="width: 200px;">
<el-option v-for="mine in mineList" :key="mine.index" :label="mine.name" :value="mine.index" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="测点编号:" prop="code">
......@@ -227,6 +257,9 @@
<el-table ref="table" v-loading="searching" :data="tableData" row-key="id">
<el-table-column :show-overflow-tooltip="true" prop="id" label="编号" width="100px" align="center" />
<el-table-column :show-overflow-tooltip="true" prop="code" label="测点编号" align="center" />
<el-table-column :show-overflow-tooltip="true" prop="enterpriseName" label="所属企业" align="center" />
<el-table-column :show-overflow-tooltip="true" prop="mineName" label="所属矿山" align="center" />
<el-table-column :show-overflow-tooltip="true" prop="name" label="测点名称" align="center" />
<el-table-column :show-overflow-tooltip="true" prop="monitoringType" label="测点类型" align="center">
<template slot-scope="scope">
......@@ -265,6 +298,9 @@
<script>
import iotEnvironmentMachineApi from '@/api/kd/iotEnvironmentMachine'
import AMapSearchPoint from '@/components/AMap/AMapSearchPoint'
import mineApi from '@/api/kd/mine'
import {getCompanyList} from '@/api/system/user'
import { getToken } from '@/utils/auth'
import { mapGetters } from 'vuex'
import { downloadFile } from '@/utils'
......@@ -272,13 +308,18 @@ import { downloadFile } from '@/utils'
const searchParam = {// 默认搜索条件
page: 1,
count: 10,
searchCount: true
searchCount: true,
mineName: '',
enterpriseName: ''
}
export default {
name: 'EIotEnvironmentMachine', // 本页面名
components: { AMapSearchPoint },
data() {
return {
options4enterpriseIdList: [],
mineList: [],
selectedMine: {},
httpHeaders: {
'Authorization': getToken()
......@@ -296,6 +337,8 @@ export default {
dialog1Saving: false,
dialog1Data: {},
dialog1Rules: {
enterpriseId: [{ required: true, message: '请选择' }],
mineId: [{ required: true, message: '请选择' }],
code: [{ required: true, message: '请填写' }],
name: [{ required: true, message: '请填写' }],
monitoringPointDataType: [{ required: true, message: '请选择' }]
......@@ -326,26 +369,45 @@ export default {
}
},
mounted() {
const selectedMineJson = window.localStorage.getItem('kd.selected.mine')
let noMine = false
if (!selectedMineJson) {
noMine = true
} else {
const selectedMine = JSON.parse(selectedMineJson)
if (!selectedMine || selectedMine.enterpriseId !== this.user.enterpriseId) {
noMine = true
} else {
this.selectedMine = selectedMine
}
}
// const selectedMineJson = window.localStorage.getItem('kd.selected.mine')
// let noMine = false
// if (!selectedMineJson) {
// noMine = true
// } else {
// const selectedMine = JSON.parse(selectedMineJson)
// if (!selectedMine || selectedMine.enterpriseId !== this.user.enterpriseId) {
// noMine = true
// } else {
// this.selectedMine = selectedMine
// }
// }
// if (noMine) {
// this.$message.error('当前未选择矿山')
// this.$router.replace('/dashboard')
// }
this.searchParamReset()
this.searchSubmit()
// 获取企业公司
getCompanyList({})
.then((res) => {
this.options4enterpriseIdList = res.body;
});
},
methods: {
enterpriseChange(value){
// 矿山选项卡
this.getAllMineByEnterpriseId(value)
},
getAllMineByEnterpriseId(enterpriseId){
mineApi.getAllMineByEnterpriseId({
enterpriseId
}).then(response => {
let i = 1
response.body.forEach(x => { x.index = i++ })
this.mineList = response.body
})
},
searchParamReset() {
this.searchParam = JSON.parse(JSON.stringify(searchParam))
},
......@@ -383,9 +445,10 @@ export default {
} else {
this.dialog1Saving = true
this.removeOtherMonitoringPoint(this.dialog1Data)
this.dialog1Data.mineType = '1' // 地下矿山
if (this.editState === 1) { // 新增
this.dialog1Data.mineType = this.selectedMine.mineType
this.dialog1Data.mineId = this.selectedMine.id
// this.dialog1Data.mineType = this.selectedMine.mineType
// this.dialog1Data.mineId = this.selectedMine.id
iotEnvironmentMachineApi.add(this.dialog1Data).then(() => {
this.dialog1Show = false
this.$message.success('保存成功')
......@@ -440,6 +503,7 @@ export default {
this.dialog1Show = true
this.$nextTick(() => {
this.$refs['dialog1Form'].clearValidate()
this.getAllMineByEnterpriseId(this.dialog1Data.enterpriseId)
})
}).catch(() => {
this.searchSubmit()
......@@ -447,6 +511,7 @@ export default {
},
dialog2Submit() {
this.dialog2Saving = true
iotEnvironmentMachineApi.del(this.dialog2Data).then(() => {
this.dialog2Show = false
this.$message.success('删除成功')
......
......@@ -5,7 +5,8 @@
<div>
<el-input v-model="searchParam.code" clearable size="small" placeholder="矿山编号" style="width: 200px;" class="filter-item" />
<el-input v-model="searchParam.nameLike" clearable size="small" placeholder="矿山名称" style="width: 200px;" class="filter-item" />
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="searchSubmit">搜索</el-button>
<el-input v-model="searchParam.enterpriseName" clearable size="small" placeholder="所属企业" style="width: 200px;" class="filter-item" />
<el-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="searchSubmit">搜索1</el-button>
<el-button class="filter-item" size="mini" type="warning" icon="el-icon-refresh-left" @click="searchParamReset">重置</el-button>
</div>
<el-button class="filter-item" size="mini" type="primary" icon="el-icon-plus" @click="beginAdd">新增</el-button>
......@@ -30,9 +31,20 @@
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="所属行政区划:" prop="_administrativeAreaCascade">
<!-- <el-form-item label="所属行政区划:" prop="_administrativeAreaCascade">
<span v-show="!editing">{{ dialog1Data.administrativeAreaName }}</span>
<el-cascader v-show="editing" v-model="dialog1Data._administrativeAreaCascade" style="width: 100%;" :options="administrativeAreaList" clearable />
</el-form-item> -->
<el-form-item label="所属企业:" prop="_administrativeAreaCascade">
<span v-show="!editing">{{ dialog1Data.enterpriseName }}</span>
<el-select v-show="editing" size="mini" v-model="dialog1Data.enterpriseId" placeholder="" @change="handleChange">
<el-option
v-for="item in companyList"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
......@@ -386,7 +398,10 @@
<el-table ref="table" v-loading="searching" :data="tableData" row-key="id">
<!-- <el-table-column type="selection" width="55" /> -->
<el-table-column :show-overflow-tooltip="true" label="编号" prop="id" width="100px" align="center" />
<el-table-column :show-overflow-tooltip="true" label="矿山名称" prop="name" align="center" />
<el-table-column :show-overflow-tooltip="true" label="所属企业" prop="enterpriseName" align="center" />
<el-table-column :show-overflow-tooltip="true" label="矿山编号" prop="code" align="center" />
<el-table-column :show-overflow-tooltip="true" label="矿山地址" prop="address" align="center" />
<el-table-column :show-overflow-tooltip="true" label="建矿时间" prop="buildDate" align="center" />
......@@ -429,16 +444,19 @@ import AMapSearchPoint from '@/components/AMap/AMapSearchPoint'
import { getToken } from '@/utils/auth'
import { mapGetters } from 'vuex'
import { validatePhone } from '@/utils/validate'
import {getCompanyList} from '@/api/system/user'
const searchParam = {// 默认搜索条件
page: 1,
count: 10,
searchCount: true
searchCount: true,
enterpriseName:''
}
export default {
name: 'EUnderground', // 本页面名
components: { AMapSearchPoint },
data() {
return {
companyList: [],
httpHeaders: {
'Authorization': getToken()
},
......@@ -502,8 +520,16 @@ export default {
})
this.searchParamReset()
this.searchSubmit()
this.getCompanyList()
},
methods: {
getCompanyList(){
getCompanyList({})
.then((res) => {
this.companyList = res.body;
});
},
searchParamReset() {
this.searchParam = JSON.parse(JSON.stringify(searchParam))
},
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment