index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  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.link_url)">
  61. <span :class="item.class"></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-wuliaoruku',
  200. title: '入库管理',
  201. link_url: '/pages/warehouse/enterHouse/index'
  202. //"num": 34
  203. },
  204. {
  205. class: 'iconfont icon-shebeichuku',
  206. title: '出库管理',
  207. link_url: '/pages/warehouse/outHouse/index'
  208. // num: 34
  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-shebeiruku',
  236. title: '库存调拨',
  237. link_url: '/pages/warehouse/inventoryAllocation/index'
  238. //"num": 133
  239. },
  240. {
  241. class: 'iconfont icon-shebeikucuntongji',
  242. title: '报损报溢',
  243. link_url: '/pages/warehouse/reportLoss/index'
  244. //"num": 133
  245. },
  246. {
  247. class: 'iconfont icon-shebeikucun',
  248. title: '库存管理',
  249. link_url: '/pages/warehouse/inventory/index'
  250. //"num": 1
  251. },
  252. {
  253. class: 'iconfont icon-shebeikucuntongji',
  254. title: '设备库存统计',
  255. link_url: '/pages/warehouse/inventory/stat'
  256. //"num": 1
  257. }
  258. ],
  259. //运维类
  260. operationsList: [
  261. {
  262. name: '保养工单',
  263. type: 'maintenance',
  264. workOrderType: 2,
  265. url: `/pages/maintenance/order/order`,
  266. icon: 'icon-gongdanguanli',
  267. badge: 0
  268. },
  269. {
  270. name: '巡点检工单',
  271. type: 'patrol',
  272. workOrderType: 1,
  273. url: `/pages/tour_tally/order/order`,
  274. icon: 'icon-gongdanguanli',
  275. badge: 0
  276. },
  277. // {
  278. // name: '量具送检工单',
  279. // type: 'quantity',
  280. // workOrderType: 5,
  281. // url: `/pages/home/myTicket/myTicket?index=2`,
  282. // icon: 'icon-gongdanguanli',
  283. // badge: 0
  284. // },
  285. {
  286. name: '维修工单',
  287. type: 'repaire',
  288. workOrderType: 3,
  289. url: `/pages/maintenanceWorkorder/order/order`,
  290. icon: 'icon-gongdanguanli',
  291. badge: 0
  292. },
  293. {
  294. name: '报修',
  295. type: 'repairReport',
  296. workOrderType: 4,
  297. url: `/pages/repair/repair/index`,
  298. icon: 'icon-gongdanguanli',
  299. badge: 0
  300. },
  301. {
  302. name: '备品备件申请单',
  303. type: 'sparepart',
  304. workOrderType: 4,
  305. url: `/pages/maintenanceWorkorder/sparepart/index`,
  306. icon: 'icon-gongdanguanli',
  307. badge: 0
  308. }
  309. /* {
  310. class: "iconfont icon-xundianjian",
  311. title: "巡点检",
  312. link_url: "/pages/tour_tally/order/order",
  313. //"num": 34
  314. },
  315. {
  316. class: "iconfont icon-a-baoyangputong",
  317. title: "保养工单",
  318. link_url: "/pages/maintenance/order/order",
  319. //"num": 23
  320. },
  321. {
  322. class: "iconfont icon-weixiugongdan",
  323. title: "维修工单",
  324. link_url: "/pages/maintain_service/order/order",
  325. //"num": 23
  326. },
  327. /* {
  328. class: 'iconfont icon-beijian',
  329. title: '备品备件',
  330. link_url: '/pages/sparepart/order/order',
  331. //"num": 1
  332. },
  333. {
  334. class: "iconfont icon-baoxiu",
  335. title: "报修单",
  336. link_url: "/pages/repair/order/order",
  337. //"num": 1
  338. },*/
  339. /* {
  340. class: 'iconfont icon-wuliaoruku',
  341. title: '入库登记',
  342. link_url: '/pages/put_storage/order/index',
  343. //"num": 34
  344. },
  345. {
  346. class: 'iconfont icon-shebeichuku',
  347. title: '出库登记',
  348. link_url: '/pages/outbound/order/index',
  349. //"num": 34
  350. }, */
  351. ],
  352. dispatchList: [
  353. {
  354. name: '任务工单',
  355. url: `/pages/dispatchManage/taskWork/index`,
  356. icon: 'icon-gongdanguanli',
  357. badge: 0
  358. //"num": 34
  359. }
  360. ],
  361. internalManagementList: [
  362. {
  363. name: '申请',
  364. url: `/pages/internalManagement/apply/index`,
  365. icon: 'icon-gongdanguanli',
  366. badge: 0
  367. //"num": 34
  368. }
  369. ],
  370. treeList: []
  371. }
  372. },
  373. created() {
  374. this.getTree()
  375. },
  376. // onShow() {
  377. // this.getStatistics()
  378. // },
  379. methods: {
  380. getStatistics() {
  381. // 获取工单统计数
  382. statistics().then(res => {
  383. this.workOrder = res
  384. console.log('this.operationsList---', this.operationsList)
  385. console.log('res', res)
  386. this.operationsList.forEach(item => {
  387. if (item.name == '保养工单') item.badge = res.maintenanceNum
  388. if (item.name == '巡点检工单') item.badge = res.patrolInspection
  389. // if (item.name == '量具送检工单') item.badge = res.quantityNum
  390. if (item.name == '维修工单') item.badge = res.repairsNum
  391. // if(item.badge)
  392. })
  393. console.log(this.operationsList)
  394. })
  395. },
  396. getTree() {
  397. let _list = uni.getStorageSync('treeList')
  398. let list = JSON.parse(_list) || []
  399. console.log('-----------list--------------')
  400. console.log(list)
  401. if (list[0] && list[0].children.length > 0) {
  402. list[0].children.forEach(f => {
  403. if (f.path == 'productionManage') {
  404. this.productionList = f.children
  405. } else if (f.path == 'operationsList') {
  406. statistics().then(res => {
  407. this.workOrder = res
  408. console.log('this.operationsList---', this.operationsList)
  409. console.log('res', res)
  410. f.children.forEach(item => {
  411. if (item.name == '保养工单') item.badge = res.maintenanceNum
  412. if (item.name == '巡点检工单') item.badge = res.patrolInspection
  413. if (item.name == '维修工单') item.badge = res.repairsNum
  414. })
  415. this.operationsList = f.children
  416. })
  417. }
  418. })
  419. }
  420. },
  421. toNav(url) {
  422. console.log(url)
  423. uni.navigateTo({
  424. url: url
  425. })
  426. },
  427. HandlScanCode() {
  428. let _this = this
  429. uni.scanCode({
  430. success: function (res) {
  431. _this.scantoRouter(res.result)
  432. }
  433. })
  434. },
  435. scantoRouter(result) {
  436. uni.navigateTo({
  437. url: `/pages/pda/workOrder/extrusionMolding/index?id=${result}`
  438. })
  439. }
  440. }
  441. }
  442. </script>
  443. <style lang="scss" scoped>
  444. @import 'index.scss';
  445. </style>