provinceHome.vue 49 KB

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