docAppr.vue 42 KB

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