zck 1 年之前
父節點
當前提交
695263d0e4

+ 7 - 7
src/api/jixiaoguanli/baogong.js

@@ -14,13 +14,13 @@ export const AdditionalInspectionRecordAdd = (data) => {
     data
   })
 }
-export const getMac = (data) => {
-  return service({
-    url: 'http://127.0.0.1:8090/init',
-    method: 'get',
-    data
-  })
-}
+// export const getMac = (data) => {
+//   return service({
+//     url: 'http://127.0.0.1:8090/init',
+//     method: 'get',
+//     data
+//   })
+// }
 export const remodelGetTab = (data) => {
   return service({
     url: '/mes_server/facility/remodelGetTab',

+ 7 - 7
src/api/jixiaoguanli/jitairibaobiao.js

@@ -928,13 +928,13 @@ export const  reportInfo= (params) => {
   })
 }
 //获取机台编号
-export const  reportMachineMac= (params) => {
-  return service({
-    url:'/mes_server/reporting_work/getMachineMac',
-    method: 'get',
-	params
-  })
-}
+// export const  reportMachineMac= (params) => {
+//   return service({
+//     url:'/mes_server/reporting_work/getMachineMac',
+//     method: 'get',
+// 	params
+//   })
+// }
 //设置工单工序完工
 export const setProcessStatus = (data) => {
   return service({

+ 9 - 0
src/api/mes/job.js

@@ -251,6 +251,15 @@ export const getTab = (params) => {
     params
   })
 }
+//获取物理地址
+export const getMac = (params) => {
+  return service({
+    url: 'http://127.0.0.1:8090/init',
+    method: 'get',
+    params
+  })
+}
+
 //物理地址获取机台编号
 export const getMachineMac = (params) => {
   return service({

+ 12 - 15
src/pinia/modules/user.js

@@ -5,7 +5,7 @@ import { ElLoading, ElMessage } from 'element-plus'
 import { defineStore } from 'pinia'
 import { ref, computed, watch } from 'vue'
 import { useRouterStore } from './router'
-import { getMachineMac } from "@/api/jixiaoguanli/jitairibaobiao";
+import { getMachineMac } from "@/api/mes/job";
 
 export const useUserStore = defineStore('user', () => {
   const loadingInstance = ref(null)
@@ -61,9 +61,9 @@ export const useUserStore = defineStore('user', () => {
  	  }
  	  result += res.macAddress[i];
  	}
- 	MAC=result
- 	// console.log(result);
-   // 68-ED-A4-26-5F-37
+ 	MAC = result
+  console.log("自动获取物理地址")
+  console.log(result)
    }
  };
  // 打开一个连接
@@ -78,7 +78,8 @@ export const useUserStore = defineStore('user', () => {
     const res = await getUserInfo()
     if (res.code === 0) {
       setUserInfo(res.data.userInfo)
-	  console.log(res)
+	    console.log("获取用户信息")
+	    console.log(res)
     }
     return res
   }
@@ -90,8 +91,6 @@ export const useUserStore = defineStore('user', () => {
     })
     try {
       const res = await login(loginInfo)
-	  console.log(loginInfo)
-	  console.log(res)
       if (res.code === 0) {
         setUserInfo(res.data.user)
         setToken(res.data.token)		
@@ -129,8 +128,8 @@ export const useUserStore = defineStore('user', () => {
     })
     try {
       const res = await login2(loginInfo)
-	  console.log(loginInfo)
-	  console.log(res)
+	  // console.log(loginInfo)
+	  // console.log(res)
       if (res.code === 0) {
         setUserInfo(res.data.user)
         setToken(res.data.token)
@@ -140,11 +139,9 @@ export const useUserStore = defineStore('user', () => {
         asyncRouters.forEach(asyncRouter => {
           router.addRoute(asyncRouter)
         })
-		// A4-B1-C1-D4-74-02
-        // const response = await getMachineMac({ addr:'68-ED-A4-26-5F-37'});
+		console.log("MAC")
 		console.log(MAC)
-		const response = await getMachineMac({ addr:MAC});
-		// const response = await getMachineMac({ addr:'68-E8-A8-28-58-38'});
+		const response = await getMachineMac({sys_sbID:MAC});
         console.log(response)
         if(response.data===null){
         	// ElMessage.error('请输入账号密码')
@@ -177,8 +174,8 @@ export const useUserStore = defineStore('user', () => {
  
 
   
-const GetMachineMac = async (addr) => {
-const response = await getMachineMac({ addr: '68-ED-A4-26-5F-37' });
+const GetMachineMac = async (sys_sbID) => {
+const response = await getMachineMac({ sys_sbID: 'B4-2E-99-28-FB-E7' });
 console.log(response)
 if(response.data===null){
 	LoginOut()

+ 1 - 1
src/view/performance/baozhuangbaogong.vue

@@ -138,7 +138,7 @@ export default {
 import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
 import {hiprint} from "vue-plugin-hiprint";
 import {ref, reactive,nextTick,watch, setBlockTracking } from 'vue'
-import {getSpotList,search,getMachineMac,getTab} from '@/api/mes/job'
+import {getSpotList,search,getMachineMac,getTab,getMac} from '@/api/mes/job'
 import PrintPage from '../yunyin/shengchanguanli/components/print.vue';
 import {ElMessage} from "element-plus";
 import { get } from 'scriptjs';

+ 4 - 4
src/view/performance/caiqiebaogong.vue

@@ -177,7 +177,7 @@ export default {
 // 全量引入格式化工具 请按需保留
 import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
 import {ref, reactive} from 'vue';
-import {getSpotList,getInfo,getMachineMac} from '@/api/mes/job';
+import {getSpotList,getInfo,getMachineMac,getMac} from '@/api/mes/job';
 import {ElMessage} from "element-plus";
 import PrintPage from '../yunyin/shengchanguanli/components/print.vue';
 defineOptions({name: 'Company'})
@@ -237,8 +237,8 @@ const GetAddr =  () => {
   }
   // 3. 打开一个连接
   xmlhttp.open("get", "http://127.0.0.1:8090/init")
-  // 5. 发送
-  xmlhttp.send();
+  //  5. 发送
+   xmlhttp.send();
 }
 GetAddr()
 
@@ -554,7 +554,7 @@ const handleSizeChange = (val) => {
 
 /* 搜索样式 */
 ::v-deep .el-input__wrapper #searchInput {  
-  font-size: 10px; 
+  font-size: 16px; 
 } 
 ::v-deep .el-input__wrapper #jitaihao {  
   font-size: 18px; 

+ 18 - 11
src/view/performance/chafengbaogong.vue

@@ -244,17 +244,24 @@ const UniqId = ref('')
 const getMachineMacdata = async () => {
   console.log("本页面获取物理地址",Machine.value)
   try {
-    const data  = await getMachineMac({sys_sbID:Machine.value});
-	add_formData['机台号'] = data.data['机台号']
-	add_formData['工序'] = data.data['生产工序']
-	add_formData['组别'] = data.data['组别']
-	add_formData['人员'] = data.data['组长']
-  setTimeout(() => {
-				const inputElement = document.getElementById('searchInput');
-				if (inputElement) {
-					inputElement.focus();		
-				}
-			}, 100); // 延迟100毫秒
+	const data  = await getMachineMac({sys_sbID:Machine.value});
+	if(data.data===null){
+	  ElMessage({
+	    type: 'error',
+	    message: '未获取到机台编号请确认MAC地址或与管理员联系'
+	  })
+	}else{
+		add_formData['机台号'] = data.data['机台号']
+		add_formData['工序'] = data.data['生产工序']
+		add_formData['组别'] = data.data['组别']
+		add_formData['人员'] = data.data['组长']
+		setTimeout(() => {
+			const inputElement = document.getElementById('searchInput');
+			if (inputElement) {
+				inputElement.focus();		
+			}
+		}, 100); // 延迟100毫秒
+	}
   } catch (error) {
     console.error(error)
   }

+ 1 - 1
src/view/performance/datangbaogong.vue

@@ -138,7 +138,7 @@ export default {
 import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
 import {hiprint} from "vue-plugin-hiprint";
 import {ref, reactive,nextTick,watch, setBlockTracking } from 'vue'
-import {getSpotList,search,getMachineMac,getTab} from '@/api/mes/job'
+import {getSpotList,search,getMachineMac,getTab,getMac} from '@/api/mes/job'
 import PrintPage from '../yunyin/shengchanguanli/components/print.vue';
 import {ElMessage} from "element-plus";
 import { get } from 'scriptjs';

+ 1 - 1
src/view/performance/houdaoshougong.vue

@@ -138,7 +138,7 @@ export default {
 import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
 import {hiprint} from "vue-plugin-hiprint";
 import {ref, reactive,nextTick,watch, setBlockTracking } from 'vue'
-import {getSpotList,search,getMachineMac,getTab} from '@/api/mes/job'
+import {getSpotList,search,getMachineMac,getTab,getMac} from '@/api/mes/job'
 import PrintPage from '../yunyin/shengchanguanli/components/print.vue';
 import {ElMessage} from "element-plus";
 import { get } from 'scriptjs';

+ 1 - 1
src/view/performance/lingliaobaogong.vue

@@ -33,7 +33,7 @@
   // 全量引入格式化工具 请按需保留
   import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
   import {ref, reactive} from 'vue'
-  import {processAdd,getMachineMac} from '@/api/mes/job'
+  import {processAdd,getMachineMac,getMac} from '@/api/mes/job'
   import {ElMessage} from "element-plus";
   import { get } from 'scriptjs';
   defineOptions({name: 'Company'})

+ 1 - 1
src/view/performance/zongjianbaogong.vue

@@ -138,7 +138,7 @@ export default {
 import { Layout, LayoutSider, LayoutContent } from '@arco-design/web-vue';
 import {hiprint} from "vue-plugin-hiprint";
 import {ref, reactive,nextTick,watch, setBlockTracking } from 'vue'
-import {getSpotList,search,getMachineMac,getTab} from '@/api/mes/job'
+import {getSpotList,search,getMachineMac,getTab,getMac} from '@/api/mes/job'
 import PrintPage from '../yunyin/shengchanguanli/components/print.vue';
 import {ElMessage} from "element-plus";
 import { get } from 'scriptjs';