tb-business-item-list.html 6.5 KB

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