tb-car-weight-list.html 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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.carNo"></sa-item>
  25. <sa-item type="text" name="编号" v-model="p.no"></sa-item>
  26. <sa-item type="text" name="结算公司" v-model="p.companyName"></sa-item>
  27. <div class="c-item">
  28. <label class="c-label">日期范围:</label>
  29. <el-date-picker size="mini" v-model="selectTime" type="daterange" unlink-panels="false"
  30. range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
  31. format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd">
  32. </el-date-picker>
  33. </div>
  34. <el-button type="primary" @click="p.pageNo = 1; f5()">查询</el-button>
  35. <el-button type="info" @click="sa.f5()">重置</el-button>
  36. </el-form>
  37. <!-- ------------- 快捷按钮 ------------- -->
  38. <!-- <sa-item type="fast-btn" show="add,get,delete,export,reset"></sa-item> -->
  39. <!-- ------------- 数据列表 ------------- -->
  40. <el-table class="data-table" ref="data-table" :data="dataList">
  41. <sa-td type="index" name="序号"></sa-td>
  42. <sa-td name="编号" prop="no" width="150"></sa-td>
  43. <sa-td name="车牌号" prop="carNo"></sa-td>
  44. <sa-td name="货物" prop="goodsName"></sa-td>
  45. <sa-td name="入场时间" prop="inTime" width="160"></sa-td>
  46. <sa-td name="出场时间" prop="outTime" width="160"></sa-td>
  47. <sa-td name="过磅时间" prop="createTime" width="160"></sa-td>
  48. <sa-td name="车身重量(吨)" prop="carWeight" width="100"></sa-td>
  49. <sa-td name="货物重量(吨)" prop="goodsWeight" width="100"></sa-td>
  50. <sa-td name="总重量(吨)" prop="totalWeight" width="100"></sa-td>
  51. <sa-td name="通道名称" prop="channelName" width="160"></sa-td>
  52. <sa-td name="结算公司" prop="companyName"></sa-td>
  53. <sa-td name="过磅员" prop="weightPerson"></sa-td>
  54. <sa-td name="复核员" prop="fuhePerson"></sa-td>
  55. <el-table-column label="操作" fixed="right" width="240px">
  56. <template slot-scope="s">
  57. <el-button class="c-btn" type="success" @click="get(s.row)">查看</el-button>
  58. <el-button class="c-btn" type="success" @click="printFn(s.row)"
  59. v-if="sa.isAuth('tb-car-weight-print')">打印</el-button>
  60. <el-button class="c-btn" type="primary" @click="update(s.row)"
  61. v-if="sa.isAuth('tb-car-weight-edit')">修改</el-button>
  62. <el-button class="c-btn" type="danger" @click="del(s.row)"
  63. v-if="sa.isAuth('tb-car-weight-del')">删除</el-button>
  64. </template>
  65. </el-table-column>
  66. </el-table>
  67. <!-- ------------- 分页 ------------- -->
  68. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount"
  69. @change="f5()"></sa-item>
  70. </div>
  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. selectTime: [],
  81. p: { // 查询参数
  82. id: '', //
  83. no: '', // 编号
  84. carNo: '', // 车牌号
  85. inTime: '', // 入场时间
  86. outTime: '', // 出场时间
  87. carWeight: '', // 车身重量
  88. goodsWeight: '', // 货物重量
  89. totalWeight: '', // 总重量
  90. image: '', // 图片
  91. channelName: '', // 通道名称
  92. companyName: '', // 结算公司
  93. weightTime: '', // 过磅时间
  94. createTime: '', // 创建时间
  95. weightPerson: '', // 过磅员
  96. goodsName: '', // 货物
  97. pageNo: 1, // 当前页
  98. pageSize: 10, // 页大小
  99. sortType: 0 // 排序方式
  100. },
  101. dataCount: 0,
  102. dataList: [], // 数据集合
  103. },
  104. methods: {
  105. printFn(data) {
  106. sa.showIframe('打印', 'tb-print.html?id=' + data.id, '90%', '700px');
  107. },
  108. // 刷新
  109. f5: function() {
  110. let selectTime = this.selectTime;
  111. if (selectTime.length > 0) {
  112. this.p.startTime = selectTime[0];
  113. this.p.endTime = selectTime[1];
  114. }else{
  115. this.p.startTime = '';
  116. this.p.endTime = '';
  117. }
  118. sa.ajax('/TbCarWeight/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-car-weight-info.html?id=' + data.id, '780px', '80%');
  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. update: function(data) {
  138. sa.showIframe('修改数据', 'tb-car-weight-add.html?id=' + data.id, '1000px', '90%');
  139. },
  140. // 新增
  141. add: function(data) {
  142. sa.showIframe('新增数据', 'tb-car-weight-add.html?id=-1', '1000px', '90%');
  143. },
  144. // 删除
  145. del: function(data) {
  146. sa.confirm('是否删除,此操作不可撤销', function() {
  147. sa.ajax('/TbCarWeight/delete?id=' + data.id, function(res) {
  148. sa.arrayDelete(this.dataList, data);
  149. sa.ok('删除成功');
  150. sa.f5TableHeight(); // 刷新表格高度
  151. }.bind(this))
  152. }.bind(this));
  153. },
  154. // 批量删除
  155. deleteByIds: function() {
  156. // 获取选中元素的id列表
  157. let selection = this.$refs['data-table'].selection;
  158. let ids = sa.getArrayField(selection, 'id');
  159. if (selection.length == 0) {
  160. return sa.msg('请至少选择一条数据')
  161. }
  162. // 提交删除
  163. sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
  164. sa.ajax('/TbCarWeight/deleteByIds', {
  165. ids: ids.join(',')
  166. }, function(res) {
  167. sa.arrayDelete(this.dataList, selection);
  168. sa.ok('删除成功');
  169. sa.f5TableHeight(); // 刷新表格高度
  170. }.bind(this))
  171. }.bind(this));
  172. },
  173. },
  174. created: function() {
  175. this.f5();
  176. sa.onInputEnter();
  177. }
  178. })
  179. </script>
  180. </body>
  181. </html>