zck 1 year ago
parent
commit
1df1d3ba1f

+ 38 - 8
src/view/performance/baozhuangbaogong.vue

@@ -157,21 +157,23 @@ const seconds = String(today.getSeconds()).padStart(2, '0');
 const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
 const currentDates = `${year}-${month}-${day}`;
 
-//全局调用
-const _Machine = '68-ED-A4-26-5F-38'
+//全局获取code,接口接收code
 const _code = '包装'
-const _gx = '7'
-const _gxmc = "包装"
+//全局接口接受的物理地址
+const Machine = ref('')
+//全局获取UniqId
+const UniqId = ref('')
 
 //物理地址获取机台编号
 const getMachineMacdata = async () => {
+  console.log("本页面获取物理地址",Machine.value)
   try {
-    const data  = await getMachineMac({sys_sbID:_Machine,code:_code});
+    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(() => {
+  setTimeout(() => {
 				const inputElement = document.getElementById('searchInput');
 				if (inputElement) {
 					inputElement.focus();		
@@ -181,8 +183,36 @@ const getMachineMacdata = async () => {
     console.error(error)
   }
 }
-getMachineMacdata();
-const UniqId = 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 add_searchInfo = ref('')
 //表格

+ 37 - 8
src/view/performance/caiqiebaogong.vue

@@ -182,20 +182,21 @@ import {ElMessage} from "element-plus";
 import PrintPage from '../yunyin/shengchanguanli/components/print.vue';
 defineOptions({name: 'Company'})
 const printPageRef = ref()
-
 const add_searchInfo = ref('')
-//全局接口接受的物理地址
-const Machine = '70-ED-A4-26-5F-32'
+
+
 //全局获取code,接口接收code
 const _code = '裁切'
+//全局接口接受的物理地址
+const Machine = ref('')
 //全局获取UniqId
 const UniqId = ref('')
 
-
 //物理地址获取机台编号
 const getMachineMacdata = async () => {
+  console.log("本页面获取物理地址",Machine.value)
   try {
-    const data  = await getMachineMac({sys_sbID:Machine,code:_code});
+    const data  = await getMachineMac({sys_sbID:Machine.value});
 	add_formData['机台号'] = data.data['机台号']
 	add_formData['工序'] = data.data['生产工序']
 	add_formData['组别'] = data.data['组别']
@@ -210,8 +211,36 @@ const getMachineMacdata = async () => {
     console.error(error)
   }
 }
-getMachineMacdata();
-
+//自动获取物理地址
+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 today = new Date();
@@ -525,7 +554,7 @@ const handleSizeChange = (val) => {
 
 /* 搜索样式 */
 ::v-deep .el-input__wrapper #searchInput {  
-  font-size: 16px; 
+  font-size: 10px; 
 } 
 ::v-deep .el-input__wrapper #jitaihao {  
   font-size: 18px; 

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

@@ -233,33 +233,62 @@ const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
 const currentDates = `${year}-${month}-${day}`;
 
 
-//全局接口接受的物理地址
-const Machine = '68-ED-A4-26-60-84'
 //全局获取code,接口接收code
 const _code = '车缝'
+//全局接口接受的物理地址
+const Machine = ref('')
 //全局获取UniqId
 const UniqId = ref('')
 
-
 //物理地址获取机台编号
 const getMachineMacdata = async () => {
+  console.log("本页面获取物理地址",Machine.value)
   try {
-    const data  = await getMachineMac({sys_sbID:Machine,code:_code});
+    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毫秒
+  setTimeout(() => {
+				const inputElement = document.getElementById('searchInput');
+				if (inputElement) {
+					inputElement.focus();		
+				}
+			}, 100); // 延迟100毫秒
   } catch (error) {
     console.error(error)
   }
 }
-getMachineMacdata();
+//自动获取物理地址
+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 cmformdata = reactive({

+ 38 - 8
src/view/performance/datangbaogong.vue

@@ -157,21 +157,23 @@ const seconds = String(today.getSeconds()).padStart(2, '0');
 const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
 const currentDates = `${year}-${month}-${day}`;
 
-//全局调用
-const _Machine = '68-ED-A4-16-7F-36'
+//全局获取code,接口接收code
 const _code = '大烫'
-const _gx = '5'
-const _gxmc = "大烫"
+//全局接口接受的物理地址
+const Machine = ref('')
+//全局获取UniqId
+const UniqId = ref('')
 
 //物理地址获取机台编号
 const getMachineMacdata = async () => {
+  console.log("本页面获取物理地址",Machine.value)
   try {
-    const data  = await getMachineMac({sys_sbID:_Machine,code:_code});
+    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(() => {
+  setTimeout(() => {
 				const inputElement = document.getElementById('searchInput');
 				if (inputElement) {
 					inputElement.focus();		
@@ -181,8 +183,36 @@ const getMachineMacdata = async () => {
     console.error(error)
   }
 }
-getMachineMacdata();
-const UniqId = 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 add_searchInfo = ref('')
 //表格

+ 38 - 8
src/view/performance/houdaoshougong.vue

@@ -157,21 +157,23 @@ const seconds = String(today.getSeconds()).padStart(2, '0');
 const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
 const currentDates = `${year}-${month}-${day}`;
 
-//全局调用
-const _Machine = '68-ED-A4-26-60-D1'
+//全局获取code,接口接收code
 const _code = '后道'
-const _gx = '4'
-const _gxmc = "后道收样"
+//全局接口接受的物理地址
+const Machine = ref('')
+//全局获取UniqId
+const UniqId = ref('')
 
 //物理地址获取机台编号
 const getMachineMacdata = async () => {
+  console.log("本页面获取物理地址",Machine.value)
   try {
-    const data  = await getMachineMac({sys_sbID:_Machine,code:_code});
+    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(() => {
+  setTimeout(() => {
 				const inputElement = document.getElementById('searchInput');
 				if (inputElement) {
 					inputElement.focus();		
@@ -181,8 +183,36 @@ const getMachineMacdata = async () => {
     console.error(error)
   }
 }
-getMachineMacdata();
-const UniqId = 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 add_searchInfo = ref('')
 //表格

+ 68 - 22
src/view/performance/lingliaobaogong.vue

@@ -54,11 +54,6 @@
   const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
   const currentDates = `${year}-${month}-${day}`;
   
-  //全局调用
-  const _Machine = '68-ED-A4-26-60-84'
-  const _code = '车缝'
-  const _gx = '5'
-  const _gxmc = "车缝"
 
   
   const add_formData = reactive({
@@ -71,25 +66,62 @@
 	是否订单尾包: '',
   });
 
-  //物理地址获取机台编号
+//全局获取code,接口接收code
+const _code = '领料'
+//全局接口接受的物理地址
+const Machine = ref('')
+//全局获取UniqId
+const UniqId = ref('')
+
+//物理地址获取机台编号
 const getMachineMacdata = async () => {
+  console.log("本页面获取物理地址",Machine.value)
   try {
-    const data  = await getMachineMac({sys_sbID:_Machine,code:_code});
-    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});
+	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)
   }
 }
-getMachineMacdata();
+//自动获取物理地址
+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 add_searchInfo = ref('')//搜索
 
@@ -238,9 +270,23 @@ const add_onSubmit = async ()=>{
   .mab{
     margin-bottom: 5px;
   }
-  /* 搜索样式 */
-  ::v-deep .el-input__wrapper #searchInput {  
-    font-size: 16px; 
-  }  
+
+
+/* 搜索样式 */
+::v-deep .el-input__wrapper #searchInput {  
+  font-size: 16px; 
+} 
+::v-deep .el-input__wrapper #jitaihao {  
+  font-size: 18px; 
+}  
+::v-deep .el-input__wrapper #gongxu {  
+  font-size: 18px; 
+}  
+::v-deep .el-input__wrapper #zubie {  
+  font-size: 18px; 
+}  
+::v-deep .el-input__wrapper #renyuan {  
+  font-size: 18px; 
+} 
   </style>
   

+ 39 - 8
src/view/performance/zongjianbaogong.vue

@@ -157,21 +157,24 @@ const seconds = String(today.getSeconds()).padStart(2, '0');
 const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
 const currentDates = `${year}-${month}-${day}`;
 
-//全局调用
-const _Machine = '68-ED-A4-26-5F-84'
+
+//全局获取code,接口接收code
 const _code = '总检'
-const _gx = '6'
-const _gxmc = "总检"
+//全局接口接受的物理地址
+const Machine = ref('')
+//全局获取UniqId
+const UniqId = ref('')
 
 //物理地址获取机台编号
 const getMachineMacdata = async () => {
+  console.log("本页面获取物理地址",Machine.value)
   try {
-    const data  = await getMachineMac({sys_sbID:_Machine,code:_code});
+    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(() => {
+  setTimeout(() => {
 				const inputElement = document.getElementById('searchInput');
 				if (inputElement) {
 					inputElement.focus();		
@@ -181,8 +184,36 @@ const getMachineMacdata = async () => {
     console.error(error)
   }
 }
-getMachineMacdata();
-const UniqId = 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 add_searchInfo = ref('')
 //表格

+ 81 - 220
src/view/yunyin/shengchanguanli/gongdanziliao.vue

@@ -98,7 +98,7 @@
                   <el-table-column align="left" sortable label="色系名称" prop="颜色"  width="110"/>
                   <el-table-column align="left" sortable label="船样" prop="船样"  width="110"/>
                   <template v-for="item in sizeDatas">
-                    <el-table-column align="left" sortable :label=item :prop=item  width="70"/> 
+                    <el-table-column align="left" sortable :label=item :prop=item  width="80"/> 
                   </template>
                   <el-table-column align="left" sortable label="制单总数" prop="zdtotal"  width="110"/>
                   <el-table-column align="left" sortable label="建档用户" prop="Sys_id"  width="110"/>
@@ -143,13 +143,13 @@
                           style="width: 100%;height: 36vh" border tooltip-effect="dark" :data="ddtableData" row-key="ID" @selection-change="handleSelectionChange">
                   <!-- <el-table-column type="selection" width="30" /> -->
                   <!-- <el-table-column align="left" label="序号" prop="序号"  width="70"/> -->
-                  <el-table-column align="left" label="备注" prop="备注"  width="70"/>
-                  <el-table-column align="left" label="文件类型" prop="件类型"  width="90"/>
-                  <el-table-column align="left" label="关联产品" prop="关联产品"  width="90"/>
-                  <el-table-column align="left" label="建档用户" prop="建档用户"  width="90"/>
-                  <el-table-column align="left" label="建档时间" prop="建档时间"  width="90"/>
-                  <el-table-column align="left" label="更新时间" prop="更新时间"  width="90"/>
-                  <el-table-column align="left" label="操作" prop="操作"  width="70" />
+                  <el-table-column align="left" label="备注" prop="附件备注"  width="110"/>
+                  <el-table-column align="left" label="文件类型" prop="件类型"  width="90"/>
+                  <el-table-column align="left" label="关联产品" prop="关联编号"  width="105"/>
+                  <el-table-column align="left" label="建档用户" prop="sys_id"  width="90"/>
+                  <el-table-column align="left" label="建档时间" prop="sys_rq"  width="115"/>
+                  <el-table-column align="left" label="更新时间" prop="mod_rq"  width="115"/>
+                  <!-- <el-table-column align="left" label="操作" prop="操作"  width="70" /> -->
                 </el-table>
               </el-tab-pane> 
 
@@ -171,22 +171,21 @@
                   <el-table-column align="left" label="建档用户" prop="sys_id"  width="90"/>
                   <el-table-column align="left" label="建档时间" prop="sys_rq"  width="115"/>
                   <el-table-column align="left" label="更新时间" prop="mod_rq"  width="115"/>
-					        <el-table-column fixed="right" label="操作" width="100">
+					        <!-- <el-table-column fixed="right" label="操作" width="115">
                     <div>
     <button @click="fetchAndConvertFile">预览PDF</button>
-
-    <!-- 弹窗结构 -->
+    <div ref="pdfContainer"></div>
     <div v-if="showPdfModal" class="modal">
       <div class="modal-content">
         <span class="close" @click="closeModal">&times;</span>
-        <div ref="pdfContainer"></div> <!-- 用于显示 PDF -->
+        <div ref="pdfContainer"></div> 
       </div>
     </div>
   </div>
 						<!-- <template v-slot="{ row }">
 						  <button @click="jsfj_del(row)">删除</button>
-						</template> -->
-					  </el-table-column>
+						</template> --
+					  </el-table-column> -->
 			      </el-table>
 			    </el-tab-pane>
             </el-tabs>
@@ -648,23 +647,11 @@
           </el-row>  -->
 
           <el-row class="form-row" style="width: 30%; margin-left: 200px; position: relative;">  
-    <el-upload  
-      ref="uploadRef"  
-      class="upload-demo"  
-      drag  
-      list-type="picture"  
-      action="http://20.0.16.128:8082/index.php/api/work_order/ImgUpload"
-      :on-preview="handlePreview"  
-      :on-remove="handleRemove"  
-      :file-list="fileList"  
-      :before-upload="beforeUpload"  
-      :auto-upload="false"  
-      :on-success="handleSuccess"  
-    >  
-      <i class="el-icon-upload"></i>  
-      <div slot="tip" class="el-upload__tip">只能上传jpg/png文件,且不超过500kb</div>  
-    </el-upload>  
-  </el-row>  
+    <form ref="uploadForm" enctype="multipart/form-data">
+      <input type="file" ref="imageInput" />
+      <input type="button" value="上传" @click="uploadFile" />
+    </form>
+  </el-row>
   
 
         </el-form>
@@ -867,7 +854,7 @@ const handleNodeClick = async (node) => {
   if (clickedNode) {
     clickedNode.querySelector('.el-tree-node__label').style.color = 'red';
   }
-  ystableData.length = []
+  ystableData.length = 0
   searchInfo.value = '';
   // if (node.label === '客户编号') {
   //   // console.log('点击了客户编号')
@@ -1363,157 +1350,8 @@ const addgdyj_onclick = async  () => {
   }
 }
 
-
-// //上传图片
-// const fileList = ref([]); 
-// const uploadRef = ref(null); 
-// const _url = ref('')
-// function handlePreview(file) {  
-//   console.log('preview', file);  
-// }  
-// function handleRemove(file, fileList) {  
-//   console.log('file removed', file, fileList);
-// }  
-// function beforeUpload(file) {  
-//   const isJPGOrPNG = file.type === 'image/jpeg' || file.type === 'image/png';  
-//   const isLt500K = file.size / 1024 / 1024 < 0.5;  
-  
-//   if (!isJPGOrPNG) {  
-//     ElMessage.error('上传头像图片只能是 JPG/PNG 格式!');  
-//     // 但为了简洁,这里我们仅返回 false  
-//     return false;  
-//   }  
-//   if (!isLt500K) {  
-//     // ElMessage.error('上传头像图片大小不能超过 500KB!');  
-//     return false;  
-//   }  
-//   return true;  
-// }  
-// function confirmAndUpload() {  
-//   if (fileList.length === 0) {  
-//     console.warn('请先选择文件!');  
-//     return;  
-//   }  
-  
-//   // 直接调用 Upload 组件的 submit 方法来上传文件  
-//   uploadRef.value.submit();  
-// } 
-// function handleSuccess(response, file, fileList) {  
-//   // 处理上传成功后的逻辑,例如清空 fileList  
-//   console.log('upload success:', response);  
-//   _url.value = fileList[0].url
-//   // 可以选择清空已上传的文件列表  
-// }  
-
-
-// //新增颜色资料确定
-// const add_gdyjenterDialog =  async  () => {
-//   let cy = '';
-//   if(add_yszlformdata['sfcy'] === '是'){
-//      cy = '1'
-//   }else if(add_yszlformdata['sfcy'] === '否'){
-//      cy = '0'
-//   }
-//   const addyszltable = {
-//     订单编号: add_yszlformdata['ddh'],
-// 		子订单编号: add_yszlformdata['ddzbh'],
-// 		颜色: add_yszlformdata['sxmc'],
-//     款号: add_yszlformdata['kh'],
-// 		船样: cy,
-//     Sys_id:add_yszlformdata['kdy'],
-//     cm1: cmformdata['cm1'],
-//     cm2: cmformdata['cm2'],
-//     cm3: cmformdata['cm3'],
-//     cm4: cmformdata['cm4'],
-//     cm5: cmformdata['cm5'],
-//     cm6: cmformdata['cm6'],
-//     cm7: cmformdata['cm7'],
-//     cm8: cmformdata['cm8'],
-//     // 合计: zdsformdata['cm9'],
-// 		cmsl1: zdsformdata['zds1'],
-//     cmsl2: zdsformdata['zds2'],
-//     cmsl3: zdsformdata['zds3'],
-//     cmsl4: zdsformdata['zds4'],
-//     cmsl5: zdsformdata['zds5'],
-//     cmsl6: zdsformdata['zds6'],
-//     cmsl7: zdsformdata['zds7'],
-//     cmsl8: zdsformdata['zds8'],
-//     zdtotal: zdsformdata['zds9'],
-
-//     // 图片:previewFiles['value']['0']['name']
-// 	};
-
-//   // console.log(addyszltable)
-//   // const upload_list = await upload(_url.value);
-//   // console.log(696,upload_list.code)
-
-//   const printDetailAdds = await printDetailAdd(addyszltable);
-//   if (printDetailAdds.code === 0) {
-// 		add_gdyjdialogFormVisible.value = false;
-// 		ElMessage({type: 'success',message: '新增成功'})
-//   }
-//   const PrintListDatas = await PrintListData({order:_Gd_gdbh.value})
-//         if(PrintListDatas.data.列表.length === 0){
-//           ystableData.length = []
-//         }else{
-//           sizeDatas.splice(0,PrintListDatas.data.型号.length,...PrintListDatas.data.型号);//型号数据
-//           ystableData.splice(0,PrintListDatas.data.列表.length,...PrintListDatas.data.列表);//表格数据
-//         }
-      
-// }
-
-const fileList = ref([]);  
-const uploadRef = ref(null);  
-const _url = ref('');  
-  
-function handlePreview(file) {  
-  console.log('preview', file);  
-}  
-  
-function handleRemove(file, fileList) {  
-  console.log('file removed', file, fileList);  
-}  
-  
-function beforeUpload(file) {  
-  const isJPGOrPNG = file.type === 'image/jpeg' || file.type === 'image/png';  
-  const isLt500K = file.size / 1024 / 1024 < 0.5;  
-  
-  if (!isJPGOrPNG) {  
-    ElMessage.error('上传头像图片只能是 JPG/PNG 格式!');  
-    return false;  
-  }  
-  if (!isLt500K) {  
-    ElMessage.error('上传头像图片大小不能超过 500KB!');  
-    return false;  
-  }  
-  return true;  
-}  
-  
-function handleSuccess(response, file, fileList) {  
-  // 假设服务器返回了文件URL  
-  _url.value = response.url; // 假设response中包含了url字段  
-  // 如果不需要保留已上传的文件在列表中,可以清空fileList  
-  // fileList.value = [];  
-}  
-  
+//新增颜色资料按钮确定
 const add_gdyjenterDialog =  async  () => {
-  console.log(123313232);  
-  console.log(fileList);  
-  // if (fileList.length === 0) {  
-  //   ElMessage.warn('请先选择文件!');  
-  //   return;  
-  // }  
-  
-  // 在这里设置action属性(如果需要的话),或者确保它已经在组件的其他部分被正确设置  
-  // uploadRef.value.action = '你的上传接口URL';  
-  
-  // 调用上传方法  
-  try {  
-    await uploadRef.value.submit(); // 这将触发beforeUpload, 如果通过,则发送文件到action指定的URL  
-  } catch (error) {  
-    // 处理上传失败的情况  
-    ElMessage.error('上传失败: ' + error.message);  
-  }  
   let cy = '';
   if(add_yszlformdata['sfcy'] === '是'){
      cy = '1'
@@ -1549,9 +1387,6 @@ const add_gdyjenterDialog =  async  () => {
     // 图片:previewFiles['value']['0']['name']
 	};
 
-  // console.log(addyszltable)
-  // const upload_list = await upload(_url.value);
-  // console.log(696,upload_list.code)
 
   const printDetailAdds = await printDetailAdd(addyszltable);
   if (printDetailAdds.code === 0) {
@@ -1560,19 +1395,46 @@ const add_gdyjenterDialog =  async  () => {
   }
   const PrintListDatas = await PrintListData({order:_Gd_gdbh.value})
         if(PrintListDatas.data.列表.length === 0){
-          ystableData.length = []
+          ystableData.length = 0
         }else{
           sizeDatas.splice(0,PrintListDatas.data.型号.length,...PrintListDatas.data.型号);//型号数据
           ystableData.splice(0,PrintListDatas.data.列表.length,...PrintListDatas.data.列表);//表格数据
         }
-      
-  
-  // 如果需要,可以在这里处理上传成功后的逻辑,但通常这会在handleSuccess中处理  
-  // 例如,你可能想在这里使用_url.value做一些事情  
-  console.log('上传成功,文件URL:', _url.value); 
-   
 }  
 
+const imageInput = ref(null);  // 通过 ref 获取文件输入 DOM
+
+const uploadFile = () => {
+  console.log('按钮被点击');
+  
+  const file = imageInput.value.files[0];  // 获取选中的文件
+  if (!file) {
+    console.error('未选择文件');
+    return;
+  }
+  let data  = new FormData()
+  data.append('image',file)
+  for (let [key, value] of data.entries()) { 
+  console.log(key, value); 
+}
+
+  fetch('http://20.0.16.128:8082/index.php/api/work_order/ImgUpload', {  // 使用 fetch 发送文件
+    method: 'POST',
+    body: data,  // 直接将文件对象作为请求体
+
+  })
+  .then(response => response.json())
+  .then(data => {
+    console.log('上传成功:', data);
+  })
+  .catch(error => {
+    console.error('上传失败:', error);
+  });
+};
+
+
+
+
 //新增颜色资料取消
 const add_dyjcloseDialog = () => {
   add_gdyjdialogFormVisible.value = false
@@ -1703,12 +1565,14 @@ const tableRowClick = async (row) => {
     console.log(row.订单编号)
     _Gd_gdbh.value = row.订单编号
     _ddhval.value = row.订单编号
+    sizeDatas.length = 0
     try {
         const PrintListDatas = await PrintListData({order:_Gd_gdbh.value})
-        const OrderAttachmentss = await OrderAttachments({order:_Gd_gdbh.value,desc:'技术附件'})
-        console.log(OrderAttachmentss.data.length)
+        const jsOrderAttachments = await OrderAttachments({order:_Gd_gdbh.value,desc:'技术附件'})
+        const ddOrderAttachments = await OrderAttachments({order:_Gd_gdbh.value,desc:'订单资料附件'})
+        console.log(jsOrderAttachments.data.length)
         if(PrintListDatas.data.列表.length === 0 ){
-          ystableData.length = []
+          ystableData.length = 0
         }else{
           sizeDatas.splice(0,PrintListDatas.data.型号.length,...PrintListDatas.data.型号);//型号数据
           ystableData.splice(0,PrintListDatas.data.列表.length,...PrintListDatas.data.列表);//表格数据
@@ -1721,8 +1585,9 @@ const tableRowClick = async (row) => {
           ystableData.length = 0;  
           ystableData.push(...newData);
         } 
-        if(OrderAttachmentss.code === 0){
-          jstableData.splice(0,OrderAttachmentss.data.length,...OrderAttachmentss.data);
+        if(jsOrderAttachments.code === 0 && ddOrderAttachments.code === 0){
+          jstableData.splice(0,jsOrderAttachments.data.length,...jsOrderAttachments.data);
+          ddtableData.splice(0,ddOrderAttachments.data.length,...ddOrderAttachments.data);
         }
       } catch (error) {
         console.error(error);
@@ -1743,23 +1608,23 @@ const fetchAndConvertFile = async () => {
     const response= responses.data[0].附件内容
     const base64Data = response.match(/base64,(.*)$/)?.[1]; 
 
-    if (!base64Data) {
-      throw new Error('Invalid Base64 data');
-    }
+if (!base64Data) {
+  throw new Error('Invalid Base64 data');
+}
 
-    const binaryString = atob(base64Data);
-    const binaryLen = binaryString.length;
-    const bytes = new Uint8Array(binaryLen);
+const binaryString = atob(base64Data);
+const binaryLen = binaryString.length;
+const bytes = new Uint8Array(binaryLen);
 
-    for (let i = 0; i < binaryLen; i++) {
-      bytes[i] = binaryString.charCodeAt(i);
-    }
+for (let i = 0; i < binaryLen; i++) {
+  bytes[i] = binaryString.charCodeAt(i);
+}
 
-    // 解析 XLSX 文件
-    const workbook = XLSX.read(bytes, { type: 'array' });
+       // 解析 XLSX 文件
+       const workbook = XLSX.read(bytes, { type: 'array' });
     const worksheet = workbook.Sheets[workbook.SheetNames[0]];
+    console.log(121212,worksheet)
     const jsonData = XLSX.utils.sheet_to_json(worksheet);
-
     generatePdf(jsonData);
   } catch (error) {
     console.error('Error fetching and converting file:', error);
@@ -1767,7 +1632,6 @@ const fetchAndConvertFile = async () => {
 };
 
 const generatePdf = (data) => {
-  console.log(465456,data)
   const doc = new jsPDF();
 
   let yPosition = 10;
@@ -1785,9 +1649,6 @@ const generatePdf = (data) => {
 const previewPdf = (blob) => {
   const fileURL = URL.createObjectURL(blob);
 
-  // 显示弹窗
-  showPdfModal.value = true;
-
   // 通过 ref 引用 pdfContainer 来在指定容器中显示 PDF
   const iframe = document.createElement('iframe');
   iframe.src = fileURL;
@@ -1800,13 +1661,13 @@ const previewPdf = (blob) => {
   }
 };
 
-const downloadPdf = (blob) => {
-  const link = document.createElement('a');
-  const fileURL = URL.createObjectURL(blob);
-  link.href = fileURL;
-  link.download = 'file.pdf';
-  link.click();
-};
+// const downloadPdf = (blob) => {
+//   const link = document.createElement('a');
+//   const fileURL = URL.createObjectURL(blob);
+//   link.href = fileURL;
+//   link.download = 'file.pdf';
+//   link.click();
+// };
 
 const table_del = ref(true)
 //表格复选框