|
|
@@ -35,7 +35,6 @@
|
|
|
:model="form"
|
|
|
:rules="rules"
|
|
|
label-width="130px"
|
|
|
- :disabled="type == 'detail'"
|
|
|
>
|
|
|
<header-title title="事项信息"></header-title>
|
|
|
<el-row style="margin-bottom: 20px">
|
|
|
@@ -786,6 +785,7 @@
|
|
|
import material from '@/views/produce/components/prenatalExamination/material.vue';
|
|
|
import statistics from './statistics.vue';
|
|
|
import selectWorkOrder from '@/views/checklistManagement/components/selectWorkOrder.vue';
|
|
|
+ import { set } from 'nprogress';
|
|
|
|
|
|
export default {
|
|
|
name: 'editModal',
|
|
|
@@ -888,7 +888,6 @@
|
|
|
pickDetails: [],
|
|
|
// 本次产出明细
|
|
|
outputDetails: [],
|
|
|
- executeUsersIds: [],
|
|
|
workshopAreaId: null,
|
|
|
workshopArea: '',
|
|
|
checkStartTime: null,
|
|
|
@@ -1159,6 +1158,7 @@
|
|
|
return list;
|
|
|
},
|
|
|
activeTeamUserList() {
|
|
|
+ if (!this.teamUserList || this.teamUserList.length === 0) return [];
|
|
|
return this.teamUserList.filter((user) =>
|
|
|
this.form.executeUsersIds.includes(user.id)
|
|
|
);
|
|
|
@@ -1183,6 +1183,7 @@
|
|
|
console.log('data', type, data);
|
|
|
this.type = type;
|
|
|
this.form.reportWorkType = this.reportWorkType;
|
|
|
+
|
|
|
if (type == 'add') {
|
|
|
this.title = `新增${this.reportWorkTypeName}事项`;
|
|
|
} else if (type == 'edit') {
|
|
|
@@ -1242,16 +1243,8 @@
|
|
|
? this.form.executeUsers[0].teamId
|
|
|
: '';
|
|
|
// 加载班组人员列表
|
|
|
- if (this.form.teamId) {
|
|
|
- const index = this.teamList.findIndex(
|
|
|
- (item) => item.id == this.form.teamId
|
|
|
- );
|
|
|
- this.teamUserList = this.teamAllList[index];
|
|
|
- }
|
|
|
- // 加载班组列表
|
|
|
- if(this.teamList.length == 0 && this.form.teamId){
|
|
|
- this.getTeamList(this.form.teamId);
|
|
|
- }
|
|
|
+ this.setTeamList();
|
|
|
+
|
|
|
console.log('this.form', this.form);
|
|
|
this.loading = false;
|
|
|
this.getListByWorkOrderId();
|
|
|
@@ -1852,23 +1845,40 @@
|
|
|
this.teamUserList = this.teamAllList[index];
|
|
|
console.log('this.teamUserList', this.teamUserList);
|
|
|
},
|
|
|
+ // 查看详情加载班组人员
|
|
|
+ async setTeamList() {
|
|
|
+ await this.getTeamList(this.form.teamId);
|
|
|
+ this.$nextTick(() => {
|
|
|
+ const index = this.teamList.findIndex(
|
|
|
+ (item) => item.id == this.form.teamId
|
|
|
+ );
|
|
|
+ this.teamUserList = this.teamAllList[index];
|
|
|
+ console.log('this.teamUserList', this.teamUserList);
|
|
|
+ });
|
|
|
+ },
|
|
|
async getTeamList(id) {
|
|
|
- if(!id) return;
|
|
|
+ if (!id) return;
|
|
|
const ids = id.split(',');
|
|
|
- this.teamList = [];
|
|
|
+ console.log('ids', ids);
|
|
|
this.teamUserList = [];
|
|
|
const list = ids.map((item) => getTeam(item));
|
|
|
|
|
|
const dataList = await Promise.all(list);
|
|
|
|
|
|
dataList.forEach((item) => {
|
|
|
- this.teamList.push({
|
|
|
- name: item.name,
|
|
|
- id: item.id
|
|
|
- });
|
|
|
+ const any = this.teamList.find((team) => team.id == item.id);
|
|
|
+
|
|
|
+ if (!any) {
|
|
|
+ this.teamList.push({
|
|
|
+ name: item.name,
|
|
|
+ id: item.id
|
|
|
+ });
|
|
|
+ }
|
|
|
|
|
|
this.teamAllList.push(item.userVOList);
|
|
|
});
|
|
|
+
|
|
|
+ this.teamAllList = Array.from(new Set(this.teamAllList));
|
|
|
},
|
|
|
changeId() {
|
|
|
if (this.form.executeUsersIds.length == this.teamUserList.length) {
|