tb-car-weight-list.html 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  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" v-if="sa.isAuth('tb-car-weight-hide')">
  28. <label class="c-label">状态:</label>
  29. <el-select v-model="p.limitData" placeholder="请选择" @change="f5()">
  30. <el-option label="全部" :value="-1"></el-option>
  31. <el-option label="公开" :value="1"></el-option>
  32. <el-option label="隐藏" :value="0"></el-option>
  33. </el-select>
  34. </div>
  35. <div class="c-item">
  36. <label class="c-label">日期范围:</label>
  37. <el-date-picker size="mini" v-model="selectTime" type="daterange" unlink-panels="false"
  38. range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"
  39. format="yyyy 年 MM 月 dd 日" value-format="yyyy-MM-dd">
  40. </el-date-picker>
  41. </div>
  42. <el-button type="primary" @click="p.pageNo = 1; f5()">查询</el-button>
  43. <el-button type="info" @click="sa.f5()">重置</el-button>
  44. <el-button type="primary" @click="hideBatch" v-if="sa.isAuth('tb-car-weight-hide')">批量确认</el-button>
  45. </el-form>
  46. <!-- ------------- 快捷按钮 ------------- -->
  47. <!-- <sa-item type="fast-btn" show="add,get,delete,export,reset"></sa-item> -->
  48. <!-- ------------- 数据列表 ------------- -->
  49. <el-table class="data-table" ref="data-table" :data="dataList">
  50. <sa-td type="selection" name="序号"></sa-td>
  51. <sa-td name="编号" prop="no" width="150"></sa-td>
  52. <sa-td name="车牌号" prop="carNo"></sa-td>
  53. <sa-td name="货物" prop="goodsName"></sa-td>
  54. <sa-td name="入场时间" prop="inTime" width="160"></sa-td>
  55. <sa-td name="出场时间" prop="outTime" width="160"></sa-td>
  56. <sa-td name="过磅时间" prop="createTime" width="160"></sa-td>
  57. <sa-td name="车身重量(吨)" prop="carWeight" width="100"></sa-td>
  58. <sa-td name="货物重量(吨)" prop="goodsWeight" width="100"></sa-td>
  59. <sa-td name="总重量(吨)" prop="totalWeight" width="100"></sa-td>
  60. <sa-td name="通道名称" prop="channelName" width="160"></sa-td>
  61. <sa-td name="结算公司" prop="companyName"></sa-td>
  62. <sa-td name="过磅员" prop="weightPerson"></sa-td>
  63. <sa-td name="复核员" prop="fuhePerson"></sa-td>
  64. <el-table-column label="操作" fixed="right" width="240px">
  65. <template slot-scope="s">
  66. <el-button class="c-btn" type="success" @click="get(s.row)">查看</el-button>
  67. <el-button class="c-btn" type="success" @click="printFn(s.row)"
  68. v-if="sa.isAuth('tb-car-weight-print')">打印</el-button>
  69. <el-button class="c-btn" type="primary" @click="update(s.row)"
  70. v-if="sa.isAuth('tb-car-weight-edit')">修改</el-button>
  71. <el-button class="c-btn" type="danger" @click="del(s.row)"
  72. v-if="sa.isAuth('tb-car-weight-del')">删除</el-button>
  73. <el-button class="c-btn" type="primary" @click="showFn(s.row)"
  74. v-if="sa.isAuth('tb-car-weight-hide')&&s.row.limitData==0">确认</el-button>
  75. <!-- <el-button class="c-btn" type="warning" @click="showFn(s.row)"
  76. v-if="sa.isAuth('tb-car-weight-hide')&&s.row.limitData==1">隐藏</el-button> -->
  77. </template>
  78. </el-table-column>
  79. </el-table>
  80. <!-- ------------- 分页 ------------- -->
  81. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount"
  82. @change="f5()"></sa-item>
  83. </div>
  84. </div>
  85. <script>
  86. var app = new Vue({
  87. components: {
  88. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  89. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  90. },
  91. el: '.vue-box',
  92. data: {
  93. selectTime: [],
  94. p: { // 查询参数
  95. id: '', //
  96. no: '', // 编号
  97. carNo: '', // 车牌号
  98. inTime: '', // 入场时间
  99. outTime: '', // 出场时间
  100. carWeight: '', // 车身重量
  101. goodsWeight: '', // 货物重量
  102. totalWeight: '', // 总重量
  103. image: '', // 图片
  104. channelName: '', // 通道名称
  105. companyName: '', // 结算公司
  106. weightTime: '', // 过磅时间
  107. createTime: '', // 创建时间
  108. weightPerson: '', // 过磅员
  109. goodsName: '', // 货物
  110. pageNo: 1, // 当前页
  111. pageSize: 10, // 页大小
  112. sortType: 0 ,// 排序方式
  113. limitData:-1,
  114. },
  115. dataCount: 0,
  116. dataList: [], // 数据集合
  117. },
  118. methods: {
  119. hideBatch(){
  120. // 获取选中元素的id列表
  121. let selection = this.$refs['data-table'].selection;
  122. let ids = sa.getArrayField(selection, 'id');
  123. if (selection.length == 0) {
  124. return sa.msg('请至少选择一条数据')
  125. }
  126. sa.confirm('是否批量确认选中数据?', function() {
  127. sa.ajax('/TbCarWeight/showBatch', {
  128. ids: ids.join(',')
  129. }, function(res) {
  130. sa.ok('确认成功');
  131. this.f5(); // 刷新表格高度
  132. }.bind(this))
  133. }.bind(this));
  134. },
  135. showFn(data) {
  136. sa.confirm('是否确认该记录?', function() {
  137. sa.ajax('/TbCarWeight/showOrHide', {
  138. id: data.id
  139. }, function(res) {
  140. sa.ok('操作成功');
  141. this.f5(); // 刷新表格高度
  142. }.bind(this))
  143. }.bind(this));
  144. },
  145. printFn(data) {
  146. sa.showIframe('打印', 'tb-print.html?id=' + data.id, '90%', '700px');
  147. },
  148. // 刷新
  149. f5: function() {
  150. let selectTime = this.selectTime;
  151. if (selectTime.length > 0) {
  152. this.p.startTime = selectTime[0];
  153. this.p.endTime = selectTime[1];
  154. } else {
  155. this.p.startTime = '';
  156. this.p.endTime = '';
  157. }
  158. sa.ajax('/TbCarWeight/getList', sa.removeNull(this.p), function(res) {
  159. this.dataList = res.data; // 数据
  160. this.dataCount = res.dataCount; // 数据总数
  161. sa.f5TableHeight(); // 刷新表格高度
  162. }.bind(this));
  163. },
  164. // 查看
  165. get: function(data) {
  166. sa.showIframe('数据详情', 'tb-car-weight-info.html?id=' + data.id, '780px', '80%');
  167. },
  168. // 查看 - 根据选中的
  169. getBySelect: function(data) {
  170. var selection = this.$refs['data-table'].selection;
  171. if (selection.length == 0) {
  172. return sa.msg('请选择一条数据')
  173. }
  174. this.get(selection[0]);
  175. },
  176. // 修改
  177. update: function(data) {
  178. sa.showIframe('修改数据', 'tb-car-weight-add.html?id=' + data.id, '1000px', '90%');
  179. },
  180. // 新增
  181. add: function(data) {
  182. sa.showIframe('新增数据', 'tb-car-weight-add.html?id=-1', '1000px', '90%');
  183. },
  184. // 删除
  185. del: function(data) {
  186. sa.confirm('是否删除,此操作不可撤销', function() {
  187. sa.ajax('/TbCarWeight/delete?id=' + data.id, function(res) {
  188. sa.arrayDelete(this.dataList, data);
  189. sa.ok('删除成功');
  190. sa.f5TableHeight(); // 刷新表格高度
  191. }.bind(this))
  192. }.bind(this));
  193. },
  194. // 批量删除
  195. deleteByIds: function() {
  196. // 获取选中元素的id列表
  197. let selection = this.$refs['data-table'].selection;
  198. let ids = sa.getArrayField(selection, 'id');
  199. if (selection.length == 0) {
  200. return sa.msg('请至少选择一条数据')
  201. }
  202. // 提交删除
  203. sa.confirm('是否批量删除选中数据?此操作不可撤销', function() {
  204. sa.ajax('/TbCarWeight/deleteByIds', {
  205. ids: ids.join(',')
  206. }, function(res) {
  207. sa.arrayDelete(this.dataList, selection);
  208. sa.ok('删除成功');
  209. sa.f5TableHeight(); // 刷新表格高度
  210. }.bind(this))
  211. }.bind(this));
  212. },
  213. },
  214. created: function() {
  215. this.f5();
  216. sa.onInputEnter();
  217. }
  218. })
  219. </script>
  220. </body>
  221. </html>