| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212 |
- <template>
- <div :style="{'height':this.tableHeight+'px'}">
- <el-container>
- <el-main style="border:1px solid #d5d5ff;margin-left:5px;padding:0px;overflow-x: hidden;">
- <el-table :data="villageList" :height="tableHeight1" style="width: 100%">
- <el-table-column align="center" show-overflow-tooltip prop="adNm" label="行政村名(*县*乡镇*村)" min-width="160"></el-table-column>
- <el-table-column align="center" show-overflow-tooltip prop="isPoverty" label="是否贫困村" min-width="80">
- <template slot-scope="scope">
- <span>{{formatRadio(scope.row.isPoverty)}}</span>
- </template>
- </el-table-column>
- <el-table-column align="center" show-overflow-tooltip prop="isFluexc" label="是否氟超标地区" min-width="100">
- <template slot-scope="scope">
- <span>{{formatRadio(scope.row.isFluexc)}}</span>
- </template>
- </el-table-column>
- <el-table-column align="center" show-overflow-tooltip prop="isMtarea" label="是否山区" min-width="70">
- <template slot-scope="scope">
- <span>{{formatRadio(scope.row.isMtarea)}}</span>
- </template>
- </el-table-column>
- <el-table-column align="center" show-overflow-tooltip prop="isCenwtSupply" label="是否集中供水村" min-width="100">
- <template slot-scope="scope">
- <span>{{formatRadio(scope.row.isCenwtSupply)}}</span>
- </template>
- </el-table-column>
- <el-table-column align="center" show-overflow-tooltip prop="watersupplyPer" label="集中供水人口比例" min-width="110">
- <template slot-scope="scope">
- <span>{{scope.row.watersupplyPer ? scope.row.watersupplyPer * 100 + '%' : ''}}</span>
- </template>
- </el-table-column>
- <el-table-column align="center" sortable show-overflow-tooltip prop="visitDate" label="暗访日期" min-width="80"></el-table-column>
- </el-table>
- </el-main>
- </el-container>
- <!-- 分页 -->
- <div style="text-align: center;">
- <el-pagination
- class="paginationCenter"
- background
- @size-change="handleSizeChange"
- @current-change="search"
- :current-page.sync="pageIndex"
- :page-sizes="[10, 20, 50, 100]"
- :page-size="pageSize"
- layout="total, sizes, prev, pager, next"
- :total="total">
- </el-pagination>
- </div>
- </div>
- </template>
- <script>
- import provTreeList from "../../../../../widgets/villageList_nongyin.vue";
- import inputWith from "../../../../../widgets/inuptWith.vue"
- import request from "../../../../../utils/gw_ajax_request.js"
- import {getTableId_ny,updateTable1_ny} from "../../../../../api/duChaTianBao.js"
- import {formatDateTimeD} from "../../../../../utils/gw_date.js"
- export default {
- components: {
- provTreeList: provTreeList,
- inputWith: inputWith
- },
- props: ['ryObjId'],
- data() {
- return {
- tableHeight: window.innerHeight * 0.5,
- tableHeight1: window.innerHeight * 0.5 -2,
- formObj: {
- ryObjId:'',
- adNm: '',
- villageCode:'',
- isPoverty: '',
- isFluexc: '',
- isMtarea: '',
- isCenwtSupply: '',
- watersupplyPer: '',
- recPers2: '',
- recPersId: '',
- recPersTel: '',
- visitDate: '',
- createTime:'',
- },
- getEngId:false,
- searchObj: {
- pageNum: '',
- pageSize: 20
- },
- pageIndex: 1,
- pageSize: 20,
- total: 0,
- villageList: [],
- dialogFormVisible: false,
- formLabelWidth: '160px',
- curOperate: '',
- isExits: false,
- loading: true
- }
- },
- computed:{
- recPersId(){
- return localStorage.getItem("userid")? localStorage.getItem("userid"): '1098101939614724096'
- }
- },
- mounted() {
- // this.getVillageList()
- // alert(this.ryObjId);
- },
- watch: {
- ryObjId(newVal,oldVal){
- if(newVal){
- this.getVillageList()
- }
- }
- },
- methods: {
- submitTable:function(){
- updateTable1_ny(
- this.formObj.adNm,
- this.ryObjId,
- this.formObj.isCenwtSupply,
- this.formObj.isFluexc,
- this.formObj.isMtarea,
- this.formObj.isPoverty,
- this.formObj.recPers2,
- this.formObj.recPersId,
- this.formObj.recPersTel,
- this.formObj.status,
- this.formObj.villageCode,
- this.formObj.visitDate,
- this.formObj.watersupplyPer
- ).then((res)=>{
- this.dialogFormVisible = false
- this.getVillageList()
- });
- },
- //村列表
- getVillageList(){
- this.searchObj.pageSize = this.pageSize;
- this.searchObj.pageNum = this.pageIndex;
- this.searchObj.ryObjId = this.ryObjId;
- let paramsObj = this.searchObj;
- request.post('/dc/insp/secsurveyVlg/queryListByPage',paramsObj).then((res)=>{
- if(res.success){
- this.villageList = res.data.list
- this.total = res.data.total
- // this.loading = false
- }
- })
- },
- toAddMember(type,row){
- this.curOperate = type
- let rowObj = {}
- Object.assign(rowObj,row)
- if(this.curOperate == '编辑'){
- this.formObj = rowObj
- this.formObj.watersupplyPer = this.formObj.watersupplyPer * 100
- }else{
- for (var obj in this.formObj) {
- this.formObj[obj] = ''
- }
- this.formObj.visitDate = formatDateTimeD()
- }
- this.dialogFormVisible = true
- },
- addTable(){
- this.formObj = {
- ryObjId:'',
- adNm: '',
- villageCode:'',
- isPoverty: '',
- isFluexc: '',
- isMtarea: '',
- isCenwtSupply: '',
- watersupplyPer: '',
- recPers2: '',
- recPersTel: '',
- visitDate: ''
- };
- this.getEngId = false;
- this.dialogFormVisible = true
- },
- //村信息
- provTreeSelectChangeHandler(params) {
- this.formObj.adNm = params.name;
- this.formObj.villageCode = params.code;
- },
- search(val){
- this.pageIndex = val
- this.getVillageList()
- },
- handleSizeChange(val){
- console.log(val);
- this.pageSize = val;
- this.getVillageList()
- },
- formatRadio(val){
- if(val == '1'){
- return '是'
- }else if(val == '0'){
- return '否'
- }else{
- return val
- }
- }
- },
- }
- </script>
- <style>
- </style>
|