tb-purchaser-list.html 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  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. </head>
  18. <body>
  19. <div class="vue-box" style="display: none;" :style="'display: block;'">
  20. <div class="c-panel">
  21. <!-- ------------- 检索参数 ------------- -->
  22. <!-- <div class="c-title">检索参数</div> -->
  23. <el-form ref="form" :model='p' @submit.native.prevent>
  24. <sa-item type="text" name="名称" v-model="p.name"></sa-item>
  25. <sa-item type="text" name="法人" v-model="p.legalPerson"></sa-item>
  26. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  27. <el-button type="info" icon="el-icon-refresh" @click="sa.f5()">重置</el-button>
  28. </el-form>
  29. <div class="fast-btn">
  30. <el-button v-if="sa.isAuth('tb-purchaser-add')" size="mini" type="primary" @click="add()">新增</el-button>
  31. <el-button size="mini" type="success" @click="getBySelect()">查看</el-button>
  32. </div>
  33. <!-- ------------- 数据列表 ------------- -->
  34. <el-table class="data-table" ref="data-table" :data="dataList" >
  35. <sa-td type="selection"></sa-td>
  36. <sa-td name="名称" prop="name" ></sa-td>
  37. <sa-td name="法人" prop="legalPerson" ></sa-td>
  38. <sa-td name="身份证号" prop="idCard" ></sa-td>
  39. <sa-td name="手机号码" prop="contact" ></sa-td>
  40. <sa-td name="营业执照" prop="businessLicense" type="img-list"></sa-td>
  41. <sa-td name="银行编号" prop="bankNo" ></sa-td>
  42. <sa-td name="银行名称" prop="bankName" ></sa-td>
  43. <sa-td name="银行账号" prop="bankAccount" ></sa-td>
  44. <sa-td name="税号" prop="dutyParagraph" ></sa-td>
  45. <sa-td name="地址编号" prop="addressIds" ></sa-td>
  46. <sa-td name="地址" prop="address" ></sa-td>
  47. <!-- <sa-td name="审核状态" prop="judgeStatus" type="enum" :jv="{0: '未通过', 1: '已通过'}"></sa-td>
  48. <sa-td name="审核意见" prop="judgeContent" ></sa-td>
  49. <sa-td name="上次审核时间" prop="judgeTime" type="datetime"></sa-td>
  50. <sa-td name="注册时间" prop="registerTime" type="datetime"></sa-td> -->
  51. <sa-td name="人脸编号" prop="personId" type="num"></sa-td>
  52. <el-table-column label="操作" fixed="right" width="240px">
  53. <template slot-scope="s">
  54. <el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看</el-button>
  55. <el-button v-if="sa.isAuth('tb-purchaser-edit')" class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改</el-button>
  56. <el-button v-if="sa.isAuth('tb-purchaser-del')" class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>
  57. </template>
  58. </el-table-column>
  59. </el-table>
  60. <!-- ------------- 分页 ------------- -->
  61. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
  62. </div>
  63. </div>
  64. <script>
  65. var app = new Vue({
  66. components: {
  67. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  68. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  69. },
  70. el: '.vue-box',
  71. data: {
  72. p: { // 查询参数
  73. name: '', // 名称
  74. legalPerson: '', // 法人
  75. idCard: '', // 身份证号
  76. contact: '', // 手机号码
  77. bankNo: '', // 银行编号
  78. bankName: '', // 银行名称
  79. bankAccount: '', // 银行账号
  80. dutyParagraph: '', // 税号
  81. addressIds: '', // 地址编号
  82. address: '', // 地址
  83. // judgeStatus: '', // 审核状态(0=未通过,1=已通过)
  84. // judgeContent: '', // 审核意见
  85. personId: '', // 人脸编号
  86. pageNo: 1, // 当前页
  87. pageSize: 10, // 页大小
  88. sortType: 0 // 排序方式
  89. },
  90. dataCount: 0,
  91. dataList: [], // 数据集合
  92. },
  93. methods: {
  94. // 刷新
  95. f5: function() {
  96. sa.ajax('/level-two-server/TbPurchaser/getList', sa.removeNull(this.p), function(res) {
  97. this.dataList = res.data; // 数据
  98. this.dataCount = res.dataCount; // 数据总数
  99. sa.f5TableHeight(); // 刷新表格高度
  100. }.bind(this));
  101. },
  102. // 查看
  103. get: function(data) {
  104. sa.showIframe('数据详情', 'tb-purchaser-info.html?id=' + data.id, '1050px', '90%');
  105. },
  106. // 查看 - 根据选中的
  107. getBySelect: function(data) {
  108. var selection = this.$refs['data-table'].selection;
  109. if(selection.length == 0) {
  110. return sa.msg('请选择一条数据')
  111. }
  112. this.get(selection[0]);
  113. },
  114. // 修改
  115. update: function(data) {
  116. sa.showIframe('修改数据', 'tb-purchaser-add.html?id=' + data.id, '1000px', '90%');
  117. },
  118. // 新增
  119. add: function(data) {
  120. sa.showIframe('新增数据', 'tb-purchaser-add.html?id=-1', '1000px', '90%');
  121. },
  122. // 删除
  123. del: function(data) {
  124. sa.confirm('是否删除,此操作不可撤销', function() {
  125. sa.ajax('/level-two-server/TbPurchaser/delete?id=' + data.id, function(res) {
  126. sa.arrayDelete(this.dataList, data);
  127. sa.ok('删除成功');
  128. sa.f5TableHeight(); // 刷新表格高度
  129. }.bind(this))
  130. }.bind(this));
  131. },
  132. // 批量删除
  133. deleteByIds: function() {
  134. // 获取选中元素的id列表
  135. let selection = this.$refs['data-table'].selection;
  136. let ids = sa.getArrayField(selection, 'id');
  137. if(selection.length == 0) {
  138. return sa.msg('请至少选择一条数据')
  139. }
  140. // 提交删除
  141. sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
  142. sa.ajax('/level-two-server/TbPurchaser/deleteByIds', {ids: ids.join(',')}, function(res) {
  143. sa.arrayDelete(this.dataList, selection);
  144. sa.ok('删除成功');
  145. sa.f5TableHeight(); // 刷新表格高度
  146. }.bind(this))
  147. }.bind(this));
  148. },
  149. // 改 - 删除状态(0=禁用,1=启用)
  150. updateDeleteStatus: function(data) {
  151. // 声明变量记录是否成功
  152. var isOk = false;
  153. var oldValue = data.deleteStatus;
  154. var ajax = sa.ajax('/level-two-server/TbPurchaser/updateDeleteStatus', {id: data.id, value: data.deleteStatus}, function(res) {
  155. isOk = true;
  156. sa.msg('修改成功');
  157. }.bind(this));
  158. // 如果未能修改成功, 则回滚
  159. $.when(ajax).done(function() {
  160. if(isOk == false) {
  161. data.status = oldValue;
  162. }
  163. })
  164. },
  165. },
  166. created: function() {
  167. this.f5();
  168. sa.onInputEnter();
  169. }
  170. })
  171. </script>
  172. </body>
  173. </html>