|
|
@@ -7,7 +7,7 @@
|
|
|
<el-col :span="19" :xs="24">
|
|
|
<el-form :model="queryParams" ref="queryForm" size="mini" :inline="true">
|
|
|
<el-form-item label="执行(负责)人" prop="executors">
|
|
|
- <dept-user-tree ref="dut" :userList="userList"
|
|
|
+ <dept-user-tree ref="dut" :userList="userList" :multiple="true"
|
|
|
@selected="(val)=>queryParams.executors=val"></dept-user-tree>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="月份选择" prop="month">
|
|
|
@@ -159,15 +159,11 @@
|
|
|
</el-date-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="执行(负责)人" prop="executor">
|
|
|
- <el-cascader
|
|
|
- v-model="form.executor"
|
|
|
- :options="userList"
|
|
|
- @change="(val)=>selectExecutor(val,'form')"
|
|
|
- :props="{ expandTrigger: 'hover',value:'id',label:'name' }"
|
|
|
- :show-all-levels="false"></el-cascader>
|
|
|
+ <dept-user-tree ref="dut2" :userList="userList"
|
|
|
+ @selected="(val)=>selectExecutor(val,'form')"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="共同执行人" prop="coExecutor">
|
|
|
- <dept-user-tree :userList="userList" @selected="selectCoExecutor"/>
|
|
|
+ <dept-user-tree ref="dut3" :userList="userList" :multiple="true" @selected="selectCoExecutor"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="任务附件">
|
|
|
<file-upload @getFileUrl="getFileUrl" @removeFile="removeFile"></file-upload>
|
|
|
@@ -229,13 +225,8 @@
|
|
|
<el-input v-model="child.taskName" style="width: 350px"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="执行人" prop="executor">
|
|
|
- <el-cascader
|
|
|
- v-model="child.executor"
|
|
|
- :options="userList"
|
|
|
- filterable
|
|
|
- @change="(val)=>selectExecutor(val,'splitForm',index)"
|
|
|
- :props="{ expandTrigger: 'hover',value:'id',label:'name' }"
|
|
|
- :show-all-levels="false"></el-cascader>
|
|
|
+ <dept-user-tree ref="dutSplit" :userList="userList" style="width: 350px"
|
|
|
+ @selected="(val)=>selectExecutor(val,'splitForm',index)"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="起止时间" prop="rangeDate">
|
|
|
<el-date-picker
|
|
|
@@ -256,6 +247,22 @@
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
|
|
|
+ <el-dialog title="该时间段内有人员安排冲突,是否继续保存?" :visible.sync="confirmOpen" append-to-body :close-on-click-modal="false">
|
|
|
+ <el-table :data="conflictTasks" size="mini">
|
|
|
+ <el-table-column label="任务名称" prop="taskName" min-width="150" :show-overflow-tooltip="true"/>
|
|
|
+ <el-table-column label="执行(负责)人" prop="executorName"/>
|
|
|
+ <el-table-column label="任务起止时间" width="170">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span>{{ scope.row.beginDate + ' 至 ' + scope.row.endDate }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button type="primary" size="mini" @click="submitConfirm">确 定</el-button>
|
|
|
+ <el-button size="mini" @click="cancelConfirm">取 消</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
@@ -327,14 +334,14 @@ export default {
|
|
|
taskName: [
|
|
|
{required: true, message: "任务名称不能为空", trigger: "blur"}
|
|
|
],
|
|
|
- taskType: [
|
|
|
- {required: true, message: "任务类型不能为空", trigger: "change"}
|
|
|
+ projectId: [
|
|
|
+ {required: true, message: "所属项目不能为空", trigger: "blur"}
|
|
|
],
|
|
|
rangeDate: [
|
|
|
{required: true, message: "起止时间不能为空", trigger: "change"}
|
|
|
],
|
|
|
executor: [
|
|
|
- {required: true, message: "执行人不能为空", trigger: "change"}
|
|
|
+ {required: true, message: "执行人不能为空", trigger: "blur"}
|
|
|
]
|
|
|
},
|
|
|
auditRules: {
|
|
|
@@ -342,6 +349,8 @@ export default {
|
|
|
{required: true, message: "审核意见不能为空", trigger: "change"}
|
|
|
]
|
|
|
},
|
|
|
+ confirmOpen: false,
|
|
|
+ conflictTasks: []
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
|
@@ -458,10 +467,10 @@ export default {
|
|
|
selectExecutor(val, form, index) {
|
|
|
if (form === 'splitForm') {
|
|
|
let child = this.splitForm.children[index];
|
|
|
- child.executor = val[val.length - 1]
|
|
|
+ child.executor = val
|
|
|
}
|
|
|
if (form === 'form') {
|
|
|
- this.form.executor = val[val.length - 1]
|
|
|
+ this.form.executor = val
|
|
|
}
|
|
|
},
|
|
|
selectCoExecutor(val) {
|
|
|
@@ -521,15 +530,55 @@ export default {
|
|
|
this.form.beginDate = this.form.rangeDate[0]
|
|
|
this.form.endDate = this.form.rangeDate[1]
|
|
|
this.form.fileUrl = JSON.stringify(this.form.files)
|
|
|
+ this.form.checkTaskConflict = true;
|
|
|
addTask(this.form).then(res => {
|
|
|
- this.$message.success("新增成功");
|
|
|
- this.open = false;
|
|
|
- this.reset();
|
|
|
- this.getList();
|
|
|
+ if (res.code === 'S.F-2001') {
|
|
|
+ this.conflictTasks = res.data
|
|
|
+ this.confirmOpen = true
|
|
|
+ } else {
|
|
|
+ this.$message.success("新增成功");
|
|
|
+ this.open = false;
|
|
|
+ this.reset();
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
});
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+ submitConfirm() {
|
|
|
+ if (this.open) {
|
|
|
+ this.form.checkTaskConflict = false;
|
|
|
+ addTask(this.form).then(res => {
|
|
|
+ this.$message.success("新增成功");
|
|
|
+ this.open = false;
|
|
|
+ this.confirmOpen = false;
|
|
|
+ this.reset();
|
|
|
+ this.getList();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ if (this.splitOpen) {
|
|
|
+ this.splitForm.checkTaskConflict = true;
|
|
|
+ splitTask(this.splitForm).then(res => {
|
|
|
+ this.resetForm("splitForm");
|
|
|
+ this.getList()
|
|
|
+ this.splitOpen = false
|
|
|
+ this.confirmOpen = false;
|
|
|
+ this.$message.success("操作成功");
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ cancelConfirm() {
|
|
|
+ this.open = false;
|
|
|
+ this.splitOpen = false;
|
|
|
+ this.confirmOpen = false;
|
|
|
+ this.$refs.dut2.clearText()
|
|
|
+ this.$refs.dut3.clearText()
|
|
|
+ let dutSplit = this.$refs.dutSplit || [];
|
|
|
+ for (let key in dutSplit) {
|
|
|
+ dutSplit[key].clearText()
|
|
|
+ }
|
|
|
+ this.resetForm("splitForm");
|
|
|
+ },
|
|
|
|
|
|
/** 审核提交按钮 */
|
|
|
submitAudit() {
|
|
|
@@ -546,12 +595,31 @@ export default {
|
|
|
},
|
|
|
/** 分解任务提交按钮 */
|
|
|
submitSplit() {
|
|
|
+ let validResult = true
|
|
|
+ let splitChild = this.$refs.splitChild;
|
|
|
+ for (let key in splitChild) {
|
|
|
+ splitChild[key].validate(valid => {
|
|
|
+ if (!valid) {
|
|
|
+ validResult = valid
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ if (!validResult) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.splitForm.checkTaskConflict = true;
|
|
|
splitTask(this.splitForm).then(res => {
|
|
|
- this.resetForm("splitForm");
|
|
|
- this.getList()
|
|
|
- this.splitOpen = false
|
|
|
- this.$message.success("操作成功");
|
|
|
+ if (res.code === 'S.F-2001') {
|
|
|
+ this.conflictTasks = res.data
|
|
|
+ this.confirmOpen = true
|
|
|
+ } else {
|
|
|
+ this.resetForm("splitForm");
|
|
|
+ this.getList()
|
|
|
+ this.splitOpen = false
|
|
|
+ this.$message.success("操作成功");
|
|
|
+ }
|
|
|
})
|
|
|
+
|
|
|
},
|
|
|
|
|
|
/** 终止按钮操作 */
|