index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  1. <template>
  2. <div class="app-container">
  3. <el-row :gutter="20">
  4. <!--机构数据-->
  5. <!-- <el-col :span="4" :xs="24">
  6. <org-tree
  7. v-model="queryParams.orgId"
  8. @defaultKey="getDefaultKey"
  9. @defaultOrg="getDefaultOrg"
  10. @checkChange="checkChange"
  11. @click="clickTreeNode"
  12. ></org-tree>
  13. </el-col> -->
  14. <el-col :span="24" :xs="24">
  15. <div class="main-right-box">
  16. <div class="main-search-box">
  17. <el-form
  18. :model="queryParams"
  19. ref="queryForm"
  20. size="small"
  21. :inline="true"
  22. v-show="showSearch"
  23. >
  24. <el-form-item label="调阅机构">
  25. <org-tree
  26. v-model="queryParams.orgId"
  27. @defaultKey="getDefaultKey"
  28. @defaultOrg="getDefaultOrg"
  29. @checkChange="checkChange"
  30. @click="clickTreeNode"
  31. ref="orgTree"
  32. ></org-tree>
  33. </el-form-item>
  34. <el-form-item label="任务名称" prop="taskName">
  35. <el-input
  36. v-model="queryParams.taskName"
  37. placeholder="请输入任务名称"
  38. clearable
  39. @keyup.enter.native="handleQuery"
  40. maxlength="50"
  41. />
  42. </el-form-item>
  43. <el-form-item label="调阅人员" prop="roleId">
  44. <el-select
  45. v-model="queryParams.roleId"
  46. placeholder="请选择调阅人员"
  47. clearable
  48. >
  49. <el-option
  50. v-for="item in roleList"
  51. :key="item.id"
  52. :label="item.name"
  53. :value="item.id"
  54. ></el-option>
  55. </el-select>
  56. </el-form-item>
  57. <el-form-item label="任务进度" prop="status">
  58. <el-select
  59. v-model="queryParams.status"
  60. placeholder="请选择进度"
  61. clearable
  62. >
  63. <el-option
  64. v-for="dict in dict.type.retrieval_task_status"
  65. :key="dict.value"
  66. :label="dict.label"
  67. :value="dict.value"
  68. />
  69. </el-select>
  70. </el-form-item>
  71. <el-form-item label="任务时间" prop="planStartTime">
  72. <DataRangePicker
  73. type="daterange"
  74. value-format="yyyy-MM-dd HH:mm:ss"
  75. :default-time="['00:00:00', '23:59:59']"
  76. start-placeholder="开始日期"
  77. end-placeholder="结束日期"
  78. v-model="queryParams.dateRange"
  79. :picker-options="pickerOptions"
  80. >
  81. </DataRangePicker>
  82. </el-form-item>
  83. </el-form>
  84. <el-row :gutter="10">
  85. <el-col :span="1.5">
  86. <el-button
  87. type="primary"
  88. icon="el-icon-search"
  89. size="mini"
  90. @click="handleQuery"
  91. >搜索
  92. </el-button>
  93. </el-col>
  94. <el-col :span="1.5">
  95. <el-button
  96. type="primary"
  97. icon="el-icon-refresh"
  98. size="mini"
  99. @click="resetQuery"
  100. >重置
  101. </el-button>
  102. </el-col>
  103. <el-col :span="1.5">
  104. <el-button
  105. type="primary"
  106. icon="el-icon-download"
  107. size="mini"
  108. @click="handleExport"
  109. v-hasPermi="['core:task:export']"
  110. >导出数据</el-button
  111. >
  112. </el-col>
  113. <right-toolbar
  114. :showSearch.sync="showSearch"
  115. @queryTable="getList"
  116. ></right-toolbar>
  117. </el-row>
  118. </div>
  119. <el-table
  120. v-loading="loading"
  121. :data="taskList"
  122. border
  123. height="600"
  124. size="small"
  125. >
  126. <el-table-column
  127. label="序号"
  128. type="index"
  129. align="center"
  130. width="100"
  131. >
  132. <template slot-scope="scope">
  133. <span>{{
  134. (queryParams.pageNum - 1) * queryParams.pageSize +
  135. scope.$index +
  136. 1
  137. }}</span>
  138. </template>
  139. </el-table-column>
  140. <el-table-column
  141. label="任务名称"
  142. align="center"
  143. prop="taskName"
  144. width="220"
  145. show-overflow-tooltip="true"
  146. />
  147. <el-table-column
  148. label="地区"
  149. align="center"
  150. prop="affiliatedArea"
  151. width="220"
  152. />
  153. <el-table-column
  154. label="行社名称"
  155. align="center"
  156. prop="affiliatedBank"
  157. width="220"
  158. />
  159. <el-table-column
  160. label="调阅机构"
  161. align="center"
  162. prop="orgName"
  163. width="220"
  164. />
  165. <el-table-column
  166. label="调阅人员"
  167. align="center"
  168. prop="roleName"
  169. width="160"
  170. />
  171. <el-table-column label="任务进度" align="center" prop="status">
  172. <template slot-scope="scope">
  173. <span>
  174. <dict-tag
  175. :options="dict.type.retrieval_task_status"
  176. :value="scope.row.status"
  177. />
  178. </span>
  179. </template>
  180. </el-table-column>
  181. <el-table-column label="任务时间" align="center" width="300">
  182. <template slot-scope="scope">
  183. {{ scope.row.planStartTime }}~{{ scope.row.planEndTime }}
  184. </template>
  185. </el-table-column>
  186. <el-table-column
  187. label="异常数量"
  188. align="center"
  189. prop="exceptionCount"
  190. />
  191. <el-table-column
  192. label="操作"
  193. fixed="right"
  194. style="width: 100px"
  195. align="center"
  196. class-name="small-padding fixed-width"
  197. >
  198. <template slot-scope="scope">
  199. <el-button
  200. size="mini"
  201. type="text"
  202. icon="el-icon-view"
  203. @click="lookView(scope.row)"
  204. v-hasPermi="['core:task:query']"
  205. >详情</el-button
  206. >
  207. <el-button
  208. icon="el-icon-document-copy"
  209. type="text"
  210. v-if="scope.row.pdfUrl"
  211. @click="onDown(scope.row.pdfUrl)"
  212. >登记簿
  213. </el-button>
  214. </template>
  215. </el-table-column>
  216. </el-table>
  217. <dialog-info ref="infoDialog" @success="refresh(true)"></dialog-info>
  218. <pagination
  219. v-show="total > 0"
  220. :total="total"
  221. :page.sync="queryParams.pageNum"
  222. :limit.sync="queryParams.pageSize"
  223. @pagination="getList"
  224. />
  225. </div>
  226. </el-col>
  227. </el-row>
  228. </div>
  229. </template>
  230. <script>
  231. import {
  232. listTask,
  233. getTask,
  234. delTask,
  235. addTask,
  236. updateTask,
  237. roleList,
  238. exportExcel,
  239. } from "@/api/core/task";
  240. import OrgTree from "@/components/orgTree/orgQuerySelector.vue";
  241. import DialogInfo from "./dialog.info";
  242. import { listPlanRole } from "@/api/core/edu/plan";
  243. import { formatTime } from "@/utils/ruoyi";
  244. import DataRangePicker from "@/components/dateTime/daterange.picker.vue";
  245. import dayjs from "dayjs";
  246. import { mapGetters } from "vuex";
  247. export default {
  248. components: { OrgTree, DialogInfo, DataRangePicker },
  249. name: "Task",
  250. dicts: ["sys_access_cycle", "retrieval_task_status"],
  251. data() {
  252. return {
  253. // 遮罩层
  254. loading: true,
  255. // 选中数组
  256. ids: [],
  257. // 非单个停用
  258. single: true,
  259. // 非多个停用
  260. multiple: true,
  261. // 显示搜索条件
  262. showSearch: true,
  263. // 总条数
  264. total: 0,
  265. // 监控调阅任务表格数据
  266. taskList: [],
  267. // 弹出层标题
  268. title: "",
  269. // 是否显示弹出层
  270. open: false,
  271. // 查询参数
  272. queryParams: {
  273. pageNum: 1,
  274. pageSize: 10,
  275. taskName: null,
  276. cycle: null,
  277. dateRange: [],
  278. planStartTime:null,
  279. status: null,
  280. roleId: null,
  281. checkSub: true,
  282. },
  283. selectedOrgName: "",
  284. // 表单参数
  285. form: {},
  286. // 表单校验
  287. rules: {},
  288. roleList: [],
  289. orgName: "",
  290. };
  291. },
  292. created() {
  293. this.queryParams.orgId = this.$store.getters.orgId;
  294. this.getList();
  295. this.initRoleList();
  296. },
  297. computed: {
  298. ...mapGetters(["orgId","orgName"]),
  299. },
  300. methods: {
  301. /** 查询监控调阅任务列表 */
  302. getList() {
  303. this.loading = true;
  304. listTask(this.queryParams).then((response) => {
  305. this.taskList = response.rows;
  306. this.total = response.total;
  307. this.loading = false;
  308. });
  309. },
  310. /* handleExport() {
  311. console.log(this,'this')
  312. this.$http()
  313. .post('/core/task/export',this.queryParams)
  314. /!* exportExcel(this.queryParams).then(res => {
  315. let file = new File([res],res.getHeader())
  316. console.log(res,'res111')
  317. });*!/
  318. },*/
  319. async onDown(pdfUrl) {
  320. window.open(pdfUrl);
  321. },
  322. getDefaultOrg(org) {
  323. this.orgName = org.name;
  324. this.selectedOrgName = org.shortName;
  325. },
  326. initRoleList() {
  327. roleList({}).then((response) => {
  328. this.roleList = response.data;
  329. });
  330. },
  331. getDefaultKey(key) {
  332. this.queryParams.orgId = key;
  333. this.getList();
  334. },
  335. checkChange(state) {
  336. this.queryParams.checkSub = state;
  337. this.handleQuery();
  338. },
  339. // 节点单击事件
  340. clickTreeNode(data) {
  341. this.queryParams.orgId = data.id;
  342. this.orgName = data.name;
  343. this.selectedOrgName = data.shortName;
  344. this.handleQuery();
  345. },
  346. /** 下穿状态改变*/
  347. changeCheckBox() {
  348. this.getList();
  349. },
  350. // 取消按钮
  351. cancel() {
  352. this.open = false;
  353. this.reset();
  354. },
  355. // 表单重置
  356. reset() {
  357. this.form = {
  358. id: null,
  359. planId: null,
  360. taskName: null,
  361. orgId: null,
  362. orgPath: null,
  363. orgName: null,
  364. ymdDate: null,
  365. ymdYear: null,
  366. ymdHalfyear: null,
  367. ymdQuarter: null,
  368. ymdMonth: null,
  369. ymdWeek: null,
  370. ymdDay: null,
  371. cycle: null,
  372. planStartTime: null,
  373. planEndTime: null,
  374. startTime: null,
  375. endTime: null,
  376. status: null,
  377. roleId: null,
  378. retrievalUser: null,
  379. orderNum: null,
  380. batchNum: null,
  381. submitTime: null,
  382. exceptionCount: null,
  383. };
  384. this.resetForm("form");
  385. },
  386. /** 搜索按钮操作 */
  387. handleQuery() {
  388. this.queryParams.pageNum = 1;
  389. //this.queryParams.dateRange = [];
  390. this.getList();
  391. },
  392. /** 重置按钮操作 */
  393. resetQuery() {
  394. this.resetForm("queryForm");
  395. this.queryParams.orgId = this.orgId;
  396. this.selectedOrgName = this.orgName;
  397. this.queryParams.checkSub = true;
  398. this.queryParams.dateRange = ['',''];
  399. this.queryParams.planStartTime=null;
  400. this.$refs["orgTree"].setCheckSub(this.queryParams.checkSub);
  401. this.handleQuery();
  402. },
  403. // 多选框选中数据
  404. handleSelectionChange(selection) {
  405. this.ids = selection.map((item) => item.id);
  406. this.single = selection.length !== 1;
  407. this.multiple = !selection.length;
  408. },
  409. /** 新增按钮操作 */
  410. handleAdd() {
  411. this.reset();
  412. this.open = true;
  413. this.title = "添加监控调阅任务";
  414. },
  415. /** 修改按钮操作 */
  416. lookView(row) {
  417. this.$refs["infoDialog"].show(row.id, {});
  418. },
  419. /** 导出按钮操作 */
  420. handleExport() {
  421. console.log(this);
  422. this.download(
  423. "core/retrievalTask/export",
  424. {
  425. ...this.queryParams,
  426. },
  427. `${
  428. this.selectedOrgName
  429. }-${this.$tab.getCurrentTabName()}-${dayjs().format("YYYYMMDD")}.xlsx`
  430. );
  431. },
  432. statusColor(status) {
  433. let color = "";
  434. switch (status) {
  435. case "0":
  436. color = "#00B0F0";
  437. break;
  438. case "1":
  439. color = "#FFC000";
  440. break;
  441. case "2":
  442. color = "#00B050";
  443. break;
  444. case "3":
  445. color = "#FF0000";
  446. break;
  447. }
  448. return "color:" + color;
  449. },
  450. },
  451. };
  452. </script>