index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. <template>
  2. <view>
  3. <uni-nav-bar fixed="true" statusBar="true" title="工作中心" right-icon="scan" @clickRight="HandlScanCode"></uni-nav-bar>
  4. <view>
  5. <CellTip title="生产管理" v-if="productionList.length > 0"></CellTip>
  6. <view class="nav">
  7. <view class="nav-content">
  8. <view class="nav-item" v-for="item in productionList" :key="item.link_url" @click="toNav(item.path)">
  9. <span :class="'iconfont ' + item.icon"></span>
  10. <label>{{ item.title }}</label>
  11. <label>{{ item.num }}</label>
  12. </view>
  13. </view>
  14. </view>
  15. </view>
  16. <!-- <view>
  17. <CellTip title="生产执行"></CellTip>
  18. <view class="nav">
  19. <view class="nav-content">
  20. <view
  21. class="nav-item"
  22. v-for="(item, index) in executeList"
  23. @click="toNav(item.link_url)"
  24. >
  25. <span :class="item.class"></span>
  26. <label>{{ item.title }}</label>
  27. <label>{{ item.num }}</label>
  28. </view>
  29. </view>
  30. </view>
  31. </view> -->
  32. <view>
  33. <CellTip title="运维管理" v-if="operationsList.length > 0"></CellTip>
  34. <view class="nav">
  35. <view class="nav-content">
  36. <view class="nav-item" v-for="(item, index) in operationsList" @click="toNav(item.url)">
  37. <span :class="'iconfont ' + item.icon"></span>
  38. <i class="badge" v-if="item.badge">{{ item.badge }}</i>
  39. <label>{{ item.name }}</label>
  40. </view>
  41. </view>
  42. </view>
  43. </view>
  44. <view>
  45. <CellTip title="仓储管理" v-if="warehousingList.length > 0"></CellTip>
  46. <view class="nav">
  47. <view class="nav-content">
  48. <view class="nav-item" v-for="(item, index) in warehousingList" @click="toNav(item.link_url)">
  49. <span :class="item.class"></span>
  50. <label>{{ item.title }}</label>
  51. <label>{{ item.num }}</label>
  52. </view>
  53. </view>
  54. </view>
  55. </view>
  56. <view>
  57. <CellTip title="派车管理" v-if="dispatchList.length > 0"></CellTip>
  58. <view class="nav">
  59. <view class="nav-content">
  60. <view class="nav-item" v-for="(item, index) in dispatchList" @click="toNav(item.url)">
  61. <span :class="'iconfont ' + item.icon"></span>
  62. <i class="badge" v-if="item.badge">{{ item.badge }}</i>
  63. <label>{{ item.name }}</label>
  64. </view>
  65. </view>
  66. </view>
  67. </view>
  68. <!-- <view>
  69. <CellTip title="生产类"></CellTip>
  70. <view class="nav">
  71. <view class="nav-content">
  72. <view
  73. class="nav-item"
  74. v-for="(item, index) in productionList"
  75. @click="toNav(item.link_url)"
  76. >
  77. <span :class="item.class"></span>
  78. <label>{{ item.title }}</label>
  79. <label>{{ item.num }}</label>
  80. </view>
  81. </view>
  82. </view>
  83. </view> -->
  84. </view>
  85. </template>
  86. <script>
  87. import CellTip from '@/components/CellTip.vue'
  88. import {
  89. statistics
  90. } from '@/api/myTicket'
  91. export default {
  92. components: {
  93. CellTip
  94. },
  95. data() {
  96. return {
  97. src1: 'https://cdn.uviewui.com/uview/album/1.jpg',
  98. workOrder: {}, // 工单统计数据
  99. //生产类
  100. productionList: [
  101. // {
  102. // class: "iconfont icon-gongdanguanli",
  103. // title: "生产工单",
  104. // link_url: "/pages/pda/workOrder/index/index",
  105. // },
  106. // {
  107. // class: "iconfont icon-gongdanguanli",
  108. // title: "领料",
  109. // link_url: "/pages/pda/picking/index/index",
  110. // },
  111. // {
  112. // class: "iconfont icon-gongdanguanli",
  113. // title: "投料",
  114. // link_url: "/pages/pda/feeding/index/index",
  115. // },
  116. // {
  117. // class: "iconfont icon-gongdanguanli",
  118. // title: "退料",
  119. // link_url: "/pages/pda/material_return/index/index",
  120. // },
  121. // {
  122. // class: "iconfont icon-gongdanguanli",
  123. // title: "不合格品处置",
  124. // link_url: "/pages/pda/nonconforming/index/index",
  125. // },
  126. // {
  127. // class: "iconfont icon-gongdanguanli",
  128. // title: "副产品回收",
  129. // link_url: "/pages/pda/by_product_recovery/index/index",
  130. // },
  131. // {
  132. // class: "iconfont icon-gongdanguanli",
  133. // title: "工单交接",
  134. // link_url: "/pages/pda/work_order_handover/index/index",
  135. // },
  136. // {
  137. // class: "iconfont icon-gongdanguanli",
  138. // title: "工单详情",
  139. // link_url: "/pages/pda/work_order_details/index/index",
  140. // },
  141. // {
  142. // class: "iconfont icon-gongdanguanli",
  143. // title: "生产报工",
  144. // link_url: "/pages/production/report/index",
  145. // "num": 1
  146. // },
  147. // {
  148. // class: "iconfont icon-gongdanguanli",
  149. // title: "生产工单",
  150. // link_url: "/pages/production/order/index",
  151. // // "num": 1
  152. // x},
  153. ],
  154. // executeList: [
  155. // {
  156. // class: "iconfont icon-gongdanguanli",
  157. // title: "成型",
  158. // link_url: "/pages/production/execute/extrusion/index",
  159. // // "num": 1
  160. // },
  161. // {
  162. // class: "iconfont icon-gongdanguanli",
  163. // title: "自然干燥",
  164. // link_url: "/pages/production/execute/drying/index",
  165. // // "num": 1
  166. // },
  167. // {
  168. // class: "iconfont icon-gongdanguanli",
  169. // title: "升温干燥",
  170. // link_url: "/pages/production/execute/heating/index",
  171. // // "num": 1
  172. // },
  173. // {
  174. // class: "iconfont icon-gongdanguanli",
  175. // title: "半加定长",
  176. // link_url: "/pages/production/execute/halfAdded/index",
  177. // // "num": 1
  178. // },
  179. // // {
  180. // // class: "iconfont icon-gongdanguanli",
  181. // // title: "领料",
  182. // // link_url: "/pages/production/execute/picking/index",
  183. // // // "num": 1
  184. // // },
  185. // ],
  186. //仓储管理
  187. warehousingList: [
  188. /*
  189. {
  190. class: "iconfont icon-wuliaoruku",
  191. title: "入库管理",
  192. link_url: "/pages/warehouse/enterHouse/index",
  193. //"num": 34
  194. },
  195. {
  196. class: "iconfont icon-shebeichuku",
  197. title: "出库管理",
  198. link_url: "/pages/warehouse/outHouse/index",
  199. "num": 34
  200. },
  201. {
  202. "class": "iconfont icon-wuliaoruku",
  203. "title": "物料入库",
  204. "link_url": "/pages/warehouse/material/index",
  205. //"num": 34
  206. },
  207. {
  208. "class": "iconfont icon-shebeiruku",
  209. "title": "设备入库",
  210. "link_url": "/pages/warehouse/equipment/index",
  211. //"num": 23
  212. },
  213. {
  214. "class": "iconfont icon-shebeichuku",
  215. "title": "设备出库",
  216. "link_url": "/pages/warehouse/outbound/index",
  217. //"num": 23
  218. },
  219. {
  220. class: "iconfont icon-pandiangongdan",
  221. title: "盘点工单",
  222. link_url: "/pages/warehouse/workOrder/index",
  223. "num": 133
  224. },
  225. {
  226. class: "iconfont icon-shebeiruku",
  227. title: "库存调拨",
  228. link_url: "/pages/warehouse/inventoryAllocation/index",
  229. //"num": 133
  230. },
  231. {
  232. class: "iconfont icon-shebeikucuntongji",
  233. title: "报损报溢",
  234. link_url: "/pages/warehouse/reportLoss/index",
  235. //"num": 133
  236. },
  237. {
  238. class: "iconfont icon-shebeikucun",
  239. title: "库存管理",
  240. link_url: "/pages/warehouse/inventory/index",
  241. //"num": 1
  242. },
  243. {
  244. class: 'iconfont icon-shebeikucuntongji',
  245. title: '设备库存统计',
  246. link_url: '/pages/warehouse/inventory/stat',
  247. //"num": 1
  248. },
  249. */
  250. ],
  251. //运维类
  252. operationsList: [{
  253. name: '保养工单',
  254. type: 'maintenance',
  255. workOrderType: 2,
  256. url: `/pages/maintenance/order/order`,
  257. icon: 'icon-gongdanguanli',
  258. badge: 0
  259. },
  260. {
  261. name: '巡点检工单',
  262. type: 'patrol',
  263. workOrderType: 1,
  264. url: `/pages/tour_tally/order/order`,
  265. icon: 'icon-gongdanguanli',
  266. badge: 0
  267. },
  268. // {
  269. // name: '量具送检工单',
  270. // type: 'quantity',
  271. // workOrderType: 5,
  272. // url: `/pages/home/myTicket/myTicket?index=2`,
  273. // icon: 'icon-gongdanguanli',
  274. // badge: 0
  275. // },
  276. {
  277. name: '维修工单',
  278. type: 'repaire',
  279. workOrderType: 3,
  280. url: `/pages/maintenanceWorkorder/order/order`,
  281. icon: 'icon-gongdanguanli',
  282. badge: 0
  283. },
  284. {
  285. name: '报修',
  286. type: 'repairReport',
  287. workOrderType: 4,
  288. url: `/pages/repair/repair/index`,
  289. icon: 'icon-gongdanguanli',
  290. badge: 0
  291. },
  292. {
  293. name: '备品备件申请单',
  294. type: 'sparepart',
  295. workOrderType: 4,
  296. url: `/pages/maintenanceWorkorder/sparepart/index`,
  297. icon: 'icon-gongdanguanli',
  298. badge: 0
  299. }
  300. /* {
  301. class: "iconfont icon-xundianjian",
  302. title: "巡点检",
  303. link_url: "/pages/tour_tally/order/order",
  304. //"num": 34
  305. },
  306. {
  307. class: "iconfont icon-a-baoyangputong",
  308. title: "保养工单",
  309. link_url: "/pages/maintenance/order/order",
  310. //"num": 23
  311. },
  312. {
  313. class: "iconfont icon-weixiugongdan",
  314. title: "维修工单",
  315. link_url: "/pages/maintain_service/order/order",
  316. //"num": 23
  317. },
  318. /* {
  319. class: 'iconfont icon-beijian',
  320. title: '备品备件',
  321. link_url: '/pages/sparepart/order/order',
  322. //"num": 1
  323. },
  324. {
  325. class: "iconfont icon-baoxiu",
  326. title: "报修单",
  327. link_url: "/pages/repair/order/order",
  328. //"num": 1
  329. },*/
  330. /* {
  331. class: 'iconfont icon-wuliaoruku',
  332. title: '入库登记',
  333. link_url: '/pages/put_storage/order/index',
  334. //"num": 34
  335. },
  336. {
  337. class: 'iconfont icon-shebeichuku',
  338. title: '出库登记',
  339. link_url: '/pages/outbound/order/index',
  340. //"num": 34
  341. }, */
  342. ],
  343. dispatchList: [
  344. {
  345. name: '任务工单',
  346. url: `/pages/dispatchManage/taskWork/index`,
  347. icon: 'icon-gongdanguanli',
  348. badge: 0
  349. //"num": 34
  350. },
  351. ],
  352. treeList: []
  353. }
  354. },
  355. created() {
  356. this.getTree()
  357. },
  358. onShow() {
  359. this.getStatistics()
  360. },
  361. methods: {
  362. getStatistics() {
  363. // 获取工单统计数
  364. statistics().then(res => {
  365. this.workOrder = res
  366. this.operationsList.forEach(item => {
  367. if (item.name == '保养工单') item.badge = res.maintenanceNum
  368. if (item.name == '巡点检工单') item.badge = res.patrolInspection
  369. // if (item.name == '量具送检工单') item.badge = res.quantityNum
  370. if (item.name == '维修工单') item.badge = res.repairsNum
  371. // if(item.badge)
  372. })
  373. })
  374. },
  375. getTree() {
  376. let _list = uni.getStorageSync('treeList')
  377. let list = JSON.parse(_list) || []
  378. console.log('-----------list--------------')
  379. console.log(list)
  380. if (list[0] && list[0].children.length > 0) {
  381. list[0].children.forEach(f => {
  382. if (f.path == 'productionManage') {
  383. this.productionList = f.children
  384. } else if (f.path == 'operationsList') {
  385. // this.operationsList = f.children
  386. // console.log(this.operationsList)
  387. }
  388. })
  389. }
  390. },
  391. toNav(url) {
  392. console.log(url)
  393. uni.navigateTo({
  394. url: url
  395. })
  396. },
  397. HandlScanCode() {
  398. let _this = this
  399. uni.scanCode({
  400. success: function(res) {
  401. _this.scantoRouter(res.result)
  402. }
  403. })
  404. },
  405. scantoRouter(result) {
  406. uni.navigateTo({
  407. url: `/pages/pda/workOrder/extrusionMolding/index?id=${result}`
  408. })
  409. }
  410. }
  411. }
  412. </script>
  413. <style lang="scss" scoped>
  414. @import 'index.scss';
  415. </style>