123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346 |
-
- @{
- Layout = null;
- }
- <!DOCTYPE html>
- <html>
- <head>
- <meta name="viewport" content="width=device-width" />
- <title>SpecialsList</title>
- <link href="~/easyui/themes/bootstrap/easyui.css" rel="stylesheet" />
- <link href="~/easyui/themes/icon.css" rel="stylesheet" />
- <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="~/js/Utils.js"></script>
- <link href="~/Content/css/Style/Markets.css" rel="stylesheet" />
- <style>
- .td_1 {
- padding-bottom: 5px;
- padding-left: 5px;
- }
- </style>
- </head>
- <body>
- <section class="hidden">
- <input id="hid_Type" name="hid_Type" type="hidden" value="0" />
- <input id="hid_IsLock" name="IsLock" type="hidden" value="0" />
- </section>
- @*<section class="text-center title">
- <h2>市场信息</h2>
- </section>*@
- <section class="container-fluid" style="height: 100vh; padding-top: 20px;">
- <div class="row tbToolBar" id="tbToolBar">
- <div class="toolbar">
- <label>
- <input type="checkbox" id="DataToggle"> 显示已删除记录
- </label>
- </div>
- <div class="toolbar" id="CurdTool" style="float:left">
-
- <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-no" plain="true" onclick="DelOrRetore('Del')">删除</a>
- <span class="shuxian"></span>
- <a href="#" class="easyui-linkbutton" iconCls="icon-arrow_up" plain="true" onclick="Save('up')">上移</a>
- <span class="shuxian"></span>
- <a href="#" class="easyui-linkbutton" iconCls="icon-arrow_down" plain="true" onclick="Save('down')">下移</a>
- </div>
- <div class="col-sm-3" id="ResetTool">
- <a href="#" class="easyui-linkbutton" iconCls="icon-undo" plain="true" onclick="DelOrRetore('ReDel')">恢复删除</a>
- </div>
- <div class="col-sm-4" id="SearchTool">
- 商品大类:<select id="sGreatKind" name="sGreatKind" onchange="sGreatKind_Change()">@Html.Raw(ViewBag.SelGreatKind)</select>商品小类:
- <select id="sLittleKind" name="sLittleKind" onchange="sLittleKind_Change()"></select>
- </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,
-
- pagination: true,
- pageSize: 15,
- pageList: [15, 25, 50, 100]
- ">
- <thead>
- <tr>
- @*hid_IsLock<th data-options="field:'TradeTypeID'" class="hidden">行业类型</th>*@
- <th data-options="field:'SpecialsID',width:50">编号</th>
- <th data-options="field:'Name',width:80,">名称</th>
- </tr>
- </thead>
- </table>
- </section>
- <section>
- <div id="winModal" class="easyui-window winModal" title="小类信息维护" style="width: 600px; height: 350px;padding:5px;"
- iconCls="icon-save" data-options="modal:true,closed:true">
- <div class="easyui-layout" data-options="fit:true" style="height:400px">
- <div data-options="region:'center'" style="padding:5px 5px 1px; height:385px">
- <table cellpadding="10" cellspacing="0" style="margin-left:10px">
- <tr>
- <td class="td_1">商品大类</td>
- <td class="td_1">
- <select id="GreatKindID" name="GreatKindID" style="width:400px;height:20px" onchange="GreatKind_Change()" >
- @Html.Raw(ViewBag.SelGreatKind)
- </select>
- </td>
- </tr>
- <tr>
- <td class="td_1">商品小类</td>
- <td class="td_1">
- <select id="LittleKindID" name="LittleKindID" style="width:400px;height:20px">
-
- </select>
- </td>
- </tr>
- <tr>
- <td class="td_1">名称</td>
- <td class="td_1"><input class="easyui-textbox" type="text" id="Name" name="Name" style="width:400px;height:20px" /></td>
- </tr>
- <tr>
- <td class="td_1">编号</td>
- <td class="td_1">
- <input class="easyui-textbox" type="text" id="SpecialsID" name="SpecialsID" style="width:400px;height:20px" />
- </td>
- </tr>
- </table>
- </div>
- <div data-options="region:'south',border:false" style="text-align:right; padding: 12px 20px ;height:52px;">
- <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>
- </section>
- <script>
- //切换显示不同状态数据
- $("#DataToggle").on("click",
- function () {
- if ($('#hid_IsLock').val() === "0") {
- $('#hid_IsLock').val("1");
- $("#CurdTool").hide();
- $("#ResetTool").show();
- } else {
- $('#hid_IsLock').val("0");
- $("#ResetTool").hide();
- $("#CurdTool").show();
- }
- window.LoadTable();
- });
- //添加
- function btn_Add() {
- $("#hid_Type").val("Add");
- $("#GreatKindID").removeAttr("disabled")
- $("#LittleKindID").removeAttr("disabled")
- $("#SpecialsID").textbox('enable')
- $("#GreatKindID").val($('#sGreatKind').val())
- GreatKind_Change();
- $("#LittleKindID").val($('#sLittleKind').val())
- $("#Name").textbox("setValue", '')
- $("#SpecialsID").textbox("setValue", '')
- $('#winModal').window('open');
- }
- //修改
- function btn_Edit() {
- $("#hid_Type").val("Edit");
- var row = $('#dgTable').datagrid('getSelected');
- if (row) {
- $("#GreatKindID").val($('#sGreatKind').val());
- GreatKind_Change();
- $("#LittleKindID").val(row.LittleKindID)
- $("#Name").textbox("setValue", row.Name);
- $("#SpecialsID").textbox("setValue", row.SpecialsID);
- $("#GreatKindID").attr("disabled", "disabled")
- $("#LittleKindID").attr("disabled", "disabled")
- $("#SpecialsID").textbox('disable')
- $('#winModal').window('open');
- }
- }
- function DelOrRetore(type) {
- var SpecialsID = $('#dgTable').datagrid('getSelections')[0].SpecialsID;
- if (!SpecialsID) {
- layer.alert('请选择一条记录进行设置', { icon: 7, title: '提示信息' });
- return;
- }
- if (type == 'Del' || type === "ReDel" ) {
- $.messager.confirm('删除或恢复', '确定删除或恢复这条记录?', function (r) {
- if (r) {
- $.ajax({
- url: "@Url.Action("SpecialsListOper", "BaseInfo")",
- type: "post",
- data: {
- Type: type,
- SpecialsID: SpecialsID
- },
- success: function (data) {
- if (CheckAajxData(data) == false) {
- return;
- }
- var msg = JSON.parse(data);
- if (msg != null && msg.Success == true) {
- LoadTable();
- layer.alert("操作成功!", { title: '提示信息' });
- } else {
- layer.alert(msg.ErrorInfo, { title: '提示信息' });
- }
- }
- });
- }
- })
- }
- }
- //提交
- function Save(type) {
- type = type || $("#hid_Type").val();
- if (type === "Edit" || type === "Add") {
- if ($("#SpecialsID").textbox('getValue').length <= 0) {
- $.messager.alert('提示', '编号不能为空!', 'error');
- return;
- }
- if ($("#LittleKindID").val().length <= 0) {
- $.messager.alert('提示', '小类不能为空!', 'error');
- return;
- }
- }
- var SpecialsID = (type === "Edit" || type === "up" || type === "down") ? $('#dgTable').datagrid('getSelections')[0].SpecialsID : $("#SpecialsID").textbox('getValue');
- $.ajax({
- url: "@Url.Action("SpecialsListOper", "BaseInfo")",
- type: "post",
- data: {
- Type: type,
- LittleKindID: $("#LittleKindID").val(),
- SpecialsID: SpecialsID,
- Name: $("#Name").textbox('getValue')
- },
- success: function (data) {
- if (CheckAajxData(data) == false) {
- return;
- }
- var msg = JSON.parse(data);
- if (msg != null && msg.Success == true) {
- LoadTable();
- $('#winModal').window('close');
- layer.alert("操作成功!", { title: '提示信息' });
- } else {
- layer.alert(msg.ErrorInfo, { title: '提示信息' });
- }
- }
- });
- }
- //modal赋值
- function SetModalVal() {
- var rows = $('#dgTable').datagrid('getSelections');
- if (rows.length === 1) {
- var row = rows[0];
- //console.log(row);
- $("#LittleKindID").val(row.LittleKindID),
- $("#SortNumber").val(row.SortNumber),
- $("#SpecialsID").val(row.SpecialsID),
- $("#Name").val(row.Name),
- $("#modal").modal("show");
- } else {
- layer.alert('请选择一条记录进行设置', { icon: 7, title: '提示信息' });
- }
- }
- //加载表格数据
- function LoadTable() {
- $('#dgTable').datagrid({
- url: '@Url.Action("GetSpecialsList", "BaseInfo")' + '?IsLock=' + $('#hid_IsLock').val() + '&&LittleKindID=' + $("#sLittleKind").val(),
- onDblClickRow: function () {
- btn_Edit();
- }
- });
- }
- function sGreatKind_Change(){
- $("#sLittleKind").empty();
- $.ajax({
- url: "@Url.Action("GetLittleKindByGreatKindId", "BaseInfo")",
- type: "post",
- dataType:'json',
- data: {
- GreatKindID: $('#sGreatKind').val()
- },
- success: function (msg) {
- if (CheckAajxData(msg) == false) {
- return;
- }
- var option = "";
- for(var j =0;j < msg.length; j++)
- {
- $("#sLittleKind").append("<option value=\"" + msg[j].LittleKindID + "\">" + msg[j].Name + "</option>");
- }
- sLittleKind_Change();
- }
- })
- }
- function sLittleKind_Change(){
- LoadTable();
- }
- function GreatKind_Change() {
- $("#LittleKindID").empty();
- $.ajax({
- url: "@Url.Action("GetLittleKindByGreatKindId", "BaseInfo")",
- type: "post",
- dataType: 'json',
- data: {
- GreatKindID: $('#GreatKindID').val()
- },
- success: function (msg) {
- if (CheckAajxData(msg) == false) {
- return;
- }
- var option = "";
- for (var j = 0; j < msg.length; j++) {
- $("#LittleKindID").append("<option value=\"" + msg[j].LittleKindID + "\">" + msg[j].Name + "</option>");
- }
- }
- })
- }
-
- $(function () {
- //加载表格数据
- window.LoadTable();
- //加载日历控件
- //laydate({
- // elem: '#PractiseTime',
- // format: "YYYY-MM-DD",
- // min: "1980-01-01",
- // event: "focus"
- //});
- sGreatKind_Change();
- GreatKind_Change();
- });
- </script>
- </body>
- </html>
|