CheckDataList.cshtml 54 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264
  1. 
  2. @{
  3. Layout = null;
  4. }
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <meta name="viewport" content="width=device-width" />
  9. <title>CheckDataList</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. <script src="~/Content/js/jquery.min.js"></script>
  15. <script src="~/Content/js/bootstrap.min.js"></script>
  16. <script src="~/easyui/jquery.easyui.min.js"></script>
  17. <script src="~/easyui/jquery.easyui.mobile.js"></script>
  18. <script src="~/easyui/locale/easyui-lang-zh_CN.js"></script>
  19. <script src="~/Content/js/plugins/layer/laydate/laydate.js"></script>
  20. <script src="~/Content/js/plugins/layer/layer.min.js"></script>
  21. <script src="~/js/Utils.js"></script>
  22. <script src="~/Content/plugins/ajaxFileUpload/ajaxFileUpload-M.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: 55vh;
  32. }
  33. @@media(min-device-width:1400px) {
  34. #CheckDataTb {
  35. height: 69vh;
  36. }
  37. }
  38. </style>
  39. </head>
  40. <body>
  41. <section class="hidden">
  42. <input id="hid_Type" name="hid_Type" type="hidden" value="Add" />
  43. <input id="hid_IsMarketSysAccount" name="hid_IsMarketSysAccount" type="hidden" value="@ViewBag.IsMarketSysAccount" />
  44. <input id="hid_IsSystem" name="hid_IsSystem" type="hidden" value="@ViewBag.IsSystem" />
  45. <input id="hid_RegionID" name="hid_RegionID" type="hidden" value="@ViewBag.RegionID" />
  46. <input id="hid_MarketID" name="hid_IsSystem" type="hidden" value="@ViewBag.MarketID" />
  47. <input id="hid_CheckUnit" name="hid_IsSystem" type="hidden" value="@ViewBag.CheckUnit" />
  48. <input id="hid_CheckUser" name="hid_IsSystem" type="hidden" value="@ViewBag.CheckUser" />
  49. <input id="hid_SampleName" name="hid_SampleName" type="hidden" value="" />
  50. <input id="hidSetSearch_Type" name="hidSetSearch_Type" type="hidden" value="0" />
  51. <input id="hid_vali" name="hid_vali" type="hidden" value="0" />
  52. </section>
  53. <section id="Search_Panel">
  54. @*<div id="" class="easyui-panel" title="检测数据在线录入(<strong class='text-requird'>*</strong>是必须添入的项目)(<strong class='text-requird'>*</strong>是必须添入的项目)"
  55. style="width: 100%; height: 285px; padding: 10px;"
  56. data-options="closable:false,collapsible:false">
  57. </div>*@
  58. <table class="panel-table" style="margin:10px auto 0;">
  59. @Html.Hidden("ID")
  60. <tr>
  61. <td class="td-label"><label for="RegionID">所在地区</label></td>
  62. <td class="td-input">
  63. <input class="easyui-combotree" style="height: 22px" id="RegionID" name="RegionID" data-options="onChange:function(){GetMarketSelStr()}" />
  64. @*<select class="easyui-combobox" style="height: 22px" id="RegionID" name="RegionID" data-options="onChange:function(){GetMarketSelStr()}">
  65. <option value="">请选择...</option>
  66. @Html.Raw(ViewBag.SelRegionInfo)
  67. </select>*@
  68. </td>
  69. <td class="td-label"><label for="CheckUnit">检测单位</label></td>
  70. <td class="td-input">
  71. <select class="easyui-combobox" style="height: 22px" id="CheckUnit" name="CheckUnit">
  72. <option value="">请选择...</option>
  73. @Html.Raw(ViewBag.SelCheckUnitInfo)
  74. </select>
  75. <strong class="text-requird">*</strong>
  76. </td>
  77. <td class="td-label"><label for="MarketID">被检单位</label></td>
  78. <td class="td-input">
  79. <select class="easyui-combobox" style="height: 22px" id="MarketID" name="MarketID" data-options="onChange:function(){GetMarketStallsSelStr()},icons:[{
  80. iconCls:'icon-search_zoom',handler:function(){SearchModal('#Market')}
  81. }]">
  82. <option value="">请选择...</option>
  83. @Html.Raw(ViewBag.SelMarketInfo)
  84. </select>
  85. </td>
  86. @*<td class="td-label"><label for="CorpName">被检对象</label></td>
  87. <td class="td-input">
  88. <input class="easyui-combobox" style="height: 22px" id="CorpName" name="CorpName" data-options="icons:[{
  89. iconCls:'icon-search_zoom',handler:function(){SearchModal('#MarketSeller')}
  90. }]">
  91. </td>*@
  92. <td class="td-label"><label for="StallNo">摊位号</label></td>
  93. <td class="td-input">
  94. <input class="easyui-textbox" style="height: 22px" id="StallNo" name="CheckValue">
  95. </td>
  96. </tr>
  97. <tr>
  98. <td class="td-label"><label for="CheckMethod">检测方法</label></td>
  99. <td class="td-input">
  100. <select class="easyui-combobox" style="height: 22px" id="CheckMethod" name="CheckMethod" data-options="onChange:function(){GetCheckProjectSelStr()}">
  101. <option value="">请选择...</option>
  102. @Html.Raw(ViewBag.SelCheckMethodInfo)
  103. </select>
  104. @*<strong class="text-requird">*</strong>*@
  105. </td>
  106. <td class="td-label"><label for="CheckProjectTypeID">检测项目</label></td>
  107. <td class="td-input">
  108. <select class="easyui-combobox" style="height: 22px" id="CheckProjectTypeID" name="CheckProjectTypeID" data-options="onChange:function(){GetCheckProjectInfo()}">
  109. @Html.Raw(ViewBag.SelCheckProjectTypeInfo)
  110. </select>
  111. <strong class="text-requird">*</strong>
  112. </td>
  113. <td class="td-label"><label for="StandardValue">标准值</label></td>
  114. <td class="td-input">
  115. <input class="easyui-textbox" style="height: 22px" id="StandardValue" name="StandardValue" disabled="disabled">
  116. </td>
  117. <td class="td-label"><label for="StandardUnit">单位</label></td>
  118. <td class="td-input">
  119. <input class="easyui-textbox" style="height: 22px" id="StandardUnit" name="StandardUnit" disabled="disabled">
  120. </td>
  121. </tr>
  122. <tr>
  123. @*<td class="td-label"><label for="LittleKindName">品种小类</label></td>
  124. <td class="td-input">
  125. <select class="easyui-combobox" style="height: 22px" id="LittleKindName" name="LittleKindName" data-options="onChange:function(){GetLittleKindSelStr()}" disabled="">
  126. <option value="">请选择...</option>
  127. @Html.Raw(ViewBag.SelLittleKindInfo)
  128. </select>
  129. </td>*@
  130. <td class="td-label"><label for="SampleName">品种名称</label></td>
  131. <td class="td-input">
  132. <input class="easyui-combotree" style="height: 22px" id="SampleName" name="SampleName" data-options="icons:[{
  133. iconCls:'icon-search_zoom',handler:function(){SearchModal()}}]" />
  134. @*<select class="easyui-combobox" style="height: 22px" id="SampleName" name="SampleName" data-options="icons:[{
  135. iconCls:'icon-search_zoom',handler:function(){SearchModal('#SampleName')}
  136. }]">
  137. <option value="">请选择...</option>
  138. @Html.Raw(ViewBag.SelSampleNameInfo)
  139. </select>*@
  140. <strong class="text-requird">*</strong>
  141. </td>
  142. <td class="td-label"><label for="CheckValue">检测值</label></td>
  143. <td class="td-input">
  144. <input class="easyui-textbox" style="height: 22px" id="CheckValue" name="CheckValue">
  145. <strong class="text-requird">*</strong>
  146. </td>
  147. <td class="td-label"><label for="CheckResult">检测结果</label></td>
  148. <td class="td-input">
  149. <select class="easyui-combobox" style="height: 22px" id="CheckResult" name="CheckResult" data-options="editable:false">
  150. <option value="合格" selected="selected">合格</option>
  151. <option value="不合格">不合格</option>
  152. </select>
  153. </td>
  154. <td class="td-label"><label for="IdCode">身份证号</label></td>
  155. <td class="td-input">
  156. <input class="easyui-textbox" style="height: 22px;" id="IdCode" name="IdCode">
  157. </td>
  158. </tr>
  159. <tr>
  160. <td class="td-label"><label for="CheckTotal">检测次数</label></td>
  161. <td class="td-input">
  162. <input class="easyui-textbox" style="height: 22px" id="CheckTotal" name="CheckTotal" value="1">
  163. <strong class="text-requird">*</strong>
  164. </td>
  165. <td class="td-label"><label for="IsSelf">是否自检</label></td>
  166. <td class="td-input">
  167. <select class="easyui-combobox" style="height: 22px" id="IsSelf" name="IsSelf">
  168. <option value="1">是</option>
  169. <option value="0">否</option>
  170. </select>
  171. </td>
  172. <td class="td-label"><label for="CorpKind">企业类型</label></td>
  173. <td class="td-input">
  174. <select class="easyui-combobox" style="height: 22px" id="CorpKind" name="CorpKind">
  175. @Html.Raw(ViewBag.SelCorpKindInfo)
  176. </select>
  177. </td>
  178. <td class="td-label"><label for="SendDate">送检日期</label></td>
  179. <td class="td-input">
  180. <input class="easyui-textbox" style="height: 22px" id="SendDate" name="SendDate">
  181. <strong class="text-requird">*</strong>
  182. </td>
  183. </tr>
  184. <tr>
  185. <td class="td-label"><label for="ProduceUnit">生产单位</label></td>
  186. <td class="td-input">
  187. <input class="easyui-textbox" style="height: 22px" id="ProduceUnit" name="ProduceUnit">
  188. </td>
  189. <td class="td-label"><label for="ProduceDate">生产日期</label></td>
  190. <td class="td-input">
  191. <input class="easyui-textbox" style="height: 22px" id="ProduceDate" name="ProduceDate">
  192. <strong class="text-requird">*</strong>
  193. </td>
  194. <td class="td-label"><label for="HabitatID">产地</label></td>
  195. <td class="td-input">
  196. <select class="easyui-combobox" style="height: 22px" id="HabitatID" name="HabitatID">
  197. @Html.Raw(ViewBag.SelHabitatInfo)
  198. </select>
  199. <strong class="text-requird">*</strong>
  200. </td>
  201. <td class="td-label"><label for="CheckTime">检测日期</label></td>
  202. <td class="td-input">
  203. <input class="easyui-textbox" style="height: 22px" id="CheckTime" name="CheckTime">
  204. <strong class="text-requird">*</strong>
  205. </td>
  206. </tr>
  207. <tr>
  208. <td class="td-label"><label for="MachineID">仪器编号</label></td>
  209. <td class="td-input">
  210. <input class="easyui-textbox" style="height: 22px" id="MachineID" name="MachineID">
  211. </td>
  212. <td class="td-label"><label for="MachineMaker">仪器厂商</label></td>
  213. <td class="td-input">
  214. <input class="easyui-textbox" style="height: 22px" id="MachineMaker" name="MachineMaker">
  215. </td>
  216. <td class="td-label"><label for="ClientIndexID">数据编号</label></td>
  217. <td class="td-input">
  218. <input class="easyui-textbox" style="height: 22px" id="ClientIndexID" name="ClientIndexID">
  219. </td>
  220. <td class="td-label"><label for="CheckUser">检测员</label></td>
  221. <td class="td-input">
  222. <input class="easyui-textbox" style="height: 22px" id="CheckUser" name="CheckUser">
  223. <strong class="text-requird">*</strong>
  224. </td>
  225. </tr>
  226. <tr>
  227. <td class="td-label"><label for="LicenseNo">执照编码</label></td>
  228. <td class="td-input">
  229. <input class="easyui-textbox" style="height: 22px;" id="LicenseNo" name="LicenseNo">
  230. </td>
  231. <td class="td-label"><label for="LicenseName">执照名称</label></td>
  232. <td class="td-input">
  233. <input class="easyui-textbox" style="height: 22px;" id="LicenseName" name="LicenseName">
  234. </td>
  235. @*<td class="td-label"><label for="IdCode">身份证号</label></td>
  236. <td class="td-input">
  237. <input class="easyui-textbox" style="height: 22px;" id="IdCode" name="IdCode">
  238. </td>*@
  239. <td class="td-label"><label for="CardIndex">安全编码</label></td>
  240. <td class="td-input">
  241. <input class="easyui-textbox" style="height: 22px;" id="CardIndex" name="CardIndex">
  242. </td>
  243. <td class="td-label"><label for="Memo">备注</label></td>
  244. <td class="td-input" colspan="7">
  245. <input class="easyui-textbox" style="height: 22px;" id="Memo" name="Memo">
  246. </td>
  247. </tr>
  248. <tr>
  249. <td colspan="2"></td>
  250. <td colspan="4" style="text-align: center;">
  251. <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>
  252. <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>
  253. </td>
  254. <td colspan="2" style="text-align: left;">
  255. <span style="z-index: 1000;">
  256. (提示:<strong class='text-requird'>*</strong>是必须添入的项目)
  257. </span>
  258. </td>
  259. </tr>
  260. </table>
  261. </section>
  262. <section id="CheckDataTb" style="padding: 0 20px;margin-top:-25px;">
  263. <div class="row tbToolBar" id="tbToolBar">
  264. <div class="toolbar" id="CurdTool">
  265. <a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="btn_Detail()">查看</a>
  266. <span class="shuxian"></span>
  267. <a href="#" class="easyui-linkbutton" iconCls="icon-edit" plain="true" onclick="btn_Edit()">修改</a>
  268. <a class="easyui-linkbutton" href="#" iconCls="icon-Excel" plain="true" onclick="uploadExcelFile()" >导入数据</a>
  269. </div>
  270. </div>
  271. <table id="dgTable" class="easyui-datagrid" style="height: 100%;"
  272. data-options="singleSelect: true,
  273. method: 'post',
  274. multiSort: false,
  275. toolbar: '#tbToolBar',
  276. fitColumns: true,
  277. @*rownumbers: true,*@
  278. remoteSort: false,
  279. @*loadFilter: pagerFilter,*@
  280. onDblClickRow: function () {
  281. btn_Edit();
  282. },
  283. pagination: true,
  284. pageSize: 50,
  285. pageList: [15,20, 50, 100]
  286. ">
  287. <thead>
  288. <tr>
  289. <th data-options="field:'CheckMethodName',width:80">检测方法</th>
  290. <th data-options="field:'CheckItemName',width:100">检测项目</th>
  291. <th data-options="field:'SampleName',width:80">品种名称</th>
  292. <th data-options="field:'CheckValue',width:80">检测值</th>
  293. <th data-options="field:'CorpName',width:150">被检对象</th>
  294. <th data-options="field:'CheckResult',width:50">检测结果</th>
  295. <th data-options="field:'Unit',width:100">检测单位</th>
  296. <th data-options="field:'CheckUser',width:60">检测员</th>
  297. </tr>
  298. </thead>
  299. </table>
  300. </section>
  301. <section>
  302. <div id="winModal" class="easyui-window winModal" title="检测数据信息" style="width: 800px;padding:5px 10px ;"
  303. iconCls="icon-save" data-options="modal:true,closed:true">
  304. <div class="easyui-layout" data-options="fit:true" style="height:99%">
  305. <div data-options="region:'center'" style="padding:0;">
  306. <!--StartPrint-->
  307. <div style="margin-bottom: 15px;text-align: center;">
  308. <table id="" class="modal-table container-fluid" style="width:600PX">
  309. <thead>
  310. <tr>
  311. <th colspan="20" style="text-align: center">
  312. <h4 class="title"><span id="">检测数据信息</span></h4>
  313. </th>
  314. </tr>
  315. </thead>
  316. <tr>
  317. <td class="tdName"><strong>所属市场</strong>:</td>
  318. <td id="Detail_MarketID" class="tdVal" colspan="2"></td>
  319. <td class="tdName"><strong>检测单位</strong>:</td>
  320. <td id="Detail_CheckUnit" class="tdVal" colspan="2"></td>
  321. </tr>
  322. <tr>
  323. <td class="tdName"><strong>被检企业</strong>:</td>
  324. <td id="Detail_CorpName" class="tdVal" colspan="2"></td>
  325. <td class="tdName"><strong>企业类型</strong>:</td>
  326. <td id="Detail_CorpKind" class="tdVal" colspan="2"></td>
  327. </tr>
  328. <tr>
  329. <td class="tdName"><strong>检测项目</strong>:</td>
  330. <td id="Detail_CheckProjectTypeName" class="tdVal" colspan="2"></td>
  331. <td class="tdName"><strong>检测值</strong>:</td>
  332. <td id="Detail_CheckValue" class="tdVal" colspan="2"></td>
  333. </tr>
  334. <tr>
  335. <td class="tdName"><strong>标准值</strong>:</td>
  336. <td id="Detail_StandardValue" class="tdVal" colspan="2"></td>
  337. <td class="tdName"><strong>单位</strong>:</td>
  338. <td id="Detail_Unit" class="tdVal" colspan="2"></td>
  339. </tr>
  340. <tr>
  341. <td class="tdName"><strong>检测次数</strong>:</td>
  342. <td id="Detail_CheckTotal" class="tdVal" colspan="2"></td>
  343. <td class="tdName"><strong>检测对比</strong>:</td>
  344. <td id="Detail_CheckResult" class="tdVal" colspan="2"></td>
  345. </tr>
  346. <tr>
  347. <td class="tdName"><strong>是否自检</strong>:</td>
  348. <td id="Detail_IsSelf" class="tdVal" colspan="2"></td>
  349. <td class="tdName"><strong>检测员</strong>:</td>
  350. <td id="Detail_CheckUser" class="tdVal" colspan="2"></td>
  351. </tr>
  352. <tr>
  353. <td class="tdName"><strong>送检日期</strong>:</td>
  354. <td id="Detail_SendDate" class="tdVal" colspan="2"></td>
  355. <td class="tdName"><strong>检测日期</strong>:</td>
  356. <td id="Detail_CheckTime" class="tdVal" colspan="2"></td>
  357. </tr>
  358. <tr>
  359. @*<td class="tdName"><strong>品种小类</strong>:</td>
  360. <td id="Detail_LittleKindName" class="tdVal" colspan="2"></td>*@
  361. <td class="tdName"><strong>品种名</strong>:</td>
  362. <td id="Detail_SampleName" class="tdVal" colspan="5"></td>
  363. </tr>
  364. <tr>
  365. <td class="tdName"><strong>生产单位</strong>:</td>
  366. <td id="Detail_ProduceUnit" class="tdVal" colspan="2"></td>
  367. <td class="tdName"><strong>生产日期</strong>:</td>
  368. <td id="Detail_ProduceDate" class="tdVal" colspan="2"></td>
  369. </tr>
  370. <tr>
  371. <td class="tdName"><strong>产地</strong>:</td>
  372. <td id="Detail_HabitatName" class="tdVal" colspan="2"></td>
  373. <td class="tdName"><strong>仪器编号</strong>:</td>
  374. <td id="Detail_MachineID" class="tdVal" colspan="2"></td>
  375. </tr>
  376. <tr>
  377. <td class="tdName"><strong>仪器厂商</strong>:</td>
  378. <td id="Detail_MachineMaker" class="tdVal" colspan="2"></td>
  379. <td class="tdName"><strong>数据编号</strong>:</td>
  380. <td id="Detail_ClientIndexID" class="tdVal" colspan="2"></td>
  381. </tr>
  382. <tr>
  383. <td class="tdName"><strong>备注</strong>:</td>
  384. <td id="Detail_Memo" class="tdVal" colspan="5"></td>
  385. </tr>
  386. </table>
  387. </div>
  388. <!--EndPrint-->
  389. <div class="" style="margin-bottom: 15px;text-align: center;display:@ViewBag.IsPrint">
  390. <button type="button" onclick="Print();">直接打印</button>
  391. <button type="button" class="but5" onclick="PreView()">打印预览</button>
  392. </div>
  393. </div>
  394. <div data-options="region:'south',border:false" style="text-align:right;height:45px; padding:13px 20px 0;">
  395. <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winModal').window('close');" style="width:80px">关闭</a>
  396. </div>
  397. </div>
  398. </div>
  399. <div id="winModal_Search" class="easyui-window winModal" title="" style="width: 750px; height: 600px;padding:10px;"
  400. iconCls="icon-save" data-options="modal:true,closed:true">
  401. <div class="easyui-layout" data-options="fit:true" style="height:99%">
  402. <div data-options="region:'center'" style="padding: 15px 5px 5px;">
  403. <div id="Search_SampleName">
  404. <div class="panle-half">
  405. <div class="input-group">
  406. <label class="input-group-addon control-label" for="dg_SearchSampleName" style="min-width: 70px">品种名</label>
  407. <input class="form-control input-group-addon" aria-disabled="true" name="dg_SearchSampleName" id="dg_SearchSampleName" type="text" value="" placeholder="" />
  408. <span class="input-group-addon control-label" onclick="DgSearchLoadTable()">搜索</span>
  409. </div>
  410. </div>
  411. <div class="panle-fluid" style="margin-top: 10px;">
  412. <table id="dgTable_Search_tree" class="easyui-datagrid" style="width: 98%; height: 410px;"
  413. data-options="singleSelect: true,
  414. method: 'post',
  415. rownumbers: true,
  416. remoteSort: false,
  417. onDblClickRow: function () {
  418. SetSearch();
  419. }
  420. ">
  421. <thead>
  422. <tr></tr>
  423. </thead>
  424. </table>
  425. </div>
  426. </div>
  427. <div id="Search_Market" style="display:none">
  428. <div class="panle-half">
  429. <div class="input-group">
  430. <label class="input-group-addon control-label" for="dg_SearchRegionID" style="min-width: 70px">所属辖区</label>
  431. <select class="form-control input-group-addon" type="text" id="dg_SearchRegionID" name="dg_SearchRegionID" onchange="GetMarketSelStr();" disabled="disabled">
  432. <option value="">全部</option>
  433. @Html.Raw(ViewBag.SelRegionInfo)
  434. </select>
  435. </div>
  436. </div>
  437. <div class="panle-half">
  438. <div class="input-group">
  439. <label class="input-group-addon control-label" for="dg_SearchMarketName" style="min-width: 70px">市场名称</label>
  440. <input class="form-control input-group-addon" aria-disabled="true" name="dg_SearchMarketName" id="dg_SearchMarketName" type="text" value="" placeholder="" />
  441. <span class="input-group-addon control-label" onclick="DgSearchLoadTable()">搜索</span>
  442. </div>
  443. </div>
  444. <div class="panle-fluid" style="margin-top: 10px;">
  445. <table id="dgTable_Search" class="easyui-datagrid" style="width: 98%; height: 410px;"
  446. data-options="singleSelect: true,
  447. method: 'post',
  448. multiSort: false,
  449. toolbar: '#tbToolBar_Attach',
  450. fitColumns: true,
  451. rownumbers: true,
  452. remoteSort: false,
  453. loadFilter: pagerFilter,
  454. onDblClickRow: function () {
  455. SetSearch();
  456. }
  457. ">
  458. <thead>
  459. <tr></tr>
  460. </thead>
  461. </table>
  462. </div>
  463. </div>
  464. <div id="Search_MarketSeller" style="display:none">
  465. <div class="panle-half">
  466. <div class="input-group">
  467. <label class="input-group-addon control-label" for="dg_SearchMarketId" style="min-width:70px">所属市场</label>
  468. <select class="form-control input-group-addon" aria-disabled="true" name="dg_SearchMarketId" id="dg_SearchMarketId" type="text" value="" placeholder="选择所属市场" disabled="">
  469. @*@Html.Raw(ViewBag.SelMarketInfo)*@
  470. </select>
  471. </div>
  472. </div>
  473. <div class="panle-half">
  474. <div class="input-group">
  475. <label class="input-group-addon control-label" for="dg_SearchSellerName" style="min-width:70px">经营户名</label>
  476. <input class="form-control input-group-addon" aria-disabled="true" name="dg_SearchSellerName" id="dg_SearchSellerName" type="text" value="" placeholder="" />
  477. <span class="input-group-addon control-label" onclick="DgSearchLoadTable()">搜索</span>
  478. </div>
  479. </div>
  480. <div class="panle-fluid" style="margin-top:10px;">
  481. <table id="dgTable_SearchSeller" class="easyui-datagrid" style="width:98%; height: 420px;"
  482. data-options="singleSelect: true,
  483. method: 'post',
  484. multiSort: false,
  485. @*toolbar: '#tbToolBar_Attach',*@
  486. fitColumns: true,
  487. @*rownumbers: true,*@
  488. remoteSort: false,
  489. @*loadFilter: pagerFilter,*@
  490. onDblClickRow: function () {
  491. SetSearch('#SearchMarketSellerID');
  492. },
  493. pagination: true,
  494. pageSize: 50,
  495. pageList: [10,20, 50, 100]
  496. ">
  497. <thead>
  498. </thead>
  499. </table>
  500. </div>
  501. </div>
  502. </div>
  503. <div data-options="region:'south',border:false" style="text-align:right;height:45px; padding:13px 20px 0;">
  504. <a class="easyui-linkbutton" id="Save_SetSearch" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="SetSearch()" style="width:80px">确认</a>
  505. <a class="easyui-linkbutton" id="Save_Search" data-options="iconCls:'icon-search'" href="javascript:void(0)" onclick="DgSearchLoadTable()" style="width:80px">搜索</a>
  506. <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winModal_Search').window('close');" style="width:80px">取消</a>
  507. </div>
  508. </div>
  509. </div>
  510. <div id="winModal_Upload" class="easyui-window winModal" title="上传Excel检测数据信息" style="width: 550px; height: 400px;padding:10px;"
  511. iconCls="icon-save" data-options="modal:true,closed:true">
  512. <div class="easyui-layout" data-options="fit:true" style="height:99%">
  513. <div data-options="region:'center'" style="padding: 15px 5px 5px;">
  514. <form class="form-horizontal" role="form">
  515. <input type="file" class="form-control" placeholder="上传excel" id="UploadExcel" name="UploadExcel" autocomplete="off" value="" />
  516. </form>
  517. </div>
  518. <div data-options="region:'south',border:false" style="text-align:right;height:45px; padding:13px 20px 0;">
  519. <a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="ExcelUpload()" style="width:80px">确认导入</a>
  520. <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="$('#winModal_Upload').window('close');" style="width:80px">取消</a>
  521. </div>
  522. </div>
  523. </div>
  524. </section>
  525. <script>
  526. var lock = false;
  527. function SampleNameChange() {
  528. alert(1);
  529. }
  530. function uploadExcelFile() {
  531. $('#UploadExcel').val('');
  532. $("#winModal_Upload").window("open");
  533. }
  534. function ExcelUpload() {
  535. var formData = new FormData();
  536. formData.append('uploadExcel', $('#UploadExcel')[0].files[0]);
  537. $.ajax({
  538. url: "@Url.Action("UploadCheckData", "MarketSystem")",
  539. processData: false,
  540. contentType: false,
  541. type: "post",
  542. data: formData,
  543. success: function(msg) {
  544. if (msg&&msg.Success) {
  545. LoadTable();
  546. //Reset();
  547. layer.alert("上传成功", { icon: 1, title: '提示信息' });
  548. $("#winModal_Upload").window("close");
  549. } else {
  550. layer.alert("上传失败"+msg.Msg, { icon: 1, title: '提示信息' });
  551. }
  552. }
  553. });
  554. }
  555. function Save(type) {
  556. type = type || $("#hid_Type").val();
  557. if (lock) return;
  558. $.ajax({
  559. url: "@Url.Action("CheckDataOper", "MarketSystem")",
  560. type: "post",
  561. dataType: "json",
  562. beforeSend: function() {
  563. $("#Search_Panel .text-requird").each(function() {
  564. var idStr = $(this).parent().children(":first").attr("id");
  565. if (idStr!=undefined) {
  566. if (CheckEmpty("#" + idStr) === true) {
  567. $("#hid_vali").val("1");
  568. return false;
  569. }
  570. }
  571. });
  572. if ($("#hid_vali").val()==="1") {
  573. return false;
  574. }
  575. var sampleId = $("#SampleName").combotree("getValue");
  576. console.log(sampleId);
  577. if (sampleId === "undefined"|| sampleId.trim()==="")
  578. {
  579. layer.alert("检测品种不能为空", { icon: 7, title: '提示信息' },function (index) {
  580. $("#hid_vali").val("0");
  581. $("#SampleName").next("span").find(".textbox-text").focus();
  582. layer.close(index);
  583. });
  584. return false;
  585. }
  586. if (!isNumber($("#CheckValue").textbox("getValue"))) {
  587. layer.alert("检测值必须为数字!", { icon: 7, title: '提示信息' },function (index) {
  588. $("#CheckValue").textbox("setValue", "");
  589. $("#CheckValue").next("span").find(".textbox-text").val("").focus();
  590. layer.close(index);
  591. });
  592. return false;
  593. }
  594. if (!isNumber($("#CheckTotal").textbox("getValue"))) {
  595. layer.alert("检测次数必须为数字!", { icon: 7, title: '提示信息' },function (index) {
  596. $("#CheckTotal").textbox("setValue", "");
  597. $("#CheckTotal").next("span").find(".textbox-text").val("").focus();
  598. layer.close(index);
  599. });
  600. return false;
  601. }
  602. lock = true;
  603. },
  604. data: {
  605. CurdType: type,
  606. ID: $("#ID").val(),
  607. CheckUnit: $("#CheckUnit").combobox("getValue"),
  608. Memo: $("#Memo").textbox("getValue"),
  609. //Memo: "",
  610. IsSelf: $("#IsSelf").combobox("getValue"),
  611. MarketID: $("#MarketID").combobox("getValue"),
  612. SendDate: $("#SendDate").textbox("getValue"),
  613. MachineMaker: $("#MachineMaker").textbox("getValue"),
  614. CorpKind: $("#CorpKind").combobox("getValue"),
  615. //CorpName: $("#CorpName").combobox("getValue"),
  616. ProduceUnit: $("#ProduceUnit").textbox("getValue"),
  617. ProduceDate: $("#ProduceDate").textbox("getValue"),
  618. ClientIndexID: $("#ClientIndexID").textbox("getValue"),
  619. MachineID: $("#MachineID").textbox("getValue"),
  620. CheckTime: $("#CheckTime").textbox("getValue"),
  621. CheckTotal: $("#CheckTotal").textbox("getValue"),
  622. CheckResult: $("#CheckResult").combobox("getValue"),
  623. StandardValue: $("#StandardValue").textbox("getValue"),
  624. CheckValue: $("#CheckValue").textbox("getValue"),
  625. SampleId: $("#SampleName").combotree("getValue"),
  626. SampleName: $("#hid_SampleName").val(),
  627. //LittleKindName: $("#LittleKindName").combobox("getValue"),
  628. CheckProjectTypeID: $("#CheckProjectTypeID").combobox("getValue"),
  629. HabitatID: $("#HabitatID").combobox("getValue"),
  630. CheckUser: $("#CheckUser").textbox("getValue"),
  631. StallNo: $("#StallNo").textbox("getValue"),
  632. LicenseNo: $("#LicenseNo").textbox("getValue"),
  633. LicenseName: $("#LicenseName").textbox("getValue"),
  634. IdCode: $("#IdCode").textbox("getValue"),
  635. CardIndex: $("#CardIndex").textbox("getValue")
  636. },
  637. success: function (data) {
  638. if (CheckAajxData(data) === false) return;
  639. var msg = data.ErrorInfo;
  640. if (data.Success === true) {
  641. LoadTable();
  642. //Reset();
  643. layer.alert(msg, { icon: 1, title: '提示信息' });
  644. } else {
  645. layer.alert(msg, { icon: 7, title: '提示信息' });
  646. }
  647. lock = false;
  648. },
  649. error:function() {
  650. lock = false;
  651. }
  652. });
  653. }
  654. function CheckEmpty(idStr) {
  655. var val = $(idStr).next("span").find(".textbox-value").val();
  656. var msg = $(idStr).parent().prev().children(":first").html()+ "不能为空!";
  657. if (val===""||val==undefined||val==="请选择...") {
  658. layer.alert(msg, { icon: 7, title: '提示信息' },function (index) {
  659. $(idStr).next("span").find(".textbox-text").focus();
  660. $("#hid_vali").val("0");
  661. layer.close(index);
  662. });
  663. return true;
  664. }
  665. return false;
  666. };
  667. function CheckNum(idStr) {
  668. var val = $(idStr).next("span").find(".textbox-value").val();
  669. var msg = $(idStr).parent().prev().children(":first").html()+ "必须为数字!";
  670. if (!isNumber(val)) {
  671. layer.alert(msg, { icon: 7, title: '提示信息' },function (index) {
  672. $(idStr).next("span").find(".textbox-text").focus();
  673. layer.close(index);
  674. });
  675. return false;
  676. }
  677. return true;
  678. };
  679. //重置恢复初始值
  680. function Reset() {
  681. lock = false;
  682. $("#Search_Panel select.easyui-combobox").combobox("setValue","");
  683. $("#Search_Panel input.easyui-textbox").textbox("setValue","");
  684. if ($("#hid_IsMarketSysAccount").val() === "0") {
  685. //$("#IsSelf").combobox("setValue", "1");
  686. $("#RegionID").combotree("setValue", @ViewBag.RegionID).combobox("disable");
  687. var t = $("#hid_CheckUnit").val();
  688. $("#CheckUnit").combobox("setValue", t);
  689. if (t.length > 0) {
  690. $("#CheckUnit").combobox("disable");
  691. }
  692. }
  693. GetMarketSelStr();
  694. GetLittleKindSelStr();
  695. GetCheckProjectSelStr();
  696. $("#IsSelf").combobox("setValue", $("#hid_IsSystem").val());
  697. $("#HabitatID").combobox("setValue", "1010");
  698. $("#CheckResult").combobox("setValue", "合格");
  699. $("#CheckUser").textbox("setValue", $("#hid_CheckUser").val());
  700. $("#SendDate").textbox("setValue",laydate.now(0, 'YYYY-MM-DD'));
  701. $("#ProduceDate").textbox("setValue",laydate.now(0, 'YYYY-MM-DD'));
  702. $("#CheckTime").textbox("setValue",laydate.now(0, 'YYYY-MM-DD'));
  703. //$("#CorpName").next("span").find("input").focus();
  704. $("#CheckTotal").textbox("setValue","1"),
  705. $("#hid_Type").val("Add");
  706. $("#Save span.l-btn-text").html("添加");
  707. }
  708. //modal赋值
  709. function SetModalVal() {
  710. var rows = $('#dgTable').datagrid('getSelections');
  711. if (rows.length === 1) {
  712. var row = rows[0];
  713. console.log(row);
  714. //var littleKindName;
  715. //try {
  716. // var paths = row.Path.split(",");
  717. // if (paths.length > 1) {
  718. // littleKindName = paths[1];
  719. // }
  720. //} catch (e) {
  721. // console.log(e);
  722. // littleKindName="";
  723. //}
  724. $("#ID").val(row.ID);
  725. $("#CheckUnit").combobox("setValue", row.CheckUnit);
  726. $("#CheckUser").textbox("setValue", row.CheckUser);
  727. $("#HabitatID").combobox("setValue", row.HabitatID);
  728. $("#CheckMethod").combobox("setValue", row.CheckMethodId);
  729. GetCheckProjectSelStr(row.CheckProjectTypeID);
  730. //$("#CheckProjectTypeID").combobox("setValue", row.CheckProjectTypeID);
  731. //GetCheckProjectInfo();
  732. //$("#LittleKindName").combobox("setValue", littleKindName);
  733. GetLittleKindSelStr(row.SampleId, row.SampleName);
  734. //$("#hid_SampleName").val(row.SampleName);
  735. //$("#SampleName").combotree("setValue", row.SampleId ? row.SampleId:"");
  736. $("#CheckValue").textbox("setValue", row.CheckValue);
  737. $("#CheckResult").combobox("setValue", row.CheckResult);
  738. $("#CheckTotal").textbox("setValue", row.CheckTotal);
  739. $("#CheckTime").textbox("setValue", row.CheckTime);
  740. $("#MachineID").textbox("setValue", row.MachineID);
  741. $("#MachineMaker").textbox("setValue", row.MachineMaker);
  742. $("#ClientIndexID").textbox("setValue", row.ClientIndexID);
  743. $("#ProduceUnit").textbox("setValue", row.ProduceUnit);
  744. $("#ProduceDate").textbox("setValue", row.ProduceDate);
  745. $("#CorpKind").combobox("setValue", row.CorpKind);
  746. $("#SendDate").textbox("setValue", row.SendDate);
  747. $("#RegionID").combotree("setValue", row.RegionID);
  748. $("#Memo").textbox("setValue", row.Memo);
  749. $("#IsSelf").combobox("setValue", row.IsSelf);
  750. $("#StallNo").textbox("setValue", row.StallNo);
  751. $("#LicenseNo").textbox("setValue", row.LicenseNo);
  752. $("#LicenseName").textbox("setValue", row.LicenseName);
  753. $("#IdCode").textbox("setValue", row.IdCode);
  754. $("#CardIndex").textbox("setValue", row.CardIndex);
  755. if ($("#hid_IsSystem").val() === "0") {
  756. GetMarketSelStr();
  757. $("#MarketID").combobox("setValue", row.MarketID);
  758. //GetMarketSellerSelStr();
  759. //GetMarketStallsSelStr();
  760. }
  761. //$("#CorpName").combobox("setValue", row.CorpName);
  762. } else {
  763. layer.alert('请选择一条记录进行设置', {title:'提示信息'});
  764. }
  765. }
  766. //查看详情
  767. function btn_Detail() {
  768. var rows = $('#dgTable').datagrid('getSelections');
  769. if (rows.length === 1) {
  770. var row = rows[0];
  771. $("#Detail_MarketID").html(row.MarketID);
  772. $("#Detail_CheckUnit").html(row.CheckUnit);
  773. $("#Detail_CorpName").html(row.CorpName);
  774. $("#Detail_CorpKind").html(row.CorpKind);
  775. $("#Detail_CheckProjectTypeName").html(row.CheckItemName);
  776. $("#Detail_CheckValue").html(row.CheckValue);
  777. $("#Detail_StandardValue").html(row.StandardValue);
  778. $("#Detail_Unit").html(row.Unit);
  779. $("#Detail_CheckTotal").html(row.CheckTotal);
  780. $("#Detail_CheckResult").html(row.CheckResult);
  781. $("#Detail_IsSelf").html(row.IsSelf === "1" ? "是" : "否");
  782. $("#Detail_CheckUser").html(row.CheckUser);
  783. $("#Detail_SendDate").html(row.SendDate);
  784. $("#Detail_CheckTime").html(row.CheckTime);
  785. //$("#Detail_LittleKindName").html(row.SampleName);
  786. $("#Detail_SampleName").html(row.SampleName);
  787. $("#Detail_ProduceUnit").html(row.ProduceUnit);
  788. $("#Detail_ProduceDate").html(row.ProduceDate);
  789. $("#Detail_HabitatName").html(row.HabitatName);
  790. $("#Detail_MachineID").html(row.MachineID);
  791. $("#Detail_MachineMaker").html(row.MachineMaker);
  792. $("#Detail_ClientIndexID").html(row.ClientIndexID);
  793. $("#Detail_Memo").html(row.Memo);
  794. $("#winModal").window("open");
  795. } else {
  796. layer.alert('请选择一条记录进行设置', {title:'提示信息'});
  797. }
  798. }
  799. //修改
  800. function btn_Edit() {
  801. $("#hid_Type").val("Edit");
  802. $("#Save span.l-btn-text").html("修改");
  803. SetModalVal();
  804. }
  805. //根据辖区获取市场下拉框的option
  806. function GetMarketSelStr() {
  807. $.ajax({
  808. url: "/GetResult/GetMarketSelStrResult",
  809. type: "post",
  810. async: false,
  811. dataType: "json",
  812. //data: { RegionID: $("input.combobox-value[name='SearchRegionID']").val() },
  813. data: { RegionID: $("#RegionID").combotree("getValue") },
  814. success: function (data) {
  815. //console.log(msg);
  816. if (CheckAajxData(data) === false) return;
  817. var rows = data.rows;
  818. var first = "{\"MarketID\":\"\",\"Names\":\"请选择...\"}";
  819. var last = "{\"MarketID\":\"Other\",\"Names\":\"其他\"}";
  820. var firstJson = JSON.parse(first);
  821. var lastJson = JSON.parse(last);
  822. rows.unshift(firstJson);
  823. rows.push(lastJson);
  824. //console.log(rows);
  825. $('#MarketID').combobox("clear").combobox({
  826. data: rows,
  827. valueField: 'MarketID',
  828. textField: 'Names',
  829. onLoadSuccess: function () {
  830. var val = $(this).combobox('getData');
  831. // ReSharper disable once MissingHasOwnPropertyInForeach
  832. if ($("#hid_IsMarketSysAccount").val() === "0") {
  833. var m = $("#hid_MarketID").val();
  834. $("#MarketID").combobox("setValue",m).combobox("disable");
  835. } else {
  836. for (var item in val[0]) {
  837. if (item === 'MarketID') {
  838. $(this).combobox('select', val[0][item]);
  839. }
  840. }
  841. }
  842. }
  843. });
  844. }
  845. });
  846. }
  847. //根据市场获取经营户下拉框的option
  848. function GetMarketSellerSelStr() {
  849. $.ajax({
  850. url: "/GetResult/GetMarketSellerSelStrResult",
  851. type: "post",
  852. async: false,
  853. dataType: "json",
  854. //data: { RegionID: $("input.combobox-value[name='SearchRegionID']").val() },
  855. data: { marketId: $("#MarketID").combobox("getValue") },
  856. success: function (data) {
  857. //console.log(msg);
  858. if (CheckAajxData(data) === false) return;
  859. var rows = data.rows;
  860. var first = "{\"Name\":\"\",\"Name\":\"请选择...\"}";
  861. //var last = "{\"MarketID\":\"Other\",\"Names\":\"其他\"}";
  862. var firstJson = JSON.parse(first);
  863. //var lastJson = JSON.parse(last);
  864. rows.unshift(firstJson);
  865. //rows.push(lastJson);
  866. //console.log(rows);
  867. $('#CorpName').combobox("clear").combobox({
  868. data: rows,
  869. //valueField: 'SellerID',
  870. valueField: 'Name',
  871. textField: 'Name',
  872. onLoadSuccess: function () {
  873. var val = $(this).combobox('getData');
  874. // ReSharper disable once MissingHasOwnPropertyInForeach
  875. for (var item in val[0]) {
  876. if (item === 'Name') {
  877. $(this).combobox('select', val[0][item]);
  878. }
  879. }
  880. }
  881. });
  882. }
  883. });
  884. }
  885. //根据市场获取经营户下拉框的option
  886. function GetMarketStallsSelStr() {
  887. $.ajax({
  888. url: "/GetResult/GetMarketStallsResult",
  889. type: "post",
  890. async: false,
  891. dataType: "json",
  892. //data: { RegionID: $("input.combobox-value[name='SearchRegionID']").val() },
  893. data: { marketId: $("#MarketID").combobox("getValue") },
  894. success: function (data) {
  895. //console.log(msg);
  896. if (CheckAajxData(data) === false) return;
  897. var rows = data.rows;
  898. var first = "{\"StallNo\":\"\",\"Name\":\"请选择...\"}";
  899. //var last = "{\"MarketID\":\"Other\",\"Names\":\"其他\"}";
  900. var firstJson = JSON.parse(first);
  901. //var lastJson = JSON.parse(last);
  902. rows.unshift(firstJson);
  903. //rows.push(lastJson);
  904. //console.log(rows);
  905. $('#CorpName').combobox("clear").combobox({
  906. data: rows,
  907. //valueField: 'SellerID',
  908. valueField: 'Name',
  909. textField: 'StallName',
  910. onLoadSuccess: function () {
  911. var val = $(this).combobox('getData');
  912. // ReSharper disable once MissingHasOwnPropertyInForeach
  913. for (var item in val[0]) {
  914. if (item === 'Name') {
  915. $(this).combobox('select', val[0][item]);
  916. }
  917. }
  918. }
  919. });
  920. }
  921. });
  922. }
  923. //根据小类获取品种名下拉框的option
  924. function GetLittleKindSelStr(id,name) {
  925. $.ajax({
  926. url: "/GetResult/GetLittleKindSelStrResult",
  927. type: "post",
  928. dataType: "json",
  929. async: false,
  930. //data: { LittleKindName: $("#LittleKindName").combobox("getValue") },
  931. success: function (data) {
  932. //console.log(msg);
  933. if (CheckAajxData(data) === false) return;
  934. //console.log(data);
  935. if (data.length>0) {
  936. $("#SampleName").combotree({
  937. data: data,
  938. onSelect: function(recode) {
  939. //console.log(recode)
  940. $("#hid_SampleName").val(recode.text);
  941. },
  942. onLoadSuccess: function() {
  943. console.log(id + "-" + name);
  944. $("#SampleName").combotree("setValue", id?id:"");
  945. $("#hid_SampleName").val(name?name:"");
  946. }
  947. });
  948. } else {
  949. $("#SampleName").combotree({
  950. data:[]
  951. });
  952. }
  953. }
  954. });
  955. }
  956. //根据检测方法获取检测项目下拉框的option
  957. function GetCheckProjectSelStr(id) {
  958. $.ajax({
  959. url: "/GetResult/GetCheckProjectSelStrResult",
  960. type: "post",
  961. dataType: "json",
  962. //async:false,
  963. data: { CheckMethod: $("#CheckMethod").combobox("getValue") },
  964. success: function (data) {
  965. if (CheckAajxData(data) === false) return;
  966. var rows = data.rows;
  967. //console.log(data);
  968. var first = "{\"CheckProjectTypeID\":\"\",\"Name\":\"请选择...\"}";
  969. var firstJson = JSON.parse(first);
  970. rows.unshift(firstJson);
  971. $('#CheckProjectTypeID').combobox("clear").combobox({
  972. data: rows,
  973. valueField: 'CheckProjectTypeID',
  974. textField: 'Name',
  975. onLoadSuccess: function () {
  976. if (id != null) {
  977. //console.log(id)
  978. $("#CheckProjectTypeID").combobox("setValue", id);
  979. GetCheckProjectInfo();
  980. } else {
  981. var val = $(this).combobox('getData');
  982. // ReSharper disable once MissingHasOwnPropertyInForeach
  983. for (var item in val[0]) {
  984. if (item === 'CheckProjectTypeID') {
  985. $(this).combobox('select', val[0][item]);
  986. }
  987. }
  988. }
  989. }
  990. });
  991. }
  992. });
  993. }
  994. //根据检测项目获取标准值和单位
  995. function GetCheckProjectInfo() {
  996. $.ajax({
  997. url: "/GetResult/GetCheckProjectInfoResult",
  998. type: "post",
  999. dataType: "json",
  1000. data: { CheckProjectTypeID: $("#CheckProjectTypeID").combobox("getValue") },
  1001. success: function (data) {
  1002. if (CheckAajxData(data) === false) return;
  1003. var row = data.rows[0];
  1004. if (row!=null) {
  1005. $('#StandardValue').textbox("setValue",row.StandardValue);
  1006. $('#StandardUnit').textbox("setValue", row.Unit);
  1007. $('#CheckValue').textbox("setValue", row.StandardValue);
  1008. }
  1009. }
  1010. });
  1011. }
  1012. function MarketIDChanaged() {
  1013. if ($('#MarketID').combobox("getValue")==="Other") {
  1014. var retval = window.prompt("输入被检企业名:", "");
  1015. if (retval !== "" && retval != null) {
  1016. $('#MarketID').combobox("setText", retval);
  1017. //$("#CorpName").textbox("setValue", retval).textbox("disable");
  1018. }
  1019. } else {
  1020. //$("#CorpName").textbox("enable").textbox("setValue", "");
  1021. }
  1022. }
  1023. function SearchModal(searchType) {
  1024. if (searchType === "#Market") {
  1025. $('#winModal_Search').window({"title": "搜索被检单位"});
  1026. $("#hidSetSearch_Type").val("#MarketID");
  1027. $("#Search_SampleName").hide();
  1028. $("#Search_MarketSeller").hide();
  1029. $("#Search_Market").show();
  1030. //GetMarketSelStr();
  1031. $("#dg_SearchRegionID").val($("#RegionID").combobox("getValue"));
  1032. } else if (searchType === "#MarketSeller") {
  1033. $('#winModal_Search').window({ "title": "搜索被检对象"});
  1034. $("#hidSetSearch_Type").val("#MarketSeller");
  1035. $("#Search_Market").hide();
  1036. $("#Search_SampleName").hide();
  1037. $("#Search_MarketSeller").show();
  1038. $("#dg_SearchMarketId").val($("#MarketID").combobox("getValue"));
  1039. }
  1040. else {
  1041. $("#hidSetSearch_Type").val("#SampleName");
  1042. //$("#dg_SearchLittleKindName").val($("#LittleKindName").combobox("getValue"));
  1043. $("#Search_MarketSeller").hide();
  1044. $("#Search_Market").hide();
  1045. $("#Search_SampleName").show();
  1046. $('#winModal_Search').window({"title": "搜索品种名"});
  1047. }
  1048. $('#winModal_Search input').val("");
  1049. DgSearchLoadTable();
  1050. $('#winModal_Search').window('open');
  1051. }
  1052. function SetSearch(idStr) {
  1053. idStr = idStr || $("#hidSetSearch_Type").val();
  1054. var rows = $('#dgTable_Search').datagrid('getSelections')
  1055. if (rows.length === 0) {
  1056. rows =$('#dgTable_Search_tree').datagrid('getSelections');
  1057. }
  1058. if (rows.length === 0) {
  1059. rows = $('#dgTable_SearchSeller').datagrid('getSelections');
  1060. }
  1061. if (rows.length === 1) {
  1062. var row = rows[0];
  1063. console.log(row);
  1064. if (idStr === "#MarketID") {
  1065. $(idStr).combobox("setValue",row.MarketID);
  1066. } else if (idStr === "#MarketSeller") {
  1067. $("#CorpName").combobox("setValue", row.CorpName);
  1068. }
  1069. else {
  1070. $(idStr).combotree("setValue", row.VarietyCategoryNo);
  1071. $("#hid_SampleName").val(row.VarietyCategoryName);
  1072. }
  1073. $('#winModal_Search').window('close');
  1074. } else {
  1075. layer.alert('请选择一条记录进行设置', { icon: 7, title: '提示信息' });
  1076. }
  1077. }
  1078. function DgSearchLoadTable(searchType) {
  1079. searchType = searchType || $("#hidSetSearch_Type").val();
  1080. if (searchType === "#MarketID") {
  1081. var regionId = $("#RegionID").combotree("getValue"),
  1082. marketName = $("#dg_SearchMarketName").val();
  1083. $('#dgTable_Search').datagrid({
  1084. pagination: true,
  1085. pageSize: 50,
  1086. pageList: [10, 20, 50, 100],
  1087. url: '@Url.Action("MarketSearchResult", "GetResult")' + '?RegionId=' + escape(regionId) + '&MarketName=' + escape(marketName),
  1088. columns: [
  1089. [
  1090. { field: 'Names', title: '市场名称', width: 130, align: 'center' },
  1091. { field: 'Principal', title: '负责人', width: 80, align: 'center' },
  1092. { field: 'LinkMan', title: '日常联系人', width: 80, align: 'center' },
  1093. { field: 'LinkTel', title: '联系电话', width: 100, align: 'center' }
  1094. //{ field: 'FrontForUnit', title: '主办单位', width: 150, align: 'center' },
  1095. //{ field: 'ManageUnit', title: '管理单位', width: 150, align: 'center' }
  1096. ]
  1097. ]
  1098. });
  1099. } else if (searchType === "#MarketSeller") {
  1100. var marketId = $("#dg_SearchMarketId").val(),
  1101. sellerName = $("#dg_SearchSellerName").val();
  1102. $('#dgTable_SearchSeller').datagrid({
  1103. url: '@Url.Action("SellerSearchResult", "GetResult")' + '?MarketID=' + escape(marketId) + '&MarketSellerName=' + escape(sellerName),
  1104. columns: [[
  1105. { field: 'MarketSellerName', title: '经营户名', width: 150, align: 'center' },
  1106. { field: 'IdCard', title: '身份证', width: 180, align: 'center' },
  1107. { field: 'EnterMarketDate', title: '入场时间', width: 180, align: 'center' },
  1108. { field: 'Tel', title: '联系电话', width: 180, align: 'center' }
  1109. //{ field: 'StallName', title: '摊位号', width: 250, align: 'center' },
  1110. //{ field: 'MarketName', title: '隶属市场', width: 180, align: 'center' },
  1111. //{ field: 'TradeTypeName', title: '所在行业', width: 200, align: 'center' },
  1112. ]]
  1113. });
  1114. }
  1115. else {
  1116. var littleKindName = $("#dg_SearchLittleKindName").val(),
  1117. sampleName = $("#dg_SearchSampleName").val();
  1118. $('#dgTable_Search_tree').treegrid({
  1119. idField: 'VarietyCategoryNo',
  1120. treeField: 'VarietyCategoryName',
  1121. url: '@Url.Action("SampleNameSearchResult", "GetResult")' + '?LittleKindName=' + escape(littleKindName) + '&SampleName=' + escape(sampleName),
  1122. columns: [
  1123. [
  1124. { field: 'VarietyCategoryName', title: '品种名称',width:"90%" }
  1125. ]
  1126. ]
  1127. });
  1128. }
  1129. }
  1130. //加载表格数据
  1131. function LoadTable() {
  1132. $('#dgTable').datagrid({
  1133. url: '@Url.Action("CheckDataResult", "GetResult")'
  1134. });
  1135. }
  1136. //easyui Textbox控件用laydate
  1137. function EasyuiLaydate(idstr, isChange) {
  1138. var idstr2 = idstr + "_Date";
  1139. $("#"+idstr).next("span").find("input").attr("id", idstr2);
  1140. laydate({
  1141. elem: "#"+idstr2,
  1142. format: "YYYY-MM-DD",
  1143. min: "1980-01-01",
  1144. event: "focus",
  1145. choose: function (datas) {
  1146. //console.log(datas)
  1147. $("#" + idstr).textbox("setValue", datas);
  1148. if (isChange) {
  1149. $("#ProduceDate").textbox("setValue", datas);
  1150. $("#CheckTime").textbox("setValue", datas);
  1151. }
  1152. }
  1153. });
  1154. //console.log(laydate.now(0, 'YYYY-MM-DD'));
  1155. $("#" + idstr).textbox("setValue",laydate.now(0, 'YYYY-MM-DD'));
  1156. }
  1157. $(function () {
  1158. //加载表格数据
  1159. //var value = $(".combobox.searchbox .combobox-value").val(), item = $(".combobox.searchbox .combobox-value").attr("name");
  1160. //LoadTable(value, item);
  1161. var data =@Html.Raw(ViewBag.SelRegionInfo)
  1162. $("#RegionID").combotree({
  1163. data: data
  1164. //onLoadSuccess: function() {
  1165. // $("#RegionID").combotree("setValue", "100001");
  1166. //}
  1167. });
  1168. if ($("#hid_IsMarketSysAccount").val() === "0") {
  1169. $("#IsSelf").combobox("setValue", "1");
  1170. $("#RegionID").combotree("setValue", "@ViewBag.RegionID");
  1171. $("#RegionID").combotree("readonly");
  1172. var t = $("#hid_CheckUnit").val();
  1173. $("#CheckUnit").combobox("setValue", t);
  1174. if (t.length > 0) {
  1175. $("#CheckUnit").combobox("readonly");
  1176. }
  1177. }
  1178. if ($("#hid_IsSystem").val() === "0") {
  1179. $("#IsSelf").combobox("setValue", "0");
  1180. }
  1181. GetMarketSelStr();
  1182. GetCheckProjectSelStr();
  1183. GetLittleKindSelStr();
  1184. //GetMarketSellerSelStr();
  1185. //GetMarketStallsSelStr();
  1186. $("#HabitatID").combobox("setValue", "1010");
  1187. $("#CheckUser").textbox("setValue", $("#hid_CheckUser").val());
  1188. LoadTable();
  1189. //加载日历控件
  1190. EasyuiLaydate("SendDate",true);
  1191. EasyuiLaydate("ProduceDate");
  1192. EasyuiLaydate("CheckTime");
  1193. $(".combo-panel.panel-body ul.tree").parent().addClass("treeC");
  1194. });
  1195. </script>
  1196. </body>
  1197. </html>