supplier.Info.js 1.81 KB
webpackJsonp([177],[
/* 0 */
/***/ function(module, exports, __webpack_require__) {

	'use strict';
	var $ = __webpack_require__(1),
	    common = __webpack_require__(2);

	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 () {
	                setTimeout(function () {
	                    history.go(-1)
	                }, 1000);
	            });
	        });
	    },
	    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});
	    });
	});
	//提交驳回
	$(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});
	    });
	});




/***/ }
]);