ComplianceServer/oldcode/WEB/Views/WeiXin/ComplaintAttendance/Index.cshtml

261 lines
8.7 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.

@using WX.CRM.WebHelper
@{
ViewBag.Title = "";
Layout = "~/Views/Shared/_Index_Layout2.cshtml";
}
<style type="text/css">
.table1 td {
height: 30px;
}
</style>
<div class="mvctool">
@Html.ToolButton("btnQuery", "icon-search", "查询", true)
@Html.ToolButton("btnAdd", "icon-add", "添加", true)
@Html.ToolButton("btnEdit", "icon-edit", "修改", true)
@Html.Action("ToolBar", "Control", ViewBag.ToolBar as ToolBar)
</div>
<div class="bas_datagrid">
<div id="tb" style="padding:5px;height:auto" class="grid_toolbar">
<ul class="toolBar_ul">
<li>
年:<select id="year">
<option>2016</option>
<option>2017</option>
<option>2018</option>
<option>2019</option>
<option>2020</option>
<option>2021</option>
<option>2022</option>
<option>2023</option>
<option>2024</option>
<option>2025</option>
<option>2026</option>
<option>2027</option>
<option>2028</option>
<option>2029</option>
<option>2030</option>
</select>
月:<select id="month">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
</select>
</li>
<li>工号:<input type="text" id="txt_eid" name="txt_eid" /></li>
</ul>
</div>
@Html.Raw(ViewBag.RptList)
</div>
<div id="dlg4" class="easyui-dialog" closed="true" style="width: 600px; height: 400px; padding: 10px;">
<table class="table1">
<tr>
<td align="right">
年:
</td>
<td>
<select id="SltYear">
<option>2016</option>
<option>2017</option>
<option>2018</option>
<option>2019</option>
<option>2020</option>
<option>2021</option>
<option>2022</option>
<option>2023</option>
<option>2024</option>
<option>2025</option>
<option>2026</option>
<option>2027</option>
<option>2028</option>
<option>2029</option>
<option>2030</option>
</select>
月:<select id="SltMonth">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>10</option>
<option>11</option>
<option>12</option>
</select>
</td>
</tr>
<tr>
<td align="right">工号:</td>
<td><input id="eid" name="eid" type="text" /></td>
</tr>
<tr>
<td align="right">投诉次数:</td>
<td><input id="tousu" name="tousu" type="text" />次</td>
</tr>
<tr>
<td align="right">处罚次数:</td>
<td><input id="chufa" name="chufa" type="text" />次</td>
</tr>
<tr>
<td align="right">出勤率:</td>
<td><input id="chuqin" name="chuqin" type="text" />%填写出勤率百分比例如90%</td>
</tr>
<tr>
<td></td>
<td>
<input type="hidden" id="pkid"/>
<input id="BtnSave" name="BtnSave" type="button" value="确认" onclick="BtnSave()"/>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
$(function () {
$(window).resize(function () {
$('#tablist').tablegrid('resize', {
height: $(window).height() - 110
});
});
var today = new Date();
$("#SltYear").val(today.getFullYear());
var m = "0000" + today.getMonth() + "";
$("#SltMonth").val(m.substring(m.length - 2));
$("#year").val(today.getFullYear());
$("#month").val(m.substring(m.length - 2));
LoadData();
$("#btnQuery").click(function () {
LoadData();
});
$("#btnAdd").click(function () {
AuditSingle("add", null, null, null, null, null, null, null);
});
$("#btnEdit").click(function () {
var row = $("#tablist").tablegrid("getSelected");
if (row != null) {
var arr = row.month.split('-');
AuditSingle("edit", row.pkid, arr[0], arr[1], row.eid, row.tousu, row.chufa, row.chuqin);
} else { $.messageBox5s('提示', "选中要确认的数据!"); }
});
});
function LoadData() {
$("#tablist").tablegrid({
url: '/weixin/ComplaintAttendance/index',
height: $(window).height() - 110,
loadNow: true,
isPage: true,
data: GetControlValue()
});
}
function GetControlValue() {
return { year: $("#year").val(), month: $("#month").val(), eid: $("#txt_eid").val() };
}
function AuditSingle(type, pkid, year, month, eid, tousu, chufa, chuqin) {
if (type === "edit") {
$("#pkid").val(pkid);
$("#eid").val(eid);
$("#SltYear").val(year);
$("#SltMonth").val(month);
$("#tousu").val(tousu);
$("#chufa").val(chufa);
$("#chuqin").val(chuqin);
} else {
$("#pkid").val("");
$("#eid").val("");
$("#tousu").val("");
$("#chufa").val("");
$("#chuqin").val("");
}
$('#dlg4').dialog({
title: "员工投诉/处罚/考勤率录入",
width: 550,
height: 250,
closed: false,
cache: false,
modal: true
});
}
function BtnSave() {
var pkid = $("#pkid").val();
var year = $("#SltYear").val();
var month = $("#SltMonth").val();
var eid = $("#eid").val();
var tousu = $("#tousu").val();
var chufa = $("#chufa").val();
var chuqin = $("#chuqin").val();
if (eid === "") {
alert("工号不能为空!");
return;
}
//if (tousu === "" && chufa === "" && chuqin === "") {
// alert("投诉/处罚/考勤率 至少填一个!");
//}
if (tousu !== "") {
if (isNaN(tousu)) {
alert("投诉次数必须是数字");
return;
}
if (tousu <= 0) {
alert("投诉次数小于等于0不需要填写");
return;
}
}
if (chufa !== "") {
if (isNaN(chufa)) {
alert("处罚次数必须是数字");
return;
}
if (chufa <= 0) {
alert("处罚次数小于等于0不需要填写");
return;
}
}
if (chuqin !== "") {
if (isNaN(chuqin)) {
alert("出勤率必须是数字");
return;
}
if (chuqin <= 0) {
alert("出勤率小于等于0不需要填写");
return;
}
if (chuqin > 90) {
alert("出勤率大于90不需要填写");
return;
}
}
$.r_ajax({
url: "/weixin/ComplaintAttendance/AddOrUpdate",
type: "Post",
data: { pkid: pkid, year: year, month: month, eid: eid, tousu: tousu, chufa: chufa, chuqin: chuqin },
dataType: "json",
loading: true,
success: function (data) {
if (data.result === "ok") {
$('#dlg4').dialog('close');
LoadData();
$.messageBox5s('提示', data.message);
}
else {
$.messageBox5s('提示', data.message);
}
}
});
}
</script>