网格员申办
This commit is contained in:
		
							
								
								
									
										179
									
								
								packages/2.0.5/AppGridMember/components/ApplyList.vue
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										179
									
								
								packages/2.0.5/AppGridMember/components/ApplyList.vue
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,179 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <ai-list class="list" isTabs>
 | 
			
		||||
    <template slot="content">
 | 
			
		||||
      <ai-search-bar bottomBorder>
 | 
			
		||||
        <template slot="left">
 | 
			
		||||
          <el-button
 | 
			
		||||
            icon="iconfont iconAdd"
 | 
			
		||||
            type="primary"
 | 
			
		||||
            size="small"
 | 
			
		||||
            @click="add('')">添加</el-button>
 | 
			
		||||
          <el-button
 | 
			
		||||
            icon="iconfont iconDelete"
 | 
			
		||||
            @click="deleteById(ids.join(','))"
 | 
			
		||||
            :disabled="!Boolean(ids.length)">
 | 
			
		||||
            删除
 | 
			
		||||
          </el-button>
 | 
			
		||||
          <ai-import :instance="instance" :dict="dict" type="appgirdmemberapply" name="网格员申报" @success="getList()">
 | 
			
		||||
            <el-button icon="iconfont iconImport">导入</el-button>
 | 
			
		||||
          </ai-import>
 | 
			
		||||
        </template>
 | 
			
		||||
        <template slot="right">
 | 
			
		||||
          <el-input
 | 
			
		||||
            v-model="searchObj.name"
 | 
			
		||||
            size="small"
 | 
			
		||||
            placeholder="网格员/责任网格"
 | 
			
		||||
            @keyup.enter.native="(page.current = 1), getList()"
 | 
			
		||||
            clearable
 | 
			
		||||
            @clear="(searchObj.name = '', page.current = 1), getList()"
 | 
			
		||||
            suffix-icon="iconfont iconSearch" />
 | 
			
		||||
        </template>
 | 
			
		||||
      </ai-search-bar>
 | 
			
		||||
      <ai-table
 | 
			
		||||
        :tableData="tableData"
 | 
			
		||||
        :col-configs="colConfigs"
 | 
			
		||||
        :total="page.total"
 | 
			
		||||
        ref="aitableex"
 | 
			
		||||
        :current.sync="page.current"
 | 
			
		||||
        :size.sync="page.size"
 | 
			
		||||
        @selection-change="(v) => (ids = v.map((e) => e.id))"
 | 
			
		||||
        @getList="getList()">
 | 
			
		||||
        <el-table-column label="操作" slot="options" align="center" fixed="right" width="120">
 | 
			
		||||
          <template slot-scope="{ row }">
 | 
			
		||||
            <div class="table-options">
 | 
			
		||||
              <el-button type="text" @click="toDetail(row.id)">详情</el-button>
 | 
			
		||||
              <el-button type="text" @click="deleteById(row.id)">删除</el-button>
 | 
			
		||||
            </div>
 | 
			
		||||
          </template>
 | 
			
		||||
        </el-table-column>
 | 
			
		||||
      </ai-table>
 | 
			
		||||
    </template>
 | 
			
		||||
  </ai-list>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
  export default {
 | 
			
		||||
    name: 'ApplyList',
 | 
			
		||||
    label: '网格员管理',
 | 
			
		||||
    props: {
 | 
			
		||||
      instance: Function,
 | 
			
		||||
      dict: Object,
 | 
			
		||||
      permissions: Function,
 | 
			
		||||
    },
 | 
			
		||||
    data() {
 | 
			
		||||
      return {
 | 
			
		||||
        searchObj: {
 | 
			
		||||
          name: "",
 | 
			
		||||
          selectionDate: "",
 | 
			
		||||
        },
 | 
			
		||||
        page: {
 | 
			
		||||
          current: 1,
 | 
			
		||||
          size: 10,
 | 
			
		||||
          total: 0,
 | 
			
		||||
        },
 | 
			
		||||
        goAdd: false,
 | 
			
		||||
        tableData: [],
 | 
			
		||||
        fileList: [],
 | 
			
		||||
        ids: [],
 | 
			
		||||
        detail: {},
 | 
			
		||||
      };
 | 
			
		||||
    },
 | 
			
		||||
    created() {
 | 
			
		||||
      this.dict.load("sex", "girdMemberType", "politicsStatus", "education");
 | 
			
		||||
      this.getList();
 | 
			
		||||
    },
 | 
			
		||||
    computed: {
 | 
			
		||||
      colConfigs() {
 | 
			
		||||
        let _ = this;
 | 
			
		||||
        return [
 | 
			
		||||
          {
 | 
			
		||||
            type: "selection",
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            prop: "name",
 | 
			
		||||
            label: "网格员姓名",
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            prop: "girdName",
 | 
			
		||||
            align: "left",
 | 
			
		||||
            label: "责任网格",
 | 
			
		||||
          },
 | 
			
		||||
          {
 | 
			
		||||
            prop: "phone",
 | 
			
		||||
            align: "center",
 | 
			
		||||
            label: "联系电话",
 | 
			
		||||
          }
 | 
			
		||||
        ];
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
    methods: {
 | 
			
		||||
      getList() {
 | 
			
		||||
        this.instance
 | 
			
		||||
          .post("/app/appgirdmemberapply/list", null, {
 | 
			
		||||
            params: {
 | 
			
		||||
              ...this.searchObj,
 | 
			
		||||
              ...this.page,
 | 
			
		||||
            },
 | 
			
		||||
          })
 | 
			
		||||
          .then((res) => {
 | 
			
		||||
            if (res.code == 0) {
 | 
			
		||||
              this.tableData = res.data.records;
 | 
			
		||||
              this.page.total = res.data.total;
 | 
			
		||||
            }
 | 
			
		||||
          });
 | 
			
		||||
      },
 | 
			
		||||
      deleteById(ids) {
 | 
			
		||||
        ids &&
 | 
			
		||||
          this.$confirm("是否要删除该网格员?", {
 | 
			
		||||
            type: "error",
 | 
			
		||||
          })
 | 
			
		||||
            .then(() => {
 | 
			
		||||
              this.instance
 | 
			
		||||
                .post("/app/appgirdmemberapply/delete", null, {
 | 
			
		||||
                  params: { ids },
 | 
			
		||||
                })
 | 
			
		||||
                .then((res) => {
 | 
			
		||||
                  if (res?.code == 0) {
 | 
			
		||||
                    this.$message.success("删除成功!");
 | 
			
		||||
                    this.getList();
 | 
			
		||||
                  }
 | 
			
		||||
                });
 | 
			
		||||
            })
 | 
			
		||||
            .catch(() => {});
 | 
			
		||||
      },
 | 
			
		||||
      add (id) {
 | 
			
		||||
        this.$emit('change', {
 | 
			
		||||
          type: 'ApplyAdd',
 | 
			
		||||
          params: {
 | 
			
		||||
            id: id || ''
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      },
 | 
			
		||||
 | 
			
		||||
      toDetail (id) {
 | 
			
		||||
        this.$emit('change', {
 | 
			
		||||
          type: 'ApplyDetail',
 | 
			
		||||
          params: {
 | 
			
		||||
            id
 | 
			
		||||
          }
 | 
			
		||||
        })
 | 
			
		||||
      },
 | 
			
		||||
 | 
			
		||||
      handleSelectionChange(val) {
 | 
			
		||||
        this.ids = [];
 | 
			
		||||
        val.map((e) => {
 | 
			
		||||
          this.ids.push(e.id);
 | 
			
		||||
        });
 | 
			
		||||
      },
 | 
			
		||||
      resetSearch() {
 | 
			
		||||
        Object.keys(this.searchObj).map((e) => {
 | 
			
		||||
          this.searchObj[e] = "";
 | 
			
		||||
        });
 | 
			
		||||
        this.getList();
 | 
			
		||||
      },
 | 
			
		||||
    },
 | 
			
		||||
  }
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
</style>
 | 
			
		||||
		Reference in New Issue
	
	Block a user