|
@@ -4,16 +4,102 @@
|
|
|
<div v-else>
|
|
|
<el-card class="box-card">
|
|
|
<div class="text item">
|
|
|
- <el-steps v-if="currentNode.clazz !== undefined && currentNode.clazz !== null && currentNode.clazz !== ''" :active="activeIndex" finish-status="success">
|
|
|
- <template v-for="(item, index) in nodeStepList">
|
|
|
+ <el-steps
|
|
|
+ v-if="
|
|
|
+ currentNode.clazz !== undefined &&
|
|
|
+ currentNode.clazz !== null &&
|
|
|
+ currentNode.clazz !== ''
|
|
|
+ "
|
|
|
+ :active="activeIndex"
|
|
|
+ finish-status="success"
|
|
|
+ >
|
|
|
+ <!-- :simple="true" -->
|
|
|
+ <template v-for="(item, index) in circulationList">
|
|
|
<el-step
|
|
|
- v-if="item.isHideNode === false ||
|
|
|
- item.isHideNode === undefined ||
|
|
|
- item.isHideNode == null ||
|
|
|
- item.id === processStructureValue.workOrder.current_state"
|
|
|
+ v-if="
|
|
|
+ item.isHideNode === false ||
|
|
|
+ item.isHideNode === undefined ||
|
|
|
+ item.isHideNode == null ||
|
|
|
+ item.id === processStructureValue.workOrder.current_state
|
|
|
+ "
|
|
|
:key="index"
|
|
|
- :title="item.label"
|
|
|
- />
|
|
|
+ :title="item.state || item.label"
|
|
|
+ >
|
|
|
+ <template #description>
|
|
|
+ <!-- 判断是否有审核数据 -->
|
|
|
+ <template v-if="!item.create_time">
|
|
|
+ <p
|
|
|
+ class="apply-status"
|
|
|
+ v-if="item.assignUsers && item.assignUsers.length > 0"
|
|
|
+ >
|
|
|
+ <!-- 判断是否是自己审批 -->
|
|
|
+ <template
|
|
|
+ v-if="
|
|
|
+ item.assignUsers[0].userId == userInfo.userId &&
|
|
|
+ activeIndex == index
|
|
|
+ "
|
|
|
+ >
|
|
|
+ 我(审批中)
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <template v-if="item.isCounterSign">
|
|
|
+ <span
|
|
|
+ v-for="(au, aIndex) in item.assignUsers"
|
|
|
+ :key="aIndex"
|
|
|
+ >
|
|
|
+ {{ au.username
|
|
|
+ }}{{
|
|
|
+ aIndex < item.assignUsers.length - 1 ? "," : null
|
|
|
+ }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ {{ item.assignUsers[0].username }}
|
|
|
+ </template>
|
|
|
+ {{ activeIndex == index ? `(审批中)` : null }}
|
|
|
+ <!-- {{ item.assignUsers[0].username }}{{ activeIndex == index ? `(审批中)` : null }} -->
|
|
|
+ </template>
|
|
|
+ </p>
|
|
|
+ </template>
|
|
|
+ <template v-else>
|
|
|
+ <p class="apply-status" v-if="item.processor">
|
|
|
+ {{ item.processor
|
|
|
+ }}{{
|
|
|
+ item.circulation ? `(${item.circulation})` : null
|
|
|
+ }}
|
|
|
+ </p>
|
|
|
+ <!-- <p class="remarks" v-if="item.remarks">
|
|
|
+ {{ item.remarks }}
|
|
|
+ </p> -->
|
|
|
+ </template>
|
|
|
+ <!-- 有抄送人并且,本节点已经审批完成了 -->
|
|
|
+ <template
|
|
|
+ v-if="
|
|
|
+ item.cc_user &&
|
|
|
+ item.cc_user.length > 0 &&
|
|
|
+ activeIndex > index
|
|
|
+ "
|
|
|
+ >
|
|
|
+ <!-- 已抄送1人 -->
|
|
|
+ <!-- <div class="ccUsers" @click="onCCChange(item)">
|
|
|
+ <span>已抄送{{ item.cc_user.length }}人</span>
|
|
|
+ <van-icon
|
|
|
+ v-show="!item.ccStatus"
|
|
|
+ style="color: #CCCCCC"
|
|
|
+ name="arrow-down"
|
|
|
+ />
|
|
|
+ <van-icon
|
|
|
+ v-show="item.ccStatus"
|
|
|
+ style="color: #CCCCCC"
|
|
|
+ name="arrow-up"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <div class="ccUserDetail" v-if="item.ccStatus">
|
|
|
+ <span>{{ item.cc_user.join(",") }}</span>
|
|
|
+ </div> -->
|
|
|
+ </template>
|
|
|
+ </template>
|
|
|
+ </el-step>
|
|
|
</template>
|
|
|
</el-steps>
|
|
|
<div v-else>
|
|
@@ -27,7 +113,10 @@
|
|
|
</el-card>
|
|
|
|
|
|
<el-alert
|
|
|
- v-if="activeIndex !== nodeStepList.length && processStructureValue.workOrder.is_end===1"
|
|
|
+ v-if="
|
|
|
+ activeIndex !== nodeStepList.length &&
|
|
|
+ processStructureValue.workOrder.is_end === 1
|
|
|
+ "
|
|
|
style="margin-top: 15px"
|
|
|
:title="alertMessage"
|
|
|
type="error"
|
|
@@ -48,10 +137,12 @@
|
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
|
<el-form-item label="优先级:" style="margin-bottom: 0">
|
|
|
- <span v-if="processStructureValue.workOrder.priority===2">
|
|
|
+ <span v-if="processStructureValue.workOrder.priority === 2">
|
|
|
<el-tag type="warning">紧急</el-tag>
|
|
|
</span>
|
|
|
- <span v-else-if="processStructureValue.workOrder.priority===3">
|
|
|
+ <span
|
|
|
+ v-else-if="processStructureValue.workOrder.priority === 3"
|
|
|
+ >
|
|
|
<el-tag type="danger">非常紧急</el-tag>
|
|
|
</span>
|
|
|
<span v-else>
|
|
@@ -78,11 +169,13 @@
|
|
|
<div class="text item">
|
|
|
<template v-for="(tplItem, tplIndex) in processStructureValue.tpls">
|
|
|
<fm-generate-form
|
|
|
- v-show="currentNode.hideTpls===undefined ||
|
|
|
- currentNode.hideTpls===null ||
|
|
|
- currentNode.hideTpls.indexOf(tplItem.form_structure.id)===-1"
|
|
|
+ v-show="
|
|
|
+ currentNode.hideTpls === undefined ||
|
|
|
+ currentNode.hideTpls === null ||
|
|
|
+ currentNode.hideTpls.indexOf(tplItem.form_structure.id) === -1
|
|
|
+ "
|
|
|
:key="tplIndex"
|
|
|
- :ref="'generateForm-'+tplItem.id"
|
|
|
+ :ref="'generateForm-' + tplItem.id"
|
|
|
:preview="true"
|
|
|
:remote="remoteFunc"
|
|
|
:value="tplItem.form_data"
|
|
@@ -92,31 +185,57 @@
|
|
|
</template>
|
|
|
</div>
|
|
|
<div v-if="processStructureValue.userAuthority && is_end == 0">
|
|
|
- <hr style="background-color: #d9d9d9; border:0; height:1px; margin-bottom: 15px">
|
|
|
- <el-form ref="dataFrom" label-position="left" :model="dataList" label-width="150">
|
|
|
- <el-form-item label="备注信息" prop="remarks" :rules="[{ required: true, message: '请输入备注信息', trigger: 'blur' }]">
|
|
|
+ <hr
|
|
|
+ style="background-color: #d9d9d9; border:0; height:1px; margin-bottom: 15px"
|
|
|
+ />
|
|
|
+ <el-form
|
|
|
+ ref="dataFrom"
|
|
|
+ label-position="left"
|
|
|
+ :model="dataList"
|
|
|
+ label-width="150"
|
|
|
+ >
|
|
|
+ <el-form-item
|
|
|
+ label="备注信息"
|
|
|
+ prop="remarks"
|
|
|
+ :rules="[
|
|
|
+ { required: true, message: '请输入备注信息', trigger: 'blur' }
|
|
|
+ ]"
|
|
|
+ >
|
|
|
<el-input
|
|
|
v-model="dataList.remarks"
|
|
|
type="textarea"
|
|
|
placeholder="请输入备注信息"
|
|
|
maxlength="200"
|
|
|
- :autosize="{ minRows: 3, maxRows: 99}"
|
|
|
+ :autosize="{ minRows: 3, maxRows: 99 }"
|
|
|
show-word-limit
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
- <div class="text item" style="text-align: center;margin-top:18px">
|
|
|
- <el-button
|
|
|
- v-for="(item, index) in btn_group"
|
|
|
- :key="index"
|
|
|
- :type="item.className"
|
|
|
- @click="submitAction(item)" >{{ item.labelShow }}</el-button>
|
|
|
+ <div class="text item" style="text-align: center;margin-top:18px">
|
|
|
+ <el-button
|
|
|
+ type="warning"
|
|
|
+ round
|
|
|
+ @click="handleInversion(endNodeDetail)"
|
|
|
+ >转交</el-button
|
|
|
+ >
|
|
|
+ <el-button
|
|
|
+ v-for="(item, index) in btn_group"
|
|
|
+ :key="index"
|
|
|
+ :type="item.className"
|
|
|
+ @click="submitAction(item)"
|
|
|
+ round
|
|
|
+ >{{ item.labelShow }}</el-button
|
|
|
+ >
|
|
|
|
|
|
- <!-- 拒绝按钮内置 -->
|
|
|
- <el-button
|
|
|
- v-if="endNodeDetail.id"
|
|
|
- type="danger"
|
|
|
- @click="submitAction(endNodeDetail)" >{{ endNodeDetail.label }}</el-button>
|
|
|
- <!-- <div
|
|
|
+ <!-- 拒绝按钮内置 -->
|
|
|
+ <el-button
|
|
|
+ v-if="endNodeDetail.id"
|
|
|
+ type="danger"
|
|
|
+ round
|
|
|
+ @click="submitAction(endNodeDetail)"
|
|
|
+ >{{ endNodeDetail.label }}</el-button
|
|
|
+ >
|
|
|
+
|
|
|
+ <!-- <div
|
|
|
v-if="isActiveProcessing && currentNode.activeOrder"
|
|
|
>
|
|
|
<el-button
|
|
@@ -138,8 +257,8 @@
|
|
|
{{ item.label }}
|
|
|
</el-button>
|
|
|
</template> -->
|
|
|
- <!-- </div> -->
|
|
|
- </div>
|
|
|
+ <!-- </div> -->
|
|
|
+ </div>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
</el-card>
|
|
@@ -149,45 +268,32 @@
|
|
|
<span>工单流转历史</span>
|
|
|
</div>
|
|
|
<div class="text item">
|
|
|
- <el-table
|
|
|
- :data="circulationHistoryList"
|
|
|
- border
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- <el-table-column
|
|
|
- prop="state"
|
|
|
- label="节点"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- prop="circulation"
|
|
|
- label="流转"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- prop="processor"
|
|
|
- label="处理人"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- prop="create_time"
|
|
|
- label="处理时间"
|
|
|
- />
|
|
|
- <el-table-column
|
|
|
- prop="remarks"
|
|
|
- label="备注"
|
|
|
- />
|
|
|
+ <el-table :data="circulationHistoryList" border style="width: 100%">
|
|
|
+ <el-table-column prop="state" label="节点" />
|
|
|
+ <el-table-column prop="circulation" label="流转" />
|
|
|
+ <el-table-column prop="processor" label="处理人" />
|
|
|
+ <el-table-column prop="create_time" label="处理时间" />
|
|
|
+ <el-table-column prop="remarks" label="备注" />
|
|
|
</el-table>
|
|
|
</div>
|
|
|
</el-card>
|
|
|
</div>
|
|
|
+ <el-dialog title="转交工单" :visible.sync="dialogVisible" width="30%">
|
|
|
+ <TransferInversion
|
|
|
+ v-if="dialogVisible"
|
|
|
+ :selectItem="selectItem"
|
|
|
+ @getList="getProcessNodeList"
|
|
|
+ @close="dialogVisible = false"
|
|
|
+ />
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import Vue from 'vue'
|
|
|
-import {
|
|
|
- GenerateForm
|
|
|
-} from '@/components/VueFormMaking'
|
|
|
-import 'form-making/dist/FormMaking.css'
|
|
|
-Vue.component(GenerateForm.name, GenerateForm)
|
|
|
+import Vue from "vue";
|
|
|
+import { GenerateForm } from "@/components/VueFormMaking";
|
|
|
+import "form-making/dist/FormMaking.css";
|
|
|
+Vue.component(GenerateForm.name, GenerateForm);
|
|
|
|
|
|
import {
|
|
|
processStructure,
|
|
@@ -196,14 +302,19 @@ import {
|
|
|
asyncPlayLog,
|
|
|
queryUserInfo,
|
|
|
queryAllOrgan
|
|
|
-} from '@/api/process/work-order'
|
|
|
-import store from '@/store'
|
|
|
-import { getInfo } from '@/api/user'
|
|
|
+} from "@/api/process/work-order";
|
|
|
+import store from "@/store";
|
|
|
+import { getInfo } from "@/api/user";
|
|
|
|
|
|
-import { listUser } from '@/api/system/sysuser'
|
|
|
+import { listUser } from "@/api/system/sysuser";
|
|
|
+import TransferInversion from "./model/transferInversion";
|
|
|
+import load from "@/utils/loading";
|
|
|
|
|
|
-import { mapGetters } from 'vuex'
|
|
|
+import { mapGetters } from "vuex";
|
|
|
export default {
|
|
|
+ components: {
|
|
|
+ TransferInversion
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
isLoadingStatus: true,
|
|
@@ -215,25 +326,27 @@ export default {
|
|
|
tpls: [],
|
|
|
organList: [],
|
|
|
dataList: {
|
|
|
- remarks: '', // 备注信息
|
|
|
+ remarks: "" // 备注信息
|
|
|
},
|
|
|
- alertMessage: '',
|
|
|
+ userInfo: {},
|
|
|
+ alertMessage: "",
|
|
|
nodeStepList: [],
|
|
|
circulationHistoryList: [],
|
|
|
+ circulationList: [],
|
|
|
activeIndex: 0,
|
|
|
processStructureValue: {
|
|
|
- workOrder: { title: '' }
|
|
|
+ workOrder: { title: "" }
|
|
|
},
|
|
|
endNodeDetail: {}, // 结束结节信息
|
|
|
ruleForm: {
|
|
|
- title: '',
|
|
|
- process: '',
|
|
|
- classify: '',
|
|
|
- state_id: '',
|
|
|
- state: '',
|
|
|
- source_state: '',
|
|
|
- processor: '',
|
|
|
- process_method: '',
|
|
|
+ title: "",
|
|
|
+ process: "",
|
|
|
+ classify: "",
|
|
|
+ state_id: "",
|
|
|
+ state: "",
|
|
|
+ source_state: "",
|
|
|
+ processor: "",
|
|
|
+ process_method: "",
|
|
|
tpls: [],
|
|
|
tasks: []
|
|
|
},
|
|
@@ -248,43 +361,75 @@ export default {
|
|
|
listUser({
|
|
|
pageSize: 999999
|
|
|
}).then(response => {
|
|
|
- const options = response.data.list
|
|
|
- resolve(options)
|
|
|
- })
|
|
|
+ const options = response.data.list;
|
|
|
+ resolve(options);
|
|
|
+ });
|
|
|
}
|
|
|
+ },
|
|
|
+ dialogVisible: false,
|
|
|
+ selectItem: {
|
|
|
+ work_order_id: "",
|
|
|
+ node_id: null,
|
|
|
+ nodeList: [],
|
|
|
+ users: []
|
|
|
}
|
|
|
- }
|
|
|
+ };
|
|
|
},
|
|
|
computed: {
|
|
|
- ...mapGetters([
|
|
|
- 'userId'
|
|
|
- ])
|
|
|
+ ...mapGetters(["userId"])
|
|
|
},
|
|
|
async created() {
|
|
|
- await this.getUserInfo()
|
|
|
- await this.getAllOrgan()
|
|
|
- await this.getProcessNodeList()
|
|
|
+ await this.getUserInfo();
|
|
|
+ await this.getAllOrgan();
|
|
|
+ await this.getProcessNodeList();
|
|
|
// 获取用户信息
|
|
|
try {
|
|
|
- let user = await getInfo()
|
|
|
- this.userInfo = user.data
|
|
|
- console.log(this.processStructureValue.workOrder.creator, user.data.userId)
|
|
|
- this.ownerApply = this.processStructureValue.workOrder.creator == user.data.userId ? true : false
|
|
|
+ let user = await getInfo();
|
|
|
+ this.userInfo = user.data;
|
|
|
+ // console.log(
|
|
|
+ // this.processStructureValue.workOrder.creator,
|
|
|
+ // user.data.userId
|
|
|
+ // );
|
|
|
+ this.ownerApply =
|
|
|
+ this.processStructureValue.workOrder.creator == user.data.userId
|
|
|
+ ? true
|
|
|
+ : false;
|
|
|
} catch {
|
|
|
- //
|
|
|
+ //
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ async handleInversion() {
|
|
|
+ let workOrder = this.processStructureValue.workOrder;
|
|
|
+ this.selectItem.work_order_id = workOrder.id;
|
|
|
+ this.selectItem.nodeList = workOrder.state || [];
|
|
|
+ this.selectItem.nodeList.forEach(item => {
|
|
|
+ item.text = item.label;
|
|
|
+ });
|
|
|
+ if (this.selectItem.nodeList.length === 1) {
|
|
|
+ this.selectItem.node_id = this.selectItem.nodeList[0].id;
|
|
|
+ }
|
|
|
+ if (this.selectItem.users.length <= 0) {
|
|
|
+ load.startLoading();
|
|
|
+ await listUser({
|
|
|
+ pageSize: 999999
|
|
|
+ }).then(response => {
|
|
|
+ this.selectItem.users = response.data.list;
|
|
|
+ });
|
|
|
+ load.endLoading();
|
|
|
+ }
|
|
|
+ this.dialogVisible = true;
|
|
|
+ },
|
|
|
async getUserInfo() {
|
|
|
await queryUserInfo().then(res => {
|
|
|
- console.log(res)
|
|
|
- if(res.code == 200) {
|
|
|
- this.userIds = res.data.id
|
|
|
- this.tenantId = res.data.tenantId
|
|
|
+ // console.log(res);
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.userIds = res.data.id;
|
|
|
+ this.tenantId = res.data.tenantId;
|
|
|
} else {
|
|
|
- this.$message.error(res.data)
|
|
|
+ this.$message.error(res.data);
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
async getProcessNodeList() {
|
|
|
await processStructure({
|
|
@@ -293,10 +438,8 @@ export default {
|
|
|
userId: this.userIds
|
|
|
}).then(response => {
|
|
|
let tempData = response.data.tpls;
|
|
|
- console.log(response);
|
|
|
// 获取对应模板中,下拉框的key, value
|
|
|
let selectList = this.getSelectValueObject(tempData);
|
|
|
- console.log(selectList);
|
|
|
|
|
|
// 获取对应模板中,需要隐藏的字段
|
|
|
let hiddenFormList = this.getSelectValueObject(
|
|
@@ -349,80 +492,174 @@ export default {
|
|
|
}
|
|
|
});
|
|
|
});
|
|
|
- this.isActiveProcessing = false
|
|
|
- this.processStructureValue = response.data
|
|
|
- this.circulationHistoryList = this.processStructureValue.circulationHistory
|
|
|
+ this.isActiveProcessing = false;
|
|
|
+ this.processStructureValue = response.data;
|
|
|
+ this.circulationHistoryList = this.processStructureValue.circulationHistory;
|
|
|
+ this.circulationList = JSON.parse(
|
|
|
+ JSON.stringify(this.circulationHistoryList)
|
|
|
+ );
|
|
|
+
|
|
|
// 获取当前展示节点列表
|
|
|
- this.nodeStepList = []
|
|
|
- if(this.processStructureValue.nodes) {
|
|
|
- for (var i = 0; i < this.processStructureValue.nodes.length; i++) {
|
|
|
- if (this.processStructureValue.nodes[i].id === this.processStructureValue.workOrder.current_state) {
|
|
|
- // 当前节点
|
|
|
- this.nodeStepList.push(this.processStructureValue.nodes[i])
|
|
|
- this.activeIndex = this.nodeStepList.length - 1
|
|
|
- if (i + 1 === this.processStructureValue.nodes.length) {
|
|
|
- this.activeIndex = this.nodeStepList.length
|
|
|
- }
|
|
|
- this.currentNode = this.processStructureValue.nodes[i]
|
|
|
- } else if (!this.processStructureValue.nodes[i].isHideNode) {
|
|
|
- // 非隐藏节点
|
|
|
- this.nodeStepList.push(this.processStructureValue.nodes[i])
|
|
|
+ // this.nodeStepList = this.processStructureValue.circulationHistory
|
|
|
+
|
|
|
+ // 获取当前展示节点列表
|
|
|
+ this.nodeStepList = [];
|
|
|
+ let nodes = this.processStructureValue.nodes;
|
|
|
+ this.principals = "处理中";
|
|
|
+ for (var i = 0; i < nodes.length; i++) {
|
|
|
+ if (
|
|
|
+ nodes[i].id === this.processStructureValue.workOrder.current_state
|
|
|
+ ) {
|
|
|
+ // 当前节点
|
|
|
+ this.nodeStepList.push(nodes[i]);
|
|
|
+ this.activeIndex = this.nodeStepList.length - 1;
|
|
|
+ if (i + 1 === nodes.length) {
|
|
|
+ this.activeIndex = this.nodeStepList.length;
|
|
|
}
|
|
|
+ this.currentNode = nodes[i];
|
|
|
+
|
|
|
+ // 处理是认谁在处理,已处理完成则显示处理中
|
|
|
+ const assignUsers = nodes[i].assignUsers;
|
|
|
+ if (assignUsers && assignUsers.length > 0) {
|
|
|
+ this.principals = assignUsers[0].username + "处理中";
|
|
|
+ }
|
|
|
+ } else if (!nodes[i].isHideNode) {
|
|
|
+ // 非隐藏节点
|
|
|
+ this.nodeStepList.push(nodes[i]);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 判断节点里面是否有结束节点,而且一个流程里面只能有一个结束结点,
|
|
|
+ if (nodes[i].clazz == "end") {
|
|
|
+ this.endNodeDetail = JSON.parse(JSON.stringify(nodes[i]));
|
|
|
+ this.endNodeDetail.target = nodes[i].id;
|
|
|
+ this.endNodeDetail.flowProperties = 0; // 拒绝属性
|
|
|
+ this.endNodeDetail.label = "拒绝";
|
|
|
}
|
|
|
}
|
|
|
+ this.circulationList.reverse();
|
|
|
+ // 如果审批流程没有结束则,流程和历史记录合并显示;结束了,就只显示历史记录
|
|
|
+ if (!this.is_end) {
|
|
|
+ this.circulationList.forEach(cir => {
|
|
|
+ this.nodeStepList.forEach(node => {
|
|
|
+ if (cir.source == node.id) {
|
|
|
+ cir.label = node.label;
|
|
|
+ cir.assignType = node.assignType;
|
|
|
+ cir.assignValue = node.assignValue;
|
|
|
+ cir.assignUsers = node.assignUsers;
|
|
|
+ cir.id = node.id;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ let tempNodes = [];
|
|
|
+ this.nodeStepList.forEach(node => {
|
|
|
+ let count = 0;
|
|
|
+ this.circulationList.forEach(cir => {
|
|
|
+ if (node.id === cir.source) {
|
|
|
+ count += 1;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ if (count <= 0) {
|
|
|
+ tempNodes.push(node);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.circulationList.push(...tempNodes);
|
|
|
+ this.circulationList.forEach((cir, index) => {
|
|
|
+ if (cir.id == this.processStructureValue.workOrder.current_state) {
|
|
|
+ this.activeIndex = index;
|
|
|
+ if (index + 1 == this.circulationList.length) {
|
|
|
+ this.activeIndex = this.circulationList.length;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ this.activeIndex = this.circulationList.length;
|
|
|
+ }
|
|
|
+ // 添加抄送状态
|
|
|
+ this.circulationList.forEach(res => {
|
|
|
+ res.ccStatus = true;
|
|
|
+ });
|
|
|
+
|
|
|
+ // console.log(this.nodeStepList);
|
|
|
+ // console.log(this.circulationList);
|
|
|
+
|
|
|
+ // if(this.processStructureValue.nodes) {
|
|
|
+ // for (var i = 0; i < this.processStructureValue.nodes.length; i++) {
|
|
|
+ // if (this.processStructureValue.nodes[i].id === this.processStructureValue.workOrder.current_state) {
|
|
|
+ // // 当前节点
|
|
|
+ // this.nodeStepList.push(this.processStructureValue.nodes[i])
|
|
|
+ // this.activeIndex = this.nodeStepList.length - 1
|
|
|
+ // if (i + 1 === this.processStructureValue.nodes.length) {
|
|
|
+ // this.activeIndex = this.nodeStepList.length
|
|
|
+ // }
|
|
|
+ // this.currentNode = this.processStructureValue.nodes[i]
|
|
|
+ // } else if (!this.processStructureValue.nodes[i].isHideNode) {
|
|
|
+ // // 非隐藏节点
|
|
|
+ // this.nodeStepList.push(this.processStructureValue.nodes[i])
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
// 如果回退到初始节点则可编辑。
|
|
|
- if (this.activeIndex === 0 && this.currentNode.clazz === 'start') {
|
|
|
- this.currentNode.writeTpls = []
|
|
|
+ if (this.activeIndex === 0 && this.currentNode.clazz === "start") {
|
|
|
+ this.currentNode.writeTpls = [];
|
|
|
for (var tplTmp of this.processStructureValue.tpls) {
|
|
|
- this.currentNode.writeTpls.push(tplTmp.form_structure.id)
|
|
|
+ this.currentNode.writeTpls.push(tplTmp.form_structure.id);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// 判断是否需要主动处理
|
|
|
for (var stateValue of this.processStructureValue.workOrder.state) {
|
|
|
- if (this.processStructureValue.workOrder.current_state === stateValue.id && stateValue.processor.length > 1) {
|
|
|
- this.isActiveProcessing = true
|
|
|
- break
|
|
|
+ if (
|
|
|
+ this.processStructureValue.workOrder.current_state ===
|
|
|
+ stateValue.id &&
|
|
|
+ stateValue.processor.length > 1
|
|
|
+ ) {
|
|
|
+ this.isActiveProcessing = true;
|
|
|
+ break;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- const nodes = this.processStructureValue.nodes
|
|
|
- for (var i = 0; i < nodes.length; i++) {
|
|
|
- // 判断节点里面是否有结束节点,而且一个流程里面只能有一个结束结点,
|
|
|
- if(nodes[i].clazz == 'end') {
|
|
|
- this.endNodeDetail = JSON.parse(JSON.stringify(nodes[i]))
|
|
|
- this.endNodeDetail.target = nodes[i].id
|
|
|
- this.endNodeDetail.flowProperties = 0 // 拒绝属性
|
|
|
- this.endNodeDetail.label = '拒绝'
|
|
|
- }
|
|
|
- }
|
|
|
+ // const nodes = this.processStructureValue.nodes;
|
|
|
+ // for (var i = 0; i < nodes.length; i++) {
|
|
|
+ // // 判断节点里面是否有结束节点,而且一个流程里面只能有一个结束结点,
|
|
|
+ // if (nodes[i].clazz == "end") {
|
|
|
+ // this.endNodeDetail = JSON.parse(JSON.stringify(nodes[i]));
|
|
|
+ // this.endNodeDetail.target = nodes[i].id;
|
|
|
+ // this.endNodeDetail.flowProperties = 0; // 拒绝属性
|
|
|
+ // this.endNodeDetail.label = "拒绝";
|
|
|
+ // }
|
|
|
+ // }
|
|
|
|
|
|
- let psv = response.data.edges || []
|
|
|
- let btn_group = []
|
|
|
+ let psv = response.data.edges || [];
|
|
|
+ let btn_group = [];
|
|
|
psv.forEach(item => {
|
|
|
- // 过滤其它类型的操作
|
|
|
- if(this.processStructureValue.workOrder.is_end===0 && item.source===this.currentNode.id && item.flowProperties == 1) {
|
|
|
- if(item.flowProperties == 1) {
|
|
|
- item.className = 'primary'
|
|
|
- item.labelShow = '同意'
|
|
|
- } else if(item.flowProperties == 0) {
|
|
|
- item.className = 'danger'
|
|
|
- } else if(item.flowProperties == 2) {
|
|
|
- item.className = 'primary'
|
|
|
- }
|
|
|
- btn_group.push(item)
|
|
|
- } else {
|
|
|
- item.className = 'primary'
|
|
|
+ // 过滤其它类型的操作
|
|
|
+ if (
|
|
|
+ this.processStructureValue.workOrder.is_end === 0 &&
|
|
|
+ item.source === this.currentNode.id &&
|
|
|
+ item.flowProperties == 1
|
|
|
+ ) {
|
|
|
+ if (item.flowProperties == 1) {
|
|
|
+ item.className = "primary";
|
|
|
+ item.labelShow = "同意";
|
|
|
+ } else if (item.flowProperties == 0) {
|
|
|
+ item.className = "danger";
|
|
|
+ } else if (item.flowProperties == 2) {
|
|
|
+ item.className = "primary";
|
|
|
}
|
|
|
- })
|
|
|
- this.btn_group = btn_group
|
|
|
+ btn_group.push(item);
|
|
|
+ } else {
|
|
|
+ item.className = "primary";
|
|
|
+ }
|
|
|
+ });
|
|
|
+ this.btn_group = btn_group;
|
|
|
|
|
|
- this.isLoadingStatus = false
|
|
|
- this.getAlertMessage()
|
|
|
- })
|
|
|
+ this.isLoadingStatus = false;
|
|
|
+ this.getAlertMessage();
|
|
|
+ });
|
|
|
},
|
|
|
- getSelectValueObject(tpls, type = "value", tplValues = []) {
|
|
|
+ getSelectValueObject(tpls, type = "value", tplValues = []) {
|
|
|
const tempData = tpls || [];
|
|
|
let selectList = [];
|
|
|
tempData.forEach((temp, index) => {
|
|
@@ -526,99 +763,127 @@ export default {
|
|
|
return modelStatus;
|
|
|
},
|
|
|
submitAction(item) {
|
|
|
- var promiseList = []
|
|
|
- this.tpls = []
|
|
|
+ var promiseList = [];
|
|
|
+ this.tpls = [];
|
|
|
for (var tpl of this.processStructureValue.tpls) {
|
|
|
this.tpls.push({
|
|
|
tplDataId: tpl.id,
|
|
|
tplId: tpl.form_structure.id
|
|
|
- })
|
|
|
- promiseList.push(this.$refs['generateForm-' + tpl.id][0].getData())
|
|
|
+ });
|
|
|
+ promiseList.push(this.$refs["generateForm-" + tpl.id][0].getData());
|
|
|
}
|
|
|
- this.$refs['dataFrom'].validate(_ => {
|
|
|
- if(_) {
|
|
|
+ this.$refs["dataFrom"].validate(_ => {
|
|
|
+ if (_) {
|
|
|
Promise.all(promiseList).then(values => {
|
|
|
for (var tplDataIndex in this.tpls) {
|
|
|
- this.tpls[tplDataIndex].tplValue = values[tplDataIndex]
|
|
|
+ this.tpls[tplDataIndex].tplValue = values[tplDataIndex];
|
|
|
}
|
|
|
|
|
|
- let fileList = []
|
|
|
- this.tpls && this.tpls.forEach(tpl => {
|
|
|
- for(let val in tpl.tplValue) {
|
|
|
- if(val.indexOf('file') != -1) {
|
|
|
- const file = tpl.tplValue[val] || []
|
|
|
- file.forEach(item => {
|
|
|
- fileList.push(item.url)
|
|
|
- })
|
|
|
- }
|
|
|
+ let fileList = [];
|
|
|
+ this.tpls &&
|
|
|
+ this.tpls.forEach(tpl => {
|
|
|
+ for (let val in tpl.tplValue) {
|
|
|
+ if (val.indexOf("file") != -1) {
|
|
|
+ const file = tpl.tplValue[val] || [];
|
|
|
+ file.forEach(item => {
|
|
|
+ fileList.push(item.url);
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
handleWorkOrder({
|
|
|
tasks: this.processStructureValue.process.task,
|
|
|
source_state: this.processStructureValue.workOrder.current_state,
|
|
|
target_state: item.target,
|
|
|
circulation: item.label,
|
|
|
- flow_properties: item.flowProperties === undefined ? 2 : parseInt(item.flowProperties),
|
|
|
+ flow_properties:
|
|
|
+ item.flowProperties === undefined
|
|
|
+ ? 2
|
|
|
+ : parseInt(item.flowProperties),
|
|
|
work_order_id: parseInt(this.$route.query.workOrderId),
|
|
|
remarks: this.dataList.remarks,
|
|
|
tpls: this.tpls
|
|
|
- }).then(async (response) => {
|
|
|
+ }).then(async response => {
|
|
|
if (response.code === 200) {
|
|
|
- // this.$router.push({ name: 'upcoming' })
|
|
|
+ // this.$router.push({ name: 'upcoming' })
|
|
|
|
|
|
- await asyncPlayLog({ workOrderId: parseInt(this.$route.query.workOrderId), fileUrl: fileList.join(',') })
|
|
|
- // window.location.reload()
|
|
|
- this.getProcessNodeList()
|
|
|
+ await asyncPlayLog({
|
|
|
+ workOrderId: parseInt(this.$route.query.workOrderId),
|
|
|
+ fileUrl: fileList.join(",")
|
|
|
+ });
|
|
|
+ // window.location.reload()
|
|
|
+ this.getProcessNodeList();
|
|
|
|
|
|
- await store.dispatch('user/getInitData')
|
|
|
+ await store.dispatch("user/getInitData");
|
|
|
}
|
|
|
- })
|
|
|
- })
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
},
|
|
|
// 获取提示消息
|
|
|
getAlertMessage() {
|
|
|
if (this.processStructureValue.workOrder.is_end === 1) {
|
|
|
- this.alertMessage = '当前工单已结束。'
|
|
|
+ this.alertMessage = "当前工单已结束。";
|
|
|
}
|
|
|
},
|
|
|
- activeOrderActive() {
|
|
|
- var jsonData = [{
|
|
|
- id: this.nodeStepList[this.activeIndex].id,
|
|
|
- label: this.nodeStepList[this.activeIndex].label,
|
|
|
- process_method: 'person',
|
|
|
- processor: [this.userId]
|
|
|
- }]
|
|
|
- activeOrder(jsonData, this.$route.query.workOrderId).then(() => {
|
|
|
- this.getProcessNodeList()
|
|
|
- })
|
|
|
- },
|
|
|
+ // activeOrderActive() {
|
|
|
+ // var jsonData = [{
|
|
|
+ // id: this.nodeStepList[this.activeIndex].id,
|
|
|
+ // label: this.nodeStepList[this.activeIndex].label,
|
|
|
+ // process_method: 'person',
|
|
|
+ // processor: [this.userId]
|
|
|
+ // }]
|
|
|
+ // activeOrder(jsonData, this.$route.query.workOrderId).then(() => {
|
|
|
+ // this.getProcessNodeList()
|
|
|
+ // })
|
|
|
+ // },
|
|
|
async getAllOrgan() {
|
|
|
await queryAllOrgan({ tenantId: this.tenantId }).then(res => {
|
|
|
if (res.code == 200) {
|
|
|
const result = res.data;
|
|
|
- const filterOrganId = [36, 39, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 52, 54, 55, 56]
|
|
|
- let tempOrgan = []
|
|
|
+ const filterOrganId = [
|
|
|
+ 36,
|
|
|
+ 39,
|
|
|
+ 41,
|
|
|
+ 42,
|
|
|
+ 43,
|
|
|
+ 44,
|
|
|
+ 45,
|
|
|
+ 46,
|
|
|
+ 47,
|
|
|
+ 48,
|
|
|
+ 49,
|
|
|
+ 50,
|
|
|
+ 52,
|
|
|
+ 54,
|
|
|
+ 55,
|
|
|
+ 56
|
|
|
+ ];
|
|
|
+ let tempOrgan = [];
|
|
|
// 过滤不会显示的分部
|
|
|
result.forEach(item => {
|
|
|
if (!filterOrganId.includes(item.id)) {
|
|
|
- tempOrgan.push(item)
|
|
|
+ tempOrgan.push(item);
|
|
|
}
|
|
|
- })
|
|
|
- this.organList = tempOrgan
|
|
|
+ });
|
|
|
+ this.organList = tempOrgan;
|
|
|
}
|
|
|
- })
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
-}
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
/deep/ .el-step__title {
|
|
|
- font-size: 14px;
|
|
|
+ font-size: 13px;
|
|
|
line-height: 1.3;
|
|
|
- width: 80%;
|
|
|
+ width: 100%;
|
|
|
padding-top: 10px;
|
|
|
+ padding-right: 10px;
|
|
|
}
|
|
|
-</style>
|
|
|
+// /deep/.el-step__icon.is-text {
|
|
|
+// border: 0;
|
|
|
+// }
|
|
|
+</style>
|