processMange.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785
  1. <template>
  2. <div class="process-mange-wrap">
  3. <!-- <el-card shadow="always" :body-style="{ padding: '20px' }"> -->
  4. <el-row>
  5. <el-col :xs="24" :md="8" :xl="8" class="col">
  6. <div class="statistic-wrap">
  7. <div class="discription">
  8. <span class="title">已完成</span>
  9. <span class="sub-title">已经完成的生产任务数</span>
  10. </div>
  11. <span class="data">{{ doneNum }}</span>
  12. </div>
  13. </el-col>
  14. <el-col :xs="24" :md="8" :xl="8" class="col">
  15. <div class="statistic-wrap">
  16. <div class="discription">
  17. <span class="title">进行中</span>
  18. <span class="sub-title">正在进行的生产任务数</span>
  19. </div>
  20. <span class="data">{{ doingNum }}</span>
  21. </div>
  22. </el-col>
  23. <!-- <el-col :xs="24" :md="8" :xl="8" class="col">
  24. <div class="statistic-wrap">
  25. <div class="discription">
  26. <span class="title">完成</span>
  27. <span class="sub-title">已经完成的管道</span>
  28. </div>
  29. <span class="data">0</span>
  30. </div>
  31. </el-col> -->
  32. </el-row>
  33. <!-- </el-card> -->
  34. <div class="main-area">
  35. <div class="show-header">
  36. <h3 class="header">管道列表</h3>
  37. <div class="search-list">
  38. <div class="search-tab">
  39. <el-radio-group v-model="taskType" v-show="false">
  40. <el-radio-button :label="1">我的处理</el-radio-button>
  41. <el-radio-button :label="2">其他处理</el-radio-button>
  42. </el-radio-group>
  43. <el-radio-group
  44. class="btn-list-two"
  45. v-model="queryParams.taskProcessState"
  46. @change="getList"
  47. >
  48. <el-radio-button label="3">已完成</el-radio-button>
  49. <el-radio-button label="0">进行中</el-radio-button>
  50. <!-- <el-radio-button label="">所有</el-radio-button> -->
  51. </el-radio-group>
  52. </div>
  53. <div class="search-input">
  54. <el-input
  55. placeholder="请输入..."
  56. v-model="queryString"
  57. @keyup.enter.native="getList"
  58. >
  59. <el-button
  60. slot="append"
  61. icon="el-icon-search"
  62. @click="getList"
  63. ></el-button>
  64. </el-input>
  65. </div>
  66. </div>
  67. </div>
  68. <div class="show-body">
  69. <!-- 流程任务列表 -->
  70. <el-table :data="tableData" border stripe>
  71. <el-table-column type="selection" width="55" align="center" />
  72. <el-table-column type="index" width="50" align="center" />
  73. <el-table-column
  74. v-for="col in newColumn"
  75. :prop="col.prop"
  76. :key="col.prop"
  77. :label="col.label"
  78. align="center"
  79. >
  80. <template slot-scope="scope">
  81. <span v-if="col.prop == 'benCreateTime'">{{
  82. scope.row.benCreateTime.replace("T", " ")
  83. }}</span>
  84. <span v-else-if="col.prop == 'bepTaskProcessType'">{{
  85. getDictLabel(scope.row.bepTaskProcessType, dict.type.bpm_type)
  86. }}</span>
  87. <span v-else-if="col.prop == 'benTaskNodeState'">{{
  88. scope.row.benTaskNodeState == "0" ? "未执行" : "已执行"
  89. }}</span>
  90. <span v-else-if="col.prop == 'bepTaskProcessState'">{{
  91. getDictLabel(
  92. scope.row.bepTaskProcessState,
  93. dict.type.task_process_state
  94. )
  95. }}</span>
  96. <span v-else>{{ scope.row[col.prop] }}</span>
  97. </template>
  98. </el-table-column>
  99. <el-table-column label="操作" align="center">
  100. <template slot-scope="scope">
  101. <div class="excute-wrap">
  102. <el-button
  103. type="warning"
  104. plain
  105. size="small"
  106. class="mr10 mb5"
  107. v-show="scope.row.bepTaskProcessState == '0'"
  108. @click="opneExecuteNode(scope.row)"
  109. >
  110. 运行
  111. </el-button>
  112. <el-dropdown>
  113. <el-button type="warning" plain size="small">
  114. 处理<i class="el-icon-arrow-down el-icon--right"></i>
  115. </el-button>
  116. <el-dropdown-menu slot="dropdown">
  117. <!-- <el-dropdown-item>
  118. <el-button
  119. size="mini"
  120. type="text"
  121. icon="el-icon-edit"
  122. @click="excuteHandler(scope.row)"
  123. v-hasPermi="['system:user:edit']"
  124. >处理
  125. </el-button>
  126. </el-dropdown-item> -->
  127. <el-dropdown-item>
  128. <el-dropdown size="mini">
  129. <el-button
  130. size="mini"
  131. type="text"
  132. icon="el-icon-d-arrow-right"
  133. >触发异常
  134. </el-button>
  135. <el-dropdown-menu slot="dropdown">
  136. <el-dropdown-item
  137. v-for="item in scope.row.exceptionScriptList"
  138. :key="item.id"
  139. >
  140. <el-button
  141. @click="exceptionTrigger(scope.row, item)"
  142. size="mini"
  143. type="text"
  144. >{{ item.scriptName }}
  145. </el-button>
  146. </el-dropdown-item>
  147. </el-dropdown-menu>
  148. </el-dropdown>
  149. </el-dropdown-item>
  150. </el-dropdown-menu>
  151. </el-dropdown>
  152. </div>
  153. </template>
  154. </el-table-column>
  155. </el-table>
  156. <!-- 分页 -->
  157. <pagination
  158. v-show="total > 0"
  159. :total="total"
  160. :page.sync="queryParams.pageNum"
  161. :limit.sync="queryParams.pageSize"
  162. @pagination="getList"
  163. />
  164. </div>
  165. <div class="show-window">
  166. <!-- 运行节点弹窗 -->
  167. <el-dialog :title="nodeTitle" :visible.sync="open">
  168. <!-- <el-form label-width="100px" :model="commonData">
  169. <h1>这里会引入当前节点需要处理的表单</h1>
  170. </el-form> -->
  171. <!-- <k-form-build
  172. v-if="formType == 'dragForm'"
  173. class="formBuild"
  174. ref="addFromRef"
  175. :dynamicData="dynamicData"
  176. :defaultValue="defaultValue"
  177. :value="jsonData"
  178. /> -->
  179. <component
  180. :is="myForm"
  181. :formData="formData"
  182. :row="row"
  183. ref="myFormRef"
  184. v-if="myForm"
  185. ></component>
  186. <!-- <QRCode :formData="formData" :row="row" ref="myFormRef" /> -->
  187. <span slot="footer" class="dialog-footer">
  188. <el-button @click="closeExecuteNode">取消</el-button>
  189. <el-button type="primary" @click="executeNode">确认运行</el-button>
  190. </span>
  191. </el-dialog>
  192. </div>
  193. </div>
  194. </div>
  195. </template>
  196. <script>
  197. import {
  198. processList,
  199. runProcessNodeExecution,
  200. getProcessNodeFormTemplate,
  201. getProcessNodeFormInfoData,
  202. } from "@/api/bpmprocess/run/executeProcess";
  203. import { triggerExceptionNode } from "@/api/bpmprocess/process";
  204. import getNodeSequence from "@/utils/bpmn/getNodeSequence";
  205. import GY02 from "./dialogCompments/GongYi/GY02.vue";
  206. import ZL01 from "./dialogCompments/ZhiLiang/ZL1.vue";
  207. import { getForm } from "@/api/dragform/form";
  208. import DialogTemplate from "@/views/dialogTemplate/components/index.vue";
  209. // 弹窗表单组件
  210. import GY01 from "./dialogCompments/GongYi/GY01.vue";
  211. import GY03 from "./dialogCompments/GongYi/GY03.vue";
  212. import CG1 from "./dialogCompments/test-component/CaiGou/CG1.vue";
  213. import CG02 from "./dialogCompments/test-component/CaiGou/CG02.vue";
  214. import KC01 from "./dialogCompments/test-component/KuCun/KC1.vue";
  215. import KC02 from "./dialogCompments/test-component/KuCun/KC02.vue";
  216. import GY06 from "./dialogCompments/GongYi/GY06.vue";
  217. import KB01 from "./dialogCompments/KongBai/KB01.vue"; //空白提示组件
  218. import SC01 from "./dialogCompments/ShengChan/SC01.vue";
  219. //Mec组件
  220. import AssignEmployees from "./dialogCompments/Mec/AssignEmployees.vue";
  221. import Notes from "./dialogCompments/Mec/Notes.vue";
  222. import Print from "./dialogCompments/Mec/Print.vue";
  223. import NodeShow from "./dialogCompments/Mec/NodeShow.vue";
  224. import RecordQuality from "./dialogCompments/Mec/RecordQuality.vue";
  225. import ProductionProcesses from "./dialogCompments/Mec/ProductionProcesses.vue";
  226. import PersonalDistribution from "./dialogCompments/Mec/PersonalDistribution.vue";
  227. import RecordSplitData from "./dialogCompments/Mec/RecordSplitData.vue";
  228. import EditFinishTime from "./dialogCompments/Mec/EditFinishTime.vue";
  229. import EditQualityCard from "./dialogCompments/Mec/EditQualityCard.vue";
  230. import FinishTask from "./dialogCompments/Mec/FinishTask.vue";
  231. import QualityControlCardSubCardProcessing from "./dialogCompments/Mec/QualityControlCardSubCardProcessing.vue";
  232. import ScrapDisposition from "./dialogCompments/Mec/ScrapDisposition.vue";
  233. import QRCode from "./dialogCompments/Mec/QRCode.vue";
  234. export default {
  235. name: "processMange",
  236. props: [],
  237. components: {
  238. GY01,
  239. DialogTemplate,
  240. CG1,
  241. CG02,
  242. KC01,
  243. GY06,
  244. GY03,
  245. KC02,
  246. GY02,
  247. KB01,
  248. SC01,
  249. ZL01,
  250. NodeShow,
  251. AssignEmployees,
  252. Notes,
  253. Print,
  254. RecordQuality,
  255. ProductionProcesses,
  256. PersonalDistribution,
  257. RecordSplitData,
  258. EditFinishTime,
  259. EditQualityCard,
  260. FinishTask,
  261. QualityControlCardSubCardProcessing,
  262. ScrapDisposition,
  263. QRCode,
  264. },
  265. dicts: ["bpm_type", "task_process_state"],
  266. data() {
  267. return {
  268. doneNum: 0, //已完成数
  269. doingNum: 0, //进行中数
  270. row: {}, //当前操作行数据
  271. myForm: "", //自定义表单组件名
  272. // 节点弹窗title
  273. nodeTitle: "节点弹窗",
  274. open: false,
  275. // 节点弹窗对应的formData
  276. commonData: {},
  277. taskType: 1,
  278. queryString: "",
  279. taskStatus: "",
  280. tableData: [], //表格数据
  281. // 查询参数
  282. queryParams: {
  283. pageNum: 1,
  284. pageSize: 10,
  285. taskProcessState: "0",
  286. taskProcessType: 0,
  287. },
  288. total: 0,
  289. columns: [
  290. {
  291. prop: "bepTaskKey",
  292. label: "任务编号",
  293. },
  294. {
  295. prop: "bepTaskName",
  296. label: "任务名称",
  297. },
  298. // {
  299. // prop: "bepTaskProcessType",
  300. // label: "任务流程类型",
  301. // },
  302. {
  303. prop: "bepTaskProcessState",
  304. label: "任务流程状态",
  305. },
  306. {
  307. prop: "benTaskNodeName",
  308. label: "节点名称",
  309. },
  310. {
  311. prop: "benTaskNodeType",
  312. label: "节点类型",
  313. },
  314. {
  315. prop: "benTaskNodeState",
  316. label: "节点状态",
  317. },
  318. {
  319. prop: "benCreateBy",
  320. label: "创建人",
  321. },
  322. {
  323. prop: "benCreateTime",
  324. label: "创建时间",
  325. },
  326. ],
  327. formType: "", //表单类型 dragForm:拖拽表单 composeForm:工艺组合表单 designForm:定制表单
  328. // k-form-build 数据
  329. dynamicData: {},
  330. tableName: "",
  331. defaultValue: {},
  332. jsonData: {},
  333. // 拖拽数据
  334. taskInfo: {},
  335. groupKey: "",
  336. subCount: {},
  337. tableCount: {},
  338. subTableName: "",
  339. // 弹窗表单渲染数据
  340. formData: {},
  341. backExceptionTaskList: ["GY06"], //特殊回退表单组件列表
  342. };
  343. },
  344. computed: {
  345. newColumn() {
  346. if (this.queryParams.taskProcessState == "3") {
  347. return [
  348. {
  349. prop: "bepTaskKey",
  350. label: "任务编号",
  351. },
  352. {
  353. prop: "bepTaskName",
  354. label: "任务名称",
  355. },
  356. // {
  357. // prop: "bepTaskProcessType",
  358. // label: "任务流程类型",
  359. // },
  360. {
  361. prop: "bepTaskProcessState",
  362. label: "任务流程状态",
  363. },
  364. {
  365. prop: "benCreateBy",
  366. label: "创建人",
  367. },
  368. {
  369. prop: "benCreateTime",
  370. label: "创建时间",
  371. },
  372. ];
  373. } else {
  374. return this.columns;
  375. }
  376. },
  377. },
  378. mounted() {
  379. this.getList();
  380. this.getDoneNumber();
  381. this.getDoingNumber();
  382. },
  383. methods: {
  384. // 获取列表数据
  385. getList() {
  386. processList({ ...this.queryParams, taskName: this.queryString }).then(
  387. (res) => {
  388. if (res.code == 200) {
  389. this.tableData = res.rows.map((item) => item.resultMap);
  390. this.total = res.total;
  391. console.log(this.tableData);
  392. } else {
  393. this.$message.error("网络异常,请稍后再试");
  394. }
  395. }
  396. );
  397. },
  398. getDoneNumber() {
  399. let params = {
  400. pageNum: 1,
  401. pageSize: 10,
  402. taskProcessState: "3",
  403. taskProcessType: 0,
  404. };
  405. processList(params).then((res) => {
  406. if (res.code == 200) {
  407. this.doneNum = res.total;
  408. } else {
  409. this.$message.error("网络异常,请稍后再试");
  410. }
  411. });
  412. },
  413. getDoingNumber() {
  414. let params = {
  415. pageNum: 1,
  416. pageSize: 10,
  417. taskProcessState: "0",
  418. taskProcessType: 0,
  419. };
  420. processList(params).then((res) => {
  421. if (res.code == 200) {
  422. this.doingNum = res.total;
  423. } else {
  424. this.$message.error("网络异常,请稍后再试");
  425. }
  426. });
  427. },
  428. // 获取表单数据
  429. async getFormData() {
  430. let formData = {};
  431. // switch (this.formType) {
  432. // case "dragForm":
  433. // try {
  434. // formData = await this.$refs.addFromRef.getData();
  435. // } catch (error) {
  436. // console.log(error);
  437. // this.$message.error("表单校验异常,请稍后重试");
  438. // return {};
  439. // }
  440. // break;
  441. // case "designForm":
  442. // let temp = await this.$refs.myFormRef.getFormData();
  443. // if (!temp.flag) {
  444. // this.$message.error(temp.msg);
  445. // return {};
  446. // } else {
  447. // formData = temp.data;
  448. // }
  449. // break;
  450. // default:
  451. // break;
  452. // }
  453. let temp = await this.$refs.myFormRef?.getFormData();
  454. console.log("temp", temp);
  455. if (!temp?.flag) {
  456. if (!temp) {
  457. //没有表单
  458. // formData.flag = true;
  459. } else {
  460. //表单数据不合法
  461. this.$message.error(temp.msg);
  462. return false;
  463. }
  464. } else {
  465. formData = temp.data;
  466. }
  467. return formData;
  468. },
  469. // 重置弹窗数据
  470. resetDialogForm() {
  471. this.formType = ""; //表单类型 dragForm:拖拽表单 composeForm:工艺组合表单 designForm:定制表单
  472. // k-form-build 数据
  473. this.dynamicData = {};
  474. this.defaultValue = {};
  475. this.jsonData = {};
  476. },
  477. // 打开运行节点弹窗
  478. async opneExecuteNode(row) {
  479. this.resetDialogForm();
  480. console.log(row);
  481. this.nodeTitle = row.benTaskNodeName;
  482. // let preFix = row.benTaskNodeName.split("-")[0];
  483. let preFix = row.benTaskNodeFormKey;
  484. let {
  485. benTaskNodeFormKey,
  486. benTaskNodeFormType,
  487. bepTaskPlanKey,
  488. bepTaskKey,
  489. bepTaskNodeKey,
  490. benTaskProcessKey,
  491. benmTaskAutomaticScriptTriggerType,
  492. bepTaskNodeNextKey,
  493. } = row;
  494. // 新的运行逻辑
  495. let payLoad = {
  496. taskNodeKey: bepTaskNodeNextKey,
  497. taskProcessKey: benTaskProcessKey,
  498. taskAutomaticScriptTriggerType: benmTaskAutomaticScriptTriggerType,
  499. taskPlanKey: bepTaskPlanKey,
  500. };
  501. // let formData = await getProcessNodeFormTemplate(payLoad);
  502. // console.log(formData);
  503. // if (benTaskNodeFormKey) {
  504. // if (benTaskNodeFormType == "dragForm") {
  505. // let templateInfo = formData.data[0]?.template;
  506. // //拖拽表单
  507. // this.formType = "dragForm";
  508. // this.jsonData = JSON.parse(templateInfo.dfVueTemplate);
  509. // this.tableName = templateInfo.dfTableName;
  510. // if (Object.keys(JSON.parse(templateInfo.dfFormSql)).length) {
  511. // this.dynamicData = JSON.parse(templateInfo.dfFormSql);
  512. // }
  513. // // await this.getDragFormInfo(benTaskNodeFormKey);
  514. // } else if (benTaskNodeFormType == "composeForm") {
  515. // //工艺组合表单
  516. // this.formType = "composeForm";
  517. // this.groupKey = benTaskNodeFormKey;
  518. // let queryPayload = {
  519. // row,
  520. // groupKey: benTaskNodeFormKey,
  521. // };
  522. // this.$nextTick(() => {
  523. // this.$refs.dialogRef.getLists(queryPayload);
  524. // });
  525. // }
  526. // } else if (preFix) {
  527. // //定制表单
  528. // this.formType = "designForm";
  529. // this.myForm = preFix;
  530. // }
  531. //定制表单
  532. this.formType = "designForm";
  533. this.myForm = preFix;
  534. let res = await getProcessNodeFormInfoData(payLoad);
  535. if (res.code == 200) {
  536. this.formData = res.data;
  537. } else {
  538. this.$message.error("网络异常,请稍后再试");
  539. }
  540. this.row = row; //记录当前行数据
  541. // if (!this.formType) return; //没有表单,直接掉运行逻辑
  542. this.open = true; // 打开弹窗
  543. this.$nextTick(() => {
  544. // this.$refs.myFormRef?.resetForm();
  545. });
  546. // 根据当前节点绑定的表单信息查询对应的表单进行展示
  547. },
  548. // 运行节点按钮 确认运行回调
  549. async executeNode() {
  550. let { benTaskNodeKey, bepTaskProcessXmlContent, implementationName } =
  551. this.row;
  552. let { nodeId, nextNodeId } = this.getNextNodeKey(
  553. benTaskNodeKey,
  554. bepTaskProcessXmlContent
  555. );
  556. // 只有完成状态的可以运行
  557. if (this.formType == "composeForm") {
  558. let res = this.$refs.dialogRef.getComposeFormData();
  559. if (!res.isSuccess) {
  560. this.$message.warning("非完成状态节点不能运行!");
  561. return;
  562. }
  563. }
  564. // return;
  565. let formData = await this.getFormData();
  566. if (!formData) return;
  567. formData.taskPlanKey = this.row.bepTaskPlanKey;
  568. let payLoad = {
  569. taskProcessKey: this.row.bepTaskKey, //当前任务流程编码
  570. taskNodeKey: nodeId, //当前执行节点唯一编码
  571. nextNodeKey: nextNodeId, //下一节点编码
  572. implementationName: this.row.benmTaskAutomaticScriptTriggerType, //当前节点绑定的脚本名
  573. // taskProcessXmlContent: this.row.bepTaskProcessXmlContent, //当前流程xml
  574. tableName: this.tableName,
  575. formDataMapString: JSON.stringify(formData), //自定义表单组件收集的表单数据
  576. taskNodeType: this.backExceptionTaskList.includes(
  577. this.row.benTaskNodeFormKey
  578. )
  579. ? "backExceptionTask"
  580. : this.row.benTaskNodeType,
  581. };
  582. let fileXML = new File(
  583. [this.row.bepTaskProcessXmlContent],
  584. this.row.bepTaskKey + ".bpmn",
  585. {
  586. type: "text/bpmn",
  587. }
  588. );
  589. const subformData = new FormData();
  590. subformData.append("fileXML", fileXML);
  591. for (let key in payLoad) {
  592. subformData.append(key, payLoad[key] == null ? "" : payLoad[key]);
  593. }
  594. runProcessNodeExecution(subformData).then((res) => {
  595. if (res.code == 200) {
  596. this.$message.success("运行成功!");
  597. this.getList();
  598. this.getDoneNumber();
  599. this.getDoingNumber();
  600. this.open = false;
  601. }
  602. });
  603. },
  604. // 获取拖拽表单数据
  605. async getDragFormInfo(fid) {
  606. try {
  607. let res = await getForm(fid);
  608. console.log(res);
  609. if (res.code == 200) {
  610. this.jsonData = JSON.parse(res.data.dfVueTemplate);
  611. this.tableName = res.data.dfTableName;
  612. if (res.data.dfFormSql) {
  613. this.dynamicData = JSON.parse(res.data.dfFormSql);
  614. console.log(this.dynamicData);
  615. }
  616. } else {
  617. console.log(res);
  618. throw new Error(res);
  619. }
  620. } catch (error) {
  621. console.log(error);
  622. this.$message.error("网络异常,请稍后再试");
  623. }
  624. },
  625. // 关闭运行节点弹窗
  626. closeExecuteNode(row) {
  627. this.open = false;
  628. },
  629. // 获取下一个节点的nodekey
  630. getNextNodeKey(nodeKey, xmlStr) {
  631. let xmlObj = this.xmlStr2XmlObj(xmlStr);
  632. let nodeSequence = getNodeSequence(xmlObj);
  633. return nodeSequence.find((item) => item.nodeId == nodeKey) || {};
  634. },
  635. // xml字符串转xml对象
  636. xmlStr2XmlObj(xmlStr) {
  637. var xmlObj = {};
  638. if (document.all) {
  639. var xmlDom = new ActiveXObject("Microsoft.XMLDOM");
  640. xmlDom.loadXML(xmlStr);
  641. xmlObj = xmlDom;
  642. } else {
  643. xmlObj = new DOMParser().parseFromString(xmlStr, "text/xml");
  644. }
  645. return xmlObj;
  646. },
  647. // 触发异常回调
  648. exceptionTrigger(row, scriptData) {
  649. // console.log(taskNodeType);
  650. let _this = this;
  651. this.$modal
  652. .confirm("是否确认触发<" + scriptData.scriptName + ">异常?")
  653. .then(function (val) {
  654. console.log(val);
  655. // 发送触发异常节点的请求
  656. let payLoad = {
  657. taskProcessKey: row.bepTaskKey,
  658. taskNodeKey: row.benTaskNodeKey,
  659. sysBpmNodeScriptVO: scriptData,
  660. taskNodeType: row.benTaskNodeType,
  661. };
  662. // 异常节点抛异常 需要下一个节点key
  663. if (row.benTaskNodeType == "exceptionTask") {
  664. let { nodeId, nextNodeId } = _this.getNextNodeKey(
  665. row.benTaskNodeKey,
  666. row.bepTaskProcessXmlContent
  667. );
  668. payLoad.taskNextNodeKey = nextNodeId;
  669. }
  670. triggerExceptionNode(payLoad).then((res) => {
  671. console.log(res);
  672. if (res.code == 200) {
  673. _this.$message.success("触发成功");
  674. _this.open = false;
  675. _this.getList();
  676. } else {
  677. _this.$message.error("触发失败请稍后再试");
  678. }
  679. });
  680. })
  681. .catch((err) => {
  682. console.log(err);
  683. _this.open = false;
  684. _this.$message.info("取消成功");
  685. });
  686. },
  687. // 获取字典对应label
  688. getDictLabel(value, dictLsit = []) {
  689. return dictLsit.find((item) => {
  690. return item.value == value;
  691. })?.label;
  692. },
  693. },
  694. };
  695. </script>
  696. <style scoped lang="scss">
  697. .process-mange-wrap {
  698. background-color: #f2f3f8;
  699. padding: 20px;
  700. .col {
  701. background-color: #fff;
  702. border-right: 1px solid #ebedf2;
  703. /* margin-right: 3px; */
  704. .statistic-wrap {
  705. /* // height: 70px; */
  706. box-sizing: border-box;
  707. display: flex;
  708. align-items: center;
  709. padding: 10px 17px;
  710. justify-content: space-between;
  711. .discription {
  712. display: flex;
  713. flex-direction: column;
  714. .title {
  715. line-height: 20px;
  716. font-size: 18px;
  717. font-weight: 700;
  718. margin-bottom: 5px;
  719. }
  720. .sub-title {
  721. font-size: 14px;
  722. }
  723. }
  724. .data {
  725. font-size: 20px;
  726. font-weight: 700;
  727. }
  728. }
  729. }
  730. .main-area {
  731. margin-top: 30px;
  732. box-shadow: 0 1px 15px 1px rgb(69 65 78 / 8%);
  733. background-color: #fff;
  734. .show-header {
  735. border-bottom: 1px solid #ebedf2;
  736. display: flex;
  737. align-items: center;
  738. justify-content: space-between;
  739. padding: 0px 20px 0px 20px;
  740. height: 70px;
  741. /* .header {
  742. } */
  743. .search-list {
  744. display: flex;
  745. .search-tab {
  746. margin-right: 20px;
  747. .btn-list-two {
  748. margin-left: 10px;
  749. }
  750. }
  751. }
  752. }
  753. .show-body {
  754. padding: 25px;
  755. }
  756. }
  757. }
  758. </style>