| | |
| | | data: param, |
| | | }); |
| | | } |
| | | //字典 |
| | | export function getDict(param) { |
| | | param.token="admin"; |
| | | return request({ |
| | |
| | | data: param, |
| | | }); |
| | | } |
| | | // 表单排序 |
| | | export function groupItemsSort(param) { |
| | | return request({ |
| | | url: 'admin/form/group/sort', |
| | | method: 'put', |
| | | data: param, |
| | | }); |
| | | } |
| | | |
| | | |
| | | export function createFlow(param) { |
| | | param.token="admin"; |
| | |
| | | data: param, |
| | | }); |
| | | } |
| | | // 查询表单详情 |
| | | export function getFormDetail(id) { |
| | | return request({ |
| | | url: 'admin/form/detail/' + id, |
| | | method: 'get', |
| | | }); |
| | | } |
| | | |
| | | // 查询审批流详情 |
| | | export function getFlowDetail(param) { |
| | | param.token="admin" |
| | |
| | | data:param |
| | | }); |
| | | } |
| | | // 查询审批流详情 |
| | | // 查询审批流详情 不可编辑 横向 |
| | | export function getWorkSetpsByBusinessId(param) { |
| | | param.token="admin" |
| | | param.dataname="md_position" |
| | |
| | | <div style="float: right"> |
| | | <el-button type="text" icon="el-icon-edit-outline" size="mini" @click="editFrom(item, groups)">编辑 |
| | | </el-button> |
| | | |
| | | <el-button type="text" size="mini" @click="viewGroup(item,groups)">查看流程</el-button> |
| | | |
| | | <el-popover placement="left" trigger="click" width="400" style="margin-left: 10px" |
| | |
| | | console.log("getEntitySet", rsp.data.data) |
| | | this.groups = rsp.data.data.entityset |
| | | console.log("this.groups", this.groups) |
| | | //this.groups = rsp.data |
| | | }).catch(err => this.$message.error('获取审批流程异常')) |
| | | }, |
| | | newProcess(groupId) { |
| | | // this.$store.commit("setTemplate", this.getTemplateData()); |
| | | // this.$store.commit("setIsEdit", false); |
| | | this.$router.push("/admin/design?groupId=" + groupId); |
| | | }, |
| | | groupSort() { |
| | | this.groupsSort = false |
| | | groupItemsSort(this.groups).then(rsp => { |
| | | this.$message.success("排序成功") |
| | | this.getGroups() |
| | | }).catch(err => { |
| | | this.getGroups() |
| | | this.$message.error(err.response.data) |
| | | }) |
| | | |
| | | }, |
| | | |
| | | |
| | |
| | | }, |
| | | //处理节点插入逻辑 |
| | | insertNode(type, parentNode){ |
| | | console.log("insertNode-parentNode",parentNode) |
| | | this.$refs['_root'].click() |
| | | //缓存一下后面的节点 |
| | | let afterNode = parentNode.children |
| | | console.log("afterNode",afterNode) |
| | | //插入新节点 |
| | | parentNode.children = { |
| | | id: this.getRandomId(), |
| | | parentId: parentNode.id, |
| | | props: {}, |
| | | type: type, |
| | | type: type |
| | | |
| | | } |
| | | switch (type){ |
| | | case 'APPROVAL': this.insertApprovalNode(parentNode, afterNode); break; |
| | |
| | | if (afterNode && afterNode.id){ |
| | | afterNode.parentId = parentNode.children.id |
| | | } |
| | | this.$set(parentNode.children, 'children', afterNode) |
| | | this.$set(parentNode.children, 'children', Object) |
| | | console.log("parentNode.children",parentNode.children) |
| | | } |
| | | this.$forceUpdate() |
| | | }, |
| | | insertApprovalNode(parentNode){ |
| | | console.log("tree 添加通过节点",parentNode.children) |
| | | this.$set(parentNode.children, "name", "审批人") |
| | | console.log("tree-DefaultProps.APPROVAL_PROPS)",DefaultProps.APPROVAL_PROPS) |
| | | this.$set(parentNode.children, "props", this.$deepCopy(DefaultProps.APPROVAL_PROPS)) |
| | | console.log("parentNode.children",parentNode.children) |
| | | }, |
| | | insertTaskNode(parentNode){ |
| | | this.$set(parentNode.children, "name", "办理人") |
| | |
| | | <i class="el-icon-s-check" style="color:rgb(255, 148, 62);"></i> |
| | | <span>审批人</span> |
| | | </div> |
| | | <!-- <div @click="addTaskNode">--> |
| | | <!-- <i class="el-icon-s-check" style="color:rgb(230, 176, 57);"></i>--> |
| | | <!-- <span>办理人</span>--> |
| | | <!-- </div>--> |
| | | <!-- <div @click="addCcNode">--> |
| | | <!-- <i class="el-icon-s-promotion" style="color:rgb(50, 150, 250);"></i>--> |
| | | <!-- <span>抄送人</span>--> |
| | | <!-- </div>--> |
| | | <!-- <div @click="addConditionsNode">--> |
| | | <!-- <i class="el-icon-share" style="color:rgb(21, 188, 131);"></i>--> |
| | | <!-- <span>条件分支</span>--> |
| | | <!-- </div>--> |
| | | <!-- <div @click="addConcurrentsNode">--> |
| | | <!-- <i class="el-icon-s-operation" style="color:#718dff;"></i>--> |
| | | <!-- <span>并行分支</span>--> |
| | | <!-- </div>--> |
| | | <!-- <div @click="addInclusivesNode">--> |
| | | <!-- <i class="el-icon-s-operation" style="color:#718dff;"></i>--> |
| | | <!-- <span>包容分支</span>--> |
| | | <!-- </div>--> |
| | | <!-- <div @click="addDelayNode">--> |
| | | <!-- <i class="el-icon-time" style="color:#f25643;"></i>--> |
| | | <!-- <span>延迟等待</span>--> |
| | | <!-- </div>--> |
| | | <!-- <div @click="addTriggerNode">--> |
| | | <!-- <i class="el-icon-set-up" style="color:#15BC83;"></i>--> |
| | | <!-- <span>触发器</span>--> |
| | | <!-- </div>--> |
| | | <!-- <div @click="addSubprocessNode">--> |
| | | <!-- <i class="el-icon-set-up" style="color:#15BC93;"></i>--> |
| | | <!-- <span>子流程</span>--> |
| | | <!-- </div>--> |
| | | <div @click="addTaskNode"> |
| | | <i class="el-icon-s-check" style="color:rgb(230, 176, 57);"></i> |
| | | <span>办理人</span> |
| | | </div> |
| | | <div @click="addCcNode"> |
| | | <i class="el-icon-s-promotion" style="color:rgb(50, 150, 250);"></i> |
| | | <span>抄送人</span> |
| | | </div> |
| | | <div @click="addConditionsNode"> |
| | | <i class="el-icon-share" style="color:rgb(21, 188, 131);"></i> |
| | | <span>条件分支</span> |
| | | </div> |
| | | <div @click="addConcurrentsNode"> |
| | | <i class="el-icon-s-operation" style="color:#718dff;"></i> |
| | | <span>并行分支</span> |
| | | </div> |
| | | <div @click="addInclusivesNode"> |
| | | <i class="el-icon-s-operation" style="color:#718dff;"></i> |
| | | <span>包容分支</span> |
| | | </div> |
| | | <div @click="addDelayNode"> |
| | | <i class="el-icon-time" style="color:#f25643;"></i> |
| | | <span>延迟等待</span> |
| | | </div> |
| | | <div @click="addTriggerNode"> |
| | | <i class="el-icon-set-up" style="color:#15BC83;"></i> |
| | | <span>触发器</span> |
| | | </div> |
| | | <div @click="addSubprocessNode"> |
| | | <i class="el-icon-set-up" style="color:#15BC93;"></i> |
| | | <span>子流程</span> |
| | | </div> |
| | | </div> |
| | | <el-button icon="el-icon-plus" slot="reference" type="primary" size="small" circle></el-button> |
| | | </el-popover> |
| | |
| | | <el-form-item label="⚙ 选择审批组或审批架构" prop="text" class="user-type"> |
| | | <el-select @change="selected(this,'staff')" value-key="id" style="width: 80%;" size="small" |
| | | v-model="nodeProps.staffGroup" placeholder="请选择审批架构"> |
| | | <el-option v-for="staffApprovals in staffGroups" :label="staffApprovals.name" :value="staffApprovals" |
| | | :key="staffApprovals.id"></el-option> |
| | | <el-option v-for="staff in staffGroups" :label="staff.name" :value="staff" |
| | | :key="staff.id"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-divider></el-divider> |
| | |
| | | </div> |
| | | </template> |
| | | <script> |
| | | //import OrgPicker from "@/components/common/OrgPicker"; |
| | | import {getDict, getEntitySet} from "@/api/design"; |
| | | export default { |
| | | name: "ApprovalNodeConfig", |
| | |
| | | return this.$store.state.selectedNode |
| | | }, |
| | | nodeProps() { |
| | | |
| | | console.log("this.$store.state.selectedNode.props",this.$store.state.selectedNode.props) |
| | | return this.$store.state.selectedNode.props |
| | | }, |
| | | select() { |
| | |
| | | let template = {"code": "position_sales"} |
| | | getDict(template).then(rsp => { |
| | | this.staffGroups = this.$Utils.decode(rsp.data.data.dictionary.items) |
| | | this.staffGroups.forEach(item => item.name = item.value); |
| | | this.staffGroups.forEach(item => item.id = item.code); |
| | | this.staffGroups.forEach(item => { |
| | | item.name = item.value |
| | | item.id = item.code |
| | | }); |
| | | // this.staffGroups.forEach(item => ); |
| | | }).catch(err => this.$message.error('获取审批流程异常')) |
| | | }, |
| | | //如果切换选箱不是指定节点 那就把之前选择的指定节点信息 给清除掉 避免提交上去 |
| | | setValue() { |
| | | if (this.nodeProps.refuse.type !== 'TO_NODE') { |
| | | this.nodeProps.refuse.target = ''; |
| | | |
| | | } |
| | | }, |
| | | delGroup(index) { |
| | |
| | | }) |
| | | }, |
| | | selected(select, type) { |
| | | console.log("输出选中select", this.nodeProps) |
| | | debugger |
| | | console.log("this.config.props",this.config) |
| | | this.nodeProps.assignedUser = [] |
| | | |
| | | if (type === 'group') { |
| | | this.nodeProps.staffGroup = {} |
| | | this.nodeProps.assignedUser.push({ |
| | |
| | | } |
| | | ) |
| | | } |
| | | console.log("assignedUser", this.config) |
| | | console.log("this.config.props", this.config) |
| | | console.log("输出选中select", this.nodeProps) |
| | | this.orgPickerSelected.length = 0 |
| | | this.$forceUpdate() |
| | | }, |
| | | removeOrgItem(index) { |
| | | this.select.splice(index, 1) |
| | |
| | | console.log("content:config.assignedUser",config) |
| | | let texts = [] |
| | | config.assignedUser.forEach(org => texts.push(org.name)) |
| | | return String(texts).replaceAll(',', '、') |
| | | |
| | | return String(texts).replaceAll(',', '、')||"aaa" |
| | | }, |
| | | |
| | | }, |
| | | created() { |
| | | console.log("加载ApprovalNode.vue") |
| | | this.content |
| | | }, |
| | | methods: { |
| | | getFormItemById(id){ |
| | |
| | | //节点内容区域文字 |
| | | content: { |
| | | type: String, |
| | | default: "" |
| | | default: "111" |
| | | }, |
| | | title:{ |
| | | type: String, |
| | |
| | | return { |
| | | loading: false, |
| | | processInstanceId: "", |
| | | taskId: "", |
| | | formData: {}, |
| | | currentNode: {}, |
| | | processInfo: "", |
| | |
| | | "staffGroup":tempJson.board_id!=null?"":{"id":tempJson.rule_code,"name":tempJson.name}, |
| | | } |
| | | } |
| | | //节点数组的大小 大于当前循环的 说明还有子项 继续循环 |
| | | if (data.length >index) { |
| | | let getChildren = this.convertToTreeData(data, parent.children, index+1,parent.children.id) |
| | | parent.children=getChildren |
| | |
| | | getProcessInfo() { |
| | | this.loading = true; |
| | | let param = {"id": this.processInstanceId} |
| | | //let param = {"id": "74d84fb9188f4ce4b93e95f301ebbc1b"} |
| | | //根据业务id获取当前审批流步骤 |
| | | getWorkSetpsByBusinessId(param).then(rsp => { |
| | | let workSetps=rsp.data.data |
| | | console.log("workSetps", workSetps) |
| | | if(workSetps.length>0){ |
| | | let index=-1; |
| | | let resultProcess; |
| | | debugger |
| | | let noApprovalArr=workSetps.filter(item=>item.end_time===null); |
| | | ////如果所有节点都没审批 那么就取index_no=1的id为当前运行的节点 |
| | | if(noApprovalArr.length===workSetps.length){ |
| | |
| | | }, |
| | | beforeMount() { |
| | | this.processInstanceId = this.$route.query.processInstanceId; |
| | | this.taskId = this.$route.query.taskId; |
| | | }, |
| | | mounted() { |
| | | this.getProcessInfo(); |