tb-deduction-bind-list.html 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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="https://unpkg.com/element-ui@2.13.0/lib/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. <style type="text/css">
  18. .data-table > .el-table__header-wrapper > table > thead > tr > th:first-child > div {
  19. display: none!important;
  20. }
  21. </style>
  22. </head>
  23. <body>
  24. <div class="vue-box" style="display: none;" :style="'display: block;'">
  25. <div class="c-panel">
  26. <!-- ------------- 检索参数 ------------- -->
  27. <div class="c-title">检索参数</div>
  28. <el-form ref="form" :model='p' @submit.native.prevent>
  29. <sa-item type="text" name="客户名称" v-model="p.customerName"></sa-item>
  30. <sa-item type="text" name="绑定操作人" v-model="p.createBy"></sa-item>
  31. <sa-item type="text" name="解绑操作人" v-model="p.updateBy"></sa-item>
  32. <sa-item type="text" name="绑定时间" >
  33. <el-date-picker
  34. v-model="p.bindTime"
  35. type="daterange"
  36. align="right"
  37. unlink-panels
  38. value-format="yyyy-MM-dd"
  39. range-separator="至"
  40. start-placeholder="开始日期"
  41. end-placeholder="结束日期"
  42. :picker-options="pickerOptions">
  43. </el-date-picker>
  44. </sa-item>
  45. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  46. <br/>
  47. </el-form>
  48. <!-- ------------- 快捷按钮 ------------- -->
  49. <sa-item type="fast-btn">
  50. <el-button type="primary" class="c-btn" icon="el-icon-plus"
  51. v-if="sa.isAuth('tb-deduction-bind-list-bind')" @click="add">绑定车辆</el-button>
  52. </sa-item>
  53. <!-- ------------- 数据列表 ------------- -->
  54. <el-table class="data-table" ref="data-table" :data="dataList" @select="selectRow" @row-click="handleRowClick">
  55. <sa-td type="selection"></sa-td>
  56. <sa-td name="主键" prop="id" v-if="false"></sa-td>
  57. <sa-td name="客户名称" prop="customerName"></sa-td>
  58. <sa-td name="扣除金额" prop="deductMoney"></sa-td>
  59. <sa-td name="绑定车辆" prop="bindCar"></sa-td>
  60. <sa-td name="绑定时间" prop="bindTime"></sa-td>
  61. <sa-td name="解绑时间" prop="unbindTime"></sa-td>
  62. <sa-td name="绑定创建人" prop="createBy"></sa-td>
  63. <sa-td name="创建时间" prop="createTime"></sa-td>
  64. <sa-td name="解绑更新人" prop="updateBy"></sa-td>
  65. <sa-td name="更新时间" prop="updateTime"></sa-td>
  66. <sa-td name="扣款失败提示" prop="feeFailRecord" width="200" height="20"></sa-td>
  67. <el-table-column label="操作" fixed="right" width="240px">
  68. <template slot-scope="s">
  69. <el-button class="c-btn" type="primary" icon="el-icon-edit" v-if="!s.row.unbindTime&&sa.isAuth('tb-deduction-bind-list-unbind')"
  70. @click="unbind(s.row)">手动解绑</el-button>
  71. </template>
  72. </el-table-column>
  73. </el-table>
  74. <!-- ------------- 分页 ------------- -->
  75. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
  76. </div>
  77. </div>
  78. <script>
  79. var app = new Vue({
  80. components: {
  81. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  82. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  83. },
  84. el: '.vue-box',
  85. data: {
  86. p: { // 查询参数
  87. id: '', // 主键
  88. customerId: '', // 客户id
  89. customerName: '', // 客户名称
  90. deductMoney: '', // 扣除金额
  91. bindCar: '', // 绑定车辆
  92. bindTime: undefined, // 绑定时间
  93. unbindTime: undefined, // 解绑时候
  94. createBy: '', // 创建人
  95. createTime: undefined, // 创建时间
  96. updateTime: undefined, // 更新时间
  97. updateBy: '', // 更新人
  98. pageNo: 1, // 当前页
  99. pageSize: 10, // 页大小
  100. sortType: 0 // 排序方式
  101. },
  102. pickerOptions: {
  103. shortcuts: [{
  104. text: '最近一周',
  105. onClick(picker) {
  106. const end = new Date();
  107. const start = new Date();
  108. start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
  109. picker.$emit('pick', [start, end]);
  110. }
  111. }, {
  112. text: '最近一个月',
  113. onClick(picker) {
  114. const end = new Date();
  115. const start = new Date();
  116. start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
  117. picker.$emit('pick', [start, end]);
  118. }
  119. }, {
  120. text: '最近三个月',
  121. onClick(picker) {
  122. const end = new Date();
  123. const start = new Date();
  124. start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
  125. picker.$emit('pick', [start, end]);
  126. }
  127. }]
  128. },
  129. addCustomerId:'',
  130. dataCount: 0,
  131. dataList: [], // 数据集合
  132. },
  133. methods: {
  134. // 刷新
  135. f5: function () {
  136. sa.ajax('/TbDeductionBind/getList', sa.removeNull(this.p), function (res) {
  137. this.dataList = res.data; // 数据
  138. this.dataCount = res.dataCount; // 数据总数
  139. sa.f5TableHeight(); // 刷新表格高度
  140. }.bind(this));
  141. },
  142. // 查看
  143. get: function (data) {
  144. sa.showIframe('数据详情', 'tb-deduction-bind-info.html?id=' + data.id, '1050px', '90%');
  145. },
  146. // 查看 - 根据选中的
  147. getBySelect: function (data) {
  148. var selection = this.$refs['data-table'].selection;
  149. if (selection.length == 0) {
  150. return sa.msg('请选择一条数据')
  151. }
  152. this.get(selection[0]);
  153. },
  154. // 手动解绑
  155. unbind: function (data) {
  156. if(!data.id || data.id=="null" || data.id=="undefined"){
  157. sa.error2("没有车辆绑定信息!")
  158. return;
  159. }
  160. sa.showIframe('修改数据', 'tb-deduction-bind-unbind.html?id=' + data.id, '700px', '70%');
  161. },
  162. // 车辆绑定
  163. add: function (data) {
  164. sa.showIframe('车辆绑定', 'tb-deduction-bind-add.html', '1000px', '90%');
  165. },
  166. // 删除
  167. del: function (data) {
  168. sa.confirm('是否删除,此操作不可撤销', function () {
  169. sa.ajax('/TbDeductionBind/delete?id=' + data.id, function (res) {
  170. sa.arrayDelete(this.dataList, data);
  171. sa.ok('删除成功');
  172. sa.f5TableHeight(); // 刷新表格高度
  173. }.bind(this))
  174. }.bind(this));
  175. },
  176. // 批量删除
  177. deleteByIds: function () {
  178. // 获取选中元素的id列表
  179. let selection = this.$refs['data-table'].selection;
  180. let ids = sa.getArrayField(selection, 'id');
  181. if (selection.length == 0) {
  182. return sa.msg('请至少选择一条数据')
  183. }
  184. // 提交删除
  185. sa.confirm('是否批量删除选中数据?此操作不可撤销', function () {
  186. sa.ajax('/TbDeductionBind/deleteByIds', {ids: ids.join(',')}, function (res) {
  187. sa.arrayDelete(this.dataList, selection);
  188. sa.ok('删除成功');
  189. sa.f5TableHeight(); // 刷新表格高度
  190. }.bind(this))
  191. }.bind(this));
  192. },
  193. selectRow(val, row) {
  194. this.$refs['data-table'].clearSelection();
  195. this.$refs['data-table'].toggleRowSelection(row, true);
  196. this.addCustomerId = row.customerId;
  197. },
  198. handleRowClick(row, column, event) {
  199. this.selectRow(null,row);
  200. }
  201. },
  202. created: function () {
  203. this.f5();
  204. sa.onInputEnter();
  205. }
  206. })
  207. </script>
  208. </body>
  209. </html>
  210. <script>
  211. import Style from "../../../app/uview-ui/libs/mixin/style";
  212. export default {
  213. components: {Style}
  214. }
  215. </script>