detail.vue 44 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779
  1. <template>
  2. <view class="container">
  3. <u-navbar leftIconColor="#fff" titleStyle="color:#fff;fontSize:36rpx;" :autoBack="true" bgColor="#2C6FF3"
  4. :placeholder="true" title="设备详情">
  5. </u-navbar>
  6. <view class="content">
  7. <view class="xy-card">
  8. <view class="top">
  9. <view>
  10. <view class="t-left">
  11. <view v-if="detail.deviceName">{{detail.deviceName}}<text
  12. style="color: #666;font-size: 26rpx;">({{detail.deviceId}})</text></view>
  13. <view v-else>{{detail.deviceId}}</view>
  14. </view>
  15. <view class="flex" style="white-space: nowrap;">
  16. <view :class="[detail.netStateName=='在线'?'t-right':'t-right off']">
  17. {{detail.netStateName||'离线'}}
  18. </view>
  19. <view :class="[detail.busyState==1?'t-right':'t-right off']">
  20. {{detail.busyState==1?'运营中':'已停运'}}
  21. </view>
  22. </view>
  23. </view>
  24. <view style="margin-top: 24rpx;">
  25. <xbutton size="mini" style="margin-right:12rpx;" bgColor="#fff" borderColor="#2C6FF3"
  26. color="#2C6FF3" @click="downloadQr">下载柜门二维码</xbutton>
  27. <xbutton size="mini" @click="btnClick('编辑')">编辑</xbutton>
  28. </view>
  29. </view>
  30. <view :class="[isMore?'center center-more':'center']">
  31. <view class="d-line">
  32. <view class="c-item">
  33. <view class="name">
  34. 编号:
  35. </view>
  36. <view class="val">
  37. {{detail.deviceId||'/'}}
  38. <text @click="copy(detail.deviceId)" v-if="detail.mercDeviceCode">复制</text>
  39. </view>
  40. </view>
  41. <view class="c-item">
  42. <view class="name">
  43. 商户:
  44. </view>
  45. <view class="val">
  46. {{detail.mercName||'/'}}
  47. </view>
  48. </view>
  49. </view>
  50. <view class="d-line">
  51. <view class="c-item">
  52. <view class="name">
  53. 温度:
  54. </view>
  55. <view class="val">
  56. {{detail.deviceStatus.tempValue}}℃
  57. </view>
  58. </view>
  59. <view class="c-item">
  60. <view class="name">
  61. 信号强度:
  62. </view>
  63. <view class="val net">
  64. {{detail.deviceStatus.netDbm||'/'}}d<text
  65. v-if="detail.deviceStatus.netDbm<-90">(弱)</text>
  66. <text
  67. v-else-if="detail.deviceStatus.netDbm>-90&&detail.deviceStatus.netDbm<-40">(中)</text>
  68. <text
  69. v-else-if="detail.deviceStatus.netDbm>-40&&detail.deviceStatus.netDbm<0">(强)</text>
  70. <text v-else-if="detail.deviceStatus.netDbm==0">(无)</text>
  71. </view>
  72. </view>
  73. </view>
  74. <view class="c-item">
  75. <view class="name">
  76. 软件版本:
  77. </view>
  78. <view class="val">
  79. {{detail.deviceSysinfo.appUpmVersion||'/'}}
  80. </view>
  81. </view>
  82. <view class="c-item">
  83. <view class="name">
  84. 最后更新时间:
  85. </view>
  86. <view class="val">
  87. {{detail.updateTime||'/'}}
  88. </view>
  89. </view>
  90. <view class="c-item">
  91. <view class="name">
  92. 激活状态:
  93. </view>
  94. <view class="val" v-if="detail.activeState==1">
  95. 已激活
  96. </view>
  97. <view class="val" v-else>
  98. 未激活
  99. </view>
  100. </view>
  101. <view class="c-item">
  102. <view class="name">
  103. 激活时间:
  104. </view>
  105. <view class="val">
  106. {{detail.activeTime||'/'}}
  107. </view>
  108. </view>
  109. <view class="c-item">
  110. <view class="name">
  111. 区域:
  112. </view>
  113. <view class="val">
  114. {{detail.districtName||'/'}}
  115. </view>
  116. </view>
  117. <view class="d-line">
  118. <view class="c-item">
  119. <view class="name">
  120. 点位:
  121. </view>
  122. <view class="val">
  123. {{detail.placeName||'/'}}
  124. </view>
  125. </view>
  126. <view class="c-item">
  127. <view class="name">
  128. 线路:
  129. </view>
  130. <view class="val">
  131. {{detail.placeLineName||'/'}}
  132. </view>
  133. </view>
  134. </view>
  135. <view class="c-item">
  136. <view class="name">
  137. 设备位置:
  138. </view>
  139. <view class="val" @click="showPos" style="width:120rpx;">
  140. <u-icon slot="right" size="20" name="map"></u-icon>
  141. </view>
  142. </view>
  143. <view class="unfold" @click="isMore=!isMore">
  144. <u-icon :name="isMore?'arrow-down':'arrow-up'" color="#999" size="20"></u-icon>
  145. </view>
  146. </view>
  147. <view class="bot">
  148. <view>
  149. <button class="cu-btn cu-btn1" style="width:150rpx;" @click="btnClick('设备重启')">设备重启</button>
  150. </view>
  151. <view>
  152. <button class="cu-btn cu-btn2" style="width:140rpx;" @click="btnClick('声音设置')">声音设置</button>
  153. </view>
  154. <view>
  155. <button class="cu-btn cu-btn2" style="width: 140rpx;" @click="btnClick('温度设置')">温度设置</button>
  156. </view>
  157. <view>
  158. <button class="cu-btn cu-btn2" style="width: 140rpx;" @click="btnClick('灯光设置')">灯光设置</button>
  159. </view>
  160. </view>
  161. <view class="bot">
  162. <view>
  163. <button class="cu-btn cu-btn2" style="width: 140rpx;" @click="btnClick('清除故障')">清除故障</button>
  164. </view>
  165. <view>
  166. <button class="cu-btn cu-btn3" style="width: 140rpx;"
  167. @click="btnClick(btnState)">{{btnState}}</button>
  168. </view>
  169. </view>
  170. </view>
  171. <view class="xy-card" style="width:750rpx;margin-left: -24rpx;border-radius: 0;">
  172. <u-tabs :list="chartTab" :scrollable="false" @click="tabClick" lineColor="#2C6FF3"></u-tabs>
  173. </view>
  174. <view class="xy-card">
  175. <view class="chart-content">
  176. <view class="total" v-if="current=='经营数据'">
  177. <view style="width:200rpx;">
  178. <u-subsection activeColor="#2C6FF3" :list="totalTab" :current="time" @change="totalChange">
  179. </u-subsection>
  180. </view>
  181. <view class="t-content">
  182. <view class="t-item">
  183. <view class="t-name">
  184. 销售额
  185. </view>
  186. <view class="t-num">
  187. ¥<text>{{$xy.delMoney(countData.salesMoney)}}</text>
  188. </view>
  189. </view>
  190. <view class="t-item">
  191. <view class="t-name">
  192. 订单数
  193. </view>
  194. <view class="t-num">
  195. <text>{{countData.salesCount||0}}</text>
  196. </view>
  197. </view>
  198. <view class="t-item">
  199. <view class="t-name">
  200. 退款
  201. </view>
  202. <view class="t-num">
  203. ¥<text>{{$xy.delMoney(countData.refundMoney)}}</text>
  204. </view>
  205. </view>
  206. </view>
  207. <view class="more-data">
  208. <xbutton width="140" @click="more">
  209. 销售统计
  210. </xbutton>
  211. </view>
  212. </view>
  213. <view class="chart" style="height: 600rpx;" v-else>
  214. <qiun-data-charts canvasId="canvasString" :canvas2d="true" :ontouch="true" type="line"
  215. :opts="opts" :chartData="chartData" :errorMessage="errorMessage" />
  216. </view>
  217. </view>
  218. </view>
  219. <view class="xy-card">
  220. <view class="title">
  221. 商品管理
  222. </view>
  223. <view class="t-content">
  224. <view class="t-item">
  225. <view class="t-name">
  226. 在售商品种类
  227. </view>
  228. <view class="t-num">
  229. <text>{{goodsManageData.categoryNum||0}}</text>种
  230. </view>
  231. </view>
  232. <view class="t-item">
  233. <view class="t-name">
  234. 在售库存
  235. </view>
  236. <view class="t-num">
  237. <text>{{goodsManageData.stock||0}}</text>
  238. </view>
  239. </view>
  240. <view class="t-item">
  241. <view class="t-name">
  242. 上次补货后库存
  243. </view>
  244. <view class="t-num">
  245. <text>{{goodsManageData.afterFillStock||0}}</text>
  246. </view>
  247. </view>
  248. </view>
  249. <view class="bot bot1">
  250. <button class="cu-btn cu-btn2" style="width:140rpx;"
  251. @click="$tab.navigateTo(`/pages/equipment/comManage?id=${id}&deviceName=${detail.deviceName}`)">管理商品</button>
  252. <button class="cu-btn cu-btn2" style="width: 140rpx;margin:0 12rpx;"
  253. @click="$tab.navigateTo(`/pages/replenish/replenishmentRecord?id=${id}`)">补货记录</button>
  254. <button class="cu-btn cu-btn3" style="width: 140rpx;"
  255. @click="$tab.navigateTo(`/pages/replenish/replenishmentHomePage?id=${id}&&deviceName=${detail.deviceName}`)">补货</button>
  256. </view>
  257. </view>
  258. <xpopup :show="qrcodeShow" mode="center" @close="qrcodeClose" :showBtn="false">
  259. <view class="qrcode-content flex flex-direction align-center">
  260. <view class="canvas-box">
  261. <u--image width="400rpx" height="400rpx" :src="qrCodeImg" mode="aspectFit"
  262. :lazy-load="true"></u--image>
  263. </view>
  264. <view class="save-qrcode" slot="botton">
  265. <xbutton @click="handleImgSave">保存二维码</xbutton>
  266. </view>
  267. </view>
  268. </xpopup>
  269. <!-- <view class="xy-card">
  270. <view class="title">
  271. 在线情况
  272. </view>
  273. <scroll-view style="height: 410rpx;" scroll-y>
  274. <view class="l-content" v-if="netRecords&&netRecords.length>0">
  275. <view class="l-item" v-for="(item,index) in netRecords" :key="item.id">
  276. <view class="l-time">
  277. {{item.createTime}}
  278. </view>
  279. <view class="l-status">
  280. {{item.netStatus}}
  281. </view>
  282. </view>
  283. </view>
  284. <view class="l-content" v-else>
  285. <u-empty text="没有记录~"></u-empty>
  286. </view>
  287. </scroll-view>
  288. </view>
  289. <view class="xy-card">
  290. <view class="title">
  291. 锁异常记录
  292. </view>
  293. <scroll-view style="height: 410rpx;" scroll-y>
  294. <view class="l-content" v-if="errRecordLock&&errRecordLock.length>0">
  295. <view class="l-item" v-for="(item,index) in errRecordLock" :key="item.id">
  296. <view class="l-time">
  297. {{item.createTime}}
  298. </view>
  299. <view class="l-status">
  300. {{item.errorDescript}}
  301. </view>
  302. </view>
  303. </view>
  304. <view class="l-content" v-else>
  305. <u-empty text="设备状态很好,没有异常~"></u-empty>
  306. </view>
  307. </scroll-view>
  308. </view>
  309. <view class="xy-card">
  310. <view class="title">
  311. 摄像头故障记录
  312. </view>
  313. <scroll-view style="height: 410rpx;" scroll-y>
  314. <view class="l-content" v-if="errRecordCamera&&errRecordCamera.length>0">
  315. <view class="l-item" v-for="(item,index) in errRecordCamera" :key="item.id">
  316. <view class="l-time">
  317. {{item.createTime}}
  318. </view>
  319. <view class="l-status">
  320. {{item.errorDescript}}
  321. </view>
  322. </view>
  323. </view>
  324. <view class="l-content" v-else>
  325. <u-empty text="设备状态很好,没有任何故障~"></u-empty>
  326. </view>
  327. </scroll-view>
  328. </view>
  329. <view class="xy-card">
  330. <view class="title">
  331. 温度记录
  332. </view>
  333. <scroll-view style="height: 410rpx;" scroll-y>
  334. <view class="l-content" v-if="deviceTempRecords&&deviceTempRecords.length>0">
  335. <view class="l-item" v-for="(item,index) in deviceTempRecords" :key="item.id">
  336. <view class="l-time">
  337. {{item.createTime}}
  338. </view>
  339. <view class="l-status">
  340. 温度为:{{item.tempValue}}
  341. </view>
  342. </view>
  343. </view>
  344. <view class="l-content" v-else>
  345. <u-empty text="没有温度信息~"></u-empty>
  346. </view>
  347. </scroll-view>
  348. </view>
  349. <view class="xy-card">
  350. <view class="title">
  351. 操作记录
  352. </view>
  353. <scroll-view style="height: 410rpx;" scroll-y>
  354. <view class="l-content" v-if="operaRecords&&operaRecords.length>0">
  355. <view class="l-item" v-for="(item,index) in operaRecords" :key="item.id">
  356. <view class="l-time">
  357. {{item.createTime}}
  358. </view>
  359. <view class="l-status">
  360. {{item.changeBefore}}变更为{{item.changeAfter}}
  361. </view>
  362. </view>
  363. </view>
  364. <view class="l-content" v-else>
  365. <u-empty text="没有任何记录~"></u-empty>
  366. </view>
  367. </scroll-view>
  368. </view> -->
  369. <xpopup :show="show" @close="close" @confirm="submit" :showBtn="true" :title="title">
  370. <!-- 设备编辑 -->
  371. <view class="popup-content" v-if="title=='编辑'">
  372. <u--form labelPosition="left" :model="editForm">
  373. <u-form-item labelWidth="90" label="名称" prop="name" borderBottom ref="item1">
  374. <u--input placeholder="设置机器名称" v-model="editForm.name" border="none"></u--input>
  375. </u-form-item>
  376. <u-form-item labelWidth="90" label="区域" prop="areaName" borderBottom ref="item1"
  377. @click.native="areaChoose">
  378. <u--input placeholder="设置机器区域" v-model="editForm.areaName" readonly
  379. border="none"></u--input>
  380. </u-form-item>
  381. <u-form-item labelWidth="90" label="线路" prop="lineName" borderBottom ref="item1"
  382. @click.native="lineChoose">
  383. <u--input placeholder="设置机器线路" v-model="editForm.lineName" readonly
  384. border="none"></u--input>
  385. </u-form-item>
  386. <u-form-item labelWidth="90" label="点位" prop="placeName" borderBottom ref="item1"
  387. @click.native="placeChoose">
  388. <u--input placeholder="设置机器点位" v-model="editForm.placeName" readonly
  389. border="none"></u--input>
  390. </u-form-item>
  391. <u-form-item labelWidth="90" label="位置" prop="lon" borderBottom @click.native="getLocation">
  392. <u--input placeholder="设置机器位置" readonly v-model="devicePos" border="none"></u--input>
  393. <u-icon slot="right" size="26" name="map"></u-icon>
  394. </u-form-item>
  395. </u--form>
  396. </view>
  397. <!-- 设备重启 -->
  398. <view class="popup-content restart" v-if="title=='设备重启'">
  399. 是否确定重启设备?
  400. </view>
  401. <!-- 暂停营业 -->
  402. <view class="popup-content restart" v-if="title=='暂停营业'||title=='开始营业'">
  403. 是否确定{{btnState}}?
  404. </view>
  405. <!-- 声音设置 -->
  406. <view class="popup-content" v-if="title=='声音设置'">
  407. <u-slider :showValue="true" min="0" max="25" v-model="voice"></u-slider>
  408. </view>
  409. <!-- 温度设置 -->
  410. <view class="popup-content temp" v-if="title=='温度设置'">
  411. <view class="flex" style="margin-top: 0;">
  412. <view class="lab" style="margin-top: -10rpx;">工作模式:</view>
  413. <u-radio-group v-model="tempDetail.selTempWorkModel" placement="row">
  414. <u-radio :customStyle="{marginBottom:'16rpx',marginLeft:'16rpx'}"
  415. v-for="(item, index) in tempWorkModels" :key="index" :label="item.name" :name="item.id">
  416. </u-radio>
  417. </u-radio-group>
  418. </view>
  419. <view class="flex" style="margin-top: 0rpx; margin-bottom: 20rpx;">
  420. <view class="lab">工作温度(℃):</view>
  421. <view style=" margin-left: 20rpx;">
  422. <u-number-box button-size="30" v-model="tempDetail.targetTemp" class='martop'>
  423. </u-number-box>
  424. </view>
  425. </view>
  426. <view class="info">时段设置为X点至Y点,结束时间需大于起始时间</view>
  427. <view class="flex align-center">
  428. <view class="lab">时段1:</view>
  429. <view class="flex align-center date-container marleft"
  430. style="padding-left: 10rpx; padding-right: 10rpx;" @tap="pickerTimes('temp',0)">
  431. <view class="time-box">
  432. {{tempDetail.start1}}
  433. </view>
  434. <view class="lab to">至</view>
  435. <view class="time-box">{{tempDetail.end1}}</view>
  436. </view>
  437. </view>
  438. <view class="flex align-center">
  439. <view class="lab">时段2:</view>
  440. <view class="flex align-center date-container marleft"
  441. style="padding-left: 10rpx; padding-right: 10rpx;" @tap="pickerTimes('temp',1)">
  442. <view class="time-box">
  443. {{tempDetail.start2}}
  444. </view>
  445. <view class="lab to">至</view>
  446. <view class="time-box">{{tempDetail.end2}}</view>
  447. </view>
  448. </view>
  449. <view class="flex align-center">
  450. <view class="lab">时段3:</view>
  451. <view class="flex align-center date-container marleft"
  452. style="padding-left: 10rpx; padding-right: 10rpx;" @tap="pickerTimes('temp',2)">
  453. <view class="time-box">
  454. {{tempDetail.start3}}
  455. </view>
  456. <view class="lab to">至</view>
  457. <view class="time-box">{{tempDetail.end3}}</view>
  458. </view>
  459. </view>
  460. <view style="height: 20rpx;"></view>
  461. </view>
  462. <!-- 灯光设置 -->
  463. <view class="popup-content temp" v-if="title=='灯光设置'">
  464. <!-- <view class="flex" style="margin-top: 0;">
  465. <view class="lab" style="margin-top: -10rpx;">是否打开:</view>
  466. <u-switch v-model="lightDetail.open"></u-switch>
  467. </view> -->
  468. <view class="info">时段设置为X点至Y点,结束时间需大于起始时间</view>
  469. <view class="flex align-center">
  470. <view class="lab">时段1:</view>
  471. <view class="flex align-center date-container marleft"
  472. style="padding-left: 10rpx; padding-right: 10rpx;" @tap="pickerTimes('light',0)">
  473. <view class="time-box">
  474. {{lightDetail.start1}}
  475. </view>
  476. <view class="lab to">至</view>
  477. <view class="time-box">{{lightDetail.end1}}</view>
  478. </view>
  479. </view>
  480. <view class="flex align-center">
  481. <view class="lab">时段2:</view>
  482. <view class="flex align-center date-container marleft"
  483. style="padding-left: 10rpx; padding-right: 10rpx;" @tap="pickerTimes('light',1)">
  484. <view class="time-box">
  485. {{lightDetail.start2}}
  486. </view>
  487. <view class="lab to">至</view>
  488. <view class="time-box">{{lightDetail.end2}}</view>
  489. </view>
  490. </view>
  491. <view class="flex align-center">
  492. <view class="lab">时段3:</view>
  493. <view class="flex align-center date-container marleft"
  494. style="padding-left: 10rpx; padding-right: 10rpx;" @tap="pickerTimes('light',2)">
  495. <view class="time-box">
  496. {{lightDetail.start3}}
  497. </view>
  498. <view class="lab to">至</view>
  499. <view class="time-box">{{lightDetail.end3}}</view>
  500. </view>
  501. </view>
  502. <view style="height: 20rpx;"></view>
  503. </view>
  504. <!-- 清除故障 -->
  505. <view class="popup-content restart" v-if="title=='清除故障'">
  506. 是否确定清除故障?
  507. </view>
  508. </xpopup>
  509. <!-- 区域选择弹框 -->
  510. <xpopup :show="areaShow" @close="areaClose" :showBtn="false" title="选择区域">
  511. <!-- 类目选择 -->
  512. <scroll-view style="height: 600rpx;" scroll-y scroll-with-animation>
  513. <view class="popup-content">
  514. <tki-tree style="width:100%;" :range="areaList" :foldAll="false" rangeKey="name" idKey="name"
  515. buttonName="选中" @btnClick="areaSubmit">
  516. </tki-tree>
  517. </view>
  518. </scroll-view>
  519. </xpopup>
  520. <!-- 线路/点位 -->
  521. <u-picker :show="pickerShow" @confirm="pickerConfirm" :closeOnClickOverlay="true" :columns="columns"
  522. keyName="label" @close="pickerClose" @cancel="pickerClose"></u-picker>
  523. <!-- 温度时间选择 -->
  524. <u-picker :show="showTimeSelPicker" ref="uPicker" :columns="times" @confirm="pickerTimeConfirm"
  525. @change="pickerTimeChangeHandler"></u-picker>
  526. </view>
  527. <u-back-top :scroll-top="scrollTop" top="400"></u-back-top>
  528. </view>
  529. </template>
  530. <script>
  531. import {
  532. detail,
  533. dataCount,
  534. indexDeviceRecords,
  535. indexDeviceNetRecords,
  536. indexDeviceTempRecords,
  537. indexDeviceError,
  538. modifyBusyStage,
  539. updateInfo,
  540. sendCommand,
  541. queryCommandResult,
  542. exportQrCode,
  543. getQrCode,
  544. abort
  545. } from "@/api/device/device.js"
  546. import {
  547. areaTree
  548. } from "@/api/point/area"
  549. import {
  550. linePage,
  551. bindDevice
  552. } from "@/api/point/line"
  553. import config from '@/config'
  554. import {
  555. pointPage
  556. } from "@/api/point/point"
  557. import {
  558. bindDevice as bindDevicePoint
  559. } from "@/api/point/point"
  560. import {
  561. base64DownLoad
  562. } from '@/utils/download.js'
  563. export default {
  564. data() {
  565. return {
  566. opts: {
  567. padding: [15, 10, 0, 15],
  568. dataLabel: false,
  569. color: ['#2D54EC', '#F49B37'],
  570. // 开启图表可拖拽滚动
  571. // enableScroll: true,
  572. dataPointShape: false, //是否显示折线上的点
  573. xAxis: {
  574. // 开启图表可拖拽滚动后 必配置(显示多少个)
  575. // itemCount: 8,
  576. rotateLabel: true,
  577. labelCount: 10,
  578. marginTop: 10,
  579. },
  580. yAxis: {
  581. splitNumber: 5,
  582. gridType: "dash",
  583. dashLength: 8,
  584. gridColor: "rgba(0, 0, 0, 0.15)",
  585. data: [{
  586. axisLine: false, //坐标轴轴线是否显示
  587. }]
  588. },
  589. extra: {
  590. column: {
  591. width: 15,
  592. seriesGap: 2,
  593. barBorderRadius: [10, 10, 10, 10],
  594. },
  595. line: {
  596. type: "curve",
  597. width: 2,
  598. activeType: "hollow",
  599. linearType: "custom",
  600. onShadow: true,
  601. animation: "horizontal"
  602. },
  603. }
  604. },
  605. current: '经营数据',
  606. chartTab: [{
  607. name: '经营数据'
  608. },
  609. {
  610. name: '经营图表'
  611. },
  612. {
  613. name: '温度图表'
  614. },
  615. {
  616. name: '信号图表'
  617. }
  618. ],
  619. chartData: {
  620. series: [],
  621. categories: []
  622. },
  623. errorMessage: '无数据',
  624. tempDetail: {
  625. targetTemp: 4,
  626. selTempWorkModel: 2,
  627. start1: 0,
  628. end1: 0,
  629. start2: 0,
  630. end2: 0,
  631. start3: 0,
  632. end3: 0,
  633. curTimes: 0
  634. },
  635. tempWorkModels: [{
  636. name: '制热',
  637. id: 1
  638. }, {
  639. name: '制冷',
  640. id: 2
  641. }, {
  642. name: '恒温',
  643. id: 3
  644. }, {
  645. name: '关闭',
  646. id: 4
  647. }],
  648. showTimeSelPicker: false,
  649. timeSelPickerType: undefined,
  650. times: [
  651. [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24],
  652. [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]
  653. ],
  654. lightDetail: {
  655. open: true,
  656. start1: 0,
  657. end1: 0,
  658. start2: 0,
  659. end2: 0,
  660. start3: 0,
  661. end3: 0,
  662. curTimes: 0
  663. },
  664. totalTab: ['今日', '本月'],
  665. time: 0,
  666. show: false,
  667. popupTitle: '编辑商品',
  668. editForm: {
  669. name: null,
  670. areaName: null,
  671. areaId: null,
  672. lineId: null,
  673. placeId: null,
  674. lineName: null,
  675. placeName: null,
  676. lon: null,
  677. lat: null,
  678. pos: null
  679. },
  680. editRules: {
  681. 'code': {
  682. type: 'string',
  683. required: true,
  684. message: '必填项',
  685. trigger: ['blur', 'change']
  686. },
  687. },
  688. title: '', //弹框标题
  689. voice: 4, //声音设置
  690. light: 50, //灯光设置
  691. id: null, //设备id
  692. detail: {}, //设备详情
  693. allCountData: {}, //经营统计数据显示
  694. scrollTop: 0, //滚动距离顶部
  695. operaRecordsFlag: false, //操作记录
  696. netRecordsFlag: false, //在线情况
  697. errRecordCameraFlag: false, //摄像头故障情况
  698. errRecordLockFlag: false, //锁故障数据情况
  699. tempRecordsFlag: false, //温度数据情况
  700. operaRecords: [], //设备操作记录
  701. netRecords: [], //在线情况记录
  702. errRecordLock: [], //锁故障数据
  703. errRecordCamera: [], //摄像头故障数据
  704. deviceTempRecords: [], //温度记录
  705. isMore: true,
  706. // 编辑弹框
  707. areaShow: false,
  708. pickerShow: false,
  709. areaList: [], //区域数据
  710. columns: [], //picker数据
  711. pickerType: 1, //1线路2点位
  712. goodsManageData: {
  713. categoryNum: 0,
  714. stock: 0,
  715. afterFillStock: 0
  716. },
  717. countData: {
  718. salesMoney: 0,
  719. salesCount: 0,
  720. refundMoney: 0
  721. },
  722. pointColumns: [],
  723. lineColumns: [],
  724. qrcodeShow: false,
  725. qrCodeImg: null
  726. }
  727. },
  728. computed: {
  729. btnState() {
  730. let str = this.detail.busyState == 1 ? '暂停营业' : '开始营业';
  731. return str
  732. },
  733. devicePos() {
  734. let pos = '';
  735. if (this.editForm.lat || this.editForm.lon) {
  736. pos = this.editForm.lat + ',' + this.editForm.lon
  737. }
  738. return pos
  739. }
  740. },
  741. async onLoad(o) {
  742. if (o.id) {
  743. this.id = o.id;
  744. //设备详情
  745. this.getDetail()
  746. // 经营数据
  747. this.allCountData = await this.getCountData(1)
  748. this.countData = this.allCountData.dayBusinessData;
  749. //商品管理数据
  750. let tempData = await this.getCountData(5)
  751. this.goodsManageData = tempData.goodsData;
  752. }
  753. },
  754. methods: {
  755. // 获取设备详情
  756. getDetail() {
  757. detail({
  758. deviceId: this.id,
  759. isSysinfo: true,
  760. isStatus: true,
  761. isRegister: true
  762. }).then(res => {
  763. this.detail = res.data
  764. })
  765. },
  766. //获取统计数据
  767. getCountData(type) {
  768. return new Promise((resolve, reject) => {
  769. dataCount({
  770. deviceId: this.id,
  771. type: type
  772. }).then(res => {
  773. resolve(res.data)
  774. })
  775. .catch(err => {
  776. reject(err)
  777. })
  778. })
  779. },
  780. // 下载柜门二维码
  781. downloadQr() {
  782. this.qrcodeShow = true;
  783. this.drawQr(this.id)
  784. },
  785. //绘制二维码
  786. drawQr(id) {
  787. getQrCode({
  788. deviceId: id
  789. }).then(res => {
  790. this.qrCodeImg = res.data
  791. })
  792. },
  793. qrcodeClose() {
  794. this.qrcodeShow = false;
  795. },
  796. // 保存图片
  797. handleImgSave() {
  798. base64DownLoad(this.qrCodeImg).then(res=>{
  799. this.qrcodeClose()
  800. uni.showToast({
  801. title: '保存成功!',
  802. icon: "none",
  803. duration: 3000
  804. })
  805. }).catch(err=>{
  806. this.qrcodeClose()
  807. })
  808. },
  809. // 复制文字
  810. copy(e) {
  811. uni.setClipboardData({
  812. data: e
  813. });
  814. },
  815. // tab切换
  816. async tabClick(e) {
  817. console.log(e)
  818. this.current = e.name
  819. if (e.name == '经营数据') {
  820. this.allCountData = await this.getCountData(1)
  821. } else if (e.name == '经营图表') {
  822. let tempChartData = {};
  823. let data = await this.getCountData(2)
  824. tempChartData.series = data.businessChart ? data.businessChart.series : []
  825. tempChartData.categories = data.businessChart ? data.businessChart.categories : []
  826. this.chartData = JSON.parse(JSON.stringify(tempChartData))
  827. } else if (e.name == '温度图表') {
  828. let tempChartData = {};
  829. let data = await this.getCountData(3)
  830. tempChartData.series = data.temperatureChart ? data.temperatureChart.series : []
  831. tempChartData.categories = data.temperatureChart ? data.temperatureChart.categories : []
  832. this.chartData = JSON.parse(JSON.stringify(tempChartData))
  833. } else if (e.name == '信号图表') {
  834. let tempChartData = {};
  835. let data = await this.getCountData(4)
  836. tempChartData.series = data.signalChart ? data.signalChart.series : []
  837. tempChartData.categories = data.signalChart ? data.signalChart.categories : []
  838. this.chartData = JSON.parse(JSON.stringify(tempChartData))
  839. }
  840. },
  841. // 今日/本月切换
  842. totalChange(e) {
  843. this.time = e
  844. if (this.time == 0) { //今日
  845. this.countData = this.allCountData.dayBusinessData
  846. } else { //今月
  847. this.countData = this.allCountData.monthBusinessData
  848. }
  849. },
  850. //销量更多数据
  851. more() {
  852. let deviceName = this.detail.deviceName ? this.detail.deviceName : this.detail.deviceId
  853. this.$tab.navigateTo(`/pages/equipment/statistics?title=${deviceName}&id=${this.id}`)
  854. },
  855. // 显示弹框
  856. async btnClick(e) {
  857. this.title = e
  858. this.show = true;
  859. if (this.title == '编辑') {
  860. // 加载区域数据
  861. this.getAreaTree()
  862. //数据反显
  863. this.editForm = {
  864. name: this.detail.deviceName,
  865. areaName: this.detail.districtName,
  866. areaId: this.detail.districtId,
  867. lineId: this.detail.placeLineId,
  868. placeId: this.detail.placeId,
  869. lineName: this.detail.placeLineName,
  870. placeName: this.detail.placeName,
  871. lon: this.detail.lon,
  872. lat: this.detail.lat,
  873. }
  874. } else if (this.title == '设备重启') {
  875. } else if (this.title == '声音设置') {
  876. } else if (this.title == '灯光设置') {
  877. } else if (this.title == '清除故障') {
  878. } else { //暂停营业
  879. }
  880. },
  881. // 关闭弹框
  882. close(e) {
  883. this.show = false
  884. },
  885. // 弹框确定
  886. async submit() {
  887. let templet = null;
  888. let reSn = null;
  889. if (this.title == '编辑') {
  890. // if (this.editForm.areaName && this.editForm.lineId) {
  891. // await this.lineBind() //绑定线路
  892. // if (this.editForm.placeId) { //绑定点位
  893. // await this.placeBind()
  894. // }
  895. // this.getDetail()
  896. // } else {
  897. // this.$modal.msg('请选择区域和线路~')
  898. // }
  899. await this.updateDevice()
  900. this.getDetail()
  901. } else if (this.title == '设备重启') {
  902. await this.getDict('mqtt_cmd_templet_task', 'appTask').then(res => {
  903. console.log(res);
  904. templet = JSON.parse(res[0].value);
  905. templet.data.task = "restart";
  906. templet.data.appId = undefined;
  907. templet.data.src = undefined;
  908. });
  909. await sendCommand([{
  910. deviceId: this.id,
  911. templet: templet
  912. }]).then(res => {
  913. this.$modal.showToast('重启成功~')
  914. reSn = res.data[0].v1;
  915. });
  916. } else if (this.title == '声音设置') {
  917. await this.getDict('mqtt_cmd_templet_sets', 'deviceVoice').then(res => {
  918. console.log(res);
  919. templet = JSON.parse(res[0].value);
  920. templet.data.alound = this.voice;
  921. });
  922. await sendCommand([{
  923. deviceId: this.id,
  924. templet: templet
  925. }]).then(res => {
  926. reSn = res.data[0].v1;
  927. });
  928. } else if (this.title == '灯光设置') {
  929. await this.getDict('mqtt_cmd_templet_sets', 'light').then(res => {
  930. templet = JSON.parse(res[0].value);
  931. templet.data.light0.start1 = this.lightDetail.start1;
  932. templet.data.light0.end1 = this.lightDetail.end1;
  933. templet.data.light0.start2 = this.lightDetail.start2;
  934. templet.data.light0.end2 = this.lightDetail.end2;
  935. templet.data.light0.start3 = this.lightDetail.start3;
  936. templet.data.light0.end3 = this.lightDetail.end3;
  937. });
  938. console.log(this.id, templet);
  939. sendCommand([{
  940. deviceId: this.id,
  941. templet: templet
  942. }]).then(res => {
  943. reSn = res.data[0].v1;
  944. });
  945. } else if (this.title == '温度设置') {
  946. if (this.vilidateParams()) return //参数校验
  947. await this.getDict('mqtt_cmd_templet_sets', 'temperature').then(res => {
  948. templet = JSON.parse(res[0].value);
  949. templet.data.workModel = this.tempDetail.selTempWorkModel;
  950. templet.data.target = this.tempDetail.targetTemp;
  951. templet.data.start1 = this.tempDetail.start1;
  952. templet.data.end1 = this.tempDetail.end1;
  953. templet.data.start2 = this.tempDetail.start2;
  954. templet.data.end2 = this.tempDetail.end2;
  955. templet.data.start3 = this.tempDetail.start3;
  956. templet.data.end3 = this.tempDetail.end3;
  957. });
  958. console.log(this.id, templet);
  959. sendCommand([{
  960. deviceId: this.id,
  961. templet: templet
  962. }]).then(res => {
  963. reSn = res.data[0].v1;
  964. });
  965. } else if (this.title == '清除故障') {
  966. this.abort()
  967. } else { //暂停营业
  968. this.changeState()
  969. }
  970. this.close()
  971. },
  972. vilidateParams() {
  973. if (this.tempDetail.start1 > this.tempDetail.end1 || this.tempDetail.start2 > this.tempDetail.end2 ||
  974. this
  975. .tempDetail.start2 > this.tempDetail.end2) {
  976. this.$modal.msg('结束时间需大于等于起始时间!')
  977. return true
  978. } else {
  979. return false
  980. }
  981. },
  982. abort() {
  983. abort({
  984. deviceId: Number(this.id),
  985. }).then(res => {
  986. this.$modal.msg('清除故障成功~')
  987. });
  988. },
  989. //修改设备信息
  990. updateDevice() {
  991. let params = {
  992. deviceId: Number(this.id),
  993. deviceName: this.editForm.name,
  994. districtId: this.editForm.areaId,
  995. placeLineId: this.editForm.lineId,
  996. placeId: this.editForm.placeId,
  997. lon: this.editForm.lon,
  998. lat: this.editForm.lat
  999. }
  1000. return new Promise((resolve, reject) => {
  1001. updateInfo(params).then(res => {
  1002. this.$modal.msg('修改成功~')
  1003. resolve(res)
  1004. }).catch(err => {
  1005. reject(err)
  1006. })
  1007. })
  1008. },
  1009. // 线路绑定设备
  1010. lineBind() {
  1011. return new Promise((resolve, reject) => {
  1012. bindDevice({
  1013. isBind: true,
  1014. deviceIds: [this.id],
  1015. id: this.editForm.lineId
  1016. }).then(res => {
  1017. this.$modal.msg('绑定线路成功~')
  1018. resolve(res)
  1019. }).catch(err => {
  1020. reject(err)
  1021. })
  1022. })
  1023. },
  1024. // 点位绑定设备
  1025. placeBind() {
  1026. return new Promise((resolve, reject) => {
  1027. bindDevicePoint({
  1028. isBind: true,
  1029. deviceIds: [this.id],
  1030. id: this.editForm.placeId
  1031. }).then(res => {
  1032. this.$modal.msg('绑定点位成功~')
  1033. resolve(res)
  1034. }).catch(err => {
  1035. reject(err)
  1036. })
  1037. })
  1038. },
  1039. changeState() {
  1040. let busyState = this.detail.busyState == 1 ? 2 : 1
  1041. modifyBusyStage({
  1042. deviceId: this.id,
  1043. busyState: busyState
  1044. }).then(async res => {
  1045. if (res.code == 200) {
  1046. this.$modal.msg('操作成功~')
  1047. this.detail.busyState = busyState;
  1048. let templet = '';
  1049. await this.getDict('mqtt_cmd_templet_sets', 'lockDevice').then(res => {
  1050. console.log(res);
  1051. templet = JSON.parse(res[0].value);
  1052. templet.data.id = 0;
  1053. templet.data.opt = (busyState == 1 ? 'unlock' : 'lock');
  1054. });
  1055. await sendCommand([{
  1056. deviceId: this.id,
  1057. templet: templet
  1058. }]).then(res => {
  1059. //reSn = res.data[0].v1;
  1060. });
  1061. } else {
  1062. this.$modal.msg('操作失败,请重试~')
  1063. }
  1064. })
  1065. },
  1066. // 获取设备操作记录
  1067. getDeviceRecords() {
  1068. this.operaRecordsFlag = true;
  1069. indexDeviceRecords({
  1070. deviceId: this.id
  1071. }).then(res => {
  1072. this.operaRecords = res.data
  1073. })
  1074. },
  1075. //获取设备联网记录
  1076. getDeviceNetRecords() {
  1077. this.netRecordsFlag = true;
  1078. indexDeviceNetRecords({
  1079. deviceId: this.id
  1080. }).then(res => {
  1081. this.deviceNetRecords = res.data;
  1082. })
  1083. },
  1084. //获取设备温度记录
  1085. getDeviceTempRecords() {
  1086. this.tempRecordsFlag = true;
  1087. indexDeviceTempRecords({
  1088. deviceId: this.id
  1089. }).then(res => {
  1090. this.deviceTempRecords = res.data;
  1091. })
  1092. },
  1093. //获取故障记录
  1094. getDeviceErrRecords(type) {
  1095. switch (type) {
  1096. case 2:
  1097. this.errRecordLockFlag = true;
  1098. break
  1099. case 5:
  1100. this.errRecordCameraFlag = true;
  1101. break
  1102. default:
  1103. break
  1104. }
  1105. indexDeviceError({
  1106. deviceId: this.id,
  1107. errorType: type
  1108. }).then(res => {
  1109. switch (type) {
  1110. case 2:
  1111. this.errRecordLock = res.data;
  1112. break
  1113. case 5:
  1114. this.errRecordCamera = res.data;
  1115. break
  1116. default:
  1117. break
  1118. }
  1119. })
  1120. },
  1121. // onPageScroll(e) {
  1122. // this.scrollTop = e.scrollTop;
  1123. // if (this.scrollTop > 140 && !this.netRecordsFlag) { //联网记录
  1124. // this.getDeviceNetRecords()
  1125. // }
  1126. // if (this.scrollTop > 400 && !this.errRecordLockFlag) { //门锁故障情况 2
  1127. // this.getDeviceErrRecords(2)
  1128. // }
  1129. // if (this.scrollTop > 660 && !this.errRecordCameraFlag) { //摄像头故障情况 5
  1130. // this.getDeviceErrRecords(5)
  1131. // }
  1132. // if (this.scrollTop > 850 && !this.tempRecordsFlag) { //操作记录
  1133. // this.getDeviceTempRecords()
  1134. // }
  1135. // if (this.scrollTop > 1110 && !this.operaRecordsFlag) { //操作记录
  1136. // this.getDeviceRecords()
  1137. // }
  1138. // },
  1139. //获取区域树
  1140. getAreaTree() {
  1141. areaTree().then(res => {
  1142. this.areaList = res.data
  1143. })
  1144. },
  1145. //获取线路options
  1146. getLineOption(regionName) {
  1147. linePage({
  1148. page: {
  1149. current: 1,
  1150. size: 1000,
  1151. },
  1152. regionName: regionName
  1153. }).then(res => {
  1154. let data = res.data.records;
  1155. let newData = data.map(i => {
  1156. return {
  1157. id: i.id,
  1158. label: i.lineName
  1159. }
  1160. })
  1161. this.lineColumns = [newData];
  1162. })
  1163. },
  1164. //获取点位分页
  1165. getPointList(lineId) {
  1166. pointPage({
  1167. page: {
  1168. current: 1,
  1169. size: 1000,
  1170. },
  1171. lineId: lineId
  1172. }).then(res => {
  1173. let data = res.data.records;
  1174. let newData = data.map(i => {
  1175. return {
  1176. id: i.id,
  1177. label: i.placeName
  1178. }
  1179. })
  1180. this.pointColumns = [newData];
  1181. })
  1182. },
  1183. //区域选择
  1184. areaChoose() {
  1185. this.areaShow = true
  1186. },
  1187. areaClose() {
  1188. this.areaShow = false
  1189. },
  1190. //区域选择提交
  1191. areaSubmit(res) {
  1192. this.editForm.areaName = res.name;
  1193. this.editForm.areaId = res.key;
  1194. console.log(res)
  1195. this.getLineOption(res.name)
  1196. this.areaClose()
  1197. //清空线路,点位信息
  1198. this.editForm.lineId = null
  1199. this.editForm.lineName = null
  1200. this.editForm.placeId = null
  1201. this.editForm.placeName = null
  1202. },
  1203. //线路选择
  1204. lineChoose() {
  1205. this.columns = this.lineColumns;
  1206. this.pickerType = 1
  1207. if (this.columns && this.columns.length > 0 && this.columns[0].length > 0) {
  1208. this.pickerShow = true
  1209. } else {
  1210. this.$modal.msg('当前无线路~')
  1211. }
  1212. },
  1213. //点位选择
  1214. placeChoose() {
  1215. this.columns = this.pointColumns;
  1216. this.pickerType = 2
  1217. if (this.columns && this.columns.length > 0 && this.columns[0].length > 0) {
  1218. this.pickerShow = true
  1219. } else {
  1220. this.$modal.msg('当前无点位~')
  1221. }
  1222. },
  1223. getLocation() {
  1224. uni.chooseLocation({
  1225. success: (res) => {
  1226. console.log('位置名称:' + res.name);
  1227. console.log('详细地址:' + res.address);
  1228. console.log('纬度:' + res.latitude);
  1229. console.log('经度:' + res.longitude);
  1230. this.editForm.lat = res.latitude;
  1231. this.editForm.lon = res.longitude;
  1232. }
  1233. })
  1234. },
  1235. showPos() {
  1236. if (this.detail.lat && this.detail.lon) {
  1237. uni.openLocation({ //​使用微信内置地图查看位置。
  1238. latitude: Number(this.detail.lat), //要去的纬度-地址
  1239. longitude: Number(this.detail.lon), //要去的经度-地址
  1240. success: res => {
  1241. console.log('success');
  1242. }
  1243. })
  1244. } else {
  1245. this.$modal.msg('请先编辑设备位置信息~')
  1246. }
  1247. },
  1248. //picker弹框确认
  1249. pickerConfirm(e) {
  1250. if (e.value[0]) {
  1251. if (this.pickerType == 1) { //线路
  1252. this.editForm.lineId = e.value[0].id
  1253. this.editForm.lineName = e.value[0].label
  1254. this.getPointList(e.value[0].id)
  1255. //清空点位信息
  1256. this.editForm.placeId = null
  1257. this.editForm.placeName = null
  1258. } else { //点位
  1259. this.editForm.placeId = e.value[0].id
  1260. this.editForm.placeName = e.value[0].label
  1261. }
  1262. }
  1263. this.pickerClose()
  1264. },
  1265. pickerClose() {
  1266. this.pickerShow = false
  1267. },
  1268. pickerTimes(type, o) {
  1269. this.timeSelPickerType = type;
  1270. this.showTimeSelPicker = true;
  1271. if (this.timeSelPickerType === 'light') {
  1272. this.lightDetail.curTimes = o;
  1273. } else if (this.timeSelPickerType === 'temp') {
  1274. this.tempDetail.curTimes = o;
  1275. }
  1276. },
  1277. pickerTimeChangeHandler(e) {
  1278. const {
  1279. columnIndex,
  1280. value,
  1281. values, // values为当前变化列的数组内容
  1282. index,
  1283. // 微信小程序无法将picker实例传出来,只能通过ref操作
  1284. picker = this.$refs.uPicker
  1285. } = e
  1286. //picker.setColumnValues(0, this.times[0][0])
  1287. // picker.setColumnValues(1, this.times[1][0])
  1288. // 当第一列值发生变化时,变化第二列(后一列)对应的选项
  1289. // if (columnIndex === 0) {
  1290. // // picker为选择器this实例,变化第二列对应的选项
  1291. // var col1 = values.slice(index,23)
  1292. // picker.setColumnValues(1, values.slice(index,23))
  1293. // }
  1294. },
  1295. pickerTimeConfirm(e) {
  1296. console.log('confirm', this.timeSelPickerType, e.value[0])
  1297. this.showTimeSelPicker = false
  1298. if (this.timeSelPickerType === 'light') {
  1299. if (0 == this.lightDetail.curTimes) {
  1300. this.lightDetail.start1 = e.value[0];
  1301. this.lightDetail.end1 = e.value[1];
  1302. } else if (1 == this.lightDetail.curTimes) {
  1303. this.lightDetail.start2 = e.value[0];
  1304. this.lightDetail.end2 = e.value[1];
  1305. } else {
  1306. this.lightDetail.start3 = e.value[0];
  1307. this.lightDetail.end3 = e.value[1];
  1308. }
  1309. } else if (this.timeSelPickerType === 'temp') {
  1310. if (0 == this.tempDetail.curTimes) {
  1311. this.tempDetail.start1 = e.value[0];
  1312. this.tempDetail.end1 = e.value[1];
  1313. } else if (1 == this.tempDetail.curTimes) {
  1314. this.tempDetail.start2 = e.value[0];
  1315. this.tempDetail.end2 = e.value[1];
  1316. } else {
  1317. this.tempDetail.start3 = e.value[0];
  1318. this.tempDetail.end3 = e.value[1];
  1319. }
  1320. }
  1321. }
  1322. }
  1323. }
  1324. </script>
  1325. <style lang="scss" scoped>
  1326. .container {
  1327. .content {
  1328. padding: 24rpx;
  1329. .xy-card {
  1330. margin-bottom: 24rpx;
  1331. }
  1332. .top {
  1333. >view:nth-child(1) {
  1334. display: flex;
  1335. flex-flow: row nowrap;
  1336. justify-content: space-between;
  1337. .t-left {
  1338. width: 380rpx;
  1339. >view:nth-child(1) {
  1340. font-size: 36rpx;
  1341. font-weight: bold;
  1342. }
  1343. >view:nth-child(2) {
  1344. font-size: 26rpx;
  1345. color: #2C6FF3;
  1346. border: 1rpx solid #2C6FF3;
  1347. border-radius: 6rpx;
  1348. padding: 0 8rpx;
  1349. background-color: rgb(243, 249, 525);
  1350. margin-left: 12rpx;
  1351. }
  1352. }
  1353. .t-right {
  1354. font-size: 30rpx;
  1355. color: #f56c6c;
  1356. position: relative;
  1357. margin-left: 24rpx;
  1358. &::before {
  1359. content: '';
  1360. display: inline-block;
  1361. background-color: green;
  1362. width: 16rpx;
  1363. height: 16rpx;
  1364. border-radius: 16rpx;
  1365. margin-right: 12rpx;
  1366. }
  1367. &.off {
  1368. color: #666;
  1369. &::before {
  1370. background-color: #666;
  1371. }
  1372. }
  1373. }
  1374. }
  1375. >view:nth-child(2) {
  1376. display: flex;
  1377. flex-direction: row;
  1378. justify-content: flex-end;
  1379. margin-top: 12rpx;
  1380. >.cu-btn {
  1381. height: 40rpx;
  1382. }
  1383. .down-qr {
  1384. font-size: 26rpx;
  1385. color: #2C6FF3;
  1386. border: 1rpx solid #2C6FF3;
  1387. border-radius: 6rpx;
  1388. padding: 4rpx 8rpx;
  1389. background-color: rgb(243, 249, 525);
  1390. }
  1391. .edit {
  1392. font-size: 26rpx;
  1393. color: #fff;
  1394. border: 1rpx solid #2C6FF3;
  1395. border-radius: 6rpx;
  1396. padding: 4rpx 8rpx;
  1397. background-color: rgb(243, 249, 525);
  1398. margin-left: 12rpx;
  1399. background-color: #2C6FF3;
  1400. }
  1401. }
  1402. }
  1403. .center {
  1404. border-radius: 8rpx;
  1405. background-color: rgb(245, 248, 251);
  1406. padding: 24rpx 12rpx 42rpx;
  1407. font-size: 30rpx;
  1408. margin-top: 24rpx;
  1409. overflow: hidden;
  1410. position: relative;
  1411. height: 560rpx;
  1412. transition: all 0.5s ease 0s;
  1413. .unfold {
  1414. position: absolute;
  1415. bottom: 8rpx;
  1416. right: 24rpx;
  1417. }
  1418. &.center-more {
  1419. height: 170rpx;
  1420. }
  1421. .d-line {
  1422. display: flex;
  1423. flex-flow: row nowrap;
  1424. justify-content: flex-start;
  1425. >view:nth-child(1) {
  1426. width: 50%;
  1427. }
  1428. >view:nth-child(2) {
  1429. width: 50%;
  1430. }
  1431. }
  1432. .c-item {
  1433. display: flex;
  1434. flex-flow: row nowrap;
  1435. justify-content: flex-start;
  1436. font-size: 28rpx;
  1437. margin-bottom: 18rpx;
  1438. align-items: flex-end;
  1439. .name {
  1440. min-width: 100rpx;
  1441. color: #999;
  1442. }
  1443. .val {
  1444. color: #333;
  1445. padding-left: 6rpx;
  1446. overflow: hidden;
  1447. text-overflow: ellipsis;
  1448. white-space: nowrap;
  1449. text {
  1450. margin-left: 12rpx;
  1451. text-decoration: underline;
  1452. color: #2C6FF3;
  1453. }
  1454. &.net {
  1455. text {
  1456. text-decoration: none;
  1457. }
  1458. }
  1459. }
  1460. }
  1461. }
  1462. .bot {
  1463. display: flex;
  1464. flex-flow: row nowrap;
  1465. justify-content: space-between;
  1466. margin-top: 24rpx;
  1467. .cu-btn {
  1468. padding: 0 12rpx;
  1469. font-size: 26rpx;
  1470. height: 60rpx;
  1471. line-height: 50rpx;
  1472. }
  1473. .cu-btn1 {
  1474. background-color: red;
  1475. color: #fff;
  1476. }
  1477. .cu-btn2 {
  1478. background-color: #fff;
  1479. color: #2C6FF3;
  1480. border: 1rpx solid #2C6FF3;
  1481. }
  1482. .cu-btn3 {
  1483. background-color: #2C6FF3;
  1484. color: #fff;
  1485. }
  1486. }
  1487. .qrcode-content {
  1488. padding: 24rpx;
  1489. .save-qrcode {
  1490. margin-top: 24rpx;
  1491. }
  1492. }
  1493. .chart-content {
  1494. width: 100%;
  1495. .total {
  1496. display: flex;
  1497. flex-direction: column;
  1498. align-items: center;
  1499. }
  1500. .more {
  1501. background-color: #2C6FF3;
  1502. padding: 0 24rpx;
  1503. font-size: 26rpx;
  1504. height: 50rpx;
  1505. line-height: 50rpx;
  1506. margin-top: 24rpx;
  1507. }
  1508. }
  1509. .t-content {
  1510. display: flex;
  1511. flex-flow: row nowrap;
  1512. width: 100%;
  1513. box-sizing: border-box;
  1514. text-align: center;
  1515. .t-item {
  1516. width: 50%;
  1517. margin-top: 24rpx;
  1518. .t-name {
  1519. font-size: 28rpx;
  1520. line-height: 40rpx;
  1521. }
  1522. .t-num {
  1523. font-size: 28rpx;
  1524. line-height: 46rpx;
  1525. padding: 12rpx 0;
  1526. text {
  1527. font-size: 40rpx;
  1528. font-weight: bold;
  1529. }
  1530. }
  1531. }
  1532. }
  1533. .title {
  1534. font-size: 34rpx;
  1535. font-weight: bold;
  1536. color: #333;
  1537. line-height: 54rpx;
  1538. }
  1539. .bot1 {
  1540. display: flex;
  1541. justify-content: flex-end;
  1542. }
  1543. .l-content {
  1544. padding-top: 24rpx;
  1545. .l-item {
  1546. font-size: 28rpx;
  1547. line-height: 50rpx;
  1548. display: flex;
  1549. flex-direction: row;
  1550. .l-status {
  1551. margin-left: 24rpx;
  1552. }
  1553. }
  1554. }
  1555. .popup-content {
  1556. padding: 0 24rpx;
  1557. }
  1558. .restart {
  1559. padding: 40rpx 0;
  1560. font-size: 34rpx;
  1561. text-align: center;
  1562. }
  1563. }
  1564. }
  1565. .temp {
  1566. .info {
  1567. color: red;
  1568. height: 60rpx;
  1569. line-height: 60rpx;
  1570. text-align: center;
  1571. }
  1572. .flex {
  1573. margin-top: 20rpx;
  1574. height: 60rpx;
  1575. .lab {
  1576. line-height: 60rpx;
  1577. height: 60rpx;
  1578. text-align: center;
  1579. font-weight: 600;
  1580. margin-top: 20rpx;
  1581. }
  1582. .to {
  1583. width: 60rpx;
  1584. margin-left: 20rpx;
  1585. margin-top: 0;
  1586. font-weight: 500;
  1587. }
  1588. .time-box {
  1589. height: 50rpx;
  1590. width: 200rpx;
  1591. line-height: 50rpx;
  1592. margin-left: 20rpx;
  1593. text-align: center;
  1594. border-radius: 10rpx;
  1595. border-style: solid;
  1596. border-width: 1px;
  1597. }
  1598. }
  1599. }
  1600. </style>