home.vue 31 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043
  1. <!--
  2. * @Title:
  3. * @Description: 首页
  4. * @Author: swp
  5. * @Date: 2022-08-24 10:49:21
  6. * @LastEditors:
  7. * @LastEditTime: 2022-08-24 10:49:21
  8. -->
  9. <template>
  10. <view class="container">
  11. <!-- <uni-nav-bar :fixed="true" backgroundColor="#f7f7f7" statusBar="false" height="75px">
  12. <block slot="left">
  13. <view class="view-flex-block-center">
  14. <image src="/static/images/logo_start.png"
  15. style="width: 100rpx;height: 100rpx;background: lightgray;border-radius: 50%;" mode="widthFix">
  16. </image>
  17. </view>
  18. </block>
  19. <view class="view-flex-inline">
  20. <uni-list style="background-color: #f7f7f7;" :border="false">
  21. <uni-list-item v-if="isLogin" :border="false" style="background-color: #f7f7f7;" showArrow
  22. :title="userName" :note="userNote" :clickable="true" @click="onUserInfoClick()" />
  23. <uni-list-item v-else :border="false" style="background-color: #f7f7f7;" showArrow title="登录/注册"
  24. note="快速登录 注册体验更多功能" :clickable="true" @click="onLoginClick()" />
  25. </uni-list>
  26. </view>
  27. <block slot="right">
  28. <view style="margin-right:0rpx" @click="onNoticeMoreClick">
  29. <uni-badge class="uni-badge-left-margin" absolute="rightTop" :is-dot="noticeDot" :text="noticeValue"
  30. size="small">
  31. <uni-icons class="input-uni-icon" type="email" size="24" color="#000000" />
  32. </uni-badge>
  33. </view>
  34. <view style="margin-right:10rpx;margin-left: 10px;" @click="onNoticeMoreClick">
  35. <uni-badge class="uni-badge-left-margin" absolute="rightTop" size="small">
  36. <uni-icons class="input-uni-icon" type="scan" size="24" color="#000000" />
  37. </uni-badge>
  38. </view>
  39. </block>
  40. </uni-nav-bar> -->
  41. <!-- <uni-card title="快捷操作" :is-shadow="false">
  42. <view class="view-flex-inline">
  43. <text class="text-under-line" style="color: coral;font-size: 1rem;"
  44. @click="toShortcutCreateOrder">发起工单</text>
  45. <text class="text-under-line" style="color: coral;font-size: 1rem;margin-left: 40px;"
  46. @click="toShortcutInspectionPlan">创建巡检保养计划</text>
  47. </view>
  48. </uni-card> -->
  49. <!-- <uni-group> -->
  50. <swiper circular :indicator-dots="false" :autoplay="true" :interval="2000" :duration="500">
  51. <swiper-item v-for="item in ads" :key="item.id" style="height: 200px;line-height: 300rpx;">
  52. <image :src="toOss(item.url)" style="width: 100%;width: 100%;" mode="widthFix"></image>
  53. </swiper-item>
  54. </swiper>
  55. <!-- </uni-group> -->
  56. <uni-list>
  57. <uni-list-item title="待办工单" showArrow :thumb="todoOrderImg" thumb-size="base" style="height: 80px;" clickable
  58. @click="toDo()">
  59. <template v-slot:footer>
  60. <view class="point" style="margin-right: 5px;">
  61. <view class="dot">
  62. {{todoOrderCount}}
  63. </view>
  64. </view>
  65. </template>
  66. </uni-list-item>
  67. <uni-list-item title="待审批工单" showArrow :thumb="closeApproveOrderImg" thumb-size="base"
  68. style="height: 80px;" clickable @click="toOrderCloseApprove()" >
  69. <template v-slot:footer>
  70. <view class="point" style="margin-right: 5px;">
  71. <view class="dot">
  72. {{closeApproveOrderCount}}
  73. </view>
  74. </view>
  75. </template>
  76. </uni-list-item>
  77. <uni-list-item title="待巡检任务" showArrow :thumb="todoInspectionImg" thumb-size="base" style="height: 80px;" clickable
  78. @click="toInspection()">
  79. <template v-slot:footer>
  80. <view class="point" style="margin-right: 5px;">
  81. <view class="dot">
  82. {{inspectionTodoNoticeCount}}
  83. </view>
  84. </view>
  85. </template>
  86. </uni-list-item>
  87. <uni-list-item title="待审批巡检任务" showArrow :thumb="closeApproveInspectionImg" thumb-size="base"
  88. style="height: 80px;" clickable @click="toInspectionCloseApprove()">
  89. <template v-slot:footer>
  90. <view class="point" style="margin-right: 5px;">
  91. <view class="dot">
  92. {{inspectionCloseApproveCount}}
  93. </view>
  94. </view>
  95. </template>
  96. </uni-list-item>
  97. </uni-list>
  98. <uni-group>
  99. <uni-row>
  100. <uni-col :span="12">
  101. <view style="padding-left: 20px;padding-right: 20px;">
  102. <button type="primary" style="font-size: 0.8rem;background-color: rgb(31,121,253);" @click="toShortcutCreateOrder">
  103. <view class="view-flex-inline-center">
  104. <uni-icons type="plusempty" size="18" color="white" />
  105. <span style="margin-left: 5px;">新建工单</span>
  106. </view>
  107. </button>
  108. </view>
  109. </uni-col>
  110. <uni-col :span="12">
  111. <view class="view-flex-inline-center" style="padding-left: 20px;padding-right: 20px;">
  112. <button type="primary" style="font-size: 0.8rem;background-color: rgb(86,93,253);" @click="toShortcutInspectionPlan">
  113. <view class="view-flex-inline-center">
  114. <uni-icons type="plusempty" size="18" color="white" />
  115. <span style="margin-left: 5px;">巡检保养计划</span>
  116. </view>
  117. </button>
  118. </view>
  119. </uni-col>
  120. </uni-row>
  121. </uni-group>
  122. <uni-group>
  123. </uni-group>
  124. <!-- <uni-card title="待办工单" :thumbnail="checkLogo" :is-shadow="false">
  125. <uni-section title="新工单" type="circle">
  126. <view v-if="unconfirmOrderCount>0">
  127. <uni-list>
  128. <uni-list-item v-for="item in unconfirmOrderList" :key="item.id" showArrow clickable
  129. @click="toConfirm(item)" rightText="去接单">
  130. <template v-slot:body>
  131. <view class="list-item-block">
  132. <view class="line">
  133. <uni-icons type="personadd" size="18" color="lightblue" />
  134. <view class="text" style="width: 90%;color: gray;">
  135. 创建人: <span
  136. style="margin-left: 5px;color: cornflowerblue;">{{item.createOrderPersonName}}</span>
  137. </view>
  138. </view>
  139. <view class="line">
  140. <uni-icons type="calendar" size="18" color="lightblue" />
  141. <view class="text" style="width: 90%;color: gray;">
  142. 创建时间: <span
  143. style="margin-left: 5px;color: cornflowerblue;">{{item.createTime}}</span>
  144. </view>
  145. </view>
  146. <view class="line">
  147. <uni-icons type="help" size="18" color="lightblue" />
  148. <view class="text text-ellipsis" style="width: 90%;color: gray;">
  149. 问题描述: <span
  150. style="margin-left: 5px;color: cornflowerblue;">{{item.orderDesc}}</span>
  151. </view>
  152. </view>
  153. </view>
  154. </template>
  155. </uni-list-item>
  156. </uni-list>
  157. </view>
  158. <view v-else class="view-flex-inline">
  159. <image src="/static/images/todo/todo.png" style="width: 40px;margin-left: 10px;" mode="widthFix">
  160. </image>
  161. <view class="view-flex-block-center" style="margin-left: 10px;align-items: flex-start;">
  162. <text>暂无新工单</text>
  163. </view>
  164. </view>
  165. </uni-section>
  166. <uni-section title="待处理工单" type="circle">
  167. <view v-if="todoOrderCount>0">
  168. <uni-list>
  169. <uni-list-item v-for="item in todoOrderList" :key="item.id" showArrow clickable
  170. @click="toDo(item)" rightText="去处理">
  171. <template v-slot:body>
  172. <view class="list-item-block">
  173. <view class="line">
  174. <uni-icons type="personadd" size="18" color="lightblue" />
  175. <view class="text" style="width: 90%;color: gray;">
  176. 处理人: <span
  177. style="margin-left: 5px;color: cornflowerblue;">{{item.orderConfirmName}}</span>
  178. </view>
  179. </view>
  180. <view class="line">
  181. <uni-icons type="calendar" size="18" color="lightblue" />
  182. <view class="text" style="width: 90%;color: gray;">
  183. 完成时限: <span
  184. style="margin-left: 5px;color: cornflowerblue;">{{item.orderCompleteTime}}</span>
  185. </view>
  186. </view>
  187. </view>
  188. </template>
  189. </uni-list-item>
  190. </uni-list>
  191. </view>
  192. <view v-else class="view-flex-inline">
  193. <image src="/static/images/todo/todo.png" style="width: 40px;margin-left: 10px;" mode="widthFix">
  194. </image>
  195. <view class="view-flex-block-center" style="margin-left: 10px;align-items: flex-start;">
  196. <text>暂无待处理工单</text>
  197. </view>
  198. </view>
  199. </uni-section>
  200. <uni-section title="工单完结审批" type="circle">
  201. <view v-if="closeApproveOrderCount>0">
  202. <uni-list>
  203. <uni-list-item v-for="item in closeApproveOrderList" :key="item.id" showArrow clickable
  204. @click="toOrderCloseApprove(item)" rightText="去审批">
  205. <template v-slot:body>
  206. <view class="list-item-block">
  207. <view class="line">
  208. <uni-icons type="personadd" size="18" color="lightblue" />
  209. <view class="text" style="width: 90%;color: gray;">
  210. 填报人: <span
  211. style="margin-left: 5px;color: cornflowerblue;">{{item.processorName}}</span>
  212. </view>
  213. </view>
  214. <view class="line">
  215. <uni-icons type="calendar" size="18" color="lightblue" />
  216. <view class="text" style="width: 90%;color: gray;">
  217. 填报时间: <span
  218. style="margin-left: 5px;color: cornflowerblue;">{{item.orderProcessTime}}</span>
  219. </view>
  220. </view>
  221. <view class="line">
  222. <uni-icons type="help" size="18" color="lightblue" />
  223. <view class="text text-ellipsis" style="width: 90%;color: gray;">
  224. 反馈意见: <span
  225. style="margin-left: 5px;color: cornflowerblue;">{{item.processDesc}}</span>
  226. </view>
  227. </view>
  228. </view>
  229. </template>
  230. </uni-list-item>
  231. </uni-list>
  232. </view>
  233. <view v-else class="view-flex-inline">
  234. <image src="/static/images/todo/todo.png" style="width: 40px;margin-left: 10px;" mode="widthFix">
  235. </image>
  236. <view class="view-flex-block-center" style="margin-left: 10px;align-items: flex-start;">
  237. <text>暂无待审批工单</text>
  238. </view>
  239. </view>
  240. </uni-section>
  241. </uni-card> -->
  242. <!-- <uni-card title="巡检保养任务" :thumbnail="checkLogo" :is-shadow="false">
  243. <uni-section title="待巡检提醒" type="circle">
  244. <view v-if="inspectionTodoNoticeCount>0">
  245. <uni-list>
  246. <uni-list-item v-for="item in inspectionTodoNoticeList" :key="item.id" showArrow clickable
  247. @click="toInspection(item)" rightText="去巡检">
  248. <template v-slot:body>
  249. <view class="list-item-block">
  250. <view class="line">
  251. <view class="text" style="width: 90%;color: gray;">
  252. 巡检标题: <span
  253. style="margin-left: 5px;color: cornflowerblue;">{{item.inspectionTitle}}</span>
  254. </view>
  255. </view>
  256. <view v-if="item.planScheduledType ==1">
  257. <view class="line">
  258. <view class="text" style="width: 90%;color: gray;">
  259. 计划执行周期: <span style="margin-left: 5px;color: cornflowerblue;">仅一次</span>
  260. </view>
  261. </view>
  262. <view class="line">
  263. <view class="text" style="width: 90%;color: gray;">
  264. 巡检完成时间: <span
  265. style="margin-left: 5px;color: cornflowerblue;">{{item.inspectionCompleteTime}}</span>
  266. </view>
  267. </view>
  268. </view>
  269. <view v-else-if="item.planScheduledType ==2">
  270. <view class="line">
  271. <view class="text" style="width: 90%;color: gray;">
  272. 计划执行周期: <span style="margin-left: 5px;color: cornflowerblue;">定期</span>
  273. </view>
  274. </view>
  275. <view class="line">
  276. <view v-if="item.timeType ==1" class="text" style="width: 90%;color: gray;">
  277. 周期设置: <span style="margin-left: 5px;color: cornflowerblue;">按天</span>
  278. </view>
  279. <view v-else-if="item.timeType ==2" class="text"
  280. style="width: 90%;color: gray;">
  281. 周期设置: <span style="margin-left: 5px;color: cornflowerblue;">按周</span>
  282. </view>
  283. <view v-else-if="item.timeType ==3" class="text"
  284. style="width: 90%;color: gray;">
  285. 周期设置: <span style="margin-left: 5px;color: cornflowerblue;">按月</span>
  286. </view>
  287. </view>
  288. </view>
  289. </view>
  290. </template>
  291. </uni-list-item>
  292. </uni-list>
  293. </view>
  294. <view v-else class="view-flex-inline">
  295. <image src="/static/images/todo/todo.png" style="width: 40px;margin-left: 10px;" mode="widthFix">
  296. </image>
  297. <view class="view-flex-block-center" style="margin-left: 10px;align-items: flex-start;">
  298. <text>暂无待巡检任务</text>
  299. </view>
  300. </view>
  301. </uni-section>
  302. <uni-section title="巡检完结审批" type="circle">
  303. <view v-if="inspectionCloseApproveCount>0">
  304. <uni-list>
  305. <uni-list-item v-for="item in inspectionCloseApproveList" :key="item.id" showArrow clickable
  306. @click="toInspectionCloseApprove(item)" rightText="去审批">
  307. <template v-slot:body>
  308. <view class="list-item-block">
  309. <view class="line">
  310. <view class="text" style="width: 90%;color: gray;">
  311. 巡检标题: <span
  312. style="margin-left: 5px;color: cornflowerblue;">{{item.inspectionTitle}}</span>
  313. </view>
  314. </view>
  315. <view class="line">
  316. <view class="text" style="width: 90%;color: gray;">
  317. 处理人: <span
  318. style="margin-left: 5px;color: cornflowerblue;">{{item.servicePersonName}}</span>
  319. </view>
  320. </view>
  321. <view class="line">
  322. <view class="text" style="width: 90%;color: gray;">
  323. 处理时间: <span
  324. style="margin-left: 5px;color: cornflowerblue;">{{item.inspectionReportTime}}</span>
  325. </view>
  326. </view>
  327. </view>
  328. </template>
  329. </uni-list-item>
  330. </uni-list>
  331. </view>
  332. <view v-else class="view-flex-inline">
  333. <image src="/static/images/todo/todo.png" style="width: 40px;margin-left: 10px;" mode="widthFix">
  334. </image>
  335. <view class="view-flex-block-center" style="margin-left: 10px;align-items: flex-start;">
  336. <text>暂无待审批巡检任务</text>
  337. </view>
  338. </view>
  339. </uni-section>
  340. </uni-card> -->
  341. <view class="goods-carts" style="background-color: #f7f7f7;">
  342. <uni-row>
  343. <uni-col :span="4">
  344. <view class="view-flex-inline-center" style="height: 70px;">
  345. <image src="/static/images/user/touxiang@2x.png"
  346. style="width: 60rpx;height: 60rpx;border-radius: 50%;" mode="widthFix">
  347. </image>
  348. </view>
  349. </uni-col>
  350. <uni-col :span="16">
  351. <uni-list style="background-color: #f7f7f7;" :border="false">
  352. <uni-list-item v-if="isLogin" :border="false" style="background-color: #f7f7f7;" showArrow
  353. :title="userName" :note="userNote" :clickable="true" @click="onUserInfoClick()" />
  354. <uni-list-item v-else :border="false" style="background-color: #f7f7f7;" showArrow title="登录/注册"
  355. note="快速登录 注册体验更多功能" :clickable="true" @click="onLoginClick()" />
  356. </uni-list>
  357. </uni-col>
  358. <uni-col :span="4">
  359. </uni-col>
  360. </uni-row>
  361. </view>
  362. </view>
  363. </template>
  364. <script>
  365. import
  366. navBtns
  367. from "@/api/home.js";
  368. import {
  369. role
  370. } from "@/api/role.js";
  371. import {
  372. oss
  373. } from '@/common/setting';
  374. import http from '@/http/api.js';
  375. export default {
  376. components: {},
  377. data() {
  378. return {
  379. title: '泰山电教维护服务',
  380. permission: {
  381. 'admin': false,
  382. 'orgAdmin': false,
  383. 'companyAdmin': false,
  384. 'companyServciePerson': false,
  385. 'yjServicePerson': false,
  386. },
  387. userLoginStatus: 0,
  388. userName: 'guest',
  389. userNote: '泰山云服务已服务您180天',
  390. postName: '',
  391. currentRole: '',
  392. current: 0,
  393. navButton: [],
  394. navButtonIndex: [],
  395. //more/loading/noMore
  396. loadMoreStatus: "noMore",
  397. timer: false,
  398. pageSize: 10,
  399. pageCurrent: 1,
  400. total: 0,
  401. noticeDot: false,
  402. noticeValue: 0,
  403. unconfirmOrderCount: 0,
  404. unconfirmOrderList: [],
  405. todoOrderCount: 1,
  406. todoOrderList: [],
  407. costsApproveOrderCount: 0,
  408. costsApproveOrderList: [],
  409. closeApproveOrderCount: 0,
  410. closeApproveOrderList: [],
  411. todoOrderImg: "/static/images/home/icon_sy_dbgd@2x.png",
  412. closeApproveOrderImg: "/static/images/home/ico_sy_dspgd@2x.png",
  413. todoInspectionImg: "/static/images/home/icon_sy_xjbyrw@2x.png",
  414. closeApproveInspectionImg: "/static/images/home/icon_sy_dsprw@2x.png",
  415. inspectionTodoNoticeCount: 0,
  416. inspectionTodoNoticeList: [],
  417. inspectionCloseApproveCount: 0,
  418. inspectionCloseApproveList: [],
  419. ads: [],
  420. };
  421. },
  422. computed: {},
  423. onLoad() {
  424. // this.permission.admin = false;
  425. // this.permission.orgAdmin = false;
  426. // this.permission.companyAdmin = false;
  427. // this.permission.companyServciePerson = false;
  428. // this.permission.yjServicePerson = false;
  429. // this.navButton = navBtns.navButtons;
  430. // if (this.userInfo.role_name === role.admin) {
  431. // this.permission.admin = true;
  432. // this.navButtonIndex = navBtns.sysAdminNavButton;
  433. // this.currentRole = role.admin;
  434. // } else if (this.userInfo.role_name === role.orgAdmin) {
  435. // this.permission.orgAdmin = true;
  436. // this.currentRole = role.orgAdmin;
  437. // this.navButtonIndex = navBtns.orgAdminNavButton;
  438. // } else if (this.userInfo.role_name === role.companyAdmin) {
  439. // this.permission.companyAdmin = true;
  440. // this.currentRole = role.companyAdmin;
  441. // this.navButtonIndex = navBtns.companyAdminNavButton;
  442. // } else if (this.userInfo.role_name === role.companyServciePerson) {
  443. // this.permission.companyServciePerson = true;
  444. // this.currentRole = role.companyServciePerson;
  445. // this.navButtonIndex = navBtns.companyServicePersonNavButton;
  446. // if (this.userInfo.post_id == '1706859505948098562') {
  447. // this.postName = "engineer";
  448. // } else if (this.userInfo.post_id == '1730535542909140993') {
  449. // this.postName = "servicePerson";
  450. // }
  451. // }
  452. // if (this.$u.func.checkLogin()) {
  453. // console.log("timer start +++++++ ")
  454. // this.timer = true;
  455. // setTimeout(this.timeCall, 10);
  456. // }
  457. // console.log(JSON.stringify(this.isLogin))
  458. // if (this.$u.func.checkLogin()) {} else {
  459. // this.$u.func.logout();
  460. // }
  461. this.$u.func.checkLoginExpires();
  462. if (this.isLogin) {
  463. this.getTodoOrderConfirmList();
  464. this.getTodoOrderList();
  465. this.getTodoCloseOrderList();
  466. this.getTodoInspectionList();
  467. this.getInspectionCloseApproveList();
  468. }
  469. this.getAds();
  470. },
  471. onUnload() {
  472. //this.timer = false;
  473. },
  474. onReady() {},
  475. onShow() {
  476. // if (this.$u.func.checkLogin()) {
  477. // if (this.userInfo.role_name !== this.currentRole) {
  478. // this.permission.admin = false;
  479. // this.permission.orgAdmin = false;
  480. // this.permission.companyAdmin = false;
  481. // this.permission.companyServciePerson = false;
  482. // this.permission.yjServicePerson = false;
  483. // this.navButton = navBtns.navButtons;
  484. // if (this.userInfo.role_name === role.admin) {
  485. // this.permission.admin = true;
  486. // this.navButtonIndex = navBtns.sysAdminNavButton;
  487. // this.currentRole = role.admin;
  488. // } else if (this.userInfo.role_name === role.orgAdmin) {
  489. // this.permission.orgAdmin = true;
  490. // this.currentRole = role.orgAdmin;
  491. // this.navButtonIndex = navBtns.orgAdminNavButton;
  492. // } else if (this.userInfo.role_name === role.companyAdmin) {
  493. // this.permission.companyAdmin = true;
  494. // this.currentRole = role.companyAdmin;
  495. // this.navButtonIndex = navBtns.companyAdminNavButton;
  496. // } else if (this.userInfo.role_name === role.companyServciePerson) {
  497. // this.permission.companyServciePerson = true;
  498. // this.currentRole = role.companyServciePerson;
  499. // this.navButtonIndex = navBtns.companyServicePersonNavButton;
  500. // if (this.userInfo.post_id == '1706859505948098562') {
  501. // this.postName = "engineer";
  502. // } else if (this.userInfo.post_id == '1730535542909140993') {
  503. // this.postName = "servicePerson";
  504. // }
  505. // }
  506. // }
  507. // if (this.timer == false) {
  508. // this.timer = true;
  509. // setTimeout(this.timeCall, 10);
  510. // }
  511. // } else {
  512. // this.$u.func.logout();
  513. // }
  514. this.$u.func.checkLoginExpires();
  515. if (this.isLogin) {
  516. this.getTodoOrderConfirmList();
  517. this.getTodoOrderList();
  518. this.getTodoCloseOrderList();
  519. this.getTodoInspectionList();
  520. this.getInspectionCloseApproveList();
  521. }
  522. this.getAds();
  523. },
  524. onHide() {
  525. //this.timer = false;
  526. },
  527. methods: {
  528. toOss(path) {
  529. return oss + path;
  530. },
  531. onLoginClick() {
  532. console.log("onLoginClick")
  533. var url = '/pages/login/login-account?skipPage=1';
  534. uni.navigateTo({
  535. url: url
  536. })
  537. },
  538. onUserInfoClick() {
  539. console.log("onUserInfoClick")
  540. var url = '/pages/user/center-simple';
  541. uni.navigateTo({
  542. url: url
  543. })
  544. },
  545. timeCall() {
  546. if (this.timer == true) {
  547. this.getHomeInfo();
  548. setTimeout(this.timeCall, 10000);
  549. }
  550. },
  551. toConfirm(item) {
  552. var url = '/pages/check-order/order-confirm?orderType=' + item.orderType + '&orderId=' + item.id;
  553. uni.navigateTo({
  554. url: url
  555. })
  556. },
  557. toDo() {
  558. uni.navigateTo({
  559. url: '/pages/check-order/check-order-manage'
  560. })
  561. // var url = '/pages/check-order/orderprocessreport?orderId=' + item.id + '&skipPage=1';
  562. // uni.navigateTo({
  563. // url: url
  564. // })
  565. },
  566. toOrderProcess(item) {
  567. var url = '/pages/check-order/orderprocessreport?skipPage=1&costsApprove=2&orderType=' + item.orderType +
  568. '&orderProcessId=' + item
  569. .orderProcessId + '&orderId=' + item.id;
  570. uni.navigateTo({
  571. url: url
  572. })
  573. },
  574. toOrderCostsApprove(item) {
  575. var url = '/pages/check-order/ordercostsapprove?orderType=' + item.orderType + '&orderId=' + item.id;
  576. uni.navigateTo({
  577. url: url
  578. })
  579. },
  580. toOrderCloseApprove() {
  581. // console.log("toOrderCloseApprove")
  582. // var url = '/pages/check-order/order-close-approve?orderType=' + item.orderType + '&orderId=' + item.id;
  583. // uni.navigateTo({
  584. // url: url
  585. // })
  586. },
  587. toShortcutCreateOrder() {
  588. if (this.isLogin) {
  589. let url = '/pages/check-order/order-add';
  590. uni.navigateTo({
  591. url: url
  592. })
  593. } else {
  594. let toUrl = encodeURIComponent("/pages/check-order/order-add");
  595. let url = '/pages/check-order/order-advertising?toUrl=' + toUrl;
  596. uni.navigateTo({
  597. url: url
  598. })
  599. }
  600. },
  601. toShortcutInspectionPlan() {
  602. if (this.isLogin) {
  603. let url = '/pages/equipment-inspection/inspection-plan';
  604. uni.navigateTo({
  605. url: url
  606. })
  607. } else {
  608. let toUrl = encodeURIComponent("/pages/equipment-inspection/inspection-plan");
  609. let url = '/pages/equipment-inspection/inspection-advertising?toUrl=' + toUrl;
  610. uni.navigateTo({
  611. url: url
  612. })
  613. }
  614. },
  615. toInspection(item) {
  616. uni.navigateTo({
  617. url: '/pages/equipment-inspection/equipment-inspection-report?id=' + item.id
  618. })
  619. },
  620. toInspectionCloseApprove(item) {
  621. uni.navigateTo({
  622. url: '/pages/equipment-inspection/inspection-close-approve?id=' + item.id
  623. })
  624. },
  625. onNoticeMoreClick() {
  626. uni.navigateTo({
  627. url: '/pages/news/noticelist'
  628. })
  629. },
  630. getHomeInfo() {
  631. this.getTodoOrderConfirmList();
  632. this.getTodoOrderList();
  633. //this.getTodoCostsApproveOrderList();
  634. this.getTodoCloseOrderList();
  635. },
  636. getAds() {
  637. let that = this;
  638. let postData = {};
  639. http.request({
  640. url: '/galaxy-business/ads/manage/show/list',
  641. method: 'GET',
  642. data: postData,
  643. }).then(res => {
  644. console.log(JSON.stringify(res))
  645. // that.unconfirmOrderCount = 0;
  646. if (res.data != null) {
  647. that.ads = res.data.length;
  648. that.ads = res.data;
  649. }
  650. }).catch(err => {
  651. console.log(JOSN.stringify(err))
  652. })
  653. },
  654. getTodoOrderConfirmList() {
  655. let that = this;
  656. let postData = {};
  657. http.request({
  658. url: '/galaxy-business/order/todo/confirm/list',
  659. method: 'GET',
  660. data: postData,
  661. }).then(res => {
  662. console.log(JSON.stringify(res))
  663. that.unconfirmOrderCount = 0;
  664. if (res.data != null) {
  665. that.unconfirmOrderCount = res.data.length;
  666. that.unconfirmOrderList = res.data;
  667. }
  668. }).catch(err => {
  669. console.log(JOSN.stringify(err))
  670. })
  671. },
  672. getTodoOrderList() {
  673. let that = this;
  674. let postData = {};
  675. http.request({
  676. url: '/galaxy-business/order/todo/list',
  677. method: 'GET',
  678. data: postData,
  679. }).then(res => {
  680. console.log(JSON.stringify(res))
  681. that.todoOrderCount = 0;
  682. if (res.data != null) {
  683. that.todoOrderCount = res.data.length;
  684. that.todoOrderList = res.data;
  685. }
  686. }).catch(err => {
  687. console.log(JOSN.stringify(err))
  688. })
  689. },
  690. getTodoCostsApproveOrderList() {
  691. let that = this;
  692. let postData = {};
  693. http.request({
  694. url: '/galaxy-business/order/todo/costsapprove/list',
  695. method: 'GET',
  696. data: postData,
  697. }).then(res => {
  698. that.costsApproveOrderCount = 0;
  699. if (res.data != null) {
  700. that.costsApproveOrderCount = res.data.length;
  701. that.costsApproveOrderList = res.data;
  702. }
  703. }).catch(err => {
  704. console.log(JOSN.stringify(err))
  705. })
  706. },
  707. getTodoCloseOrderList() {
  708. let that = this;
  709. let postData = {};
  710. http.request({
  711. url: '/galaxy-business/order/todo/closeapprove/list',
  712. method: 'GET',
  713. data: postData,
  714. }).then(res => {
  715. that.closeApproveOrderCount = 0;
  716. if (res.data != null) {
  717. that.closeApproveOrderCount = res.data.length;
  718. that.closeApproveOrderList = res.data;
  719. }
  720. }).catch(err => {
  721. console.log(JOSN.stringify(err))
  722. })
  723. },
  724. getTodoInspectionList() {
  725. let that = this;
  726. let postData = {};
  727. http.request({
  728. url: '/galaxy-business/equipment/inspection/todo/list',
  729. method: 'GET',
  730. data: postData,
  731. }).then(res => {
  732. that.to = 0;
  733. if (res.data != null) {
  734. console.log(JSON.stringify(res))
  735. that.inspectionTodoNoticeCount = res.data.length;
  736. that.inspectionTodoNoticeList = res.data;
  737. }
  738. }).catch(err => {
  739. console.log(JOSN.stringify(err))
  740. })
  741. },
  742. getInspectionCloseApproveList() {
  743. let that = this;
  744. let postData = {};
  745. http.request({
  746. url: '/galaxy-business/equipment/inspection/close-approve/list',
  747. method: 'GET',
  748. data: postData,
  749. }).then(res => {
  750. that.inspectionCloseApproveCount = 0;
  751. if (res.data != null) {
  752. that.inspectionCloseApproveCount = res.data.length;
  753. that.inspectionCloseApproveList = res.data;
  754. }
  755. }).catch(err => {
  756. console.log(JOSN.stringify(err))
  757. })
  758. },
  759. }
  760. };
  761. </script>
  762. <style lang="scss" scoped>
  763. $nav-height: 75px;
  764. .user-box {
  765. display: flex;
  766. justify-content: space-between;
  767. padding: 0 20rpx 0 64rpx;
  768. margin-top: 36rpx;
  769. .left {
  770. display: flex;
  771. flex-direction: column;
  772. align-items: center;
  773. .avatar {
  774. width: 128rpx;
  775. height: 128rpx;
  776. background: #ffffff;
  777. border-radius: 50%;
  778. }
  779. .user-name {
  780. margin-top: 20rpx;
  781. font-size: 36rpx;
  782. font-family: Source Han Sans CN;
  783. font-weight: 500;
  784. color: #ffffff;
  785. }
  786. .tag {
  787. margin-top: 20rpx;
  788. display: flex;
  789. justify-content: center;
  790. align-items: center;
  791. padding: 5rpx 16rpx;
  792. border: 1px solid #f5f5f5;
  793. border-radius: 7rpx;
  794. font-size: 19rpx;
  795. font-family: Source Han Sans CN;
  796. font-weight: 300;
  797. color: #ffffff;
  798. }
  799. }
  800. .edit-btn {
  801. margin-top: 20rpx;
  802. margin-bottom: 10px;
  803. flex-shrink: 0;
  804. display: flex;
  805. justify-content: center;
  806. align-items: center;
  807. width: 165rpx;
  808. height: 54rpx;
  809. border: 2rpx solid #f5f5f5;
  810. border-radius: 11rpx;
  811. font-size: 27rpx;
  812. font-family: Source Han Sans CN;
  813. font-weight: 400;
  814. color: #ffffff;
  815. }
  816. }
  817. .decoration {
  818. width: 6px;
  819. height: 6px;
  820. margin-right: 4px;
  821. border-radius: 50%;
  822. background-color: cadetblue;
  823. }
  824. .input-uni-icon {
  825. line-height: $nav-height;
  826. }
  827. .item-block {
  828. display: flex;
  829. flex-direction: column;
  830. justify-content: flex-start;
  831. width: 100%;
  832. }
  833. .line {
  834. display: flex;
  835. flex-direction: row;
  836. justify-content: flex-start;
  837. width: 100%;
  838. }
  839. .line .block {
  840. display: flex;
  841. flex-direction: column;
  842. justify-content: center;
  843. }
  844. .line-end {
  845. display: flex;
  846. flex-direction: row;
  847. justify-content: flex-end;
  848. width: 100%;
  849. }
  850. .line-end .block {
  851. display: flex;
  852. flex-direction: column;
  853. justify-content: center;
  854. }
  855. .line-center {
  856. display: flex;
  857. flex-direction: row;
  858. justify-content: center;
  859. width: 100%;
  860. height: 100%;
  861. }
  862. .line-center .block {
  863. display: flex;
  864. flex-direction: column;
  865. justify-content: center;
  866. }
  867. .rtu-name {
  868. margin-left: 5rpx;
  869. font-size: 0.7rem;
  870. font-weight: bold;
  871. }
  872. .rtu-code {
  873. margin-left: 5rpx;
  874. font-size: 0.6rem;
  875. color: gray;
  876. }
  877. .item-text-line {
  878. width: 100%;
  879. display: flex;
  880. flex-direction: row;
  881. align-items: flex-start;
  882. padding-left: 0px;
  883. padding-right: 0px;
  884. .block {
  885. height: 100%;
  886. display: flex;
  887. flex-direction: column;
  888. justify-content: center;
  889. align-items: center;
  890. }
  891. .item-title {
  892. font-size: 0.7rem;
  893. }
  894. .item-text {
  895. padding-left: 2px;
  896. padding-right: 5px;
  897. font-size: 0.7rem;
  898. }
  899. .item-text-ell {
  900. width: 100%;
  901. overflow: hidden;
  902. font-size: 0.7rem;
  903. white-space: nowrap;
  904. text-overflow: ellipsis;
  905. }
  906. .item-number {
  907. font-size: 0.7rem;
  908. margin-left: 2px;
  909. margin-right: 5px;
  910. }
  911. }
  912. .item-title-image {
  913. /* #ifndef APP-NVUE */
  914. display: block;
  915. /* #endif */
  916. margin-right: 5px;
  917. width: 20px;
  918. height: 20px;
  919. border-radius: 50%;
  920. }
  921. .uni-badge-left-margin {
  922. margin-left: 0px;
  923. }
  924. .logo {
  925. flex-shrink: 0;
  926. width: 80rpx;
  927. height: auto;
  928. }
  929. .container {
  930. // background-color: #f7f7f7;
  931. // min-height: 100vh;
  932. overflow: hidden;
  933. padding: 0 0 75rpx;
  934. }
  935. .nav {
  936. margin: 0rpx 0;
  937. box-sizing: border-box;
  938. padding: 0 10rpx;
  939. &-item {
  940. width: 100%;
  941. box-sizing: border-box;
  942. display: flex;
  943. flex-direction: column;
  944. align-items: center;
  945. justify-content: space-between;
  946. height: 130rpx;
  947. &-img {
  948. width: 80rpx;
  949. height: 80rpx;
  950. }
  951. &-name {
  952. font-size: 0.7rem;
  953. font-family: PingFang SC;
  954. font-weight: 500;
  955. color: #585b61;
  956. }
  957. }
  958. }
  959. .point {
  960. display: flex;
  961. flex-direction: row;
  962. align-items: center;
  963. // margin: 15rpx 0;
  964. }
  965. .dot {
  966. //margin-left: -22rpx;
  967. background-color: #19be6b;
  968. box-shadow: 0 0 5rpx 5rpx #71d5a1;
  969. color: white;
  970. width: 40rpx;
  971. height: 40rpx;
  972. // padding: 5rpx;
  973. font-size: 28rpx;
  974. text-align: center;
  975. border-radius: 40rpx;
  976. }
  977. .goods-carts {
  978. /* #ifndef APP-NVUE */
  979. display: flex;
  980. /* #endif */
  981. flex-direction: column;
  982. position: fixed;
  983. left: 0;
  984. right: 0;
  985. /* #ifdef H5 */
  986. left: var(--window-left);
  987. right: var(--window-right);
  988. /* #endif */
  989. bottom: var(--window-bottom);
  990. }
  991. </style>