index.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878
  1. <template>
  2. <div class="app-container">
  3. <el-row :gutter="10">
  4. <!--机构数据-->
  5. <!-- <el-col :span="4" :xs="24"
  6. >
  7. <org-tree
  8. v-model="queryParams.orgId"
  9. @defaultKey="getDefaultKey"
  10. @checkChange="checkChange"
  11. @click="clickTreeNode"
  12. hangsheTree
  13. :defaultCheckSub="false"
  14. ></org-tree>
  15. </el-col> -->
  16. <el-col :span="24" :xs="24">
  17. <!-- 搜索条件 -->
  18. <div class="main-right-box">
  19. <div class="main-search-box">
  20. <el-form
  21. :model="queryParams"
  22. ref="search"
  23. size="small"
  24. :inline="true"
  25. v-show="showSearch"
  26. >
  27. <el-row>
  28. <el-form-item label="行社名称">
  29. <org-tree
  30. v-model="queryParams.orgId"
  31. @defaultKey="getDefaultKey"
  32. @checkChange="checkChange"
  33. @click="clickTreeNode"
  34. hangsheTree
  35. :defaultCheckSub="false"
  36. ref="orgTree"
  37. ></org-tree>
  38. </el-form-item>
  39. <el-form-item prop="checkType" label="任务类型">
  40. <el-select
  41. prop="checkType"
  42. label="任务类型"
  43. v-model="queryParams.checkType"
  44. placeholder="请选择任务类型"
  45. clearable
  46. >
  47. <el-option
  48. v-for="dict in dict.type.check_type"
  49. :key="dict.value"
  50. :label="dict.label"
  51. :value="dict.value"
  52. />
  53. </el-select>
  54. </el-form-item>
  55. <el-form-item
  56. prop="execOrgType"
  57. label="检查机构类型"
  58. v-if="false"
  59. >
  60. <el-select
  61. prop="execOrgType"
  62. label="检查机构类型"
  63. v-model="queryParams.execOrgType"
  64. placeholder="请选择检查机构类型"
  65. clearable
  66. >
  67. <el-option
  68. v-for="dict in dict.type.sys_org_type"
  69. :key="dict.value"
  70. :label="dict.label"
  71. :value="dict.value"
  72. />
  73. </el-select>
  74. </el-form-item>
  75. <el-form-item
  76. prop="checkOrgType"
  77. label="受检机构类型"
  78. v-if="false"
  79. >
  80. <el-select
  81. prop="checkOrgType"
  82. label="受检机构类型"
  83. v-model="queryParams.checkOrgType"
  84. placeholder="请选择受检机构类型"
  85. clearable
  86. >
  87. <el-option
  88. v-for="dict in dict.type.sys_org_type"
  89. :key="dict.value"
  90. :label="dict.label"
  91. :value="dict.value"
  92. />
  93. </el-select>
  94. </el-form-item>
  95. <el-form-item prop="checkRole" label="检查人员">
  96. <el-select
  97. @visible-change="getRolesByOrg"
  98. prop="checkRole"
  99. label="检查人员"
  100. v-model="queryParams.checkRole"
  101. placeholder="请选择用户角色"
  102. clearable
  103. >
  104. <el-option
  105. v-for="dict in resumptionRoles"
  106. :key="dict.index"
  107. :label="dict.roleName"
  108. :value="dict.id"
  109. />
  110. </el-select>
  111. </el-form-item>
  112. <el-form-item prop="planCycle" label="任务周期">
  113. <el-select
  114. prop="planCycle"
  115. label="任务周期"
  116. v-model="queryParams.planCycle"
  117. placeholder="请选择任务周期"
  118. clearable
  119. >
  120. <el-option
  121. v-for="item in dict.type.check_cycle"
  122. :key="item.value"
  123. :label="item.label"
  124. :value="item.value"
  125. >
  126. </el-option>
  127. </el-select>
  128. </el-form-item>
  129. <el-form-item prop="planStatus" label="任务状态">
  130. <el-select
  131. prop="planStatus"
  132. label="任务状态"
  133. v-model="queryParams.planStatus"
  134. placeholder="请选择任务状态"
  135. clearable
  136. >
  137. <el-option
  138. v-for="item in dict.type.check_status"
  139. :key="item.value"
  140. :label="item.label"
  141. :value="item.value"
  142. >
  143. </el-option>
  144. </el-select>
  145. </el-form-item>
  146. <el-form-item prop="planName" label="任务名称">
  147. <el-input
  148. v-model="queryParams.planName"
  149. :maxlength="50"
  150. name="planName"
  151. placeholder="请输入关键字"
  152. clearable
  153. />
  154. </el-form-item>
  155. </el-row>
  156. <el-row> </el-row>
  157. </el-form>
  158. <el-row :gutter="10">
  159. <el-col :span="1.5">
  160. <el-button
  161. type="primary"
  162. icon="el-icon-search"
  163. size="mini"
  164. @click="getList"
  165. >搜索</el-button
  166. >
  167. </el-col>
  168. <el-col :span="1.5">
  169. <el-button
  170. type="primary"
  171. icon="el-icon-refresh"
  172. size="mini"
  173. @click="resetQuery"
  174. >重置</el-button
  175. >
  176. </el-col>
  177. <el-col :span="1.5">
  178. <el-button
  179. type="primary"
  180. icon="el-icon-plus"
  181. size="mini"
  182. @click="handleAdd()"
  183. v-hasPermi="['core:checkplan:add']"
  184. >新增任务</el-button
  185. >
  186. </el-col>
  187. <right-toolbar
  188. :showSearch.sync="showSearch"
  189. @queryTable="getList"
  190. ></right-toolbar>
  191. </el-row>
  192. </div>
  193. <el-table
  194. border
  195. height="596"
  196. size="small"
  197. v-loading="loading"
  198. :data="pageData"
  199. @selection-change="handleSelectionChange"
  200. row-key="id"
  201. :tree-props="{ children: 'children' }"
  202. >
  203. <el-table-column
  204. type="index"
  205. label="序号"
  206. align="center"
  207. width="80px"
  208. v-if="columns[0].visible"
  209. ><template slot-scope="scope">
  210. {{
  211. (queryParams.pageNum - 1) * queryParams.pageSize +
  212. scope.$index +
  213. 1
  214. }}
  215. </template></el-table-column>
  216. <el-table-column
  217. prop="planName"
  218. label="任务名称"
  219. align="center"
  220. width="250px"
  221. show-overflow-tooltip
  222. v-if="columns[1].visible"
  223. ></el-table-column>
  224. <el-table-column
  225. prop="checkType"
  226. label="任务类型"
  227. align="center"
  228. width="300px"
  229. v-if="columns[2].visible"
  230. >
  231. <template slot-scope="r"
  232. >{{ getLabel(dict.type.check_type, `${r.row.checkType}`) }}
  233. </template>
  234. </el-table-column>
  235. <el-table-column
  236. prop="planCreateOrgName"
  237. label="创建机构"
  238. align="center"
  239. width="150px"
  240. show-overflow-tooltip
  241. v-if="columns[3].visible"
  242. >
  243. </el-table-column>
  244. <el-table-column
  245. prop="planOfOrgName"
  246. label="行社名称"
  247. align="center"
  248. width="150px"
  249. show-overflow-tooltip
  250. v-if="columns[4].visible"
  251. >
  252. </el-table-column>
  253. <el-table-column
  254. prop="execOrgType"
  255. align="center"
  256. width="150px"
  257. label="检查主体"
  258. v-if="columns[5].visible"
  259. >
  260. <template slot-scope="r"
  261. >{{ getLabel(dict.type.sys_org_type, `${r.row.execOrgType}`) }}
  262. </template>
  263. </el-table-column>
  264. <el-table-column
  265. prop="typeNames"
  266. align="center"
  267. width="150px"
  268. label="受检机构"
  269. show-overflow-tooltip
  270. v-if="columns[6].visible"
  271. >
  272. <!-- <template slot-scope="r"
  273. >{{ getLabel(dict.type.sys_org_type, `${r.row.checkOrgType}`) }}
  274. </template> -->
  275. </el-table-column>
  276. <el-table-column
  277. prop="roleNames"
  278. align="center"
  279. width="200px"
  280. label="检查人员"
  281. show-overflow-tooltip
  282. v-if="columns[7].visible"
  283. >
  284. <template slot-scope="scope">
  285. <template v-for="item in splitRoleNames(scope.row.roleNames)">
  286. {{ item }}
  287. </template> </template
  288. ></el-table-column>
  289. <el-table-column
  290. prop="planCycle"
  291. label="任务周期"
  292. align="center"
  293. width="120px"
  294. v-if="columns[8].visible"
  295. >
  296. <template slot-scope="r"
  297. >{{ getLabel(dict.type.check_cycle, `${r.row.planCycle}`) }}
  298. </template>
  299. </el-table-column>
  300. <el-table-column
  301. prop="count"
  302. label="任务次数"
  303. align="center"
  304. width="120px"
  305. v-if="columns[9].visible"
  306. ></el-table-column>
  307. <el-table-column
  308. prop="planStatus"
  309. label="任务状态"
  310. align="center"
  311. width="120px"
  312. v-if="columns[10].visible"
  313. >
  314. <template slot-scope="r"
  315. >{{ getLabel(dict.type.check_status, `${r.row.planStatus}`) }}
  316. </template>
  317. </el-table-column>
  318. <el-table-column
  319. prop="modifiedName"
  320. label="修改人"
  321. v-if="false"
  322. ></el-table-column>
  323. <el-table-column
  324. prop="updateTime"
  325. label="修改时间"
  326. width="80px"
  327. v-if="false"
  328. >
  329. <template slot-scope="scope">
  330. <span>{{
  331. formatTime(scope.row.updateTime, "YYYY-MM-DD")
  332. }}</span>
  333. </template>
  334. </el-table-column>
  335. <el-table-column
  336. label="操作"
  337. width="280"
  338. fixed="right"
  339. align="center"
  340. >
  341. <template slot-scope="r">
  342. <el-button
  343. type="text"
  344. size="mini"
  345. icon="el-icon-arrow-down"
  346. v-if="showPublish(r.row)"
  347. @click="showDialogDistribute(r.row)"
  348. v-hasPermi="['core:checkplan:distribute']"
  349. >下发</el-button
  350. >
  351. <el-button
  352. type="text"
  353. icon="el-icon-top-left"
  354. size="mini"
  355. v-if="showWithDraw(r.row)"
  356. @click="chhuile(r.row)"
  357. v-hasPermi="['core:checkplan:distribute']"
  358. >撤回</el-button
  359. >
  360. <el-button
  361. v-if="showEditBtn(r.row)"
  362. size="mini"
  363. type="text"
  364. icon="el-icon-edit-outline"
  365. @click="onEdit(r.row.id)"
  366. v-hasPermi="['core:checkplan:edit']"
  367. >编辑</el-button
  368. >
  369. <el-button
  370. size="mini"
  371. type="text"
  372. icon="el-icon-edit-outline"
  373. @click="onDetail(r.row.id)"
  374. v-hasPermi="['core:checkplan:query']"
  375. >详情</el-button
  376. >
  377. <el-button
  378. v-if="showDelete(r.row)"
  379. size="mini"
  380. type="text"
  381. icon="el-icon-delete"
  382. @click="onDel(r.row)"
  383. v-hasPermi="['core:checkplan:remove']"
  384. >删除</el-button
  385. >
  386. </template>
  387. </el-table-column>
  388. </el-table>
  389. <pagination
  390. v-show="total > 0"
  391. :total="total"
  392. :page.sync="queryParams.pageNum"
  393. :limit.sync="queryParams.pageSize"
  394. @pagination="getList"
  395. />
  396. </div>
  397. </el-col>
  398. </el-row>
  399. <dialog-edit
  400. ref="editDialog"
  401. @success="getList()"
  402. :orgTypeOptions="orgTypeOptions"
  403. :ruleTypeOptions="dict.type.rule_type"
  404. ></dialog-edit>
  405. <DialogDistribute ref="dialogDistribute" @select="sel"></DialogDistribute>
  406. <DialogThreeState ref="DialogThreeState"> </DialogThreeState>
  407. <dialog-detail
  408. ref="detailDialog"
  409. :orgTypeOptions="orgTypeOptions"
  410. :ruleTypeOptions="dict.type.rule_type"
  411. ></dialog-detail>
  412. </div>
  413. </template>
  414. <script>
  415. import DialogDistribute from "./distribute.vue";
  416. import OrgTree from "@/components/orgTree/orgQuerySelector.vue";
  417. import { mapState, mapMutations, mapGetters } from "vuex";
  418. import DialogEdit from "./dialog.edit";
  419. import DialogDetail from "./dialog.detail";
  420. import * as api from "@/api/safetycheck/plan";
  421. import { statusOptions, getLabel } from "@/views/commonOption";
  422. import { allRole } from "@/api/system/role";
  423. import DialogThreeState from "@/components/message/threeStateMessageBox.vue";
  424. export default {
  425. name: "resumptionplan",
  426. dicts: [
  427. "sys_org_type",
  428. "rule_type",
  429. "check_cycle",
  430. "check_status",
  431. "check_type",
  432. ],
  433. components: {
  434. DialogEdit,
  435. OrgTree,
  436. DialogDistribute,
  437. DialogThreeState,
  438. DialogDetail
  439. },
  440. data() {
  441. const { params, query } = this.$route;
  442. return {
  443. isShow: false,
  444. loading: false,
  445. ids: [],
  446. // 非单个停用
  447. single: true,
  448. // 非多个停用
  449. multiple: true,
  450. // 显示搜索条件
  451. showSearch: true,
  452. resumptionRoles: [],
  453. total: 0,
  454. queryParams: {
  455. id: null,
  456. planName: null,
  457. checkRole: null,
  458. planCycle: null,
  459. planCreateOrgId: null,
  460. checkType: null,
  461. planOfOrgId: null,
  462. execOrgType: null,
  463. checkOrgType: null,
  464. planStatus: null,
  465. pageSize: 10,
  466. pageNum: 1,
  467. checkSub: false,
  468. orgId: null,
  469. ...query,
  470. },
  471. pageData: [],
  472. // 列信息
  473. columns: [
  474. { key: 0, label: `序号`, visible: true },
  475. { key: 1, label: `任务名称`, visible: true },
  476. { key: 2, label: `任务类型`, visible: true },
  477. { key: 3, label: `创建机构`, visible: true },
  478. { key: 4, label: `行社名称`, visible: true },
  479. { key: 5, label: `检查主体`, visible: true },
  480. { key: 6, label: `受检机构`, visible: true },
  481. { key: 7, label: `检查人员`, visible: true },
  482. { key: 8, label: `任务周期`, visible: true },
  483. { key: 9, label: `任务次数`, visible: true },
  484. { key: 10, label: `任务状态`, visible: true },
  485. ],
  486. };
  487. },
  488. props: {},
  489. watch: {},
  490. computed: {
  491. ...mapState([]),
  492. ...mapGetters(["orgId", "orgName"]),
  493. orgTypeOptions() {
  494. if (!this.dict || !this.dict.type.sys_org_type == null) {
  495. return [];
  496. }
  497. return this.dict.type.sys_org_type.filter(
  498. (t) => !["7", "8"].includes(t.value)
  499. );
  500. },
  501. },
  502. methods: {
  503. ...mapMutations([]),
  504. //判断是否跟当前用户同机构
  505. showEditBtn(row) {
  506. // console.log(row.planOfOrgId,"row.planOfOrgId");
  507. // console.log(this.orgId,"this.orgId");
  508. if (row == null || row == undefined) {
  509. return false;
  510. }
  511. //只能编辑所属机构是自己的
  512. return row.planOfOrgId == this.orgId;
  513. },
  514. showDialogDistribute(row) {
  515. //行社的计划,或检查机构类型是省联社、办事处,走单个下发
  516. if (
  517. row.planOfOrgType == 3 ||
  518. row.execOrgType == 1 ||
  519. row.execOrgType == 2
  520. ) {
  521. this.onSinglePlanDistribute(row);
  522. } else {
  523. this.$refs.dialogDistribute.show(row);
  524. }
  525. },
  526. onSinglePlanDistribute(row) {
  527. if (row.planStatus == 0) {
  528. if (row.planCycle == 6) {
  529. //无周期任务,
  530. let msg = "确定下发任务并立即生成任务?";
  531. this.$modal.confirm(msg).then(() => {
  532. this.distributeSingle(row.id, true);
  533. });
  534. } else {
  535. let msg = "请选择下发后立即生成或下周期生成任务";
  536. this.$refs["DialogThreeState"].show(
  537. msg,
  538. (state) => {
  539. if (state == 0 || state == 1) {
  540. this.distributeSingle(row.id, state == 1);
  541. }
  542. },
  543. {
  544. yesText: "立即生成",
  545. noText: "下周期",
  546. cancelText: "取消",
  547. }
  548. );
  549. }
  550. } else if (row.planStatus == 2) {
  551. let msg = "";
  552. if (row.planCycle == 6) {
  553. msg = "已存在已完成任务,是否确定下发?";
  554. } else {
  555. msg = "因存在已完成任务,是否确定从下周期生成任务?";
  556. }
  557. this.$modal
  558. .confirm(msg, {
  559. confirmButtonText: "确定",
  560. canelButtonText: "取消",
  561. })
  562. .then(() => {
  563. this.distributeSingle(row.id, false);
  564. });
  565. } else {
  566. this.distributeSingle(row.id, false);
  567. }
  568. },
  569. distributeSingle(id, immediateEffect) {
  570. this.loading = true;
  571. api
  572. .distributeSingle(id, immediateEffect)
  573. .then((response) => {
  574. // console.log(response, "then");
  575. if (response.data == 0) {
  576. this.loading = false;
  577. } else {
  578. this.getList();
  579. this.loading = false;
  580. }
  581. })
  582. .catch((response) => {
  583. // console.log(response, "catch");
  584. this.getList();
  585. this.loading = false;
  586. });
  587. },
  588. showPublish(row) {
  589. //有父计划且父计划不是使用中状态,不能下发
  590. if (row.parentStatus != 1 && row.parentId > 0) {
  591. return false;
  592. }
  593. //可以下发:本机构创建+状态为草稿、停用的计划
  594. if (
  595. row.planCreateOrgId == this.orgId &&
  596. (row.planStatus == 0 || row.planStatus == 2)
  597. ) {
  598. return true;
  599. }
  600. // if (
  601. // row.planOfOrgId == this.orgId &&
  602. // row.planCreateOrgId != this.orgId &&
  603. // (row.planStatus == 0 || row.planStatus == 2) &&
  604. // row.distributePlanStatus == 0
  605. // ) {
  606. // return true;
  607. // }
  608. return false;
  609. },
  610. showDelete(row) {
  611. //本机构创建的计划,才能删除
  612. return row.planCreateOrgId == this.orgId && row.planOfOrgId == this.orgId;
  613. },
  614. showWithDraw(row) {
  615. //本机构创建是自己+状态为使用中
  616. if (row.planCreateOrgId == this.orgId && row.planStatus == 1) {
  617. return true;
  618. }
  619. // if (
  620. // row.planOfOrgId == this.orgId &&
  621. // row.planCreateOrgId != this.orgId &&
  622. // row.planStatus == 1 &&
  623. // row.distributePlanStatus == 0
  624. // ) {
  625. // return true;
  626. // }
  627. return false;
  628. },
  629. // showEditBtn(row) {
  630. // if (row == null || row == undefined) {
  631. // return false;
  632. // }
  633. // //只能编辑所属机构是自己的
  634. // return row.planOfOrgId == this.orgId;
  635. // // console.log(row.planOfOrgId,"row.planOfOrgId");
  636. // // console.log(this.orgId,"this.orgId");
  637. // },
  638. splitRoleNames(val) {
  639. if (val != null && val != undefined) {
  640. return val.split(",");
  641. } else {
  642. return [];
  643. }
  644. // 使用逗号分割字符串,得到角色名称的数组
  645. },
  646. sel(selectList, row) {
  647. let msg = "";
  648. if (row.planStatus == 0) {
  649. if (row.planCycle == 6) {
  650. //无周期任务,
  651. let msg = "确定下发任务并立即生成任务?";
  652. this.$modal.confirm(msg).then(() => {
  653. this.distributeInner(selectList, true);
  654. });
  655. } else {
  656. msg = "请选择下发后立即生成或下周期生成任务。";
  657. this.$refs["DialogThreeState"].show(
  658. msg,
  659. (state) => {
  660. if (state == 0 || state == 1) {
  661. this.distributeInner(selectList, state == 1);
  662. }
  663. },
  664. {
  665. yesText: "立即生成",
  666. noText: "下周期",
  667. cancelText: "取消",
  668. }
  669. );
  670. }
  671. } else if (row.planStatus == 2) {
  672. if (row.planCycle == 6) {
  673. msg = "已存在已完成任务,是否确定下发?";
  674. } else {
  675. msg = "因存在已完成任务,是否确定从下周期生成任务?";
  676. }
  677. this.$modal.confirm(msg).then(() => {
  678. this.distributeInner(selectList, false);
  679. });
  680. } else {
  681. this.distributeInner(selectList, false);
  682. }
  683. },
  684. distributeInner(selectList, imme) {
  685. this.loading = true;
  686. api
  687. .distribute(selectList, imme)
  688. .then((response) => {
  689. this.getList();
  690. this.loading = false;
  691. })
  692. .catch(() => {
  693. this.loading = false;
  694. });
  695. },
  696. //开始撤回
  697. chhuile(row) {
  698. if (row.planCycle == "6" && row.taskHasCompleted == 1) {
  699. //无周期任务有已完成时,不能撤回
  700. this.$modal.alertSuccess(
  701. "存在已完成任务,无周期任务不允许撤回,如需删除下发任务请点击“删除”。"
  702. );
  703. return;
  704. }
  705. let msg;
  706. if (row.taskHasCompleted != 1) {
  707. msg = "因不存在已完成任务,撤回后将删除所有生成任务?";
  708. } else {
  709. msg = "因存在已完成任务,撤回后下周期起将不再生成任务?";
  710. }
  711. this.$modal
  712. .confirm(msg, "提示")
  713. .then(() => {
  714. // 用户点击了确认按钮
  715. // console.log("执行操作...");
  716. this.loading = true;
  717. api.cheHui(row.id).then((response) => {
  718. this.getList();
  719. this.loading = false;
  720. });
  721. })
  722. .catch(() => {
  723. // 用户点击了取消按钮
  724. // console.log("取消操作...");
  725. });
  726. },
  727. // //已下发的显示撤回
  728. // chehui(row) {
  729. // if (row.distribute == 1 && row.planCreateOrgId == this.orgId) {
  730. // return true;
  731. // }
  732. // return false;
  733. // },
  734. // showDialogDistribute(row) {
  735. // console.log(row, "qqq");
  736. // this.$refs.dialogDistribute.show(row);
  737. // },
  738. getRolesByOrg() {
  739. allRole().then((res) => {
  740. // console.info(res);
  741. this.resumptionRoles = res.data;
  742. });
  743. },
  744. getList() {
  745. this.loading = true;
  746. console.info(this.dict.type);
  747. api
  748. .list(this.queryParams)
  749. .then((response) => {
  750. this.pageData = response.rows;
  751. this.total = response.total;
  752. this.loading = false;
  753. })
  754. .catch(() => {
  755. this.loading = false;
  756. });
  757. },
  758. getDefaultKey(key) {
  759. this.queryParams.orgId = key;
  760. this.getList();
  761. },
  762. handleAdd(id, other = {}) {
  763. id = null;
  764. this.$refs.editDialog.show(id, other);
  765. },
  766. onEdit(id, other = {}) {
  767. this.$refs.editDialog.show(id, other);
  768. },
  769. onDetail(id) {
  770. this.$refs.detailDialog.show(id);
  771. },
  772. async onDel(row) {
  773. let msg = "";
  774. if (row.planStatus == 0) {
  775. msg = '是否确认删除名称为"' + row.planName + '"的任务?';
  776. } else if (row.planStatus == 1) {
  777. msg = "本次删除将强制删除当前任务时间及以后所有任务";
  778. } else if (row.planStatus == 2) {
  779. // if (row.hasTaskCurrentCycle) {
  780. msg = "本次删除将强制删除当前任务时间及以后所有任务";
  781. // } else {
  782. // msg = '是否确认删除名称为"' + row.planName + '"的任务?';
  783. // }
  784. }
  785. this.$modal
  786. .confirm(msg)
  787. .then(() => {
  788. // 用户点击了确认按钮
  789. // console.log("执行操作...");
  790. this.loading = true;
  791. api
  792. .delelte(row.id)
  793. .then(() => {
  794. this.getList();
  795. this.loading = false;
  796. this.$modal.msgSuccess("删除成功");
  797. })
  798. .catch(() => {
  799. this.loading = false;
  800. });
  801. })
  802. .catch((ex) => {
  803. console.error(ex);
  804. // 用户点击了取消按钮
  805. // console.log("取消操作...");
  806. });
  807. },
  808. // 多选框选中数据
  809. handleSelectionChange(selection) {
  810. this.ids = selection.map((item) => item.userId);
  811. this.single = selection.length != 1;
  812. this.multiple = !selection.length;
  813. },
  814. /** 重置按钮操作 */
  815. resetQuery() {
  816. this.resetForm("search");
  817. this.queryParams.orgId = this.orgId;
  818. this.queryParams.checkSub = false;
  819. this.$refs["orgTree"].setCheckSub(this.queryParams.checkSub);
  820. // this.$refs.tree.setCurrentKey(null);
  821. this.getList();
  822. },
  823. //单选框状态改变
  824. checkChange(state) {
  825. this.queryParams.checkSub = state;
  826. this.getList();
  827. },
  828. // 节点单击事件
  829. clickTreeNode(data) {
  830. this.queryParams.orgId = data.id;
  831. this.getList();
  832. },
  833. getStatusLabel(value) {
  834. return getLabel(statusOptions, value);
  835. },
  836. getLabel(options, value) {
  837. return getLabel(options, value);
  838. },
  839. //apimark//
  840. },
  841. mounted() {},
  842. };
  843. </script>
  844. <style lang="scss" scoped>
  845. .brand {
  846. }
  847. </style>