| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <template>
- <div>
- <el-button type="primary" size="small" @click="drawer=true">
- {{$t(`新建`)}}
- </el-button>
- <el-drawer
- :title="$t(`新建减速箱`)"
- :visible.sync="drawer"
- :wrapperClosable="false"
- size="664px"
- direction="rtl"
- append-to-body
- :show-close="false">
- <div class="drawer__panel">
- <customForm ref="form" formname="form" v-if="drawer"></customForm>
- </div>
- <div class="fixed__btn__panel">
- <el-button size="small" @click="drawer = false" class="normal-btn-width">{{$t(`取 消`)}}</el-button>
- <el-button size="small" type="primary" @click="onSubmit" :loading="loading" class="normal-btn-width">{{$t(`确 定`)}}</el-button>
- </div>
- </el-drawer>
- </div>
- </template>
- <script>
- import customForm from '@/components/customForm/customForm'
- import {mapGetters} from "vuex";
- export default {
- components:{customForm},
- data () {
- return {
- drawer:false,
- type:'',
- valvetype:''
- }
- },
- computed:{
- ...mapGetters({
- loading:'loading'
- })
- },
- watch: {
- },
- methods:{
- onSubmit () {
- this.$refs.form.validateFields(()=>{
- if (this.$refs.form.form.maxsquarewidth) {
- this.$refs.form.form.maxsquarewidth = [this.$refs.form.form.maxsquarewidth]
- } else {
- this.$refs.form.form.maxsquarewidth = []
- }
- this.$store.commit('setLoading',true)
- this.$api.requested({
- id:20240615135802,
- content: this.$refs.form.form
- }).then(res=>{
- this.tool.showMessage(res,() => {
- this.$store.dispatch('changeDetailDrawer',true)
- this.$router.push({path:'/speedBoxDetail',query:{id:res.data.itemid,rowindex:res.data.rowindex}})
- this.drawer = false
- this.$emit('onSuccess',res.data)
- })
- this.$store.commit('setLoading',false)
- })
- })
- },
- },
- }
- </script>
- <style scoped>
- .dialog-footer{
- margin-top:32px;
- text-align: center;
- }
- </style>
|