index.vue 15 KB

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