CheckDataQry.cshtml 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737
  1. 
  2. @{
  3. Layout = null;
  4. }
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <meta name="viewport" content="width=device-width" />
  9. <title>CheckDataQry</title>
  10. <link href="~/easyui/themes/default/easyui.css" rel="stylesheet" />
  11. <link rel="stylesheet" type="text/css" href="~/easyui/themes/icon.css" />
  12. <link href="~/Content/css/bootstrap.min.css" rel="stylesheet" />
  13. <link href="~/Content/js/plugins/layer/skin/layer.css" rel="stylesheet" />
  14. <link href="~/Content/plugins/select2/css/select2.min.css" rel="stylesheet" />
  15. <script src="~/Content/js/jquery.min.js"></script>
  16. <script src="~/Content/js/bootstrap.min.js"></script>
  17. <script src="~/easyui/jquery.easyui.min.js"></script>
  18. <script src="~/easyui/jquery.easyui.mobile.js"></script>
  19. <script src="~/easyui/locale/easyui-lang-zh_CN.js"></script>
  20. <script src="~/Content/js/plugins/layer/laydate/laydate.js"></script>
  21. <script src="~/Content/js/plugins/layer/layer.min.js"></script>
  22. <script src="~/js/Utils.js"></script>
  23. <link href="~/Content/css/Style/Markets.css" rel="stylesheet" />
  24. <script src="~/Content/js/js/MarketJs.js"></script>
  25. <style>
  26. .datagrid-header td,
  27. .datagrid-body .datagrid-row td {
  28. padding: 2px;
  29. }
  30. #CheckDataTb {
  31. height: 75vh;
  32. }
  33. @@media(min-device-width:1400px) {
  34. #CheckDataTb {
  35. height: 85vh;
  36. }
  37. }
  38. </style>
  39. </head>
  40. <body>
  41. <div id="BodyDiv">
  42. <section class="hidden">
  43. <input id="hid_Type" name="hid_Type" type="hidden" value="0"/>
  44. <input id="hid_IsMarketSysAccount" name="hid_IsMarketSysAccount" type="hidden" value="@ViewBag.IsMarketSysAccount"/>
  45. <input id="hid_IsSystem" name="hid_IsSystem" type="hidden" value="@ViewBag.IsSystem"/>
  46. @*<input id="hid_RegionID" name="hid_RegionID" type="hidden" value="@ViewBag.RegionID"/>*@
  47. <input id="hid_MarketID" name="hid_IsSystem" type="hidden" value="@ViewBag.MarketID"/>
  48. <input id="hid_CheckUnit" name="hid_IsSystem" type="hidden" value="@ViewBag.CheckUnit"/>
  49. @*<input id="hid_CheckUser" name="hid_IsSystem" type="hidden" value="@ViewBag.CheckUser"/>*@
  50. <input id="hidSetSearch_Type" name="hidSetSearch_Type" type="hidden" value="0"/>
  51. </section>
  52. <section id="Search_Panel">
  53. @*<div id="" class="easyui-panel" title="检测数据查询"
  54. style="width: 100%; height: 140px; padding: 10px;"
  55. data-options="closable:flase,collapsible:false">
  56. </div>*@
  57. <table class="panel-table" style="margin:10px auto 0;">
  58. <tr>
  59. <td class="td-label"><label for="SearchRegionID">辖区工商</label></td>
  60. <td class="td-input">
  61. <input class="easyui-combotree" style="height: 25px; width: 150px" id="SearchRegionID" name="SearchRegionID" data-options="onChange:function(){GetMarketSelStr()}" />
  62. @*<select class="easyui-combobox" type="text" id="SearchRegionID" name="SearchRegionID" style="height: 25px; width: 150px" data-options="onChange:function(){GetMarketSelStr()}">
  63. <option value="">全部</option>
  64. @Html.Raw(ViewBag.SelRegionInfo)
  65. </select>*@
  66. </td>
  67. <td class="td-label"><label for="SearchMarketID">被检单位</label></td>
  68. <td class="td-input">
  69. <select class="easyui-combobox" style="height: 25px; width: 150px" id="SearchMarketID" name="SearchMarketID" data-options="icons:[{iconCls:'icon-search_zoom',handler:function(){SearchModal('#Market')}
  70. }]">
  71. @Html.Raw(ViewBag.SelMarketInfo)
  72. </select>
  73. </td>
  74. <td class="td-label"><label for="SearchCheckUnit">检测单位</label></td>
  75. <td class="td-input">
  76. <select class="easyui-combobox" style="height: 25px; width: 150px" id="SearchCheckUnit" name="SearchCheckUnit">
  77. <option value="">全部</option>
  78. @Html.Raw(ViewBag.SelCheckUnitInfo)
  79. </select>
  80. </td>
  81. <td class="td-label"><label for="SearchCorpName">被检对象</label></td>
  82. <td class="td-input">
  83. <input class="easyui-textbox" style="height: 25px; width: 150px" id="SearchCorpName" name="SearchCorpName">
  84. </td>
  85. </tr>
  86. <tr>
  87. <td class="td-label"><label for="SearchLittleKindName">品种小类</label></td>
  88. <td class="td-input">
  89. <select class="easyui-combobox" style="height: 25px; width: 150px" id="SearchLittleKindName" name="SearchLittleKindName" data-options="onChange:function(){GetLittleKindSelStr()}">
  90. <option value="">全部</option>
  91. @Html.Raw(ViewBag.SelLittleKindInfo)
  92. </select>
  93. </td>
  94. <td class="td-label"><label for="SearchSampleName">品种名</label></td>
  95. <td class="td-input">
  96. <input class="easyui-combotree" style="height: 25px; width: 150px" id="SearchSampleName" name="SearchSampleName" data-options="icons:[{
  97. iconCls:'icon-search_zoom',handler:function(){SearchModal()}}]"/>
  98. @*<select class="easyui-combobox" style="height: 25px; width: 150px" id="SearchSampleName" name="SearchSampleName" data-options="icons:[{
  99. iconCls:'icon-search_zoom',handler:function(){SearchModal('#SampleName')}
  100. }]">
  101. <option value="">请选择...</option>
  102. @Html.Raw(ViewBag.SelSampleNameInfo)
  103. </select>*@
  104. </td>
  105. <td class="td-label"><label for="SearchCheckMethod">检测方法</label></td>
  106. <td class="td-input">
  107. <select class="easyui-combobox" style="height: 25px; width: 150px" id="SearchCheckMethod" name="SearchCheckMethod" data-options="onChange:function(){GetCheckProjectSelStr()}">
  108. <option value="">全部</option>
  109. @Html.Raw(ViewBag.SelCheckMethodInfo)
  110. </select>
  111. </td>
  112. <td class="td-label"><label for="SearchCheckProjectTypeID">检测项目</label></td>
  113. <td class="td-input">
  114. <select class="easyui-combobox" style="height: 25px; width: 150px" id="SearchCheckProjectTypeID" name="SearchCheckProjectTypeID" data-options="">
  115. @Html.Raw(ViewBag.SelCheckProjectTypeInfo)
  116. </select>
  117. </td>
  118. </tr>
  119. <tr>
  120. <td class="td-label"><label for="SearchCheckResult">检测结果</label></td>
  121. <td class="td-input">
  122. <select class="easyui-combobox" style="height: 25px; width: 150px" id="SearchCheckResult" name="SearchCheckResult">
  123. <option value="" selected="selected">全部</option>
  124. <option value="合格">合格</option>
  125. <option value="不合格">不合格</option>
  126. </select>
  127. </td>
  128. <td class="td-label"><label for="SearchStartTime">开始时间</label></td>
  129. <td class="td-input"><input class="easyui-textbox" type="text" id="SearchStartTime" name="SearchStartTime" style="height: 25px; width: 150px" data-options="" placeholder="输入查询检测时间的开始日期"/></td>
  130. <td class="td-label"><label for="SearchEndTime">截止时间</label></td>
  131. <td class="td-input"><input class="easyui-textbox" type="text" id="SearchEndTime" name="SearchEndTime" style="height: 25px; width: 150px" data-options="" placeholder="输入查询检测时间的截止日期"/></td>
  132. <td></td>
  133. <td class="td-input">
  134. <a href="#" class="easyui-linkbutton" iconCls="icon-search" style="width: 90%; height: 25px" onclick="LoadTable(true);">查询</a>
  135. </td>
  136. </tr>
  137. </table>
  138. </section>
  139. <section id="CheckDataTb" style="padding: 0 20px;">
  140. <div class="row tbToolBar" id="tbToolBar">
  141. <div class="toolbar">
  142. <a href="#" class="easyui-linkbutton" iconCls="icon-application_view_detail" plain="true" onclick="btn_Detail();">查看详情</a>
  143. </div>
  144. </div>
  145. <table id="dgTable" class="easyui-datagrid" style="height: 100%;"
  146. data-options="singleSelect: true,
  147. method: 'post',
  148. multiSort: false,
  149. toolbar: '#tbToolBar',
  150. fitColumns: true,
  151. @*rownumbers: true,*@
  152. remoteSort: false,
  153. @*loadFilter: pagerFilter,*@
  154. onDblClickRow: function () {
  155. btn_Detail();
  156. },
  157. pagination: true,
  158. pageSize: 50,
  159. pageList: [10,20, 50, 100]
  160. ">
  161. <thead>
  162. <tr>
  163. <th data-options="field:'SampleName',width:50">品种名称</th>
  164. <th data-options="field:'CheckMethodName',width:55">检测方法</th>
  165. <th data-options="field:'CheckItemName',width:60">检测项目</th>
  166. <th data-options="field:'CheckValue',width:40">检测值</th>
  167. <th data-options="field:'CheckUnit',width:100">检测单位</th>
  168. <th data-options="field:'CheckResult',width:50">检测结果</th>
  169. <th data-options="field:'CheckTime',width:55">检测时间</th>
  170. <th data-options="field:'CheckUser',width:40">检测员</th>
  171. <th data-options="field:'CorpName',width:100">被检企业</th>
  172. <th data-options="field:'MarketName',width:130">所属市场名称</th>
  173. <th data-options="field:'RegionName',width:60">所属辖区</th>
  174. </tr>
  175. </thead>
  176. </table>
  177. </section>
  178. <section>
  179. <div id="winModal" class="easyui-window winModal" title="检测数据信息" style="width: 1000px; padding: 5px 10px;"
  180. iconCls="icon-save" data-options="modal:true,closed:true">
  181. <div class="easyui-layout" data-options="fit:true" style="height: 99%">
  182. <div data-options="region:'center'" style="padding: 0;">
  183. <!--StartPrint-->
  184. <div style="margin-bottom: 15px; text-align: center;">
  185. <table id="" class="modal-table container-fluid" style="width: 800PX">
  186. <thead>
  187. <tr>
  188. <th colspan="20" style="text-align: center">
  189. <h4 class="title"><span id="">检测数据信息</span></h4>
  190. </th>
  191. </tr>
  192. </thead>
  193. <tr>
  194. <td class="tdName"><strong>所属市场</strong>:</td>
  195. <td id="Detail_MarketID" class="tdVal" colspan="3"></td>
  196. <td class="tdName"><strong>检测单位</strong>:</td>
  197. <td id="Detail_CheckUnit" class="tdVal" colspan="3"></td>
  198. </tr>
  199. <tr>
  200. <td class="tdName"><strong>被检企业</strong>:</td>
  201. <td id="Detail_CorpName" class="tdVal" colspan="3"></td>
  202. <td class="tdName"><strong>企业类型</strong>:</td>
  203. <td id="Detail_CorpKind" class="tdVal" colspan="3"></td>
  204. </tr>
  205. <tr>
  206. <td class="tdName"><strong>检测项目</strong>:</td>
  207. <td id="Detail_CheckProjectTypeName" class="tdVal" colspan="3"></td>
  208. <td class="tdName"><strong>检测值</strong>:</td>
  209. <td id="Detail_CheckValue" class="tdVal" colspan="3"></td>
  210. </tr>
  211. <tr>
  212. <td class="tdName"><strong>标准值</strong>:</td>
  213. <td id="Detail_StandardValue" class="tdVal" colspan="3"></td>
  214. <td class="tdName"><strong>单位</strong>:</td>
  215. <td id="Detail_Unit" class="tdVal" colspan="3"></td>
  216. </tr>
  217. <tr>
  218. <td class="tdName"><strong>检测次数</strong>:</td>
  219. <td id="Detail_CheckTotal" class="tdVal" colspan="3"></td>
  220. <td class="tdName"><strong>检测对比</strong>:</td>
  221. <td id="Detail_CheckResult" class="tdVal" colspan="3"></td>
  222. </tr>
  223. <tr>
  224. <td class="tdName"><strong>是否自检</strong>:</td>
  225. <td id="Detail_IsSelf" class="tdVal" colspan="3"></td>
  226. <td class="tdName"><strong>检测员</strong>:</td>
  227. <td id="Detail_CheckUser" class="tdVal" colspan="3"></td>
  228. </tr>
  229. <tr>
  230. <td class="tdName"><strong>送检日期</strong>:</td>
  231. <td id="Detail_SendDate" class="tdVal" colspan="3"></td>
  232. <td class="tdName"><strong>检测日期</strong>:</td>
  233. <td id="Detail_CheckTime" class="tdVal" colspan="3"></td>
  234. </tr>
  235. <tr>
  236. @*<td class="tdName"><strong>品种小类</strong>:</td>
  237. <td id="Detail_LittleKindName" class="tdVal" colspan="3"></td>*@
  238. <td class="tdName"><strong>品种名</strong>:</td>
  239. <td id="Detail_SampleName" class="tdVal" colspan="7"></td>
  240. </tr>
  241. <tr>
  242. <td class="tdName"><strong>生产单位</strong>:</td>
  243. <td id="Detail_ProduceUnit" class="tdVal" colspan="3"></td>
  244. <td class="tdName"><strong>生产日期</strong>:</td>
  245. <td id="Detail_ProduceDate" class="tdVal" colspan="3"></td>
  246. </tr>
  247. <tr>
  248. <td class="tdName"><strong>产地</strong>:</td>
  249. <td id="Detail_HabitatName" class="tdVal" colspan="3"></td>
  250. <td class="tdName"><strong>仪器编号</strong>:</td>
  251. <td id="Detail_MachineID" class="tdVal" colspan="3"></td>
  252. </tr>
  253. <tr>
  254. <td class="tdName"><strong>仪器厂商</strong>:</td>
  255. <td id="Detail_MachineMaker" class="tdVal" colspan="3"></td>
  256. <td class="tdName"><strong>数据编号</strong>:</td>
  257. <td id="Detail_ClientIndexID" class="tdVal" colspan="3"></td>
  258. </tr>
  259. <tr>
  260. <td class="tdName"><strong>备注</strong>:</td>
  261. <td id="Detail_Memo" class="tdVal" colspan="7"></td>
  262. </tr>
  263. </table>
  264. </div>
  265. <!--EndPrint-->
  266. <div class="" style="margin-bottom: 15px; text-align: center; display: @ViewBag.IsPrint">
  267. <button type="button" onclick="Print();">直接打印</button>
  268. <button type="button" class="but5" onclick="PreView()">打印预览</button>
  269. </div>
  270. </div>
  271. <div data-options="region:'south',border:false" style="text-align: right; height: 45px; padding: 13px 20px 0;">
  272. <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winModal').window('close');" style="width: 80px">关闭</a>
  273. </div>
  274. </div>
  275. </div>
  276. <div id="winModal_Search" class="easyui-window winModal" title="" style="width: 750px; height: 600px;padding:10px;"
  277. iconCls="icon-save" data-options="modal:true,closed:true">
  278. <div class="easyui-layout" data-options="fit:true" style="height:99%">
  279. <div data-options="region:'center'" style="padding: 15px 5px 5px;">
  280. <div id="Search_SampleName">
  281. @*<div class="panle-half">
  282. <div class="input-group">
  283. <label class="input-group-addon control-label" for="dg_SearchLittleKindName" style="min-width: 70px">品种类</label>
  284. <select class="form-control input-group-addon" aria-disabled="true" name="dg_SearchLittleKindName" id="dg_SearchLittleKindName" type="text" value="" placeholder="选择品种类" disabled="disabled">
  285. <option value="">全部</option>
  286. @Html.Raw(ViewBag.SelLittleKindInfo)
  287. </select>
  288. </div>
  289. </div>*@
  290. <div class="panle-half">
  291. <div class="input-group">
  292. <label class="input-group-addon control-label" for="dg_SearchSampleName" style="min-width: 70px">品种名</label>
  293. <input class="form-control input-group-addon" aria-disabled="true" name="dg_SearchSampleName" id="dg_SearchSampleName" type="text" value="" placeholder="" />
  294. <span class="input-group-addon control-label" onclick="DgSearchLoadTable()">搜索</span>
  295. </div>
  296. </div>
  297. <div class="panle-fluid" style="margin-top: 10px;">
  298. <table id="dgTable_Search_tree" class="easyui-datagrid" style="width: 98%; height: 410px;"
  299. data-options="singleSelect: true,
  300. method: 'post',
  301. multiSort: false,
  302. fitColumns: true,
  303. remoteSort: false,
  304. onDblClickRow: function () {
  305. SetSearch();
  306. },
  307. ">
  308. <thead></thead>
  309. </table>
  310. </div>
  311. </div>
  312. <div id="Search_Market" style="display:none">
  313. <div class="panle-half">
  314. <div class="input-group">
  315. <label class="input-group-addon control-label" for="dg_SearchRegionID" style="min-width: 70px">所属辖区</label>
  316. <select class="form-control input-group-addon" type="text" id="dg_SearchRegionID" name="dg_SearchRegionID" onchange="GetMarketSelStr();" disabled="disabled">
  317. <option value="">全部</option>
  318. @Html.Raw(ViewBag.SelRegionInfo)
  319. </select>
  320. </div>
  321. </div>
  322. <div class="panle-half">
  323. <div class="input-group">
  324. <label class="input-group-addon control-label" for="dg_SearchMarketName" style="min-width: 70px">市场名称</label>
  325. <input class="form-control input-group-addon" aria-disabled="true" name="dg_SearchMarketName" id="dg_SearchMarketName" type="text" value="" placeholder="" />
  326. <span class="input-group-addon control-label" onclick="DgSearchLoadTable()">搜索</span>
  327. </div>
  328. </div>
  329. <div class="panle-fluid" style="margin-top: 10px;">
  330. <table id="dgTable_Search" class="easyui-datagrid" style="width: 98%; height: 410px;"
  331. data-options="singleSelect: true,
  332. method: 'post',
  333. multiSort: false,
  334. toolbar: '#tbToolBar_Attach',
  335. fitColumns: true,
  336. remoteSort: false,
  337. onDblClickRow: function () {
  338. SetSearch();
  339. },
  340. pagination: true,
  341. pageSize: 50,
  342. pageList: [10,20, 50, 100]
  343. ">
  344. <thead></thead>
  345. </table>
  346. </div>
  347. </div>
  348. </div>
  349. <div data-options="region:'south',border:false" style="text-align:right;height:45px; padding:13px 20px 0;">
  350. <a class="easyui-linkbutton" id="Save_SetSearch" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="SetSearch()" style="width:80px">确认</a>
  351. <a class="easyui-linkbutton" id="Save_Search" data-options="iconCls:'icon-search'" href="javascript:void(0)" onclick="DgSearchLoadTable()" style="width:80px">搜索</a>
  352. <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winModal_Search').window('close');" style="width:80px">取消</a>
  353. </div>
  354. </div>
  355. </div>
  356. </section>
  357. <script>
  358. //加载表格数据
  359. function LoadTable(collapsed) {
  360. collapsed = collapsed || false;
  361. var regionId = $("#SearchRegionID").combotree("getValue"),
  362. marketId = $("#SearchMarketID").combobox("getValue"),
  363. checkUnit = $("#SearchCheckUnit").combobox("getValue"),
  364. corpName = $("#SearchCorpName").textbox("getValue"),
  365. littleKindName = $("#SearchLittleKindName").combobox("getValue"),
  366. sampleName = $("#SearchSampleName").combotree("getValue"),
  367. checkProjectTypeId = $("#SearchCheckProjectTypeID").combobox("getValue"),
  368. checkMethod = $("#SearchCheckMethod").combobox("getValue"),
  369. checkResult = $("#SearchCheckResult").combobox("getValue"),
  370. startTime = $('#SearchStartTime').val(),
  371. endTime = $('#SearchEndTime').val();
  372. if (collapsed === true) {
  373. $("#Search").panel("collapse", true);
  374. }
  375. $('#dgTable').datagrid({
  376. url: '@Url.Action("CheckDataQryResult", "GetResult")',
  377. queryParams: {
  378. RegionID: regionId,
  379. MarketID: marketId,
  380. StartTime: startTime,
  381. EndTime: endTime,
  382. CheckUnit: checkUnit,
  383. CorpName: corpName,
  384. LittleKindName: littleKindName,
  385. SampleName: sampleName,
  386. CheckProjectTypeID: checkProjectTypeId,
  387. CheckMethod:checkMethod,
  388. CheckResult: checkResult
  389. }
  390. });
  391. }
  392. //查看详情
  393. function btn_Detail() {
  394. var rows = $('#dgTable').datagrid('getSelections');
  395. if (rows.length === 1) {
  396. var row = rows[0];
  397. $("#Detail_MarketID").html(row.MarketID);
  398. $("#Detail_CheckUnit").html(row.CheckUnit);
  399. $("#Detail_CorpName").html(row.CorpName);
  400. $("#Detail_CorpKind").html(row.CorpKind);
  401. $("#Detail_CheckProjectTypeName").html(row.CheckItemName);
  402. $("#Detail_CheckValue").html(row.CheckValue);
  403. $("#Detail_StandardValue").html(row.StandardValue);
  404. $("#Detail_Unit").html(row.Unit);
  405. $("#Detail_CheckTotal").html(row.CheckTotal);
  406. $("#Detail_CheckResult").html(row.CheckResult);
  407. $("#Detail_IsSelf").html(row.IsSelf === "1" ? "是" : "否");
  408. $("#Detail_CheckUser").html(row.CheckUser);
  409. $("#Detail_SendDate").html(row.SendDate);
  410. $("#Detail_CheckTime").html(row.CheckTime);
  411. //$("#Detail_LittleKindName").html(row.LittleKindName);
  412. $("#Detail_SampleName").html(row.SampleName);
  413. $("#Detail_ProduceUnit").html(row.ProduceUnit);
  414. $("#Detail_ProduceDate").html(row.ProduceDate);
  415. $("#Detail_HabitatName").html(row.HabitatName);
  416. $("#Detail_MachineID").html(row.MachineID);
  417. $("#Detail_MachineMaker").html(row.MachineMaker);
  418. $("#Detail_ClientIndexID").html(row.ClientIndexID);
  419. $("#Detail_Memo").html(row.Memo);
  420. $("#winModal").window("open");
  421. } else {
  422. layer.alert('请选择一条记录进行设置', { icon: 7, title: '提示信息' });
  423. }
  424. }
  425. //根据辖区获取市场下拉框的option
  426. function GetMarketSelStr() {
  427. console.log($("#SearchRegionID").combotree("getValue"));
  428. $.ajax({
  429. url: "/GetResult/GetMarketSelStrResult",
  430. type: "post",
  431. async: false,
  432. dataType: "json",
  433. //data: { RegionID: $("input.combobox-value[name='SearchRegionID']").val() },
  434. data: { RegionID: $("#SearchRegionID").combotree("getValue") },
  435. success: function(data) {
  436. //console.log(msg);
  437. if (CheckAajxData(data) === false) return;
  438. var rows = data.rows;
  439. var first = "{\"MarketID\":\"\",\"Names\":\"全部\"}";
  440. var last = "{\"MarketID\":\"Other\",\"Names\":\"其他\"}";
  441. var firstJson = JSON.parse(first);
  442. var lastJson = JSON.parse(last);
  443. rows.unshift(firstJson);
  444. rows.push(lastJson);
  445. console.log(rows);
  446. $('#SearchMarketID').combobox("clear").combobox({
  447. data: rows,
  448. valueField: 'MarketID',
  449. textField: 'Names',
  450. onLoadSuccess: function() {
  451. var val = $(this).combobox('getData');
  452. // ReSharper disable once MissingHasOwnPropertyInForeach
  453. if ($("#hid_IsMarketSysAccount").val() === "0") {
  454. var m = $("#hid_MarketID").val();
  455. $("#SearchMarketID").combobox("setValue", m).combobox("disable");
  456. } else {
  457. for (var item in val[0]) {
  458. if (item === 'MarketID') {
  459. $(this).combobox('select', val[0][item]);
  460. }
  461. }
  462. }
  463. }
  464. });
  465. }
  466. });
  467. }
  468. //根据小类获取品种名下拉框的option
  469. function GetLittleKindSelStr() {
  470. $.ajax({
  471. url: "/GetResult/GetLittleKindSelStrResult",
  472. type: "post",
  473. async: false,
  474. dataType: "json",
  475. data: { LittleKindName: $("#SearchLittleKindName").combobox("getValue") },
  476. success: function(data) {
  477. //console.log(msg);
  478. if (CheckAajxData(data) === false) return;
  479. if (data.length > 0) {
  480. $("#SearchSampleName").combotree({
  481. data: data,
  482. //onChange: function (recode) {
  483. // //console.log(recode)
  484. // $("#hid_SampleName").val(recode.text);
  485. //},
  486. //onLoadSuccess: function () {
  487. // //console.log(id + "-" + name);
  488. // $("#SampleName").combotree("setValue", id ? id : "");
  489. // $("#hid_SampleName").val(name ? name : "");
  490. //}
  491. });
  492. } else {
  493. $("#SearchSampleName").combotree({
  494. data: []
  495. });
  496. }
  497. //var rows = data.rows;
  498. ////var first = "{\"SpecialsID\":\"";
  499. ////for (var i = 0; i < rows.length; i++) {
  500. //// first += (first === "{\"SpecialsID\":\"" ? "" : "@@|@@") + rows[i].SpecialsID;
  501. ////}
  502. ////first += "\",\"Name\":\"全部\"}";
  503. //var first = "{\"Name\":\"\",\"Name\":\"全部\"}";
  504. //var firstJson = JSON.parse(first);
  505. //rows.unshift(firstJson);
  506. //$('#SearchSampleName').combobox("clear").combobox({
  507. // data: rows,
  508. // valueField: 'Name',
  509. // textField: 'Name',
  510. // onLoadSuccess: function() {
  511. // var val = $(this).combobox('getData');
  512. // // ReSharper disable once MissingHasOwnPropertyInForeach
  513. // for (var item in val[0]) {
  514. // if (item === 'Name') {
  515. // $(this).combobox('select', val[0][item]);
  516. // }
  517. // }
  518. // }
  519. //});
  520. }
  521. });
  522. }
  523. //根据检测方法获取检测项目下拉框的option
  524. function GetCheckProjectSelStr() {
  525. $.ajax({
  526. url: "/GetResult/GetCheckProjectSelStrResult",
  527. type: "post",
  528. async: false,
  529. dataType: "json",
  530. data: { CheckMethod: $("#SearchCheckMethod").combobox("getValue") },
  531. success: function(data) {
  532. //console.log(msg);
  533. if (CheckAajxData(data) === false) return;
  534. var rows = data.rows;
  535. var first = "{\"CheckProjectTypeID\":\"\",\"Name\":\"全部\"}";
  536. var firstJson = JSON.parse(first);
  537. rows.unshift(firstJson);
  538. $('#SearchCheckProjectTypeID').combobox("clear").combobox({
  539. data: rows,
  540. valueField: 'CheckProjectTypeID',
  541. textField: 'Name',
  542. onLoadSuccess: function() {
  543. var val = $(this).combobox('getData');
  544. // ReSharper disable once MissingHasOwnPropertyInForeach
  545. for (var item in val[0]) {
  546. if (item === 'CheckProjectTypeID') {
  547. $(this).combobox('select', val[0][item]);
  548. }
  549. }
  550. }
  551. });
  552. }
  553. });
  554. }
  555. function SearchModal(searchType) {
  556. if (searchType === "#Market") {
  557. $('#winModal_Search').window({ "title": "搜索被检单位" });
  558. $("#hidSetSearch_Type").val("#MarketID");
  559. $("#Search_SampleName").hide();
  560. $("#Search_Market").show();
  561. $("#dg_SearchRegionID").val($("#SearchRegionID").combotree("getValue"));
  562. //GetMarketSelStr();
  563. } else {
  564. $("#Search_SampleName").show();
  565. $("#hidSetSearch_Type").val("#SampleName");
  566. //$("#dg_SearchLittleKindName").val($("#SearchLittleKindName").combobox("getValue"));
  567. $("#Search_Market").hide();
  568. $('#winModal_Search').window({ "title": "搜索品种名" });
  569. }
  570. $('#winModal_Search input').val("");
  571. DgSearchLoadTable();
  572. $('#winModal_Search').window('open');
  573. }
  574. function SetSearch(idStr) {
  575. idStr = idStr || $("#hidSetSearch_Type").val();
  576. var rows = $('#dgTable_Search').datagrid('getSelections');
  577. if (rows.length === 0) {
  578. rows = $('#dgTable_Search_tree').datagrid('getSelections');
  579. }
  580. if (rows.length === 1) {
  581. var row = rows[0];
  582. console.log(row);
  583. if (idStr === "#MarketID") {
  584. $("#SearchMarketID").combobox("setValue", row.MarketID);
  585. } else if (idStr === "#SampleName") {
  586. //$("#SearchSampleName").combobox("setValue", row.Name);
  587. $("#SearchSampleName").combotree("setValue", row.VarietyCategoryNo);
  588. }
  589. $('#winModal_Search').window('close');
  590. } else {
  591. layer.alert('请选择一条记录进行设置', { icon: 7, title: '提示信息' });
  592. }
  593. }
  594. function DgSearchLoadTable(searchType) {
  595. searchType = searchType || $("#hidSetSearch_Type").val();
  596. if (searchType === "#MarketID") {
  597. var regionId = $("#SearchRegionID").combotree("getValue"),
  598. marketName = $("#dg_SearchMarketName").val();
  599. $('#dgTable_Search').datagrid({
  600. url: '@Url.Action("MarketSearchResult", "GetResult")' + '?RegionId=' + escape(regionId) + '&MarketName=' + escape(marketName),
  601. columns: [
  602. [
  603. { field: 'Names', title: '市场名称', width: 130, align: 'center' },
  604. { field: 'Principal', title: '负责人', width: 80, align: 'center' },
  605. { field: 'LinkMan', title: '日常联系人', width: 80, align: 'center' },
  606. { field: 'LinkTel', title: '联系电话', width: 100, align: 'center' }
  607. //{ field: 'FrontForUnit', title: '主办单位', width: 150, align: 'center' },
  608. //{ field: 'ManageUnit', title: '管理单位', width: 150, align: 'center' }
  609. ]
  610. ]
  611. });
  612. } else {
  613. var littleKindName = $("#dg_SearchLittleKindName").val(),
  614. sampleName = $("#dg_SearchSampleName").val();
  615. $('#dgTable_Search_tree').treegrid({
  616. idField: 'VarietyCategoryNo',
  617. treeField: 'VarietyCategoryName',
  618. url: '@Url.Action("SampleNameSearchResult", "GetResult")' + '?LittleKindName=' + escape(littleKindName) + '&SampleName=' + escape(sampleName),
  619. columns: [
  620. [
  621. { field: 'VarietyCategoryName', title: '品种名称', width:"90%" ,align: 'center' }
  622. ]
  623. ]
  624. });
  625. }
  626. }
  627. var start = {
  628. elem: "#StartTime",
  629. format: "YYYY-MM-DD",
  630. min: "2010-01-01",
  631. event: "focus",
  632. choose: function(datas) {
  633. end.min = datas; //开始日选好后,重置结束日的最小日期
  634. end.start = datas; //将结束日的初始值设定为开始日
  635. $('#SearchStartTime').val(datas);
  636. }
  637. },
  638. end = {
  639. elem: "#EndTime",
  640. format: "YYYY-MM-DD",
  641. min: "2010-01-01",
  642. event: "focus",
  643. choose: function(datas) {
  644. start.max = datas; //结束日选好后,重置开始日的最大日期
  645. $('#SearchEndTime').val(datas);
  646. }
  647. };
  648. $(function () {
  649. var dataRegion =@Html.Raw(ViewBag.SelRegionInfo);
  650. $("#SearchRegionID").combotree({
  651. data: dataRegion,
  652. //onLoadSuccess: function() {
  653. // $("#RegionID").combotree("setValue", "100001");
  654. //}
  655. });
  656. $("#SearchStartTime").next("span").find("input").attr("id", "StartTime");
  657. $("#SearchEndTime").next("span").find("input").attr("id", "EndTime");
  658. $("#SearchStartTime").textbox("setValue", laydate.now(-30, 'YYYY-MM-DD'));
  659. $("#SearchEndTime").textbox("setValue", laydate.now(1, 'YYYY-MM-DD'));
  660. if ($("#hid_IsMarketSysAccount").val() === "0") {
  661. $("#SearchRegionID").combotree("setValue", "@ViewBag.RegionID").combotree("readonly");
  662. $("#SearchMarketID").combobox("readonly");
  663. //$("#SearchCheckUnit").combobox("setValue", $("#hid_CheckUnit").val());
  664. //if ($("#hid_CheckUnit").val().length > 0) {
  665. // $("#SearchCheckUnit").combobox("disable");
  666. //}
  667. }
  668. GetMarketSelStr();
  669. GetLittleKindSelStr();
  670. GetCheckProjectSelStr();
  671. //加载表格数据
  672. LoadTable();
  673. //加载日历控件
  674. laydate(start);
  675. laydate(end);
  676. $(".combo-panel.panel-body ul.tree").parent().addClass("treeC");
  677. });
  678. </script>
  679. </div>
  680. </body>
  681. </html>