匹配行政区划及分页功能

lijinlong^2
吕天方 1 year ago
parent 1ff9d3ddb7
commit 8d25586c86

@ -154,13 +154,25 @@
width="150" width="150"
header-align="center" header-align="center"
> >
<template slot-scope="scope">
<span>{{ componendDistrict("0" + scope.row.subdistrict) }}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="ecoTypeLarge" prop="indusTypeClass"
label="经济类型" label="行业类型"
show-overflow-tooltip show-overflow-tooltip
header-align="center" header-align="center"
> >
<template slot-scope="scope">
<div>
{{
scope.row.indusTypeClass != "null"
? filterTable(optionstwo.category, scope.row.indusTypeClass)
: ""
}}
</div>
</template>
</el-table-column> </el-table-column>
<!-- <el-table-column <!-- <el-table-column
prop="indusTypeClass" prop="indusTypeClass"
@ -187,11 +199,20 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="entprColor" prop="enterColorChart"
label="企业分色" label="企业分色"
show-overflow-tooltip show-overflow-tooltip
header-align="center" header-align="center"
> >
<template slot-scope="scope">
<div>
{{
scope.row.enterColorChart != "null"
? filterTable(optionstwo.entpr_color, scope.row.enterColorChart)
: ""
}}
</div>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="uscCode" prop="uscCode"
@ -219,7 +240,7 @@
</el-table> </el-table>
</div> </div>
<div class="pagination"> <div class="pagination">
<my-pagination :total="total" @pagesChange="pagesChange"> <my-pagination :total="total" @pagesChange="pagesChange" ref="mypagination">
<!-- <div>重点企业数 <!-- <div>重点企业数
<span :class=" count == unCount ? 'selectedNumber' : 'unselectedNumber'">{{ unCount }}</span>/ <span :class=" count == unCount ? 'selectedNumber' : 'unselectedNumber'">{{ unCount }}</span>/
<span class="sum">{{ count }}</span> <span class="sum">{{ count }}</span>
@ -372,6 +393,23 @@ export default {
} }
}, },
methods: { methods: {
//
componendDistrict(district){
let name
this.listOne.map((item)=>{
if(item.subdistrict == district) {
name = item.institutionName
} else {
item.children.map((itemTwo)=>{
if(itemTwo.subdistrict == district) {
name = item.institutionName + '-' + itemTwo.institutionName
}
})
}
})
return name
},
//
filterTable(a, b) { filterTable(a, b) {
let arr = []; let arr = [];
if (!b) return; if (!b) return;
@ -390,6 +428,9 @@ export default {
// if (this.form.subdistrict) { // if (this.form.subdistrict) {
// this.subdistrict = this.trimTrailingZeros(this.form.subdistrict); // this.subdistrict = this.trimTrailingZeros(this.form.subdistrict);
// } // }
this.pages.pageNum = 1;
this.pages.pageSize = 10;
this.$refs.mypagination.defaultPages();
let obj let obj
// console.log(this.form.subdistrict) // console.log(this.form.subdistrict)
// //
@ -443,7 +484,9 @@ export default {
}, },
this.pages.pageNum = 1; this.pages.pageNum = 1;
this.pages.pageSize = 10; this.pages.pageSize = 10;
this.getTable(this.pages); this.$refs.mypagination.defaultPages();
let obj = {...this.pages,...this.form}
this.getTable(obj);
}, },
// checkBox // checkBox
checkSelectable(row) { checkSelectable(row) {
@ -515,6 +558,7 @@ export default {
// this.unCount = 0; // this.unCount = 0;
this.pages.pageNum = 1; this.pages.pageNum = 1;
this.pages.pageSize = 10; this.pages.pageSize = 10;
this.$refs.mypagination.defaultPages();
this.selected = 0; this.selected = 0;
// this.unselected = 0; // this.unselected = 0;
// this.count = 0; // this.count = 0;

@ -4,7 +4,7 @@
* @Author: JC9527 * @Author: JC9527
* @Date: 2023-09-04 13:11:33 * @Date: 2023-09-04 13:11:33
* @LastEditors: JC9527 * @LastEditors: JC9527
* @LastEditTime: 2023-09-20 09:31:57 * @LastEditTime: 2023-09-27 16:36:54
--> -->
<template> <template>
<div class="pagination"> <div class="pagination">
@ -59,6 +59,11 @@ export default {
this.pageNum = 1; this.pageNum = 1;
this.$emit('pagesChange',{pageSize:e,pageNum:this.pageNum}) this.$emit('pagesChange',{pageSize:e,pageNum:this.pageNum})
}, },
//
defaultPages(){
this.pageSize = 10;
this.pageNum = 1;
},
// //
numberMap() { numberMap() {
// if (this.total == this.tableData.length) { // if (this.total == this.tableData.length) {

@ -1,3 +1,11 @@
<!--
* @Descripttion:
* @version:
* @Author: JC9527
* @Date: 2023-09-27 14:01:34
* @LastEditors: JC9527
* @LastEditTime: 2023-09-27 15:59:28
-->
<template> <template>
<div > <div >
<el-cascader <el-cascader
@ -59,6 +67,7 @@ export default {
} }
}); });
} }
this.$emit("quhuadizhi", this.compartment)
}); });
}, },
getData(e) { getData(e) {

@ -4,7 +4,7 @@
* @Author: JC9527 * @Author: JC9527
* @Date: 2023-09-04 10:20:06 * @Date: 2023-09-04 10:20:06
* @LastEditors: JC9527 * @LastEditors: JC9527
* @LastEditTime: 2023-09-27 13:51:27 * @LastEditTime: 2023-09-27 16:47:17
--> -->
<template> <template>
<div class="container-main" ref="main"> <div class="container-main" ref="main">
@ -24,7 +24,7 @@
<div class="select-input"> <div class="select-input">
<div class="select-span">区划:</div> <div class="select-span">区划:</div>
<executive @quhua="quhua"></executive> <executive @quhua="quhua" @quhuadizhi="quhuadizhi"></executive>
</div> </div>
<div class="my-checkbox"> <div class="my-checkbox">
<el-checkbox-group v-model="checkList" @change="setmealSelect"> <el-checkbox-group v-model="checkList" @change="setmealSelect">
@ -74,6 +74,9 @@
width="180" width="180"
header-align="center" header-align="center"
> >
<template slot-scope="scope">
<span>{{ componendDistrict(scope.row.district) }}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="entprName" prop="entprName"
@ -107,7 +110,7 @@
</el-table> </el-table>
</div> </div>
<div class="pagination"> <div class="pagination">
<my-pagination :total="total" @pagesChange="pagesChange"></my-pagination> <my-pagination :total="total" @pagesChange="pagesChange" ref="mypagination"></my-pagination>
</div> </div>
<!-- 查看 --> <!-- 查看 -->
<el-dialog <el-dialog
@ -166,6 +169,7 @@ export default {
data() { data() {
return { return {
tableData: [], tableData: [],
option:[],
loads: true, loads: true,
total: 0, total: 0,
// //
@ -301,6 +305,26 @@ export default {
this.getList(); this.getList();
}, },
methods: { methods: {
//
componendDistrict(district){
let name
this.option.map((item)=>{
if(item.value == district) {
name = item.label
} else {
item.children.map((itemTwo)=>{
if(itemTwo.value == district) {
name = item.label + '-' + itemTwo.label
}
})
}
})
return name
},
//
quhuadizhi(district) {
this.option = district
},
reset() { reset() {
this.form = { this.form = {
district: "", district: "",
@ -312,6 +336,7 @@ export default {
pageSize: 10, pageSize: 10,
pageNum: 1, pageNum: 1,
}; };
this.$refs.mypagination.defaultPages();
}, },
// //
chongzhiList() { chongzhiList() {
@ -343,6 +368,11 @@ export default {
if (this.district) { if (this.district) {
this.form.district = this.district; this.form.district = this.district;
} }
this.searchBefore = {
pageSize: 10,
pageNum: 1,
};
this.$refs.mypagination.defaultPages();
this.searchBefore = { ...this.searchBefore, ...this.form }; this.searchBefore = { ...this.searchBefore, ...this.form };
this.getList(); this.getList();
}, },

@ -12,7 +12,7 @@
:disabled="isNoneDivision" :disabled="isNoneDivision"
> >
</el-cascader> --> </el-cascader> -->
<executive @quhua="quhua"></executive> <executive @quhua="quhua" @quhuadizhi="quhuadizhi"></executive>
</div> </div>
<div class="select-input"> <div class="select-input">
<div class="select-span">经济类型:</div> <div class="select-span">经济类型:</div>
@ -98,14 +98,26 @@
style="width: 100%" style="width: 100%"
:height="497" :height="497"
:border="false" :border="false"
tooltip-effect="light"
:row-class-name="tableRowClassName" :row-class-name="tableRowClassName"
> >
<el-table-column <el-table-column
prop="entprName" prop="entprName"
label="企业名称" label="企业名称"
show-overflow-tooltip
header-align="center" header-align="center"
> >
</el-table-column> </el-table-column>
<el-table-column
prop="majorHazardLevel"
label="行政区划"
width="180"
header-align="center"
>
<template slot-scope="scope">
<span>{{ componendDistrict("0" + scope.row.subdistrict) }}</span>
</template>
</el-table-column>
<el-table-column <el-table-column
prop="majorHazardLevel" prop="majorHazardLevel"
label="重大危险源等级" label="重大危险源等级"
@ -241,6 +253,7 @@ export default {
data() { data() {
return { return {
tableData: [], tableData: [],
option:[],
form: { form: {
subdistrict: [], subdistrict: [],
frimType: "", frimType: "",
@ -603,6 +616,27 @@ export default {
this.getDict(); this.getDict();
}, },
methods: { methods: {
//
componendDistrict(district){
let name
console.log(this.option,'this.option')
this.option.map((item)=>{
if(item.value == district) {
name = item.label
} else {
item.children.map((itemTwo)=>{
if(itemTwo.value == district) {
name = item.label + '-' + itemTwo.label
}
})
}
})
return name
},
//
quhuadizhi(district) {
this.option = district
},
getDict() { getDict() {
listDist({ listDist({
list: "economic_categories,category,major_hazard_level,entpr_color", list: "economic_categories,category,major_hazard_level,entpr_color",
@ -681,6 +715,11 @@ export default {
this.subdistrict = e; this.subdistrict = e;
}, },
searchList() { searchList() {
this.searchBefore = {
pageSize: 10,
pageNum: 1,
};
this.$refs.mypagination.defaultPages();
if (this.subdistrict) { if (this.subdistrict) {
this.form.subdistrict = this.subdistrict; this.form.subdistrict = this.subdistrict;
} }
@ -702,6 +741,7 @@ export default {
pageSize: 10, pageSize: 10,
pageNum: 1, pageNum: 1,
}; };
this.$refs.mypagination.defaultPages();
this.getList(); this.getList();
}, },
// //

@ -4,7 +4,7 @@
* @Author: JC9527 * @Author: JC9527
* @Date: 2023-09-04 10:20:06 * @Date: 2023-09-04 10:20:06
* @LastEditors: JC9527 * @LastEditors: JC9527
* @LastEditTime: 2023-09-27 13:52:16 * @LastEditTime: 2023-09-27 17:06:02
--> -->
<template> <template>
<div class="container-main" ref="main"> <div class="container-main" ref="main">
@ -34,7 +34,7 @@
:disabled="isNoneDivision" :disabled="isNoneDivision"
> >
</el-cascader> --> </el-cascader> -->
<executive @quhua="quhua"></executive> <executive @quhua="quhua" @quhuadizhi="quhuadizhi"></executive>
</div> </div>
<div class="select-input"> <div class="select-input">
<el-input <el-input
@ -87,6 +87,7 @@
:border="false" :border="false"
:row-class-name="tableRowClassName" :row-class-name="tableRowClassName"
:cell-style="columnStyle" :cell-style="columnStyle"
tooltip-effect="light"
@selection-change="handleSelectionChange" @selection-change="handleSelectionChange"
> >
<el-table-column type="selection" width="55"></el-table-column> <el-table-column type="selection" width="55"></el-table-column>
@ -98,6 +99,7 @@
<el-table-column <el-table-column
prop="enterpriseName" prop="enterpriseName"
label="企业名称" label="企业名称"
show-overflow-tooltip
header-align="center" header-align="center"
> >
</el-table-column> </el-table-column>
@ -131,7 +133,7 @@
</el-table> </el-table>
</div> </div>
<div class="pagination"> <div class="pagination">
<my-pagination :total="total" @pagesChange="pagesChange"></my-pagination> <my-pagination :total="total" @pagesChange="pagesChange" ref="mypagination"></my-pagination>
</div> </div>
<!-- 新增修改 --> <!-- 新增修改 -->
<el-dialog <el-dialog
@ -278,7 +280,7 @@
details.type details.type
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="行政区划">{{ <el-descriptions-item label="行政区划">{{
details.district componendDistrict(details.district)
}}</el-descriptions-item> }}</el-descriptions-item>
<el-descriptions-item label="备注">{{ <el-descriptions-item label="备注">{{
details.remark details.remark
@ -381,6 +383,26 @@ export default {
}), }),
}, },
methods: { methods: {
//
componendDistrict(district){
let name
this.options.map((item)=>{
if(item.value == district) {
name = item.label
} else {
item.children.map((itemTwo)=>{
if(itemTwo.value == district) {
name = item.label + '-' + itemTwo.label
}
})
}
})
return name
},
//
quhuadizhi(district) {
this.options = district
},
getTreeList() { getTreeList() {
xzTree().then((res1) => { xzTree().then((res1) => {
if (this.dept.parentId == 0) { if (this.dept.parentId == 0) {
@ -407,6 +429,11 @@ export default {
this.district = e; this.district = e;
}, },
searchList() { searchList() {
this.searchBefore = {
pageSize: 10,
pageNum: 1,
};
this.$refs.mypagination.defaultPages();
if (this.district) { if (this.district) {
this.queryParms.district = this.district; this.queryParms.district = this.district;
} }
@ -432,6 +459,7 @@ export default {
pageSize: 10, pageSize: 10,
pageNum: 1, pageNum: 1,
}; };
this.$refs.mypagination.defaultPages();
this.queryParms.year = ""; this.queryParms.year = "";
// this.district = []; // this.district = [];
this.queryParms.uscCode = ""; this.queryParms.uscCode = "";
@ -588,6 +616,7 @@ export default {
pageSize: 10, pageSize: 10,
pageNum: 1, pageNum: 1,
}; };
this.$refs.mypagination.defaultPages();
this.getList(); this.getList();
this.$refs.uploadOver.clearFiles(); this.$refs.uploadOver.clearFiles();
}) })

@ -2,8 +2,8 @@
<div class="mainBox"> <div class="mainBox">
<div class="select-nav"> <div class="select-nav">
<div class="left-nav" v-if="activeIndex == 1"> <div class="left-nav" v-if="activeIndex == 1">
<div class="navText">:</div> <div class="navText">:</div>
<el-select v-model="ruleForm.date" placeholder="请选择年" size="mini"> <el-select v-model="ruleForm.date" placeholder="请选择年" size="mini">
<el-option <el-option
v-for="item in options" v-for="item in options"
:key="item.value" :key="item.value"
@ -242,8 +242,8 @@ export default {
], ],
//=== //===
beforeParams: { beforeParams: {
// pageSize: 10, pageSize: 10,
// pageNum: 1, pageNum: 1,
}, },
form: { form: {
deptName: "", deptName: "",

@ -4,7 +4,7 @@
* @Author: JC9527 * @Author: JC9527
* @Date: 2023-09-04 10:20:06 * @Date: 2023-09-04 10:20:06
* @LastEditors: JC9527 * @LastEditors: JC9527
* @LastEditTime: 2023-09-27 14:00:22 * @LastEditTime: 2023-09-27 16:45:07
--> -->
<template> <template>
<div class="plan-management"> <div class="plan-management">
@ -78,6 +78,9 @@
width="180" width="180"
header-align="center" header-align="center"
> >
<template slot-scope="scope">
<span>{{ componendDistrict(scope.row.district) }}</span>
</template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="entprName" prop="entprName"
@ -160,7 +163,7 @@
</el-table> --> </el-table> -->
</div> </div>
<div class="pagination"> <div class="pagination">
<my-pagination :total="total" @pagesChange="pagesChange"></my-pagination> <my-pagination :total="total" @pagesChange="pagesChange" ref="mypagination"></my-pagination>
</div> </div>
</div> </div>
<my-dialog ref="myDialog" v-on:close="padlock"></my-dialog> <my-dialog ref="myDialog" v-on:close="padlock"></my-dialog>
@ -258,6 +261,9 @@
// districtTwo = district.split(1,11) // districtTwo = district.split(1,11)
// obj = { ...this.pages, ...newForm,district:districtTwo }; // obj = { ...this.pages, ...newForm,district:districtTwo };
// } // }
this.pages.pageNum = 1;
this.pages.pageSize = 10;
this.$refs.mypagination.defaultPages();
let obj = obj = { ...this.pages, ...newForm }; let obj = obj = { ...this.pages, ...newForm };
// district = district[1] // district = district[1]
this.getList(obj) this.getList(obj)
@ -266,6 +272,22 @@
} }
}, },
methods:{ methods:{
//
componendDistrict(district){
let name
this.options.map((item)=>{
if(item.subdistrict == district) {
name = item.institutionName
} else {
item.children.map((itemTwo)=>{
if(itemTwo.subdistrict == district) {
name = item.institutionName + '-' + itemTwo.institutionName
}
})
}
})
return name
},
// //
pagesChange(pages){ pagesChange(pages){
this.getList(pages) this.getList(pages)
@ -299,6 +321,9 @@
}, },
// //
reset(){ reset(){
this.pages.pageNum = 1;
this.pages.pageSize = 10;
this.$refs.mypagination.defaultPages();
let obj let obj
if(this.dept.parentId !== 0) { if(this.dept.parentId !== 0) {
let { district} = this.form; let { district} = this.form;
@ -316,6 +341,9 @@
// dialog // dialog
padlock(){ padlock(){
let { district} = this.form; let { district} = this.form;
this.pages.pageNum = 1;
this.pages.pageSize = 10;
this.$refs.mypagination.defaultPages();
let obj = {...this.pages,district} let obj = {...this.pages,district}
this.getList(obj); this.getList(obj);
}, },

@ -49,8 +49,8 @@ module.exports = {
// }, // },
// }, // },
'/api': { '/api': {
// target: `http://39.101.188.84:9033`, target: `http://39.101.188.84:9033`,
target: `http://192.168.0.119:9033`, // target: `http://192.168.0.119:9033`,
changeOrigin: true, changeOrigin: true,
pathRewrite: { pathRewrite: {
'^/api': '' '^/api': ''

Loading…
Cancel
Save