tb-business-item-list.html 5.8 KB

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