123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411 |
-
- @{
- Layout = null;
- }
- <!DOCTYPE html>
- <html>
- <head>
- <meta name="viewport" content="width=device-width" />
- <title>NameBrandList</title>
- <link href="~/easyui/themes/default/easyui.css" rel="stylesheet" />
- <link rel="stylesheet" type="text/css" href="~/easyui/themes/icon.css" />
- <link href="~/Content/css/bootstrap.min.css" rel="stylesheet" />
- <link href="~/Content/js/plugins/layer/skin/layer.css" rel="stylesheet" />
- <script src="~/Content/js/jquery.min.js"></script>
- <script src="~/Content/js/bootstrap.min.js"></script>
- <script src="~/easyui/jquery.easyui.min.js"></script>
- <script src="~/easyui/jquery.easyui.mobile.js"></script>
- <script src="~/easyui/locale/easyui-lang-zh_CN.js"></script>
- <script src="~/Content/js/plugins/layer/laydate/laydate.js"></script>
- <script src="~/Content/js/plugins/layer/layer.min.js"></script>
- <script src="~/Content/js/plugins/validate/jquery.validate.min.js"></script>
- <script src="~/Content/js/plugins/validate/messages_zh.min.js"></script>
- <script src="~/js/Utils.js"></script>
- <script src="~/Content/plugins/ajaxFileUpload/ajaxFileUpload-M.js"></script>
- <link href="~/Content/css/Style/Markets.css" rel="stylesheet" />
- <script src="~/Content/js/js/MarketJs.js"></script>
- </head>
- <body >
- <section class="hidden">
- <input id="hid_Type" name="hid_Type" type="hidden" value="0" />
- <input id="hid_Type_Attach" name="hid_Type" type="hidden" value="0" />
- </section>
- <section style="height:95vh; padding: 10px 20px;">
- <div class="row tbToolBar" id="tbToolBar">
-
- @*<div class="toolbar">
- <label>
- <input type="checkbox" id="DataToggle"> 显示已删除记录
- <span class="shuxian"></span>
- </label>
- </div>*@
- <div class="toolbar" id="CurdTool">
- <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="btn_Add()">添加</a>
- <span class="shuxian"></span>
- <a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="btn_Edit()">修改</a>
- <span class="shuxian"></span>
- <a href="#" class="easyui-linkbutton" iconCls="icon-remove" plain="true" onclick="btn_Del()">删除</a>
- <span class="shuxian"></span>
- <a href="#" class="easyui-linkbutton" iconCls="icon-link" plain="true" onclick="btn_Attach()">附件</a>
- </div>
- <div class="toolbar-search">
- <span>【请选择查询条件】</span>
- <input class="easyui-searchbox" data-options="prompt:'请输入查询条件...',menu:'#search',searcher:LoadTable" style="width: 300px; height: 25px;"/>
- <div id="search">
- <div data-options="name:'NameBrandName'">品牌名称</div>
- <div data-options="name:'MarketName'">市场名称</div>
- <div data-options="name:'FoodName'">商品名</div>
- <div data-options="name:'NBByPerson'">品牌持有人</div>
- </div>
- </div>
- </div>
- <table id="dgTable" class="easyui-datagrid" style="height: 100%;"
- data-options="singleSelect: true,
- method: 'post',
- multiSort: false,
- toolbar: '#tbToolBar',
- fitColumns: true,
- @*rownumbers: true,*@
- remoteSort: false,
- @*loadFilter: pagerFilter,*@
- onDblClickRow: function () {
- btn_Edit();
- },
- pagination: true,
- pageSize: 50,
- pageList: [20, 50, 100]
- ">
- <thead>
- <tr>
- <th data-options="field:'NameBrandName',width:150">品牌名称</th>
- <th data-options="field:'MarketName',width:150">市场名称</th>
- <th data-options="field:'FoodName',width:120,">商品名</th>
- <th data-options="field:'NBByPerson',width:90,">品牌持有人</th>
- </tr>
- </thead>
- </table>
- </section>
- <section>
- <div id="winModal" class="easyui-window winModal" title="品牌管理维护" style="width: 450px;padding:10px;"
- iconCls="icon-save" data-options="modal:true,closed:true">
- <div class="easyui-layout" data-options="fit:true" style="height:99%">
- <div data-options="region:'center'" style="padding:15px 5px 5px;" >
- <form id="form">
- @Html.Hidden("NameBrandID")
- <div class="panle-fluid">
- <div class="input-group">
- <label class="input-group-addon control-label" for="NameBrandName">品牌名称</label>
- <input class="form-control input-group-addon required" aria-disabled="true" name="NameBrandName" id="NameBrandName" type="text" value="" placeholder=""/>
- <strong class="text-requird input-group-addon control-label">*</strong>
- </div>
- <div class="input-group">
- <label class="input-group-addon control-label" for="NBByPerson">品牌持有人</label>
- <input class="form-control input-group-addon required" aria-disabled="true" name="NBByPerson" id="NBByPerson" type="text" value="" placeholder=""/>
- <strong class="text-requird input-group-addon control-label">*</strong>
- </div>
- <div class="input-group">
- <label class="input-group-addon control-label" for="MarketManager">直接主管人</label>
- <input class="form-control input-group-addon required" aria-disabled="true" name="MarketManager" id="MarketManager" type="text" value="" placeholder=""/>
- <strong class="text-requird input-group-addon control-label">*</strong>
- </div>
- <div class="input-group">
- <label class="input-group-addon control-label" for="yjzhizhao">经营执照</label>
- <input class="form-control input-group-addon required" aria-disabled="true" name="yjzhizhao" id="yjzhizhao" type="text" value="" placeholder=""/>
- <strong class="text-requird input-group-addon control-label">*</strong>
- </div>
-
- <div class="input-group">
- <label class="input-group-addon control-label" for="FoodName">商品名称</label>
- <input class="form-control input-group-addon required" aria-disabled="true" name="FoodName" id="FoodName" type="text" value="" placeholder=""/>
- <strong class="text-requird input-group-addon control-label">*</strong>
- </div>
- <div class="input-group">
- <label class="input-group-addon control-label" for="NBByPersonLinks">联系方式</label>
- <input class="form-control input-group-addon" aria-disabled="true" name="NBByPersonLinks" id="NBByPersonLinks" type="text" value="" placeholder=""/>
- </div>
- <div class="input-group">
- <label class="input-group-addon control-label" for="MarketId">所属市场</label>
- <select class="form-control input-group-addon required" aria-disabled="true" name="MarketId" id="MarketId" type="text" value="" placeholder="选择所属市场">
- @Html.Raw(ViewBag.SelMarketInfo)
- </select>
- <strong class="text-requird input-group-addon control-label">*</strong>
- </div>
- <div class="input-group">
- <label class="input-group-addon control-label" for="pinpaizhengshu">品牌证书</label>
- <input class="form-control input-group-addon" aria-disabled="true" name="pinpaizhengshu" id="pinpaizhengshu" type="text" value="" placeholder=""/>
- </div>
-
- <div class="input-group">
- <label class="input-group-addon control-label" for="Description">品牌其他描述</label>
- <textarea class="form-control input-group-addon" aria-disabled="true" rows="5" name="Description" id="Description" type="text" value="" placeholder="" ></textarea>
- </div>
- </div>
- </form>
- </div>
- <div data-options="region:'south',border:false" style="text-align:right;height:45px; padding:13px 20px 0;">
- <a class="easyui-linkbutton" id="Save" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="Save()" style="width:80px">确认</a>
- <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winModal').window('close');" style="width:80px">取消</a>
- </div>
- </div>
-
- </div>
- <div id="winModal_Attach" class="easyui-window winModal" title="附件维护" style="width: 450px;padding:10px;"
- iconCls="icon-save" data-options="modal:true,closed:true">
- <div class="easyui-layout" data-options="fit:true" style="height:99%">
- <div data-options="region:'center'" style="padding:15px 5px 5px;">
- <div class="panle-fluid">
- <div class="input-group">
- <label class="input-group-addon control-label" for="AttachFile">上传附件</label>
- <input class="form-control input-group-addon" aria-disabled="true" name="AttachFile" id="AttachFile" type="file" value="" placeholder="" onblur="CheckFileSize('AttachFile')"/>
- </div>
- <div class="input-group">
- <label class="input-group-addon control-label" for="FileTitle">附件名称</label>
- <input class="form-control input-group-addon" aria-disabled="true" name="FileTitle" id="FileTitle" type="text" value="" placeholder="" />
- </div>
- <div class="input-group">
- <label class="input-group-addon control-label" for="Description_Attach">备注信息</label>
- <textarea class="form-control input-group-addon" aria-disabled="true" name="Description_Attach" id="Description_Attach" type="text" value="" placeholder="" ></textarea>
- </div>
- <div class="input-group" style="margin:20px auto 10px">
- <input class="btn btn-default" aria-disabled="true" name="" id="Save_Attach" type="button" value="确认上传附件" placeholder="" onclick="Save_Attach('Add')"/>
- </div>
- </div>
- <div class="panle-fluid">
- <div class="row tbToolBar" id="tbToolBar_Attach" style="padding-left:0;">
- <div class="toolbar">
- <a href="#" class="easyui-linkbutton" iconCls="icon-link_go" plain="true" onclick="btn_Look()">查看</a>
- <span class="shuxian"></span>
- <a href="#" class="easyui-linkbutton" iconCls="icon-link_delete" plain="true" onclick="btn_Del_Attach()">删除</a>
- </div>
- </div>
- <table id="dgTable_Attach" class="easyui-datagrid" style="width:100%; height: 170px;"
- data-options="singleSelect: true,
- method: 'post',
- multiSort: false,
- toolbar: '#tbToolBar_Attach',
- fitColumns: true,
- @*rownumbers: true,*@
- remoteSort: false,
- @*loadFilter: pagerFilter,*@
- onDblClickRow: function () {
- btn_Look();
- },
- pagination: false,
- pageSize: 50,
- pageList: [20, 50, 100]
- ">
- <thead>
- <tr>
- <th data-options="field:'FileTitle',width:100">附件标题</th>
- <th data-options="field:'FileExt',width:60,">扩展名</th>
- <th data-options="field:'TimeLastMod',width:90,">上传日期</th>
- </tr>
- </thead>
- </table>
- </div>
- </div>
- <div data-options="region:'south',border:false" style="text-align:right;height:45px; padding:13px 20px 0;">
- @*<a class="easyui-linkbutton" id="Save_Attach" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="Save_Attach()" style="width:80px">确认</a>*@
- <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winModal_Attach').window('close');" style="width:80px">取消</a>
- </div>
-
- </div>
- </div>
- </section>
- <script>
- function Save(type) {
- type = type || $("#hid_Type").val();
- var nameBrandId = (type === "Add" || type === "Edit") ? $("#NameBrandID").val() : $('#dgTable').datagrid('getSelections')[0].NameBrandID;
- $.ajax({
- url: "@Url.Action("NameBrandOper", "MarketSystem")",
- type: "post",
- dataType: "json",
- beforeSend: function () {
- return BeforeSend();
- },
- data: {
- Type: type,
- NameBrandID: nameBrandId,
- NameBrandName: $("#NameBrandName").val(),
- NBByPerson: $("#NBByPerson").val(),
- MarketManager: $("#MarketManager").val(),
- yjzhizhao: $("#yjzhizhao").val(),
- FoodName: $("#FoodName").val(),
- NBByPersonLinks: $("#NBByPersonLinks").val(),
- MarketId: $("#MarketId").val(),
- pinpaizhengshu: $("#pinpaizhengshu").val(),
- Description: $("#Description").val()
- },
- success: function (data) {
- if (CheckAajxData(data) === false) return;
- var msg = data.ErrorInfo;
- if (data.Success === true) {
- LoadTable();
- layer.alert(msg, { icon: 1, title: '提示信息' });
- } else {
- layer.alert(msg, { icon: 7, title: '提示信息' });
- }
- }
- });
- }
- function Save_Attach(type) {
- type = type || $("#hid_Type_Attach").val();
- $.ajaxFileUpload({
- url: "@Url.Action("AttachFileUpdate", "MarketSystem")",
- secureuri: false, //一般设置为false
- fileElementId: 'AttachFile', //文件上传控件的Id <input type="file" id="fileUpload" name="file" />
- type: "post",
- dataType: "json",
- data: {
- Type: type,
- UploadFile: "true",
- TableId :"NameBrands",
- ColumnId: "NameBrandID",
- SourceKey:$('#dgTable').datagrid('getSelections')[0].NameBrandID,
- FileTitle:$("#FileTitle").val(),
- Description: $("#Description_Attach").val()
- },
- success: function (data) {
- if (CheckAajxData(data) === false) return;
- var msg = data.ErrorInfo;
- if (data.Success === true) {
- LoadTable_Attach();
- layer.alert(msg, { icon: 1, title: '提示信息' });
- } else {
- LoadTable_Attach();
- layer.alert(msg, { icon: 7, title: '提示信息' });
- }
- }
- });
- }
- //添加
- function btn_Add() {
- $("#hid_Type").val("Add");
- $("#winModal input").val("");
- $("#winModal textarea").val("");
- $("#Save span.l-btn-text").html("添加");
- $("#winModal").window("open");
- }
- function btn_Look() {
- var rows = $('#dgTable_Attach').datagrid('getSelections');
- if (rows.length === 1) {
- var row = rows[0];
- var path = "../" + row.FilePath + "/" + row.FileName;
- //window.location.href = path;
- window.open(path);
- } else {
- layer.alert('请选择一条记录进行设置', { icon: 7, title: '提示信息' });
- }
- }
- function btn_Del_Attach() {
- $("#hid_Type_Attach").val("Del");
- var rows = $('#dgTable_Attach').datagrid('getSelections');
- if (rows.length === 1) {
- layer.confirm("您确定删除这条记录吗?", { icon: 3, title: '提示信息' },
- function (index) {
- SetModalVal_Attach();
- Save_Attach("Del");
- layer.close(index);
- });
- } else {
- layer.alert('请选择一条记录进行设置', { icon: 7, title: '提示信息' });
- }
- }
- //修改
- function btn_Edit() {
- $("#hid_Type").val("Edit");
- $("#Save span.l-btn-text").html("修改");
- SetModalVal();
- }
- function btn_Edit_Attach() {
- $("#hid_Type").val("Edit");
- $("#Save_Attach").html("修改");
- SetModalVal_Attach();
- }
- //附件
- function btn_Attach() {
- SetModalVal_Attach();
- }
- //modal赋值
- function SetModalVal() {
- var rows = $('#dgTable').datagrid('getSelections');
- if (rows.length === 1) {
- var row = rows[0];
- //console.log(row);
- $("#NameBrandID").val(row.NameBrandID);
- $("#NameBrandName").val(row.NameBrandName);
- $("#NBByPerson").val(row.NBByPerson);
- $("#MarketManager").val(row.MarketManager);
- $("#yjzhizhao").val(row.yjzhizhao);
- $("#FoodName").val(row.FoodName);
- $("#NBByPersonLinks").val(row.NBByPersonLinks);
- $("#MarketId").val(row.MarketId);
- $("#pinpaizhengshu").val(row.pinpaizhengshu);
- $("#Description").val(row.Description);
- if ($("#hid_Type").val()==="Edit") {
- $("#winModal").window("open");
- }
- } else {
- layer.alert('请选择一条记录进行设置', {title:'提示信息'});
- }
- }
- function SetModalVal_Attach() {
- var rows = $('#dgTable').datagrid('getSelections');
- if (rows.length === 1) {
- var row = rows[0];
- //console.log(row);
- $("#NameBrandID").val(row.NameBrandID);
- LoadTable_Attach();
- $("#winModal_Attach").window("open");
-
- } else {
- layer.alert('请选择一条记录进行设置', { icon: 7, title: '提示信息' });
- }
- }
- //加载表格数据
- function LoadTable(value, item) {
- $('#dgTable').datagrid({
- url: '@Url.Action("NameBrandListResult", "GetResult")' + '?PcVal=' + escape(value) + '&PcItem=' + item
- });
- }
- function LoadTable_Attach() {
- $('#dgTable_Attach').datagrid({
- url: '@Url.Action("NameBrandAttachResult", "GetResult")' + '?SourceKey=' + $('#dgTable').datagrid('getSelections')[0].NameBrandID
- });
- }
- $(function () {
- //加载表格数据
- var value = $(".textbox.searchbox .textbox-value").val(), item = $(".textbox.searchbox .textbox-value").attr("name");
- LoadTable(value, item);
- //加载日历控件
- //laydate({
- // elem: '#PractiseTime',
- // format: "YYYY-MM-DD",
- // min: "1980-01-01",
- // event: "focus"
- //});
- });
- </script>
- </body>
- </html>
|