|
@@ -13,7 +13,7 @@
|
|
|
<el-form ref="form" :model="formData" label-width="100px" label-position="left">
|
|
|
<el-form-item v-if="type === 'require'" label="需求方向">
|
|
|
<el-cascader
|
|
|
- v-model="formData.requireOrientId"
|
|
|
+ v-model="formData.requireOrientIdList"
|
|
|
size="small"
|
|
|
collapse-tags
|
|
|
:props="requireProps"
|
|
@@ -24,7 +24,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="type === 'task'" label="技术模块">
|
|
|
<el-cascader
|
|
|
- v-model="formData.techModuleId"
|
|
|
+ v-model="formData.techModuleIdList"
|
|
|
size="small"
|
|
|
collapse-tags
|
|
|
:props="requireProps"
|
|
@@ -79,10 +79,10 @@
|
|
|
<el-select v-model="item.type" placeholder="请选择" size="small" class="condition-select" @change="changeNoticeType(item)">
|
|
|
<el-option v-for="key in noticeGroupList" :key="'email-type'+key.label" :label="key.label" :value="key.value" />
|
|
|
</el-select>
|
|
|
- <el-select v-show="item.type===1" v-model="item.teamList" placeholder="请选择" size="small" :multiple="true">
|
|
|
+ <el-select v-show="item.type===1" v-model="item.teams" placeholder="请选择" size="small" :multiple="true">
|
|
|
<el-option v-for="key in teamList" :key="'email-team'+key.teamId" :label="key.teamName" :value="key.teamId" />
|
|
|
</el-select>
|
|
|
- <search-people v-show="item.type===2" :value.sync="item.customStaffList" :clearable="false" :multiple="true" />
|
|
|
+ <search-people v-show="item.type===2" :value.sync="item.customStaffs" :clearable="false" :multiple="true" />
|
|
|
<i v-if="index!==0" class="el-icon-remove-outline" @click="removeMembers(EmailList,index)" />
|
|
|
</el-form-item>
|
|
|
<div v-show="noticeList.Email" class="add-notice" @click="addMembers(EmailList)"><i class="el-icon-circle-plus-outline" /> 添加人群</div>
|
|
@@ -92,10 +92,10 @@
|
|
|
<el-select v-model="item.type" placeholder="请选择" size="small" class="condition-select" @change="changeNoticeType(item)">
|
|
|
<el-option v-for="key in noticeGroupList" :key="'DChart-type'+key.label" :label="key.label" :value="key.value" />
|
|
|
</el-select>
|
|
|
- <el-select v-show="item.type===1" v-model="item.teamList" placeholder="请选择" size="small" :multiple="true">
|
|
|
+ <el-select v-show="item.type===1" v-model="item.teams" placeholder="请选择" size="small" :multiple="true">
|
|
|
<el-option v-for="key in teamList" :key="'DChart-team'+key.teamId" :label="key.teamName" :value="key.teamId" />
|
|
|
</el-select>
|
|
|
- <search-people v-show="item.type===2" :value.sync="item.customStaffList" :clearable="false" :multiple="true" />
|
|
|
+ <search-people v-show="item.type===2" :value.sync="item.customStaffs" :clearable="false" :multiple="true" />
|
|
|
<i v-if="index!==0" class="el-icon-remove-outline" @click="removeMembers(DChartList,index)" />
|
|
|
</el-form-item>
|
|
|
<div v-show="noticeList.DChart" class="add-notice" @click="addMembers(DChartList)"><i class="el-icon-circle-plus-outline" /> 添加人群</div>
|
|
@@ -155,7 +155,8 @@ import {
|
|
|
showRequireStatusEnum,
|
|
|
showTaskStatusEnum,
|
|
|
getBizNoticeSettingEnum,
|
|
|
- addBizNoticeSetting
|
|
|
+ addBizNoticeSetting,
|
|
|
+ updateBizNoticeSetting
|
|
|
} from '@/api/configure'
|
|
|
import { settingQueryBizRqmtOrntList } from '@/api/requirement.js'
|
|
|
import { settingQueryBizModuleList } from '@/api/defectManage'
|
|
@@ -196,8 +197,8 @@ export default {
|
|
|
modulesList: [], // 任务模块列表
|
|
|
formData: {
|
|
|
bizId: Number(localStorage.getItem('bizId')),
|
|
|
- requireOrientId: [], // 需求方向
|
|
|
- techModuleId: [], // 技术模块
|
|
|
+ requireOrientIdList: [], // 需求方向
|
|
|
+ techModuleIdList: [], // 技术模块
|
|
|
clientId: null, // 客户端
|
|
|
clientVersionId: null, // 版本
|
|
|
noticeConditionList: [], // 条件列表
|
|
@@ -240,7 +241,7 @@ export default {
|
|
|
get() {
|
|
|
if (this.formData.clientId !== null) {
|
|
|
const obj = this.appClientList.find(item => item.code === this.formData.clientId)
|
|
|
- return obj.childEnumInfos || []
|
|
|
+ return (obj && obj.childEnumInfos) || []
|
|
|
} else {
|
|
|
return []
|
|
|
}
|
|
@@ -272,14 +273,14 @@ export default {
|
|
|
'noticeList.Email': {
|
|
|
handler(newV, oldV) {
|
|
|
if (newV) {
|
|
|
- if (this.EmailList.length === 0) this.EmailList.push({ type: 0, member: false, teamList: [], customStaffList: [] })
|
|
|
+ if (this.EmailList.length === 0) this.EmailList.push({ types: 0, member: false, teams: [], customStaffs: [] })
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
'noticeList.DChart': {
|
|
|
handler(newV, oldV) {
|
|
|
if (newV) {
|
|
|
- if (this.DChartList.length === 0) this.DChartList.push({ type: 0, member: false, teamList: [], customStaffList: [] })
|
|
|
+ if (this.DChartList.length === 0) this.DChartList.push({ types: 0, member: false, teams: [], customStaffs: [] })
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -296,24 +297,24 @@ export default {
|
|
|
initData(data) {
|
|
|
this.formData = {
|
|
|
bizId: data.bizId,
|
|
|
- requireOrientId: data.requireOrientId, // 需求方向
|
|
|
- techModuleId: data.techModuleId, // 技术模块
|
|
|
+ requireOrientIdList: data.requireOrientIdList, // 需求方向
|
|
|
+ techModuleIdList: data.techModuleIdList, // 技术模块
|
|
|
clientId: data.clientId || null, // 客户端
|
|
|
clientVersionId: data.clientVersionId, // 版本
|
|
|
noticeConditionList: data.noticeConditionList || [], // 条件列表
|
|
|
noticeSetting: {}, // 通知方式
|
|
|
noticeTime: data.noticeTime // 通知时刻
|
|
|
}
|
|
|
- if (data.email.length > 0) {
|
|
|
- this.EmailList = data.email
|
|
|
+ if (data.noticeSetting.email && data.noticeSetting.email.length > 0) {
|
|
|
+ this.EmailList = data.noticeSetting.email || []
|
|
|
this.noticeList.Email = true
|
|
|
}
|
|
|
- if (data.dChart.length > 0) {
|
|
|
- this.DChartList = data.email
|
|
|
+ if (data.noticeSetting.dChat && data.noticeSetting.dChat.length > 0) {
|
|
|
+ this.DChartList = data.noticeSetting.dChat || []
|
|
|
this.noticeList.DChart = true
|
|
|
}
|
|
|
- if (data.dChartGroup.length > 0) {
|
|
|
- this.GroupList = data.email
|
|
|
+ if (data.noticeSetting.dChatGroup && data.noticeSetting.dChatGroup.length > 0) {
|
|
|
+ this.GroupList = data.noticeSetting.dChatGroup || []
|
|
|
this.noticeList.Group = true
|
|
|
}
|
|
|
},
|
|
@@ -410,7 +411,7 @@ export default {
|
|
|
this.formData.noticeConditionList.splice(index, 1)
|
|
|
},
|
|
|
addMembers(list) { // 添加成员
|
|
|
- list.push({ type: 0, member: false, teamList: [], customStaffList: [] })
|
|
|
+ list.push({ types: 0, member: false, teams: [], customStaffs: [] })
|
|
|
},
|
|
|
removeMembers(list, index) { // 移除成员
|
|
|
list.splice(index, 1)
|
|
@@ -448,10 +449,10 @@ export default {
|
|
|
this.GroupList.splice(index, 1)
|
|
|
},
|
|
|
validate() { // 校验入参
|
|
|
- if (this.formData.requireOrientId.length < 1 && this.type === 'require') {
|
|
|
+ if (this.formData.requireOrientIdList.length < 1 && this.type === 'require') {
|
|
|
this.$message({ message: '请选择需求方向', type: 'error', duration: 1000, offset: 150 })
|
|
|
}
|
|
|
- if (this.formData.techModuleId.length < 1 && this.type === 'task') {
|
|
|
+ if (this.formData.techModuleIdList.length < 1 && this.type === 'task') {
|
|
|
this.$message({ message: '请选择技术方向', type: 'error', duration: 1000, offset: 150 })
|
|
|
}
|
|
|
if (!this.formData.clientId) {
|
|
@@ -465,17 +466,22 @@ export default {
|
|
|
}
|
|
|
this.formData.noticeSetting = {
|
|
|
email: this.noticeList.Email ? this.EmailList : [],
|
|
|
- dChart: this.noticeList.DChart ? this.DChartList : [],
|
|
|
- dChartGroup: this.noticeList.Group ? this.GroupList : []
|
|
|
+ dchat: this.noticeList.DChart ? this.DChartList : [],
|
|
|
+ dchatGroup: this.noticeList.Group ? this.GroupList : []
|
|
|
}
|
|
|
- this.addBizNoticeSetting()
|
|
|
+ this.data ? this.updateBizNoticeSetting() : this.addBizNoticeSetting()
|
|
|
},
|
|
|
async addBizNoticeSetting() { // 新增通知
|
|
|
const res = await addBizNoticeSetting(this.formData)
|
|
|
if (res.code === 200) {
|
|
|
- this.data
|
|
|
- ? this.$message({ message: '修改成功', type: 'success', duration: 1000, offset: 150 })
|
|
|
- : this.$message({ message: '添加成功', type: 'success', duration: 1000, offset: 150 })
|
|
|
+ this.$message({ message: '添加成功', type: 'success', duration: 1000, offset: 150 })
|
|
|
+ this.$emit('confirm')
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async updateBizNoticeSetting() { // 更新通知
|
|
|
+ const res = await updateBizNoticeSetting(this.formData)
|
|
|
+ if (res.code === 200) {
|
|
|
+ this.$message({ message: '修改成功', type: 'success', duration: 1000, offset: 150 })
|
|
|
this.$emit('confirm')
|
|
|
}
|
|
|
},
|