generalParameters.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  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. import {
  240. dateUtils
  241. } from '@/common/util.js';
  242. export default {
  243. data() {
  244. return {
  245. D418: 0,
  246. D405: 0,
  247. D406: 0,
  248. D407: 0,
  249. D408: 0,
  250. D409: 0,
  251. D412: 0,
  252. D416: 0,
  253. D460: 0,
  254. D461: 0,
  255. D419: 0,
  256. D435: 0,
  257. D467: 0,
  258. D468: 0,
  259. M504: 0,
  260. D475: 0,
  261. D476: 0,
  262. D477: 0,
  263. D478: 0,
  264. D471: 0,
  265. D444: 0,
  266. D445: 0,
  267. D472: 0,
  268. D473: 0,
  269. index: null,
  270. equipmentName: null,
  271. equimentType: null,
  272. equipmentId:null,
  273. equipmentNameList: [],
  274. globalUser: null,
  275. show: true,
  276. searchClientId:null
  277. }
  278. },
  279. onShow() {
  280. var token = uni.getStorageSync("token");
  281. this.globalUser = uni.getStorageSync("globalUser");
  282. this.globalUser.todayDate = dateUtils.getCurrentDate();
  283. uni.setNavigationBarTitle({
  284. title: this.$t('parameters.general')
  285. });
  286. if (token.length > 1) {
  287. this.getEquipmentListData();
  288. // this.getParam();
  289. } else {
  290. uni.reLaunch({
  291. url: '../Login/Login',
  292. });
  293. }
  294. },
  295. methods: {
  296. ...mapActions('chart', ['getParameters', 'updateParameters', 'getEquipmentListByUser']),
  297. getEquipmentListData() {
  298. this.getEquipmentListByUser(this.globalUser)
  299. .then(data => {
  300. // this.merchantList = data;
  301. var listName = data[0].equipmentList;
  302. var equipmentNameList = [];
  303. for (var i = 0; i < listName.length; i++) {
  304. equipmentNameList.push(this.$t('common.name') + listName[i].name + ' , '+ this.$t('common.ID') + listName[i].clientId.substring(
  305. listName[i].clientId.length - 6, listName[i].clientId.length));
  306. }
  307. this.equipmentNameList = equipmentNameList;
  308. var listId = data[0].id;
  309. if (listId != null && listId != '1') {
  310. uni.setStorageSync("listName", listName);
  311. }
  312. uni.stopPullDownRefresh();
  313. }, _ => void uni.stopPullDownRefresh());
  314. },
  315. search(){
  316. var clientId = this.searchClientId;
  317. var list = uni.getStorageSync("listName");
  318. var n = 0;
  319. for (var i = 0; i < list.length; i++) {
  320. var code = list[i].clientId.substring(list[i].clientId.length - 6, list[i].clientId.length);
  321. if(code==clientId){
  322. n++;
  323. this.D418=null;
  324. this.D405=null;
  325. this.D406=null;
  326. this.D407=null;
  327. this.D408=null;
  328. this.D409=null;
  329. this.D412=null;
  330. this.D416=null;
  331. this.D460=null;
  332. this.D461=null;
  333. this.D419=null;
  334. this.D435=null;
  335. this.D467=null;
  336. this.D468=null;
  337. this.M504=null;
  338. this.D475=null;
  339. this.D476=null;
  340. this.D477=null;
  341. this.D478=null;
  342. this.D471=null;
  343. this.D444=null;
  344. this.D445=null;
  345. this.D472=null;
  346. this.D473=null;
  347. this.index = i;
  348. var id = list[i].id;
  349. this.equipmentId = id;
  350. this.equimentType = list[i].equimentType;
  351. this.clientId = list[i].clientId;
  352. this.show = true;
  353. if (this.equimentType == 'MG280') {
  354. this.show = false;
  355. }
  356. this.getParam();
  357. break;
  358. }
  359. }
  360. if(n==0){
  361. uni.showModal({
  362. title: this.$t('common.tip'),
  363. content: this.$t('common.noDevice'),
  364. success: (res) => {
  365. }
  366. })
  367. }
  368. },
  369. //改变机器
  370. changeEquipment: function(e) {
  371. this.D418=null;
  372. this.D405=null;
  373. this.D406=null;
  374. this.D407=null;
  375. this.D408=null;
  376. this.D409=null;
  377. this.D412=null;
  378. this.D416=null;
  379. this.D460=null;
  380. this.D461=null;
  381. this.D419=null;
  382. this.D435=null;
  383. this.D467=null;
  384. this.D468=null;
  385. this.M504=null;
  386. this.D475=null;
  387. this.D476=null;
  388. this.D477=null;
  389. this.D478=null;
  390. this.D471=null;
  391. this.D444=null;
  392. this.D445=null;
  393. this.D472=null;
  394. this.D473=null;
  395. this.searchClientId = null;
  396. this.index = e.target.value;
  397. var list = uni.getStorageSync("listName");
  398. // this.getProName(list[e.target.value].id);
  399. this.equipmentId = list[e.target.value].id;
  400. this.equimentType = list[e.target.value].equimentType;
  401. this.clientId = list[e.target.value].clientId;
  402. this.show = true;
  403. if (this.equimentType == 'MG280') {
  404. this.show = false;
  405. }
  406. // console.log("eid==" + this.equipmentId);
  407. // console.log("equimentType==" + this.equimentType);
  408. this.getParam();
  409. },
  410. getParam() {
  411. const param = {};
  412. param['id'] = this.equipmentId;
  413. // 0:通用参数; 1:进阶参数
  414. param['status'] = '0';
  415. param['clientId'] = this.clientId;
  416. this.getParameters(param).then(res => {
  417. var code = res.code;
  418. if(code==false){
  419. uni.showToast({
  420. title: data.data.message,
  421. duration: 2000
  422. });
  423. return;
  424. }
  425. var info = res.data;
  426. if (info != null || info != '') {
  427. for (var i = 0; i < info.length; i++) {
  428. if (info[i].name == 'D418') {
  429. this.D418 = info[i].val;
  430. }
  431. if (info[i].name == 'D405') {
  432. this.D405 = info[i].val;
  433. }
  434. if (info[i].name == 'D406') {
  435. this.D406 = info[i].val;
  436. }
  437. if (info[i].name == 'D407') {
  438. this.D407 = info[i].val;
  439. }
  440. if (info[i].name == 'D408') {
  441. this.D408 = info[i].val;
  442. }
  443. if (info[i].name == 'D409') {
  444. this.D409 = info[i].val;
  445. }
  446. if (info[i].name == 'D412') {
  447. this.D412 = info[i].val;
  448. }
  449. if (info[i].name == 'D416') {
  450. this.D416 = info[i].val;
  451. }
  452. if (info[i].name == 'D460') {
  453. this.D460 = info[i].val;
  454. }
  455. if (info[i].name == 'D461') {
  456. this.D461 = info[i].val;
  457. }
  458. if (info[i].name == 'D419') {
  459. this.D419 = info[i].val;
  460. }
  461. if (info[i].name == 'D435') {
  462. this.D435 = info[i].val;
  463. }
  464. if (info[i].name == 'D467') {
  465. this.D467 = info[i].val;
  466. }
  467. if (info[i].name == 'D468') {
  468. this.D468 = info[i].val;
  469. }
  470. if (info[i].name == 'M504') {
  471. this.M504 = info[i].val;
  472. }
  473. if (info[i].name == 'D475') {
  474. this.D475 = info[i].val;
  475. }
  476. if (info[i].name == 'D476') {
  477. this.D476 = info[i].val;
  478. }
  479. if (info[i].name == 'D477') {
  480. this.D477 = info[i].val;
  481. }
  482. if (info[i].name == 'D478') {
  483. this.D478 = info[i].val;
  484. }
  485. if (info[i].name == 'D471') {
  486. this.D471 = info[i].val;
  487. }
  488. if (info[i].name == 'D444') {
  489. this.D444 = info[i].val;
  490. }
  491. if (info[i].name == 'D445') {
  492. this.D445 = info[i].val;
  493. }
  494. if (info[i].name == 'D472') {
  495. this.D472 = info[i].val;
  496. }
  497. if (info[i].name == 'D473') {
  498. this.D473 = info[i].val;
  499. }
  500. }
  501. }
  502. }, _ => void uni.stopPullDownRefresh());
  503. },
  504. update(name, val) {
  505. const param = {};
  506. param['id'] = this.equipmentId;
  507. param['name'] = name;
  508. param['val'] = val;
  509. this.updateParameters(param).then(res => {
  510. if (res.data == 'SUCCESS') {
  511. uni.showToast({
  512. title: this.$t('common.success'),
  513. duration: 1000
  514. });
  515. }
  516. }, _ => void uni.stopPullDownRefresh());
  517. },
  518. },
  519. }
  520. </script>
  521. <style>
  522. .search{
  523. width: 100%;
  524. padding-top: 10upx;
  525. display: flex;
  526. flex-direction: row;
  527. justify-content: flex-start;
  528. }
  529. .search-title{
  530. width: 28%;
  531. text-align: center;
  532. font-size: 26upx;
  533. font-family: "PingFang-SC-Bold";
  534. }
  535. .search-input{
  536. width: 48%;
  537. height: 25px;
  538. text-align: center;
  539. font-size: 26upx;
  540. /* font-family: "PingFang-SC-Bold"; */
  541. box-shadow: 0upx 0upx 20upx #D3D3D3;
  542. border-radius: 5upx;
  543. }
  544. .search-button{
  545. width: 20%;
  546. padding-left: 10px;
  547. padding-bottom: 5px;
  548. text-align: center;
  549. height: 60upx;
  550. text-align: left;
  551. }
  552. .line {
  553. height: 50upx;
  554. }
  555. .line2 {
  556. height: 10upx;
  557. }
  558. .body {
  559. background-color: #FFFFFF;
  560. width: 98%;
  561. padding: 10upx 10upx 10upx 10upx;
  562. display: flex;
  563. flex-direction: row;
  564. justify-content: flex-start;
  565. font-size: 32upx;
  566. }
  567. .p {
  568. width: 50%;
  569. text-align: right;
  570. }
  571. .input {
  572. width: 20%;
  573. box-shadow: 0upx 0upx 20upx #D3D3D3;
  574. border-radius: 5upx;
  575. margin-left: 10px;
  576. padding-top: 5px;
  577. text-align: center;
  578. }
  579. .button {
  580. width: 15%;
  581. height: 60upx;
  582. text-align: left;
  583. border-radius: 10upx;
  584. }
  585. .p2 {
  586. font-size: 25upx;
  587. /* #ifndef H5 */
  588. padding-top: 3upx;
  589. /* #endif */
  590. position: absolute;
  591. /* 水平居中 */
  592. left: 50%;
  593. -webkit-transform: translateX(-50%);
  594. transform: translateX(-50%);
  595. }
  596. </style>