provinceHome.vue 50 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373
  1. <template>
  2. <div class="flex-box">
  3. <!-- 头部组件 -->
  4. <div :span="24" class="flex-header">
  5. <Tabs :tabList="tabList" @status="clickTabs">
  6. </Tabs>
  7. <el-button
  8. type="primary"
  9. @click="clickNewTag"
  10. v-show="lable.name === 'first'"
  11. >+新建
  12. </el-button
  13. >
  14. </div>
  15. <div class="flex-count">
  16. <Table
  17. @clickDemand="clickDemand"
  18. :list="lable"
  19. ref="TableList"
  20. @num="getNum"
  21. @changeNum="changeNum"
  22. >
  23. <template v-slot:three>
  24. </template>
  25. </Table>
  26. </div>
  27. <el-dialog
  28. :title="dialogTitle + '工单'"
  29. :visible.sync="dialogStatus"
  30. width="100%"
  31. :before-close="handleClose"
  32. :modal="false"
  33. v-if="dialogStatus"
  34. :destroy-on-close="true"
  35. >
  36. <!-- 后期维护 -->
  37. <div style="position: fixed; z-index: 10000" v-if="buttonStatus">
  38. <el-button type="primary" v-if="startStatus" @click="clickHandles"
  39. >处理
  40. </el-button
  41. >
  42. <el-button type="primary" v-if="closeStatus" @click="handleClose"
  43. >关闭
  44. </el-button
  45. >
  46. <el-button type="primary" v-if="saveStatus" @click="clickSave"
  47. >保存
  48. </el-button
  49. >
  50. </div>
  51. <FormTable
  52. :list="fromList"
  53. :disabled="disabled"
  54. class="flex-form"
  55. ref="formTable"
  56. />
  57. <div>
  58. <div class="table-title">流程追踪</div>
  59. <Tableid :list="lables"></Tableid>
  60. </div>
  61. </el-dialog>
  62. <div v-if="destroy">
  63. <el-dialog
  64. title="处理操作"
  65. width="100%"
  66. :visible.sync="handleStatus"
  67. :before-close="handleCloses"
  68. :modal="false"
  69. v-if="handleStatus"
  70. :destroy-on-close="true"
  71. >
  72. <Workflow
  73. :list="fromList"
  74. @updateForm="beforeClose"
  75. v-if="isWorkflowStatus == true"
  76. :requestForm="requestForm"
  77. :request_formTitle="request_form.title"
  78. />
  79. <WorkflowEntrance :list="fromList" v-else :lastManList="lastManList" @beforeClose="beforeClose"
  80. :requestForm="requestForm" :request_formTitle="request_form.title"/>
  81. <!-- 后期维护 -->
  82. </el-dialog>
  83. </div>
  84. </div>
  85. </template>
  86. <script>
  87. import Workflow from "../../../components/workflowBase";
  88. import FormTable from "./formTable.vue";
  89. import Seach from "../../../components/el-search.vue";
  90. import Tabs from "../../../components/el-tabs.vue";
  91. import Table from "../../../components/el-form";
  92. import Tableid from "../../../components/el-formid";
  93. import WorkflowEntrance from "../../../components/workflowEntrance";
  94. import {
  95. getTodoBase,
  96. getDoneBase,
  97. getInitiateBase,
  98. } from "../../../http/api.js";
  99. export default {
  100. components: {
  101. Tabs,
  102. Table,
  103. Tableid,
  104. Seach,
  105. FormTable,
  106. Workflow,
  107. WorkflowEntrance
  108. },
  109. data() {
  110. return {
  111. tableName: "scsjdc_pro_process",
  112. buttonStatus: true,
  113. copyStatus: false,
  114. dialogTitle: "",
  115. disabled: false,
  116. destroy: false,
  117. //分页数据
  118. totalPage: "1", //默认第一页
  119. currentPage: "1", //当前页数
  120. pageSize: "10", //每页显示十条
  121. currentPageList: ["1", "2"],
  122. startStatus: true,
  123. closeStatus: true, //关闭按钮状态
  124. forwardStatus: false, //转需求管理平台状态
  125. exportBtnStatus: false, //导出按钮状态
  126. saveStatus: false, //保存按钮状态
  127. fromList: {}, //表单数据
  128. lastManList: [],
  129. isWorkflowStatus: true, //默认展示模式组件,为true时展示多人处理组件
  130. rejectStatus: true,
  131. taskId: "", //工单taskID
  132. treeUser: {},
  133. formId: "",
  134. fileId: "", //工作流开启Id
  135. request_form: {
  136. userId: "",
  137. userName: "",
  138. path: this.$router.currentRoute.name,
  139. userCode: JSON.parse(window.sessionStorage.userInfo).loginNo,
  140. // path:this.$roter.options.routers,
  141. // nextDealMan:'',
  142. title: "title",
  143. businessKey: "",
  144. processDefinitionKey: "scsjdc_pro_process",
  145. },
  146. requestForm: {
  147. // fresourceId: "ae3564a5-96f2-11ed-be6b-00505687dcd3", // 本地环境
  148. fresourceId: "b67ff4ed-c312-11ed-afb6-e00084564cce", // 生产环境
  149. // fresourceId: "bf79721c-33f3-11ed-ba0b-00505687dcd3", //测试环境
  150. processDefinitionKey: "scsjdc_pro_process",
  151. },
  152. treeList: [], //候选人列表
  153. treeCopyList: [], //抄送人列表
  154. editStatus: false,
  155. querryList: [], //已选人员名单
  156. commonlyList: [
  157. //常用意见列表页
  158. ],
  159. textarea: "未填写意见",
  160. num: 0,
  161. dialogStatus: false, //新建dialog显示
  162. handleStatus: false, //处理按钮状态
  163. tabList: [
  164. {
  165. index: "first",
  166. label: "我的待办",
  167. number: 0,
  168. name: "prosss_key",
  169. },
  170. {
  171. index: "two",
  172. label: "我的已办",
  173. number: 0,
  174. },
  175. {
  176. index: "three",
  177. label: "我发起的",
  178. number: 0,
  179. }
  180. ],//上层跳转已发起已办等
  181. todoBase: {
  182. name: "first",
  183. height: "650",
  184. titledata: [
  185. {
  186. label: "文件标题",
  187. prop: "need_name",
  188. width: 300,
  189. color: "#0682cd",
  190. },
  191. {
  192. label: "发起部门",
  193. prop: "apply_department",
  194. width: 200,
  195. },
  196. {
  197. label: "发起科室",
  198. prop: "apply_office",
  199. width: 200,
  200. },
  201. {
  202. label: "发起人",
  203. prop: "proposer",
  204. width: 200,
  205. },
  206. {
  207. label: "发起时间",
  208. prop: "proposer_time",
  209. width: 250,
  210. },
  211. {
  212. label: "上一步处理人",
  213. prop: "predealman",
  214. width: 200,
  215. },
  216. {
  217. label: "状态",
  218. prop: "taskName",
  219. width: 200,
  220. },
  221. ], //表格头
  222. data: [], //内容数据
  223. loading: true,
  224. pageData: {
  225. total: 100, // 总条数
  226. pageSize: 10, // 每页数量
  227. pageSizes: [10], // 每页数量
  228. pageNum: 1, // 页码
  229. },
  230. isSelection: false, // 表格有多选时设置
  231. isOperation: false, // 表格有操作列时设置
  232. isIndex: true, // 列表序号
  233. operation: {
  234. // 表格有操作列时设置
  235. label: "操作", // 列名
  236. width: "50", // 根据实际情况给宽度
  237. data: [
  238. {
  239. label: "操作", // 操作名称
  240. type: "", //按钮类型
  241. handleRow: (e, r, o) => {
  242. }, // 自定义事件
  243. },
  244. ],
  245. },
  246. },
  247. doneBase: {
  248. name: "two",
  249. disabled: true,
  250. titledata: [
  251. {
  252. label: "文件标题",
  253. prop: "need_name",
  254. width: 300,
  255. color: "#0682CD",
  256. },
  257. {
  258. label: "发起部门",
  259. prop: "apply_department",
  260. width: 200,
  261. },
  262. {
  263. label: "发起科室",
  264. prop: "apply_office",
  265. width: 200,
  266. },
  267. {
  268. label: "发起人",
  269. prop: "proposer",
  270. width: 200,
  271. },
  272. {
  273. label: "发起时间",
  274. prop: "proposer_time",
  275. width: 250,
  276. },
  277. {
  278. label: "状态",
  279. prop: "taskName",
  280. width: 200,
  281. },
  282. ], //表格头
  283. data: [], //内容数据
  284. loading: true,
  285. pageData: {
  286. total: 100, // 总条数
  287. pageSizes: [10], // 每页数量
  288. pageSize: 10, // 每页数量
  289. pageNum: 1, // 页码
  290. },
  291. isSelection: false, // 表格有多选时设置
  292. isOperation: false, // 表格有操作列时设置
  293. isIndex: true, // 列表序号
  294. operation: {
  295. // 表格有操作列时设置
  296. label: "操作", // 列名
  297. width: "50", // 根据实际情况给宽度
  298. data: [
  299. {
  300. label: "操作", // 操作名称
  301. type: "", //按钮类型
  302. handleRow: function () {
  303. }, // 自定义事件
  304. },
  305. ],
  306. },
  307. },
  308. meLaunch: {
  309. name: "three",
  310. titledata: [
  311. {
  312. label: "文件标题",
  313. prop: "need_name",
  314. width: 300,
  315. color: "#0682CD",
  316. },
  317. {
  318. label: "发起部门",
  319. prop: "apply_department",
  320. width: 200,
  321. },
  322. {
  323. label: "发起科室",
  324. prop: "apply_office",
  325. width: 200,
  326. },
  327. {
  328. label: "发起人",
  329. prop: "proposer",
  330. width: 200,
  331. },
  332. {
  333. label: "发起时间",
  334. prop: "proposer_time",
  335. width: 250,
  336. },
  337. {
  338. label: "状态",
  339. prop: "taskName",
  340. width: 200,
  341. },
  342. ], //表格头
  343. data: [], //内容数据
  344. loading: true,
  345. pageData: {
  346. total: 100, // 总条数
  347. pageSizes: [10], // 每页数量
  348. pageSize: 10, // 每页数量
  349. pageNum: 1, // 页码
  350. },
  351. isSelection: false, // 表格有多选时设置
  352. isOperation: false, // 表格有操作列时设置
  353. isIndex: true, // 列表序号
  354. },
  355. lable: {},//jziyy 页面table列表布局变量
  356. copyUser: "", //抄送人
  357. backThree: [],
  358. backCopyThree: [], //抄送人数组
  359. lables: {
  360. height: "400",
  361. titledata: [
  362. {
  363. label: "环节名称",
  364. prop: "taskName",
  365. width: 300,
  366. },
  367. {
  368. label: "处理人",
  369. prop: "assignee",
  370. width: 300,
  371. },
  372. {
  373. label: "到达时间",
  374. prop: "startTime",
  375. width: 300,
  376. },
  377. {
  378. label: "处理时间",
  379. prop: "endTime",
  380. width: 300,
  381. },
  382. {
  383. label: "回复意见",
  384. prop: "content",
  385. width: 300,
  386. },
  387. ], //表格头
  388. data: [], //内容数据
  389. loading: true,
  390. pageData: {
  391. total: 10, // 总条数
  392. pageSize: 10, // 每页数量
  393. pageSizes: [10], // 每页数量
  394. pageNum: 1, // 页码
  395. },
  396. isSelection: false, // 表格有多选时设置
  397. isOperation: false, // 表格有操作列时设置
  398. isIndex: true, // 列表序号
  399. operation: {
  400. // 表格有操作列时设置
  401. label: "操作", // 列名
  402. width: "50", // 根据实际情况给宽度
  403. data: [
  404. {
  405. label: "操作", // 操作名称
  406. type: "", //按钮类型
  407. handleRow: function () {
  408. }, // 自定义事件
  409. },
  410. ],
  411. },
  412. },
  413. formWorkId: "",
  414. taskName: "", //工单是否为起草阶段
  415. clicknextName: "", //点击选择流程节点
  416. firstStatus: false,
  417. selectUser: "", //选择人userName
  418. isSync: "1", //什么yes no起草状态判断
  419. createdId: "", //获取表单创始人Id
  420. batchList: ["fanyan"], //多选数组
  421. userList: [
  422. //选择路径列表页
  423. ],
  424. props: {
  425. lazy: true,
  426. lazyLoad: this.lazyLoad,
  427. },
  428. propsList: [],
  429. DepartmentName: "",
  430. seleIndex: 9,
  431. clickTagName: "first",
  432. value: "",
  433. nextPath: [],
  434. nextPaths: [],
  435. node: [],
  436. nodes: [],
  437. transferStatus: false,
  438. TransferStatus: false,
  439. CopyStatus: false,
  440. initialList: [],
  441. clickTaskName: "",
  442. seachLists: {},
  443. timeList: {},
  444. };
  445. },
  446. created() {
  447. let status = JSON.stringify(this.$route.query) == "{}";
  448. if (status) {
  449. //oa跳转回来显示
  450. this.getQueryList();
  451. this.getMeDone();
  452. this.getMeLaunch();
  453. this.lable = this.todoBase;
  454. } else {
  455. let { id, type } = this.$route.query;
  456. let list = {
  457. taskId: id,
  458. tableName: this.tableName
  459. };
  460. this.getQueryList(0, list,0);//代办
  461. }
  462. },
  463. methods: {
  464. //添加面包屑
  465. setabList(n, p) {
  466. let params = {
  467. children: "",
  468. name: n,
  469. rountPath: p,
  470. target: "_self",
  471. };
  472. for (let i = 0; i < this.$store.state.tabList.length; i++) {
  473. if (this.$store.state.tabList[i].name === params.name) {
  474. this.$store.state.tabList[i] = params;
  475. }
  476. }
  477. let set = new Set([...this.$store.state.tabList, params]);
  478. set.add(params);
  479. this.$store.commit("setDefaultActive", params.rountPath);
  480. this.$store.commit("setTabList", Array.from(set));
  481. },
  482. beforeClose() {
  483. this.dialogStatus = false;
  484. this.handleCloses();
  485. switch (this.clickTagName) {
  486. case "first": {
  487. this.getMeDone("1");
  488. this.getMeLaunch("1");
  489. this.getQueryList();
  490. break;
  491. }
  492. case "two": {
  493. this.getQueryList("1");
  494. this.getMeLaunch("1");
  495. this.getMeDone();
  496. break;
  497. }
  498. case "three": {
  499. this.getQueryList("1");
  500. this.getMeDone("1");
  501. this.getMeLaunch();
  502. break;
  503. }
  504. }
  505. },
  506. //是否最后一个人
  507. async getLastName() {
  508. console.log(this.fromList);
  509. let list = {
  510. procinstid: this.fromList.processId,
  511. taskid: this.fromList.taskId,
  512. // taskId:e.taskId
  513. };
  514. let _this = this;
  515. let obj = {
  516. url: this.$url.formList.getLastName, //流程追踪接口
  517. data: list,
  518. // status: "form",
  519. headers: {
  520. "Content-Type": "application/json",
  521. },
  522. };
  523. let res = await this.common.httpPost(obj, success);
  524. function success(data) {
  525. _this.isWorkflowStatus = data.lastMan != false;
  526. _this.lastManList = data;
  527. // console.log(_this.isWorkflowStatus);
  528. }
  529. },
  530. clickGetTree(e, index) {
  531. this.CopyStatus = false;
  532. this.TransferStatus = false;
  533. this.clickTaskName = e.properties.name;
  534. this.clicknextName = e.properties.name;
  535. this.seleIndex = index;
  536. this.getNextPath(e.resourceId); //1 为点击后获取线
  537. },
  538. //常用意见添加
  539. addStatus() {
  540. let newData = Date.parse(new Date());
  541. this.$prompt("请输入常用意见", "提示", {
  542. confirmButtonText: "确定",
  543. cancelButtonText: "取消",
  544. })
  545. .then(({value}) => {
  546. let list = {
  547. dictCode: "approval",
  548. dataCode: newData,
  549. dataName: value,
  550. dictName: "审批意见",
  551. };
  552. this.geaddctType(list);
  553. this.$message({
  554. type: "success",
  555. message: "常用意见添加成功",
  556. });
  557. })
  558. .catch(() => {
  559. this.$message({
  560. type: "info",
  561. message: "取消输入",
  562. });
  563. });
  564. },
  565. //常用意见删除
  566. deleStatus(e) {
  567. this.$confirm("此操作将删除此常用意见, 是否继续?", "提示", {
  568. confirmButtonText: "确定",
  569. cancelButtonText: "取消",
  570. type: "warning",
  571. })
  572. .then(() => {
  573. let list = {
  574. dataCode: e.dataCode,
  575. dictCode: "approval",
  576. };
  577. this.geDelectType(list);
  578. this.$message({
  579. type: "success",
  580. message: "删除成功!",
  581. });
  582. })
  583. .catch(() => {
  584. this.$message({
  585. type: "info",
  586. message: "已取消删除",
  587. });
  588. });
  589. },
  590. //转需求管理平台
  591. clickReassignment() {
  592. this.$http({
  593. url: "/market/waf/sync",
  594. method: "post",
  595. headers: {
  596. "Content-Type": "application/json",
  597. },
  598. data: this.$refs.formTable.form,
  599. }).then((res) => {
  600. if (res.code === 0) {
  601. this.$message.success("转需求管理平台成功!");
  602. } else {
  603. this.$message.error("转需求管理平台错误!");
  604. }
  605. });
  606. },
  607. //点击工单状态跳转需求流程显示页面 e lab名称 res row对象
  608. clickDemand(e, res) {
  609. this.isWorkflowStatus = true
  610. //点击文件标题才会进行跳转
  611. if (e === "文件标题") {
  612. //代办页面跳转
  613. this.dialogTitle = "查看";
  614. if (this.clickTagName === "first") {
  615. if (res.taskName === "起草") {
  616. this.disabled = false;
  617. this.startStatus = true;
  618. this.closeStatus = true;
  619. this.saveStatus = true;
  620. } else {
  621. //不允许修改列表
  622. this.disabled = true;
  623. //弹出框表头 dialogTitle + 需求
  624. this.startStatus = true;
  625. this.closeStatus = true;
  626. this.saveStatus = false;
  627. }
  628. }
  629. if (this.clickTagName === "two") {
  630. this.disabled = true;
  631. this.startStatus = false;
  632. this.closeStatus = true;
  633. this.saveStatus = false;
  634. }
  635. if (this.clickTagName === "three") {
  636. if (res.taskName === "起草") {
  637. this.disabled = false;
  638. this.startStatus = true;
  639. this.closeStatus = true;
  640. this.saveStatus = true;
  641. } else {
  642. this.disabled = true;
  643. this.startStatus = false;
  644. this.closeStatus = true;
  645. this.saveStatus = false;
  646. }
  647. }
  648. //流程追踪页面展示
  649. this.clickForm(res);
  650. //会查询单条数据 并且把 页面展示出来
  651. this.getFromQuery(res);
  652. }
  653. },
  654. clickExport() {
  655. let array = [];
  656. array.push(this.$refs.formTable.form);
  657. this.downloadExcel(array);
  658. },
  659. getNowTime() {
  660. let date = new Date();
  661. let year = date.getFullYear(); //获取当前年份
  662. let mon = date.getMonth() + 1; //获取当前月份
  663. let da = date.getDate(); //获取当前日
  664. let h = date.getHours(); //获取小时
  665. let m = date.getMinutes(); //获取分钟
  666. return year + "-" + mon + "-" + da + "-" + h + ":" + m;
  667. },
  668. //导出方法
  669. downloadExcel(e) {
  670. let res = this.getNowTime();
  671. this.$http({
  672. url: "/market/waf/exportAll",
  673. method: "post",
  674. headers: {
  675. "Content-Type": "application/json",
  676. },
  677. responseType: "blob",
  678. data: e,
  679. }).then((response) => {
  680. if (window.navigator && window.navigator.msSaveOrOpenBlob) {
  681. let blob = new Blob([response.data.size], {
  682. type: "application/vnd.ms-excel;",
  683. });
  684. if (e.length > 1) {
  685. window.navigator.msSaveOrOpenBlob(
  686. blob,
  687. this.fromList.needName + ".zip"
  688. );
  689. // window.navigator.msSaveOrOpenBlob(blob, res + "需求申请单" + ".zip");
  690. } else {
  691. window.navigator.msSaveOrOpenBlob(
  692. blob,
  693. this.fromList.needName + ".zip"
  694. );
  695. }
  696. } else {
  697. /* 火狐谷歌的文件下载方式 */
  698. var blob = new Blob([response.data]);
  699. var downloadElement = document.createElement("a");
  700. var href = window.URL.createObjectURL(blob);
  701. downloadElement.href = href;
  702. if (e.length > 1) {
  703. downloadElement.download = res + "需求申请单" + ".zip";
  704. } else {
  705. downloadElement.download = e[0].needName + ".zip";
  706. }
  707. document.body.appendChild(downloadElement);
  708. downloadElement.click();
  709. document.body.removeChild(downloadElement);
  710. window.URL.revokeObjectURL(href);
  711. }
  712. });
  713. },
  714. //驳回方法
  715. clickReject(res) {
  716. let e = "no";
  717. this.submitWork(e, res);
  718. },
  719. //我发起的接口
  720. getMeLaunch(e) {
  721. this.loading = true;
  722. let list = {...{tableName: this.tableName}, ...e};
  723. getInitiateBase(this.totalPage, "", list).then((res) => {
  724. if (e !== "1"){
  725. this.meLaunch.data = res.data.data;
  726. this.meLaunch.pageData.total = res.data.totalRecord;
  727. }
  728. this.tabList[2].number = res.data.totalRecord
  729. this.loading = false;
  730. });
  731. },
  732. //按钮权限方法
  733. getBtnStatus(e) {
  734. this.$refs.formTable.form = e;
  735. },
  736. //我的已办接口
  737. getMeDone(e) {
  738. this.loading = true;
  739. getDoneBase(this.totalPage, "", {tableName: this.tableName,}).then((res) => {
  740. if (e !== "1"){
  741. this.doneBase.data = res.data.data;
  742. this.doneBase.data.map((item) => {
  743. item.status = "2";
  744. });
  745. this.doneBase.pageData.total = res.data.totalRecord;
  746. }
  747. this.tabList[1].number = res.data.totalRecord
  748. this.loading = false;
  749. });
  750. },
  751. isNaNStatus(e) {
  752. if (e.size === 0) {
  753. return "0";
  754. } else {
  755. return e.size;
  756. }
  757. },
  758. //选择树的回调
  759. changeTree(e) {
  760. if (e.length > 1) {
  761. this.$message.error("只能选择一个人");
  762. return;
  763. } else {
  764. this.backThree = e;
  765. if (e[0]) {
  766. this.selectUser = e[0].loginNameStr;
  767. } else {
  768. this.selectUser = "暂无选择";
  769. }
  770. }
  771. },
  772. changeTreeCopy(e) {
  773. if (e.length > 1) {
  774. this.$message.error("只能选择一个人");
  775. return;
  776. } else {
  777. this.backCopyThree = e;
  778. if (e[0]) {
  779. this.copyUser = e[0].loginNameStr;
  780. } else {
  781. this.copyUser = "暂无选择";
  782. }
  783. }
  784. },
  785. //查询form表单数据
  786. getFromQuery(e) {
  787. this.$http({
  788. url: "/market/scsjdcProProcess/query",
  789. method: "post",
  790. headers: {
  791. "Content-Type": "application/json",
  792. },
  793. data: {id: e.id},
  794. }).then((res11) => {
  795. this.dialogStatus = true;
  796. this.fromList.mkFileShareAttachList = res11.data.mkFileShareAttachList;
  797. this.taskId = res11.data.taskId;
  798. this.fromList = res11.data;
  799. this.fromList.createId = e.createId
  800. console.log("==========" + this.fromList.createId)
  801. this.fromList.resourceId = e.resourceId
  802. this.taskId = res11.data.taskId;
  803. });
  804. },
  805. //我发起的搜索内容
  806. seachList(e) {
  807. this.seachLists = e;
  808. this.getMeLaunch(e);
  809. },
  810. //点击修改
  811. clickEdit() {
  812. this.editStatus = true;
  813. },
  814. //点击职位显示右侧列表
  815. //常用意见点击选择
  816. clickCommonly(e) {
  817. this.textarea = e.currentTarget.innerHTML;
  818. },
  819. //------------------ jziyy新建按钮
  820. async clickNewTag() {
  821. this.dialogTitle = "新建";
  822. this.lables.data = [];
  823. this.disabled = false;
  824. this.isWorkflowStatus = true;
  825. await this.getDepartmentName();
  826. },
  827. //获取用户部门名称
  828. getDepartmentName() {
  829. this.$http({
  830. url: "/market/scsjdcProProcess/queryAutoInfo",
  831. method: "post",
  832. headers: {
  833. "Content-Type": "application/json",
  834. },
  835. data: {},
  836. }).then((res) => {
  837. let list = {
  838. phoneNo: res.data.body.phoneNo,
  839. proposer: res.data.body.proposer,
  840. proposerNo: res.data.body.proposer,
  841. applyDepartment: res.data.body.applyDepartment,
  842. applyOffice: res.data.body.applyOffice,
  843. needNo: res.data.body.needNo,
  844. proposerTime: res.data.body.proposerTime,
  845. ruleType: "1", //新建按钮跳转过去的
  846. };
  847. this.fromList = list;
  848. //将用户部门科室名称数据发送给新建弹出页
  849. if (this.$refs.formTable) {
  850. this.$refs.formTable.form = list;
  851. }
  852. this.dialogStatus = true;
  853. this.saveStatus = true;
  854. });
  855. },
  856. //保存接口
  857. async clickSave() {
  858. this.$refs.formTable.$refs.form.validate((valid) => {
  859. if (valid) {
  860. if (this.fromList.id) {
  861. this.setUpdateForm(this.$refs.formTable.form);
  862. } else {
  863. this.$http({
  864. url: "/market/api/user/info/queryNodePers?params=" + JSON.parse(window.sessionStorage.userInfo).loginNo,
  865. method: "post",
  866. headers: {
  867. "Content-Type": "application/json",
  868. },
  869. }).then((res) => {
  870. console.log(res);
  871. this.request_form.userName = res.data[0].children[0].loginNameStr;
  872. this.request_form.userId = res.data[0].children[0].loginNoStr;
  873. this.setForm();
  874. });
  875. }
  876. } else {
  877. this.$message.error("请完善表单信息");
  878. return false;
  879. }
  880. });
  881. },
  882. //保存按钮
  883. //获取自己idname
  884. getUserIds() {
  885. this.$http({
  886. url: "/market/api/user/info/queryNodePers?params=" + JSON.parse(window.sessionStorage.userInfo).loginNo,
  887. method: "post",
  888. headers: {
  889. "Content-Type": "application/json",
  890. },
  891. }).then((res) => {
  892. console.log(res);
  893. this.request_form.userName = res.data[0].children[0].loginNameStr;
  894. this.request_form.userId = res.data[0].children[0].loginNoStr;
  895. });
  896. },
  897. setForm(e) {
  898. this.request_form.title = "[工作台]-省生产数据导出-" + this.$refs.formTable.form.needName;
  899. this.$http({
  900. url: "/market/scsjdcProProcess/add",
  901. method: "post",
  902. headers: {
  903. "Content-Type": "application/json",
  904. },
  905. data: this.$refs.formTable.form,
  906. }).then((res) => {
  907. this.request_form.businessKey = res.data.body;
  908. this.fromList.id = res.data.body;
  909. this.formWorkId = res.data.body;
  910. this.clickHandle(res.data.body);
  911. this.$message.success("保存成功");
  912. });
  913. },
  914. //处理按钮,开始工作流接口
  915. //处理按钮,开始工作流接口
  916. clickHandles() {
  917. this.getNextPath(this.fromList.resourceId || "");
  918. console.log(this.fromList);
  919. this.request_form.title = "[工作台]-省生产数据导出-" + this.$refs.formTable.form.needName;
  920. // if (this.fromList.taskId) {
  921. // this.destroy = true;
  922. // this.handleStatus = true;
  923. // } else {
  924. // this.$message.error("请先点击保存按钮");
  925. // }
  926. },
  927. getNextPath(e) {
  928. let list = {
  929. // fresourceId: "bf79721c-33f3-11ed-ba0b-00505687dcd3", //测试环境
  930. fresourceId: this.requestForm.fresourceId, // 本地环境
  931. processId: this.requestForm.processDefinitionKey,
  932. // fresourceId: "0d94de8a-0281-11ed-a302-4ae7da54db39", // 本地环境
  933. // processId: "request_form_process",
  934. // resourceId: e,
  935. };
  936. if (e) {
  937. // this.propsList = [];
  938. list.resourceId = e;
  939. }
  940. this.$http({
  941. url: "/market/waf/queryPath",
  942. method: "post",
  943. headers: {
  944. "Content-Type": "application/json",
  945. },
  946. data: list,
  947. }).then((res) => {
  948. console.log(res);
  949. console.log(res.data.body);
  950. console.log(res.data.body.nextShapes[0].multi);
  951. if (res.data.body.nextShapes[0].multi) {
  952. if (res.data.body.nextShapes[0].multi.multi === "true") {
  953. this.getLastName();
  954. }
  955. }
  956. if (this.fromList.taskId) {
  957. this.destroy = true;
  958. this.handleStatus = true;
  959. this.getMetirialType();
  960. } else {
  961. this.$message.error("请先点击保存按钮");
  962. }
  963. });
  964. },
  965. //获取字典表常用意见
  966. getMetirialType(e) {
  967. this.$http({
  968. url: "/market/cfgDataDict/queryList",
  969. method: "post",
  970. headers: {
  971. "Content-Type": "application/json",
  972. },
  973. data: {
  974. dictCodePks: "approval",
  975. },
  976. }).then((res) => {
  977. this.commonlyList = res.data;
  978. });
  979. },
  980. async clickForm(e) {
  981. let list = {
  982. processInstanceId: e.process_id,
  983. // taskId:e.taskId
  984. };
  985. let _this = this;
  986. let obj = {
  987. url: this.$url.formList.getCommentsByProcessId, //流程追踪接口
  988. data: list,
  989. headers: {
  990. "Content-Type": "application/json",
  991. },
  992. };
  993. let res = await this.common.httpPost(obj, success);
  994. function success(data) {
  995. console.log('[ 接口返回值第一曾 ] >', data)
  996. let list = [];
  997. list = data.data.data;
  998. if (data.data.lastmandata.length !== 0) {
  999. data.data.lastmandata.map((item, index) => {
  1000. item.id = index + 22;
  1001. });
  1002. }
  1003. list.map((item, index) => {
  1004. item.startTime = _this.$util.datetimeFormat(item.startTime);
  1005. item.endTime = _this.$util.datetimeFormat(item.endTime);
  1006. item.id = index + 1;
  1007. item.children = [];
  1008. if (data.data.lastmandata.length != 0) {
  1009. let indexs = data.data.lastmandata.findIndex((items) => {
  1010. if (items.taskId == item.taskId) {
  1011. item.children.push(items);
  1012. }
  1013. });
  1014. }
  1015. });
  1016. console.log(list);
  1017. _this.lables.data = list;
  1018. console.log("[ _this.lables.data ] >", _this.lables.data);
  1019. _this.abc = true;
  1020. }
  1021. },
  1022. async clickHandle(e) {
  1023. let _this = this;
  1024. let obj = {
  1025. url: this.$url.formList.startWork, //开始工作流接口
  1026. data: _this.request_form,
  1027. status: "form",
  1028. headers: {
  1029. "Content-Type": "application/x-www-form-urlencoded",
  1030. },
  1031. };
  1032. let res = await this.common.httpPost(obj, success);
  1033. function success(data) {
  1034. _this.fromList.taskId = data.data;
  1035. _this.taskId = data.data;
  1036. let list = {
  1037. id: e,
  1038. processId: _this.fromList.taskId,
  1039. tableName: _this.tableName,
  1040. };
  1041. _this.setUpdate(list);
  1042. }
  1043. },
  1044. setUpdateForm(e) {
  1045. this.request_form.title = "[工作台]-省生产数据导出-" + this.$refs.formTable.form.needName;
  1046. // this.$refs.formTable.form.taskId = e;
  1047. this.$http({
  1048. url: "/market/scsjdcProProcess/update",
  1049. method: "post",
  1050. headers: {
  1051. "Content-Type": "application/json",
  1052. },
  1053. data: this.$refs.formTable.form,
  1054. }).then((res) => {
  1055. this.request_form.businessKey = res.data.body;
  1056. this.fromList.id = res.data.body;
  1057. this.formWorkId = res.data.body;
  1058. this.setUpdate(e);
  1059. this.$message.success("更新成功");
  1060. });
  1061. },
  1062. //更新工作流接口
  1063. setUpdate(e) {
  1064. if (!e.tableName){
  1065. e.tableName = this.tableName;
  1066. }
  1067. this.$http({
  1068. url: "/market/waf/updateBase",
  1069. method: "post",
  1070. headers: {
  1071. "Content-Type": "application/json",
  1072. },
  1073. data: e,
  1074. }).then((res) => {
  1075. this.fromList.taskId = res.data.body[0].taskId;
  1076. this.fromList.taskName = res.data.body[0].taskName;
  1077. this.fromList.processId = res.data.body[0].process_id;
  1078. if (res.data.result === 0) {
  1079. this.$message.success("工作流更新成功");
  1080. }
  1081. })
  1082. },
  1083. //点击查阅接口
  1084. //获取我的代办列表List
  1085. getQueryList(e, currentList, status) {
  1086. getTodoBase(this.totalPage, "", currentList || {tableName: this.tableName}).then((res) => {
  1087. if (status === 0) {
  1088. this.clickDemand("文件标题", res.data.data[0]);
  1089. }
  1090. this.tabList[0].number = res.data.totalRecord;
  1091. if (e !== "1") {
  1092. this.todoBase.data = res.data.data;
  1093. this.todoBase.pageData.total = res.data.totalRecord;
  1094. this.lable = this.todoBase;
  1095. }
  1096. });
  1097. },
  1098. getCurrentPageList(e) {
  1099. this.totalPage = Math.ceil(e.length / this.pageSize);
  1100. this.totalPage = this.totalPage == 0 ? 1 : this.totalPage;
  1101. let begin = (this.currentPage - 1) * this.pageSize;
  1102. let end = this.currentPage * this.pageSize;
  1103. this.currentPageList = e.slice(begin, end);
  1104. return this.currentPageList;
  1105. },
  1106. getNum(e) {
  1107. //多选数组
  1108. this.batchList = e;
  1109. if (e.length > 0) {
  1110. this.exportStatus = true;
  1111. } else {
  1112. this.exportStatus = false;
  1113. }
  1114. this.num = e.length;
  1115. },
  1116. //获取页码
  1117. changeNum(e) {
  1118. this.pageNo = e;
  1119. this.totalPage = e;
  1120. if (this.clickTagName === "first") {
  1121. if (this.timeList) {
  1122. this.getQueryList(this.timeList);
  1123. } else {
  1124. this.getQueryList();
  1125. }
  1126. } else if (this.clickTagName === "two") {
  1127. this.getMeDone();
  1128. } else if (this.clickTagName === "three") {
  1129. if (this.seachLists) {
  1130. this.getMeLaunch(this.seachLists);
  1131. } else {
  1132. this.getMeLaunch();
  1133. }
  1134. }
  1135. },
  1136. clickTabs(e) {
  1137. this.buttonStatus = true;
  1138. this.clickTagName = e;
  1139. this.$refs.TableList.page = 1;
  1140. this.totalPage = "1";
  1141. //重新网络请求
  1142. if (this.todoBase.name == e) {
  1143. this.lable = this.todoBase;
  1144. this.getQueryList();
  1145. } else if (this.doneBase.name == e) {
  1146. this.lable = this.doneBase;
  1147. this.getMeDone();
  1148. } else if (this.meLaunch.name === e) {
  1149. this.lable = this.meLaunch;
  1150. this.getMeLaunch();
  1151. }
  1152. },
  1153. handleClose() {
  1154. this.dialogStatus = false;
  1155. this.forwardStatus = false;
  1156. this.exportBtnStatus = false;
  1157. this.saveStatus = false;
  1158. this.startStatus = true;
  1159. this.closeStatus = true;
  1160. // this.fromList = {};
  1161. },
  1162. handleCloses() {
  1163. this.treeList = [];
  1164. this.textarea = "";
  1165. this.handleStatus = false;
  1166. },
  1167. editCloses() {
  1168. this.editStatus = false;
  1169. },
  1170. }
  1171. ,
  1172. }
  1173. ;
  1174. </script>
  1175. <style lang="scss" scoped>
  1176. .copyClass {
  1177. display: flex;
  1178. }
  1179. .flex-header-text-tree {
  1180. width: 50%;
  1181. text-align: center;
  1182. }
  1183. .active {
  1184. background-color: #f3faff;
  1185. }
  1186. .flex-common {
  1187. padding: 10px 5%;
  1188. font-size: 18px;
  1189. }
  1190. .flex-buttons {
  1191. background-color: #cde4f6;
  1192. border-color: #cde4f6;
  1193. color: #606266;
  1194. }
  1195. .flex-button {
  1196. margin-top: 10px;
  1197. margin-bottom: 10px;
  1198. ::v-deep .el-button--primary {
  1199. width: 222px;
  1200. }
  1201. }
  1202. .flex-left-header-text {
  1203. height: 40px;
  1204. line-height: 40px;
  1205. color: black;
  1206. padding-left: 10px;
  1207. background-color: #cde4f6;
  1208. font-size: 18px;
  1209. font-weight: bold;
  1210. }
  1211. .flex-right-text {
  1212. margin-right: 20px;
  1213. width: 50%;
  1214. }
  1215. .flex-handle {
  1216. width: 100%;
  1217. padding: 30px;
  1218. display: flex;
  1219. .flex-right {
  1220. width: 50%;
  1221. border: 1px solid #e1e1e1;
  1222. margin-left: 20px;
  1223. }
  1224. .flex-left {
  1225. width: 50%;
  1226. display: flex;
  1227. flex-direction: column;
  1228. .flex-left-header {
  1229. display: flex;
  1230. justify-content: space-around;
  1231. }
  1232. }
  1233. }
  1234. .table-title {
  1235. height: 50px;
  1236. line-height: 50px;
  1237. background-color: #f3faff;
  1238. font-size: 18px;
  1239. font-weight: bold;
  1240. }
  1241. ::v-deep .el-dialog {
  1242. margin-top: 0 !important;
  1243. }
  1244. ::v-deep .el-table__fixed-body-wrapper {
  1245. top: 50px !important;
  1246. }
  1247. .flex-box {
  1248. display: flex;
  1249. width: calc(100% - 40px);
  1250. border-radius: 20px;
  1251. background-color: #fff;
  1252. margin: 0 auto;
  1253. margin-top: 20px;
  1254. position: relative;
  1255. flex-direction: column;
  1256. .flex-header {
  1257. display: flex;
  1258. width: 100%;
  1259. position: relative;
  1260. height: 60px;
  1261. margin: 1%;
  1262. border-bottom: 1px solid #e1e1e1;
  1263. justify-content: space-between;
  1264. .el-button {
  1265. width: 150px;
  1266. float: right;
  1267. height: 40px !important;
  1268. margin-right: 30px;
  1269. }
  1270. }
  1271. }
  1272. //设置子组件样式
  1273. ::v-deep .el-tabs__item {
  1274. padding: 0;
  1275. margin-right: 20px;
  1276. width: 166px;
  1277. text-align: center;
  1278. background-color: #d8eaf6;
  1279. color: black;
  1280. }
  1281. ::v-deep .is-active {
  1282. color: #fff;
  1283. background-color: #0583cd;
  1284. }
  1285. ::v-deep .el-tabs__active-bar {
  1286. display: none;
  1287. }
  1288. ::v-deep .el-tabs__nav-wrap::after {
  1289. display: none !important;
  1290. }
  1291. .flex-form {
  1292. margin-top: 50px;
  1293. }
  1294. .flex-footer-botton {
  1295. display: flex;
  1296. justify-content: space-evenly;
  1297. }
  1298. </style>