Commit 5f95ec4d authored by jianqian's avatar jianqian

应急物资

parent bf02740d
......@@ -339,6 +339,27 @@ export const defalutRouterMap = [
},
component: () => import('@/views/EnseList/EnseList.vue')
},
{
path: '/Guaranteebise',
name: 'Guaranteebise',
component: Layout,
redirect: '/guarantee',
meta: {
title: '应急综合保障',
icon: 'iconfont iconqiye',
},
children: [
{
path: '/guarantee',
name: 'guarantee',
meta: {
title: '应急资源管理',
icon: '',
},
component: () => import('@/views/guarantee/guarantee.vue')
}
]
},
]
},
{
......
export default {
// URL:'http://192.168.1.104:60018/danger',
URL:'http://192.168.2.8:60018/danger',
// URL:'http://127.0.0.1:60018/danger',
URL:'http://36.148.23.59:8901/danger',
//URL:'http://36.148.23.59:8901/danger',
titleArray: [],
enterpriseId:'',
componentUrl: {
......@@ -25,7 +25,8 @@ export default {
MenuMg: "System",
RoleMg: "System",
UserMg: "System",
VideoList: "Video"
VideoList: "Video",
guarantee: "guarantee",
},
deleteFun(that: any, url: any, callback: any) {
(that as any)
......
<template>
<div class="EnseList">
<el-row class="topBar">
<el-col>
<el-form :inline="true" :model="searchData">
<el-form-item label="">
<el-select v-model="searchData.materialType" placeholder="请选择资源类型">
<el-option label="救援物资" value="救援物资"></el-option>
<el-option label="专家资源" value="专家资源"></el-option>
<el-option label="救援队伍" value="救援队伍"></el-option>
<el-option label="避难场所" value="避难场所"></el-option>
<el-option label="防护目标" value="防护目标"></el-option>
<el-option label="医疗卫生单位" value="医疗卫生单位"></el-option>
<el-option label="通信保障机构" value="通信保障机构"></el-option>
</el-select>
</el-form-item>
<el-form-item label="">
<el-input v-model="searchData.materialName" placeholder="请输入资源名称"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="searchFun()">
<i class="el-icon-search"></i> 搜索
</el-button>
<el-button type="primary" @click="resetFun()">
<i class="el-icon-refresh"></i> 重置
</el-button>
</el-form-item>
<el-form-item class="fr">
<el-button plain type="primary" @click="addFun()">
<i class="el-icon-plus"></i> 新增资源
</el-button>
</el-form-item>
</el-form>
</el-col>
</el-row>
<el-table :data="tableData.pageData" stripe border style="width:100%;" :loading="loading">
<el-table-column width="50" type="index" label="序号"></el-table-column>
<el-table-column prop="materialName" label="资源名称"></el-table-column>
<el-table-column prop="materialType" label="资源类型">
</el-table-column>
<el-table-column prop="num" label="资源数量"></el-table-column>
<el-table-column prop="address" label="地址"></el-table-column>
<el-table-column prop="contacts" label="联系人"></el-table-column>
<el-table-column prop="phone" label="电话"></el-table-column>
<el-table-column prop="createTime" label="创建时间"></el-table-column>
<!-- <el-table-column prop="stockNum" label="库存数量"></el-table-column> -->
<!-- <el-table-column prop="dangerGrade" label="危险等级"></el-table-column> -->
<el-table-column label="操作" width="220" align="center">
<template slot-scope="scope">
<el-button @click="editFun(scope.row)" size="small">编辑</el-button>
<el-button type="danger" @click="delFun(scope.row)" size="small">删除</el-button>
</template>
</el-table-column>
</el-table>
<el-pagination background layout="total,sizes, prev, pager, next, jumper" :total="tableData.total" @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="PAGE.page" :page-size="PAGE.size"></el-pagination>
<SafetyDeviceMgEdit :dialogVisible="dialogVisible" :editForm="formData" :title="dialogTit" @dialogFun="closeDialog" @refreshTableData="getTableData" :key="zjKey"></SafetyDeviceMgEdit>
</div>
</template>
<script lang="ts">
import {
Component,
Vue,
Provide
} from "vue-property-decorator";
import SafetyDeviceMgEdit from "./guaranteeEdit.vue";
import METHOD from "@/utils/methods";
@Component({
components: {
SafetyDeviceMgEdit
}
})
export default class SafetyDeviceMg extends Vue {
@Provide() tableData: Object = {
pageData: [],
total: 0
};
@Provide() PAGE: any = {
page: 1,
size: 10
};
@Provide() searchData: any = {
deviceName: "",
deviceNumber: "",
shortNum: "",
dataType: '',
};
@Provide() loading: Boolean = false;
//编辑组件
@Provide() dialogVisible: Boolean = false;
@Provide() dialogTit: String = "新增";
@Provide() formData: any = {
dataType: "",
enterpriseId: ""
};
@Provide() zjKey: any = 0;
@Provide() enterpriseId: string = "all";
@Provide() dataType: string = "";
getTableData() {
let that = this,
param = Object.assign({}, that.PAGE, that.searchData);
that.enterpriseId="all";
that.loading = true;
METHOD.axiosPost(
that,
`/material/materialInfoList`,
param,
function (res: any) {
that.loading = false;
if (res.code == 0) {
that.tableData = res.data;
console.log(res.data)
}
}
);
}
searchFun() {
this.PAGE = {
page: 1,
size: 10
};
this.getTableData();
}
resetFun() {
this.PAGE = {
page: 1,
size: 10
};
this.searchData = {
deviceName: "",
deviceNumber: "",
shortNum: "",
dataType: ''
};
this.getTableData();
}
addFun() {
this.zjKey++;
this.dialogVisible = true;
//this.formData.dataType = this.searchData.dataType;
if(METHOD.enterpriseId){
this.formData.enterpriseId = METHOD.enterpriseId;
}
}
editFun(row: any) {
this.dialogTit = "编辑";
this.formData = Object.assign({}, row);
this.zjKey++;
this.dialogVisible = true;
}
delFun(row: any) {
let that = this as any;
METHOD.deleteFun(
this,
`/material/deleteMaterial/${row.id}`,
function () {
that.getTableData();
}
);
}
handleSizeChange(val: any) {
this.PAGE.size = val;
this.getTableData();
}
handleCurrentChange(val: any) {
this.PAGE.page = val;
this.getTableData();
}
closeDialog() {
//关闭窗口
this.dialogVisible = false;
this.formData = {};
}
selectChange(val: any) {
this.searchData.dataType = val;
this.getTableData();
}
created() {
this.enterpriseId = METHOD.enterpriseId;
this.getTableData();
}
}
</script>
<style lang="scss">
@import "@/utils/public.scss";
</style>
<template>
<div class="wrapper editwrap">
<el-dialog
:visible.sync="dialogVisible"
:title="title"
:show-close="false"
:close-on-click-modal="false"
>
<el-form ref="editForm" :model="editForm" :rules="rules" label-width="106px">
<el-form-item label="资源名称" prop="materialName">
<el-input v-model="editForm.materialName"></el-input>
</el-form-item>
<!--<el-form-item label="资源类型" prop="materialType">-->
<!--<el-input v-model="editForm.materialType"></el-input>-->
<!--</el-form-item>-->
<el-form-item label="资源类型" prop="materialType">
<el-select v-model="editForm.materialType" placeholder="请选择资源类型">
<el-option label="救援物资" value="救援物资"></el-option>
<el-option label="专家资源" value="专家资源"></el-option>
<el-option label="救援队伍" value="救援队伍"></el-option>
<el-option label="避难场所" value="避难场所"></el-option>
<el-option label="防护目标" value="防护目标"></el-option>
<el-option label="医疗卫生单位" value="医疗卫生单位"></el-option>
<el-option label="通信保障机构" value="通信保障机构"></el-option>
</el-select>
</el-form-item>
<el-form-item label="资源数量" prop="num">
<el-input v-model="editForm.num"></el-input>
</el-form-item>
<p style="color: #F56C6C;float: left;position: relative;left: 45px;">*</p>
<el-form-item label="经纬度">
<el-row>
<el-col :span="8">
<!--<el-input v-model="editForm.longitude"></el-input>-->
<el-form-item prop="longitude" style="margin-right: 9px">
<el-input v-model="editForm.longitude"></el-input>
</el-form-item>
</el-col>
<el-col :span="8">
<el-form-item prop="latitude" style="margin-right: 9px">
<el-input v-model="editForm.latitude"></el-input>
</el-form-item>
<!--<el-input v-model="editForm.latitude"></el-input>-->
</el-col>
<el-col :span="6">
<el-button type="primary" plain @click="MapdialogFun">选择经纬度</el-button>
</el-col>
</el-row>
</el-form-item>
<el-form-item label="详细地址" prop="address">
<el-input v-model="editForm.address"></el-input>
</el-form-item>
<el-form-item label="联系人" prop="contacts">
<el-input v-model="editForm.contacts"></el-input>
</el-form-item>
<el-form-item label="电话" prop="phone">
<el-input v-model="editForm.phone"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button type="primary" size="small" @click="confirmFun('editForm')">确定</el-button>
<el-button @click="$emit('dialogFun')" size="small">取消</el-button>
</span>
</el-dialog>
<Mapdialog
v-if="loadmap"
:dialogTableVisible="dialogTableVisible"
@dialogcancelFun="dialogcancelFun"
:slat="editForm.latitude"
:slng="editForm.longitude"
@confirm="qrFun"
/>
</div>
</template>
<style lang="scss">
</style>
<script lang="ts">
import { Component, Vue, Provide, Prop, Watch } from "vue-property-decorator";
import { State, Getter, Mutation, Action } from "vuex-class";
import Mapdialog from "@/components/maplnglat.vue";
import METHOD from "@/utils/methods";
@Component({
components: { Mapdialog }
})
export default class SafetyDeviceMgEdit extends Vue {
//属性或参数中使用!:表示强制解析(告诉typescript编译器,这里一定有值),常用于vue-decorator中的@Prop
@Prop(Boolean) dialogVisible!: Boolean;
@Provide() loading: Boolean = false;
@Prop(Object) editForm!: {
deviceName: String;
longitude: Number;
latitude: Number;
dataType: String;
enterpriseId: String;
};
@Prop(String) title!: String;
// @Provide() editForm: any = {};
@Provide() enterpriseList: any = [];
@Provide() qvvalue: any = []; //区域值
@Provide() signsArr: any = []; //图例list
@Provide() dialogTableVisible: Boolean = false;
@Provide() rules: any = {
materialName: [{ required: true, trigger: "blur", message: "该项为必填项!" }],
materialType: [
{ required: true, trigger: "blur", message: "该项为必填项!" }
],
contacts: [{ required: true, trigger: "blur", message: "该项为必填项!" }],
num: [{ required: true, trigger: "blur", message: "该项为必填项!" }],
/*isBigDanger: [
{ required: true, trigger: "blur", message: "该项为必填项!" }
],
dangerGrade: [
{ required: true, trigger: "blur", message: "该项为必填项!" }
],*/
phone: [
{ required: true, trigger: "blur", message: "该项为必填项!" }
],
longitude: [{ required: true, trigger: "blur", message: "该项为必填项!" }],
latitude: [{ required: true, trigger: "blur", message: "该项为必填项!" }]
};
@Provide() loadmap: Boolean = false;
@Provide() play: Boolean = false;
@Provide() enterpriseId: string = "dbe0c3268a3c4911913f35a2fdcd0e3e";
qrFun(v: any) {
//确认选择经纬度
this.editForm.longitude = v.lng;
this.editForm.latitude = v.lat;
}
MapdialogFun() {
this.loadmap = false;
this.$nextTick(() => {
this.loadmap = true;
});
this.dialogTableVisible = true;
}
dialogcancelFun() {
this.dialogTableVisible = false;
}
//取消事件要在父级取消是所以用到 $emit
confirmFun(formName: string) {
let that = this,
params = that.editForm;
(that as any).$refs[formName].validate((valid: boolean) => {
if (valid) {
METHOD.axiosPost(
that,
`/material/addMaterInfo`,
params,
function(res: any) {
if (res.code == 0) {
(that as any).$emit("dialogFun");
(that as any).$message({
message: "操作成功!",
type: "success"
});
that.$emit("refreshTableData"); //刷新表格
}
}
);
} else {
return false;
}
});
}
getnterpriseListInfo() {
let that = this,
param ={accountStatus:'0'};
that.loading = true;
METHOD.axiosPost(
that,
`/enterpriseInfo/queryEnterpriseListInfo`,
param,
function(res: any) {
that.loading = false;
if (res.code == 0) {
that.enterpriseList = res.data;
}
}
);
}
getnterpriseListInfo() {
let that = this,
param ={accountStatus:'0'};
that.loading = true;
METHOD.axiosPost(
that,
`/enterpriseInfo/queryEnterpriseListInfo`,
param,
function(res: any) {
that.loading = false;
if (res.code == 0) {
that.enterpriseList = res.data;
}
}
);
}
seletChange(enterpriseId: any) {
let that = this,
arr;
arr = that.enterpriseList.filter((ele: any) => enterpriseId == ele.enterpriseId);
that.editForm.enterpriseListId = arr[0].enterpriseId;
}
created() {
//this.editForm = this.editFormData;
if(METHOD.enterpriseId){
this.enterpriseId = METHOD.enterpriseId;
}else{
//政府用户
this.play = true;
this.getnterpriseListInfo();
}
}
}
</script>
<style lang="scss">
@import "@/utils/public.scss";
</style>
......@@ -25,6 +25,7 @@
<QyMapone></QyMapone>
</div>
<div class="markBox">
<div @click="mapqiye" class="markbox-div" ref="qyzc" style="margin-top: 100px;">
<div class="markbox-click" ref="qyimg" style="width: 30%;height: 100%;float: left;text-align: right;">
<img width="27px" src="@/assets/mark/markqy.png" />
......@@ -70,9 +71,17 @@
</div>
</div>
<div @click="yinhuan" class="markbox-div" ref="yh">
<div class="markbox-click" ref="yhimg" style="width: 30%;height: 100%;float: left;text-align: right;">
<img width="30px" src="@/assets/mark/markjk.png" />
</div>
<div class="markbox-span" ref="zyh" style="width: 70%;height: 100%;float: left;text-align: center;line-height: 10px;padding-top: 18px;">
<span>应急物资<p></p><span style="font-family: 'UnidreamLED';font-size: 1.5rem;">{{materialData.total}}</span></span>
</div>
</div>
</div>
</div>
<el-dialog title="危险源" :visible.sync="dialogVisible1">
<el-form ref="goods" :model="goods" label-width="100px" class="demo-ruleForm">
<el-form-item label="名称:" prop="goodsName">
......@@ -177,16 +186,23 @@
@Provide() markers1: any = [];
@Provide() markers2: any = [];
@Provide() markers3: any = [];
@Provide() markers4: any = [];
@Provide() mapData: any = [];
@Provide() windowsArr: any = [];
@Provide() windowsArr1: any = [];
@Provide() windowsArr2: any = [];
@Provide() windowsArr3: any = [];
@Provide() windowsArr4: any = [];
@Provide() currentWindow: any = "";
// @Provide() searchOption: any = {
// city: "石家庄",
// citylimit: true,
// };
@Provide() PAGE: any = {
page: 1,
size: 1000
};
@Provide() materialData: any = [];
@Provide() lastVideoPlayId: any = "";
@Provide() markersB: any = [];
@Provide() dialogVisible1: Boolean = false;
......@@ -199,6 +215,7 @@
@Provide() qiyeVisble: boolean = true;
@Provide() wxyVisble: boolean = true;
@Provide() shipinVisble: boolean = true;
@Provide() maVisble: boolean = true;
@Provide() weihaiVisble: boolean = true;
@Provide() yinhuanVisble: boolean = true;
@Provide() treecheckedObj: any = {};
......@@ -235,6 +252,36 @@
}
);
}
getMaterial(){
let that = this;
var param = Object.assign({}, that.PAGE, );
METHOD.axiosPost(
that,
`/material/materialInfoList`,
param,
function (res: any) {
that.materialData = res.data;
if (res.code == 0&& res.data.pageData.length > 0) {
that.matermapData = res.data.pageData;
let latSum = 0;
let lngSum = 0;
that.matermapData.forEach((ele: any, index: any) => {
that.addMaterialMark(ele, index);
//that.addMark(ele,index);
lngSum += ele.longitude;
latSum += ele.latitude;
});
let center = [
lngSum / that.matermapData.length,
latSum / that.matermapData.length,
];
that.Mutil.setViewF({
center: center
})
}
}
);
}
getWindowInfo(enterpriseId: string) {
let that = this;
(window as any).checkDetail = function (param: string) {
......@@ -280,6 +327,31 @@
}
);
}
getMaterialWindow(id: string) {
let that = this;
console.log('----------------------'+id);
(window as any).checkDetail = function (param: string) {
that.$router.push({
path: "/EnDetail",
query: {
enterpriseId: param
}
});
};
let obj = that.materialData.pageData[id-1],
html =
`<div class="windowDg"><h3>应急资源详细信息</h3>` +
`<p><span>资源名称:</span>${obj.materialName}</p>` +
`<p><span>资源类型:</span>${obj.materialType}</p>` +
`<p><span>数量:</span>${obj.num}</p>` +
`<p><span>地址:</span>${obj.address}</p>` +
`<p><span>联系人:</span>${obj.contacts}</p>` +
`<p><span>联系方式:</span>${obj.phone}</p>` +
`</div>`;
that.Mutil.addPopup(html, obj.id, obj.longitude, obj.latitude)
}
getWxyWindowInfo(goodsId: string) {
let that = this;
(window as any).dialogVisible1Change = function () {
......@@ -358,6 +430,42 @@
}
this.isShowVideo = false;
}
addMaterialMark(obj: any, index: any) {
let icon,
that = this;
icon = require("@/assets/mark/markjk.png");
let option = {
position: [Number(obj.longitude), Number(obj.latitude)],
content: ` <img src="${icon}" width="25">`,
label: {
content: obj.materialName,
offset: [28, -7]
},
offset: [-13, -2],
events: {
click: (e: any) => {
that.windowsArr4.forEach((ele: any) => {
// console.log(ele,"ele")
ele.visible = false;
});
that.$nextTick(() => {
// console.log(ele,"ele")
that.currentWindow = that.windowsArr4[index];
that.currentWindow.visible = true;
});
},
},
visible: true,
};
that.Mutil.addMarkerToMap(
'material',
obj.materialName,
icon,
[obj.longitude, obj.latitude],
0.4,
index+1
);
}
addMark(obj: any, index: any) {
let icon,
that = this;
......@@ -505,6 +613,13 @@
that.markers[index].visible = false;
}
});
that.matermapData.forEach((ele: any, index: any) => {
if (ele.dataType == v || v == 0) {
that.markers4[index].visible = true;
} else {
that.markers4[index].visible = false;
}
});
that.wxymapData.forEach((ele: any, index: any) => {
if (ele.dataType == v || v == 0) {
that.markers1[index].visible = true;
......@@ -561,12 +676,17 @@
let that = this;
that.getshipinWindowInfo(shipinid);
}
getMaterialinfo(maid: any) {
let that = this;
that.getMaterialWindow(maid);
}
getyinhuanPopcon(yinhuanid: any) {
let that = this;
that.getyinhuanWindowInfo(yinhuanid);
}
created() {
this.getMapData();
this.getMaterial();
}
cancel(){
this.goods={};
......@@ -661,6 +781,10 @@
that.Mutil.closeAllOverlays();
let id = evt.selected[0].get('did');
if (id) that.getyinhuanPopcon(id);
}else if(evt.selected[0].get('type') === 'material'){
that.Mutil.closeAllOverlays();
let id = evt.selected[0].get('did');
if (id) that.getMaterialinfo(id);
}
......@@ -684,6 +808,19 @@
this.$refs.zqyzc.lastChild.style.color = "#fff";
}
}
mapma(){
if (this.maVisble) {
this.Mutil.visibleMarks(false, "material");
this.maVisble = false;
this.$refs.maimg.lastChild.style.display = "none";
} else {
this.Mutil.visibleMarks(true, "material");
this.maVisble = true;
this.$refs.maimg.lastChild.style.display = "block";
}
}
// mapbox(){
// let that = this;
......
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