tb-menber-list.html 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>组内边民-列表</title>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  7. <!-- 所有的 css & js 资源 -->
  8. <link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
  9. <link rel="stylesheet" href="../../static/sa.css">
  10. <script src="../../static/kj/vue.min.js"></script>
  11. <script src="../../static/kj/element-ui/index.js"></script>
  12. <script src="../../static/kj/httpVueLoader.js"></script>
  13. <script src="../../static/kj/jquery.min.js"></script>
  14. <script src="../../static/kj/layer/layer.js"></script>
  15. <script src="../../static/sa.js"></script>
  16. <script src="../../static/kj/upload-util.js"></script>
  17. <style type="text/css">
  18. .c-panel .el-form .c-label{width: 7em !important;}
  19. .c-panel .el-form .el-input, .c-panel .el-form .el-textarea__inner{width: 250px;}
  20. </style>
  21. </head>
  22. <body>
  23. <div class="vue-box" style="display: none;" :style="'display: block;'">
  24. <div class="c-panel">
  25. <!-- ------------- 数据列表 ------------- -->
  26. <el-table class="data-table" ref="data-table" :data="dataList" >
  27. <sa-td type="selection"></sa-td>
  28. <sa-td name="姓名" prop="name" ></sa-td>
  29. <sa-td name="边民号" prop="code" ></sa-td>
  30. <sa-td name="性别" prop="sex" type="enum" :jv="{1: '男', 2: '女'}"></sa-td>
  31. <sa-td name="年龄" prop="age" type="num"></sa-td>
  32. <sa-td name="身份证" prop="idCard" ></sa-td>
  33. <sa-td name="身份证复印件" prop="idCardImg" type="img-list"></sa-td>
  34. <sa-td name="手机号码" prop="phone" ></sa-td>
  35. <sa-td name="银行编号" prop="bankNo" ></sa-td>
  36. <sa-td name="银行卡号" prop="bankCode" ></sa-td>
  37. <sa-td name="银行名称" prop="bankName" ></sa-td>
  38. <sa-td name="所属互助组" prop="groupId" type="enum" :jv="{1: '测试组'}"></sa-td>
  39. <sa-td name="互助组名称" prop="groupName" ></sa-td>
  40. <sa-td name="是否可用" prop="status" type="enum" :jv="{0: '否', 1: '是'}"></sa-td>
  41. <sa-td name="角色" prop="role" type="num"></sa-td>
  42. <sa-td name="经度" prop="lng" ></sa-td>
  43. <sa-td name="纬度" prop="lat" ></sa-td>
  44. <sa-td name="最后一次下单定位" prop="lastLocation" ></sa-td>
  45. <sa-td name="联系地址" prop="address" ></sa-td>
  46. <sa-td name="地址ID" prop="addressIds" ></sa-td>
  47. <sa-td name="详细地址" prop="detailAddress" ></sa-td>
  48. <sa-td name="是否锁定" prop="isLock" ></sa-td>
  49. <sa-td name="当天剩余额度" prop="leftPrice" ></sa-td>
  50. <sa-td name="" prop="judgeStatus" ></sa-td>
  51. <!-- <sa-td name="" prop="judgeContent" ></sa-td>
  52. <sa-td name="" prop="registerTime" ></sa-td>
  53. <sa-td name="" prop="judgeTime" ></sa-td>
  54. <sa-td name="" prop="personId" ></sa-td> -->
  55. <!-- <sa-td name="删除状态" prop="deleteStatus" type="switch" :jv="{0: '禁用', 1: '启用'}" @change="s => updateDeleteStatus(s.row)"></sa-td> -->
  56. <el-table-column label="操作" fixed="right" width="240px">
  57. <template slot-scope="s">
  58. <el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看</el-button>
  59. <el-button v-if="sa.isAuth('tb-people-edit')" class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改</el-button>
  60. <el-button v-if="sa.isAuth('tb-people-del')" class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>
  61. </template>
  62. </el-table-column>
  63. </el-table>
  64. <!-- ------------- 分页 ------------- -->
  65. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
  66. </div>
  67. </div>
  68. <script>
  69. var app = new Vue({
  70. components: {
  71. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  72. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  73. },
  74. el: '.vue-box',
  75. data: {
  76. id: sa.p('id', 0), // 获取超链接中的id参数(0=添加,非0=修改)
  77. p: { // 查询参数
  78. name: '', // 姓名
  79. code: '', // 边民号
  80. sex: '', // 性别(1=男,2=女)
  81. age: '', // 年龄
  82. idCard: '', // 身份证
  83. phone: '', // 手机号码
  84. bankNo: '', // 银行编号
  85. bankCode: '', // 银行卡号
  86. bankName: '', // 银行名称
  87. groupId: '', // 所属互助组(1=测试组)
  88. groupName: '', // 互助组名称
  89. status: '', // 是否可用(0=否,1=是)
  90. role: '', // 角色(1=普通边民,2=兼组长)
  91. lng: '', // 经度
  92. lat: '', // 纬度
  93. lastLocation: '', // 最后一次下单定位
  94. address: '', // 联系地址
  95. addressIds: '', // 地址ID
  96. detailAddress: '', // 详细地址
  97. isLock: '', // 是否锁定
  98. leftPrice: '', // 当天剩余额度
  99. // judgeStatus: '', //
  100. // judgeContent: '', //
  101. // registerTime: '', //
  102. // judgeTime: '', //
  103. // personId: '', //
  104. // deleteStatus: '', // 删除状态(0=禁用,1=启用)
  105. pageNo: 1, // 当前页
  106. pageSize: 10, // 页大小
  107. sortType: 0 // 排序方式
  108. },
  109. dataCount: 0,
  110. dataList: [], // 数据集合
  111. },
  112. methods: {
  113. // 刷新
  114. f5: function() {
  115. // 查询组内成员
  116. sa.ajax('/level-one-server/TbGroup/getMemberListByGroupId?id=' + this.id, function(res) {
  117. this.dataList = res.data; // 数据
  118. this.dataCount = res.dataCount; // 数据总数
  119. sa.f5TableHeight(); // 刷新表格高度
  120. }.bind(this));
  121. },
  122. // 查看
  123. get: function(data) {
  124. sa.showIframe('数据详情', '../tb-people/tb-people-info.html?id=' + data.id, '1050px', '90%');
  125. },
  126. // 查看 - 根据选中的
  127. getBySelect: function(data) {
  128. var selection = this.$refs['data-table'].selection;
  129. if(selection.length == 0) {
  130. return sa.msg('请选择一条数据')
  131. }
  132. this.get(selection[0]);
  133. },
  134. // 修改
  135. update: function(data) {
  136. sa.showIframe('修改数据', '../tb-people/tb-people-add.html?id=' + data.id, '1000px', '90%');
  137. },
  138. // 新增
  139. add: function(data) {
  140. sa.showIframe('新增数据', '../tb-people/tb-people-add.html?id=-1', '1000px', '90%');
  141. },
  142. // 删除
  143. del: function(data) {
  144. sa.confirm('是否删除,此操作不可撤销', function() {
  145. sa.ajax('/level-one-server/TbPeople/delete?id=' + data.id, function(res) {
  146. sa.arrayDelete(this.dataList, data);
  147. sa.ok('删除成功');
  148. sa.f5TableHeight(); // 刷新表格高度
  149. }.bind(this))
  150. }.bind(this));
  151. },
  152. // 批量删除
  153. deleteByIds: function() {
  154. // 获取选中元素的id列表
  155. let selection = this.$refs['data-table'].selection;
  156. let ids = sa.getArrayField(selection, 'id');
  157. if(selection.length == 0) {
  158. return sa.msg('请至少选择一条数据')
  159. }
  160. // 提交删除
  161. sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
  162. sa.ajax('/level-one-server/TbPeople/deleteByIds', {ids: ids.join(',')}, function(res) {
  163. sa.arrayDelete(this.dataList, selection);
  164. sa.ok('删除成功');
  165. sa.f5TableHeight(); // 刷新表格高度
  166. }.bind(this))
  167. }.bind(this));
  168. },
  169. // 改 - 删除状态(0=禁用,1=启用)
  170. updateDeleteStatus: function(data) {
  171. // 声明变量记录是否成功
  172. var isOk = false;
  173. var oldValue = data.deleteStatus;
  174. var ajax = sa.ajax('/level-one-server/TbPeople/updateDeleteStatus', {id: data.id, value: data.deleteStatus}, function(res) {
  175. isOk = true;
  176. sa.msg('修改成功');
  177. }.bind(this));
  178. // 如果未能修改成功, 则回滚
  179. $.when(ajax).done(function() {
  180. if(isOk == false) {
  181. data.status = oldValue;
  182. }
  183. })
  184. },
  185. },
  186. created: function() {
  187. this.f5();
  188. sa.onInputEnter();
  189. }
  190. })
  191. </script>
  192. </body>
  193. </html>