1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264 |
-
- @{
- Layout = null;
- }
- <!DOCTYPE html>
- <html>
- <head>
- <meta name="viewport" content="width=device-width" />
- <title>CheckDataList</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="~/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>
- <style>
- .datagrid-header td,
- .datagrid-body .datagrid-row td {
- padding: 2px;
- }
- #CheckDataTb {
- height: 55vh;
- }
- @@media(min-device-width:1400px) {
- #CheckDataTb {
- height: 69vh;
- }
- }
- </style>
- </head>
- <body>
- <section class="hidden">
- <input id="hid_Type" name="hid_Type" type="hidden" value="Add" />
- <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="hid_SampleName" name="hid_SampleName" type="hidden" value="" />
- <input id="hidSetSearch_Type" name="hidSetSearch_Type" type="hidden" value="0" />
- <input id="hid_vali" name="hid_vali" type="hidden" value="0" />
- </section>
- <section id="Search_Panel">
- @*<div id="" class="easyui-panel" title="检测数据在线录入(<strong class='text-requird'>*</strong>是必须添入的项目)(<strong class='text-requird'>*</strong>是必须添入的项目)"
- style="width: 100%; height: 285px; padding: 10px;"
- data-options="closable:false,collapsible:false">
- </div>*@
- <table class="panel-table" style="margin:10px auto 0;">
- @Html.Hidden("ID")
- <tr>
- <td class="td-label"><label for="RegionID">所在地区</label></td>
- <td class="td-input">
- <input class="easyui-combotree" style="height: 22px" id="RegionID" name="RegionID" data-options="onChange:function(){GetMarketSelStr()}" />
- @*<select class="easyui-combobox" style="height: 22px" id="RegionID" name="RegionID" data-options="onChange:function(){GetMarketSelStr()}">
- <option value="">请选择...</option>
- @Html.Raw(ViewBag.SelRegionInfo)
- </select>*@
- </td>
- <td class="td-label"><label for="CheckUnit">检测单位</label></td>
- <td class="td-input">
- <select class="easyui-combobox" style="height: 22px" id="CheckUnit" name="CheckUnit">
- <option value="">请选择...</option>
- @Html.Raw(ViewBag.SelCheckUnitInfo)
- </select>
- <strong class="text-requird">*</strong>
- </td>
- <td class="td-label"><label for="MarketID">被检单位</label></td>
- <td class="td-input">
- <select class="easyui-combobox" style="height: 22px" id="MarketID" name="MarketID" data-options="onChange:function(){GetMarketStallsSelStr()},icons:[{
- iconCls:'icon-search_zoom',handler:function(){SearchModal('#Market')}
- }]">
- <option value="">请选择...</option>
- @Html.Raw(ViewBag.SelMarketInfo)
- </select>
- </td>
- @*<td class="td-label"><label for="CorpName">被检对象</label></td>
- <td class="td-input">
- <input class="easyui-combobox" style="height: 22px" id="CorpName" name="CorpName" data-options="icons:[{
- iconCls:'icon-search_zoom',handler:function(){SearchModal('#MarketSeller')}
- }]">
- </td>*@
- <td class="td-label"><label for="StallNo">摊位号</label></td>
- <td class="td-input">
- <input class="easyui-textbox" style="height: 22px" id="StallNo" name="CheckValue">
- </td>
- </tr>
- <tr>
- <td class="td-label"><label for="CheckMethod">检测方法</label></td>
- <td class="td-input">
- <select class="easyui-combobox" style="height: 22px" id="CheckMethod" name="CheckMethod" data-options="onChange:function(){GetCheckProjectSelStr()}">
- <option value="">请选择...</option>
- @Html.Raw(ViewBag.SelCheckMethodInfo)
- </select>
- @*<strong class="text-requird">*</strong>*@
- </td>
- <td class="td-label"><label for="CheckProjectTypeID">检测项目</label></td>
- <td class="td-input">
- <select class="easyui-combobox" style="height: 22px" id="CheckProjectTypeID" name="CheckProjectTypeID" data-options="onChange:function(){GetCheckProjectInfo()}">
- @Html.Raw(ViewBag.SelCheckProjectTypeInfo)
- </select>
- <strong class="text-requird">*</strong>
- </td>
- <td class="td-label"><label for="StandardValue">标准值</label></td>
- <td class="td-input">
- <input class="easyui-textbox" style="height: 22px" id="StandardValue" name="StandardValue" disabled="disabled">
- </td>
- <td class="td-label"><label for="StandardUnit">单位</label></td>
- <td class="td-input">
- <input class="easyui-textbox" style="height: 22px" id="StandardUnit" name="StandardUnit" disabled="disabled">
- </td>
- </tr>
- <tr>
- @*<td class="td-label"><label for="LittleKindName">品种小类</label></td>
- <td class="td-input">
- <select class="easyui-combobox" style="height: 22px" id="LittleKindName" name="LittleKindName" data-options="onChange:function(){GetLittleKindSelStr()}" disabled="">
- <option value="">请选择...</option>
- @Html.Raw(ViewBag.SelLittleKindInfo)
- </select>
- </td>*@
- <td class="td-label"><label for="SampleName">品种名称</label></td>
- <td class="td-input">
- <input class="easyui-combotree" style="height: 22px" id="SampleName" name="SampleName" data-options="icons:[{
- iconCls:'icon-search_zoom',handler:function(){SearchModal()}}]" />
- @*<select class="easyui-combobox" style="height: 22px" id="SampleName" name="SampleName" data-options="icons:[{
- iconCls:'icon-search_zoom',handler:function(){SearchModal('#SampleName')}
- }]">
- <option value="">请选择...</option>
- @Html.Raw(ViewBag.SelSampleNameInfo)
- </select>*@
- <strong class="text-requird">*</strong>
- </td>
- <td class="td-label"><label for="CheckValue">检测值</label></td>
- <td class="td-input">
- <input class="easyui-textbox" style="height: 22px" id="CheckValue" name="CheckValue">
- <strong class="text-requird">*</strong>
- </td>
- <td class="td-label"><label for="CheckResult">检测结果</label></td>
- <td class="td-input">
- <select class="easyui-combobox" style="height: 22px" id="CheckResult" name="CheckResult" data-options="editable:false">
- <option value="合格" selected="selected">合格</option>
- <option value="不合格">不合格</option>
- </select>
- </td>
-
- <td class="td-label"><label for="IdCode">身份证号</label></td>
- <td class="td-input">
- <input class="easyui-textbox" style="height: 22px;" id="IdCode" name="IdCode">
- </td>
- </tr>
- <tr>
- <td class="td-label"><label for="CheckTotal">检测次数</label></td>
- <td class="td-input">
- <input class="easyui-textbox" style="height: 22px" id="CheckTotal" name="CheckTotal" value="1">
- <strong class="text-requird">*</strong>
- </td>
- <td class="td-label"><label for="IsSelf">是否自检</label></td>
- <td class="td-input">
- <select class="easyui-combobox" style="height: 22px" id="IsSelf" name="IsSelf">
- <option value="1">是</option>
- <option value="0">否</option>
- </select>
- </td>
- <td class="td-label"><label for="CorpKind">企业类型</label></td>
- <td class="td-input">
- <select class="easyui-combobox" style="height: 22px" id="CorpKind" name="CorpKind">
- @Html.Raw(ViewBag.SelCorpKindInfo)
- </select>
- </td>
- <td class="td-label"><label for="SendDate">送检日期</label></td>
- <td class="td-input">
- <input class="easyui-textbox" style="height: 22px" id="SendDate" name="SendDate">
- <strong class="text-requird">*</strong>
- </td>
- </tr>
- <tr>
- <td class="td-label"><label for="ProduceUnit">生产单位</label></td>
- <td class="td-input">
- <input class="easyui-textbox" style="height: 22px" id="ProduceUnit" name="ProduceUnit">
- </td>
- <td class="td-label"><label for="ProduceDate">生产日期</label></td>
- <td class="td-input">
- <input class="easyui-textbox" style="height: 22px" id="ProduceDate" name="ProduceDate">
- <strong class="text-requird">*</strong>
- </td>
- <td class="td-label"><label for="HabitatID">产地</label></td>
- <td class="td-input">
- <select class="easyui-combobox" style="height: 22px" id="HabitatID" name="HabitatID">
- @Html.Raw(ViewBag.SelHabitatInfo)
- </select>
- <strong class="text-requird">*</strong>
- </td>
- <td class="td-label"><label for="CheckTime">检测日期</label></td>
- <td class="td-input">
- <input class="easyui-textbox" style="height: 22px" id="CheckTime" name="CheckTime">
- <strong class="text-requird">*</strong>
- </td>
- </tr>
- <tr>
- <td class="td-label"><label for="MachineID">仪器编号</label></td>
- <td class="td-input">
- <input class="easyui-textbox" style="height: 22px" id="MachineID" name="MachineID">
- </td>
- <td class="td-label"><label for="MachineMaker">仪器厂商</label></td>
- <td class="td-input">
- <input class="easyui-textbox" style="height: 22px" id="MachineMaker" name="MachineMaker">
- </td>
- <td class="td-label"><label for="ClientIndexID">数据编号</label></td>
- <td class="td-input">
- <input class="easyui-textbox" style="height: 22px" id="ClientIndexID" name="ClientIndexID">
- </td>
- <td class="td-label"><label for="CheckUser">检测员</label></td>
- <td class="td-input">
- <input class="easyui-textbox" style="height: 22px" id="CheckUser" name="CheckUser">
- <strong class="text-requird">*</strong>
- </td>
- </tr>
- <tr>
- <td class="td-label"><label for="LicenseNo">执照编码</label></td>
- <td class="td-input">
- <input class="easyui-textbox" style="height: 22px;" id="LicenseNo" name="LicenseNo">
- </td>
- <td class="td-label"><label for="LicenseName">执照名称</label></td>
- <td class="td-input">
- <input class="easyui-textbox" style="height: 22px;" id="LicenseName" name="LicenseName">
- </td>
- @*<td class="td-label"><label for="IdCode">身份证号</label></td>
- <td class="td-input">
- <input class="easyui-textbox" style="height: 22px;" id="IdCode" name="IdCode">
- </td>*@
- <td class="td-label"><label for="CardIndex">安全编码</label></td>
- <td class="td-input">
- <input class="easyui-textbox" style="height: 22px;" id="CardIndex" name="CardIndex">
- </td>
- <td class="td-label"><label for="Memo">备注</label></td>
- <td class="td-input" colspan="7">
- <input class="easyui-textbox" style="height: 22px;" id="Memo" name="Memo">
- </td>
- </tr>
-
- <tr>
- <td colspan="2"></td>
- <td colspan="4" style="text-align: center;">
- <a class="easyui-linkbutton" id="Save" data-options="iconCls:'icon-ok'" href="javascript:void(0)" style="width: 80px; margin: 5px 15px 0; z-index: 1000; position: relative" onclick="Save()">添加</a>
- <a class="easyui-linkbutton" id="Reset" data-options="iconCls:'icon-delete'" href="javascript:void(0)" onclick="Reset()" style="width: 80px; margin: 5px 15px 0; z-index: 1000; position: relative">重置</a>
-
- </td>
- <td colspan="2" style="text-align: left;">
- <span style="z-index: 1000;">
- (提示:<strong class='text-requird'>*</strong>是必须添入的项目)
- </span>
- </td>
- </tr>
- </table>
- </section>
- <section id="CheckDataTb" style="padding: 0 20px;margin-top:-25px;">
- <div class="row tbToolBar" id="tbToolBar">
- <div class="toolbar" id="CurdTool">
- <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="btn_Detail()">查看</a>
- <span class="shuxian"></span>
- <a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="btn_Edit()">修改</a>
- <a class="easyui-linkbutton" href="#" iconCls="icon-Excel" plain="true" onclick="uploadExcelFile()" >导入数据</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_Edit();
- },
- pagination: true,
- pageSize: 50,
- pageList: [15,20, 50, 100]
- ">
- <thead>
- <tr>
- <th data-options="field:'CheckMethodName',width:80">检测方法</th>
- <th data-options="field:'CheckItemName',width:100">检测项目</th>
- <th data-options="field:'SampleName',width:80">品种名称</th>
- <th data-options="field:'CheckValue',width:80">检测值</th>
- <th data-options="field:'CorpName',width:150">被检对象</th>
- <th data-options="field:'CheckResult',width:50">检测结果</th>
- <th data-options="field:'Unit',width:100">检测单位</th>
- <th data-options="field:'CheckUser',width:60">检测员</th>
- </tr>
- </thead>
- </table>
- </section>
- <section>
- <div id="winModal" class="easyui-window winModal" title="检测数据信息" style="width: 800px;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:600PX">
- <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="2"></td>
- <td class="tdName"><strong>检测单位</strong>:</td>
- <td id="Detail_CheckUnit" class="tdVal" colspan="2"></td>
- </tr>
- <tr>
- <td class="tdName"><strong>被检企业</strong>:</td>
- <td id="Detail_CorpName" class="tdVal" colspan="2"></td>
- <td class="tdName"><strong>企业类型</strong>:</td>
- <td id="Detail_CorpKind" class="tdVal" colspan="2"></td>
- </tr>
- <tr>
- <td class="tdName"><strong>检测项目</strong>:</td>
- <td id="Detail_CheckProjectTypeName" class="tdVal" colspan="2"></td>
- <td class="tdName"><strong>检测值</strong>:</td>
- <td id="Detail_CheckValue" class="tdVal" colspan="2"></td>
- </tr>
- <tr>
- <td class="tdName"><strong>标准值</strong>:</td>
- <td id="Detail_StandardValue" class="tdVal" colspan="2"></td>
- <td class="tdName"><strong>单位</strong>:</td>
- <td id="Detail_Unit" class="tdVal" colspan="2"></td>
- </tr>
- <tr>
- <td class="tdName"><strong>检测次数</strong>:</td>
- <td id="Detail_CheckTotal" class="tdVal" colspan="2"></td>
- <td class="tdName"><strong>检测对比</strong>:</td>
- <td id="Detail_CheckResult" class="tdVal" colspan="2"></td>
- </tr>
- <tr>
- <td class="tdName"><strong>是否自检</strong>:</td>
- <td id="Detail_IsSelf" class="tdVal" colspan="2"></td>
- <td class="tdName"><strong>检测员</strong>:</td>
- <td id="Detail_CheckUser" class="tdVal" colspan="2"></td>
- </tr>
- <tr>
- <td class="tdName"><strong>送检日期</strong>:</td>
- <td id="Detail_SendDate" class="tdVal" colspan="2"></td>
- <td class="tdName"><strong>检测日期</strong>:</td>
- <td id="Detail_CheckTime" class="tdVal" colspan="2"></td>
- </tr>
- <tr>
- @*<td class="tdName"><strong>品种小类</strong>:</td>
- <td id="Detail_LittleKindName" class="tdVal" colspan="2"></td>*@
- <td class="tdName"><strong>品种名</strong>:</td>
- <td id="Detail_SampleName" class="tdVal" colspan="5"></td>
- </tr>
- <tr>
- <td class="tdName"><strong>生产单位</strong>:</td>
- <td id="Detail_ProduceUnit" class="tdVal" colspan="2"></td>
- <td class="tdName"><strong>生产日期</strong>:</td>
- <td id="Detail_ProduceDate" class="tdVal" colspan="2"></td>
- </tr>
- <tr>
- <td class="tdName"><strong>产地</strong>:</td>
- <td id="Detail_HabitatName" class="tdVal" colspan="2"></td>
- <td class="tdName"><strong>仪器编号</strong>:</td>
- <td id="Detail_MachineID" class="tdVal" colspan="2"></td>
- </tr>
- <tr>
- <td class="tdName"><strong>仪器厂商</strong>:</td>
- <td id="Detail_MachineMaker" class="tdVal" colspan="2"></td>
- <td class="tdName"><strong>数据编号</strong>:</td>
- <td id="Detail_ClientIndexID" class="tdVal" colspan="2"></td>
- </tr>
- <tr>
- <td class="tdName"><strong>备注</strong>:</td>
- <td id="Detail_Memo" class="tdVal" colspan="5"></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_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',
- rownumbers: true,
- remoteSort: false,
- onDblClickRow: function () {
- SetSearch();
- }
- ">
- <thead>
- <tr></tr>
- </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,
- rownumbers: true,
- remoteSort: false,
- loadFilter: pagerFilter,
- onDblClickRow: function () {
- SetSearch();
- }
- ">
- <thead>
- <tr></tr>
- </thead>
- </table>
- </div>
- </div>
- <div id="Search_MarketSeller" style="display:none">
- <div class="panle-half">
- <div class="input-group">
- <label class="input-group-addon control-label" for="dg_SearchMarketId" style="min-width:70px">所属市场</label>
- <select class="form-control input-group-addon" aria-disabled="true" name="dg_SearchMarketId" id="dg_SearchMarketId" type="text" value="" placeholder="选择所属市场" disabled="">
- @*@Html.Raw(ViewBag.SelMarketInfo)*@
- </select>
- </div>
- </div>
- <div class="panle-half">
- <div class="input-group">
- <label class="input-group-addon control-label" for="dg_SearchSellerName" style="min-width:70px">经营户名</label>
- <input class="form-control input-group-addon" aria-disabled="true" name="dg_SearchSellerName" id="dg_SearchSellerName" 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_SearchSeller" class="easyui-datagrid" style="width:98%; height: 420px;"
- data-options="singleSelect: true,
- method: 'post',
- multiSort: false,
- @*toolbar: '#tbToolBar_Attach',*@
- fitColumns: true,
- @*rownumbers: true,*@
- remoteSort: false,
- @*loadFilter: pagerFilter,*@
- onDblClickRow: function () {
- SetSearch('#SearchMarketSellerID');
- },
- 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>
- <div id="winModal_Upload" class="easyui-window winModal" title="上传Excel检测数据信息" style="width: 550px; height: 400px;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 class="form-horizontal" role="form">
- <input type="file" class="form-control" placeholder="上传excel" id="UploadExcel" name="UploadExcel" autocomplete="off" value="" />
- </form>
-
-
- </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-ok'" href="javascript:void(0)" onclick="ExcelUpload()" style="width:80px">确认导入</a>
-
- <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winModal_Upload').window('close');" style="width:80px">取消</a>
- </div>
- </div>
- </div>
- </section>
- <script>
- var lock = false;
- function SampleNameChange() {
- alert(1);
- }
- function uploadExcelFile() {
- $('#UploadExcel').val('');
- $("#winModal_Upload").window("open");
- }
- function ExcelUpload() {
- var formData = new FormData();
-
- formData.append('uploadExcel', $('#UploadExcel')[0].files[0]);
- $.ajax({
- url: "@Url.Action("UploadCheckData", "MarketSystem")",
- processData: false,
- contentType: false,
- type: "post",
- data: formData,
- success: function(msg) {
- if (msg&&msg.Success) {
- LoadTable();
- //Reset();
- layer.alert("上传成功", { icon: 1, title: '提示信息' });
- $("#winModal_Upload").window("close");
- } else {
- layer.alert("上传失败"+msg.Msg, { icon: 1, title: '提示信息' });
- }
- }
- });
- }
- function Save(type) {
- type = type || $("#hid_Type").val();
- if (lock) return;
- $.ajax({
- url: "@Url.Action("CheckDataOper", "MarketSystem")",
- type: "post",
- dataType: "json",
- beforeSend: function() {
- $("#Search_Panel .text-requird").each(function() {
- var idStr = $(this).parent().children(":first").attr("id");
- if (idStr!=undefined) {
- if (CheckEmpty("#" + idStr) === true) {
- $("#hid_vali").val("1");
- return false;
- }
- }
- });
- if ($("#hid_vali").val()==="1") {
- return false;
- }
- var sampleId = $("#SampleName").combotree("getValue");
- console.log(sampleId);
- if (sampleId === "undefined"|| sampleId.trim()==="")
- {
- layer.alert("检测品种不能为空", { icon: 7, title: '提示信息' },function (index) {
- $("#hid_vali").val("0");
- $("#SampleName").next("span").find(".textbox-text").focus();
- layer.close(index);
-
- });
- return false;
- }
- if (!isNumber($("#CheckValue").textbox("getValue"))) {
- layer.alert("检测值必须为数字!", { icon: 7, title: '提示信息' },function (index) {
- $("#CheckValue").textbox("setValue", "");
- $("#CheckValue").next("span").find(".textbox-text").val("").focus();
- layer.close(index);
- });
- return false;
- }
- if (!isNumber($("#CheckTotal").textbox("getValue"))) {
- layer.alert("检测次数必须为数字!", { icon: 7, title: '提示信息' },function (index) {
- $("#CheckTotal").textbox("setValue", "");
- $("#CheckTotal").next("span").find(".textbox-text").val("").focus();
- layer.close(index);
- });
- return false;
- }
-
- lock = true;
- },
- data: {
- CurdType: type,
- ID: $("#ID").val(),
- CheckUnit: $("#CheckUnit").combobox("getValue"),
- Memo: $("#Memo").textbox("getValue"),
- //Memo: "",
- IsSelf: $("#IsSelf").combobox("getValue"),
- MarketID: $("#MarketID").combobox("getValue"),
- SendDate: $("#SendDate").textbox("getValue"),
- MachineMaker: $("#MachineMaker").textbox("getValue"),
- CorpKind: $("#CorpKind").combobox("getValue"),
- //CorpName: $("#CorpName").combobox("getValue"),
- ProduceUnit: $("#ProduceUnit").textbox("getValue"),
- ProduceDate: $("#ProduceDate").textbox("getValue"),
- ClientIndexID: $("#ClientIndexID").textbox("getValue"),
- MachineID: $("#MachineID").textbox("getValue"),
- CheckTime: $("#CheckTime").textbox("getValue"),
- CheckTotal: $("#CheckTotal").textbox("getValue"),
- CheckResult: $("#CheckResult").combobox("getValue"),
- StandardValue: $("#StandardValue").textbox("getValue"),
- CheckValue: $("#CheckValue").textbox("getValue"),
- SampleId: $("#SampleName").combotree("getValue"),
- SampleName: $("#hid_SampleName").val(),
- //LittleKindName: $("#LittleKindName").combobox("getValue"),
- CheckProjectTypeID: $("#CheckProjectTypeID").combobox("getValue"),
- HabitatID: $("#HabitatID").combobox("getValue"),
- CheckUser: $("#CheckUser").textbox("getValue"),
- StallNo: $("#StallNo").textbox("getValue"),
- LicenseNo: $("#LicenseNo").textbox("getValue"),
- LicenseName: $("#LicenseName").textbox("getValue"),
- IdCode: $("#IdCode").textbox("getValue"),
- CardIndex: $("#CardIndex").textbox("getValue")
- },
- success: function (data) {
- if (CheckAajxData(data) === false) return;
- var msg = data.ErrorInfo;
- if (data.Success === true) {
- LoadTable();
- //Reset();
- layer.alert(msg, { icon: 1, title: '提示信息' });
- } else {
- layer.alert(msg, { icon: 7, title: '提示信息' });
- }
- lock = false;
- },
- error:function() {
- lock = false;
- }
- });
- }
- function CheckEmpty(idStr) {
- var val = $(idStr).next("span").find(".textbox-value").val();
- var msg = $(idStr).parent().prev().children(":first").html()+ "不能为空!";
- if (val===""||val==undefined||val==="请选择...") {
- layer.alert(msg, { icon: 7, title: '提示信息' },function (index) {
- $(idStr).next("span").find(".textbox-text").focus();
- $("#hid_vali").val("0");
- layer.close(index);
- });
- return true;
- }
- return false;
- };
- function CheckNum(idStr) {
- var val = $(idStr).next("span").find(".textbox-value").val();
- var msg = $(idStr).parent().prev().children(":first").html()+ "必须为数字!";
- if (!isNumber(val)) {
- layer.alert(msg, { icon: 7, title: '提示信息' },function (index) {
- $(idStr).next("span").find(".textbox-text").focus();
- layer.close(index);
- });
- return false;
- }
- return true;
- };
- //重置恢复初始值
- function Reset() {
- lock = false;
- $("#Search_Panel select.easyui-combobox").combobox("setValue","");
- $("#Search_Panel input.easyui-textbox").textbox("setValue","");
- if ($("#hid_IsMarketSysAccount").val() === "0") {
- //$("#IsSelf").combobox("setValue", "1");
- $("#RegionID").combotree("setValue", @ViewBag.RegionID).combobox("disable");
- var t = $("#hid_CheckUnit").val();
- $("#CheckUnit").combobox("setValue", t);
- if (t.length > 0) {
- $("#CheckUnit").combobox("disable");
- }
- }
- GetMarketSelStr();
- GetLittleKindSelStr();
- GetCheckProjectSelStr();
- $("#IsSelf").combobox("setValue", $("#hid_IsSystem").val());
- $("#HabitatID").combobox("setValue", "1010");
- $("#CheckResult").combobox("setValue", "合格");
- $("#CheckUser").textbox("setValue", $("#hid_CheckUser").val());
- $("#SendDate").textbox("setValue",laydate.now(0, 'YYYY-MM-DD'));
- $("#ProduceDate").textbox("setValue",laydate.now(0, 'YYYY-MM-DD'));
- $("#CheckTime").textbox("setValue",laydate.now(0, 'YYYY-MM-DD'));
- //$("#CorpName").next("span").find("input").focus();
- $("#CheckTotal").textbox("setValue","1"),
- $("#hid_Type").val("Add");
- $("#Save span.l-btn-text").html("添加");
- }
- //modal赋值
- function SetModalVal() {
- var rows = $('#dgTable').datagrid('getSelections');
- if (rows.length === 1) {
- var row = rows[0];
- console.log(row);
- //var littleKindName;
- //try {
- // var paths = row.Path.split(",");
- // if (paths.length > 1) {
- // littleKindName = paths[1];
- // }
- //} catch (e) {
- // console.log(e);
- // littleKindName="";
- //}
- $("#ID").val(row.ID);
- $("#CheckUnit").combobox("setValue", row.CheckUnit);
- $("#CheckUser").textbox("setValue", row.CheckUser);
- $("#HabitatID").combobox("setValue", row.HabitatID);
- $("#CheckMethod").combobox("setValue", row.CheckMethodId);
- GetCheckProjectSelStr(row.CheckProjectTypeID);
- //$("#CheckProjectTypeID").combobox("setValue", row.CheckProjectTypeID);
- //GetCheckProjectInfo();
- //$("#LittleKindName").combobox("setValue", littleKindName);
- GetLittleKindSelStr(row.SampleId, row.SampleName);
- //$("#hid_SampleName").val(row.SampleName);
- //$("#SampleName").combotree("setValue", row.SampleId ? row.SampleId:"");
- $("#CheckValue").textbox("setValue", row.CheckValue);
- $("#CheckResult").combobox("setValue", row.CheckResult);
- $("#CheckTotal").textbox("setValue", row.CheckTotal);
- $("#CheckTime").textbox("setValue", row.CheckTime);
- $("#MachineID").textbox("setValue", row.MachineID);
- $("#MachineMaker").textbox("setValue", row.MachineMaker);
- $("#ClientIndexID").textbox("setValue", row.ClientIndexID);
- $("#ProduceUnit").textbox("setValue", row.ProduceUnit);
- $("#ProduceDate").textbox("setValue", row.ProduceDate);
- $("#CorpKind").combobox("setValue", row.CorpKind);
- $("#SendDate").textbox("setValue", row.SendDate);
- $("#RegionID").combotree("setValue", row.RegionID);
- $("#Memo").textbox("setValue", row.Memo);
- $("#IsSelf").combobox("setValue", row.IsSelf);
- $("#StallNo").textbox("setValue", row.StallNo);
- $("#LicenseNo").textbox("setValue", row.LicenseNo);
- $("#LicenseName").textbox("setValue", row.LicenseName);
- $("#IdCode").textbox("setValue", row.IdCode);
- $("#CardIndex").textbox("setValue", row.CardIndex);
- if ($("#hid_IsSystem").val() === "0") {
- GetMarketSelStr();
- $("#MarketID").combobox("setValue", row.MarketID);
- //GetMarketSellerSelStr();
- //GetMarketStallsSelStr();
- }
- //$("#CorpName").combobox("setValue", row.CorpName);
- } else {
- layer.alert('请选择一条记录进行设置', {title:'提示信息'});
- }
- }
- //查看详情
- 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.SampleName);
- $("#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('请选择一条记录进行设置', {title:'提示信息'});
- }
- }
- //修改
- function btn_Edit() {
- $("#hid_Type").val("Edit");
- $("#Save span.l-btn-text").html("修改");
- SetModalVal();
- }
- //根据辖区获取市场下拉框的option
- function GetMarketSelStr() {
- $.ajax({
- url: "/GetResult/GetMarketSelStrResult",
- type: "post",
- async: false,
- dataType: "json",
- //data: { RegionID: $("input.combobox-value[name='SearchRegionID']").val() },
- data: { RegionID: $("#RegionID").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);
- $('#MarketID').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();
- $("#MarketID").combobox("setValue",m).combobox("disable");
- } else {
- for (var item in val[0]) {
- if (item === 'MarketID') {
- $(this).combobox('select', val[0][item]);
- }
- }
- }
- }
- });
- }
- });
- }
- //根据市场获取经营户下拉框的option
- function GetMarketSellerSelStr() {
- $.ajax({
- url: "/GetResult/GetMarketSellerSelStrResult",
- type: "post",
- async: false,
- dataType: "json",
- //data: { RegionID: $("input.combobox-value[name='SearchRegionID']").val() },
- data: { marketId: $("#MarketID").combobox("getValue") },
- success: function (data) {
- //console.log(msg);
- if (CheckAajxData(data) === false) return;
- var rows = data.rows;
- var first = "{\"Name\":\"\",\"Name\":\"请选择...\"}";
- //var last = "{\"MarketID\":\"Other\",\"Names\":\"其他\"}";
- var firstJson = JSON.parse(first);
- //var lastJson = JSON.parse(last);
- rows.unshift(firstJson);
- //rows.push(lastJson);
- //console.log(rows);
- $('#CorpName').combobox("clear").combobox({
- data: rows,
- //valueField: 'SellerID',
- 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 GetMarketStallsSelStr() {
- $.ajax({
- url: "/GetResult/GetMarketStallsResult",
- type: "post",
- async: false,
- dataType: "json",
- //data: { RegionID: $("input.combobox-value[name='SearchRegionID']").val() },
- data: { marketId: $("#MarketID").combobox("getValue") },
- success: function (data) {
- //console.log(msg);
- if (CheckAajxData(data) === false) return;
- var rows = data.rows;
- var first = "{\"StallNo\":\"\",\"Name\":\"请选择...\"}";
- //var last = "{\"MarketID\":\"Other\",\"Names\":\"其他\"}";
- var firstJson = JSON.parse(first);
- //var lastJson = JSON.parse(last);
- rows.unshift(firstJson);
- //rows.push(lastJson);
- //console.log(rows);
- $('#CorpName').combobox("clear").combobox({
- data: rows,
- //valueField: 'SellerID',
- valueField: 'Name',
- textField: 'StallName',
- 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 GetLittleKindSelStr(id,name) {
- $.ajax({
- url: "/GetResult/GetLittleKindSelStrResult",
- type: "post",
- dataType: "json",
- async: false,
- //data: { LittleKindName: $("#LittleKindName").combobox("getValue") },
- success: function (data) {
- //console.log(msg);
- if (CheckAajxData(data) === false) return;
- //console.log(data);
- if (data.length>0) {
- $("#SampleName").combotree({
- data: data,
- onSelect: 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 {
- $("#SampleName").combotree({
- data:[]
- });
- }
- }
- });
- }
- //根据检测方法获取检测项目下拉框的option
- function GetCheckProjectSelStr(id) {
- $.ajax({
- url: "/GetResult/GetCheckProjectSelStrResult",
- type: "post",
- dataType: "json",
- //async:false,
- data: { CheckMethod: $("#CheckMethod").combobox("getValue") },
- success: function (data) {
- if (CheckAajxData(data) === false) return;
- var rows = data.rows;
- //console.log(data);
- var first = "{\"CheckProjectTypeID\":\"\",\"Name\":\"请选择...\"}";
- var firstJson = JSON.parse(first);
- rows.unshift(firstJson);
- $('#CheckProjectTypeID').combobox("clear").combobox({
- data: rows,
- valueField: 'CheckProjectTypeID',
- textField: 'Name',
- onLoadSuccess: function () {
- if (id != null) {
- //console.log(id)
- $("#CheckProjectTypeID").combobox("setValue", id);
- GetCheckProjectInfo();
- } else {
- 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 GetCheckProjectInfo() {
- $.ajax({
- url: "/GetResult/GetCheckProjectInfoResult",
- type: "post",
- dataType: "json",
- data: { CheckProjectTypeID: $("#CheckProjectTypeID").combobox("getValue") },
- success: function (data) {
- if (CheckAajxData(data) === false) return;
- var row = data.rows[0];
- if (row!=null) {
- $('#StandardValue').textbox("setValue",row.StandardValue);
- $('#StandardUnit').textbox("setValue", row.Unit);
- $('#CheckValue').textbox("setValue", row.StandardValue);
- }
- }
- });
- }
- function MarketIDChanaged() {
- if ($('#MarketID').combobox("getValue")==="Other") {
- var retval = window.prompt("输入被检企业名:", "");
- if (retval !== "" && retval != null) {
- $('#MarketID').combobox("setText", retval);
- //$("#CorpName").textbox("setValue", retval).textbox("disable");
- }
- } else {
- //$("#CorpName").textbox("enable").textbox("setValue", "");
- }
- }
- function SearchModal(searchType) {
- if (searchType === "#Market") {
- $('#winModal_Search').window({"title": "搜索被检单位"});
- $("#hidSetSearch_Type").val("#MarketID");
- $("#Search_SampleName").hide();
- $("#Search_MarketSeller").hide();
- $("#Search_Market").show();
- //GetMarketSelStr();
- $("#dg_SearchRegionID").val($("#RegionID").combobox("getValue"));
- } else if (searchType === "#MarketSeller") {
- $('#winModal_Search').window({ "title": "搜索被检对象"});
- $("#hidSetSearch_Type").val("#MarketSeller");
- $("#Search_Market").hide();
- $("#Search_SampleName").hide();
- $("#Search_MarketSeller").show();
- $("#dg_SearchMarketId").val($("#MarketID").combobox("getValue"));
- }
- else {
- $("#hidSetSearch_Type").val("#SampleName");
- //$("#dg_SearchLittleKindName").val($("#LittleKindName").combobox("getValue"));
- $("#Search_MarketSeller").hide();
- $("#Search_Market").hide();
- $("#Search_SampleName").show();
- $('#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 === 0) {
- rows = $('#dgTable_SearchSeller').datagrid('getSelections');
- }
- if (rows.length === 1) {
- var row = rows[0];
- console.log(row);
- if (idStr === "#MarketID") {
- $(idStr).combobox("setValue",row.MarketID);
- } else if (idStr === "#MarketSeller") {
- $("#CorpName").combobox("setValue", row.CorpName);
- }
- else {
- $(idStr).combotree("setValue", row.VarietyCategoryNo);
- $("#hid_SampleName").val(row.VarietyCategoryName);
- }
- $('#winModal_Search').window('close');
- } else {
- layer.alert('请选择一条记录进行设置', { icon: 7, title: '提示信息' });
- }
- }
- function DgSearchLoadTable(searchType) {
- searchType = searchType || $("#hidSetSearch_Type").val();
- if (searchType === "#MarketID") {
- var regionId = $("#RegionID").combotree("getValue"),
- marketName = $("#dg_SearchMarketName").val();
- $('#dgTable_Search').datagrid({
- pagination: true,
- pageSize: 50,
- pageList: [10, 20, 50, 100],
- 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 if (searchType === "#MarketSeller") {
- var marketId = $("#dg_SearchMarketId").val(),
- sellerName = $("#dg_SearchSellerName").val();
- $('#dgTable_SearchSeller').datagrid({
- url: '@Url.Action("SellerSearchResult", "GetResult")' + '?MarketID=' + escape(marketId) + '&MarketSellerName=' + escape(sellerName),
- columns: [[
- { field: 'MarketSellerName', title: '经营户名', width: 150, align: 'center' },
- { field: 'IdCard', title: '身份证', width: 180, align: 'center' },
- { field: 'EnterMarketDate', title: '入场时间', width: 180, align: 'center' },
- { field: 'Tel', title: '联系电话', width: 180, align: 'center' }
- //{ field: 'StallName', title: '摊位号', width: 250, align: 'center' },
- //{ field: 'MarketName', title: '隶属市场', width: 180, align: 'center' },
- //{ field: 'TradeTypeName', title: '所在行业', width: 200, 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%" }
- ]
- ]
- });
- }
- }
- //加载表格数据
- function LoadTable() {
- $('#dgTable').datagrid({
- url: '@Url.Action("CheckDataResult", "GetResult")'
- });
- }
- //easyui Textbox控件用laydate
- function EasyuiLaydate(idstr, isChange) {
- var idstr2 = idstr + "_Date";
- $("#"+idstr).next("span").find("input").attr("id", idstr2);
- laydate({
- elem: "#"+idstr2,
- format: "YYYY-MM-DD",
- min: "1980-01-01",
- event: "focus",
- choose: function (datas) {
- //console.log(datas)
- $("#" + idstr).textbox("setValue", datas);
- if (isChange) {
- $("#ProduceDate").textbox("setValue", datas);
- $("#CheckTime").textbox("setValue", datas);
- }
- }
- });
- //console.log(laydate.now(0, 'YYYY-MM-DD'));
- $("#" + idstr).textbox("setValue",laydate.now(0, 'YYYY-MM-DD'));
- }
- $(function () {
- //加载表格数据
- //var value = $(".combobox.searchbox .combobox-value").val(), item = $(".combobox.searchbox .combobox-value").attr("name");
- //LoadTable(value, item);
- var data =@Html.Raw(ViewBag.SelRegionInfo)
- $("#RegionID").combotree({
- data: data
- //onLoadSuccess: function() {
- // $("#RegionID").combotree("setValue", "100001");
- //}
- });
- if ($("#hid_IsMarketSysAccount").val() === "0") {
- $("#IsSelf").combobox("setValue", "1");
- $("#RegionID").combotree("setValue", "@ViewBag.RegionID");
- $("#RegionID").combotree("readonly");
- var t = $("#hid_CheckUnit").val();
- $("#CheckUnit").combobox("setValue", t);
- if (t.length > 0) {
- $("#CheckUnit").combobox("readonly");
- }
- }
- if ($("#hid_IsSystem").val() === "0") {
- $("#IsSelf").combobox("setValue", "0");
- }
- GetMarketSelStr();
- GetCheckProjectSelStr();
- GetLittleKindSelStr();
- //GetMarketSellerSelStr();
- //GetMarketStallsSelStr();
- $("#HabitatID").combobox("setValue", "1010");
- $("#CheckUser").textbox("setValue", $("#hid_CheckUser").val());
- LoadTable();
- //加载日历控件
- EasyuiLaydate("SendDate",true);
- EasyuiLaydate("ProduceDate");
- EasyuiLaydate("CheckTime");
- $(".combo-panel.panel-body ul.tree").parent().addClass("treeC");
- });
- </script>
- </body>
- </html>
|