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