<template>
    <div class="app-container" v-loading="allLoading">
        <el-card class="userInfo_box">
            <el-tabs v-model="activeName" @tab-click="handleClick">
                <el-tab-pane label="异地个账撤销" name="1">
                    <el-form ref="form" :model="form" label-width="100px">
                        <el-form-item label="地纬账号">
                            <el-input v-model="form.dw_user"></el-input>
                        </el-form-item>
                        <el-form-item label="订单号">
                          <el-input v-model="form.order_id"></el-input>
                        </el-form-item>
                        <el-form-item label="社保机构编号">
                       <el-input v-model="form.social_code"></el-input>
                        </el-form-item>
                        <el-form-item label="身份证号">
                            <el-input v-model="form.id_card"></el-input>
                        </el-form-item>
                            <el-form-item label="退款金额">
                            <el-input v-model="form.refund_money"></el-input>
                        </el-form-item>
                             <el-form-item label="姓名">
                            <el-input v-model="form.name"></el-input>
                        </el-form-item>
                      
                        <el-form-item>
                            <el-button type="primary" @click="onSubmit">确定</el-button>
                            <el-button>取消</el-button>
                        </el-form-item>
                    </el-form>
                </el-tab-pane>
                <el-tab-pane label="二维码个账撤销" name="2">
                    <el-form ref="formEWM" :model="formEWM" label-width="100px">
                         <el-form-item label="地纬账号">
                            <el-input v-model="formEWM.dw_user"></el-input>
                        </el-form-item>
                        <el-form-item label="二维码">
                          <el-input v-model="formEWM.ewm"></el-input>
                        </el-form-item>
                        <el-form-item label="结算号ID">
                       <el-input v-model="formEWM.jsh_id"></el-input>
                        </el-form-item>
                        <el-form-item>
                            <el-button type="primary" @click="onSubmitEWM">确定</el-button>
                            <el-button>取消</el-button>
                        </el-form-item>
                    </el-form>
                </el-tab-pane>
            </el-tabs>
        </el-card>

        <!-- 读卡弹窗 -->
     
    </div>
</template>
<script>
import {  destroy_ewm_gz,destroy_yd_gz } from '@/api/mz'

export default {
    name: 'Outpatient',
    components: {
  
   
    },
    data() {
        return {
            allLoading:false,
            activeName: '1',
            form: {
                name: '',
                refund_money: '',
                id_card: '',
                social_code: '',
                order_id: '',
                dw_user: '',
              
            },
            formEWM: {
                jsh_id: '',
                ewm: '',
                dw_user: '',
               
            },
        }
    },
    mounted() {},
    created() {},
    methods: {
        handleClick(tab, event) {
            console.log(tab, event)
        },
        onSubmit() {
            this.allLoading = true
                   destroy_yd_gz(this.form)
                .then(response => {
                  this.$message({
                        message: '成功撤销！',
                        type: 'success',
                    })
                })
                .catch(e => {
                    this.$message({
                        message: e.message,
                        type: 'error',
                    })
                })
                .finally(() => {
                     this.allLoading = false
                })
            console.log('submit!')
        },
        onSubmitEWM() {
             this.allLoading = true
                   destroy_ewm_gz(this.formEWM)
                .then(response => {
                      this.$message({
                        message: '成功撤销！',
                        type: 'success',
                    })
                })
                .catch(e => {
                    this.$message({
                        message: e.message,
                        type: 'error',
                    })
                })
                .finally(() => {
                     this.allLoading = false
                })
            console.log('submit!')
        },
    },
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped></style>
