中航光电热表web
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

157 lines
3.7 KiB

9 months ago
<template>
<el-dialog
title="零件信息"
v-model="setCrewShow"
:before-close="cancel"
fullscreen
@opened="opened"
>
7 months ago
<div class="tabs-container">
3 weeks ago
<!-- <div class="version-info">
<span class="version-label">工艺版本{{ partVersion || '-' }}</span>
3 weeks ago
</div> -->
7 months ago
<el-tabs v-if="setCrewShow" v-model="activeName" @tab-click="handleClick">
<!-- 零件信息-->
<el-tab-pane label="零件信息" name="1">
<dsPartBasicInfo
ref="dsPartRef"
v-if="activeName == '1'"
:part-id="partId"
@cancelClose="cancelClose"
:dialogType="dialogType"
:partType="partType"
:dsPartInfo="dsPartInfo"
@updateVersion="updateVersion"
:updateRow="updateRow"
/>
7 months ago
</el-tab-pane>
<!-- 子件信息 -->
<el-tab-pane label="工艺编制" name="2">
<!-- 工艺编制 -->
<processPlanning
ref="craftEdit"
v-if="activeName == '2'"
:part-id="partId"
:dialogType="dialogType"
:updateRow="updateRow"
></processPlanning>
7 months ago
</el-tab-pane>
</el-tabs>
<!-- <div class="content-right">
<p>工艺版本{{partVersion}}</p>
</div> -->
7 months ago
</div>
9 months ago
6 months ago
<template #footer v-if="activeName == '1'">
9 months ago
<div class="dialog-footer">
<el-button @click="cancel()">取消</el-button>
<el-button type="primary" @click="submit()" :loading="submitLoading"> 确认 </el-button>
9 months ago
</div>
</template>
</el-dialog>
</template>
<script>
import dsPartBasicInfo from './dsPartBasicInfo.vue';
import processPlanning from './processPlanning.vue';
6 months ago
9 months ago
export default {
name: 'DsPartIndex',
components: {
dsPartBasicInfo,
processPlanning,
9 months ago
},
props: {
partType: {
type: String,
default: '',
},
isOpen: {
type: Boolean,
default: false,
9 months ago
},
partId: {
7 months ago
type: [Number, String],
default: null,
8 months ago
},
7 months ago
dialogType: {
8 months ago
type: String,
default: '',
6 months ago
},
updateRow: {
type: Object,
default: {},
},
9 months ago
},
data() {
return {
4 months ago
submitLoading: false,
9 months ago
setCrewShow: false,
6 months ago
activeName: '1',
dsPartInfo: {},
partVersion: '', //
9 months ago
};
},
methods: {
updateVersion(value) {
this.partVersion = value;
},
9 months ago
opened() {
6 months ago
// this.getPartDetails()
8 months ago
// if (this.partId) {
// this.$refs.dsPartRef.loadData(this.partId);
// }
9 months ago
},
handleClick(tab, event) {
if (tab.name === '1') {
// this.$refs.dsPartRef.loadData(this.partId);
} else if (tab.name === '2') {
// this.$refs.partSubRef.getData(this.partId, true);
}
},
partSubRefLoad() {
this.$refs.partSubRef.loadData(this.partId, true);
},
cancelClose(flag, dsPart) {
this.submitLoading = false;
9 months ago
if (flag) {
this.cancel(true);
} else {
this.partId = dsPart.partId;
}
},
cancel(refresh) {
this.activeName = '1';
// this.$refs.dsPartRef.clear();
this.setCrewShow = false;
9 months ago
this.$emit('cancel', typeof refresh === 'boolean' && refresh);
6 months ago
},
submit() {
if (this.activeName == '1') {
2 months ago
// this.submitLoading = true;
this.$refs.dsPartRef.submit();
6 months ago
}
},
9 months ago
},
mounted() {
this.setCrewShow = this.isOpen;
console.log('弹框页', this.dialogType);
},
9 months ago
};
</script>
7 months ago
<style lang="scss" scoped>
.tabs-container {
position: relative;
}
.version-info {
width: 50%;
7 months ago
position: absolute;
right: 0;
top: 10px;
7 months ago
/* 或者使用 flex: 0 0 200px; 根据需要调整宽度 */
.version-label{
float: right;
}
7 months ago
}
</style>