<style>
 @import url('../../assets/css/financia/ProcessList.css');
</style>
<template>
    <div class="flexOne page_ProcessList">
        <div class='query-box'>
			<ul>
                <li>
                    <label>公司名称</label>
                    <el-input v-model="msg.BName"  class="w210"></el-input>
                </li>
				<li>
                    <input type="button" class="hollowFixedBtn" :value="$t('pub.searchBtn')" @click="resetPageIndex(),getList()"/>
                </li>
			</ul>
        </div>
        <div>
            <div class="clearfix" v-loading='loading'>
                <table class="po_content singeRowTable" style="border:1px solid #E6E6E6;" cellspacing="0" cellpadding="0">
                    <tr>
                        <th>公司名称</th>
                        <th>标准流程</th>
                        <th>自定义流程</th>
                        <th>{{$t('system.table_operation')}}</th>
                    </tr>
                    <tr v-for="(item,index) in DataList">
                        <td>{{item.BName}}</td>
                        <td>{{item.IsSet}}</td>
                        <td>{{item.Num}}</td>
                        <td>
                            <el-tooltip class="item" effect="dark" :content="$t('pub.updateMsg')" placement="top">
                                <el-button type="primary" @click="goUrl('FProcessManagement',item.Branch_Id)" class="iconfont icon-menu-shezhi" circle></el-button>
                            </el-tooltip>
                        </td>
                    </tr>
                 </table>
            </div>
            <div class="noData" v-show="noData">
                {{$t('system.content_noData')}}
            </div> 
            <div>
                <el-pagination 
                    background
                    @current-change="handleCurrentChange" 
                    :current-page.sync="currentPage"
                    layout="total,prev, pager, next, jumper"
                    :page-size=msg.pageSize                         
                    :total=total>
                </el-pagination>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    data(){
        return{
            noData:false,
            total:0,
            currentPage:1,
            loading:true,
            msg:{
                PageIndex:1,
                pageSize:13,
                BNameL:'',
            },
            DataList:[],
        }
    },
    created(){

    },
    mounted(){
        this.getList();
    },
    methods:{
        getList(){ //获取列表
            this.loading = true
            this.apipost('FinancialFlowTemplate_post_GetListByBranch',this.msg,res=>{
                 if(res.data.resultCode==1){
                    this.total = res.data.data.count;
                    let data = res.data.data.pageData;                    
                    if(this.total>0){
                        this.noData =false;   
                    }else{
                        this.noData =true;   
                    }
                    this.DataList = data;
                    this.loading = false;
                }else{
                    this.$message.error(res.data.message)
                    this.loading = false;   
                }                            
            },err=>{})
        },
        goUrl(path,id){
            this.$router.push({name:path,query:{'Branch_Id':id}})
        },
        resetPageIndex() {//查询初始化页码
            this.msg.pageIndex = 1;
            this.currentPage = 1
        },
        handleCurrentChange(val) {//翻页功能按钮
            this.msg.pageIndex = val;
            this.getList();
        },
    }
}
</script>
