电核.php 6.93 KB
<?php $this->load->view('common/header'); ?>

<body>
    <div class="cl pd-5 bg-1">
        <span class="l">
            <button class="btn btn-primary radius" onclick="loadIframe('<?=site_url('work/check/6/'.$id)?>', '录入信用报告');">录入信用报告</button>
            <button class="btn btn-primary radius" onclick="loadIframe('<?=site_url('work/check/7/'.$id)?>', '网查筛查');">网查筛查</button>
            <button class="btn btn-primary radius" onclick="loadIframe('<?=site_url('work/check/8/'.$id)?>', '电核');">电核</button>
            <button class="btn btn-primary radius" onclick="loadIframe('<?=site_url('work/check/9/'.$id)?>', '受理意见');">受理意见</button>
        </span>
    </div>

    <div id="tab" class="HuiTab">
        <div class="tabBar clearfix" style="background-color:#e8e8e8">
            <span>电核结果</span>
            <span>电核记录</span>
        </div>

        <div class="tabCon">
            <form action="" id="form1">
                <input type="hidden" name="orderId" value="<?=$id?>">
                <?php $this->load->view('/work/审批/电核结果'); ?>
            </form>
        </div>

        <?php $record = api('/audit/phoneAudit/record/'.$id); ?>
        <div class="tabCon pb-20">
            <div class="cl pd-5 bg-1">
                <span class="r">
                    <button class="btn btn-primary radius" onclick="add()">
                        <i class="Hui-iconfont">&#xe6df;</i> 添加
                    </button>
                </span>
            </div>
            <table class="table table-border table-bordered table-bg">
                <thead class="text-c">
                    <tr>
                        <th>ID</th>
                        <th>电核时间</th>
                        <th>是否拨通</th>
                        <th>电核人</th>
                        <th>备注</th>
<!--                        <th width="70px">操作</th>-->
                    </tr>
                </thead>
                <tbody class="text-c">
                    <tr v-for="record in records">
                        <td>{{record.id}}</td>
                        <td>{{record.phoneAuditTime | formatDate}}</td>
                        <td>{{record.hasPutThrough}}</td>
                        <td>{{record.phoneAuditEmployee}}</td>
                        <td>{{record.remark}}</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>

    <div class="row cl pb-20 col-sm-12">
        <div class="col-sm-offset-3 col-sm-2">
            <button class="btn btn-warning btn-block">退回订单</button>
        </div>
        <!--<div class="col-sm-2">
            <button class="btn btn-danger btn-block" onclick="refuse()">拒绝</button>
        </div>-->
        <div class="col-sm-2">
            <button class="btn btn-primary btn-block" onclick="pass()">通过</button>
        </div>
    </div>

    <?php $this->load->view('common/footer'); ?>

    <script>
        var vm = new Vue({
            el: '#tab',
            data: {
                clientInfoOutputVO: {},
                clientContactOutputVOS: {},
                orderVO: {},
                records: [],
                use: [],
                nature: [],
            },
            mounted () {
                this.getRecords();
                this.getClient();
                this.getUse();
                this.getNature();
            },
            methods: {
                getRecords () {
                    let _this = this;
                    instance.get('/audit/phoneAudit/record/<?=$id?>').then( ( {data} ) => {
                        this.records = data.data.reverse();
                    });
                },
                getClient () {
                    let _this = this;
                    instance.get('order/detail/<?=$id?>').then( ( {data} ) => {
                        console.log(data);
                        this.clientInfoOutputVO = data.data.clientInfoOutputVO;
                        this.orderVO = data.data.orderVO;
                        this.clientContactOutputVOS = data.data.clientContactOutputVOS;
                    });
                },
                getUse () {
                    let _this = this;
                    instance.get('dueDiligence/enum/loanPurpose').then( ( {data} ) => {
                        this.use = data.data;
                    });
                },
                getNature () {
                    let _this = this;
                    instance.get('/enum/loan/nature').then( ( {data} ) => {
                        this.nature = data.data;
                    });
                }
            },
            filters: {
                shengxiao(birthDate){
                    let yyyy = new Date(birthDate).getFullYear();
                    var arr=['猴','鸡','狗','猪','鼠','牛','虎','兔','龙','蛇','马','羊'];
                    return /^\d{4}$/.test(yyyy)?arr[yyyy%12]:null;
                }
            }
        });

        function getQueryString(name) {
            var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
            var r = window.location.search.substr(1).match(reg);
            if (r != null) return unescape(r[2]); return null;
        }

        var index = getQueryString('tab');

        $("#tab").Huitab({index: index});

        function add() {
            layer.open({
                type: 2,
                title: '电核记录',
                shadeClose: true,
                area: ['800px', '400px'],
                content: '<?=site_url('work/telAdd/'.$id)?>'
            });
        }

        function refuse() {
            layer.open({
                type: 2,
                title: '电核记录',
                shadeClose: true,
                area: ['800px', '400px'],
                content: '<?=site_url('work/telRefuse')?>'
            });
        }

        function pass() {
            var data = $("#form1").serializeJson();
            var url = '<?=site_url('/work/check/9/' . $id);?>';
            $.ajax({
                type: 'post',
                url: apiBaseUrl + 'audit/phoneAudit',
                cache: false,
                data: JSON.stringify(data),
                dataType: 'json',
                contentType: "application/json; charset=UTF-8",
                success: function (data) {
                    if (data.msg) {
                        layer.alert(data.msg);
                    } else if (data.code != 0) {
                        layer.alert('操作失败');
                    } else {
                        layer.alert('操作成功');
                    }
                    if(!data.code){
                        setTimeout(function () {
                            loadIframe(url, '审核意见');
                        }, 500)
                    }
                },
                error: function () {
                    layer.alert("操作失败")
                }
            })
        }
    </script>
</body>
</html>