generalParameters.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604
  1. <template>
  2. <view class="">
  3. <!-- <view class="line">
  4. </view> -->
  5. <view class="search">
  6. <view class="search-title">
  7. {{$t('dosugar.equipmentClientID')}}
  8. </view>
  9. <view class="search-input">
  10. <input type="text" :placeholder="$t('dosugar.placeholder')" v-model="searchClientId" />
  11. </view>
  12. <view class="search-button">
  13. <button type="primary" size="mini" class="" @click="search()">
  14. <p class="">{{$t('dosugar.search')}}</P>
  15. </button>
  16. </view>
  17. </view>
  18. <view class="td-right">
  19. <view class="uni-list">
  20. <view class="uni-list-cell">
  21. <view class="uni-list-cell-left">
  22. {{$t('dosugar.chooseEquipment')}}
  23. </view>
  24. <view class="uni-list-cell-db" style="overflow: hidden;text-overflow: ellipsis;">
  25. <picker @change="changeEquipment" :value="index" :range="equipmentNameList">
  26. <view class="uni-input">{{equipmentNameList[index]}}</view>
  27. </picker>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <view >
  33. <view class="body">
  34. <p class="p">{{$t('generalParameters.headTemperature')}}:</p>
  35. <input class="input" type="text" v-model="D418" />
  36. <button type="primary" class="button" @click="update('D418',D418)">
  37. <p class="p2">{{$t('parameters.update')}}</P>
  38. </button>
  39. </view>
  40. <view class="line2"></view>
  41. <view class="body">
  42. <p class="p">{{$t('generalParameters.headMediumSpeed')}}:</p>
  43. <input class="input" type="text" v-model="D406" />
  44. <button type="primary" class="button" @click="update('D406',D406)">
  45. <p class="p2">{{$t('parameters.update')}}</P>
  46. </button>
  47. </view>
  48. <view class="line2"></view>
  49. <view class="body">
  50. <p class="p">{{$t('generalParameters.pumpOpeningtime')}}:</p>
  51. <input class="input" type="text" v-model="D408" />
  52. <button type="primary" class="button" @click="update('D408',D408)">
  53. <p class="p2">{{$t('parameters.update')}}</P>
  54. </button>
  55. </view>
  56. <view class="line2"></view>
  57. <view class="body">
  58. <p class="p">{{$t('generalParameters.blowerBlowingTime')}}:</p>
  59. <input class="input" type="text" v-model="D409" />
  60. <button type="primary" class="button" @click="update('D409',D409)">
  61. <p class="p2">{{$t('parameters.update')}}</P>
  62. </button>
  63. </view>
  64. <view class="line2"></view>
  65. <view class="body">
  66. <p class="p">{{$t('generalParameters.lowerSugarThickness')}}:</p>
  67. <input class="input" type="text" v-model="D416" />
  68. <button type="primary" class="button" @click="update('D416',D416)">
  69. <p class="p2">{{$t('parameters.update')}}</P>
  70. </button>
  71. </view>
  72. <view class="line2"></view>
  73. <view class="body">
  74. <p class="p">{{$t('generalParameters.sugarTemperatureError')}}:</p>
  75. <input class="input" type="text" v-model="D419" />
  76. <button type="primary" class="button" @click="update('D419',D419)">
  77. <p class="p2">{{$t('parameters.update')}}</P>
  78. </button>
  79. </view>
  80. <view class="line2"></view>
  81. <view class="body">
  82. <p class="p">{{$t('generalParameters.returnAdjustment')}}:</p>
  83. <input class="input" type="text" v-model="M504" />
  84. <button type="primary" class="button" @click="update('M504',M504)">
  85. <p class="p2">{{$t('parameters.update')}}</P>
  86. </button>
  87. </view>
  88. <view class="line2"></view>
  89. <!-- 320和301特有 -->
  90. <view class="" v-show="equimentType=='MG301' || equimentType=='MG320' || equimentType=='MG330'">
  91. <view class="line2"></view>
  92. <view class="body">
  93. <p class="p">{{$t('generalParameters.headLowSpeed')}}:</p>
  94. <input class="input" type="text" v-model="D405" />
  95. <button type="primary" class="button" @click="update('D405',D405)">
  96. <p class="p2">{{$t('parameters.update')}}</P>
  97. </button>
  98. </view>
  99. <view class="line2"></view>
  100. <view class="body">
  101. <p class="p">{{$t('generalParameters.headHighSpeed')}}:</p>
  102. <input class="input" type="text" v-model="D407" />
  103. <button type="primary" class="button" @click="update('D407',D407)">
  104. <p class="p2">{{$t('parameters.update')}}</P>
  105. </button>
  106. </view>
  107. <view class="line2"></view>
  108. <view class="body">
  109. <p class="p">{{$t('generalParameters.closingWaitTime')}}:</p>
  110. <input class="input" type="text" v-model="D412" />
  111. <button type="primary" class="button" @click="update('D412',D412)">
  112. <p class="p2">{{$t('parameters.update')}}</P>
  113. </button>
  114. </view>
  115. <view class="line2"></view>
  116. <view class="body">
  117. <p class="p">{{$t('generalParameters.lowTemperatureEnvironment')}}:</p>
  118. <input class="input" type="text" v-model="D460" />
  119. <button type="primary" class="button" @click="update('D460',D460)">
  120. <p class="p2">{{$t('parameters.update')}}</P>
  121. </button>
  122. </view>
  123. <view class="line2"></view>
  124. <view class="body">
  125. <p class="p">{{$t('generalParameters.highTemperatureEnvironment')}}:</p>
  126. <input class="input" type="text" v-model="D461" />
  127. <button type="primary" class="button" @click="update('D461',D461)">
  128. <p class="p2">{{$t('parameters.update')}}</P>
  129. </button>
  130. </view>
  131. </view>
  132. <!-- //320特有 -->
  133. <view class="" v-show="equimentType=='MG320' || equimentType=='MG330'">
  134. <view class="line2"></view>
  135. <view class="body">
  136. <p class="p">{{$t('generalParameters.headDuringHumidification')}}:</p>
  137. <input class="input" type="text" v-model="D467" />
  138. <button type="primary" class="button" @click="update('D467',D467)">
  139. <p class="p2">{{$t('parameters.update')}}</P>
  140. </button>
  141. </view>
  142. <view class="line2"></view>
  143. <view class="body">
  144. <p class="p">{{$t('generalParameters.humidificationMonitoringTime')}}:</p>
  145. <input class="input" type="text" v-model="D468" />
  146. <button type="primary" class="button" @click="update('D468',D468)">
  147. <p class="p2">{{$t('parameters.update')}}</P>
  148. </button>
  149. </view>
  150. <view class="line2"></view>
  151. <view class="body">
  152. <p class="p">{{$t('generalParameters.humidificationOFFTime')}}:</p>
  153. <input class="input" type="text" v-model="D475" />
  154. <button type="primary" class="button" @click="update('D475',D475)">
  155. <p class="p2">{{$t('parameters.update')}}</P>
  156. </button>
  157. </view>
  158. <view class="line2"></view>
  159. <view class="body">
  160. <p class="p">{{$t('generalParameters.humidificationONTime')}}:</p>
  161. <input class="input" type="text" v-model="D476" />
  162. <button type="primary" class="button" @click="update('D476',D476)">
  163. <p class="p2">{{$t('parameters.update')}}</P>
  164. </button>
  165. </view>
  166. <view class="line2"></view>
  167. <view class="body">
  168. <p class="p">{{$t('generalParameters.humidificationStartDelay')}}:</p>
  169. <input class="input" type="text" v-model="D477" />
  170. <button type="primary" class="button" @click="update('D477',D477)">
  171. <p class="p2">{{$t('parameters.update')}}</P>
  172. </button>
  173. </view>
  174. <view class="line2"></view>
  175. <view class="body">
  176. <p class="p">{{$t('generalParameters.humidificationStopDelay')}}:</p>
  177. <input class="input" type="text" v-model="D478" />
  178. <button type="primary" class="button" @click="update('D478',D478)">
  179. <p class="p2">{{$t('parameters.update')}}</P>
  180. </button>
  181. </view>
  182. <view class="line2"></view>
  183. <view class="body">
  184. <p class="p">{{$t('generalParameters.manipulatorWaitingTime')}}:</p>
  185. <input class="input" type="text" v-model="D471" />
  186. <button type="primary" class="button" @click="update('D471',D471)">
  187. <p class="p2">{{$t('parameters.update')}}</P>
  188. </button>
  189. </view>
  190. </view>
  191. <!-- 301和280特有 -->
  192. <view class="" v-show="equimentType=='MG301'||equimentType=='MG280'">
  193. <view class="line2"></view>
  194. <view class="body">
  195. <p class="p">{{$t('generalParameters.referenceCoefficient')}}:</p>
  196. <input class="input" type="text" v-model="D444" />
  197. <button type="primary" class="button" @click="update('D444',D444)">
  198. <p class="p2">{{$t('parameters.update')}}</P>
  199. </button>
  200. </view>
  201. <view class="line2"></view>
  202. <view class="body">
  203. <p class="p">{{$t('generalParameters.referenceHumidity')}}:</p>
  204. <input class="input" type="text" v-model="D445" />
  205. <button type="primary" class="button" @click="update('D445',D445)">
  206. <p class="p2">{{$t('parameters.update')}}</P>
  207. </button>
  208. </view>
  209. </view>
  210. <!-- 280特有 -->
  211. <view class="" v-show="equimentType=='MG280'">
  212. <view class="line2"></view>
  213. <view class="body">
  214. <p class="p">{{$t('generalParameters.humidificationOFFTime')}}:</p>
  215. <input class="input" type="text" v-model="D472" />
  216. <button type="primary" class="button" @click="update('D472',D472)">
  217. <p class="p2">{{$t('parameters.update')}}</P>
  218. </button>
  219. </view>
  220. <view class="line2"></view>
  221. <view class="body">
  222. <p class="p">{{$t('generalParameters.humidificationONTime')}}:</p>
  223. <input class="input" type="text" v-model="D473" />
  224. <button type="primary" class="button" @click="update('D473',D473)">
  225. <p class="p2">{{$t('parameters.update')}}</P>
  226. </button>
  227. </view>
  228. </view>
  229. </view>
  230. <view class="line2"></view>
  231. </view>
  232. </template>
  233. <script>
  234. import {
  235. mapState,
  236. mapActions,
  237. mapMutations
  238. } from 'vuex'
  239. export default {
  240. data() {
  241. return {
  242. D418: 0,
  243. D405: 0,
  244. D406: 0,
  245. D407: 0,
  246. D408: 0,
  247. D409: 0,
  248. D412: 0,
  249. D416: 0,
  250. D460: 0,
  251. D461: 0,
  252. D419: 0,
  253. D435: 0,
  254. D467: 0,
  255. D468: 0,
  256. M504: 0,
  257. D475: 0,
  258. D476: 0,
  259. D477: 0,
  260. D478: 0,
  261. D471: 0,
  262. D444: 0,
  263. D445: 0,
  264. D472: 0,
  265. D473: 0,
  266. index: null,
  267. equipmentName: null,
  268. equimentType: null,
  269. equipmentId:null,
  270. equipmentNameList: [],
  271. globalUser: null,
  272. show: true,
  273. searchClientId:null
  274. }
  275. },
  276. onShow() {
  277. var token = uni.getStorageSync("token");
  278. this.globalUser = uni.getStorageSync("globalUser");
  279. uni.setNavigationBarTitle({
  280. title: this.$t('parameters.general')
  281. });
  282. if (token.length > 1) {
  283. this.getEquipmentListData();
  284. // this.getParam();
  285. } else {
  286. uni.reLaunch({
  287. url: '../Login/Login',
  288. });
  289. }
  290. },
  291. methods: {
  292. ...mapActions('chart', ['getParameters', 'updateParameters', 'getEquipmentListByUser']),
  293. getEquipmentListData() {
  294. this.getEquipmentListByUser(this.globalUser)
  295. .then(data => {
  296. // this.merchantList = data;
  297. var listName = data[0].equipmentList;
  298. var equipmentNameList = [];
  299. for (var i = 0; i < listName.length; i++) {
  300. equipmentNameList.push(this.$t('common.name') + listName[i].name + ' , '+ this.$t('common.ID') + listName[i].clientId.substring(
  301. listName[i].clientId.length - 6, listName[i].clientId.length));
  302. }
  303. this.equipmentNameList = equipmentNameList;
  304. var listId = data[0].id;
  305. if (listId != null && listId != '1') {
  306. uni.setStorageSync("listName", listName);
  307. }
  308. uni.stopPullDownRefresh();
  309. }, _ => void uni.stopPullDownRefresh());
  310. },
  311. search(){
  312. var clientId = this.searchClientId;
  313. var list = uni.getStorageSync("listName");
  314. var n = 0;
  315. for (var i = 0; i < list.length; i++) {
  316. var code = list[i].clientId.substring(list[i].clientId.length - 6, list[i].clientId.length);
  317. if(code==clientId){
  318. n++;
  319. this.D418=null;
  320. this.D405=null;
  321. this.D406=null;
  322. this.D407=null;
  323. this.D408=null;
  324. this.D409=null;
  325. this.D412=null;
  326. this.D416=null;
  327. this.D460=null;
  328. this.D461=null;
  329. this.D419=null;
  330. this.D435=null;
  331. this.D467=null;
  332. this.D468=null;
  333. this.M504=null;
  334. this.D475=null;
  335. this.D476=null;
  336. this.D477=null;
  337. this.D478=null;
  338. this.D471=null;
  339. this.D444=null;
  340. this.D445=null;
  341. this.D472=null;
  342. this.D473=null;
  343. this.index = i;
  344. var id = list[i].id;
  345. this.equipmentId = id;
  346. this.equimentType = list[i].equimentType;
  347. this.clientId = list[i].clientId;
  348. this.show = true;
  349. if (this.equimentType == 'MG280') {
  350. this.show = false;
  351. }
  352. this.getParam();
  353. break;
  354. }
  355. }
  356. if(n==0){
  357. uni.showModal({
  358. title: this.$t('common.tip'),
  359. content: this.$t('common.noDevice'),
  360. success: (res) => {
  361. }
  362. })
  363. }
  364. },
  365. //改变机器
  366. changeEquipment: function(e) {
  367. this.D418=null;
  368. this.D405=null;
  369. this.D406=null;
  370. this.D407=null;
  371. this.D408=null;
  372. this.D409=null;
  373. this.D412=null;
  374. this.D416=null;
  375. this.D460=null;
  376. this.D461=null;
  377. this.D419=null;
  378. this.D435=null;
  379. this.D467=null;
  380. this.D468=null;
  381. this.M504=null;
  382. this.D475=null;
  383. this.D476=null;
  384. this.D477=null;
  385. this.D478=null;
  386. this.D471=null;
  387. this.D444=null;
  388. this.D445=null;
  389. this.D472=null;
  390. this.D473=null;
  391. this.searchClientId = null;
  392. this.index = e.target.value;
  393. var list = uni.getStorageSync("listName");
  394. // this.getProName(list[e.target.value].id);
  395. this.equipmentId = list[e.target.value].id;
  396. this.equimentType = list[e.target.value].equimentType;
  397. this.clientId = list[e.target.value].clientId;
  398. this.show = true;
  399. if (this.equimentType == 'MG280') {
  400. this.show = false;
  401. }
  402. // console.log("eid==" + this.equipmentId);
  403. // console.log("equimentType==" + this.equimentType);
  404. this.getParam();
  405. },
  406. getParam() {
  407. const param = {};
  408. param['id'] = this.equipmentId;
  409. // 0:通用参数; 1:进阶参数
  410. param['status'] = '0';
  411. param['clientId'] = this.clientId;
  412. this.getParameters(param).then(res => {
  413. var code = res.code;
  414. if(code==false){
  415. uni.showToast({
  416. title: data.data.message,
  417. duration: 2000
  418. });
  419. return;
  420. }
  421. var info = res.data;
  422. if (info != null || info != '') {
  423. for (var i = 0; i < info.length; i++) {
  424. if (info[i].name == 'D418') {
  425. this.D418 = info[i].val;
  426. }
  427. if (info[i].name == 'D405') {
  428. this.D405 = info[i].val;
  429. }
  430. if (info[i].name == 'D406') {
  431. this.D406 = info[i].val;
  432. }
  433. if (info[i].name == 'D407') {
  434. this.D407 = info[i].val;
  435. }
  436. if (info[i].name == 'D408') {
  437. this.D408 = info[i].val;
  438. }
  439. if (info[i].name == 'D409') {
  440. this.D409 = info[i].val;
  441. }
  442. if (info[i].name == 'D412') {
  443. this.D412 = info[i].val;
  444. }
  445. if (info[i].name == 'D416') {
  446. this.D416 = info[i].val;
  447. }
  448. if (info[i].name == 'D460') {
  449. this.D460 = info[i].val;
  450. }
  451. if (info[i].name == 'D461') {
  452. this.D461 = info[i].val;
  453. }
  454. if (info[i].name == 'D419') {
  455. this.D419 = info[i].val;
  456. }
  457. if (info[i].name == 'D435') {
  458. this.D435 = info[i].val;
  459. }
  460. if (info[i].name == 'D467') {
  461. this.D467 = info[i].val;
  462. }
  463. if (info[i].name == 'D468') {
  464. this.D468 = info[i].val;
  465. }
  466. if (info[i].name == 'M504') {
  467. this.M504 = info[i].val;
  468. }
  469. if (info[i].name == 'D475') {
  470. this.D475 = info[i].val;
  471. }
  472. if (info[i].name == 'D476') {
  473. this.D476 = info[i].val;
  474. }
  475. if (info[i].name == 'D477') {
  476. this.D477 = info[i].val;
  477. }
  478. if (info[i].name == 'D478') {
  479. this.D478 = info[i].val;
  480. }
  481. if (info[i].name == 'D471') {
  482. this.D471 = info[i].val;
  483. }
  484. if (info[i].name == 'D444') {
  485. this.D444 = info[i].val;
  486. }
  487. if (info[i].name == 'D445') {
  488. this.D445 = info[i].val;
  489. }
  490. if (info[i].name == 'D472') {
  491. this.D472 = info[i].val;
  492. }
  493. if (info[i].name == 'D473') {
  494. this.D473 = info[i].val;
  495. }
  496. }
  497. }
  498. }, _ => void uni.stopPullDownRefresh());
  499. },
  500. update(name, val) {
  501. const param = {};
  502. param['id'] = this.equipmentId;
  503. param['name'] = name;
  504. param['val'] = val;
  505. this.updateParameters(param).then(res => {
  506. if (res.data == 'SUCCESS') {
  507. uni.showToast({
  508. title: this.$t('common.success'),
  509. duration: 1000
  510. });
  511. }
  512. }, _ => void uni.stopPullDownRefresh());
  513. },
  514. },
  515. }
  516. </script>
  517. <style>
  518. .search{
  519. width: 100%;
  520. padding-top: 10upx;
  521. display: flex;
  522. flex-direction: row;
  523. justify-content: flex-start;
  524. }
  525. .search-title{
  526. width: 28%;
  527. text-align: center;
  528. font-size: 26upx;
  529. font-family: "PingFang-SC-Bold";
  530. }
  531. .search-input{
  532. width: 48%;
  533. height: 25px;
  534. text-align: center;
  535. font-size: 26upx;
  536. /* font-family: "PingFang-SC-Bold"; */
  537. box-shadow: 0upx 0upx 20upx #D3D3D3;
  538. border-radius: 5upx;
  539. }
  540. .search-button{
  541. width: 20%;
  542. padding-left: 10px;
  543. padding-bottom: 5px;
  544. text-align: center;
  545. height: 60upx;
  546. text-align: left;
  547. }
  548. .line {
  549. height: 50upx;
  550. }
  551. .line2 {
  552. height: 10upx;
  553. }
  554. .body {
  555. background-color: #FFFFFF;
  556. width: 98%;
  557. padding: 10upx 10upx 10upx 10upx;
  558. display: flex;
  559. flex-direction: row;
  560. justify-content: flex-start;
  561. font-size: 32upx;
  562. }
  563. .p {
  564. width: 50%;
  565. text-align: right;
  566. }
  567. .input {
  568. width: 20%;
  569. box-shadow: 0upx 0upx 20upx #D3D3D3;
  570. border-radius: 5upx;
  571. margin-left: 10px;
  572. padding-top: 5px;
  573. text-align: center;
  574. }
  575. .button {
  576. width: 15%;
  577. height: 60upx;
  578. text-align: left;
  579. border-radius: 10upx;
  580. }
  581. .p2 {
  582. font-size: 25upx;
  583. /* #ifndef H5 */
  584. padding-top: 3upx;
  585. /* #endif */
  586. position: absolute;
  587. /* 水平居中 */
  588. left: 50%;
  589. -webkit-transform: translateX(-50%);
  590. transform: translateX(-50%);
  591. }
  592. </style>