index.vue 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. <template>
  2. <div class='m-container'>
  3. <h2>
  4. <div class="squrt"></div>问卷管理
  5. </h2>
  6. <div class="m-core">
  7. <el-button type="primary" @click="onQuestionOperation('create')"
  8. v-permission="'organization/add'"
  9. class='newBand'>添加问卷</el-button>
  10. <save-form :inline="true"
  11. @submit="search"
  12. @reset="onReSet"
  13. ref="searchForm"
  14. :model="searchForm">
  15. <el-form-item prop="search">
  16. <el-input
  17. type="text"
  18. clearable
  19. v-model="searchForm.search"
  20. placeholder="问卷编号或编号"
  21. ></el-input>
  22. </el-form-item>
  23. <el-form-item prop="status">
  24. <el-select v-model="searchForm.status"
  25. filterable
  26. placeholder="请选择收费类型"
  27. clearable>
  28. <el-option label="启用" :value="1"></el-option>
  29. <el-option label="停用" :value="0"></el-option>
  30. </el-select>
  31. </el-form-item>
  32. <el-form-item>
  33. <el-button type="danger" native-type="submit">搜索</el-button>
  34. <el-button native-type="reset" type="primary">重置</el-button>
  35. </el-form-item>
  36. </save-form>
  37. <!-- 列表 -->
  38. <div class="tableWrap">
  39. <el-table :data='tableList'
  40. :header-cell-style="{background:'#EDEEF0',color:'#444'}">
  41. <el-table-column align='center'
  42. prop="id"
  43. label="问卷编号">
  44. </el-table-column>
  45. <el-table-column align='center'
  46. prop="name"
  47. label="问卷名称">
  48. </el-table-column>
  49. <el-table-column align='center'
  50. prop="areaName"
  51. label="状态">
  52. </el-table-column>
  53. <el-table-column align='center'
  54. label="操作">
  55. <template slot-scope="scope">
  56. <el-button @click="onQuestionOperation('update', scope.row)"
  57. v-permission="'organization/update'"
  58. type="text">修改</el-button>
  59. </template>
  60. </el-table-column>
  61. </el-table>
  62. <pagination sync :total.sync="pageInfo.total"
  63. :page.sync="pageInfo.page"
  64. :limit.sync="pageInfo.limit"
  65. :page-sizes="pageInfo.page_size"
  66. @pagination="getList" />
  67. </div>
  68. </div>
  69. </div>
  70. </template>
  71. <script>
  72. import pagination from '@/components/Pagination/index'
  73. import { branchQueryPage, areaQueryChild, branchAdd, branchUpdate, getParentArea } from '@/api/specialSetting'
  74. export default {
  75. name: 'branchSetting',
  76. components: { pagination },
  77. data () {
  78. return {
  79. searchForm: {
  80. search: null,
  81. status: null
  82. },
  83. tableList: [],
  84. pageInfo: {
  85. // 分页规则
  86. limit: 10, // 限制显示条数
  87. page: 1, // 当前页
  88. total: 0, // 总条数
  89. page_size: [10, 20, 40, 50] // 选择限制显示条数
  90. },
  91. organId: null,
  92. }
  93. },
  94. mounted () {
  95. this.getList()
  96. },
  97. methods: {
  98. getList () {
  99. branchQueryPage({
  100. rows: this.pageInfo.limit,
  101. page: this.pageInfo.page
  102. }).then(res => {
  103. if (res.code == 200 && res.data) {
  104. this.tableList = res.data.rows
  105. this.pageInfo.total = res.data.total
  106. }
  107. })
  108. },
  109. onQuestionOperation(type) {
  110. let str = '问卷'
  111. str = (type == 'create' ? '添加' : '修改') + str
  112. this.$router.push({
  113. path: '/operateManager/questionOperation',
  114. query: {
  115. type
  116. }
  117. }, (router) => {
  118. router.meta.title = str;
  119. })
  120. },
  121. search() {
  122. this.pageInfo.page = 1;
  123. this.getList();
  124. },
  125. onReSet() {
  126. this.$refs['searchForm'].resetFields();
  127. this.search();
  128. },
  129. }
  130. }
  131. </script>
  132. <style lang="scss" scoped>
  133. /deep/.el-button--primary {
  134. background: #14928a;
  135. border-color: #14928a;
  136. color: #fff;
  137. &:hover,
  138. &:active,
  139. &:focus {
  140. background: #14928a;
  141. border-color: #14928a;
  142. color: #fff;
  143. }
  144. }
  145. /deep/.el-date-editor.el-input {
  146. width: 100% !important;
  147. }
  148. /deep/.el-select {
  149. width: 98% !important;
  150. }
  151. </style>