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.
79 lines
2.9 KiB
79 lines
2.9 KiB
4 years ago
|
define(function (require, exports, module) {
|
||
|
let BaseBiz = require('apps/rht/base/rhtBiz');
|
||
|
let rhtComm = require('../../comm/rhtComm');
|
||
|
var ScDateWindow = require('system/views/pages/scdatewindow/scdatewindow');
|
||
|
|
||
|
function Biz(vm) {
|
||
|
//继承第一步,构造继承
|
||
|
BaseBiz.call(this, vm);
|
||
|
}
|
||
|
|
||
|
//继承第二步,方法继承
|
||
|
inherits(Biz, BaseBiz);
|
||
|
|
||
|
let IsMulScDate = rhtComm.getRhtOptionValue("*",'SYS','SYS_IsMulScDate','0');
|
||
|
|
||
|
//增加右键菜单按钮并控制按钮状态
|
||
|
Biz.prototype.getContextMenus = function (ds, source) {
|
||
|
let menus = this.super("getContextMenus", ds, source);
|
||
|
if (ds.uiObjCode === this.dsDetail.uiObjCode) {
|
||
|
let edit = ds.getEditable();
|
||
|
if ((!edit) && (IsMulScDate =='1')){
|
||
|
let curBodyRow = this.dsDetail.currentRow;
|
||
|
let PluCode = curBodyRow ? TypeUtil.toString(curBodyRow['PluCode']) : '';
|
||
|
if (PluCode != ''){
|
||
|
menus.push({
|
||
|
text: '生产日期管理',
|
||
|
opCode: 'scdate',
|
||
|
disabled: false
|
||
|
});
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
return menus;
|
||
|
};
|
||
|
//按钮事件控制
|
||
|
Biz.prototype.doOp = function (opCode) {
|
||
|
let self = this;
|
||
|
if (opCode == 'scdate') {
|
||
|
let dhead = self.dsMaster;
|
||
|
let dbodyrow = self.dsDetail.currentRow;
|
||
|
this.onscdate(self, dhead,dbodyrow);
|
||
|
}
|
||
|
};
|
||
|
//生产日期信息按钮事件处理
|
||
|
Biz.prototype.onscdate = function (self, dhead, dbodyrow) {
|
||
|
let curRow = self.dsMaster.currentRow;
|
||
|
let YwType = curRow ? TypeUtil.toString(curRow['YwType']) : '*';
|
||
|
let DataStatus = curRow ? TypeUtil.toString(curRow['DataStatus']) : '0';
|
||
|
if (IsMulScDate !=='1'){
|
||
|
Store.messager.err("系统没有开启多生产日期管理,请先开启后再执行本操作!");
|
||
|
return false;
|
||
|
}
|
||
|
//定义窗口界面
|
||
|
let param = {
|
||
|
uiObjCode: self.dsMaster.funcCode,
|
||
|
billNo: dbodyrow.BillNo,
|
||
|
ywType: YwType,
|
||
|
toSerialNo: dbodyrow.SerialNo,
|
||
|
pluInf: dbodyrow.PluCode+'-'+dbodyrow.PluName,
|
||
|
recCount: dbodyrow.PlanDbCount,
|
||
|
biz: self,
|
||
|
pk: "BillNo,YwType,ToSerialNo,SerialNo",
|
||
|
fixQuery: {
|
||
|
'ToSerialNo': dbodyrow.SerialNo,
|
||
|
'BillNo': dbodyrow.BillNo,
|
||
|
'YwType': YwType
|
||
|
},
|
||
|
showCheckColumn: true,
|
||
|
isToEdit: (DataStatus ==='0'),
|
||
|
enablePager: false,
|
||
|
funcCode: self.FuncCode,
|
||
|
ds: dbodyrow
|
||
|
};
|
||
|
//new多选窗体 并打开
|
||
|
let myWindow = new ScDateWindow(param);
|
||
|
myWindow.open();
|
||
|
};
|
||
|
return Biz;
|
||
|
});
|