tb-item-list.html 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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.name"></sa-item>
  25. <el-button type="primary" icon="el-icon-search" @click="p.pageNo = 1; f5()">查询</el-button>
  26. <sa-item type="fast-btn" show="reset" style="display: inline;"></sa-item>
  27. <br/>
  28. </el-form>
  29. <!-- ------------- 数据列表 ------------- -->
  30. <el-table class="data-table" ref="data-table" :data="dataList">
  31. <sa-td name="项目名称" prop="name" width="300px"></sa-td>
  32. <!-- <sa-td name="业务类型" prop="businessType">
  33. <template slot-scope="s">
  34. <el-select :disabled="!sa.isAuth('tb-item-list-edit-type')" multiple v-model="s.row.type" placeholder="收费项" @change="businessChange(s.row)">
  35. <el-option v-for="item in businessTypeList" :key="item.value" :value="item.value"
  36. :label="item.name">
  37. </el-option>
  38. </el-select>
  39. </template>
  40. </sa-td> -->
  41. <sa-td name="税率" prop="taxRate"></sa-td>
  42. <!-- <sa-td name="项目编号" prop="code"></sa-td> -->
  43. <sa-td name="收费项" prop="code">
  44. <template slot-scope="s">
  45. <el-select v-if="s.row.items.length>0" v-model="s.row.items[0].id" placeholder="收费项">
  46. <el-option v-for="item in s.row.items" :key="item.id" :value="item.id"
  47. :label="item.itemName+' '+item.price+item.unit">
  48. </el-option>
  49. </el-select>
  50. </template>
  51. </sa-td>
  52. </el-table>
  53. <!-- ------------- 分页 ------------- -->
  54. <sa-item type="page" :curr.sync="p.pageNo" :size.sync="p.pageSize" :total="dataCount" @change="f5()">
  55. </sa-item>
  56. </div>
  57. </div>
  58. <script>
  59. var app = new Vue({
  60. components: {
  61. "sa-item": httpVueLoader('../../sa-frame/com/sa-item.vue'),
  62. "sa-td": httpVueLoader('../../sa-frame/com/sa-td.vue'),
  63. },
  64. el: '.vue-box',
  65. data: {
  66. p: { // 查询参数
  67. id: '', // 主键
  68. name: '', // 项目名称
  69. business: 1,
  70. pageNo: 1, // 当前页
  71. pageSize: 20, // 页大小
  72. sortType: 0 // 排序方式
  73. },
  74. dataCount: 0,
  75. dataList: [], // 数据集合
  76. itemTypeList: [],
  77. businessTypeList: [{
  78. value: '0',
  79. name: '默认'
  80. },
  81. {
  82. value: '1',
  83. name: '消杀'
  84. },
  85. {
  86. value: '2',
  87. name: '装卸'
  88. },
  89. {
  90. value: '3',
  91. name: '核酸'
  92. },
  93. ]
  94. },
  95. methods: {
  96. businessChange(data) {
  97. let obj = {
  98. id: data.id,
  99. businessType: data.type.join(',')
  100. }
  101. sa.ajax('/TbItemType/update', obj, function (res) {
  102. this.f5();
  103. }.bind(this));
  104. },
  105. // 刷新
  106. f5: function () {
  107. sa.ajax('/TbItemType/getList', sa.removeNull(this.p), function (res) {
  108. let list = res.data;
  109. // for(let i in list){
  110. // let obj=list[i];
  111. // obj.type=obj.businessType.split(',')
  112. // }
  113. this.dataList = list; // 数据
  114. this.dataCount = res.dataCount; // 数据总数
  115. sa.f5TableHeight(); // 刷新表格高度
  116. }.bind(this));
  117. },
  118. },
  119. created: function () {
  120. this.f5();
  121. sa.onInputEnter();
  122. }
  123. })
  124. </script>
  125. </body>
  126. </html>