index.vue 14 KB

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