TG.WXCRM.V4/WEB/Views/WeiXin/AfterSales/Index.cshtml

150 lines
5.8 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";
}
<div class="mvctool">
@Html.ToolButton("btnQuery", "icon-search", "查询", 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>客户ID<input type="text" name="txt_resid" style="width:120px;" />&nbsp;</li>
<li>售后工号:<input type="text" value="" name="txt_aftersale" />&nbsp;</li>
<li>
分配状态:<select id="slt_bindType" name="slt_bindType" style="height: 22px;">
<option value="">全部</option>
<option value="0" selected>未分配</option>
<option value="1">已分配</option>
</select>&nbsp;
</li>
<li><input type="checkbox" name="samllorder" id="samllorder" />显示100元以下订单</li>
<li>
赠送到期时间:@Html.WdatePickerText("txt_overstarttime", "")-@Html.WdatePickerText("txt_overendtime", "")
@*<input type="hidden" value="CustomerZJL02" id="txt_amounttypeid" name="txt_amounttypeid" />*@@*10万以下*@
</li>
<li>
资金量:
<select id="slt_amounttypeid" name="slt_amounttypeid">
@{ IEnumerable<SelectListItem> itemlist = ViewBag.ZJL as IEnumerable<SelectListItem>;}
<option value="">--请选择--</option>
@foreach (SelectListItem item in itemlist)
{
<option value="@item.Value" @Html.Raw(item.Value == "CustomerZJL02" ? "selected=\"selected\"" : "")>@item.Text</option>
}
</select>
</li>
</ul>
</div>
@Html.Raw(ViewBag.GroupList)
</div>
<script type="text/javascript">
$(function () {
$('#tablist').tablegrid({
url: '/WeiXin/AfterSales/Index',
height: $(window).height() - 130,
loadNow: true,
data: GetControlValue,
isPage: true
});
function GetControlValue() {
return { samllorder: $("#samllorder").prop('checked') };
}
//$('#tablist').tablegrid("Load");
$("#btnQuery").click(function () {
$('#tablist').tablegrid("Search");
});
});
function onLoadSucced() {
$("#tablist").tablegrid("Search");
}
function frameReturnByClose() {
$("#modalwindow").window('close');
}
function frameReturnByReload(flag) {
$("#tablist").tablegrid("Load");
}
function frameReturnByMes(mes) {
$.messageBox5s('提示', mes);
}
function Save_Click() {
var inputValue = [];
$("input[name='aftersale']")
.each(function () {
if ($(this).attr("oldTUser") !== "" || $(this).val() !== "") {
inputValue.push({
Id: $(this).attr("id"),
OldUserId: $(this).attr("oldTUser"),
NewUserId: $(this).val(),
ResId: $(this).attr("resid")
});
}
});
if (inputValue.length > 0) {
$.r_post("/weixin/aftersales/Save", { aftersales: JSON.stringify(inputValue) }, function (data) {
if (data.type === 1) {
$("#tablist").tablegrid('Load');
$.messageBox5s('提示', data.message);
}
else if (data.type === 0) {
$.messageBox5s('提示', data.message);
}
else if (data.type === 10) {
var msg = "";
$.each(data.errors, function (i, j) {
msg += $("#" + j.PropertyName).val() + ":" + j.Message + ",";
});
$.messageBox5s('提示', msg);
}
}, "json");
}
else {
$.messageBox5s('提示', '请输入要变更的工号');
}
}
function Bind_Click() {
var row = $('#tablist').tablegrid('getSelected');
if (row != null) {
$("#modalwindow").html(GetIframeHtml("/WeiXin/AfterSales/Bind?resId=" + row.res + "&Ieguid=" + GetGuid()));
$("#modalwindow").window({ title: '绑定售后', width: 700, height: 600, iconCls: 'icon-edit' }).window('open');
} else { $.messageBox5s('提示', '@Suggestion.PlaseChooseToOperatingRecords'); }
}
function BatchBind_Click() {
$("#modalwindow").html(GetIframeHtml("/WeiXin/AfterSales/BatchBind?Ieguid=" + GetGuid()));
$("#modalwindow").window({ title: '批量重新绑定售后', width: 900, height: 700, iconCls: 'icon-edit' }).window('open');
}
function GetIframeHtml(src) {
return "<iframe width='100%' height='98%' scrolling='no' frameborder='0'' src='" + src + "'></iframe>";
}
//获取datagrid头部及字段
function getDataGridHeader() {
var columns = $('#tablist').tablegrid("getHead");
return columns;
}
function export_Click() {
var parm = GetQueryStr();
if (parm == null || parm == "" || parm == undefined) {
parm = "?smallorder=" + $("#samllorder").prop('checked');
}
else {
parm += "&smallorder=" + $("#samllorder").prop('checked');
}
$("#modalwindow").html(GetIframeHtml("/Control/ExcelExport?Query=" + encodeURIComponent("/WeiXin/AfterSales/Export?" + parm)));
$("#modalwindow").window({ title: '导出', width: 480, height: 300, iconCls: 'icon-export' }).window('open');
}
</script>