index.vue 13 KB

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