userList.vue 42 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198
  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="saveStatus" @click="clickSave">保存</el-button>
  18. <el-button type="primary" v-if="startStatus" @click="clickHandles">处理</el-button>
  19. <el-button type="primary" v-if="closeStatus" @click="handleClose">关闭</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.needNo" 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="remark">
  41. <el-input type="textarea" v-model="fromList.remark" 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="accessoryList">
  47. <my-upload v-if="!disabled" @uploadBack="uploadBack" @delloadBack="delloadBack"
  48. @clickDownload="download" :fileInfo="fileInfo" :fileList="fromList.accessoryList"
  49. style="width: 30% !important"></my-upload>
  50. <div v-if="fromList.taskName != '填写用户清单审核'">
  51. <div v-for="(item, index) in fromList.accessoryList" :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" :request_formTitle="request_form.title" />
  70. <WorkflowEntrance :list="fromList" v-else :lastManList="lastManList" @beforeClose="updateForm"
  71. :requestForm="requestForm" :request_formTitle="request_form.title"/>
  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. remark: [
  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: "YHQD_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: "YHQD_process",//流程key
  144. },
  145. requestForm: {
  146. // fresourceId: "65791a1e-b1ac-11ed-886f-d6cd97160e00", // 本地环境
  147. // fresourceId: "canvas", // 生产环境
  148. // fresourceId: "4edefb21-b24f-11ed-be6b-00505687dcd3", //测试91环境
  149. fresourceId: getConfig().userList,
  150. processDefinitionKey: "YHQD_process",
  151. },
  152. dialogStatus: false, //dialog显示
  153. dialoglablesStatus: true, //dialogL流程追踪显示
  154. clickTagNameTop: 'First',//头部tab
  155. clickTagName: 'first',
  156. dialogTitle: '',//dialogtit
  157. startStatus: false,//处理状态按钮
  158. closeStatus: false, //关闭按钮状态
  159. saveStatus: false, //保存按钮状态
  160. lables: {
  161. height: "400",
  162. titledata: [
  163. {
  164. label: "环节名称",
  165. prop: "taskName",
  166. width: 300,
  167. },
  168. {
  169. label: "处理人",
  170. prop: "assignee",
  171. width: 300,
  172. },
  173. {
  174. label: "到达时间",
  175. prop: "startTime",
  176. width: 300,
  177. },
  178. {
  179. label: "处理时间",
  180. prop: "endTime",
  181. width: 300,
  182. },
  183. {
  184. label: "回复意见",
  185. prop: "content",
  186. width: 300,
  187. },
  188. ], //表格头
  189. data: [], //内容数据
  190. loading: true,
  191. pageData: {
  192. total: 0, // 总条数
  193. pageSizes: 10, // 每页数量
  194. pageNum: 1, // 页码
  195. },
  196. isSelection: false, // 表格有多选时设置
  197. isOperation: false, // 表格有操作列时设置
  198. isIndex: true, // 列表序号
  199. operation: {
  200. // 表格有操作列时设置
  201. label: "操作", // 列名
  202. width: "50", // 根据实际情况给宽度
  203. data: [
  204. {
  205. label: "操作", // 操作名称
  206. type: "", //按钮类型
  207. handleRow: function () { }, // 自定义事件
  208. },
  209. ],
  210. },
  211. },
  212. tabListMain: [
  213. {
  214. index: "first",
  215. label: "我的待办",
  216. number: 1,
  217. name: "prosss_key",
  218. },
  219. {
  220. index: "two",
  221. label: "我的已办",
  222. number: 2,
  223. },
  224. {
  225. index: "three",
  226. label: "我发起的",
  227. number: 3,
  228. },
  229. ],
  230. lableTable: {},//传给子组件table
  231. firstlabel: {
  232. height: "400",
  233. titledata: [
  234. {
  235. label: "标题",
  236. prop: "need_name",
  237. width: 400,
  238. },
  239. {
  240. label: "申请人",
  241. prop: "proposer",
  242. width: 400,
  243. },
  244. {
  245. label: "申请时间",
  246. prop: "proposer_time",
  247. width: 400,
  248. },
  249. {
  250. label: "当前环节",
  251. prop: "taskName",
  252. width: 400,
  253. },
  254. ], //表格头
  255. data: [], //内容数据
  256. loading: true,
  257. pageData: {
  258. total: 10, // 总条数
  259. pageSizes: 10, // 每页数量
  260. pageNum: 1, // 页码
  261. },
  262. isSelection: false, // 表格有多选时设置
  263. isOperation: false, // 表格有操作列时设置
  264. isIndex: false, // 列表序号
  265. operation: {
  266. // 表格有操作列时设置
  267. label: "操作", // 列名
  268. width: "50", // 根据实际情况给宽度
  269. data: [
  270. {
  271. label: "操作", // 操作名称
  272. type: "", //按钮类型
  273. handleRow: function () { }, // 自定义事件
  274. },
  275. ],
  276. },
  277. },
  278. twolabel: {
  279. height: "400",
  280. titledata: [
  281. {
  282. label: "标题",
  283. prop: "need_name",
  284. width: 400,
  285. },
  286. {
  287. label: "申请人",
  288. prop: "proposer",
  289. width: 400,
  290. },
  291. {
  292. label: "申请时间",
  293. prop: "proposer_time",
  294. width: 400,
  295. },
  296. {
  297. label: "当前环节",
  298. prop: "taskName",
  299. width: 400,
  300. },
  301. ], //表格头
  302. data: [], //内容数据
  303. loading: true,
  304. pageData: {
  305. total: 10, // 总条数
  306. pageSizes: 10, // 每页数量
  307. pageNum: 1, // 页码
  308. },
  309. isSelection: false, // 表格有多选时设置
  310. isOperation: false, // 表格有操作列时设置
  311. isIndex: false, // 列表序号
  312. operation: {
  313. // 表格有操作列时设置
  314. label: "操作", // 列名
  315. width: "50", // 根据实际情况给宽度
  316. data: [
  317. {
  318. label: "操作", // 操作名称
  319. type: "", //按钮类型
  320. handleRow: function () { }, // 自定义事件
  321. },
  322. ],
  323. },
  324. },
  325. threelabel: {
  326. height: "400",
  327. titledata: [
  328. {
  329. label: "标题",
  330. prop: "need_name",
  331. width: 400,
  332. },
  333. {
  334. label: "申请人",
  335. prop: "proposer",
  336. width: 400,
  337. },
  338. {
  339. label: "申请时间",
  340. prop: "proposer_time",
  341. width: 400,
  342. },
  343. {
  344. label: "当前环节",
  345. prop: "taskName",
  346. width: 400,
  347. },
  348. {
  349. label: "当前处理人",
  350. prop: "currentMan",
  351. width: 400,
  352. },
  353. ], //表格头
  354. data: [], //内容数据
  355. loading: true,
  356. pageData: {
  357. total: 10, // 总条数
  358. pageSizes: 10, // 每页数量
  359. pageNum: 1, // 页码
  360. },
  361. isSelection: false, // 表格有多选时设置
  362. isOperation: false, // 表格有操作列时设置
  363. isIndex: false, // 列表序号
  364. operation: {
  365. // 表格有操作列时设置
  366. label: "操作", // 列名
  367. width: "50", // 根据实际情况给宽度
  368. data: [
  369. {
  370. label: "操作", // 操作名称
  371. type: "", //按钮类型
  372. handleRow: function () { }, // 自定义事件
  373. },
  374. ],
  375. },
  376. },
  377. filterData: {
  378. timeSelect: false, //是否显示日期控件
  379. sreach: true,
  380. restet: false,
  381. elinput: [
  382. {
  383. name: "材料名称", //提示语275
  384. key: "materialName", //字段名
  385. width: 275, //宽度
  386. },
  387. ],
  388. },
  389. savestatusBtn: false,
  390. }
  391. },
  392. methods: {
  393. clickNewTag(v) {
  394. this.$http({
  395. url: "/market/YhqdProcess/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. needNo: 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 accessoryList = [];
  410. accessoryList = v;
  411. this.$set(this.fromList, "accessoryList", accessoryList);
  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/downFileByMinio",
  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.accessoryList) {
  529. this.fromList.accessoryList = [];
  530. this.fromList.accessoryList = v;
  531. } else {
  532. let accessoryList = [];
  533. accessoryList = v;
  534. this.$set(this.fromList, "accessoryList", accessoryList);
  535. }
  536. },
  537. delloadBack(v) {
  538. this.fromList.accessoryList = 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/YhqdProcess/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.accessoryList) {
  644. this.fromList.accessoryList.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.request_form.title = '[IT工作台]-用户清单-' + this.fromList.needName;
  704. this.$http({
  705. url: "/market/YhqdProcess/update",
  706. method: "post",
  707. headers: {
  708. "Content-Type": "application/json",
  709. },
  710. data: this.fromList,
  711. }).then((res) => {
  712. if (res.data.result === 0) {
  713. this.$message.success("表单更新成功");
  714. }
  715. });
  716. } else {
  717. this.getUserIds();
  718. }
  719. } else {
  720. this.$message.error("请完善表单信息");
  721. return false;
  722. }
  723. });
  724. },
  725. //获取自己idname
  726. getUserIds() {
  727. this.$http({
  728. url: "/market/api/user/info/queryNodePers?params=" + JSON.parse(window.sessionStorage.userInfo).loginNo,
  729. method: "post",
  730. headers: {
  731. "Content-Type": "application/json",
  732. },
  733. }).then((res) => {
  734. this.request_form.userName = res.data[0].children[0].loginNameStr;
  735. this.request_form.userId = res.data[0].children[0].loginNoStr;
  736. this.setForm();
  737. console.log(this.request_form)
  738. });
  739. },
  740. setForm(e) {
  741. // console.log(this.$refs.form)
  742. this.request_form.title = '[IT工作台]-用户清单-' + this.fromList.needName;
  743. // this.request_form.title = this.$refs.form.needName;
  744. // this.$refs.form.taskId = e;
  745. this.fromList.accessoryIdList = []
  746. console.log(this.fromList.accessoryList);
  747. if (this.fromList.accessoryList) {
  748. this.fromList.accessoryList.map((item) => {
  749. this.fromList.accessoryIdList.push(item.id);
  750. })
  751. }
  752. this.$http({
  753. url: "/market/YhqdProcess/add",
  754. method: "post",
  755. headers: {
  756. "Content-Type": "application/json",
  757. },
  758. // data: this.$refs.form,
  759. data: this.fromList,
  760. }).then((res) => {
  761. this.request_form.businessKey = res.data.body;
  762. this.fromList.id = res.data.body;
  763. this.formWorkId = res.data.body;
  764. this.clickHandle(res.data.body);
  765. });
  766. },
  767. async clickHandle(e) {
  768. let _this = this;
  769. let obj = {
  770. url: this.$url.formList.startWork, //开始工作流接口
  771. data: _this.request_form,
  772. status: "form",
  773. headers: {
  774. "Content-Type": "application/x-www-form-urlencoded",
  775. },
  776. };
  777. let res = await this.common.httpPost(obj, success);
  778. function success(data) {
  779. // console.log(data);
  780. _this.fromList.taskId = data.data;
  781. _this.fromList.processId = data.data;
  782. // _this.fromList.resourceId = data.data;
  783. _this.taskId = data.data;
  784. // _this.fromList.taskId = data;
  785. // _this.taskId = data;
  786. let list = {
  787. id: e,
  788. // taskId:_this.formId,
  789. processId: _this.fromList.taskId,
  790. tableName: _this.request_form.processDefinitionKey,
  791. };
  792. _this.setUpdate(list);
  793. }
  794. },
  795. //更新工作流接口
  796. setUpdate(e) {
  797. this.$http({
  798. url: "/market/waf/updateBase",
  799. method: "post",
  800. headers: {
  801. "Content-Type": "application/json",
  802. },
  803. data: e,
  804. }).then((res) => {
  805. this.fromList.taskId = res.data.body[0].taskId;
  806. this.fromList.taskName = res.data.body[0].taskName;
  807. // if (res.data.body.taskName === "填写用户清单审核") {
  808. // this.isSync = res.data.body.isSync;
  809. // } else {
  810. // this.isSync = "1";
  811. // }
  812. if (res.data.result === 0) {
  813. this.$message.success("工作流更新成功");
  814. }
  815. });
  816. },
  817. //处理按钮,开始工作流接口
  818. clickHandles() {
  819. this.getNextPath(this.fromList.resourceId || "");
  820. console.log(this.fromList);
  821. // if (this.fromList.taskId) {
  822. // this.destroy = true;
  823. // this.handleStatus = true;
  824. // } else {
  825. // this.$message.error("请先点击保存按钮");
  826. // }
  827. },
  828. getNextPath(e) {
  829. let list = {
  830. fresourceId: this.requestForm.fresourceId, // 本地环境
  831. processId: this.requestForm.processDefinitionKey,
  832. // processId: "request_form_process",
  833. // resourceId: e,
  834. };
  835. if (e) {
  836. // this.propsList = [];
  837. list.resourceId = e;
  838. }
  839. console.log(11111);
  840. console.log(list);
  841. console.log(11111);
  842. this.$http({
  843. url: "/market/waf/queryPath",
  844. method: "post",
  845. headers: {
  846. "Content-Type": "application/json",
  847. },
  848. data: list,
  849. }).then((res) => {
  850. console.log(res);
  851. console.log(this.fromList);
  852. console.log(res.data.body);
  853. console.log(res.data.body.nextShapes[0].multi);
  854. if (res.data.body.nextShapes[0].multi) {
  855. if (res.data.body.nextShapes[0].multi.multi === "true") {
  856. this.getLastName();
  857. }
  858. }
  859. if (this.fromList.taskId || this.fromList.processId) {
  860. this.destroy = true;
  861. this.handleStatus = true;
  862. this.getMetirialType();
  863. } else {
  864. this.$message.error("请先点击保存按钮");
  865. }
  866. });
  867. },
  868. //获取字典表常用意见
  869. getMetirialType(e) {
  870. this.$http({
  871. url: "/market/cfgDataDict/queryList",
  872. method: "post",
  873. headers: {
  874. "Content-Type": "application/json",
  875. },
  876. data: {
  877. dictCodePks: "approval",
  878. },
  879. }).then((res) => {
  880. this.commonlyList = res.data;
  881. });
  882. },
  883. //处理关闭
  884. handleCloses() {
  885. // this.treeList = [];
  886. // this.textarea = "";
  887. this.handleStatus = false;
  888. this.usernumber()
  889. },
  890. updateForm() {
  891. this.dialogStatus = false;
  892. this.handleCloses();
  893. this.usernumber()
  894. if (this.clickTagName == 'first') {
  895. this.lableTable = this.firstlabel
  896. this.getQueryList();
  897. }
  898. if (this.clickTagName == 'two') {
  899. this.lableTable = this.twolabel
  900. this.getQueryDone();
  901. }
  902. if (this.clickTagName == 'three') {
  903. this.lableTable = this.threelabel
  904. this.getMeLaunch()
  905. }
  906. },
  907. clickTabMains(e) {
  908. console.log(e);
  909. this.clickTagName = e
  910. this.pageNo = 1
  911. this.$refs.TableList.page = 1;
  912. if (this.clickTagName == 'first') {
  913. this.lableTable = this.firstlabel
  914. this.getQueryList();
  915. }
  916. if (this.clickTagName == 'two') {
  917. this.lableTable = this.twolabel
  918. this.getQueryDone();
  919. }
  920. if (this.clickTagName == 'three') {
  921. this.lableTable = this.threelabel
  922. this.getMeLaunch()
  923. }
  924. },
  925. adminhandleSizeChange(val) {
  926. console.log(`每页 ${val} 条`);
  927. },
  928. adminhandleCurrentChange(val) {
  929. console.log(`当前页: ${val}`);
  930. },
  931. //我的待办
  932. getQueryList(e, status) {
  933. this.loading = true;
  934. getTodoBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  935. if (status === 0) {
  936. this.clickDemand("标题", res.data.data[0]);
  937. }
  938. this.lableTable.data = res.data.data;
  939. this.lableTable.pageData.total = res.data.totalRecord;
  940. this.tabListMain[0].number = res.data.totalRecord
  941. this.loading = false;
  942. });
  943. },
  944. //我的已办
  945. getQueryDone() {
  946. this.loading = true;
  947. getDoneBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  948. this.lableTable.data = res.data.data;
  949. // this.lableTable.data.map((item) => {
  950. // item.status = "2";
  951. // });
  952. this.lableTable.pageData.total = res.data.totalRecord;
  953. this.tabListMain[1].number = res.data.totalRecord
  954. this.loading = false;
  955. });
  956. },
  957. //我发起的
  958. getMeLaunch() {
  959. this.loading = true;
  960. getInitiateBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  961. this.lableTable.data = res.data.data;
  962. // this.lableTable.data.map((item) => {
  963. // if (item.taskName === "填写用户清单审核") {
  964. // item.status = "1";
  965. // } else {
  966. // item.status = "2";
  967. // }
  968. // });
  969. this.lableTable.pageData.total = res.data.totalRecord;
  970. this.tabListMain[2].number = res.data.totalRecord
  971. this.loading = false;
  972. });
  973. },
  974. usernumber() {
  975. getInitiateBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  976. this.tabListMain[2].number = res.data.totalRecord
  977. });
  978. getDoneBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  979. this.tabListMain[1].number = res.data.totalRecord
  980. });
  981. getTodoBase(this.pageNo, "", { tableName: this.tableName, }).then((res) => {
  982. this.tabListMain[0].number = res.data.totalRecord
  983. });
  984. }
  985. },
  986. created() {
  987. let status = JSON.stringify(this.$route.query) == "{}";
  988. if (status) {
  989. this.lableTable = this.firstlabel
  990. this.getQueryList()
  991. this.usernumber()
  992. } else {
  993. let { id, type } = this.$route.query;
  994. let list = {
  995. taskId: id,
  996. tableName: this.tableName
  997. };
  998. this.usernumber()
  999. this.lableTable = this.firstlabel
  1000. this.getQueryList(list, 0);//代办
  1001. }
  1002. }
  1003. }
  1004. </script>
  1005. <style lang="scss" scoped>
  1006. .copyClass {
  1007. display: flex;
  1008. }
  1009. .flex-header-text-tree {
  1010. width: 50%;
  1011. text-align: center;
  1012. }
  1013. ::v-deep .el-form-item {
  1014. width: 100%;
  1015. }
  1016. .active {
  1017. background-color: #f3faff;
  1018. }
  1019. .flex-common {
  1020. padding: 10px 5%;
  1021. font-size: 18px;
  1022. }
  1023. .flex-buttons {
  1024. background-color: #cde4f6;
  1025. border-color: #cde4f6;
  1026. color: #606266;
  1027. }
  1028. .flex-button {
  1029. margin-top: 10px;
  1030. margin-bottom: 10px;
  1031. ::v-deep .el-button--primary {
  1032. width: 222px;
  1033. }
  1034. }
  1035. .flex-left-header-text {
  1036. height: 40px;
  1037. line-height: 40px;
  1038. color: black;
  1039. padding-left: 10px;
  1040. background-color: #cde4f6;
  1041. font-size: 18px;
  1042. font-weight: bold;
  1043. }
  1044. .flex-right-text {
  1045. margin-right: 20px;
  1046. width: 50%;
  1047. }
  1048. .flex-handle {
  1049. width: 100%;
  1050. padding: 30px;
  1051. display: flex;
  1052. .flex-right {
  1053. width: 50%;
  1054. border: 1px solid #e1e1e1;
  1055. margin-left: 20px;
  1056. }
  1057. .flex-left {
  1058. width: 50%;
  1059. display: flex;
  1060. flex-direction: column;
  1061. .flex-left-header {
  1062. display: flex;
  1063. justify-content: space-around;
  1064. }
  1065. }
  1066. }
  1067. .table-title {
  1068. height: 50px;
  1069. line-height: 50px;
  1070. background-color: #f3faff;
  1071. font-size: 18px;
  1072. font-weight: bold;
  1073. }
  1074. ::v-deep .el-dialog {
  1075. margin-top: 0 !important;
  1076. }
  1077. ::v-deep .el-table__fixed-body-wrapper {
  1078. top: 50px !important;
  1079. }
  1080. .flex-box {
  1081. display: flex;
  1082. width: calc(100% - 40px);
  1083. border-radius: 20px;
  1084. background-color: #fff;
  1085. margin: 0 auto;
  1086. margin-top: 20px;
  1087. position: relative;
  1088. flex-direction: column;
  1089. .flex-load {
  1090. display: flex;
  1091. width: 100%;
  1092. position: relative;
  1093. margin: 1%;
  1094. border-bottom: 1px solid #e1e1e1;
  1095. justify-content: space-between;
  1096. }
  1097. .flex-header {
  1098. display: flex;
  1099. // width: 100%;
  1100. position: relative;
  1101. // height: 60px;
  1102. margin: 1%;
  1103. border-bottom: 1px solid #e1e1e1;
  1104. justify-content: space-between;
  1105. // ::v-deep .el-form-item {
  1106. // width: 30%;
  1107. // margin-right: 5%;
  1108. // }
  1109. .el-button {
  1110. width: 150px;
  1111. float: right;
  1112. height: 40px !important;
  1113. margin-right: 30px;
  1114. }
  1115. }
  1116. }
  1117. //设置子组件样式
  1118. ::v-deep .el-tabs__item {
  1119. padding: 0;
  1120. margin-right: 20px;
  1121. width: 166px;
  1122. text-align: center;
  1123. background-color: #d8eaf6;
  1124. color: black;
  1125. }
  1126. ::v-deep .is-active {
  1127. color: #fff;
  1128. background-color: #0583cd;
  1129. }
  1130. ::v-deep .el-select {
  1131. width: 100%
  1132. }
  1133. ::v-deep .el-tabs__active-bar {
  1134. display: none;
  1135. }
  1136. ::v-deep .el-tabs__nav-wrap::after {
  1137. display: none !important;
  1138. }
  1139. ::v-deep .el-form-item__label {
  1140. text-align: center;
  1141. }
  1142. .flex-form {
  1143. margin-top: 50px;
  1144. }
  1145. .flex-footer-botton {
  1146. display: flex;
  1147. justify-content: space-evenly;
  1148. }
  1149. </style>