|
@@ -114,16 +114,23 @@
|
|
|
<!-- 需求负责人 -->
|
|
|
<a-col :xl="12" :lg="8" :md="12" :sm="24" :xs="24">
|
|
|
<a-form-item :label="$t('base.info.requirement.owner')">
|
|
|
- <span v-if="!isEdit" class="ml8">{{ ownerName }}</span>
|
|
|
+ <span v-if="!isEdit" class="ml8">{{ baseInfo.owner }}</span>
|
|
|
<a-select
|
|
|
v-else
|
|
|
class="select-width"
|
|
|
- v-model="baseInfo.owner"
|
|
|
+ v-model="owner"
|
|
|
:filter-option="filterOption"
|
|
|
- :options="requirementOwnerList"
|
|
|
:placeholder="$t('base.info.please-choose-owner')"
|
|
|
- showSearch>
|
|
|
+ showSearch
|
|
|
+ @change="changeOwner"
|
|
|
+ >
|
|
|
<a-icon slot="suffixIcon" type="search"/>
|
|
|
+ <a-select-option
|
|
|
+ v-for="item in requirementOwnerList"
|
|
|
+ :key="item.userId"
|
|
|
+ >
|
|
|
+ {{ item.fullname }}
|
|
|
+ </a-select-option>
|
|
|
</a-select>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
@@ -155,7 +162,6 @@ export default {
|
|
|
isEdit: false, // 编辑标识
|
|
|
owner: undefined, // 责任人
|
|
|
requirementOwnerList: [], // 责任人字典
|
|
|
- ownerName: undefined
|
|
|
};
|
|
|
},
|
|
|
created() {},
|
|
@@ -173,7 +179,6 @@ export default {
|
|
|
_that.$api.initDvpBasicInformation(data).then(res =>{
|
|
|
if (res.flag){
|
|
|
_that.baseInfo = res.data;
|
|
|
- _that.ownerName = res.data.owner;
|
|
|
//处理"年",只显示年份不显示后面日期与时间
|
|
|
if (_that.baseInfo.year){
|
|
|
_that.baseInfo.year = _that.baseInfo.year.slice(0,4)
|
|
@@ -192,23 +197,21 @@ export default {
|
|
|
getRequirementOwner(){
|
|
|
this.$api.getAllUsers().then(res =>{
|
|
|
if (res.flag){
|
|
|
- let userList = res.data;
|
|
|
- userList.forEach(item =>{
|
|
|
- let options = {
|
|
|
- label: item.fullname, //后端返回的不是驼峰命名,所以这样写
|
|
|
- value: item.userId
|
|
|
- };
|
|
|
- this.requirementOwnerList.push(options);
|
|
|
- });
|
|
|
+ this.requirementOwnerList = res.data;
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.message, 1);
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
// 保存
|
|
|
doSave() {
|
|
|
+ if (!this.owner) {
|
|
|
+ return this.$message.warning(this.$t('base.info.please-choose-owner'), 1);
|
|
|
+ }
|
|
|
//基本信息保存请求参数-目前只能更改需求负责人
|
|
|
let basicInfoData = {
|
|
|
dvpId: this.$store.getters.dvpId,
|
|
|
- ownerId: this.baseInfo.owner,
|
|
|
+ ownerId: this.owner,
|
|
|
dvpType: 0,
|
|
|
};
|
|
|
//保存基本信息-需求负责人
|
|
@@ -225,6 +228,10 @@ export default {
|
|
|
// 编辑
|
|
|
doEdit() {
|
|
|
this.isEdit = true;
|
|
|
+ },
|
|
|
+ // 责任人下拉选项变换时
|
|
|
+ changeOwner(value, options) {
|
|
|
+ this.owner = options ? options.data.key : undefined;
|
|
|
},
|
|
|
// 下拉选项过滤
|
|
|
filterOption(input, option) {
|