operate.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. <template>
  2. <view>
  3. <template v-if="!userInfo || !userInfo.realName">
  4. <view class="top d-flex a-center px3 main-color-bg" @tap="login">
  5. <view class="img">
  6. <image src="/static/images/user_pic.png" mode=""></image>
  7. </view>
  8. <view class="ml-3 f-size-36 text-color-white">登录 / 注册</view>
  9. </view>
  10. </template>
  11. <template v-else>
  12. <view class="top d-flex a-center px3 main-color-bg">
  13. <view class="img">
  14. <image :src="myAvatar" @error="myDefaultAvatar" mode=""></image>
  15. </view>
  16. <view class="ml-3 f-size-36 text-color-white">{{
  17. userInfo.realName
  18. }}</view>
  19. </view>
  20. </template>
  21. <view class="divider"></view>
  22. <view class="often px3 bg-color-white">
  23. <view class="f-size-32 f-weight-bold py2 border-bottom">常用功能</view>
  24. <view class="d-flex f-wrap my2 py3">
  25. <view class="col4 mb-2" @tap="handleCode">
  26. <view class="d-flex f-column a-center j-center">
  27. <view class="iconfont icon-saoma main-color-text"></view>
  28. <!-- <image src="../../static/images/code.png" mode=""></image> -->
  29. <text class="f-size-26 text-color-6 mt-2">设备扫码</text>
  30. </view>
  31. </view>
  32. <!-- <navigator class="col4 mb-2" url="../check/check">
  33. <view class="d-flex f-column a-center j-center">
  34. <view class="iconfont icon-weixiu z-bl"></view>
  35. <text
  36. class="f-size-26 text-color-6 mt-2"
  37. >点检管理</text
  38. >
  39. </view>
  40. </navigator>
  41. <navigator class="col4 mb-2" url="../inspection/inspection">
  42. <view class="d-flex f-column a-center j-center">
  43. <view class="iconfont icon-xunjianguanli z-bl"></view>
  44. <text
  45. class="f-size-26 text-color-6 mt-2"
  46. >巡检填报</text
  47. >
  48. </view>
  49. </navigator>-->
  50. <navigator class="col4 mb-2" url="../maintain/maintain">
  51. <view class="d-flex f-column a-center j-center">
  52. <view class="iconfont icon-tubiaozhizuomoban-135 z-bl"></view>
  53. <text class="f-size-26 text-color-6 mt-2">保养管理</text>
  54. </view>
  55. </navigator>
  56. <!-- <navigator class="col4 mb-2" url="../running/running">
  57. <view class="d-flex f-column a-center j-center">
  58. &lt;!&ndash; <image src="../../static/images/code.png" mode=""></image> &ndash;&gt;
  59. <view
  60. class="iconfont icon-icon-GIS_yunhangguanli main-color-text"
  61. ></view>
  62. <text
  63. class="f-size-26 text-color-6 mt-2"
  64. >运行填报</text
  65. >
  66. </view>
  67. </navigator>-->
  68. <navigator class="col4 mb-2" url="../repair/repair">
  69. <view class="d-flex f-column a-center j-center">
  70. <!-- <image src="../../static/images/code.png" mode=""></image> -->
  71. <view class="iconfont icon-baoxiu main-color-text" style="color: #0f6fb9"></view>
  72. <text class="f-size-26 text-color-6 mt-2 ">设备报修</text>
  73. </view>
  74. </navigator>
  75. <!-- <navigator class="col4 mb-2" url="../receive/receive">
  76. <view class="d-flex f-column a-center j-center">
  77. &lt;!&ndash; <image src="../../static/images/code.png" mode=""></image> &ndash;&gt;
  78. <view
  79. class="iconfont icon-houqinwuzi main-color-text"
  80. ></view>
  81. <text
  82. class="f-size-26 text-color-6 mt-2"
  83. >备品备件</text
  84. >
  85. </view>
  86. </navigator>-->
  87. <navigator class="col4 mb-2" url="../equipment/equipment">
  88. <view class="d-flex f-column a-center j-center">
  89. <!-- <image src="../../static/images/shebei.png" mode=""></image> -->
  90. <view class="iconfont icon-shebei z-bl"></view>
  91. <text class="f-size-26 text-color-6 mt-2">设备台账</text>
  92. </view>
  93. </navigator>
  94. <!-- <view class="col4 mb-2" @tap="handleCodeIn">
  95. <view class="d-flex f-column a-center j-center">
  96. <view
  97. class="iconfont icon-houqinwuzi main-color-text"
  98. style="color: #fda621"
  99. ></view>
  100. <text class="f-size-26 text-color-6 mt-2">入库</text>
  101. </view>
  102. </view>
  103. <view class="col4 mb-2" @tap="handleCodeOut">
  104. <view class="d-flex f-column a-center j-center">
  105. <view
  106. class="iconfont icon-houqinwuzi main-color-text"
  107. style="color: #fda621"
  108. ></view>
  109. <text class="f-size-26 text-color-6 mt-2">出库</text>
  110. </view>
  111. </view>-->
  112. <!--<navigator class="col4 mb-2" url="/pages/repair/repair-edit">
  113. <view class="d-flex f-column a-center j-center">
  114. <view class="iconfont icon-baoxiu"></view>
  115. <text class="f-size-26 text-color-6 mt-2">报修验收</text>
  116. </view>
  117. </navigator>-->
  118. </view>
  119. </view>
  120. <view class="often px3 bg-color-white">
  121. <view class="f-size-32 f-weight-bold py2 border-bottom">仓库功能</view>
  122. <view class="d-flex f-wrap my2 py3">
  123. <navigator class="col4 mb-2" url="../in-store/list">
  124. <view class="d-flex f-column a-center j-center">
  125. <view class="iconfont icon-ruku main-color-text" style="color: #f1650c"></view>
  126. <text class="f-size-26 text-color-6 mt-2 main-color-text">入库</text>
  127. </view>
  128. </navigator>
  129. <navigator class="col4 mb-2" url="../out-store/list">
  130. <view class="d-flex f-column a-center j-center">
  131. <view class="iconfont icon-chuku main-color-text" style="color: #fda621"></view>
  132. <text class="f-size-26 text-color-6 mt-2">出库</text>
  133. </view>
  134. </navigator>
  135. <view class="col4 mb-2" @tap="handleSpareStore">
  136. <view class="d-flex f-column a-center j-center">
  137. <view class="iconfont icon-shebei main-color-text" style="color: #f1650c"></view>
  138. <text class="f-size-26 text-color-6 mt-2 main-color-text">库存信息</text>
  139. </view>
  140. </view>
  141. <!-- <view class="col4 mb-2" @tap="handleSpareQrCode">
  142. <view class="d-flex f-column a-center j-center">
  143. <view
  144. class="iconfont icon-saoma main-color-text"
  145. style="color: #f1650c"
  146. ></view>
  147. <text
  148. class="f-size-26 text-color-6 mt-2 main-color-text"
  149. >备件扫码</text
  150. >
  151. </view>
  152. </view> -->
  153. </view>
  154. </view>
  155. <u-tabbar :list="tabbar" :mid-button="true" active-color="#0082ff"></u-tabbar>
  156. </view>
  157. </template>
  158. <script>
  159. export default {
  160. data() {
  161. return {
  162. userInfo: {
  163. realName: null,
  164. avatar: null
  165. },
  166. gatherTask: {
  167. maintainTask: 0,
  168. lubricationTask: 0,
  169. oilTask: 0,
  170. repairTask: 0
  171. },
  172. myAvatar: '',
  173. tabbar: [
  174. {
  175. iconPath: '/static/tabars/home.png',
  176. pagePath: '/pages/home/home',
  177. selectedIconPath: '/static/tabars/home_s.png',
  178. text: '首页'
  179. },
  180. {
  181. iconPath: '/static/tabars/order.png',
  182. pagePath: '/pages/operate/operate',
  183. selectedIconPath: '/static/tabars/order_s.png',
  184. text: '功能'
  185. },
  186. {
  187. iconPath: '/static/tabars/publish.png',
  188. pagePath: '/pages/middle/middle',
  189. selectedIconPath: '/static/tabars/publish.png',
  190. text: '报修',
  191. midButton: true
  192. },
  193. {
  194. iconPath: '/static/tabars/tiding.png',
  195. pagePath: '/pages/tidings/tidings',
  196. selectedIconPath: '/static/tabars/tiding_s.png',
  197. text: '消息'
  198. },
  199. {
  200. iconPath: '/static/tabars/mine.png',
  201. pagePath: '/pages/my/my',
  202. selectedIconPath: '/static/tabars/mine_s.png',
  203. text: '我的'
  204. }
  205. ]
  206. }
  207. },
  208. onLoad() {},
  209. onShow() {
  210. this.userInfo = this.$BaseTool.UserUtil.getUserInfo()
  211. if (!this.userInfo || !this.userInfo.username) {
  212. uni.showModal({
  213. content: '登录后方可查看内容',
  214. showCancel: true,
  215. success: result => {
  216. uni.reLaunch({ url: '/pages/login/login' })
  217. }
  218. })
  219. return
  220. }
  221. this.myAvatar = this.$BaseTool.UserUtil.getFileUrl(this.userInfo.avatar)
  222. this.$Http.getGatherTask().then(res => {
  223. this.gatherTask = res.data
  224. })
  225. },
  226. methods: {
  227. myDefaultAvatar() {
  228. this.myAvatar = '/static/images/user_pic.png'
  229. },
  230. getSetting() {
  231. uni.navigateTo({
  232. url: '../setting/setting'
  233. })
  234. },
  235. // 维修任务
  236. handleService() {
  237. uni.navigateTo({
  238. url: '../service/service'
  239. })
  240. },
  241. // 加油任务
  242. handleOiling() {
  243. uni.navigateTo({
  244. url: '../oiling/oiling'
  245. })
  246. },
  247. // 保养任务
  248. handleMaintain() {
  249. uni.navigateTo({
  250. url: '../maintain/maintain'
  251. })
  252. },
  253. // 润滑任务
  254. handleLubrication(e) {
  255. uni.navigateTo({
  256. url: '../lubrication/lubrication'
  257. })
  258. },
  259. handleSpareStore() {
  260. uni.navigateTo({
  261. url: '../spare/spare-store'
  262. })
  263. },
  264. // 设备扫码
  265. handleCode() {
  266. // #ifdef H5
  267. uni.showToast({
  268. title: '暂不支持该功能',
  269. icon: 'none'
  270. })
  271. // #endif
  272. // #ifndef H5
  273. uni.scanCode({
  274. success(e) {
  275. console.log(e.result)
  276. if (e.result) {
  277. const sbId = e.result.split('=')[1]
  278. if (sbId != null) {
  279. uni.navigateTo({
  280. url: '/pages/equipment-detail/equipment-detail?detailId=' + sbId
  281. })
  282. } else {
  283. uni.showToast('非本系统二维码,无法识别')
  284. }
  285. }
  286. }
  287. })
  288. // #endif
  289. },
  290. // 备件扫码
  291. handleSpareQrCode() {
  292. // #ifdef H5
  293. uni.showToast({
  294. title: '暂不支持该功能',
  295. icon: 'none'
  296. })
  297. /*uni.navigateTo({
  298. url:'/pages/spare/spare-detail?detailId=607fd4b643dc4e04acc0a6fe'
  299. });*/
  300. // #endif
  301. // #ifndef H5
  302. uni.scanCode({
  303. success(e) {
  304. console.log(e.result)
  305. if (e.result) {
  306. uni.navigateTo({
  307. url: '/pages/spare/spare-detail?detailId=' + e.result
  308. })
  309. }
  310. }
  311. })
  312. // #endif
  313. },
  314. // 登录
  315. login() {
  316. uni.navigateTo({
  317. url: '../login/login'
  318. })
  319. }
  320. }
  321. }
  322. </script>
  323. <style lang="less">
  324. page {
  325. background-color: #f4f4f4;
  326. }
  327. .often {
  328. image {
  329. width: unit(50, rpx);
  330. height: unit(50, rpx);
  331. }
  332. .iconfont {
  333. font-size: unit(50, rpx);
  334. }
  335. }
  336. .top {
  337. height: unit(200, rpx);
  338. .img {
  339. width: unit(128, rpx);
  340. height: unit(128, rpx);
  341. border-radius: 50%;
  342. image {
  343. width: unit(128, rpx);
  344. height: unit(128, rpx);
  345. border-radius: 50%;
  346. background-color: #999;
  347. // border: 5rpx solid #fff;
  348. }
  349. }
  350. }
  351. </style>