index.vue 12 KB

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