123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249 |
- <!DOCTYPE html>
- <html>
- <head>
- <title>互助组-列表</title>
- <meta charset="utf-8">
- <meta name="viewport"
- content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
- <!-- 所有的 css & js 资源 -->
- <link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
- <link rel="stylesheet" href="../../static/sa.css">
- <script src="../../static/kj/vue.min.js"></script>
- <script src="../../static/kj/element-ui/index.js"></script>
- <script src="../../static/kj/httpVueLoader.js"></script>
- <script src="../../static/kj/jquery.min.js"></script>
- <script src="../../static/kj/layer/layer.js"></script>
- <script src="../../static/sa.js"></script>
- </head>
- <body>
- <div class="vue-box" style="display: none;" :style="'display: block;'">
- <div class="c-panel">
- <!-- ------------- 检索参数 ------------- -->
- <div class="c-title">检索参数</div>
- <el-form ref="form" :model='p' @submit.native.prevent>
- <div class="c-item">
- <label class="c-label">互市区:</label>
- <el-select @change="f5()" v-model="p.tradeAreaId" placeholder="请选择" filterable size="mini">
- <el-option label="请选择" :value="0" disabled></el-option>
- <el-option v-for="(item,index) in tradeAreaList" :key="index" :label="item.name"
- :value="item.id"> </el-option>
- </el-select>
- </div>
- <div class="c-item">
- <label class="c-label">名称:</label>
- <el-input size="mini" v-model="p.name"></el-input>
- </div>
- <div class="c-item" style="min-width: 0px;">
- <el-button size="mini" type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
- <el-button size="mini" type="info" icon="el-icon-refresh" @click="sa.f5()">重置</el-button>
- </div>
- </el-form>
- <!-- ------------- 数据列表 ------------- -->
- <el-table class="data-table" ref="data-table" :data="dataList" size="small">
- <el-table-column align="center" type="selection" width="45px"></el-table-column>
- <el-table-column align="center" label="名称" prop="orgName"></el-table-column>
- <el-table-column align="center" label="场站编码" prop="fieldCode"></el-table-column>
- <el-table-column align="center" label="所属场所" prop="tradeAreaName" width="180"></el-table-column>
- <el-table-column align="center" label="组长" prop="leaderName">
- <template slot-scope='s'>
- <b v-if="s.row.leaderName" style="color: #066CF3;cursor: pointer;" @click="editLeaderFn(s.row.id,s.row.leaderId)">{{s.row.leaderName}}</b>
- <b v-else>-</b>
- </template>
- </el-table-column>
- <el-table-column align="center" label="组长电话" prop="leaderPhone">
- <template slot-scope='s'>
- <b v-if="s.row.leaderPhone">{{s.row.leaderPhone}}</b>
- <b v-else>-</b>
- </template>
- </el-table-column>
- <el-table-column align="center" label="创建时间" class-name="tc-date">
- <template slot-scope="s">{{s.row.createTime}}</template>
- </el-table-column>
- <el-table-column align="center" label="操作" fixed="right" width="270px">
- <template slot-scope="s">
- <el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看
- </el-button>
- <el-button class="c-btn" type="primary" icon="el-icon-view" @click="peopleFn(s.row)">边民
- </el-button>
- </template>
- </el-table-column>
- </el-table>
- <!-- ------------- 分页 ------------- -->
- <div class="page-box">
- <el-pagination background layout="total, prev, pager, next, sizes, jumper"
- :current-page.sync="p.pageNo" :page-size.sync="p.pageSize" :total="dataCount"
- :page-sizes="[10, 20, 30, 40, 50, 100, 1000]" @current-change="f5()" @size-change="f5()">
- </el-pagination>
- </div>
- </div>
- <el-dialog title="导入互助组" :visible.sync="upload" width="500px">
- <div class="c-item br">
- <label class="c-label"><label style="color: red">*</label>所在地区:</label>
- <el-cascader size="mini" @change="addressChange" placeholder="请选择" v-model="address_arry"
- :options="options" :props={value:'id',label:'district'}></el-cascader>
- <span style="color: red; margin-left: 20px;" v-if="showError">请选择</span>
- </div>
- <div style="text-align: center;margin-top: 20px;">
- <el-upload class="upload-demo" :auto-upload="false" drag ref="uploadExcel" :limit="1"
- :headers=headers :data="extraData" :limit="1" accept=".xls,.xlsx" :on-success="onSuccess"
- :action="importExcelUrl" :multiple="false">
- <i class="el-icon-upload"></i>
- <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
- <div class="el-upload__tip" slot="tip">只能上传excel文件</div>
- </el-upload>
- </div>
- <span slot="footer" class="dialog-footer">
- <el-button @click="upload = false">取 消</el-button>
- <el-button type="primary" @click="sureUpload">确 定</el-button>
- </span>
- </el-dialog>
- </div>
- <script>
- var app = new Vue({
- components: {
- "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue')
- },
- el: '.vue-box',
- data: {
- upload: false,
- address_arry: [],
- showError: false,
- importExcelUrl: sa.cfg.api_url + '/levelone-server/TbGroup/import',
- headers: {
- satoken: localStorage.tokenValue
- },
- p: { // 查询参数
- id: '', //
- name: '', // 名称
- leaderId: '', // 组长ID
- leaderName: '', // 组长名
- leaderPhone: '', // 组长电话
- code: '', //
- status: '', // 状态(0=禁用,1=启用)
- pageNo: 1, // 当前页
- pageSize: 10, // 页大小
- sortType: 0 // 排序方式
- },
- dataCount: 0,
- dataList: [], // 数据集合
- options: [],
- tradeAreaList:[],
- extraData: {
- addressIds: ''
- }
- },
- methods: {
- getTradeArea() {
- sa.ajax('/level-one-server/TbTradeArea/getList', {
- pageSize: 100,
- pageNo: 1
- }, function(resp) {
- this.tradeAreaList = resp.data;
- }.bind(this));
- },
- addressChange(value) {
- console.log(value);
- },
- sureUpload() {
- this.showError = this.address_arry.length == 0;
- if (this.showError) {
- return;
- }
- this.$refs.uploadExcel.submit();
- },
- getImportExcel() {
- window.location.href = '../../static/excel/group.xlsx'
- },
- showUpload() {
- this.upload = true;
- this.showError = false;
- this.address_arry = [];
- this.extraData.addressIds = '';
- this.getAddress();
- },
- getAddress() {
- sa.ajax('/level-one-server/TbDistrict/getTreeData', function(resp) {
- this.options = resp.data;
- }.bind(this));
- },
- onSuccess(res, file, fileList) {
- fileList = [];
- if (res.code === 500) {
- sa.alert(res.msg);
- } else {
- sa.alert('导入成功');
- this.f5();
- }
- this.$refs.uploadExcel.clearFiles();
- this.upload = false;
- },
- peopleFn(group){
- sa.showIframe("【"+group.orgName+'】边民管理', 'tb-group-people.html?groupId='+group.id, '1080px', '100%');
- },
- addLeaderFn(groupId){
- sa.showIframe('添加组长', 'tb-group-leader.html?groupId='+groupId, '950px', '90%');
- },
- editLeaderFn(groupId,leaderId){
- sa.showIframe('组长详情', 'tb-group-leader.html?groupId='+groupId+'&leaderId='+leaderId, '950px', '90%');
- },
- // 刷新
- f5: function() {
- sa.ajax('/level-one-server/TbGroup/getList', sa.removeNull(this.p), function(res) {
- this.dataList = res.data; // 数据
- this.dataCount = parseInt(res.dataCount); // 数据总数
- sa.f5TableHeight(); // 刷新表格高度
- }.bind(this));
- },
- // 查看
- get: function(data) {
- sa.showIframe('数据详情', 'tb-group-info.html?id=' + data.id, '950px', '90%');
- },
- // 修改
- update: function(data) {
- sa.showIframe('修改数据', 'tb-group-add.html?id=' + data.id, '550px', '90%');
- },
- // 新增
- add: function(data) {
- sa.showIframe('新增数据', 'tb-group-add.html?id=-1', '550px', '90%');
- },
- // 删除
- del: function(data) {
- sa.confirm('是否删除,此操作不可撤销', function() {
- sa.ajax('/level-one-server/TbGroup/delete?id=' + data.id, function(res) {
- sa.arrayDelete(this.dataList, data);
- sa.ok('删除成功');
- sa.f5TableHeight(); // 刷新表格高度
- }.bind(this))
- }.bind(this));
- },
- // 批量删除
- deleteByIds: function() {
- // 获取选中元素的id列表
- let selection = this.$refs['data-table'].selection;
- let ids = sa.getArrayField(selection, 'id');
- if (selection.length == 0) {
- return sa.msg('请至少选择一条数据')
- }
- // 提交删除
- sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
- sa.ajax('/level-one-server/TbGroup/deleteByIds', {
- ids: ids.join(',')
- }, function(res) {
- sa.arrayDelete(this.dataList, selection);
- sa.ok('删除成功');
- sa.f5TableHeight(); // 刷新表格高度
- }.bind(this))
- }.bind(this));
- },
- },
- created: function() {
- this.f5();
- sa.onInputEnter();
- this.getTradeArea();
- }
- })
- </script>
- </body>
- </html>
|