index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  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. class: "iconfont icon-xundianjian",
  294. title: "巡点检",
  295. link_url: "/pages/tour_tally/order/order",
  296. //"num": 34
  297. },
  298. {
  299. class: "iconfont icon-a-baoyangputong",
  300. title: "保养工单",
  301. link_url: "/pages/maintenance/order/order",
  302. //"num": 23
  303. },
  304. {
  305. class: "iconfont icon-weixiugongdan",
  306. title: "维修工单",
  307. link_url: "/pages/maintain_service/order/order",
  308. //"num": 23
  309. },
  310. /* {
  311. class: 'iconfont icon-beijian',
  312. title: '备品备件',
  313. link_url: '/pages/sparepart/order/order',
  314. //"num": 1
  315. },
  316. {
  317. class: "iconfont icon-baoxiu",
  318. title: "报修单",
  319. link_url: "/pages/repair/order/order",
  320. //"num": 1
  321. },*/
  322. /* {
  323. class: 'iconfont icon-wuliaoruku',
  324. title: '入库登记',
  325. link_url: '/pages/put_storage/order/index',
  326. //"num": 34
  327. },
  328. {
  329. class: 'iconfont icon-shebeichuku',
  330. title: '出库登记',
  331. link_url: '/pages/outbound/order/index',
  332. //"num": 34
  333. }, */
  334. ],
  335. dispatchList: [
  336. {
  337. name: '任务工单',
  338. url: `/pages/dispatchManage/taskWork/index`,
  339. icon: 'icon-gongdanguanli',
  340. badge: 0
  341. //"num": 34
  342. },
  343. ],
  344. treeList: []
  345. }
  346. },
  347. created() {
  348. this.getTree()
  349. },
  350. onShow() {
  351. this.getStatistics()
  352. },
  353. methods: {
  354. getStatistics() {
  355. // 获取工单统计数
  356. statistics().then(res => {
  357. this.workOrder = res
  358. this.operationsList.forEach(item => {
  359. if (item.name == '保养工单') item.badge = res.maintenanceNum
  360. if (item.name == '巡点检工单') item.badge = res.patrolInspection
  361. // if (item.name == '量具送检工单') item.badge = res.quantityNum
  362. if (item.name == '维修工单') item.badge = res.repairsNum
  363. // if(item.badge)
  364. })
  365. })
  366. },
  367. getTree() {
  368. let _list = uni.getStorageSync('treeList')
  369. let list = JSON.parse(_list) || []
  370. console.log('-----------list--------------')
  371. console.log(list)
  372. if (list[0] && list[0].children.length > 0) {
  373. list[0].children.forEach(f => {
  374. if (f.path == 'productionManage') {
  375. this.productionList = f.children
  376. } else if (f.path == 'operationsList') {
  377. // this.operationsList = f.children
  378. // console.log(this.operationsList)
  379. }
  380. })
  381. }
  382. },
  383. toNav(url) {
  384. console.log(url)
  385. uni.navigateTo({
  386. url: url
  387. })
  388. },
  389. HandlScanCode() {
  390. let _this = this
  391. uni.scanCode({
  392. success: function(res) {
  393. _this.scantoRouter(res.result)
  394. }
  395. })
  396. },
  397. scantoRouter(result) {
  398. uni.navigateTo({
  399. url: `/pages/pda/workOrder/extrusionMolding/index?id=${result}`
  400. })
  401. }
  402. }
  403. }
  404. </script>
  405. <style lang="scss" scoped>
  406. @import 'index.scss';
  407. </style>