|
|
@@ -1,103 +1,122 @@ |
|
|
|
(function() { |
|
|
|
var colDataItemArr = ['GenderNo']; |
|
|
|
var colDataItemCode = ['usersex']; |
|
|
|
(function () { |
|
|
|
var colDataItemArr = ['GenderNo']; |
|
|
|
var colDataItemCode = ['usersex']; |
|
|
|
var colDataItemBank = ['DepositBank']; |
|
|
|
|
|
|
|
var page = { |
|
|
|
isScroll: false, |
|
|
|
init: function($page) { |
|
|
|
// 获取登录者信息 |
|
|
|
var userinfo = learun.storage.get('userinfo'); |
|
|
|
|
|
|
|
//增加联系人 |
|
|
|
$page.find('.welT i').on('tap', function() { |
|
|
|
var FamilyHtml = '<div class="welCon"><form class="welConForm">' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>姓名</span>' + |
|
|
|
'<input type="text" name="Name" placeholder="请填写姓名" />' + |
|
|
|
'</div>' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>与本人关系</span>' + |
|
|
|
'<div name="Relation" value=""></div>' + |
|
|
|
'</div>' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>性别</span>' + |
|
|
|
'<div name="Sex" value=""></div>' + |
|
|
|
'</div>' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>年龄</span>' + |
|
|
|
'<input type="text" name="Age" placeholder="请填写年龄" />' + |
|
|
|
'</div>' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>政治面貌</span>' + |
|
|
|
'<div name="Politicy" value=""></div>' + |
|
|
|
'</div>' + |
|
|
|
//'<div class="welInput">' + |
|
|
|
//'<span>身份证号</span>' + |
|
|
|
//'<input type="text" name="IdCard" placeholder="请填写身份证号" />' + |
|
|
|
//'</div>' + |
|
|
|
'<div class="welDel"> <i class="iconfont icon-move"></i> </div>' + |
|
|
|
'</form></div>'; |
|
|
|
var EmergePeopleHtml = '<div class="welCon"><form class="welConForm">' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>姓名</span>' + |
|
|
|
'<input type="text" name="Name" placeholder="请填写姓名" />' + |
|
|
|
'</div>' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>与本人关系</span>' + |
|
|
|
'<input type="text" name="Relation" placeholder="请填写与本人关系" />' + |
|
|
|
'</div>' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>手机号码</span>' + |
|
|
|
'<input type="text" name="Telephone" placeholder="请填写手机号码" />' + |
|
|
|
'</div>' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>座机号码</span>' + |
|
|
|
'<input type="text" name="Mobile" placeholder="请填写座机号码" />' + |
|
|
|
'</div>' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>联系地址</span>' + |
|
|
|
'<input type="text" name="Address" placeholder="请填写联系地址" />' + |
|
|
|
'</div>' + |
|
|
|
'<div class="welDel"> <i class="iconfont icon-move"></i> </div>' + |
|
|
|
'</form></div>'; |
|
|
|
|
|
|
|
|
|
|
|
var obj = $(this).parent().next(); |
|
|
|
if ($(this).attr('title') == '紧急联系人') { |
|
|
|
obj.append(EmergePeopleHtml); |
|
|
|
} else { |
|
|
|
obj.append(FamilyHtml); |
|
|
|
} |
|
|
|
var page = { |
|
|
|
isScroll: false, |
|
|
|
init: function ($page) { |
|
|
|
// 获取登录者信息 |
|
|
|
var userinfo = learun.storage.get('userinfo'); |
|
|
|
//tab切换 |
|
|
|
$page.find('.welTab div').on('tap', function () { |
|
|
|
var ind = $(this).index(); |
|
|
|
$(this).addClass('active').siblings().removeClass('active'); |
|
|
|
$('.welBox').css('display', 'none').eq(ind).fadeIn() |
|
|
|
}) |
|
|
|
//增加联系人 |
|
|
|
$page.find('.welAdd i').on('tap', function () { |
|
|
|
var FamilyHtml = '<div class="welCon"><form class="welConForm">' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>姓名</span>' + |
|
|
|
'<input class="welInputs" type="text" name="Name" placeholder="请填写姓名" />' + |
|
|
|
'</div>' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>与本人关系</span>' + |
|
|
|
'<div name="Relation" value=""></div>' + |
|
|
|
'</div>' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>年龄</span>' + |
|
|
|
'<input class="welInputs" type="text" name="Age" placeholder="请填写年龄" />' + |
|
|
|
'</div>' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>政治面貌</span>' + |
|
|
|
'<div name="Politicy" value=""></div>' + |
|
|
|
'</div>' + |
|
|
|
//'<div class="welInput">' + |
|
|
|
//'<span>身份证号</span>' + |
|
|
|
//'<input type="text" name="IdCard" placeholder="请填写身份证号" />' + |
|
|
|
//'</div>' + |
|
|
|
'<div class="welDel"> <i class="iconfont icon-move"></i> </div>' + |
|
|
|
'</form></div>'; |
|
|
|
var EmergePeopleHtml = '<div class="welCon"><form class="welConForm">' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>姓名</span>' + |
|
|
|
'<input class="welInputs" type="text" name="Name" placeholder="请填写姓名" />' + |
|
|
|
'</div>' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>与本人关系</span>' + |
|
|
|
'<div name="Relation" value=""></div>' + |
|
|
|
'</div>' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>手机号码</span>' + |
|
|
|
'<input class="welInputs" type="text" name="Telephone" placeholder="请填写手机号码" />' + |
|
|
|
'</div>' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>座机号码</span>' + |
|
|
|
'<input class="welInputs" type="text" name="Mobile" placeholder="请填写座机号码" />' + |
|
|
|
'</div>' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>联系地址</span>' + |
|
|
|
'<input class="welInputs" type="text" name="Address" placeholder="请填写联系地址" />' + |
|
|
|
'</div>' + |
|
|
|
'<div class="welDel"> <i class="iconfont icon-move"></i> </div>' + |
|
|
|
'</form></div>'; |
|
|
|
|
|
|
|
|
|
|
|
page.bind($page); |
|
|
|
}) |
|
|
|
//删除联系人 |
|
|
|
$page.find('.welBox').on('tap', '.welDel i', function() { |
|
|
|
var parents = $(this).parents('.welCon') |
|
|
|
learun.layer.confirm('是否删除此联系人?', function(_index) { |
|
|
|
_index == 1 ? parents.remove() : '' |
|
|
|
}, '提示', ['否', '是']); |
|
|
|
}) |
|
|
|
//上传照片 |
|
|
|
var inputNode = $page.find('#files'); |
|
|
|
$page.find('#welImgBtn').on('tap', function() { |
|
|
|
var evt = new MouseEvent("click", { |
|
|
|
bubbles: false, |
|
|
|
cancelable: true, |
|
|
|
view: window |
|
|
|
var obj = $(this).parents('.welBox').find('.welUrgent'); |
|
|
|
if ($(this).attr('title') == '紧急联系人') { |
|
|
|
obj.append(EmergePeopleHtml); |
|
|
|
|
|
|
|
} else { |
|
|
|
obj.append(FamilyHtml); |
|
|
|
//政治面貌 |
|
|
|
var Politicy = $(obj).find('[name="Politicy"]:last'); |
|
|
|
Politicy.lrpickerex({ |
|
|
|
code: 'BCdPartyFace', |
|
|
|
type: 'sourceData', |
|
|
|
ivalue: 'partyfaceno', |
|
|
|
itext: 'partyface' |
|
|
|
}); |
|
|
|
//赋值 |
|
|
|
Politicy.lrpickerSet(Politicy.attr('value')); |
|
|
|
} |
|
|
|
//与本人关系 |
|
|
|
var Relation = $(obj).find('[name="Relation"]:last'); |
|
|
|
Relation.lrpickerex({ |
|
|
|
code: 'FamilyRelation', |
|
|
|
type: 'dataItem' |
|
|
|
}); |
|
|
|
inputNode[0].dispatchEvent(evt); |
|
|
|
}) |
|
|
|
inputNode.on('change', function() { |
|
|
|
previewFile(); |
|
|
|
}); |
|
|
|
|
|
|
|
//数据绑定 |
|
|
|
//赋值 |
|
|
|
Relation.lrpickerSet(Relation.attr('value')); |
|
|
|
|
|
|
|
// page.bind($page); |
|
|
|
}) |
|
|
|
//删除联系人 |
|
|
|
$page.find('.welBox').on('tap', '.welDel i', function () { |
|
|
|
var parents = $(this).parents('.welCon') |
|
|
|
learun.layer.confirm('是否删除此联系人?', function (_index) { |
|
|
|
_index == 1 ? parents.remove() : '' |
|
|
|
}, '提示', ['否', '是']); |
|
|
|
}) |
|
|
|
//上传照片 |
|
|
|
var inputNode = $page.find('#files'); |
|
|
|
$page.find('#welImgBtn').on('tap', function () { |
|
|
|
var evt = new MouseEvent("click", { |
|
|
|
bubbles: false, |
|
|
|
cancelable: true, |
|
|
|
view: window |
|
|
|
}); |
|
|
|
inputNode[0].dispatchEvent(evt); |
|
|
|
}) |
|
|
|
inputNode.on('change', function () { |
|
|
|
previewFile(); |
|
|
|
}); |
|
|
|
|
|
|
|
//数据绑定 |
|
|
|
learun.layer.loading(true, '获取数据中'); |
|
|
|
learun.httpget(config.webapi + "StuInfoFresh/stuInfoFreshEntity", userinfo.baseinfo.account, ( |
|
|
|
data) => { |
|
|
|
//console.log('datadata',data); |
|
|
|
if (data) { |
|
|
|
//基本信息 |
|
|
|
for (var id in data['StuInfoFreshEntity']) { |
|
|
@@ -126,16 +145,16 @@ |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
// if (id == "#DepositBank") { |
|
|
|
// learun.clientdata.get('sourceData', { |
|
|
|
// code: 'DepositBank', |
|
|
|
// key: data['StuInfoFreshEntity']['' + id + ''], |
|
|
|
// keyId: 'DepositBank', |
|
|
|
// callback: function(data, op) { |
|
|
|
// $("#DepositBank").html(data.text); |
|
|
|
// } |
|
|
|
// }); |
|
|
|
// } |
|
|
|
if (id == "#DepositBank") { |
|
|
|
learun.clientdata.get('sourceData', { |
|
|
|
code: 'DepositBank', |
|
|
|
key: data['StuInfoFreshEntity']['' + id + ''], |
|
|
|
keyId: 'DepositBank', |
|
|
|
callback: function(data, op) { |
|
|
|
$("#DepositBank").html(data.text); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
} else if (dom.tagName.toLowerCase() == "input") { |
|
|
|
$('#' + id).val(data['StuInfoFreshEntity']['' + id + '']); |
|
|
|
} |
|
|
@@ -146,79 +165,71 @@ |
|
|
|
$("#DepositBank").lrpickerSet(data.StuInfoFreshEntity.DepositBank); |
|
|
|
//头像 |
|
|
|
$('#PhotoImg').attr('src', config.web + data['Url']); |
|
|
|
|
|
|
|
//家庭成员 |
|
|
|
if(data['StuInfoFreshFamilyList'].length>0){ |
|
|
|
$('#StuInfoFreshFamily').html(""); |
|
|
|
|
|
|
|
$.each(data['StuInfoFreshFamilyList'], function(i, item) { |
|
|
|
var html = '<div class="welCon"><form class="welConForm">' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>姓名</span>' + |
|
|
|
'<input type="text" name="Name" placeholder="请填写姓名" value="' + |
|
|
|
'<input class="welInputs" type="text" name="Name" placeholder="请填写姓名" value="' + |
|
|
|
item.Name + '"/>' + |
|
|
|
'</div >' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>与本人关系</span>' + |
|
|
|
//'<input type="text" name="Relation" placeholder="请填写与本人关系" value="' + item.Relation + '"/>' + |
|
|
|
'<div name="Relation" value="' + item.Relation + '"></div>' + |
|
|
|
'</div>' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>性别</span>' + |
|
|
|
//'<input type="text" name="Sex" placeholder="请填写性别" value="' + item.Sex + '"/>' + |
|
|
|
'<div name="Sex" value="' + item.Sex + '"></div>' + |
|
|
|
'</div>' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>年龄</span>' + |
|
|
|
'<input type="text" name="Age" placeholder="请填写年龄" value="' + |
|
|
|
'<input class="welInputs" type="text" name="Age" placeholder="请填写年龄" value="' + |
|
|
|
item.Age + '"/>' + |
|
|
|
'</div>' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>政治面貌</span>' + |
|
|
|
//'<input type="text" name="Politicy" placeholder="请填写政治面貌" value="' + item.Politicy + '"/>' + |
|
|
|
'<div name="Politicy" value="' + item.Politicy + '"/>' + |
|
|
|
'</div>' + |
|
|
|
//'<div class="welInput">' + |
|
|
|
//'<span>身份证号</span>' + |
|
|
|
//'<input type="text" name="IdCard" placeholder="请填写身份证号" value="' + item.IdCard + '"/>' + |
|
|
|
//'</div>' + |
|
|
|
'<div class="welDel"> <i class="iconfont icon-move"></i> </div>' + |
|
|
|
'</form></div> '; |
|
|
|
$('#StuInfoFreshFamily').append(html); |
|
|
|
|
|
|
|
}); |
|
|
|
});} |
|
|
|
|
|
|
|
//紧急联系人 |
|
|
|
if(data['StuInfoFreshEmergePeopleList'].length>0){ |
|
|
|
$('#StuInfoFreshEmergePeople').html(""); |
|
|
|
$.each(data['StuInfoFreshEmergePeopleList'], function(i, item) { |
|
|
|
var html = '<div class="welCon"><form class="welConForm">' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>姓名</span>' + |
|
|
|
'<input type="text" name="Name" placeholder="请填写姓名" value="' + |
|
|
|
'<input class="welInputs" type="text" name="Name" placeholder="请填写姓名" value="' + |
|
|
|
item.Name + '"/>' + |
|
|
|
'</div >' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>与本人关系</span>' + |
|
|
|
'<input type="text" name="Relation" placeholder="请填写与本人关系" value="' + |
|
|
|
item.Relation + '"/>' + |
|
|
|
'<div name="Relation" value="' +item.Relation + '"></div>' + |
|
|
|
'</div>' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>手机号码</span>' + |
|
|
|
'<input type="text" name="Telephone" placeholder="请填写手机号码" value="' + |
|
|
|
'<input class="welInputs" type="text" name="Telephone" placeholder="请填写手机号码" value="' + |
|
|
|
item.Telephone + '"/>' + |
|
|
|
'</div>' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>座机号码</span>' + |
|
|
|
'<input type="text" name="Mobile" placeholder="请填写座机号码" value="' + |
|
|
|
'<input class="welInputs" type="text" name="Mobile" placeholder="请填写座机号码" value="' + |
|
|
|
item.Mobile + '"/>' + |
|
|
|
'</div>' + |
|
|
|
'<div class="welInput">' + |
|
|
|
'<span>联系地址</span>' + |
|
|
|
'<input type="text" name="Address" placeholder="请填写联系地址" value="' + |
|
|
|
item.Address + '"/>' + |
|
|
|
'<input class="welInputs" type="text" name="Address" placeholder="请填写联系地址" value="' +item.Address + '"/>' + |
|
|
|
'</div>' + |
|
|
|
'<div class="welDel"> <i class="iconfont icon-move"></i> </div>' + |
|
|
|
'</form></div > '; |
|
|
|
$('#StuInfoFreshEmergePeople').append(html); |
|
|
|
|
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
page.bind($page); |
|
|
|
learun.layer.loading(false); |
|
|
@@ -227,8 +238,9 @@ |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
//保存 |
|
|
|
$page.find('#saveBtn').on('tap', function() { |
|
|
|
|
|
|
|
//保存 |
|
|
|
$page.find('.saveBtn').on('tap', function () { |
|
|
|
var postdata = { |
|
|
|
ID: $('#ID').val(), |
|
|
|
RegionNo: $('#RegionNo').val(), |
|
|
@@ -241,135 +253,138 @@ |
|
|
|
StuInfoFreshFamilyEntities: family(), |
|
|
|
StuInfoFreshEmergePeopleEntities: emergePeople() |
|
|
|
}; |
|
|
|
console.log(postdata) |
|
|
|
// return |
|
|
|
learun.layer.loading(true, '正在提交数据'); |
|
|
|
learun.httpget(config.webapi + "StuInfoFresh/saveStuInfoFresh", postdata, ( |
|
|
|
data) => { |
|
|
|
learun.layer.loading(false); |
|
|
|
if (data) { |
|
|
|
learun.layer.toast('保存成功'); |
|
|
|
location.reload(); |
|
|
|
} |
|
|
|
}); |
|
|
|
//console.log(postdata) |
|
|
|
//return |
|
|
|
learun.layer.loading(true, '正在提交数据'); |
|
|
|
learun.httpget(config.webapi + "StuInfoFresh/saveStuInfoFresh", postdata, (data) => { |
|
|
|
learun.layer.loading(false); |
|
|
|
if (data) { |
|
|
|
learun.layer.toast('保存成功'); |
|
|
|
location.reload(); |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
page.bind($page); |
|
|
|
}, |
|
|
|
bind: function ($page) { |
|
|
|
//性别 |
|
|
|
$.each($page.find('[name="Sex"]'), function (i, item) { |
|
|
|
$page.find(item).lrpickerex({ |
|
|
|
code: 'usersex', |
|
|
|
type: 'dataItem' |
|
|
|
}); |
|
|
|
//赋值 |
|
|
|
$(item).lrpickerSet($(item).attr('value')); |
|
|
|
}); |
|
|
|
//政治面貌 |
|
|
|
$.each($page.find('[name="Politicy"]'), function (i, item) { |
|
|
|
$page.find(item).lrpickerex({ |
|
|
|
code: 'BCdPartyFace', |
|
|
|
type: 'sourceData', |
|
|
|
ivalue: 'partyfaceno', |
|
|
|
itext: 'partyface' |
|
|
|
}); |
|
|
|
//赋值 |
|
|
|
$(item).lrpickerSet($(item).attr('value')); |
|
|
|
}); |
|
|
|
//与本人关系 |
|
|
|
$.each($page.find('[name="Relation"]'), function (i, item) { |
|
|
|
$page.find(item).lrpickerex({ |
|
|
|
code: 'FamilyRelation', |
|
|
|
type: 'dataItem' |
|
|
|
}); |
|
|
|
//赋值 |
|
|
|
$(item).lrpickerSet($(item).attr('value')); |
|
|
|
}); |
|
|
|
//开户银行 |
|
|
|
$page.find('#DepositBank').lrpickerex({ |
|
|
|
code: 'DepositBank', |
|
|
|
type: 'dataItem' |
|
|
|
}); |
|
|
|
/* $.each($page.find('[name="DepositBank"]'), function (i, item) { |
|
|
|
$page.find(item).lrpickerex({ |
|
|
|
code: 'DepositBank', |
|
|
|
type: 'dataItem' |
|
|
|
}); |
|
|
|
//赋值 |
|
|
|
$(item).lrpickerSet($(item).attr('value')); |
|
|
|
}); */ |
|
|
|
} |
|
|
|
}; |
|
|
|
//数据处理 |
|
|
|
function family() { |
|
|
|
var list = new Array(); |
|
|
|
$.each($('#StuInfoFreshFamily').children('.welCon'), function (i, item) { |
|
|
|
var o = $(item).children(".welConForm").serializeObject(); |
|
|
|
o.Sex = $(item).find('[name="Sex"]').lrpickerGet(); |
|
|
|
o.Politicy = $(item).find('[name="Politicy"]').lrpickerGet(); |
|
|
|
o.Relation = $(item).find('[name="Relation"]').lrpickerGet(); |
|
|
|
list.push(o); |
|
|
|
}); |
|
|
|
return list; |
|
|
|
} |
|
|
|
function emergePeople() { |
|
|
|
var list = new Array(); |
|
|
|
$.each($('#StuInfoFreshEmergePeople').children('.welCon'), function (i, item) { |
|
|
|
var o = $(item).children(".welConForm").serializeObject(); |
|
|
|
list.push(o); |
|
|
|
}); |
|
|
|
return list; |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
bind: function($page) { |
|
|
|
//性别 |
|
|
|
$.each($page.find('[name="Sex"]'), function(i, item) { |
|
|
|
$page.find(item).lrpickerex({ |
|
|
|
code: 'usersex', |
|
|
|
type: 'dataItem' |
|
|
|
}); |
|
|
|
//赋值 |
|
|
|
$(item).lrpickerSet($(item).attr('value')); |
|
|
|
}); |
|
|
|
$page.find('#DepositBank').lrpickerex({ |
|
|
|
code: 'DepositBank', |
|
|
|
type: 'dataItem' |
|
|
|
}); |
|
|
|
//政治面貌 |
|
|
|
$.each($page.find('[name="Politicy"]'), function(i, item) { |
|
|
|
$page.find(item).lrpickerex({ |
|
|
|
code: 'BCdPartyFace', |
|
|
|
type: 'sourceData', |
|
|
|
ivalue: 'partyfaceno', |
|
|
|
itext: 'partyface' |
|
|
|
}); |
|
|
|
//赋值 |
|
|
|
$(item).lrpickerSet($(item).attr('value')); |
|
|
|
}); |
|
|
|
//与本人关系 |
|
|
|
$.each($page.find('#StuInfoFreshFamily').find('[name="Relation"]'), function(i, item) { |
|
|
|
$page.find(item).lrpickerex({ |
|
|
|
code: 'FamilyRelation', |
|
|
|
type: 'dataItem' |
|
|
|
}); |
|
|
|
//赋值 |
|
|
|
$(item).lrpickerSet($(item).attr('value')); |
|
|
|
}); |
|
|
|
} |
|
|
|
}; |
|
|
|
//数据处理 |
|
|
|
function family() { |
|
|
|
var list = new Array(); |
|
|
|
$.each($('#StuInfoFreshFamily').children('.welCon'), function(i, item) { |
|
|
|
var o = $(item).children(".welConForm").serializeObject(); |
|
|
|
o.Sex = $(item).find('[name="Sex"]').lrpickerGet(); |
|
|
|
o.DepositBank = $(item).find('[name="DepositBank"]').lrpickerGet(); |
|
|
|
o.Politicy = $(item).find('[name="Politicy"]').lrpickerGet(); |
|
|
|
o.Relation = $(item).find('[name="Relation"]').lrpickerGet(); |
|
|
|
list.push(o); |
|
|
|
}); |
|
|
|
return list; |
|
|
|
} |
|
|
|
|
|
|
|
function emergePeople() { |
|
|
|
var list = new Array(); |
|
|
|
$.each($('#StuInfoFreshEmergePeople').children('.welCon'), function(i, item) { |
|
|
|
var o = $(item).children(".welConForm").serializeObject(); |
|
|
|
list.push(o); |
|
|
|
}); |
|
|
|
return list; |
|
|
|
} |
|
|
|
$.fn.serializeObject = function () { |
|
|
|
var o = {}; |
|
|
|
var a = this.serializeArray(); |
|
|
|
$.each(a, function () { |
|
|
|
if (o[this.name]) { |
|
|
|
if (!o[this.name].push) { |
|
|
|
o[this.name] = [o[this.name]]; |
|
|
|
} |
|
|
|
o[this.name].push(this.value || ''); |
|
|
|
} else { |
|
|
|
o[this.name] = this.value || ''; |
|
|
|
} |
|
|
|
}); |
|
|
|
return o; |
|
|
|
} |
|
|
|
|
|
|
|
$.fn.serializeObject = function() { |
|
|
|
var o = {}; |
|
|
|
var a = this.serializeArray(); |
|
|
|
$.each(a, function() { |
|
|
|
if (o[this.name]) { |
|
|
|
if (!o[this.name].push) { |
|
|
|
o[this.name] = [o[this.name]]; |
|
|
|
} |
|
|
|
o[this.name].push(this.value || ''); |
|
|
|
} else { |
|
|
|
o[this.name] = this.value || ''; |
|
|
|
} |
|
|
|
}); |
|
|
|
return o; |
|
|
|
} |
|
|
|
|
|
|
|
//上传照片 |
|
|
|
function previewFile() { |
|
|
|
var html = ''; |
|
|
|
var file = document.querySelector('input[type=file]').files[0]; |
|
|
|
var reader = new FileReader(); |
|
|
|
reader.onloadend = function() { |
|
|
|
//$('#PhotoImg').attr('src', reader.result); |
|
|
|
var postData = { |
|
|
|
Base64Url: reader.result |
|
|
|
} |
|
|
|
learun.httppost(config.webapi + "StuInfoFresh/savePhoto", postData, (data) => { |
|
|
|
if (data) { |
|
|
|
$('#Photo').val(data.AnnexesFileId); |
|
|
|
$('#PhotoImg').attr('src', config.web + data.Url); |
|
|
|
} else { |
|
|
|
learun.layer.toast('采集照片信息失败!'); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
if (file) { |
|
|
|
reader.readAsDataURL(file); |
|
|
|
} |
|
|
|
} |
|
|
|
//上传照片 |
|
|
|
function previewFile() { |
|
|
|
var html = ''; |
|
|
|
var file = document.querySelector('input[type=file]').files[0]; |
|
|
|
var reader = new FileReader(); |
|
|
|
reader.onloadend = function () { |
|
|
|
//$('#PhotoImg').attr('src', reader.result); |
|
|
|
var postData = { |
|
|
|
Base64Url: reader.result |
|
|
|
} |
|
|
|
learun.httppost(config.webapi + "StuInfoFresh/savePhoto", postData, (data) => { |
|
|
|
if (data) { |
|
|
|
$('#Photo').val(data.AnnexesFileId); |
|
|
|
$('#PhotoImg').attr('src', config.web + data.Url); |
|
|
|
} else { |
|
|
|
learun.layer.toast('采集照片信息失败!'); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
if (file) { |
|
|
|
reader.readAsDataURL(file); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//产生随机数 |
|
|
|
function GenerateRandom() { |
|
|
|
var retstr = ""; |
|
|
|
var date = new Date(); |
|
|
|
retstr = date.getFullYear().toString() + "-" + date.getMonth().toString() + "-" + date.getDate() |
|
|
|
.toString() + "-" + date.getUTCHours().toString() + "-" + date.getUTCMinutes() + "-" + date |
|
|
|
.getUTCSeconds() |
|
|
|
.toString(); |
|
|
|
var Num = ""; |
|
|
|
for (var i = 0; i < 6; i++) { |
|
|
|
Num += Math.floor(Math.random() * 10); |
|
|
|
} |
|
|
|
return retstr + Num; |
|
|
|
} |
|
|
|
//产生随机数 |
|
|
|
function GenerateRandom() { |
|
|
|
var retstr = ""; |
|
|
|
var date = new Date(); |
|
|
|
retstr = date.getFullYear().toString() + "-" + date.getMonth().toString() + "-" + date.getDate().toString() + "-" + date.getUTCHours().toString() + "-" + date.getUTCMinutes() + "-" + date.getUTCSeconds().toString(); |
|
|
|
var Num = ""; |
|
|
|
for (var i = 0; i < 6; i++) { |
|
|
|
Num += Math.floor(Math.random() * 10); |
|
|
|
} |
|
|
|
return retstr + Num; |
|
|
|
} |
|
|
|
|
|
|
|
return page; |
|
|
|
return page; |
|
|
|
})(); |