|
@@ -2,44 +2,63 @@
|
|
|
<div class="page-nzy-manage">
|
|
|
<div class="page-left" :style="{height:contentHeight+'px',width:contentWidth+'px'}">
|
|
|
<div class="nzy-tools">
|
|
|
- <el-form label-width="120px" :model="paramsList">
|
|
|
- <el-row :gutter="20">
|
|
|
+ <el-form label-width="120px" :model="searchParam">
|
|
|
+ <el-row :gutter="10">
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="批次索引:">
|
|
|
- <el-input v-model="paramsList.pzwh" placeholder="请输入批次索引" clearable></el-input>
|
|
|
+ <el-input v-model="searchParam.pcbh" placeholder="请输入项目名称" clearable></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
- <el-form-item label="项目名称:">
|
|
|
- <el-input v-model="paramsList.pcmc" placeholder="请输入项目名称" clearable></el-input>
|
|
|
+ <el-form-item label="批次名称:">
|
|
|
+ <el-input v-model="searchParam.pch" placeholder="请输入项目名称" clearable></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
- <span></span>
|
|
|
- <el-form-item label="项目类型:">
|
|
|
- <el-input v-model="paramsList.pcmc" placeholder="请输入项目类型" clearable></el-input>
|
|
|
+ <el-form-item label="类型:">
|
|
|
+ <el-select v-model="searchParam.lx" style="width: 100%;">
|
|
|
+ <el-option value="单独选址" label="单独选址" />
|
|
|
+ <el-option value="批次用地" label="批次用地" />
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="批准文号:">
|
|
|
- <el-input v-model="paramsList.pcmc" placeholder="请输入批准文号" clearable></el-input>
|
|
|
+ <el-input v-model="searchParam.pwh" placeholder="请输入批准文号" clearable></el-input>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
- <el-row :gutter="20">
|
|
|
+ <el-row :gutter="10">
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="批准日期:">
|
|
|
- <el-input v-model="paramsList.pcmc" placeholder="请输入批准日期" clearable></el-input>
|
|
|
+ <el-date-picker
|
|
|
+ v-model="pcrqDateRange"
|
|
|
+ type="daterange"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ unlink-panels
|
|
|
+ start-placeholder="批准开始时间"
|
|
|
+ end-placeholder="批准结束时间"
|
|
|
+ :shortcuts="shortcuts"
|
|
|
+ style="width:100%"
|
|
|
+ />
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<el-form-item label="批次总面积:">
|
|
|
- <el-input v-model="paramsList.pcmc" placeholder="请输入批次总面积(公顷)" clearable></el-input>
|
|
|
+ <el-input v-model="searchParam.pzmj" placeholder="请输入批次总面积(公顷)" clearable></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </el-col>
|
|
|
+ <el-col :span="6">
|
|
|
+ <el-form-item label="是否农民建房:">
|
|
|
+ <el-select style="width: 100%;" v-model="searchParam.nmjf">
|
|
|
+ <el-option value="是" label="是"></el-option>
|
|
|
+ <el-option value="否" label="否"></el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
<el-col :span="6">
|
|
|
<div class="btn-group">
|
|
|
- <el-button type="primary" @click="getBpxmList">查询</el-button>
|
|
|
+ <el-button type="primary" @click="queryByPage">查询</el-button>
|
|
|
<div class="panel-dropdown">
|
|
|
<el-dropdown>
|
|
|
<el-button type="success">
|
|
@@ -74,7 +93,6 @@
|
|
|
:height="contentHeight-260"
|
|
|
:header-cell-style="tableHeaderStyle"
|
|
|
:cell-style="tableRowStyle"
|
|
|
- :row-click="rowClick"
|
|
|
ref="report-table"
|
|
|
>
|
|
|
<el-table-column
|
|
@@ -83,54 +101,54 @@
|
|
|
label="序号">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="pf_wh"
|
|
|
- label="批次索引">
|
|
|
+ prop="pch"
|
|
|
+ label="批次名称">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="pf_wh"
|
|
|
- label="项目名称">
|
|
|
+ prop="lx"
|
|
|
+ label="类型">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="xm_lx"
|
|
|
- label="项目类型"
|
|
|
- width="100">
|
|
|
- <template slot-scope="scope">
|
|
|
- <span v-if="scope.row.xm_lx=='2'">单独选址项目</span>
|
|
|
- <span v-else-if="scope.row.xm_lx=='3'">城市分批次项目</span>
|
|
|
- <span v-else-if="scope.row.xm_lx=='10'">实施方案项目</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="xm_bh"
|
|
|
+ prop="pwh"
|
|
|
label="批准文号">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="xm_mc"
|
|
|
+ prop="pzrq"
|
|
|
label="批准日期">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- prop="xm_mc"
|
|
|
- label="批次总面积(公顷)">
|
|
|
+ prop="pzmj"
|
|
|
+ label="批准总面积(公顷)">
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
- width="150"
|
|
|
-
|
|
|
+ prop="nmjf"
|
|
|
+ label="是否农民建房">
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ width="260"
|
|
|
label="操作">
|
|
|
<template slot-scope="scope">
|
|
|
<div style="line-height: 34px;">
|
|
|
<el-button
|
|
|
- @click.native.prevent="openDetail(scope.$index, scope.row)"
|
|
|
- style="margin-right: 10px;"
|
|
|
+ @click.native.prevent="openDetail(scope.row)"
|
|
|
plain
|
|
|
type="primary"
|
|
|
size="mini">
|
|
|
查看
|
|
|
</el-button>
|
|
|
+ <el-button
|
|
|
+ @click.native.prevent="openDetail(scope.row, true)"
|
|
|
+ style="margin: 0px 10px;"
|
|
|
+ plain
|
|
|
+ type="primary"
|
|
|
+ size="mini">
|
|
|
+ 编辑
|
|
|
+ </el-button>
|
|
|
<el-popconfirm
|
|
|
title="该条数据确定删除吗?"
|
|
|
+ @confirm="deleteHandle(scope.$index, scope.row)"
|
|
|
>
|
|
|
<el-button
|
|
|
- @click.native.prevent="locationDk(scope.$index, scope.row)"
|
|
|
plain
|
|
|
type="danger"
|
|
|
slot="reference"
|
|
@@ -144,8 +162,8 @@
|
|
|
</el-table>
|
|
|
<Page style="float: right;margin-top: 10px;"
|
|
|
show-total
|
|
|
- :total="paramsList.total"
|
|
|
- :page-size="paramsList.size"
|
|
|
+ :total="tableData.total"
|
|
|
+ :page-size="searchParam.size"
|
|
|
@on-change="pageChange"
|
|
|
@on-page-size-change="sizeChange"
|
|
|
show-sizer />
|
|
@@ -157,21 +175,16 @@
|
|
|
top="5vh"
|
|
|
width="80%"
|
|
|
>
|
|
|
- <detail ref="details" @initBpxm="getBpxmList" :contentWidth="contentWidth-menusWidth" :contentHeight="contentHeight" :project="currProject"/>
|
|
|
+ <detail ref="details" :contentWidth="contentWidth-menusWidth" :contentHeight="contentHeight"/>
|
|
|
</el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
-import BaseMap from "../../components/common/BaseMap";
|
|
|
import Detail from "./nzy/Detail";
|
|
|
-import {Geometry as WkxGeometry} from "wkx";
|
|
|
import JSZip from 'jszip'
|
|
|
import mapshaper from 'mapshaper';
|
|
|
import { saveAs } from 'file-saver'
|
|
|
-import * as XLSX from "xlsx";
|
|
|
const {
|
|
|
- importContent,
|
|
|
- setDatasetCRS,
|
|
|
exportFileContent
|
|
|
} = mapshaper.internal
|
|
|
export default {
|
|
@@ -180,99 +193,73 @@ export default {
|
|
|
contentWidth:Number,
|
|
|
contentHeight:Number
|
|
|
},
|
|
|
- components:{BaseMap,Detail},
|
|
|
+ components:{Detail},
|
|
|
data() {
|
|
|
return {
|
|
|
- compName: 'data-manage',
|
|
|
menus:JSON.parse(window.sessionStorage.getItem('yzt-user')),
|
|
|
menusWidth:700,
|
|
|
detailShow:false,
|
|
|
tableData:{
|
|
|
data:[],
|
|
|
},
|
|
|
- currProject:null,
|
|
|
- paramsList:{pzwh:'',pcmc:'',page:1,size:15,total:0},
|
|
|
- fullscreenLoading: false,
|
|
|
- drawShapeJson:null,
|
|
|
+ pcrqDateRange: [],
|
|
|
+ searchParam: {
|
|
|
+ pcbh: '',
|
|
|
+ pch: '',
|
|
|
+ lx: '',
|
|
|
+ pwh: '',
|
|
|
+ pzrqStart: '',
|
|
|
+ pzrqEnd: '',
|
|
|
+ pzmj: '',
|
|
|
+ nmjf: '',
|
|
|
+ current: 1,
|
|
|
+ size: 10
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
- mounted(){
|
|
|
- this.getBpxmList();
|
|
|
+ created () {
|
|
|
+ this.queryByPage();
|
|
|
},
|
|
|
methods: {
|
|
|
- //处理内容变化记录信息
|
|
|
- recordInfo(type,name,content){
|
|
|
- let info = {};
|
|
|
- info.re_recorder = this.menus.userInfo.orgName;
|
|
|
- info.table_type = '农转用导入';
|
|
|
- info.re_content='';
|
|
|
- let _this = this;
|
|
|
- info.re_name = name;
|
|
|
- if(type=='input'){
|
|
|
- info.re_content ='导入项目文件名:'+content;
|
|
|
- }else{
|
|
|
- info.re_content ='导出文件名:'+content;
|
|
|
- }
|
|
|
- let params = new FormData();
|
|
|
- params.append('data',JSON.stringify(info))
|
|
|
- //执行持久化操作(记录入库)
|
|
|
- this.$ajax.post('/api/opera/record/insert',params, this, true).then(res => {
|
|
|
- const {success,data} = res;
|
|
|
- if(success){
|
|
|
- this.$message.success("操作成功!")
|
|
|
- }else{
|
|
|
- this.$message.error("操作失败!")
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
pageChange:function (page){
|
|
|
- this.paramsList.page=page;
|
|
|
- this.getBpxmList()
|
|
|
+ this.searchParam.current=page;
|
|
|
+ this.queryByPage()
|
|
|
},
|
|
|
sizeChange:function (size){
|
|
|
- this.paramsList.size=size;
|
|
|
- this.getBpxmList()
|
|
|
+ this.searchParam.size=size;
|
|
|
+ this.queryByPage()
|
|
|
},
|
|
|
//查询报批项目信息
|
|
|
- getBpxmList(){
|
|
|
- let params = new FormData();
|
|
|
- params.append("pzwh",this.paramsList.pzwh);
|
|
|
- params.append("pcmc",this.paramsList.pcmc);
|
|
|
- params.append("page",this.paramsList.page);
|
|
|
- params.append("size",this.paramsList.size);
|
|
|
- if(this.drawShapeJson){
|
|
|
- params.append("shapes",JSON.stringify(this.drawShapeJson));
|
|
|
- }
|
|
|
+ queryByPage () {
|
|
|
let _this = this;
|
|
|
- this.$ajax.post('/api/data/manage/nzy/getBpxm', params, this, true).then(res => {
|
|
|
- const {success,data} = res;
|
|
|
- if(success){
|
|
|
- _this.tableData.data =[];
|
|
|
- _this.paramsList.total=0;
|
|
|
- if(data.list){
|
|
|
- _this.tableData.data= data.list;
|
|
|
- _this.paramsList.total = data.total;
|
|
|
- }
|
|
|
+ if (this.pcrqDateRange.length > 0) {
|
|
|
+ this.searchParam.pzrqStart = this.pcrqDateRange[0]
|
|
|
+ this.searchParam.pzrqEnd = this.pcrqDateRange[1]
|
|
|
+ }
|
|
|
+ const params = {
|
|
|
+ ...this.searchParam
|
|
|
+ }
|
|
|
+ this.$ajax.get('/api/stnzy/page', params, this, true).then(res => {
|
|
|
+ if (res.status === 200) {
|
|
|
+ _this.tableData.data= res.records;
|
|
|
+ _this.tableData.total = res.total;
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- rowClick(row, column, event){
|
|
|
- this.currProject = row;
|
|
|
- this.detailShow =true;
|
|
|
- },
|
|
|
- openDetail(index,row){
|
|
|
- this.currProject = row;
|
|
|
+ openDetail(row, isEditor = false){
|
|
|
this.detailShow = true;
|
|
|
- this.$refs['details'].initDetailData()
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs['details'].initDetailData(row, isEditor)
|
|
|
+ })
|
|
|
},
|
|
|
- locationDk(index,row){
|
|
|
- if(row.dk_bh){
|
|
|
- this.detailShow = false;
|
|
|
- let dkbhArr = row.dk_bh?row.dk_bh.split(","):'';
|
|
|
- let arr = dkbhArr.map(i=>{return "'"+i+"'";});
|
|
|
- this.$vm.$emit('locationGlobal', 'YHYZT_NZYDK_NEW', `index_id in (${arr.join()})`)
|
|
|
- //this.$message.warning("暂无图形")
|
|
|
- }
|
|
|
+ deleteHandle (index, row) {
|
|
|
+ const params = {pch: row['pch']}
|
|
|
+ this.$ajax.get('/api/stnzy/deleteByPch', params, this, true).then(res => {
|
|
|
+ if (res) {
|
|
|
+ this.$Message.success('删除成功!')
|
|
|
+ this.queryByPage()
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
tableRowStyle({row, rowIndex}) {
|
|
|
if (rowIndex%2 === 1) {
|
|
@@ -295,63 +282,18 @@ export default {
|
|
|
doInput(file){
|
|
|
let params = new FormData();
|
|
|
params.append("file",file);
|
|
|
-
|
|
|
- let _this = this;
|
|
|
- const loading = this.$loading({
|
|
|
- lock: true,
|
|
|
- text: '正在导入中',
|
|
|
- spinner: 'el-icon-loading',
|
|
|
- background: 'rgba(0, 0, 0, 0.7)'
|
|
|
- });
|
|
|
- this.$ajax.post('/api/data/upload/nzy/zip', params, this).then(res => {
|
|
|
- const {success,data} = res;
|
|
|
- loading.close();
|
|
|
- if(success && data){
|
|
|
- this.recordInfo("input",'农转用成果导入',file.name);
|
|
|
- //this.$message.success("上传成功!")
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- doExport(){
|
|
|
- let params = new FormData();
|
|
|
- params.append("pzwh",this.paramsList.pzwh);
|
|
|
- params.append("pcmc",this.paramsList.pcmc);
|
|
|
const loading = this.$loading({
|
|
|
lock: true,
|
|
|
- text: '正在导出',
|
|
|
+ text: '正在导入中',
|
|
|
spinner: 'el-icon-loading',
|
|
|
background: 'rgba(0, 0, 0, 0.7)'
|
|
|
});
|
|
|
- this.$ajax.post('/api/data/manage/nzy/exportShapeFile', params, this).then(res => {
|
|
|
- const {success, data} = res;
|
|
|
- if(success){
|
|
|
- const geos = {
|
|
|
- 'type': 'FeatureCollection',
|
|
|
- 'features': []
|
|
|
- }
|
|
|
- data.map(i=>{
|
|
|
- let geoT = {
|
|
|
- type: 'Feature',
|
|
|
- geometry: {},
|
|
|
- properties: {}
|
|
|
- }
|
|
|
- const geo = WkxGeometry.parse(i.geomText).toGeoJSON()
|
|
|
- geoT.geometry = { ...geo }
|
|
|
- delete i.shape
|
|
|
- delete i.geomText
|
|
|
- geoT['properties'] = i
|
|
|
- geos.features.push(geoT)
|
|
|
- })
|
|
|
- console.log(geos)
|
|
|
- const dataset = importContent({ json: { filename: '农转用项目.json', content: JSON.stringify(geos) }})
|
|
|
- setDatasetCRS(dataset, { prj: 'GEOGCS["GCS_China_Geodetic_Coordinate_System_2000",DATUM["D_China_2000",SPHEROID["CGCS2000",6378137.0,298.257222101]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]]' })
|
|
|
- this.saveDataset(dataset);
|
|
|
- loading.close();
|
|
|
- }else{
|
|
|
- this.$Message.error("查询异常,请联系管理员!");
|
|
|
- loading.close();
|
|
|
- }
|
|
|
- })
|
|
|
+ this.$ajax.post('/api/stnzy/upload', params, this).then(res => {
|
|
|
+ loading.close();
|
|
|
+ if (res) {
|
|
|
+ this.$Message.success("导入成功!")
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
saveDataset(dataset, type = 'shapefile') {
|
|
|
const fileContent = exportFileContent(dataset, { format: type })
|