index.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <template>
  2. <div class="app-container">
  3. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="100px">
  4. <el-form-item label="主办方名称">
  5. <el-input
  6. v-model="queryParams.name"
  7. placeholder="请输入主办方名称"
  8. clearable
  9. style="width: 240px;"
  10. @keyup.enter.native="handleQuery"
  11. />
  12. </el-form-item>
  13. <el-form-item>
  14. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  15. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  16. </el-form-item>
  17. </el-form>
  18. <el-row :gutter="10" class="mb8">
  19. <el-col :span="1.5">
  20. <el-button
  21. type="primary"
  22. plain
  23. icon="el-icon-plus"
  24. size="mini"
  25. @click="handleAdd"
  26. v-hasPermi="['performMr:performMr:add']"
  27. >新增</el-button>
  28. </el-col>
  29. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  30. </el-row>
  31. <el-table ref="tables" v-loading="loading" :data="dataList" border>
  32. <el-table-column label="序号" align="center" type="index" width="50"></el-table-column>
  33. <el-table-column label="主办方名你" align="center" prop="name" />
  34. <el-table-column label="法人" align="center" prop="corporationName" />
  35. <el-table-column label="主办方负责人" align="center" prop="contactName" />
  36. <el-table-column label="负责人联系电话" align="center" prop="contactMobile" />
  37. <el-table-column label="创建时间" align="center" prop="createTime" width="160">
  38. <template slot-scope="scope">
  39. <span>{{ parseTime(scope.row.createTime) }}</span>
  40. </template>
  41. </el-table-column>
  42. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  43. <template slot-scope="scope">
  44. <el-button
  45. size="mini"
  46. type="text"
  47. v-if="scope.row.status != '1'"
  48. @click="handleUpdate(scope.row)"
  49. v-hasPermi="['performMr:performMr:edit']"
  50. >修改</el-button>
  51. <el-button
  52. size="mini"
  53. type="text"
  54. v-if="scope.row.status != '1'"
  55. @click="handleDelete(scope.row,scope.index)"
  56. v-hasPermi="['performMr:performMr:delete']"
  57. >删除</el-button>
  58. </template>
  59. </el-table-column>
  60. </el-table>
  61. <pagination
  62. v-show="total>0"
  63. :total="total"
  64. :page.sync="queryParams.pageNum"
  65. :limit.sync="queryParams.pageSize"
  66. @pagination="getList"
  67. />
  68. <!-- 新增/编辑弹框 -->
  69. <add-and-edit
  70. ref="addAndEdit"
  71. :dict="dict"
  72. @getList="getList"
  73. />
  74. <el-dialog
  75. title="查看"
  76. :visible.sync="visibleStatus"
  77. width="600px"
  78. :destroy-on-close="true"
  79. :close-on-click-modal="false"
  80. >
  81. <div v-if="visibleType == 'img'">
  82. <el-image
  83. style="width: 400px; height: 100%"
  84. :src="newObj.mainImg"
  85. fit="cover"
  86. />
  87. </div>
  88. <div v-if="visibleType == 'html'">
  89. <div v-html="newObj.centent"></div>
  90. </div>
  91. <div slot="footer" class="dialog-footer">
  92. <el-button type="primary" @click="visibleStatus = false">确 定</el-button>
  93. </div>
  94. </el-dialog>
  95. </div>
  96. </template>
  97. <script>
  98. import { pageList, deleteById } from '@/api/performMr/performMr'
  99. import addAndEdit from "./dialog/addAndEdit.vue";
  100. export default {
  101. name: "agreement",
  102. dicts: ['agreement_type'],
  103. components: { addAndEdit },
  104. data() {
  105. return {
  106. // 遮罩层
  107. loading: true,
  108. // 选中数组
  109. ids: [],
  110. // 非单个禁用
  111. single: true,
  112. // 非多个禁用
  113. multiple: true,
  114. // 显示搜索条件
  115. showSearch: true,
  116. // 总条数
  117. total: 0,
  118. // 用户表格数据
  119. dataList: null,
  120. // 弹出层标题
  121. title: "",
  122. // 是否显示弹出层
  123. open: false,
  124. // 日期范围
  125. dateRange: [],
  126. // 查询参数
  127. queryParams: {
  128. pageNum: 1,
  129. pageSize: 10,
  130. type: undefined
  131. },
  132. statusList: [
  133. {id: 1, name: '未发布', value: 0},
  134. {id: 2, name: '发布', value: 1},
  135. {id: 3, name: '下架', value: 2},
  136. ],
  137. visibleStatus: false,
  138. newObj: {},
  139. visibleType: ''
  140. };
  141. },
  142. created() {
  143. this.getList();
  144. },
  145. methods: {
  146. /** 查询列表 */
  147. getList() {
  148. this.loading = true;
  149. pageList(this.addDateRange(this.queryParams, this.dateRange))
  150. .then(response => {
  151. this.dataList = response.data.rows;
  152. this.total = response.data.total;
  153. this.loading = false;
  154. }
  155. );
  156. },
  157. // 取消按钮
  158. cancel() {
  159. this.open = false;
  160. },
  161. /** 搜索按钮操作 */
  162. handleQuery() {
  163. this.queryParams.pageNum = 1;
  164. this.getList();
  165. },
  166. /** 重置按钮操作 */
  167. resetQuery() {
  168. this.dateRange = [];
  169. this.$set(this.queryParams, 'name', '');
  170. this.queryParams.pageNum = 1;
  171. this.handleQuery();
  172. },
  173. // 多选框选中数据
  174. handleSelectionChange(selection) {
  175. this.ids = selection.map(item => item.userId);
  176. this.single = selection.length != 1;
  177. this.multiple = !selection.length;
  178. },
  179. /** 新增按钮操作 */
  180. handleAdd() {
  181. this.$refs["addAndEdit"].openDialog("新增数据", null);
  182. },
  183. /** 修改按钮操作 */
  184. handleUpdate(row) {
  185. this.$refs["addAndEdit"].openDialog("修改数据", row);
  186. },
  187. /** 删除按钮操作 */
  188. handleDelete(row) {
  189. this.$modal.confirm('是否确认删除数据主办方名你为"' + row.name + '"的数据项?').then(function() {
  190. return deleteById(row.id);
  191. }).then(() => {
  192. this.getList();
  193. this.$modal.msgSuccess("删除成功");
  194. }).catch(() => {});
  195. },
  196. /** 查看按钮操作 */
  197. seeCenter(obj, type) {
  198. this.visibleStatus = true
  199. this.visibleType = type;
  200. this.newObj = obj;
  201. }
  202. }
  203. };
  204. </script>