|
@@ -0,0 +1,194 @@
|
|
|
+<!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="https://unpkg.com/element-ui@2.13.0/lib/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>
|
|
|
+ <script src="../../static/kj/upload-util.js"></script>
|
|
|
+ <style type="text/css">
|
|
|
+ .c-panel .el-form .c-label{width: 7em !important;}
|
|
|
+ .c-panel .el-form .el-input, .c-panel .el-form .el-textarea__inner{width: 250px;}
|
|
|
+ </style>
|
|
|
+ </head>
|
|
|
+ <body>
|
|
|
+ <div class="vue-box" style="display: none;" :style="'display: block;'">
|
|
|
+ <div class="c-panel">
|
|
|
+ <!-- ------------- 数据列表 ------------- -->
|
|
|
+ <el-table class="data-table" ref="data-table" :data="dataList" >
|
|
|
+ <sa-td type="selection"></sa-td>
|
|
|
+ <sa-td name="姓名" prop="name" ></sa-td>
|
|
|
+ <sa-td name="边民号" prop="code" ></sa-td>
|
|
|
+ <sa-td name="性别" prop="sex" type="enum" :jv="{1: '男', 2: '女'}"></sa-td>
|
|
|
+ <sa-td name="年龄" prop="age" type="num"></sa-td>
|
|
|
+ <sa-td name="身份证" prop="idCard" ></sa-td>
|
|
|
+ <sa-td name="身份证复印件" prop="idCardImg" type="img-list"></sa-td>
|
|
|
+ <sa-td name="手机号码" prop="phone" ></sa-td>
|
|
|
+ <sa-td name="银行编号" prop="bankNo" ></sa-td>
|
|
|
+ <sa-td name="银行卡号" prop="bankCode" ></sa-td>
|
|
|
+ <sa-td name="银行名称" prop="bankName" ></sa-td>
|
|
|
+ <sa-td name="所属互助组" prop="groupId" type="enum" :jv="{1: '测试组'}"></sa-td>
|
|
|
+ <sa-td name="互助组名称" prop="groupName" ></sa-td>
|
|
|
+ <sa-td name="是否可用" prop="status" type="enum" :jv="{0: '否', 1: '是'}"></sa-td>
|
|
|
+ <sa-td name="角色" prop="role" type="num"></sa-td>
|
|
|
+ <sa-td name="经度" prop="lng" ></sa-td>
|
|
|
+ <sa-td name="纬度" prop="lat" ></sa-td>
|
|
|
+ <sa-td name="最后一次下单定位" prop="lastLocation" ></sa-td>
|
|
|
+ <sa-td name="联系地址" prop="address" ></sa-td>
|
|
|
+ <sa-td name="地址ID" prop="addressIds" ></sa-td>
|
|
|
+ <sa-td name="详细地址" prop="detailAddress" ></sa-td>
|
|
|
+ <sa-td name="是否锁定" prop="isLock" ></sa-td>
|
|
|
+ <sa-td name="当天剩余额度" prop="leftPrice" ></sa-td>
|
|
|
+ <sa-td name="" prop="judgeStatus" ></sa-td>
|
|
|
+ <!-- <sa-td name="" prop="judgeContent" ></sa-td>
|
|
|
+ <sa-td name="" prop="registerTime" ></sa-td>
|
|
|
+ <sa-td name="" prop="judgeTime" ></sa-td>
|
|
|
+ <sa-td name="" prop="personId" ></sa-td> -->
|
|
|
+ <!-- <sa-td name="删除状态" prop="deleteStatus" type="switch" :jv="{0: '禁用', 1: '启用'}" @change="s => updateDeleteStatus(s.row)"></sa-td> -->
|
|
|
+ <el-table-column label="操作" fixed="right" width="240px">
|
|
|
+ <template slot-scope="s">
|
|
|
+ <el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看</el-button>
|
|
|
+ <el-button v-if="sa.isAuth('tb-people-edit')" class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改</el-button>
|
|
|
+ <el-button v-if="sa.isAuth('tb-people-del')" class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <!-- ------------- 分页 ------------- -->
|
|
|
+ <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <script>
|
|
|
+ var app = new Vue({
|
|
|
+ components: {
|
|
|
+ "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
|
|
|
+ "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
|
|
|
+ },
|
|
|
+ el: '.vue-box',
|
|
|
+ data: {
|
|
|
+ id: sa.p('id', 0), // 获取超链接中的id参数(0=添加,非0=修改)
|
|
|
+ p: { // 查询参数
|
|
|
+ name: '', // 姓名
|
|
|
+ code: '', // 边民号
|
|
|
+ sex: '', // 性别(1=男,2=女)
|
|
|
+ age: '', // 年龄
|
|
|
+ idCard: '', // 身份证
|
|
|
+ phone: '', // 手机号码
|
|
|
+ bankNo: '', // 银行编号
|
|
|
+ bankCode: '', // 银行卡号
|
|
|
+ bankName: '', // 银行名称
|
|
|
+ groupId: '', // 所属互助组(1=测试组)
|
|
|
+ groupName: '', // 互助组名称
|
|
|
+ status: '', // 是否可用(0=否,1=是)
|
|
|
+ role: '', // 角色(1=普通边民,2=兼组长)
|
|
|
+ lng: '', // 经度
|
|
|
+ lat: '', // 纬度
|
|
|
+ lastLocation: '', // 最后一次下单定位
|
|
|
+ address: '', // 联系地址
|
|
|
+ addressIds: '', // 地址ID
|
|
|
+ detailAddress: '', // 详细地址
|
|
|
+ isLock: '', // 是否锁定
|
|
|
+ leftPrice: '', // 当天剩余额度
|
|
|
+ // judgeStatus: '', //
|
|
|
+ // judgeContent: '', //
|
|
|
+ // registerTime: '', //
|
|
|
+ // judgeTime: '', //
|
|
|
+ // personId: '', //
|
|
|
+ // deleteStatus: '', // 删除状态(0=禁用,1=启用)
|
|
|
+ pageNo: 1, // 当前页
|
|
|
+ pageSize: 10, // 页大小
|
|
|
+ sortType: 0 // 排序方式
|
|
|
+ },
|
|
|
+ dataCount: 0,
|
|
|
+ dataList: [], // 数据集合
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ // 刷新
|
|
|
+ f5: function() {
|
|
|
+ // 查询组内成员
|
|
|
+ sa.ajax('/level-one-server/TbGroup/getMemberListByGroupId?id=' + this.id, function(res) {
|
|
|
+ this.dataList = res.data; // 数据
|
|
|
+ this.dataCount = res.dataCount; // 数据总数
|
|
|
+ sa.f5TableHeight(); // 刷新表格高度
|
|
|
+ }.bind(this));
|
|
|
+
|
|
|
+ },
|
|
|
+ // 查看
|
|
|
+ get: function(data) {
|
|
|
+ sa.showIframe('数据详情', '../tb-people/tb-people-info.html?id=' + data.id, '1050px', '90%');
|
|
|
+ },
|
|
|
+ // 查看 - 根据选中的
|
|
|
+ getBySelect: function(data) {
|
|
|
+ var selection = this.$refs['data-table'].selection;
|
|
|
+ if(selection.length == 0) {
|
|
|
+ return sa.msg('请选择一条数据')
|
|
|
+ }
|
|
|
+ this.get(selection[0]);
|
|
|
+ },
|
|
|
+ // 修改
|
|
|
+ update: function(data) {
|
|
|
+ sa.showIframe('修改数据', '../tb-people/tb-people-add.html?id=' + data.id, '1000px', '90%');
|
|
|
+ },
|
|
|
+ // 新增
|
|
|
+ add: function(data) {
|
|
|
+ sa.showIframe('新增数据', '../tb-people/tb-people-add.html?id=-1', '1000px', '90%');
|
|
|
+ },
|
|
|
+ // 删除
|
|
|
+ del: function(data) {
|
|
|
+ sa.confirm('是否删除,此操作不可撤销', function() {
|
|
|
+ sa.ajax('/level-one-server/TbPeople/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/TbPeople/deleteByIds', {ids: ids.join(',')}, function(res) {
|
|
|
+ sa.arrayDelete(this.dataList, selection);
|
|
|
+ sa.ok('删除成功');
|
|
|
+ sa.f5TableHeight(); // 刷新表格高度
|
|
|
+ }.bind(this))
|
|
|
+ }.bind(this));
|
|
|
+ },
|
|
|
+ // 改 - 删除状态(0=禁用,1=启用)
|
|
|
+ updateDeleteStatus: function(data) {
|
|
|
+ // 声明变量记录是否成功
|
|
|
+ var isOk = false;
|
|
|
+ var oldValue = data.deleteStatus;
|
|
|
+ var ajax = sa.ajax('/level-one-server/TbPeople/updateDeleteStatus', {id: data.id, value: data.deleteStatus}, function(res) {
|
|
|
+ isOk = true;
|
|
|
+ sa.msg('修改成功');
|
|
|
+ }.bind(this));
|
|
|
+ // 如果未能修改成功, 则回滚
|
|
|
+ $.when(ajax).done(function() {
|
|
|
+ if(isOk == false) {
|
|
|
+ data.status = oldValue;
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ },
|
|
|
+ created: function() {
|
|
|
+ this.f5();
|
|
|
+ sa.onInputEnter();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ </script>
|
|
|
+ </body>
|
|
|
+</html>
|