tb-business-item-list.html 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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. <!-- ------------- 数据列表 ------------- -->
  31. <el-table class="data-table" ref="data-table" :data="dataList">
  32. <sa-td name="单号" prop="no" width="160"></sa-td>
  33. <sa-td name="作业公司" prop="pickCustomerName"></sa-td>
  34. <sa-td name="项目" prop="itemName"></sa-td>
  35. <sa-td name="类型" prop="itemTypeName"></sa-td>
  36. <sa-td name="计费标准" prop="unit">
  37. <template slot-scope="s">
  38. {{s.row.itemPrice}}{{s.row.unit}}
  39. </template>
  40. </sa-td>
  41. <!-- <sa-td name="状态" prop="status" type="enum" :jv="{0: '未完成', 1: '已完成'}"></sa-td>
  42. <sa-td name="作业时间" prop="operateTime"></sa-td> -->
  43. <sa-td name="创建时间" prop="createTime" width="160"></sa-td>
  44. <sa-td name="接单时间" prop="pickTime" width="160"></sa-td>
  45. <sa-td name="确认时间" prop="confirmTime" width="160"></sa-td>
  46. <el-table-column label="操作" fixed="right" width="200px" v-if="currentCustomerId=='1'">
  47. <template slot-scope="s">
  48. <el-button v-if="s.row.pickTime&&!s.row.confirmTime" class="c-btn" type="success" icon="el-icon-edit" @click="confirmFn(s.row)">确认
  49. </el-button>
  50. </template>
  51. </el-table-column>
  52. </el-table>
  53. <!-- ------------- 分页 ------------- -->
  54. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
  55. </sa-item>
  56. </div>
  57. <el-dialog title="提示" :visible.sync="confirm.visible" width="30%">
  58. <span>是否进行接单确认?</span>
  59. <span slot="footer" class="dialog-footer">
  60. <el-button @click="confirm.visible = false">取 消</el-button>
  61. <el-button type="primary" @click="sureConfirm">确 定</el-button>
  62. </span>
  63. </el-dialog>
  64. </div>
  65. <script>
  66. var app = new Vue({
  67. components: {
  68. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  69. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  70. },
  71. el: '.vue-box',
  72. data: {
  73. p: { // 查询参数
  74. id: '', // 主键
  75. itemName: '', // 项目名称
  76. pageNo: 1, // 当前页
  77. pageSize: 10, // 页大小
  78. sortType: 10 // 排序方式
  79. },
  80. dataCount: 0,
  81. dataList: [], // 数据集合
  82. currentCustomerId: '1',
  83. confirm: {
  84. visible: false,
  85. form: {
  86. id: ''
  87. }
  88. }
  89. },
  90. methods: {
  91. confirmFn(data) {
  92. Object.assign(this.confirm, {
  93. visible: true,
  94. form: {
  95. id: data.id
  96. }
  97. })
  98. },
  99. sureConfirm() {
  100. sa.ajax('/TbBusinessItem/confirm',{id:this.confirm.form.id}, function(resp) {
  101. this.confirm.visible = false;
  102. this.f5();
  103. }.bind(this));
  104. },
  105. getCustomer() {
  106. sa.ajax('/TbCostomer/getCurrentCustomerId', function(resp) {
  107. this.currentCustomerId = resp.data;
  108. }.bind(this));
  109. },
  110. // 刷新
  111. f5: function() {
  112. sa.ajax('/TbBusinessItem/getList', sa.removeNull(this.p), function(res) {
  113. this.dataList = res.data; // 数据
  114. this.dataCount = res.dataCount; // 数据总数
  115. sa.f5TableHeight(); // 刷新表格高度
  116. }.bind(this));
  117. },
  118. // 查看
  119. get: function(data) {
  120. sa.showIframe('数据详情', 'tb-business-item-info.html?id=' + data.id, '1050px', '90%');
  121. },
  122. // 查看 - 根据选中的
  123. getBySelect: function(data) {
  124. var selection = this.$refs['data-table'].selection;
  125. if (selection.length == 0) {
  126. return sa.msg('请选择一条数据')
  127. }
  128. this.get(selection[0]);
  129. },
  130. // 批量删除
  131. deleteByIds: function() {
  132. // 获取选中元素的id列表
  133. let selection = this.$refs['data-table'].selection;
  134. let ids = sa.getArrayField(selection, 'id');
  135. if (selection.length == 0) {
  136. return sa.msg('请至少选择一条数据')
  137. }
  138. // 提交删除
  139. sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
  140. sa.ajax('/TbBusinessItem/deleteByIds', {
  141. ids: ids.join(',')
  142. }, function(res) {
  143. sa.arrayDelete(this.dataList, selection);
  144. sa.ok('删除成功');
  145. sa.f5TableHeight(); // 刷新表格高度
  146. }.bind(this))
  147. }.bind(this));
  148. },
  149. },
  150. created: function() {
  151. this.getCustomer()
  152. this.f5();
  153. sa.onInputEnter();
  154. }
  155. })
  156. </script>
  157. </body>
  158. </html>