tb-abinet-record.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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.cabinetNo"></sa-item>
  25. <sa-item type="text" name="车牌号" v-model="p.carNo"></sa-item>
  26. <sa-item type="text" name="客户" v-model="p.customerName"></sa-item>
  27. <sa-item type="text" name="合作伙伴" v-model="p.pickCustomerName"></sa-item>
  28. <el-button type="primary" @click="p.pageNo = 1; f5()">查询</el-button>
  29. <el-button type="info" @click="p.pageNo = 1; p.cabinetNo='';p.carNo='';p.customerName='';p.pickCustomerName='';f5()">重置</el-button>
  30. </el-form>
  31. <!-- ------------- 数据列表 ------------- -->
  32. <el-table class="data-table" ref="data-table" :data="dataList">
  33. <sa-td name="序号" type="index"></sa-td>
  34. <sa-td name="柜号" prop="cabinetNo"></sa-td>
  35. <sa-td name="车牌号" prop="cardNo"></sa-td>
  36. <sa-td name="取/存" prop="cabinetType" type="enum" :jv="{0: '存柜', 1:'取柜'}">
  37. </sa-td>
  38. <sa-td name="存柜时间" prop="coldStartTime" width="150"></sa-td>
  39. <sa-td name="取柜时间" prop="coldEndTime" width="150"></sa-td>
  40. <sa-td name="状态" prop="cabinetStatus" type="enum" :jv="{0: '未取柜', 1:'已取柜'}">
  41. </sa-td>
  42. <sa-td name="客户" prop="customerName" width="160"></sa-td>
  43. <sa-td name="合作伙伴" prop="pickCustomerName" width="160"></sa-td>
  44. <sa-td name="录入时间" prop="createTime" width="150"></sa-td>
  45. <sa-td name="单价(元)" prop="itemPrice"></sa-td>
  46. <sa-td name="费用(元)" prop="total"></sa-td>
  47. <sa-td name="支付状态" prop="payStatus" type="enum" :jv="{0: '未支付', 1:'已支付'}">
  48. </sa-td>
  49. <sa-td name="支付时间" prop="payTime" width="150"></sa-td>
  50. </el-table>
  51. <!-- ------------- 分页 ------------- -->
  52. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount"
  53. @change="f5()"></sa-item>
  54. </div>
  55. </div>
  56. <script>
  57. var app = new Vue({
  58. components: {
  59. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  60. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  61. },
  62. el: '.vue-box',
  63. data: {
  64. p: { // 查询参数
  65. id: '', // 主键
  66. carNo: '', // 等级表id
  67. cabinetNo: '', // 项目编号
  68. pickCustomerName:'',
  69. customerName:'',
  70. pageNo: 1, // 当前页
  71. pageSize: 10, // 页大小
  72. sortType: 0 // 排序方式
  73. },
  74. dataCount: 0,
  75. dataList: [], // 数据集合
  76. },
  77. methods: {
  78. // 刷新
  79. f5: function() {
  80. sa.ajax('/TbBusinessItem/getCabinetRecord', sa.removeNull(this.p), function(res) {
  81. this.dataList = res.data; // 数据
  82. this.dataCount = res.dataCount; // 数据总数
  83. sa.f5TableHeight(); // 刷新表格高度
  84. }.bind(this));
  85. },
  86. // 查看
  87. get: function(data) {
  88. sa.showIframe('数据详情', 'tb-business-item-info.html?id=' + data.id, '1050px', '90%');
  89. },
  90. // 查看 - 根据选中的
  91. getBySelect: function(data) {
  92. var selection = this.$refs['data-table'].selection;
  93. if (selection.length == 0) {
  94. return sa.msg('请选择一条数据')
  95. }
  96. this.get(selection[0]);
  97. },
  98. // 修改
  99. update: function(data) {
  100. sa.showIframe('修改数据', 'tb-business-item-add.html?id=' + data.id, '1000px', '90%');
  101. },
  102. // 新增
  103. add: function(data) {
  104. sa.showIframe('新增数据', 'tb-business-item-add.html?id=-1', '1000px', '90%');
  105. },
  106. // 删除
  107. del: function(data) {
  108. sa.confirm('是否删除,此操作不可撤销', function() {
  109. sa.ajax('/TbBusinessItem/delete?id=' + data.id, function(res) {
  110. sa.arrayDelete(this.dataList, data);
  111. sa.ok('删除成功');
  112. sa.f5TableHeight(); // 刷新表格高度
  113. }.bind(this))
  114. }.bind(this));
  115. },
  116. // 批量删除
  117. deleteByIds: function() {
  118. // 获取选中元素的id列表
  119. let selection = this.$refs['data-table'].selection;
  120. let ids = sa.getArrayField(selection, 'id');
  121. if (selection.length == 0) {
  122. return sa.msg('请至少选择一条数据')
  123. }
  124. // 提交删除
  125. sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
  126. sa.ajax('/TbBusinessItem/deleteByIds', {
  127. ids: ids.join(',')
  128. }, function(res) {
  129. sa.arrayDelete(this.dataList, selection);
  130. sa.ok('删除成功');
  131. sa.f5TableHeight(); // 刷新表格高度
  132. }.bind(this))
  133. }.bind(this));
  134. },
  135. },
  136. created: function() {
  137. this.f5();
  138. sa.onInputEnter();
  139. }
  140. })
  141. </script>
  142. </body>
  143. </html>