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.
59 lines
2.3 KiB
59 lines
2.3 KiB
define(function (require, exports, module) {
|
|
let BaseBiz = require('apps/rht/base/rhtBiz');
|
|
let rhtComm = require('../../comm/rhtComm');
|
|
/**
|
|
* 控制按钮的可用
|
|
* @param opCode 按钮编码
|
|
* @return [description]
|
|
*/
|
|
|
|
function Biz(vm) {
|
|
//继承第一步,构造继承
|
|
BaseBiz.call(this, vm);
|
|
vm.remark =''
|
|
}
|
|
|
|
//继承第二步,方法继承
|
|
inherits(Biz, BaseBiz);
|
|
Biz.prototype.getBillNoFieldName = function () {
|
|
};
|
|
//根据登录组织等拼装查询条件
|
|
Biz.prototype.beforeDataSrcSearch = function (dataSrc, params) {
|
|
let self = this;
|
|
self.setServerBiz('cn.qdhezheng.rht.app.cou.cou190101.SavePlugin');
|
|
};
|
|
//增加后
|
|
Biz.prototype.afterAdd = function () {
|
|
let masterRow = this.dsMaster.currentRow;
|
|
let InOrgCode = rhtComm.GetInOrgCode(Store.logOn.orgCode).message;
|
|
let sOrgType = rhtComm.GetOrgType(Store.logOn.orgCode);
|
|
if ((sOrgType == "1001") || (sOrgType == "1002")){
|
|
masterRow.setColumnValue('OrgCode', "*");
|
|
masterRow.setColumnValue('OrgName', "*");
|
|
masterRow.setColumnValue('InOrgCode', "*");
|
|
}
|
|
else{
|
|
masterRow.setColumnText('OrgCode', InOrgCode);
|
|
}
|
|
return true;
|
|
};
|
|
//保存前校验
|
|
Biz.prototype.beforeSave = function () {
|
|
let masterRow = this.dsMaster.currentRow;
|
|
if(masterRow){
|
|
let sCouCycleCode = masterRow ? TypeUtil.toString(masterRow['CouCycleCode']) : '';
|
|
if (sCouCycleCode.length > 0 ){
|
|
sCouCycleCode = sCouCycleCode.toUpperCase();
|
|
if (!((sCouCycleCode == "D") || (sCouCycleCode == "")
|
|
|| ((sCouCycleCode.length == 2) && (sCouCycleCode >= "W0") && (sCouCycleCode <= "W6"))
|
|
|| ((sCouCycleCode.length == 3) && (sCouCycleCode >= "M01") && (sCouCycleCode <= "M31")))){
|
|
Store.messager.err("循环盘点码非法,请参照说明设置。");
|
|
return false;
|
|
}
|
|
masterRow.setColumnValue('CouCycleCode', sCouCycleCode);
|
|
}
|
|
}
|
|
return this.super('beforeSave');
|
|
};
|
|
return Biz;
|
|
}); |