|
@@ -33,8 +33,10 @@
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="业务线" prop="bizId">
|
|
|
- <el-select v-model="task_form.bizId" :disabled="tit_Name === '编辑任务'" filterable placeholder="请选择" style="width:20vw">
|
|
|
- <el-option v-for="item in all_bizId" :key="item.code" :label="item.name" :value="item.code" />
|
|
|
+ <el-select v-model="task_form.bizId" :disabled="task_form.source !== 2" placeholder="请选择" style="width:100%" filterable @change="task_change_bizId(task_form.bizId)">
|
|
|
+ <el-option-group v-for="group in bizList" :key="group.code" :label="group.name">
|
|
|
+ <el-option v-for="item in group.options" :key="item.code" :label="item.name" :value="item.code" />
|
|
|
+ </el-option-group>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="开发负责人">
|
|
@@ -103,7 +105,7 @@ import { mapGetters } from 'vuex'
|
|
|
import { analysisBizId_id, EncryptId } from '@/utils/crypto-js.js'
|
|
|
const _ = require('lodash')
|
|
|
import { taskCreate, memberQueryMemberInfoByIDAPorName, configShowTaskEnum, configShowRequirementVersionEnum, taskGet, taskUpdate, projectListProject } from '@/api/taskIndex' // ajax
|
|
|
-import { projectList, settingGetBizList } from '@/api/projectIndex'
|
|
|
+import { projectList, settingGetBizList, settingGetMyAndOtherBizList } from '@/api/projectIndex'
|
|
|
import { settingQueryBizModuleList } from '@/api/defectManage'
|
|
|
export default {
|
|
|
props: {
|
|
@@ -122,6 +124,7 @@ export default {
|
|
|
ascription_project: false, // 归属项目(隐藏)
|
|
|
ascription_demand: false, // 归属需求(隐藏)
|
|
|
test: {},
|
|
|
+ bizList: [],
|
|
|
loading: false,
|
|
|
tit: '', // 跳转
|
|
|
tit_Name: '', // 新建(编辑)
|
|
@@ -139,6 +142,7 @@ export default {
|
|
|
demandList: [], // 需求list
|
|
|
userInformation: localStorage.getItem('username'),
|
|
|
userNames: localStorage.getItem('realname'),
|
|
|
+ requirementIdList: {},
|
|
|
task_rulesForm: {
|
|
|
name: [{ required: true, message: '请输入任务名称', trigger: 'blur' }],
|
|
|
// moduleIds: [{ required: true, message: '请选择模块', trigger: 'blur' }],
|
|
@@ -159,6 +163,7 @@ export default {
|
|
|
},
|
|
|
created() {
|
|
|
this.analysisBizId_id()
|
|
|
+ this.settingGetBizList()
|
|
|
},
|
|
|
mounted() {
|
|
|
this.get_taskSelect()
|
|
@@ -175,38 +180,27 @@ export default {
|
|
|
this.tit_Name = '新建任务'
|
|
|
switch (e) {
|
|
|
case 1: // 新建任务(任务主页)
|
|
|
- this.task_form = {
|
|
|
- followVersion: 2
|
|
|
- }
|
|
|
this.dialogFormVisible = true
|
|
|
this.ascription_demand = false
|
|
|
this.ascription_project = false
|
|
|
- this.$set(this.task_form, 'notest', 0)
|
|
|
- this.$set(this.task_form, 'followVersion', 2)
|
|
|
- this.$set(this.task_form, 'source', 1)
|
|
|
- this.$set(this.task_form, 'bizId', this.bizId)
|
|
|
+ this.task_form = { 'notest': 0, 'followVersion': 2, 'source': 1, 'bizId': this.bizId }
|
|
|
+ this.requirementIdList = { 'name': '主页' }
|
|
|
this.show_Client = false
|
|
|
this.$nextTick(() => {
|
|
|
this.$refs['task_form'].clearValidate()
|
|
|
})
|
|
|
+ this.task_change_bizId(this.bizId)
|
|
|
break
|
|
|
case 2: // 新建任务(项目详情)
|
|
|
this.tit = '新建任务'
|
|
|
projectList({ id: this.projectId, curIndex: 1, pageSize: 15 }).then(res => {
|
|
|
this.dialogFormVisible = true
|
|
|
- var that = this
|
|
|
- setTimeout(function() {
|
|
|
- that.task_form = {}
|
|
|
- that.ascription_demand = false
|
|
|
- that.ascription_project = true
|
|
|
- that.$set(that.task_form, 'bizId', that.bizId)
|
|
|
- that.$set(that.task_form, 'source', 3)
|
|
|
- that.$set(that.task_form, 'notest', 0)
|
|
|
- that.$set(that.task_form, 'followVersion', 2)
|
|
|
- that.$set(that.task_form, 'requireId', res.data[0].id)
|
|
|
- that.$set(that.task_form, 'projectId', res.data[0].id)
|
|
|
- that.task_form.followVersion === 2 ? that.show_Client = false : ''
|
|
|
- }, 300)
|
|
|
+ this.task_form = { 'followVersion': 2, 'notest': 0, 'source': 3, 'projectId': res.data[0].id, 'requireId': res.data[0].id, 'bizId': this.bizId }
|
|
|
+ this.requirementIdList = { 'name': '项目', 'data': res.data[0].id }
|
|
|
+ this.ascription_demand = false
|
|
|
+ this.ascription_project = true
|
|
|
+ this.show_Client = false
|
|
|
+ this.task_change_bizId(this.bizId)
|
|
|
})
|
|
|
break
|
|
|
case 3: // 编辑任务(任务详情)
|
|
@@ -238,9 +232,10 @@ export default {
|
|
|
return item
|
|
|
}, [])
|
|
|
}, 100)
|
|
|
+ this.task_change_bizId(res.data.bizId, res.data.id)
|
|
|
})
|
|
|
break
|
|
|
- case 4: // 新建任务(项目详情)
|
|
|
+ case 4: // 新建任务(需求详情)
|
|
|
this.tit = '新建任务'
|
|
|
var ss = {}
|
|
|
configShowRequirementVersionEnum({ bizId: this.bizId }).then(res => {
|
|
@@ -248,36 +243,21 @@ export default {
|
|
|
item.id === this.requireId ? ss = item : ''
|
|
|
})
|
|
|
this.dialogFormVisible = true
|
|
|
- const that = this
|
|
|
- setTimeout(function() {
|
|
|
- that.task_form = {}
|
|
|
- that.ascription_demand = true
|
|
|
- that.ascription_project = false
|
|
|
- that.$set(that.task_form, 'source', 2)
|
|
|
- that.$set(that.task_form, 'notest', 0)
|
|
|
- that.$set(that.task_form, 'followVersion', 2)
|
|
|
- that.$set(that.task_form, 'requireId', ss.id)
|
|
|
- that.$set(that.task_form, 'projectId', '')
|
|
|
- that.$set(that.task_form, 'bizId', that.bizId)
|
|
|
- that.task_form.followVersion === 2 ? that.show_Client = false : ''
|
|
|
- if (data) {
|
|
|
- that.$set(that.task_form, 'requireId', data.requirementId)
|
|
|
- that.$set(that.task_form, 'name', data.name)
|
|
|
- that.$set(that.task_form, 'priority', data.priority)
|
|
|
- }
|
|
|
- console.log(that.task_form)
|
|
|
- }, 300)
|
|
|
+ this.ascription_demand = true
|
|
|
+ this.ascription_project = false
|
|
|
+ this.task_form = { 'followVersion': 2, 'notest': 0, 'source': 2, 'projectId': '', 'requireId': ss.id, 'bizId': this.bizId }
|
|
|
+ this.show_Client = false
|
|
|
+ if (data) {
|
|
|
+ this.task_form = { ...this.task_form, 'requireId': data.requirementId, 'name': data.name, 'priority': data.priority }
|
|
|
+ this.requirementIdList = { 'name': '需求', 'data': data.requirementId }
|
|
|
+ }
|
|
|
+ this.task_change_bizId(this.bizId)
|
|
|
})
|
|
|
break
|
|
|
}
|
|
|
projectListProject({ bizId: this.bizId }).then(res => { // 获取项目(查询)
|
|
|
this.projectList = res.data.filter(item => item.id !== -1)
|
|
|
})
|
|
|
- const res = await configShowRequirementVersionEnum({ bizId: this.bizId, taskId: 2060 }) // 获取需求(查询)
|
|
|
- // if (res.code === 200) {
|
|
|
- console.log(res, id, '你才看见的是')
|
|
|
- // this.demandList = res.data.filter(item => item.id !== -1)
|
|
|
- // }
|
|
|
},
|
|
|
test2(item, e) { // 获取团队人员信息
|
|
|
if (typeof this.test[item.idap] === 'undefined') {
|
|
@@ -292,6 +272,26 @@ export default {
|
|
|
leading: true,
|
|
|
trailing: false
|
|
|
}),
|
|
|
+ async settingGetBizList() { // 获取业务线列表
|
|
|
+ const res = await settingGetMyAndOtherBizList()
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.bizList = [{
|
|
|
+ name: '我的业务线',
|
|
|
+ options: res.data[0] || []
|
|
|
+ }, {
|
|
|
+ name: '其他业务线',
|
|
|
+ options: res.data[1] ? res.data[1].filter(item => item.isSecret !== 1) : []
|
|
|
+ }]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async task_change_bizId(biz, id) { // 获取业务线需求
|
|
|
+ const data = { bizId: biz }
|
|
|
+ id ? data.taskId = id : ''
|
|
|
+ const res = await configShowRequirementVersionEnum(data) // 获取需求(查询)
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.demandList = res.data.filter(item => item.id !== -1)
|
|
|
+ }
|
|
|
+ },
|
|
|
create_task(e) { // 创建任务(保存)
|
|
|
this.$refs['task_form'].validate((valid) => {
|
|
|
if (valid) {
|
|
@@ -393,18 +393,22 @@ export default {
|
|
|
case 1:
|
|
|
this.ascription_demand = false
|
|
|
this.ascription_project = false
|
|
|
+ this.$set(this.task_form, 'bizId', this.bizId)
|
|
|
this.$set(this.task_form, 'requireId', '')
|
|
|
this.$set(this.task_form, 'projectId', '')
|
|
|
break
|
|
|
case 2:
|
|
|
this.ascription_demand = true
|
|
|
this.ascription_project = false
|
|
|
- this.$set(this.task_form, 'requireId', '')
|
|
|
+ this.requirementIdList.name === '需求' ? this.$set(this.task_form, 'requireId', this.requirementIdList.data) : this.$set(this.task_form, 'requireId', '')
|
|
|
+ this.$set(this.task_form, 'projectId', '')
|
|
|
break
|
|
|
case 3:
|
|
|
this.ascription_demand = false
|
|
|
this.ascription_project = true
|
|
|
- this.$set(this.task_form, 'projectId', '')
|
|
|
+ this.$set(this.task_form, 'bizId', this.bizId)
|
|
|
+ this.requirementIdList.name === '项目' ? this.$set(this.task_form, 'projectId', this.requirementIdList.data) : this.$set(this.task_form, 'projectId', '')
|
|
|
+ this.$set(this.task_form, 'requireId', '')
|
|
|
break
|
|
|
}
|
|
|
},
|