You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
221 lines
7.0 KiB
221 lines
7.0 KiB
@{
|
|
ViewData["Title"] = "供应商管理";
|
|
Layout = "~/Views/Shared/_Index.cshtml";
|
|
}
|
|
|
|
<div class="lr-layout">
|
|
<div class="lr-layout-center">
|
|
<div class="lr-layout-wrap lr-layout-wrap-notitle">
|
|
|
|
<div class="lr-layout-tool">
|
|
<div class="lr-layout-tool-left">
|
|
<div class="lr-layout-tool-item">
|
|
<div id="datesearch" class="datetime"></div>
|
|
</div>
|
|
<div class="lr-layout-tool-item">
|
|
<input id="txt_Keyword" type="text" class="form-control" placeholder="请输入要查询关键字"/>
|
|
</div>
|
|
<div class="lr-layout-tool-item">
|
|
<a id="btn_hint" class="fa fa-question-circle" style="font-size: 18px; color: orange;"></a>
|
|
<a id="btn_Search" class="btn btn-primary btn-sm"><i class="fa fa-search"></i> <span class="lrlg">查询</span></a>
|
|
<a id="btn_Reset" class="btn btn-default btn-sm"><i class="fa fa-refresh"></i> <span class="lrlg">重置</span></a>
|
|
</div>
|
|
</div>
|
|
<div class="lr-layout-tool-right">
|
|
<div class="btn-group btn-group-sm">
|
|
<a id="btn_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a>
|
|
</div>
|
|
<div class="btn-group btn-group-sm" learun-authorize="yes">
|
|
<a id="btn_add" class="btn btn-default"><i class="fa fa-plus"></i> <span class="lrlg">新增</span></a>
|
|
<a id="btn_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> <span class="lrlg">编辑</span></a>
|
|
<a id="btn_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> <span class="lrlg">删除</span></a>
|
|
<a id="btn_print" class="btn btn-default"><i class="fa fa-print"></i> <span class="lrlg">打印</span></a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="lr-layout-body" id="gridtable"></div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
var selectedRow;
|
|
var curParam = {
|
|
StartTime: '',
|
|
EndTime: '',
|
|
Keyword: ''
|
|
};
|
|
var checkJustReturn = false;
|
|
var bootstrap = function ($, learun) {
|
|
"use strict";
|
|
|
|
var page = {
|
|
init: function () {
|
|
page.bind();
|
|
page.initGrid();
|
|
},
|
|
bind: function () {
|
|
//日期查询
|
|
$('.datetime').each(function () {
|
|
$(this).lrdate({
|
|
//初始值
|
|
dfdata: [
|
|
{ name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
|
|
{ name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
|
|
{ name: '近1月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
|
|
{ name: '近3月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } },
|
|
],
|
|
// 初始索引值
|
|
dfvalue: '-1',
|
|
selectfn: function (begin, end) {
|
|
curParam.StartTime = begin;
|
|
curParam.EndTime = end;
|
|
page.search();
|
|
}
|
|
});
|
|
});
|
|
//提示
|
|
$('#btn_hint').popover({
|
|
trigger: 'hover',//触发方式
|
|
placement: 'right',//弹出框位置
|
|
html: true,//添加data-html="true"之后,data-content里面就可以添加HTML代码
|
|
//title: 'title',
|
|
content: " 查询时间:<br>创建时间<br>" +
|
|
" 查询关键字:<br>供应商名、负责人",
|
|
container: 'body'
|
|
});
|
|
// 查询
|
|
$('#btn_Search').on('click', function () {
|
|
curParam.Keyword = $('#txt_Keyword').val();
|
|
page.search();
|
|
});
|
|
// 重置
|
|
$('#btn_Reset').on('click', function () {
|
|
curParam = {};
|
|
checkJustReturn = true;
|
|
$('#datesearch').find('.lr-search-date-btn-block:last').find('a').click();
|
|
$('#txt_Keyword').val('');
|
|
checkJustReturn = false;
|
|
page.search();
|
|
});
|
|
// 刷新
|
|
$('#btn_refresh').on('click', function () {
|
|
location.reload();
|
|
});
|
|
//新增
|
|
$('#btn_add').on('click', function () {
|
|
selectedRow = null;
|
|
learun.layerForm({
|
|
id: 'form',
|
|
title: '新增',
|
|
url: top.$.rootUrl + '/AutoWeight/Supplier/Form',
|
|
width: 750,
|
|
height: 450,
|
|
callBack: function (id) {
|
|
return top[id].acceptClick(page.refreshData);
|
|
}
|
|
});
|
|
});
|
|
//编辑
|
|
$('#btn_edit').on('click', function () {
|
|
selectedRow = $('#gridtable').jfGridGet('rowdata');
|
|
var keyValue = $('#gridtable').jfGridValue('Id');
|
|
if (learun.checkrow(keyValue)) {
|
|
learun.layerForm({
|
|
id: 'form',
|
|
title: '编辑',
|
|
url: top.$.rootUrl + '/AutoWeight/Supplier/Form',
|
|
width: 750,
|
|
height: 450,
|
|
callBack: function (id) {
|
|
return top[id].acceptClick(page.refreshData);
|
|
}
|
|
});
|
|
}
|
|
});
|
|
//删除
|
|
$('#btn_delete').on('click', function () {
|
|
var keyValue = $('#gridtable').jfGridValue('Id');
|
|
if (learun.checkrow(keyValue)) {
|
|
learun.layerConfirm('是否确认删除该项!', function (res) {
|
|
if (res) {
|
|
learun.deleteForm(top.$.rootUrl + '/AutoWeight/Supplier/DeleteForm', { keyValue: keyValue }, function () {
|
|
page.refreshData();
|
|
});
|
|
}
|
|
});
|
|
}
|
|
});
|
|
},
|
|
initGrid: function () {
|
|
$('#gridtable').lrAuthorizeJfGrid({
|
|
url: top.$.rootUrl + '/AutoWeight/Supplier/GetPageList',
|
|
isPage: true,
|
|
mainId: 'Id',
|
|
rows: 30,
|
|
sidx: '',//排序字段只有在分页的情况下支持,多个字段用,隔开
|
|
headData: [
|
|
{
|
|
label: "Id", name: "Id", ishide: true
|
|
},
|
|
{
|
|
label: "名称", name: "Name", width: 150, align: "center", frozen: true
|
|
},
|
|
{
|
|
label: "负责人", name: "Manager", width: 80, align: "center", frozen: true
|
|
},
|
|
{
|
|
label: "电话", name: "FixedPhone", width: 120, align: "center"
|
|
},
|
|
{
|
|
label: "手机", name: "MobilePhone", width: 120, align: "center"
|
|
},
|
|
{
|
|
label: "邮箱", name: "Email", width: 120, align: "center"
|
|
},
|
|
{
|
|
label: "创建者", name: "CreateMan", width: 100, align: "center"
|
|
},
|
|
{
|
|
label: "创建时间", name: "CreateTime", width: 150, align: "center",
|
|
formatter: function (value, row, op, $cell) {
|
|
return learun.formatDate(value, 'yyyy-MM-dd hh:mm:ss');
|
|
}
|
|
},
|
|
{
|
|
label: "更新者", name: "UpdateMan", width: 100, align: "center"
|
|
},
|
|
{
|
|
label: "更新时间", name: "UpdateTime", width: 150, align: "center",
|
|
formatter: function (value, row, op, $cell) {
|
|
return learun.formatDate(value, 'yyyy-MM-dd hh:mm:ss');
|
|
}
|
|
},
|
|
{
|
|
label: "备注", name: "Remark", align: "left"
|
|
}
|
|
]
|
|
});
|
|
page.search();
|
|
},
|
|
beforeSearch: function () {
|
|
if (checkJustReturn) {
|
|
return false;
|
|
}
|
|
return true;
|
|
},
|
|
search: function (param) {
|
|
if (page.beforeSearch()) {
|
|
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(curParam) });
|
|
}
|
|
},
|
|
refreshData: function () {
|
|
page.search();
|
|
}
|
|
};
|
|
|
|
page.init();
|
|
}
|
|
</script>
|