{"remainingRequest":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/vue-loader/lib/index.js??vue-loader-options!/data/jenkins/workspace/badp-bcxin-web-5.x-vue/src/components/form_selectApprover_flowpanel.vue?vue&type=script&lang=js&","dependencies":[{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/src/components/form_selectApprover_flowpanel.vue","mtime":1725957645722},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/thread-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/babel-loader/lib/index.js","mtime":315532800000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/cache-loader/dist/cjs.js","mtime":499162500000},{"path":"/data/jenkins/workspace/badp-bcxin-web-5.x-vue/node_modules/vue-loader/lib/index.js","mtime":1655715099000}],"contextDependencies":[],"result":["\nimport API from \"@/api.js\";\nexport default {\n props: [\n \"act\",\n \"openParams\", \n \"buildFormData\", \n \"approversObj\", \n \"flowId\", \n \"isFreeFlow\",\n \"saveApproverStatus\",\n \"submitTo\",\n \"approverNumType\",\n \"isAppentCirculator\",\n \"subflowData\",\n \"subFlowToApprover\",\n \"groupNum\",\n \"isSubFlow\",\n \"isUpcoming\", //首页我的待办\n \"isProxys\", //判断是否是首页个人设置代理设置\n \"allowEditApprover\",\n \"approvers\",\n \"isSendMail\",\n \"processHostingList\",\n ],\n data: function() {\n return {\n currentPage:1,\n row_count:0,\n begin:true,\n roleCurrentId:'',\n allRoles:'',//{{$t('form.all')}}角色\n selectedUsers:[],//选中的角色id(复选)\n selectedUserFree: '', //选中的角色id(单选自由流程)\n selectedUsersList:[], //选中的角色数据列表\n rolesData:[],//角色数据\n\n activeName:'first',//tab的当前页\n\n linkman:[],//通讯录{{$t('view.link')}}\n\n searchData:[],//搜索返回的数据\n props: {\n label: \"name\",\n children: \"zones\",\n isLeaf: \"leaf\"\n },\n\n deptUser:[],//部门员工列表\n\n title:\" \",\n tabName:'first',\n\n rowCount:0,\n roleId:'',\n contactCount:0,\n departId:'',\n searchCount:0,\n onlinesUserCount:0,\n loadingIcon:false,\n\n onlinesPage:2,\n onlinesPageCount:'',\n\n contactPage:2,\n contactPageCount:'',\n\n searchPage:2,\n searchPageCount:'',\n\n searchValue:'',\n\n currentGroup:[], //子流程{{$t('view.group')}}\n groupNumber:'', //子流程{{$t('view.group')}}数量\n currentGroupIndex:-1,\n currentRoleName:'',\n currentDeptName:'',\n defaultExpandedKeys: [],\n tabTitleList: [\n {\n name: \"first\",\n value:this.$t('view.a_dept')\n },\n {\n name: 'second',\n value:this.$t('view.a_role')\n },\n {\n name: 'fourth',\n value:this.$t('profile.tel_list')\n },\n {\n name: 'fifth',\n value:this.$t('view.nearly')\n }\n ],\n recentUsers:[],\n isSearchOperation: false, //判断是否是查询操作\n isDefaultApprover: false, //默认显示指定角色的{{$t('form.all')}}用户\n defaultApprovers: [],\n defaultApproversCount: '',\n isclickEmpty: false,\n isCarbonCopyPage: false, //当前是抄送分页\n }\n },\n created() {\n if(this.approversObj && this.approversObj.nodeid) { //如果时候指定流程审批人,或指定抄送审批人时,隐藏通讯录\n let tabTitleList = this.tabTitleList;\n tabTitleList.splice(2,1);\n if(this.isSubFlow) {\n tabTitleList.splice(2,1);\n }\n }\n },\n mounted() {\n this.getData();\n if(this.isSubFlow) {\n this.listView();\n }\n },\n methods: {\n closeAll() {\n this.selectedUsers = [];\n this.selectedUsersList = [];\n this.selectedUserFree = '';\n if(this.currentGroup && this.groupNum !=2) {\n this.currentGroup[0].row = [];\n }\n },\n\n closableTag(id, index){\n this.selectedUsersList.splice(index, 1);\n this.selectedUserFree = '';\n for(let i = 0; i0) {\n this.rolesData.forEach(item => {\n if(arr.indexOf(item.id) < 0) {\n this.selectedUsersList.push(item);\n this.selectedUsers.push(item.id);\n }\n });\n }else {\n this.rolesData.forEach(item => {\n this.selectedUsersList.push(item);\n this.selectedUsers.push(item.id);\n });\n }\n }else if (val == 'DEPT') {\n let arr = JSON.parse(JSON.stringify(this.selectedUsers));\n if(this.selectedUsers && this.selectedUsers.length>0) {\n this.deptUser.forEach(item => {\n if(arr.indexOf(item.id) < 0) {\n this.selectedUsersList.push(item);\n this.selectedUsers.push(item.id);\n }\n });\n }else {\n this.deptUser.forEach(item => {\n this.selectedUsersList.push(item);\n this.selectedUsers.push(item.id);\n });\n }\n }else if (val == 'ADDRESSBOOK') { \n let arr = JSON.parse(JSON.stringify(this.selectedUsers));\n if(this.selectedUsers && this.selectedUsers.length>0) {\n this.linkman.forEach(item => {\n if(arr.indexOf(item.id) < 0) {\n this.selectedUsersList.push(item);\n this.selectedUsers.push(item.id);\n }\n });\n }else {\n this.linkman.forEach(item => {\n this.selectedUsersList.push(item);\n this.selectedUsers.push(item.id);\n });\n }\n }\n if(this.isSubFlow) { //如果有子流程\n \n if(this.currentGroup && this.currentGroup.length>0) {\n for(let i=0; i 0){\n this.currentGroup[i].row = JSON.parse(JSON.stringify(selectedUsersList));\n }else if (searchData && searchData.length>0) {\n this.currentGroup[i].row = JSON.parse(JSON.stringify(searchData));\n let arr = JSON.parse(JSON.stringify(this.selectedUsers));\n if(this.selectedUsers && this.selectedUsers.length>0) {\n searchDatar.forEach(item => {\n if(arr.indexOf(item.id) < 0) {\n this.selectedUsersList.push(item);\n this.selectedUsers.push(item.id);\n }\n });\n }else {\n searchData.forEach(item => {\n this.selectedUsersList.push(item);\n this.selectedUsers.push(item.id);\n });\n }\n }\n \n }\n }\n }\n }\n },\n\n handleRadioChange(ev, value, id) {\n let arr = [];\n let selectedId = [];\n arr.push(value);\n this.selectedUsersList = arr;\n selectedId.push(id);\n this.selectedUsers = selectedId;\n\n },\n\n handleSelectChange(ev, value, id) {\n if(ev) {\n this.selectedUsersList.push(value);\n }else {\n if(this.selectedUsersList && this.selectedUsersList.length > 0) {\n let list = this.selectedUsersList;\n for(let i=0; i0) {\n for(let i=0; i {\n this.rolesData = [];\n this.deptUser = [];\n this.searchData = res.data.data.datas;\n this.searchCount = res.data.data.rowCount\n this.row_count = res.data.data.rowCount;\n if(res.data.data.rowCount === 0) {\n this.isclickEmpty = true;\n }\n }\n }\n )\n }\n }else {\n this.isSearchOperation = true;\n let pageNum = 1, \n pageSize = 10;\n this.$api.getSearch(value, pageNum, pageSize, {\n onSucess: res => {\n if(res.data.data.msg) {\n this.rolesData = [];\n this.deptUser = [];\n this.linkman = [];\n this.searchData = [];\n this.searchCount = 0;\n this.row_count = 0;\n this.isclickEmpty = true;\n }else {\n this.rolesData = [];\n this.deptUser = [];\n this.linkman = [];\n this.searchData = res.data.data.datas;\n this.searchCount = res.data.data.rowCount;\n this.row_count = res.data.data.rowCount;\n }\n }\n })\n }\n },\n\n //加载更多{{$t('view.link')}}\n contactLoadingMore(num){\n this.loadingIcon = true;\n let pageSize = 10;\n if(this.isSearchOperation){ //判断是查询时使用这个方法\n this.$api.getSearch(this.searchValue, num, 10, {\n onSucess: res => {\n this.searchData = res.data.data.datas;\n this.searchCount = res.data.data.rowCount\n this.row_count = res.data.data.rowCount;\n }\n })\n }else {\n API.ContactPage(\n num,\n pageSize,\n {\n onSucess: response => {\n this.linkman = response.data.data.datas;\n this.loadingIcon = false;\n }\n }\n );\n }\n \n },\n\n //点击部门树节点触发\n handleNodeClick(e){\n this.currentPage = 1;\n this.isSearchOperation = false;\n this.searchData = [];\n this.departId = e.id;\n let deptId = e.id;\n this.currentDeptName = e.name;\n let openParams = this.openParams;\n let appId = openParams ? openParams.appId : this.$root.appid;\n let approversObj = this.approversObj;\n if(approversObj && approversObj.nodeid) {\n this.isDefaultApprover = false; //如果有默认指定审批人,点击树后,显示树的数据\n let docId = this.buildFormData.id, \n flowId = this.flowId, \n nodeId = approversObj.nodeid, \n type = 1, \n selectId = e.id, \n pageNum = 1, \n pageSize = 10;\n if(this.isAppentCirculator) { //抄送的时候调用抄送的接口\n this.isCarbonCopyPage = true;\n let currentNodeId = nodeId,\n defaultType = 1;\n this.getCirculators({appId, docId, flowId, currentNodeId, defaultType, selectId, pageNum, pageSize});\n }else {\n this.$api.getSelectApprovers(\n appId, \n docId, \n flowId, \n nodeId, \n type, \n selectId, \n pageNum, \n pageSize,\n {\n onSucess: res => {\n this.row_count = res.data.data.rowCount;\n this.title = e.name;\n let list = res.data.data.datas;\n this.deptUser = list;\n if(list.length <= 0) {\n this.isclickEmpty = true;\n }\n }\n }\n )\n }\n }else {\n this.$api.getDeptUser(\n appId, \n deptId,\n {\n onSucess: res => {\n this.row_count = res.data.data.rowCount;\n this.title = e.name;\n let list = res.data.data.datas;\n this.deptUser = list;\n if(list.length <= 0) {\n this.isclickEmpty = true;\n }\n }\n }\n );\n } \n },\n\n //加载更多部门\n deptLoadingMore(ev){\n let appId = this.openParams?this.openParams.appId:this.$root.appid;\n let pageSize = 10;\n let departId = this.departId;\n let approversObj = this.approversObj;\n if(this.isAppentCirculator) { //抄送的时候调用抄送的接口\n let docId = this.buildFormData.id, \n flowId = this.flowId, \n nodeId = approversObj.nodeid, \n selectId = departId, \n pageNum = ev, \n pageSize = 10;\n let defaultType = '';\n if(this.isCarbonCopyPage){\n defaultType = 1;\n }else {\n defaultType = 0;\n }\n if(this.isSearchOperation) { //搜索时\n defaultType = 3;\n selectId = this.searchValue;\n }\n let currentNodeId = nodeId;\n this.getCirculators({appId, docId, flowId, currentNodeId, defaultType, selectId, pageNum, pageSize});\n return;\n }\n if(this.isDefaultApprover) { //当前数据是默认指定审批人\n let buildFormData = this.buildFormData;\n let docId = buildFormData?buildFormData.id:''; //凡是表单进来的,打开弹出框拿到docId\n let flowId = this.flowId;\n let currentNodeId = approversObj.nodeid;\n let selectId = '', \n pageSize = 10,\n defaultType = 0;\n this.getDefault({appId, docId, flowId, currentNodeId, defaultType, selectId, ev, pageSize,});\n }else {\n if(approversObj && approversObj.nodeid) {\n let docId = this.buildFormData.id, \n flowId = this.flowId, \n nodeId = approversObj.nodeid, \n type = 1, \n selectId = departId, \n pageNum = ev, \n pageSize = 10;\n this.$api.getSelectApprovers(\n appId, \n docId, \n flowId, \n nodeId, \n type, \n selectId, \n pageNum, \n pageSize,\n {\n onSucess: res => {\n this.deptUser = res.data.data.datas;\n this.row_count = res.data.data.rowCount\n }\n }\n )\n }else if(this.isSearchOperation){ //判断是查询时使用这个方法\n this.$api.getSearch(this.searchValue, ev, 10, {\n onSucess: res => {\n this.searchData = res.data.data.datas;\n this.searchCount = res.data.data.rowCount\n this.row_count = res.data.data.rowCount;\n }\n })\n }else {\n this.$api.departmentPage(\n appId,\n departId,\n ev,\n pageSize,\n {\n onSucess: response => {\n this.deptUser = response.data.data.datas;\n this.row_count = response.data.data.rowCount;\n }\n }\n );\n } \n }\n },\n\n //部门树\n loadNode(node, resolve) {\n let appid = this.openParams?this.openParams.appId:this.$root.appid;\n let that = this;\n if (node.level === 0) {\n API.getDepartmentsByParentId(appid, \"\", {\n onSucess: function(response) {\n that.defaultExpandedKeys.push(response.data.data[0].id);\n resolve(response.data.data);\n }\n });\n } else {\n API.getDepartmentsByParentId(appid, node.key, {\n onSucess: function(response) {\n resolve(response.data.data);\n }\n });\n }\n },\n\n //角色分类加载\n rolesList(id, name) {\n this.isDefaultApprover = false;\n this.currentPage = 1;\n this.searchData = [];\n this.isSearchOperation = false;\n this.currentRoleName = name;\n let that = this;\n this.roleCurrentId = id; \n this.roleId = id;\n let openParams = this.openParams;\n let appId = openParams?openParams.appId:this.$root.appid;\n let approversObj = this.approversObj;\n if(approversObj && approversObj.nodeid) {\n let docId = this.buildFormData.id, \n flowId = this.flowId, \n nodeId = this.approversObj.nodeid, \n type = 2, \n selectId = id, \n pageNum = 1, \n pageSize = 10;\n if(this.isAppentCirculator) { //抄送的时候调用抄送的接口\n this.isCarbonCopyPage = true;\n let currentNodeId = nodeId,\n defaultType = 2;\n this.getCirculators({appId, docId, flowId, currentNodeId, defaultType, selectId, pageNum, pageSize});\n }else {\n this.$api.getSelectApprovers(\n appId, \n docId, \n flowId, \n nodeId, \n type, \n selectId, \n pageNum, \n pageSize,\n {\n onSucess: res => {\n that.row_count = res.data.data.rowCount;\n let list = res.data.data.datas;\n that.rolesData = list;\n if(list.length <= 0) {\n this.isclickEmpty = true;\n }\n }\n }\n )\n }\n }else {\n let type = 0;\n this.$api.getRoles(\n appId,\n id,\n type,\n 10, \n 1, \n {\n onSucess: res => {\n that.row_count = res.data.data.rowCount;\n let list = res.data.data.datas;\n that.rolesData = list;\n if(list.length <= 0) {\n this.isclickEmpty = true;\n }\n }\n }\n )\n }\n },\n\n //加载更多角色\n rolesLoadingMore(ev){\n let openParams = this.openParams;\n let appId = openParams ? openParams.appId : this.$root.appid;\n let roles = this.roleId;\n let pageSize = 10;\n let approversObj = this.approversObj;\n if(this.isAppentCirculator) { //抄送的时候调用抄送的接口\n let docId = this.buildFormData.id, \n flowId = this.flowId, \n nodeId = approversObj.nodeid, \n selectId = this.roleCurrentId,\n pageNum = ev, \n pageSize = 10;\n let defaultType = '';\n if(this.isCarbonCopyPage){\n defaultType = 2;\n }else {\n defaultType = 0;\n }\n if(this.isSearchOperation) { //搜索时\n defaultType = 3;\n selectId = this.searchValue;\n }\n let currentNodeId = nodeId;\n this.getCirculators({appId, docId, flowId, currentNodeId, defaultType, selectId, pageNum, pageSize});\n return;\n }\n if(this.isDefaultApprover) { \n let approversObj = this.approversObj;\n let buildFormData = this.buildFormData;\n let docId = buildFormData ? buildFormData.id : ''; //凡是表单进来的,打开弹出框拿到docId\n let flowId = this.flowId;\n let currentNodeId = approversObj.nodeid;\n let selectId = '', \n pageSize = 10,\n defaultType = 0;\n this.getDefault({appId, docId, flowId, currentNodeId, defaultType, selectId, ev, pageSize,});\n }else {\n if(approversObj && approversObj.nodeid) {\n let docId = this.buildFormData.id, \n flowId = this.flowId, \n nodeId = approversObj.nodeid, \n type = 2, \n selectId = this.roleCurrentId, \n pageNum = ev;\n if(this.isAppentCirculator) { //抄送的时候调用抄送的接口\n let currentNodeId = nodeId,\n defaultType = 0;\n this.getCirculators({appId, docId, flowId, currentNodeId, defaultType, selectId, pageNum, pageSize});\n }else {\n this.$api.getSelectApprovers(\n appId, \n docId, \n flowId, \n nodeId, \n type, \n selectId, \n pageNum, \n pageSize,\n {\n onSucess: res => {\n this.rolesData = res.data.data.datas;\n this.row_count = res.data.data.rowCount;\n return ;\n }\n }\n )\n }\n }else if(this.isSearchOperation){ //判断是查询时使用这个方法\n this.$api.getSearch(this.searchValue, ev, 10, {\n onSucess: res => {\n this.searchData = res.data.data.datas;\n this.searchCount = res.data.data.rowCount\n this.row_count = res.data.data.rowCount;\n }\n })\n }else {\n this.$api.getRoles(\n appId,\n roles,\n 0,\n pageSize,\n ev,\n {\n onSucess: response => {\n this.rolesData = response.data.data.datas;\n that.row_count = res.data.data.rowCount;\n }\n }\n );\n } \n }\n },\n\n //标签页分类\n handleClick(tab){\n this.isclickEmpty = false;\n if(!this.isDefaultApprover) {\n this.row_count = 0;\n this.currentPage = 1;\n }\n if(tab.name == \"second\") { //按角色\n this.tabName = \"second\";\n this.searchData = [];\n this.isCarbonCopyPage = false;\n if(this.defaultApprovers.length > 0) { //如果默认指定审批人打于0\n let data = this.defaultApprovers;\n this.isDefaultApprover = true;\n this.rolesData = data;\n this.row_count = this.defaultApproversCount;\n }else {\n this.rolesData = [];\n }\n }else if(tab.name == \"third\") {\n this.searchData = [];\n this.onlinesPage = 2;\n this.tabName = \"third\";\n let pageNum = 1;\n let pageSize = 10;\n //在线用户\n API.getOnlines(\n pageNum, \n pageSize,\n {\n onSucess: response => {\n this.onlinesUser = response.data.data.datas\n this.onlinesUserCount = response.data.data.rowCount;\n this.onlinesPageCount = response.data.data.pageCount;\n }\n }\n );\n }else if(tab.name == \"fourth\") {\n //通讯录\n this.linkman = [];\n this.searchData = [];\n this.tabName = \"fourth\";\n }else if(tab.name == \"fifth\"){ //最近\n this.searchData = [];\n this.tabName = \"fifth\";\n let approversObj = this.approversObj;\n let isApprovers = (approversObj && approversObj.nodeid)?true:false;\n if(isApprovers) {\n let recentUsers = JSON.parse(localStorage.getItem(\"localRecentlyDesignatedUsers\") || '[]');\n // this.recentUsers\n let defaultData = this.defaultApprovers;\n let list = [];\n if(recentUsers.length > 0) {\n for(let i=0; i 0) {\n this.isDefaultApprover = true;\n this.deptUser = this.defaultApprovers;\n this.row_count = this.defaultApproversCount;\n }else {\n this.deptUser = [];\n }\n this.tabName = \"first\";\n }\n },\n\n //通讯录{{$t('view.link')}}\n contact() {\n this.currentPage = 1;\n this.isSearchOperation = false;\n this.searchData = [];\n this.contactPage = 2;\n let contactsId = \"all\";\n API.getContact(\n contactsId,\n {\n onSucess: response => {\n this.row_count = response.data.data.rowCount;\n this.linkman = response.data.data.datas\n this.contactCount = response.data.data.rowCount;\n \n }\n }\n );\n },\n //删除选中的角色\n onTabClose(dept) {\n if(this.field.data.length == 1){\n this.field.value = \"\";\n this.field.data = [];\n this.begin = false;\n if(this.field.refreshOnChanged) {\n this.onChange();\n }\n }else {\n let deptData = this.field.data;\n for(let i=0; i {\n approverId += item + \";\";\n for(let i=0; i < _sul.length; i++) {\n if(item == _sul[i].id){\n approverName += _sul[i].name + \";\"; \n }\n }\n });\n this.$emit(\"action\",approverName, approverId, _sul);\n }else if(this.isSendMail) {\n _su.forEach(item => {\n approverId += item + \";\";\n for(let i=0; i < _sul.length; i++) {\n if(item == _sul[i].id){\n approverName += _sul[i].name + \";\"; \n }\n }\n });\n this.$emit(\"action\",approverName, approverId);\n }else if (this.isUpcoming) {\n let list = _sul;\n if(list.length <= 0) {\n this.$emit(\"action\",);\n }else {\n approverName = list[0].name;\n let nextUserId = this.selectedUserFree;\n this.$emit(\"action\",approverName, nextUserId);\n }\n }else if (this.allowEditApprover) {\n let obj = {};\n obj.auditorList = _su;\n let appId = this.openParams?this.openParams.appId:this.$root.appid;\n this.$api.approversWorkflow(\n appId,\n this.buildFormData.id,\n obj,\n {\n onSucess: res => {\n if(res.data.errcode == 0) {\n let isRefresh = true;\n this.$emit(\"closeApproverDialog\",isRefresh)\n this.$notify({\n title: res.data.data,\n message: '',\n type: 'success'\n });\n }\n }\n }\n )\n }else {\n if(this.act.type == 57 || this.act.type == 58) { //加签主办或协办\n let hostOrCohostList = [];\n let selectedUserObj = {};\n this.selectedUsersList.forEach(items => {\n let obj = {};\n for (let key in items) {\n if(key == \"id\" || key == \"name\") {\n obj[key] = items[key];\n }\n }\n approverId += items.id + \";\";\n selectedUserObj.userids = approverId;\n hostOrCohostList.push(obj);\n });\n selectedUserObj.row = this.selectedUsersList;\n this.$emit(\"selectHostOrCohost\",hostOrCohostList, selectedUserObj); //调用父组件selectHostOrCohost()方法\n }else if (this.isFreeFlow) { //自由流程\n approverName = _sul[0].name;\n let nextUserId = this.selectedUserFree;\n this.$emit(\"action\",approverName, \"\", nextUserId)\n }else if (this.isSubFlow) { //子流程\n let groupNum = this.groupNum;\n let groupLength = Object.assign({}, this.approversObj);\n if(groupNum == -2) { //因\n\n let userid = [];\n let approverName = '';\n this.currentGroup[0].row = this.selectedUsersList;\n let obj = {};\n obj.position = 1;\n let arrId = [];\n let row = [];\n if(this.selectedUsersList && this.selectedUsersList.length >0 ) {\n let params =this.selectedUsersList;\n for(let j=0; j0 ) {\n let params = this.currentGroup[i].row;\n for(let j=0; j 0) {\n let arr = [];\n if (this.approverNumType == 1) { //单选\n if(_sul.length > 0 ) {\n approverName = _sul[0].name;\n this.approversObj.userids = _sul[0].id;\n this.approversObj.row = _sul;\n }\n } else { //多选\n this.selectedUsers.forEach(item => {\n approverId += item + \";\";\n for(let i=0; i < _sul.length; i++) {\n if(item == _sul[i].id){\n approverName += _sul[i].name + \";\"; \n arr.push(_sul[i]);\n }\n }\n });\n _sul = arr;\n // approverName = approverName.replace(/^(\\s|;)+|(\\s|;)+$/g, '');\n // approverId = approverId.replace(/^(\\s|;)+|(\\s|;)+$/g, '');\n this.approversObj.userids = approverId;\n this.approversObj.row = _sul;\n }\n let isAppentCirculator = this.isAppentCirculator;\n this.$emit(\"action\",approverName, this.approversObj,'', isAppentCirculator); // 调用父组件selectApprover()方法\n }else {\n let _ao = this.approversObj;\n _ao.userids = '';\n _ao.row = [];\n let isAppentCirculator = this.isAppentCirculator?this.isAppentCirculator:'';\n this.$emit(\"action\", '', _ao , '', isAppentCirculator); \n }\n }\n }\n\n //以下都是最近用户缓存\n let selectList = JSON.parse(JSON.stringify(this.selectedUsersList));\n let approversObj = this.approversObj;\n let isApprovers = (approversObj && approversObj.nodeid)?true:false;\n let recentUsers = '';\n if(isApprovers) {\n recentUsers = JSON.parse(localStorage.getItem(\"localRecentlyDesignatedUsers\") || '[]');\n }else {\n recentUsers = JSON.parse(localStorage.getItem(\"localRecentUsers\") || '[]');\n }\n let tempArray1 = [];//临时数组1\n if(recentUsers.length > 0) {\n for(let i=0; icurrentNodeId\n let currentNodeId = ao.nodeid;\n let type;\n if(this.isSubFlow) { //{{$t('view.b_flow')}}子流程\n type = 0;\n }else if(this.isAppentCirculator){ //TODO,当是抄送时,角色是2\n type = 2;\n }else{ //指定审批人\n type = 1;\n }\n\n if(this.isSubFlow) {\n this.$api.getAllRoles(\n appId,\n type,\n {\n onSucess: res => {\n this.allRoles = res.data.data.datas;\n }\n }\n )\n }else {\n this.$api.getCopyAllRoles(\n appId,\n docId,\n currentNodeId,\n flowId,\n type,\n {\n onSucess: res => {\n that.allRoles = res.data.data.datas;\n }\n }\n )\n }\n //以下是获取默认显示指定角色\n // docId = buildFormData.id, \n let selectId = '', \n pageNum = 1, \n pageSize = 10,\n defaultType = 0;\n if(this.isAppentCirculator) { //抄送的时候调用抄送的接口\n this.getCirculators({appId, docId, flowId, currentNodeId, defaultType, selectId, pageNum, pageSize})\n }else {\n this.getDefault({appId, docId, flowId, currentNodeId, defaultType, selectId, pageNum, pageSize});\n }\n \n } else {\n let type = 0;\n //角色的接口\n this.$api.getAllRoles(\n appId,\n type,\n {\n onSucess: res => {\n this.allRoles = res.data.data.datas;\n }\n }\n )\n }\n \n if(this.allowEditApprover) {\n //this.selectedUsersList = JSON.parse(JSON.stringify(this.approvers[0].nodes[0].auditors));\n if(this.approvers[0]) {\n if(this.approvers[0].nodes[0]) {\n this.selectedUsersList = JSON.parse(JSON.stringify(this.approvers[0].nodes[0].auditors));\n if(this.approvers[0].nodes[0].auditors && this.approvers[0].nodes[0].auditors.length > 0) {\n let auditors = JSON.parse(JSON.stringify(this.approvers[0].nodes[0].auditors));\n for(let i=0; i 0) {\n for(let i=0; i 0) { //子流程 并且 groupNum==2\n let row = sfta[0].row\n for(let i=0; i {\n let list = res.data.data.datas;\n this.defaultApprovers = list || [];\n this.row_count = this.defaultApproversCount = res.data.data.rowCount;\n this.rolesData = list;\n this.deptUser = list;\n if(list.length <= 0) {\n this.isclickEmpty = true;\n }\n }\n }\n )\n },\n \n //获取默认审批人\n getDefault(data){\n if(!this.isFreeFlow) {\n this.$api.getSelectApprovers(\n data.appId, \n data.docId, \n data.flowId, \n data.currentNodeId, \n data.defaultType, \n data.selectId, \n data.pageNum?data.pageNum:data.ev, \n data.pageSize,\n {\n onSucess: res => {\n let resData = res.data.data.datas;\n this.isDefaultApprover = true;\n this.defaultApprovers = resData || [];\n this.row_count = this.defaultApproversCount = res.data.data.rowCount;\n this.rolesData = res.data.data.datas;\n this.deptUser = res.data.data.datas;\n }\n }\n )\n }\n },\n\n //子流程{{$t('view.group')}}\n listView(){\n if(this.subFlowToApprover && this.subFlowToApprover.length>0) {\n this.currentGroup = JSON.parse(JSON.stringify(this.subFlowToApprover));\n this.groupNumber = this.currentGroup.length;\n }else {\n let parent = document.getElementById('parent');\n if(parent.children.length ==0){\n // this.groupNumber = parent.children.length;\n let obj = Object.assign({}, this.approversObj);\n obj.type = \"subflow\";\n obj.row = [];\n this.currentGroup.push(obj);\n this.groupNumber = 1;\n this.currentGroupIndex = 0;\n }\n }\n },\n\n //添加子流程\n addSubflow() {\n let obj = Object.assign({}, this.approversObj);\n if(obj.groupNum == -1) {\n obj.type = \"subflow\";\n this.currentGroup.push(obj);\n this.groupNumber++;\n }else {\n if(this.currentGroup.length < obj.groupNum) {\n obj.type = \"subflow\";\n obj.row = [];\n this.currentGroup.push(obj);\n this.groupNumber++;\n }else {\n this.$message({\n message: this.$t('view.bograter_group')`${obj.groupNum}`,\n type: 'warning'\n });\n }\n }\n },\n\n //删除字流程\n deleteSubflow(index) {\n if(this.currentGroup.length < 2) {\n this.$message({\n message: this.$t('view.one_group'),\n type: 'warning'\n });\n }else {\n this.currentGroup.splice(index, 1);\n this.$forceUpdate();\n }\n },\n\n //删除子字流程某个选中用户\n deleteUser(id, items, index) {\n items.row.forEach((item,index) => {\n if(id == item.id) {\n items.row.splice(index, 1);\n }\n });\n this.currentGroup[index].row = items.row;\n this.selectedUsersList = JSON.parse(JSON.stringify(this.currentGroup[index].row));\n for(let i=0; i