index.vue 10 KB

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