tb-business-pick-list.html 6.5 KB

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