Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 

1311 linhas
37 KiB

  1. <template>
  2. <div class="box-center">
  3. <!-- 头 -->
  4. <div class="app-top">
  5. <div class="app-titel" style="margin-top: 5px">
  6. <div class="div-lab">
  7. <div class="label">更新时间:</div>
  8. <el-date-picker
  9. v-model="time"
  10. type="daterange"
  11. class="div-inp"
  12. range-separator="-"
  13. start-placeholder="开始日期"
  14. :default-time="['00:00:00', '23:59:59']"
  15. value-format="yyyy-MM-dd"
  16. end-placeholder="结束日期"
  17. @change="timeChange"
  18. >
  19. </el-date-picker>
  20. </div>
  21. <div class="div-lab">
  22. <el-input
  23. v-model="changeValue"
  24. clearable
  25. placeholder="请输入"
  26. maxlength="20"
  27. @change="selectChange"
  28. style="width: 363px"
  29. >
  30. <el-select
  31. v-model="selflag"
  32. slot="prepend"
  33. class="input-with-select"
  34. style="width: 115px"
  35. placeholder="请选择"
  36. @change="selChange"
  37. >
  38. <el-option label="设备编号" value="1"></el-option>
  39. <!-- <el-option label="版本号" value="2"></el-option> -->
  40. <!-- <el-option label="批次号" value="3"></el-option>
  41. <el-option label="代理商名称" value="4"></el-option>
  42. <el-option label="公司名称" value="5"></el-option> -->
  43. <el-option label="楼盘名称" value="6"></el-option>
  44. </el-select>
  45. </el-input>
  46. </div>
  47. <!-- <div class="div-lab">
  48. <div class="label">售出状态</div>
  49. <el-select
  50. class="div-inp"
  51. multiple
  52. clearable
  53. collapse-tags
  54. v-model="searchForm.keywordsId"
  55. placeholder="请选择"
  56. >
  57. <el-option
  58. v-for="item in options"
  59. :key="item.value"
  60. :label="item.label"
  61. :value="item.value"
  62. >
  63. </el-option>
  64. </el-select>
  65. </div> -->
  66. <div class="div-lab">
  67. <div class="label">领用状态:</div>
  68. <el-select
  69. class="div-inp"
  70. clearable
  71. filterable
  72. collapse-tags
  73. v-model="searchForm.receiveType"
  74. placeholder="请选择"
  75. >
  76. <el-option
  77. v-for="item in receiveTypeList"
  78. :key="item.value"
  79. :label="item.label"
  80. :value="item.value"
  81. >
  82. </el-option>
  83. </el-select>
  84. </div>
  85. <div class="div-lab">
  86. <div class="label">在线状态:</div>
  87. <el-select
  88. class="div-inp"
  89. clearable
  90. filterable
  91. collapse-tags
  92. v-model="searchForm.onLine"
  93. placeholder="请选择"
  94. >
  95. <el-option
  96. v-for="item in onlineList"
  97. :key="item.value"
  98. :label="item.label"
  99. :value="item.value"
  100. >
  101. </el-option>
  102. </el-select>
  103. </div>
  104. <div class="div-lab">
  105. <div class="label">录音状态:</div>
  106. <el-select
  107. class="div-inp"
  108. clearable
  109. filterable
  110. collapse-tags
  111. v-model="searchForm.simAudioStatus"
  112. placeholder="请选择"
  113. >
  114. <el-option
  115. v-for="item in audioStatusList"
  116. :key="item.value"
  117. :label="item.label"
  118. :value="item.value"
  119. >
  120. </el-option>
  121. </el-select>
  122. </div>
  123. <div class="div-lab">
  124. <div class="label">上传状态:</div>
  125. <el-select
  126. class="div-inp"
  127. filterable
  128. clearable
  129. collapse-tags
  130. v-model="searchForm.simAudioUploadStatus"
  131. placeholder="请选择"
  132. >
  133. <el-option
  134. v-for="item in uploadStatusList"
  135. :key="item.value"
  136. :label="item.label"
  137. :value="item.value"
  138. >
  139. </el-option>
  140. </el-select>
  141. </div>
  142. <div class="div-lab">
  143. <div class="label">关机状态:</div>
  144. <el-select
  145. class="div-inp"
  146. filterable
  147. clearable
  148. collapse-tags
  149. v-model="searchForm.offStatus"
  150. placeholder="请选择"
  151. >
  152. <el-option
  153. v-for="item in offStatusList"
  154. :key="item.value"
  155. :label="item.label"
  156. :value="item.value"
  157. >
  158. </el-option>
  159. </el-select>
  160. </div>
  161. <div class="div-lab">
  162. <div class="label">领用人:</div>
  163. <el-input type="text" v-model="searchForm.userName"></el-input>
  164. </div>
  165. <div class="div-lab">
  166. <div class="label">设备电量:</div>
  167. <el-input type="text" v-model="searchForm.electricity"></el-input>
  168. </div>
  169. </div>
  170. <!-- <div class="app-titel" style="margin-top: 15px">
  171. <div class="label">设备电量:</div>
  172. <div>
  173. <el-input v-model="value"></el-input>
  174. </div>
  175. <div class="label">是否在线:</div>
  176. <div>
  177. <el-select v-model="value" placeholder="请选择">
  178. <el-option
  179. v-for="item in options"
  180. :key="item.value"
  181. :label="item.label"
  182. :value="item.value"
  183. >
  184. </el-option>
  185. </el-select>
  186. </div>
  187. </div> -->
  188. <div class="app-titel" style="margin-top: 15px">
  189. <!-- <div class="label" style="color: #ffffff">筛选相关:</div> -->
  190. <div style="margin-left: 20px">
  191. <el-button type="primary" @click="screen"
  192. >筛选</el-button
  193. >
  194. </div>
  195. <div style="margin-left: 20px">
  196. <el-button @click="reset">清空筛选条件</el-button>
  197. </div>
  198. <div style="margin-left: 20px">
  199. <el-button
  200. @click="openAllLight()"
  201. type="primary"
  202. v-if="equ_state_open"
  203. :disabled="multipleSelection.length == 0"
  204. >批量开启指示灯</el-button
  205. >
  206. </div>
  207. <div style="margin-left: 20px">
  208. <el-button
  209. @click="closeAllLight()"
  210. type="primary"
  211. v-if="equ_state_off"
  212. :disabled="multipleSelection.length == 0"
  213. >批量关闭指示灯</el-button
  214. >
  215. </div>
  216. <div style="margin-left: 20px">
  217. <el-button
  218. @click="Batchreturn()"
  219. type="primary"
  220. v-if="equ_state_back"
  221. :disabled="multipleSelection.length == 0"
  222. >批量归还</el-button
  223. >
  224. </div>
  225. <div style="margin-left: 20px">
  226. <el-button
  227. @click="infoMasstransfer()"
  228. type="primary"
  229. v-if="equ_state_tranfer"
  230. :disabled="multipleSelection.length == 0"
  231. >批量转移</el-button
  232. >
  233. </div>
  234. <div style="margin-left: 20px">
  235. <el-button
  236. @click="zkequipmentUnbind()"
  237. type="primary"
  238. v-if="equ_state_unbind"
  239. :disabled="multipleSelection.length == 0"
  240. >批量解绑</el-button
  241. >
  242. </div>
  243. </div>
  244. </div>
  245. <!-- 表格 -->
  246. <div class="cen-tab">
  247. <div class="tongji">
  248. 在线设备:{{ onLineCount || 0 }} 正在工作设备:{{
  249. workingCount || 0
  250. }}
  251. 离线设备:{{ offLineCount || 0 }}
  252. </div>
  253. <el-table
  254. :data="tableData"
  255. stripe
  256. @selection-change="handleSelectionChange"
  257. style="width: 100%"
  258. >
  259. <el-table-column type="selection" width="55"> </el-table-column>
  260. <el-table-column type="index" label="序号" align="center">
  261. </el-table-column>
  262. <el-table-column prop="imei" label="设备编号" align="center">
  263. </el-table-column>
  264. <el-table-column prop="houseName" label="楼盘" align="center">
  265. </el-table-column>
  266. <el-table-column prop="userName" label="领用人" align="center">
  267. </el-table-column>
  268. <el-table-column prop="onLine" label="在线状态" align="center">
  269. <template slot-scope="{ row }">
  270. {{ row.onLine == 1 ? "在线" : "离线" }}
  271. </template>
  272. </el-table-column>
  273. <el-table-column prop="date" label="离线天数" align="center">
  274. </el-table-column>
  275. <el-table-column prop="recCmd" label="录音状态" align="center">
  276. <template slot-scope="{ row }">
  277. {{ row.recCmd=='start' ? "开启" : "关闭" }}
  278. </template>
  279. </el-table-column>
  280. <el-table-column
  281. prop="simAudioUploadStatus"
  282. label="上传状态"
  283. align="center"
  284. >
  285. <template slot-scope="{ row }">
  286. {{ row.simAudioUploadStatus=='true' ? "上传中" : "无上传" }}
  287. </template>
  288. </el-table-column>
  289. <el-table-column prop="lightStatus" label="开机指示灯" align="center">
  290. <template slot-scope="{ row }">
  291. {{ row.lightStatus == "on" ? "开启" : "关闭" }}
  292. </template>
  293. </el-table-column>
  294. <el-table-column
  295. prop="name"
  296. label="电池电量"
  297. width="200"
  298. align="center"
  299. >
  300. <template slot-scope="{ row }">
  301. <el-progress
  302. :percentage="row.electricity / 1"
  303. :color="customColors"
  304. ></el-progress>
  305. </template>
  306. </el-table-column>
  307. <el-table-column prop="signalDevice" label="信号强度" align="center">
  308. </el-table-column>
  309. <el-table-column prop="name" label="待上传文件" align="center">
  310. </el-table-column>
  311. <el-table-column
  312. width="150"
  313. prop="updateTime"
  314. label="更新时间"
  315. align="center"
  316. >
  317. </el-table-column>
  318. <el-table-column
  319. prop="openTime"
  320. width="150"
  321. label="开机时间"
  322. align="center"
  323. >
  324. </el-table-column>
  325. <el-table-column
  326. prop="closeTime"
  327. width="150"
  328. label="关机时间"
  329. align="center"
  330. >
  331. </el-table-column>
  332. <el-table-column prop="offStatus" label="关机类型" align="center">
  333. <template slot-scope="{ row }">
  334. {{
  335. row.offStatus == 1
  336. ? "正常关机": row.offStatus == 2
  337. ? "低电关机":row.offStatus == 3? "异常关机":''
  338. }}
  339. </template>
  340. </el-table-column>
  341. <!-- scope -->
  342. <el-table-column label="操作" align="center" fixed="right" width="200">
  343. <template slot-scope="{ row }">
  344. <!-- <div style="color: #2671e2" @click="toinifoThereturn()">
  345. 修改指示灯状态
  346. </div> -->
  347. <el-dropdown v-if="(row.receiveType==2&&equ_state_take)||(row.houseName&&equ_state_take)||equ_state_open||equ_state_WiFi||equ_state_Voice" @command="handleCommand($event, row)" trigger="click">
  348. <span style="color: #409eff; font-size: 12px; margin-left: 10px;cursor: pointer;">
  349. 更多<i class="el-icon-arrow-down el-icon--right"></i>
  350. </span>
  351. <el-dropdown-menu slot="dropdown">
  352. <!-- <el-dropdown-item command="toinifoThereturn" v-if="row.receiveType == 2" >归还</el-dropdown-item> -->
  353. <el-dropdown-item command="toinifoThereturn" v-if="row.receiveType==2 &&equ_state_take"
  354. >归还</el-dropdown-item
  355. >
  356. <el-dropdown-item command="receive" v-if="row.houseName&&equ_state_take&&row.receiveType!=2"
  357. >领用</el-dropdown-item
  358. >
  359. <el-dropdown-item command="lightStatusChange"
  360. v-if="equ_state_open"
  361. >{{
  362. row.lightStatus == "on" ? "关闭" : "开启"
  363. }}指示灯</el-dropdown-item
  364. >
  365. <el-dropdown-item v-if="equ_state_WiFi" command="wifiShow">WiFi管理</el-dropdown-item>
  366. <el-dropdown-item v-if="equ_state_Voice" command="voiceOpen">录音{{row.simAudioStatus=='true'?'关闭':'开启'}}</el-dropdown-item>
  367. </el-dropdown-menu>
  368. </el-dropdown>
  369. </template>
  370. </el-table-column>
  371. </el-table>
  372. <div style="display: flex; justify-content: flex-end; margin-top: 10px">
  373. <el-pagination
  374. @size-change="handleSizeChange"
  375. @current-change="handleCurrentChange"
  376. :current-page="currentPage"
  377. :page-sizes="[10, 30, 50]"
  378. :page-size="size"
  379. layout="total, sizes, prev, pager, next, jumper"
  380. :total="total"
  381. >
  382. </el-pagination>
  383. </div>
  384. </div>
  385. <el-dialog
  386. title="领用"
  387. :visible.sync="receiveVisible"
  388. @close="resetReceive"
  389. >
  390. <el-form
  391. :model="receiveForm"
  392. label-position="labelPosition"
  393. ref="receiveForm"
  394. :rules="receiveRules"
  395. label-width="100px"
  396. >
  397. <el-form-item label="楼盘" prop="batchId">
  398. <el-input
  399. v-model="receiveForm.bindHouseName"
  400. style="width: 80%"
  401. disabled
  402. ></el-input>
  403. </el-form-item>
  404. <el-form-item label="顾问" prop="batchId">
  405. <el-select
  406. v-model="receiveForm.accountId"
  407. style="width: 80%"
  408. placeholder="请选择"
  409. >
  410. <el-option
  411. v-for="item in userList"
  412. :key="item.accountId"
  413. :label="item.name"
  414. :value="item.accountId"
  415. >
  416. </el-option>
  417. </el-select>
  418. </el-form-item>
  419. </el-form>
  420. <div slot="footer" class="dialog-footer">
  421. <el-button @click="receiveVisible = false">取 消</el-button>
  422. <el-button type="primary" @click="saveReceive()">保存</el-button>
  423. </div>
  424. </el-dialog>
  425. <el-dialog
  426. title="批量转移"
  427. width="40%"
  428. :visible.sync="dialogVisible5"
  429. @close="resetBind"
  430. >
  431. <el-form
  432. :model="bindForm"
  433. label-position="labelPosition"
  434. ref="allbindForm"
  435. :rules="bindRules"
  436. label-width="140px"
  437. >
  438. <el-form-item label="楼盘" prop="houseId">
  439. <el-select
  440. filterable
  441. v-model="bindForm.houseId"
  442. style="width: 80%"
  443. placeholder="请选择"
  444. @change="houseChange"
  445. >
  446. <el-option
  447. v-for="item in houseList"
  448. :key="item.id"
  449. :label="item.propertyName"
  450. :value="item.id"
  451. >
  452. </el-option>
  453. </el-select>
  454. </el-form-item>
  455. </el-form>
  456. <div slot="footer" class="dialog-footer">
  457. <el-button @click="dialogVisible5 = false">取 消</el-button>
  458. <el-button type="primary" @click="Masstransfer()">保存</el-button>
  459. </div>
  460. </el-dialog>
  461. <el-dialog title="WiFi管理" width="40%" :visible.sync="wifiVisible">
  462. <el-form
  463. :model="wifiForm"
  464. :rules="wifiRule"
  465. ref="wifiForm"
  466. label-width="100px"
  467. class="demo-ruleForm"
  468. >
  469. <el-form-item label="设备号" prop="imei">
  470. <el-input v-model="wifiForm.imei" disabled></el-input>
  471. </el-form-item>
  472. <div>主WiFi</div>
  473. <el-form-item label="wifi名称" prop="masterWifiName">
  474. <el-input v-model="wifiForm.masterWifiName" maxlength="20" clearable></el-input>
  475. </el-form-item>
  476. <el-form-item label="wifi密码" prop="masterWifiPassword">
  477. <el-input
  478. v-model="wifiForm.masterWifiPassword"
  479. show-password
  480. ></el-input>
  481. </el-form-item>
  482. <div>备用一</div>
  483. <el-form-item label="wifi名称" prop="spareOneWifiName">
  484. <el-input v-model="wifiForm.spareOneWifiName" maxlength="20" clearable></el-input>
  485. </el-form-item>
  486. <el-form-item label="wifi密码" prop="spareOneWifiPassword">
  487. <el-input
  488. v-model="wifiForm.spareOneWifiPassword"
  489. show-password
  490. ></el-input>
  491. </el-form-item>
  492. <div>备用二</div>
  493. <el-form-item label="wifi名称" prop="spareTwoWifiName">
  494. <el-input v-model="wifiForm.spareTwoWifiName" maxlength="20" clearable></el-input>
  495. </el-form-item>
  496. <el-form-item label="wifi密码" prop="spareTwoWifiPassword">
  497. <el-input
  498. v-model="wifiForm.spareTwoWifiPassword"
  499. show-password
  500. ></el-input>
  501. </el-form-item>
  502. <el-form-item>
  503. <el-button @click="wifiVisible = false" type="primary"
  504. >取消</el-button
  505. >
  506. <el-button @click="wifiEdit">确定</el-button>
  507. </el-form-item>
  508. </el-form>
  509. </el-dialog>
  510. </div>
  511. </template>
  512. <script>
  513. import { mapGetters } from "vuex";
  514. export default {
  515. data() {
  516. return {
  517. options: [
  518. {
  519. value: "1",
  520. label: "全部",
  521. },
  522. {
  523. value: "2",
  524. label: "在线",
  525. },
  526. {
  527. value: "3",
  528. label: "离线",
  529. },
  530. ],
  531. onlineList: [
  532. {
  533. value: "0",
  534. label: "离线",
  535. },
  536. {
  537. value: "1",
  538. label: "在线",
  539. },
  540. ],
  541. audioStatusList: [
  542. {
  543. value: true,
  544. label: "开启",
  545. },
  546. {
  547. value: false,
  548. label: "关闭",
  549. },
  550. ],
  551. uploadStatusList: [
  552. {
  553. value: false,
  554. label: "无上传",
  555. },
  556. {
  557. value: true,
  558. label: "上传中",
  559. },
  560. ],
  561. equipmentStatusList: [
  562. {
  563. value: "0",
  564. label: "已验收",
  565. },
  566. {
  567. value: "1",
  568. label: "未验收",
  569. },
  570. {
  571. value: "2",
  572. label: "维修中",
  573. },
  574. {
  575. value: "3",
  576. label: "更换中",
  577. },
  578. {
  579. value: "4",
  580. label: "已报损",
  581. },
  582. ],
  583. offStatusList: [
  584. {
  585. value: "1",
  586. label: "正常关机",
  587. },
  588. {
  589. value: "2",
  590. label: "低电关机",
  591. },
  592. {
  593. value: "3",
  594. label: "异常关机",
  595. },
  596. ],
  597. receiveTypeList: [
  598. {
  599. value: "1",
  600. label: "未领用",
  601. },
  602. {
  603. value: "2",
  604. label: "使用中",
  605. },
  606. {
  607. value: "3",
  608. label: "已归还",
  609. },
  610. ],
  611. options1: [],
  612. houseList: [],
  613. searchForm: {
  614. name: "",
  615. imei: "", //设备号
  616. batchId: "", //批次号
  617. // equipmentType: "", //设备类型
  618. receiveType: "", //领用状态
  619. defaultTransliteration: "", //转写方式
  620. startDate: "", //开始时间
  621. endDate: "", //结束时间
  622. agentName: "", //代理商名称
  623. orgName: "", //公司名称
  624. houseName: "", //楼盘名称
  625. acceptanceStatus: "", //设备状态
  626. simAudioStatus: "", //录音状态
  627. simAudioUploadStatus: "", //上传状态
  628. offStatus: "", //关机状态
  629. onLine: "",
  630. userName:'',
  631. electricity:''
  632. },
  633. bindRules: {
  634. houseId: [{ required: true, message: "请选择楼盘", trigger: "blur" }],
  635. },
  636. bindForm: {
  637. remark: "",
  638. houseId: "",
  639. // choic: "3",
  640. },
  641. wifiForm: {
  642. // imei:"",
  643. // masterWifiName:"",
  644. // masterWifiPassword:'',
  645. // spareOneWifiName:"",
  646. // spareOneWifiPassword:'',
  647. // spareTwoWifiName:'',
  648. // spareTwoWifiPassword:'',
  649. },
  650. receiveForm: {
  651. houseId: "",
  652. bindHouseName: "",
  653. accountId: "",
  654. },
  655. receiveRules: {},
  656. wifiRule: {
  657. masterWifiPassword: [
  658. { min: 8, max: 16, message: "长度在 8 到 16 位", trigger: "blur" },
  659. ],
  660. spareOneWifiPassword: [
  661. { min: 8, max: 16, message: "长度在 8 到 16 位", trigger: "blur" },
  662. ],
  663. spareTwoWifiPassword: [
  664. { min: 8, max: 16, message: "长度在 8 到 16 位", trigger: "blur" },
  665. ],
  666. },
  667. addRules: {
  668. houseId: [{ required: true, message: "请选择楼盘", trigger: "blur" }],
  669. batchId: { required: true, message: "请选择顾问", trigger: "blur" },
  670. },
  671. receiveVisible: false,
  672. currentPage: 1,
  673. size: 10,
  674. total: 10,
  675. value: "",
  676. input: "",
  677. time: [],
  678. selflag: "1",
  679. changeValue: "",
  680. tableData: [],
  681. multipleSelection: [],
  682. userList: [],
  683. onLineCount: "",
  684. offLineCount: "",
  685. workingCount: "",
  686. dialogVisible5: false,
  687. wifiVisible: false,
  688. customColors: [
  689. { color: "red", percentage: 20 },
  690. // { color: "#e6a23c", percentage: 40 },
  691. // { color: "#5cb87a", percentage: 60 },
  692. // { color: "#1989fa", percentage: 80 },
  693. { color: "#6f7ad3", percentage: 100 },
  694. ],
  695. };
  696. },
  697. computed: {
  698. ...mapGetters(["permissions"]),
  699. },
  700. created() {
  701. this.equ_state_open = this.permissions["equ_state_open"];
  702. this.equ_state_off = this.permissions["equ_state_off"];
  703. this.equ_state_back = this.permissions["equ_state_back"];
  704. this.equ_state_tranfer = this.permissions["equ_state_tranfer"];
  705. this.equ_state_unbind = this.permissions["equ_state_unbind"];
  706. this.equ_state_take = this.permissions["equ_state_take"];
  707. this.equ_state_WiFi = this.permissions["equ_state_WiFi"];
  708. this.equ_state_Voice = this.permissions["equ_state_Voice"];
  709. },
  710. mounted() {
  711. if(this.$route.query.flag){
  712. if(this.$route.query.flag==1){
  713. this.searchForm.onLine='0';
  714. }else{
  715. this.searchForm.onLine='1';
  716. this.searchForm.electricity=this.$route.query.electricity
  717. }
  718. }
  719. // asd
  720. this.getTableList();
  721. // 获取列表
  722. this.zkhousePage();
  723. },
  724. methods: {
  725. // wifi
  726. wifiShow(row) {
  727. this.wifiVisible = true;
  728. // 获取wifi数据
  729. this.wifiFindById(row.id);
  730. },
  731. //
  732. wifiFindById(id) {
  733. this.$api.api
  734. .wifiFindById({
  735. id,
  736. })
  737. .then((res) => {
  738. this.wifiForm = {
  739. imei: res.data.imei,
  740. masterWifiName: res.data.masterWifiName,
  741. masterWifiPassword: res.data.masterWifiPassword,
  742. spareOneWifiName: res.data.spareOneWifiName,
  743. spareOneWifiPassword: res.data.spareOneWifiPassword,
  744. spareTwoWifiName: res.data.spareTwoWifiName,
  745. spareTwoWifiPassword: res.data.spareTwoWifiPassword,
  746. };
  747. if (!res.data.receiveType) {
  748. this.wifiForm.id = res.data.id;
  749. }
  750. });
  751. },
  752. wifiEdit() {
  753. // console.log(this.wifiForm);
  754. // return
  755. this.$refs.wifiForm.validate((valid) => {
  756. if (valid) {
  757. if (
  758. this.wifiForm.masterWifiName &&
  759. !this.wifiForm.masterWifiPassword
  760. ) {
  761. this.$message.warning("请检查主WiFi密码是否填写");
  762. return;
  763. }
  764. if (
  765. this.wifiForm.spareOneWifiName &&
  766. !this.wifiForm.spareOneWifiPassword
  767. ) {
  768. this.$message.warning("请检查备用一密码是否填写");
  769. return;
  770. }
  771. if (
  772. this.wifiForm.spareTwoWifiName &&
  773. !this.wifiForm.spareTwoWifiPassword
  774. ) {
  775. this.$message.warning("请检查备用二密码是否填写");
  776. return;
  777. }
  778. this.$api.api.wifiUpdate(this.wifiForm).then((res) => {
  779. // console.log(res);
  780. this.$message.success("修改成功");
  781. this.wifiVisible = false;
  782. });
  783. }
  784. });
  785. },
  786. resetWifi() {},
  787. getTableList() {
  788. this.$api.api
  789. .equipmentZxOnFindByPage({
  790. size: this.size,
  791. current: this.currentPage,
  792. timeType:2,
  793. orgType: localStorage.getItem("orgType"),
  794. orgCode: localStorage.getItem("orgCode"),
  795. agentId: localStorage.getItem("agentId"),
  796. houseId: localStorage.getItem("houseId"),
  797. ...this.searchForm,
  798. })
  799. .then((res) => {
  800. // console.log(res);
  801. let newlist=res.data.list.records;
  802. newlist.map(item=>{
  803. let num=this.ascformatDate(item.updateTime)
  804. if(num>12){
  805. item.electricity=0;
  806. item.signalDevice=0;
  807. }
  808. })
  809. this.tableData = newlist;
  810. this.onLineCount = res.data.onLineCount;
  811. this.offLineCount = res.data.offLineCount;
  812. this.workingCount = res.data.workingCount;
  813. this.total = res.data.list.total;
  814. });
  815. },
  816. ascformatDate(dateTimeStamp){
  817. let newDate = new Date(dateTimeStamp.replace(/-/g, '/')).getTime();
  818. let minute = 1000 * 60;
  819. let hour = minute * 60;
  820. let day = hour * 24;
  821. let halfamonth = day * 15;
  822. let month = day * 30;
  823. let now = new Date().getTime();
  824. let diffValue = now - newDate;
  825. let result =diffValue/hour;
  826. return result;
  827. },
  828. //批量
  829. Batchreturn() {
  830. this.$confirm("确认批量归还吗?", "提示", {
  831. confirmButtonText: "确定",
  832. cancelButtonText: "取消",
  833. type: "warning",
  834. })
  835. .then(() => {
  836. let str = [];
  837. this.multipleSelection.map((item) => {
  838. str.push(item.imei);
  839. });
  840. this.$api.api
  841. .zkequipmentEquipmentBack({
  842. imeis: str.join(","),
  843. })
  844. .then((res) => {
  845. this.$message({
  846. type: "success",
  847. message: "批量归还成功!",
  848. });
  849. this.getTableList();
  850. });
  851. })
  852. .catch(() => {
  853. });
  854. },
  855. zkequipmentUnbind() {
  856. this.$confirm("确认批量解绑吗?", "提示", {
  857. confirmButtonText: "确定",
  858. cancelButtonText: "取消",
  859. type: "warning",
  860. })
  861. .then(() => {
  862. let str = [];
  863. this.multipleSelection.map((item) => {
  864. if (item.receiveType != 2) {
  865. str.push(item.imei);
  866. }
  867. });
  868. console.log(str);
  869. this.$api.api
  870. .zkequipmentUnbind({
  871. imeis: str.join(","),
  872. })
  873. .then((res) => {
  874. this.$message({
  875. type: "success",
  876. message: "操作成功!",
  877. });
  878. this.getTableList();
  879. });
  880. })
  881. .catch(() => {
  882. });
  883. },
  884. zkhousePage() {
  885. this.$api.api
  886. .findHouseByUser({
  887. orgType: localStorage.getItem("orgType"),
  888. })
  889. .then((res) => {
  890. // console.log(res)
  891. this.houseList = res.data;
  892. // this.searchForm.houseId = res.data[0].id;
  893. // 列表获取
  894. // this.correctFindbypage();
  895. });
  896. },
  897. //批量转移
  898. infoMasstransfer() {
  899. this.dialogVisible5 = true;
  900. },
  901. houseChange(e) {
  902. console.log(e);
  903. let idx = this.houseList.findIndex((item) => item.id == e);
  904. if (idx != -1) {
  905. this.bindForm.orgCode = this.houseList[idx].orgCode;
  906. }
  907. },
  908. Masstransfer() {
  909. this.$refs.allbindForm.validate((valid) => {
  910. if (valid) {
  911. console.log(this.bindForm);
  912. let arr = [];
  913. this.multipleSelection.map((item) => arr.push(item.imei));
  914. let obj = {
  915. houseId: this.bindForm.houseId,
  916. orgCode: this.bindForm.orgCode,
  917. imeis: arr.join(","),
  918. };
  919. this.$api.api.zkequipmentBind(obj).then((res) => {
  920. console.log(res);
  921. this.$message.success("绑定成功");
  922. this.getTableList();
  923. this.dialogVisible5 = false;
  924. });
  925. }
  926. });
  927. },
  928. resetBind() {
  929. this.bindForm = {
  930. remark: "",
  931. houseId: "",
  932. };
  933. },
  934. screen() {
  935. this.currentPage = 1;
  936. // console.log(this.searchForm);
  937. this.getTableList();
  938. },
  939. reset() {
  940. this.changeValue = "";
  941. this.searchForm = {
  942. name: "",
  943. imei: "", //设备号
  944. batchId: "", //批次号
  945. // equipmentType: "", //设备类型
  946. receiveType: "", //领用状态
  947. defaultTransliteration: "", //转写方式
  948. startDate: "", //开始时间
  949. endDate: "", //结束时间
  950. agentName: "", //代理商名称
  951. orgName: "", //公司名称
  952. houseName: "", //楼盘名称
  953. acceptanceStatus: "", //设备状态
  954. simAudioStatus: "", //录音状态
  955. simAudioUploadStatus: "", //上传状态
  956. offStatus: "", //关机状态
  957. onLine: "",
  958. userName:'',
  959. electricity:''
  960. };
  961. this.time=[]
  962. this.currentPage = 1;
  963. this.getTableList();
  964. },
  965. receive(row) {
  966. this.receiveVisible = true;
  967. // this.bindForm.imeis = row.imei;
  968. this.receiveForm.houseId = row.propertyId;
  969. this.receiveForm.bindHouseName = row.bindHouseName;
  970. this.receiveForm.imei = row.imei;
  971. this.getUserByHouseId(row.propertyId);
  972. },
  973. saveReceive() {
  974. this.$refs.receiveForm.validate((valid) => {
  975. if (valid) {
  976. this.$api.api.equipmentReceiving(this.receiveForm).then((res) => {
  977. // console.log(res);
  978. this.receiveVisible = false;
  979. this.getTableList();
  980. this.$message({
  981. type: "success",
  982. message: "领用成功!",
  983. });
  984. });
  985. }
  986. });
  987. },
  988. resetReceive() {
  989. this.receiveForm = {
  990. houseId: "",
  991. bindHouseName: "",
  992. accountId: "",
  993. };
  994. },
  995. handleCommand(e, row) {
  996. console.log(row);
  997. this[e](row);
  998. },
  999. // 顾问列表
  1000. getUserByHouseId(houseId) {
  1001. this.$api.api
  1002. .getUserByHouseId({
  1003. houseId,
  1004. })
  1005. .then((res) => {
  1006. // console.log(res);
  1007. this.userList = res.data;
  1008. });
  1009. },
  1010. voiceOpen(row){
  1011. this.$confirm(
  1012. `确认${row.recCmd == "start" ? "关闭" : "开启"}录音吗?`,
  1013. "提示",
  1014. {
  1015. confirmButtonText: "确定",
  1016. cancelButtonText: "取消",
  1017. type: "warning",
  1018. }
  1019. )
  1020. .then(() => {
  1021. this.$api.api
  1022. .audioStatusControl({
  1023. imei: row.imei,
  1024. recCmd: row.recCmd == "start" ? "stop" : "start",
  1025. })
  1026. .then((res) => {
  1027. this.$message({
  1028. type: "success",
  1029. message: "操作成功!",
  1030. });
  1031. this.getTableList();
  1032. });
  1033. })
  1034. .catch(() => {
  1035. });
  1036. },
  1037. // 指示灯开启关闭
  1038. lightStatusChange(row) {
  1039. this.$confirm(
  1040. `确认${row.lightStatus == "on" ? "关闭" : "开启"}指示灯吗?`,
  1041. "提示",
  1042. {
  1043. confirmButtonText: "确定",
  1044. cancelButtonText: "取消",
  1045. type: "warning",
  1046. }
  1047. )
  1048. .then(() => {
  1049. this.$api.api
  1050. .batchOperateIndicator({
  1051. imeis: row.imei,
  1052. lightStatus: row.lightStatus == "on" ? "off" : "on",
  1053. })
  1054. .then((res) => {
  1055. this.$message({
  1056. type: "success",
  1057. message: "操作成功!",
  1058. });
  1059. this.getTableList();
  1060. });
  1061. })
  1062. .catch(() => {
  1063. });
  1064. },
  1065. openAllLight() {
  1066. this.$confirm(`确认开启指示灯吗?`, "提示", {
  1067. confirmButtonText: "确定",
  1068. cancelButtonText: "取消",
  1069. type: "warning",
  1070. })
  1071. .then(() => {
  1072. let str = [];
  1073. this.multipleSelection.map((item) => {
  1074. str.push(item.imei);
  1075. });
  1076. this.$api.api
  1077. .batchOperateIndicator({
  1078. imeis: str.join(","),
  1079. lightStatus: "on",
  1080. })
  1081. .then((res) => {
  1082. this.$message({
  1083. type: "success",
  1084. message: "操作成功!",
  1085. });
  1086. this.getTableList();
  1087. });
  1088. })
  1089. .catch(() => {
  1090. });
  1091. },
  1092. closeAllLight() {
  1093. this.$confirm(`确认关闭指示灯吗?`, "提示", {
  1094. confirmButtonText: "确定",
  1095. cancelButtonText: "取消",
  1096. type: "warning",
  1097. })
  1098. .then(() => {
  1099. let str = [];
  1100. this.multipleSelection.map((item) => {
  1101. str.push(item.imei);
  1102. });
  1103. this.$api.api
  1104. .batchOperateIndicator({
  1105. imeis: str.join(","),
  1106. lightStatus: "off",
  1107. })
  1108. .then((res) => {
  1109. this.$message({
  1110. type: "success",
  1111. message: "操作成功!",
  1112. });
  1113. this.getTableList();
  1114. });
  1115. })
  1116. .catch(() => {
  1117. });
  1118. },
  1119. //归还
  1120. toinifoThereturn(row) {
  1121. this.$confirm("确认归还吗?", "提示", {
  1122. confirmButtonText: "确定",
  1123. cancelButtonText: "取消",
  1124. type: "warning",
  1125. })
  1126. .then(() => {
  1127. this.$api.api
  1128. .zkequipmentEquipmentBack({
  1129. imeis: row.imei,
  1130. })
  1131. .then((res) => {
  1132. this.$message({
  1133. type: "success",
  1134. message: "归还成功!",
  1135. });
  1136. this.getTableList();
  1137. });
  1138. })
  1139. .catch(() => {
  1140. });
  1141. },
  1142. timeChange(e) {
  1143. if (e) {
  1144. this.searchForm.startDate = e[0];
  1145. this.searchForm.endDate = e[1];
  1146. }else{
  1147. this.searchForm.startDate = '';
  1148. this.searchForm.endDate ='';
  1149. }
  1150. },
  1151. selChange() {
  1152. this.changeValue = "";
  1153. this.searchForm.imei = "";
  1154. this.searchForm.batchId = "";
  1155. this.searchForm.agentName = "";
  1156. this.searchForm.orgName = "";
  1157. this.searchForm.houseName = "";
  1158. this.searchForm.userName=''
  1159. },
  1160. selectChange(e) {
  1161. this.searchForm.imei = "";
  1162. this.searchForm.batchId = "";
  1163. this.searchForm.agentName = "";
  1164. this.searchForm.orgName = "";
  1165. this.searchForm.houseName = "";
  1166. this.searchForm.userName=''
  1167. if (!e) retun;
  1168. if (this.selflag == 1) {
  1169. // 设备编号
  1170. this.searchForm.imei = e;
  1171. }
  1172. if (this.selflag == 3) {
  1173. // 批次号
  1174. this.searchForm.batchId = e;
  1175. }
  1176. if (this.selflag == 4) {
  1177. // 代理商名称
  1178. this.searchForm.agentName = e;
  1179. }
  1180. if (this.selflag == 5) {
  1181. // 公司名称
  1182. this.searchForm.orgName = e;
  1183. }
  1184. if (this.selflag == 6) {
  1185. // 楼盘名称
  1186. this.searchForm.houseName = e;
  1187. }
  1188. },
  1189. // //批量归还
  1190. // toinifoThereturn() {
  1191. // this.$confirm("确认更改吗?", "提示", {
  1192. // confirmButtonText: "确定",
  1193. // cancelButtonText: "取消",
  1194. // type: "warning",
  1195. // })
  1196. // .then(() => {
  1197. // this.$message({
  1198. // type: "success",
  1199. // message: "更改成功!",
  1200. // });
  1201. // })
  1202. // .catch(() => {
  1203. // this.$message({
  1204. // type: "info",
  1205. // message: "更改归还",
  1206. // });
  1207. // });
  1208. // },
  1209. handleSelectionChange(val) {
  1210. this.multipleSelection = val;
  1211. },
  1212. handleSizeChange(val) {
  1213. console.log(`每页 ${val} 条`);
  1214. this.size = val;
  1215. this.getTableList();
  1216. },
  1217. handleCurrentChange(val) {
  1218. console.log(`当前页: ${val}`);
  1219. this.currentPage = val;
  1220. this.getTableList();
  1221. },
  1222. },
  1223. };
  1224. </script>
  1225. <style scoped="scoped" lang="scss" >
  1226. .box-center {
  1227. width: 100%;
  1228. padding: 15px;
  1229. min-width: 1000px;
  1230. padding-bottom: 100px;
  1231. }
  1232. .tongji {
  1233. padding-bottom: 10px;
  1234. font-size: 16px;
  1235. color: red;
  1236. }
  1237. .cen-tab {
  1238. width: 100%;
  1239. padding: 15px;
  1240. background: #ffffff;
  1241. margin-top: 15px;
  1242. }
  1243. .tophove {
  1244. color: #ffffff;
  1245. background: #2671e2;
  1246. }
  1247. .app-top {
  1248. width: 100%;
  1249. background: #ffffff;
  1250. box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.04);
  1251. border-radius: 4px;
  1252. padding-top: 15px;
  1253. padding-bottom: 15px;
  1254. .app-titel {
  1255. width: 100%;
  1256. display: flex;
  1257. align-items: center;
  1258. flex-wrap: wrap;
  1259. .label {
  1260. font-size: 14px;
  1261. font-weight: 400;
  1262. color: #32363d;
  1263. line-height: 32px;
  1264. margin-left: 15px;
  1265. min-width: 78px;
  1266. }
  1267. .toptimeqhuan {
  1268. height: 30px;
  1269. background: #ffffff;
  1270. display: flex;
  1271. align-items: center;
  1272. }
  1273. .toptimeqhuan div {
  1274. padding-left: 20px;
  1275. padding-right: 20px;
  1276. text-align: center;
  1277. line-height: 30px;
  1278. font-size: 14px;
  1279. margin-right: 15px;
  1280. border-radius: 4px;
  1281. border: 1px solid #e0e0e0;
  1282. }
  1283. }
  1284. }
  1285. .div-lab {
  1286. display: flex;
  1287. margin: 5px;
  1288. }
  1289. .div-inp {
  1290. width: 250px;
  1291. }
  1292. </style>