123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737 |
-
- @{
- Layout = null;
- }
- <!DOCTYPE html>
- <html>
- <head>
- <meta name="viewport" content="width=device-width" />
- <title>CheckDataQry</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" />
- <link href="~/Content/plugins/select2/css/select2.min.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" />
- <script src="~/Content/js/js/MarketJs.js"></script>
- <style>
- .datagrid-header td,
- .datagrid-body .datagrid-row td {
- padding: 2px;
- }
- #CheckDataTb {
- height: 75vh;
- }
- @@media(min-device-width:1400px) {
- #CheckDataTb {
- height: 85vh;
- }
- }
- </style>
- </head>
- <body>
- <div id="BodyDiv">
- <section class="hidden">
- <input id="hid_Type" name="hid_Type" type="hidden" value="0"/>
- <input id="hid_IsMarketSysAccount" name="hid_IsMarketSysAccount" type="hidden" value="@ViewBag.IsMarketSysAccount"/>
- <input id="hid_IsSystem" name="hid_IsSystem" type="hidden" value="@ViewBag.IsSystem"/>
- @*<input id="hid_RegionID" name="hid_RegionID" type="hidden" value="@ViewBag.RegionID"/>*@
- <input id="hid_MarketID" name="hid_IsSystem" type="hidden" value="@ViewBag.MarketID"/>
- <input id="hid_CheckUnit" name="hid_IsSystem" type="hidden" value="@ViewBag.CheckUnit"/>
- @*<input id="hid_CheckUser" name="hid_IsSystem" type="hidden" value="@ViewBag.CheckUser"/>*@
- <input id="hidSetSearch_Type" name="hidSetSearch_Type" type="hidden" value="0"/>
- </section>
- <section id="Search_Panel">
- @*<div id="" class="easyui-panel" title="检测数据查询"
- style="width: 100%; height: 140px; padding: 10px;"
- data-options="closable:flase,collapsible:false">
-
- </div>*@
- <table class="panel-table" style="margin:10px auto 0;">
- <tr>
- <td class="td-label"><label for="SearchRegionID">辖区工商</label></td>
- <td class="td-input">
- <input class="easyui-combotree" style="height: 25px; width: 150px" id="SearchRegionID" name="SearchRegionID" data-options="onChange:function(){GetMarketSelStr()}" />
- @*<select class="easyui-combobox" type="text" id="SearchRegionID" name="SearchRegionID" style="height: 25px; width: 150px" data-options="onChange:function(){GetMarketSelStr()}">
- <option value="">全部</option>
- @Html.Raw(ViewBag.SelRegionInfo)
- </select>*@
- </td>
- <td class="td-label"><label for="SearchMarketID">被检单位</label></td>
- <td class="td-input">
- <select class="easyui-combobox" style="height: 25px; width: 150px" id="SearchMarketID" name="SearchMarketID" data-options="icons:[{iconCls:'icon-search_zoom',handler:function(){SearchModal('#Market')}
- }]">
- @Html.Raw(ViewBag.SelMarketInfo)
- </select>
- </td>
- <td class="td-label"><label for="SearchCheckUnit">检测单位</label></td>
- <td class="td-input">
- <select class="easyui-combobox" style="height: 25px; width: 150px" id="SearchCheckUnit" name="SearchCheckUnit">
- <option value="">全部</option>
- @Html.Raw(ViewBag.SelCheckUnitInfo)
- </select>
- </td>
- <td class="td-label"><label for="SearchCorpName">被检对象</label></td>
- <td class="td-input">
- <input class="easyui-textbox" style="height: 25px; width: 150px" id="SearchCorpName" name="SearchCorpName">
- </td>
- </tr>
- <tr>
- <td class="td-label"><label for="SearchLittleKindName">品种小类</label></td>
- <td class="td-input">
- <select class="easyui-combobox" style="height: 25px; width: 150px" id="SearchLittleKindName" name="SearchLittleKindName" data-options="onChange:function(){GetLittleKindSelStr()}">
- <option value="">全部</option>
- @Html.Raw(ViewBag.SelLittleKindInfo)
- </select>
- </td>
- <td class="td-label"><label for="SearchSampleName">品种名</label></td>
- <td class="td-input">
- <input class="easyui-combotree" style="height: 25px; width: 150px" id="SearchSampleName" name="SearchSampleName" data-options="icons:[{
- iconCls:'icon-search_zoom',handler:function(){SearchModal()}}]"/>
- @*<select class="easyui-combobox" style="height: 25px; width: 150px" id="SearchSampleName" name="SearchSampleName" data-options="icons:[{
- iconCls:'icon-search_zoom',handler:function(){SearchModal('#SampleName')}
- }]">
- <option value="">请选择...</option>
- @Html.Raw(ViewBag.SelSampleNameInfo)
- </select>*@
- </td>
- <td class="td-label"><label for="SearchCheckMethod">检测方法</label></td>
- <td class="td-input">
- <select class="easyui-combobox" style="height: 25px; width: 150px" id="SearchCheckMethod" name="SearchCheckMethod" data-options="onChange:function(){GetCheckProjectSelStr()}">
- <option value="">全部</option>
- @Html.Raw(ViewBag.SelCheckMethodInfo)
- </select>
- </td>
- <td class="td-label"><label for="SearchCheckProjectTypeID">检测项目</label></td>
- <td class="td-input">
- <select class="easyui-combobox" style="height: 25px; width: 150px" id="SearchCheckProjectTypeID" name="SearchCheckProjectTypeID" data-options="">
- @Html.Raw(ViewBag.SelCheckProjectTypeInfo)
- </select>
- </td>
- </tr>
- <tr>
- <td class="td-label"><label for="SearchCheckResult">检测结果</label></td>
- <td class="td-input">
- <select class="easyui-combobox" style="height: 25px; width: 150px" id="SearchCheckResult" name="SearchCheckResult">
- <option value="" selected="selected">全部</option>
- <option value="合格">合格</option>
- <option value="不合格">不合格</option>
- </select>
- </td>
- <td class="td-label"><label for="SearchStartTime">开始时间</label></td>
- <td class="td-input"><input class="easyui-textbox" type="text" id="SearchStartTime" name="SearchStartTime" style="height: 25px; width: 150px" data-options="" placeholder="输入查询检测时间的开始日期"/></td>
- <td class="td-label"><label for="SearchEndTime">截止时间</label></td>
- <td class="td-input"><input class="easyui-textbox" type="text" id="SearchEndTime" name="SearchEndTime" style="height: 25px; width: 150px" data-options="" placeholder="输入查询检测时间的截止日期"/></td>
- <td></td>
- <td class="td-input">
- <a href="#" class="easyui-linkbutton" iconCls="icon-search" style="width: 90%; height: 25px" onclick="LoadTable(true);">查询</a>
- </td>
- </tr>
- </table>
- </section>
- <section id="CheckDataTb" style="padding: 0 20px;">
- <div class="row tbToolBar" id="tbToolBar">
- <div class="toolbar">
- <a href="#" class="easyui-linkbutton" iconCls="icon-application_view_detail" plain="true" onclick="btn_Detail();">查看详情</a>
- </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_Detail();
- },
- pagination: true,
- pageSize: 50,
- pageList: [10,20, 50, 100]
- ">
- <thead>
- <tr>
- <th data-options="field:'SampleName',width:50">品种名称</th>
- <th data-options="field:'CheckMethodName',width:55">检测方法</th>
- <th data-options="field:'CheckItemName',width:60">检测项目</th>
- <th data-options="field:'CheckValue',width:40">检测值</th>
- <th data-options="field:'CheckUnit',width:100">检测单位</th>
- <th data-options="field:'CheckResult',width:50">检测结果</th>
- <th data-options="field:'CheckTime',width:55">检测时间</th>
- <th data-options="field:'CheckUser',width:40">检测员</th>
- <th data-options="field:'CorpName',width:100">被检企业</th>
- <th data-options="field:'MarketName',width:130">所属市场名称</th>
- <th data-options="field:'RegionName',width:60">所属辖区</th>
- </tr>
- </thead>
- </table>
- </section>
- <section>
- <div id="winModal" class="easyui-window winModal" title="检测数据信息" style="width: 1000px; padding: 5px 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: 0;">
- <!--StartPrint-->
- <div style="margin-bottom: 15px; text-align: center;">
- <table id="" class="modal-table container-fluid" style="width: 800PX">
- <thead>
- <tr>
- <th colspan="20" style="text-align: center">
- <h4 class="title"><span id="">检测数据信息</span></h4>
- </th>
- </tr>
- </thead>
- <tr>
- <td class="tdName"><strong>所属市场</strong>:</td>
- <td id="Detail_MarketID" class="tdVal" colspan="3"></td>
- <td class="tdName"><strong>检测单位</strong>:</td>
- <td id="Detail_CheckUnit" class="tdVal" colspan="3"></td>
- </tr>
- <tr>
- <td class="tdName"><strong>被检企业</strong>:</td>
- <td id="Detail_CorpName" class="tdVal" colspan="3"></td>
- <td class="tdName"><strong>企业类型</strong>:</td>
- <td id="Detail_CorpKind" class="tdVal" colspan="3"></td>
- </tr>
- <tr>
- <td class="tdName"><strong>检测项目</strong>:</td>
- <td id="Detail_CheckProjectTypeName" class="tdVal" colspan="3"></td>
- <td class="tdName"><strong>检测值</strong>:</td>
- <td id="Detail_CheckValue" class="tdVal" colspan="3"></td>
- </tr>
- <tr>
- <td class="tdName"><strong>标准值</strong>:</td>
- <td id="Detail_StandardValue" class="tdVal" colspan="3"></td>
- <td class="tdName"><strong>单位</strong>:</td>
- <td id="Detail_Unit" class="tdVal" colspan="3"></td>
- </tr>
- <tr>
- <td class="tdName"><strong>检测次数</strong>:</td>
- <td id="Detail_CheckTotal" class="tdVal" colspan="3"></td>
- <td class="tdName"><strong>检测对比</strong>:</td>
- <td id="Detail_CheckResult" class="tdVal" colspan="3"></td>
- </tr>
- <tr>
- <td class="tdName"><strong>是否自检</strong>:</td>
- <td id="Detail_IsSelf" class="tdVal" colspan="3"></td>
- <td class="tdName"><strong>检测员</strong>:</td>
- <td id="Detail_CheckUser" class="tdVal" colspan="3"></td>
- </tr>
- <tr>
- <td class="tdName"><strong>送检日期</strong>:</td>
- <td id="Detail_SendDate" class="tdVal" colspan="3"></td>
- <td class="tdName"><strong>检测日期</strong>:</td>
- <td id="Detail_CheckTime" class="tdVal" colspan="3"></td>
- </tr>
- <tr>
- @*<td class="tdName"><strong>品种小类</strong>:</td>
- <td id="Detail_LittleKindName" class="tdVal" colspan="3"></td>*@
- <td class="tdName"><strong>品种名</strong>:</td>
- <td id="Detail_SampleName" class="tdVal" colspan="7"></td>
- </tr>
- <tr>
- <td class="tdName"><strong>生产单位</strong>:</td>
- <td id="Detail_ProduceUnit" class="tdVal" colspan="3"></td>
- <td class="tdName"><strong>生产日期</strong>:</td>
- <td id="Detail_ProduceDate" class="tdVal" colspan="3"></td>
- </tr>
- <tr>
- <td class="tdName"><strong>产地</strong>:</td>
- <td id="Detail_HabitatName" class="tdVal" colspan="3"></td>
- <td class="tdName"><strong>仪器编号</strong>:</td>
- <td id="Detail_MachineID" class="tdVal" colspan="3"></td>
- </tr>
- <tr>
- <td class="tdName"><strong>仪器厂商</strong>:</td>
- <td id="Detail_MachineMaker" class="tdVal" colspan="3"></td>
- <td class="tdName"><strong>数据编号</strong>:</td>
- <td id="Detail_ClientIndexID" class="tdVal" colspan="3"></td>
- </tr>
- <tr>
- <td class="tdName"><strong>备注</strong>:</td>
- <td id="Detail_Memo" class="tdVal" colspan="7"></td>
- </tr>
- </table>
- </div>
- <!--EndPrint-->
- <div class="" style="margin-bottom: 15px; text-align: center; display: @ViewBag.IsPrint">
- <button type="button" onclick="Print();">直接打印</button>
- <button type="button" class="but5" onclick="PreView()">打印预览</button>
- </div>
- </div>
- <div data-options="region:'south',border:false" style="text-align: right; height: 45px; padding: 13px 20px 0;">
- <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_Search" class="easyui-window winModal" title="" style="width: 750px; height: 600px;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 id="Search_SampleName">
- @*<div class="panle-half">
- <div class="input-group">
- <label class="input-group-addon control-label" for="dg_SearchLittleKindName" style="min-width: 70px">品种类</label>
- <select class="form-control input-group-addon" aria-disabled="true" name="dg_SearchLittleKindName" id="dg_SearchLittleKindName" type="text" value="" placeholder="选择品种类" disabled="disabled">
- <option value="">全部</option>
- @Html.Raw(ViewBag.SelLittleKindInfo)
- </select>
- </div>
- </div>*@
- <div class="panle-half">
- <div class="input-group">
- <label class="input-group-addon control-label" for="dg_SearchSampleName" style="min-width: 70px">品种名</label>
- <input class="form-control input-group-addon" aria-disabled="true" name="dg_SearchSampleName" id="dg_SearchSampleName" type="text" value="" placeholder="" />
- <span class="input-group-addon control-label" onclick="DgSearchLoadTable()">搜索</span>
- </div>
-
- </div>
- <div class="panle-fluid" style="margin-top: 10px;">
- <table id="dgTable_Search_tree" class="easyui-datagrid" style="width: 98%; height: 410px;"
- data-options="singleSelect: true,
- method: 'post',
- multiSort: false,
- fitColumns: true,
- remoteSort: false,
- onDblClickRow: function () {
- SetSearch();
- },
-
- ">
- <thead></thead>
- </table>
- </div>
- </div>
- <div id="Search_Market" style="display:none">
- <div class="panle-half">
- <div class="input-group">
- <label class="input-group-addon control-label" for="dg_SearchRegionID" style="min-width: 70px">所属辖区</label>
- <select class="form-control input-group-addon" type="text" id="dg_SearchRegionID" name="dg_SearchRegionID" onchange="GetMarketSelStr();" disabled="disabled">
- <option value="">全部</option>
- @Html.Raw(ViewBag.SelRegionInfo)
- </select>
- </div>
- </div>
- <div class="panle-half">
- <div class="input-group">
- <label class="input-group-addon control-label" for="dg_SearchMarketName" style="min-width: 70px">市场名称</label>
- <input class="form-control input-group-addon" aria-disabled="true" name="dg_SearchMarketName" id="dg_SearchMarketName" type="text" value="" placeholder="" />
- <span class="input-group-addon control-label" onclick="DgSearchLoadTable()">搜索</span>
- </div>
- </div>
- <div class="panle-fluid" style="margin-top: 10px;">
- <table id="dgTable_Search" class="easyui-datagrid" style="width: 98%; height: 410px;"
- data-options="singleSelect: true,
- method: 'post',
- multiSort: false,
- toolbar: '#tbToolBar_Attach',
- fitColumns: true,
- remoteSort: false,
- onDblClickRow: function () {
- SetSearch();
- },
- pagination: true,
- pageSize: 50,
- pageList: [10,20, 50, 100]
- ">
- <thead></thead>
- </table>
- </div>
- </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_SetSearch" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="SetSearch()" style="width:80px">确认</a>
- <a class="easyui-linkbutton" id="Save_Search" data-options="iconCls:'icon-search'" href="javascript:void(0)" onclick="DgSearchLoadTable()" style="width:80px">搜索</a>
- <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winModal_Search').window('close');" style="width:80px">取消</a>
- </div>
- </div>
- </div>
- </section>
- <script>
- //加载表格数据
- function LoadTable(collapsed) {
- collapsed = collapsed || false;
- var regionId = $("#SearchRegionID").combotree("getValue"),
- marketId = $("#SearchMarketID").combobox("getValue"),
- checkUnit = $("#SearchCheckUnit").combobox("getValue"),
- corpName = $("#SearchCorpName").textbox("getValue"),
- littleKindName = $("#SearchLittleKindName").combobox("getValue"),
- sampleName = $("#SearchSampleName").combotree("getValue"),
- checkProjectTypeId = $("#SearchCheckProjectTypeID").combobox("getValue"),
- checkMethod = $("#SearchCheckMethod").combobox("getValue"),
- checkResult = $("#SearchCheckResult").combobox("getValue"),
- startTime = $('#SearchStartTime').val(),
- endTime = $('#SearchEndTime').val();
- if (collapsed === true) {
- $("#Search").panel("collapse", true);
- }
- $('#dgTable').datagrid({
- url: '@Url.Action("CheckDataQryResult", "GetResult")',
- queryParams: {
- RegionID: regionId,
- MarketID: marketId,
- StartTime: startTime,
- EndTime: endTime,
- CheckUnit: checkUnit,
- CorpName: corpName,
- LittleKindName: littleKindName,
- SampleName: sampleName,
- CheckProjectTypeID: checkProjectTypeId,
- CheckMethod:checkMethod,
- CheckResult: checkResult
- }
- });
- }
- //查看详情
- function btn_Detail() {
- var rows = $('#dgTable').datagrid('getSelections');
- if (rows.length === 1) {
- var row = rows[0];
- $("#Detail_MarketID").html(row.MarketID);
- $("#Detail_CheckUnit").html(row.CheckUnit);
- $("#Detail_CorpName").html(row.CorpName);
- $("#Detail_CorpKind").html(row.CorpKind);
- $("#Detail_CheckProjectTypeName").html(row.CheckItemName);
- $("#Detail_CheckValue").html(row.CheckValue);
- $("#Detail_StandardValue").html(row.StandardValue);
- $("#Detail_Unit").html(row.Unit);
- $("#Detail_CheckTotal").html(row.CheckTotal);
- $("#Detail_CheckResult").html(row.CheckResult);
- $("#Detail_IsSelf").html(row.IsSelf === "1" ? "是" : "否");
- $("#Detail_CheckUser").html(row.CheckUser);
- $("#Detail_SendDate").html(row.SendDate);
- $("#Detail_CheckTime").html(row.CheckTime);
- //$("#Detail_LittleKindName").html(row.LittleKindName);
- $("#Detail_SampleName").html(row.SampleName);
- $("#Detail_ProduceUnit").html(row.ProduceUnit);
- $("#Detail_ProduceDate").html(row.ProduceDate);
- $("#Detail_HabitatName").html(row.HabitatName);
- $("#Detail_MachineID").html(row.MachineID);
- $("#Detail_MachineMaker").html(row.MachineMaker);
- $("#Detail_ClientIndexID").html(row.ClientIndexID);
- $("#Detail_Memo").html(row.Memo);
- $("#winModal").window("open");
- } else {
- layer.alert('请选择一条记录进行设置', { icon: 7, title: '提示信息' });
- }
- }
- //根据辖区获取市场下拉框的option
- function GetMarketSelStr() {
- console.log($("#SearchRegionID").combotree("getValue"));
- $.ajax({
- url: "/GetResult/GetMarketSelStrResult",
- type: "post",
- async: false,
- dataType: "json",
- //data: { RegionID: $("input.combobox-value[name='SearchRegionID']").val() },
- data: { RegionID: $("#SearchRegionID").combotree("getValue") },
- success: function(data) {
- //console.log(msg);
- if (CheckAajxData(data) === false) return;
- var rows = data.rows;
- var first = "{\"MarketID\":\"\",\"Names\":\"全部\"}";
- var last = "{\"MarketID\":\"Other\",\"Names\":\"其他\"}";
- var firstJson = JSON.parse(first);
- var lastJson = JSON.parse(last);
- rows.unshift(firstJson);
- rows.push(lastJson);
- console.log(rows);
- $('#SearchMarketID').combobox("clear").combobox({
- data: rows,
- valueField: 'MarketID',
- textField: 'Names',
- onLoadSuccess: function() {
- var val = $(this).combobox('getData');
- // ReSharper disable once MissingHasOwnPropertyInForeach
- if ($("#hid_IsMarketSysAccount").val() === "0") {
- var m = $("#hid_MarketID").val();
- $("#SearchMarketID").combobox("setValue", m).combobox("disable");
- } else {
- for (var item in val[0]) {
- if (item === 'MarketID') {
- $(this).combobox('select', val[0][item]);
- }
- }
- }
- }
- });
- }
- });
- }
- //根据小类获取品种名下拉框的option
- function GetLittleKindSelStr() {
- $.ajax({
- url: "/GetResult/GetLittleKindSelStrResult",
- type: "post",
- async: false,
- dataType: "json",
- data: { LittleKindName: $("#SearchLittleKindName").combobox("getValue") },
- success: function(data) {
- //console.log(msg);
- if (CheckAajxData(data) === false) return;
- if (data.length > 0) {
- $("#SearchSampleName").combotree({
- data: data,
- //onChange: function (recode) {
- // //console.log(recode)
- // $("#hid_SampleName").val(recode.text);
- //},
- //onLoadSuccess: function () {
- // //console.log(id + "-" + name);
- // $("#SampleName").combotree("setValue", id ? id : "");
- // $("#hid_SampleName").val(name ? name : "");
- //}
- });
- } else {
- $("#SearchSampleName").combotree({
- data: []
- });
- }
- //var rows = data.rows;
- ////var first = "{\"SpecialsID\":\"";
- ////for (var i = 0; i < rows.length; i++) {
- //// first += (first === "{\"SpecialsID\":\"" ? "" : "@@|@@") + rows[i].SpecialsID;
- ////}
- ////first += "\",\"Name\":\"全部\"}";
- //var first = "{\"Name\":\"\",\"Name\":\"全部\"}";
- //var firstJson = JSON.parse(first);
- //rows.unshift(firstJson);
- //$('#SearchSampleName').combobox("clear").combobox({
- // data: rows,
- // valueField: 'Name',
- // textField: 'Name',
- // onLoadSuccess: function() {
- // var val = $(this).combobox('getData');
- // // ReSharper disable once MissingHasOwnPropertyInForeach
- // for (var item in val[0]) {
- // if (item === 'Name') {
- // $(this).combobox('select', val[0][item]);
- // }
- // }
- // }
- //});
- }
- });
- }
- //根据检测方法获取检测项目下拉框的option
- function GetCheckProjectSelStr() {
- $.ajax({
- url: "/GetResult/GetCheckProjectSelStrResult",
- type: "post",
- async: false,
- dataType: "json",
- data: { CheckMethod: $("#SearchCheckMethod").combobox("getValue") },
- success: function(data) {
- //console.log(msg);
- if (CheckAajxData(data) === false) return;
- var rows = data.rows;
- var first = "{\"CheckProjectTypeID\":\"\",\"Name\":\"全部\"}";
- var firstJson = JSON.parse(first);
- rows.unshift(firstJson);
- $('#SearchCheckProjectTypeID').combobox("clear").combobox({
- data: rows,
- valueField: 'CheckProjectTypeID',
- textField: 'Name',
- onLoadSuccess: function() {
- var val = $(this).combobox('getData');
- // ReSharper disable once MissingHasOwnPropertyInForeach
- for (var item in val[0]) {
- if (item === 'CheckProjectTypeID') {
- $(this).combobox('select', val[0][item]);
- }
- }
- }
- });
- }
- });
- }
- function SearchModal(searchType) {
- if (searchType === "#Market") {
- $('#winModal_Search').window({ "title": "搜索被检单位" });
- $("#hidSetSearch_Type").val("#MarketID");
- $("#Search_SampleName").hide();
- $("#Search_Market").show();
- $("#dg_SearchRegionID").val($("#SearchRegionID").combotree("getValue"));
- //GetMarketSelStr();
- } else {
- $("#Search_SampleName").show();
- $("#hidSetSearch_Type").val("#SampleName");
- //$("#dg_SearchLittleKindName").val($("#SearchLittleKindName").combobox("getValue"));
- $("#Search_Market").hide();
- $('#winModal_Search').window({ "title": "搜索品种名" });
- }
- $('#winModal_Search input').val("");
- DgSearchLoadTable();
- $('#winModal_Search').window('open');
- }
- function SetSearch(idStr) {
- idStr = idStr || $("#hidSetSearch_Type").val();
- var rows = $('#dgTable_Search').datagrid('getSelections');
- if (rows.length === 0) {
- rows = $('#dgTable_Search_tree').datagrid('getSelections');
- }
- if (rows.length === 1) {
- var row = rows[0];
- console.log(row);
- if (idStr === "#MarketID") {
- $("#SearchMarketID").combobox("setValue", row.MarketID);
- } else if (idStr === "#SampleName") {
- //$("#SearchSampleName").combobox("setValue", row.Name);
- $("#SearchSampleName").combotree("setValue", row.VarietyCategoryNo);
- }
- $('#winModal_Search').window('close');
- } else {
- layer.alert('请选择一条记录进行设置', { icon: 7, title: '提示信息' });
- }
- }
- function DgSearchLoadTable(searchType) {
- searchType = searchType || $("#hidSetSearch_Type").val();
- if (searchType === "#MarketID") {
- var regionId = $("#SearchRegionID").combotree("getValue"),
- marketName = $("#dg_SearchMarketName").val();
- $('#dgTable_Search').datagrid({
- url: '@Url.Action("MarketSearchResult", "GetResult")' + '?RegionId=' + escape(regionId) + '&MarketName=' + escape(marketName),
- columns: [
- [
- { field: 'Names', title: '市场名称', width: 130, align: 'center' },
- { field: 'Principal', title: '负责人', width: 80, align: 'center' },
- { field: 'LinkMan', title: '日常联系人', width: 80, align: 'center' },
- { field: 'LinkTel', title: '联系电话', width: 100, align: 'center' }
- //{ field: 'FrontForUnit', title: '主办单位', width: 150, align: 'center' },
- //{ field: 'ManageUnit', title: '管理单位', width: 150, align: 'center' }
- ]
- ]
- });
- } else {
- var littleKindName = $("#dg_SearchLittleKindName").val(),
- sampleName = $("#dg_SearchSampleName").val();
- $('#dgTable_Search_tree').treegrid({
- idField: 'VarietyCategoryNo',
- treeField: 'VarietyCategoryName',
- url: '@Url.Action("SampleNameSearchResult", "GetResult")' + '?LittleKindName=' + escape(littleKindName) + '&SampleName=' + escape(sampleName),
- columns: [
- [
- { field: 'VarietyCategoryName', title: '品种名称', width:"90%" ,align: 'center' }
- ]
- ]
- });
- }
- }
- var start = {
- elem: "#StartTime",
- format: "YYYY-MM-DD",
- min: "2010-01-01",
- event: "focus",
- choose: function(datas) {
- end.min = datas; //开始日选好后,重置结束日的最小日期
- end.start = datas; //将结束日的初始值设定为开始日
- $('#SearchStartTime').val(datas);
- }
- },
- end = {
- elem: "#EndTime",
- format: "YYYY-MM-DD",
- min: "2010-01-01",
- event: "focus",
- choose: function(datas) {
- start.max = datas; //结束日选好后,重置开始日的最大日期
- $('#SearchEndTime').val(datas);
- }
- };
- $(function () {
- var dataRegion =@Html.Raw(ViewBag.SelRegionInfo);
- $("#SearchRegionID").combotree({
- data: dataRegion,
- //onLoadSuccess: function() {
- // $("#RegionID").combotree("setValue", "100001");
- //}
- });
- $("#SearchStartTime").next("span").find("input").attr("id", "StartTime");
- $("#SearchEndTime").next("span").find("input").attr("id", "EndTime");
- $("#SearchStartTime").textbox("setValue", laydate.now(-30, 'YYYY-MM-DD'));
- $("#SearchEndTime").textbox("setValue", laydate.now(1, 'YYYY-MM-DD'));
- if ($("#hid_IsMarketSysAccount").val() === "0") {
- $("#SearchRegionID").combotree("setValue", "@ViewBag.RegionID").combotree("readonly");
- $("#SearchMarketID").combobox("readonly");
- //$("#SearchCheckUnit").combobox("setValue", $("#hid_CheckUnit").val());
- //if ($("#hid_CheckUnit").val().length > 0) {
- // $("#SearchCheckUnit").combobox("disable");
- //}
- }
- GetMarketSelStr();
- GetLittleKindSelStr();
- GetCheckProjectSelStr();
- //加载表格数据
- LoadTable();
- //加载日历控件
- laydate(start);
- laydate(end);
-
- $(".combo-panel.panel-body ul.tree").parent().addClass("treeC");
- });
- </script>
- </div>
- </body>
- </html>
|