You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.5 KiB

4 years ago
define(function (require, exports, module) {
let BaseBiz = require('apps/rht/base/rhtBiz');
let rhtComm = require('apps/rht/comm/rhtComm');
let Service = require('./bas0403service');
/**
* 控制按钮的可用
* @param opCode 按钮编码
* @return [description]
*/
function Biz(vm) {
//继承第一步,构造继承
BaseBiz.call(this, vm);
vm.remark = ''
}
//继承第二步,方法继承
inherits(Biz, BaseBiz);
Biz.prototype.initCompleted = function () {
this.super('initCompleted');
let self = this;
self.dsMaster.defaultOrder='TaxType';
this.dsMaster.serverBiz = 'basTaxBiz'
};
Biz.prototype.beforeSave = function () {
let curRow = this.dsMaster.currentRow;
if (curRow) {
let taxType = curRow.TaxType;
let taxRate = curRow.TaxRate;
if (taxType==='X' && taxRate > 100){
Store.messager.tip('销项税率不能大于100请重新设置');
return false;
}
if(this.getState() === 'add') {
let ret = Service.getSlideMenuData("TaxCheck", "CheckTaxExist", taxType, taxRate, "", "", "", "");
if (ret.result !== 1) {
Store.messager.tip(ret.message);
return false;
}
}
}
return this.super('beforeSave');
}
return Biz;
});