addMachine.vue 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761
  1. <template>
  2. <view>
  3. <form @submit="submit">
  4. <form @submit="addMachine">
  5. <view class="bigTitle">机器</view>
  6. <view class="body">
  7. <input class="input" style="display:none;" name="coding" :value=coding />
  8. 机器编码:<input class="input" v-model="coding" />
  9. <button type="primary" @click="saoma('coding')" class="button1" size="mini">
  10. <p class="p">扫码</p>
  11. </button>
  12. <button type="primary" @click="getMachine(coding)" class="button1" size="mini">
  13. <p class="p">获取</p>
  14. </button>
  15. </view>
  16. <view class="bodyname">
  17. 名称:<input class="input" name="name" :value="name" />
  18. <!-- <button type="primary" form-type="submit" class="button1">
  19. <p class="p">确认</p>
  20. </button> -->
  21. </view>
  22. <view class="body">
  23. 机身铭牌:<input class="input" name="nameplate" :value="nameplate" />
  24. <!-- <button type="primary" form-type="submit" class="button1">
  25. <p class="p">确认</p>
  26. </button> -->
  27. </view>
  28. <view class="body">
  29. 设备编号:<input class="input" name="clientId" :value="clientId" />
  30. <!-- <button type="primary" form-type="submit" class="button1">
  31. <p class="p">确认</p>
  32. </button> -->
  33. </view>
  34. <view class="body">
  35. <!-- 订单编号:<input class="input" name="orderNo" :value="orderNo" /> -->
  36. <input class="input" style="display:none;" name="orderNo" :value=orderNo />
  37. 订单编号:<input class="input" v-model="orderNo" />
  38. <button type="primary" @click="saoma('orderNo')" class="button1">
  39. <p class="p">扫码</p>
  40. </button>
  41. <!-- <button type="primary" form-type="submit" class="button1">
  42. <p class="p">确认</p>
  43. </button> -->
  44. <!-- <button type="primary" @click="getMessage(orderNo)" class="button1">
  45. <p class="p">获取</p>
  46. </button> -->
  47. </view>
  48. <view class="body">
  49. 客户编号:<input class="input" name="customerNo" :value="customerNo" />
  50. <!-- <button type="primary" form-type="submit" class="button1">
  51. <p class="p">确认</p>
  52. </button> -->
  53. </view>
  54. <view class="body">
  55. <input class="input" style="display:none;" name="cardReader" :value=cardReader />
  56. <span style="margin-left: 25upx;">刷卡器:</span><input class="input" v-model="cardReader" />
  57. <button type="primary" @click="saoma('cardReader')" class="button1">
  58. <p class="p">扫码</p>
  59. </button>
  60. <!-- <button type="primary" form-type="submit" class="button1">
  61. <p class="p">确认</p>
  62. </button> -->
  63. </view>
  64. <view class="">
  65. <button type="primary" form-type="submit" class="submitButton">
  66. 确认
  67. </button>
  68. </view>
  69. </form>
  70. <view class="line"></view>
  71. <view class="">
  72. <uni-list-item title="添加工序" @click="gongxu()" />
  73. </view>
  74. <view class="line"></view>
  75. <form @submit="jike" @reset="jikeReset">
  76. <view class="modules">
  77. <view class="title">机壳</view>
  78. <view class="body">
  79. <input class="input" style="display:none;" name="jikeCoding" :value=jikeCoding />
  80. 编码:<input class="input" v-model="jikeCoding" />
  81. <button type="primary" @click="saoma('jikeCoding')" class="button1">
  82. <p class="p">扫码</p>
  83. </button>
  84. <button type="primary" @click="getMessage(jikeCoding)" class="button1">
  85. <p class="p">获取</p>
  86. </button>
  87. </view>
  88. <view class="body">
  89. 名称:<input class="input" name="jikeName" :value="jikeName" />
  90. </view>
  91. <view class="body">
  92. 版本:<input class="input" name="jikeVersion" :value="jikeVersion" />
  93. </view>
  94. <view class="modulesButton">
  95. <button type="primary" form-type="submit" class="button1">
  96. <p class="p">确认</p>
  97. </button>
  98. <button type="primary" @click="updateModules(jikeCoding,'jike')" class="button1">
  99. <p class="p">更换</p>
  100. </button>
  101. </view>
  102. </view>
  103. </form>
  104. <view class="line"></view>
  105. <form @submit="lutou" @reset="lutouReset">
  106. <view class="modules">
  107. <view class="title">炉头</view>
  108. <view class="body">
  109. <input class="input" style="display:none;" name="lutouCoding" :value=lutouCoding />
  110. 编码:<input class="input" v-model="lutouCoding" />
  111. <button type="primary" @click="saoma('lutouCoding')" class="button1">
  112. <p class="p">扫码</p>
  113. </button>
  114. <button type="primary" @click="getMessage(lutouCoding)" class="button1">
  115. <p class="p">获取</p>
  116. </button>
  117. </view>
  118. <view class="body">
  119. 名称:<input class="input" name="lutouName" :value="lutouName" />
  120. </view>
  121. <view class="body">
  122. 版本:<input class="input" name="lutouVersion" :value="lutouVersion" />
  123. </view>
  124. <view class="modulesButton">
  125. <button type="primary" form-type="submit" class="button1">
  126. <p class="p">确认</p>
  127. </button>
  128. <button type="primary" @click="updateModules(lutouCoding,'lutou')" class="button1">
  129. <p class="p">更换</p>
  130. </button>
  131. </view>
  132. </view>
  133. </form>
  134. <view class="line"></view>
  135. <form @submit="jiashiqi" @reset="jiashiqiReset">
  136. <view class="modules">
  137. <view class="title">加湿器</view>
  138. <view class="body">
  139. <input class="input" style="display:none;" name="jiashiqiCoding" :value=jiashiqiCoding />
  140. 编码:<input class="input" v-model="jiashiqiCoding" />
  141. <button type="primary" @click="saoma('jiashiqiCoding')" class="button1">
  142. <p class="p">扫码</p>
  143. </button>
  144. <button type="primary" @click="getMessage(jiashiqiCoding)" class="button1">
  145. <p class="p">获取</p>
  146. </button>
  147. </view>
  148. <view class="body">
  149. 名称:<input class="input" name="jiashiqiName" :value="jiashiqiName" />
  150. </view>
  151. <view class="body">
  152. 版本:<input class="input" name="jiashiqiVersion" :value="jiashiqiVersion" />
  153. </view>
  154. <view class="modulesButton">
  155. <button type="primary" form-type="submit" class="button1">
  156. <p class="p">确认</p>
  157. </button>
  158. <button type="primary" @click="updateModules(jiashiqiCoding,'jiashiqi')" class="button1">
  159. <p class="p">更换</p>
  160. </button>
  161. </view>
  162. </view>
  163. </form>
  164. <view class="line"></view>
  165. <form @submit="anzhuoping" @reset="anzhuopingReset">
  166. <view class="modules">
  167. <view class="title">安卓屏</view>
  168. <view class="body">
  169. <input class="input" style="display:none;" name="anzhuopingCoding" :value=anzhuopingCoding />
  170. 编码:<input class="input" v-model="anzhuopingCoding" />
  171. <button type="primary" @click="saoma('anzhuopingCoding')" class="button1">
  172. <p class="p">扫码</p>
  173. </button>
  174. <button type="primary" @click="getMessage(anzhuopingCoding)" class="button1">
  175. <p class="p">获取</p>
  176. </button>
  177. </view>
  178. <view class="body">
  179. 名称:<input class="input" name="anzhuopingName" :value="anzhuopingName" />
  180. </view>
  181. <view class="body">
  182. 版本:<input class="input" name="anzhuopingVersion" :value="anzhuopingVersion" />
  183. </view>
  184. <view class="modulesButton">
  185. <button type="primary" form-type="submit" class="button1">
  186. <p class="p">确认</p>
  187. </button>
  188. <button type="primary" @click="updateModules(anzhuopingCoding,'anzhuoping')" class="button1">
  189. <p class="p">更换</p>
  190. </button>
  191. </view>
  192. </view>
  193. </form>
  194. <view class="line"></view>
  195. <form @submit="plc" @reset="plcReset">
  196. <view class="modules">
  197. <view class="title">plc</view>
  198. <view class="body">
  199. <input class="input" style="display:none;" name="plcCoding" :value=plcCoding />
  200. 编码:<input class="input" v-model="plcCoding" />
  201. <button type="primary" @click="saoma('plcCoding')" class="button1">
  202. <p class="p">扫码</p>
  203. </button>
  204. <button type="primary" @click="getMessage(plcCoding)" class="button1">
  205. <p class="p">获取</p>
  206. </button>
  207. </view>
  208. <view class="body">
  209. 名称:<input class="input" name="plcName" :value="plcName" />
  210. </view>
  211. <view class="body">
  212. 版本:<input class="input" name="plcVersion" :value="plcVersion" />
  213. </view>
  214. <view class="modulesButton">
  215. <button type="primary" form-type="submit" class="button1">
  216. <p class="p">确认</p>
  217. </button>
  218. <button type="primary" @click="updateModules(plcCoding,'plc')" class="button1">
  219. <p class="p">更换</p>
  220. </button>
  221. </view>
  222. </view>
  223. </form>
  224. <view class="line"></view>
  225. <form @submit="jiareban" @reset="jiarebanReset">
  226. <view class="modules">
  227. <view class="title">加热板</view>
  228. <view class="body">
  229. <input class="input" style="display:none;" name="jiarebanCoding" :value=jiarebanCoding />
  230. 编码:<input class="input" v-model="jiarebanCoding" />
  231. <button type="primary" @click="saoma('jiarebanCoding')" class="button1">
  232. <p class="p">扫码</p>
  233. </button>
  234. <button type="primary" @click="getMessage(jiarebanCoding)" class="button1">
  235. <p class="p">获取</p>
  236. </button>
  237. </view>
  238. <view class="body">
  239. 名称:<input class="input" name="jiarebanName" :value="jiarebanName" />
  240. </view>
  241. <view class="body">
  242. 版本:<input class="input" name="jiarebanVersion" :value="jiarebanVersion" />
  243. </view>
  244. <view class="modulesButton">
  245. <button type="primary" form-type="submit" class="button1">
  246. <p class="p">确认</p>
  247. </button>
  248. <button type="primary" @click="updateModules(jiarebanCoding,'jiareban')" class="button1">
  249. <p class="p">更换</p>
  250. </button>
  251. </view>
  252. </view>
  253. </form>
  254. <view class="line"></view>
  255. <form @submit="chugun" @reset="chugunReset">
  256. <view class="modules">
  257. <view class="title">出棍模块</view>
  258. <view class="body">
  259. <input class="input" style="display:none;" name="chugunCoding" :value=chugunCoding />
  260. 编码:<input class="input" v-model="chugunCoding" />
  261. <button type="primary" @click="saoma('chugunCoding')" class="button1">
  262. <p class="p">扫码</p>
  263. </button>
  264. <button type="primary" @click="getMessage(chugunCoding)" class="button1">
  265. <p class="p">获取</p>
  266. </button>
  267. </view>
  268. <view class="body">
  269. 名称:<input class="input" name="chugunName" :value="chugunName" />
  270. </view>
  271. <view class="body">
  272. 版本:<input class="input" name="chugunVersion" :value="chugunVersion" />
  273. </view>
  274. <view class="modulesButton">
  275. <button type="primary" form-type="submit" class="button1">
  276. <p class="p">确认</p>
  277. </button>
  278. <button type="primary" @click="updateModules(chugunCoding,'chugun')" class="button1">
  279. <p class="p">更换</p>
  280. </button>
  281. </view>
  282. </view>
  283. </form>
  284. <view class="line"></view>
  285. <form @submit="diangui" @reset="dianguiReset">
  286. <view class="modules">
  287. <view class="title">电柜模块</view>
  288. <view class="body">
  289. <input class="input" style="display:none;" name="dianguiCoding" :value=dianguiCoding />
  290. 编码:<input class="input" v-model="dianguiCoding" />
  291. <button type="primary" @click="saoma('dianguiCoding')" class="button1">
  292. <p class="p">扫码</p>
  293. </button>
  294. <button type="primary" @click="getMessage(dianguiCoding)" class="button1">
  295. <p class="p">获取</p>
  296. </button>
  297. </view>
  298. <view class="body">
  299. 名称:<input class="input" name="dianguiName" :value="dianguiName" />
  300. </view>
  301. <view class="body">
  302. 版本:<input class="input" name="dianguiVersion" :value="dianguiVersion" />
  303. </view>
  304. <view class="modulesButton">
  305. <button type="primary" form-type="submit" class="button1">
  306. <p class="p">确认</p>
  307. </button>
  308. <button type="primary" @click="updateModules(dianguiCoding,'diangui')" class="button1">
  309. <p class="p">更换</p>
  310. </button>
  311. </view>
  312. </view>
  313. </form>
  314. <view class="line"></view>
  315. <form @submit="xiazai" @reset="xiazaiReset">
  316. <view class="modules">
  317. <view class="title">远程下载模块</view>
  318. <view class="body">
  319. <input class="input" style="display:none;" name="xiazaiCoding" :value=xiazaiCoding />
  320. 编码:<input class="input" v-model="xiazaiCoding" />
  321. <button type="primary" @click="saoma('xiazaiCoding')" class="button1">
  322. <p class="p">扫码</p>
  323. </button>
  324. <button type="primary" @click="getMessage(xiazaiCoding)" class="button1">
  325. <p class="p">获取</p>
  326. </button>
  327. </view>
  328. <view class="body">
  329. 名称:<input class="input" name="xiazaiName" :value="xiazaiName" />
  330. </view>
  331. <view class="body">
  332. 版本:<input class="input" name="xiazaiVersion" :value="xiazaiVersion" />
  333. </view>
  334. <view class="modulesButton">
  335. <button type="primary" form-type="submit" class="button1">
  336. <p class="p">确认</p>
  337. </button>
  338. <button type="primary" @click="updateModules(xiazaiCoding,'xiazai')" class="button1">
  339. <p class="p">更换</p>
  340. </button>
  341. </view>
  342. </view>
  343. </form>
  344. <view class="line"></view>
  345. <form @submit="jixieshou" @reset="jixieshouReset">
  346. <view class="modules">
  347. <view class="title">机械手</view>
  348. <view class="body">
  349. <input class="input" style="display:none;" name="jixieshouCoding" :value=jixieshouCoding />
  350. 编码:<input class="input" v-model="jixieshouCoding" />
  351. <button type="primary" @click="saoma('jixieshouCoding')" class="button1">
  352. <p class="p">扫码</p>
  353. </button>
  354. <button type="primary" @click="getMessage(jixieshouCoding)" class="button1">
  355. <p class="p">获取</p>
  356. </button>
  357. </view>
  358. <view class="body">
  359. 名称:<input class="input" name="jixieshouName" :value="jixieshouName" />
  360. </view>
  361. <view class="body">
  362. 版本:<input class="input" name="jixieshouVersion" :value="jixieshouVersion" />
  363. </view>
  364. <view class="modulesButton">
  365. <button type="primary" form-type="submit" class="button1">
  366. <p class="p">确认</p>
  367. </button>
  368. <button type="primary" @click="updateModules(jixieshouCoding,'jixieshou')" class="button1">
  369. <p class="p">更换</p>
  370. </button>
  371. </view>
  372. </view>
  373. </form>
  374. <view class="line"></view>
  375. <form @submit="yaxingdao" @reset="yaxingdaoReset">
  376. <view class="modules">
  377. <view class="title">压型刀</view>
  378. <view class="body">
  379. <input class="input" style="display:none;" name="yaxingdaoCoding" :value=yaxingdaoCoding />
  380. 编码:<input class="input" v-model="yaxingdaoCoding" />
  381. <button type="primary" @click="saoma('yaxingdaoCoding')" class="button1">
  382. <p class="p">扫码</p>
  383. </button>
  384. <button type="primary" @click="getMessage(yaxingdaoCoding)" class="button1">
  385. <p class="p">获取</p>
  386. </button>
  387. </view>
  388. <view class="body">
  389. 名称:<input class="input" name="yaxingdaoName" :value="yaxingdaoName" />
  390. </view>
  391. <view class="body">
  392. 版本:<input class="input" name="yaxingdaoVersion" :value="yaxingdaoVersion" />
  393. </view>
  394. <view class="modulesButton">
  395. <button type="primary" form-type="submit" class="button1">
  396. <p class="p">确认</p>
  397. </button>
  398. <button type="primary" @click="updateModules(yaxingdaoCoding,'yaxingdao')" class="button1">
  399. <p class="p">更换</p>
  400. </button>
  401. </view>
  402. </view>
  403. </form>
  404. <view class="line"></view>
  405. <form @submit="songtang" @reset="yaxingdaoReset">
  406. <view class="modules">
  407. <view class="title">送糖模块</view>
  408. <view class="body">
  409. <input class="input" style="display:none;" name="songtangCoding" :value=songtangCoding />
  410. 编码:<input class="input" v-model="songtangCoding" />
  411. <button type="primary" @click="saoma('songtangCoding')" class="button1">
  412. <p class="p">扫码</p>
  413. </button>
  414. <button type="primary" @click="getMessage(songtangCoding)" class="button1">
  415. <p class="p">获取</p>
  416. </button>
  417. </view>
  418. <view class="body">
  419. 名称:<input class="input" name="songtangName" :value="songtangName" />
  420. </view>
  421. <view class="body">
  422. 版本:<input class="input" name="songtangVersion" :value="songtangVersion" />
  423. </view>
  424. <view class="modulesButton">
  425. <button type="primary" form-type="submit" class="button1">
  426. <p class="p">确认</p>
  427. </button>
  428. <button type="primary" @click="updateModules(songtangCoding,'songtang')" class="button1">
  429. <p class="p">更换</p>
  430. </button>
  431. </view>
  432. </view>
  433. </form>
  434. <view class="line"></view>
  435. <form @submit="qibeng" @reset="yaxingdaoReset">
  436. <view class="modules">
  437. <view class="title">气泵</view>
  438. <view class="body">
  439. <input class="input" style="display:none;" name="qibengCoding" :value=qibengCoding />
  440. 编码:<input class="input" v-model="qibengCoding" />
  441. <button type="primary" @click="saoma('qibengCoding')" class="button1">
  442. <p class="p">扫码</p>
  443. </button>
  444. <button type="primary" @click="getMessage(qibengCoding)" class="button1">
  445. <p class="p">获取</p>
  446. </button>
  447. </view>
  448. <view class="body">
  449. 名称:<input class="input" name="qibengName" :value="qibengName" />
  450. </view>
  451. <!-- <view class="body">
  452. 版本:<input class="input" name="qibengVersion" :value="qibengVersion" />
  453. </view> -->
  454. <view class="modulesButton">
  455. <button type="primary" form-type="submit" class="button1">
  456. <p class="p">确认</p>
  457. </button>
  458. <button type="primary" @click="updateModules(qibengCoding,'qibeng')" class="button1">
  459. <p class="p">更换</p>
  460. </button>
  461. </view>
  462. </view>
  463. </form>
  464. <view class="line"></view>
  465. <form @submit="zidongdoor" @reset="zidongdoorReset">
  466. <view class="modules">
  467. <view class="title">自动门</view>
  468. <view class="body">
  469. <input class="input" style="display:none;" name="zidongdoorCoding" :value=zidongdoorCoding />
  470. 编码:<input class="input" v-model="zidongdoorCoding" />
  471. <button type="primary" @click="saoma('zidongdoorCoding')" class="button1">
  472. <p class="p">扫码</p>
  473. </button>
  474. <button type="primary" @click="getMessage(zidongdoorCoding)" class="button1">
  475. <p class="p">获取</p>
  476. </button>
  477. </view>
  478. <view class="body">
  479. 名称:<input class="input" name="zidongdoorName" :value="zidongdoorName" />
  480. </view>
  481. <view class="body">
  482. 版本:<input class="input" name="zidongdoorVersion" :value="zidongdoorVersion" />
  483. </view>
  484. <view class="modulesButton">
  485. <button type="primary" form-type="submit" class="button1">
  486. <p class="p">确认</p>
  487. </button>
  488. <button type="primary" @click="updateModules(zidongdoorCoding,'zidongdoor')" class="button1">
  489. <p class="p">更换</p>
  490. </button>
  491. </view>
  492. </view>
  493. </form>
  494. <view class="line"></view>
  495. <form @submit="shuibeng" @reset="shuibengReset">
  496. <view class="modules">
  497. <view class="title">蒸汽发生器</view>
  498. <view class="body">
  499. <input class="input" style="display:none;" name="shuibengCoding" :value=shuibengCoding />
  500. 编码:<input class="input" v-model="shuibengCoding" />
  501. <button type="primary" @click="saoma('shuibengCoding')" class="button1">
  502. <p class="p">扫码</p>
  503. </button>
  504. <button type="primary" @click="getMessage(shuibengCoding)" class="button1">
  505. <p class="p">获取</p>
  506. </button>
  507. </view>
  508. <view class="body">
  509. 名称:<input class="input" name="shuibengName" :value="shuibengName" />
  510. </view>
  511. <view class="body">
  512. 版本:<input class="input" name="shuibengVersion" :value="shuibengVersion" />
  513. </view>
  514. <view class="modulesButton">
  515. <button type="primary" form-type="submit" class="button1">
  516. <p class="p">确认</p>
  517. </button>
  518. <button type="primary" @click="updateModules(shuibengCoding,'shuibeng')" class="button1">
  519. <p class="p">更换</p>
  520. </button>
  521. </view>
  522. </view>
  523. </form>
  524. <view class="line"></view>
  525. <form @submit="shoudongdoor" @reset="shoudongdoorReset">
  526. <view class="modules">
  527. <view class="title">手动门</view>
  528. <view class="body">
  529. <input class="input" style="display:none;" name="shoudongdoorCoding"
  530. :value=shoudongdoorCoding />
  531. 编码:<input class="input" v-model="shoudongdoorCoding" />
  532. <button type="primary" @click="saoma('shoudongdoorCoding')" class="button1">
  533. <p class="p">扫码</p>
  534. </button>
  535. <button type="primary" @click="getMessage(shoudongdoorCoding)" class="button1">
  536. <p class="p">获取</p>
  537. </button>
  538. </view>
  539. <view class="body">
  540. 名称:<input class="input" name="shoudongdoorName" :value="shoudongdoorName" />
  541. </view>
  542. <view class="body">
  543. 版本:<input class="input" name="shoudongdoorVersion" :value="shoudongdoorVersion" />
  544. </view>
  545. <view class="modulesButton">
  546. <button type="primary" form-type="submit" class="button1">
  547. <p class="p">确认</p>
  548. </button>
  549. <button type="primary" @click="updateModules(shoudongdoorCoding,'shoudongdoor')"
  550. class="button1">
  551. <p class="p">更换</p>
  552. </button>
  553. </view>
  554. </view>
  555. </form>
  556. <!-- 循环风机1 -->
  557. <view class="line"></view>
  558. <form @submit="circulationFan1" @reset="circulationFan1Reset">
  559. <view class="modules">
  560. <view class="title">循环风机1</view>
  561. <view class="body">
  562. <input class="input" style="display:none;" name="circulationFan1Coding"
  563. :value=circulationFan1Coding />
  564. 编码:<input class="input" v-model="circulationFan1Coding" />
  565. <button type="primary" @click="saoma('circulationFan1Coding')" class="button1">
  566. <p class="p">扫码</p>
  567. </button>
  568. <button type="primary" @click="getMessage(circulationFan1Coding, 'circulationFan1')"
  569. class="button1">
  570. <p class="p">获取</p>
  571. </button>
  572. </view>
  573. <view class="body">
  574. 名称:<input class="input" name="circulationFan1Name" :value="circulationFan1Name" />
  575. </view>
  576. <view class="body">
  577. 版本:<input class="input" name="circulationFan1Version" :value="circulationFan1Version" />
  578. </view>
  579. <view class="modulesButton">
  580. <button type="primary" form-type="submit" class="button1">
  581. <p class="p">确认</p>
  582. </button>
  583. <button type="primary" @click="updateModules(circulationFan1Coding,'circulationFan1')"
  584. class="button1">
  585. <p class="p">更换</p>
  586. </button>
  587. </view>
  588. </view>
  589. </form>
  590. <!-- 循环风机2 -->
  591. <view class="line"></view>
  592. <form @submit="circulationFan2" @reset="circulationFan2Reset">
  593. <view class="modules">
  594. <view class="title">循环风机2</view>
  595. <view class="body">
  596. <input class="input" style="display:none;" name="circulationFan2Coding"
  597. :value=circulationFan2Coding />
  598. 编码:<input class="input" v-model="circulationFan2Coding" />
  599. <button type="primary" @click="saoma('circulationFan2Coding')" class="button1">
  600. <p class="p">扫码</p>
  601. </button>
  602. <button type="primary" @click="getMessage(circulationFan2Coding, 'circulationFan2')"
  603. class="button1">
  604. <p class="p">获取</p>
  605. </button>
  606. </view>
  607. <view class="body">
  608. 名称:<input class="input" name="circulationFan2Name" :value="circulationFan2Name" />
  609. </view>
  610. <view class="body">
  611. 版本:<input class="input" name="circulationFan2Version" :value="circulationFan2Version" />
  612. </view>
  613. <view class="modulesButton">
  614. <button type="primary" form-type="submit" class="button1">
  615. <p class="p">确认</p>
  616. </button>
  617. <button type="primary" @click="updateModules(circulationFan2Coding,'circulationFan2')"
  618. class="button1">
  619. <p class="p">更换</p>
  620. </button>
  621. </view>
  622. </view>
  623. </form>
  624. <!-- 循环风机3 -->
  625. <view class="line"></view>
  626. <form @submit="circulationFan3" @reset="circulationFan3Reset">
  627. <view class="modules">
  628. <view class="title">循环风机3</view>
  629. <view class="body">
  630. <input class="input" style="display:none;" name="circulationFan3Coding"
  631. :value=circulationFan3Coding />
  632. 编码:<input class="input" v-model="circulationFan3Coding" />
  633. <button type="primary" @click="saoma('circulationFan3Coding')" class="button1">
  634. <p class="p">扫码</p>
  635. </button>
  636. <button type="primary" @click="getMessage(circulationFan3Coding, 'circulationFan3')"
  637. class="button1">
  638. <p class="p">获取</p>
  639. </button>
  640. </view>
  641. <view class="body">
  642. 名称:<input class="input" name="circulationFan3Name" :value="circulationFan3Name" />
  643. </view>
  644. <view class="body">
  645. 版本:<input class="input" name="circulationFan3Version" :value="circulationFan3Version" />
  646. </view>
  647. <view class="modulesButton">
  648. <button type="primary" form-type="submit" class="button1">
  649. <p class="p">确认</p>
  650. </button>
  651. <button type="primary" @click="updateModules(circulationFan3Coding,'circulationFan3')"
  652. class="button1">
  653. <p class="p">更换</p>
  654. </button>
  655. </view>
  656. </view>
  657. </form>
  658. <view class="line"></view>
  659. <view class="">
  660. <button type="primary" @click="jiancha()" class="button">
  661. <p class="p1">检查</p>
  662. </button>
  663. </view>
  664. <view class="checkContent">
  665. {{weiname}} </br>
  666. {{Modulesname}}
  667. </view>
  668. </form>
  669. <view class="line"></view>
  670. </view>
  671. </template>
  672. <script>
  673. import {
  674. mapState,
  675. mapActions,
  676. mapMutations
  677. } from 'vuex';
  678. import timeSelector from '@/components/wing-time-selector/wing-time-selector.vue';
  679. export default {
  680. components: {
  681. timeSelector
  682. },
  683. data() {
  684. return {
  685. produceDate: '',
  686. coding: '',
  687. lutouCoding: null,
  688. jiashiqiCoding: null,
  689. name: null,
  690. jiashiqiName: null,
  691. lutouName: null,
  692. nameplate: null,
  693. clientId: null,
  694. orderNo: null,
  695. cardReader: null,
  696. customerNo: null,
  697. producePersonnel: null,
  698. jiashiqiVersion: null,
  699. lutouVersion: null,
  700. jikeCoding: null,
  701. jikeName: null,
  702. jikeVersion: null,
  703. circulationFan1Coding: null,
  704. circulationFan1Name: null,
  705. circulationFan1Version: null,
  706. circulationFan2Coding: null,
  707. circulationFan2Name: null,
  708. circulationFan2Version: null,
  709. circulationFan3Coding: null,
  710. circulationFan3Name: null,
  711. circulationFan3Version: null,
  712. shuibengCoding: null,
  713. shuibengName: null,
  714. shuibengVersion: null,
  715. chugunCoding: null,
  716. chugunName: null,
  717. chugunVersion: null,
  718. dianguiCoding: null,
  719. dianguiName: null,
  720. dianguiVersion: null,
  721. zidongdoorCoding: null,
  722. zidongdoorName: null,
  723. zidongdoorVersion: null,
  724. jixieshouCoding: null,
  725. jixieshouName: null,
  726. jixieshouVersion: null,
  727. yaxingdaoCoding: null,
  728. yaxingdaoName: null,
  729. yaxingdaoVersion: null,
  730. qibengCoding: null,
  731. qibengName: null,
  732. qibengVersion: null,
  733. songtangCoding: null,
  734. songtangName: null,
  735. songtangVersion: null,
  736. shoudongdoorCoding: null,
  737. shoudongdoorName: null,
  738. shoudongdoorVersion: null,
  739. anzhuopingCoding: null,
  740. anzhuopingName: null,
  741. anzhuopingVersion: null,
  742. plcCoding: null,
  743. plcName: null,
  744. plcVersion: null,
  745. jiarebanCoding: null,
  746. jiarebanName: null,
  747. jiarebanVersion: null,
  748. xiazaiCoding: null,
  749. xiazaiName: null,
  750. xiazaiVersion: null,
  751. weiname: '',
  752. Modulesname: ''
  753. }
  754. },
  755. methods: {
  756. btnConfirm0(e) {
  757. // console.log('确定时间为:', e);
  758. this.produceDate = e.key;
  759. },
  760. btnCancel0() {
  761. this.produceDate = '';
  762. },
  763. gongxu() {
  764. var item = {
  765. coding: null,
  766. type: 'add'
  767. };
  768. var coding = this.coding;
  769. item.coding = coding;
  770. uni.navigateTo({
  771. url: 'workingProcedure?item=' + encodeURIComponent(JSON.stringify(item))
  772. });
  773. },
  774. saoma(cod) {
  775. var that = this;
  776. // 允许从相机和相册扫码
  777. uni.scanCode({
  778. success(res) {
  779. console.log('res:' + res);
  780. console.log('条码类型:' + res.scanType);
  781. console.log('条码内容:' + res.result);
  782. if (cod == 'coding') {
  783. that.coding = res.result;
  784. }
  785. if (cod == 'lutouCoding') {
  786. that.lutouCoding = res.result;
  787. }
  788. if (cod == 'jiashiqiCoding') {
  789. that.jiashiqiCoding = res.result;
  790. }
  791. if (cod == 'shuibengCoding') {
  792. that.shuibengCoding = res.result;
  793. }
  794. if (cod == 'chugunCoding') {
  795. that.chugunCoding = res.result;
  796. }
  797. if (cod == 'dianguiCoding') {
  798. that.dianguiCoding = res.result;
  799. }
  800. if (cod == 'zidongdoorCoding') {
  801. that.zidongdoorCoding = res.result;
  802. }
  803. if (cod == 'jixieshouCoding') {
  804. that.jixieshouCoding = res.result;
  805. }
  806. if (cod == 'yaxingdaoCoding') {
  807. that.yaxingdaoCoding = res.result;
  808. }
  809. if (cod == 'qibengCoding') {
  810. that.qibengCoding = res.result;
  811. }
  812. if (cod == 'songtangCoding') {
  813. that.songtangCoding = res.result;
  814. }
  815. if (cod == 'shoudongdoorCoding') {
  816. that.shoudongdoorCoding = res.result;
  817. }
  818. if (cod == 'anzhuopingCoding') {
  819. that.anzhuopingCoding = res.result;
  820. }
  821. if (cod == 'plcCoding') {
  822. that.plcCoding = res.result;
  823. }
  824. if (cod == 'jiarebanCoding') {
  825. that.jiarebanCoding = res.result;
  826. }
  827. if (cod == 'jikeCoding') {
  828. that.jikeCoding = res.result;
  829. }
  830. if (cod == 'circulationFan1Coding') {
  831. that.circulationFan1Coding = res.result;
  832. }
  833. if (cod == 'circulationFan2Coding') {
  834. that.circulationFan2Coding = res.result;
  835. }
  836. if (cod == 'circulationFan3Coding') {
  837. that.circulationFan3Coding = res.result;
  838. }
  839. if (cod == 'xiazaiCoding') {
  840. that.xiazaiCoding = res.result;
  841. }
  842. if (cod == 'orderNo') {
  843. that.orderNo = res.result;
  844. }
  845. if (cod == 'cardReader') {
  846. that.cardReader = res.result;
  847. }
  848. },
  849. fail(err) {
  850. console.log('err:' + JSON.stringify(err));
  851. uni.showToast({
  852. icon: 'none',
  853. title: '请使用正确的条形码或二维码!',
  854. duration: 2000
  855. });
  856. }
  857. });
  858. },
  859. //获取机器详细信息
  860. getMachine(coding) {
  861. var that = this;
  862. that.jiashiqiName = null;
  863. that.jiashiqiCoding = null;
  864. that.jiashiqiVersion = null;
  865. that.lutouName = null;
  866. that.lutouCoding = null;
  867. that.lutouVersion = null;
  868. that.shuibengName = null;
  869. that.shuibengCoding = null;
  870. that.shuibengVersion = null;
  871. that.chugunName = null;
  872. that.chugunCoding = null;
  873. that.chugunVersion = null;
  874. that.dianguiName = null;
  875. that.dianguiCoding = null;
  876. that.dianguiVersion = null;
  877. that.jikeName = null;
  878. that.jikeCoding = null;
  879. that.jikeVersion = null;
  880. that.circulationFan1Name = null;
  881. that.circulationFan1Coding = null;
  882. that.circulationFan1Version = null;
  883. that.circulationFan2Name = null;
  884. that.circulationFan2Coding = null;
  885. that.circulationFan2Version = null;
  886. that.circulationFan3Name = null;
  887. that.circulationFan3Coding = null;
  888. that.circulationFan3Version = null;
  889. that.zidongdoorName = null;
  890. that.zidongdoorCoding = null;
  891. that.zidongdoorVersion = null;
  892. that.shoudongdoorName = null;
  893. that.shoudongdoorCoding = null;
  894. that.shoudongdoorVersion = null;
  895. that.jixieshouName = null;
  896. that.jixieshouCoding = null;
  897. that.jixieshouVersion = null;
  898. that.yaxingdaoName = null;
  899. that.yaxingdaoCoding = null;
  900. that.yaxingdaoVersion = null;
  901. that.songtangName = null;
  902. that.songtangCoding = null;
  903. that.songtangVersion = null;
  904. that.songtangVersion = null;
  905. that.qibengName = null;
  906. that.qibengCoding = null;
  907. that.qibengVersion = null;
  908. that.anzhuopingName = null;
  909. that.anzhuopingCoding = null;
  910. that.anzhuopingVersion = null;
  911. that.plcName = null;
  912. that.plcCoding = null;
  913. that.plcVersion = null;
  914. that.jiarebanName = null;
  915. that.jiarebanCoding = null;
  916. that.jiarebanVersion = null;
  917. that.xiazaiName = null;
  918. that.xiazaiCoding = null;
  919. that.xiazaiVersion = null;
  920. var serverUrl = that.serverurl;
  921. var token = uni.getStorageSync("token");
  922. uni.request({
  923. url: serverUrl + "/TMachine/getMachine?coding=" + coding,
  924. method: "GET",
  925. header: {
  926. 'token': token
  927. },
  928. success: (Result) => {
  929. var res = Result;
  930. if (res.data.code == true) {
  931. //当机器已录入时,会先把所有录入模块给列出来
  932. if (res.data.message == 'all') {
  933. var tmachine = res.data.data.tmachine;
  934. that.name = tmachine.name;
  935. that.nameplate = tmachine.nameplate;
  936. that.clientId = tmachine.clientId;
  937. that.customerNo = tmachine.customerNo;
  938. that.orderNo = tmachine.orderNo;
  939. that.cardReader = tmachine.cardReader;
  940. // that.producePersonnel = uni.getStorageSync("name");
  941. var modulesList = res.data.data.modulesList;
  942. var modules;
  943. for (var i = 0; i < modulesList.length; i++) {
  944. // console.log(modulesList[i]);
  945. var coding = modulesList[i].coding;
  946. //排除标准件
  947. if (coding.substring(0, 4) != '1000') {
  948. //半成品
  949. if (coding.substring(0, 2) == '15') {
  950. //电柜模块
  951. if (coding.substring(5, 7) == '01') {
  952. that.dianguiName = modulesList[i].name;
  953. that.dianguiCoding = modulesList[i].coding;
  954. that.dianguiVersion = modulesList[i].coding.substring(8, 10);
  955. }
  956. //机械手
  957. if (coding.substring(5, 7) == '02') {
  958. that.jixieshouName = modulesList[i].name;
  959. that.jixieshouCoding = modulesList[i].coding;
  960. that.jixieshouVersion = modulesList[i].coding.substring(8, 10);
  961. }
  962. //压型刀
  963. if (coding.substring(5, 7) == '03') {
  964. that.yaxingdaoName = modulesList[i].name;
  965. that.yaxingdaoCoding = modulesList[i].coding;
  966. that.yaxingdaoVersion = modulesList[i].coding.substring(8, 10);
  967. }
  968. //炉头
  969. if (coding.substring(5, 7) == '04') {
  970. that.lutouName = modulesList[i].name;
  971. that.lutouCoding = modulesList[i].coding;
  972. that.lutouVersion = modulesList[i].coding.substring(8, 10);
  973. }
  974. //送糖
  975. if (coding.substring(5, 7) == '05') {
  976. that.songtangName = modulesList[i].name;
  977. that.songtangCoding = modulesList[i].coding;
  978. that.songtangVersion = modulesList[i].coding.substring(8, 10);
  979. }
  980. //出棍模块
  981. if (coding.substring(5, 7) == '06') {
  982. that.chugunName = modulesList[i].name;
  983. that.chugunCoding = modulesList[i].coding;
  984. that.chugunVersion = modulesList[i].coding.substring(8, 10);
  985. }
  986. //"加湿器"
  987. if (coding.substring(5, 7) == '07') {
  988. that.jiashiqiName = modulesList[i].name;
  989. that.jiashiqiCoding = modulesList[i].coding;
  990. that.jiashiqiVersion = modulesList[i].coding.substring(8, 10);
  991. }
  992. //水泵 -> 蒸汽发生器
  993. if (coding.substring(5, 7) == '08') {
  994. that.shuibengName = modulesList[i].name;
  995. that.shuibengCoding = modulesList[i].coding;
  996. that.shuibengVersion = modulesList[i].coding.substring(8, 10);
  997. }
  998. //机壳
  999. if (coding.substring(5, 7) == '09') {
  1000. that.jikeName = modulesList[i].name;
  1001. that.jikeCoding = modulesList[i].coding;
  1002. that.jikeVersion = modulesList[i].coding.substring(8, 10);
  1003. }
  1004. // // 循环风机1
  1005. // if (coding.substring(5, 7) == '10') {
  1006. // that.circulationFan1Name = modulesList[i].name;
  1007. // that.circulationFan1Coding = modulesList[i].coding;
  1008. // that.circulationFan1Version = modulesList[i].coding.substring(
  1009. // 8, 10);
  1010. // }
  1011. // // 循环风机2
  1012. // if (coding.substring(5, 7) == '10') {
  1013. // that.circulationFan2Name = modulesList[i].name;
  1014. // that.circulationFan2Coding = modulesList[i].coding;
  1015. // that.circulationFan2Version = modulesList[i].coding.substring(
  1016. // 8, 10);
  1017. // }
  1018. // //循环风机3
  1019. // if (coding.substring(5, 7) == '10') {
  1020. // that.circulationFan3Name = modulesList[i].name;
  1021. // that.circulationFan3Coding = modulesList[i].coding;
  1022. // that.circulationFan3Version = modulesList[i].coding.substring(
  1023. // 8, 10);
  1024. // }
  1025. if (coding.substring(5, 7) == '10') {
  1026. if (!this.circulationFan1Coding) {
  1027. this.circulationFan1Name = modulesList[i].name;
  1028. this.circulationFan1Coding = modulesList[i].coding;
  1029. this.circulationFan1Version = modulesList[i].coding
  1030. .substring(8, 10);
  1031. } else if (!this.circulationFan2Coding) {
  1032. this.circulationFan2Name = modulesList[i].name;
  1033. this.circulationFan2Coding = modulesList[i].coding;
  1034. this.circulationFan2Version = modulesList[i].coding
  1035. .substring(8, 10);
  1036. } else if (!this.circulationFan3Coding) {
  1037. that.circulationFan3Name = modulesList[i].name;
  1038. that.circulationFan3Coding = modulesList[i].coding;
  1039. that.circulationFan3Version = modulesList[i].coding
  1040. .substring(8, 10);
  1041. }
  1042. }
  1043. //手动门
  1044. if (coding.substring(5, 7) == '11') {
  1045. that.shoudongdoorName = modulesList[i].name;
  1046. that.shoudongdoorCoding = modulesList[i].coding;
  1047. that.shoudongdoorVersion = modulesList[i].coding.substring(
  1048. 8,
  1049. 10);
  1050. }
  1051. //自动门
  1052. if (coding.substring(5, 7) == '12') {
  1053. that.zidongdoorName = modulesList[i].name;
  1054. that.zidongdoorCoding = modulesList[i].coding;
  1055. that.zidongdoorVersion = modulesList[i].coding.substring(8,
  1056. 10);
  1057. }
  1058. //远程下载模块
  1059. if (coding.substring(5, 7) == '13') {
  1060. that.xiazaiName = modulesList[i].name;
  1061. that.xiazaiCoding = modulesList[i].coding;
  1062. that.xiazaiVersion = modulesList[i].coding.substring(8,
  1063. 10);
  1064. }
  1065. //加热板
  1066. if (coding.substring(5, 7) == '14') {
  1067. that.jiarebanName = modulesList[i].name;
  1068. // that.qibengCoding = modulesList[i].coding.substring(0, 10);
  1069. that.jiarebanCoding = modulesList[i].coding;
  1070. that.jiarebanVersion = modulesList[i].coding.substring(8,
  1071. 10);
  1072. }
  1073. //安卓屏
  1074. if (coding.substring(5, 7) == '15') {
  1075. that.anzhuopingName = modulesList[i].name;
  1076. that.anzhuopingCoding = modulesList[i].coding;
  1077. that.anzhuopingVersion = modulesList[i].coding.substring(8,
  1078. 10);
  1079. }
  1080. //plc
  1081. if (coding.substring(5, 7) == '16') {
  1082. that.plcName = modulesList[i].name;
  1083. that.plcCoding = modulesList[i].coding;
  1084. that.plcVersion = modulesList[i].coding.substring(8, 10);
  1085. }
  1086. }
  1087. } else {
  1088. //气泵
  1089. if (coding.substring(8, 10) == '39') {
  1090. that.qibengName = modulesList[i].name;
  1091. // that.qibengCoding = modulesList[i].coding.substring(0, 10);
  1092. that.qibengCoding = modulesList[i].coding;
  1093. that.qibengVersion = modulesList[i].coding.substring(8, 10);
  1094. }
  1095. }
  1096. }
  1097. } else {
  1098. var codes = res.data.data;
  1099. that.name = codes.name;
  1100. that.nameplate = codes.nameplate;
  1101. that.clientId = codes.clientId;
  1102. that.customerNo = codes.customerNo;
  1103. that.orderNo = codes.orderNo;
  1104. that.cardReader = codes.cardReader;
  1105. that.producePersonnel = uni.getStorageSync("name");
  1106. }
  1107. } else {
  1108. uni.showModal({
  1109. title: '提示',
  1110. content: res.data.message,
  1111. });
  1112. }
  1113. }
  1114. });
  1115. },
  1116. getMessage(coding, fanType) {
  1117. var that = this;
  1118. var serverUrl = that.serverurl;
  1119. var token = uni.getStorageSync("token");
  1120. uni.request({
  1121. url: serverUrl + "/TModules/getMessage?coding=" + coding,
  1122. method: "GET",
  1123. header: {
  1124. 'token': token
  1125. },
  1126. success: (Result) => {
  1127. var res = Result;
  1128. if (res.data.code == true) {
  1129. var codes = res.data.data;
  1130. var coding = codes.code;
  1131. //排除标准件
  1132. if (coding.substring(0, 4) != '1000') {
  1133. //半成品
  1134. if (coding.substring(0, 2) == '15') {
  1135. //电柜模块
  1136. if (coding.substring(5, 7) == '01') {
  1137. that.dianguiName = codes.name;
  1138. that.dianguiCoding = codes.coding;
  1139. that.dianguiVersion = codes.code.substring(8, 10);
  1140. }
  1141. //机械手
  1142. if (coding.substring(5, 7) == '02') {
  1143. that.jixieshouName = codes.name;
  1144. that.jixieshouCoding = codes.coding;
  1145. that.jixieshouVersion = codes.code.substring(8, 10);
  1146. }
  1147. //压型刀
  1148. if (coding.substring(5, 7) == '03') {
  1149. that.yaxingdaoName = codes.name;
  1150. that.yaxingdaoCoding = codes.coding;
  1151. that.yaxingdaoVersion = codes.code.substring(8, 10);
  1152. }
  1153. //炉头
  1154. if (coding.substring(5, 7) == '04') {
  1155. that.lutouName = codes.name;
  1156. that.lutouCoding = codes.coding;
  1157. that.lutouVersion = codes.code.substring(8, 10);
  1158. }
  1159. //送糖
  1160. if (coding.substring(5, 7) == '05') {
  1161. that.songtangName = codes.name;
  1162. that.songtangCoding = codes.coding;
  1163. that.songtangVersion = codes.code.substring(8, 10);
  1164. }
  1165. //出棍模块
  1166. if (coding.substring(5, 7) == '06') {
  1167. that.chugunName = codes.name;
  1168. that.chugunCoding = codes.coding;
  1169. that.chugunVersion = codes.code.substring(8, 10);
  1170. }
  1171. //"加湿器"
  1172. if (coding.substring(5, 7) == '07') {
  1173. that.jiashiqiName = codes.name;
  1174. that.jiashiqiCoding = codes.coding;
  1175. that.jiashiqiVersion = codes.code.substring(8, 10);
  1176. }
  1177. //水泵 -> 蒸汽发生器
  1178. if (coding.substring(5, 7) == '08') {
  1179. that.shuibengName = codes.name;
  1180. that.shuibengCoding = codes.coding;
  1181. that.shuibengVersion = codes.code.substring(8, 10);
  1182. }
  1183. //机壳
  1184. if (coding.substring(5, 7) == '09') {
  1185. that.jikeName = codes.name;
  1186. that.jikeCoding = codes.coding;
  1187. that.jikeVersion = codes.code.substring(8, 10);
  1188. }
  1189. //循环风机1
  1190. // if (coding.substring(5, 7) == '10') {
  1191. // that.circulationFan1Name = codes.name;
  1192. // that.circulationFan1Coding = codes.coding;
  1193. // that.circulationFan1Version = codes.code.substring(8, 10);
  1194. // }
  1195. //循环风机2
  1196. // if (coding.substring(5, 7) == '10') {
  1197. // that.circulationFan2Name = codes.name;
  1198. // that.circulationFan2Coding = codes.coding;
  1199. // that.circulationFan2Version = codes.code.substring(8, 10);
  1200. // }
  1201. //循环风机3
  1202. // if (coding.substring(5, 7) == '10') {
  1203. // that.circulationFan3Name = codes.name;
  1204. // that.circulationFan3Coding = codes.coding;
  1205. // that.circulationFan3Version = codes.code.substring(8, 10);
  1206. // }
  1207. if (coding.substring(5, 7) == '10') {
  1208. if (fanType === 'circulationFan1') {
  1209. that.circulationFan1Name = codes.name;
  1210. that.circulationFan1Coding = codes.coding;
  1211. that.circulationFan1Version = codes.code.substring(8, 10);
  1212. } else if (fanType === 'circulationFan2') {
  1213. that.circulationFan2Name = codes.name;
  1214. that.circulationFan2Coding = codes.coding;
  1215. that.circulationFan2Version = codes.code.substring(8, 10);
  1216. } else if (fanType === 'circulationFan3') {
  1217. that.circulationFan3Name = codes.name;
  1218. that.circulationFan3Coding = codes.coding;
  1219. that.circulationFan3Version = codes.code.substring(8, 10);
  1220. }
  1221. }
  1222. //手动门
  1223. if (coding.substring(5, 7) == '11') {
  1224. that.shoudongdoorName = codes.name;
  1225. that.shoudongdoorCoding = codes.coding;
  1226. that.shoudongdoorVersion = codes.code.substring(8, 10);
  1227. }
  1228. //自动门
  1229. if (coding.substring(5, 7) == '12') {
  1230. that.zidongdoorName = codes.name;
  1231. that.zidongdoorCoding = codes.coding;
  1232. that.zidongdoorVersion = codes.code.substring(8, 10);
  1233. }
  1234. //远程下载模块
  1235. if (coding.substring(5, 7) == '13') {
  1236. that.xiazaiName = codes.name;
  1237. that.xiazaiCoding = codes.coding;
  1238. that.xiazaiVersion = codes.code.substring(8, 10);
  1239. }
  1240. //加热板
  1241. if (coding.substring(5, 7) == '14') {
  1242. that.jiarebanName = codes.name;
  1243. that.jiarebanCoding = codes.coding;
  1244. that.jiarebanVersion = codes.code.substring(8, 10);
  1245. }
  1246. //安卓屏
  1247. if (coding.substring(5, 7) == '15') {
  1248. that.anzhuopingName = codes.name;
  1249. that.anzhuopingCoding = codes.coding;
  1250. that.anzhuopingVersion = codes.code.substring(8, 10);
  1251. }
  1252. //plc
  1253. if (coding.substring(5, 7) == '16') {
  1254. that.plcName = codes.name;
  1255. that.plcCoding = codes.coding;
  1256. that.plcVersion = codes.code.substring(8, 10);
  1257. }
  1258. }
  1259. } else {
  1260. //气泵
  1261. if (coding.substring(8, 10) == '39') {
  1262. that.qibengName = codes.name;
  1263. that.qibengCoding = codes.coding;
  1264. that.qibengVersion = codes.versions;
  1265. }
  1266. }
  1267. } else {
  1268. uni.showModal({
  1269. title: '提示',
  1270. content: res.data.message,
  1271. });
  1272. }
  1273. }
  1274. });
  1275. },
  1276. //机器修改
  1277. addMachine(event) {
  1278. var serverUrl = this.serverurl;
  1279. const {
  1280. value: modules
  1281. } = event.detail;
  1282. // console.log("3");
  1283. var token = uni.getStorageSync("token");
  1284. var createPersonnel = uni.getStorageSync("name");
  1285. uni.request({
  1286. url: serverUrl + "/TMachine/add",
  1287. method: "POST",
  1288. data: {
  1289. "coding": modules.coding,
  1290. "name": modules.name,
  1291. "nameplate": modules.nameplate,
  1292. "clientId": modules.clientId,
  1293. "customerNo": modules.customerNo,
  1294. "orderNo": modules.orderNo,
  1295. "cardReader": modules.cardReader,
  1296. "createPersonnel": createPersonnel
  1297. },
  1298. header: {
  1299. 'token': token
  1300. },
  1301. success: (Result) => {
  1302. var res = Result;
  1303. uni.showModal({
  1304. title: '提示',
  1305. content: res.data.message,
  1306. });
  1307. }
  1308. });
  1309. },
  1310. lutou(event) { // 4炉头
  1311. var serverUrl = this.serverurl;
  1312. var machineCoding = this.coding;
  1313. const {
  1314. value: modules
  1315. } = event.detail;
  1316. // console.log(event.detail.value);
  1317. var token = uni.getStorageSync("token");
  1318. var createPersonnel = uni.getStorageSync("name");
  1319. uni.request({
  1320. url: serverUrl + "/TModules/update",
  1321. method: "POST",
  1322. data: {
  1323. "machineCoding": machineCoding,
  1324. "coding": modules.lutouCoding,
  1325. "name": modules.lutouName,
  1326. "installPersonnel": createPersonnel
  1327. },
  1328. header: {
  1329. 'token': token
  1330. },
  1331. success: (Result) => {
  1332. var res = Result;
  1333. if (res.data.code == true) {
  1334. }
  1335. uni.showModal({
  1336. title: '提示',
  1337. content: res.data.message,
  1338. });
  1339. }
  1340. });
  1341. },
  1342. objToStrMap(obj) {
  1343. let strMap = new Map();
  1344. for (let k of Object.keys(obj)) {
  1345. strMap.set(k, obj[k]);
  1346. }
  1347. return strMap;
  1348. },
  1349. diangui(event) { // 1电柜
  1350. this.tijiao(event, "diangui");
  1351. },
  1352. jixieshou(event) { // 2机械手
  1353. this.tijiao(event, "jixieshou");
  1354. },
  1355. yaxingdao(event) { // 3压型刀
  1356. this.tijiao(event, "yaxingdao");
  1357. },
  1358. // 4炉头
  1359. songtang(event) { // 5送糖
  1360. this.tijiao(event, "songtang");
  1361. },
  1362. chugun(event) { // 6出棍
  1363. this.tijiao(event, "chugun");
  1364. },
  1365. jiashiqi(event) { // 7加湿器
  1366. this.tijiao(event, "jiashiqi");
  1367. },
  1368. shuibeng(event) { // 8水泵-蒸汽发生器
  1369. this.tijiao(event, "shuibeng");
  1370. },
  1371. jike(event) { // 9机壳
  1372. this.tijiao(event, "jike");
  1373. },
  1374. circulationFan1(event) { // 10循环风机1
  1375. this.tijiao(event, "circulationFan1");
  1376. },
  1377. circulationFan2(event) { // 10循环风机2
  1378. this.tijiao(event, "circulationFan2");
  1379. },
  1380. circulationFan3(event) { // 10循环风机3
  1381. this.tijiao(event, "circulationFan3");
  1382. },
  1383. shoudongdoor(event) { // 11手动门
  1384. this.tijiao(event, "shoudongdoor");
  1385. },
  1386. zidongdoor(event) { // 12自动门
  1387. this.tijiao(event, "zidongdoor");
  1388. },
  1389. xiazai(event) { // 13远程下载
  1390. this.tijiao(event, "xiazai");
  1391. },
  1392. jiareban(event) { // 14加热板
  1393. this.tijiao(event, "jiareban");
  1394. },
  1395. anzhuoping(event) { // 15安卓屏
  1396. this.tijiao(event, "anzhuoping");
  1397. },
  1398. plc(event) { // 16plc
  1399. this.tijiao(event, "plc");
  1400. },
  1401. qibeng(event) { // 39气泵
  1402. this.tijiao(event, "qibeng");
  1403. },
  1404. tijiao(event, sname) {
  1405. var serverUrl = this.serverurl;
  1406. var machineCoding = this.coding;
  1407. const {
  1408. value: modules
  1409. } = event.detail;
  1410. var eValue = event.detail.value;
  1411. //将value对象转为map
  1412. var mapValue = this.objToStrMap(eValue);
  1413. var coding = mapValue.get(sname + "Coding");
  1414. var name = mapValue.get(sname + "Name");
  1415. // console.log(coding+"---"+name);
  1416. var token = uni.getStorageSync("token");
  1417. var createPersonnel = uni.getStorageSync("name");
  1418. uni.request({
  1419. url: serverUrl + "/TModules/update",
  1420. method: "POST",
  1421. data: {
  1422. "machineCoding": machineCoding,
  1423. "coding": coding,
  1424. "name": name,
  1425. "installPersonnel": createPersonnel
  1426. },
  1427. header: {
  1428. 'token': token
  1429. },
  1430. success: (Result) => {
  1431. var res = Result;
  1432. if (res.data.code == true) {
  1433. }
  1434. uni.showModal({
  1435. title: '提示',
  1436. content: res.data.message,
  1437. });
  1438. }
  1439. });
  1440. },
  1441. updateModules(code, name) {
  1442. var that = this;
  1443. uni.setStorageSync("updateModules", code);
  1444. uni.setStorageSync("updateMachineCode", that.coding);
  1445. uni.showModal({
  1446. title: '提示',
  1447. content: '是否要更换?',
  1448. success: function(res) {
  1449. if (res.confirm) {
  1450. uni.navigateTo({
  1451. url: 'updateModules',
  1452. });
  1453. if (name == "diangui") { // 1电柜模块
  1454. that.dianguiName = null;
  1455. that.dianguiCoding = null;
  1456. that.dianguiVersion = null;
  1457. }
  1458. if (name == "jixieshou") { // 2机械手
  1459. that.jixieshouName = null;
  1460. that.jixieshouCoding = null;
  1461. that.jixieshouVersion = null;
  1462. }
  1463. if (name == "yaxingdao") { // 3压型刀模块
  1464. that.yaxingdaoName = null;
  1465. that.yaxingdaoCoding = null;
  1466. that.yaxingdaoVersion = null;
  1467. }
  1468. if (name == "lutou") { // 4炉头模块
  1469. that.lutouName = null;
  1470. that.lutouCoding = null;
  1471. that.lutouVersion = null;
  1472. }
  1473. if (name == "songtang") { // 5送糖模块
  1474. that.songtangName = null;
  1475. that.songtangCoding = null;
  1476. that.songtangVersion = null;
  1477. }
  1478. if (name == "chugun") { // 6出棍模块
  1479. that.chugunName = null;
  1480. that.chugunCoding = null;
  1481. that.chugunVersion = null;
  1482. }
  1483. if (name == "jiashiqi") { // 7加湿器
  1484. that.jiashiqiName = null;
  1485. that.jiashiqiCoding = null;
  1486. that.jiashiqiVersion = null;
  1487. }
  1488. if (name == "shuibeng") { // 8水泵
  1489. that.shuibengName = null;
  1490. that.shuibengCoding = null;
  1491. that.shuibengVersion = null;
  1492. }
  1493. if (name == "jike") { // 9机壳
  1494. that.jikeName = null;
  1495. that.jikeCoding = null;
  1496. that.jikeVersion = null;
  1497. }
  1498. if (name == "circulationFan1") { // 10循环风机1
  1499. that.circulationFan1Name = null;
  1500. that.circulationFan1Coding = null;
  1501. that.circulationFan1Version = null;
  1502. }
  1503. if (name == "circulationFan2") { // 10循环风机2
  1504. that.circulationFan2Name = null;
  1505. that.circulationFan2Coding = null;
  1506. that.circulationFan2Version = null;
  1507. }
  1508. if (name == "circulationFan3") { // 10循环风机3
  1509. that.circulationFan3Name = null;
  1510. that.circulationFan3Coding = null;
  1511. that.circulationFan3Version = null;
  1512. }
  1513. if (name == "shoudongdoor") { // 11手动门
  1514. that.shoudongdoorName = null;
  1515. that.shoudongdoorCoding = null;
  1516. that.shoudongdoorVersion = null;
  1517. }
  1518. if (name == "zidongdoor") { // 12自动门
  1519. that.zidongdoorName = null;
  1520. that.zidongdoorCoding = null;
  1521. that.zidongdoorVersion = null;
  1522. }
  1523. if (name == "xiazai") { // 13远程下载
  1524. that.xiazaiName = null;
  1525. that.xiazaiCoding = null;
  1526. that.xiazaiVersion = null;
  1527. }
  1528. if (name == "jiareban") { // 14加热板
  1529. that.jiarebanName = null;
  1530. that.jiarebanCoding = null;
  1531. that.jiarebanVersion = null;
  1532. }
  1533. if (name == "anzhuoping") { // 15安卓屏
  1534. that.anzhuopingName = null;
  1535. that.anzhuopingCoding = null;
  1536. that.anzhuopingVersion = null;
  1537. }
  1538. if (name == "plc") { // 16plc
  1539. that.plcName = null;
  1540. that.plcCoding = null;
  1541. that.plcVersion = null;
  1542. }
  1543. if (name == "qibeng") { // 39气泵
  1544. that.qibengName = null;
  1545. that.qibengCoding = null;
  1546. that.qibengVersion = null;
  1547. }
  1548. } else if (res.cancel) {}
  1549. }
  1550. });
  1551. },
  1552. submit(event) {
  1553. var serverUrl = this.serverurl;
  1554. var machineCoding = this.coding;
  1555. const {
  1556. value: modules
  1557. } = event.detail;
  1558. var token = uni.getStorageSync("token");
  1559. var createPersonnel = uni.getStorageSync("name");
  1560. uni.request({
  1561. url: serverUrl + "/TMachine/submit",
  1562. method: "POST",
  1563. data: {
  1564. "coding": machineCoding,
  1565. checkPersonnel: createPersonnel
  1566. },
  1567. header: {
  1568. 'token': token
  1569. },
  1570. success: (Result) => {
  1571. var res = Result;
  1572. if (res.data.code == true) {
  1573. }
  1574. uni.showModal({
  1575. title: '提示',
  1576. content: res.data.message,
  1577. });
  1578. }
  1579. });
  1580. },
  1581. jiancha() {
  1582. var token = uni.getStorageSync("token");
  1583. uni.request({
  1584. url: this.serverurl + "/TWorkingProcedure/jiancha",
  1585. method: "POST",
  1586. data: {
  1587. "machineCoding": this.coding
  1588. },
  1589. header: {
  1590. 'token': token
  1591. },
  1592. success: (Result) => {
  1593. var res = Result;
  1594. if (res.data.code == false) {
  1595. var re = res.data.data.toString();
  1596. this.weiname = '工序:' + re + '未安装';
  1597. } else {
  1598. this.weiname = '工序已全部安装';
  1599. }
  1600. this.jianchaModules();
  1601. }
  1602. });
  1603. },
  1604. jianchaModules() {
  1605. var token = uni.getStorageSync("token");
  1606. uni.request({
  1607. url: this.serverurl + "/TModules/jianchaModules?machineCoding=" + this.coding,
  1608. method: "GET",
  1609. header: {
  1610. 'token': token
  1611. },
  1612. success: (Result) => {
  1613. var res = Result;
  1614. if (res.data.code == false) {
  1615. var re = res.data.data.toString();
  1616. this.Modulesname = '模块:' + re + '未安装';
  1617. } else {
  1618. this.Modulesname = '模块已全部安装';
  1619. }
  1620. }
  1621. });
  1622. }
  1623. }
  1624. }
  1625. </script>
  1626. <style>
  1627. .body {
  1628. background-color: #FFFFFF;
  1629. padding: 20upx 20upx 20upx 20upx;
  1630. display: flex;
  1631. flex-direction: row;
  1632. justify-content: flex-start;
  1633. }
  1634. .bodyname {
  1635. background-color: #FFFFFF;
  1636. padding: 20upx 20upx 20upx 70upx;
  1637. display: flex;
  1638. flex-direction: row;
  1639. justify-content: flex-start;
  1640. }
  1641. .input {
  1642. /* padding: 10upx 20upx 10upx 0upx; */
  1643. padding-left: 10upx;
  1644. /* padding-top: 10upx; */
  1645. background-color: #FFFFFF;
  1646. width: 350upx;
  1647. height: 50upx;
  1648. box-shadow: 0upx 0upx 20upx #D3D3D3;
  1649. border-radius: 5upx;
  1650. }
  1651. .button {
  1652. /* margin: auto; */
  1653. margin: 50upx 100upx ;
  1654. /* width: 60%; */
  1655. height: 100upx;
  1656. }
  1657. .button1 {
  1658. margin: auto;
  1659. width: 90upx;
  1660. height: 55upx;
  1661. }
  1662. .submitButton {
  1663. margin: 20upx 200upx;
  1664. }
  1665. .p {
  1666. /* #ifdef H5 */
  1667. top: -13%;
  1668. /* #endif */
  1669. width: 50upx;
  1670. height: 30upx;
  1671. font-size: 25upx;
  1672. padding-right: 9upx;
  1673. padding-top: 6upx;
  1674. /* #ifndef H5 */
  1675. /* padding-top: 10upx; */
  1676. /* #endif */
  1677. position: absolute;
  1678. /* 水平居中 */
  1679. left: 50%;
  1680. -webkit-transform: translateX(-50%);
  1681. transform: translateX(-50%);
  1682. }
  1683. .p1 {
  1684. /* #ifdef H5 */
  1685. top: -13%;
  1686. /* #endif */
  1687. width: 80upx;
  1688. height: 60upx;
  1689. font-size: 40upx;
  1690. padding-top: 6upx;
  1691. /* #ifndef H5 */
  1692. padding-top: 10upx;
  1693. /* #endif */
  1694. position: absolute;
  1695. /* 水平居中 */
  1696. left: 50%;
  1697. -webkit-transform: translateX(-50%);
  1698. transform: translateX(-50%);
  1699. }
  1700. .radio {
  1701. padding-top: 20upx;
  1702. padding-left: 30upx;
  1703. }
  1704. .line {
  1705. background: #ECECEC;
  1706. height: 10upx;
  1707. }
  1708. .bigTitle {
  1709. font-size: 35upx;
  1710. margin-left: 20upx;
  1711. }
  1712. .title {
  1713. font-size: 35upx;
  1714. }
  1715. .modulesButton {
  1716. background-color: #FFFFFF;
  1717. padding: 20upx 20upx 20upx 20upx;
  1718. display: flex;
  1719. width: 250upx;
  1720. margin: auto;
  1721. flex-direction: row;
  1722. justify-content: flex-start;
  1723. }
  1724. .checkContent {
  1725. margin: 50upx 30upx;
  1726. font-size: 30upx;
  1727. }
  1728. .modules {
  1729. width: 95%;
  1730. margin: auto;
  1731. }
  1732. </style>