tb-business-pick-list.html 8.6 KB

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