tb-business-item-list.html 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  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.itemName"></sa-item>
  25. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  26. <el-button style="display: inline;" type="info" icon="el-icon-refresh" @click="sa.f5()">重置
  27. </el-button>
  28. </el-form>
  29. <!-- ------------- 快捷按钮 ------------- -->
  30. <sa-item type="fast-btn" show="export"></sa-item>
  31. <!-- ------------- 数据列表 ------------- -->
  32. <el-table class="data-table" ref="data-table" :data="dataList">
  33. <sa-td name="项目类型" prop="itemTypeName"></sa-td>
  34. <sa-td name="具体项目" prop="itemName"></sa-td>
  35. <sa-td name="计费标准" prop="unit">
  36. <template slot-scope="s">
  37. {{s.row.itemPrice}}{{s.row.unit}}
  38. </template>
  39. </sa-td>
  40. <!-- <sa-td name="状态" prop="status" type="enum" :jv="{0: '未完成', 1: '已完成'}"></sa-td>
  41. <sa-td name="作业时间" prop="operateTime"></sa-td> -->
  42. <sa-td name="创建时间" prop="createTime"></sa-td>
  43. <sa-td name="接单时间" prop="pickTime"></sa-td>
  44. <sa-td name="确认时间" prop="confirmTime"></sa-td>
  45. <!-- <el-table-column label="操作" fixed="right" width="200px">
  46. <template slot-scope="s">
  47. <el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看
  48. </el-button>
  49. <el-button class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改
  50. </el-button>
  51. </template>
  52. </el-table-column> -->
  53. </el-table>
  54. <!-- ------------- 分页 ------------- -->
  55. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
  56. </sa-item>
  57. </div>
  58. </div>
  59. <script>
  60. var app = new Vue({
  61. components: {
  62. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  63. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  64. },
  65. el: '.vue-box',
  66. data: {
  67. p: { // 查询参数
  68. id: '', // 主键
  69. itemName: '', // 项目名称
  70. pageNo: 1, // 当前页
  71. pageSize: 10, // 页大小
  72. sortType: 9 // 排序方式
  73. },
  74. dataCount: 0,
  75. dataList: [], // 数据集合
  76. },
  77. methods: {
  78. // 刷新
  79. f5: function() {
  80. sa.ajax('/TbBusinessItem/getList', sa.removeNull(this.p), function(res) {
  81. this.dataList = res.data; // 数据
  82. this.dataCount = res.dataCount; // 数据总数
  83. sa.f5TableHeight(); // 刷新表格高度
  84. }.bind(this));
  85. },
  86. // 查看
  87. get: function(data) {
  88. sa.showIframe('数据详情', 'tb-business-item-info.html?id=' + data.id, '1050px', '90%');
  89. },
  90. // 查看 - 根据选中的
  91. getBySelect: function(data) {
  92. var selection = this.$refs['data-table'].selection;
  93. if (selection.length == 0) {
  94. return sa.msg('请选择一条数据')
  95. }
  96. this.get(selection[0]);
  97. },
  98. // 批量删除
  99. deleteByIds: function() {
  100. // 获取选中元素的id列表
  101. let selection = this.$refs['data-table'].selection;
  102. let ids = sa.getArrayField(selection, 'id');
  103. if (selection.length == 0) {
  104. return sa.msg('请至少选择一条数据')
  105. }
  106. // 提交删除
  107. sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
  108. sa.ajax('/TbBusinessItem/deleteByIds', {
  109. ids: ids.join(',')
  110. }, function(res) {
  111. sa.arrayDelete(this.dataList, selection);
  112. sa.ok('删除成功');
  113. sa.f5TableHeight(); // 刷新表格高度
  114. }.bind(this))
  115. }.bind(this));
  116. },
  117. },
  118. created: function() {
  119. this.f5();
  120. sa.onInputEnter();
  121. }
  122. })
  123. </script>
  124. </body>
  125. </html>