249 lines
9.6 KiB
Plaintext
249 lines
9.6 KiB
Plaintext
@{
|
|
ViewBag.Title = "预约时间记录";
|
|
Layout = "~/Views/Shared/_MainLayout.cshtml";
|
|
}
|
|
|
|
@section JS{
|
|
|
|
<script type="text/javascript">
|
|
var g_grid = {};
|
|
$(function () {
|
|
$("#DateFromappointmenttime").val(new Date().Format("yyyy-MM-dd"));
|
|
$("#DateToappointmenttime").val(new Date().Format("yyyy-MM-dd"));
|
|
var PostData = { appointmenttimeStart: new Date().Format("yyyy-MM-dd"), appointmenttimeEnd: new Date().Format("yyyy-MM-dd") };
|
|
$(".datepicker").datepicker({ changeMonth: true, changeYear: true, showButtonPanel: true, showOtherMonths: true, selectOtherMonths: true });
|
|
var grid = jQuery('#listGrid').jqGrid({
|
|
url: '/book_calendar/book_calendarQuery',
|
|
datatype: 'json',
|
|
|
|
height: 'auto',
|
|
width: '96%',
|
|
autowidth: false,
|
|
shrinkToFit: false,
|
|
viewrecords: true,
|
|
jsonReader: { repeatitems: false },
|
|
caption: '',
|
|
mtype: 'POST',
|
|
postData: PostData,
|
|
afterInsertRow: AfterInsertRow,
|
|
onSelectRow: rowclick,
|
|
ondblClickRow: rowdblclick,
|
|
colModel: colModelGrid,
|
|
pager: jQuery('#pagerGrid'),
|
|
pagerpos: 'left',
|
|
rowNum: 20,
|
|
rowList: [20, 30, 50, 200, 10000],
|
|
footerrow: false,
|
|
loadComplete: gridComplete,
|
|
onPaging: onJqgridPaging,
|
|
grouping: true,
|
|
footerrow: false
|
|
});
|
|
|
|
g_grid = jQuery('#listGrid');
|
|
|
|
function keyEnter(event) {
|
|
try {
|
|
var e = event ? event : (window.event ? window.event : null);
|
|
if (e.keyCode == 13) {
|
|
SearchClick(true);
|
|
}
|
|
} catch (e) {
|
|
|
|
}
|
|
}
|
|
|
|
document.onkeydown = keyEnter;
|
|
try {
|
|
SetAceDropDown();
|
|
} catch (e) {
|
|
|
|
}
|
|
function AfterInsertRow(rowid, aData) {
|
|
}
|
|
|
|
$("#IsClientNeedBook").click(function () {
|
|
main.confirm("确认修改双录预约限制?", function () {
|
|
main.post("/valuedate/SaveIsClientNeedBook", { isClientNeedBook: $("#IsClientNeedBook").prop("checked") });
|
|
});
|
|
})
|
|
});
|
|
|
|
var colModelGrid = [{
|
|
name: 'id', label: 'id', index: 'id', width: 1, align: 'center', hidden: true
|
|
}, {
|
|
name: 'EncryptId', label: 'EncryptId', index: 'EncryptId', width: 0, align: 'center', hidden: true
|
|
}, {
|
|
name: 'clientid', label: '客户人员', index: 'clientid', width: 150, align: 'center', hidden: true
|
|
}, {
|
|
name: 'clientname', label: '客户名称', index: 'clientname', width: 150, align: 'center'
|
|
}, {
|
|
name: 'workid', label: '双录人员信息', index: 'workid', width: 150, align: 'center', hidden: true
|
|
}, {
|
|
name: 'workname', label: '双录人员', index: 'workname', width: 150, align: 'center'
|
|
}, {
|
|
name: 'appointmenttime', label: '预约时间', index: 'appointmenttime', width: 150, align: 'center'
|
|
}, {
|
|
name: 'optdate', label: '操作时间', index: 'optdate', width: 150, align: 'center', hidden: true
|
|
}, {
|
|
name: 'state', label: '状态', index: 'state', width: 150, align: 'center', formatter: stateFormat
|
|
}, {
|
|
name: '', label: '操作', index: '', width: 150, align: 'center', formatter: customButton
|
|
}];
|
|
|
|
function gridComplete() {
|
|
}
|
|
|
|
|
|
function customButton(cellValue, options, rowObject) {
|
|
if (rowObject.state == "待确认" || rowObject.state == null || rowObject.state == undefined || rowObject.state == "") {
|
|
var imageHtml = "<input type=\"button\" value=\"确认\" class=\"wentiEdit\" onclick=\"ensurebook_calendar('" + rowObject.EncryptId + "');\" />";
|
|
imageHtml += "<input type=\"button\" value=\"拒绝\" class=\"wentiEdit\" onclick=\"denybook_calendar('" + rowObject.EncryptId + "');\" />";
|
|
return imageHtml;
|
|
}
|
|
if (rowObject.state == "已确认") {
|
|
var imageHtml = "<input type=\"button\" value=\"完成\" class=\"wentiEdit\" onclick=\"completebook_calendar('" + rowObject.EncryptId + "');\" />";
|
|
return imageHtml;
|
|
}
|
|
return "";
|
|
}
|
|
|
|
function stateFormat(cellValue, options, rowObject) {
|
|
if (cellValue == null || cellValue == undefined || cellValue == "") {
|
|
return "待确认"
|
|
}
|
|
else {
|
|
return cellValue
|
|
}
|
|
}
|
|
|
|
function deletebook_calendar(encryptId) {
|
|
if (confirm("确定删除吗?")) {
|
|
$.ajax({
|
|
type: "Post",
|
|
url: "/book_calendar/Deletebook_calendar",
|
|
data: { id: encryptId, d: new Date() },
|
|
success: function (data) {
|
|
showmiddlemessage(data.obj);
|
|
if (data.success == true) {
|
|
$('#listGrid').trigger('reloadGrid');
|
|
}
|
|
},
|
|
error: function (msg) {
|
|
alert("error:" + msg);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function ensurebook_calendar(encryptId) {
|
|
if (confirm("确定同意双录时间?")) {
|
|
$.ajax({
|
|
type: "Post",
|
|
url: "/book_calendar/Ensurebook_calendar",
|
|
data: { id: encryptId, d: new Date() },
|
|
success: function (data) {
|
|
showmiddlemessage(data.msg);
|
|
if (data.success == true) {
|
|
$('#listGrid').trigger('reloadGrid');
|
|
}
|
|
},
|
|
error: function (msg) {
|
|
alert("error:" + msg);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function denybook_calendar(encryptId) {
|
|
if (confirm("确定拒绝双录时间?")) {
|
|
$.ajax({
|
|
type: "Post",
|
|
url: "/book_calendar/Denybook_calendar",
|
|
data: { id: encryptId, d: new Date() },
|
|
success: function (data) {
|
|
showmiddlemessage(data.msg);
|
|
if (data.success == true) {
|
|
$('#listGrid').trigger('reloadGrid');
|
|
}
|
|
},
|
|
error: function (msg) {
|
|
alert("error:" + msg);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function completebook_calendar(encryptId) {
|
|
if (confirm("确定同意双录时间?")) {
|
|
$.ajax({
|
|
type: "Post",
|
|
url: "/book_calendar/Completebook_calendar",
|
|
data: { id: encryptId, d: new Date() },
|
|
success: function (data) {
|
|
showmiddlemessage(data.msg);
|
|
if (data.success == true) {
|
|
$('#listGrid').trigger('reloadGrid');
|
|
}
|
|
},
|
|
error: function (msg) {
|
|
alert("error:" + msg);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function showToolName(cellValue, options, rowObject) {
|
|
var html = "<input type=\"button\" class=\"wentiEdit\" title='查看预约时间记录' onclick=\"startbook_calendarView('{0}')\" value=\"{1}\" />".template(rowObject.EncryptId, "查看");
|
|
return html;
|
|
}
|
|
|
|
function rowclick(id) {
|
|
|
|
}
|
|
function startAddbook_calendar() {
|
|
var addurl = "/book_calendar/book_calendarEdit/0";
|
|
main.open("新增预约时间记录", addurl);
|
|
}
|
|
function startbook_calendarView(id) {
|
|
var srcurl = "/book_calendar/book_calendarView/?enid=" + id;
|
|
main.open("查看预约时间记录", srcurl);
|
|
}
|
|
|
|
function reloadbook_calendar() {
|
|
//重新加载
|
|
SearchClick();
|
|
}
|
|
|
|
function SearchClick(isSearchclick) {
|
|
var listGrid = $('#listGrid');
|
|
|
|
listGrid.appendPostData({ clientname: $("#clientname").val() });
|
|
listGrid.appendPostData({ workname: $("#workname").val() });
|
|
listGrid.appendPostData({ appointmenttimeStart: $("#DateFromappointmenttime").val() });
|
|
listGrid.appendPostData({ appointmenttimeEnd: $("#DateToappointmenttime").val() });
|
|
|
|
if (typeof (isSearchclick) != "undefined" && isSearchclick) {
|
|
//点击搜索时默认第一页
|
|
listGrid.jqGrid('setGridParam', {
|
|
page: 1
|
|
});
|
|
}
|
|
listGrid.trigger('reloadGrid');
|
|
}
|
|
</script>
|
|
}
|
|
|
|
<div class="searchdiv">
|
|
@Html.ShortInput("clientname", "客户名称")
|
|
@Html.ShortInput("workname", "双录人员")
|
|
@Html.SearchDateRange("appointmenttime", "预约时间")
|
|
@MyControls.SearchBtn()
|
|
<div style="display: inline; word-break: keep-all; white-space: nowrap; margin-left: 20px;">
|
|
开户审批是否受限于双录预约:
|
|
<input type="checkbox" class="check" id="IsClientNeedBook" @(ViewBag.IsClientNeedBook ? "checked" : "") />
|
|
</div>
|
|
</div>
|
|
@Html.Raw(JqGridSimple.OutTable())
|
|
|