addMachine.vue 56 KB

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