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.

91 lines
3.3 KiB

4 years ago
define(function(require, exports, module) {
let Window = require('system/views/pages/window');
let tpl = require('text!apps/rht/stk/stk180614/myedit.tpl');
let Service = require('./stk180614service');
function MyEdit(DataA, DataB) {
this.options = {
title: "批次调整",
content: tpl,
width: 350,
height: 200,
modal: true,
closed: true,
closable: true,
draggable: true,
maximizable: false,
resizable: false,
data: null
}
this.dataa = DataA;
this.datab = DataB;
Window.call(this, this.options);
}
inherits(MyEdit, Window);
MyEdit.prototype.init = function() {
}
MyEdit.prototype.open = function() {
Window.prototype.open.call(this);
}
//执行windows窗体上自定义按钮事件
MyEdit.prototype.customerize = function() {
let self = this;
let sInPcNo = this.dataa.PcNo;
let sOutPcNo = this.datab.PcNo;
let $sInPcNo = this.getElement('.sInPcNo');
let $sOutPcNo = this.getElement('.sOutPcNo');
let $fTzCount = this.getElement('.fTzCount');
$sInPcNo.combobox({
valueField:'InPcNo',
textField:'sInPcNo',
data: [{'InPcNo':sInPcNo,'sInPcNo':sInPcNo},{'InPcNo':sOutPcNo,'sInPcNo':sOutPcNo}]
});
$sOutPcNo.combobox({
valueField:'OutPcNo',
textField:'sOutPcNo',
data: [{'OutPcNo':sInPcNo,'sOutPcNo':sInPcNo},{'OutPcNo':sOutPcNo,'sOutPcNo':sOutPcNo}]
});
//确定按钮事件
this.getElement('.btnOK').on('click', function(event) {
let fTzCount = $fTzCount.numberbox('getValue');
let InPcNo = $sInPcNo.combobox('getValue');
let OutPcNo = $sOutPcNo.combobox('getValue');
if (TypeUtil.toFloat(fTzCount) <= 0){
Store.messager.err('调整数量必须大于0');
}
else{
if ((InPcNo.length <= 0) || (OutPcNo.length <= 0 ) || (OutPcNo == InPcNo)){
Store.messager.err('调入批次、调出批次都不能为空,且不能相同!');
}
else{
if (Store.confirm("您确认对批次数量进行调整吗?")) {
let ret = Service.getSlideMenuData("actExecute","onpctz", self.dataa.getData(),self.datab.getData(),InPcNo,OutPcNo,fTzCount);
if (ret.result !== 1) {
Store.messager.err(ret.message);
return false;
}
else{
Store.messager.tip(ret.message+"<br>请手工刷新当前页面查看结果!");
if (self.callback) {
self.callback();
}
self.close();
}
}
}
}
});
//取消按钮事件
this.getElement('.btnCancel').on('click', function(event) {
self.close();
});
}
return MyEdit;
})