zck 11 сар өмнө
parent
commit
9b1862ba5c

+ 2 - 2
src/view/inventory/ruku.vue

@@ -236,7 +236,7 @@
 				<el-table-column  align="left" label="款式" prop="款式" width="120"/>
 				<el-table-column  align="left" label="入库数量" prop="入库数量" width="90"/>
 				<el-table-column  align="left" label="单位" prop="单位" width="60"/>
-				<el-table-column  align="left" label="部门" prop="部门" width="60"/> 
+				<el-table-column  align="left" label="来料部门" prop="部门" width="100"/> 
 				<el-table-column  align="left" label="备注" prop="备注" width="300"/>
 				<el-table-column fixed="right" label="操作" width="120">
 				    <template #default="{ row, $index }">
@@ -619,7 +619,7 @@ const dj_Dialog = () => {
 		mianliaotabData.value.部门 === undefined ||
 		mianliaotabData.value.部门 === null	
 	){
-	  ElMessage({ type: 'warning', message: '请选择部门' });
+	  ElMessage({ type: 'warning', message: '请选择来料部门' });
 	  return;
 	}
 	

+ 66 - 10
src/view/performance/QualityAssessment/SemiFinishedRework.vue

@@ -64,9 +64,9 @@ v-model="dialogFormVisible"
 :before-close="closeDialog"
 :title="type === 'create' ? '服装半成品返工报工页面' : '服装半成品返工报工修改'"
 destroy-on-close
-style="width: 90%; height: 90%; margin-top: 3%;"
+style="width: 100%; height: 100%; margin-top: 0%;"
 >
-<el-form :model="formData" label-position="right" ref="elFormRef" :rules="rule" label-width="120px">
+<el-form :model="formData" label-position="right" ref="elFormRef" :rules="rule" label-width="220px">
   <!-- 日期选择框 -->
   <el-row :gutter="10" >
     <el-col :span="8">
@@ -74,7 +74,13 @@ style="width: 90%; height: 90%; margin-top: 3%;"
         <el-date-picker v-model="DefectiveformData['Sys_rq']" style="width: 40%;" type="date" />
       </el-form-item>
     </el-col>
+    <el-col :span="8">
+      <el-form-item label="返工车缝小组" label-width="100px">
+        <el-input v-model="ReworkTeam['zb']" style="width: 120px;"  />
+      </el-form-item>
+    </el-col>
   </el-row>
+  
 
   <!-- 新增一行按钮 -->
   <el-button type="primary" @click="addRow" style="margin-left: 20px; margin-bottom: 20px;">新增一行</el-button>
@@ -91,7 +97,7 @@ style="width: 90%; height: 90%; margin-top: 3%;"
     :show-overflow-tooltip="true"
   >
     <!-- 订单编号|款号 -->
-    <el-table-column label="订单编号|款号" width="300">
+    <el-table-column label="订单编号|款号" width="220">
       <template #default="{ row, $index }">
         <el-select
           v-model="row.ddbh"
@@ -113,7 +119,7 @@ style="width: 90%; height: 90%; margin-top: 3%;"
     </el-table-column>
 
     <!-- 面料分类|面料名称 -->
-    <el-table-column label="面料分类|面料名称" width="220">
+    <el-table-column label="面料分类|面料名称" width="160">
       <template #default="{ row }">
         <el-select v-model="row.material" placeholder="请选择面料" >
           <el-option
@@ -127,7 +133,7 @@ style="width: 90%; height: 90%; margin-top: 3%;"
     </el-table-column>
 
     <!-- 颜色 -->
-    <el-table-column label="颜色" width="160">
+    <el-table-column label="颜色" width="130">
       <template #default="{ row }">
         <el-select v-model="row.color" placeholder="请选择颜色" >
           <el-option
@@ -141,7 +147,7 @@ style="width: 90%; height: 90%; margin-top: 3%;"
     </el-table-column>
 
             <!-- 尺码 -->
-        <el-table-column label="尺码" width="160">
+        <el-table-column label="尺码" width="130">
       <template #default="{ row }">
         <el-select v-model="row.size" placeholder="请选择尺码" clearable>
           <el-option
@@ -156,14 +162,14 @@ style="width: 90%; height: 90%; margin-top: 3%;"
 
 
      <!-- 返工数量 -->
-     <el-table-column label="返工数量" width="100">
+     <el-table-column label="返工数量" width="95">
       <template #default="{ row }">
         <el-input v-model="row.defectiveQuantity" />
       </template>
     </el-table-column>
     
         <!-- 返工车缝小组 -->
-        <el-table-column label="返工车缝小组" width="150">
+        <!-- <el-table-column label="返工车缝小组" width="110">
       <template #default="{ row }">
         <el-select v-model="row.group" placeholder="请选择返工车缝小组" clearable>
           <el-option
@@ -174,7 +180,7 @@ style="width: 90%; height: 90%; margin-top: 3%;"
           />
         </el-select>
       </template>
-    </el-table-column>
+    </el-table-column> -->
 
     <!-- 返工问题 -->
     <el-table-column label="返工问题" width="140">
@@ -266,6 +272,7 @@ import FileSaver from 'file-saver';
 import { Search, Refresh, Download } from '@element-plus/icons-vue'
 import { ref, reactive, nextTick, onMounted, onBeforeMount } from 'vue'
 import { Layout, LayoutContent, LayoutHeader, LayoutSider } from '@arco-design/web-vue'
+import {getMachineMac} from '@/api/jixiaoguanli/jitairibaobiao'
 import {queryOrderSize,ApiAddDefective,ApiMouthlist,ApiSubPieceAnd,ApiSubPieceAndReworkList, Apiorder} from '@/api/mes/job'
 import { useUserStore } from '@/pinia/modules/user'
 // import { el } from 'element-plus/es/locale'
@@ -320,6 +327,55 @@ try {
 
 getTabdata();
 
+const ReworkTeam = reactive({
+  zb: '车缝01组', // 返工车缝小组
+});
+const Machine = ref('') //机台号
+//自动获取物理地址
+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]
+      }
+	  Machine.value = result
+    getMachineMacdata(Machine.value)
+    }
+  }
+  // 3. 打开一个连接
+  xmlhttp.open("get", "http://127.0.0.1:8090/init")
+  // 5. 发送
+  xmlhttp.send();
+}
+GetAddr()
+
+//物理地址获取机台编号
+const getMachineMacdata = async () => {
+  console.log("机台获取物理地址",Machine.value)
+  try {
+    const data  = await getMachineMac({sys_sbID:Machine.value});
+	if (data.data === null) {
+		return;
+	}
+  console.log("机台获取物理地址",data.data)
+  ReworkTeam['zb'] = data.data.组别;
+  } catch (error) {
+    console.error(error)
+  }
+}
 
 const tableData = reactive([]);
 const exceltableData = reactive([]);
@@ -582,7 +638,7 @@ const params = SecondarytabeleData.map(item => {
     数量: item['defectiveQuantity'],
     备注: item['remark'],
     Sys_id: userStore.userInfo.nickName,
-    组别: item['group'],
+    组别: ReworkTeam['zb'],
     Sys_rq: currentDates,
     sczl_rq: currentDate,
     状态: '返工',

+ 58 - 2
src/view/performance/QualityAssessment/cropdefective.vue

@@ -65,7 +65,7 @@
 			  destroy-on-close
 			  style="width: 100%; height: 100%; margin: 0%;"
 			>
-  <el-form :model="formData" label-position="right" ref="elFormRef" :rules="rule" label-width="120px">
+  <el-form :model="formData" label-position="right" ref="elFormRef" :rules="rule" label-width="120px">  
     <!-- 日期选择框 -->
     <el-row :gutter="10" >
       <el-col :span="8">
@@ -73,6 +73,11 @@
           <el-date-picker v-model="DefectiveformData['Sys_rq']" style="width: 40%;" type="date" />
         </el-form-item>
       </el-col>
+      <el-col :span="8">
+      <el-form-item label="报工小组" label-width="100px">
+        <el-input v-model="ReworkTeam['zb']" style="width: 120px;"  />
+      </el-form-item>
+    </el-col>
     </el-row>
 
     <!-- 新增一行按钮 -->
@@ -255,6 +260,7 @@ import FileSaver from 'file-saver';
 import { Search, Refresh, Download } from '@element-plus/icons-vue'
 import { ref, reactive, nextTick, onMounted, onBeforeMount } from 'vue'
 import { Layout, LayoutContent, LayoutHeader, LayoutSider } from '@arco-design/web-vue'
+import {getMachineMac} from '@/api/jixiaoguanli/jitairibaobiao'
 import {queryOrderSize,ApiAddDefective,ApiMouthlist,ApiSubPieceAnd,ApiSubPieceAndReworkList, Apiorder} from '@/api/mes/job'
 import { useUserStore } from '@/pinia/modules/user'
 // import { el } from 'element-plus/es/locale'
@@ -309,6 +315,56 @@ const getTabdata = async () => {
 
 getTabdata();
 
+const ReworkTeam = reactive({
+  zb: '车缝01组', // 返工车缝小组
+});
+const Machine = ref('') //机台号
+//自动获取物理地址
+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]
+      }
+	  Machine.value = result
+    getMachineMacdata(Machine.value)
+    }
+  }
+  // 3. 打开一个连接
+  xmlhttp.open("get", "http://127.0.0.1:8090/init")
+  // 5. 发送
+  xmlhttp.send();
+}
+GetAddr()
+
+//物理地址获取机台编号
+const getMachineMacdata = async () => {
+  console.log("机台获取物理地址",Machine.value)
+  try {
+    const data  = await getMachineMac({sys_sbID:Machine.value});
+	if (data.data === null) {
+		return;
+	}
+  console.log("机台获取物理地址",data.data)
+  ReworkTeam['zb'] = data.data.组别;
+  } catch (error) {
+    console.error(error)
+  }
+}
+
 
 const tableData = reactive([]);
 const exceltableData = reactive([]);
@@ -554,7 +610,7 @@ const enterDialog = async () => {
       数量: item['defectiveQuantity'],
       备注: item['remark'],
       Sys_id: userStore.userInfo.nickName,
-      组别: item['group'],
+      组别: ReworkTeam['zb'],
       Sys_rq: currentDates,
       sczl_rq: currentDate,
       状态: '次片',