ysy há 2 anos atrás
pai
commit
a8839486b1

+ 12 - 1
api/pda/common.js

@@ -6,7 +6,7 @@ import {
 import Vue from "vue";
 
 
-// 工单列表
+// 获取字典
 export async function getByCode(code) {
 	const data = await get(
 		Vue.prototype.apiUrl + `/system/dict/getByCode/${code}`,
@@ -18,5 +18,16 @@ export async function getByCode(code) {
 }
 
 
+// 查询菜单列表
+
+export async function getResourcesTree(code) {
+	const data = await get(
+		Vue.prototype.apiUrl + `/system/resources/getResourcesTreePDA`,
+	);
+  if (data.code == 0) {
+    return data.data;
+  }
+  return Promise.reject(data.message);
+}
 
 

+ 2 - 2
pages/center/about/about.vue

@@ -7,8 +7,8 @@
       @clickLeft="back"
     >
       <!-- <view class="title">关于株洲硬质合金集团型材分公司</view> -->
-	   <!-- <view class="title">关于湖南碳谷新材料有限公司</view> -->
-	    <view class="title">关于株洲索尔切削刀具有限公司</view>
+	   <view class="title">关于湖南碳谷新材料有限公司</view>
+	    <!-- <view class="title">关于株洲索尔切削刀具有限公司</view> -->
 
     </uni-nav-bar>
 

+ 128 - 102
pages/index/index.vue

@@ -4,12 +4,12 @@
 
 		</uni-nav-bar>
 		<view>
-			<CellTip title="生产管理"></CellTip>
+			<CellTip title="生产管理" v-if='productionList.lengt > 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.link_url)">
-						<span :class="item.class"></span>
+						@click="toNav(item.path)">
+						<span :class="'iconfont '  + item.icon"></span>
 						<label>{{ item.title }}</label>
 						<label>{{ item.num }}</label>
 					</view>
@@ -33,7 +33,7 @@
       </view>
     </view> -->
 		<view>
-			<CellTip title="运维管理"></CellTip>
+			<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.link_url)">
@@ -45,7 +45,7 @@
 			</view>
 		</view>
 		<view>
-			<CellTip title="仓储管理"></CellTip>
+			<CellTip title="仓储管理" v-if='warehousingList.length > 0'></CellTip>
 
 			<view class="nav">
 				<view class="nav-content">
@@ -89,51 +89,53 @@
 				//生产类
 				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/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/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/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/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/pda/work_order_handover/index/index",
-					},
 
-					{
-						class: "iconfont icon-gongdanguanli",
-						title: "工单详情",
-						link_url: "/pages/pda/work_order_details/index/index",
-					},
 
 					// {
 					//   class: "iconfont icon-gongdanguanli",
@@ -181,7 +183,10 @@
 				//   // },
 				// ],
 				//仓储管理
-				warehousingList: [{
+			
+				warehousingList: [
+				/*
+					{
 						class: "iconfont icon-wuliaoruku",
 						title: "入库管理",
 						link_url: "/pages/warehouse/enterHouse/index",
@@ -191,35 +196,35 @@
 						class: "iconfont icon-shebeichuku",
 						title: "出库管理",
 						link_url: "/pages/warehouse/outHouse/index",
-						//"num": 34
+						"num": 34
 					},
 
-					// {
-					// 	"class": "iconfont icon-wuliaoruku",
-					// 	"title": "物料入库",
-					// 	"link_url": "/pages/warehouse/material/index",
-					// 	//"num": 34
-					// },
+					{
+						"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-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-shebeichuku",
+						"title": "设备出库",
+						"link_url": "/pages/warehouse/outbound/index",
+						//"num": 23
+					},
 
 					{
 						class: "iconfont icon-pandiangongdan",
 						title: "盘点工单",
 						link_url: "/pages/warehouse/workOrder/index",
-						//"num": 133
+						"num": 133
 					},
 					{
 						class: "iconfont icon-shebeiruku",
@@ -241,45 +246,49 @@
 						//"num": 1
 					},
 
-					/* {
+					 {
 					  class: 'iconfont icon-shebeikucuntongji',
 					  title: '设备库存统计',
 					  link_url: '/pages/warehouse/inventory/stat',
 					  //"num": 1
-					}, */
+					}, 
+					*/
 				],
+				
 				//运维类
-				operationsList: [{
-						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
-					},
+				operationsList: [
+					/*	{
+							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-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: '入库登记',
@@ -293,15 +302,32 @@
 		  //"num": 34
 		}, */
 				],
+
+
+				treeList: []
 			};
 		},
 		created() {
-			// uni.setStorageSync(
-			//   "token",
-			//   "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhY2NvdW50SWQiOiIxIiwicm9sZUlkIjoiMCIsImdyb3VwSWQiOiIwIiwiaXNzIjoiYXV0aDAiLCJleHAiOjIwMTA2MjQ3ODcsInVzZXJJZCI6IjEifQ.4duZc2BjUIKWC2EP-8EGWgQpmqgGGLJLecxKXxFARmk"
-			// );
+			this.getTree()
+
+
 		},
 		methods: {
+			getTree() {
+				let _list = uni.getStorageSync('treeList') || [];
+				let list = JSON.parse(_list) || []
+				console.log(list)
+
+				if (list && list.length > 0) {
+					list[0].children.forEach(f => {
+						if (f.path == "productionManage") {
+							this.productionList = f.children
+
+						}
+					})
+				}
+			},
+
 			toNav(url) {
 				console.log(url)
 				uni.navigateTo({

+ 23 - 2
pages/login/login.vue

@@ -10,8 +10,8 @@
     <view class="login-title">
       <label>智慧工厂信息化系统</label>
       <!-- <text>株洲硬质合金集团型材分公司</text> -->
-	  <!-- <text>湖南碳谷新材料有限公司</text> -->
-	   <text >株洲索尔切削刀具有限公司</text>
+	  <text>湖南碳谷新材料有限公司</text>
+	   <!-- <text >株洲索尔切削刀具有限公司</text> -->
 	  
     </view>
     <view>
@@ -56,6 +56,7 @@
 <script>
 import { postJ } from "@/utils/api.js";
 import { login } from "@/api/common.js";
+import { getResourcesTree } from '@/api/pda/common.js'
 import {
   setMemo,
   isMemo,
@@ -64,6 +65,7 @@ import {
   getPassword,
 } from "@/utils/passwordMemo.js";
 import ServerSetting from "@/components/ServerSetting/index";
+
 export default {
   components: { ServerSetting },
   data() {
@@ -170,6 +172,7 @@ export default {
             icon: "success",
             duration: 2000,
           });
+		  this.getTree()
           setTimeout(() => {
             uni.reLaunch({
               url: "/pages/home/home",
@@ -195,6 +198,24 @@ export default {
         removeMemo();
       }
     },
+	
+	getTree() {
+		getResourcesTree().then(res => {
+			console.log(res)
+			if(res.length == 0) {
+				uni.showToast({
+					title: '您还未配置权限',
+					icon: 'none'
+				})
+			}
+			let List  = JSON.stringify(res || [])
+			 uni.setStorageSync("treeList", List);
+			 
+			 
+			
+	
+		})
+	},
   },
 };
 </script>

+ 4 - 1
pages/pda/feeding/components/instanceBom.vue

@@ -15,7 +15,7 @@
 					<view class="lable rx-cc">{{ itm.label }}</view>
 					<view class="content">{{ mate[itm.prop] }}</view>
 				</view>
-
+              
 				<view class="item" v-if='mate.isConsumable == 1'>
 					<view class="lable rx-cc">包装库存</view>
 					<view class="content">{{ mate.packingCountBase }}/ {{ mate.minUnit}}</view>
@@ -99,6 +99,9 @@
 
 			}
 		},
+		created() {
+			console.log(11,this.list)
+		},
 		methods: {
 			tableH(type) {
 				return tableHeader(type)

+ 3 - 12
pages/pda/workOrder/extrusionMolding/index.vue

@@ -261,14 +261,10 @@
 			setTypeFn() {
 				this.stepsList.length && this.stepsList.find(f => {
 					let id = this.currentTaskId || this.taskId
-					
-					if (id == -1) {
-						this.currentType = 5
-						return false
-					}
 					if (f.taskId == id) {
 						this.currentType = f.type
 					}
+					
 				})
 
 			},
@@ -284,13 +280,8 @@
 				this.currentTaskId = item.taskId
 				this.currentTaskName = item.taskTypeName
 				
-				 
-				if(item.taskId == -1) {
-					this.currentType =  5
-				} else {
-				
-					this.currentType = item.type
-				}
+				 	this.currentType = item.type
+			
 				
 				this.feedStatus()
 			},

+ 2 - 0
pages/systemSettings/index.vue

@@ -120,6 +120,8 @@ export default {
               .then(res => {
                 uni.removeStorageSync('token')
                 uni.removeStorageSync('userInfo')
+				uni.removeStorageSync('treeList')
+				
                 uni.reLaunch({
                   url: '/pages/login/login'
                 })

+ 1 - 0
utils/request.js

@@ -56,6 +56,7 @@ const http = ({
           console.log('身份验证已过期,请重新登录------');
           uni.removeStorageSync("token");
           uni.removeStorageSync("userInfo");
+		  uni.removeStorageSync('treeList')
           setTimeout(() => {
             wx.navigateTo({
               url: "/pages/login/login",