123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371 |
- <template>
- <div class="flex-box">
- <!-- 头部组件 -->
- <div :span="24" class="flex-header">
- <Tabs :tabList="tabList" @status="clickTabs">
- </Tabs>
- <el-button
- type="primary"
- @click="clickNewTag"
- v-show="lable.name === 'first'"
- >+新建
- </el-button
- >
- </div>
- <div class="flex-count">
- <Table
- @clickDemand="clickDemand"
- :list="lable"
- ref="TableList"
- @num="getNum"
- @changeNum="changeNum"
- >
- <template v-slot:three>
- </template>
- </Table>
- </div>
- <el-dialog
- :title="dialogTitle + '工单'"
- :visible.sync="dialogStatus"
- width="100%"
- :before-close="handleClose"
- :modal="false"
- v-if="dialogStatus"
- :destroy-on-close="true"
- >
- <!-- 后期维护 -->
- <div style="position: fixed; z-index: 10000" v-if="buttonStatus">
- <el-button type="primary" v-if="startStatus" @click="clickHandles"
- >处理
- </el-button
- >
- <el-button type="primary" v-if="closeStatus" @click="handleClose"
- >关闭
- </el-button
- >
- <el-button type="primary" v-if="saveStatus" @click="clickSave"
- >保存
- </el-button
- >
- </div>
- <FormTable
- :list="fromList"
- :disabled="disabled"
- class="flex-form"
- ref="formTable"
- />
- <div>
- <div class="table-title">流程追踪</div>
- <Tableid :list="lables"></Tableid>
- </div>
- </el-dialog>
- <div v-if="destroy">
- <el-dialog
- title="处理操作"
- width="100%"
- :visible.sync="handleStatus"
- :before-close="handleCloses"
- :modal="false"
- v-if="handleStatus"
- :destroy-on-close="true"
- >
- <Workflow
- :list="fromList"
- @updateForm="beforeClose"
- v-if="isWorkflowStatus == true"
- :requestForm="requestForm"
- />
- <WorkflowEntrance :list="fromList" v-else :lastManList="lastManList" @beforeClose="beforeClose"
- :requestForm="requestForm" />
- <!-- 后期维护 -->
- </el-dialog>
- </div>
- </div>
- </template>
- <script>
- import Workflow from "../../../components/workflowBase";
- import FormTable from "./formTable.vue";
- import Seach from "../../../components/el-search.vue";
- import Tabs from "../../../components/el-tabs.vue";
- import Table from "../../../components/el-form";
- import Tableid from "../../../components/el-formid";
- import WorkflowEntrance from "../../../components/workflowEntrance";
- import {
- getTodoBase,
- getDoneBase,
- getInitiateBase,
- } from "../../../http/api.js";
- export default {
- components: {
- Tabs,
- Table,
- Tableid,
- Seach,
- FormTable,
- Workflow,
- WorkflowEntrance
- },
- data() {
- return {
- tableName: "scsjdc_pro_process",
- buttonStatus: true,
- copyStatus: false,
- dialogTitle: "",
- disabled: false,
- destroy: false,
- //分页数据
- totalPage: "1", //默认第一页
- currentPage: "1", //当前页数
- pageSize: "10", //每页显示十条
- currentPageList: ["1", "2"],
- startStatus: true,
- closeStatus: true, //关闭按钮状态
- forwardStatus: false, //转需求管理平台状态
- exportBtnStatus: false, //导出按钮状态
- saveStatus: false, //保存按钮状态
- fromList: {}, //表单数据
- lastManList: [],
- isWorkflowStatus: true, //默认展示模式组件,为true时展示多人处理组件
- rejectStatus: true,
- taskId: "", //工单taskID
- treeUser: {},
- formId: "",
- fileId: "", //工作流开启Id
- request_form: {
- userId: "",
- userName: "",
- path: this.$router.currentRoute.name,
- userCode: JSON.parse(window.sessionStorage.userInfo).loginNo,
- // path:this.$roter.options.routers,
- // nextDealMan:'',
- title: "title",
- businessKey: "",
- processDefinitionKey: "scsjdc_pro_process",
- },
- requestForm: {
- // fresourceId: "ae3564a5-96f2-11ed-be6b-00505687dcd3", // 本地环境
- fresourceId: "b67ff4ed-c312-11ed-afb6-e00084564cce", // 生产环境
- // fresourceId: "bf79721c-33f3-11ed-ba0b-00505687dcd3", //测试环境
- processDefinitionKey: "scsjdc_pro_process",
- },
- treeList: [], //候选人列表
- treeCopyList: [], //抄送人列表
- editStatus: false,
- querryList: [], //已选人员名单
- commonlyList: [
- //常用意见列表页
- ],
- textarea: "未填写意见",
- num: 0,
- dialogStatus: false, //新建dialog显示
- handleStatus: false, //处理按钮状态
- tabList: [
- {
- index: "first",
- label: "我的待办",
- number: 0,
- name: "prosss_key",
- },
- {
- index: "two",
- label: "我的已办",
- number: 0,
- },
- {
- index: "three",
- label: "我发起的",
- number: 0,
- }
- ],//上层跳转已发起已办等
- todoBase: {
- name: "first",
- height: "650",
- titledata: [
- {
- label: "文件标题",
- prop: "need_name",
- width: 300,
- color: "#0682cd",
- },
- {
- label: "发起部门",
- prop: "apply_department",
- width: 200,
- },
- {
- label: "发起科室",
- prop: "apply_office",
- width: 200,
- },
- {
- label: "发起人",
- prop: "proposer",
- width: 200,
- },
- {
- label: "发起时间",
- prop: "proposer_time",
- width: 250,
- },
- {
- label: "上一步处理人",
- prop: "predealman",
- width: 200,
- },
- {
- label: "状态",
- prop: "taskName",
- width: 200,
- },
- ], //表格头
- data: [], //内容数据
- loading: true,
- pageData: {
- total: 100, // 总条数
- pageSize: 10, // 每页数量
- pageSizes: [10], // 每页数量
- pageNum: 1, // 页码
- },
- isSelection: false, // 表格有多选时设置
- isOperation: false, // 表格有操作列时设置
- isIndex: true, // 列表序号
- operation: {
- // 表格有操作列时设置
- label: "操作", // 列名
- width: "50", // 根据实际情况给宽度
- data: [
- {
- label: "操作", // 操作名称
- type: "", //按钮类型
- handleRow: (e, r, o) => {
- }, // 自定义事件
- },
- ],
- },
- },
- doneBase: {
- name: "two",
- disabled: true,
- titledata: [
- {
- label: "文件标题",
- prop: "need_name",
- width: 300,
- color: "#0682CD",
- },
- {
- label: "发起部门",
- prop: "apply_department",
- width: 200,
- },
- {
- label: "发起科室",
- prop: "apply_office",
- width: 200,
- },
- {
- label: "发起人",
- prop: "proposer",
- width: 200,
- },
- {
- label: "发起时间",
- prop: "proposer_time",
- width: 250,
- },
- {
- label: "状态",
- prop: "taskName",
- width: 200,
- },
- ], //表格头
- data: [], //内容数据
- loading: true,
- pageData: {
- total: 100, // 总条数
- pageSizes: [10], // 每页数量
- pageSize: 10, // 每页数量
- pageNum: 1, // 页码
- },
- isSelection: false, // 表格有多选时设置
- isOperation: false, // 表格有操作列时设置
- isIndex: true, // 列表序号
- operation: {
- // 表格有操作列时设置
- label: "操作", // 列名
- width: "50", // 根据实际情况给宽度
- data: [
- {
- label: "操作", // 操作名称
- type: "", //按钮类型
- handleRow: function () {
- }, // 自定义事件
- },
- ],
- },
- },
- meLaunch: {
- name: "three",
- titledata: [
- {
- label: "文件标题",
- prop: "need_name",
- width: 300,
- color: "#0682CD",
- },
- {
- label: "发起部门",
- prop: "apply_department",
- width: 200,
- },
- {
- label: "发起科室",
- prop: "apply_office",
- width: 200,
- },
- {
- label: "发起人",
- prop: "proposer",
- width: 200,
- },
- {
- label: "发起时间",
- prop: "proposer_time",
- width: 250,
- },
- {
- label: "状态",
- prop: "taskName",
- width: 200,
- },
- ], //表格头
- data: [], //内容数据
- loading: true,
- pageData: {
- total: 100, // 总条数
- pageSizes: [10], // 每页数量
- pageSize: 10, // 每页数量
- pageNum: 1, // 页码
- },
- isSelection: false, // 表格有多选时设置
- isOperation: false, // 表格有操作列时设置
- isIndex: true, // 列表序号
- },
- lable: {},//jziyy 页面table列表布局变量
- copyUser: "", //抄送人
- backThree: [],
- backCopyThree: [], //抄送人数组
- lables: {
- height: "400",
- titledata: [
- {
- label: "环节名称",
- prop: "taskName",
- width: 300,
- },
- {
- label: "处理人",
- prop: "assignee",
- width: 300,
- },
- {
- label: "到达时间",
- prop: "startTime",
- width: 300,
- },
- {
- label: "处理时间",
- prop: "endTime",
- width: 300,
- },
- {
- label: "回复意见",
- prop: "content",
- width: 300,
- },
- ], //表格头
- data: [], //内容数据
- loading: true,
- pageData: {
- total: 10, // 总条数
- pageSize: 10, // 每页数量
- pageSizes: [10], // 每页数量
- pageNum: 1, // 页码
- },
- isSelection: false, // 表格有多选时设置
- isOperation: false, // 表格有操作列时设置
- isIndex: true, // 列表序号
- operation: {
- // 表格有操作列时设置
- label: "操作", // 列名
- width: "50", // 根据实际情况给宽度
- data: [
- {
- label: "操作", // 操作名称
- type: "", //按钮类型
- handleRow: function () {
- }, // 自定义事件
- },
- ],
- },
- },
- formWorkId: "",
- taskName: "", //工单是否为起草阶段
- clicknextName: "", //点击选择流程节点
- firstStatus: false,
- selectUser: "", //选择人userName
- isSync: "1", //什么yes no起草状态判断
- createdId: "", //获取表单创始人Id
- batchList: ["fanyan"], //多选数组
- userList: [
- //选择路径列表页
- ],
- props: {
- lazy: true,
- lazyLoad: this.lazyLoad,
- },
- propsList: [],
- DepartmentName: "",
- seleIndex: 9,
- clickTagName: "first",
- value: "",
- nextPath: [],
- nextPaths: [],
- node: [],
- nodes: [],
- transferStatus: false,
- TransferStatus: false,
- CopyStatus: false,
- initialList: [],
- clickTaskName: "",
- seachLists: {},
- timeList: {},
- };
- },
- created() {
- let status = JSON.stringify(this.$route.query) == "{}";
- if (status) {
- //oa跳转回来显示
- this.getQueryList();
- this.getMeDone();
- this.getMeLaunch();
- this.lable = this.todoBase;
- } else {
- let { id, type } = this.$route.query;
- let list = {
- taskId: id,
- tableName: this.tableName
- };
- this.getQueryList(0, list,0);//代办
- }
- },
- methods: {
- //添加面包屑
- setabList(n, p) {
- let params = {
- children: "",
- name: n,
- rountPath: p,
- target: "_self",
- };
- for (let i = 0; i < this.$store.state.tabList.length; i++) {
- if (this.$store.state.tabList[i].name === params.name) {
- this.$store.state.tabList[i] = params;
- }
- }
- let set = new Set([...this.$store.state.tabList, params]);
- set.add(params);
- this.$store.commit("setDefaultActive", params.rountPath);
- this.$store.commit("setTabList", Array.from(set));
- },
- beforeClose() {
- this.dialogStatus = false;
- this.handleCloses();
- switch (this.clickTagName) {
- case "first": {
- this.getMeDone("1");
- this.getMeLaunch("1");
- this.getQueryList();
- break;
- }
- case "two": {
- this.getQueryList("1");
- this.getMeLaunch("1");
- this.getMeDone();
- break;
- }
- case "three": {
- this.getQueryList("1");
- this.getMeDone("1");
- this.getMeLaunch();
- break;
- }
- }
- },
- //是否最后一个人
- async getLastName() {
- console.log(this.fromList);
- let list = {
- procinstid: this.fromList.processId,
- taskid: this.fromList.taskId,
- // taskId:e.taskId
- };
- let _this = this;
- let obj = {
- url: this.$url.formList.getLastName, //流程追踪接口
- data: list,
- // status: "form",
- headers: {
- "Content-Type": "application/json",
- },
- };
- let res = await this.common.httpPost(obj, success);
- function success(data) {
- _this.isWorkflowStatus = data.lastMan != false;
- _this.lastManList = data;
- // console.log(_this.isWorkflowStatus);
- }
- },
- clickGetTree(e, index) {
- this.CopyStatus = false;
- this.TransferStatus = false;
- this.clickTaskName = e.properties.name;
- this.clicknextName = e.properties.name;
- this.seleIndex = index;
- this.getNextPath(e.resourceId); //1 为点击后获取线
- },
- //常用意见添加
- addStatus() {
- let newData = Date.parse(new Date());
- this.$prompt("请输入常用意见", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- })
- .then(({value}) => {
- let list = {
- dictCode: "approval",
- dataCode: newData,
- dataName: value,
- dictName: "审批意见",
- };
- this.geaddctType(list);
- this.$message({
- type: "success",
- message: "常用意见添加成功",
- });
- })
- .catch(() => {
- this.$message({
- type: "info",
- message: "取消输入",
- });
- });
- },
- //常用意见删除
- deleStatus(e) {
- this.$confirm("此操作将删除此常用意见, 是否继续?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- let list = {
- dataCode: e.dataCode,
- dictCode: "approval",
- };
- this.geDelectType(list);
- this.$message({
- type: "success",
- message: "删除成功!",
- });
- })
- .catch(() => {
- this.$message({
- type: "info",
- message: "已取消删除",
- });
- });
- },
- //转需求管理平台
- clickReassignment() {
- this.$http({
- url: "/market/waf/sync",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: this.$refs.formTable.form,
- }).then((res) => {
- if (res.code === 0) {
- this.$message.success("转需求管理平台成功!");
- } else {
- this.$message.error("转需求管理平台错误!");
- }
- });
- },
- //点击工单状态跳转需求流程显示页面 e lab名称 res row对象
- clickDemand(e, res) {
- this.isWorkflowStatus = true
- //点击文件标题才会进行跳转
- if (e === "文件标题") {
- //代办页面跳转
- this.dialogTitle = "查看";
- if (this.clickTagName === "first") {
- if (res.taskName === "起草") {
- this.disabled = false;
- this.startStatus = true;
- this.closeStatus = true;
- this.saveStatus = true;
- } else {
- //不允许修改列表
- this.disabled = true;
- //弹出框表头 dialogTitle + 需求
- this.startStatus = true;
- this.closeStatus = true;
- this.saveStatus = false;
- }
- }
- if (this.clickTagName === "two") {
- this.disabled = true;
- this.startStatus = false;
- this.closeStatus = true;
- this.saveStatus = false;
- }
- if (this.clickTagName === "three") {
- if (res.taskName === "起草") {
- this.disabled = false;
- this.startStatus = true;
- this.closeStatus = true;
- this.saveStatus = true;
- } else {
- this.disabled = true;
- this.startStatus = false;
- this.closeStatus = true;
- this.saveStatus = false;
- }
- }
- //流程追踪页面展示
- this.clickForm(res);
- //会查询单条数据 并且把 页面展示出来
- this.getFromQuery(res);
- }
- },
- clickExport() {
- let array = [];
- array.push(this.$refs.formTable.form);
- this.downloadExcel(array);
- },
- getNowTime() {
- let date = new Date();
- let year = date.getFullYear(); //获取当前年份
- let mon = date.getMonth() + 1; //获取当前月份
- let da = date.getDate(); //获取当前日
- let h = date.getHours(); //获取小时
- let m = date.getMinutes(); //获取分钟
- return year + "-" + mon + "-" + da + "-" + h + ":" + m;
- },
- //导出方法
- downloadExcel(e) {
- let res = this.getNowTime();
- this.$http({
- url: "/market/waf/exportAll",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- responseType: "blob",
- data: e,
- }).then((response) => {
- if (window.navigator && window.navigator.msSaveOrOpenBlob) {
- let blob = new Blob([response.data.size], {
- type: "application/vnd.ms-excel;",
- });
- if (e.length > 1) {
- window.navigator.msSaveOrOpenBlob(
- blob,
- this.fromList.needName + ".zip"
- );
- // window.navigator.msSaveOrOpenBlob(blob, res + "需求申请单" + ".zip");
- } else {
- window.navigator.msSaveOrOpenBlob(
- blob,
- this.fromList.needName + ".zip"
- );
- }
- } else {
- /* 火狐谷歌的文件下载方式 */
- var blob = new Blob([response.data]);
- var downloadElement = document.createElement("a");
- var href = window.URL.createObjectURL(blob);
- downloadElement.href = href;
- if (e.length > 1) {
- downloadElement.download = res + "需求申请单" + ".zip";
- } else {
- downloadElement.download = e[0].needName + ".zip";
- }
- document.body.appendChild(downloadElement);
- downloadElement.click();
- document.body.removeChild(downloadElement);
- window.URL.revokeObjectURL(href);
- }
- });
- },
- //驳回方法
- clickReject(res) {
- let e = "no";
- this.submitWork(e, res);
- },
- //我发起的接口
- getMeLaunch(e) {
- this.loading = true;
- let list = {...{tableName: this.tableName}, ...e};
- getInitiateBase(this.totalPage, "", list).then((res) => {
- if (e !== "1"){
- this.meLaunch.data = res.data.data;
- this.meLaunch.pageData.total = res.data.totalRecord;
- }
- this.tabList[2].number = res.data.totalRecord
- this.loading = false;
- });
- },
- //按钮权限方法
- getBtnStatus(e) {
- this.$refs.formTable.form = e;
- },
- //我的已办接口
- getMeDone(e) {
- this.loading = true;
- getDoneBase(this.totalPage, "", {tableName: this.tableName,}).then((res) => {
- if (e !== "1"){
- this.doneBase.data = res.data.data;
- this.doneBase.data.map((item) => {
- item.status = "2";
- });
- this.doneBase.pageData.total = res.data.totalRecord;
- }
- this.tabList[1].number = res.data.totalRecord
- this.loading = false;
- });
- },
- isNaNStatus(e) {
- if (e.size === 0) {
- return "0";
- } else {
- return e.size;
- }
- },
- //选择树的回调
- changeTree(e) {
- if (e.length > 1) {
- this.$message.error("只能选择一个人");
- return;
- } else {
- this.backThree = e;
- if (e[0]) {
- this.selectUser = e[0].loginNameStr;
- } else {
- this.selectUser = "暂无选择";
- }
- }
- },
- changeTreeCopy(e) {
- if (e.length > 1) {
- this.$message.error("只能选择一个人");
- return;
- } else {
- this.backCopyThree = e;
- if (e[0]) {
- this.copyUser = e[0].loginNameStr;
- } else {
- this.copyUser = "暂无选择";
- }
- }
- },
- //查询form表单数据
- getFromQuery(e) {
- this.$http({
- url: "/market/scsjdcProProcess/query",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: {id: e.id},
- }).then((res11) => {
- this.dialogStatus = true;
- this.fromList.mkFileShareAttachList = res11.data.mkFileShareAttachList;
- this.taskId = res11.data.taskId;
- this.fromList = res11.data;
- this.fromList.createId = e.createId
- console.log("==========" + this.fromList.createId)
- this.fromList.resourceId = e.resourceId
- this.taskId = res11.data.taskId;
- });
- },
- //我发起的搜索内容
- seachList(e) {
- this.seachLists = e;
- this.getMeLaunch(e);
- },
- //点击修改
- clickEdit() {
- this.editStatus = true;
- },
- //点击职位显示右侧列表
- //常用意见点击选择
- clickCommonly(e) {
- this.textarea = e.currentTarget.innerHTML;
- },
- //------------------ jziyy新建按钮
- async clickNewTag() {
- this.dialogTitle = "新建";
- this.lables.data = [];
- this.disabled = false;
- this.isWorkflowStatus = true;
- await this.getDepartmentName();
- },
- //获取用户部门名称
- getDepartmentName() {
- this.$http({
- url: "/market/scsjdcProProcess/queryAutoInfo",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: {},
- }).then((res) => {
- let list = {
- phoneNo: res.data.body.phoneNo,
- proposer: res.data.body.proposer,
- proposerNo: res.data.body.proposer,
- applyDepartment: res.data.body.applyDepartment,
- applyOffice: res.data.body.applyOffice,
- needNo: res.data.body.needNo,
- proposerTime: res.data.body.proposerTime,
- ruleType: "1", //新建按钮跳转过去的
- };
- this.fromList = list;
- //将用户部门科室名称数据发送给新建弹出页
- if (this.$refs.formTable) {
- this.$refs.formTable.form = list;
- }
- this.dialogStatus = true;
- this.saveStatus = true;
- });
- },
- //保存接口
- async clickSave() {
- this.$refs.formTable.$refs.form.validate((valid) => {
- if (valid) {
- if (this.fromList.id) {
- this.setUpdateForm(this.$refs.formTable.form);
- } else {
- this.$http({
- url: "/market/api/user/info/queryNodePers?params=" + JSON.parse(window.sessionStorage.userInfo).loginNo,
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- }).then((res) => {
- console.log(res);
- this.request_form.userName = res.data[0].children[0].loginNameStr;
- this.request_form.userId = res.data[0].children[0].loginNoStr;
- this.setForm();
- });
- }
- } else {
- this.$message.error("请完善表单信息");
- return false;
- }
- });
- },
- //保存按钮
- //获取自己idname
- getUserIds() {
- this.$http({
- url: "/market/api/user/info/queryNodePers?params=" + JSON.parse(window.sessionStorage.userInfo).loginNo,
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- }).then((res) => {
- console.log(res);
- this.request_form.userName = res.data[0].children[0].loginNameStr;
- this.request_form.userId = res.data[0].children[0].loginNoStr;
- });
- },
- setForm(e) {
- this.request_form.title = this.$refs.formTable.form.needName;
- this.$http({
- url: "/market/scsjdcProProcess/add",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: this.$refs.formTable.form,
- }).then((res) => {
- this.request_form.businessKey = res.data.body;
- this.fromList.id = res.data.body;
- this.formWorkId = res.data.body;
- this.clickHandle(res.data.body);
- this.$message.success("保存成功");
- });
- },
- //处理按钮,开始工作流接口
- //处理按钮,开始工作流接口
- clickHandles() {
- this.getNextPath(this.fromList.resourceId || "");
- console.log(this.fromList);
- // if (this.fromList.taskId) {
- // this.destroy = true;
- // this.handleStatus = true;
- // } else {
- // this.$message.error("请先点击保存按钮");
- // }
- },
- getNextPath(e) {
- let list = {
- // fresourceId: "bf79721c-33f3-11ed-ba0b-00505687dcd3", //测试环境
- fresourceId: this.requestForm.fresourceId, // 本地环境
- processId: this.requestForm.processDefinitionKey,
- // fresourceId: "0d94de8a-0281-11ed-a302-4ae7da54db39", // 本地环境
- // processId: "request_form_process",
- // resourceId: e,
- };
- if (e) {
- // this.propsList = [];
- list.resourceId = e;
- }
- this.$http({
- url: "/market/waf/queryPath",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: list,
- }).then((res) => {
- console.log(res);
- console.log(res.data.body);
- console.log(res.data.body.nextShapes[0].multi);
- if (res.data.body.nextShapes[0].multi) {
- if (res.data.body.nextShapes[0].multi.multi === "true") {
- this.getLastName();
- }
- }
- if (this.fromList.taskId) {
- this.destroy = true;
- this.handleStatus = true;
- this.getMetirialType();
- } else {
- this.$message.error("请先点击保存按钮");
- }
- });
- },
- //获取字典表常用意见
- getMetirialType(e) {
- this.$http({
- url: "/market/cfgDataDict/queryList",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: {
- dictCodePks: "approval",
- },
- }).then((res) => {
- this.commonlyList = res.data;
- });
- },
- async clickForm(e) {
- let list = {
- processInstanceId: e.process_id,
- // taskId:e.taskId
- };
- let _this = this;
- let obj = {
- url: this.$url.formList.getCommentsByProcessId, //流程追踪接口
- data: list,
- headers: {
- "Content-Type": "application/json",
- },
- };
- let res = await this.common.httpPost(obj, success);
- function success(data) {
- console.log('[ 接口返回值第一曾 ] >', data)
- let list = [];
- list = data.data.data;
- if (data.data.lastmandata.length !== 0) {
- data.data.lastmandata.map((item, index) => {
- item.id = index + 22;
- });
- }
- list.map((item, index) => {
- item.startTime = _this.$util.datetimeFormat(item.startTime);
- item.endTime = _this.$util.datetimeFormat(item.endTime);
- item.id = index + 1;
- item.children = [];
- if (data.data.lastmandata.length != 0) {
- let indexs = data.data.lastmandata.findIndex((items) => {
- if (items.taskId == item.taskId) {
- item.children.push(items);
- }
- });
- }
- });
- console.log(list);
- _this.lables.data = list;
- console.log("[ _this.lables.data ] >", _this.lables.data);
- _this.abc = true;
- }
- },
- async clickHandle(e) {
- let _this = this;
- let obj = {
- url: this.$url.formList.startWork, //开始工作流接口
- data: _this.request_form,
- status: "form",
- headers: {
- "Content-Type": "application/x-www-form-urlencoded",
- },
- };
- let res = await this.common.httpPost(obj, success);
- function success(data) {
- _this.fromList.taskId = data.data;
- _this.taskId = data.data;
- let list = {
- id: e,
- processId: _this.fromList.taskId,
- tableName: _this.tableName,
- };
- _this.setUpdate(list);
- }
- },
- setUpdateForm(e) {
- this.request_form.title = "[工作台]-省生产数据导出-" + this.$refs.formTable.form.needName;
- // this.$refs.formTable.form.taskId = e;
- this.$http({
- url: "/market/scsjdcProProcess/update",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: this.$refs.formTable.form,
- }).then((res) => {
- this.request_form.businessKey = res.data.body;
- this.fromList.id = res.data.body;
- this.formWorkId = res.data.body;
- this.setUpdate(e);
- this.$message.success("更新成功");
- });
- },
- //更新工作流接口
- setUpdate(e) {
- if (!e.tableName){
- e.tableName = this.tableName;
- }
- this.$http({
- url: "/market/waf/updateBase",
- method: "post",
- headers: {
- "Content-Type": "application/json",
- },
- data: e,
- }).then((res) => {
- this.fromList.taskId = res.data.body[0].taskId;
- this.fromList.taskName = res.data.body[0].taskName;
- this.fromList.processId = res.data.body[0].process_id;
- if (res.data.result === 0) {
- this.$message.success("工作流更新成功");
- }
- })
- },
- //点击查阅接口
- //获取我的代办列表List
- getQueryList(e, currentList, status) {
- getTodoBase(this.totalPage, "", currentList || {tableName: this.tableName}).then((res) => {
- if (status === 0) {
- this.clickDemand("文件标题", res.data.data[0]);
- }
- this.tabList[0].number = res.data.totalRecord;
- if (e !== "1") {
- this.todoBase.data = res.data.data;
- this.todoBase.pageData.total = res.data.totalRecord;
- this.lable = this.todoBase;
- }
- });
- },
- getCurrentPageList(e) {
- this.totalPage = Math.ceil(e.length / this.pageSize);
- this.totalPage = this.totalPage == 0 ? 1 : this.totalPage;
- let begin = (this.currentPage - 1) * this.pageSize;
- let end = this.currentPage * this.pageSize;
- this.currentPageList = e.slice(begin, end);
- return this.currentPageList;
- },
- getNum(e) {
- //多选数组
- this.batchList = e;
- if (e.length > 0) {
- this.exportStatus = true;
- } else {
- this.exportStatus = false;
- }
- this.num = e.length;
- },
- //获取页码
- changeNum(e) {
- this.pageNo = e;
- this.totalPage = e;
- if (this.clickTagName === "first") {
- if (this.timeList) {
- this.getQueryList(this.timeList);
- } else {
- this.getQueryList();
- }
- } else if (this.clickTagName === "two") {
- this.getMeDone();
- } else if (this.clickTagName === "three") {
- if (this.seachLists) {
- this.getMeLaunch(this.seachLists);
- } else {
- this.getMeLaunch();
- }
- }
- },
- clickTabs(e) {
- this.buttonStatus = true;
- this.clickTagName = e;
- this.$refs.TableList.page = 1;
- this.totalPage = "1";
- //重新网络请求
- if (this.todoBase.name == e) {
- this.lable = this.todoBase;
- this.getQueryList();
- } else if (this.doneBase.name == e) {
- this.lable = this.doneBase;
- this.getMeDone();
- } else if (this.meLaunch.name === e) {
- this.lable = this.meLaunch;
- this.getMeLaunch();
- }
- },
- handleClose() {
- this.dialogStatus = false;
- this.forwardStatus = false;
- this.exportBtnStatus = false;
- this.saveStatus = false;
- this.startStatus = true;
- this.closeStatus = true;
- // this.fromList = {};
- },
- handleCloses() {
- this.treeList = [];
- this.textarea = "";
- this.handleStatus = false;
- },
- editCloses() {
- this.editStatus = false;
- },
- }
- ,
- }
- ;
- </script>
- <style lang="scss" scoped>
- .copyClass {
- display: flex;
- }
- .flex-header-text-tree {
- width: 50%;
- text-align: center;
- }
- .active {
- background-color: #f3faff;
- }
- .flex-common {
- padding: 10px 5%;
- font-size: 18px;
- }
- .flex-buttons {
- background-color: #cde4f6;
- border-color: #cde4f6;
- color: #606266;
- }
- .flex-button {
- margin-top: 10px;
- margin-bottom: 10px;
- ::v-deep .el-button--primary {
- width: 222px;
- }
- }
- .flex-left-header-text {
- height: 40px;
- line-height: 40px;
- color: black;
- padding-left: 10px;
- background-color: #cde4f6;
- font-size: 18px;
- font-weight: bold;
- }
- .flex-right-text {
- margin-right: 20px;
- width: 50%;
- }
- .flex-handle {
- width: 100%;
- padding: 30px;
- display: flex;
- .flex-right {
- width: 50%;
- border: 1px solid #e1e1e1;
- margin-left: 20px;
- }
- .flex-left {
- width: 50%;
- display: flex;
- flex-direction: column;
- .flex-left-header {
- display: flex;
- justify-content: space-around;
- }
- }
- }
- .table-title {
- height: 50px;
- line-height: 50px;
- background-color: #f3faff;
- font-size: 18px;
- font-weight: bold;
- }
- ::v-deep .el-dialog {
- margin-top: 0 !important;
- }
- ::v-deep .el-table__fixed-body-wrapper {
- top: 50px !important;
- }
- .flex-box {
- display: flex;
- width: calc(100% - 40px);
- border-radius: 20px;
- background-color: #fff;
- margin: 0 auto;
- margin-top: 20px;
- position: relative;
- flex-direction: column;
- .flex-header {
- display: flex;
- width: 100%;
- position: relative;
- height: 60px;
- margin: 1%;
- border-bottom: 1px solid #e1e1e1;
- justify-content: space-between;
- .el-button {
- width: 150px;
- float: right;
- height: 40px !important;
- margin-right: 30px;
- }
- }
- }
- //设置子组件样式
- ::v-deep .el-tabs__item {
- padding: 0;
- margin-right: 20px;
- width: 166px;
- text-align: center;
- background-color: #d8eaf6;
- color: black;
- }
- ::v-deep .is-active {
- color: #fff;
- background-color: #0583cd;
- }
- ::v-deep .el-tabs__active-bar {
- display: none;
- }
- ::v-deep .el-tabs__nav-wrap::after {
- display: none !important;
- }
- .flex-form {
- margin-top: 50px;
- }
- .flex-footer-botton {
- display: flex;
- justify-content: space-evenly;
- }
- </style>
|