index.html 87 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
  5. <meta http-equiv="Pragma" content="no-cache" />
  6. <meta http-equiv="Expires" content="0" />
  7. <meta charset="utf-8">
  8. <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  9. <link rel="shortcut icon" href="/img/logo.png" />
  10. <link rel="bookmark" href="/img/logo.png" />
  11. <link rel="stylesheet" href="/plugins/bootstrap-4.3.1/css/bootstrap.min.css">
  12. <link rel="stylesheet" href="/plugins/font-awesome-4.7.0/css/font-awesome.min.css">
  13. <link href="/Plugins/bootstrap-select/css/bootstrap-select.min.css" rel="stylesheet" />
  14. <link rel="stylesheet" href="../common/StyleSheet.css" />
  15. <script src="/Plugins/jquery-3.4.1/jquery-3.4.1.min.js"></script>
  16. <script src="/Plugins/virtualkeyboard/xvirtualkeyboard.js"></script>
  17. <style type="text/css">
  18. .nav-link {
  19. padding: .4rem 0.6rem;
  20. }
  21. tr, th, td {
  22. height: 22px !important;
  23. padding: 4px !important;
  24. }
  25. .nav-pills .nav-link.active, .nav-pills .show > .nav-link {
  26. background-color: #17a2b8 !important;
  27. }
  28. </style>
  29. <title>东科软件</title>
  30. </head>
  31. <body class="bg-light">
  32. <!--导航菜单-->
  33. <script src="../common/navbar.js"></script>
  34. <!--质量登记表单-->
  35. <div class="container-fluid pt-2">
  36. <div class="rounded bg-white shadow-sm pl-4 pt-3 pr-4 pl-4 pb-2">
  37. <form class="pt-0">
  38. <div class="form-row">
  39. <div class="form-group col-2 mb-1">
  40. <label for="生产工号">生产工号</label>
  41. <input readonly type="text" class="form-control border-secondary" id="生产工号" placeholder="请输入" required>
  42. </div>
  43. <div class="form-group col-2 mb-1">
  44. <label for="产品编码">产品编码</label>
  45. <input type="text" class="form-control border-secondary" id="产品编码" placeholder="查询" readonly>
  46. </div>
  47. <div class="form-group col-2 mb-1">
  48. <label for="产品名称">产品名称</label>
  49. <input type="text" class="form-control border-secondary" id="产品名称" placeholder="查询" readonly>
  50. </div>
  51. <div class="form-group col-2 mb-1">
  52. <label for="产品条码">产品条码</label>
  53. <input value="10016153380" onkeydown="if (event.keyCode == 13) loadProduct();" type="text" class="form-control" id="产品条码" placeholder="请输入" required>
  54. <div id="softkeyboard"></div>
  55. </div>
  56. <div class="form-group col-4 align-self-end mb-1">
  57. <button onclick="loadProduct()" id="产品查询" type="button" class="btn btn-info btn-block">产品查询</button>
  58. </div>
  59. </div>
  60. <div class="form-row pt-1">
  61. <div class="form-group col-2 mb-1">
  62. <input type="text" class="form-control border-secondary" id="产品商标" placeholder="查询" readonly>
  63. </div>
  64. <div class="form-group col-2 mb-1">
  65. <input type="text" class="form-control border-secondary" id="产品釉料" placeholder="查询" readonly>
  66. </div>
  67. <div class="form-group col-2 mb-1">
  68. <input type="text" class="form-control border-secondary" id="漏气" placeholder="查询" readonly>
  69. </div>
  70. <div class="form-group col-2 mb-1">
  71. <input type="text" class="form-control border-secondary" id="内漏" placeholder="查询" readonly>
  72. </div>
  73. <div class="form-group col-2">
  74. <input type="text" class="form-control border-secondary" id="重烧" placeholder="查询" readonly>
  75. </div>
  76. <div class="form-group col-2">
  77. <input type="text" class="form-control border-secondary" id="干补" placeholder="查询" readonly>
  78. </div>
  79. </div>
  80. </form>
  81. </div>
  82. <ul class="nav nav-tabs pt-2" id="myTab" role="tablist">
  83. <li class="nav-item" role="presentation">
  84. <a class="nav-link active" id="物料绑定页" data-toggle="tab" href="#物料绑定" role="tab" aria-controls="物料绑定" aria-selected="true">物料绑定</a>
  85. </li>
  86. <li class="nav-item" role="presentation">
  87. <a class="nav-link" id="物料报损页" data-toggle="tab" href="#物料报损" role="tab" aria-controls="物料报损" aria-selected="false">物料报损</a>
  88. </li>
  89. <li class="nav-item" role="presentation">
  90. <a class="nav-link" id="质量登记页" data-toggle="tab" href="#质量登记" role="tab" aria-controls="质量登记" aria-selected="false">质量登记</a>
  91. </li>
  92. </ul>
  93. <div class="tab-content" id="myTabContent">
  94. <div class="tab-pane fade show active" id="物料绑定" role="tabpanel" aria-labelledby="物料绑定页">
  95. <div class="rounded bg-white shadow-sm pl-4 pt-3 pr-4 pl-4 pb-2">
  96. <div class="nav nav-pills" id="v-pills-tab" role="tablist" aria-orientation="vertical">
  97. <a class="nav-link active" id="v-bom1-tab" data-toggle="pill" href="#v-pills-bom1" role="tab" aria-controls="v-pills-bom1" aria-selected="true">HEGII(新)#CT966EN2100B01</a>
  98. <a class="nav-link" id="v-bom2-tab" data-toggle="pill" href="#v-pills-bom2" role="tab" aria-controls="v-pills-bom2" aria-selected="false">HEGII(非标)#CT966EN2210B02</a>
  99. <input class="form-control ml-2" type="text" id="getBarcode" style="width:200px;" placeholder="扫描物料唯一码">
  100. </div>
  101. <div class="tab-content pt-2" id="v-pills-tabContent">
  102. <div class="tab-pane fade show active" id="v-pills-bom1" role="tabpanel" aria-labelledby="v-pills-bom1">
  103. <!--物料列表1-->
  104. <table class="table">
  105. <thead>
  106. <tr>
  107. <th scope="col">物料号</th>
  108. <th scope="col">物料描述</th>
  109. <th scope="col">批次</th>
  110. <th scope="col">数量</th>
  111. <th scope="col">操作</th>
  112. <th scope="col">工序</th>
  113. <th scope="col">操作员</th>
  114. <th scope="col">时间</th>
  115. </tr>
  116. </thead>
  117. <tbody>
  118. <tr>
  119. <td>CT966EN2100B01</td>
  120. <td>落地式坐便器HC0118PT\地排305</td>
  121. <td>
  122. <select class="form-control form-control-sm" id="row11_select" style="width:100px;">
  123. <option>202209</option>
  124. <option>202210</option>
  125. </select>
  126. </td>
  127. <td>
  128. <input class="form-control form-control-sm" type="text" value="1" id="row11_text" style="width:40px;">
  129. </td>
  130. <td>
  131. <div class="btn-group btn-group-sm" role="group" aria-label="操作">
  132. <button type="button" class="btn btn-info">装配</button>
  133. <button type="button" class="btn btn-secondary">取消</button>
  134. <button type="button" class="btn btn-danger">报损</button>
  135. </div>
  136. </td>
  137. <td>装配</td>
  138. <td>XW</td>
  139. <td>2022-11-20 18:00:00</td>
  140. </tr>
  141. <tr>
  142. <td>CT966EN2100B01</td>
  143. <td>落地式坐便器HC0118PT\地排305</td>
  144. <td>
  145. <select class="form-control form-control-sm" id="row12_select" style="width:100px;">
  146. <option>202209</option>
  147. <option>202210</option>
  148. </select>
  149. </td>
  150. <td>
  151. <input class="form-control form-control-sm" type="text" value="1" id="row12_text" style="width:40px;">
  152. </td>
  153. <td>
  154. <div class="btn-group btn-group-sm" role="group" aria-label="操作">
  155. <button type="button" class="btn btn-info">装配</button>
  156. <button type="button" class="btn btn-secondary">取消</button>
  157. <button type="button" class="btn btn-danger">报损</button>
  158. </div>
  159. </td>
  160. <td>装配</td>
  161. <td>XW</td>
  162. <td>2022-11-20 18:00:00</td>
  163. </tr>
  164. <tr>
  165. <td>CT966EN2100B01</td>
  166. <td>落地式坐便器HC0118PT\地排305</td>
  167. <td>
  168. <select class="form-control form-control-sm" id="row13_select" style="width:100px;">
  169. <option>202209</option>
  170. <option>202210</option>
  171. </select>
  172. </td>
  173. <td>
  174. <input class="form-control form-control-sm" type="text" value="1" id="row13_text" style="width:40px;">
  175. </td>
  176. <td>
  177. <div class="btn-group btn-group-sm" role="group" aria-label="操作">
  178. <button type="button" class="btn btn-info">装配</button>
  179. <button type="button" class="btn btn-secondary">取消</button>
  180. <button type="button" class="btn btn-danger">报损</button>
  181. </div>
  182. </td>
  183. <td>装配</td>
  184. <td>XW</td>
  185. <td>2022-11-20 18:00:00</td>
  186. </tr>
  187. </tbody>
  188. </table>
  189. </div>
  190. <div class="tab-pane fade" id="v-pills-bom2" role="tabpanel" aria-labelledby="v-pills-bom2">
  191. <!--物料列表2-->
  192. <table class="table">
  193. <thead>
  194. <tr>
  195. <th scope="col">物料号</th>
  196. <th scope="col">物料描述</th>
  197. <th scope="col">批次</th>
  198. <th scope="col">数量</th>
  199. <th scope="col">操作</th>
  200. <th scope="col">工序</th>
  201. <th scope="col">操作员</th>
  202. <th scope="col">时间</th>
  203. </tr>
  204. </thead>
  205. <tbody>
  206. <tr>
  207. <td>CT966EN2100B02</td>
  208. <td>落地式坐便器HC0118PT\地排305</td>
  209. <td>
  210. <select class="form-control form-control-sm" id="row21_select" style="width:100px;">
  211. <option>202209</option>
  212. <option>202210</option>
  213. </select>
  214. </td>
  215. <td>
  216. <input class="form-control form-control-sm" type="text" value="1" id="row21_text" style="width:40px;">
  217. </td>
  218. <td>
  219. <div class="btn-group btn-group-sm" role="group" aria-label="操作">
  220. <button type="button" class="btn btn-info">装配</button>
  221. <button type="button" class="btn btn-secondary">取消</button>
  222. <button type="button" class="btn btn-danger">报损</button>
  223. </div>
  224. </td>
  225. <td>装配</td>
  226. <td>XW</td>
  227. <td>2022-11-20 18:00:00</td>
  228. </tr>
  229. <tr>
  230. <td>CT966EN2100B02</td>
  231. <td>落地式坐便器HC0118PT\地排305</td>
  232. <td>
  233. <select class="form-control form-control-sm" id="row22_select" style="width:100px;">
  234. <option>202209</option>
  235. <option>202210</option>
  236. </select>
  237. </td>
  238. <td>
  239. <input class="form-control form-control-sm" type="text" value="1" id="row22_text" style="width:40px;">
  240. </td>
  241. <td>
  242. <div class="btn-group btn-group-sm" role="group" aria-label="操作">
  243. <button type="button" class="btn btn-info">装配</button>
  244. <button type="button" class="btn btn-secondary">取消</button>
  245. <button type="button" class="btn btn-danger">报损</button>
  246. </div>
  247. </td>
  248. <td>装配</td>
  249. <td>XW</td>
  250. <td>2022-11-20 18:00:00</td>
  251. </tr>
  252. </tbody>
  253. </table>
  254. </div>
  255. </div>
  256. </div>
  257. </div>
  258. <div class="tab-pane fade" id="物料报损" role="tabpanel" aria-labelledby="物料报损页">
  259. <div class="rounded bg-white shadow-sm pl-4 pt-3 pr-4 pl-4 pb-2">
  260. <table class="table">
  261. <thead>
  262. <tr>
  263. <th scope="col">物料号</th>
  264. <th scope="col">物料描述</th>
  265. <th scope="col">批次</th>
  266. <th scope="col">数量</th>
  267. <th scope="col">操作</th>
  268. <th scope="col">工序</th>
  269. <th scope="col">操作员</th>
  270. <th scope="col">时间</th>
  271. </tr>
  272. </thead>
  273. <tbody>
  274. <tr>
  275. <td>CT966EN2100B01</td>
  276. <td>落地式坐便器HC0118PT\地排305</td>
  277. <td>202210</td>
  278. <td>1</td>
  279. <td>
  280. <div class="btn-group btn-group-sm" role="group" aria-label="操作">
  281. <button type="button" class="btn btn-danger">取消报损</button>
  282. </div>
  283. </td>
  284. <td>装配</td>
  285. <td>XW</td>
  286. <td>2022-11-20 18:00:00</td>
  287. </tr>
  288. </tbody>
  289. </table>
  290. </div>
  291. </div>
  292. <div class="tab-pane fade" id="质量登记" role="tabpanel" aria-labelledby="质量登记页">
  293. <div class="rounded bg-white shadow-sm pl-4 pt-3 pr-4 pl-4 pb-2">
  294. <div class="form-row">
  295. <div class="form-group col-2">
  296. <label for="缺陷名称">缺陷名称</label>
  297. <div class="input-group">
  298. <input type="text" class="form-control border-secondary" id="缺陷名称" placeholder="查询" readonly>
  299. <div class="input-group-append">
  300. <button class="btn btn-info" onclick="productDefect_OnClick(procedureId)" type="button" id="选择缺陷按钮" disabled>选择</button>
  301. </div>
  302. </div>
  303. </div>
  304. <div class="form-group col-2">
  305. <label for="缺陷位置">缺陷位置</label>
  306. <div class="input-group">
  307. <input type="text" class="form-control border-secondary" id="缺陷位置" placeholder="查询" readonly>
  308. <div class="input-group-append">
  309. <button class="btn btn-info" onclick="productDefectPosition_OnClick(procedureId)" type="button" id="选择位置按钮" disabled>选择</button>
  310. </div>
  311. </div>
  312. </div>
  313. <div class="form-group col-2">
  314. <label for="特殊缺陷">特殊缺陷</label>
  315. <select id="特殊缺陷" class="custom-select" required disabled>
  316. <option value="" selected>请选择...</option>
  317. <option value="1">1</option>
  318. <option value="0">0</option>
  319. </select>
  320. </div>
  321. <div class="form-group col-2">
  322. <label for="责任工序">责任工序</label>
  323. <select onchange="defectProcedure_OnChange()" id="责任工序" class="custom-select" required disabled>
  324. <option value="">请选择...</option>
  325. </select>
  326. </div>
  327. <div class="form-group col-2">
  328. <label for="责任工号">责任工号</label>
  329. <div class="input-group">
  330. <input type="text" onkeyup="this.value=this.value.toUpperCase()" onkeydown="if (event.keyCode == 13) loadDefectByUserCode(procedureId);" class="form-control border-secondary" id="责任工号" placeholder="请输入..." disabled>
  331. <div class="input-group-append">
  332. <button class="btn btn-info" onclick="loadDefectByUserCode(procedureId)" type="button" id="责任工号按钮" disabled>查询</button>
  333. </div>
  334. </div>
  335. </div>
  336. <div class="form-group col-2">
  337. <label for="责任工种">责任工种</label>
  338. <select id="责任工种" class="custom-select" onchange="defectJobs_OnChange()" required disabled>
  339. <option value="">请选择...</option>
  340. </select>
  341. </div>
  342. </div>
  343. <div class="form-row">
  344. <div class="form-group col-2">
  345. <label for="责任人">责任人</label>
  346. <select id="责任人" class="form-control selectpicker" title="请选择..." multiple required disabled>
  347. <option value="">请选择...</option>
  348. </select>
  349. </div>
  350. <div class="form-group col-2">
  351. <label for="缺陷扣罚">缺陷扣罚</label>
  352. <select id="缺陷扣罚" class="custom-select" required disabled>
  353. <option value="">请选择...</option>
  354. </select>
  355. </div>
  356. <div class="form-group col-2">
  357. <label for="扣除数">扣除数</label>
  358. <select id="扣除数" class="custom-select" required disabled>
  359. <option value="">请选择...</option>
  360. </select>
  361. </div>
  362. <div class="form-group col-3">
  363. <label for="返工工序">返工工序</label>
  364. <select id="返工工序" class="custom-select" required disabled>
  365. <option value="">请选择...</option>
  366. </select>
  367. </div>
  368. <div class="form-group col-3">
  369. <label for="备注">备注</label>
  370. <input type="text" class="form-control" id="备注" placeholder="请输入" required disabled>
  371. </div>
  372. </div>
  373. <div class="form-row">
  374. <div class="form-group col-2 align-self-end">
  375. <button onclick="productDefectSaveOne()" id="产品缺陷保存按钮" type="button" class="btn btn-info btn-block" disabled>保存缺陷(单次)</button>
  376. </div>
  377. <div class="form-group col-2 align-self-end">
  378. <button onclick="productDefectSaveMore()" id="产品缺陷保存按钮多次" type="button" class="btn btn-secondary btn-block" disabled>保存缺陷(多次)</button>
  379. </div>
  380. <div class="form-group col-5">
  381. <!--产品分级变量-->
  382. <div style="display:none;">
  383. <label for="产品分级">产品分级</label>
  384. <select id="产品分级" onchange="goodsLevel_OnChange()" class="custom-select" required disabled>
  385. <option value="">请选择...</option>
  386. </select>
  387. </div>
  388. <!--产品分级按钮-->
  389. <div id="产品分级按钮模板" style="display:none;">
  390. <label class="btn btn-info active" onclick="goodsLevelSelect('{id}')">
  391. <input type="radio" name="产品分级按钮项" id="产品分级{text}" value="{text}"> {text}
  392. </label>
  393. </div>
  394. <div id="产品分级按钮" class="btn-group btn-group-toggle btn-block pt-2" data-toggle="buttons">
  395. <label class="btn btn-info" onclick="goodsLevelSelect('0')">
  396. <input type="radio" name="产品分级按钮项" id="产品分级正品" value="正品"> 正品
  397. </label>
  398. <label class="btn btn-info" onclick="goodsLevelSelect('0')">
  399. <input type="radio" name="产品分级按钮项" id="产品分级副品" value="副品"> 副品
  400. </label>
  401. <label class="btn btn-info" onclick="goodsLevelSelect('0')">
  402. <input type="radio" name="产品分级按钮项" id="产品分级重烧" value="重烧"> 重烧
  403. </label>
  404. <label class="btn btn-info" onclick="goodsLevelSelect('0')">
  405. <input type="radio" name="产品分级按钮项" id="产品分级次品" value="次品"> 次品
  406. </label>
  407. </div>
  408. </div>
  409. <div class="form-group col-3 align-self-end">
  410. <button onclick="productSave()" id="产品分级保存按钮" type="button" class="btn btn-danger btn-block" disabled>保存产品分级</button>
  411. </div>
  412. </div>
  413. </div>
  414. <div class="rounded bg-white shadow-sm pl-4 pt-1 pr-4 pl-4 pb-2 mt-2">
  415. <!--产品缺陷记录登记-->
  416. <table class="table table-bordered mt-2">
  417. <thead>
  418. <tr>
  419. <th>缺陷名称</th>
  420. <th>缺陷位置</th>
  421. <th>责任工序</th>
  422. <th>工号</th>
  423. <th>工种</th>
  424. <th>责任人</th>
  425. <th>扣罚</th>
  426. <th>扣除</th>
  427. <th>特殊</th>
  428. <th>&nbsp;</th>
  429. </tr>
  430. </thead>
  431. <tbody id="产品缺陷列表">
  432. </tbody>
  433. </table>
  434. </div>
  435. </div>
  436. </div>
  437. </div>
  438. <!--缺陷列表模板-->
  439. <div class="d-none">
  440. <table>
  441. <tbody id="缺陷列表模板">
  442. <tr id="{缺陷标识}">
  443. <td>{缺陷编码}{缺陷名称}</td>
  444. <td>{位置编码}{缺陷位置}</td>
  445. <td>{责任工序}</td>
  446. <td>{责任工号}</td>
  447. <td>{责任工种}</td>
  448. <td>{责任人}</td>
  449. <td>{缺陷扣罚}</td>
  450. <td>{扣除数}</td>
  451. <td>{特殊缺陷}</td>
  452. <td><button delbutton="true" onclick="productDefectDelete('{缺陷标识}')" class="btn btn-sm btn-block btn-danger" type="button">删除</button></td>
  453. </tr>
  454. </tbody>
  455. </table>
  456. </div>
  457. <!--对话框-->
  458. <script src="../common/dialog.js"></script>
  459. <!--产品缺陷对话框-->
  460. <script src="../common/dialogDefect.js"></script>
  461. <!--产品缺陷位置对话框-->
  462. <script src="../common/dialogDefectPosition.js"></script>
  463. <!--版权信息-->
  464. <script src="../common/footer.js"></script>
  465. <script src="/Plugins/bootstrap-4.3.1/js/bootstrap.bundle.min.js"></script>
  466. <script src="/Plugins/bootstrap-select/js/bootstrap-select.min.js"></script>
  467. <script src="/Plugins/sweetalert/sweetalert.min.js"></script>
  468. <script src="/Plugins/xrequest/xrequest.min.js"></script>
  469. <script src="../Common/xuwell.js"></script>
  470. <script>
  471. //xuwei 2020-04-21
  472. //计件标记变量 1新建 2改判 3冷补后
  473. var checkFlag = '1';
  474. //是否打印条码
  475. var printBarcode = false;
  476. //成检工序ID
  477. var procedureId = request('id');
  478. //接口数据源定义
  479. var completeProcedure;
  480. var jsonUser;
  481. var jsonGoodsLevel;
  482. var jsonProcedure;
  483. var jsonStaff;
  484. var defectUserId;
  485. var jsonProductData;
  486. //操作方式 insert update
  487. var action = "";
  488. //用于提交的缺陷数据
  489. var productionDefects = [];
  490. //用于显示的缺陷数据
  491. var defectJson = [];
  492. var defectCount = 0;
  493. var userId = "";
  494. $(document).ready(function () {
  495. //读取是否打印条码
  496. //$.get('print/getprint.ashx', function (d) {
  497. // var p = JSON.parse(d);
  498. // printBarcode = p['success']
  499. //});
  500. //加载数据
  501. loadData();
  502. });
  503. //产品分级按钮事件
  504. function goodsLevelSelect(value) {
  505. $("#产品分级").val(value);
  506. goodsLevel_OnChange();
  507. }
  508. function keyBoard() {
  509. //加载软键盘
  510. $('#产品条码').keyboard({ usePreview: false, autoAccept: true });
  511. $('#备注').keyboard({ usePreview: false, autoAccept: true });
  512. $('#责任工号').keyboard({ usePreview: false, autoAccept: true });
  513. swal({
  514. title: '产品分级',
  515. text: '软键盘已加载!',
  516. icon: 'success',
  517. button: '确定'
  518. });
  519. }
  520. //加载 生产工号
  521. function loadData() {
  522. //检查登录状态
  523. $.get('api/LogInCheck_WCF.ashx', function (data) {
  524. var json = JSON.parse(data);
  525. if (json["success"] == true) {
  526. //登录状态
  527. $('#生产工号').val(json["rows"]["userCode"]);
  528. //保存登录数据源
  529. jsonUser = json["rows"];
  530. }
  531. else {
  532. swal({
  533. title: '登录异常!',
  534. text: '请您先登录系统!',
  535. icon: 'error',
  536. button: '确定'
  537. }).then(function () {
  538. window.location = '/main/login/login.html';
  539. });
  540. }
  541. });
  542. ClearProductDefectList();
  543. }
  544. //清空 产品缺陷列表 位置
  545. function ClearProductDefectList() {
  546. $('#产品缺陷列表').html('<tr><td colspan="9" style="text-align:center">暂无产品缺陷数据。<td></tr>');
  547. defectJson = [];
  548. productionDefects = [];
  549. defectCount = 0;
  550. }
  551. //输入条码 加载 产品信息
  552. function loadProduct() {
  553. swal({
  554. title: '产品分级',
  555. text: '正在查询数据,请稍候。。。',
  556. icon: 'info',
  557. button: false,
  558. closeOnClickOutside: false
  559. });
  560. //重置缺陷数据
  561. productionDefects = [];
  562. defectJson = [];
  563. defectCount = 0;
  564. $("[delbutton='true']").prop("disabled", false);
  565. procedureId = request('id');
  566. //加载产品信息
  567. $.get('api/GetCheckBarCode_WCF.ashx', { 'procedureid': procedureId, 'barcode': $('#产品条码').val() }, function (data) {
  568. var json = JSON.parse(data);
  569. if (json['success'] == true) {
  570. //打印条码
  571. //if (printBarcode) $('#barcodeImg').attr('src', 'print/barcodeimg.ashx?barcode=' + $('#产品条码').val());
  572. if (json['rows'][0]['out_errMsg'] == '') {
  573. //读取产品信息
  574. $('#产品商标').val('商标:' + json['rows'][0]["out_logoName"]);
  575. $('#产品釉料').val('釉料:' + json['rows'][0]["out_glazeName"]);
  576. $('#产品编码').val(json['rows'][0]["out_goodsCode"]);
  577. $('#产品名称').val(json['rows'][0]["out_goodsName"]);
  578. $('#漏气').val('漏气:' + json['rows'][0]["out_LeakFlag1"]);
  579. $('#内漏').val('内漏:' + json['rows'][0]["out_LeakFlag2"]);
  580. //设置漏气内漏样式 1合格0不合格
  581. $('#漏气').removeClass('bg-info,bg-warning');
  582. $('#内漏').removeClass('bg-info,bg-warning');
  583. if (json['rows'][0]["out_LeakFlag1"] == "1") $('#漏气').addClass('bg-info');
  584. if (json['rows'][0]["out_LeakFlag1"] == "0") $('#漏气').addClass('bg-warning');
  585. if (json['rows'][0]["out_LeakFlag2"] == "1") $('#内漏').addClass('bg-info');
  586. if (json['rows'][0]["out_LeakFlag2"] == "0") $('#内漏').addClass('bg-warning');
  587. $('#重烧').val('重烧:' + json['rows'][0]["out_isReFire"]);
  588. $('#干补').val('干补:' + json['rows'][0]["out_specialRepairFlag"]);
  589. //加载完成工序 判断 是 新建 还是 编辑
  590. $.get('api/GetCompleteProcedureIDPDA_WCF.ashx', { 'barcode': $('#产品条码').val() }, function (data) {
  591. var json = JSON.parse(data);
  592. if (json["success"] == true) {
  593. swal.close();
  594. completeProcedure = json["rows"];
  595. if (procedureId == completeProcedure[0]["COMPLETEPROCEDUREID"]) {
  596. checkFlag = "2";
  597. action = "update";
  598. loadUpdateData(0);
  599. }
  600. else {
  601. //2020-03-23 修正 回收后 再次成检 改判操作 找到正确的成检ID
  602. $.get('api/GetProductionDataCheckID_WCF.ashx', { 'barcode': $('#产品条码').val() }, function (data) {
  603. if (data == '{"success":true,"message":"操作成功!","rows":}') {
  604. data = '{"success":true,"message":"操作成功!","rows":""}';
  605. }
  606. var json = JSON.parse(data);
  607. if (json["success"] == true) {
  608. //2020-04-23 xuwei 修正
  609. if (json["rows"].length == 0) {
  610. //为空行时是新建
  611. checkFlag = "1";
  612. action = "insert";
  613. loadInsertData();
  614. }
  615. else {
  616. if (json["rows"][0]["PROCEDUREID"] == procedureId) {
  617. //工序相等时是更新
  618. checkFlag = "3";
  619. action = "update";
  620. loadUpdateData(json["rows"][0]["PRODUCTIONDATAID"]);
  621. }
  622. else {
  623. //工序不等时不可到达
  624. resetGoodsGrade(false);
  625. swal({
  626. title: "产品查询",
  627. text: "该工序不可到达!请确认质量登记工序!",
  628. icon: "error",
  629. button: "确定"
  630. }).then(function () {
  631. $('#产品条码').val('');
  632. $('#产品条码').focus();
  633. });
  634. }
  635. }
  636. //if (json["rows"][0]["PRODUCTIONDATAID"] != 0) {
  637. // checkFlag = "3";
  638. // action = "update";
  639. // loadUpdateData(json["rows"][0]["PRODUCTIONDATAID"]);
  640. //}
  641. //else {
  642. // checkFlag = "1";
  643. // action = "insert";
  644. // loadInsertData();
  645. //}
  646. }
  647. });
  648. }
  649. }
  650. });
  651. }
  652. else {
  653. resetGoodsGrade(false);
  654. swal({
  655. title: "产品查询",
  656. text: json['rows'][0]['out_errMsg'],
  657. icon: "error",
  658. button: "确定"
  659. }).then(function () {
  660. //条码无效时清空条码 2020-03-03 xuwei
  661. $('#产品条码').val('');
  662. $('#产品条码').focus();
  663. });
  664. }
  665. }
  666. else {
  667. swal({
  668. title: '登录异常!',
  669. text: '请您重新登录系统!',
  670. icon: 'error',
  671. button: '确定'
  672. }).then(function () {
  673. window.location = '/main/login/login.html';
  674. });
  675. }
  676. //产品缺陷列表清空
  677. ClearProductDefectList();
  678. });
  679. }
  680. //加载插入数据
  681. function loadInsertData() {
  682. //从预检(直接取在产表 tp_pm_inproduction)加载数据 xuwei add 2020-06-11 ======
  683. $.get('api/GetPreProductCheck.ashx?barCode=' + $('#产品条码').val(), function (data) {
  684. json = JSON.parse(data);
  685. var goodsLevelTypeId = 0;
  686. var reworkProcedureId = 0;
  687. if (json["success"] == true) {
  688. if (json["rows"].length > 0) {
  689. goodsLevelTypeId = json["rows"][0]["GOODSLEVELTYPEID"];
  690. reworkProcedureId = json["rows"][0]["REWORKPROCEDUREID"];
  691. }
  692. }
  693. //加载产品分级
  694. xuwell.loadSelect({
  695. id: '#产品分级',
  696. url: 'api/GetProductCheckGoodsGrade_WCF.ashx',
  697. data: {},
  698. fieldKey: 'DEFECTFLAGID',
  699. fieldValue: 'DEFECTFLAGNAME',
  700. onLoad: function (data) {
  701. $('#产品分级').get(0).selectedIndex = 0;
  702. if (goodsLevelTypeId > 0) $('#产品分级').val(goodsLevelTypeId);
  703. jsonGoodsLevel = data["rows"];
  704. //更新按钮状态
  705. goodsLevel_OnChange();
  706. //加载产品分级按钮
  707. if ($('#产品分级按钮').length > 0) {
  708. $('#产品分级按钮').html('');
  709. for (var i = 0; i < jsonGoodsLevel.length; i++) {
  710. var temp = $('#产品分级按钮模板').html().replaceAll('{id}', data["rows"][i]["DEFECTFLAGID"]).replaceAll('{text}', data["rows"][i]["DEFECTFLAGNAME"]);
  711. if (data["rows"][i]["DEFECTFLAGID"] != goodsLevelTypeId)
  712. temp = temp.replaceAll('active', '');
  713. $('#产品分级按钮').append(temp);
  714. }
  715. }
  716. }
  717. });
  718. //加载产品返工工序
  719. xuwell.loadSelect({
  720. id: '#返工工序',
  721. url: 'api/GetProductCheckReworkProcedure_WCF.ashx',
  722. data: { 'id': procedureId },
  723. fieldKey: 'REWORKPROCEDUREID',
  724. fieldValue: 'REWORKPROCEDURENAME',
  725. onLoad: function () {
  726. $('#返工工序').get(0).selectedIndex = 0;
  727. if (reworkProcedureId > 0) $('#返工工序').val(reworkProcedureId);
  728. }
  729. });
  730. //备注可用
  731. $('#产品分级').val('');
  732. $('#备注').prop('disabled', false);
  733. });
  734. //=============================================================================
  735. }
  736. //加载编辑数据
  737. function loadUpdateData(productionDataCheckID) {
  738. if (action == "update") {
  739. //读取产品编辑ID
  740. $.get('api/GetProductionData_WCF.ashx', { 'BarCode': $('#产品条码').val(), 'ProcedureID': procedureId, 'userCode': $('#生产工号').val() }, function (data) {
  741. var json = JSON.parse(data);
  742. if (json["success"] == true) {
  743. //记录成检数据ID
  744. if (json["rows"].toString() != "") productionDataID = json["rows"][0]["PRODUCTIONDATAID"];
  745. //xuwei add 2020-03-23 回收后成检数据ID变更
  746. if (productionDataCheckID != 0) productionDataID = productionDataCheckID;
  747. //读取成检数据
  748. $.get('api/GetProductionDataByID_WCF.ashx', { 'productionDataID': productionDataID }, function (data) {
  749. swal.close();
  750. var json = JSON.parse(data);
  751. //读取产品信息 xuwei add 2020-03-23
  752. $('#产品商标').val('商标:' + json["rows"]["PDAProductionData"][0]["LogoName"]);
  753. $('#产品釉料').val('釉料:' + json["rows"]["PDAProductionData"][0]["GlazeName"]);
  754. $('#产品编码').val(json["rows"]["PDAProductionData"][0]["GoodsCode"]);
  755. $('#产品名称').val(json["rows"]["PDAProductionData"][0]["GoodsName"]);
  756. $('#重烧').val('重烧:' + json["rows"]["PDAProductionData"][0]["IsReFire"]);
  757. $('#干补').val('干补:' + json["rows"]["PDAProductionData"][0]["SpecialRepairflag"]);
  758. if (json["success"] == true) {
  759. //加载产品分级
  760. xuwell.loadSelect({
  761. id: '#产品分级',
  762. url: 'api/GetProductCheckGoodsGrade_WCF.ashx',
  763. data: {},
  764. fieldKey: 'DEFECTFLAGID',
  765. fieldValue: 'DEFECTFLAGNAME',
  766. onLoad: function (data) {
  767. $('#产品分级').val(json["rows"]["PDAProductionData"][0]["DefectFlagID"]);
  768. jsonGoodsLevel = data["rows"];
  769. //加载产品分级按钮
  770. if ($('#产品分级按钮').length > 0) {
  771. $('#产品分级按钮').html('');
  772. for (var i = 0; i < jsonGoodsLevel.length; i++) {
  773. var temp = $('#产品分级按钮模板').html().replaceAll('{id}', data["rows"][i]["DEFECTFLAGID"]).replaceAll('{text}', data["rows"][i]["DEFECTFLAGNAME"]);
  774. if (data["rows"][i]["DEFECTFLAGID"] != json["rows"]["PDAProductionData"][0]["DefectFlagID"])
  775. temp = temp.replaceAll('active', '');
  776. $('#产品分级按钮').append(temp);
  777. }
  778. }
  779. //判定是否超过改判时间
  780. $.get('api/GetSystemSettingDataByCode_WCF.ashx', function (data) {
  781. var json = JSON.parse(data);
  782. if (json["success"] == true) {
  783. var value = json["rows"][0]["SETTINGVALUE"];
  784. //判断是否超过改判时间
  785. //正常 value=0 是不限制 但是按PDA逻辑 使用接口再进行判定
  786. var createTime = jsonProductData["CreateTime"];
  787. $.post('api/BarcodeAllowCancel_WCF.ashx', { 'orgTime': createTime, 'days': value }, function (data) {
  788. var json = JSON.parse(data);
  789. if (json["success"] == true) {
  790. //更新按钮状态
  791. goodsLevel_OnChange();
  792. $('#产品分级保存按钮').prop('disabled', false);
  793. $('#备注').prop('disabled', false);
  794. }
  795. else {
  796. $('#产品分级').prop("disabled", true);
  797. $("[delbutton='true']").prop("disabled", true);
  798. swal({
  799. title: "产品分级",
  800. text: "产品已过系统改判时间!",
  801. icon: "warning",
  802. button: "确定"
  803. });
  804. }
  805. });
  806. }
  807. });
  808. }
  809. });
  810. //加载产品返工工序
  811. xuwell.loadSelect({
  812. id: '#返工工序',
  813. url: 'api/GetProductCheckReworkProcedure_WCF.ashx',
  814. data: { 'id': procedureId },
  815. fieldKey: 'REWORKPROCEDUREID',
  816. fieldValue: 'REWORKPROCEDURENAME',
  817. autoDisabled: false,
  818. onLoad: function () {
  819. $('#返工工序').val(json["rows"]["PDAProductionData"][0]["ReworkProcedureID"]);
  820. }
  821. });
  822. //加载分级数据
  823. $('#备注').val(json["rows"]["PDAProductionData"][0]["Remarks"]);
  824. //记录修改数据
  825. jsonProductData = json["rows"]["PDAProductionData"][0];
  826. //加载缺陷数据
  827. var defect = json["rows"]["PDAProductionData"][0]["PDADefects"];
  828. for (var i = 0; i < defect.length; i++) {
  829. //更新数据模板并添加记录
  830. var temp = $('#缺陷列表模板').html();
  831. if (i == 0) $('#产品缺陷列表').empty();
  832. temp = temp.replaceAll('{缺陷标识}', i);
  833. temp = temp.replaceAll('{缺陷编码}', defect[i]["DefectCode"]);
  834. temp = temp.replaceAll('{缺陷名称}', defect[i]["DefectName"]);
  835. temp = temp.replaceAll('{位置编码}', defect[i]["DefectPositionCode"]);
  836. temp = temp.replaceAll('{缺陷位置}', defect[i]["DefectPositionName"]);
  837. temp = temp.replaceAll('{责任工序}', defect[i]["DefectProcedureName"]);
  838. temp = temp.replaceAll('{责任工号}', defect[i]["DefectUserCode"]);
  839. temp = temp.replaceAll('{责任工种}', defect[i]["Jobs"] + defect[i]["JobsText"]);
  840. temp = temp.replaceAll('{责任人}', getDefectUserNameFromDefect(defect[i]));
  841. temp = temp.replaceAll('{缺陷扣罚}', defect[i]["DefectFineValue"]);
  842. temp = temp.replaceAll('{扣除数}', defect[i]["DefectDeductionNum"]);
  843. temp = temp.replaceAll('{特殊缺陷}', defect[i]["SpecialDefect"]);
  844. $('#产品缺陷列表').append(temp);
  845. //加载缺陷数据用于提交
  846. productDefectLoadJson(defect[i]);
  847. }
  848. }
  849. });
  850. }
  851. });
  852. }
  853. }
  854. //产品分级 改变连动处理
  855. function goodsLevel_OnChange() {
  856. if ($("#产品分级").val() != '') {
  857. //重烧能选择返工工序
  858. if ($("#产品分级").find("option:selected").text() == '重烧') {
  859. $('#返工工序').prop('disabled', false);
  860. $('#返工工序').get(0).selectedIndex = 1;
  861. }
  862. else {
  863. $('#返工工序').prop('disabled', true);
  864. $("#返工工序").val('');
  865. }
  866. //缺陷页控制
  867. if ($("#产品分级").find("option:selected").text() == '正品') {
  868. //如果有缺陷记录要确认是否删除
  869. if (productionDefects.length > 0) {
  870. swal({
  871. title: "产品分级",
  872. text: "产品分级改判为正品,必须除缺陷记录!",
  873. icon: "warning",
  874. buttons: true,
  875. dangerMode: true,
  876. buttons: ["取消", "删除缺陷记录"]
  877. }).then((ok) => {
  878. if (ok) {
  879. $("#返工工序").val('');
  880. $('#返工工序').prop('disabled', true);
  881. //产品缺陷列表清空
  882. ClearProductDefectList();
  883. resetSaveButton();
  884. }
  885. });
  886. }
  887. else {
  888. //产品缺陷列表清空
  889. ClearProductDefectList();
  890. }
  891. }
  892. else {
  893. $('#产品分级保存按钮').prop('disabled', true);
  894. }
  895. //更新保存按钮
  896. resetSaveButton();
  897. }
  898. else {
  899. $('#产品分级保存按钮').prop('disabled', true);
  900. }
  901. }
  902. //启用禁用 产品分级 保存按钮
  903. function resetSaveButton() {
  904. //保存按钮控制 正品没有缺陷记录可保存,非正品必须有缺陷记录才可保存
  905. if ($("#产品分级").find("option:selected").text() == '正品') {
  906. if (productionDefects.length == 0)
  907. $('#产品分级保存按钮').prop('disabled', false);
  908. else
  909. $('#产品分级保存按钮').prop('disabled', true);
  910. //重置产品缺陷选择
  911. resetProductDefect(true);
  912. }
  913. else {
  914. if (productionDefects.length > 0)
  915. $('#产品分级保存按钮').prop('disabled', false);
  916. else
  917. $('#产品分级保存按钮').prop('disabled', true);
  918. //重置产品缺陷选择
  919. resetProductDefect(false);
  920. }
  921. }
  922. //启用禁用 产品分级 页
  923. function resetGoodsGrade(clearBarCode) {
  924. //产品信息清空
  925. $('#产品商标').val('');
  926. $('#产品釉料').val('');
  927. $('#产品编码').val('');
  928. $('#产品名称').val('');
  929. $('#重烧').val('');
  930. $('#干补').val('');
  931. //产品分级选项清空禁用
  932. $('#产品分级').val('');
  933. $('#产品分级').prop('disabled', true);
  934. $('#返工工序').val('');
  935. $('#返工工序').prop('disabled', true);
  936. $('#备注').val('');
  937. $('#备注').prop('disabled', true);
  938. $('#产品分级保存按钮').prop('disabled', true);
  939. //产品缺陷禁用
  940. resetProductDefect(true);
  941. if (clearBarCode) $('#产品条码').val('');
  942. $('#产品条码').focus();
  943. }
  944. //启用禁用 产品缺陷 页
  945. function resetProductDefect(disabled) {
  946. if (disabled) {
  947. $('#缺陷名称').val('');
  948. $('#选择缺陷按钮').prop('disabled', true);
  949. $('#缺陷位置').val('');
  950. $('#选择位置按钮').prop('disabled', true);
  951. $('#特殊缺陷').val('');
  952. $('#特殊缺陷').prop('disabled', true);
  953. $('#责任工序').val('');
  954. $('#责任工序').prop('disabled', true);
  955. $('#责任工号').val('');
  956. $('#责任工号').prop('disabled', true);
  957. $('#责任工号按钮').prop('disabled', true);
  958. $('#责任工种').val('');
  959. $('#责任工种').prop('disabled', true);
  960. $('#责任人').val('');
  961. $('#责任人').prop('disabled', true);
  962. $('#责任人').selectpicker('refresh');
  963. $('#缺陷扣罚').val('');
  964. $('#缺陷扣罚').prop('disabled', true);
  965. $('#扣除数').val('');
  966. $('#扣除数').prop('disabled', true);
  967. $('#产品缺陷保存按钮').prop('disabled', true);
  968. $('#产品缺陷保存按钮多次').prop('disabled', true);
  969. }
  970. else {
  971. $('#缺陷名称').val('');
  972. $('#选择缺陷按钮').prop('disabled', false);
  973. $('#缺陷位置').val('');
  974. $('#选择位置按钮').prop('disabled', false);
  975. $('#特殊缺陷').val('');
  976. //$('#特殊缺陷').prop('disabled', false);
  977. $('#责任工序').val('');
  978. //$('#责任工序').prop('disabled', false);
  979. $('#责任工号').val('');
  980. //$('#责任工号').prop('disabled', false);
  981. //$('#责任工号按钮').prop('disabled', false);
  982. $('#责任工种').val('');
  983. //$('#责任工种').prop('disabled', false);
  984. $('#责任人').val('');
  985. //$('#责任人').prop('disabled', false);
  986. $('#责任人').selectpicker('refresh');
  987. $('#缺陷扣罚').val('');
  988. //$('#缺陷扣罚').prop('disabled', false);
  989. $('#扣除数').val('');
  990. //$('#扣除数').prop('disabled', false);
  991. $('#产品缺陷保存按钮').prop('disabled', true);
  992. $('#产品缺陷保存按钮多次').prop('disabled', true);
  993. }
  994. //中陶 只有一个缺陷位置 默认选中第一项=================
  995. if (productDefectPositionData['rows'].length > 0) {
  996. productDefectPositionId = productDefectPositionData['rows'][0]['DEFECTPOSITIONID'];
  997. productDefectPositionCode = productDefectPositionData['rows'][0]['DEFECTPOSITIONCODE'];
  998. productDefectPositionName = productDefectPositionData['rows'][0]['DEFECTPOSITIONNAME'];
  999. $('#缺陷位置').val(productDefectPositionName);
  1000. }
  1001. //=======================================================
  1002. }
  1003. //加载 责任工序
  1004. function loadDefectProcedure() {
  1005. //加载责任工序
  1006. xuwell.loadSelect({
  1007. id: '#责任工序',
  1008. url: 'api/GetDutyProcedureByBarCode_WCF.ashx',
  1009. data: {
  1010. 'barcode': $('#产品条码').val(),
  1011. 'defectid': productDefectId
  1012. },
  1013. fieldKey: 'DUTYPROCEDUREID',
  1014. fieldValue: 'DUTYPROCEDURENAME',
  1015. onLoad: function (data) {
  1016. jsonProcedure = data['rows'];
  1017. }
  1018. });
  1019. //加载缺限扣罚
  1020. xuwell.loadSelect({
  1021. id: '#缺陷扣罚',
  1022. //url: 'api/GetAllDefectFine_WCF.ashx',
  1023. url: 'api/GetDefectFine.ashx',
  1024. data: { 'defectid': productDefectId },
  1025. fieldKey: 'DEFECTFINEID',
  1026. fieldValue: 'DEFECTFINECODE',
  1027. onLoad: function () {
  1028. $('#缺陷扣罚').get(0).selectedIndex = 1;
  1029. }
  1030. });
  1031. //加载扣除数
  1032. xuwell.loadSelect({
  1033. id: '#扣除数',
  1034. //url: 'api/GetAllDefectDeduction_WCF.ashx',
  1035. url: 'api/GetDefectDeduction.ashx',
  1036. data: { 'defectid': productDefectId },
  1037. fieldKey: 'DEFECTDEDUCTIONID',
  1038. fieldValue: 'DEFECTDEDUCTIONNUM',
  1039. onLoad: function () {
  1040. $('#扣除数').get(0).selectedIndex = 1;
  1041. }
  1042. });
  1043. $('#特殊缺陷').val('0');
  1044. $('#特殊缺陷').prop('disabled', false);
  1045. $('#责任工号按钮').prop('disabled', false);
  1046. $('#责任工号').prop('disabled', false);
  1047. $('#责任工号').val('');
  1048. $('#责任工种').prop('disabled', true);
  1049. $('#责任工种').val('');
  1050. $('#责任人').prop('disabled', true);
  1051. $('#责任人').val('');
  1052. }
  1053. //责任工序 改变连动处理
  1054. function defectProcedure_OnChange() {
  1055. var selectIndex = $('#责任工序').prop("selectedIndex");
  1056. if (selectIndex > 0) {
  1057. //加载责任工号
  1058. $('#责任工号按钮').prop('disabled', true);
  1059. $('#责任工号').prop('disabled', true);
  1060. $('#责任工号').val(jsonProcedure[selectIndex - 1]['USERCODE']);
  1061. defectUserId = jsonProcedure[selectIndex - 1]['USERID'];
  1062. //加载责任工种
  1063. xuwell.loadSelect({
  1064. id: '#责任工种',
  1065. url: 'api/GetDutyJobsByUserIDAndProductionID_WCF.ashx',
  1066. data: {
  1067. 'classesSettingID': jsonProcedure[selectIndex - 1]['CLASSESSETTINGID'],
  1068. 'defectid': productDefectId,
  1069. 'procedureID': jsonProcedure[selectIndex - 1]['DUTYPROCEDUREID']
  1070. },
  1071. fieldKey: 'JOBSID',
  1072. fieldValue: 'JOBSNAME',
  1073. onLoad: function (data) {
  1074. $('#责任工种').get(0).selectedIndex = 1;
  1075. }
  1076. });
  1077. //加载责任人
  1078. xuwell.loadSelect({
  1079. id: '#责任人',
  1080. url: 'api/GetDutyStaffByUserIDAndJobs_WCF.ashx',
  1081. data: {
  1082. 'classesSettingID': jsonProcedure[selectIndex - 1]['CLASSESSETTINGID'],
  1083. 'jobsid': jsonProcedure[selectIndex - 1]['JOBSID']
  1084. },
  1085. fieldKey: 'STAFFID',
  1086. fieldValue: 'STAFFNAME',
  1087. addTitle: false,
  1088. onLoad: function (data) {
  1089. jsonStaff = data["rows"];
  1090. //$('#责任人').get(0).selectedIndex = '1,2';
  1091. $("#责任人").selectpicker({
  1092. selectedTextFormat: 'values',
  1093. });
  1094. $('#责任人').selectpicker('refresh');
  1095. $('#责任人').selectpicker('selectAll');
  1096. }
  1097. });
  1098. }
  1099. else {
  1100. $('#责任工号按钮').prop('disabled', false);
  1101. $('#责任工号').prop('disabled', false);
  1102. $('#责任工号').val('');
  1103. $('#责任工种').prop('disabled', true);
  1104. $('#责任工种').val('');
  1105. $('#责任人').prop('disabled', true);
  1106. //$('#责任人').val('');
  1107. $('#责任人').selectpicker('val', []);
  1108. }
  1109. }
  1110. //加载 责任工种 从 责任工号(无责任)
  1111. function loadDefectByUserCode() {
  1112. //查找userId
  1113. $.get('api/GetUserCode_WCF.ashx', { 'usercode': $('#责任工号').val() }, function (data) {
  1114. var json = JSON.parse(data);
  1115. if (json['success'] == true && json['rows'].length > 0) {
  1116. userId = json['rows'][0]['USERID'];
  1117. defectUserId = json['rows'][0]['USERID'];
  1118. //加载责任工种
  1119. xuwell.loadSelect({
  1120. id: '#责任工种',
  1121. url: 'api/GetAllJobsByUserID_WCF.ashx',
  1122. data: { 'userid': userId },
  1123. fieldKey: 'JOBS',
  1124. fieldValue: 'JOBSNAME',
  1125. onLoad: function (data) {
  1126. $('#责任工种').get(0).selectedIndex = 1;
  1127. //加载责任人
  1128. defectJobs_OnChange();
  1129. }
  1130. });
  1131. }
  1132. else {
  1133. swal({
  1134. title: "工号查询",
  1135. text: "工号不正确!",
  1136. icon: "error",
  1137. button: "确定"
  1138. });
  1139. }
  1140. });
  1141. }
  1142. //责任工种 改变连动处理
  1143. function defectJobs_OnChange() {
  1144. //没有选择责任工序 通过责任工种 查找 责任人
  1145. if ($('#责任工序').val() == '') {
  1146. //加载责任人
  1147. if ($('#责任工种').val() != '') {
  1148. xuwell.loadSelect({
  1149. id: '#责任人',
  1150. url: 'api/GetDutyStaffByUserJobsID_WCF.ashx',
  1151. data: {
  1152. 'userid': userId,
  1153. 'jobs': $('#责任工种').val()
  1154. },
  1155. fieldKey: 'STAFFID',
  1156. fieldValue: 'STAFFNAME',
  1157. addTitle: false,
  1158. onLoad: function (data) {
  1159. jsonStaff = data["rows"];
  1160. //$('#责任人').get(0).selectedIndex = 1;
  1161. $('#责任人').selectpicker('refresh');
  1162. $('#责任人').selectpicker('selectAll');
  1163. },
  1164. onError: function () {
  1165. $('#责任人').val('');
  1166. $('#责任人').prop('disabled', true);
  1167. $('#责任人').selectpicker('refresh');
  1168. }
  1169. });
  1170. }
  1171. else {
  1172. $('#责任人').val('');
  1173. $('#责任人').prop('disabled', true);
  1174. $('#责任人').selectpicker('refresh');
  1175. }
  1176. }
  1177. }
  1178. //单次保存
  1179. function productDefectSaveOne() {
  1180. if (productDefectSave()) {
  1181. //重设缺陷编辑状态 可继续添加缺陷
  1182. resetProductDefect(true);
  1183. //$('#缺陷名称').val('');
  1184. $('#选择缺陷按钮').prop('disabled', false);
  1185. //$('#缺陷位置').val('');
  1186. $('#选择位置按钮').prop('disabled', false);
  1187. //更新产品分级保存按钮
  1188. $('#产品分级保存按钮').prop('disabled', false);
  1189. }
  1190. }
  1191. //多次保存
  1192. function productDefectSaveMore() {
  1193. if (productDefectSave()) {
  1194. $('#责任工序').val('');
  1195. defectProcedure_OnChange();
  1196. //更新产品分级保存按钮
  1197. $('#产品分级保存按钮').prop('disabled', false);
  1198. }
  1199. }
  1200. //保存产品缺陷记录处理
  1201. function productDefectSave() {
  1202. //校验填写数据
  1203. if ($('#缺陷名称').val() == '') {
  1204. swal({
  1205. title: "产品缺陷",
  1206. text: '请您选择缺陷名称!',
  1207. icon: "error",
  1208. button: "确定"
  1209. });
  1210. return false;
  1211. }
  1212. if ($('#缺陷位置').val() == '') {
  1213. swal({
  1214. title: "产品缺陷",
  1215. text: '请您选择缺陷位置!',
  1216. icon: "error",
  1217. button: "确定"
  1218. });
  1219. return false;
  1220. }
  1221. if ($('#责任工序').val() == '' && $('#责任工号').val() == '') {
  1222. swal({
  1223. title: "产品缺陷",
  1224. text: '请您选择责任工序或者填写责任工号!',
  1225. icon: "error",
  1226. button: "确定"
  1227. });
  1228. return false;
  1229. }
  1230. if ($('#责任工种').val() == '') {
  1231. swal({
  1232. title: "产品缺陷",
  1233. text: '请您选择责任工种!',
  1234. icon: "error",
  1235. button: "确定"
  1236. });
  1237. return false;
  1238. }
  1239. if ($('#责任人').val() == '') {
  1240. swal({
  1241. title: "产品缺陷",
  1242. text: '请您选择责任人!',
  1243. icon: "error",
  1244. button: "确定"
  1245. });
  1246. return false;
  1247. }
  1248. if ($('#缺陷扣罚').val() == '') {
  1249. swal({
  1250. title: "产品缺陷",
  1251. text: '请您选择缺陷扣罚!',
  1252. icon: "error",
  1253. button: "确定"
  1254. });
  1255. return false;
  1256. }
  1257. if ($('#扣除数').val() == '') {
  1258. swal({
  1259. title: "产品缺陷",
  1260. text: '请您选择扣除数!',
  1261. icon: "error",
  1262. button: "确定"
  1263. });
  1264. return false;
  1265. }
  1266. if ($('#特殊缺陷').val() == '') {
  1267. swal({
  1268. title: "产品缺陷",
  1269. text: '请您选择特殊缺陷!',
  1270. icon: "error",
  1271. button: "确定"
  1272. });
  1273. return false;
  1274. }
  1275. //判断缺陷是否重复 2020-04-24
  1276. for (var i = 0; i < productionDefects.length; i++) {
  1277. if (
  1278. productionDefects[i]["DefectID"] == productDefectId
  1279. && productionDefects[i]["DefectProcedureID"] == ($('#责任工序').val() == "" ? null : $('#责任工序').val())
  1280. && productionDefects[i]["DefectUserCode"] == $("#责任工号").val()
  1281. ) {
  1282. swal({
  1283. title: "产品缺陷",
  1284. text: '缺陷重复,不允许添加!',
  1285. icon: "error",
  1286. button: "确定"
  1287. });
  1288. return false;
  1289. }
  1290. }
  1291. //更新数据模板并添加记录
  1292. var temp = $('#缺陷列表模板').html();
  1293. if (defectCount == 0) $('#产品缺陷列表').empty();
  1294. temp = temp.replaceAll('{缺陷标识}', defectCount);
  1295. temp = temp.replaceAll('{缺陷编码}', productDefectCode);
  1296. temp = temp.replaceAll('{缺陷名称}', $('#缺陷名称').val());
  1297. temp = temp.replaceAll('{位置编码}', productDefectPositionCode);
  1298. temp = temp.replaceAll('{缺陷位置}', $('#缺陷位置').val());
  1299. temp = temp.replaceAll('{责任工序}', $("#责任工序").val() == '' ? '' : $("#责任工序").find("option:selected").text());
  1300. temp = temp.replaceAll('{责任工号}', $('#责任工号').val());
  1301. temp = temp.replaceAll('{责任工种}', $('#责任工种').val() + $('#责任工种').find("option:selected").text());
  1302. temp = temp.replaceAll('{责任人}', getDefectUserName());
  1303. temp = temp.replaceAll('{缺陷扣罚}', $('#缺陷扣罚').find("option:selected").text());
  1304. temp = temp.replaceAll('{扣除数}', $('#扣除数').find("option:selected").text());
  1305. temp = temp.replaceAll('{特殊缺陷}', $('#特殊缺陷').find("option:selected").text());
  1306. $('#产品缺陷列表').append(temp);
  1307. //保存缺陷数据
  1308. productDefectSaveJson();
  1309. return true;
  1310. }
  1311. //保存产品缺陷记录拼合处理
  1312. function productDefectSaveJson() {
  1313. //定义缺陷责任
  1314. var defectResponsibles = [];
  1315. //获取责任人
  1316. console.log($("#责任人").selectpicker('val'));
  1317. console.log(jsonStaff);
  1318. for (var i = 0; i < jsonStaff.length; i++) {
  1319. if ($("#责任人").selectpicker('val').indexOf(jsonStaff[i]["STAFFID"].toString()) >= 0) {
  1320. var defectOne = {
  1321. "UserID": defectUserId,
  1322. "UserCode": $("#责任工号").val(),
  1323. "SJobsID": jsonStaff[i]["SJOBSID"],
  1324. "StaffStatus": jsonStaff[i]["STAFFSTATUS"],
  1325. "StaffID": jsonStaff[i]["STAFFID"],
  1326. "UJobsID": $("#责任工种").val()
  1327. }
  1328. //如果是更新
  1329. if (action == "update") {
  1330. if (jsonProductData["PDADefects"].length > 0)
  1331. defectOne["PDACheckTime"] = jsonProductData["PDADefects"][0]["CheckTime"];
  1332. }
  1333. defectResponsibles.push(defectOne);
  1334. }
  1335. }
  1336. //定义缺陷数据
  1337. var productionOne = {
  1338. "DefectID": productDefectId,
  1339. "DefectCode": productDefectCode,
  1340. "DefectName": productDefectName,
  1341. "DefectPositionID": productDefectPositionId,
  1342. "DefectPositionCode": productDefectPositionCode,
  1343. "DefectPositionName": productDefectPositionName,
  1344. "DefectProcedureID": $('#责任工序').val() == "" ? null : $('#责任工序').val(),
  1345. "DefectProcedureCode": $('#责任工序').val() != "" ? jsonProcedure[$('#责任工序').get(0).selectedIndex - 1]["DUTYPROCEDURECODE"] : "",
  1346. "DefectProcedureName": $('#责任工序').val() != "" ? $("#责任工序").find("option:selected").text() : "",
  1347. "DefectUserID": $('#责任工序').val() != "" ? jsonProcedure[$('#责任工序').get(0).selectedIndex - 1]["USERID"] : defectUserId,
  1348. "DefectUserCode": $("#责任工号").val(),
  1349. "DefectUserName": $('#责任工序').val() != "" ? jsonProcedure[$('#责任工序').get(0).selectedIndex - 1]["USERNAME"] : "",
  1350. "DefectJobs": $("#责任工种").val(),
  1351. "DefectFine": $("#缺陷扣罚").val(),
  1352. "DefectDeductionNum": $("#扣除数").val(),
  1353. "SpecialDefect": $("#特殊缺陷").val(),
  1354. "IsPDA": "1",
  1355. "DefectResponsibles": defectResponsibles,
  1356. }
  1357. //如果是更新
  1358. if (action == "update") {
  1359. if (jsonProductData["PDADefects"].length > 0)
  1360. productionOne["PDACheckTime"] = jsonProductData["PDADefects"][0]["CheckTime"];
  1361. }
  1362. productionDefects.push(productionOne);
  1363. defectCount++;
  1364. }
  1365. //加载产品缺陷记录从编辑数据
  1366. function productDefectLoadJson(json) {
  1367. console.log(json);
  1368. //定义缺陷责任
  1369. var defectResponsibles = [];
  1370. for (var i = 0; i < json["PDADefectResponsibles"].length; i++) {
  1371. var defectOne = {
  1372. "UserID": json["DefectUserID"],
  1373. "UserCode": json["DefectUserCode"],
  1374. "SJobsID": json["PDADefectResponsibles"][i]["SJobsID"],
  1375. "StaffStatus": json["PDADefectResponsibles"][i]["StaffStatus"],
  1376. "StaffID": json["PDADefectResponsibles"][i]["StaffID"],
  1377. "UJobsID": json["PDADefectResponsibles"][i]["UJobsID"],
  1378. //只有编辑时使用
  1379. "PDACheckTime": json["CheckTime"]
  1380. }
  1381. defectResponsibles.push(defectOne);
  1382. }
  1383. //定义缺陷数据
  1384. var productionOne = {
  1385. "DefectID": json["DefectID"],
  1386. "DefectCode": json["DefectCode"],
  1387. "DefectName": json["DefectName"],
  1388. "DefectPositionID": json["DefectPositionID"],
  1389. "DefectPositionCode": json["DefectPositionCode"],
  1390. "DefectPositionName": json["DefectPositionName"],
  1391. "DefectProcedureID": json["DefectProcedureID"],
  1392. "DefectProcedureCode": json["DefectProcedureCode"],
  1393. "DefectProcedureName": json["DefectProcedureName"],
  1394. "DefectUserID": json["DefectUserID"],
  1395. "DefectUserCode": json["DefectUserCode"],
  1396. "DefectUserName": json["DefectUserName"],
  1397. "DefectJobs": json["Jobs"].toString(),
  1398. "DefectFine": json["DefectFineID"],
  1399. "DefectDeductionNum": json["DefectDeductionNum"],
  1400. "SpecialDefect": json["SpecialDefect"],
  1401. "IsPDA": "1",
  1402. "DefectResponsibles": defectResponsibles,
  1403. //只有编辑时使用
  1404. "PDACheckTime": json["CheckTime"]
  1405. }
  1406. productionDefects.push(productionOne);
  1407. defectCount++;
  1408. }
  1409. //获取责任人多选值用|分隔 从当前选项
  1410. function getDefectUserName() {
  1411. var s = $("#责任人").find("option:selected");
  1412. var username = "";
  1413. for (var i = 0; i < s.length; i++) {
  1414. if (i > 0) username += "|";
  1415. username += $("#责任人").find("option:selected")[i].innerText;
  1416. }
  1417. return username;
  1418. }
  1419. //获取责任人多选值用|分隔 从数据
  1420. function getDefectUserNameFromDefect(json) {
  1421. var username = "";
  1422. for (var i = 0; i < json["PDADefectResponsibles"].length; i++) {
  1423. if (username != "") username += "|";
  1424. username += json["PDADefectResponsibles"][i]["StaffName"]
  1425. }
  1426. return username;
  1427. }
  1428. //删除缺陷记录按钮处理
  1429. function productDefectDelete(id) {
  1430. swal({
  1431. title: "产品缺陷",
  1432. text: "您确定要删除缺陷记录吗?",
  1433. icon: "warning",
  1434. buttons: true,
  1435. dangerMode: true,
  1436. buttons: ["取消", "确定"]
  1437. }).then((save) => {
  1438. if (save) {
  1439. $('#' + id).remove();
  1440. productionDefects.splice(parseInt(id), 1);
  1441. defectCount--;
  1442. if (defectCount == 0) {
  1443. ClearProductDefectList();
  1444. //更新产品分级保存按钮
  1445. resetSaveButton();
  1446. }
  1447. }
  1448. });
  1449. }
  1450. //选择缺陷按钮点击处理
  1451. function productDefect_OnClick(id) {
  1452. dialogDefectShow(function () {
  1453. $('#缺陷名称').val(productDefectName);
  1454. loadDefectProcedure();
  1455. $('#产品缺陷保存按钮').prop('disabled', false);
  1456. $('#产品缺陷保存按钮多次').prop('disabled', false);
  1457. });
  1458. }
  1459. //选择缺陷位置按钮点击处理
  1460. function productDefectPosition_OnClick(id) {
  1461. dialogDefectPositionShow(function () {
  1462. $('#缺陷位置').val(productDefectPositionName);
  1463. //loadDefectProcedure();
  1464. //$('#产品缺陷保存按钮').prop('disabled', false);
  1465. //$('#产品缺陷保存按钮多次').prop('disabled', false);
  1466. });
  1467. }
  1468. //保存产品分级
  1469. function productSave() {
  1470. //校验填写数据
  1471. if ($("#产品分级").val() == '') {
  1472. swal({
  1473. title: "产品分级",
  1474. text: "请您选择产品分级!",
  1475. icon: "error",
  1476. button: "确定"
  1477. });
  1478. return;
  1479. }
  1480. if ($("#产品分级").find("option:selected").text() == '正品' && productionDefects.length > 0) {
  1481. swal({
  1482. title: "产品分级",
  1483. text: "产品分级为正品,不能有缺陷记录!",
  1484. icon: "error",
  1485. button: "确定"
  1486. });
  1487. return;
  1488. }
  1489. if ($("#产品分级").find("option:selected").text() != '正品' && productionDefects.length == 0) {
  1490. swal({
  1491. title: "产品分级",
  1492. text: "产品分级为非正品,必须填写缺陷记录!",
  1493. icon: "error",
  1494. button: "确定"
  1495. });
  1496. return;
  1497. }
  1498. if ($("#产品分级").find("option:selected").text() == '重烧' && $("#返工工序").val() == '') {
  1499. swal({
  1500. title: "产品分级",
  1501. text: "请您选择返工工序!",
  1502. icon: "error",
  1503. button: "确定"
  1504. });
  1505. return;
  1506. }
  1507. //保存产品分级 带确认提示
  1508. swal({
  1509. title: "产品分级",
  1510. text: "您确定要保存产品分级数据吗?",
  1511. icon: "warning",
  1512. dangerMode: true,
  1513. buttons: ["取消","确定"]
  1514. }).then((ok) => {
  1515. if (ok) {
  1516. swal({
  1517. title: '产品分级',
  1518. text: '正在保存数据,请稍候。。。',
  1519. icon: 'info',
  1520. button: false,
  1521. closeOnClickOutside: false
  1522. });
  1523. save(ok);
  1524. }
  1525. });
  1526. //保存产品分级 不带确认提示
  1527. //swal("正在保存产品分级...", {
  1528. // buttons: false,
  1529. // timer: 3000,
  1530. //});
  1531. //save(true);
  1532. }
  1533. function save(ok) {
  1534. if (ok) {
  1535. //生成时间戳避免重复提交
  1536. var dataKey = new Date().getTime() + '-' + $('#生产工号').val();
  1537. console.log(dataKey);
  1538. var productionDataEntitys;
  1539. //拼合插入数据
  1540. if (action == "insert") {
  1541. productionDataEntitys = [{
  1542. "DataKey": dataKey,
  1543. "CheckFlag": checkFlag,
  1544. "UserID": jsonUser["userId"],
  1545. "UserCode": jsonUser["userCode"],
  1546. "UserName": jsonUser["userName"],
  1547. "Barcode": $('#产品条码').val(),
  1548. "GoodsLevelID": jsonGoodsLevel[$('#产品分级').get(0).selectedIndex - 1]["DEFECTFLAGID"],
  1549. "GoodsLevelTypeID": jsonGoodsLevel[$('#产品分级').get(0).selectedIndex - 1]["GOODSLEVELTYPEID"],
  1550. "ReworkProcedureID": parseInt($('#返工工序').val()),
  1551. "ReworkProcedureName": $('#返工工序').val() == "" ? "" : $("#返工工序").find("option:selected").text(),
  1552. "DefectFlag": $("#产品分级").find("option:selected").text() == "正品" ? 1 : 2,
  1553. "Remarks": $('#备注').val(),
  1554. "IsPDA": 1,
  1555. "ProductionDefects": productionDefects,
  1556. "OPTimeStampPDA": completeProcedure[0]["CONVERTOPTIMESTAMP"]
  1557. }];
  1558. }
  1559. //拼合更新数据
  1560. if (action == "update") {
  1561. productionDataEntitys = [{
  1562. "DataKey": dataKey,
  1563. "CheckFlag": checkFlag,
  1564. "UserID": jsonUser["userId"],
  1565. "UserCode": jsonUser["userCode"],
  1566. "UserName": jsonUser["userName"],
  1567. "Barcode": $('#产品条码').val(),
  1568. "GoodsLevelID": jsonGoodsLevel[$('#产品分级').get(0).selectedIndex - 1]["DEFECTFLAGID"],
  1569. "GoodsLevelTypeID": jsonGoodsLevel[$('#产品分级').get(0).selectedIndex - 1]["GOODSLEVELTYPEID"],
  1570. "ReworkProcedureID": parseInt($('#返工工序').val()),
  1571. "ReworkProcedureName": $('#返工工序').val() == "" ? "" : $("#返工工序").find("option:selected").text(),
  1572. "DefectFlag": $("#产品分级").find("option:selected").text() == "正品" ? 1 : 2,
  1573. "Remarks": $('#备注').val(),
  1574. "IsPDA": 1,
  1575. "ProductionDefects": productionDefects,
  1576. "OPTimeStampPDA": completeProcedure[0]["CONVERTOPTIMESTAMP"],
  1577. //只有编辑时使用
  1578. "ProductionDataID": productionDataID,
  1579. "PDACheckTime": jsonProductData["CheckTime"],
  1580. "OrgGoodsLevelTypeID": jsonProductData["GoodsLevelTypeID"]
  1581. }];
  1582. }
  1583. //提交到接口
  1584. $.post('api/AddCheckBarcode_WCF.ashx', { 'procedureID': procedureId, 'productionDataEntitys': JSON.stringify(productionDataEntitys) }, function (data) {
  1585. var json = JSON.parse(data);
  1586. if (json['success'] == true) {
  1587. //打印条码
  1588. //if (printBarcode) {
  1589. // if ($("#产品分级").find("option:selected").text() == "正品"
  1590. // || $("#产品分级").find("option:selected").text() == "副品"
  1591. // ) {
  1592. // console.log(jsonGoodsLevel[$('#产品分级').get(0).selectedIndex - 1]["GOODSLEVELTYPEID"]);
  1593. // $("#printBarcode").jqprint({
  1594. // debug: false,
  1595. // importCSS: false,
  1596. // printContainer: false,
  1597. // operaSupport: false
  1598. // });
  1599. // //$("#barcodeImg").print();
  1600. // }
  1601. //}
  1602. //保存成功
  1603. swal({
  1604. title: "产品分级",
  1605. text: '保存成功!',
  1606. icon: "success",
  1607. button: "确定"
  1608. }).then((ok) => {
  1609. $("#产品条码").focus();
  1610. });
  1611. //清空数据,继续下次成检
  1612. resetGoodsGrade(true);
  1613. //产品缺陷列表清空
  1614. ClearProductDefectList();
  1615. }
  1616. else {
  1617. //保存失败
  1618. swal({
  1619. title: "产品分级",
  1620. text: '保存失败!',
  1621. icon: "error",
  1622. button: "确定"
  1623. });
  1624. }
  1625. });
  1626. }
  1627. }
  1628. </script>
  1629. <!--打印条码-->
  1630. <!--<script src="print/jquery.jqprint-0.3.js"></script>-->
  1631. <!--<div id="printBarcode" style="background-color:white;display:none">
  1632. <img id="barcodeImg"/>
  1633. </div>-->
  1634. </body>
  1635. </html>