<template>
    <div class="borderless" v-loading="pageLoading">
        <div class="customer-head">
            <div class="customer-back">
                <el-button type="danger" style="border: none;background: none;color: red" icon="el-icon-arrow-left"
                           @click="backToList">返回列表
                </el-button>
            </div>
            <div class="add-customer-btn">
                <el-button  size="small" type="primary" style="margin-right: 8px"
                            :loading="saveLoading" @click="bigSavefun" >保 存
                </el-button>
            </div>
        </div>
        <div style="margin: 55px 5px 0px 5px;'">
            <el-card class="box-card">
                <accounts-dialog :form="form"></accounts-dialog>
            </el-card>
            <el-card class="box-card" style="margin-top: 10px">
                <accitemsopenblc :form="form" :crudData="form.accItemsOpenblcList"></accitemsopenblc>
            </el-card>
        </div>
    </div>
</template>

<script>
    import accountsDialog from "@/views/iosBasicData/accounts/assembly/accountsDialog.vue";
    import accitemsopenblc from "@/views/iosBasicData/accounts/assembly/accitemsopenblc.vue";
    import {accountsSubmit} from "@/api/iosBasicData/accounts";

    export default {
        components: {accountsDialog,accitemsopenblc},
        data(){
            return{
                pageLoading:false,
                saveLoading:false,
                form:{
                    accItemsOpenblcList:[]
                },

            }
        },
        methods:{
            // 大保存
            bigSavefun(){
                let sum = '请填写'
                if (!this.form.code) {
                    sum += '科目编码'
                }
                if (!this.form.cnName) {
                    sum += '科目名称'
                }
                if (!this.form.cnName) {
                    sum += '科目英文'
                }
                if (!this.form.dc) {
                    sum += '方向'
                }
                for(let i in this.form) {
                    if (!this.form[i] && this.form[i] != 0) {

                    }
                }
            },
            // 保存
            accountsSubmitfun(){
                console.log(this.form,46)
                // accountsSubmit().then(res=>{
                //
                // })
            },
            //返回列表
            backToList() {
                this.$emit('goBack')
            },
        }
    }
</script>

<style scoped>

</style>
