tb-entity-list.html 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>开票主体表-列表</title>
  5. <meta charset="utf-8">
  6. <meta name="viewport"
  7. content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
  8. <!-- 所有的 css & js 资源 -->
  9. <link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
  10. <link rel="stylesheet" href="../../static/sa.css">
  11. <script src="../../static/kj/vue.min.js"></script>
  12. <script src="../../static/kj/element-ui/index.js"></script>
  13. <script src="../../static/kj/httpVueLoader.js"></script>
  14. <script src="../../static/kj/jquery.min.js"></script>
  15. <script src="../../static/kj/layer/layer.js"></script>
  16. <script src="../../static/sa.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. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  26. <br/>
  27. </el-form>
  28. <!-- ------------- 快捷按钮 ------------- -->
  29. <sa-item type="fast-btn" show="add,reset"></sa-item>
  30. <!-- ------------- 数据列表 ------------- -->
  31. <el-table class="data-table" ref="data-table" :data="dataList">
  32. <!-- <sa-td type="selection"></sa-td>-->
  33. <!-- <sa-td name="主键" prop="id" ></sa-td>-->
  34. <!-- <sa-td name="客户id" prop="customerId" ></sa-td>-->
  35. <sa-td name="企业名称" prop="name"></sa-td>
  36. <sa-td name="税号" prop="taxIdNo"></sa-td>
  37. <sa-td name="地址" prop="address"></sa-td>
  38. <sa-td name="电话" prop="phone"></sa-td>
  39. <sa-td name="开户银行" prop="bank"></sa-td>
  40. <sa-td name="银行账号" prop="bankNo"></sa-td>
  41. <sa-td name="邮箱" prop="email"></sa-td>
  42. <!-- <sa-td name="创建时间" prop="createTime" ></sa-td>-->
  43. <!-- <sa-td name="更新时间" prop="updateTime" ></sa-td>-->
  44. <el-table-column label="操作" width="240px">
  45. <template slot-scope="s">
  46. <el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看</el-button>
  47. <el-button class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改</el-button>
  48. <el-button class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>
  49. </template>
  50. </el-table-column>
  51. </el-table>
  52. <!-- ------------- 分页 ------------- -->
  53. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
  54. </div>
  55. </div>
  56. <script>
  57. var app = new Vue({
  58. components: {
  59. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  60. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  61. },
  62. el: '.vue-box',
  63. data: {
  64. p: { // 查询参数
  65. id: '', // 主键
  66. customerId: '', // 客户id
  67. name: '', // 企业名称
  68. taxIdNo: '', // 税号
  69. address: '', // 地址
  70. phone: '', // 电话
  71. bank: '', // 开户银行
  72. bankNo: '', // 银行账号
  73. email: '', // 邮箱
  74. createTime: '', // 创建时间
  75. updateTime: '', // 更新时间
  76. pageNo: 1, // 当前页
  77. pageSize: 10, // 页大小
  78. sortType: 0 // 排序方式
  79. },
  80. dataCount: 0,
  81. dataList: [], // 数据集合
  82. currentCustomerId: '1',
  83. },
  84. methods: {
  85. getCustomer() {
  86. sa.ajax('/TbCostomer/getCurrentCustomerId', function (resp) {
  87. this.currentCustomerId = resp.data;
  88. }.bind(this));
  89. },
  90. // 刷新
  91. f5: function () {
  92. sa.ajax('/TbEntity/getList', sa.removeNull(this.p), function (res) {
  93. this.dataList = res.data; // 数据
  94. this.dataCount = res.dataCount; // 数据总数
  95. sa.f5TableHeight(); // 刷新表格高度
  96. }.bind(this));
  97. },
  98. // 查看
  99. get: function (data) {
  100. sa.showIframe('数据详情', 'tb-entity-info.html?id=' + data.id, '1050px', '90%');
  101. },
  102. // 查看 - 根据选中的
  103. getBySelect: function (data) {
  104. var selection = this.$refs['data-table'].selection;
  105. if (selection.length == 0) {
  106. return sa.msg('请选择一条数据')
  107. }
  108. this.get(selection[0]);
  109. },
  110. // 修改
  111. update: function (data) {
  112. sa.showIframe('修改数据', 'tb-entity-add.html?id=' + data.id, '550px', '80%');
  113. },
  114. // 新增
  115. add: function (data) {
  116. sa.showIframe('新增数据', 'tb-entity-add.html?id=-1&customerId=' + this.currentCustomerId, '550px', '80%');
  117. },
  118. // 删除
  119. del: function (data) {
  120. sa.confirm('是否删除,此操作不可撤销', function () {
  121. sa.ajax('/TbEntity/delete?id=' + data.id, function (res) {
  122. sa.arrayDelete(this.dataList, data);
  123. sa.ok('删除成功');
  124. sa.f5TableHeight(); // 刷新表格高度
  125. }.bind(this))
  126. }.bind(this));
  127. },
  128. // 批量删除
  129. deleteByIds: function () {
  130. // 获取选中元素的id列表
  131. let selection = this.$refs['data-table'].selection;
  132. let ids = sa.getArrayField(selection, 'id');
  133. if (selection.length == 0) {
  134. return sa.msg('请至少选择一条数据')
  135. }
  136. // 提交删除
  137. sa.confirm('是否批量删除选中数据?此操作不可撤销', function () {
  138. sa.ajax('/TbEntity/deleteByIds', {ids: ids.join(',')}, function (res) {
  139. sa.arrayDelete(this.dataList, selection);
  140. sa.ok('删除成功');
  141. sa.f5TableHeight(); // 刷新表格高度
  142. }.bind(this))
  143. }.bind(this));
  144. },
  145. },
  146. created: function () {
  147. this.f5();
  148. this.getCustomer();
  149. sa.onInputEnter();
  150. }
  151. })
  152. </script>
  153. </body>
  154. </html>