diff --git a/src/views/auditFlow/editFlow.vue b/src/views/auditFlow/editFlow.vue index a17fbb06..124d9205 100644 --- a/src/views/auditFlow/editFlow.vue +++ b/src/views/auditFlow/editFlow.vue @@ -63,7 +63,10 @@ export default { this.getRoleList(); }, methods: { - handleCheckedChange(data) { + handleCheckedChange(pa) { + const data = pa; + // console.log("data===>" + JSON.stringify(data)); + // console.log("data===>" + JSON.stringify(this.auditPersonArr)); if (!data.isSpecial && this.auditPersonArr.filter(item => item.LABEL === data.LABEL).length > 0) { this.$message({ type: 'warning', @@ -79,6 +82,50 @@ export default { return; } this.auditPersonArr.push(data); + let newArr = []; + let num = 0; + for (var i = 0; i < this.auditPersonArr.length; i++) { + let item = this.auditPersonArr[i]; + let tempItem = { + ...item + }; + if (item.isSpecial) { + console.log("特殊角色"); + if (num === 0) { + tempItem.LABEL = "房管经办人审核"; + console.log("进入审核"); + num = 1; + } else if (num === 1) { + tempItem.LABEL = "房管经办人抄送"; + console.log("进入抄送"); + } + } + newArr.push(tempItem); + } + this.auditPersonArr = newArr; + console.log("data===>newArr=" + JSON.stringify(newArr)); + console.log("data===>num=" + num); + //console.log("data===>auditPersonArr=" + JSON.stringify(this.auditPersonArr)); + //处理数据 + // let num = 0; + // let shouldStop = false; // 新增标志变量 + // console.log("data===>num11=" + num) + // this.auditPersonArr.forEach(item => { + // if (shouldStop) return; // 如果已经找到两个,或者没有,直接跳过 + // console.log("data===>num22=" + num) + // if (item.isSpecial && num === 0) { + // item.LABEL = "房管经办人审核"; + // num++; + // console.log("data===>num33=" + num) + // } + // else if (item.isSpecial && num === 1) { + // item.LABEL = "房管经办人抄送"; + // shouldStop = true; // 标记不再处理后续项 + // console.log("data===>num44=" + num) + // } + // }); + // console.log("data===>num55=" + num) + }, removeItem(item, index) { this.auditPersonArr.splice(index, 1); @@ -101,9 +148,10 @@ export default { ...item, isSpecial: false }; - if (item.LABEL === '房管经办人') { + if (item.LABEL === '房管经办人' || item.LABEL === '房管经办人审核' || item.LABEL === '房管经办人抄送') { obj.isSpecial = true; } + console.log("obj===>" + JSON.stringify(obj)); this.roleData.push(obj); }); } else { @@ -123,7 +171,7 @@ export default { if (res.returnCode === "1") { //对auditPersonArr 进行赋值 res.returnData.forEach(item => { - if (item.LABEL === '房管经办人') { + if (item.LABEL === '房管经办人' || item.LABEL === '房管经办人审核' || item.LABEL === '房管经办人抄送') { this.auditPersonArr.push({ ...item, isSpecial: true, @@ -308,7 +356,7 @@ export default { right: 20px; } -.activity-label{ +.activity-label { cursor: pointer; } diff --git a/src/views/jurisdiction/approle/approle.vue b/src/views/jurisdiction/approle/approle.vue index 6dbfe7cb..30b40f0d 100644 --- a/src/views/jurisdiction/approle/approle.vue +++ b/src/views/jurisdiction/approle/approle.vue @@ -14,7 +14,7 @@
- + 添加
@@ -80,7 +80,7 @@ :closeOnClickModal="false" width="600px" > - + - + @@ -106,7 +106,7 @@ :closeOnClickModal="false" width="600px" > - + - + { console.log(err); @@ -367,7 +367,7 @@ this.row = row; this.getPermissionByRoleId(); this.relationMenuPopup = true; - + }, cancal(formName) { this.addRolePopup = false; @@ -544,7 +544,7 @@ if (res.returnCode == "1") { this.menuList = res.returnData.data; console.log(this.menuList) - } + } }) .catch(err => { console.log(err); @@ -557,7 +557,7 @@ let aa = { roleId:this.row.id }; - + getPermissionByRoleId(aa) .then(res => { if (res.returnCode == "1") { @@ -566,7 +566,7 @@ for(var i=0;i { console.log(err); @@ -589,7 +589,7 @@ .then(res => { if (res.returnCode == "1") { this.cancal(); - } + } }) .catch(err => { console.log(err);