index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481
  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: 'maintenance',
  282. workOrderType: 2,
  283. url: `/pages/maintenance/order/order`,
  284. icon: 'icon-gongdanguanli',
  285. badge: 0
  286. },
  287. {
  288. name: '巡点检工单',
  289. type: 'patrol',
  290. workOrderType: 1,
  291. url: `/pages/tour_tally/order/order`,
  292. icon: 'icon-gongdanguanli',
  293. badge: 0
  294. },
  295. // {
  296. // name: '量具送检工单',
  297. // type: 'quantity',
  298. // workOrderType: 5,
  299. // url: `/pages/home/myTicket/myTicket?index=2`,
  300. // icon: 'icon-gongdanguanli',
  301. // badge: 0
  302. // },
  303. {
  304. name: '维修工单',
  305. type: 'repaire',
  306. workOrderType: 3,
  307. url: `/pages/maintenanceWorkorder/order/order`,
  308. icon: 'icon-gongdanguanli',
  309. badge: 0
  310. },
  311. {
  312. name: '报修',
  313. type: 'repairReport',
  314. workOrderType: 4,
  315. url: `/pages/repair/repair/index`,
  316. icon: 'icon-gongdanguanli',
  317. badge: 0
  318. },
  319. {
  320. name: '备品备件申请单',
  321. type: 'sparepart',
  322. workOrderType: 4,
  323. url: `/pages/maintenanceWorkorder/sparepart/index`,
  324. icon: 'icon-gongdanguanli',
  325. badge: 0
  326. }
  327. /* {
  328. class: "iconfont icon-xundianjian",
  329. title: "巡点检",
  330. link_url: "/pages/tour_tally/order/order",
  331. //"num": 34
  332. },
  333. {
  334. class: "iconfont icon-a-baoyangputong",
  335. title: "保养工单",
  336. link_url: "/pages/maintenance/order/order",
  337. //"num": 23
  338. },
  339. {
  340. class: "iconfont icon-weixiugongdan",
  341. title: "维修工单",
  342. link_url: "/pages/maintain_service/order/order",
  343. //"num": 23
  344. },
  345. /* {
  346. class: 'iconfont icon-beijian',
  347. title: '备品备件',
  348. link_url: '/pages/sparepart/order/order',
  349. //"num": 1
  350. },
  351. {
  352. class: "iconfont icon-baoxiu",
  353. title: "报修单",
  354. link_url: "/pages/repair/order/order",
  355. //"num": 1
  356. },*/
  357. /* {
  358. class: 'iconfont icon-wuliaoruku',
  359. title: '入库登记',
  360. link_url: '/pages/put_storage/order/index',
  361. //"num": 34
  362. },
  363. {
  364. class: 'iconfont icon-shebeichuku',
  365. title: '出库登记',
  366. link_url: '/pages/outbound/order/index',
  367. //"num": 34
  368. }, */
  369. ],
  370. dispatchList: [
  371. {
  372. name: '任务工单',
  373. url: `/pages/dispatchManage/taskWork/index`,
  374. icon: 'icon-gongdanguanli',
  375. badge: 0
  376. //"num": 34
  377. }
  378. ],
  379. internalManagementList: [
  380. {
  381. name: '申请',
  382. url: `/pages/internalManagement/apply/index`,
  383. icon: 'icon-gongdanguanli',
  384. badge: 0
  385. //"num": 34
  386. }
  387. ],
  388. treeList: [],
  389. saleManageList:[]
  390. }
  391. },
  392. created() {
  393. this.getTree()
  394. },
  395. // onShow() {
  396. // this.getStatistics()
  397. // },
  398. methods: {
  399. getStatistics() {
  400. // 获取工单统计数
  401. statistics().then(res => {
  402. this.workOrder = res
  403. console.log('this.operationsList---', this.operationsList)
  404. console.log('res', res)
  405. this.operationsList.forEach(item => {
  406. if (item.name == '保养工单') item.badge = res.maintenanceNum
  407. if (item.name == '巡点检工单') item.badge = res.patrolInspection
  408. // if (item.name == '量具送检工单') item.badge = res.quantityNum
  409. if (item.name == '维修工单') item.badge = res.repairsNum
  410. // if(item.badge)
  411. })
  412. console.log(this.operationsList)
  413. })
  414. },
  415. getTree() {
  416. let _list = uni.getStorageSync('treeList')
  417. let list = JSON.parse(_list) || []
  418. console.log('-----------list--------------')
  419. console.log(list)
  420. if (list[0] && list[0].children.length > 0) {
  421. list[0].children.forEach(f => {
  422. if (f.path == 'productionManage') {
  423. this.productionList = f.children
  424. } else if (f.path == 'operationsList') {
  425. statistics().then(res => {
  426. this.workOrder = res
  427. console.log('this.operationsList---', this.operationsList)
  428. console.log('res', res)
  429. f.children.forEach(item => {
  430. if (item.name == '保养工单') item.badge = res.maintenanceNum
  431. if (item.name == '巡点检工单') item.badge = res.patrolInspection
  432. if (item.name == '维修工单') item.badge = res.repairsNum
  433. })
  434. this.operationsList = f.children
  435. })
  436. } else if (f.path == 'warehouseManagement') {
  437. this.warehousingList = f.children
  438. } else if (f.path == 'saleManageList') {
  439. this.saleManageList = f.children
  440. this.saleManageList.forEach(item=>{
  441. item.name=item.name.replace('员工','')
  442. item.name=item.name.replace('管理员','')
  443. })
  444. }
  445. })
  446. }
  447. },
  448. toNav(url) {
  449. console.log(url)
  450. uni.navigateTo({
  451. url: url
  452. })
  453. },
  454. HandlScanCode() {
  455. let _this = this
  456. uni.scanCode({
  457. success: function (res) {
  458. _this.scantoRouter(res.result)
  459. }
  460. })
  461. },
  462. scantoRouter(result) {
  463. uni.navigateTo({
  464. url: `/pages/pda/workOrder/extrusionMolding/index?id=${result}`
  465. })
  466. }
  467. }
  468. }
  469. </script>
  470. <style lang="scss" scoped>
  471. @import 'index.scss';
  472. </style>