You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

522 lines
16 KiB

  1. <template>
  2. <div class="box-center">
  3. <div class="toptab">
  4. <div
  5. @click="tapclickyab(0)"
  6. :class="{ activecllasscet: activeTotal == 0 }"
  7. :style="{ background: activeTotal == 0 ? '#2671E2' : '#ffffff' }"
  8. >
  9. 设备在线记录
  10. </div>
  11. <div
  12. @click="tapclickyab(1)"
  13. :class="{ activecllasscet: activeTotal == 1 }"
  14. :style="{ background: activeTotal == 1 ? '#2671E2' : '#ffffff' }"
  15. >
  16. 设备指派记录
  17. </div>
  18. </div>
  19. <div class="titlebox" v-if="activeTotal == 0">
  20. <div
  21. style="
  22. background: #ffffff;
  23. padding-left: 18px;
  24. display: flex;
  25. padding-top: 18px;
  26. "
  27. >
  28. <span style="line-height: 40px" class="demonstration">在线时间:</span>
  29. <el-date-picker
  30. @change="confirmtime()"
  31. v-model="customtime"
  32. type="daterange"
  33. range-separator="-"
  34. :default-time="['00:00:00', '23:59:59']"
  35. value-format="yyyy-MM-dd"
  36. start-placeholder="开始日期"
  37. end-placeholder="结束日期"
  38. >
  39. </el-date-picker>
  40. <span class="demonstration" style="margin-left: 18px; line-height: 40px"
  41. >楼盘名称:</span
  42. >
  43. <div style="width: 200px">
  44. <!-- <el-input v-model="page.houseName"></el-input>-->
  45. <el-select v-model="page.houseName" placeholder="请选择">
  46. <el-option
  47. v-for="item in houseList"
  48. :key="item.id"
  49. :label="item.propertyName"
  50. :value="item.id"
  51. >
  52. </el-option>
  53. </el-select>
  54. </div>
  55. </div>
  56. <div
  57. style="
  58. background: #ffffff;
  59. padding-left: 18px;
  60. display: flex;
  61. padding-top: 18px;
  62. "
  63. >
  64. <span style="line-height: 40px" class="demonstration">领用人:</span>
  65. <div style="width: 200px">
  66. <el-input v-model="page.accountName"></el-input>
  67. </div>
  68. <span class="demonstration" style="margin-left: 18px; line-height: 40px"
  69. >设备编号:</span
  70. >
  71. <div style="width: 200px">
  72. <el-input v-model="page.imei"></el-input>
  73. </div>
  74. </div>
  75. <div
  76. style="
  77. background: #ffffff;
  78. padding-left: 18px;
  79. display: flex;
  80. padding-top: 18px;
  81. "
  82. >
  83. <div style="margin-left: 20px">
  84. <el-button
  85. @click="screening()"
  86. style="background: #2671e2; color: #ffffff"
  87. >筛选</el-button
  88. >
  89. </div>
  90. <div style="margin-left: 20px">
  91. <el-button @click="empty()">清空筛选条件</el-button>
  92. </div>
  93. </div>
  94. </div>
  95. <div class="tablebox" v-if="activeTotal == 0">
  96. <template>
  97. <el-table :data="tableData" style="width: 100%">
  98. <el-table-column prop="index" label="序号" width="100" align="center">
  99. </el-table-column>
  100. <el-table-column prop="imei" label="设备编号" align="center">
  101. </el-table-column>
  102. <el-table-column prop="accountName" label="领用人" align="center">
  103. </el-table-column>
  104. <el-table-column prop="openTime" label="在线时间" align="center">
  105. </el-table-column>
  106. <el-table-column prop="closeTime" label="离线时间" align="center">
  107. </el-table-column>
  108. <el-table-column prop="offStatusName" label="离线原因" align="center">
  109. </el-table-column>
  110. </el-table>
  111. </template>
  112. <div style="display: flex; justify-content: flex-end; margin-top: 10px">
  113. <el-pagination
  114. @size-change="handleSizeChange"
  115. @current-change="handleCurrentChange"
  116. :current-page="currentPage4"
  117. :page-sizes="[6, 10, 14, 20]"
  118. :page-size="6"
  119. layout="total, sizes, prev, pager, next, jumper"
  120. :total="page.total"
  121. >
  122. </el-pagination>
  123. </div>
  124. </div>
  125. <div class="titlebox" v-if="activeTotal == 1">
  126. <div
  127. style="
  128. background: #ffffff;
  129. padding-left: 18px;
  130. display: flex;
  131. padding-top: 18px;
  132. "
  133. >
  134. <span style="line-height: 40px" class="demonstration">指派时间:</span>
  135. <el-date-picker
  136. @change="confirmtime()"
  137. v-model="customtime"
  138. type="daterange"
  139. range-separator="-"
  140. :default-time="['00:00:00', '23:59:59']"
  141. value-format="yyyy-MM-dd"
  142. start-placeholder="开始日期"
  143. end-placeholder="结束日期"
  144. >
  145. </el-date-picker>
  146. <span class="demonstration" style="margin-left: 18px; line-height: 40px"
  147. >楼盘名称:</span
  148. >
  149. <div style="width: 200px">
  150. <!-- <el-input v-model="page.houseName"></el-input>-->
  151. <el-select v-model="page.houseName" placeholder="请选择">
  152. <el-option
  153. v-for="item in houseList"
  154. :key="item.id"
  155. :label="item.propertyName"
  156. :value="item.id"
  157. >
  158. </el-option>
  159. </el-select>
  160. </div>
  161. </div>
  162. <div
  163. style="
  164. background: #ffffff;
  165. padding-left: 18px;
  166. display: flex;
  167. padding-top: 18px;
  168. "
  169. >
  170. <span style="line-height: 40px" class="demonstration">领用人:</span>
  171. <div style="width: 200px">
  172. <el-input v-model="page.accountName"></el-input>
  173. </div>
  174. <span class="demonstration" style="margin-left: 18px; line-height: 40px"
  175. >设备编号:</span
  176. >
  177. <div style="width: 200px">
  178. <el-input v-model="page.imei"></el-input>
  179. </div>
  180. <span class="demonstration" style="margin-left: 18px; line-height: 40px"
  181. >录音结果:</span
  182. >
  183. <div style="width: 200px">
  184. <el-select v-model="page.recording" placeholder="请选择">
  185. <el-option
  186. v-for="item in options"
  187. :key="item.value"
  188. :label="item.label"
  189. :value="item.value"
  190. >
  191. </el-option>
  192. </el-select>
  193. </div>
  194. </div>
  195. <div
  196. style="
  197. background: #ffffff;
  198. padding-left: 18px;
  199. display: flex;
  200. padding-top: 18px;
  201. "
  202. >
  203. <div style="margin-left: 20px">
  204. <el-button
  205. @click="screening()"
  206. style="background: #2671e2; color: #ffffff"
  207. >筛选</el-button
  208. >
  209. </div>
  210. <div style="margin-left: 20px">
  211. <el-button @click="empty()">清空筛选条件</el-button>
  212. </div>
  213. </div>
  214. </div>
  215. <div class="tablebox" v-if="activeTotal == 1">
  216. <template>
  217. <el-table :data="tableData" style="width: 100%">
  218. <el-table-column prop="index" label="序号" width="100" align="center">
  219. </el-table-column>
  220. <el-table-column prop="imei" label="设备编号" align="center">
  221. </el-table-column>
  222. <el-table-column prop="agentName" label="领用人" align="center">
  223. </el-table-column>
  224. <!-- <el-table-column-->
  225. <!-- prop="id"-->
  226. <!-- label="接待记录ID"-->
  227. <!-- align="center">-->
  228. <!-- </el-table-column>-->
  229. <el-table-column prop="staTime" label="指派时间" align="center">
  230. </el-table-column>
  231. <el-table-column prop="endTime" label="结束时间" align="center">
  232. <template slot-scope="scope">
  233. {{ scope.row.endTime.substring(0, 19) }}
  234. </template>
  235. </el-table-column>
  236. <el-table-column prop="recordingName" label="录音结果" align="center">
  237. </el-table-column>
  238. <el-table-column
  239. prop="recordingReasonName"
  240. label="未完整录音原因"
  241. align="center"
  242. >
  243. </el-table-column>
  244. <el-table-column prop="" label="操作" align="center">
  245. <template slot-scope="{ row }">
  246. <el-button
  247. v-if="row.recording != 0"
  248. @click.native.prevent="goinfo(row)"
  249. type="text"
  250. size="small"
  251. >接待详情</el-button
  252. >
  253. </template>
  254. </el-table-column>
  255. </el-table>
  256. </template>
  257. <div style="display: flex; justify-content: flex-end; margin-top: 10px">
  258. <el-pagination
  259. @size-change="handleSizeChange"
  260. @current-change="handleCurrentChange"
  261. :current-page="currentPage4"
  262. :page-sizes="[6, 10, 14, 20]"
  263. :page-size="6"
  264. layout="total, sizes, prev, pager, next, jumper"
  265. :total="page.total"
  266. >
  267. </el-pagination>
  268. </div>
  269. </div>
  270. </div>
  271. </template>
  272. <script>
  273. export default {
  274. data() {
  275. return {
  276. activeTotal: 0,
  277. customtime: "",
  278. tableData: [],
  279. currentPage4: 1,
  280. houseList: [],
  281. flag: false,
  282. page: {
  283. pageNum: 1,
  284. pageSize: 6,
  285. openTime: "",
  286. closeTime: "",
  287. houseName: "",
  288. accountName: "",
  289. imei: "",
  290. total:10,
  291. recording: "",
  292. },
  293. options: [
  294. {
  295. value: "0",
  296. label: "无录音",
  297. },
  298. {
  299. value: "1",
  300. label: "部分录音",
  301. },
  302. {
  303. value: "2",
  304. label: "完整录音",
  305. },
  306. ],
  307. };
  308. },
  309. mounted() {
  310. return
  311. let theRequest=this.$route.query
  312. console.log(theRequest, "123"); //此时的theRequest就是我们需要的参数;
  313. if (theRequest.houseId) {
  314. this.activeTotal = theRequest.flag;
  315. this.flag = true;
  316. this.page.openTime = theRequest.startDate;
  317. this.page.closeTime = theRequest.endDate;
  318. this.customtime = [theRequest.startDate, theRequest.endDate];
  319. this.page.houseName = theRequest.houseId;
  320. } else {
  321. let num = 24 * 3600 * 1000 * 6;
  322. let time1 = this.timestampToTime(new Date().getTime() - num);
  323. console.log(this.timestampToTime(new Date().getTime()), time1);
  324. this.page.openTime = time1.trim();
  325. this.page.closeTime = this.timestampToTime(new Date().getTime()).trim();
  326. this.customtime = [this.page.openTime, this.page.closeTime];
  327. }
  328. // this.activeTotal=0;
  329. // this.customtime=[] ;
  330. this.tableData = [];
  331. this.tableData1 = [];
  332. this.getHouseList();
  333. },
  334. methods: {
  335. timestampToTime(timestamp) {
  336. var date = new Date(timestamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
  337. // var date = new Date(timestamp * 1000);//时间戳为10位需*1000,时间戳为13位的话不需乘1000
  338. var yyyy = date.getFullYear() + "-";
  339. var MM =
  340. (date.getMonth() + 1 < 10
  341. ? "0" + (date.getMonth() + 1)
  342. : date.getMonth() + 1) + "-";
  343. // var dd = date.getDate() + ' ';
  344. var dd =
  345. (date.getDate() < 10 ? "0" + date.getDate() : date.getDate()) + " ";
  346. // var HH = date.getHours() + ':';
  347. // var HH = (date.getHours() < 10 ? '0'+(date.getHours()) : date.getHours()) + ':';
  348. //
  349. // // var mm = date.getMinutes() + ':';
  350. // var mm = (date.getMinutes() < 10 ? '0'+(date.getMinutes()) : date.getMinutes()) + ':';
  351. //
  352. // // var ss = date.getSeconds();
  353. // var ss = (date.getSeconds() < 10 ? '0'+(date.getSeconds()) : date.getSeconds());
  354. // return yyyy+MM+dd+HH+mm+ss;
  355. return yyyy + MM + dd;
  356. },
  357. //时间补0
  358. Zeropadding(s) {
  359. return s < 10 ? "0" + s : s;
  360. },
  361. tapclickyab(i) {
  362. this.activeTotal = i;
  363. this.getTableList();
  364. },
  365. screening() {
  366. this.page.pageNum = 1;
  367. this.page.pageSize = 6;
  368. this.getTableList();
  369. },
  370. goinfo(row) {
  371. console.log(row);
  372. location.href = "${jypath}/zk/file/receptionDetails";
  373. localStorage.setItem("AudioListId", row.id);
  374. localStorage.setItem("AudioIdx", 0);
  375. },
  376. empty() {
  377. this.page = {
  378. pageNum: 1,
  379. pageSize: 6,
  380. openTime: "",
  381. closeTime: "",
  382. houseName: this.houseList[0].id,
  383. accountName: "",
  384. imei: "",
  385. total: "",
  386. };
  387. this.customtime = "";
  388. this.getTableList();
  389. },
  390. //时间选择
  391. confirmtime() {
  392. console.log(this.customtime);
  393. // const d = new Date(this.customtime[0])
  394. // this.page.openTime = d.getFullYear() + '-' + this.Zeropadding((d.getMonth() + 1)) + '-' + this.Zeropadding(d.getDate())
  395. // const c = new Date(this.customtime[1])
  396. // this.page.closeTime = c.getFullYear() + '-' + this.Zeropadding((c.getMonth() + 1)) + '-' + this.Zeropadding(c.getDate())
  397. this.page.openTime = this.customtime[0];
  398. this.page.closeTime = this.customtime[1];
  399. },
  400. handleSizeChange(val) {
  401. console.log("每页条" + val);
  402. this.page.pageSize = val;
  403. this.getTableList();
  404. },
  405. handleCurrentChange(val) {
  406. console.log("当前页" + val);
  407. this.page.pageNum = val;
  408. this.getTableList();
  409. },
  410. //获取楼盘数据
  411. getHouseList() {
  412. axios({
  413. url: `${jypath}/equipment/onlinerecord/findAllProperties`,
  414. method: "get",
  415. }).then((res) => {
  416. // console.log(res.data.obj)
  417. if (res.data.res == 1) {
  418. this.houseList = res.data.obj;
  419. if (!this.flag) {
  420. this.page.houseName = res.data.obj[0].id;
  421. }
  422. this.getTableList();
  423. // res.data.obj.results.forEach((item,index)=>{
  424. // item.index=index+1
  425. // })
  426. // this.tableData=res.data.obj.results;
  427. // this.page.total = res.data.obj.totalRecord;
  428. }
  429. });
  430. },
  431. //获取table数据、
  432. getTableList() {
  433. console.log(this.activeTotal, "888888888888888888888");
  434. var url = "";
  435. let obj = {
  436. pageNum: this.page.pageNum,
  437. pageSize: this.page.pageSize,
  438. imei: this.page.imei,
  439. };
  440. this.tableData = [];
  441. if (this.activeTotal == 0) {
  442. url = `${jypath}/equipment/onlinerecord/findByPage`;
  443. obj.openTime = this.page.openTime;
  444. obj.closeTime = this.page.closeTime;
  445. obj.houseId = this.page.houseName;
  446. obj.accountName = this.page.accountName;
  447. } else {
  448. url = `${jypath}/equipment/onlinerecord/assignmentRecord`;
  449. obj.staDate = this.page.openTime;
  450. obj.endDate = this.page.closeTime;
  451. obj.projectId = this.page.houseName;
  452. obj.agentName = this.page.accountName;
  453. obj.recording = this.page.recording;
  454. }
  455. axios({
  456. url: url,
  457. method: "post",
  458. data: obj,
  459. }).then((res) => {
  460. // console.log(res)
  461. if (res.data.res == 1) {
  462. if (!res.data.obj.results) return;
  463. res.data.obj.results.forEach((item, index) => {
  464. item.index = index + 1;
  465. });
  466. this.tableData = res.data.obj.results;
  467. this.page.total = res.data.obj.totalRecord;
  468. }
  469. });
  470. },
  471. },
  472. };
  473. </script>
  474. <style scoped >
  475. .box-center {
  476. width: 100%;
  477. padding: 15px;
  478. min-width: 1200px;
  479. padding-bottom: 100px;
  480. }
  481. .toptab {
  482. width: 100%;
  483. display: flex;
  484. }
  485. .toptab div {
  486. padding-left: 30px;
  487. padding-right: 30px;
  488. padding-top: 10px;
  489. padding-bottom: 10px;
  490. font-size: 14px;
  491. }
  492. .activecllasscet {
  493. color: #ffffff;
  494. }
  495. .titlebox {
  496. width: 100%;
  497. background: #ffffff;
  498. box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.04);
  499. border-radius: 8px;
  500. margin-top: 20px;
  501. padding-bottom: 18px;
  502. }
  503. .tablebox {
  504. width: 100%;
  505. background: #ffffff;
  506. box-shadow: 0px 0px 12px 0px rgba(0, 0, 0, 0.04);
  507. border-radius: 8px;
  508. margin-top: 20px;
  509. padding: 18px;
  510. }
  511. </style>