From 1217719f7aa1619a21cbb430e72242cd8e05f461 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=AE=8B=E4=BC=9F=E4=BD=B3?= <2797716443@qq.com>
Date: Fri, 13 Aug 2021 23:03:56 +0800
Subject: [PATCH] =?UTF-8?q?=E9=80=89=E6=8B=A9=E8=B4=A3=E4=BB=BB=E4=BA=BA?=
=?UTF-8?q?=E6=A1=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../pages/creatProcess/xmpg2/step5.vue | 118 ++++++++++--------
1 file changed, 64 insertions(+), 54 deletions(-)
diff --git a/src/pages/processCenter/pages/creatProcess/xmpg2/step5.vue b/src/pages/processCenter/pages/creatProcess/xmpg2/step5.vue
index 80c2f261d..2828bd0e0 100644
--- a/src/pages/processCenter/pages/creatProcess/xmpg2/step5.vue
+++ b/src/pages/processCenter/pages/creatProcess/xmpg2/step5.vue
@@ -44,7 +44,7 @@
-
-
- {{ scope.row.workPeople ? scope.row.workPeople : "" }}
-
+
+
+
+
+
+
+
+
@@ -253,7 +258,8 @@ export default {
detailData: [], //流程历史数据
userId: this.$store.getters.userInfo.userId,
taskIds: this.$route.query.taskIds,
- pId: this.$route.query.prcId
+ pId: this.$route.query.prcId,
+ selectedId:'',
};
},
methods: {
@@ -316,7 +322,6 @@ export default {
taskIds: this.taskIds,
pId: this.pId
}).then(res => {
- console.log(res.mesg);
if (res) {
const processForm = JSON.parse(res.mesg);
this.getFormFieldList(processForm);
@@ -408,20 +413,32 @@ export default {
}, e => {
});
},
- //批量分发按钮
- batchOperation(id) {
- if (this.selectList.length === 0) {
- this.$message.warning("请至少选择一条数据进行批量分发");
- } else {
+ //批量分发按钮
+ choiceZRRS(row, type, index) {
+ this.selectedId=row.id
+ this.type = type;
+ if (type === 1) {
+ this.drawerTitle = "选择责任人";
this.nodeList = [];
- this.nodeList.push(id);
+ this.zrIndex = index;
+ this.zrType = type;
+ this.nodeList.push(row);
this.modalshowflag = true;
+ } else if (type === 2) {
+ // 批量
+ if (this.selectList.length > 0) {
+ this.zrType = type;
+ this.nodeList = [];
+ this.modalshowflag = true;
+ this.drawerTitle = "批量选择责任人";
+ } else {
+ this.$message.warning("请选择要分发的数据");
+ }
}
},
//标准表格选择框改变
selectStandChange(data) {
this.selectList = data;
- console.log(this.selectList);
},
getTree() {
this.$http.get("SarInstitution/institution/institutionAndUser", {}, {}, res => {
@@ -438,47 +455,40 @@ export default {
}
},
checkedRole(data) {
- console.log(data[0].name);
- // 选取负责人时的操作
- let deposit = new Map();
- let mis2 = new Map();
- this.selectList.forEach(item => {
- item.workPeople = data[0].name;
- item.workPeopleId = data[0].id;
- if (item.children) {
- item.children.forEach(items => {
- deposit.set(items.standId, items);
- });
- }
- mis2.set(item.standId, item);
- });
- this.dataList.forEach((item, index) => {
- if (mis2.get(item.standId)) {
- if (item.children) {
- item.children.forEach(i => {
- i.workPeopleId = undefined;
- i.workPeople = undefined;
- });
- } else {
- const newItem = JSON.parse(JSON.stringify(item));
- newItem.workPeopleId = data[0].id;
- newItem.workPeople = data[0].name;
- this.$set(this.dataList, index, newItem);
+ //单选操作
+ if (this.type === 1) {
+ this.dataList.forEach(item => {
+ if(item.children){
+ item.children.forEach(items => {
+ if(items.id === this.selectedId){
+ items.workPeople = data[0].name
+ items.workPeopleId = data[0].id
+ // this.$set(items,'workPeople',data[0].name)
+ //this.$set(items,'workPeopleId',data[0].id)
+ }
+ })
}
- } else {
- if (item.children) {
- item.children.forEach((items, childIndex) => {
- if (deposit.get(items.standId)) {
- const childItems = JSON.parse(JSON.stringify(items));
- childItems.workPeopleId = deposit.get(items.standId).workPeopleId;
- childItems.workPeople = deposit.get(items.standId).workPeople;
- this.$set(this.dataList[index].children, childIndex, childItems);
- }
- });
- }
- }
- });
- this.$refs.myTable.clearSelection();
+ })
+ this.dataList = JSON.parse(JSON.stringify(this.dataList))
+ } else if (this.type === 2) {
+ this.selectList.forEach(item =>{
+ this.dataList.map(items=>{
+ if(item.id==items.id){
+ items.workPeople = data[0].name
+ items.workPeopleId = data[0].id
+ }
+ if(items.children.length){
+ items.children.map(childrenItem=>{
+ if(childrenItem.id==item.id){
+ childrenItem.workPeople = data[0].name
+ childrenItem.workPeopleId = data[0].id
+ }
+ })
+ }
+ })
+ })
+ this.dataList = JSON.parse(JSON.stringify(this.dataList))
+ }
this.modalshowflag = false;
},
cancleUserInfo() {