<script setup>
|
import glass from './pages/Glass.vue'
|
import Interlayer from './pages/Interlayer.vue'
|
import Hollow from './pages/Hollow.vue'
|
import Process from './pages/Process.vue'
|
import {onMounted, ref} from "vue";
|
import request from "@/utils/request";
|
import {ElMessage} from "element-plus";
|
import {useRouter,useRoute} from "vue-router"
|
import {useI18n} from "vue-i18n";
|
const { t } = useI18n()
|
let BasicData = ref({
|
stuffColor:null,
|
stuffCraft:null,
|
stuffLowE:null,
|
stuffPosition:null,
|
stuffThickness:null,
|
//夹层数据
|
InterlayerType:null,
|
InterlayerThickness:null,
|
InterlayerColor:null,
|
//中空数据
|
hollowGasType:null,
|
hollowGlueDepth:null,
|
hollowThickness:null,
|
hollowType:null,
|
//流程
|
process:null
|
|
})
|
let tabsValue = ref(1)
|
const router = useRouter()
|
const route = useRoute()
|
|
onMounted( async () => {
|
await request.get(`/basicData/BasicDataByType/product`).then((res) => {
|
if(res.code==200){
|
BasicData.value = res.data
|
}else{
|
ElMessage.warning(res.msg)
|
}
|
})
|
})
|
|
const getChild = (value) =>{
|
for (let key in value) {
|
if(!value[key]){
|
ElMessage.warning(t('glassPrice.msg.error1'))
|
return
|
}
|
}
|
|
request.post(`/glassPriceBasic/save`,value).then((res) => {
|
if(res.code==='200' && res.data===true){
|
ElMessage.success(t('glassPrice.msg.success'))
|
router.push({path:'/main/glassPrice/glassPriceList'})
|
}else{
|
ElMessage.warning(t('glassPrice.msg.error1'))
|
}
|
})
|
}
|
|
</script>
|
|
<template>
|
<div id="main-div">
|
<el-tabs v-model="tabsValue" type="border-card" style="width: 100%;height: 100%">
|
<el-tab-pane :name="1" :label="t('glassPrice.glass')" >
|
<glass @getChild="getChild" v-if="tabsValue===1" :basicData="BasicData"/>
|
</el-tab-pane>
|
<el-tab-pane :name="2" :label="t('glassPrice.interlayer')">
|
<interlayer @getChild="getChild" v-if="tabsValue===2" :basicData="BasicData"/>
|
</el-tab-pane>
|
<el-tab-pane :name="3" :label="t('glassPrice.hollow')">
|
<hollow @getChild="getChild" v-if="tabsValue===3" :basicData="BasicData"/>
|
</el-tab-pane>
|
<el-tab-pane :name="4" :label="t('glassPrice.process')">
|
<process @getChild="getChild" v-if="tabsValue===4" :basicData="BasicData"/>
|
</el-tab-pane>
|
</el-tabs>
|
</div>
|
</template>
|
|
<style scoped>
|
#main-div{
|
width: 100%;
|
height: 100%;
|
}
|
:deep(.el-tabs__content) {
|
width: 100%;
|
}
|
.el-tab-pane{
|
width: 100%;
|
height: 100%;
|
}
|
|
</style>
|