| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439 |
- <template>
- <view>
- <uni-nav-bar fixed="true" statusBar="true" title="工作中心" right-icon="scan" @clickRight="HandlScanCode"></uni-nav-bar>
- <view>
- <CellTip title="生产管理" v-if="productionList.length > 0"></CellTip>
- <view class="nav">
- <view class="nav-content">
- <view class="nav-item" v-for="item in productionList" :key="item.link_url" @click="toNav(item.path)">
- <span :class="'iconfont ' + item.icon"></span>
- <label>{{ item.title }}</label>
- <label>{{ item.num }}</label>
- </view>
- </view>
- </view>
- </view>
- <!-- <view>
- <CellTip title="生产执行"></CellTip>
- <view class="nav">
- <view class="nav-content">
- <view
- class="nav-item"
- v-for="(item, index) in executeList"
- @click="toNav(item.link_url)"
- >
- <span :class="item.class"></span>
- <label>{{ item.title }}</label>
- <label>{{ item.num }}</label>
- </view>
- </view>
- </view>
- </view> -->
- <view>
- <CellTip title="运维管理" v-if="operationsList.length > 0"></CellTip>
- <view class="nav">
- <view class="nav-content">
- <view class="nav-item" v-for="(item, index) in operationsList" @click="toNav(item.path)">
- <span :class="'iconfont ' + item.icon"></span>
- <i class="badge" v-if="item.badge">{{ item.badge }}</i>
- <label>{{ item.name }}</label>
- </view>
- </view>
- </view>
- </view>
- <view>
- <CellTip title="仓储管理" v-if="warehousingList.length > 0"></CellTip>
- <view class="nav">
- <view class="nav-content">
- <view class="nav-item" v-for="(item, index) in warehousingList" @click="toNav(item.path)">
- <span :class="'iconfont ' + item.icon"></span>
- <label>{{ item.title }}</label>
- <!-- <label>{{ item.num }}</label> -->
- </view>
- </view>
- </view>
- </view>
- <view>
- <CellTip title="派车管理" v-if="dispatchList.length > 0"></CellTip>
- <view class="nav">
- <view class="nav-content">
- <view class="nav-item" v-for="(item, index) in dispatchList" @click="toNav(item.url)">
- <span :class="'iconfont ' + item.icon"></span>
- <i class="badge" v-if="item.badge">{{ item.badge }}</i>
- <label>{{ item.name }}</label>
- </view>
- </view>
- </view>
- </view>
- <!-- <view>
- <CellTip title="生产类"></CellTip>
- <view class="nav">
- <view class="nav-content">
- <view
- class="nav-item"
- v-for="(item, index) in productionList"
- @click="toNav(item.link_url)"
- >
- <span :class="item.class"></span>
- <label>{{ item.title }}</label>
- <label>{{ item.num }}</label>
- </view>
- </view>
- </view>
- </view> -->
- </view>
- </template>
- <script>
- import CellTip from '@/components/CellTip.vue'
- import { statistics } from '@/api/myTicket'
- export default {
- components: {
- CellTip
- },
- data() {
- return {
- src1: 'https://cdn.uviewui.com/uview/album/1.jpg',
- workOrder: {}, // 工单统计数据
- //生产类
- productionList: [
- // {
- // class: "iconfont icon-gongdanguanli",
- // title: "生产工单",
- // link_url: "/pages/pda/workOrder/index/index",
- // },
- // {
- // class: "iconfont icon-gongdanguanli",
- // title: "领料",
- // link_url: "/pages/pda/picking/index/index",
- // },
- // {
- // class: "iconfont icon-gongdanguanli",
- // title: "投料",
- // link_url: "/pages/pda/feeding/index/index",
- // },
- // {
- // class: "iconfont icon-gongdanguanli",
- // title: "退料",
- // link_url: "/pages/pda/material_return/index/index",
- // },
- // {
- // class: "iconfont icon-gongdanguanli",
- // title: "不合格品处置",
- // link_url: "/pages/pda/nonconforming/index/index",
- // },
- // {
- // class: "iconfont icon-gongdanguanli",
- // title: "副产品回收",
- // link_url: "/pages/pda/by_product_recovery/index/index",
- // },
- // {
- // class: "iconfont icon-gongdanguanli",
- // title: "工单交接",
- // link_url: "/pages/pda/work_order_handover/index/index",
- // },
- // {
- // class: "iconfont icon-gongdanguanli",
- // title: "工单详情",
- // link_url: "/pages/pda/work_order_details/index/index",
- // },
- // {
- // class: "iconfont icon-gongdanguanli",
- // title: "生产报工",
- // link_url: "/pages/production/report/index",
- // "num": 1
- // },
- // {
- // class: "iconfont icon-gongdanguanli",
- // title: "生产工单",
- // link_url: "/pages/production/order/index",
- // // "num": 1
- // x},
- ],
- // executeList: [
- // {
- // class: "iconfont icon-gongdanguanli",
- // title: "成型",
- // link_url: "/pages/production/execute/extrusion/index",
- // // "num": 1
- // },
- // {
- // class: "iconfont icon-gongdanguanli",
- // title: "自然干燥",
- // link_url: "/pages/production/execute/drying/index",
- // // "num": 1
- // },
- // {
- // class: "iconfont icon-gongdanguanli",
- // title: "升温干燥",
- // link_url: "/pages/production/execute/heating/index",
- // // "num": 1
- // },
- // {
- // class: "iconfont icon-gongdanguanli",
- // title: "半加定长",
- // link_url: "/pages/production/execute/halfAdded/index",
- // // "num": 1
- // },
- // // {
- // // class: "iconfont icon-gongdanguanli",
- // // title: "领料",
- // // link_url: "/pages/production/execute/picking/index",
- // // // "num": 1
- // // },
- // ],
- //仓储管理
- warehousingList: [
- // {
- // class: 'iconfont icon-shebeikucun',
- // title: '库存管理',
- // link_url: '/pages/warehouse/inventory/index'
- // //"num": 1
- // },
- // {
- // class: 'iconfont icon-wuliaoruku',
- // title: '入库管理',
- // link_url: '/pages/warehouse/enterHouse/index'
- // //"num": 34
- // },
- // {
- // class: 'iconfont icon-shebeichuku',
- // title: '出库管理',
- // link_url: '/pages/warehouse/outHouse/index'
- // // num: 34
- // },
- // {
- // class: 'iconfont icon-shebeiruku',
- // title: '库存调拨',
- // link_url: '/pages/warehouse/inventoryAllocation/index'
- // //"num": 133
- // },
- // {
- // class: 'iconfont icon-wuliaoruku',
- // title: '物料入库',
- // link_url: '/pages/warehouse/material/index'
- // //"num": 34
- // },
- // {
- // class: 'iconfont icon-shebeiruku',
- // title: '设备入库',
- // link_url: '/pages/warehouse/equipment/index'
- // //"num": 23
- // },
- // {
- // class: 'iconfont icon-shebeichuku',
- // title: '设备出库',
- // link_url: '/pages/warehouse/outbound/index'
- // //"num": 23
- // },
- // {
- // class: 'iconfont icon-pandiangongdan',
- // title: '盘点工单',
- // link_url: '/pages/warehouse/workOrder/index'
- // // num: 133
- // },
- // {
- // class: 'iconfont icon-shebeikucuntongji',
- // title: '报损报溢',
- // link_url: '/pages/warehouse/reportLoss/index'
- // //"num": 133
- // },
- // {
- // class: 'iconfont icon-gongdanguanli',
- // title: '拣货管理',
- // link_url: '/pages/warehouse/picking/index'
- // //"num": 133
- // }
- // {
- // class: 'iconfont icon-shebeikucuntongji',
- // title: '设备库存统计',
- // link_url: '/pages/warehouse/inventory/stat'
- // //"num": 1
- // }
- ],
- //运维类
- operationsList: [
- {
- name: '保养工单',
- type: 'maintenance',
- workOrderType: 2,
- url: `/pages/maintenance/order/order`,
- icon: 'icon-gongdanguanli',
- badge: 0
- },
- {
- name: '巡点检工单',
- type: 'patrol',
- workOrderType: 1,
- url: `/pages/tour_tally/order/order`,
- icon: 'icon-gongdanguanli',
- badge: 0
- },
- // {
- // name: '量具送检工单',
- // type: 'quantity',
- // workOrderType: 5,
- // url: `/pages/home/myTicket/myTicket?index=2`,
- // icon: 'icon-gongdanguanli',
- // badge: 0
- // },
- {
- name: '维修工单',
- type: 'repaire',
- workOrderType: 3,
- url: `/pages/maintenanceWorkorder/order/order`,
- icon: 'icon-gongdanguanli',
- badge: 0
- },
- {
- name: '报修',
- type: 'repairReport',
- workOrderType: 4,
- url: `/pages/repair/repair/index`,
- icon: 'icon-gongdanguanli',
- badge: 0
- },
- {
- name: '备品备件申请单',
- type: 'sparepart',
- workOrderType: 4,
- url: `/pages/maintenanceWorkorder/sparepart/index`,
- icon: 'icon-gongdanguanli',
- badge: 0
- }
- /* {
- class: "iconfont icon-xundianjian",
- title: "巡点检",
- link_url: "/pages/tour_tally/order/order",
- //"num": 34
- },
- {
- class: "iconfont icon-a-baoyangputong",
- title: "保养工单",
- link_url: "/pages/maintenance/order/order",
- //"num": 23
- },
- {
- class: "iconfont icon-weixiugongdan",
- title: "维修工单",
- link_url: "/pages/maintain_service/order/order",
- //"num": 23
- },
- /* {
- class: 'iconfont icon-beijian',
- title: '备品备件',
- link_url: '/pages/sparepart/order/order',
- //"num": 1
- },
- {
- class: "iconfont icon-baoxiu",
- title: "报修单",
- link_url: "/pages/repair/order/order",
- //"num": 1
- },*/
- /* {
- class: 'iconfont icon-wuliaoruku',
- title: '入库登记',
- link_url: '/pages/put_storage/order/index',
- //"num": 34
- },
- {
- class: 'iconfont icon-shebeichuku',
- title: '出库登记',
- link_url: '/pages/outbound/order/index',
- //"num": 34
- }, */
- ],
- dispatchList: [
- {
- name: '任务工单',
- url: `/pages/dispatchManage/taskWork/index`,
- icon: 'icon-gongdanguanli',
- badge: 0
- //"num": 34
- }
- ],
- treeList: []
- }
- },
- created() {
- this.getTree()
- },
- // onShow() {
- // this.getStatistics()
- // },
- methods: {
- getStatistics() {
- // 获取工单统计数
- statistics().then(res => {
- this.workOrder = res
- console.log('this.operationsList---', this.operationsList)
- console.log('res', res)
- this.operationsList.forEach(item => {
- if (item.name == '保养工单') item.badge = res.maintenanceNum
- if (item.name == '巡点检工单') item.badge = res.patrolInspection
- // if (item.name == '量具送检工单') item.badge = res.quantityNum
- if (item.name == '维修工单') item.badge = res.repairsNum
- // if(item.badge)
- })
- console.log(this.operationsList)
- })
- },
- getTree() {
- let _list = uni.getStorageSync('treeList')
- let list = JSON.parse(_list) || []
- console.log('-----------list--------------')
- console.log(list)
- if (list[0] && list[0].children.length > 0) {
- list[0].children.forEach(f => {
- if (f.path == 'productionManage') {
- this.productionList = f.children
- } else if (f.path == 'operationsList') {
- statistics().then(res => {
- this.workOrder = res
- console.log('this.operationsList---', this.operationsList)
- console.log('res', res)
- f.children.forEach(item => {
- if (item.name == '保养工单') item.badge = res.maintenanceNum
- if (item.name == '巡点检工单') item.badge = res.patrolInspection
- if (item.name == '维修工单') item.badge = res.repairsNum
- })
- this.operationsList = f.children
- })
- } else if (f.path == 'warehouseManagement') {
- this.warehousingList = f.children
- }
- })
- }
- },
- toNav(url) {
- console.log(url)
- uni.navigateTo({
- url: url
- })
- },
- HandlScanCode() {
- let _this = this
- uni.scanCode({
- success: function (res) {
- _this.scantoRouter(res.result)
- }
- })
- },
- scantoRouter(result) {
- uni.navigateTo({
- url: `/pages/pda/workOrder/extrusionMolding/index?id=${result}`
- })
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- @import 'index.scss';
- </style>
|