检测开单.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport"
  6. content="width=device-width, initial-scale=1, maximum-scale=1">
  7. <title>检测开单</title>
  8. <link rel="stylesheet" href="../../layui/css/layui.css">
  9. <link rel="stylesheet" href="../../c_style/css.css">
  10. </head>
  11. <body>
  12. <div class="report-main">
  13. <h3>检测报告</h3>
  14. <div class="report-package">
  15. <label class="layui-form-label"><span
  16. class="required-red">*</span>检测套餐</label><span
  17. class="icon-question"></span>
  18. <form class="layui-form" action="">
  19. <div class="layui-input-block">
  20. <select name="city" lay-verify="required">
  21. <option value="">请选择一个城市</option>
  22. <option value="010">北京</option>
  23. <option value="021">上海</option>
  24. <option value="0571">杭州</option>
  25. </select>
  26. </div>
  27. </form>
  28. </div>
  29. <h4><i class="icon-car"></i>车辆环视图</h4>
  30. <div class="report-item ring-view">
  31. <div class="ring-view-canvas">
  32. <canvas id="canvasEle"></canvas>
  33. </div>
  34. <div class="ring-view-operation">
  35. <div class="ring-view-operation-item" type="triangle" id="triangle_btn">
  36. <i class="icon-triangle"></i>划痕
  37. </div>
  38. <div class="ring-view-operation-item" type="rift" id="rift_btn">
  39. <i class="icon-rift"></i>裂痕
  40. </div>
  41. <div class="ring-view-operation-item" type="sunken" id="sunken_btn">
  42. <i class="icon-sunken"></i>凹陷
  43. </div>
  44. <div class="ring-view-operation-item" type="damage"
  45. id="damage_btn">
  46. <i class="icon-damage"></i>损坏
  47. </div>
  48. <button onclick="saveImg()">baocun</button>
  49. </div>
  50. <div class="ring-view-right">
  51. <div class="view-container-item">
  52. <p>车辆环视图</p>
  53. <div class="view-container-item-inner">
  54. <span class="checked-ok">状态良好</span>
  55. <span>密切关注</span>
  56. <span>急需处理</span>
  57. </div>
  58. </div>
  59. <div class="view-container-item">
  60. <p>备注</p>
  61. <div class="layui-form view-container-item-inner">
  62. <div class="layui-input-inline">
  63. <input type="text" name="" placeholder="请输入" autocomplete="off"
  64. class="layui-input">
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. </div>
  70. <h4><i class="icon-lamp"></i>警示灯</h4>
  71. <div class="report-item lamp-view">
  72. <div class="lamp-view-wrapper">
  73. <span class="icon-gasbag checked"></span>
  74. <span class="icon-engine"></span>
  75. <span class="icon-battery checked"></span>
  76. <span class="icon-abs"></span>
  77. <span class="icon-oil"></span>
  78. <span class="icon-brake"></span>
  79. <span class="icon-door"></span>
  80. </div>
  81. <div class="view-container-item">
  82. <p class="message-left-abbreviation">警示灯</p>
  83. <div class="view-container-item-inner">
  84. <span>状态良好</span>
  85. <span class="checked-warning">密切关注</span>
  86. <span>急需处理</span>
  87. </div>
  88. </div>
  89. <div class="view-container-item">
  90. <p class="message-left-abbreviation">备注</p>
  91. <div class="layui-form view-container-item-inner">
  92. <div class="layui-input-inline">
  93. <input type="text" name="" placeholder="请输入" autocomplete="off"
  94. class="layui-input">
  95. </div>
  96. </div>
  97. </div>
  98. </div>
  99. <h4><i class="icon-wheel"></i>车轮相关</h4>
  100. <div class="report-item lamp-view">
  101. <h5>电器系统</h5>
  102. <div class="view-container-item">
  103. <p class="message-left-abbreviation">雨刮片</p>
  104. <div class="view-container-item-inner">
  105. <span>喷水损坏,大灯清洗异常,电机异常</span>
  106. <span class="checked-warning">1.9mm~1.7mm</span>
  107. <span>≤1.6mm</span>
  108. </div>
  109. </div>
  110. <div class="view-container-item">
  111. <p class="message-left-abbreviation">雨刮系统</p>
  112. <div class="view-container-item-inner">
  113. <span>无裂纹</span>
  114. <span>拉杆松旷,开口胶间隙过大,变形</span>
  115. <span class="checked-error">严重龟裂</span>
  116. </div>
  117. </div>
  118. <div class="view-container-item">
  119. <p class="message-left-abbreviation">胎压</p>
  120. <div class="view-container-item-inner">
  121. <span class="checked-ok">正常</span>
  122. <span>偏高</span>
  123. <span>偏低</span>
  124. <span>过高</span>
  125. <span>过低</span>
  126. </div>
  127. </div>
  128. <div class="view-container-item">
  129. <p class="message-left-abbreviation" title="冷却液字数做限制长changchangchang">
  130. 冷却液字数做限制长changchangchang</p>
  131. <div class="view-container-item-inner">
  132. <span class="checked-ok">正常</span>
  133. <span>偏高</span>
  134. <span>偏低</span>
  135. <span>过高</span>
  136. <span>过低</span>
  137. </div>
  138. </div>
  139. <div class="view-container-item">
  140. <p class="message-left-abbreviation">备注</p>
  141. <div class="layui-form view-container-item-inner">
  142. <div class="layui-input-inline">
  143. <input type="text" name="" placeholder="请输入" autocomplete="off"
  144. class="layui-input">
  145. </div>
  146. </div>
  147. </div>
  148. </div>
  149. <div class="report-item lamp-view">
  150. <h5>减震器</h5>
  151. <div class="view-container-item">
  152. <p class="message-left-abbreviation">漏油</p>
  153. <div class="view-container-item-inner">
  154. <span>无漏油</span>
  155. <span class="checked-warning">轻微漏油</span>
  156. <span>严重漏油</span>
  157. </div>
  158. </div>
  159. <div class="view-container-item">
  160. <p class="message-left-abbreviation">异响</p>
  161. <div class="view-container-item-inner">
  162. <span class="checked-ok">无异响</span>
  163. <span>有异响</span>
  164. </div>
  165. </div>
  166. <div class="view-container-item">
  167. <p class="message-left-abbreviation">备注</p>
  168. <div class="layui-form view-container-item-inner">
  169. <div class="layui-input-inline">
  170. <input type="text" name="" placeholder="请输入" autocomplete="off"
  171. class="layui-input">
  172. </div>
  173. </div>
  174. </div>
  175. </div>
  176. <h4><i class="icon-engine"></i>发动机舱</h4>
  177. <div class="report-item lamp-view">
  178. <h5>发动机油底壳放油螺丝</h5>
  179. <div class="view-container-item">
  180. <p class="message-left-abbreviation">使用年限</p>
  181. <div class="view-container-item-inner">
  182. <span>5万公里以下</span>
  183. <span class="checked-warning">5~6万公里</span>
  184. <span>超过6万公里</span>
  185. </div>
  186. </div>
  187. <div class="view-container-item">
  188. <p class="message-left-abbreviation">保养周期已归零</p>
  189. <div class="view-container-item-inner">
  190. <span class="checked-ok">无裂纹</span>
  191. <span>有裂纹</span>
  192. <span>严重龟裂</span>
  193. </div>
  194. </div>
  195. <div class="view-container-item">
  196. <p class="message-left-abbreviation">胎压(厂家半载气压)</p>
  197. <div class="view-container-item-inner">
  198. <span class="checked-ok">正常</span>
  199. <span>偏高</span>
  200. <span>偏低</span>
  201. <span>过高</span>
  202. <span>过低</span>
  203. </div>
  204. </div>
  205. <div class="view-container-item">
  206. <p class="message-left-abbreviation">备注</p>
  207. <div class="layui-form view-container-item-inner">
  208. <div class="layui-input-inline">
  209. <input type="text" name="" placeholder="请输入" autocomplete="off"
  210. class="layui-input">
  211. </div>
  212. </div>
  213. </div>
  214. </div>
  215. <div class="report-item lamp-view">
  216. <h5>火花塞</h5>
  217. <div class="view-container-item">
  218. <p class="message-left-abbreviation">使用里程</p>
  219. <div class="view-container-item-inner">
  220. <span>4万公里以下</span>
  221. <span class="checked-warning">4~6万公里</span>
  222. <span>超过6万公里</span>
  223. </div>
  224. </div>
  225. <div class="view-container-item">
  226. <p class="message-left-abbreviation">电极间隙</p>
  227. <div class="view-container-item-inner">
  228. <span>≤1.5mm</span>
  229. <span>1.6~1.9mm</span>
  230. <span>≥2.0mm</span>
  231. </div>
  232. </div>
  233. <div class="view-container-item">
  234. <p class="message-left-abbreviation">绝缘体漏电</p>
  235. <div class="view-container-item-inner">
  236. <span>无</span>
  237. <span>有漏电痕迹</span>
  238. <span>严重漏电痕迹</span>
  239. </div>
  240. </div>
  241. <div class="view-container-item">
  242. <p class="message-left-abbreviation">备注</p>
  243. <div class="layui-form view-container-item-inner">
  244. <div class="layui-input-inline">
  245. <input type="text" name="" placeholder="请输入" autocomplete="off"
  246. class="layui-input">
  247. </div>
  248. </div>
  249. </div>
  250. </div>
  251. <h4><i class="icon-chassis"></i>底盘</h4>
  252. <div class="report-item lamp-view">
  253. <h5>球笼防尘套球笼防尘套</h5>
  254. <div class="view-container-item">
  255. <p class="message-left-abbreviation">漏油</p>
  256. <div class="view-container-item-inner">
  257. <span>5万公里以下</span>
  258. <span class="checked-warning">5~6万公里</span>
  259. <span>超过6万公里</span>
  260. </div>
  261. </div>
  262. <div class="view-container-item">
  263. <p class="message-left-abbreviation" title="破损字数很长很长怎啊啊啊啊啊啊">
  264. 破损字数很长很长怎啊啊啊啊啊啊</p>
  265. <div class="view-container-item-inner">
  266. <span>5万公里以下</span>
  267. <span class="checked-warning">5~6万公里</span>
  268. <span>超过6万公里</span>
  269. </div>
  270. </div>
  271. <div class="view-container-item">
  272. <p class="message-left-abbreviation">备注</p>
  273. <div class="layui-form view-container-item-inner">
  274. <div class="layui-input-inline">
  275. <input type="text" name="" placeholder="请输入" autocomplete="off"
  276. class="layui-input">
  277. </div>
  278. </div>
  279. </div>
  280. </div>
  281. </div>
  282. <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
  283. <script src="../../layui/layui.all.js"></script>
  284. <script src="../../c_javascript/fabric.js"></script>
  285. <script src="../../c_javascript/fabric.min.js"></script>
  286. <script>
  287. var t_select
  288. $(function () {
  289. $('.ring-view-operation-item').map(function (index, value) {
  290. value.addEventListener('click', function (e) {
  291. var _value = $(value)
  292. _value.toggleClass('checked')
  293. if (_value.hasClass('checked')) {
  294. _value.siblings().removeClass('checked')
  295. t_select = _value.attr('type')
  296. } else {
  297. t_select = ''
  298. }
  299. })
  300. })
  301. })
  302. function saveImg () {
  303. //将画板保存为图片格式的函数
  304. var img_png_src = canvas.toDataURL('image/png')
  305. var imgData = img_png_src.replace('png', 'image/octet-stream')
  306. var filename = '导出' + (new Date()).getTime() + '.png'
  307. var save_link = document.createElementNS('http://www.w3.org/1999/xhtml', 'a')
  308. save_link.href = imgData
  309. save_link.download = filename
  310. var event = document.createEvent('MouseEvents')
  311. event.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false,
  312. false, false, false, 0, null)
  313. save_link.dispatchEvent(event)
  314. }
  315. var canvasElement = document.getElementById('canvasEle')
  316. var canvas = new fabric.Canvas(canvasElement, {
  317. selection: false,
  318. width: 431,
  319. height: 581,
  320. })
  321. canvas.setBackgroundImage('./img/canvas-bg.png', canvas.renderAll.bind(canvas))
  322. canvas.on({
  323. 'object:moving': function (e) {
  324. e.target.opacity = 0.5
  325. },
  326. 'mouse:up': function (e) {
  327. if (!e.target) {
  328. createCanvasItem(typeMap[t_select], e.pointer)
  329. }
  330. },
  331. 'object:modified': function (e) {
  332. e.target.opacity = 1
  333. },
  334. })
  335. var typeMap={
  336. triangle:'./img/icon_tan_big.png',
  337. rift:'./img/icon_fang_big.png',
  338. sunken:'./img/icon_circle_big.png',
  339. damage:'./img/icon_close_big.png',
  340. }
  341. function createCanvasItem (imageUrl, coordinate) {
  342. fabric.Image.fromURL(imageUrl, function (img) {
  343. canvas.add(
  344. img.set({ left: coordinate.x-8, top: coordinate.y-8, hasControls: false }))
  345. })
  346. }
  347. !function () {
  348. var layer = layui.layer
  349. , form = layui.form
  350. }()
  351. </script>
  352. </body>
  353. </html>