|
楼主 |
发表于 2018-6-29 16:25:02
|
显示全部楼层
define(function(require){
var $ = require("jquery");
var justep = require("$UI/system/lib/justep");
var Model = function(){
this.callParent();
};
Model.prototype.windowReceiver1Receive = function(event){
debugger;
var data = event.data;//此处为json对象
var id = data.id; //获取name值
// alert(id);
localStorage.setItem("rid", id);
this.comp("ryxg").setFilter('filter2',"fID = '"+id+"'");
this.comp('ryxg').refreshData();
this.comp("fj").refreshData();
};
Model.prototype.button4Click = function(event){
// var xmid = localStorage.getItem("rid");
// alert(xmid);
var data = this.comp('ryxg');
//var startDate = this.getElementByXid('startDate').value;
//var endDate = this.getElementByXid('endDate').value;
var xmid = data.getValue("fID");
//var startDate = this.comp("input1").val();
var xm = data.getValue("fXM");
var dwid = data.getValue("fDWID");
//var zylr = this.comp("textarea1").val();
var sfzh = data.getValue("fSFZH");
var jhsj =this.comp("input1").val();
var fj = this.comp("fj").getValue("fFJ");
this.comp("dw").setFilter('filter2',"fID = '"+dwid+"'");
this.comp('dw').refreshData();
var dwmc =this.comp('dw').getValue("fDWMC");
// 登录,String zxr, java.util.Date startDate, String lxfs, String lb, String zylr
//String zxr = params.getString("fDFDW");
//String startDate = params.getString("fFBSJ");
//String lxfs = params.getString("fNRJJ");
//String lb = params.getString("fWJM");
//String zylr = params.getString("fNR");
var params = {};
// if (startDate && endDate) {
params = {
dwid:dwid,
xmid:xmid,
sfzh:sfzh,
dwmc:dwmc,
xm:xm,
jhsj:jhsj
//};
};
if ((jhsj=== undefined)||(jhsj=== null)||(jhsj=== "")||(fj=== undefined)||(fj=== null)||(fj=== ""))
{
justep.Util.hint("计划离岗位时间必须填写,且附件必须上传!");
//alert("没有照片,请先上传");
event.cancel = true;
}
else
{
justep.Baas.sendRequest({
"url" : "/zzfw/zzrz",
"action" : "zzlz",
"async" : false,
"params" : params,
"success" : function(ret) {
// data.loadData(ret);
//data.refreshData();
}
});
this.comp('fj').saveData();
justep.Util.hint("数据提交成功,请等待答复");
this.close();
}
};
Model.prototype.fjCustomRefresh = function(event){
debugger;
// this.comp("fj").refreshData();
var xmid = localStorage.getItem("rid");
var data = this.comp('fj');
var options = {
defaultValues :[
{"fXMID":xmid,"fFJM":"身份证正面"},
{"fXMID":xmid,"fFJM":"身份证反面"},
{"fXMID":xmid,"fFJM":"离职申请书拍照(签字)"}
]
};
data.newData(options);
//this.comp('fj').saveData()
};
return Model;
}); |
|