Browse Source

报工优化

liuhairui 1 năm trước cách đây
mục cha
commit
9d1697b8fe
1 tập tin đã thay đổi với 47 bổ sung32 xóa
  1. 47 32
      src/view/performance/chejianbaogong.vue

+ 47 - 32
src/view/performance/chejianbaogong.vue

@@ -137,6 +137,7 @@
                                     :header-cell-style="{ padding: '0px' }"
                                     @row-dblclick="gyupdateCompanyFunc"
                                     :row-class-name="rowClassStyle"
+                                    :cell-class-name="bzryplanUsageCellClass"
                                     style="width: 100%;height: 400px" border tooltip-effect="dark" :data="FPData" row-key="ID" @selection-change="handleSelectionChange"
                                     @row-click="clickybupdate">
                            <el-table-column type="selection" label="选择" width="55" />
@@ -1348,7 +1349,7 @@
 		    </el-col>
 			<el-col :span="4" style="margin-top=0px; margin-bottom: 0px;">
 			  <el-form-item label="工号 " prop="id" style="margin-top=0px; margin-bottom: 0px;">
-			    <el-input v-model="xunchaData.sczl_bh"  @keyup.enter.native="getygsubmit($event, '11')"  placeholder="" style="margin-top=0px; margin-bottom: 0px;"/>
+			    <el-input v-model="xunchaData.sczl_bh"  @keyup.enter.native="getxunchayg($event)"  placeholder="" style="margin-top=0px; margin-bottom: 0px;"/>
 			  </el-form-item>
 			</el-col>
 			<el-col :span="4" style="margin-top=0px; margin-bottom: 0px;">
@@ -2205,6 +2206,13 @@ const getygsubmit = (event, inputName) => {
 		   // console.log(variableValue)
 		   GetYg(variableValue,inputName)
 }
+
+const getxunchayg = async (value) => {
+  const response = await getYg({sczl_bh:xunchaData.value.sczl_bh});
+  if (response.code === 0) {
+    xunchaData.value.sczl_name=response.data.ygxm
+  }
+}
 //获取员工信息
 const GetYg = async (value,inputName) => {
   const response = await getYg({sczl_bh:value});
@@ -2690,35 +2698,13 @@ const FieldInspectionRecord = async () => {
   }
 }
 //获取机台编号
-const GetMachineMac = async () => {
-	var xmlhttp = null;
-	var res;
-	if (window.XMLHttpRequest) {
-		xmlhttp = new XMLHttpRequest();
-	} else if (window.ActiveXObject) {
-		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
-	}
-	// 2. 设置回调函数
-	xmlhttp.onreadystatechange = function() {
-		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
-			res = eval('('+xmlhttp.response+')');
-			let result = ''
-			  for (let i = 0; i < res.macAddress.length; i++) {
-				if (i % 2 === 0 && i !== 0) {
-				  result += '-' // 根据实际需求修改分隔符
-				}
-				result += res.macAddress[i]
-			  }
-		}
-	}
-	// 3. 打开一个连接http://10.10.4.42/
-	xmlhttp.open("get", "http://127.0.0.1:8090/init")
-	// 5. 发送
-	xmlhttp.send();
+const GetMachineMac = async (addr) => {
+  console.log(addr);
+  const response = await getMachineMac({ addr: addr });
   // const response = await getMachineMac({ addr: '68-ED-A4-26-5D-5E' });
   // const response = await getMachineMac({ addr: '68-ED-A4-26-5D-90' });
   // const response = await getMachineMac({ addr: '68-ED-A4-26-5E-50' });
-  const response = await getMachineMac({ addr: '68-ED-A4-26-60-CC' });
+  // const response = await getMachineMac({ addr: '68-ED-A4-26-60-CC' });
   // const response = await getMachineMac({ addr: '68-ED-A4-26-5F-8E' });
   // const response = await getMachineMac({ addr: '68-ED-A4-26-60-C8' });
   // const response = await getMachineMac({ addr: '40-62-31-21-4E-15' });
@@ -2726,7 +2712,6 @@ const GetMachineMac = async () => {
   // const response = await getMachineMac({ addr: '68-ED-A4-26-60-E5' });
   // const response = await getMachineMac({ addr: '68-ED-A4-26-5E-4E' });
   // const response = await getMachineMac({ addr: '68-ED-A4-26-60-D1' });
-  console.log(response);
   if (response.code === 0) {
     // 将接口返回的数据添加到树型结构中
     let newNode = {
@@ -2745,7 +2730,34 @@ const GetMachineMac = async () => {
     FacilityProduction();
   }
 }
-GetMachineMac()
+const GetAddr =  () => {
+  var xmlhttp = null;
+  var res;
+  if (window.XMLHttpRequest) {
+    xmlhttp = new XMLHttpRequest();
+  } else if (window.ActiveXObject) {
+    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
+  }
+  // 2. 设置回调函数
+  xmlhttp.onreadystatechange = function() {
+    if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
+      res = eval('('+xmlhttp.response+')');
+      let result = ''
+      for (let i = 0; i < res.macAddress.length; i++) {
+        if (i % 2 === 0 && i !== 0) {
+          result += '-' // 根据实际需求修改分隔符
+        }
+        result += res.macAddress[i]
+      }
+      GetMachineMac(result)
+    }
+  }
+  // 3. 打开一个连接http://10.10.4.42/
+  xmlhttp.open("get", "http://127.0.0.1:8090/init")
+  // 5. 发送
+  xmlhttp.send();
+}
+GetAddr()
 //提交巡查记录
 const SubmitPatrolRecord = async () => {
 	console.log(JTMC.split("#")[0])
@@ -3637,13 +3649,16 @@ const enterDialog = async () => {
 }
 
 const sbzyqdplanUsageCellClass = ({row, column, rowIndex, columnIndex}) =>{
-  // console.log(formData.value['工单编号'])
-  // console.log(row['工单编号|质量信息'].split('|')[0])
   if(formData.value['工单编号'] === row['工单编号|质量信息'].split('|')[0]){
-    console.log(123)
     return 'back-color-row';
   }
 }
+const bzryplanUsageCellClass = ({row, column, rowIndex, columnIndex}) =>{
+  if(formData.value['班组Id'] === row.ID){
+    return 'back-color-row';
+  }
+}
+
 </script>
 
 <style scoped>