|
@@ -35,29 +35,66 @@
|
|
|
</div>
|
|
</div>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="8">
|
|
|
|
|
|
|
+ <el-col :span="8" v-if="!dialogTitle.includes('量具送检')">
|
|
|
<el-form-item label="类型" prop="autoOrder">
|
|
<el-form-item label="类型" prop="autoOrder">
|
|
|
- <el-select v-model="addForm.type" size="small" @change="typeChange" style="width: 100%">
|
|
|
|
|
|
|
+ <el-select v-model="addForm.executeUserType" :disabled="isBindPlan" size="small" @change="typeChange" style="width: 100%">
|
|
|
<el-option :value="1" label="班组"></el-option>
|
|
<el-option :value="1" label="班组"></el-option>
|
|
|
<el-option :value="0" label="个人"></el-option>
|
|
<el-option :value="0" label="个人"></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
- <el-col :span="8" v-if="addForm.autoOrder && !dialogTitle.includes('量具送检')">
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <el-col :span="8" v-if="((addForm.autoOrder && (modelType == 'add' || modelType == 'edit')) || (!addForm.autoOrder && modelType == 'dispatch')) && addForm.executeUserType == 1 && !dialogTitle.includes('量具送检')">
|
|
|
|
|
+ <el-form-item label="班组" prop="teamId">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="addForm.teamId"
|
|
|
|
|
+ :disabled="isBindPlan"
|
|
|
|
|
+ size="small"
|
|
|
|
|
+ @change="teamChange"
|
|
|
|
|
+ style="width: 100%"
|
|
|
|
|
+ >
|
|
|
|
|
+ <el-option
|
|
|
|
|
+ :value="i.id"
|
|
|
|
|
+ :label="i.name"
|
|
|
|
|
+ v-for="i in teamAllList"
|
|
|
|
|
+ :key="i.id"
|
|
|
|
|
+ ></el-option>
|
|
|
|
|
+ </el-select>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-col>
|
|
|
|
|
+
|
|
|
|
|
+ <el-col :span="8" v-if="((addForm.autoOrder && (modelType == 'add' || modelType == 'edit')) || (!addForm.autoOrder && modelType == 'dispatch')) && addForm.executeUserType == 0 && !dialogTitle.includes('量具送检')">
|
|
|
<el-form-item label="部门" prop="groupId">
|
|
<el-form-item label="部门" prop="groupId">
|
|
|
<deptSelect v-model="addForm.groupId" @changeGroup="searchDeptNodeClick" :disabled="isBindPlan" />
|
|
<deptSelect v-model="addForm.groupId" @changeGroup="searchDeptNodeClick" :disabled="isBindPlan" />
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="8" v-if="
|
|
<el-col :span="8" v-if="
|
|
|
- addForm.autoOrder &&
|
|
|
|
|
- !dialogTitle.includes('量具送检') &&
|
|
|
|
|
- addForm.type == 0
|
|
|
|
|
|
|
+ ((addForm.autoOrder && (modelType == 'add' || modelType == 'edit')) || (!addForm.autoOrder && modelType == 'dispatch')) && addForm.executeUserType == 0 &&
|
|
|
|
|
+ !dialogTitle.includes('量具送检')
|
|
|
">
|
|
">
|
|
|
- <el-form-item label="负责人" prop="executeIdList">
|
|
|
|
|
|
|
+ <!-- <el-form-item label="负责人" prop="executeIdList">
|
|
|
<el-select v-model="addForm.executeIdList" size="small" style="width: 100%" :disabled="isBindPlan" multiple
|
|
<el-select v-model="addForm.executeIdList" size="small" style="width: 100%" :disabled="isBindPlan" multiple
|
|
|
filterable>
|
|
filterable>
|
|
|
<el-option v-for="item in executorList" :key="item.id" :value="item.id" :label="item.name"></el-option>
|
|
<el-option v-for="item in executorList" :key="item.id" :value="item.id" :label="item.name"></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
|
|
+ </el-form-item> -->
|
|
|
|
|
+ <el-form-item label="负责人" prop="executeIdList">
|
|
|
|
|
+ <el-select
|
|
|
|
|
+ v-model="addForm.executeIdList"
|
|
|
|
|
+ :disabled="isBindPlan"
|
|
|
|
|
+ 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>
|
|
|
<el-col :span="8" v-if="!dialogTitle.includes('量具送检')">
|
|
<el-col :span="8" v-if="!dialogTitle.includes('量具送检')">
|
|
@@ -277,6 +314,7 @@ import {
|
|
|
bomTaskDelete,
|
|
bomTaskDelete,
|
|
|
getByTaskId
|
|
getByTaskId
|
|
|
} from '@/api/material/BOM';
|
|
} from '@/api/material/BOM';
|
|
|
|
|
+import { getteampage } from '@/api/workforceManagement/team';
|
|
|
|
|
|
|
|
import { getFile } from '@/api/system/file';
|
|
import { getFile } from '@/api/system/file';
|
|
|
import { deepClone } from 'ele-admin/lib/utils/core';
|
|
import { deepClone } from 'ele-admin/lib/utils/core';
|
|
@@ -326,7 +364,7 @@ export default {
|
|
|
addForm: {
|
|
addForm: {
|
|
|
code: '', // 计划配置单号
|
|
code: '', // 计划配置单号
|
|
|
name: '', // 计划配置名称
|
|
name: '', // 计划配置名称
|
|
|
- type: 0, // 默认个人
|
|
|
|
|
|
|
+ executeUserType: 0, // 默认个人
|
|
|
autoOrder: 1, // 自动派单
|
|
autoOrder: 1, // 自动派单
|
|
|
ruleId: '', // 规则id
|
|
ruleId: '', // 规则id
|
|
|
ruleName: '', // 规则名称
|
|
ruleName: '', // 规则名称
|
|
@@ -377,9 +415,15 @@ export default {
|
|
|
executeIdList: [
|
|
executeIdList: [
|
|
|
{ required: true, message: '请选择人员', trigger: 'change' }
|
|
{ required: true, message: '请选择人员', trigger: 'change' }
|
|
|
],
|
|
],
|
|
|
|
|
+ teamId: [
|
|
|
|
|
+ { required: true, message: '请选择班组', trigger: 'change' }
|
|
|
|
|
+ ],
|
|
|
urgent: [
|
|
urgent: [
|
|
|
{ required: true, message: '请选择紧急程度', trigger: 'change' }
|
|
{ required: true, message: '请选择紧急程度', trigger: 'change' }
|
|
|
- ]
|
|
|
|
|
|
|
+ ],
|
|
|
|
|
+ executeUserType: [
|
|
|
|
|
+ { required: true, message: '请选择', trigger: 'change' }
|
|
|
|
|
+ ],
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
columns: [
|
|
columns: [
|
|
@@ -470,7 +514,9 @@ export default {
|
|
|
tabsValue: null,
|
|
tabsValue: null,
|
|
|
|
|
|
|
|
hasCategoryId:false,
|
|
hasCategoryId:false,
|
|
|
- getByIdData:{}
|
|
|
|
|
|
|
+ getByIdData:{},
|
|
|
|
|
+ modelType: '',
|
|
|
|
|
+ teamAllList: [],
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
@@ -498,13 +544,15 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
|
|
|
+ this.getAllTeamList();
|
|
|
this.getUserList({groupId: "1"});
|
|
this.getUserList({groupId: "1"});
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
// 初始化
|
|
// 初始化
|
|
|
- async init(row, tips) {
|
|
|
|
|
|
|
+ async init(type, row, tips) {
|
|
|
console.log(row);
|
|
console.log(row);
|
|
|
console.log(tips);
|
|
console.log(tips);
|
|
|
|
|
+ this.modelType = type;
|
|
|
if (row) {
|
|
if (row) {
|
|
|
this.getInfo(row.id);
|
|
this.getInfo(row.id);
|
|
|
} else {
|
|
} else {
|
|
@@ -514,7 +562,7 @@ export default {
|
|
|
code: '', // 计划配置单号
|
|
code: '', // 计划配置单号
|
|
|
name: '', // 计划配置名称
|
|
name: '', // 计划配置名称
|
|
|
autoOrder: 1, // 自动派单
|
|
autoOrder: 1, // 自动派单
|
|
|
- type: 0, // 默认个人
|
|
|
|
|
|
|
+ executeUserType: 0, // 默认个人
|
|
|
ruleId: '', // 规则id
|
|
ruleId: '', // 规则id
|
|
|
ruleName: '', // 规则名称
|
|
ruleName: '', // 规则名称
|
|
|
duration: null, // 计划完成时长
|
|
duration: null, // 计划完成时长
|
|
@@ -533,6 +581,30 @@ export default {
|
|
|
// this.matterRulesList = [];
|
|
// this.matterRulesList = [];
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ async getAllTeamList() {
|
|
|
|
|
+ const { list } = await getteampage({
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ size: -1
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log('teamAllList 班组', list);
|
|
|
|
|
+ this.teamAllList = list;
|
|
|
|
|
+ },
|
|
|
|
|
+ teamChange() {
|
|
|
|
|
+ console.log('this.addForm.teamId', this.addForm.teamId);
|
|
|
|
|
+ // 当前班组
|
|
|
|
|
+ const currentTeam = this.teamAllList.find(
|
|
|
|
|
+ (item) => item.id === this.addForm.teamId
|
|
|
|
|
+ );
|
|
|
|
|
+ if (currentTeam) {
|
|
|
|
|
+ // 同步执行人
|
|
|
|
|
+ this.addForm.executeUsers = [
|
|
|
|
|
+ {
|
|
|
|
|
+ teamId: currentTeam.id,
|
|
|
|
|
+ teamName: currentTeam.name
|
|
|
|
|
+ }
|
|
|
|
|
+ ];
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
typeChange() {
|
|
typeChange() {
|
|
|
this.addForm.groupId = '';
|
|
this.addForm.groupId = '';
|
|
|
this.addForm.executeIdList = [];
|
|
this.addForm.executeIdList = [];
|
|
@@ -700,6 +772,33 @@ export default {
|
|
|
ruleItems: item.ruleMatters
|
|
ruleItems: item.ruleMatters
|
|
|
};
|
|
};
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
|
|
+ // 处理回显数据
|
|
|
|
|
+ if (this.addForm.executeUserType === 0) {
|
|
|
|
|
+ // 个人
|
|
|
|
|
+ this.addForm.executeIdList = this.addForm.executeUsers.map(
|
|
|
|
|
+ (item) => item.userId
|
|
|
|
|
+ );
|
|
|
|
|
+
|
|
|
|
|
+ let groupIds = this.addForm.executeUsers
|
|
|
|
|
+ .map((i) => i.groupId)
|
|
|
|
|
+ .filter((i) => i);
|
|
|
|
|
+ groupIds = Array.from(new Set(groupIds));
|
|
|
|
|
+
|
|
|
|
|
+ if (groupIds.includes('1')) {
|
|
|
|
|
+ // 包含全部部门,置空
|
|
|
|
|
+ this.addForm.groupId = '1';
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.addForm.groupId = this.addForm.executeUsers[0]?.groupId || '1';
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ groupIds.map((item) => {
|
|
|
|
|
+ this.searchDeptNodeClick(item);
|
|
|
|
|
+ });
|
|
|
|
|
+ } else {
|
|
|
|
|
+ // 班组
|
|
|
|
|
+ this.addForm.teamId = this.addForm.executeUsers[0]?.teamId || '';
|
|
|
|
|
+ }
|
|
|
this.tabsValue = this.ruleIdList[0].ruleId;
|
|
this.tabsValue = this.ruleIdList[0].ruleId;
|
|
|
if (res.groupId) {
|
|
if (res.groupId) {
|
|
|
const params = { groupId: res.groupId };
|
|
const params = { groupId: res.groupId };
|
|
@@ -707,8 +806,8 @@ export default {
|
|
|
}
|
|
}
|
|
|
// this._getMatterRulesDetails(res.ruleId);
|
|
// this._getMatterRulesDetails(res.ruleId);
|
|
|
this.$set(this.addForm, 'code', res.code);
|
|
this.$set(this.addForm, 'code', res.code);
|
|
|
- this.$set(this.addForm, 'urgent', JSON.stringify(res.urgent));
|
|
|
|
|
- this.$set(this.addForm, 'executeIdList', res.executeId.split(','));
|
|
|
|
|
|
|
+ this.$set(this.addForm, 'urgent', res.urgent+'');
|
|
|
|
|
+ // this.$set(this.addForm, 'executeIdList', res.executeId.split(','));
|
|
|
this.$set(this.addForm, 'imageUrl', {});
|
|
this.$set(this.addForm, 'imageUrl', {});
|
|
|
console.log(this.rootData);
|
|
console.log(this.rootData);
|
|
|
const rep = await getTreeByType(0);
|
|
const rep = await getTreeByType(0);
|
|
@@ -777,15 +876,29 @@ export default {
|
|
|
this.addForm.groupName = data.name;
|
|
this.addForm.groupName = data.name;
|
|
|
const params = { groupId: info };
|
|
const params = { groupId: info };
|
|
|
await this.getUserList(params);
|
|
await this.getUserList(params);
|
|
|
- if (this.addForm.type == 1) {
|
|
|
|
|
- this.addForm.executeIdList = this.executorList.map(
|
|
|
|
|
- (item) => item.id
|
|
|
|
|
- );
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // if (this.addForm.executeUserType == 1) {
|
|
|
|
|
+ // this.addForm.executeIdList = this.executorList.map(
|
|
|
|
|
+ // (item) => item.id
|
|
|
|
|
+ // );
|
|
|
|
|
+ // }
|
|
|
} else {
|
|
} else {
|
|
|
this.addForm.groupId = null;
|
|
this.addForm.groupId = null;
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
+ // 负责人变更 同步执行人列表
|
|
|
|
|
+ executeIdListChange() {
|
|
|
|
|
+ this.addForm.executeUsers = this.addForm.executeIdList.map((userId) => {
|
|
|
|
|
+ const user = this.executorList.find((u) => u.id === userId);
|
|
|
|
|
+ return {
|
|
|
|
|
+ userId: user.id,
|
|
|
|
|
+ userName: user.name,
|
|
|
|
|
+
|
|
|
|
|
+ groupId: user.groupId,
|
|
|
|
|
+ groupName: user.groupName
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log('this.addForm.executeUsers', this.addForm.executeUsers);
|
|
|
|
|
+ },
|
|
|
// 过滤计划完成时长
|
|
// 过滤计划完成时长
|
|
|
formDataDurationTime(value) {
|
|
formDataDurationTime(value) {
|
|
|
if (value > 0) {
|
|
if (value > 0) {
|