|
@@ -2,22 +2,13 @@
|
|
|
<a-card class="back-card">
|
|
|
<!-- 编辑 -->
|
|
|
<a-button
|
|
|
- v-if="$api.btnPms && !isEdit"
|
|
|
+ v-if="$api.btnPms"
|
|
|
class="mr-24"
|
|
|
slot="extra"
|
|
|
type="primary"
|
|
|
@click="doEdit()" >
|
|
|
{{ $t('global-btn.edit') }}
|
|
|
</a-button>
|
|
|
- <!-- 保存 -->
|
|
|
- <a-button
|
|
|
- v-if="$api.btnPms && isEdit"
|
|
|
- class="mr-24"
|
|
|
- slot="extra"
|
|
|
- type="primary"
|
|
|
- @click="doSave()">
|
|
|
- {{ $t('global-btn.save') }}
|
|
|
- </a-button>
|
|
|
<div class="pad-12">
|
|
|
<a-form layout="inline">
|
|
|
<a-row :gutter="24">
|
|
@@ -94,73 +85,19 @@
|
|
|
<!-- 产品工程师 -->
|
|
|
<a-col :xl="6" :lg="8" :md="12" :sm="24" :xs="24">
|
|
|
<a-form-item :label="$t('workbench.product-engineer')">
|
|
|
- <span v-if="!isEdit" class="ml8">{{ baseInfo.productEngineer }}</span>
|
|
|
- <a-select
|
|
|
- v-else
|
|
|
- class="select-width"
|
|
|
- v-model="productEngineer"
|
|
|
- :filter-option="filterOption"
|
|
|
- :options="engineerList"
|
|
|
- :placeholder="$t('workbench.please-enter-product-engineer')"
|
|
|
- showSearch
|
|
|
- @change="changeProductEngineer"
|
|
|
- >
|
|
|
- <a-icon slot="suffixIcon" type="search"/>
|
|
|
- <a-select-option
|
|
|
- v-for="item in engineerList"
|
|
|
- :key="item.productEngineerId"
|
|
|
- >
|
|
|
- {{ item.name }}
|
|
|
- </a-select-option>
|
|
|
- </a-select>
|
|
|
+ <span class="ml8">{{ baseInfo.owner }}</span>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
<!-- 材料工程师 -->
|
|
|
<a-col :xl="6" :lg="8" :md="12" :sm="24" :xs="24">
|
|
|
<a-form-item :label="$t('workbench.material-engineer')">
|
|
|
- <span v-if="!isEdit" class="ml8">{{ baseInfo.materialsEngineer }}</span>
|
|
|
- <a-select
|
|
|
- v-else
|
|
|
- class="select-width"
|
|
|
- v-model="materialEngineer"
|
|
|
- :filter-option="filterOption"
|
|
|
- :options="engineerList"
|
|
|
- :placeholder="$t('workbench.please-enter-material-engineer')"
|
|
|
- showSearch
|
|
|
- @change="changeMaterialEngineer"
|
|
|
- >
|
|
|
- <a-icon slot="suffixIcon" type="search"/>
|
|
|
- <a-select-option
|
|
|
- v-for="item in engineerList"
|
|
|
- :key="item.materialsEngineerId"
|
|
|
- >
|
|
|
- {{ item.name }}
|
|
|
- </a-select-option>
|
|
|
- </a-select>
|
|
|
+ <span class="ml8">{{ baseInfo.materialsEngineer }}</span>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
- <!-- 零部件工程师 -->
|
|
|
+ <!-- 试验工程师 -->
|
|
|
<a-col :xl="6" :lg="8" :md="12" :sm="24" :xs="24">
|
|
|
<a-form-item :label="$t('workbench.parts-engineer')">
|
|
|
- <span v-if="!isEdit" class="ml8">{{ baseInfo.partEngineer }}</span>
|
|
|
- <a-select
|
|
|
- v-else
|
|
|
- class="select-width"
|
|
|
- v-model="partsEngineer"
|
|
|
- :filter-option="filterOption"
|
|
|
- :options="engineerList"
|
|
|
- :placeholder="$t('workbench.please-enter-parts-engineer')"
|
|
|
- showSearch
|
|
|
- @change="changePartsEngineer"
|
|
|
- >
|
|
|
- <a-icon slot="suffixIcon" type="search"/>
|
|
|
- <a-select-option
|
|
|
- v-for="item in engineerList"
|
|
|
- :key="item.partEngineerId"
|
|
|
- >
|
|
|
- {{ item.name }}
|
|
|
- </a-select-option>
|
|
|
- </a-select>
|
|
|
+ <span class="ml8">{{ baseInfo.testEngineer }}</span>
|
|
|
</a-form-item>
|
|
|
</a-col>
|
|
|
</a-row>
|
|
@@ -188,19 +125,13 @@ export default {
|
|
|
return {
|
|
|
dvpId: undefined, //dvpId
|
|
|
baseInfo: {}, //基本信息
|
|
|
- isEdit: false, // 编辑标识
|
|
|
productEngineer: undefined, // 产品工程师
|
|
|
materialEngineer: undefined, // 材料工程师
|
|
|
- partsEngineer: undefined, // 零件工程师
|
|
|
- productEngineerId: undefined, // 产品工程师Id
|
|
|
- materialsEngineerId: undefined, // 材料工程师Id
|
|
|
- partsEngineerId: undefined, // 零件工程师Id
|
|
|
- engineerList: [] // 工程师字典
|
|
|
+ partsEngineer: undefined // 零件工程师
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
|
this.initBaseInfo();
|
|
|
- this.getEngineer();
|
|
|
},
|
|
|
methods: {
|
|
|
//获取基本信息
|
|
@@ -217,62 +148,15 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 保存
|
|
|
- doSave() {
|
|
|
- console.log(this.baseInfo.materialsEngineerId)
|
|
|
- //基本信息保存请求参数-目前只能更改工程师
|
|
|
- let basicInfoData = {
|
|
|
- dvpId: this.$store.getters.dvpId,
|
|
|
- productEngineerId: this.productEngineerId,
|
|
|
- materialsEngineerId: this.materialEngineerId ,
|
|
|
- partEngineerId: this.partsEngineerId,
|
|
|
- dvpType: 2,
|
|
|
- };
|
|
|
- //保存基本信息-工程师
|
|
|
- this.$api.updateDvpBasicInformation(basicInfoData).then(res => {
|
|
|
- if (res.flag) {
|
|
|
- this.$message.success(this.$t('plan.dvp.operation-succeeded'), 1);
|
|
|
- this.initBaseInfo();
|
|
|
- this.isEdit = !this.isEdit;
|
|
|
- } else{
|
|
|
- this.$message.error(this.$t('plan.dvp.operation-failed'), 1);
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
// 编辑
|
|
|
doEdit() {
|
|
|
+ let isOwner = this.baseInfo.isOwner;
|
|
|
let infoUrl = '/dvp/componentsDVP/edit?dvpId='
|
|
|
+ this.$route.query.dvpId
|
|
|
- + '&lookFlag=2';
|
|
|
+ + '&lookFlag=2'
|
|
|
+ + '&isOwner=' + isOwner;
|
|
|
let backUrl = this.$api.fmUrl + '/#' + infoUrl
|
|
|
window.open(backUrl, '_top')
|
|
|
- },
|
|
|
- //获取工程师下拉选项
|
|
|
- getEngineer(){
|
|
|
- this.$api.getAllUsers().then(res => {
|
|
|
- if (res.flag) {
|
|
|
- let userList = res.data;
|
|
|
- userList.forEach(item => {
|
|
|
- let options = {
|
|
|
- label: item.fullname, //后端返回的不是驼峰命名,所以这样写
|
|
|
- value: item.userId
|
|
|
- };
|
|
|
- this.engineerList.push(options);
|
|
|
- });
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- // 产品工程师下拉选项变换时
|
|
|
- changeProductEngineer(value) {
|
|
|
- this.productEngineerId = value;
|
|
|
- },
|
|
|
- // 材料工程师下拉选项变换时
|
|
|
- changeMaterialEngineer(value) {
|
|
|
- this.materialEngineerId = value;
|
|
|
- },
|
|
|
- // 零部件工程师下拉选项变换时
|
|
|
- changePartsEngineer(value) {
|
|
|
- this.partsEngineerId = value;
|
|
|
},
|
|
|
// 下拉选项过滤
|
|
|
filterOption(input, option) {
|