tb-purchaser-list.html 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  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.businessName" width="100px"></sa-item>
  25. <sa-item type="text" name="企业法人" v-model="p.legalPerson" width="100px"></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-button v-if="sa.isAuth('tb-purchaser-add')" size="mini" type="primary" @click="add()">新增</el-button>
  29. </el-form>
  30. <!-- ------------- 数据列表 ------------- -->
  31. <el-table class="data-table" ref="data-table" :data="dataList" >
  32. <sa-td type="selection"></sa-td>
  33. <sa-td name="企业名称" prop="businessName" width="250"></sa-td>
  34. <sa-td name="企业法人" prop="legalPerson" ></sa-td>
  35. <sa-td name="统一社会信用代码" prop="dutyParagraph" width="200"></sa-td>
  36. <!-- <sa-td name="营业执照" prop="businessLicense" type="img-list"></sa-td> -->
  37. <sa-td name="开户行" prop="bankName" width="230"></sa-td>
  38. <sa-td name="开户账号" prop="bankAccount" width="200"></sa-td>
  39. <sa-td name="联系人" prop="name" ></sa-td>
  40. <sa-td name="联系号码" prop="contact" width="160"></sa-td>
  41. <!-- <sa-td name="邮箱" prop="email" ></sa-td> -->
  42. <sa-td name="审核状态" prop="judgeStatus">
  43. <template slot-scope="scope">
  44. <el-tag type="danger" v-if="scope.row.judgeStatus==0">未审核</el-tag>
  45. <el-tag type="primary" v-if="scope.row.judgeStatus==1">审核通过</el-tag>
  46. <el-tag type="danger" v-if="scope.row.judgeStatus==2">审核驳回</el-tag>
  47. </template>
  48. </sa-td>
  49. <sa-td name="创建时间" prop="createTime" width="160"></sa-td>
  50. <el-table-column label="操作" fixed="right" width="240px">
  51. <template slot-scope="s">
  52. <el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看</el-button>
  53. <el-button v-if="sa.isAuth('tb-purchaser-edit')" class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改</el-button>
  54. <el-button v-if="sa.isAuth('tb-purchaser-del')" class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>
  55. </template>
  56. </el-table-column>
  57. </el-table>
  58. <!-- ------------- 分页 ------------- -->
  59. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
  60. </div>
  61. </div>
  62. <script>
  63. var app = new Vue({
  64. components: {
  65. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  66. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  67. },
  68. el: '.vue-box',
  69. data: {
  70. p: { // 查询参数
  71. type: 1, // 类型:企业收购商
  72. businessName: '', // 企业名称
  73. legalPerson: '', // 企业法人
  74. pageNo: 1, // 当前页
  75. pageSize: 10, // 页大小
  76. sortType: 0 // 排序方式
  77. },
  78. dataCount: 0,
  79. dataList: [], // 数据集合
  80. },
  81. methods: {
  82. // 刷新
  83. f5: function() {
  84. sa.ajax('/level-two-server/TbPurchaser/getList', sa.removeNull(this.p), function(res) {
  85. this.dataList = res.data; // 数据
  86. this.dataCount = res.dataCount; // 数据总数
  87. sa.f5TableHeight(); // 刷新表格高度
  88. }.bind(this));
  89. },
  90. // 查看
  91. get: function(data) {
  92. sa.showIframe('数据详情', 'tb-purchaser-info.html?id=' + data.id, '1050px', '90%');
  93. },
  94. // 修改
  95. update: function(data) {
  96. sa.showIframe('修改数据', 'tb-purchaser-add.html?id=' + data.id, '1000px', '90%');
  97. },
  98. // 新增
  99. add: function(data) {
  100. sa.showIframe('新增数据', 'tb-purchaser-add.html?id=-1', '1000px', '90%');
  101. },
  102. // 删除
  103. del: function(data) {
  104. sa.confirm('是否删除,此操作不可撤销', function() {
  105. sa.ajax('/level-two-server/TbPurchaser/delete?id=' + data.id, function(res) {
  106. sa.arrayDelete(this.dataList, data);
  107. sa.ok('删除成功');
  108. sa.f5TableHeight(); // 刷新表格高度
  109. }.bind(this))
  110. }.bind(this));
  111. },
  112. // 批量删除
  113. deleteByIds: function() {
  114. // 获取选中元素的id列表
  115. let selection = this.$refs['data-table'].selection;
  116. let ids = sa.getArrayField(selection, 'id');
  117. if(selection.length == 0) {
  118. return sa.msg('请至少选择一条数据')
  119. }
  120. // 提交删除
  121. sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
  122. sa.ajax('/level-two-server/TbPurchaser/deleteByIds', {ids: ids.join(',')}, function(res) {
  123. sa.arrayDelete(this.dataList, selection);
  124. sa.ok('删除成功');
  125. sa.f5TableHeight(); // 刷新表格高度
  126. }.bind(this))
  127. }.bind(this));
  128. },
  129. // 改 - 删除状态(0=禁用,1=启用)
  130. updateDeleteStatus: function(data) {
  131. // 声明变量记录是否成功
  132. var isOk = false;
  133. var oldValue = data.deleteStatus;
  134. var ajax = sa.ajax('/level-two-server/TbPurchaser/updateDeleteStatus', {id: data.id, value: data.deleteStatus}, function(res) {
  135. isOk = true;
  136. sa.msg('修改成功');
  137. }.bind(this));
  138. // 如果未能修改成功, 则回滚
  139. $.when(ajax).done(function() {
  140. if(isOk == false) {
  141. data.status = oldValue;
  142. }
  143. })
  144. },
  145. },
  146. created: function() {
  147. this.f5();
  148. sa.onInputEnter();
  149. }
  150. })
  151. </script>
  152. </body>
  153. </html>