tb-business-item-list.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. <div class="fast-btn">
  31. <el-button type="warning" icon="el-icon-download" @click="sa.exportExcel()">导出</el-button>
  32. </div>
  33. <!-- ------------- 数据列表 ------------- -->
  34. <el-table class="data-table" ref="data-table" :data="dataList">
  35. <sa-td name="合作伙伴" prop="pickCustomerName"></sa-td>
  36. <sa-td name="项目类型" prop="itemTypeName"></sa-td>
  37. <sa-td name="具体项目" prop="itemName"></sa-td>
  38. <sa-td name="计费标准" prop="unit">
  39. <template slot-scope="s">
  40. {{s.row.itemPrice}}{{s.row.unit}}
  41. </template>
  42. </sa-td>
  43. <!-- <sa-td name="状态" prop="status" type="enum" :jv="{0: '未完成', 1: '已完成'}"></sa-td>
  44. <sa-td name="作业时间" prop="operateTime"></sa-td> -->
  45. <sa-td name="创建时间" prop="createTime"></sa-td>
  46. <sa-td name="接单时间" prop="pickTime"></sa-td>
  47. <sa-td name="确认时间" prop="confirmTime"></sa-td>
  48. <el-table-column label="操作" fixed="right" width="100px">
  49. <template slot-scope="s">
  50. <el-button class="c-btn" type="primary" @click="pickFn(s.row)" v-if="s.row.pick == 1 && s.row.confirm == 0">确认</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. businessId: sa.p('businessId', 0),
  68. p: { // 查询参数
  69. id: '', // 主键
  70. itemName: '', // 项目名称
  71. pageNo: 1, // 当前页
  72. pageSize: 10, // 页大小
  73. sortType: 9 // 排序方式
  74. },
  75. dataCount: 0,
  76. dataList: [], // 数据集合
  77. },
  78. methods: {
  79. pickFn (data){
  80. sa.confirm('是否确认该业务项?', function() {
  81. sa.ajax('/TbBusinessItem/confirm',{id: data.id}, function(res){
  82. sa.ok('已确认');
  83. this.f5();
  84. }.bind(this));
  85. }.bind(this));
  86. },
  87. // 刷新
  88. f5: function() {
  89. sa.ajax('/TbBusiness/getById?id=' + this.businessId, sa.removeNull(this.p), function(res) {
  90. this.dataList = res.data.items; // 数据
  91. this.dataCount = res.dataCount; // 数据总数
  92. sa.f5TableHeight(); // 刷新表格高度
  93. }.bind(this));
  94. },
  95. // 查看
  96. get: function(data) {
  97. sa.showIframe('数据详情', 'tb-business-item-info.html?id=' + data.id, '1050px', '90%');
  98. },
  99. // 查看 - 根据选中的
  100. getBySelect: function(data) {
  101. var selection = this.$refs['data-table'].selection;
  102. if (selection.length == 0) {
  103. return sa.msg('请选择一条数据')
  104. }
  105. this.get(selection[0]);
  106. },
  107. // 批量删除
  108. deleteByIds: function() {
  109. // 获取选中元素的id列表
  110. let selection = this.$refs['data-table'].selection;
  111. let ids = sa.getArrayField(selection, 'id');
  112. if (selection.length == 0) {
  113. return sa.msg('请至少选择一条数据')
  114. }
  115. // 提交删除
  116. sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
  117. sa.ajax('/TbBusinessItem/deleteByIds', {
  118. ids: ids.join(',')
  119. }, function(res) {
  120. sa.arrayDelete(this.dataList, selection);
  121. sa.ok('删除成功');
  122. sa.f5TableHeight(); // 刷新表格高度
  123. }.bind(this))
  124. }.bind(this));
  125. },
  126. },
  127. created: function() {
  128. this.f5();
  129. sa.onInputEnter();
  130. }
  131. })
  132. </script>
  133. </body>
  134. </html>