Commit cdd9ec0b authored by Kimber's avatar Kimber

Merge branch 'rev2'

parents 2bf9672c 1313bb76
...@@ -96,9 +96,9 @@ export default { ...@@ -96,9 +96,9 @@ export default {
}, },
// 修改 // 修改
set: (iotNormalMachine) => { set: (iotNormalMachine) => {
iotNormalMachine.enterpriseId = null // iotNormalMachine.enterpriseId = null
iotNormalMachine.mineType = null // iotNormalMachine.mineType = null
iotNormalMachine.mineId = null // iotNormalMachine.mineId = null
iotNormalMachine.createDatetime = null iotNormalMachine.createDatetime = null
iotNormalMachine.createBy = null iotNormalMachine.createBy = null
iotNormalMachine.updateDatetime = null iotNormalMachine.updateDatetime = null
......
...@@ -50,7 +50,7 @@ export default { ...@@ -50,7 +50,7 @@ export default {
// 修改地下矿山 // 修改地下矿山
setUnderground: (mine) => { setUnderground: (mine) => {
mine.hasEnable = null mine.hasEnable = null
mine.enterpriseId = null // mine.enterpriseId = null
mine.createDatetime = null mine.createDatetime = null
mine.createBy = null mine.createBy = null
mine.updateDatetime = null mine.updateDatetime = null
...@@ -183,5 +183,14 @@ export default { ...@@ -183,5 +183,14 @@ export default {
method: 'get', method: 'get',
params: mineSearchParam params: mineSearchParam
}) })
},
// 根据企业查询所属矿山(含停产)enterpriseId
getAllMineByEnterpriseId: (mineSearchParam) => {
return request({
url: 'api/mine/underground/list',
method: 'get',
params: mineSearchParam
})
} }
} }
<template>
<div class="app-amap-search-point">
<el-autocomplete v-show="isSearch" v-model="mapInput" style="width: 100%;" :fetch-suggestions="querySearch" placeholder="请输入地址搜素" prefix-icon="el-icon-search" @select="handleSelect">
<template slot-scope="{ item }">
<div style="text-overflow: ellipsis; overflow: hidden;">{{ item.name }}</div>
<span style="font-size: 12px; color: #b4b4b4;">{{ item.district }}</span>
</template>
</el-autocomplete>
<div id="amap_search_point_container_add" :style="{padding: 0,margin: 0,width: '100%',height: mapHeight}" />
</div>
</template>
<script>
import AMapLoader from '@amap/amap-jsapi-loader'
export default {
name: 'AMapSearchPoint',
props: {
mapHeight: {
type: String,
default: () => { return '400px' }
},
isSearch: {
type: Boolean,
default: () => { return true }
},
point: {
type: Array,
default: () => { return null }
}
},
data() {
return {
mapInput: '',
lnglat: null,
mapMarker: null
}
},
computed: {},
watch: {
mapMarker(newValue, oldValue) {
if (oldValue) {
this.map.remove(oldValue)
}
if (newValue) {
this.map.add(newValue)
}
},
point() {
if (this.map) {
this.markPoint(this.point)
this.point && this.map.panTo(this.point)
}
}
},
created() {
this.initMap()
},
methods: {
// 输入选择
querySearch(queryString, callback) {
this.autoComplete.search(queryString, (status, result) => {
// result.tips[0].{name,district,location{lng,lat}}
if (result && result.tips) {
callback(result.tips.filter(tip => tip.location))
} else {
callback(null)
}
})
},
// 点选搜索结果
handleSelect(amapTip) {
if (amapTip.location.lng && amapTip.location.lat) {
this.$emit('choosePoint', [amapTip.location.lng, amapTip.location.lat])
} else {
this.$message({
message: '您所选的地点无法精确定位',
type: 'warning'
})
}
},
// 选中点
markPoint(lnglatArray) {
if (lnglatArray && lnglatArray.length === 2) {
this.mapMarker = new this.AMap.Marker({
position: new this.AMap.LngLat(lnglatArray[0], lnglatArray[1])
})
this.lnglat = lnglatArray
} else {
this.mapMarker = null
}
},
initMap() {
AMapLoader.load({
key: 'a0efee399e638b35211705625d786e83',
version: '2.0',
plugins: []
}).then((AMap) => {
this.AMap = AMap
// 加载地图
let center = [119.969873, 36.753901] // 平度市
if (this.defaultPoint && this.defaultPoint.length === 2) {
center = this.defaultPoint
}
this.map = new this.AMap.Map('amap_search_point_container_add', {
resizeEnable: true,
center: center,
zoom: 12
})
if (this.defaultPoint && this.defaultPoint.length === 2) {
this.markPoint(center)
}
// 点击选取
this.map.on('click', res => {
if (this.isSearch) {
if (res && res.lnglat && res.lnglat.lng && res.lnglat.lat) {
this.$emit('choosePoint', [res.lnglat.lng, res.lnglat.lat])
}
}
})
// 输入框选择位置
this.AMap.plugin(['AMap.AutoComplete'], () => {
this.autoComplete = new this.AMap.AutoComplete({
city: '全国'
})
})
// 初始化位置
if (this.point) {
this.markPoint(this.point)
this.point && this.map.panTo(this.point)
}
}).catch(e => {
console.error(e)
})
}
}
}
</script>
<style rel="stylesheet/scss" lang="scss" scoped>
</style>
...@@ -198,12 +198,14 @@ export default { ...@@ -198,12 +198,14 @@ export default {
id: value id: value
} }
}).then((res)=>{ }).then((res)=>{
Message({ this.$message({
message: '操作成功,正在重新加载页面', message: '操作成功,正在重新加载页面',
type: 'success', type: 'success',
duration: 3000 // 消息显示的时间,单位为 ms duration: 3000 // 消息显示的时间,单位为 ms
}); });
// window.location.reload() setTimeout(() => {
window.location.reload()
}, 500);
}) })
}, },
// 跳转到大屏 // 跳转到大屏
......
<template>
<div class="login" :style="'background-image:url(' + Background + ');'">
<div class="topTitle" >
<div class="floating-text">
中和地信有限公司欢迎您!
</div>
</div>
<div class="bottomTitle">@中和地信有限公司</div>
<div class="wrapper">
<div class="header">
<h2 @click="navTo('admin')"><i class="el-icon-setting"></i>管理后台</h2>
</div>
<div class="title">
<h1>中和地信应急平台</h1>
</div>
<div class="content">
<ul>
<li v-for="(item, index) in dataList" :key="index" @click="navTo(item.label)">
{{ item.label }}
</li>
</ul>
</div>
</div>
</div>
</template>
<script>
import qs from "qs";
import Background from "@/assets/images/background.webp";
import { mapGetters } from "vuex";
import menuApi from '@/api/system/menu.js'
export default {
name: "Login",
data() {
return {
show: false,
userStyle: null,
Background: Background,
codeUrl: "",
cookiePass: "",
loading: false,
redirect: undefined,
dataList: []
};
},
computed: {
...mapGetters(["user"]),
},
watch: {
$route: {
handler: function (route) {
const data = route.query;
if (data && data.redirect) {
this.redirect = data.redirect;
delete data.redirect;
if (JSON.stringify(data) !== "{}") {
this.redirect =
this.redirect + "&" + qs.stringify(data, { indices: false });
}
}
},
immediate: true,
},
},
created() {
// // 按照不同域名加载不同页面样式(企业、应急局),加载完毕后再显示页面
// const host = window.location.host;
// if (host === "yingji.longxijiancai.com") {
// this.userStyle = "应急局";
// }
// if (host === "qiye.longxijiancai.com") {
// this.userStyle = "企业";
// }
menuApi.getMenusHome().then((res)=>{
this.dataList = res.body
})
},
methods: {
navTo(type) {
var host = location.protocol + '//' + window.location.host;
if (type === "admin") {
// this.$router.push({ path: "home4Center" });
this.$router.push({ path: "/user/center" });
}else if(type === "应急管理"){
// this.$router.push({ path: "home4Center" });
// this.$router.push({ path: "/user/center" });
// location.href = 'http://192.168.3.226:8057/datav/index.html'
location.href = host + '/datav/index.html'
}else if(type === "自然资源"){
// location.href = process.env.NODE_ENV + ''
// location.href = 'http://192.168.3.226:8057/datav/natural.html'
location.href = host + '/datav/natural.html'
}else if(type === "水利系统"){
// location.href = 'http://192.168.3.226:8057/datav/watersource.html'
location.href = host + '/datav/watersource.html'
}else if(type === "电子档案馆"){
// this.$router.push({ path: "home4Center" });
this.$router.push({ path: "/user/center" });
}
},
},
};
</script>
<style rel="stylesheet/scss" lang="scss">
@keyframes floatShadow {
0% {
transform:translateX(1300px);
display:block;
}
100% {
transform:translateX(-1300px);
display:none;
}
}
.floating-text {
font-size:18px;line-height:1;
color: #FDD756;text-shadow: 0 0 5px #fff;
animation: floatShadow;
animation-name:floatShadow;
animation-duration: 20s;
animation-iteration-count: infinite;
animation-timing-function:linear;
position:absolute;top:8px;
}
.topTitle {
position: absolute;
top: 0;
background: #15181a73;
height: 32px;
width: 100%;
line-height: 32px;
color: #fff;
text-align: center;
}
.bottomTitle {
position: absolute;
bottom: 0;
background: #021d39;
height: 32px;
width: 100%;
line-height: 32px;
color: #fff;
text-align: center;
}
.wrapper {
.header {
h2 {
color: #00346b;
text-align: right;
position: absolute;
top: 20px;
right: 20px;
cursor: pointer;
}
}
h1 {
text-align: center;
color: #00346b;
}
ul {
list-style: none;
width: 900px;
overflow: hidden;
}
li {
float: left;
width: 400px;
background: #173e67;
height: 170px;
line-height: 170px;
text-align: center;
color: #fff;
font-size: 28px;
font-weight: bold;
margin: 10px;
cursor: pointer;
&:nth-child(1) {
background: #135965;
}
&:nth-child(4) {
background: #135965;
}
}
}
.login {
position: relative;
display: flex;
justify-content: center;
align-items: center;
height: 100%;
background-size: cover;
}
</style>
<template> <template>
<div class="login" :style="'background-image:url(' + Background + ');'"> <div class="login" :style="'background-image:url(' + Background + ');'">
<div class="topTitle" > <div class="topTitle" :style="'background-image:url(' + Title + ');'">
<div class="floating-text"> 中和地信应急平台
中和地信有限公司欢迎您!
</div> </div>
<div class="subTopTitle">
<h2 :style="'background-image:url(' + Welcome + ');'">
<img src="@/assets/home4Index/icon5.png" />中和地信有限公司欢迎您!
</h2>
<h2 @click="navTo('admin')" style="cursor: pointer;">
<img src="@/assets/home4Index/icon6.png" />管理后台
</h2>
</div> </div>
<div class="bottomTitle">@中和地信有限公司</div>
<div class="wrapper"> <div class="wrapper">
<div class="header">
<h2 @click="navTo('admin')"><i class="el-icon-setting"></i>管理后台</h2>
</div>
<div class="title">
<h1>中和地信应急平台</h1>
</div>
<div class="content"> <div class="content">
<ul> <ul>
<li v-for="(item, index) in dataList" :key="index" @click="navTo(item.label)"> <li
{{ item.label }} v-for="(item, index) in dataList"
:key="index"
@click="navTo(item.label)"
>
<div class="itemDiv">
<img
:src="require(`@/assets/home4Index/icon${index + 1}.png`)"
alt=""
/>
<p>
<span>{{ item.label }}</span>
<img src="@/assets/home4Index/underline2.png" />
</p>
</div>
</li> </li>
</ul> </ul>
</div> </div>
</div> </div>
<div class="bottomTitle">@中和地信有限公司</div>
</div> </div>
</template> </template>
<script> <script>
import qs from "qs"; import qs from "qs";
import Background from "@/assets/images/background.webp"; import Background from "@/assets/home4Index/bg.png";
import Title from "@/assets/home4Index/title.png";
import Welcome from "@/assets/home4Index/underline.png";
import { mapGetters } from "vuex"; import { mapGetters } from "vuex";
import menuApi from '@/api/system/menu.js' import menuApi from "@/api/system/menu.js";
export default { export default {
name: "Login", name: "Login",
data() { data() {
...@@ -36,11 +52,13 @@ export default { ...@@ -36,11 +52,13 @@ export default {
show: false, show: false,
userStyle: null, userStyle: null,
Background: Background, Background: Background,
Welcome,
Title,
codeUrl: "", codeUrl: "",
cookiePass: "", cookiePass: "",
loading: false, loading: false,
redirect: undefined, redirect: undefined,
dataList: [] dataList: [],
}; };
}, },
computed: { computed: {
...@@ -63,8 +81,6 @@ export default { ...@@ -63,8 +81,6 @@ export default {
}, },
}, },
created() { created() {
// // 按照不同域名加载不同页面样式(企业、应急局),加载完毕后再显示页面 // // 按照不同域名加载不同页面样式(企业、应急局),加载完毕后再显示页面
// const host = window.location.host; // const host = window.location.host;
// if (host === "yingji.longxijiancai.com") { // if (host === "yingji.longxijiancai.com") {
...@@ -73,30 +89,32 @@ export default { ...@@ -73,30 +89,32 @@ export default {
// if (host === "qiye.longxijiancai.com") { // if (host === "qiye.longxijiancai.com") {
// this.userStyle = "企业"; // this.userStyle = "企业";
// } // }
menuApi.getMenusHome().then((res)=>{ menuApi.getMenusHome().then((res) => {
this.dataList = res.body this.dataList = res.body;
}) });
}, },
methods: { methods: {
navTo(type) { navTo(type) {
var host = location.protocol + "//" + window.location.host;
if (type === "admin") { if (type === "admin") {
// this.$router.push({ path: "home4Center" }); // this.$router.push({ path: "home4Center" });
this.$router.push({ path: "/user/center" }); this.$router.push({ path: "/user/center" });
} else if (type === "应急管理") {
}else if(type === "应急管理"){
// this.$router.push({ path: "home4Center" }); // this.$router.push({ path: "home4Center" });
// this.$router.push({ path: "/user/center" }); // this.$router.push({ path: "/user/center" });
location.href = 'http://192.168.3.226:8057/datav/index.html' // location.href = 'http://192.168.3.226:8057/datav/index.html'
}else if(type === "自然资源"){ location.href = host + "/datav/index.html";
} else if (type === "自然资源") {
// location.href = process.env.NODE_ENV + '' // location.href = process.env.NODE_ENV + ''
location.href = 'http://192.168.3.226:8057/datav/natural.html' // location.href = 'http://192.168.3.226:8057/datav/natural.html'
}else if(type === "水利系统"){ location.href = host + "/datav/natural.html";
location.href = 'http://192.168.3.226:8057/datav/watersource.html' } else if (type === "水利系统") {
}else if(type === "电子档案馆"){ // location.href = 'http://192.168.3.226:8057/datav/watersource.html'
location.href = host + "/datav/watersource.html";
} else if (type === "电子档案馆") {
// this.$router.push({ path: "home4Center" }); // this.$router.push({ path: "home4Center" });
this.$router.push({ path: "/user/center" }); this.$router.push({ path: "/user/center" });
} }
}, },
}, },
...@@ -104,40 +122,75 @@ export default { ...@@ -104,40 +122,75 @@ export default {
</script> </script>
<style rel="stylesheet/scss" lang="scss"> <style rel="stylesheet/scss" lang="scss">
@keyframes floatShadow { @keyframes floatShadow {
0% { 0% {
transform:translateX(1300px); transform: translateX(1300px);
display:block; display: block;
} }
100% { 100% {
transform:translateX(-1300px); transform: translateX(-1300px);
display:none; display: none;
} }
} }
.floating-text { .floating-text {
font-size:18px;line-height:1; font-size: 18px;
color: #FDD756;text-shadow: 0 0 5px #fff; line-height: 1;
color: #fdd756;
text-shadow: 0 0 5px #fff;
animation: floatShadow; animation: floatShadow;
animation-name:floatShadow; animation-name: floatShadow;
animation-duration: 20s; animation-duration: 20s;
animation-iteration-count: infinite; animation-iteration-count: infinite;
animation-timing-function:linear; animation-timing-function: linear;
position:absolute;top:8px; position: absolute;
top: 8px;
} }
.subTopTitle {
display: -webkit-box;
display: -ms-flexbox;
display: flex;
-ms-flex-pack: distribute;
justify-content: space-between;
position: absolute;
top: 10px;
width: 100%;
/* z-index: 99999; */
height: 110px;
color: #fff;
font-size: 12px;
padding: 10px 43px;
align-items: center;
h2 {
display: inline-block;
vertical-align: middle;
letter-spacing: 2px;
font-weight: 600;
color: #fdfdfd;
&:first-child {
height: 50px;
background-repeat: no-repeat;
background-position-y: 30px;
}
}
img {
vertical-align: middle;
margin-right: 10px;
}
}
.topTitle { .topTitle {
position: absolute; position: absolute;
top: 0; top: 0;
background: #15181a73;
height: 32px;
width: 100%; width: 100%;
line-height: 32px;
color: #fff; color: #fff;
text-align: center; text-align: center;
background-size: cover;
height: 100px;
font-size: 38px;
line-height: 100px;
font-weight: bold;
letter-spacing: 5px;
} }
.bottomTitle { .bottomTitle {
position: absolute; position: absolute;
...@@ -166,14 +219,16 @@ export default { ...@@ -166,14 +219,16 @@ export default {
} }
ul { ul {
list-style: none; list-style: none;
width: 900px; // width: 1200px;
overflow: hidden; overflow: hidden;
} }
li { li {
display: flex;
justify-content: center;
float: left; float: left;
width: 400px; width: 304px;
background: #173e67; // background: #173e67;
height: 170px; height: 620px;
line-height: 170px; line-height: 170px;
text-align: center; text-align: center;
color: #fff; color: #fff;
...@@ -182,13 +237,44 @@ export default { ...@@ -182,13 +237,44 @@ export default {
margin: 10px; margin: 10px;
cursor: pointer; cursor: pointer;
&:nth-child(1) { &:nth-child(1) {
background: #135965; // background: #135965;
} }
&:nth-child(4) { &:nth-child(4) {
background: #135965; // background: #135965;
} }
&:hover {
background-image: url("../assets/home4Index/bg2.png");
}
background-image: url("../assets/home4Index/bg1.png");
background-repeat: no-repeat;
background-size: cover;
} }
} }
.itemDiv {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
& > img {
width: 120px;
margin-left: 30px;
}
p {
width: 180px;
margin-top: -10px;
position: relative;
span {
font-weight: 500;
letter-spacing: 3px;
}
img {
position: absolute;
bottom: 45px;
right: 15px;
}
}
}
.login { .login {
position: relative; position: relative;
display: flex; display: flex;
......
...@@ -4,16 +4,296 @@ ...@@ -4,16 +4,296 @@
<div class="head-container"> <div class="head-container">
<div> <div>
<el-input v-model="searchParam.nameLike" 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-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-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="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="searchParamReset">重置</el-button>
<el-button class="filter-item" size="mini" type="warning" icon="el-icon-refresh-left" @click="add">新增</el-button>
<el-tooltip class="item" effect="dark" content="按当前查询条件导出" placement="top"> <el-tooltip class="item" effect="dark" content="按当前查询条件导出" placement="top">
<el-button :loading="exporting" class="filter-item" size="mini" type="info" plain icon="el-icon-download" @click="exportSubmit">导出</el-button> <el-button :loading="exporting" class="filter-item" size="mini" type="info" plain icon="el-icon-download" @click="exportSubmit">导出</el-button>
</el-tooltip> </el-tooltip>
</div> </div>
</div> </div>
<el-dialog append-to-body :close-on-click-modal="true" :visible.sync="addCompanyShow" :title="'企业信息'" width="1160px">
<el-form ref="addCompanyForm" :model="mainDataEditing" :rules="mainFormRules" size="mini" label-width="170px" style="margin-right: 100px;">
<el-row :gutter="10">
<el-divider content-position="center">基础信息</el-divider>
<el-col :span="12">
<el-form-item label="企业名称:" prop="name">
<el-input v-model="mainDataEditing.name"/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="公司地址:" prop="address">
<el-input v-model="mainDataEditing.address" maxlength="500" show-word-limit />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="100">
<el-col :span="12">
<el-form-item label="所属区域:" prop="_administrativeAreaCascade">
<!-- <el-cascader v-model="mainDataEditing._administrativeAreaCascade" style="width: 100%;" :options="administrativeAreaList" clearable /> -->
<el-cascader
v-model="mainDataEditing._administrativeAreaCascade"
:options="administrativeAreaList"
:props="{ checkStrictly: true, value: 'id' }"
:show-all-levels="false"
></el-cascader>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="所属集团:" prop="">
<!-- <el-select v-model="mainDataEditing.dict41" placeholder="请选择" style="width: 100%;">
<el-option v-for="item in dict41List" :key="item.id" :label="item.value" :value="item.id" />
</el-select> -->
<el-select
v-model="mainDataEditing.pid"
placeholder="请输入企业"
clearable
>
<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-row>
<el-row :gutter="100">
<el-col :span="12">
<el-form-item label="单位性质:" prop="dict1">
<el-select v-model="mainDataEditing.dict1" placeholder="请选择" style="width: 100%;">
<el-option v-for="item in dict1List" :key="item.id" :label="item.value" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="经济类型:" prop="dict2">
<el-select v-model="mainDataEditing.dict2" placeholder="请选择" style="width: 100%;">
<el-option v-for="item in dict2List" :key="item.id" :label="item.value" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="100">
<el-col :span="12">
<el-form-item label="行业类别:" prop="dict3">
<el-select v-model="mainDataEditing.dict3" placeholder="请选择" style="width: 100%;">
<el-option v-for="item in dict3List" :key="item.id" :label="item.value" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="统一社会信用代码:" prop="idCode">
<el-input v-model="mainDataEditing.idCode" maxlength="100" show-word-limit />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="100">
<el-col :span="12">
<el-form-item label="是否有注册资本:" prop="hasRegisteredCapital">
<el-radio-group v-model="mainDataEditing.hasRegisteredCapital" size="mini">
<el-radio-button :label="true"></el-radio-button>
<el-radio-button :label="false"></el-radio-button>
</el-radio-group>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item v-if="mainDataEditing.hasRegisteredCapital" label="注册资本(万元):" prop="registeredCapital">
<el-input-number v-model="mainDataEditing.registeredCapital" :precision="2" :controls="false" style="width: 100%;" :min="0" :max="999999" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="100">
<el-col :span="18">
<el-form-item label="经营范围:" prop="businessScope">
<el-input v-model="mainDataEditing.businessScope" type="textarea" :rows="3" maxlength="1000" show-word-limit />
</el-form-item>
</el-col>
</el-row>
<el-divider content-position="center">企业资质</el-divider>
<el-row :gutter="100">
<el-col :span="12">
<el-form-item label="成立日期:" prop="setupDate">
<el-date-picker v-model="mainDataEditing.setupDate" value-format="yyyy-MM-dd" type="date" placeholder="选择日期" style="width: 100%;" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="100">
<el-col :span="12">
<el-form-item label="经营期限(起):" prop="beginLimitDate">
<el-date-picker v-model="mainDataEditing.beginLimitDate" value-format="yyyy-MM-dd" type="date" placeholder="选择日期" style="width: 100%;" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="经营期限(止):" prop="endLimitDate">
<el-date-picker v-model="mainDataEditing.endLimitDate" value-format="yyyy-MM-dd" type="date" placeholder="选择日期" style="width: 100%;" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="100">
<el-col :span="12">
<el-form-item label="生产经营方式:" prop="dict4">
<el-select v-model="mainDataEditing.dict4" placeholder="请选择" style="width: 100%;">
<el-option v-for="item in dict4List" :key="item.id" :label="item.value" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="100">
<el-col :span="12">
<el-form-item label="企业规模:" prop="dict5">
<el-select v-model="mainDataEditing.dict5" placeholder="请选择" style="width: 100%;">
<el-option v-for="item in dict5List" :key="item.id" :label="item.value" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="是否规模以上企业:" prop="dict6">
<el-select v-model="mainDataEditing.dict6" placeholder="请选择" style="width: 100%;">
<el-option v-for="item in dict6List" :key="item.id" :label="item.value" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="100">
<el-col :span="12">
<el-form-item label="隶属层级:" prop="dict7">
<el-select v-model="mainDataEditing.dict7" placeholder="请选择" style="width: 100%;">
<el-option v-for="item in dict7List" :key="item.id" :label="item.value" :value="item.id" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="100">
<el-col :span="12">
<el-form-item label="责任人:" prop="liablePerson">
<el-input v-model="mainDataEditing.liablePerson" maxlength="30" show-word-limit />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="责任人电话:" prop="liablePersonPhone">
<el-input v-model="mainDataEditing.liablePersonPhone" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="100">
<el-col :span="12">
<el-form-item label="生产经营地址:" prop="businessAddress">
<el-input v-model="mainDataEditing.businessAddress" maxlength="500" show-word-limit />
</el-form-item>
</el-col>
</el-row>
<el-divider content-position="center">证书</el-divider>
<el-row :gutter="100">
<el-col :span="12">
<el-form-item label="采矿许可证:" prop="_workLicenseFileList">
<el-upload
class="upload-demo"
:action="`${baseApi}/api/file/upload`"
multiple
:headers="httpHeaders"
:limit="1"
:on-success="upFileSuccessWork"
:on-remove="upFileRemoveWork"
:on-error="upFileError"
:on-exceed="upFileExceed"
:before-upload="upFileBefore"
:on-preview="openFile"
:file-list="mainDataEditing._workLicenseFileListShow"
>
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">图片不要超过20M,仅支持jpeg、png格式</div>
</el-upload>
</el-form-item>
</el-col>
<el-col :span="12">
<div>
<el-form-item label="采矿许可有效期:" prop="workLicenseBeginDate">
<el-date-picker v-model="mainDataEditing.workLicenseBeginDate" value-format="yyyy-MM-dd" type="date" placeholder="选择日期" style="width: 100%;" />
</el-form-item>
</div>
<div>
<el-form-item label="至:" prop="workLicenseEndDate">
<el-date-picker v-model="mainDataEditing.workLicenseEndDate" value-format="yyyy-MM-dd" type="date" placeholder="选择日期" style="width: 100%;" />
</el-form-item>
</div>
</el-col>
</el-row>
<el-row :gutter="100">
<el-col :span="12">
<el-form-item label="安全生产许可证:" prop="_safetyLicenseFileList">
<el-upload
class="upload-demo"
:action="`${baseApi}/api/file/upload`"
multiple
:headers="httpHeaders"
:limit="1"
:on-success="upFileSuccessSafety"
:on-remove="upFileRemoveSafety"
:on-error="upFileError"
:on-exceed="upFileExceed"
:before-upload="upFileBefore"
:on-preview="openFile"
:file-list="mainDataEditing._safetyLicenseFileListShow"
>
<el-button size="small" type="primary">点击上传</el-button>
<div slot="tip" class="el-upload__tip">图片不要超过20M,仅支持jpeg、png格式</div>
</el-upload>
</el-form-item>
</el-col>
<el-col :span="12">
<div>
<el-form-item label="安全许可有效期:" prop="safetyLicenseBeginDate">
<el-date-picker v-model="mainDataEditing.safetyLicenseBeginDate" value-format="yyyy-MM-dd" type="date" placeholder="选择日期" style="width: 100%;" />
</el-form-item>
</div>
<div>
<el-form-item label="至:" prop="safetyLicenseEndDate">
<el-date-picker v-model="mainDataEditing.safetyLicenseEndDate" value-format="yyyy-MM-dd" type="date" placeholder="选择日期" style="width: 100%;" />
</el-form-item>
</div>
</el-col>
</el-row>
<el-divider content-position="center">位置</el-divider>
<el-row :gutter="100">
<el-col :span="12">
<el-form-item label="经度:" prop="longitude">
<el-input-number v-model="mainDataEditing.longitude" :precision="6" :controls="false" style="width: 100%;" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="纬度:" prop="latitude">
<el-input-number v-model="mainDataEditing.latitude" :precision="6" :controls="false" style="width: 100%;" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="100">
<el-col :span="18">
<el-form-item label="位置地图:">
<AMapSearchPointAdd :is-search="true" :point="mapPoint4add" @choosePoint="choosePoint" />
</el-form-item>
</el-col>
</el-row>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="text" @click="addCompanyShow=false">取消</el-button>
<el-button type="primary" @click="confirmAdd">确认</el-button>
</div>
</el-dialog>
<!--企业信息窗--> <!--企业信息窗-->
<el-dialog append-to-body :close-on-click-modal="true" :visible.sync="dialog1Show" :title="'企业信息'" width="1160px"> <el-dialog append-to-body :close-on-click-modal="true" :visible.sync="dialog1Show" :title="'企业信息'" width="1160px">
<el-form ref="mainForm" :model="dialog1Data" size="mini" label-width="170px"> <el-form ref="mainForm" :model="dialog1Data" size="mini" label-width="170px">
...@@ -25,20 +305,20 @@ ...@@ -25,20 +305,20 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="统一社会信用代码:" prop="idCode"> <el-form-item label="公司地址:" prop="address">
<span>{{ dialog1Data.idCode }}</span> <span>{{ dialog1Data.address }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="行政区域:" prop="administrativeAreaCode"> <el-form-item label="所属区域:">
<span>{{ dialog1Data.administrativeAreaName }}</span> <span>{{ dialog1Data.deptName }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="公司地址:" prop="address"> <el-form-item label="所属集团:">
<span>{{ dialog1Data.address }}</span> <span>{{ dialog1Data.pName }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
...@@ -147,6 +427,11 @@ ...@@ -147,6 +427,11 @@
<span>{{ dialog1Data.businessAddress }}</span> <span>{{ dialog1Data.businessAddress }}</span>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12">
<el-form-item label="统一社会信用代码:" prop="idCode">
<span>{{ dialog1Data.idCode }}</span>
</el-form-item>
</el-col>
</el-row> </el-row>
<el-divider content-position="left">证书</el-divider> <el-divider content-position="left">证书</el-divider>
<el-row :gutter="20"> <el-row :gutter="20">
...@@ -230,6 +515,8 @@ ...@@ -230,6 +515,8 @@
<!-- <el-table-column type="selection" width="55" /> --> <!-- <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="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="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"> <!-- <el-table-column :show-overflow-tooltip="true" label="审核状态" prop="auditState" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-for="e in enterpriseApi.auditStates()" :key="e.key"> <span v-for="e in enterpriseApi.auditStates()" :key="e.key">
...@@ -258,7 +545,9 @@ ...@@ -258,7 +545,9 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" width="200px" align="center" fixed="right"> <el-table-column label="操作" width="200px" align="center" fixed="right">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button v-show="scope.row.auditState!=1" size="mini" round @click="showEnterpriseInfo(scope.row.id)">查看详情</el-button> <el-button size="mini" round @click="showEnterpriseInfo(scope.row.id)">查看详情</el-button>
<el-button size="mini" round @click="editEnterpriseInfo(scope.row)">修改</el-button>
<!-- <el-button v-show="scope.row.auditState==1" size="mini" round @click="auditBtn(scope.row, 2)">通过</el-button> <!-- <el-button v-show="scope.row.auditState==1" size="mini" round @click="auditBtn(scope.row, 2)">通过</el-button>
<el-button v-show="scope.row.auditState==1" size="mini" round @click="auditBtn(scope.row, 3)">不通过</el-button> --> <el-button v-show="scope.row.auditState==1" size="mini" round @click="auditBtn(scope.row, 3)">不通过</el-button> -->
</template> </template>
...@@ -279,24 +568,98 @@ ...@@ -279,24 +568,98 @@
<script> <script>
import enterpriseApi from '@/api/kd/enterprise' import enterpriseApi from '@/api/kd/enterprise'
import dictionaryApi from '@/api/kd/dictionary'
import AMapSearchPoint from '@/components/AMap/AMapSearchPoint' import AMapSearchPoint from '@/components/AMap/AMapSearchPoint'
import AMapSearchPointAdd from '@/components/AMap/AMapSearchPointAdd'
import { getDeptList } from '@/api/system/dept'
import {getCompanyList} from '@/api/system/user'
import request from '@/utils/request'
import administrativeAreaApi from '@/api/kd/administrativeArea'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { downloadFile } from '@/utils' import { downloadFile } from '@/utils'
import { getToken } from '@/utils/auth'
import { validatePhone } from '@/utils/validate'
const searchParam = {// 默认搜索条件 const searchParam = {// 默认搜索条件
page: 1, page: 1,
count: 10, count: 10,
searchCount: true searchCount: true,
nameLike: '',
auditState: '',
deptId: ''
} }
export default { export default {
name: 'CEnterprise', // 本页面名 name: 'CEnterprise', // 本页面名
components: { AMapSearchPoint }, components: { AMapSearchPoint, AMapSearchPointAdd },
data() { data() {
return { return {
/**
* 新增字段
*/
httpHeaders: {
'Authorization': getToken()
},
addCompanyShow: false,
mainDataEditing: {},
dict1List: [],
dict2List: [],
dict3List: [],
dict4List: [],
dict5List: [],
dict6List: [],
dict7List: [],
dict41List: [], // 企业类型
administrativeAreaList: [],
options4enterpriseIdList: [],
dialog1FormRules: {
code: [{ required: true, message: '请输入' }]
},
mainFormRules: {
name: [{ required: true, message: '请输入' }],
idCode: [{ required: true, message: '请输入' }],
_administrativeAreaCascade: [{ required: true, message: '请选择' }],
address: [{ required: true, message: '请输入' }],
dict1: [{ required: true, message: '请选择' }],
dict2: [{ required: true, message: '请选择' }],
dict3: [{ required: true, message: '请选择' }],
hasRegisteredCapital: [{ required: true, message: '请选择' }],
registeredCapital: [{ required: true, message: '请输入' }],
businessScope: [{ required: true, message: '请输入' }],
setupDate: [{ required: true, message: '请选择' }],
beginLimitDate: [{ required: true, message: '请选择' }],
endLimitDate: [{ required: true, message: '请选择' }],
dict4: [{ required: true, message: '请选择' }],
dict5: [{ required: true, message: '请选择' }],
dict6: [{ required: true, message: '请选择' }],
dict7: [{ required: true, message: '请选择' }],
dict41: [{ required: true, message: '请选择' }],
liablePerson: [{ required: true, message: '请输入' }],
liablePersonPhone: [{ required: true, trigger: 'blur', validator: validatePhone }],
businessAddress: [{ required: true, message: '请输入' }],
longitude: [{ required: true, message: '请选择位置' }],
latitude: [{ required: true, message: '请选择位置' }],
_workLicenseFileList: [{ required: true, message: '请选择' }],
workLicenseBeginDate: [{ required: true, message: '请选择' }],
workLicenseEndDate: [{ required: true, message: '请选择' }],
_safetyLicenseFileList: [{ required: true, message: '请选择' }],
safetyLicenseBeginDate: [{ required: true, message: '请选择' }],
safetyLicenseEndDate: [{ required: true, message: '请选择' }]
},
searching: false, searching: false,
exporting: false, exporting: false,
enterpriseApi: enterpriseApi, enterpriseApi: enterpriseApi,
searchParam: {}, searchParam: {
nameLike: '',
auditState: '',
deptId: ''
},
searchResult: { searchResult: {
total: 0, total: 0,
results: [] // 搜索结果 results: [] // 搜索结果
...@@ -321,19 +684,215 @@ export default { ...@@ -321,19 +684,215 @@ export default {
return [this.dialog1Data.longitude * 1, this.dialog1Data.latitude * 1] return [this.dialog1Data.longitude * 1, this.dialog1Data.latitude * 1]
} }
return null return null
},
mapPoint4add() {
if (this.mainDataEditing.longitude && this.mainDataEditing.latitude) {
return [this.mainDataEditing.longitude * 1, this.mainDataEditing.latitude * 1]
}
return null
} }
}, },
mounted() { mounted() {
// administrativeAreaApi.cascadeElementUI().then(response => {
// this.administrativeAreaList = response.results
// })
getDeptList({
}).then((res) => {
this.administrativeAreaList = res.body.content;
});
getCompanyList({
// deptId
})
.then((res) => {
this.options4enterpriseIdList = res.body;
});
const dictGroups = [1, 2, 3, 4, 5, 6, 7]
dictGroups.forEach(i => {
dictionaryApi.getList({ 'groupCode': i }).then(response => {
this['dict' + i + 'List'] = response.results
})
})
this.searchParamReset() this.searchParamReset()
this.searchSubmit() this.searchSubmit()
}, },
methods: { methods: {
/**
* 企业新增
*/
confirmAdd(){
this.$refs.addCompanyForm.validate((valid) => {
if (valid) {
if (this.mainDataEditing.beginLimitDate >= this.mainDataEditing.endLimitDate) {
this.$message.error('经营期限(起)应小于经营期限(止)')
} else if (this.mainDataEditing.workLicenseBeginDate >= this.mainDataEditing.workLicenseEndDate) {
this.$message.error('采矿许可有效期(起)应小于采矿许可有效期(止)')
} else if (this.mainDataEditing.safetyLicenseBeginDate >= this.mainDataEditing.safetyLicenseEndDate) {
this.$message.error('安全许可有效期(起)应小于安全许可有效期(止)')
}else{
this.addCompanyLoading = true
this.mainDataEditing.deptId = this.mainDataEditing._administrativeAreaCascade[this.mainDataEditing._administrativeAreaCascade.length - 1]
delete this.mainDataEditing._administrativeAreaCascade
if (this.mainDataEditing._workLicenseFileList) {
this.mainDataEditing.workLicenseFilePath = JSON.stringify(this.mainDataEditing._workLicenseFileList)
}
if (this.mainDataEditing._safetyLicenseFileList) {
this.mainDataEditing.safetyLicenseFilePath = JSON.stringify(this.mainDataEditing._safetyLicenseFileList)
}
if(this.mainDataEditing.id){
let enterprise = JSON.parse(JSON.stringify(this.mainDataEditing))
enterprise.name = null
enterprise.createDatetime = null
enterprise.createBy = null
enterprise.updateDatetime = null
enterprise.updateBy = null
enterprise.hasEnable = null
enterprise.applyDatetime = null
enterprise.auditState = null
enterprise.auditDatetime = null
enterprise.auditBy = null
request({
url: 'api/enterprise/set-my',
method: 'post',
data: enterprise
}).then(() => {
this.addCompanyLoading = false
this.addCompanyShow = false
this.$message({
message: '操作完成',
type: 'success'
})
this.searchSubmit()
}).catch(() => {
this.addCompanyLoading = false
this.addCompanyShow = false
})
}else{
request({
url: 'api/enterprise/add/enterpriseList',
method: 'post',
data: this.mainDataEditing
}).then(() => {
this.addCompanyLoading = false
this.addCompanyShow = false
this.$message({
message: '操作完成',
type: 'success'
})
this.searchSubmit()
}).catch(() => {
this.addCompanyLoading = false
this.addCompanyShow = false
})
}
}
}else{
this.$message({
message: '填写不满足要求,请检查',
type: 'error'
})
}
});
},
add(){
this.mainDataEditing = {}
// this.mainDataEditing.id = null
this.addCompanyShow = true
},
elementuiUpListFormat(fileList) {
const filePathArray = []
fileList.forEach(f => {
if (f.response && f.response.result) {
filePathArray.push({
name: f.name,
url: f.response.result
})
} else if (f.name && f.url) {
filePathArray.push({
name: f.name,
url: f.url
})
}
})
return filePathArray
},
upFileSuccessWork(response, file, fileList) {
if (!this.mainDataEditing._workLicenseFileList) {
this.mainDataEditing._workLicenseFileList = []
}
this.mainDataEditing._workLicenseFileList.push({
name: file.name,
url: response.result
})
this.$set(this.mainDataEditing, '_workLicenseFileList', this.mainDataEditing._workLicenseFileList)
},
upFileRemoveWork(file, fileList) {
this.mainDataEditing._workLicenseFileList = this.elementuiUpListFormat(fileList)
},
upFileSuccessSafety(response, file, fileList) {
if (!this.mainDataEditing._safetyLicenseFileList) {
this.mainDataEditing._safetyLicenseFileList = []
}
this.mainDataEditing._safetyLicenseFileList.push({
name: file.name,
url: response.result
})
this.$set(this.mainDataEditing, '_safetyLicenseFileList', this.mainDataEditing._safetyLicenseFileList)
},
upFileRemoveSafety(file, fileList) {
this.mainDataEditing._safetyLicenseFileList = this.elementuiUpListFormat(fileList)
},
upFileError() {
this.$message.error('上传失败,请稍后再试')
},
upFileExceed() {
this.$message.error('只可以上传一张照片')
},
upFileBefore(file) {
const isIMG = file.type === 'image/jpeg' || file.type === 'image/png'
const isLtSize = file.size / 1024 / 1024 < 20
if (!isIMG) {
this.$message.error('上传图片只能是 JPG/JPEG/PNG 格式')
return false
}
if (!isLtSize) {
this.$message.error('上传图片大小不能超过 20MB')
return false
}
return true
},
openFile(file) {
if (file.url) {
window.open(this.baseApi + '/file' + file.url)
} else if (file.response && file.response.result) {
window.open(this.baseApi + '/file' + file.response.result)
}
},
choosePoint(lnglat) {
console.log(lnglat)
if (lnglat) {
this.$set(this.mainDataEditing, 'longitude', lnglat[0])
this.$set(this.mainDataEditing, 'latitude', lnglat[1])
} else {
this.$set(this.mainDataEditing, 'longitude', null)
this.$set(this.mainDataEditing, 'latitude', null)
}
},
searchParamReset() { searchParamReset() {
this.searchParam = JSON.parse(JSON.stringify(searchParam)) this.searchParam = JSON.parse(JSON.stringify(searchParam))
}, },
searchSubmit() { searchSubmit() {
this.searching = true 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.searchResult = response
this.searching = false this.searching = false
}).catch(() => { }).catch(() => {
...@@ -357,6 +916,19 @@ export default { ...@@ -357,6 +916,19 @@ export default {
dialog2Submit() { dialog2Submit() {
this.doAudit(this.dialog2Data) this.doAudit(this.dialog2Data)
}, },
editEnterpriseInfo(row){
this.addCompanyShow = true
this.mainDataEditing = row
if (this.mainDataEditing.workLicenseFilePath) {
this.mainDataEditing._workLicenseFileList = JSON.parse(this.mainDataEditing.workLicenseFilePath)
this.mainDataEditing._workLicenseFileListShow = JSON.parse(this.mainDataEditing.workLicenseFilePath) // 数据存放与原始绑定分开,可以防止中途赋值产生的闪烁问题
}
if (this.mainDataEditing.safetyLicenseFilePath) {
this.mainDataEditing._safetyLicenseFileList = JSON.parse(this.mainDataEditing.safetyLicenseFilePath)
this.mainDataEditing._safetyLicenseFileListShow = JSON.parse(this.mainDataEditing.safetyLicenseFilePath) // 数据存放与原始绑定分开,可以防止中途赋值产生的闪烁问题
}
this.mainDataEditing._administrativeAreaCascade = [row.deptId]
},
showEnterpriseInfo(enterpriseId) { showEnterpriseInfo(enterpriseId) {
enterpriseApi.getById(enterpriseId).then(response => { enterpriseApi.getById(enterpriseId).then(response => {
this.dialog1Data = response this.dialog1Data = response
......
...@@ -206,7 +206,7 @@ ...@@ -206,7 +206,7 @@
<el-upload <el-upload
v-show="editing" v-show="editing"
class="upload-demo" class="upload-demo"
action="/api/file/upload" :action="`${baseApi}/api/file/upload`"
multiple multiple
:headers="httpHeaders" :headers="httpHeaders"
:limit="1" :limit="1"
...@@ -247,7 +247,7 @@ ...@@ -247,7 +247,7 @@
<el-upload <el-upload
v-show="editing" v-show="editing"
class="upload-demo" class="upload-demo"
action="/api/file/upload" :action="`${baseApi}/api/file/upload`"
multiple multiple
:headers="httpHeaders" :headers="httpHeaders"
:limit="1" :limit="1"
......
...@@ -4,6 +4,8 @@ ...@@ -4,6 +4,8 @@
<div class="head-container"> <div class="head-container">
<div> <div>
<el-input v-model="searchParam.nameLike" 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-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="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="searchParamReset">重置</el-button>
<el-tooltip class="item" effect="dark" content="按当前查询条件导出" placement="top"> <el-tooltip class="item" effect="dark" content="按当前查询条件导出" placement="top">
...@@ -28,6 +30,34 @@ ...@@ -28,6 +30,34 @@
<!--弹出框1--> <!--弹出框1-->
<el-dialog append-to-body :close-on-click-modal="true" :visible.sync="dialog1Show" :title="editState==1?'新增':editState==2?'修改':'查看'" width="960px"> <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-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-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="测点编号:" prop="code"> <el-form-item label="测点编号:" prop="code">
...@@ -227,6 +257,9 @@ ...@@ -227,6 +257,9 @@
<el-table ref="table" v-loading="searching" :data="tableData" row-key="id"> <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="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="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="name" label="测点名称" align="center" />
<el-table-column :show-overflow-tooltip="true" prop="monitoringType" label="测点类型" align="center"> <el-table-column :show-overflow-tooltip="true" prop="monitoringType" label="测点类型" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
...@@ -265,6 +298,9 @@ ...@@ -265,6 +298,9 @@
<script> <script>
import iotEnvironmentMachineApi from '@/api/kd/iotEnvironmentMachine' import iotEnvironmentMachineApi from '@/api/kd/iotEnvironmentMachine'
import AMapSearchPoint from '@/components/AMap/AMapSearchPoint' import AMapSearchPoint from '@/components/AMap/AMapSearchPoint'
import mineApi from '@/api/kd/mine'
import {getCompanyList} from '@/api/system/user'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { downloadFile } from '@/utils' import { downloadFile } from '@/utils'
...@@ -272,13 +308,18 @@ import { downloadFile } from '@/utils' ...@@ -272,13 +308,18 @@ import { downloadFile } from '@/utils'
const searchParam = {// 默认搜索条件 const searchParam = {// 默认搜索条件
page: 1, page: 1,
count: 10, count: 10,
searchCount: true searchCount: true,
mineName: '',
enterpriseName: ''
} }
export default { export default {
name: 'EIotEnvironmentMachine', // 本页面名 name: 'EIotEnvironmentMachine', // 本页面名
components: { AMapSearchPoint }, components: { AMapSearchPoint },
data() { data() {
return { return {
options4enterpriseIdList: [],
mineList: [],
selectedMine: {}, selectedMine: {},
httpHeaders: { httpHeaders: {
'Authorization': getToken() 'Authorization': getToken()
...@@ -296,6 +337,8 @@ export default { ...@@ -296,6 +337,8 @@ export default {
dialog1Saving: false, dialog1Saving: false,
dialog1Data: {}, dialog1Data: {},
dialog1Rules: { dialog1Rules: {
enterpriseId: [{ required: true, message: '请选择' }],
mineId: [{ required: true, message: '请选择' }],
code: [{ required: true, message: '请填写' }], code: [{ required: true, message: '请填写' }],
name: [{ required: true, message: '请填写' }], name: [{ required: true, message: '请填写' }],
monitoringPointDataType: [{ required: true, message: '请选择' }] monitoringPointDataType: [{ required: true, message: '请选择' }]
...@@ -326,26 +369,45 @@ export default { ...@@ -326,26 +369,45 @@ export default {
} }
}, },
mounted() { mounted() {
const selectedMineJson = window.localStorage.getItem('kd.selected.mine') // const selectedMineJson = window.localStorage.getItem('kd.selected.mine')
let noMine = false // let noMine = false
if (!selectedMineJson) { // if (!selectedMineJson) {
noMine = true // noMine = true
} else { // } else {
const selectedMine = JSON.parse(selectedMineJson) // const selectedMine = JSON.parse(selectedMineJson)
if (!selectedMine || selectedMine.enterpriseId !== this.user.enterpriseId) { // if (!selectedMine || selectedMine.enterpriseId !== this.user.enterpriseId) {
noMine = true // noMine = true
} else { // } else {
this.selectedMine = selectedMine // this.selectedMine = selectedMine
} // }
} // }
// if (noMine) { // if (noMine) {
// this.$message.error('当前未选择矿山') // this.$message.error('当前未选择矿山')
// this.$router.replace('/dashboard') // this.$router.replace('/dashboard')
// } // }
this.searchParamReset() this.searchParamReset()
this.searchSubmit() this.searchSubmit()
// 获取企业公司
getCompanyList({})
.then((res) => {
this.options4enterpriseIdList = res.body;
});
}, },
methods: { 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() { searchParamReset() {
this.searchParam = JSON.parse(JSON.stringify(searchParam)) this.searchParam = JSON.parse(JSON.stringify(searchParam))
}, },
...@@ -383,9 +445,10 @@ export default { ...@@ -383,9 +445,10 @@ export default {
} else { } else {
this.dialog1Saving = true this.dialog1Saving = true
this.removeOtherMonitoringPoint(this.dialog1Data) this.removeOtherMonitoringPoint(this.dialog1Data)
this.dialog1Data.mineType = '1' // 地下矿山
if (this.editState === 1) { // 新增 if (this.editState === 1) { // 新增
this.dialog1Data.mineType = this.selectedMine.mineType // this.dialog1Data.mineType = this.selectedMine.mineType
this.dialog1Data.mineId = this.selectedMine.id // this.dialog1Data.mineId = this.selectedMine.id
iotEnvironmentMachineApi.add(this.dialog1Data).then(() => { iotEnvironmentMachineApi.add(this.dialog1Data).then(() => {
this.dialog1Show = false this.dialog1Show = false
this.$message.success('保存成功') this.$message.success('保存成功')
...@@ -440,6 +503,7 @@ export default { ...@@ -440,6 +503,7 @@ export default {
this.dialog1Show = true this.dialog1Show = true
this.$nextTick(() => { this.$nextTick(() => {
this.$refs['dialog1Form'].clearValidate() this.$refs['dialog1Form'].clearValidate()
this.getAllMineByEnterpriseId(this.dialog1Data.enterpriseId)
}) })
}).catch(() => { }).catch(() => {
this.searchSubmit() this.searchSubmit()
...@@ -447,6 +511,7 @@ export default { ...@@ -447,6 +511,7 @@ export default {
}, },
dialog2Submit() { dialog2Submit() {
this.dialog2Saving = true this.dialog2Saving = true
iotEnvironmentMachineApi.del(this.dialog2Data).then(() => { iotEnvironmentMachineApi.del(this.dialog2Data).then(() => {
this.dialog2Show = false this.dialog2Show = false
this.$message.success('删除成功') this.$message.success('删除成功')
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<div> <div>
<el-input v-model="searchParam.code" clearable size="small" placeholder="矿山编号" style="width: 200px;" class="filter-item" /> <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-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-button class="filter-item" size="mini" type="success" icon="el-icon-search" @click="searchSubmit">搜索</el-button> <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="searchParamReset">重置</el-button>
</div> </div>
...@@ -30,9 +31,20 @@ ...@@ -30,9 +31,20 @@
</el-row> </el-row>
<el-row :gutter="20"> <el-row :gutter="20">
<el-col :span="12"> <el-col :span="12">
<el-form-item label="所属行政区划:" prop="_administrativeAreaCascade"> <!-- <el-form-item label="所属行政区划:" prop="_administrativeAreaCascade">
<span v-show="!editing">{{ dialog1Data.administrativeAreaName }}</span> <span v-show="!editing">{{ dialog1Data.administrativeAreaName }}</span>
<el-cascader v-show="editing" v-model="dialog1Data._administrativeAreaCascade" style="width: 100%;" :options="administrativeAreaList" clearable /> <el-cascader v-show="editing" v-model="dialog1Data._administrativeAreaCascade" style="width: 100%;" :options="administrativeAreaList" clearable />
</el-form-item> -->
<el-form-item label="所属企业:" prop="enterpriseId">
<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-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
...@@ -386,7 +398,10 @@ ...@@ -386,7 +398,10 @@
<el-table ref="table" v-loading="searching" :data="tableData" row-key="id"> <el-table ref="table" v-loading="searching" :data="tableData" row-key="id">
<!-- <el-table-column type="selection" width="55" /> --> <!-- <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="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="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="code" align="center" />
<el-table-column :show-overflow-tooltip="true" label="矿山地址" prop="address" 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" /> <el-table-column :show-overflow-tooltip="true" label="建矿时间" prop="buildDate" align="center" />
...@@ -429,16 +444,19 @@ import AMapSearchPoint from '@/components/AMap/AMapSearchPoint' ...@@ -429,16 +444,19 @@ import AMapSearchPoint from '@/components/AMap/AMapSearchPoint'
import { getToken } from '@/utils/auth' import { getToken } from '@/utils/auth'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { validatePhone } from '@/utils/validate' import { validatePhone } from '@/utils/validate'
import {getCompanyList} from '@/api/system/user'
const searchParam = {// 默认搜索条件 const searchParam = {// 默认搜索条件
page: 1, page: 1,
count: 10, count: 10,
searchCount: true searchCount: true,
enterpriseName:''
} }
export default { export default {
name: 'EUnderground', // 本页面名 name: 'EUnderground', // 本页面名
components: { AMapSearchPoint }, components: { AMapSearchPoint },
data() { data() {
return { return {
companyList: [],
httpHeaders: { httpHeaders: {
'Authorization': getToken() 'Authorization': getToken()
}, },
...@@ -502,8 +520,16 @@ export default { ...@@ -502,8 +520,16 @@ export default {
}) })
this.searchParamReset() this.searchParamReset()
this.searchSubmit() this.searchSubmit()
this.getCompanyList()
}, },
methods: { methods: {
getCompanyList(){
getCompanyList({})
.then((res) => {
this.companyList = res.body;
});
},
searchParamReset() { searchParamReset() {
this.searchParam = JSON.parse(JSON.stringify(searchParam)) this.searchParam = JSON.parse(JSON.stringify(searchParam))
}, },
......
...@@ -146,7 +146,7 @@ export default { ...@@ -146,7 +146,7 @@ export default {
mixins: [presenter(), header(), form(defaultForm), crud()], mixins: [presenter(), header(), form(defaultForm), crud()],
data() { data() {
return { return {
dateScopes: ["本级", "全部"], dateScopes: ["全部", "本级及以下", "自定义",],
defaultProps: { children: 'children', label: 'label', isLeaf: 'leaf' }, defaultProps: { children: 'children', label: 'label', isLeaf: 'leaf' },
level: 3, level: 3,
currentId: 0, currentName: '', menuLoading: false, showButton: false, currentId: 0, currentName: '', menuLoading: false, showButton: false,
......
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