| | |
| | | allow-create |
| | | default-first-option |
| | | @keyup.enter.native="handleInputConfirm" |
| | | @change="handleInputConfirm" |
| | | > |
| | | <el-option |
| | | v-for="(item, id) in tags" |
| | |
| | | <template slot="append">小时</template> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item label="任务负责人" prop="userId"> |
| | | <el-select v-model="form.userIdList" :no-data-text=" '未任务成员' " multiple filterable clearable placeholder="请选择" style="width: 340px;"> |
| | | <el-form-item label="任务成员" prop="containUserList"> |
| | | <el-select v-model="form.containUserList" multiple filterable clearable placeholder="请选择" style="width: 340px;" @change="getContainUserList"> |
| | | <el-option |
| | | v-for="item in containUserList" |
| | | v-for="item in users" |
| | | :key="item.id" |
| | | :label="item.nickName" |
| | | :value="item.id" |
| | |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="任务成员" prop="containUserList"> |
| | | <el-select v-model="form.containUserList" multiple filterable clearable placeholder="请选择" style="width: 340px;"> |
| | | <el-form-item label="任务负责人" prop="userId"> |
| | | <el-select v-model="form.userIdList" :no-data-text=" '没有任务成员' " multiple filterable clearable placeholder="请选择" style="width: 340px;"> |
| | | <el-option |
| | | v-for="item in users" |
| | | v-show="form.containUserList != undefined && form.containUserList.some(animal => animal === item.id)" |
| | | :key="item.id" |
| | | :label="item.nickName" |
| | | :value="item.id" |
| | |
| | | tags: [], |
| | | // tag标签 |
| | | inputVisible: false, |
| | | inputValue: '', |
| | | inputValue: null, |
| | | containUserList: [] |
| | | } |
| | | }, |
| | |
| | | this.getTags() |
| | | }, |
| | | methods: { |
| | | getContainUserList(e) { |
| | | console.log(e) |
| | | this.form.containUserList = e |
| | | }, |
| | | getTags() { |
| | | crudTask.getTags().then(res => { |
| | | this.tags = res |
| | | }) |
| | | }, |
| | | // 钩子:在获取表格数据之前执行,false 则代表不获取数据 |
| | | [CRUD.HOOK.beforeRefresh]() { |
| | | if (!this.crud.query.projectId) { |
| | |
| | | if (!this.form.taskStatus) { |
| | | this.form.taskStatus = 'task_status_not_started' |
| | | } |
| | | if (this.form.parent.id === undefined || this.form.parent.id === null || this.form.parent.id === '') { |
| | | this.form.parent = null |
| | | if (this.inputValue !== null) { |
| | | this.form.tagList.push(this.inputValue) |
| | | } |
| | | return true |
| | | }, |
| | | [CRUD.HOOK.afterSubmit]() { |
| | | this.inputValue = null |
| | | this.getTags() |
| | | }, |
| | | // 钩子:新建 - 之前 |
| | | [CRUD.HOOK.beforeToCU]() { |
| | |
| | | this.crud.query.flag = project.flag |
| | | this.crud.toQuery() |
| | | this.getProjectTotal() |
| | | }, |
| | | getTags() { |
| | | crudTask.getTags().then(res => { |
| | | // 项目列表 |
| | | this.tags = res |
| | | }) |
| | | }, |
| | | getTaskUser(even) { |
| | | this.containUserList = [] |
| | |
| | | }, |
| | | handleInputConfirm() { |
| | | const inputValue = this.inputValue |
| | | if (inputValue) { |
| | | if (inputValue !== '') { |
| | | this.form.tagList.push(inputValue) |
| | | } |
| | | this.inputVisible = false |
| | | this.inputValue = '' |
| | | this.inputValue = null |
| | | }, |
| | | handleSelect(item) { |
| | | this.inputValue = item.value |