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