|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-if="showSearch" @submit.native.prevent>
|
|
|
+ <el-form :model="queryParams" ref="queryForm" :inline="true" v-if="showSearch" @submit.native.prevent>
|
|
|
<el-form-item label-width="100px" label="名称" prop="name">
|
|
|
<el-input
|
|
|
v-model="queryParams.name"
|
|
@@ -16,7 +16,8 @@
|
|
|
<span @click="changeQueryType" v-if="queryParams.deptName == 1">只查询本级</span>
|
|
|
</template>
|
|
|
<treeselect v-model="queryParams.deptId" :options="deptOptions" multiple:false :show-count="true"
|
|
|
- placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'" style="width: 240px"/>
|
|
|
+ placeholder="请选择部门" @select="hx" :noResultsText="'空'" :noOptionsText="'空'"
|
|
|
+ style="width: 240px"/>
|
|
|
<el-input v-model="queryParams.deptName" v-if="false"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
@@ -33,7 +34,8 @@
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
v-hasPermi="['garbage_transfer:garbageTransfer:add']"
|
|
|
- >新增</el-button>
|
|
|
+ >新增
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
@@ -44,7 +46,8 @@
|
|
|
:disabled="single"
|
|
|
@click="handleUpdate"
|
|
|
v-hasPermi="['garbage_transfer:garbageTransfer:edit']"
|
|
|
- >修改</el-button>
|
|
|
+ >修改
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
@@ -55,7 +58,8 @@
|
|
|
:disabled="multiple"
|
|
|
@click="handleDelete"
|
|
|
v-hasPermi="['garbage_transfer:garbageTransfer:remove']"
|
|
|
- >删除</el-button>
|
|
|
+ >删除
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
|
<!--<el-col :span="1.5">
|
|
|
<el-button
|
|
@@ -76,20 +80,21 @@
|
|
|
size="mini"
|
|
|
@click="handleExport"
|
|
|
v-hasPermi="['garbage_transfer:garbageTransfer:export']"
|
|
|
- >导出</el-button>
|
|
|
+ >导出
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
<el-table v-loading="loading" :data="MachineryInfoList" @selection-change="handleSelectionChange">
|
|
|
- <el-table-column type="selection" width="55" align="center" />
|
|
|
+ <el-table-column type="selection" width="55" align="center"/>
|
|
|
<!--<el-table-column label="${comment}" align="center" prop="id" />-->
|
|
|
- <el-table-column label="名称" align="center" prop="name" />
|
|
|
- <el-table-column label="经度" align="center" prop="longitude" />
|
|
|
- <el-table-column label="纬度" align="center" prop="latitude" />
|
|
|
- <el-table-column label="编号" align="center" prop="code" />
|
|
|
- <el-table-column label="覆盖区域" align="center" prop="coverage" />
|
|
|
- <el-table-column label="所属部门" align="center" prop="deptName" />
|
|
|
+ <el-table-column label="名称" align="center" prop="name"/>
|
|
|
+ <el-table-column label="经度" align="center" prop="longitude"/>
|
|
|
+ <el-table-column label="纬度" align="center" prop="latitude"/>
|
|
|
+ <el-table-column label="编号" align="center" prop="code"/>
|
|
|
+ <el-table-column label="覆盖区域" align="center" prop="coverage"/>
|
|
|
+ <el-table-column label="所属部门" align="center" prop="deptName"/>
|
|
|
<el-table-column label="创建人" align="center" prop="createName"/>
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime"/>
|
|
|
<el-table-column label="修改人" align="center" prop="updateName"/>
|
|
@@ -102,14 +107,16 @@
|
|
|
icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
v-hasPermi="['garbage_transfer:garbageTransfer:edit']"
|
|
|
- >修改</el-button>
|
|
|
+ >修改
|
|
|
+ </el-button>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
v-hasPermi="['garbage_transfer:garbageTransfer:remove']"
|
|
|
- >删除</el-button>
|
|
|
+ >删除
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -123,42 +130,84 @@
|
|
|
/>
|
|
|
|
|
|
<!-- 添加或修改农机管理对话框 -->
|
|
|
- <el-dialog :title="title" :visible.sync="open" width="600px" class="form-style">
|
|
|
+ <el-dialog :title="title" :visible.sync="open" width="1000px" class="form-style">
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
- <el-form-item label="名称" prop="name">
|
|
|
- <el-input v-model="form.name" placeholder="请输入名称" maxlength="20"/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="覆盖区域" prop="coverage">
|
|
|
- <el-input v-model="form.coverage" placeholder="请输入覆盖区域" maxlength="20"/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="编号" prop="code">
|
|
|
- <el-input v-model="form.code" placeholder="请输入编号" maxlength="20"/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="经度" prop="longitude" @dblclick.native="showMap">
|
|
|
- <el-input v-model="form.longitude" placeholder="鼠标双击选择经纬度" maxlength="32"/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="纬度" prop="latitude" @dblclick.native="showMap">
|
|
|
- <el-input v-model="form.latitude" placeholder="鼠标双击选择经纬度" maxlength="32"/>
|
|
|
- </el-form-item>
|
|
|
- <el-form-item label="所属部门" prop="deptId" class="form-style">
|
|
|
- <!-- <treeselect-->
|
|
|
- <!-- v-if="!disable"-->
|
|
|
- <!-- :flat="false"-->
|
|
|
- <!-- :allowSelectingDisabledDescendants="true"-->
|
|
|
- <!-- v-model="form.deptId" :options="deptOptions" :show-count="true"-->
|
|
|
- <!-- placeholder="请选择所属部门"/>-->
|
|
|
- <!-- <el-select v-model="form.deptName" placeholder="请选择所属部门" :style="inputStyle" v-if="disable" :disabled="disable">-->
|
|
|
- <!-- <el-option-->
|
|
|
- <!-- v-for="dept in deptOptions"-->
|
|
|
- <!-- :key="dept.deptId"-->
|
|
|
- <!-- :label="dept.deptName"-->
|
|
|
- <!-- :value="dept"-->
|
|
|
- <!-- />-->
|
|
|
- <!-- </el-select>-->
|
|
|
-<!-- <deptselector :setValue=setDataDeptId :dataDeptId="form.deptId" v-model="form.deptId"></deptselector>-->
|
|
|
- <treeselect v-model="form.deptId" :options="deptOptions" multiple:false :show-count="true" :noResultsText="'空'" :noOptionsText="'空'"
|
|
|
- placeholder="请选择部门" @select="hx"/>
|
|
|
- </el-form-item>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="名称" prop="name">
|
|
|
+ <el-input v-model="form.name" placeholder="请输入名称" maxlength="20"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="覆盖区域" prop="coverage">
|
|
|
+ <el-input v-model="form.coverage" placeholder="请输入覆盖区域" maxlength="20"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="经度" prop="longitude" @dblclick.native="showMap">
|
|
|
+ <el-input v-model="form.longitude" placeholder="鼠标双击选择经纬度" maxlength="32"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="纬度" prop="latitude" @dblclick.native="showMap">
|
|
|
+ <el-input v-model="form.latitude" placeholder="鼠标双击选择经纬度" maxlength="32"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="编号" prop="code">
|
|
|
+ <el-input v-model="form.code" placeholder="请输入编号" maxlength="20"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="所属部门" prop="deptId" class="form-style">
|
|
|
+ <!-- <treeselect-->
|
|
|
+ <!-- v-if="!disable"-->
|
|
|
+ <!-- :flat="false"-->
|
|
|
+ <!-- :allowSelectingDisabledDescendants="true"-->
|
|
|
+ <!-- v-model="form.deptId" :options="deptOptions" :show-count="true"-->
|
|
|
+ <!-- placeholder="请选择所属部门"/>-->
|
|
|
+ <!-- <el-select v-model="form.deptName" placeholder="请选择所属部门" :style="inputStyle" v-if="disable" :disabled="disable">-->
|
|
|
+ <!-- <el-option-->
|
|
|
+ <!-- v-for="dept in deptOptions"-->
|
|
|
+ <!-- :key="dept.deptId"-->
|
|
|
+ <!-- :label="dept.deptName"-->
|
|
|
+ <!-- :value="dept"-->
|
|
|
+ <!-- />-->
|
|
|
+ <!-- </el-select>-->
|
|
|
+ <!-- <deptselector :setValue=setDataDeptId :dataDeptId="form.deptId" v-model="form.deptId"></deptselector>-->
|
|
|
+ <treeselect v-model="form.deptId" :options="deptOptions" multiple:false :show-count="true"
|
|
|
+ :noResultsText="'空'" :noOptionsText="'空'"
|
|
|
+ placeholder="请选择部门" @select="hx"/>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="20">
|
|
|
+ <el-form-item label="绑定设备" prop="deviceList">
|
|
|
+ <el-select v-model="form.deviceList" filterable placeholder="请选择设备" multiple filterable>
|
|
|
+ <el-option
|
|
|
+ v-for="dict in cameraList"
|
|
|
+ :key="dict.id"
|
|
|
+ :label="dict.cameraName"
|
|
|
+ :value="dict.id"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
+ <el-row :gutter="20">
|
|
|
+ <el-col :span="12">
|
|
|
+ <el-form-item label="图片" prop="attachPaths">
|
|
|
+ <ImageUpload ref="ImageUpload" :limit="1" :file-type="['png','jpg','jpeg']"
|
|
|
+ :value="form.attachPaths"
|
|
|
+ @input="getUrl"></ImageUpload>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ </el-row>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
@@ -170,273 +219,291 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- import { checkLat, checkLon } from '@/api/rules/rules'
|
|
|
- import { listGarbageTransfer, getGarbageTransfer, delGarbageTransfer, addGarbageTransfer, updateGarbageTransfer } from "@/api/data/digitalagriculture/garbage_transfer/garbageTransfer";
|
|
|
- import deptselector from '@/views/components/deptselector'
|
|
|
- import { getToken } from '@/utils/auth'
|
|
|
- import Treeselect from '@riophae/vue-treeselect'
|
|
|
- import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
|
- import {format_date} from "@/views/data/common/dateExport";
|
|
|
- import ISuperMap from '@/views/data/common/ISuperMap.vue'
|
|
|
- import { treeselect } from "@/api/system/dept";
|
|
|
+import {checkLat, checkLon} from '@/api/rules/rules'
|
|
|
+import {
|
|
|
+ listGarbageTransfer,
|
|
|
+ getGarbageTransfer,
|
|
|
+ delGarbageTransfer,
|
|
|
+ addGarbageTransfer,
|
|
|
+ updateGarbageTransfer
|
|
|
+} from "@/api/data/digitalagriculture/garbage_transfer/garbageTransfer";
|
|
|
+import deptselector from '@/views/components/deptselector'
|
|
|
+import {getToken} from '@/utils/auth'
|
|
|
+import Treeselect from '@riophae/vue-treeselect'
|
|
|
+import '@riophae/vue-treeselect/dist/vue-treeselect.css'
|
|
|
+import {format_date} from "@/views/data/common/dateExport";
|
|
|
+import ISuperMap from '@/views/data/common/ISuperMap.vue'
|
|
|
+import {treeselect} from "@/api/system/dept";
|
|
|
+import {selectCenterMonitorlList} from "@/api/data/digitalforest/animal/animal";
|
|
|
|
|
|
- export default {
|
|
|
- name: "garbageTransfer",
|
|
|
- components: {
|
|
|
- ISuperMap,
|
|
|
- deptselector,
|
|
|
- Treeselect,
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- ISuperMapvisible: false,
|
|
|
- sign: 1,
|
|
|
- // 遮罩层
|
|
|
- loading: true,
|
|
|
- // 选中数组
|
|
|
- ids: [],
|
|
|
- // 非单个禁用
|
|
|
- single: true,
|
|
|
- // 非多个禁用
|
|
|
- multiple: true,
|
|
|
- // 显示搜索条件
|
|
|
- showSearch: true,
|
|
|
- // 总条数
|
|
|
- total: 0,
|
|
|
- // 弹出层宽度
|
|
|
- labelWidth: '150px',
|
|
|
- // 文本框宽度
|
|
|
- inputStyle: 'width: 310px',
|
|
|
- // 农机管理表格数据
|
|
|
- MachineryInfoList: [],
|
|
|
- // 弹出层标题
|
|
|
- title: "",
|
|
|
- // 是否显示弹出层
|
|
|
+export default {
|
|
|
+ name: "garbageTransfer",
|
|
|
+ components: {
|
|
|
+ ISuperMap,
|
|
|
+ deptselector,
|
|
|
+ Treeselect,
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ ISuperMapvisible: false,
|
|
|
+ cameraList: [],//设备集合
|
|
|
+ sign: 1,
|
|
|
+ // 遮罩层
|
|
|
+ loading: true,
|
|
|
+ // 选中数组
|
|
|
+ ids: [],
|
|
|
+ // 非单个禁用
|
|
|
+ single: true,
|
|
|
+ // 非多个禁用
|
|
|
+ multiple: true,
|
|
|
+ // 显示搜索条件
|
|
|
+ showSearch: true,
|
|
|
+ // 总条数
|
|
|
+ total: 0,
|
|
|
+ // 弹出层宽度
|
|
|
+ labelWidth: '150px',
|
|
|
+ // 文本框宽度
|
|
|
+ inputStyle: 'width: 310px',
|
|
|
+ // 农机管理表格数据
|
|
|
+ MachineryInfoList: [],
|
|
|
+ // 弹出层标题
|
|
|
+ title: "",
|
|
|
+ // 是否显示弹出层
|
|
|
+ open: false,
|
|
|
+ // 部门名称
|
|
|
+ deptName: undefined,
|
|
|
+ // 部门树选项
|
|
|
+ deptOptions: [],
|
|
|
+ // 导入参数
|
|
|
+ upload: {
|
|
|
+ // 是否显示导入弹出层
|
|
|
open: false,
|
|
|
- // 部门名称
|
|
|
- deptName: undefined,
|
|
|
- // 部门树选项
|
|
|
- deptOptions: [],
|
|
|
- // 导入参数
|
|
|
- upload: {
|
|
|
- // 是否显示导入弹出层
|
|
|
- open: false,
|
|
|
- // 导入弹出层标题
|
|
|
- title: '',
|
|
|
- // 是否禁用上传
|
|
|
- isUploading: false,
|
|
|
- // 是否更新已经存在的数据
|
|
|
- updateSupport: 0,
|
|
|
- // 设置上传的请求头部
|
|
|
- headers: { Authorization: 'Bearer ' + getToken() },
|
|
|
- // 上传的地址
|
|
|
- url: process.env.VUE_APP_BASE_API + '/center-data/MachineryInfo/import/importData'
|
|
|
- },
|
|
|
- // 查询参数
|
|
|
- queryParams: {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
- name: null,
|
|
|
- longitude: null,
|
|
|
- latitude: null,
|
|
|
- createDate: null,
|
|
|
- updateDate: null,
|
|
|
- remarks: null,
|
|
|
- deptId: null,
|
|
|
- deptName: 0,
|
|
|
- },
|
|
|
- // 表单参数
|
|
|
- form: {},
|
|
|
- // 表单校验
|
|
|
- rules: {
|
|
|
- name: [
|
|
|
- {required: true, message: "名称不能为空", trigger: "blur"}
|
|
|
- ],
|
|
|
- longitude: [
|
|
|
- { required: true, message: "经度不能为空", trigger: "change" },
|
|
|
- { validator: checkLon,trigger: 'blur'}
|
|
|
- ],
|
|
|
- latitude: [
|
|
|
- { required: true, message: "纬度不能为空", trigger: "change" },
|
|
|
- { validator: checkLat,trigger: 'blur'}
|
|
|
- ],
|
|
|
- deptId: [
|
|
|
- { required: true, message: "所属部门不能为空", trigger: "change" },
|
|
|
- ],
|
|
|
- }
|
|
|
+ // 导入弹出层标题
|
|
|
+ title: '',
|
|
|
+ // 是否禁用上传
|
|
|
+ isUploading: false,
|
|
|
+ // 是否更新已经存在的数据
|
|
|
+ updateSupport: 0,
|
|
|
+ // 设置上传的请求头部
|
|
|
+ headers: {Authorization: 'Bearer ' + getToken()},
|
|
|
+ // 上传的地址
|
|
|
+ url: process.env.VUE_APP_BASE_API + '/center-data/MachineryInfo/import/importData'
|
|
|
+ },
|
|
|
+ // 查询参数
|
|
|
+ queryParams: {
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 10,
|
|
|
+ name: null,
|
|
|
+ longitude: null,
|
|
|
+ latitude: null,
|
|
|
+ createDate: null,
|
|
|
+ updateDate: null,
|
|
|
+ remarks: null,
|
|
|
+ deptId: null,
|
|
|
+ deptName: 0,
|
|
|
+ },
|
|
|
+ // 表单参数
|
|
|
+ form: {},
|
|
|
+ // 表单校验
|
|
|
+ rules: {
|
|
|
+ name: [
|
|
|
+ {required: true, message: "名称不能为空", trigger: "blur"}
|
|
|
+ ],
|
|
|
+ longitude: [
|
|
|
+ {required: true, message: "经度不能为空", trigger: "change"},
|
|
|
+ {validator: checkLon, trigger: 'blur'}
|
|
|
+ ],
|
|
|
+ latitude: [
|
|
|
+ {required: true, message: "纬度不能为空", trigger: "change"},
|
|
|
+ {validator: checkLat, trigger: 'blur'}
|
|
|
+ ],
|
|
|
+ deptId: [
|
|
|
+ {required: true, message: "所属部门不能为空", trigger: "change"},
|
|
|
+ ],
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.getList();
|
|
|
+ this.getTreeselect();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ showMap() {
|
|
|
+ this.ISuperMapvisible = true;
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.ISuperMap.init(this.sign, {
|
|
|
+ id: this.form.id,
|
|
|
+ longitude: this.form.longitude,
|
|
|
+ latitude: this.form.latitude,
|
|
|
+ // 对应显示线 或 面
|
|
|
+ // xiantude: this.form.longitude
|
|
|
+ })
|
|
|
+ })
|
|
|
+ },
|
|
|
+ send(val) {
|
|
|
+ if (val === true) {
|
|
|
+ this.ISuperMapvisible = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (this.sign === 1) {
|
|
|
+ this.form.longitude = val.longitude;
|
|
|
+ this.form.latitude = val.latitude;
|
|
|
+ }
|
|
|
+ // if (this.sign === 2 || this.sign === 3) this.form.longitude = val.xiantude;
|
|
|
+ this.ISuperMapvisible = false
|
|
|
+ },
|
|
|
+ setDeptId(deptId) {
|
|
|
+ this.form.deptId = deptId
|
|
|
+ },
|
|
|
+ setDataDeptId(e) {
|
|
|
+ this.form.deptId = e.deptId
|
|
|
+ this.form.deptName = e.deptName
|
|
|
+ },
|
|
|
+ /** 查询部门下拉树结构 */
|
|
|
+ getTreeselect() {
|
|
|
+ treeselect().then(response => {
|
|
|
+ this.deptOptions = response.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ getUrl(url) {
|
|
|
+ this.form.attachPaths = url
|
|
|
+ },
|
|
|
+ hx(node) {
|
|
|
+ this.form.deptId = node.id
|
|
|
+ this.form.deptName = node.label
|
|
|
+ this.$refs.form.validateField('deptId');
|
|
|
+ },
|
|
|
+ // 筛选节点
|
|
|
+ filterNode(value, data) {
|
|
|
+ if (!value) return true
|
|
|
+ return data.label.indexOf(value) !== -1
|
|
|
+ },
|
|
|
+ // 节点单击事件
|
|
|
+ handleNodeClick(data) {
|
|
|
+ this.queryParams.deptId = data.id
|
|
|
+ this.handleQuery()
|
|
|
+ },
|
|
|
+ /** 查询垃圾转输站列表 */
|
|
|
+ getList() {
|
|
|
+ this.loading = true;
|
|
|
+ listGarbageTransfer(this.queryParams).then(response => {
|
|
|
+ this.MachineryInfoList = response.rows;
|
|
|
+ this.total = response.total;
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ // 取消按钮
|
|
|
+ cancel() {
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
+ },
|
|
|
+ // 表单重置
|
|
|
+ reset() {
|
|
|
+ this.form = {
|
|
|
+ id: null,
|
|
|
+ name: null,
|
|
|
+ longitude: null,
|
|
|
+ latitude: null,
|
|
|
+ code: null,
|
|
|
+ coverage: null,
|
|
|
+ createBy: null,
|
|
|
+ createDate: null,
|
|
|
+ updateBy: null,
|
|
|
+ updateDate: null,
|
|
|
+ deptId: null
|
|
|
};
|
|
|
+ this.resetForm("form");
|
|
|
},
|
|
|
- created() {
|
|
|
+ /** 搜索按钮操作 */
|
|
|
+ handleQuery() {
|
|
|
+ this.queryParams.pageNum = 1;
|
|
|
this.getList();
|
|
|
- this.getTreeselect();
|
|
|
},
|
|
|
- methods: {
|
|
|
- showMap() {
|
|
|
- this.ISuperMapvisible = true;
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.ISuperMap.init(this.sign, {
|
|
|
- id: this.form.id,
|
|
|
- longitude: this.form.longitude,
|
|
|
- latitude: this.form.latitude,
|
|
|
- // 对应显示线 或 面
|
|
|
- // xiantude: this.form.longitude
|
|
|
- })
|
|
|
- })
|
|
|
- },
|
|
|
- send(val) {
|
|
|
- if (val===true){
|
|
|
- this.ISuperMapvisible = false;
|
|
|
- return;
|
|
|
- }
|
|
|
- if (this.sign === 1) {
|
|
|
- this.form.longitude = val.longitude;
|
|
|
- this.form.latitude = val.latitude;
|
|
|
- }
|
|
|
- // if (this.sign === 2 || this.sign === 3) this.form.longitude = val.xiantude;
|
|
|
- this.ISuperMapvisible = false
|
|
|
- },
|
|
|
- setDeptId(deptId) {
|
|
|
- this.form.deptId = deptId
|
|
|
- },
|
|
|
- setDataDeptId(e) {
|
|
|
- this.form.deptId = e.deptId
|
|
|
- this.form.deptName = e.deptName
|
|
|
- },
|
|
|
- /** 查询部门下拉树结构 */
|
|
|
- getTreeselect() {
|
|
|
- treeselect().then(response => {
|
|
|
- this.deptOptions = response.data;
|
|
|
- });
|
|
|
- },
|
|
|
- hx(node) {
|
|
|
- this.form.deptId = node.id
|
|
|
- this.form.deptName = node.label
|
|
|
- this.$refs.form.validateField('deptId');
|
|
|
- },
|
|
|
- // 筛选节点
|
|
|
- filterNode(value, data) {
|
|
|
- if (!value) return true
|
|
|
- return data.label.indexOf(value) !== -1
|
|
|
- },
|
|
|
- // 节点单击事件
|
|
|
- handleNodeClick(data) {
|
|
|
- this.queryParams.deptId = data.id
|
|
|
- this.handleQuery()
|
|
|
- },
|
|
|
- /** 查询垃圾转输站列表 */
|
|
|
- getList() {
|
|
|
- this.loading = true;
|
|
|
- listGarbageTransfer(this.queryParams).then(response => {
|
|
|
- this.MachineryInfoList = response.rows;
|
|
|
- this.total = response.total;
|
|
|
- this.loading = false;
|
|
|
- });
|
|
|
- },
|
|
|
- // 取消按钮
|
|
|
- cancel() {
|
|
|
- this.open = false;
|
|
|
- this.reset();
|
|
|
- },
|
|
|
- // 表单重置
|
|
|
- reset() {
|
|
|
- this.form = {
|
|
|
- id: null,
|
|
|
- name: null,
|
|
|
- longitude: null,
|
|
|
- latitude: null,
|
|
|
- code: null,
|
|
|
- coverage: null,
|
|
|
- createBy: null,
|
|
|
- createDate: null,
|
|
|
- updateBy: null,
|
|
|
- updateDate: null,
|
|
|
- deptId: null
|
|
|
- };
|
|
|
- this.resetForm("form");
|
|
|
- },
|
|
|
- /** 搜索按钮操作 */
|
|
|
- handleQuery() {
|
|
|
- this.queryParams.pageNum = 1;
|
|
|
- this.getList();
|
|
|
- },
|
|
|
- /** 重置按钮操作 */
|
|
|
- resetQuery() {
|
|
|
- this.queryParams.deptName = 0;
|
|
|
- this.resetForm("queryForm");
|
|
|
- this.handleQuery();
|
|
|
- },
|
|
|
- // 多选框选中数据
|
|
|
- handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map(item => item.id)
|
|
|
- this.single = selection.length!==1
|
|
|
- this.multiple = !selection.length
|
|
|
- },
|
|
|
- /** 新增按钮操作 */
|
|
|
- handleAdd() {
|
|
|
- this.reset();
|
|
|
+ /** 重置按钮操作 */
|
|
|
+ resetQuery() {
|
|
|
+ this.queryParams.deptName = 0;
|
|
|
+ this.resetForm("queryForm");
|
|
|
+ this.handleQuery();
|
|
|
+ },
|
|
|
+ // 多选框选中数据
|
|
|
+ handleSelectionChange(selection) {
|
|
|
+ this.ids = selection.map(item => item.id)
|
|
|
+ this.single = selection.length !== 1
|
|
|
+ this.multiple = !selection.length
|
|
|
+ },
|
|
|
+ /** 新增按钮操作 */
|
|
|
+ handleAdd() {
|
|
|
+ this.reset();
|
|
|
+ this.open = true;
|
|
|
+ this.title = "添加垃圾转输站";
|
|
|
+ selectCenterMonitorlList(this.queryParams).then(response => {
|
|
|
+ this.cameraList = response.data;
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 修改按钮操作 */
|
|
|
+ handleUpdate(row) {
|
|
|
+ this.reset();
|
|
|
+ let _this = this;
|
|
|
+ const id = row.id || this.ids
|
|
|
+ selectCenterMonitorlList(this.queryParams).then(response => {
|
|
|
+ this.cameraList = response.data;
|
|
|
+ });
|
|
|
+ getGarbageTransfer(id).then(response => {
|
|
|
+ this.form = response.data;
|
|
|
+ this.title = "修改垃圾转输站";
|
|
|
+ // treeselect().then(response => {
|
|
|
+ // _this.deptOptions = response.data;
|
|
|
+ // treeselectAll().then(response => {
|
|
|
+ // addDeptToTreeSelect(_this.form.deptId, _this.deptOptions, response.data[0]);
|
|
|
this.open = true;
|
|
|
- this.title = "添加垃圾转输站";
|
|
|
- },
|
|
|
- /** 修改按钮操作 */
|
|
|
- handleUpdate(row) {
|
|
|
- this.reset();
|
|
|
- let _this = this;
|
|
|
- const id = row.id || this.ids
|
|
|
- getGarbageTransfer(id).then(response => {
|
|
|
- this.form = response.data;
|
|
|
- this.title = "修改垃圾转输站";
|
|
|
- // treeselect().then(response => {
|
|
|
- // _this.deptOptions = response.data;
|
|
|
- // treeselectAll().then(response => {
|
|
|
- // addDeptToTreeSelect(_this.form.deptId, _this.deptOptions, response.data[0]);
|
|
|
- this.open = true;
|
|
|
- // });
|
|
|
- // });
|
|
|
- });
|
|
|
- },
|
|
|
- /** 提交按钮 */
|
|
|
- submitForm() {
|
|
|
- this.$refs["form"].validate(valid => {
|
|
|
- if (valid) {
|
|
|
- // this.form.deptName = this.deptOptions.filter((item) => {
|
|
|
- // return this.form.deptId == item.id;
|
|
|
- // })[0].label;
|
|
|
- if (this.form.id != null) {
|
|
|
- updateGarbageTransfer(this.form).then(response => {
|
|
|
- this.$modal.msgSuccess("修改成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- } else {
|
|
|
- addGarbageTransfer(this.form).then(response => {
|
|
|
- this.$modal.msgSuccess("新增成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- }
|
|
|
+ // });
|
|
|
+ // });
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 提交按钮 */
|
|
|
+ submitForm() {
|
|
|
+ this.$refs["form"].validate(valid => {
|
|
|
+ if (valid) {
|
|
|
+ // this.form.deptName = this.deptOptions.filter((item) => {
|
|
|
+ // return this.form.deptId == item.id;
|
|
|
+ // })[0].label;
|
|
|
+ if (this.form.id != null) {
|
|
|
+ updateGarbageTransfer(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess("修改成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ addGarbageTransfer(this.form).then(response => {
|
|
|
+ this.$modal.msgSuccess("新增成功");
|
|
|
+ this.open = false;
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
}
|
|
|
- });
|
|
|
- },
|
|
|
- /** 删除按钮操作 */
|
|
|
- handleDelete(row) {
|
|
|
- const ids = row.id || this.ids;
|
|
|
- this.$modal.confirm('是否删除选中的数据?').then(function() {
|
|
|
- return delGarbageTransfer(ids);
|
|
|
- }).then(() => {
|
|
|
- this.getList();
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
- }).catch(() => {});
|
|
|
- },
|
|
|
- /** 导出按钮操作 */
|
|
|
- handleExport() {
|
|
|
- this.download('/center-data/garbageTransfer/export', {
|
|
|
- ...this.queryParams
|
|
|
- }, `垃圾转输站_${format_date(new Date())}.xlsx`)
|
|
|
- },
|
|
|
- // 点击按钮修改是否只查询本级部门用户
|
|
|
- changeQueryType() {
|
|
|
- this.queryParams.deptName = this.queryParams.deptName == 0 ? 1 : 0;
|
|
|
- }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 删除按钮操作 */
|
|
|
+ handleDelete(row) {
|
|
|
+ const ids = row.id || this.ids;
|
|
|
+ this.$modal.confirm('是否删除选中的数据?').then(function () {
|
|
|
+ return delGarbageTransfer(ids);
|
|
|
+ }).then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ }).catch(() => {
|
|
|
+ });
|
|
|
+ },
|
|
|
+ /** 导出按钮操作 */
|
|
|
+ handleExport() {
|
|
|
+ this.download('/center-data/garbageTransfer/export', {
|
|
|
+ ...this.queryParams
|
|
|
+ }, `垃圾转输站_${format_date(new Date())}.xlsx`)
|
|
|
+ },
|
|
|
+ // 点击按钮修改是否只查询本级部门用户
|
|
|
+ changeQueryType() {
|
|
|
+ this.queryParams.deptName = this.queryParams.deptName == 0 ? 1 : 0;
|
|
|
}
|
|
|
- };
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|