|
@@ -225,12 +225,22 @@
|
|
|
|
|
|
|
|
<el-table-column label="检查人">
|
|
<el-table-column label="检查人">
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <div
|
|
|
|
|
- @click="openSelectUser(scope.row)"
|
|
|
|
|
- style="display: flex; align-items: center; cursor: pointer"
|
|
|
|
|
- >
|
|
|
|
|
- <div>{{ showCheckUserNames(scope.row.checkUsers) }}</div
|
|
|
|
|
- ><i class="el-icon-caret-bottom"></i>
|
|
|
|
|
|
|
+ <div>
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="scope.row.checkUsersIds"
|
|
|
|
|
+ placeholder="请选择检查人"
|
|
|
|
|
+ filterable
|
|
|
|
|
+ multiple
|
|
|
|
|
+ @change="checkUsersIdsChange(scope.row)"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in activeTeamUserList"
|
|
|
|
|
+ :label="item.name"
|
|
|
|
|
+ :value="item.id"
|
|
|
|
|
+ :key="item.id"
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-option>
|
|
|
|
|
+ </el-select>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -321,13 +331,6 @@
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
- <!-- 选择用户 -->
|
|
|
|
|
- <SelectUser
|
|
|
|
|
- ref="SelectUserRef"
|
|
|
|
|
- v-model="showSelectUser"
|
|
|
|
|
- multipleSelect
|
|
|
|
|
- @selectUserFinished="selectUserFinished"
|
|
|
|
|
- ></SelectUser>
|
|
|
|
|
|
|
|
|
|
<toolModal ref="toolModalRef" @chooseModal="chooseModal" />
|
|
<toolModal ref="toolModalRef" @chooseModal="chooseModal" />
|
|
|
</ele-modal>
|
|
</ele-modal>
|
|
@@ -348,6 +351,7 @@
|
|
|
} from '@/api/producetaskrecordrulesrecord/index';
|
|
} from '@/api/producetaskrecordrulesrecord/index';
|
|
|
import toolModal from '@/views/batchRecord/components/toolModal.vue';
|
|
import toolModal from '@/views/batchRecord/components/toolModal.vue';
|
|
|
import { getTeam } from '@/api/produce/job.js';
|
|
import { getTeam } from '@/api/produce/job.js';
|
|
|
|
|
+ import { det, row } from 'mathjs';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
components: { SelectUser, toolModal },
|
|
components: { SelectUser, toolModal },
|
|
@@ -525,6 +529,11 @@
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
return '类记录表';
|
|
return '类记录表';
|
|
|
|
|
+ },
|
|
|
|
|
+ activeTeamUserList() {
|
|
|
|
|
+ return this.teamUserList.filter((user) =>
|
|
|
|
|
+ this.addForm.executeUsersIds.includes(user.id)
|
|
|
|
|
+ );
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
@@ -596,6 +605,7 @@
|
|
|
console.log('dat 缓存', data);
|
|
console.log('dat 缓存', data);
|
|
|
data.details = data.details.map((i) => {
|
|
data.details = data.details.map((i) => {
|
|
|
i.toolNames = i.tools.map((j) => j.toolName).join(',');
|
|
i.toolNames = i.tools.map((j) => j.toolName).join(',');
|
|
|
|
|
+ i.checkUsersIds = i.checkUsers.map((j) => j.userId);
|
|
|
return i;
|
|
return i;
|
|
|
});
|
|
});
|
|
|
this.$util.assignObject(this.addForm, data);
|
|
this.$util.assignObject(this.addForm, data);
|
|
@@ -618,6 +628,14 @@
|
|
|
? this.addForm.executeUsers[0].teamId
|
|
? this.addForm.executeUsers[0].teamId
|
|
|
: '';
|
|
: '';
|
|
|
|
|
|
|
|
|
|
+ // 加载班组人员列表
|
|
|
|
|
+ if (this.addForm.teamId) {
|
|
|
|
|
+ const index = this.teamList.findIndex(
|
|
|
|
|
+ (item) => item.id == this.addForm.teamId
|
|
|
|
|
+ );
|
|
|
|
|
+ this.teamUserList = this.teamAllList[index];
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
this.loading = false;
|
|
this.loading = false;
|
|
@@ -656,17 +674,13 @@
|
|
|
checkStatusDesc: i.defaultValue || '',
|
|
checkStatusDesc: i.defaultValue || '',
|
|
|
errorMsg: '',
|
|
errorMsg: '',
|
|
|
checkUsers: [],
|
|
checkUsers: [],
|
|
|
|
|
+ checkUsersIds: [],
|
|
|
paramValue: i.paramValue,
|
|
paramValue: i.paramValue,
|
|
|
toolNames: i.tools.map((i) => i.toolName).join(',')
|
|
toolNames: i.tools.map((i) => i.toolName).join(',')
|
|
|
};
|
|
};
|
|
|
});
|
|
});
|
|
|
console.log('this.addForm 添加规则', this.addForm, list);
|
|
console.log('this.addForm 添加规则', this.addForm, list);
|
|
|
},
|
|
},
|
|
|
- openSelectUser(row) {
|
|
|
|
|
- this.currentRow = row;
|
|
|
|
|
- console.log('row', row);
|
|
|
|
|
- this.showSelectUser = true;
|
|
|
|
|
- },
|
|
|
|
|
handleBeforeClose() {
|
|
handleBeforeClose() {
|
|
|
this.addForm = JSON.parse(JSON.stringify(this.formDate));
|
|
this.addForm = JSON.parse(JSON.stringify(this.formDate));
|
|
|
console.log('this.$refs.ruleFormRef', this.addForm);
|
|
console.log('this.$refs.ruleFormRef', this.addForm);
|
|
@@ -675,23 +689,6 @@
|
|
|
this.visible = false;
|
|
this.visible = false;
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
- selectUserFinished(userInfo) {
|
|
|
|
|
- console.log('userInfo', userInfo);
|
|
|
|
|
- this.currentRow.checkUsers = userInfo.map((i) => {
|
|
|
|
|
- // 构建参数和接口的对应上
|
|
|
|
|
- return { ...i, userName: i.name, userId: i.id };
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- showCheckUserNames(userList) {
|
|
|
|
|
- if (userList.length == 0) return '请选择部门-选择员工';
|
|
|
|
|
-
|
|
|
|
|
- return userList
|
|
|
|
|
- .map((i) => {
|
|
|
|
|
- return i.groupName + '-' + i.userName;
|
|
|
|
|
- })
|
|
|
|
|
- .join(',');
|
|
|
|
|
- },
|
|
|
|
|
// 提交
|
|
// 提交
|
|
|
submit(type) {
|
|
submit(type) {
|
|
|
// 验证表单
|
|
// 验证表单
|
|
@@ -861,6 +858,12 @@
|
|
|
console.log('this.addForm.executeUsers', this.addForm.executeUsers);
|
|
console.log('this.addForm.executeUsers', this.addForm.executeUsers);
|
|
|
|
|
|
|
|
this.computedDuration();
|
|
this.computedDuration();
|
|
|
|
|
+
|
|
|
|
|
+ // 同步详情执行人
|
|
|
|
|
+ this.addForm.details.forEach((detail) => {
|
|
|
|
|
+ detail.checkUsersIds = this.addForm.executeUsersIds;
|
|
|
|
|
+ detail.checkUsers = this.addForm.executeUsers;
|
|
|
|
|
+ });
|
|
|
},
|
|
},
|
|
|
checkChange() {
|
|
checkChange() {
|
|
|
this.addForm.executeUsersIds = [];
|
|
this.addForm.executeUsersIds = [];
|
|
@@ -895,6 +898,22 @@
|
|
|
) {
|
|
) {
|
|
|
this.addForm.duration = Number(this.addForm.duration).toFixed(1);
|
|
this.addForm.duration = Number(this.addForm.duration).toFixed(1);
|
|
|
}
|
|
}
|
|
|
|
|
+ },
|
|
|
|
|
+ checkUsersIdsChange(row) {
|
|
|
|
|
+ // 同步 checkUsers
|
|
|
|
|
+ row.checkUsers = row.checkUsersIds.map((i) => {
|
|
|
|
|
+ const user = this.activeTeamUserList.find((item) => item.id === i);
|
|
|
|
|
+ return {
|
|
|
|
|
+ teamId: this.addForm.teamId,
|
|
|
|
|
+ teamName: this.teamList.find(
|
|
|
|
|
+ (team) => team.id == this.addForm.teamId
|
|
|
|
|
+ )?.name,
|
|
|
|
|
+ userId: user.id,
|
|
|
|
|
+ userName: user.name
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ console.log('row', row);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|