|
@@ -73,7 +73,7 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="执行人" required prop="teamId">
|
|
|
|
|
|
|
+ <!-- <el-form-item label="执行人" required prop="teamId">
|
|
|
<el-select
|
|
<el-select
|
|
|
v-model="addForm.teamId"
|
|
v-model="addForm.teamId"
|
|
|
placeholder="请选择班组"
|
|
placeholder="请选择班组"
|
|
@@ -109,6 +109,33 @@
|
|
|
>
|
|
>
|
|
|
</el-option>
|
|
</el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
|
|
+ </el-form-item> -->
|
|
|
|
|
+
|
|
|
|
|
+ <el-form-item label="部门">
|
|
|
|
|
+ <deptSelect
|
|
|
|
|
+ v-model="addForm.groupId"
|
|
|
|
|
+ @changeGroup="searchDeptNodeClick"
|
|
|
|
|
+ />
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+
|
|
|
|
|
+ <el-col :span="8">
|
|
|
|
|
+ <el-form-item label="报工人" prop="executeUsersIds">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="addForm.executeUsersIds"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ multiple
|
|
|
|
|
+ filterable
|
|
|
|
|
+ @change="executeIdListChange"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ v-for="item in executorList"
|
|
|
|
|
+ :key="item.id"
|
|
|
|
|
+ :value="item.id"
|
|
|
|
|
+ :label="item.name"
|
|
|
|
|
+ ></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
|
@@ -286,11 +313,14 @@
|
|
|
import { getTeam } from '@/api/produce/job.js';
|
|
import { getTeam } from '@/api/produce/job.js';
|
|
|
import toolModal from '@/views/batchRecord/components/toolModal.vue';
|
|
import toolModal from '@/views/batchRecord/components/toolModal.vue';
|
|
|
import { producetaskrulerecordSaveOrUpdateAndSubmit } from '@/api/recordRules/index.js';
|
|
import { producetaskrulerecordSaveOrUpdateAndSubmit } from '@/api/recordRules/index.js';
|
|
|
|
|
+ import deptSelect from '@/components/CommomSelect/dept-select.vue';
|
|
|
|
|
+ import { getUserPage } from '@/api/system/organization';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
mixins: [dictMixins],
|
|
mixins: [dictMixins],
|
|
|
components: {
|
|
components: {
|
|
|
- toolModal
|
|
|
|
|
|
|
+ toolModal,
|
|
|
|
|
+ deptSelect
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
|
'addForm.details': {
|
|
'addForm.details': {
|
|
@@ -354,6 +384,7 @@
|
|
|
executeUsers: [],
|
|
executeUsers: [],
|
|
|
// 班组id
|
|
// 班组id
|
|
|
teamId: '',
|
|
teamId: '',
|
|
|
|
|
+ groupId: null,
|
|
|
// 物料字段name
|
|
// 物料字段name
|
|
|
pickDetails: [],
|
|
pickDetails: [],
|
|
|
// 本次产出明细
|
|
// 本次产出明细
|
|
@@ -455,7 +486,8 @@
|
|
|
{ label: '成品统计', value: '1' },
|
|
{ label: '成品统计', value: '1' },
|
|
|
{ label: '物料统计', value: '2' },
|
|
{ label: '物料统计', value: '2' },
|
|
|
{ label: '工序统计', value: '3' }
|
|
{ label: '工序统计', value: '3' }
|
|
|
- ]
|
|
|
|
|
|
|
+ ],
|
|
|
|
|
+ executorList: []
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -543,6 +575,8 @@
|
|
|
} else {
|
|
} else {
|
|
|
this.getTeamList(this.$store.state.user.info.teamId);
|
|
this.getTeamList(this.$store.state.user.info.teamId);
|
|
|
}
|
|
}
|
|
|
|
|
+ // 获取审核人列表、巡点检人员
|
|
|
|
|
+ this.getUserList();
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
// 外部调用,打开弹窗
|
|
// 外部调用,打开弹窗
|
|
@@ -593,6 +627,11 @@
|
|
|
? this.addForm.executeUsers[0].teamId
|
|
? this.addForm.executeUsers[0].teamId
|
|
|
: '';
|
|
: '';
|
|
|
|
|
|
|
|
|
|
+ if (this.addForm.executeUsers.length > 0) {
|
|
|
|
|
+ this.addForm.groupId = this.addForm.executeUsers[0]?.groupId || '';
|
|
|
|
|
+ this.searchDeptNodeClick(this.addForm.groupId);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if (!this.addForm.teamId && this.teamList.length > 0) {
|
|
if (!this.addForm.teamId && this.teamList.length > 0) {
|
|
|
this.addForm.teamId = this.teamList[0].id;
|
|
this.addForm.teamId = this.teamList[0].id;
|
|
|
}
|
|
}
|
|
@@ -850,6 +889,52 @@
|
|
|
i.checkResult = 1;
|
|
i.checkResult = 1;
|
|
|
return i;
|
|
return i;
|
|
|
});
|
|
});
|
|
|
|
|
+ },
|
|
|
|
|
+ // 获取审核人列表、巡点检人员
|
|
|
|
|
+ async getUserList(params) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ let data = { pageNum: 1, size: -1 };
|
|
|
|
|
+ // 如果传了参数就是获取部门人员数据
|
|
|
|
|
+ if (params) {
|
|
|
|
|
+ data = Object.assign(data, params);
|
|
|
|
|
+ }
|
|
|
|
|
+ const res = await getUserPage(data);
|
|
|
|
|
+ if (params) {
|
|
|
|
|
+ this.executorList = res.list;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.uerList = res.list;
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (error) {}
|
|
|
|
|
+ },
|
|
|
|
|
+ //选择部门(搜索)
|
|
|
|
|
+ async searchDeptNodeClick(groupId, data) {
|
|
|
|
|
+ if (groupId) {
|
|
|
|
|
+ // 根据部门获取人员
|
|
|
|
|
+ const params = { groupId: groupId };
|
|
|
|
|
+ await this.getUserList(params);
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.addForm.groupId = null;
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ // 负责人变更 同步执行人列表
|
|
|
|
|
+ executeIdListChange() {
|
|
|
|
|
+ this.addForm.executeUsers = this.addForm.executeUsersIds.map(
|
|
|
|
|
+ (userId) => {
|
|
|
|
|
+ const user = this.executorList.find((u) => u.id === userId);
|
|
|
|
|
+ return {
|
|
|
|
|
+ userId: user.id,
|
|
|
|
|
+ userName: user.name,
|
|
|
|
|
+ groupId: user.groupId,
|
|
|
|
|
+ groupName: user.groupName
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+ );
|
|
|
|
|
+ // 同步详情执行人
|
|
|
|
|
+ this.addForm.details.forEach((detail) => {
|
|
|
|
|
+ detail.checkUsersIds = this.addForm.executeUsersIds;
|
|
|
|
|
+ detail.checkUsers = this.addForm.executeUsers;
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log('this.addForm.executeUsers', this.addForm.executeUsers);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|