bfsjList.vue 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193
  1. <template>
  2. <div class="flex-box">
  3. <div :span="24" class="flex-header">
  4. <Tabs :tabList="tabListMain" @status="clickTabMains">
  5. </Tabs>
  6. <el-button v-if="clickTagName == 'first'" type="primary" @click="clickNewTag()">+新建</el-button>
  7. </div>
  8. <div class="flex-count">
  9. <Table v-loading="loading" @clickDemand="clickDemand" :list="lableTable" ref="TableList" @changeNum="changeNum"
  10. @changeSize="changeSize">
  11. </Table>
  12. </div>
  13. <el-dialog :title="dialogTitle" :visible.sync="dialogStatus" width="100%" :before-close="handleClose" :modal="false"
  14. v-if="dialogStatus" :destroy-on-close="true">
  15. <!-- 后期维护 -->
  16. <div style="position: fixed; z-index: 10000;top: 55px;">
  17. <el-button type="primary" v-if="startStatus" @click="clickHandles">处理</el-button>
  18. <el-button type="primary" v-if="closeStatus" @click="handleClose">关闭</el-button>
  19. <el-button type="primary" v-if="saveStatus" @click="clickSave">保存</el-button>
  20. </div>
  21. <el-form ref="form" :model="fromList" :rules="rule" label-width="85px" style="margin-top: 30px">
  22. <div style="text-align: center; font-size: 24px;">备份数据恢复</div>
  23. <div class="flex-header">
  24. <el-form-item label="工单号:">
  25. <el-input v-model="fromList.workOrderNo" disabled></el-input>
  26. </el-form-item>
  27. <el-form-item label="标题:" prop="needName">
  28. <el-input v-model="fromList.needName" :disabled="disabled"></el-input>
  29. </el-form-item>
  30. </div>
  31. <div class="flex-header">
  32. <el-form-item label="申请人:">
  33. <el-input v-model="fromList.proposer" disabled></el-input>
  34. </el-form-item>
  35. <el-form-item label="申请时间:">
  36. <el-input v-model="fromList.proposerTime" disabled></el-input>
  37. </el-form-item>
  38. </div>
  39. <div class="" style="margin: 1%; border-bottom: 1px solid #e1e1e1;">
  40. <el-form-item label="申请内容:" prop="proposerContent">
  41. <el-input type="textarea" v-model="fromList.proposerContent" maxlength="500" show-word-limit
  42. :disabled="disabled"></el-input>
  43. </el-form-item>
  44. </div>
  45. <div class="flex-load" style="display: flex; flex-direction: column">
  46. <el-form-item label="上传附件:" :disabled="disabled" prop="mkFileShareAttachList">
  47. <my-upload v-if="!disabled" @uploadBack="uploadBack" @delloadBack="delloadBack"
  48. @clickDownload="download" :fileInfo="fileInfo" :fileList="fromList.mkFileShareAttachList"
  49. style="width: 30% !important"></my-upload>
  50. <div v-if="fromList.taskName != '填写备份数据申请'">
  51. <div v-for="(item, index) in fromList.mkFileShareAttachList" :key="index">
  52. <span style="color: blue;cursor: pointer;" @click="downloadOne(item)">{{
  53. item.fileName
  54. }}</span>
  55. </div>
  56. </div>
  57. </el-form-item>
  58. </div>
  59. </el-form>
  60. <div v-if="dialoglablesStatus">
  61. <div class="table-title">流程追踪</div>
  62. <TableId :list="lables"></TableId>
  63. </div>
  64. </el-dialog>
  65. <div v-if="destroy">
  66. <el-dialog title="处理操作" width="100%" :visible.sync="handleStatus" :before-close="handleCloses" :modal="false"
  67. v-if="handleStatus" :destroy-on-close="true">
  68. <Workflow :list="fromList" v-if="isWorkflowStatus == true" @updateForm="updateForm"
  69. :requestForm="requestForm" />
  70. <WorkflowEntrance :list="fromList" v-else :lastManList="lastManList" @beforeClose="updateForm"
  71. :requestForm="requestForm" />
  72. <!-- 后期维护 -->
  73. </el-dialog>
  74. </div>
  75. </div>
  76. </template>
  77. <script>
  78. import Tabs from "../../../components/el-tabs";
  79. import Table from "../../../components/el-form";
  80. import TableId from "../../../components/el-formid";
  81. import Seach from "../../../components/el-search";
  82. import myUpload from "../../../components/workflowUpload";
  83. import Workflow from "../../../components/workflowBase";
  84. import WorkflowEntrance from "../../../components/workflowEntrance";
  85. import getConfig from '../../../config/dev.js'
  86. import {
  87. getTodoBase,
  88. getDoneBase,
  89. getInitiateBase,
  90. getNowdata,
  91. } from "../../../http/api.js";//../../../http/api.js
  92. import { log } from "console";
  93. export default {
  94. components: {
  95. Table,
  96. TableId,
  97. Tabs,
  98. myUpload,
  99. Workflow,
  100. Seach,
  101. WorkflowEntrance
  102. },
  103. data() {
  104. let _self = this
  105. return {
  106. loading: false,
  107. isWorkflowStatus: true, //默认展示模式组件,为true时展示多人处理组件
  108. lastManList: [],
  109. rule: {
  110. proposerContent: [
  111. { required: true, message: "请添加备注", trigger: "blur" },
  112. ],
  113. needName: [
  114. { required: true, message: "请添加标题", trigger: "blur" },
  115. ],
  116. },
  117. form: {
  118. }, //表单数据
  119. fromList: {
  120. }, //表单数据
  121. fileInfo: {
  122. type: "bt1n",
  123. typename: "上传文件",
  124. // limit: 5,
  125. url: "/market/waf/uploadByMinio",
  126. fileList: [],
  127. },
  128. list: {},
  129. disabled: false,
  130. pageNo: 1,//页码
  131. destroy: false,//处理
  132. handleStatus: false,//处理
  133. tableName: "BFSJ_process",
  134. request_form: {
  135. userId: "",
  136. userName: "",
  137. path: this.$router.currentRoute.name,
  138. userCode: JSON.parse(window.sessionStorage.userInfo).loginNo,
  139. // path:this.$roter.options.routers,
  140. // nextDealMan:'',
  141. title: "title",
  142. businessKey: "1",
  143. processDefinitionKey: "BFSJ_process",//流程key
  144. },
  145. requestForm: {
  146. // fresourceId: "524e01f7-b25d-11ed-886f-d6cd97160e00", // 本地环境
  147. // fresourceId: "dbd83414-b25f-11ed-be6b-00505687dcd3", // 91环境
  148. fresourceId: getConfig().bfsjList,
  149. processDefinitionKey: "BFSJ_process",
  150. },
  151. dialogStatus: false, //dialog显示
  152. dialoglablesStatus: true, //dialogL流程追踪显示
  153. clickTagNameTop: 'First',//头部tab
  154. clickTagName: 'first',
  155. dialogTitle: '',//dialogtit
  156. startStatus: false,//处理状态按钮
  157. closeStatus: false, //关闭按钮状态
  158. saveStatus: false, //保存按钮状态
  159. lables: {
  160. height: "400",
  161. titledata: [
  162. {
  163. label: "环节名称",
  164. prop: "taskName",
  165. width: 300,
  166. },
  167. {
  168. label: "处理人",
  169. prop: "assignee",
  170. width: 300,
  171. },
  172. {
  173. label: "到达时间",
  174. prop: "startTime",
  175. width: 300,
  176. },
  177. {
  178. label: "处理时间",
  179. prop: "endTime",
  180. width: 300,
  181. },
  182. {
  183. label: "回复意见",
  184. prop: "content",
  185. width: 300,
  186. },
  187. ], //表格头
  188. data: [], //内容数据
  189. loading: true,
  190. pageData: {
  191. total: 0, // 总条数
  192. pageSizes: 10, // 每页数量
  193. pageNum: 1, // 页码
  194. },
  195. isSelection: false, // 表格有多选时设置
  196. isOperation: false, // 表格有操作列时设置
  197. isIndex: true, // 列表序号
  198. operation: {
  199. // 表格有操作列时设置
  200. label: "操作", // 列名
  201. width: "50", // 根据实际情况给宽度
  202. data: [
  203. {
  204. label: "操作", // 操作名称
  205. type: "", //按钮类型
  206. handleRow: function () { }, // 自定义事件
  207. },
  208. ],
  209. },
  210. },
  211. tabListMain: [
  212. {
  213. index: "first",
  214. label: "我的待办",
  215. number: 1,
  216. name: "prosss_key",
  217. },
  218. {
  219. index: "two",
  220. label: "我的已办",
  221. number: 2,
  222. },
  223. {
  224. index: "three",
  225. label: "我发起的",
  226. number: 3,
  227. },
  228. ],
  229. lableTable: {},//传给子组件table
  230. firstlabel: {
  231. height: "400",
  232. titledata: [
  233. {
  234. label: "标题",
  235. prop: "need_name",
  236. width: 400,
  237. },
  238. {
  239. label: "申请人",
  240. prop: "proposer",
  241. width: 400,
  242. },
  243. {
  244. label: "申请时间",
  245. prop: "proposer_time",
  246. width: 400,
  247. },
  248. {
  249. label: "当前环节",
  250. prop: "taskName",
  251. width: 400,
  252. },
  253. ], //表格头
  254. data: [], //内容数据
  255. loading: true,
  256. pageData: {
  257. total: 10, // 总条数
  258. pageSizes: 10, // 每页数量
  259. pageNum: 1, // 页码
  260. },
  261. isSelection: false, // 表格有多选时设置
  262. isOperation: false, // 表格有操作列时设置
  263. isIndex: false, // 列表序号
  264. operation: {
  265. // 表格有操作列时设置
  266. label: "操作", // 列名
  267. width: "50", // 根据实际情况给宽度
  268. data: [
  269. {
  270. label: "操作", // 操作名称
  271. type: "", //按钮类型
  272. handleRow: function () { }, // 自定义事件
  273. },
  274. ],
  275. },
  276. },
  277. twolabel: {
  278. height: "400",
  279. titledata: [
  280. {
  281. label: "标题",
  282. prop: "need_name",
  283. width: 400,
  284. },
  285. {
  286. label: "申请人",
  287. prop: "proposer",
  288. width: 400,
  289. },
  290. {
  291. label: "申请时间",
  292. prop: "proposer_time",
  293. width: 400,
  294. },
  295. {
  296. label: "当前环节",
  297. prop: "taskName",
  298. width: 400,
  299. },
  300. ], //表格头
  301. data: [], //内容数据
  302. loading: true,
  303. pageData: {
  304. total: 10, // 总条数
  305. pageSizes: 10, // 每页数量
  306. pageNum: 1, // 页码
  307. },
  308. isSelection: false, // 表格有多选时设置
  309. isOperation: false, // 表格有操作列时设置
  310. isIndex: false, // 列表序号
  311. operation: {
  312. // 表格有操作列时设置
  313. label: "操作", // 列名
  314. width: "50", // 根据实际情况给宽度
  315. data: [
  316. {
  317. label: "操作", // 操作名称
  318. type: "", //按钮类型
  319. handleRow: function () { }, // 自定义事件
  320. },
  321. ],
  322. },
  323. },
  324. threelabel: {
  325. height: "400",
  326. titledata: [
  327. {
  328. label: "标题",
  329. prop: "need_name",
  330. width: 400,
  331. },
  332. {
  333. label: "申请人",
  334. prop: "proposer",
  335. width: 400,
  336. },
  337. {
  338. label: "申请时间",
  339. prop: "proposer_time",
  340. width: 400,
  341. },
  342. {
  343. label: "当前环节",
  344. prop: "taskName",
  345. width: 400,
  346. },
  347. {
  348. label: "当前处理人",
  349. prop: "currentMan",
  350. width: 400,
  351. },
  352. ], //表格头
  353. data: [], //内容数据
  354. loading: true,
  355. pageData: {
  356. total: 10, // 总条数
  357. pageSizes: 10, // 每页数量
  358. pageNum: 1, // 页码
  359. },
  360. isSelection: false, // 表格有多选时设置
  361. isOperation: false, // 表格有操作列时设置
  362. isIndex: false, // 列表序号
  363. operation: {
  364. // 表格有操作列时设置
  365. label: "操作", // 列名
  366. width: "50", // 根据实际情况给宽度
  367. data: [
  368. {
  369. label: "操作", // 操作名称
  370. type: "", //按钮类型
  371. handleRow: function () { }, // 自定义事件
  372. },
  373. ],
  374. },
  375. },
  376. filterData: {
  377. timeSelect: false, //是否显示日期控件
  378. sreach: true,
  379. restet: false,
  380. elinput: [
  381. {
  382. name: "材料名称", //提示语275
  383. key: "materialName", //字段名
  384. width: 275, //宽度
  385. },
  386. ],
  387. },
  388. savestatusBtn: false,
  389. searchBox: {},
  390. }
  391. },
  392. methods: {
  393. clickNewTag(v) {
  394. this.$http({
  395. url: "/market/bfsjProcess/getNeedNo",
  396. method: "post",
  397. headers: {
  398. "Content-Type": "application/json",
  399. },
  400. data: {},
  401. }).then((res) => {
  402. console.log(res);
  403. this.fromList = {
  404. workOrderNo: res.data.body,
  405. proposer: JSON.parse(window.sessionStorage.getItem('userInfo')).loginName,
  406. proposerNo: JSON.parse(window.sessionStorage.getItem('userInfo')).loginNoStr,
  407. proposerTime: getNowdata({ a: '-', b: ' ', c: ':' }),
  408. }
  409. let mkFileShareAttachList = [];
  410. mkFileShareAttachList = v;
  411. this.$set(this.fromList, "mkFileShareAttachList", mkFileShareAttachList);
  412. });
  413. this.lables.data = []
  414. this.startStatus = true;
  415. this.saveStatus = true;
  416. this.closeStatus = true;
  417. this.dialogStatus = true;
  418. this.isWorkflowStatus = true;
  419. this.dialoglablesStatus = true
  420. this.dialogTitle = "新建工单";
  421. this.disabled = false;
  422. },
  423. //是否最后一个人
  424. async getLastName() {
  425. console.log(this.fromList);
  426. let list = {
  427. procinstid: this.fromList.processId,
  428. taskid: this.fromList.taskId,
  429. // taskId:e.taskId
  430. };
  431. let _this = this;
  432. let obj = {
  433. url: this.$url.formList.getLastName, //流程追踪接口
  434. data: list,
  435. // status: "form",
  436. headers: {
  437. "Content-Type": "application/json",
  438. },
  439. };
  440. let res = await this.common.httpPost(obj, success);
  441. function success(data) {
  442. _this.isWorkflowStatus = data.lastMan == false ? false : true;
  443. _this.lastManList = data;
  444. // console.log(_this.isWorkflowStatus);
  445. }
  446. },
  447. downloadOne(e) {
  448. let list = {
  449. id: e.fileCode,
  450. fileName: e.fileName,
  451. };
  452. this.$http({
  453. url: "/market/waf/downFileByMinio",
  454. method: "post",
  455. headers: {
  456. "Content-Type": "application/json",
  457. },
  458. responseType: "blob",
  459. data: list,
  460. }).then((response) => {
  461. console.log(response);
  462. if (window.navigator && window.navigator.msSaveOrOpenBlob) {
  463. let blob = new Blob([response.data], {
  464. type: "application/vnd.ms-excel",
  465. });
  466. //window.navigator.msSaveOrOpenBlob(blob, this.form.needName);
  467. window.navigator.msSaveOrOpenBlob(
  468. blob,
  469. list.fileName
  470. );
  471. } else {
  472. /* 火狐谷歌的文件下载方式 */
  473. var blob = new Blob([response.data]);
  474. var downloadElement = document.createElement("a");
  475. var href = window.URL.createObjectURL(blob);
  476. downloadElement.href = href;
  477. downloadElement.download =
  478. list.fileName;
  479. document.body.appendChild(downloadElement);
  480. downloadElement.click();
  481. document.body.removeChild(downloadElement);
  482. window.URL.revokeObjectURL(href);
  483. }
  484. });
  485. },
  486. download(e) {
  487. let list = {
  488. id: e.fileCode,
  489. fileName: e.name,
  490. };
  491. this.$http({
  492. url: "/market/waf/downAllFileByMinio",
  493. method: "post",
  494. headers: {
  495. "Content-Type": "application/json",
  496. },
  497. responseType: "blob",
  498. data: list,
  499. }).then((response) => {
  500. console.log(response);
  501. if (window.navigator && window.navigator.msSaveOrOpenBlob) {
  502. let blob = new Blob([response.data], {
  503. type: "application/vnd.ms-excel",
  504. });
  505. //window.navigator.msSaveOrOpenBlob(blob, this.form.needName);
  506. window.navigator.msSaveOrOpenBlob(
  507. blob,
  508. list.fileName
  509. );
  510. } else {
  511. /* 火狐谷歌的文件下载方式 */
  512. var blob = new Blob([response.data]);
  513. var downloadElement = document.createElement("a");
  514. var href = window.URL.createObjectURL(blob);
  515. downloadElement.href = href;
  516. downloadElement.download =
  517. list.fileName;
  518. document.body.appendChild(downloadElement);
  519. downloadElement.click();
  520. document.body.removeChild(downloadElement);
  521. window.URL.revokeObjectURL(href);
  522. }
  523. });
  524. },
  525. //上传文件钩子函数
  526. clickUpload(file) { },
  527. uploadBack(v) {
  528. if (this.fromList.mkFileShareAttachList) {
  529. this.fromList.mkFileShareAttachList = [];
  530. this.fromList.mkFileShareAttachList = v;
  531. } else {
  532. let mkFileShareAttachList = [];
  533. mkFileShareAttachList = v;
  534. this.$set(this.fromList, "mkFileShareAttachList", mkFileShareAttachList);
  535. }
  536. },
  537. delloadBack(v) {
  538. this.fromList.mkFileShareAttachList = v;
  539. // this.$http({
  540. // url: "/market/waf/update",
  541. // method: "post",
  542. // headers: {
  543. // "Content-Type": "application/json",
  544. // },
  545. // data: this.fromList,
  546. // }).then((res) => {
  547. // console.log(res);
  548. // // if (res.data.result === 0) {
  549. // // this.$message.success("工作流更新成功");
  550. // // }
  551. // });
  552. },
  553. //获取页码
  554. changeNum(e) {
  555. console.log(e)
  556. this.pageNo = e;
  557. if (this.clickTagName == 'first') {
  558. this.firstlabel.pageData.pageNum = e;
  559. this.getQueryList();
  560. }
  561. if (this.clickTagName == 'two') {
  562. this.twolabel.pageData.pageNum = e;
  563. this.getQueryDone();
  564. }
  565. if (this.clickTagName == 'three') {
  566. this.threelabel.pageData.pageNum = e;
  567. this.getMeLaunch()
  568. }
  569. },
  570. //获取页码
  571. changeSize(e) {
  572. console.log(11111);
  573. },
  574. //点击工单状态跳转需求流程显示页面
  575. clickDemand(e, res) {
  576. console.log(e);
  577. this.isWorkflowStatus = true
  578. console.log(res);
  579. if (e === "标题") {
  580. if (this.clickTagName === "three") {//发起
  581. console.log(res.taskName)
  582. this.dialogTitle = "查看";
  583. this.closeStatus = true;
  584. if (res.taskName == "填写备份数据申请") {
  585. this.disabled = false;
  586. this.startStatus = true;
  587. this.saveStatus = true;
  588. this.dialoglablesStatus = true
  589. } else {
  590. this.disabled = true;
  591. this.startStatus = false;
  592. this.saveStatus = false;
  593. this.dialoglablesStatus = true
  594. }
  595. }
  596. if (this.clickTagName === "first") {//代办
  597. this.dialogTitle = "处理";
  598. if (res.taskName == "填写备份数据申请") {
  599. this.savestatusBtn = false
  600. this.disabled = false;
  601. this.startStatus = true;
  602. this.saveStatus = true;
  603. this.closeStatus = true;
  604. this.dialoglablesStatus = true
  605. } else {
  606. this.savestatusBtn = true
  607. this.disabled = true;
  608. this.closeStatus = true;
  609. this.startStatus = true;
  610. this.saveStatus = false;
  611. this.dialoglablesStatus = true
  612. }
  613. }
  614. if (this.clickTagName === "two") {//已办
  615. this.dialogTitle = "查看";
  616. this.closeStatus = true;
  617. this.startStatus = false;
  618. this.saveStatus = false;
  619. this.disabled = true;
  620. this.dialoglablesStatus = true
  621. }
  622. this.dialogStatus = true
  623. this.fromList = res;
  624. this.clickForm(res);
  625. this.getFromQuery(res);
  626. }
  627. },
  628. //查询form表单数据
  629. getFromQuery(e) {
  630. this.$http({
  631. url: "/market/bfsjProcess/query",
  632. method: "post",
  633. headers: {
  634. "Content-Type": "application/json",
  635. },
  636. data: { id: e.id },
  637. }).then((res) => {
  638. this.fromList = res.data;
  639. this.dialogStatus = true;
  640. this.fromList.taskId = e.taskId
  641. this.fromList.taskName = e.taskName
  642. this.fromList.createId = e.createId
  643. if (this.fromList.mkFileShareAttachList) {
  644. this.fromList.mkFileShareAttachList.map((item) => {
  645. item.name = item.fileName;
  646. })
  647. }
  648. this.fromList.resourceId = e.resourceId
  649. });
  650. },
  651. async clickForm(e) {
  652. let list = {
  653. processInstanceId: e.process_id,
  654. // taskId:e.taskId
  655. };
  656. let _this = this;
  657. let obj = {
  658. url: this.$url.formList.getCommentsByProcessId, //流程追踪接口
  659. data: list,
  660. headers: {
  661. "Content-Type": "application/json",
  662. },
  663. };
  664. let res = await this.common.httpPost(obj, success);
  665. function success(data) {
  666. console.log('[ 接口返回值第一曾 ] >', data)
  667. let list = [];
  668. list = data.data.data;
  669. if (data.data.lastmandata.length != 0) {
  670. data.data.lastmandata.map((item, index) => {
  671. item.id = index + 22;
  672. });
  673. }
  674. list.map((item, index) => {
  675. item.startTime = _this.$util.datetimeFormat(item.startTime);
  676. item.endTime = _this.$util.datetimeFormat(item.endTime);
  677. item.id = index + 1;
  678. item.children = [];
  679. if (data.data.lastmandata.length != 0) {
  680. let indexs = data.data.lastmandata.findIndex((items) => {
  681. if (items.taskId == item.taskId) {
  682. item.children.push(items);
  683. }
  684. });
  685. }
  686. });
  687. console.log(list);
  688. _this.lables.data = list;
  689. console.log("[ _this.lables.data ] >", _this.lables.data);
  690. _this.abc = true;
  691. }
  692. },
  693. handleClose() {//关闭弹窗
  694. this.dialogStatus = false;
  695. this.fromList = {};
  696. },
  697. async clickSave() {
  698. this.$refs.form.validate((valid) => {
  699. if (valid) {
  700. console.log(this.$refs.form.model)
  701. this.savestatusBtn = true
  702. if (this.fromList.id) {
  703. this.$http({
  704. url: "/market/bfsjProcess/update",
  705. method: "post",
  706. headers: {
  707. "Content-Type": "application/json",
  708. },
  709. data: this.fromList,
  710. }).then((res) => {
  711. if (res.data.result === 0) {
  712. this.$message.success("表单更新成功");
  713. }
  714. });
  715. } else {
  716. this.getUserIds();
  717. }
  718. } else {
  719. this.$message.error("请完善表单信息");
  720. return false;
  721. }
  722. });
  723. },
  724. //获取自己idname
  725. getUserIds() {
  726. this.$http({
  727. url: "/market/api/user/info/queryNodePers?params=" + JSON.parse(window.sessionStorage.userInfo).loginNo,
  728. method: "post",
  729. headers: {
  730. "Content-Type": "application/json",
  731. },
  732. }).then((res) => {
  733. this.request_form.userName = res.data[0].children[0].loginNameStr;
  734. this.request_form.userId = res.data[0].children[0].loginNoStr;
  735. this.setForm();
  736. console.log(this.request_form)
  737. });
  738. },
  739. setForm(e) {
  740. // console.log(this.$refs.form)
  741. this.request_form.title = '[IT工作台]-'+'备份数据-'+ this.fromList.needName;
  742. // this.request_form.title = this.$refs.form.needName;
  743. // this.$refs.form.taskId = e;
  744. this.fromList.accessoryIdList = []
  745. console.log(this.fromList.mkFileShareAttachList);
  746. if (this.fromList.mkFileShareAttachList) {
  747. this.fromList.mkFileShareAttachList.map((item) => {
  748. this.fromList.accessoryIdList.push(item.id);
  749. })
  750. }
  751. this.$http({
  752. url: "/market/bfsjProcess/add",
  753. method: "post",
  754. headers: {
  755. "Content-Type": "application/json",
  756. },
  757. // data: this.$refs.form,
  758. data: this.fromList,
  759. }).then((res) => {
  760. this.request_form.businessKey = res.data.body;
  761. this.fromList.id = res.data.body;
  762. this.formWorkId = res.data.body;
  763. this.clickHandle(res.data.body);
  764. });
  765. },
  766. async clickHandle(e) {
  767. let _this = this;
  768. let obj = {
  769. url: this.$url.formList.startWork, //开始工作流接口
  770. data: _this.request_form,
  771. status: "form",
  772. headers: {
  773. "Content-Type": "application/x-www-form-urlencoded",
  774. },
  775. };
  776. let res = await this.common.httpPost(obj, success);
  777. function success(data) {
  778. // console.log(data);
  779. _this.fromList.taskId = data.data;
  780. _this.fromList.processId = data.data;
  781. // _this.fromList.resourceId = data.data;
  782. _this.taskId = data.data;
  783. // _this.fromList.taskId = data;
  784. // _this.taskId = data;
  785. let list = {
  786. id: e,
  787. // taskId:_this.formId,
  788. processId: _this.fromList.taskId,
  789. tableName: _this.request_form.processDefinitionKey,
  790. };
  791. _this.setUpdate(list);
  792. }
  793. },
  794. //更新工作流接口
  795. setUpdate(e) {
  796. this.$http({
  797. url: "/market/waf/updateBase",
  798. method: "post",
  799. headers: {
  800. "Content-Type": "application/json",
  801. },
  802. data: e,
  803. }).then((res) => {
  804. this.fromList.taskId = res.data.body[0].taskId;
  805. this.fromList.taskName = res.data.body[0].taskName;
  806. // if (res.data.body.taskName === "填写备份数据申请") {
  807. // this.isSync = res.data.body.isSync;
  808. // } else {
  809. // this.isSync = "1";
  810. // }
  811. if (res.data.result === 0) {
  812. this.$message.success("工作流更新成功");
  813. }
  814. });
  815. },
  816. //处理按钮,开始工作流接口
  817. clickHandles() {
  818. this.getNextPath(this.fromList.resourceId || "");
  819. console.log(this.fromList);
  820. // if (this.fromList.taskId) {
  821. // this.destroy = true;
  822. // this.handleStatus = true;
  823. // } else {
  824. // this.$message.error("请先点击保存按钮");
  825. // }
  826. },
  827. getNextPath(e) {
  828. let list = {
  829. fresourceId: this.requestForm.fresourceId, // 本地环境
  830. processId: this.requestForm.processDefinitionKey,
  831. // processId: "request_form_process",
  832. // resourceId: e,
  833. };
  834. if (e) {
  835. // this.propsList = [];
  836. list.resourceId = e;
  837. }
  838. console.log(11111);
  839. console.log(list);
  840. console.log(11111);
  841. this.$http({
  842. url: "/market/waf/queryPath",
  843. method: "post",
  844. headers: {
  845. "Content-Type": "application/json",
  846. },
  847. data: list,
  848. }).then((res) => {
  849. console.log(res);
  850. console.log(this.fromList);
  851. console.log(res.data.body);
  852. console.log(res.data.body.nextShapes[0].multi);
  853. if (res.data.body.nextShapes[0].multi) {
  854. if (res.data.body.nextShapes[0].multi.multi === "true") {
  855. this.getLastName();
  856. }
  857. }
  858. if (this.fromList.taskId || this.fromList.processId) {
  859. this.destroy = true;
  860. this.handleStatus = true;
  861. this.getMetirialType();
  862. } else {
  863. this.$message.error("请先点击保存按钮");
  864. }
  865. });
  866. },
  867. //获取字典表常用意见
  868. getMetirialType(e) {
  869. this.$http({
  870. url: "/market/cfgDataDict/queryList",
  871. method: "post",
  872. headers: {
  873. "Content-Type": "application/json",
  874. },
  875. data: {
  876. dictCodePks: "approval",
  877. },
  878. }).then((res) => {
  879. this.commonlyList = res.data;
  880. });
  881. },
  882. //处理关闭
  883. handleCloses() {
  884. // this.treeList = [];
  885. // this.textarea = "";
  886. this.handleStatus = false;
  887. this.usernumber()
  888. },
  889. updateForm() {
  890. this.dialogStatus = false;
  891. this.handleCloses();
  892. this.usernumber()
  893. if (this.clickTagName == 'first') {
  894. this.lableTable = this.firstlabel
  895. this.getQueryList();
  896. }
  897. if (this.clickTagName == 'two') {
  898. this.lableTable = this.twolabel
  899. this.getQueryDone();
  900. }
  901. if (this.clickTagName == 'three') {
  902. this.lableTable = this.threelabel
  903. this.getMeLaunch()
  904. }
  905. },
  906. clickTabMains(e) {
  907. console.log(e);
  908. this.clickTagName = e
  909. this.pageNo = 1
  910. this.$refs.TableList.page = 1;
  911. if (this.clickTagName == 'first') {
  912. this.lableTable = this.firstlabel
  913. this.getQueryList();
  914. }
  915. if (this.clickTagName == 'two') {
  916. this.lableTable = this.twolabel
  917. this.getQueryDone();
  918. }
  919. if (this.clickTagName == 'three') {
  920. this.lableTable = this.threelabel
  921. this.getMeLaunch()
  922. }
  923. },
  924. adminhandleSizeChange(val) {
  925. console.log(`每页 ${val} 条`);
  926. },
  927. adminhandleCurrentChange(val) {
  928. console.log(`当前页: ${val}`);
  929. },
  930. //我的待办
  931. getQueryList(e, status) {
  932. this.loading = true;
  933. getTodoBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  934. if (status === 0) {
  935. this.clickDemand("标题", res.data.data[0]);
  936. }
  937. this.lableTable.data = res.data.data;
  938. this.lableTable.pageData.total = res.data.totalRecord;
  939. this.tabListMain[0].number = res.data.totalRecord
  940. this.loading = false;
  941. });
  942. },
  943. //我的已办
  944. getQueryDone() {
  945. this.loading = true;
  946. getDoneBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  947. this.lableTable.data = res.data.data;
  948. // this.lableTable.data.map((item) => {
  949. // item.status = "2";
  950. // });
  951. this.lableTable.pageData.total = res.data.totalRecord;
  952. this.tabListMain[1].number = res.data.totalRecord
  953. this.loading = false;
  954. });
  955. },
  956. //我发起的
  957. getMeLaunch() {
  958. this.loading = true;
  959. getInitiateBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  960. this.lableTable.data = res.data.data;
  961. // this.lableTable.data.map((item) => {
  962. // if (item.taskName === "填写备份数据申请") {
  963. // item.status = "1";
  964. // } else {
  965. // item.status = "2";
  966. // }
  967. // });
  968. this.lableTable.pageData.total = res.data.totalRecord;
  969. this.tabListMain[2].number = res.data.totalRecord
  970. this.loading = false;
  971. });
  972. },
  973. usernumber() {
  974. getInitiateBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  975. this.tabListMain[2].number = res.data.totalRecord
  976. });
  977. getDoneBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  978. this.tabListMain[1].number = res.data.totalRecord
  979. });
  980. getTodoBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  981. this.tabListMain[0].number = res.data.totalRecord
  982. });
  983. }
  984. },
  985. created() {
  986. let status = JSON.stringify(this.$route.query) == "{}";
  987. if (status) {
  988. this.lableTable = this.firstlabel
  989. this.getQueryList()
  990. this.usernumber()
  991. } else {
  992. let { id, type } = this.$route.query;
  993. let list = {
  994. taskId: id,
  995. tableName: this.tableName
  996. };
  997. this.usernumber()
  998. this.lableTable = this.firstlabel
  999. this.getQueryList(list, 0);//代办
  1000. }
  1001. }
  1002. }
  1003. </script>
  1004. <style lang="scss" scoped>
  1005. .copyClass {
  1006. display: flex;
  1007. }
  1008. .flex-header-text-tree {
  1009. width: 50%;
  1010. text-align: center;
  1011. }
  1012. ::v-deep .el-form-item {
  1013. width: 100%;
  1014. }
  1015. .active {
  1016. background-color: #f3faff;
  1017. }
  1018. .flex-common {
  1019. padding: 10px 5%;
  1020. font-size: 18px;
  1021. }
  1022. .flex-buttons {
  1023. background-color: #cde4f6;
  1024. border-color: #cde4f6;
  1025. color: #606266;
  1026. }
  1027. .flex-button {
  1028. margin-top: 10px;
  1029. margin-bottom: 10px;
  1030. ::v-deep .el-button--primary {
  1031. width: 222px;
  1032. }
  1033. }
  1034. .flex-left-header-text {
  1035. height: 40px;
  1036. line-height: 40px;
  1037. color: black;
  1038. padding-left: 10px;
  1039. background-color: #cde4f6;
  1040. font-size: 18px;
  1041. font-weight: bold;
  1042. }
  1043. .flex-right-text {
  1044. margin-right: 20px;
  1045. width: 50%;
  1046. }
  1047. .flex-handle {
  1048. width: 100%;
  1049. padding: 30px;
  1050. display: flex;
  1051. .flex-right {
  1052. width: 50%;
  1053. border: 1px solid #e1e1e1;
  1054. margin-left: 20px;
  1055. }
  1056. .flex-left {
  1057. width: 50%;
  1058. display: flex;
  1059. flex-direction: column;
  1060. .flex-left-header {
  1061. display: flex;
  1062. justify-content: space-around;
  1063. }
  1064. }
  1065. }
  1066. .table-title {
  1067. height: 50px;
  1068. line-height: 50px;
  1069. background-color: #f3faff;
  1070. font-size: 18px;
  1071. font-weight: bold;
  1072. }
  1073. ::v-deep .el-dialog {
  1074. margin-top: 0 !important;
  1075. }
  1076. ::v-deep .el-table__fixed-body-wrapper {
  1077. top: 50px !important;
  1078. }
  1079. .flex-box {
  1080. display: flex;
  1081. width: calc(100% - 40px);
  1082. border-radius: 20px;
  1083. background-color: #fff;
  1084. margin: 0 auto;
  1085. margin-top: 20px;
  1086. position: relative;
  1087. flex-direction: column;
  1088. .flex-load {
  1089. display: flex;
  1090. width: 100%;
  1091. position: relative;
  1092. margin: 1%;
  1093. border-bottom: 1px solid #e1e1e1;
  1094. justify-content: space-between;
  1095. }
  1096. .flex-header {
  1097. display: flex;
  1098. // width: 100%;
  1099. position: relative;
  1100. // height: 60px;
  1101. margin: 1%;
  1102. border-bottom: 1px solid #e1e1e1;
  1103. justify-content: space-between;
  1104. // ::v-deep .el-form-item {
  1105. // width: 30%;
  1106. // margin-right: 5%;
  1107. // }
  1108. .el-button {
  1109. width: 150px;
  1110. float: right;
  1111. height: 40px !important;
  1112. margin-right: 30px;
  1113. }
  1114. }
  1115. }
  1116. //设置子组件样式
  1117. ::v-deep .el-tabs__item {
  1118. padding: 0;
  1119. margin-right: 20px;
  1120. width: 166px;
  1121. text-align: center;
  1122. background-color: #d8eaf6;
  1123. color: black;
  1124. }
  1125. ::v-deep .is-active {
  1126. color: #fff;
  1127. background-color: #0583cd;
  1128. }
  1129. ::v-deep .el-select {
  1130. width: 100%
  1131. }
  1132. ::v-deep .el-tabs__active-bar {
  1133. display: none;
  1134. }
  1135. ::v-deep .el-tabs__nav-wrap::after {
  1136. display: none !important;
  1137. }
  1138. .flex-form {
  1139. margin-top: 50px;
  1140. }
  1141. .flex-footer-botton {
  1142. display: flex;
  1143. justify-content: space-evenly;
  1144. }
  1145. </style>