index.vue 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849
  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. ></el-table-column>
  210. <el-table-column
  211. prop="planName"
  212. label="任务名称"
  213. align="center"
  214. width="250px"
  215. show-overflow-tooltip
  216. v-if="columns[1].visible"
  217. ></el-table-column>
  218. <el-table-column
  219. prop="checkType"
  220. label="任务类型"
  221. align="center"
  222. width="300px"
  223. v-if="columns[2].visible"
  224. >
  225. <template slot-scope="r"
  226. >{{ getLabel(dict.type.check_type, `${r.row.checkType}`) }}
  227. </template>
  228. </el-table-column>
  229. <el-table-column
  230. prop="planCreateOrgName"
  231. label="创建机构"
  232. align="center"
  233. width="150px"
  234. show-overflow-tooltip
  235. v-if="columns[3].visible"
  236. >
  237. </el-table-column>
  238. <el-table-column
  239. prop="planOfOrgName"
  240. label="行社名称"
  241. align="center"
  242. width="150px"
  243. show-overflow-tooltip
  244. v-if="columns[4].visible"
  245. >
  246. </el-table-column>
  247. <el-table-column
  248. prop="execOrgType"
  249. align="center"
  250. width="150px"
  251. label="检查主体"
  252. v-if="columns[5].visible"
  253. >
  254. <template slot-scope="r"
  255. >{{ getLabel(dict.type.sys_org_type, `${r.row.execOrgType}`) }}
  256. </template>
  257. </el-table-column>
  258. <el-table-column
  259. prop="typeNames"
  260. align="center"
  261. width="150px"
  262. label="受检机构"
  263. v-if="columns[6].visible"
  264. >
  265. <!-- <template slot-scope="r"
  266. >{{ getLabel(dict.type.sys_org_type, `${r.row.checkOrgType}`) }}
  267. </template> -->
  268. </el-table-column>
  269. <el-table-column
  270. prop="roleNames"
  271. align="center"
  272. width="200px"
  273. label="检查人员"
  274. show-overflow-tooltip
  275. v-if="columns[7].visible"
  276. >
  277. <template slot-scope="scope">
  278. <template v-for="item in splitRoleNames(scope.row.roleNames)">
  279. {{ item }}
  280. </template> </template
  281. ></el-table-column>
  282. <el-table-column
  283. prop="planCycle"
  284. label="任务周期"
  285. align="center"
  286. width="120px"
  287. v-if="columns[8].visible"
  288. >
  289. <template slot-scope="r"
  290. >{{ getLabel(dict.type.check_cycle, `${r.row.planCycle}`) }}
  291. </template>
  292. </el-table-column>
  293. <el-table-column
  294. prop="count"
  295. label="任务次数"
  296. align="center"
  297. width="120px"
  298. v-if="columns[9].visible"
  299. ></el-table-column>
  300. <el-table-column
  301. prop="planStatus"
  302. label="任务状态"
  303. align="center"
  304. width="120px"
  305. v-if="columns[10].visible"
  306. >
  307. <template slot-scope="r"
  308. >{{ getLabel(dict.type.check_status, `${r.row.planStatus}`) }}
  309. </template>
  310. </el-table-column>
  311. <el-table-column
  312. prop="modifiedName"
  313. label="修改人"
  314. v-if="false"
  315. ></el-table-column>
  316. <el-table-column
  317. prop="updateTime"
  318. label="修改时间"
  319. width="80px"
  320. v-if="false"
  321. >
  322. <template slot-scope="scope">
  323. <span>{{
  324. formatTime(scope.row.updateTime, "YYYY-MM-DD")
  325. }}</span>
  326. </template>
  327. </el-table-column>
  328. <el-table-column
  329. label="操作"
  330. width="200"
  331. fixed="right"
  332. align="center"
  333. >
  334. <template slot-scope="r">
  335. <el-button
  336. type="text"
  337. size="mini"
  338. icon="el-icon-arrow-down"
  339. v-if="showPublish(r.row)"
  340. @click="showDialogDistribute(r.row)"
  341. v-hasPermi="['core:checkplan:distribute']"
  342. >下发</el-button
  343. >
  344. <el-button
  345. type="text"
  346. icon="el-icon-top-left"
  347. size="mini"
  348. v-if="showWithDraw(r.row)"
  349. @click="chhuile(r.row)"
  350. v-hasPermi="['core:checkplan:distribute']"
  351. >撤回</el-button
  352. >
  353. <el-button
  354. v-if="eqOrg(r.row)"
  355. size="mini"
  356. type="text"
  357. icon="el-icon-edit-outline"
  358. @click="onEdit(r.row.id)"
  359. v-hasPermi="['core:checkplan:edit']"
  360. >编辑</el-button
  361. >
  362. <el-button
  363. v-if="showDelete(r.row)"
  364. size="mini"
  365. type="text"
  366. icon="el-icon-delete"
  367. @click="onDel(r.row)"
  368. v-hasPermi="['core:checkplan:remove']"
  369. >删除</el-button
  370. >
  371. </template>
  372. </el-table-column>
  373. </el-table>
  374. <pagination
  375. v-show="total > 0"
  376. :total="total"
  377. :page.sync="queryParams.pageNum"
  378. :limit.sync="queryParams.pageSize"
  379. @pagination="getList"
  380. />
  381. </div>
  382. </el-col>
  383. </el-row>
  384. <dialog-edit
  385. ref="editDialog"
  386. @success="getList()"
  387. :orgTypeOptions="orgTypeOptions"
  388. :ruleTypeOptions="dict.type.rule_type"
  389. ></dialog-edit>
  390. <DialogDistribute ref="dialogDistribute" @select="sel"></DialogDistribute>
  391. <DialogThreeState ref="DialogThreeState"> </DialogThreeState>
  392. </div>
  393. </template>
  394. <script>
  395. import DialogDistribute from "./distribute.vue";
  396. import OrgTree from "@/components/orgTree/orgQuerySelector.vue";
  397. import { mapState, mapMutations, mapGetters } from "vuex";
  398. import DialogEdit from "./dialog.edit";
  399. import * as api from "@/api/safetycheck/plan";
  400. import { statusOptions, getLabel } from "@/views/commonOption";
  401. import { listRole } from "@/api/system/role";
  402. import DialogThreeState from "@/components/message/threeStateMessageBox.vue";
  403. export default {
  404. name: "resumptionplan",
  405. dicts: [
  406. "sys_org_type",
  407. "rule_type",
  408. "check_cycle",
  409. "check_status",
  410. "check_type",
  411. ],
  412. components: {
  413. DialogEdit,
  414. OrgTree,
  415. DialogDistribute,
  416. DialogThreeState,
  417. },
  418. data() {
  419. const { params, query } = this.$route;
  420. return {
  421. isShow: false,
  422. loading: false,
  423. ids: [],
  424. // 非单个停用
  425. single: true,
  426. // 非多个停用
  427. multiple: true,
  428. // 显示搜索条件
  429. showSearch: true,
  430. resumptionRoles: [],
  431. total: 0,
  432. queryParams: {
  433. id: null,
  434. planName: null,
  435. checkRole: null,
  436. planCycle: null,
  437. planCreateOrgId: null,
  438. checkType: null,
  439. planOfOrgId: null,
  440. execOrgType: null,
  441. checkOrgType: null,
  442. planStatus: null,
  443. pageSize: 10,
  444. pageNum: 1,
  445. checkSub: false,
  446. orgId: null,
  447. ...query,
  448. },
  449. pageData: [],
  450. // 列信息
  451. columns: [
  452. { key: 0, label: `序号`, visible: true },
  453. { key: 1, label: `任务名称`, visible: true },
  454. { key: 2, label: `任务类型`, visible: true },
  455. { key: 3, label: `创建机构`, visible: true },
  456. { key: 4, label: `行社名称`, visible: true },
  457. { key: 5, label: `检查主体`, visible: true },
  458. { key: 6, label: `受检机构`, visible: true },
  459. { key: 7, label: `检查人员`, visible: true },
  460. { key: 8, label: `任务周期`, visible: true },
  461. { key: 9, label: `任务次数`, visible: true },
  462. { key: 10, label: `任务状态`, visible: true },
  463. ],
  464. };
  465. },
  466. props: {},
  467. watch: {},
  468. computed: {
  469. ...mapState([]),
  470. ...mapGetters(["orgId", "orgName"]),
  471. orgTypeOptions() {
  472. if (!this.dict || !this.dict.type.sys_org_type == null) {
  473. return [];
  474. }
  475. return this.dict.type.sys_org_type.filter(
  476. (t) => !["7", "8"].includes(t.value)
  477. );
  478. },
  479. },
  480. methods: {
  481. ...mapMutations([]),
  482. //判断是否跟当前用户同机构
  483. eqOrg(row) {
  484. // console.log(row.planOfOrgId,"row.planOfOrgId");
  485. // console.log(this.orgId,"this.orgId");
  486. if (
  487. row != null &&
  488. row != undefined &&
  489. (row.planCreateOrgId == this.orgId ||
  490. (row.planOfOrgType == 3 && row.planOfOrgId == this.orgId))
  491. ) {
  492. return true;
  493. }
  494. return false;
  495. },
  496. showDialogDistribute(row) {
  497. //行社的计划,或检查机构类型是省联社、办事处,走单个下发
  498. if (
  499. row.planOfOrgType == 3 ||
  500. row.execOrgType == 1 ||
  501. row.execOrgType == 2
  502. ) {
  503. this.onSinglePlanDistribute(row);
  504. } else {
  505. this.$refs.dialogDistribute.show(row);
  506. }
  507. },
  508. onSinglePlanDistribute(row) {
  509. if (row.planStatus == 0) {
  510. if (row.planCycle == 6) {
  511. //无周期任务,
  512. let msg = "确定下发任务并立即生成任务?";
  513. this.$modal.confirm(msg).then(() => {
  514. this.distributeSingle(row.id, true);
  515. });
  516. } else {
  517. let msg = "请选择下发后立即生成或下周期生成任务";
  518. this.$refs["DialogThreeState"].show(
  519. msg,
  520. (state) => {
  521. if (state == 0 || state == 1) {
  522. this.distributeSingle(row.id, state == 1);
  523. }
  524. },
  525. {
  526. yesText: "立即生成",
  527. noText: "下周期",
  528. cancelText: "取消",
  529. }
  530. );
  531. }
  532. } else if (row.planStatus == 2) {
  533. let msg = "";
  534. if (row.planCycle == 6) {
  535. msg = "已存在已完成任务,是否确定下发?";
  536. } else {
  537. msg = "因存在已完成任务,是否确定从下周期生成任务?";
  538. }
  539. this.$modal
  540. .confirm(msg, {
  541. confirmButtonText: "确定",
  542. canelButtonText: "取消",
  543. })
  544. .then(() => {
  545. this.distributeSingle(row.id, false);
  546. });
  547. } else {
  548. this.distributeSingle(row.id, false);
  549. }
  550. },
  551. distributeSingle(id, immediateEffect) {
  552. this.loading = true;
  553. api
  554. .distributeSingle(id, immediateEffect)
  555. .then((response) => {
  556. // console.log(response, "then");
  557. if (response.data == 0) {
  558. this.loading = false;
  559. } else {
  560. this.getList();
  561. this.loading = false;
  562. }
  563. })
  564. .catch((response) => {
  565. // console.log(response, "catch");
  566. this.getList();
  567. this.loading = false;
  568. });
  569. },
  570. showPublish(row) {
  571. //有父计划且父计划不是使用中状态,不能下发
  572. if (row.parentStatus != 1 && row.parentId > 0) {
  573. return false;
  574. }
  575. //可以下发:本机构创建+状态为草稿、停用的计划
  576. if (
  577. row.planCreateOrgId == this.orgId &&
  578. (row.planStatus == 0 || row.planStatus == 2)
  579. ) {
  580. return true;
  581. }
  582. // if (
  583. // row.planOfOrgId == this.orgId &&
  584. // row.planCreateOrgId != this.orgId &&
  585. // (row.planStatus == 0 || row.planStatus == 2) &&
  586. // row.distributePlanStatus == 0
  587. // ) {
  588. // return true;
  589. // }
  590. return false;
  591. },
  592. showDelete(row) {
  593. //本机构创建的计划,才能删除
  594. return row.planCreateOrgId == this.orgId && row.planOfOrgId == this.orgId;
  595. },
  596. showWithDraw(row) {
  597. //本机构创建是自己+状态为使用中
  598. if (row.planCreateOrgId == this.orgId && row.planStatus == 1) {
  599. return true;
  600. }
  601. // if (
  602. // row.planOfOrgId == this.orgId &&
  603. // row.planCreateOrgId != this.orgId &&
  604. // row.planStatus == 1 &&
  605. // row.distributePlanStatus == 0
  606. // ) {
  607. // return true;
  608. // }
  609. return false;
  610. },
  611. splitRoleNames(val) {
  612. if (val != null && val != undefined) {
  613. return val.split(",");
  614. } else {
  615. return [];
  616. }
  617. // 使用逗号分割字符串,得到角色名称的数组
  618. },
  619. sel(selectList, row) {
  620. let msg = "";
  621. if (row.planStatus == 0) {
  622. if (row.planCycle == 6) {
  623. //无周期任务,
  624. let msg = "确定下发任务并立即生成任务?";
  625. this.$modal.confirm(msg).then(() => {
  626. this.distributeInner(selectList, true);
  627. });
  628. } else {
  629. msg = "请选择下发后立即生成或下周期生成任务。";
  630. this.$refs["DialogThreeState"].show(
  631. msg,
  632. (state) => {
  633. if (state == 0 || state == 1) {
  634. this.distributeInner(selectList, state == 1);
  635. }
  636. },
  637. {
  638. yesText: "立即生成",
  639. noText: "下周期",
  640. cancelText: "取消",
  641. }
  642. );
  643. }
  644. } else if (row.planStatus == 2) {
  645. if (row.planCycle == 6) {
  646. msg = "已存在已完成任务,是否确定下发?";
  647. } else {
  648. msg = "因存在已完成任务,是否确定从下周期生成任务?";
  649. }
  650. this.$modal.confirm(msg).then(() => {
  651. this.distributeInner(selectList, false);
  652. });
  653. } else {
  654. this.distributeInner(selectList, false);
  655. }
  656. },
  657. distributeInner(selectList, imme) {
  658. this.loading = true;
  659. api
  660. .distribute(selectList, imme)
  661. .then((response) => {
  662. this.getList();
  663. this.loading = false;
  664. })
  665. .catch(() => {
  666. this.loading = false;
  667. });
  668. },
  669. //开始撤回
  670. chhuile(row) {
  671. if (row.planCycle == "6" && row.taskHasCompleted == 1) {
  672. //无周期任务有已完成时,不能撤回
  673. this.$modal.alertSuccess(
  674. "存在已完成任务,无周期任务不允许撤回,如需删除下发任务请点击“删除”。"
  675. );
  676. return;
  677. }
  678. let msg;
  679. if (row.taskHasCompleted != 1) {
  680. msg = "因不存在已完成任务,撤回后将删除所有生成任务?";
  681. } else {
  682. msg = "因存在已完成任务,撤回后下周期起将不再生成任务?";
  683. }
  684. this.$modal
  685. .confirm(msg, "提示")
  686. .then(() => {
  687. // 用户点击了确认按钮
  688. // console.log("执行操作...");
  689. this.loading = true;
  690. api.cheHui(row.id).then((response) => {
  691. this.getList();
  692. this.loading = false;
  693. });
  694. })
  695. .catch(() => {
  696. // 用户点击了取消按钮
  697. // console.log("取消操作...");
  698. });
  699. },
  700. // //已下发的显示撤回
  701. // chehui(row) {
  702. // if (row.distribute == 1 && row.planCreateOrgId == this.orgId) {
  703. // return true;
  704. // }
  705. // return false;
  706. // },
  707. // showDialogDistribute(row) {
  708. // console.log(row, "qqq");
  709. // this.$refs.dialogDistribute.show(row);
  710. // },
  711. getRolesByOrg() {
  712. let params = {
  713. // orgId:this.queryParams.orgId
  714. };
  715. listRole(params).then((res) => {
  716. // console.info(res);
  717. this.resumptionRoles = res.rows;
  718. });
  719. },
  720. getList() {
  721. this.loading = true;
  722. console.info(this.dict.type);
  723. api
  724. .list(this.queryParams)
  725. .then((response) => {
  726. this.pageData = response.rows;
  727. this.total = response.total;
  728. this.loading = false;
  729. })
  730. .catch(() => {
  731. this.loading = false;
  732. });
  733. },
  734. getDefaultKey(key) {
  735. this.queryParams.orgId = key;
  736. this.getList();
  737. },
  738. handleAdd(id, other = {}) {
  739. id = null;
  740. this.$refs.editDialog.show(id, other);
  741. },
  742. onEdit(id, other = {}) {
  743. this.$refs.editDialog.show(id, other);
  744. },
  745. async onDel(row) {
  746. let msg = "";
  747. if (row.planStatus == 0) {
  748. msg = '是否确认删除名称为"' + row.planName + '"的任务?';
  749. } else if (row.planStatus == 1) {
  750. msg = "本次删除将强制删除当前任务时间及以后所有任务";
  751. } else if (row.planStatus == 2) {
  752. if (row.hasTaskCurrentCycle) {
  753. msg = "本次删除将强制删除当前任务时间及以后所有任务";
  754. } else {
  755. msg = '是否确认删除名称为"' + row.planName + '"的任务?';
  756. }
  757. }
  758. this.$modal
  759. .confirm(msg)
  760. .then(() => {
  761. // 用户点击了确认按钮
  762. // console.log("执行操作...");
  763. this.loading = true;
  764. api
  765. .delelte(row.id)
  766. .then(() => {
  767. this.getList();
  768. this.loading = false;
  769. this.$modal.msgSuccess("删除成功");
  770. })
  771. .catch(() => {
  772. this.loading = false;
  773. });
  774. })
  775. .catch((ex) => {
  776. console.error(ex);
  777. // 用户点击了取消按钮
  778. // console.log("取消操作...");
  779. });
  780. },
  781. // 多选框选中数据
  782. handleSelectionChange(selection) {
  783. this.ids = selection.map((item) => item.userId);
  784. this.single = selection.length != 1;
  785. this.multiple = !selection.length;
  786. },
  787. /** 重置按钮操作 */
  788. resetQuery() {
  789. this.resetForm("search");
  790. this.queryParams.orgId = this.orgId;
  791. this.queryParams.checkSub = false;
  792. this.$refs["orgTree"].setCheckSub(this.queryParams.checkSub);
  793. // this.$refs.tree.setCurrentKey(null);
  794. this.getList();
  795. },
  796. //单选框状态改变
  797. checkChange(state) {
  798. this.queryParams.checkSub = state;
  799. this.getList();
  800. },
  801. // 节点单击事件
  802. clickTreeNode(data) {
  803. this.queryParams.orgId = data.id;
  804. this.getList();
  805. },
  806. getStatusLabel(value) {
  807. return getLabel(statusOptions, value);
  808. },
  809. getLabel(options, value) {
  810. return getLabel(options, value);
  811. },
  812. //apimark//
  813. },
  814. mounted() {},
  815. };
  816. </script>
  817. <style lang="scss" scoped>
  818. .brand {
  819. }
  820. </style>