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.1 KiB

4 years ago
define(function (require, exports, module) {
let BaseBiz = require('apps/rht/base/rhtBiz');
let rhtComm = require('../../comm/rhtComm');
let DataCartWin = require('system/views/pages/data-cart-win/data-cart-win')
function Biz(vm) {
//继承第一步,构造继承
BaseBiz.call(this, vm);
vm.remark =''
}
//继承第二步,方法继承
inherits(Biz, BaseBiz);
//字段变化触发事件
Biz.prototype.fieldChanged = function (dataSrc, dr, dc) {
if (dataSrc.uiObjCode === this.dsMaster.uiObjCode) {
switch (dc.fieldName) {
case 'PluCode':
this.fieldChangedPluCode(dataSrc, dr, dc);
break;
}
}
this.super('fieldChanged');
};
//PluCode 字段变化执行事件
Biz.prototype.fieldChangedPluCode = function (dataSrc, dr, dc) {
let sPluCode = dr ? TypeUtil.toString(dr['PluCode']) : '';
let sKeyNo = dr ? TypeUtil.toString(dr['KeyNo']) : '';
//如果选项【电子秤商品设置键值默认方式】设置为1在键值为空的时候将键值赋值为商品编码
//如果键值已经有值,商品编码改变不再对键值作出改变。
let FRS_BalPluDefMode = rhtComm.getRhtOptionValue('*','FRS','FRS_BalPluDefMode','0');
dr.setColumnText('PluNo', sPluCode);
if ((FRS_BalPluDefMode == "1") && (sKeyNo.length <= 0)){
dr.setColumnText('KeyNo', sPluCode);
}
return true;
};
Biz.prototype.doOp = function(opCode) {
this.super('doOp', opCode)
if (opCode === 'batch') {
let win = new DataCartWin({
funcCode: this.funcCode,
leftObjCode: this.dsWeighter.uiObjCode,
rightObjCode: this.dsPlu.uiObjCode,
completed: function(weigterRows, pluRows) {
console.log(weigterRows)
console.log(pluRows)
}
})
win.open()
}
}
return Biz;
});