270 lines
9.1 KiB
Plaintext
270 lines
9.1 KiB
Plaintext
@{
|
|
ViewBag.Title = "销售人员列表";
|
|
Layout = "~/Views/Shared/_MainLayout.cshtml";
|
|
}
|
|
@section CSS{
|
|
<link href="~/Style/Css/bankcardView.css" />
|
|
}
|
|
<style>
|
|
.OptName-wrap, .date-wrap {
|
|
display: none !important;
|
|
}
|
|
|
|
.spanNone {
|
|
display: none;
|
|
}
|
|
|
|
.no-skin {
|
|
position: initial !important;
|
|
}
|
|
</style>
|
|
@section JS{
|
|
<script type="text/javascript">
|
|
var g_grid = {};
|
|
var query_data = {};
|
|
$(function () {
|
|
var PostData = {};
|
|
$(".datepicker").datepicker({
|
|
changeMonth: true,
|
|
changeYear: true,
|
|
showButtonPanel: true,
|
|
showOtherMonths: true,
|
|
selectOtherMonths: true
|
|
});
|
|
@Html.Raw(JqGridSimple.OutGrid("/SalesCommissionManage/SalesmenQuery"));
|
|
g_grid = jQuery('#listGrid');
|
|
|
|
function keyEnter(event) {
|
|
try {
|
|
var e = event ? event : (window.event ? window.event : null);
|
|
(e.keyCode == 13)&& SearchClick(true);
|
|
} catch (e) {}
|
|
}
|
|
|
|
document.onkeydown = keyEnter;
|
|
SetAceDropDown();
|
|
});
|
|
|
|
var colModelGrid = [
|
|
{
|
|
name: 'id',
|
|
label: 'id',
|
|
index: 'id',
|
|
hidden: true,
|
|
optionHide: true
|
|
}, {
|
|
name: 'Name',
|
|
label: '姓名',
|
|
index: 'Name',
|
|
width: 150,
|
|
}, {
|
|
name: 'Department',
|
|
label: '部门',
|
|
index: 'Department',
|
|
width: 150
|
|
}, {
|
|
name: 'Mail',
|
|
label: '邮箱',
|
|
index: 'Mail',
|
|
width: 200
|
|
}, {
|
|
name: 'Telephone',
|
|
label: '座机',
|
|
index: 'Telephone',
|
|
width: 200
|
|
}, {
|
|
name: 'Mobile',
|
|
label: '手机',
|
|
index: 'Mobile',
|
|
width: 200,
|
|
|
|
}, {
|
|
name: 'Status',
|
|
label: '状态 ',
|
|
index: 'Status',
|
|
formatter: statusFormatter,
|
|
width: 100
|
|
}, {
|
|
name: '',
|
|
label: '操作',
|
|
index: '',
|
|
sortable: false,
|
|
width: 136,
|
|
formatter: showToolName,
|
|
classes: 'actrion'
|
|
}
|
|
]
|
|
|
|
function rowdblclick(rowid) {
|
|
var rowData = $(this).getRowData(rowid);
|
|
startSalesmenView(rowData.id);
|
|
}
|
|
|
|
function statusFormatter(cellValue, options, rowObject) {
|
|
if (rowObject.Status == "0") {
|
|
return "正常";
|
|
}
|
|
else {
|
|
return "禁用";
|
|
}
|
|
}
|
|
|
|
function showToolName(cellValue, options, rowObject) {
|
|
var html =
|
|
"<input type=\"button\" class=\"wentiEdit\" title='修改' onclick=\"startSalesmanView('{0}')\" value=\"{1}\" />"
|
|
.template(rowObject.id, "修改");
|
|
html = html +
|
|
"<input type=\"button\" class=\"wentiEdit\" title='删除' onclick=\"deleteSalesman('{0}')\" value=\"{1}\" />"
|
|
.template(rowObject.id, "删除");
|
|
return html;
|
|
}
|
|
|
|
function rowclick(id) {
|
|
|
|
}
|
|
|
|
function startAddSalesman() {
|
|
var srcurl = "/SalesCommissionManage/SalesmanEdit/0";
|
|
main.open("新增销售员", srcurl, { area: ['450px', '450px'] });
|
|
}
|
|
|
|
function deleteSalesman(id) {
|
|
if (confirm("确定删除吗?")) {
|
|
$.ajax({
|
|
type: "Post",
|
|
url: "/SalesCommissionManage/DeleteSalesman",
|
|
data: { id: id, d: new Date() },
|
|
success: function (data) {
|
|
showmiddlemessage(data.msg);
|
|
reloadSalesmen2();
|
|
},
|
|
error: function (msg) {
|
|
alert("error:" + msg);
|
|
}
|
|
});
|
|
}
|
|
}
|
|
|
|
function startSalesmanView(id) {
|
|
var srcurl = "/SalesCommissionManage/SalesmanEdit/?enid=" + id;
|
|
main.open("查看销售员信息", srcurl, { area: ['450px', '450px']});
|
|
}
|
|
|
|
function reloadSalesmen() {
|
|
//重新加载
|
|
SearchClick();
|
|
window.layer.closeAll();
|
|
}
|
|
|
|
function reloadSalesmen2() {
|
|
//重新加载
|
|
SearchClick();
|
|
}
|
|
|
|
function uploadSalesmen(id) {
|
|
var scrurl = "/SalesCommissionManage/SalesmenUpload";
|
|
main.open("销售员导入", scrurl, { area: ['550px', '300px'] });
|
|
}
|
|
|
|
function exportSalesmenChoose() {
|
|
var htmlContent =
|
|
'<div style="padding:30px">' +
|
|
'<input class="btn btn-primary " type="button" style="width:auto;height:29px;border: none;border-radius: 3px;margin-right:20px" onclick="exprotChooseColumn();return false;" value="导出可选列">' +
|
|
'<input class="btn btn-primary " type="button" style="width:auto;height:29px;border: none;border-radius: 3px;margin-right:20px" onclick="exportSalesmenMouldExcel();return false;" value="导出销售员信息模板">' +
|
|
'</div>';
|
|
layer.open({
|
|
type: 1,
|
|
title: "导出销售员列表",
|
|
shadeClose: false,
|
|
shade: 0.4,
|
|
area: ['800px', '150px'],
|
|
content: htmlContent
|
|
});
|
|
}
|
|
|
|
function exprotChooseColumn() {
|
|
var dateTemp = new Date().Format("yyyyMMddhhmmss");
|
|
var fileName = "销售员个人信息_" + dateTemp;
|
|
main.toExcel("listGrid", fileName, "xls", null, "操作", [
|
|
{
|
|
colName: "座机",
|
|
formatter:"text"
|
|
},
|
|
{
|
|
colName: "手机",
|
|
formatter: "text"
|
|
}
|
|
]);
|
|
return;
|
|
}
|
|
|
|
function exportSalesmenMouldExcel() {
|
|
window.open("../App_Docs/销售员信息导入模板.xlsx");
|
|
}
|
|
|
|
$("#Name").change(function () {
|
|
var value = $("#Name").val();
|
|
$("#Name").attr("title", value);
|
|
});
|
|
|
|
function downCsv(fileName, exStrr) {
|
|
var isIE = (navigator.userAgent.indexOf('MSIE') >= 0);
|
|
if (isIE) {
|
|
var strHTML = exStrr;
|
|
var winSave = window.open();
|
|
winSave.document.open("text", "utf-8");
|
|
winSave.document.write(strHTML);
|
|
winSave.document.execCommand("SaveAs", true, fileName + ".csv");
|
|
winSave.close();
|
|
} else {
|
|
var mimeType = 'text/plain';
|
|
$('#createInvote').attr('download', fileName + ".csv");
|
|
//\uFEFF bom
|
|
$('#createInvote').attr('href',
|
|
'data:' + mimeType + ';charset=utf-8,\uFEFF' + encodeURIComponent(exStrr));
|
|
document.getElementById('createInvote').click();
|
|
}
|
|
}
|
|
|
|
function SearchClick(isSearchclick) {
|
|
var listGrid = $('#listGrid');
|
|
|
|
listGrid.appendPostData({ ids: $("#ids").val() == null ? "" : $("#ids").val().join(",") });
|
|
listGrid.appendPostData({ departments: $("#departments").val() == null ? "" : $("#departments").val().join(",") });
|
|
|
|
query_data = {
|
|
ids: $("#ids").val() == null ? "" : $("#ids").val().join(","),
|
|
departments: $("#departments").val() == null ? "" : $("#departments").val().join(",")
|
|
}
|
|
|
|
if (typeof (isSearchclick) != "undefined" && isSearchclick) {
|
|
//点击搜索时默认第一页
|
|
listGrid.jqGrid('setGridParam',{page: 1});
|
|
}
|
|
listGrid.trigger('reloadGrid');
|
|
}
|
|
function gridComplete() {
|
|
main.setcolumnChooser(jQuery('#listGrid'), "@configcolumn_data.销售员列表");
|
|
}
|
|
|
|
function showcolumnChooser() {
|
|
main.showcolumnChooser(jQuery('#listGrid'), "@configcolumn_data.销售员列表");
|
|
}
|
|
|
|
</script>
|
|
}
|
|
|
|
<div class="searchdiv">
|
|
@Html.MyAceDropdownInput("ids", "销售员", SalesDataModel.GetAllSalesmen())
|
|
@Html.MyAceDropdownInput("departments", "部门", SalesDataModel.GetDepartment())
|
|
@MyControls.SearchBtn()
|
|
@MyControls.Btn("新增销售员", "startAddSalesman()")
|
|
@MyControls.Btn("批量销售员导入", "uploadSalesmen()")
|
|
@MyControls.Btn("导出销售员列表", "exportSalesmenChoose()")
|
|
<div style="width:30px;display:inline;" onclick="showcolumnChooser();return false;">
|
|
<img src="~/Images/configure.png" />
|
|
</div>
|
|
</div>
|
|
@Html.Raw(JqGridSimple.OutTable())
|
|
|