|
|
|
@ -2,35 +2,39 @@ |
|
|
|
<el-dialog v-drag |
|
|
|
:title="!dataForm.id ? '新增' : '修改'" |
|
|
|
:close-on-click-modal="false" |
|
|
|
width="335px" |
|
|
|
width="455px" |
|
|
|
@close="closeDialog()" |
|
|
|
:visible.sync="visible"> |
|
|
|
<el-form :model="dataForm" :inline="true" label-position="top" :rules="dataRule" ref="dataForm" |
|
|
|
label-width="80px"> |
|
|
|
<el-row> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form :model="dataForm" :inline="false" label-position="top" :rules="dataRule" ref="dataForm" |
|
|
|
label-width="80px" > |
|
|
|
<el-row :gutter="10"> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="发起日期" prop="taskStartDate"> |
|
|
|
<el-date-picker |
|
|
|
v-model="dataForm.taskStartDate" |
|
|
|
type="date" |
|
|
|
style="width: 145px" |
|
|
|
style="width: 100%" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
placeholder="选择日期"> |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="客户" prop="customer"> |
|
|
|
<el-input v-model="dataForm.customer"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="24"> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="项目" prop="project"> |
|
|
|
<el-input v-model="dataForm.project"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row :gutter="10" style="display: block;"> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="要求完成日期" prop="requiredCompletionDate"> |
|
|
|
<el-date-picker |
|
|
|
style="width: 145px" |
|
|
|
style="width: 100%" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
v-model="dataForm.requiredCompletionDate" |
|
|
|
type="date" |
|
|
|
@ -38,14 +42,36 @@ |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="老型号/编码" > |
|
|
|
<el-input v-model="dataForm.oldSpec"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="新型号/编码" > |
|
|
|
<el-input v-model="dataForm.newSpec"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-row :gutter="10" style="display: block;"> |
|
|
|
<el-col :span="16"> |
|
|
|
<el-form-item label="主题" prop="taskHeader"> |
|
|
|
<el-input style="width: 305px" v-model="dataForm.taskHeader"></el-input> |
|
|
|
<el-input v-model="dataForm.taskHeader" ></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="任务类型" prop="taskHeader"> |
|
|
|
<el-select filterable v-model="dataForm.taskType" clearable> |
|
|
|
<el-option :label="item.taskType" :value="item.taskType" v-for="(item,index) in taskTypeList " |
|
|
|
:key="index"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row :gutter="10" style="display: block;"> |
|
|
|
<el-col :span="24"> |
|
|
|
<el-form-item label="任务描述"> |
|
|
|
<el-input type="textarea" style="width: 305px" v-model="dataForm.taskDescription"></el-input> |
|
|
|
<el-input type="textarea" v-model="dataForm.taskDescription"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
@ -95,7 +121,7 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import {getUserList} from '@/api/taskmanage/users.js' |
|
|
|
import {saveBatchTaskList, updateTask} from '@/api/taskmanage/tasklist.js' |
|
|
|
import {saveBatchTaskList, updateTask,getTaskTypeList} from '@/api/taskmanage/tasklist.js' |
|
|
|
|
|
|
|
export default { |
|
|
|
data() { |
|
|
|
@ -172,7 +198,11 @@ |
|
|
|
site: '', |
|
|
|
updatedDate: '', |
|
|
|
taskHeader: '', |
|
|
|
taskType: '', |
|
|
|
oldSpec: '', |
|
|
|
newSpec: '', |
|
|
|
}, |
|
|
|
taskTypeList:[], |
|
|
|
dataRule: { |
|
|
|
project: [ |
|
|
|
{required: true, message: ' ', trigger: 'blur'} |
|
|
|
@ -221,6 +251,9 @@ |
|
|
|
this.dataForm.updatedDate = data.taskList.updatedDate |
|
|
|
this.dataForm.updatedBy = data.taskList.updatedBy |
|
|
|
this.dataForm.site = data.taskList.site |
|
|
|
this.dataForm.taskType= data.taskList.taskType |
|
|
|
this.dataForm.oldSpec = data.taskList.oldSpec |
|
|
|
this.dataForm.newSpec = data.taskList.newSpec |
|
|
|
} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
@ -235,6 +268,7 @@ |
|
|
|
if (!this.dataForm.project) return this.$message.warning('项目不能为空!') |
|
|
|
if (!this.dataForm.requiredCompletionDate) return this.$message.warning('任务结束日期不能为空') |
|
|
|
if (!this.dataForm.taskHeader) return this.$message.warning('任务主题不能为空!') |
|
|
|
if (!this.dataForm.taskType) return this.$message.warning('任务类型不能为空!') |
|
|
|
this.$refs['dataForm'].validate((valid) => { |
|
|
|
if (valid) { |
|
|
|
if (this.dataForm.taskStartDate < this.dayjs().format("YYYY-MM-DD")) { |
|
|
|
@ -275,6 +309,9 @@ |
|
|
|
'createdBy': this.$store.state.user.name, |
|
|
|
'site': this.$store.state.user.site, |
|
|
|
'taskHeader': this.dataForm.taskHeader, |
|
|
|
'taskType': this.dataForm.taskType, |
|
|
|
'oldSpec': this.dataForm.oldSpec, |
|
|
|
'newSpec': this.dataForm.newSpec, |
|
|
|
'taskDetails': newTaskList |
|
|
|
|
|
|
|
} |
|
|
|
@ -314,6 +351,16 @@ |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
getTaskTypeList() { |
|
|
|
getTaskTypeList({}).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
console.log(data.rows) |
|
|
|
this.taskTypeList = data.rows |
|
|
|
} else { |
|
|
|
this.taskTypeList = [] |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 多选 |
|
|
|
selectionChangeHandle(val) { |
|
|
|
this.dataListSelections = val |
|
|
|
@ -330,6 +377,10 @@ |
|
|
|
}, |
|
|
|
created() { |
|
|
|
this.getUserList() |
|
|
|
this.getTaskTypeList(); |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
<style scoped> |
|
|
|
|
|
|
|
</style> |