tb-freight-template-list.html 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>车型运费模板-列表</title>
  5. <meta charset="utf-8">
  6. <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
  7. <!-- 所有的 css & js 资源 -->
  8. <link rel="stylesheet" href="../../static/kj/element-ui/theme-chalk/index.css">
  9. <link rel="stylesheet" href="../../static/sa.css">
  10. <script src="../../static/kj/vue.min.js"></script>
  11. <script src="../../static/kj/element-ui/index.js"></script>
  12. <script src="../../static/kj/httpVueLoader.js"></script>
  13. <script src="../../static/kj/jquery.min.js"></script>
  14. <script src="../../static/kj/layer/layer.js"></script>
  15. <script src="../../static/sa.js"></script>
  16. </head>
  17. <body>
  18. <div class="vue-box" style="display: none;" :style="'display: block;'">
  19. <div class="c-panel">
  20. <!-- ------------- 检索参数 ------------- -->
  21. <el-form ref="form" :model='p' @submit.native.prevent>
  22. <sa-item type="text" name="车型" v-model="p.vechileTypeId" width="40" br>
  23. <el-select v-model="p.vechileTypeId" placeholder="请选择" filterable size="mini">
  24. <el-option v-for="(item,index) in catList" :key="item.id" :label="item.dictName" :value="item.id"> </el-option>
  25. </el-select>
  26. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  27. <el-button size="mini" type="info" @click="sa.f5()">重置</el-button>
  28. </sa-item>
  29. </el-form>
  30. <div class="fast-btn">
  31. <el-button v-if="sa.isAuth('tb-freight-template-add')" size="mini" type="primary" @click="add()">新增</el-button>
  32. <!--<el-button size="mini" type="success" @click="getBySelect()">查看</el-button>-->
  33. </div>
  34. <!-- ------------- 数据列表 ------------- -->
  35. <el-table class="data-table" ref="data-table" :data="dataList" >
  36. <sa-td name="车型" prop="vechileTypeName" ></sa-td>
  37. <sa-td name="每公里单价" prop="unitPrice" ></sa-td>
  38. <sa-td name="备注" prop="remark" ></sa-td>
  39. <sa-td name="更新人" prop="updateBy" ></sa-td>
  40. <sa-td name="更新时间" prop="updateTime" ></sa-td>
  41. <el-table-column label="操作" fixed="right" width="180px">
  42. <template slot-scope="s">
  43. <!--<el-button class="c-btn" type="success" icon="el-icon-view" @click="get(s.row)">查看</el-button>-->
  44. <el-button v-if="sa.isAuth('tb-freight-template-edit')" class="c-btn" type="primary" icon="el-icon-edit" @click="update(s.row)">修改</el-button>
  45. <el-button v-if="sa.isAuth('tb-freight-template-del')" class="c-btn" type="danger" icon="el-icon-delete" @click="del(s.row)">删除</el-button>
  46. </template>
  47. </el-table-column>
  48. </el-table>
  49. <!-- ------------- 分页 ------------- -->
  50. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()"></sa-item>
  51. </div>
  52. </div>
  53. <script>
  54. var app = new Vue({
  55. components: {
  56. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  57. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  58. },
  59. el: '.vue-box',
  60. data: {
  61. p: { // 查询参数
  62. id: '', // ID
  63. vechileTypeId: '', // 字典 ID
  64. vechileTypeName: '', // 车型名称
  65. unitPrice: '', // 每公里单价
  66. remark: '', // 备注
  67. pageNo: 1, // 当前页
  68. pageSize: 10, // 页大小
  69. sortType: 0 // 排序方式
  70. },
  71. dataCount: 0,
  72. dataList: [], // 数据集合
  73. catList:[],
  74. },
  75. methods: {
  76. // 车型列表
  77. getCatList() {
  78. sa.ajax('/transport-server/TbDictInfo/getList', {
  79. code:'vehicle_type',
  80. pageSize: 100,
  81. pageNo: 1
  82. }, function(resp) {
  83. let list=resp.data;
  84. this.catList = list;
  85. }.bind(this));
  86. },
  87. // 刷新
  88. f5: function() {
  89. sa.ajax('/transport-server/TbFreightTemplate/getList', sa.removeNull(this.p), function(res) {
  90. this.dataList = res.data; // 数据
  91. this.dataCount = res.dataCount; // 数据总数
  92. sa.f5TableHeight(); // 刷新表格高度
  93. }.bind(this));
  94. },
  95. // 查看
  96. get: function(data) {
  97. sa.showIframe('运费模板详情', 'tb-freight-template-info.html?id=' + data.id, '500px', '400px');
  98. },
  99. // 查看 - 根据选中的
  100. getBySelect: function(data) {
  101. var selection = this.$refs['data-table'].selection;
  102. if(selection.length == 0) {
  103. return sa.msg('请选择一条数据')
  104. }
  105. this.get(selection[0]);
  106. },
  107. // 修改
  108. update: function(data) {
  109. sa.showIframe('修改运费模板', 'tb-freight-template-add.html?id=' + data.id, '500px', '400px');
  110. },
  111. // 新增
  112. add: function(data) {
  113. sa.showIframe('添加运费模板', 'tb-freight-template-add.html?id=-1', '500px', '400px');
  114. },
  115. // 删除
  116. del: function(data) {
  117. sa.confirm('此操作不可撤销,确定要删除该模板吗?', function() {
  118. sa.ajax('/transport-server/TbFreightTemplate/delete?id=' + data.id, function(res) {
  119. sa.arrayDelete(this.dataList, data);
  120. sa.ok('删除成功');
  121. sa.f5TableHeight(); // 刷新表格高度
  122. }.bind(this))
  123. }.bind(this));
  124. },
  125. // 批量删除
  126. deleteByIds: function() {
  127. // 获取选中元素的id列表
  128. let selection = this.$refs['data-table'].selection;
  129. let ids = sa.getArrayField(selection, 'id');
  130. if(selection.length == 0) {
  131. return sa.msg('请至少选择一条数据')
  132. }
  133. // 提交删除
  134. sa.confirm('此操作不可撤销,是否批量删除选中数据?', function() {
  135. sa.ajax('/transport-server/TbFreightTemplate/deleteByIds', {ids: ids.join(',')}, function(res) {
  136. sa.arrayDelete(this.dataList, selection);
  137. sa.ok('删除成功');
  138. sa.f5TableHeight(); // 刷新表格高度
  139. }.bind(this))
  140. }.bind(this));
  141. },
  142. },
  143. created: function() {
  144. this.getCatList();
  145. this.f5();
  146. sa.onInputEnter();
  147. }
  148. })
  149. </script>
  150. </body>
  151. </html>