165 lines
6.1 KiB
Plaintext
165 lines
6.1 KiB
Plaintext
|
|
@{
|
|||
|
|
ViewBag.Title = "职业史导入";
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
<table>
|
|||
|
|
<tr>
|
|||
|
|
<td class="ltd">请选择企业:</td>
|
|||
|
|
<td class="rtd"><input id="qyname"></td>
|
|||
|
|
<td class="rtd"><div id="choseqy" class="l-button">选择</div></td>
|
|||
|
|
<td class="ltd">姓名:</td>
|
|||
|
|
<td class="rtd"><input id="txt_name" /></td>
|
|||
|
|
<td class="rtd"><div id="cx">查询</div></td>
|
|||
|
|
|
|||
|
|
</tr>
|
|||
|
|
<tr>
|
|||
|
|
<td class="ltd">导入职业史:</td>
|
|||
|
|
<td class="ltd"><input id="oldfile" name="oldfile" type="file" /></td>
|
|||
|
|
<td class="rtd"><div id="upload">上传</div></td>
|
|||
|
|
<td class="rtd"><div id="download">下载模板</div></td>
|
|||
|
|
</tr>
|
|||
|
|
</table>
|
|||
|
|
|
|||
|
|
<div id="olddate"></div>
|
|||
|
|
@section scripts{
|
|||
|
|
<script src="@Url.Content("~/Scripts/ajaxfileupload.js")"></script>
|
|||
|
|
<script type="text/javascript">
|
|||
|
|
var dia;
|
|||
|
|
var cId;
|
|||
|
|
var cName;
|
|||
|
|
function selectedQY(data) {
|
|||
|
|
cId = data.id;
|
|||
|
|
cName = data.enterprise_name;
|
|||
|
|
$("#qyname").val(cName);
|
|||
|
|
dia.close();
|
|||
|
|
}
|
|||
|
|
$(function () {
|
|||
|
|
|
|||
|
|
$("#txt_name").ligerTextBox();
|
|||
|
|
$("#olddate").ligerGrid(
|
|||
|
|
{
|
|||
|
|
title: "职业史",
|
|||
|
|
url: "@Url.Action("getOccupationHistoryImportList")",
|
|||
|
|
parms: { key: "" },
|
|||
|
|
columns: [{
|
|||
|
|
display: '姓名',
|
|||
|
|
name: 'name',
|
|||
|
|
align: 'left',
|
|||
|
|
width: 80
|
|||
|
|
}, {
|
|||
|
|
display: '身份证号',
|
|||
|
|
name: 'identity_card',
|
|||
|
|
align: 'left',
|
|||
|
|
width: 80
|
|||
|
|
}, {
|
|||
|
|
display: '开始时间',
|
|||
|
|
name: 'start_date',
|
|||
|
|
align: 'left',
|
|||
|
|
width: 80
|
|||
|
|
}, {
|
|||
|
|
display: '结束时间',
|
|||
|
|
name: 'end_date',
|
|||
|
|
align: 'left',
|
|||
|
|
width: 100
|
|||
|
|
}
|
|||
|
|
, {
|
|||
|
|
display: '工作单位',
|
|||
|
|
name: 'util',
|
|||
|
|
align: 'left',
|
|||
|
|
width: 40
|
|||
|
|
}, {
|
|||
|
|
display: '车间部门',
|
|||
|
|
name: 'workshop',
|
|||
|
|
align: 'left',
|
|||
|
|
width: 100
|
|||
|
|
}, {
|
|||
|
|
display: '工种',
|
|||
|
|
name: 'work_type',
|
|||
|
|
align: 'left',
|
|||
|
|
width: 100
|
|||
|
|
}, {
|
|||
|
|
display: '有害因素',
|
|||
|
|
name: 'factory',
|
|||
|
|
align: 'left',
|
|||
|
|
width: 100
|
|||
|
|
},
|
|||
|
|
{
|
|||
|
|
display: "防护措施",
|
|||
|
|
name: "protect_method",
|
|||
|
|
align: "left",
|
|||
|
|
width: 100
|
|||
|
|
},
|
|||
|
|
], height: '100%', rownumbers: true, pageSize:30
|
|||
|
|
}
|
|||
|
|
);
|
|||
|
|
$("#cx").ligerButton({
|
|||
|
|
click: function () {
|
|||
|
|
var g = liger.get("olddate");
|
|||
|
|
g.setParm("key", cId);
|
|||
|
|
g.reload();
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
$("#choseqy").ligerButton({
|
|||
|
|
click: function () {
|
|||
|
|
dia = $.ligerDialog.open({
|
|||
|
|
title: "选择企业",
|
|||
|
|
url: "@Url.Action("SelectCompany", "Common")?lx=职业",
|
|||
|
|
width: 811,
|
|||
|
|
height: 422
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
|
|||
|
|
$("#choseqy2").ligerButton({
|
|||
|
|
click: function () {
|
|||
|
|
var g = liger.get("olddate");
|
|||
|
|
g.setParm("xm", liger.get("txt_name").getValue());
|
|||
|
|
g.changePage("first");
|
|||
|
|
g.reload();
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
$("#download").ligerButton({
|
|||
|
|
click: function () {
|
|||
|
|
window.open("@Url.Content("~/report/occupationDiseaseDataImportModel.xls")");
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
$("#upload").ligerButton({
|
|||
|
|
click: function () {
|
|||
|
|
if (!$("#oldfile").val()) {
|
|||
|
|
$.ligerDialog.warn("请选择要上传的职业史!");
|
|||
|
|
return;
|
|||
|
|
}
|
|||
|
|
$.ligerDialog.waitting("正在上传职业史……");
|
|||
|
|
$.ajaxFileUpload({
|
|||
|
|
url: "@Url.Action("uploadOccupationDataImport")",
|
|||
|
|
data: { "key": cId,"name":cName},
|
|||
|
|
type: "post",
|
|||
|
|
secureuri: false, //一般设置为false
|
|||
|
|
fileElementId: "oldfile", // 上传文件的id、name属性名
|
|||
|
|
dataType: "json", //返回值类型,一般设置为json、application/json
|
|||
|
|
//elementIds: elementIds, //传递参数到服务器
|
|||
|
|
success: function (data, status) {
|
|||
|
|
$.ligerDialog.closeWaitting();
|
|||
|
|
if (data.State == 1) {
|
|||
|
|
$.ligerDialog.success(data.Message);
|
|||
|
|
}
|
|||
|
|
else {
|
|||
|
|
$.ligerDialog.warn(data.Message);
|
|||
|
|
}
|
|||
|
|
},
|
|||
|
|
error: function (data, status, e) {
|
|||
|
|
$.ligerDialog.closeWaitting();
|
|||
|
|
$.ligerDialog.warn(data.responseText);
|
|||
|
|
},
|
|||
|
|
complete: function () {
|
|||
|
|
var g = liger.get("olddate");
|
|||
|
|
g.setParm("key", cId);
|
|||
|
|
g.reload();
|
|||
|
|
},
|
|||
|
|
beforeSend: function () { $.ligerDialog.waitting("正在上传职业史……"); }
|
|||
|
|
});
|
|||
|
|
}
|
|||
|
|
});
|
|||
|
|
});
|
|||
|
|
</script>
|
|||
|
|
}
|