index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  1. <!-- 考试安排 -->
  2. <template>
  3. <div class="app-container examinationArrange">
  4. <div class="page-container examinationArrangePage" v-if="pageType === 1">
  5. <div class="page-form-title-box">
  6. <el-form :model="queryParams" class="form-box" ref="queryForm"
  7. :inline="true" style="width:100%;">
  8. <el-form-item label="" prop="queryParamsData1">
  9. <el-select v-model="queryParams.queryParamsData1" placeholder="是否共享" style="width: 120px">
  10. <el-option label="共享" value="1"/>
  11. <el-option label="不共享" value="2"/>
  12. </el-select>
  13. </el-form-item>
  14. <el-form-item label="" prop="queryParamsData2">
  15. <el-select v-model="queryParams.queryParamsData2" placeholder="专业类别" style="width: 140px">
  16. <el-option
  17. v-for="dict in optionListA"
  18. :key="dict.id"
  19. :label="dict.disciplineName"
  20. :value="dict.id"
  21. />
  22. </el-select>
  23. </el-form-item>
  24. <el-form-item label="" prop="queryParamsData3">
  25. <el-select v-model="queryParams.queryParamsData3" placeholder="考试类别" style="width: 140px">
  26. <el-option
  27. v-for="dict in optionListB"
  28. :key="dict.id"
  29. :label="dict.examTypeName"
  30. :value="dict.id"
  31. />
  32. </el-select>
  33. </el-form-item>
  34. <el-form-item label="" prop="queryParamsData4">
  35. <el-select v-model="queryParams.queryParamsData4" placeholder="学院单位" style="width: 160px">
  36. <el-option
  37. v-for="dict in optionListC"
  38. :key="dict.deptId"
  39. :label="dict.deptName"
  40. :value="dict.deptId"
  41. />
  42. </el-select>
  43. </el-form-item>
  44. <el-form-item label="" prop="queryParamsData5">
  45. <el-select v-model="queryParams.queryParamsData5" placeholder="状态" style="width: 120px">
  46. <el-option label="进行中" value="1"/>
  47. <el-option label="已结束" value="2"/>
  48. </el-select>
  49. </el-form-item>
  50. <el-form-item label="" prop="queryParamsData6">
  51. <el-select v-model="queryParams.queryParamsData6" placeholder="是否补考" style="width: 140px">
  52. <el-option label="补考" value="1"/>
  53. <el-option label="不补考" value="2"/>
  54. </el-select>
  55. </el-form-item>
  56. <el-form-item label="" prop="queryParamsData7">
  57. <el-input
  58. maxLength="30"
  59. v-model="queryParams.queryParamsData7"
  60. placeholder="考试名称"
  61. style="width: 140px"
  62. />
  63. </el-form-item>
  64. <el-form-item label="" prop="state">
  65. <el-date-picker
  66. :clearable="false"
  67. v-model="dateRange"
  68. size="small"
  69. style="width: 220px"
  70. value-format="yyyy-MM-dd"
  71. type="daterange"
  72. range-separator="-"
  73. start-placeholder="开始日期"
  74. end-placeholder="结束日期"
  75. ></el-date-picker>
  76. </el-form-item>
  77. <p class="page-inquire-common-style-button" @click="handleQuery">查询</p>
  78. <p class="page-reset-common-style-button" @click="resetQuery">重置</p>
  79. <p class="page-submit-common-style-button"
  80. style="float: right;"
  81. @click="tableButton(1)"
  82. >新建考试</p>
  83. </el-form>
  84. </div>
  85. <div class="page-content-box">
  86. <el-table class="table-box" v-loading="loading" border :data="dataList">
  87. <el-table-column label="考试名称" prop="name" show-overflow-tooltip/>
  88. <el-table-column label="考试类型" prop="content" width="140" show-overflow-tooltip/>
  89. <el-table-column label="专业类别" prop="content" width="140" show-overflow-tooltip/>
  90. <el-table-column label="是否共享" prop="content" width="120" show-overflow-tooltip/>
  91. <el-table-column label="考试时间" prop="createTime" width="200" show-overflow-tooltip>
  92. <template slot-scope="scope">
  93. <span>{{parseTime(scope.row.createTime,"{y}-{m}-{d} {h}:{i}")}}至{{parseTime(scope.row.createTime,"{y}-{m}-{d} {h}:{i}")}}</span>
  94. </template>
  95. </el-table-column>
  96. <el-table-column label="可考次数" prop="content" width="120" show-overflow-tooltip/>
  97. <el-table-column label="考试范围" prop="content" width="140" show-overflow-tooltip/>
  98. <el-table-column label="状态" prop="content" width="200" show-overflow-tooltip/>
  99. <el-table-column label="操作" width="200" show-overflow-tooltip>
  100. <template slot-scope="scope">
  101. <div class="table-button-box">
  102. <p class="table-button-null"></p>
  103. <p class="table-button-p"
  104. @click="tableButton(2,scope.row)"
  105. >补考</p>
  106. <p class="table-button-p"
  107. @click="tableButton(3,scope.row)"
  108. >编辑</p>
  109. <p class="table-button-p"
  110. @click="tableButton(2,scope.row)"
  111. >复制</p>
  112. <p class="table-button-p"
  113. @click="tableButton(4,scope.row)"
  114. >删除</p>
  115. <p class="table-button-null"></p>
  116. </div>
  117. </template>
  118. </el-table-column>
  119. </el-table>
  120. <pagination :page-sizes="[20, 30, 40, 50]"
  121. v-show="total>0"
  122. :total="total"
  123. :page.sync="queryParams.page"
  124. :limit.sync="queryParams.pageSize"
  125. @pagination="getList"
  126. />
  127. </div>
  128. </div>
  129. <add-page :propsData="propsData" v-if="pageType === 2"></add-page>
  130. </div>
  131. </template>
  132. <script>
  133. //import { getDicts } from "@/api/commonality/noPermission";
  134. //import { systemUserSelect } from "@/api/commonality/permission";
  135. //import { getInfo } from "@/api/basicsModules/index";
  136. import addPage from "./addPage.vue";
  137. import { examElDisciplineTypeList,examElExamTypeList,systemDeptCurrentDept, } from "@/api/safetyEducationExaminationNew/index";
  138. export default {
  139. name: 'index',
  140. components: {
  141. addPage
  142. },
  143. data () {
  144. return {
  145. tableButtonType:this.hasPermiDom(['demo:demo:detail','demo:demo:edit','demo:demo:del',]),
  146. //页面状态
  147. pageType:1,
  148. //页面遮罩
  149. loading:false,
  150. //下拉列表数据
  151. optionListA:[],
  152. optionListB:[],
  153. optionListC:[],
  154. //查询条件
  155. queryParams:{
  156. page:1,
  157. pageSize:20,
  158. queryParamsData1 :null,
  159. queryParamsData2 :null,
  160. queryParamsData3 :null,
  161. queryParamsData4 :null,
  162. queryParamsData5 :null,
  163. queryParamsData6 :null,
  164. queryParamsData7:"",
  165. },
  166. //时间数据
  167. dateRange:[],
  168. //列表数据
  169. dataList:[],
  170. //数据数量
  171. total:0,
  172. //组件传参
  173. propsData:{},
  174. }
  175. },
  176. created () {
  177. },
  178. mounted () {
  179. //this.getList();
  180. this.examElDisciplineTypeList();
  181. this.examElExamTypeList();
  182. this.systemDeptCurrentDept();
  183. },
  184. methods: {
  185. //查询按钮
  186. handleQuery(){
  187. this.$set(this.queryParams,'page',1);
  188. this.getList();
  189. },
  190. //重置按钮
  191. resetQuery(){
  192. this.$set(this,'dateRange',[])
  193. this.$set(this,'queryParams',{
  194. page:1,
  195. pageSize:20,
  196. queryParamsData1 :null,
  197. queryParamsData2 :null,
  198. queryParamsData3 :null,
  199. queryParamsData4 :null,
  200. queryParamsData5 :null,
  201. queryParamsData6 :null,
  202. queryParamsData7:"",
  203. });
  204. this.getList();
  205. },
  206. //获取数据列表
  207. getList(){
  208. this.$set(this,'loading',true);
  209. let obj = JSON.parse(JSON.stringify(this.queryParams))
  210. if(this.dateRange[0]){
  211. obj.startTime = this.dateRange[0]+'T00:00:00'
  212. obj.endTime = this.dateRange[1]+'T23:59:59'
  213. }else{
  214. obj.startTime = "";
  215. obj.endTime = "";
  216. }
  217. getListFunction(obj).then(response => {
  218. this.$set(this,'loading',false);
  219. this.$set(this,'dataList',response.data.records);
  220. this.$set(this,'total',response.data.total);
  221. });
  222. },
  223. //操作按钮
  224. tableButton(type,row){
  225. let self = this;
  226. if(type == 1){
  227. //新增
  228. this.$set(this,'pageType',2);
  229. this.$set(this,'propsData',{});
  230. }else if(type == 2){
  231. //详情
  232. this.$set(this,'pageType',2);
  233. let obj = JSON.parse(JSON.stringify(row))
  234. obj.showType = true;
  235. this.$set(this,'propsData',obj);
  236. }else if(type == 3){
  237. //编辑
  238. this.$set(this,'pageType',2);
  239. let obj = JSON.parse(JSON.stringify(row))
  240. obj.showType = false;
  241. this.$set(this,'propsData',obj);
  242. }else if(type == 4){
  243. //删除
  244. this.$confirm('是否确认删除?', "警告", {
  245. confirmButtonText: "确定",
  246. cancelButtonText: "取消",
  247. type: "warning"
  248. }).then(function() {
  249. }).then(() => {
  250. deleteFunction({id:row.id}).then(response => {
  251. self.msgSuccess(response.message)
  252. self.getList();
  253. });
  254. }).catch(() => {});
  255. }else if(type == 5){
  256. //启用&停用
  257. let text = row.state ? "停用" : "启用";
  258. this.$confirm('是否确认' + text + '?', "警告", {
  259. confirmButtonText: "确定",
  260. cancelButtonText: "取消",
  261. type: "warning"
  262. }).then(function() {
  263. }).then(() => {
  264. stateFunction({id:row.id,state:!row.state,}).then(response => {
  265. self.msgSuccess(response.message)
  266. self.getList();
  267. });
  268. }).catch(() => {});
  269. }else if(type == 6){
  270. //返回并刷新
  271. this.$set(this,'pageType',1);
  272. this.getList();
  273. }
  274. },
  275. //查询全部专业类别
  276. examElDisciplineTypeList(){
  277. examElDisciplineTypeList({}).then(response => {
  278. this.$set(this,'optionListA',response.data);
  279. });
  280. },
  281. //查询全部考试类型
  282. examElExamTypeList(){
  283. examElExamTypeList({}).then(response => {
  284. this.$set(this,'optionListB',response.data);
  285. });
  286. },
  287. //学院列表
  288. systemDeptCurrentDept(){
  289. systemDeptCurrentDept({}).then(response => {
  290. this.$set(this,'optionListC',response.data);
  291. });
  292. },
  293. },
  294. }
  295. </script>
  296. <style scoped lang="scss">
  297. .examinationArrange{
  298. .examinationArrangePage{
  299. }
  300. }
  301. </style>