index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. <template>
  2. <div class="app-container">
  3. <el-row :gutter="20">
  4. <!--机构数据-->
  5. <el-col :span="4" :xs="24">
  6. <org-tree v-model="queryParams.orgId" @defaultKey="getDefaultKey" @defaultOrg="getDefaultOrg" @checkChange="checkChange"
  7. @click="clickTreeNode"></org-tree>
  8. </el-col>
  9. <el-col :span="20" :xs="24">
  10. <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
  11. <el-form-item label="调阅周期" prop="cycle">
  12. <el-select v-model="queryParams.cycle" placeholder="请选择周期" clearable>
  13. <el-option
  14. v-for="dict in dict.type.sys_access_cycle"
  15. :key="dict.value"
  16. :label="dict.label"
  17. :value="dict.value"
  18. />
  19. </el-select>
  20. </el-form-item>
  21. <el-form-item label="调阅角色" prop="roleId">
  22. <el-select v-model="queryParams.roleId" placeholder="请选择">
  23. <el-option v-for="item in roleList" :key="item.id" :label="item.name" :value="item.id"></el-option>
  24. </el-select>
  25. </el-form-item>
  26. <el-form-item label="计划时间" prop="planStartTime">
  27. <el-date-picker
  28. v-model="queryParams.dateRange"
  29. style="width: 240px"
  30. value-format="yyyy-MM-dd HH:mm:ss"
  31. type="daterange"
  32. range-separator="-"
  33. start-placeholder="开始日期"
  34. end-placeholder="结束日期"
  35. :default-time="['00:00:00', '23:59:59']"
  36. ></el-date-picker>
  37. </el-form-item>
  38. <el-form-item label="状态" prop="status">
  39. <el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
  40. <el-option
  41. v-for="dict in dict.type.retrieval_task_status"
  42. :key="dict.value"
  43. :label="dict.label"
  44. :value="dict.value"
  45. />
  46. </el-select>
  47. </el-form-item>
  48. <el-form-item label="任务名称" prop="taskName">
  49. <el-input
  50. v-model="queryParams.taskName"
  51. placeholder="请输入任务名称"
  52. clearable
  53. @keyup.enter.native="handleQuery"
  54. />
  55. </el-form-item>
  56. <el-form-item>
  57. <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
  58. <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
  59. </el-form-item>
  60. </el-form>
  61. <el-row :gutter="10" class="mb8">
  62. <el-col :span="1.5">
  63. <el-button
  64. type="primary"
  65. plain
  66. icon="el-icon-download"
  67. size="mini"
  68. @click="handleExport"
  69. v-hasPermi="['core:task:export']"
  70. >导出</el-button>
  71. </el-col>
  72. <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
  73. </el-row>
  74. <el-table v-loading="loading" :data="taskList" border
  75. height="600"
  76. size="small">
  77. <el-table-column label="序号" type="index" align="center">
  78. <template slot-scope="scope">
  79. <span>{{(queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1}}</span>
  80. </template>
  81. </el-table-column>
  82. <el-table-column label="任务名称" align="center" prop="taskName" width="220"/>
  83. <el-table-column label="调阅周期" align="center" prop="cycle" >
  84. <template slot-scope="scope">
  85. <dict-tag :options="dict.type.sys_access_cycle" :value="scope.row.cycle" />
  86. </template>
  87. </el-table-column>
  88. <el-table-column label="开始时间" align="center" prop="planStartTime" width="160">
  89. <!-- <template slot-scope="scope">
  90. <span>{{ parseTime(scope.row.planStartTime, '{y}-{m}-{d}') }}</span>
  91. </template>-->
  92. </el-table-column>
  93. <el-table-column label="结束时间" align="center" prop="planEndTime" width="160">
  94. <!-- <template slot-scope="scope">
  95. <span>{{ parseTime(scope.row.planEndTime, '{y}-{m}-{d}') }}</span>
  96. </template>-->
  97. </el-table-column>
  98. <el-table-column label="状态" align="center" prop="status">
  99. <template slot-scope="scope">
  100. <dict-tag :options="dict.type.retrieval_task_status" :value="scope.row.status"/>
  101. </template>
  102. </el-table-column>
  103. <el-table-column label="调阅机构" align="center" prop="orgName" width="220"/>
  104. <el-table-column label="调阅角色" align="center" prop="roleName" width="160"/>
  105. <el-table-column label="调阅开始时间" align="center" prop="startTime" width="160">
  106. <!-- <template slot-scope="scope">
  107. <span>{{ parseTime(scope.row.startTime, '{y}-{m}-{d}') }}</span>
  108. </template>-->
  109. </el-table-column>
  110. <el-table-column label="调阅结束时间" align="center" prop="endTime" width="160">
  111. <!-- <template slot-scope="scope">
  112. <span>{{ parseTime(scope.row.endTime, '{y}-{m}-{d}') }}</span>
  113. </template>-->
  114. </el-table-column>
  115. <el-table-column label="调阅人" align="center" prop="retrievalUserName" width="140"/>
  116. <el-table-column label="异常数" align="center" prop="exceptionCount" />
  117. <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
  118. <template slot-scope="scope">
  119. <el-button
  120. size="mini"
  121. type="text"
  122. icon="el-icon-view"
  123. @click="lookView(scope.row)"
  124. v-if="scope.row.status == 2"
  125. v-hasPermi="['core:task:query']"
  126. >详情</el-button>
  127. </template>
  128. </el-table-column>
  129. </el-table>
  130. <dialog-info ref="infoDialog" @success="refresh(true)"></dialog-info>
  131. <pagination
  132. v-show="total>0"
  133. :total="total"
  134. :page.sync="queryParams.pageNum"
  135. :limit.sync="queryParams.pageSize"
  136. @pagination="getList"
  137. />
  138. </el-col>
  139. </el-row>
  140. </div>
  141. </template>
  142. <script>
  143. import { listTask, getTask, delTask, addTask, updateTask,roleList,exportExcel } from "@/api/core/task";
  144. import OrgTree from "@/components/orgTree";
  145. import DialogInfo from "./dialog.info";
  146. import {listPlanRole} from "@/api/core/edu/plan";
  147. import {formatTime} from "@/utils/ruoyi";
  148. export default {
  149. components: {OrgTree,DialogInfo},
  150. name: "Task",
  151. dicts: ['sys_access_cycle', 'retrieval_task_status'],
  152. data() {
  153. return {
  154. // 遮罩层
  155. loading: true,
  156. // 选中数组
  157. ids: [],
  158. // 非单个禁用
  159. single: true,
  160. // 非多个禁用
  161. multiple: true,
  162. // 显示搜索条件
  163. showSearch: true,
  164. // 总条数
  165. total: 0,
  166. // 监控调阅任务表格数据
  167. taskList: [],
  168. // 弹出层标题
  169. title: "",
  170. // 是否显示弹出层
  171. open: false,
  172. // 查询参数
  173. queryParams: {
  174. pageNum: 1,
  175. pageSize: 10,
  176. taskName: null,
  177. cycle: null,
  178. dateRange:[],
  179. status: null,
  180. roleId:null,
  181. checkSub: true,
  182. },
  183. // 表单参数
  184. form: {},
  185. // 表单校验
  186. rules: {
  187. },
  188. roleList: [],
  189. orgName:'',
  190. };
  191. },
  192. created() {
  193. this.queryParams.orgId = this.$store.getters.orgId;
  194. this.getList();
  195. this.initRoleList();
  196. },
  197. methods: {
  198. /** 查询监控调阅任务列表 */
  199. getList() {
  200. this.loading = true;
  201. listTask(this.queryParams).then(response => {
  202. this.taskList = response.rows;
  203. this.total = response.total;
  204. this.loading = false;
  205. });
  206. },
  207. /* handleExport() {
  208. console.log(this,'this')
  209. this.$http()
  210. .post('/core/task/export',this.queryParams)
  211. /!* exportExcel(this.queryParams).then(res => {
  212. let file = new File([res],res.getHeader())
  213. console.log(res,'res111')
  214. });*!/
  215. },*/
  216. getDefaultOrg(org){
  217. this.orgName = org.name;
  218. },
  219. initRoleList() {
  220. roleList({}).then(response => {
  221. this.roleList = response.data;
  222. });
  223. },
  224. getDefaultKey(key) {
  225. this.queryParams.orgId = key;
  226. this.getList();
  227. },
  228. checkChange(state) {
  229. this.queryParams.checkSub = state;
  230. this.handleQuery();
  231. },
  232. // 节点单击事件
  233. clickTreeNode(data) {
  234. this.queryParams.orgId = data.id;
  235. this.orgName = data.name;
  236. this.handleQuery();
  237. },
  238. /** 下穿状态改变*/
  239. changeCheckBox() {
  240. this.getList();
  241. },
  242. // 取消按钮
  243. cancel() {
  244. this.open = false;
  245. this.reset();
  246. },
  247. // 表单重置
  248. reset() {
  249. this.form = {
  250. id: null,
  251. planId: null,
  252. taskName: null,
  253. orgId: null,
  254. orgPath: null,
  255. orgName: null,
  256. ymdDate: null,
  257. ymdYear: null,
  258. ymdHalfyear: null,
  259. ymdQuarter: null,
  260. ymdMonth: null,
  261. ymdWeek: null,
  262. ymdDay: null,
  263. cycle: null,
  264. planStartTime: null,
  265. planEndTime: null,
  266. startTime: null,
  267. endTime: null,
  268. status: null,
  269. roleId: null,
  270. retrievalUser: null,
  271. orderNum: null,
  272. batchNum: null,
  273. submitTime: null,
  274. exceptionCount: null
  275. };
  276. this.resetForm("form");
  277. },
  278. /** 搜索按钮操作 */
  279. handleQuery() {
  280. this.queryParams.pageNum = 1;
  281. //this.queryParams.dateRange = [];
  282. this.getList();
  283. },
  284. /** 重置按钮操作 */
  285. resetQuery() {
  286. this.resetForm("queryForm");
  287. this.queryParams.dateRange = [];
  288. this.handleQuery();
  289. },
  290. // 多选框选中数据
  291. handleSelectionChange(selection) {
  292. this.ids = selection.map(item => item.id)
  293. this.single = selection.length!==1
  294. this.multiple = !selection.length
  295. },
  296. /** 新增按钮操作 */
  297. handleAdd() {
  298. this.reset();
  299. this.open = true;
  300. this.title = "添加监控调阅任务";
  301. },
  302. /** 修改按钮操作 */
  303. lookView(row) {
  304. this.$refs["infoDialog"].show(row.id,{});
  305. },
  306. /** 导出按钮操作 */
  307. handleExport() {
  308. this.download('core/retrievalTask/export', {
  309. ...this.queryParams
  310. }, `${this.orgName+'-监控调阅任务记录-'+this.formatTime(new Date(),'YYYYMMhh')}.xlsx`)
  311. }
  312. }
  313. };
  314. </script>