354 lines
14 KiB
Plaintext
354 lines
14 KiB
Plaintext
|
|
@{
|
|
ViewBag.Title = "sqjkMessage";
|
|
}
|
|
|
|
@model dccdc.Models.sqqtbxModel
|
|
@section scripts{
|
|
<script type="text/javascript" src="@Url.Content("~/Scripts/public.js")"></script>
|
|
<script type="text/javascript">
|
|
|
|
$(function () {
|
|
$("#layout1").ligerLayout({ leftWidth: 300, topHeight: 170 });
|
|
$("#sqsj").ligerDateEditor({ format: "yyyy/MM/dd hh:mm:ss", showTime: true });
|
|
//$("#sqsj").ligerGetDateEditorManager().setValue(fun_date(0));
|
|
|
|
$("#dydh").focus(function () {
|
|
openf2 = $.ligerDialog.open({
|
|
title: "选择申请单(单击选中确定)",
|
|
url: "@Url.Action("choosqtbxfyzcView")",
|
|
width: 750,
|
|
height: 500
|
|
});
|
|
})
|
|
|
|
$("#grid2").ligerGrid({
|
|
height: "100%",
|
|
columns: [
|
|
//{ display: "双击删除", name: "", align: "left", width: 60 },
|
|
{
|
|
display: "", name: "", align: "left", width: 33,
|
|
render: function () {
|
|
return "<div onclick='add(1)' style='text-align:center'><img src='@Url.Content("~/Content/jingfei/b_jia.png")'><div>";
|
|
}
|
|
},
|
|
//{ display: "经办人", name: "title", align: "left", width: 80, type: 'string', editor: { type: 'string' } },
|
|
{ display: "业务内容", name: "content", align: "left", width: 460, type: 'string', editor: { type: 'string' } },
|
|
{ display: "金额", name: "je", align: "right", width: 150, type: 'float', editor: { type: 'float', initSelect: true } },
|
|
{
|
|
display: "", name: "", align: "left", width: 33,
|
|
render: function () {
|
|
return "<div onclick='sub(this)' style='text-align:center'><img src='@Url.Content("~/Content/jingfei/b_jian.png")'><div>";
|
|
}
|
|
}
|
|
],
|
|
url: "@Url.Action("getsqqtbxmx")?key=0000000&id=@Request.QueryString["id"]",
|
|
rownumber: true,
|
|
usePager: false,
|
|
enabledEdit: true,
|
|
heightDiff: -27,
|
|
//toolbar: {
|
|
// items: [
|
|
// { text: '增加', click: edit, icon: 'add' }
|
|
// ]
|
|
//},
|
|
//onDblClickRow: function (rowdata, rowid, rowobj) {
|
|
// liger.get("grid2").remove(rowdata);
|
|
// //计算
|
|
// sum();
|
|
//},
|
|
onAfterEdit: function (e) {
|
|
//计算
|
|
sum();
|
|
}
|
|
});
|
|
|
|
//添加时补齐6行 要等grid加载完 add才有效 延迟一会
|
|
//liger grid 就onloaded事件好用 但是这个事件 弹出加载中 不会消失
|
|
if (!GetQueryString("id")) {
|
|
setTimeout(function () { add(6) }, 500);
|
|
}
|
|
|
|
//有显示权限 都不验证金额
|
|
if ("@ViewBag.show" == "True") {
|
|
$("#title2").html("(无需申请单)");
|
|
}
|
|
})
|
|
function add(count) {
|
|
if (count <= 0) {
|
|
return;
|
|
}
|
|
var rowdata = {};
|
|
rowdata.title = "";
|
|
rowdata.content = "";
|
|
rowdata.sl = 1;
|
|
rowdata.je = 0;
|
|
rowdata.kmmc = "";
|
|
liger.get("grid2").add(rowdata);
|
|
add(--count)
|
|
}
|
|
function sub(e) {
|
|
var rowindex = e.parentNode.parentNode.parentNode.rowIndex;
|
|
if (rowindex >= 6) {
|
|
var r = liger.get("grid2").getRow(rowindex);
|
|
liger.get("grid2").remove(r);
|
|
}
|
|
else {
|
|
liger.get("grid2").updateCell("content", "", rowindex)
|
|
liger.get("grid2").updateCell("je", 0, rowindex)
|
|
}
|
|
|
|
//计算
|
|
sum();
|
|
}
|
|
|
|
function edit(item) {
|
|
if (item.text === "增加") {
|
|
var rowdata = {};
|
|
rowdata.title = "";
|
|
rowdata.content = "";
|
|
rowdata.sl = 1;
|
|
rowdata.je = 0;
|
|
liger.get("grid2").add(rowdata);
|
|
}
|
|
}
|
|
function sum() {
|
|
var rows = liger.get("grid2").getData();
|
|
var result = 0;
|
|
for (var i in rows) {
|
|
result += parseFloat(rows[i].je);
|
|
}
|
|
|
|
$("#je").val(result.toFixed(2));
|
|
}
|
|
|
|
function save() {
|
|
liger.get("grid2").endEdit();
|
|
var rows = liger.get("grid2").getData();
|
|
if (rows.length == 0) {
|
|
$.ligerDialog.error("请添加明细!")
|
|
return;
|
|
}
|
|
for (var i in rows) {
|
|
if (rows[i].content == "" && rows[i].je != 0) {
|
|
$.ligerDialog.error("明细带金额的内容必填!")
|
|
return;
|
|
}
|
|
}
|
|
|
|
var id = $("#id").val();
|
|
var je = $("#je").val();
|
|
var bz = $("#bz").val();
|
|
var fyly1 = false;
|
|
var fyly2 = $("#fyly2:checked").val();
|
|
var fyly = "";
|
|
var fydh = $("#fydh").val();
|
|
var fydhs = $("#fydhs").val();
|
|
var fydh2 = $("#fydh2").val();
|
|
var dydh = $("#dydh").val();
|
|
var hblx = $("#hblx").val();
|
|
var sqje = $("#sqje").val();
|
|
if (!je || !bz) {
|
|
$.ligerDialog.error("金额、报销内容必填!")
|
|
return;
|
|
}
|
|
|
|
//有显示权限 都不验证金额
|
|
if ("@ViewBag.show" == "False") {
|
|
//if (parseFloat(je) > parseFloat($("#sqje").val())) {
|
|
// $.ligerDialog.error("报销金额不能大于申请金额!")
|
|
// return;
|
|
//}
|
|
}
|
|
|
|
var items = "";
|
|
for (var i in rows) {
|
|
if (rows[i].content)
|
|
items += rows[i].title + "|" + rows[i].content + "|" + rows[i].sl + "|" + rows[i].je + ",";
|
|
}
|
|
if (!items) {
|
|
$.ligerDialog.error("至少维护一条明细!")
|
|
return;
|
|
}
|
|
if (filecount == 0) {
|
|
$.ligerDialog.error("附件必填!")
|
|
return;
|
|
}
|
|
|
|
$.ajax({
|
|
url: "@Url.Action("savesqqtbx")", type: "post", dataType: "json", data: { id: id, je: je, bz: bz, fyly1: fyly1, fyly2: fyly2, fyly: fyly, fydh: fydh, fydhs: fydhs, fydh2: fydh2, dydh: dydh, hblx: hblx, sqje: sqje, items: items },
|
|
success: function (d) {
|
|
$.ligerDialog.closeWaitting();
|
|
if (d.State == "0") {
|
|
$.ligerDialog.error("操作失败!");
|
|
}
|
|
else {
|
|
$.ligerDialog.success("操作成功!");
|
|
parent.init();
|
|
//window.opener.init();
|
|
//window.opener = null;
|
|
//window.close();
|
|
}
|
|
},
|
|
beforeSend: function () {
|
|
$.ligerDialog.waitting("正在进行请稍后……");
|
|
}
|
|
});
|
|
}
|
|
|
|
//附件
|
|
function sqfile(show) {
|
|
var openf3 = $.ligerDialog.open({
|
|
url: "@Url.Action("sqfile")?show=" + show + "&type=" + encodeURIComponent("其他报销") + "&sqid=" + @Model.id,
|
|
title: "附件管理",
|
|
width: 700,
|
|
height: 300,
|
|
allowClose: false
|
|
});
|
|
}
|
|
//附件反馈 (必填)
|
|
var filecount = @ViewBag.filecount;
|
|
|
|
function init() {
|
|
openf2.close();
|
|
}
|
|
//弹出框选中
|
|
@*function selectedQTBXFYZC(rowdata) {
|
|
$("#dydh").val(rowdata.id);
|
|
$("#hblx").val(rowdata.hblx); //多表 需要合并类型区分
|
|
//项目经费赋值
|
|
$("#fydh").val(rowdata.fydh);
|
|
$("#fydhs").val(rowdata.fydhs);
|
|
//console.log(rowdata.fydhs);
|
|
$("#fydh2").val(rowdata.fydh2);
|
|
$("#sqje").val(rowdata.je);
|
|
openf2.close();
|
|
|
|
if (rowdata.hblx == "公务接待") {
|
|
openf2 = $.ligerDialog.open({
|
|
title: "公务接待填写",
|
|
url: "@Url.Action("sqgwjdMessageTx")?id=" + rowdata.id,
|
|
width: 700,
|
|
height: 500
|
|
});
|
|
}
|
|
}*@
|
|
//弹出框选中
|
|
function selectedQTBXFYZC2(ids, hblxs, fydh, fydhs, fydh2, jes) {
|
|
$("#dydh").val(ids);
|
|
$("#hblx").val(hblxs); //多表 需要合并类型区分
|
|
//项目经费赋值
|
|
$("#fydh").val(fydh);
|
|
$("#fydhs").val(fydhs);
|
|
$("#fydh2").val(fydh2);
|
|
$("#sqje").val(jes);
|
|
openf2.close();
|
|
}
|
|
|
|
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">
|
|
<div position="top">
|
|
@Html.HiddenFor(m => m.id)
|
|
@Html.HiddenFor(m => m.fydh)
|
|
@Html.HiddenFor(m => m.fydhs)
|
|
@Html.HiddenFor(m => m.fydh2)
|
|
@Html.HiddenFor(m => m.hblx)
|
|
<h3 style="text-align:center;margin:10px 0 10px 0">德城区疾控中心其他报销申请单<span id="title2"></span></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">@Html.TextBoxFor(m => m.sqje, new { @style = "width:90px;text-align:center", @class = "l-text ", @readonly = "readonly" })</td>
|
|
<td class="ltd" width="70px">经费分解:</td>
|
|
<td class="rtd" width="150px">
|
|
@if (ViewBag.show)
|
|
{
|
|
@Html.CheckBoxFor(m => m.fyly2)
|
|
}
|
|
else
|
|
{
|
|
@Html.CheckBoxFor(m => m.fyly2, new { disabled = "disabled" })
|
|
}
|
|
项目经费
|
|
</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 { @style = "width:90px", @class = "l-text l-text-field-number", @type = "number", @readonly = "readonly" })</td>
|
|
<td class="ltd" width="70px">报销关联:</td>
|
|
<td class="rtd" width="150px">@Html.TextBoxFor(m => m.dydh, new { @class = "l-text", @readonly = "readonly", @style = "color:red" })*</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="ltd" width="70px">报销内容:</td>
|
|
<td class="rtd" colspan="5">@Html.TextAreaFor(m => m.bz, new { @rows = "2", @style = "width:97%" })*</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div id="layout1">
|
|
<div position="center" title="">
|
|
<div id="grid2"></div>
|
|
</div>
|
|
<div position="bottom">
|
|
<div style="text-align:center;margin-top:10px">
|
|
<a href="~/Content/fjsm.jpg" target="_blank">附件说明</a>
|
|
<input type="@Request.QueryString["type"]" readonly="readonly" value="附件管理*" class="l-button" onclick="sqfile('')" />
|
|
<input type="@Request.QueryString["type"]" readonly="readonly" value="申请" class="l-button" onclick="save()" />
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|