tb-business-item-list.html 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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="num" name="主键" v-model="p.id"></sa-item>
  25. <sa-item type="text" name="等级表id" v-model="p.businessId"></sa-item>
  26. <sa-item type="text" name="项目编号" v-model="p.itemCode"></sa-item>
  27. <sa-item type="text" name="项目金额" v-model="p.itemPrice"></sa-item>
  28. <sa-item type="text" name="项目名称" v-model="p.itemName"></sa-item>
  29. <sa-item type="text" name="状态" v-model="p.status"></sa-item>
  30. <sa-item type="text" name="操作时间" v-model="p.operateTime"></sa-item>
  31. <sa-item type="text" name="操作人员" v-model="p.operaror"></sa-item>
  32. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  33. <br/>
  34. <sa-item name="综合排序">
  35. <el-radio-group v-model="p.sortType" class="s-radio-text">
  36. <el-radio :label="0">默认</el-radio>
  37. <el-radio :label="1">主键</el-radio>
  38. <el-radio :label="2">等级表id</el-radio>
  39. <el-radio :label="3">项目编号</el-radio>
  40. <el-radio :label="4">项目金额</el-radio>
  41. <el-radio :label="5">项目名称</el-radio>
  42. <el-radio :label="6">状态</el-radio>
  43. <el-radio :label="7">操作时间</el-radio>
  44. <el-radio :label="8">操作人员</el-radio>
  45. </el-radio-group>
  46. </sa-item>
  47. </el-form>
  48. <!-- ------------- 快捷按钮 ------------- -->
  49. <sa-item type="fast-btn" show="add,get,delete,export,reset"></sa-item>
  50. <!-- ------------- 数据列表 ------------- -->
  51. <el-table class="data-table" ref="data-table" :data="dataList">
  52. <sa-td type="selection"></sa-td>
  53. <sa-td name="主键" prop="id" type="num"></sa-td>
  54. <sa-td name="等级表id" prop="businessId"></sa-td>
  55. <sa-td name="项目编号" prop="itemCode"></sa-td>
  56. <sa-td name="项目金额" prop="itemPrice"></sa-td>
  57. <sa-td name="项目名称" prop="itemName"></sa-td>
  58. <sa-td name="状态" prop="status"></sa-td>
  59. <sa-td name="操作时间" prop="operateTime"></sa-td>
  60. <sa-td name="操作人员" prop="operaror"></sa-td>
  61. <el-table-column label="操作" fixed="right" width="240px">
  62. <template slot-scope="s">
  63. <el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看</el-button>
  64. <el-button class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改</el-button>
  65. <el-button class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>
  66. </template>
  67. </el-table-column>
  68. </el-table>
  69. <!-- ------------- 分页 ------------- -->
  70. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
  71. </div>
  72. </div>
  73. <script>
  74. var app = new Vue({
  75. components: {
  76. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  77. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  78. },
  79. el: '.vue-box',
  80. data: {
  81. p: { // 查询参数
  82. id: '', // 主键
  83. businessId: '', // 等级表id
  84. itemCode: '', // 项目编号
  85. itemPrice: '', // 项目金额(元)
  86. itemName: '', // 项目名称
  87. status: '', // 状态(1=未完成,2=已完成)
  88. operateTime: '', // 操作时间
  89. operaror: '', // 操作人员
  90. pageNo: 1, // 当前页
  91. pageSize: 10, // 页大小
  92. sortType: 0 // 排序方式
  93. },
  94. dataCount: 0,
  95. dataList: [], // 数据集合
  96. },
  97. methods: {
  98. // 刷新
  99. f5: function () {
  100. sa.ajax('/TbBusinessItem/getList', sa.removeNull(this.p), function (res) {
  101. this.dataList = res.data; // 数据
  102. this.dataCount = res.dataCount; // 数据总数
  103. sa.f5TableHeight(); // 刷新表格高度
  104. }.bind(this));
  105. },
  106. // 查看
  107. get: function (data) {
  108. sa.showIframe('数据详情', 'tb-business-item-info.html?id=' + data.id, '1050px', '90%');
  109. },
  110. // 查看 - 根据选中的
  111. getBySelect: function (data) {
  112. var selection = this.$refs['data-table'].selection;
  113. if (selection.length == 0) {
  114. return sa.msg('请选择一条数据')
  115. }
  116. this.get(selection[0]);
  117. },
  118. // 修改
  119. update: function (data) {
  120. sa.showIframe('修改数据', 'tb-business-item-add.html?id=' + data.id, '1000px', '90%');
  121. },
  122. // 新增
  123. add: function (data) {
  124. sa.showIframe('新增数据', 'tb-business-item-add.html?id=-1', '1000px', '90%');
  125. },
  126. // 删除
  127. del: function (data) {
  128. sa.confirm('是否删除,此操作不可撤销', function () {
  129. sa.ajax('/TbBusinessItem/delete?id=' + data.id, function (res) {
  130. sa.arrayDelete(this.dataList, data);
  131. sa.ok('删除成功');
  132. sa.f5TableHeight(); // 刷新表格高度
  133. }.bind(this))
  134. }.bind(this));
  135. },
  136. // 批量删除
  137. deleteByIds: function () {
  138. // 获取选中元素的id列表
  139. let selection = this.$refs['data-table'].selection;
  140. let ids = sa.getArrayField(selection, 'id');
  141. if (selection.length == 0) {
  142. return sa.msg('请至少选择一条数据')
  143. }
  144. // 提交删除
  145. sa.confirm('是否批量删除选中数据?此操作不可撤销', function () {
  146. sa.ajax('/TbBusinessItem/deleteByIds', {ids: ids.join(',')}, function (res) {
  147. sa.arrayDelete(this.dataList, selection);
  148. sa.ok('删除成功');
  149. sa.f5TableHeight(); // 刷新表格高度
  150. }.bind(this))
  151. }.bind(this));
  152. },
  153. },
  154. created: function () {
  155. this.f5();
  156. sa.onInputEnter();
  157. }
  158. })
  159. </script>
  160. </body>
  161. </html>