tijian_tieying/web/dccdc/Views/sq2/chuchai_sqMessageNew.cshtml
2025-02-20 12:14:39 +08:00

502 lines
19 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

@{
ViewBag.Title = "chuchai_sqMessage";
}
@model dccdc.Models.chuchai_sqModel
@section scripts{
<script type="text/javascript" src="@Url.Content("~/Scripts/public.js")"></script>
<script type="text/javascript">
var openf2;
$(function () {
$("#sqsj").ligerDateEditor({ format: "yyyy/MM/dd hh:mm:ss", showTime: true });
//$("#sqsj").ligerGetDateEditorManager().setValue(fun_date(0));
$("#ccsj2").ligerDateEditor();
//$("#ccsj").ligerGetDateEditorManager().setValue(fun_date(0));
//$("#toolbar").ligerToolBar({
// items: [
// { text: '维护项目经费', click: function () { message(1) }, icon: 'modify' },
// { line: true },
// { text: '维护三重一大', click: function () { message(2) }, icon: 'modify' }
// ]
//});
$("#fyly2").change(function () {
if ($("#fyly2").prop("checked") == false && $("#fydh").val()) {
$.ligerDialog.error("存在项目经费申请单,不能取消选择!");
$("#fyly2").prop("checked", true);
message(1);
return;
}
if ($("#fyly2").prop("checked") == true) {
message(1);
}
})
$("#je").blur(function () {
if ($("#je").val() >= 10000 && !$("#fydh2").val()) {
message(2)
}
})
$("#je").dblclick(function () {
if ($("#je").val() >= 10000) {
message(2)
}
})
var childD =@Html.Raw(ViewBag.area2D);
$("#areaid2").ligerComboBox({ data: null, valueField: 'id', textField: 'name' });
$("#areaid3").ligerComboBox({ data: null, valueField: 'id', textField: 'name' });
//修改赋值
if (@Model.areaid1!= 0) {
//修改赋值 先赋值jfid_val 再绑定数据源 jfid_val(是jfid的值)
var child2D = [];
for (var i in childD) {
if (childD[i].pid == "@Model.areaid1") {
child2D.push(childD[i])
}
}
//先赋值jfid_val 在绑定下拉会自动显示
$("#areaid2_val").val(@Model.areaid2);
liger.get("areaid2").setData(child2D);
}
if (@Model.areaid2!= 0) {
//修改赋值 先赋值jfid_val 再绑定数据源 jfid_val(是jfid的值)
var child2D = [];
for (var i in childD) {
if (childD[i].pid == "@Model.areaid2") {
child2D.push(childD[i])
}
}
//先赋值jfid_val 在绑定下拉会自动显示
$("#areaid3_val").val(@Model.areaid3);
liger.get("areaid3").setData(child2D);
}
$("#areaid1").change(function () {
var select = $("#areaid1").val();
liger.get("areaid2").setData(null);
var child2D = [];
for (var i in childD) {
if (childD[i].pid == select) {
child2D.push(childD[i]);
}
}
liger.get("areaid2").setData(child2D);
});
$("#areaid2").change(function () {
var select = $("#areaid2_val").val();
liger.get("areaid3").setData(null);
var child2D = [];
for (var i in childD) {
if (childD[i].pid == select) {
child2D.push(childD[i]);
}
}
liger.get("areaid3").setData(child2D);
});
//搜索下拉
@*$("#area").ligerComboBox({
data: null, valueField: 'name', textField: 'name',
autocomplete: true,
keySupport: true,
autocomplete: function (e) {
var child2D = [];
for (var i in childD) {
if (childD[i].name.indexOf(e.key) != -1) {
child2D.push(childD[i])
}
}
liger.get("area").setData(child2D);
e.show();
}
});
$("#area").val("@Model.area");*@
$("#area").focus(function () {
var url = "@Url.Action("sqccbxMessage3")?type=" + 3;
openf2 = $.ligerDialog.open({
title: "常用地点",
url: url,
width: 450,
height: 330
});
})
//上传文件
$("#file1").on("change", function () {
$.ajax({
url: "@Url.Action("uploadFile")",
type: 'POST',
cache: false,
data: new FormData($('#fileForm')[0]),
processData: false,
contentType: false,
dataType: "json",
beforeSend: function () {
$.ligerDialog.waitting("正在进行请稍后……");
},
success: function (data) {
$.ligerDialog.closeWaitting();
if (data.state) {
$("#filepath").val(data.url)
}
else {
$.ligerDialog.error(data.msg);
}
}
});
});
$("#ccry").bind("click", function () {
dia = $.ligerDialog.open({
title: "选择人员",
url: "@Url.Action("selectRY", "OA")?selected=" + ($("#ccryids").val() == "" ? "@Model.sqrid" : $("#ccryids").val()),
width: 660,
height: 360,
isHidden: false
});
});
})
var dia;
function selectbm(ids, names) {
$("#ccryids").val(ids)
$("#ccry").val(names)
dia.close();
}
function message(type) {
var title = "";
var url = "";
if (type == 1) {
title = "项目经费申请内容";
url = "@Url.Action("sqMessageNew", "sq2")?type=@Request.QueryString["type"]&del=1&id=" + $("#fydh").val();
}
if (type == 2) {
title = "三重一大申请内容";
url = "@Url.Action("szyd_zjsysqMessageNew", "sq2")?type=@Request.QueryString["type"]&del=1&id=" + $("#fydh2").val() + "&je=" + $("#je").val();
}
openf2 = $.ligerDialog.open({
title: title,
url: url,
width: 760,
height: 450
});
//window.open(url);
}
//弹出框选中
function selectedData(type, sqdh, rowdatas) {
if (type == "xmjf")
$("#fydh").val(sqdh);
if (type == "szyd")
$("#fydh2").val(sqdh);
if (openf2)
openf2.close();
}
function message2(type) {
openf2 = $.ligerDialog.open({
title: "选择已有项目经费",
url: "@Url.Action("sqjfcx2", "sq2")?type=@Request.QueryString["type"]&fydhs=" + $("#fydhs").val(),
width: 760,
height: 450
});
//window.open(url);
}
//弹出框选中
function selectedXZYYXMJF(fydhs) {
$("#fydhs").val(fydhs);
if (openf2)
openf2.close();
}
function save() {
var id = $("#id").val();
var je = $("#je").val();
var cclx = $("#cclx").val();
var ccrs = $("#ccrs").val();
var ccry = $("#ccry").val();
var ccryids = $("#ccryids").val();
var filepath = $("#filepath").val();
var ccsj = $("#ccsj2").val();
var ccts = $("#ccts").val();
var ccdd = $("#ccdd").val();
var sy = $("#sy").val();
var cclb = $("#cclb").val();
var areaid1=$("#areaid1").val();
var area1=$("#areaid1 option:checked").text();
var areaid2=$("#areaid2_val").val();
var area2=$("#areaid2").val();
var areaid3=$("#areaid3_val").val();
var area3 = $("#areaid3").val();
//var area = area1 + area2 + area3;
//之前的下拉关联 省市区 改成搜索下拉
var area = $("#area").val();
var fyly1 = $("#fyly1:checked").val();
var fyly2 = $("#fyly2:checked").val();
var fyly = "";
var fydh = $("#fydh").val();
var fydhs = $("#fydhs").val();
var fydh2 = $("#fydh2").val();
if (!cclx || !cclb || !ccrs || !ccts || !ccdd || !area || !sy) {
$.ligerDialog.error("出差类型、人数、天数、类别、地点、事由必填!")
return;
}
if (!ccsj || compareNow(ccsj) == 1) {
$.ligerDialog.error("日期不能小于当前时间!")
return;
}
if (!je) {
$.ligerDialog.error("金额必填!!")
return;
}
if (je >= 10000) {
if (fydh2 == "") {
$.ligerDialog.error("金额超过10000与三重一大添加不一致")
return;
}
}
else {
if (fydh2 != "") {
$.ligerDialog.error("金额超过10000与三重一大添加不一致")
return;
}
}
if (fyly2) {
if (fydh == "") {
$.ligerDialog.error("勾选项目经费必须维护项目经费申请单!")
return;
}
}
else {
if (fydh != "") {
$.ligerDialog.error("维护项目经费申请单必须勾选项目经费!")
return;
}
}
$.ajax({
url: "@Url.Action("savechuchaisq")", type: "post", dataType: "json", data: { id: id, je: je, cclx: cclx, ccrs: ccrs, ccry: ccry, ccryids: ccryids, filepath: filepath, ccsj: ccsj, ccts: ccts, ccdd: ccdd, sy: sy, cclb: cclb, areaid1: areaid1, areaid2: areaid2, areaid3: areaid3, area: area, fyly1: fyly1, fyly2: fyly2, fyly: fyly, fydh: fydh, fydhs: fydhs, fydh2: fydh2 },
success: function (d) {
$.ligerDialog.closeWaitting();
if (d.State == 0) {
$.ligerDialog.error("操作失败!");
}
else {
if(parent.init)
{
$.ligerDialog.success("操作成功!");
parent.init();
}
else
{
$.ligerDialog.alert('操作成功!','提示','success',function(){
window.opener.document.location.reload();
window.opener=null;
window.open('','_self');
window.close();
});
}
//parent.init();
//window.opener.init();
//window.opener = null;
//window.close();
}
},
beforeSend: function () {
$.ligerDialog.waitting("正在进行请稍后……");
}
});
}
//弹出框选中
function selectedArea(type, name, bz, bz2) {
if (type == "0") {
openf2.close();
return
}
if (type == "3") {
$("#area").val(name);
}
openf2.close();
}
//js对象深度克隆
var deepCopy = function (source) {
var result = {};
for (var key in source) {
result[key] = typeof source[key] === 'object' ? deepCopy(source[key]) : source[key];
}
return result;
}
function fun_date(days) {
var date1 = new Date(),
time1 = date1.getFullYear() + "-" + (date1.getMonth() + 1) + "-" + date1.getDate();//time1表示当前时间
var date2 = new Date(date1);
date2.setDate(date1.getDate() + days);
var y = date2.getFullYear();
var m = date2.getMonth() + 1;
m = m < 10 ? '0' + m : m;
var d = date2.getDate();
d = d < 10 ? ('0' + d) : d;
var time2 = y + "-" + m + "-" + d;
return time2;
}
</script>
<style type="text/css">
.ltd {
background-color: white;
}
.t3 .ltd {
text-align: center;
}
.t2 tr td {
padding: 5px 0px 5px 10px;
line-height: 22px;
word-break: break-all;
}
.t3 tr td {
border: 1px solid #bebeff;
padding: 5px 0px 5px 10px;
line-height: 22px;
word-break: break-all;
}
</style>
}
<div class="l-clear"></div>
<div style="width:700px; margin:0 auto">
@Html.HiddenFor(m => m.id)
@Html.HiddenFor(m => m.fydh)
@Html.HiddenFor(m => m.fydhs)
@Html.HiddenFor(m => m.fydh2)
<h3 style="text-align:center;margin:10px 0 10px 0">德城区疾控中心出差申请单</h3>
<table class="t2" style="width:100%" border="0">
<tr style="display:none">
<td class="ltd" width="70px">申 请 人:</td>
<td class="rtd" width="150px">@Html.DisplayFor(m => m.sqr)</td>
<td class="ltd" width="70px">申请状态:</td>
<td class="rtd" width="150px">@Html.DropDownListFor(m => m.zt, ViewData["ztD"] as SelectList, "----请选择----", new { @class = "l-text", @disabled = "disabled" })</td>
<td class="ltd" width="70px">申请日期:</td>
<td class="rtd" width="150px">@Html.DisplayFor(m => m.sqsj)</td>
</tr>
<tr>
<td class="ltd" width="70px">申 请 人:</td>
<td class="rtd" width="150px">@Html.DisplayFor(m => m.sqr)</td>
<td class="ltd" width="70px"></td>
<td class="rtd" width="150px"></td>
<td class="ltd" width="70px"></td>
<td class="rtd" width="150px">
@*<input type="@Request.QueryString["type"]" style="width:140px" readonly="readonly" value="选择已有项目经费" class="l-button" onclick="message2()" />*@
</td>
</tr>
<tr>
<td class="ltd" width="70px">申请科室:</td>
<td class="rtd" width="150px">@Html.DisplayFor(m => m.ksmc)</td>
<td class="ltd" width="70px">申请金额:</td>
<td class="rtd" width="150px">
@Html.TextBoxFor(m => m.je, new { @class = "l-text l-text-field-number", @type = "number" })*
@*<input readonly="readonly" value="三重一大" class="l-button" onclick="message(2)" />*@
</td>
<td class="ltd" width="70px">费用来源:</td>
<td class="rtd" width="150px">@Html.CheckBoxFor(m => m.fyly1)自有资金 &nbsp;&nbsp; @Html.CheckBoxFor(m => m.fyly2)项目经费</td>
</tr>
</table>
<table class="t3" style="width:100%">
<tr style="display:none">
<td class="ltd" width="70px">出差省份</td>
<td class="rtd" width="150px">@Html.DropDownListFor(m => m.areaid1, ViewData["areaD"] as SelectList, "----请选择----", new { @class = "l-text" })</td>
<td class="ltd" width="70px">出差市区</td>
<td class="rtd" width="150px">@Html.TextBoxFor(m => m.areaid2, new { @class = "l-text" })</td>
<td class="ltd" width="70px">出差地区</td>
<td class="rtd" width="150px">@Html.TextBoxFor(m => m.areaid3, new { @class = "l-text" })</td>
</tr>
<tr>
<td class="ltd">出差类型</td>
<td class="rtd">@Html.DropDownListFor(m => m.cclx, ViewData["cclxD"] as SelectList, "----请选择----", new { @class = "l-text" })*</td>
</tr>
<tr>
<td class="ltd" width="200px">出差人数</td>
<td class="rtd">@Html.TextBoxFor(m => m.ccrs, new { @class = "l-text l-text-field-number", @type = "number", onkeyup = @"value=value.replace(/[^\d]/g,'')" })*</td>
</tr>
<tr>
<td class="ltd">出差天数</td>
<td class="rtd">@Html.TextBoxFor(m => m.ccts, new { @class = "l-text l-text-field-number", @type = "number", onkeyup = @"value=value.replace(/[^\d]/g,'')" })*</td>
</tr>
<tr>
<td class="ltd">出差时间</td>
<td class="rtd">@Html.TextBoxFor(m => m.ccsj2, new { @class = "l-text" })</td>
</tr>
<tr>
<td class="ltd">出差类别</td>
<td class="rtd">@Html.DropDownListFor(m => m.cclb, ViewData["cclbD"] as SelectList, "----请选择----", new { @class = "l-text" })*</td>
</tr>
<tr>
<td class="ltd">出差地区</td>
<td class="rtd">@Html.TextBoxFor(m => m.area, new { @class = "l-text" })*</td>
</tr>
<tr>
<td class="ltd">详细地址</td>
<td class="rtd">@Html.TextBoxFor(m => m.ccdd, new { @class = "l-text", @style = "width:400px" })*</td>
</tr>
<tr>
<td class="ltd">出差人员</td>
<td class="rtd">
@Html.HiddenFor(m => m.ccryids)
@Html.TextBoxFor(m => m.ccry, new { @class = "l-text", @style = "width:400px", @readonly = "readonly" })
</td>
</tr>
<tr>
<td class="ltd">上传附件</td>
<td class="rtd">
<form id="fileForm" enctype='multipart/form-data'>
<input type="file" name="file1" id="file1" />
@Html.HiddenFor(m => m.filepath)
@if (!string.IsNullOrEmpty(Model.filepath))
{
<a href="@Model.filepath" target="_blank">下载 @Model.filepath</a>
}
else
{
<span style="color:red">大小:10M以内格式:图片格式、word、excel、pdf等</span>
}
</form>
</td>
</tr>
<tr>
<td class="ltd">出差事由</td>
<td class="rtd">@Html.TextAreaFor(m => m.sy, new { @rows = "3", @style = "width:400px" })*</td>
</tr>
</table>
<div style="text-align:center;margin-top:10px"><input type="@Request.QueryString["type"]" readonly="readonly" value="申请" class="l-button" onclick="save()" /></div>
<div id="toolbar"></div>
</div>
<div style="display:none;"></div>
<div class="dispReport">
<object classid="clsid:F6A015E2-092A-4006-93DA-4CBDE3AFF4B8" id="window.top.Formium.external.Print" width="300" height="50"></object>
</div>