info.js 1.75 KB


'use strict';
var $ = require('jquery'),
    common=require('../common/common');


    if($("#status").val()==="200"){
        $(".btn-return").add(".btn-submit").show();
    }else{
        $(".btn-return").add(".btn-submit").remove();
    }

    var Bll={
        toast:function(content,fn){
            common.dialog.confirm("温馨提示",content,function(){
                common.util.__ajax({
                    url:'/supplier/index/status',
                    data:fn()
                },function(){
                    history.go(-1);
                });
            });
        },
        model:function(datas){
            var _deform={
                id:$("#id").val(),
                status:$("#status").val(),
                operations:$("#operations").val()
            }
            for(var key in datas){
                _deform[key]=datas[key];
            }
            return _deform
        }
    }
    //提交操作
    $(document).on('click', '.btn-submit', function() {
        Bll.toast("确定要审核通过吗?",function(){
            return Bll.model({status:300,operations:2});
        });
    });
    //提交驳回
    $(document).on('click', '.btn-return', function() {
        Bll.toast("确定要驳回审核吗?",function(){
            return Bll.model({status:900});
        });
    });
    //冻结操作
    $(document).on('click', '.btn-freeze', function() {
        Bll.toast("确定要冻结审核吗?",function(){
            return Bll.model({isFreeze:"Y",operations:3});
        });
    });

    //解冻操作
    $(document).on('click', '.btn-recovery', function() {
        var that = this;
        Bll.toast("确定要解冻审核吗?",function(){
            return Bll.model({isFreeze:"N",operations:4});
        });
    });