liuhairui 1 rok temu
rodzic
commit
51089dccdf

Plik diff jest za duży
+ 0 - 348
src/view/job/processSheet/processSheet.vue


+ 76 - 15
src/view/performance/baozhuangbaogong.vue

@@ -122,25 +122,42 @@
 									</el-table>
 								</el-tab-pane>
 								
-							  <el-tab-pane label="技术附件" @click="showTable('技术附件')" name="fourth">
-								<el-table ref="multipleTable"
-										  :row-style="{ height: '20px' }"
-										  :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
+							<el-tab-pane label="订单资料附件" name="third">
+							  <el-table ref="multipleTable"
+							            :row-style="{ height: '30px' }"
+							            :cell-style="{ padding: '0px' }" :header-row-style="{ height: '30px' }"
+							            :header-cell-style="{ padding: '0px' }"
+							            :show-overflow-tooltip="true"
+							            :cell-class-name="planUsageCellClass"
+							            highlight-current-row="true"
+							            @row-dblclick="gdbomupdateCompanyFunc"
+							            style="width: 100%;height: 36vh" border tooltip-effect="dark" :data="ddtableData" row-key="ID"
+													   @selection-change="fjSelectionChange">
+							   <el-table-column align="left" label="关联编号" prop="关联编号"  width="115"/>
+							   <el-table-column align="left" label="备注" 	prop="附件备注"  width="110"/>
+							   <el-table-column align="left" label="文件类型" prop="附件类型"  width="100"/>
+							   <el-table-column align="left" label="建档时间" prop="sys_rq"  width="160"/>
+							   <el-table-column align="left" label="建档用户" prop="sys_id"  width="200"/>
+							  </el-table>
+							</el-tab-pane> 
+							
+							  <el-tab-pane label="技术附件"  name="fourth">
+							  	<el-table ref="multipleTable"
+										  :row-style="{ height: '30px' }"
+										  :cell-style="{ padding: '0px' }" :header-row-style="{ height: '30px' }"
 										  :header-cell-style="{ padding: '0px' }"
 										  :show-overflow-tooltip="true"
 										  :cell-class-name="planUsageCellClass"
 										  highlight-current-row="true"
 										  @row-dblclick="ExcelShow"
 										  style="width: 100%;height: 36vh" border tooltip-effect="dark" :data="jstableData" row-key="ID" @selection-change="handleSelectionChange">
-								  <!-- <el-table-column type="selection" width="55" /> -->
-								  <el-table-column align="left" label="备注" prop="附件备注"  width="120"/>
-								  <el-table-column align="left" label="文件类型" prop="附件类型"  width="120"/>
-								  <el-table-column align="left" label="关联产品" prop="关联编号"  width="120"/>
-								  <el-table-column align="left" label="建档用户" prop="sys_id"  width="120"/>
-								  <el-table-column align="left" label="建档时间" prop="sys_rq"  width="160"/>
-								  <el-table-column align="left" label="更新时间" prop="mod_rq"  width="120"/>
-								  </el-table>
-								</el-tab-pane>
+								 <el-table-column align="left" label="关联编号" prop="关联编号"  width="115"/>
+								 <el-table-column align="left" label="备注" 	prop="附件备注"  width="110"/>
+								 <el-table-column align="left" label="文件类型" prop="附件类型"  width="100"/>
+								 <el-table-column align="left" label="建档时间" prop="sys_rq"  width="160"/>
+								 <el-table-column align="left" label="建档用户" prop="sys_id"  width="200"/>
+							      </el-table>
+							    </el-tab-pane>
 							</el-tabs>
 						</el-row>
 					</el-main>
@@ -335,6 +352,7 @@ const searcs = ref('')
 const _order = ref('')
 //技术附件
 const jstableData = reactive([])
+const ddtableData = reactive([])
 const _list = ref('')
 
 // 查询按钮
@@ -382,13 +400,56 @@ const add_onSubmit = async ()=>{
 	 add_formData['剩余数量'] = getSpotLists.data.result.ci_num
 	 add_tableData.splice(0,add_tableData.length,...getSpotLists.data.records);
 	 
-	 //技术附件
+	 //xlsx附件
 	 const searchValue = add_searchInfo.value.split('-')[0];
 	 const jsOrderAttachments = await OrderAttachments({order:searchValue,desc:'技术附件'})
+	 const ddOrderAttachments = await OrderAttachments({order:searchValue,desc:'订单资料附件'})
 	 jstableData.splice(0,jsOrderAttachments.data.length,...jsOrderAttachments.data);
+	 ddtableData.splice(0,ddOrderAttachments.data.length,...ddOrderAttachments.data);
 	 
 }
-
+//订单资料excel展示
+const gdbomupdateCompanyFunc = (row) =>{
+	const { url } = row
+	const excelPath = `/${url.replace(/\\/g,"/")}`
+	const excelName = excelPath.split('/').pop()
+	$.getScript('/luckysheet/plugins/js/plugin.js', () => {
+			$script('/luckysheet/luckysheet.umd.js', () => {
+			luckyexcelVisible.value = true
+			LuckyExcel.transformExcelToLuckyByUrl(
+				excelPath,
+				excelName,
+				function(exportJson, luckysheetfile){
+					if(exportJson.sheets==null || exportJson.sheets.length==0){
+						alert("Failed to read the content of the excel file, currently does not support xls files!");
+						return;
+					}
+					if(luckyExcel) luckyExcel.destroy();
+					luckysheet.create({
+						container: 'luckyexcel', //容器的ID
+						data: exportJson.sheets,
+						title: exportJson.info.name, // 工作簿名称
+						lang: "zh", // 设定表格语言 国际化设置,允许设置表格的语言,支持中文("zh")和英文("en")
+						showtoolbar: false, // 是否显示工具栏
+						showinfobar: false, // 是否显示顶部信息栏
+						allowEdit: false, // 是否允许前台编辑
+						enableAddRow: false, // 允许增加行
+						enableAddCol: false, // 允许增加列
+						userInfo: false, // 右上角的用户信息展示样式
+						showRowBar: false, // 是否显示行号区域
+						showColumnBar: false, // 是否显示列号区域
+						sheetFormulaBar: false, // 是否显示公式栏
+						enableAddBackTop: false,//返回头部按钮
+					});
+					luckyExcel = luckysheet;
+			})
+		})
+		})
+		$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/css/pluginsCss.css'));
+		$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/plugins.css'));
+		$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/css/luckysheet.css'));
+		$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/assets/iconfont/iconfont.css'));
+}
 //技术资料excel展示
 const ExcelShow = (row) =>{
 	console.log("技术资料excel展示")

+ 210 - 124
src/view/performance/caiqiebaogong.vue

@@ -42,10 +42,6 @@
 		      	<el-col :span="2"><el-input v-model="add_formData['人员']" readonly style="width: 100%; height: 40px;"/></el-col>
 		      </el-row>
 			  
-			 
-
-				
-				
 					<el-row :gutter="0">
 						<el-col :span="2.5"><el-text style="font-size: 30px;margin-left: 90px;">尺 码</el-text></el-col>
 						<el-col :span="1" style="padding-right: 5px;margin-right: 11px;"><el-input v-model="cmformdata.cm1" id="cm1" readonly style="width: 65px;height: 40px;" /></el-col>
@@ -139,24 +135,43 @@
 							</el-table>
 						</el-tab-pane>
 						
+						<el-tab-pane label="订单资料附件" name="third">
+						  <el-table ref="multipleTable"
+						            :row-style="{ height: '30px' }"
+						            :cell-style="{ padding: '0px' }" :header-row-style="{ height: '30px' }"
+						            :header-cell-style="{ padding: '0px' }"
+						            :show-overflow-tooltip="true"
+						            :cell-class-name="planUsageCellClass"
+						            highlight-current-row="true"
+						            @row-dblclick="gdbomupdateCompanyFunc"
+						            style="width: 100%;height: 36vh" border tooltip-effect="dark" :data="ddtableData" row-key="ID"
+												   @selection-change="fjSelectionChange">
+							  <el-table-column align="left" label="关联编号" prop="关联编号"  width="115"/>
+							  <el-table-column align="left" label="备注" 	prop="附件备注"  width="110"/>
+							  <el-table-column align="left" label="文件类型" prop="附件类型"  width="100"/>
+							  <el-table-column align="left" label="建档时间" prop="sys_rq"  width="160"/>
+							  <el-table-column align="left" label="建档用户" prop="sys_id"  width="200"/>
+							  
+							  
+						  </el-table>
+						</el-tab-pane> 
 					
 					  <el-tab-pane label="技术附件" @click="showTable('技术附件')" name="fourth">
 					  	<el-table ref="multipleTable"
-								  :row-style="{ height: '20px' }"
-								  :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
-								  :header-cell-style="{ padding: '0px' }"
+								 :row-style="{ height: '30px' }"
+								 :cell-style="{ padding: '0px' }" :header-row-style="{ height: '30px' }"
+								 :header-cell-style="{ padding: '0px' }"
 								  :show-overflow-tooltip="true"
 								  :cell-class-name="planUsageCellClass"
 								  highlight-current-row="true"
 								  @row-dblclick="ExcelShow"
 								  style="width: 100%;height: 36vh" border tooltip-effect="dark" :data="jstableData" row-key="ID" @selection-change="handleSelectionChange">
 						  <!-- <el-table-column type="selection" width="55" /> -->
-					      <el-table-column align="left" label="备注" prop="附件备注"  width="120"/>
-					      <el-table-column align="left" label="文件类型" prop="附件类型"  width="120"/>
-					      <el-table-column align="left" label="关联产品" prop="关联编号"  width="120"/>
-					      <el-table-column align="left" label="建档用户" prop="sys_id"  width="120"/>
+					      <el-table-column align="left" label="关联编号" prop="关联编号"  width="115"/>
+					      <el-table-column align="left" label="备注" 	prop="附件备注"  width="110"/>
+					      <el-table-column align="left" label="文件类型" prop="附件类型"  width="100"/>
 					      <el-table-column align="left" label="建档时间" prop="sys_rq"  width="160"/>
-					      <el-table-column align="left" label="更新时间" prop="mod_rq"  width="120"/>
+					      <el-table-column align="left" label="建档用户" prop="sys_id"  width="200"/>
 					      </el-table>
 					    </el-tab-pane>
 					</el-tabs>
@@ -416,6 +431,7 @@ const _UniqId = ref('');
 const sizeDatas = reactive([])
 //技术附件
 const jstableData = reactive([])
+const ddtableData = reactive([])
 const _list = ref('');
 
 //查询
@@ -442,21 +458,28 @@ const add_onSubmit = async ()=>{
 	   ElMessage({type: 'warning',message: '此订单未出库,请先出库' })
 	   return false
 	 }
-	 setTimeout(() => {
-	 	  const inputElement = document.getElementById('scs1');
-	 	  if (inputElement) {
-	 		  inputElement.focus();		
-	 	  }
-	 }, 100);//100毫秒
-	 
+	 if(add_searchInfo.value === ''){
+		 //光标跳转搜索框
+		 _searchInput()
+	 }else{
+		 setTimeout(() => {
+		 	  const inputElement = document.getElementById('scs1');
+		 	  if (inputElement) {
+		 		  inputElement.focus();		
+		 	  }
+		 }, 100);//100毫秒
+		 
+	 }
+	
 	 sizeDatas.splice(0, getSpotLists.data.headers.length, ...getSpotLists.data.headers);
 	 jdhz_tableData.splice(0, jdhz_tableData.length, ...getSpotLists.data.table);
 	
-	//技术附件
+	//xlsx附件
 	const searchValue = add_searchInfo.value.split('-')[0];
 	const jsOrderAttachments = await OrderAttachments({order:searchValue,desc:'技术附件'})
+	const ddOrderAttachments = await OrderAttachments({order:searchValue,desc:'订单资料附件'})
 	jstableData.splice(0,jsOrderAttachments.data.length,...jsOrderAttachments.data);
-	
+	ddtableData.splice(0,ddOrderAttachments.data.length,...ddOrderAttachments.data);
 	_list.value = getSpotLists.data.list
 	_UniqId.value = getSpotLists.data.list.UniqId
 	
@@ -522,61 +545,158 @@ const add_onSubmit = async ()=>{
     return sums;  
 };  
 
-
+//订单资料excel展示
+const gdbomupdateCompanyFunc = (row) =>{
+	// 加载插件和样式
+	const loadScriptsAndStyles = () => {
+	    $.getScript('/luckysheet/plugins/js/plugin.js', () => {
+	        $script('/luckysheet/luckysheet.umd.js', () => {
+	            initializeLuckysheet();
+	        });
+	    });
+	
+	    const styles = [
+	        '/luckysheet/plugins/css/pluginsCss.css',
+	        '/luckysheet/plugins/plugins.css',
+	        '/luckysheet/css/luckysheet.css',
+	        '/luckysheet/assets/iconfont/iconfont.css'
+	    ];
+	
+	    styles.forEach(style => {
+	        $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', style));
+	    });
+	};
+	
+	// 初始化 Luckysheet
+	const initializeLuckysheet = () => {
+	    const callback = (exportJson, luckysheetfile) => {
+	        if (!exportJson.sheets || exportJson.sheets.length === 0) {
+	            alert("Failed to read the content of the excel file, currently does not support xls files!");
+	            return;
+	        }
+	        if (luckyExcel) luckyExcel.destroy();
+	        luckysheet.create({
+	            container: 'luckyexcel',
+	            data: exportJson.sheets,
+	            title: exportJson.info.name,
+	            lang: "zh",
+	            showtoolbar: false,
+	            showinfobar: false,
+	            allowEdit: false,
+	            enableAddRow: false,
+	            enableAddCol: false,
+	            userInfo: false,
+	            showRowBar: false,
+	            showColumnBar: false,
+	            sheetFormulaBar: false,
+	            enableAddBackTop: false,
+	        });
+	        luckyExcel = luckysheet;
+	    };
+	
+	    if (row['url'] === null || row['url'] === '') {
+	        const blob = dataURLtoBlob(row.附件内容);
+	        luckyexcelVisible.value = true;
+	        LuckyExcel.transformExcelToLucky(blob, callback);
+	    } else {
+	        const excelPath = `/${row.url.replace(/\\/g, "/")}`;
+	        const excelName = excelPath.split('/').pop();
+	        luckyexcelVisible.value = true;
+	        LuckyExcel.transformExcelToLuckyByUrl(excelPath, excelName, callback);
+	    }
+	};
+	
+	// Data URL 转 Blob
+	const dataURLtoBlob = (dataUrl) => {
+	    const byteString = atob(dataUrl.split(',')[1]);
+	    const ab = new ArrayBuffer(byteString.length);
+	    const ia = new Uint8Array(ab);
+	
+	    for (let i = 0; i < byteString.length; i++) {
+	        ia[i] = byteString.charCodeAt(i);
+	    }
+	
+	    return new Blob([ab], { type: 'application/octet-stream' });
+	};
+	
+	loadScriptsAndStyles();
+}
 //技术资料excel展示
 const ExcelShow = (row) =>{
-	console.log("技术资料excel展示")
-	console.log(row)
-	if(!row.附件内容) return
-	$.getScript('/luckysheet/plugins/js/plugin.js', () => {
-		$script('/luckysheet/luckysheet.umd.js', () => {
-					function dataURLtoBlob(dataUrl) {
-					    const byteString = atob(dataUrl.split(',')[1]);
-					    const ab = new ArrayBuffer(byteString.length);
-					    const ia = new Uint8Array(ab);
-
-					    for (let i = 0; i < byteString.length; i++) {
-					        ia[i] = byteString.charCodeAt(i);
-					    }
-
-					    return new Blob([ab], { type: 'application/octet-stream' });
-					}
-
-					const blob = dataURLtoBlob(row.附件内容);
-					luckyexcelVisible.value = true
-					LuckyExcel.transformExcelToLucky(blob, function(exportJson, luckysheetfile){
-						if(exportJson.sheets==null || exportJson.sheets.length==0){
-							alert("Failed to read the content of the excel file, currently does not support xls files!");
-							return;
-						}
-						if(luckyExcel) luckyExcel.destroy();
-						luckysheet.create({
-							container: 'luckyexcel', //容器的ID
-							data: exportJson.sheets,
-							title: exportJson.info.name, // 工作簿名称
-							lang: "zh", // 设定表格语言 国际化设置,允许设置表格的语言,支持中文("zh")和英文("en")
-							showtoolbar: false, // 是否显示工具栏
-							showinfobar: false, // 是否显示顶部信息栏
-							allowEdit: false, // 是否允许前台编辑
-							enableAddRow: false, // 允许增加行
-							enableAddCol: false, // 允许增加列
-							userInfo: false, // 右上角的用户信息展示样式
-							showRowBar: false, // 是否显示行号区域
-							showColumnBar: false, // 是否显示列号区域
-							sheetFormulaBar: false, // 是否显示公式栏
-							enableAddBackTop: false,//返回头部按钮
-						});
-						luckyExcel = luckysheet;
-					})
-		})
-	})
-	$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/css/pluginsCss.css'));
-	$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/plugins.css'));
-	$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/css/luckysheet.css'));
-	$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/assets/iconfont/iconfont.css'));
-
+	// 加载插件和样式
+	const loadScriptsAndStyles = () => {
+	    $.getScript('/luckysheet/plugins/js/plugin.js', () => {
+	        $script('/luckysheet/luckysheet.umd.js', () => {
+	            initializeLuckysheet();
+	        });
+	    });
+	
+	    const styles = [
+	        '/luckysheet/plugins/css/pluginsCss.css',
+	        '/luckysheet/plugins/plugins.css',
+	        '/luckysheet/css/luckysheet.css',
+	        '/luckysheet/assets/iconfont/iconfont.css'
+	    ];
+	
+	    styles.forEach(style => {
+	        $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', style));
+	    });
+	};
+	
+	// 初始化 Luckysheet
+	const initializeLuckysheet = () => {
+	    const callback = (exportJson, luckysheetfile) => {
+	        if (!exportJson.sheets || exportJson.sheets.length === 0) {
+	            alert("Failed to read the content of the excel file, currently does not support xls files!");
+	            return;
+	        }
+	        if (luckyExcel) luckyExcel.destroy();
+	        luckysheet.create({
+	            container: 'luckyexcel',
+	            data: exportJson.sheets,
+	            title: exportJson.info.name,
+	            lang: "zh",
+	            showtoolbar: false,
+	            showinfobar: false,
+	            allowEdit: false,
+	            enableAddRow: false,
+	            enableAddCol: false,
+	            userInfo: false,
+	            showRowBar: false,
+	            showColumnBar: false,
+	            sheetFormulaBar: false,
+	            enableAddBackTop: false,
+	        });
+	        luckyExcel = luckysheet;
+	    };
+	
+	    if (row['url'] === null || row['url'] === '') {
+	        const blob = dataURLtoBlob(row.附件内容);
+	        luckyexcelVisible.value = true;
+	        LuckyExcel.transformExcelToLucky(blob, callback);
+	    } else {
+	        const excelPath = `/${row.url.replace(/\\/g, "/")}`;
+	        const excelName = excelPath.split('/').pop();
+	        luckyexcelVisible.value = true;
+	        LuckyExcel.transformExcelToLuckyByUrl(excelPath, excelName, callback);
+	    }
+	};
+	
+	// Data URL 转 Blob
+	const dataURLtoBlob = (dataUrl) => {
+	    const byteString = atob(dataUrl.split(',')[1]);
+	    const ab = new ArrayBuffer(byteString.length);
+	    const ia = new Uint8Array(ab);
+	
+	    for (let i = 0; i < byteString.length; i++) {
+	        ia[i] = byteString.charCodeAt(i);
+	    }
+	
+	    return new Blob([ab], { type: 'application/octet-stream' });
+	};
+	
+	loadScriptsAndStyles();
 }
-
 let luckyExcel = null
 
 const luckyexcelVisible = ref(false)
@@ -588,9 +708,7 @@ const luckyexcelCloseDialog = () => {
 //表格行点击
 const tableRowClick = async (row)=>{
   add_searchInfo.value = row.子订单编号
-	// console.log(row)
 	_order.value = row.子订单编号
-  // add_onSubmit();
 }
 
 
@@ -603,7 +721,14 @@ const handleSelectionChange = (selection, type) => {
   ckSelection.value = ids.join(',')
   console.log(ckSelection.value)
 }
-
+const _searchInput = async ()=>{
+	setTimeout(() => {
+		const inputElement = document.getElementById('searchInput');
+			if (inputElement) {
+				inputElement.focus();		
+			}
+	}, 100);
+}
 //报工
 const add_Dialog = async ()=>{
 	if (!add_formData['机台号']) {
@@ -614,7 +739,7 @@ const add_Dialog = async ()=>{
 	    ElMessage({ type: 'warning', message: '请扫描子订单(条码)后,在进行报工' });
 	    return;
 	}
-	// 检查 scs1 到 scs10 是否都为空
+	// 检查新增实裁数是否都为空
 	const isAllEmpty = Array.from({ length: 10 }, (_, i) => scsformdata[`scs${i + 1}`]).every(value => !value);
 	if (isAllEmpty) {
 	    ElMessage({ type: 'warning', message: '请至少填写一个报工数据' });
@@ -672,42 +797,6 @@ const add_Dialog = async ()=>{
 			break; // 如果某个报工失败,则中断循环  
 		}
 	}
-	// return;
-	
-	
-	
-	
-	// // 记录每一次上报数据信息日志
-	// let datalog = {};
-	// datalog.code = _code;
-	// datalog.订单编号 = _list.value[0].订单编号;
-	// datalog.子订单编号 = _list.value[0].子订单编号;
-	// datalog.款号 = _list.value[0].款号;
-	// datalog.款式 = _list.value[0].款式;
-	// datalog.颜色 = _list.value[0].颜色;
-	// datalog.上报时间 = currentDate;
-	// //循环生成 cm1 到 cm20 的字段
-	// for (let i = 1; i <= 10; i++) {
-	//     datalog[`cm${i}`] = _list.value[0][`cm${i}`];
-	// }
-	// //循环生成 scsl1 到 scsl20 的字段
-	// for (let i = 1; i <= 10; i++) {
-	//     datalog[`scsl${i}`] = scsformdata[`scs${i}`];
-	// }
-	// // 记录总实裁数
-	// datalog.sctotal = scsformdata.sctotal;
-	// datalog.zdtotal = cmslformdata['zdtotal'];
-	// datalog['组别'] = add_formData['组别'];
-	// console.log(datalog)
-	// const getTabByGdbhs = await getTabByGdbh(datalog);
-	
-	// //光标跳转input框
-	// setTimeout(() => {
-	// 	const inputElement = document.getElementById('searchInput');
-	// 	if (inputElement) {
-	// 		inputElement.focus();		
-	// 	}
-	// }, 100); // 延迟100毫秒
 	  
 	//报工修改印件资料一条数据
 	if (_order.value.indexOf('-') !== -1) {
@@ -730,15 +819,15 @@ const add_Dialog = async ()=>{
 	    const baogong_getInfo = await getInfo(params);
 	   if (baogong_getInfo.code === 0) {
 	           ElMessage({ type: 'success', message: '报工成功' });
-			   setTimeout(() => {
-			   	const inputElement = document.getElementById('searchInput');
-			   	if (inputElement) {
-			   		inputElement.focus();		
-			   	}
-			   }, 100); // 延迟100毫秒
-	           // 清空表单数据
+			   //查询更新数据
+			   add_onSubmit()
+			   //光标跳转input
+			   _searchInput()
+			    // 清空搜索信息
+			   add_searchInfo.value = '';
+			   
+			   // 批量清空新增实裁数input数据
 	           if (scsformdata) {
-	               // 批量清空 scs1 到 scs10 和总和字段
 	               for (let i = 1; i <= 10; i++) {
 	                   scsformdata[`scs${i}`] = '';
 	               }
@@ -746,9 +835,6 @@ const add_Dialog = async ()=>{
 	           } else {
 	               console.error('scsformdata 未定义');
 	           }
-			   const getSpotLists = await getSpotList({ order: _order.value, code: _code});
-			   jdhz_tableData.splice(0, jdhz_tableData.length, ...getSpotLists.data.tale);
-	           add_searchInfo.value = ''; // 清空搜索信息
 	       } else {
 	           ElMessage({ type: 'error', message: '报工失败' });
 	       }

Plik diff jest za duży
+ 189 - 133
src/view/performance/chafengbaogong.vue


+ 3 - 3
src/view/performance/chukubaogong.vue

@@ -5,10 +5,10 @@
         <div class="gva-table-box">
 			<h1 style="margin: 0%;margin-bottom: 6px;">出库报工</h1>
 			<el-row :gutter="24" style="margin-bottom: 6px;">
-				  <el-input v-model="add_searchInfo" placeholder="请扫描子订单编号"
+				  <el-input v-model="add_searchInfo" placeholder="请扫描子订单编号条码"
 				  			  @keyup.enter="add_onSubmit"
 								  id="searchInput" 
-				  			  style="width: 220px;height: 50px;margin-left: 10px;">
+				  			  style="width: 250px;height: 50px;margin-left: 10px;">
 				  			  </el-input>
 				  <el-button type="primary" icon="search" @click="add_onSubmit" style="height: 50px;font-size: 20px;">查询</el-button>
 				  <el-button type="primary" icon="" @click="Restore_onSubmit" style="height: 50px;font-size: 20px;">恢复未出库</el-button>
@@ -239,7 +239,7 @@ const add_Dialogs = async () => {
 //恢复未出库按钮
 const Restore_onSubmit = async ()=>{
 	if(_orderid.value === '' || _orderid.value === null){
-		ElMessage({type: 'warning',message: '请点击选择恢复的子订单' })
+		ElMessage({type: 'warning',message: '请点击点击恢复的子订单编号' })
 	}else{
 		let params = {}
 		params.order_id = _orderid.value;

+ 192 - 74
src/view/performance/datangbaogong.vue

@@ -122,25 +122,42 @@
 									</el-table>
 								</el-tab-pane>
 								
-							  <el-tab-pane label="技术附件" @click="showTable('技术附件')" name="fourth">
-								<el-table ref="multipleTable"
-										  :row-style="{ height: '20px' }"
-										  :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
-										  :header-cell-style="{ padding: '0px' }"
-										  :show-overflow-tooltip="true"
-										  :cell-class-name="planUsageCellClass"
-										  highlight-current-row="true"
-										  @row-dblclick="ExcelShow"
-										  style="width: 100%;height: 36vh" border tooltip-effect="dark" :data="jstableData" row-key="ID" @selection-change="handleSelectionChange">
-								  <!-- <el-table-column type="selection" width="55" /> -->
-								  <el-table-column align="left" label="备注" prop="附件备注"  width="120"/>
-								  <el-table-column align="left" label="文件类型" prop="附件类型"  width="120"/>
-								  <el-table-column align="left" label="关联产品" prop="关联编号"  width="120"/>
-								  <el-table-column align="left" label="建档用户" prop="sys_id"  width="120"/>
-								  <el-table-column align="left" label="建档时间" prop="sys_rq"  width="160"/>
-								  <el-table-column align="left" label="更新时间" prop="mod_rq"  width="120"/>
-								  </el-table>
-								</el-tab-pane>
+							  <el-tab-pane label="订单资料附件" name="third">
+							    <el-table ref="multipleTable"
+							              :row-style="{ height: '30px' }"
+							              :cell-style="{ padding: '0px' }" :header-row-style="{ height: '30px' }"
+							              :header-cell-style="{ padding: '0px' }"
+							              :show-overflow-tooltip="true"
+							              :cell-class-name="planUsageCellClass"
+							              highlight-current-row="true"
+							              @row-dblclick="gdbomupdateCompanyFunc"
+							              style="width: 100%;height: 36vh" border tooltip-effect="dark" :data="ddtableData" row-key="ID"
+							  						   @selection-change="fjSelectionChange">
+							     <el-table-column align="left" label="关联编号" prop="关联编号"  width="115"/>
+							     <el-table-column align="left" label="备注" 	prop="附件备注"  width="110"/>
+							     <el-table-column align="left" label="文件类型" prop="附件类型"  width="100"/>
+							     <el-table-column align="left" label="建档时间" prop="sys_rq"  width="160"/>
+							     <el-table-column align="left" label="建档用户" prop="sys_id"  width="200"/>
+							    </el-table>
+							  </el-tab-pane> 
+							  
+							    <el-tab-pane label="技术附件"  name="fourth">
+							    	<el-table ref="multipleTable"
+							  			  :row-style="{ height: '30px' }"
+							  			  :cell-style="{ padding: '0px' }" :header-row-style="{ height: '30px' }"
+							  			  :header-cell-style="{ padding: '0px' }"
+							  			  :show-overflow-tooltip="true"
+							  			  :cell-class-name="planUsageCellClass"
+							  			  highlight-current-row="true"
+							  			  @row-dblclick="ExcelShow"
+							  			  style="width: 100%;height: 36vh" border tooltip-effect="dark" :data="jstableData" row-key="ID" @selection-change="handleSelectionChange">
+							  	 <el-table-column align="left" label="关联编号" prop="关联编号"  width="115"/>
+							  	 <el-table-column align="left" label="备注" 	prop="附件备注"  width="110"/>
+							  	 <el-table-column align="left" label="文件类型" prop="附件类型"  width="100"/>
+							  	 <el-table-column align="left" label="建档时间" prop="sys_rq"  width="160"/>
+							  	 <el-table-column align="left" label="建档用户" prop="sys_id"  width="200"/>
+							        </el-table>
+							      </el-tab-pane>
 							</el-tabs>
 						</el-row>
 					</el-main>
@@ -335,6 +352,7 @@ const searcs = ref('')
 const _order = ref('')
 //技术附件
 const jstableData = reactive([])
+const ddtableData = reactive([])
 const _list = ref('')
 
 // 查询按钮
@@ -382,65 +400,165 @@ const add_onSubmit = async ()=>{
 	 add_formData['剩余数量'] = getSpotLists.data.result.ci_num
 	 add_tableData.splice(0,add_tableData.length,...getSpotLists.data.records);
 	 
-	 //技术附件
-	 const searchValue = add_searchInfo.value.split('-')[0];
-	 const jsOrderAttachments = await OrderAttachments({order:searchValue,desc:'技术附件'})
-	 jstableData.splice(0,jsOrderAttachments.data.length,...jsOrderAttachments.data);
+	//xlsx附件
+	const searchValue = add_searchInfo.value.split('-')[0];
+	const jsOrderAttachments = await OrderAttachments({order:searchValue,desc:'技术附件'})
+	const ddOrderAttachments = await OrderAttachments({order:searchValue,desc:'订单资料附件'})
+	jstableData.splice(0,jsOrderAttachments.data.length,...jsOrderAttachments.data);
+	ddtableData.splice(0,ddOrderAttachments.data.length,...ddOrderAttachments.data);
 	 
 }
-
+//订单资料excel展示
+const gdbomupdateCompanyFunc = (row) =>{
+	// 加载插件和样式
+	const loadScriptsAndStyles = () => {
+	    $.getScript('/luckysheet/plugins/js/plugin.js', () => {
+	        $script('/luckysheet/luckysheet.umd.js', () => {
+	            initializeLuckysheet();
+	        });
+	    });
+	
+	    const styles = [
+	        '/luckysheet/plugins/css/pluginsCss.css',
+	        '/luckysheet/plugins/plugins.css',
+	        '/luckysheet/css/luckysheet.css',
+	        '/luckysheet/assets/iconfont/iconfont.css'
+	    ];
+	
+	    styles.forEach(style => {
+	        $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', style));
+	    });
+	};
+	
+	// 初始化 Luckysheet
+	const initializeLuckysheet = () => {
+	    const callback = (exportJson, luckysheetfile) => {
+	        if (!exportJson.sheets || exportJson.sheets.length === 0) {
+	            alert("Failed to read the content of the excel file, currently does not support xls files!");
+	            return;
+	        }
+	        if (luckyExcel) luckyExcel.destroy();
+	        luckysheet.create({
+	            container: 'luckyexcel',
+	            data: exportJson.sheets,
+	            title: exportJson.info.name,
+	            lang: "zh",
+	            showtoolbar: false,
+	            showinfobar: false,
+	            allowEdit: false,
+	            enableAddRow: false,
+	            enableAddCol: false,
+	            userInfo: false,
+	            showRowBar: false,
+	            showColumnBar: false,
+	            sheetFormulaBar: false,
+	            enableAddBackTop: false,
+	        });
+	        luckyExcel = luckysheet;
+	    };
+	
+	    if (row['url'] === null || row['url'] === '') {
+	        const blob = dataURLtoBlob(row.附件内容);
+	        luckyexcelVisible.value = true;
+	        LuckyExcel.transformExcelToLucky(blob, callback);
+	    } else {
+	        const excelPath = `/${row.url.replace(/\\/g, "/")}`;
+	        const excelName = excelPath.split('/').pop();
+	        luckyexcelVisible.value = true;
+	        LuckyExcel.transformExcelToLuckyByUrl(excelPath, excelName, callback);
+	    }
+	};
+	
+	// Data URL 转 Blob
+	const dataURLtoBlob = (dataUrl) => {
+	    const byteString = atob(dataUrl.split(',')[1]);
+	    const ab = new ArrayBuffer(byteString.length);
+	    const ia = new Uint8Array(ab);
+	
+	    for (let i = 0; i < byteString.length; i++) {
+	        ia[i] = byteString.charCodeAt(i);
+	    }
+	
+	    return new Blob([ab], { type: 'application/octet-stream' });
+	};
+	
+	loadScriptsAndStyles();
+}
 //技术资料excel展示
 const ExcelShow = (row) =>{
-	console.log("技术资料excel展示")
-	console.log(row)
-	if(!row.附件内容) return
-	$.getScript('/luckysheet/plugins/js/plugin.js', () => {
-		$script('/luckysheet/luckysheet.umd.js', () => {
-					function dataURLtoBlob(dataUrl) {
-					    const byteString = atob(dataUrl.split(',')[1]);
-					    const ab = new ArrayBuffer(byteString.length);
-					    const ia = new Uint8Array(ab);
-
-					    for (let i = 0; i < byteString.length; i++) {
-					        ia[i] = byteString.charCodeAt(i);
-					    }
-
-					    return new Blob([ab], { type: 'application/octet-stream' });
-					}
-
-					const blob = dataURLtoBlob(row.附件内容);
-					luckyexcelVisible.value = true
-					LuckyExcel.transformExcelToLucky(blob, function(exportJson, luckysheetfile){
-						if(exportJson.sheets==null || exportJson.sheets.length==0){
-							alert("Failed to read the content of the excel file, currently does not support xls files!");
-							return;
-						}
-						if(luckyExcel) luckyExcel.destroy();
-						luckysheet.create({
-							container: 'luckyexcel', //容器的ID
-							data: exportJson.sheets,
-							title: exportJson.info.name, // 工作簿名称
-							lang: "zh", // 设定表格语言 国际化设置,允许设置表格的语言,支持中文("zh")和英文("en")
-							showtoolbar: false, // 是否显示工具栏
-							showinfobar: false, // 是否显示顶部信息栏
-							allowEdit: false, // 是否允许前台编辑
-							enableAddRow: false, // 允许增加行
-							enableAddCol: false, // 允许增加列
-							userInfo: false, // 右上角的用户信息展示样式
-							showRowBar: false, // 是否显示行号区域
-							showColumnBar: false, // 是否显示列号区域
-							sheetFormulaBar: false, // 是否显示公式栏
-							enableAddBackTop: false,//返回头部按钮
-						});
-						luckyExcel = luckysheet;
-					})
-		})
-	})
-	$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/css/pluginsCss.css'));
-	$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/plugins.css'));
-	$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/css/luckysheet.css'));
-	$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/assets/iconfont/iconfont.css'));
-
+	// 加载插件和样式
+	const loadScriptsAndStyles = () => {
+	    $.getScript('/luckysheet/plugins/js/plugin.js', () => {
+	        $script('/luckysheet/luckysheet.umd.js', () => {
+	            initializeLuckysheet();
+	        });
+	    });
+	
+	    const styles = [
+	        '/luckysheet/plugins/css/pluginsCss.css',
+	        '/luckysheet/plugins/plugins.css',
+	        '/luckysheet/css/luckysheet.css',
+	        '/luckysheet/assets/iconfont/iconfont.css'
+	    ];
+	
+	    styles.forEach(style => {
+	        $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', style));
+	    });
+	};
+	
+	// 初始化 Luckysheet
+	const initializeLuckysheet = () => {
+	    const callback = (exportJson, luckysheetfile) => {
+	        if (!exportJson.sheets || exportJson.sheets.length === 0) {
+	            alert("Failed to read the content of the excel file, currently does not support xls files!");
+	            return;
+	        }
+	        if (luckyExcel) luckyExcel.destroy();
+	        luckysheet.create({
+	            container: 'luckyexcel',
+	            data: exportJson.sheets,
+	            title: exportJson.info.name,
+	            lang: "zh",
+	            showtoolbar: false,
+	            showinfobar: false,
+	            allowEdit: false,
+	            enableAddRow: false,
+	            enableAddCol: false,
+	            userInfo: false,
+	            showRowBar: false,
+	            showColumnBar: false,
+	            sheetFormulaBar: false,
+	            enableAddBackTop: false,
+	        });
+	        luckyExcel = luckysheet;
+	    };
+	
+	    if (row['url'] === null || row['url'] === '') {
+	        const blob = dataURLtoBlob(row.附件内容);
+	        luckyexcelVisible.value = true;
+	        LuckyExcel.transformExcelToLucky(blob, callback);
+	    } else {
+	        const excelPath = `/${row.url.replace(/\\/g, "/")}`;
+	        const excelName = excelPath.split('/').pop();
+	        luckyexcelVisible.value = true;
+	        LuckyExcel.transformExcelToLuckyByUrl(excelPath, excelName, callback);
+	    }
+	};
+	
+	// Data URL 转 Blob
+	const dataURLtoBlob = (dataUrl) => {
+	    const byteString = atob(dataUrl.split(',')[1]);
+	    const ab = new ArrayBuffer(byteString.length);
+	    const ia = new Uint8Array(ab);
+	
+	    for (let i = 0; i < byteString.length; i++) {
+	        ia[i] = byteString.charCodeAt(i);
+	    }
+	
+	    return new Blob([ab], { type: 'application/octet-stream' });
+	};
+	
+	loadScriptsAndStyles();
 }
 
 let luckyExcel = null

+ 194 - 83
src/view/performance/houdaoshougong.vue

@@ -107,40 +107,50 @@
 										highlight-current-row="true" tooltip-effect="dark"
 										@row-dblclick="add_updateCompanyFunc" @row-click="add_tableRowClick" @row-contextmenu="handleRightClick"
 										:show-overflow-tooltip="true" @selection-change="add_xpSelectionChange">
-									<!-- <el-table-column type="selection" width="70" /> -->
-									<el-table-column sortable align="left" label="流水号" prop="serial" width="100"/>
-									<el-table-column sortable align="left" label="报工时间" prop="sys_rq" width="160"/>
-									<el-table-column sortable align="left" label="订单编号" prop="订单编号" width="130"/>
-									<el-table-column sortable align="left" label="订单子编号" prop="子订单编号" width="140"/>
-									<el-table-column sortable align="left" label="款式" prop="款式" width="140"/>
-									<el-table-column sortable align="left" label="色系名称" prop="颜色" width="130"/>
-									<el-table-column sortable align="left" label="尺码" prop="尺码" width="110"/>
-									<el-table-column sortable align="left" label="数量" prop="数量" width="110"/>
-									<el-table-column sortable align="left" label="上报数量" prop="上报数量" width="110"/>
-									<el-table-column sortable align="left" label="是否尾包" prop="尾包" width="130"/>
-									<!-- <el-table-column sortable align="left" label="组别" prop="组别" width="130"/> -->
+									<el-table-column align="left" label="关联编号" prop="关联编号"  width="115"/>
+									<el-table-column align="left" label="备注" 	prop="附件备注"  width="110"/>
+									<el-table-column align="left" label="文件类型" prop="附件类型"  width="100"/>
+									<el-table-column align="left" label="建档时间" prop="sys_rq"  width="160"/>
+									<el-table-column align="left" label="建档用户" prop="sys_id"  width="200"/>
 									</el-table>
 								</el-tab-pane>
 								
-							  <el-tab-pane label="技术附件" @click="showTable('技术附件')" name="fourth">
-								<el-table ref="multipleTable"
-										  :row-style="{ height: '20px' }"
-										  :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
-										  :header-cell-style="{ padding: '0px' }"
-										  :show-overflow-tooltip="true"
-										  :cell-class-name="planUsageCellClass"
-										  highlight-current-row="true"
-										  @row-dblclick="ExcelShow"
-										  style="width: 100%;height: 36vh" border tooltip-effect="dark" :data="jstableData" row-key="ID" @selection-change="handleSelectionChange">
-								  <!-- <el-table-column type="selection" width="55" /> -->
-								  <el-table-column align="left" label="备注" prop="附件备注"  width="120"/>
-								  <el-table-column align="left" label="文件类型" prop="附件类型"  width="120"/>
-								  <el-table-column align="left" label="关联产品" prop="关联编号"  width="120"/>
-								  <el-table-column align="left" label="建档用户" prop="sys_id"  width="120"/>
-								  <el-table-column align="left" label="建档时间" prop="sys_rq"  width="160"/>
-								  <el-table-column align="left" label="更新时间" prop="mod_rq"  width="120"/>
-								  </el-table>
-								</el-tab-pane>
+							 <el-tab-pane label="订单资料附件" name="third">
+							   <el-table ref="multipleTable"
+							             :row-style="{ height: '30px' }"
+							             :cell-style="{ padding: '0px' }" :header-row-style="{ height: '30px' }"
+							             :header-cell-style="{ padding: '0px' }"
+							             :show-overflow-tooltip="true"
+							             :cell-class-name="planUsageCellClass"
+							             highlight-current-row="true"
+							             @row-dblclick="gdbomupdateCompanyFunc"
+							             style="width: 100%;height: 36vh" border tooltip-effect="dark" :data="ddtableData" row-key="ID"
+							 						   @selection-change="fjSelectionChange">
+							    <el-table-column align="left" label="关联编号" prop="关联编号"  width="115"/>
+							    <el-table-column align="left" label="备注" 	prop="附件备注"  width="110"/>
+							    <el-table-column align="left" label="文件类型" prop="附件类型"  width="100"/>
+							    <el-table-column align="left" label="建档时间" prop="sys_rq"  width="160"/>
+							    <el-table-column align="left" label="建档用户" prop="sys_id"  width="200"/>
+							   </el-table>
+							 </el-tab-pane> 
+							 
+							   <el-tab-pane label="技术附件"  name="fourth">
+							   	<el-table ref="multipleTable"
+							 			  :row-style="{ height: '30px' }"
+							 			  :cell-style="{ padding: '0px' }" :header-row-style="{ height: '30px' }"
+							 			  :header-cell-style="{ padding: '0px' }"
+							 			  :show-overflow-tooltip="true"
+							 			  :cell-class-name="planUsageCellClass"
+							 			  highlight-current-row="true"
+							 			  @row-dblclick="ExcelShow"
+							 			  style="width: 100%;height: 36vh" border tooltip-effect="dark" :data="jstableData" row-key="ID" @selection-change="handleSelectionChange">
+							 	 <el-table-column align="left" label="关联编号" prop="关联编号"  width="115"/>
+							 	 <el-table-column align="left" label="备注" 	prop="附件备注"  width="110"/>
+							 	 <el-table-column align="left" label="文件类型" prop="附件类型"  width="100"/>
+							 	 <el-table-column align="left" label="建档时间" prop="sys_rq"  width="160"/>
+							 	 <el-table-column align="left" label="建档用户" prop="sys_id"  width="200"/>
+							       </el-table>
+							     </el-tab-pane>
 							</el-tabs>
 						</el-row>
 					</el-main>
@@ -335,6 +345,7 @@ const searcs = ref('')
 const _order = ref('')
 //技术附件
 const jstableData = reactive([])
+const ddtableData = reactive([])
 const _list = ref('')
 
 // 查询按钮
@@ -382,65 +393,165 @@ const add_onSubmit = async ()=>{
 	 add_formData['剩余数量'] = getSpotLists.data.result.ci_num
 	 add_tableData.splice(0,add_tableData.length,...getSpotLists.data.records);
 	 
-	 //技术附件
+	 //xlsx附件
 	 const searchValue = add_searchInfo.value.split('-')[0];
 	 const jsOrderAttachments = await OrderAttachments({order:searchValue,desc:'技术附件'})
+	 const ddOrderAttachments = await OrderAttachments({order:searchValue,desc:'订单资料附件'})
 	 jstableData.splice(0,jsOrderAttachments.data.length,...jsOrderAttachments.data);
+	 ddtableData.splice(0,ddOrderAttachments.data.length,...ddOrderAttachments.data);
 	 
 }
-
+//订单资料excel展示
+const gdbomupdateCompanyFunc = (row) =>{
+// 加载插件和样式
+	const loadScriptsAndStyles = () => {
+	    $.getScript('/luckysheet/plugins/js/plugin.js', () => {
+	        $script('/luckysheet/luckysheet.umd.js', () => {
+	            initializeLuckysheet();
+	        });
+	    });
+	
+	    const styles = [
+	        '/luckysheet/plugins/css/pluginsCss.css',
+	        '/luckysheet/plugins/plugins.css',
+	        '/luckysheet/css/luckysheet.css',
+	        '/luckysheet/assets/iconfont/iconfont.css'
+	    ];
+	
+	    styles.forEach(style => {
+	        $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', style));
+	    });
+	};
+	
+	// 初始化 Luckysheet
+	const initializeLuckysheet = () => {
+	    const callback = (exportJson, luckysheetfile) => {
+	        if (!exportJson.sheets || exportJson.sheets.length === 0) {
+	            alert("Failed to read the content of the excel file, currently does not support xls files!");
+	            return;
+	        }
+	        if (luckyExcel) luckyExcel.destroy();
+	        luckysheet.create({
+	            container: 'luckyexcel',
+	            data: exportJson.sheets,
+	            title: exportJson.info.name,
+	            lang: "zh",
+	            showtoolbar: false,
+	            showinfobar: false,
+	            allowEdit: false,
+	            enableAddRow: false,
+	            enableAddCol: false,
+	            userInfo: false,
+	            showRowBar: false,
+	            showColumnBar: false,
+	            sheetFormulaBar: false,
+	            enableAddBackTop: false,
+	        });
+	        luckyExcel = luckysheet;
+	    };
+	
+	    if (row['url'] === null || row['url'] === '') {
+	        const blob = dataURLtoBlob(row.附件内容);
+	        luckyexcelVisible.value = true;
+	        LuckyExcel.transformExcelToLucky(blob, callback);
+	    } else {
+	        const excelPath = `/${row.url.replace(/\\/g, "/")}`;
+	        const excelName = excelPath.split('/').pop();
+	        luckyexcelVisible.value = true;
+	        LuckyExcel.transformExcelToLuckyByUrl(excelPath, excelName, callback);
+	    }
+	};
+	
+	// Data URL 转 Blob
+	const dataURLtoBlob = (dataUrl) => {
+	    const byteString = atob(dataUrl.split(',')[1]);
+	    const ab = new ArrayBuffer(byteString.length);
+	    const ia = new Uint8Array(ab);
+	
+	    for (let i = 0; i < byteString.length; i++) {
+	        ia[i] = byteString.charCodeAt(i);
+	    }
+	
+	    return new Blob([ab], { type: 'application/octet-stream' });
+	};
+	
+	loadScriptsAndStyles();
+}
 //技术资料excel展示
 const ExcelShow = (row) =>{
-	console.log("技术资料excel展示")
-	console.log(row)
-	if(!row.附件内容) return
-	$.getScript('/luckysheet/plugins/js/plugin.js', () => {
-		$script('/luckysheet/luckysheet.umd.js', () => {
-					function dataURLtoBlob(dataUrl) {
-					    const byteString = atob(dataUrl.split(',')[1]);
-					    const ab = new ArrayBuffer(byteString.length);
-					    const ia = new Uint8Array(ab);
-
-					    for (let i = 0; i < byteString.length; i++) {
-					        ia[i] = byteString.charCodeAt(i);
-					    }
-
-					    return new Blob([ab], { type: 'application/octet-stream' });
-					}
-
-					const blob = dataURLtoBlob(row.附件内容);
-					luckyexcelVisible.value = true
-					LuckyExcel.transformExcelToLucky(blob, function(exportJson, luckysheetfile){
-						if(exportJson.sheets==null || exportJson.sheets.length==0){
-							alert("Failed to read the content of the excel file, currently does not support xls files!");
-							return;
-						}
-						if(luckyExcel) luckyExcel.destroy();
-						luckysheet.create({
-							container: 'luckyexcel', //容器的ID
-							data: exportJson.sheets,
-							title: exportJson.info.name, // 工作簿名称
-							lang: "zh", // 设定表格语言 国际化设置,允许设置表格的语言,支持中文("zh")和英文("en")
-							showtoolbar: false, // 是否显示工具栏
-							showinfobar: false, // 是否显示顶部信息栏
-							allowEdit: false, // 是否允许前台编辑
-							enableAddRow: false, // 允许增加行
-							enableAddCol: false, // 允许增加列
-							userInfo: false, // 右上角的用户信息展示样式
-							showRowBar: false, // 是否显示行号区域
-							showColumnBar: false, // 是否显示列号区域
-							sheetFormulaBar: false, // 是否显示公式栏
-							enableAddBackTop: false,//返回头部按钮
-						});
-						luckyExcel = luckysheet;
-					})
-		})
-	})
-	$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/css/pluginsCss.css'));
-	$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/plugins.css'));
-	$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/css/luckysheet.css'));
-	$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/assets/iconfont/iconfont.css'));
-
+	// 加载插件和样式
+	const loadScriptsAndStyles = () => {
+	    $.getScript('/luckysheet/plugins/js/plugin.js', () => {
+	        $script('/luckysheet/luckysheet.umd.js', () => {
+	            initializeLuckysheet();
+	        });
+	    });
+	
+	    const styles = [
+	        '/luckysheet/plugins/css/pluginsCss.css',
+	        '/luckysheet/plugins/plugins.css',
+	        '/luckysheet/css/luckysheet.css',
+	        '/luckysheet/assets/iconfont/iconfont.css'
+	    ];
+	
+	    styles.forEach(style => {
+	        $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', style));
+	    });
+	};
+	
+	// 初始化 Luckysheet
+	const initializeLuckysheet = () => {
+	    const callback = (exportJson, luckysheetfile) => {
+	        if (!exportJson.sheets || exportJson.sheets.length === 0) {
+	            alert("Failed to read the content of the excel file, currently does not support xls files!");
+	            return;
+	        }
+	        if (luckyExcel) luckyExcel.destroy();
+	        luckysheet.create({
+	            container: 'luckyexcel',
+	            data: exportJson.sheets,
+	            title: exportJson.info.name,
+	            lang: "zh",
+	            showtoolbar: false,
+	            showinfobar: false,
+	            allowEdit: false,
+	            enableAddRow: false,
+	            enableAddCol: false,
+	            userInfo: false,
+	            showRowBar: false,
+	            showColumnBar: false,
+	            sheetFormulaBar: false,
+	            enableAddBackTop: false,
+	        });
+	        luckyExcel = luckysheet;
+	    };
+	
+	    if (row['url'] === null || row['url'] === '') {
+	        const blob = dataURLtoBlob(row.附件内容);
+	        luckyexcelVisible.value = true;
+	        LuckyExcel.transformExcelToLucky(blob, callback);
+	    } else {
+	        const excelPath = `/${row.url.replace(/\\/g, "/")}`;
+	        const excelName = excelPath.split('/').pop();
+	        luckyexcelVisible.value = true;
+	        LuckyExcel.transformExcelToLuckyByUrl(excelPath, excelName, callback);
+	    }
+	};
+	
+	// Data URL 转 Blob
+	const dataURLtoBlob = (dataUrl) => {
+	    const byteString = atob(dataUrl.split(',')[1]);
+	    const ab = new ArrayBuffer(byteString.length);
+	    const ia = new Uint8Array(ab);
+	
+	    for (let i = 0; i < byteString.length; i++) {
+	        ia[i] = byteString.charCodeAt(i);
+	    }
+	
+	    return new Blob([ab], { type: 'application/octet-stream' });
+	};
+	
+	loadScriptsAndStyles();
 }
 
 let luckyExcel = null

+ 183 - 65
src/view/performance/zongjianbaogong.vue

@@ -122,25 +122,42 @@
 									</el-table>
 								</el-tab-pane>
 								
-							  <el-tab-pane label="技术附件" @click="showTable('技术附件')" name="fourth">
-								<el-table ref="multipleTable"
-										  :row-style="{ height: '20px' }"
-										  :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
+							<el-tab-pane label="订单资料附件" name="third">
+							  <el-table ref="multipleTable"
+							            :row-style="{ height: '30px' }"
+							            :cell-style="{ padding: '0px' }" :header-row-style="{ height: '30px' }"
+							            :header-cell-style="{ padding: '0px' }"
+							            :show-overflow-tooltip="true"
+							            :cell-class-name="planUsageCellClass"
+							            highlight-current-row="true"
+							            @row-dblclick="gdbomupdateCompanyFunc"
+							            style="width: 100%;height: 36vh" border tooltip-effect="dark" :data="ddtableData" row-key="ID"
+													   @selection-change="fjSelectionChange">
+							   <el-table-column align="left" label="关联编号" prop="关联编号"  width="115"/>
+							   <el-table-column align="left" label="备注" 	prop="附件备注"  width="110"/>
+							   <el-table-column align="left" label="文件类型" prop="附件类型"  width="100"/>
+							   <el-table-column align="left" label="建档时间" prop="sys_rq"  width="160"/>
+							   <el-table-column align="left" label="建档用户" prop="sys_id"  width="200"/>
+							  </el-table>
+							</el-tab-pane> 
+							
+							  <el-tab-pane label="技术附件"  name="fourth">
+							  	<el-table ref="multipleTable"
+										  :row-style="{ height: '30px' }"
+										  :cell-style="{ padding: '0px' }" :header-row-style="{ height: '30px' }"
 										  :header-cell-style="{ padding: '0px' }"
 										  :show-overflow-tooltip="true"
 										  :cell-class-name="planUsageCellClass"
 										  highlight-current-row="true"
 										  @row-dblclick="ExcelShow"
 										  style="width: 100%;height: 36vh" border tooltip-effect="dark" :data="jstableData" row-key="ID" @selection-change="handleSelectionChange">
-								  <!-- <el-table-column type="selection" width="55" /> -->
-								  <el-table-column align="left" label="备注" prop="附件备注"  width="120"/>
-								  <el-table-column align="left" label="文件类型" prop="附件类型"  width="120"/>
-								  <el-table-column align="left" label="关联产品" prop="关联编号"  width="120"/>
-								  <el-table-column align="left" label="建档用户" prop="sys_id"  width="120"/>
-								  <el-table-column align="left" label="建档时间" prop="sys_rq"  width="160"/>
-								  <el-table-column align="left" label="更新时间" prop="mod_rq"  width="120"/>
-								  </el-table>
-								</el-tab-pane>
+								 <el-table-column align="left" label="关联编号" prop="关联编号"  width="115"/>
+								 <el-table-column align="left" label="备注" 	prop="附件备注"  width="110"/>
+								 <el-table-column align="left" label="文件类型" prop="附件类型"  width="100"/>
+								 <el-table-column align="left" label="建档时间" prop="sys_rq"  width="160"/>
+								 <el-table-column align="left" label="建档用户" prop="sys_id"  width="200"/>
+							      </el-table>
+							    </el-tab-pane>
 							</el-tabs>
 						</el-row>
 					</el-main>
@@ -335,6 +352,7 @@ const searcs = ref('')
 const _order = ref('')
 //技术附件
 const jstableData = reactive([])
+const ddtableData = reactive([])
 const _list = ref('')
 
 // 查询按钮
@@ -382,65 +400,165 @@ const add_onSubmit = async ()=>{
 	 add_formData['剩余数量'] = getSpotLists.data.result.ci_num
 	 add_tableData.splice(0,add_tableData.length,...getSpotLists.data.records);
 	 
-	 //技术附件
+	 //xlsx附件
 	 const searchValue = add_searchInfo.value.split('-')[0];
 	 const jsOrderAttachments = await OrderAttachments({order:searchValue,desc:'技术附件'})
+	 const ddOrderAttachments = await OrderAttachments({order:searchValue,desc:'订单资料附件'})
 	 jstableData.splice(0,jsOrderAttachments.data.length,...jsOrderAttachments.data);
+	 ddtableData.splice(0,ddOrderAttachments.data.length,...ddOrderAttachments.data);
 	 
 }
-
+//订单资料excel展示
+const gdbomupdateCompanyFunc = (row) =>{
+	// 加载插件和样式
+	const loadScriptsAndStyles = () => {
+	    $.getScript('/luckysheet/plugins/js/plugin.js', () => {
+	        $script('/luckysheet/luckysheet.umd.js', () => {
+	            initializeLuckysheet();
+	        });
+	    });
+	
+	    const styles = [
+	        '/luckysheet/plugins/css/pluginsCss.css',
+	        '/luckysheet/plugins/plugins.css',
+	        '/luckysheet/css/luckysheet.css',
+	        '/luckysheet/assets/iconfont/iconfont.css'
+	    ];
+	
+	    styles.forEach(style => {
+	        $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', style));
+	    });
+	};
+	
+	// 初始化 Luckysheet
+	const initializeLuckysheet = () => {
+	    const callback = (exportJson, luckysheetfile) => {
+	        if (!exportJson.sheets || exportJson.sheets.length === 0) {
+	            alert("Failed to read the content of the excel file, currently does not support xls files!");
+	            return;
+	        }
+	        if (luckyExcel) luckyExcel.destroy();
+	        luckysheet.create({
+	            container: 'luckyexcel',
+	            data: exportJson.sheets,
+	            title: exportJson.info.name,
+	            lang: "zh",
+	            showtoolbar: false,
+	            showinfobar: false,
+	            allowEdit: false,
+	            enableAddRow: false,
+	            enableAddCol: false,
+	            userInfo: false,
+	            showRowBar: false,
+	            showColumnBar: false,
+	            sheetFormulaBar: false,
+	            enableAddBackTop: false,
+	        });
+	        luckyExcel = luckysheet;
+	    };
+	
+	    if (row['url'] === null || row['url'] === '') {
+	        const blob = dataURLtoBlob(row.附件内容);
+	        luckyexcelVisible.value = true;
+	        LuckyExcel.transformExcelToLucky(blob, callback);
+	    } else {
+	        const excelPath = `/${row.url.replace(/\\/g, "/")}`;
+	        const excelName = excelPath.split('/').pop();
+	        luckyexcelVisible.value = true;
+	        LuckyExcel.transformExcelToLuckyByUrl(excelPath, excelName, callback);
+	    }
+	};
+	
+	// Data URL 转 Blob
+	const dataURLtoBlob = (dataUrl) => {
+	    const byteString = atob(dataUrl.split(',')[1]);
+	    const ab = new ArrayBuffer(byteString.length);
+	    const ia = new Uint8Array(ab);
+	
+	    for (let i = 0; i < byteString.length; i++) {
+	        ia[i] = byteString.charCodeAt(i);
+	    }
+	
+	    return new Blob([ab], { type: 'application/octet-stream' });
+	};
+	
+	loadScriptsAndStyles();
+}
 //技术资料excel展示
 const ExcelShow = (row) =>{
-	console.log("技术资料excel展示")
-	console.log(row)
-	if(!row.附件内容) return
-	$.getScript('/luckysheet/plugins/js/plugin.js', () => {
-		$script('/luckysheet/luckysheet.umd.js', () => {
-					function dataURLtoBlob(dataUrl) {
-					    const byteString = atob(dataUrl.split(',')[1]);
-					    const ab = new ArrayBuffer(byteString.length);
-					    const ia = new Uint8Array(ab);
-
-					    for (let i = 0; i < byteString.length; i++) {
-					        ia[i] = byteString.charCodeAt(i);
-					    }
-
-					    return new Blob([ab], { type: 'application/octet-stream' });
-					}
-
-					const blob = dataURLtoBlob(row.附件内容);
-					luckyexcelVisible.value = true
-					LuckyExcel.transformExcelToLucky(blob, function(exportJson, luckysheetfile){
-						if(exportJson.sheets==null || exportJson.sheets.length==0){
-							alert("Failed to read the content of the excel file, currently does not support xls files!");
-							return;
-						}
-						if(luckyExcel) luckyExcel.destroy();
-						luckysheet.create({
-							container: 'luckyexcel', //容器的ID
-							data: exportJson.sheets,
-							title: exportJson.info.name, // 工作簿名称
-							lang: "zh", // 设定表格语言 国际化设置,允许设置表格的语言,支持中文("zh")和英文("en")
-							showtoolbar: false, // 是否显示工具栏
-							showinfobar: false, // 是否显示顶部信息栏
-							allowEdit: false, // 是否允许前台编辑
-							enableAddRow: false, // 允许增加行
-							enableAddCol: false, // 允许增加列
-							userInfo: false, // 右上角的用户信息展示样式
-							showRowBar: false, // 是否显示行号区域
-							showColumnBar: false, // 是否显示列号区域
-							sheetFormulaBar: false, // 是否显示公式栏
-							enableAddBackTop: false,//返回头部按钮
-						});
-						luckyExcel = luckysheet;
-					})
-		})
-	})
-	$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/css/pluginsCss.css'));
-	$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/plugins.css'));
-	$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/css/luckysheet.css'));
-	$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/assets/iconfont/iconfont.css'));
-
+// 加载插件和样式
+	const loadScriptsAndStyles = () => {
+	    $.getScript('/luckysheet/plugins/js/plugin.js', () => {
+	        $script('/luckysheet/luckysheet.umd.js', () => {
+	            initializeLuckysheet();
+	        });
+	    });
+	
+	    const styles = [
+	        '/luckysheet/plugins/css/pluginsCss.css',
+	        '/luckysheet/plugins/plugins.css',
+	        '/luckysheet/css/luckysheet.css',
+	        '/luckysheet/assets/iconfont/iconfont.css'
+	    ];
+	
+	    styles.forEach(style => {
+	        $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', style));
+	    });
+	};
+	
+	// 初始化 Luckysheet
+	const initializeLuckysheet = () => {
+	    const callback = (exportJson, luckysheetfile) => {
+	        if (!exportJson.sheets || exportJson.sheets.length === 0) {
+	            alert("Failed to read the content of the excel file, currently does not support xls files!");
+	            return;
+	        }
+	        if (luckyExcel) luckyExcel.destroy();
+	        luckysheet.create({
+	            container: 'luckyexcel',
+	            data: exportJson.sheets,
+	            title: exportJson.info.name,
+	            lang: "zh",
+	            showtoolbar: false,
+	            showinfobar: false,
+	            allowEdit: false,
+	            enableAddRow: false,
+	            enableAddCol: false,
+	            userInfo: false,
+	            showRowBar: false,
+	            showColumnBar: false,
+	            sheetFormulaBar: false,
+	            enableAddBackTop: false,
+	        });
+	        luckyExcel = luckysheet;
+	    };
+	
+	    if (row['url'] === null || row['url'] === '') {
+	        const blob = dataURLtoBlob(row.附件内容);
+	        luckyexcelVisible.value = true;
+	        LuckyExcel.transformExcelToLucky(blob, callback);
+	    } else {
+	        const excelPath = `/${row.url.replace(/\\/g, "/")}`;
+	        const excelName = excelPath.split('/').pop();
+	        luckyexcelVisible.value = true;
+	        LuckyExcel.transformExcelToLuckyByUrl(excelPath, excelName, callback);
+	    }
+	};
+	
+	// Data URL 转 Blob
+	const dataURLtoBlob = (dataUrl) => {
+	    const byteString = atob(dataUrl.split(',')[1]);
+	    const ab = new ArrayBuffer(byteString.length);
+	    const ia = new Uint8Array(ab);
+	
+	    for (let i = 0; i < byteString.length; i++) {
+	        ia[i] = byteString.charCodeAt(i);
+	    }
+	
+	    return new Blob([ab], { type: 'application/octet-stream' });
+	};
+	
+	loadScriptsAndStyles();
 }
 
 let luckyExcel = null

+ 47 - 46
src/view/yunyin/shengchanguanli/baogongshuju.vue

@@ -204,16 +204,16 @@
         // 确定按钮的逻辑
         // 在这里可以执行提交表单的逻辑
       },
-      handleFileUpload(event) {
-        // 处理文件上传逻辑
-        const file = event.target.files[0];
-        console.log(file)
-        // 模拟上传并保存文件路径
-        // 在实际应用中,您需要将文件上传到服务器并保存路径
-        this.formDataTest.imageUrl = URL.createObjectURL(file);
-        // 手动触发Vue的更新
-        this.$forceUpdate();
-      }
+      // handleFileUpload(event) {
+      //   // 处理文件上传逻辑
+      //   const file = event.target.files[0];
+      //   // console.log(file)
+      //   // 模拟上传并保存文件路径
+      //   // 在实际应用中,您需要将文件上传到服务器并保存路径
+      //   this.formDataTest.imageUrl = URL.createObjectURL(file);
+      //   // 手动触发Vue的更新
+      //   this.$forceUpdate();
+      // }
     }
   };
 </script>
@@ -227,11 +227,13 @@ import {MachineList,MachineDetail,getOneWorkOrder,spotcheckdel,ProcessDetailDel}
 import {ElMessage} from "element-plus";
 import { useUserStore } from '@/pinia/modules/user';
 defineOptions({name: 'Company'})
+
 //获取登录用户信息
 const userStore = useUserStore()
 const _username = ref('')
 _username.value = userStore.userInfo.userName + '/' + userStore.userInfo.nickName
 console.log('获取用户名称',_username.value)
+
 //全局获取当前日期
 const today = new Date();
 const year = today.getFullYear();
@@ -242,17 +244,16 @@ const minutes = String(today.getMinutes()).padStart(2, '0');
 const seconds = String(today.getSeconds()).padStart(2, '0');
 const currentDate = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
 const currentDates = `${year}-${month}-${day}`;
+const currentDatess = `${month}`;
 const treeData = ref([]);
- 
 
+//左侧菜单栏
 const DataListdata = async () => {
   try {
     const response = await MachineList(); // 假设 MachineList 是一个已定义的 API 请求函数
     const data = response.data;
-    
     // 初始化树形结构数据
     treeData.value = [];
-
     // 遍历 data 对象
     for (const [yearMonth, machineList] of Object.entries(data)) {
       // 创建一个新的一级节点(年月)
@@ -260,7 +261,6 @@ const DataListdata = async () => {
         label: yearMonth,  // 年月作为一级节点
         children: []  // 二级节点的容器
       };
-
       // 遍历每个生产工序
       for (const [process, machines] of Object.entries(machineList)) {
         // 创建一个新的二级节点(生产工序)
@@ -268,7 +268,6 @@ const DataListdata = async () => {
           label: process,  // 生产工序作为二级节点
           children: []  // 机器信息的容器
         };
-
         // 遍历每个机器编号及其日期
         for (const [machine, dates] of Object.entries(machines)) {
           // 创建一个三级节点(机器编号)
@@ -276,26 +275,22 @@ const DataListdata = async () => {
             label: machine,  // 机器编号作为三级节点
             children: dates.map(date => ({ label: date, parent: null }))  // 日期作为四级节点
           };
-
           // 为每个日期节点添加 `parent` 属性指向机器节点
           machineNode.children.forEach(dateNode => {
             dateNode.parent = machineNode;
           });
-
           // 将机器节点的 `parent` 指向生产工序节点
           machineNode.parent = processNode;
-
           // 将该机器节点添加到对应的生产工序下
           processNode.children.push(machineNode);
         }
-
+        // 对 `processNode.children` 按机器编号排序
+        processNode.children.sort((a, b) => a.label.localeCompare(b.label, 'zh'));
         // 将生产工序节点的 `parent` 指向年月节点
         processNode.parent = yearMonthNode;
-
         // 将生产工序节点添加到对应的年月节点下
         yearMonthNode.children.push(processNode);
       }
-
       // 将年月节点添加到树形结构的根节点
       treeData.value.push(yearMonthNode);
     }
@@ -305,13 +300,12 @@ const DataListdata = async () => {
 };
 DataListdata();
   
-// 点击左侧树形 获取右侧 table 列表
 const tableData = reactive([]);
 const _Machine = ref('');
 const _Machine_riqi = ref('');
 let parentGroup = '';
 
-// 左侧树形节点点击事件
+//左侧树形节点点击事件
 const handleNodeClick = async (node) => {
   // 重置所有节点颜色
   document.querySelectorAll('.treecolor .el-tree-node').forEach(node => {
@@ -331,15 +325,15 @@ const handleNodeClick = async (node) => {
   if (!node.children || node.children.length === 0) {  // 底层日期节点
     _Machine_riqi.value = node.label;  // 设置日期
     const parentNode = node.parent;
-
     // 获取机台名称
     if (parentNode && parentNode.label.includes('--')) {
       _Machine.value = parentNode.label.split('--')[0];  // 获取机台名
     }
   } else {  
+	  console.log(1)
     // 非日期节点时清空 _Machine 和 _Machine_riqi
-    _Machine.value = '';
-    _Machine_riqi.value = '';
+    _Machine.value = node.label.split('--')[0];
+    _Machine_riqi.value = currentDatess;
   }
 
   // 调用获取员工列表的函数
@@ -365,7 +359,7 @@ const onSubmit = () => {
 const sizeDatas = reactive([])
 //调用报工数据接口
 const _getStaffList = async ()=>{
-	console.log(_Machine.value)
+	console.log("机台",_Machine.value)
 	console.log("日期",_Machine_riqi.value)
   try {
 	  const WorkListdata = await MachineDetail({machine:_Machine.value,date:_Machine_riqi.value,order:searchInfo.value});
@@ -383,40 +377,47 @@ const _getStaffList = async ()=>{
 }
 }
 
-  //合计
-  const getSummaries = (param) => {  
+//合计
+// 合计函数
+const getSummaries = (param) => {  
     const { columns, data } = param;  
     const sums = {};  
-	//选择你希望合计的列
-    const summableLabels = [...sizeDatas,];
+    const summableLabels = [...sizeDatas];  // 需要合计的尺码列
+    let grandTotal = 0;  // 用于保存所有尺码总计的最终汇总
+
     columns.forEach((column, index) => {  
         if (index === 1) {  
             sums[index] = '总数量合计';  
             return;  
         }  
-  
+
         if (summableLabels.includes(column.label)) {  
             const values = data.map(item => Number(item[column.property]));  
-  
-            // 检查数组中是否所有值都是 NaN  
-            if (!values.every(value => isNaN(value))) {  
-                sums[index] = values.reduce((prev, curr) => {  
+
+            // 检查数组中是否存在非 NaN 的数值
+            if (values.some(value => !isNaN(value))) {  
+                // 累加数值,跳过 NaN
+                const columnTotal = values.reduce((prev, curr) => {  
                     const value = Number(curr);  
-                    if (!isNaN(value)) {  
-                        return prev + value; 
-                    }  
-                    return prev;  
-                }, 0);  
-                // 如果需要,可以在这里添加单位  
-                // sums[index] += ' 件';  
+                    return !isNaN(value) ? prev + value : prev;  
+                }, 0);
+
+                sums[index] = columnTotal;  // 设置每个尺码列的总计
+                grandTotal += columnTotal;  // 将当前列的总计加入汇总
             } else {  
-                 sums[index] = '';  
+                sums[index] = '';  
             }  
         }  
     });  
-  
+
+    // 将汇总的总数量放在“上报时间”列下方
+    const reportTimeIndex = columns.findIndex(col => col.label === '上报时间');
+    sums[reportTimeIndex] = grandTotal;
+
     return sums;  
-};  
+};
+
+
 //=========查询产量进度表============
 const statusExceldialog = ref(false)
 const ExcelformData = ref({})

Plik diff jest za duży
+ 15 - 295
src/view/yunyin/shengchanguanli/components/print.vue


+ 279 - 147
src/view/yunyin/shengchanguanli/gongdanziliao.vue

@@ -8,11 +8,11 @@
             <el-form-item>
               <el-input v-model="searchInfo"  placeholder="搜索订单编号" style="width: 180px;" @keyup.enter="onSubmit()"></el-input>
               <el-button type="primary" icon="search" @click="onSubmit" title="搜索"  ></el-button>
+			  <el-button type="primary" icon="edit"   @click="cp_gdprintonClick" class="bt" title="打印生产订单" >订单打印</el-button>
               <el-button type="primary" class="bt" icon="edit"  @click="jsfjClick">附件上传</el-button>
               <el-button type="primary" icon="edit"   @click="addgd_onclick"   class="bt"   title="新增工单资料">新增订单资料</el-button>
               <el-button type="primary" icon="edit"   @click="addgdyj_onclick"   class="bt" title="新增颜色资料">新增颜色资料</el-button>
               <el-button type="primary" icon="edit"   @click="addgdgy_onclick"   class="bt" title="新增工序资料" >新增工序资料</el-button>
-              <el-button type="primary" icon="edit"   @click="cp_gdprintonClick" class="bt" title="打印生产订单" >订单打印</el-button>
               <el-button type="primary" icon="edit"   @click="del_ddzlClick" 	v-if="table_del=== true" :disabled="table_Selection === ''"  class="bt" title="删除订单资料"  >删除订单资料</el-button>
               <el-button type="primary" icon="edit"   @click="delgd_delclick" 	v-if="delall=== true" :disabled="ysSelection === '' && gySelection === ''"  class="bt"   >删除颜色工艺资料</el-button>
 			</el-form-item>
@@ -127,10 +127,10 @@
                 </el-table>
               </el-tab-pane>
 
-              <el-tab-pane label="订单资料附件" @click="showTable('订单资料附件')" name="third">
+              <el-tab-pane label="订单资料附件" name="third">
                 <el-table ref="multipleTable"
-                          :row-style="{ height: '20px' }"
-                          :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
+                          :row-style="{ height: '30px' }"
+                          :cell-style="{ padding: '0px' }" :header-row-style="{ height: '30px' }"
                           :header-cell-style="{ padding: '0px' }"
                           :show-overflow-tooltip="true"
                           :cell-class-name="planUsageCellClass"
@@ -138,31 +138,30 @@
                           @row-dblclick="gdbomupdateCompanyFunc"
                           style="width: 100%;height: 36vh" border tooltip-effect="dark" :data="ddtableData" row-key="ID"
 						   @selection-change="fjSelectionChange">
-                  <!-- <el-table-column type="selection" width="30" /> -->
-				  <el-table-column align="left" label="关联编号" prop="关联编号"  width="105"/>
-				  <el-table-column align="left" label="建档时间" prop="sys_rq"  width="160"/>
-				  <el-table-column align="left" label="建档用户" prop="sys_id"  width="160"/>
-				  <el-table-column align="left" label="文件类型" prop="附件类型"  width="90"/>
-                  <el-table-column align="left" label="备注" 	prop="附件备注"  width="110"/>
+                 <el-table-column align="left" label="关联编号" prop="关联编号"  width="115"/>
+                 <el-table-column align="left" label="备注" 	prop="附件备注"  width="110"/>
+                 <el-table-column align="left" label="文件类型" prop="附件类型"  width="100"/>
+                 <el-table-column align="left" label="建档时间" prop="sys_rq"  width="160"/>
+                 <el-table-column align="left" label="建档用户" prop="sys_id"  width="200"/>
                 </el-table>
               </el-tab-pane> 
+			  
 
 			  <el-tab-pane label="技术附件" @click="showTable('技术附件')" name="fourth">
 			  	<el-table ref="multipleTable"
-					  :row-style="{ height: '20px' }"
-					  :cell-style="{ padding: '0px' }" :header-row-style="{ height: '20px' }"
+					  :row-style="{ height: '30px' }"
+					  :cell-style="{ padding: '0px' }" :header-row-style="{ height: '30px' }"
 					  :header-cell-style="{ padding: '0px' }"
 					  :show-overflow-tooltip="true"
 					  :cell-class-name="planUsageCellClass"
 					  highlight-current-row="true"
 					  @row-dblclick="ExcelShow"
 					  style="width: 100%;height: 36vh" border tooltip-effect="dark" :data="jstableData" row-key="ID" @selection-change="fjSelectionChange">
-				  <!-- <el-table-column type="selection" width="55" /> -->
-				  <el-table-column align="left" label="关联编号" prop="关联编号"  width="105"/>
+				  <el-table-column align="left" label="关联编号" prop="关联编号"  width="115"/>
+				  <el-table-column align="left" label="备注" 	prop="附件备注"  width="110"/>
+				  <el-table-column align="left" label="文件类型" prop="附件类型"  width="100"/>
 				  <el-table-column align="left" label="建档时间" prop="sys_rq"  width="160"/>
-				  <el-table-column align="left" label="建档用户" prop="sys_id"  width="160"/>
-				  <el-table-column align="left" label="文件类型" prop="附件类型"  width="90"/>
-                  <el-table-column align="left" label="备注" prop="附件备注"  width="110"/>
+				  <el-table-column align="left" label="建档用户" prop="sys_id"  width="200"/>
 			      </el-table>
 			    </el-tab-pane>
             </el-tabs>
@@ -872,8 +871,12 @@
 		 <link href="https://cdn.jsdelivr.net/npm/vue-plugin-hiprint@1.0.0/dist/print-lock.css" rel="stylesheet" media="print">
 		 <link href="https://unpkg.com/vue-plugin-hiprint@1.0.0/dist/print-lock.css" rel="stylesheet">
 		</div> -->
-		
+		<div id="preview"></div>
   </div>
+  
+	
+	
+	
 </template>
 <script>
 //点击按钮显示下方表格
@@ -911,6 +914,7 @@ import PrintPage from './components/print.vue'
 import AddGongYi from './components/addGongYi.vue'  
 import { useUserStore } from '@/pinia/modules/user';
 
+  
 defineOptions({name: 'Company'})
 //定义打印跳转页面
 const printPageRef = ref()
@@ -1964,25 +1968,35 @@ for (let i = 0; i < binaryLen; i++) {
     const worksheet = workbook.Sheets[workbook.SheetNames[0]];
     console.log(121212,worksheet)
     const jsonData = XLSX.utils.sheet_to_json(worksheet);
-    generatePdf(jsonData);
+	
+	let base64 = XLSX.write(worksheet, { type: 'base64' });
+	
+    generatePdf(base64);
   } catch (error) {
     console.error('Error fetching and converting file:', error);
   }
 };
 
 const generatePdf = (data) => {
-  const doc = new jsPDF();
-
-  let yPosition = 10;
-  data.forEach((row) => {
-    doc.text(10, yPosition, JSON.stringify(row));
-    yPosition += 10;
-  });
-
-  const pdfBlob = doc.output('blob');
+  
 
-  previewPdf(pdfBlob);
-  downloadPdf(pdfBlob);
+ //  let yPosition = 10;
+ //  data.forEach((row) => {
+	// const doc = new jsPDF();
+ //    doc.text(10, yPosition, JSON.stringify(row));
+ //    yPosition += 10;
+ //  });
+
+ //  const pdfBlob = doc.output('blob');
+
+ //  previewPdf(pdfBlob);
+ //  downloadPdf(pdfBlob);
+ console/log('pdf data', data)
+ const pdfDoc = new jsPDF()
+ pdfDoc.text(data)
+ pdfDoc.save(a4.pdf)
+ 
+ 
 };
 
 const previewPdf = (blob) => {
@@ -2241,7 +2255,9 @@ const yulan = (event) =>{
 	$.getScript('/luckysheet/plugins/js/plugin.js', () => {
 			$script('/luckysheet/luckysheet.umd.js', () => {
 			luckyexcelVisible.value = true
+			
 			LuckyExcel.transformExcelToLucky(jsfjformdata.value.附件内容, function(exportJson, luckysheetfile){
+				console.log('jsfjformdata.value.附件内容', jsfjformdata.value.附件内容)
 				if(exportJson.sheets==null || exportJson.sheets.length==0){
 					alert("Failed to read the content of the excel file, currently does not support xls files!");
 					return;
@@ -2303,11 +2319,6 @@ const jsfj_del = (row) =>{
 
 //技术附件弹窗确定
 const jsfjenterDialog = () => {
-	
-	// console.log(jsfjformdata.value.附件类型)
-	
-	
-	// return;
 	if(jsfjformdata.value.附件备注==''){
 		ElMessage({
 			type: 'error',
@@ -2329,11 +2340,6 @@ const jsfjenterDialog = () => {
 		});
 		return;
 	}
-	//判断验证上传文件类型是否为 xlsx
-	// if(){//不是此类型提示
-		
-	// }
-
 	let fr = new FileReader();
 	fr.readAsDataURL(jsfjformdata.value.附件内容);
 	fr.onload = function () {
@@ -2343,7 +2349,7 @@ const jsfjenterDialog = () => {
 	  restoredData.append('附件内容', fr.result);
 	  restoredData.append('附件类型', jsfjformdata.value.附件类型);
 	  restoredData.append('关联编号', jsfjformdata.value.关联编号);
-
+       //将restoredDta数据新增到接口
 	   gdAnnexAdd(restoredData).then(response => {
 		 if(response.code==0){
 			 ElMessage({
@@ -2361,116 +2367,244 @@ const jsfjenterDialog = () => {
 	   })
 	}
 }
-
-
-//订单资料附件
-const gdbomupdateCompanyFunc = (row) =>{
-	if(!row.附件内容) return
-	$.getScript('/luckysheet/plugins/js/plugin.js', () => {
-		$script('/luckysheet/luckysheet.umd.js', () => {
-					function dataURLtoBlob(dataUrl) {
-					    const byteString = atob(dataUrl.split(',')[1]);
-					    const ab = new ArrayBuffer(byteString.length);
-					    const ia = new Uint8Array(ab);
-
-					    for (let i = 0; i < byteString.length; i++) {
-					        ia[i] = byteString.charCodeAt(i);
-					    }
-
-					    return new Blob([ab], { type: 'application/octet-stream' });
-					}
-
-					const blob = dataURLtoBlob(row.附件内容);
-					luckyexcelVisible.value = true
-					LuckyExcel.transformExcelToLucky(blob, function(exportJson, luckysheetfile){
-						if(exportJson.sheets==null || exportJson.sheets.length==0){
-							alert("Failed to read the content of the excel file, currently does not support xls files!");
-							return;
-						}
-						if(luckyExcel) luckyExcel.destroy();
-						luckysheet.create({
-							container: 'luckyexcel', //容器的ID
-							data: exportJson.sheets,
-							title: exportJson.info.name, // 工作簿名称
-							lang: "zh", // 设定表格语言 国际化设置,允许设置表格的语言,支持中文("zh")和英文("en")
-							showtoolbar: false, // 是否显示工具栏
-							showinfobar: false, // 是否显示顶部信息栏
-							allowEdit: false, // 是否允许前台编辑
-							enableAddRow: false, // 允许增加行
-							enableAddCol: false, // 允许增加列
-							userInfo: false, // 右上角的用户信息展示样式
-							showRowBar: false, // 是否显示行号区域
-							showColumnBar: false, // 是否显示列号区域
-							sheetFormulaBar: false, // 是否显示公式栏
-							enableAddBackTop: false,//返回头部按钮
-						});
-						luckyExcel = luckysheet;
-					})
-		})
-	})
-	$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/css/pluginsCss.css'));
-	$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/plugins.css'));
-	$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/css/luckysheet.css'));
-	$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/assets/iconfont/iconfont.css'));
-}
-
+
+
+//订单资料附件 - 预览
+const gdbomupdateCompanyFunc = (row) => {
+    // 加载插件和样式
+    const loadScriptsAndStyles = () => {
+        // 加载插件脚本
+        $.getScript('/luckysheet/plugins/js/plugin.js', () => {
+            $script('/luckysheet/luckysheet.umd.js', () => {
+                initializeLuckysheet(); // 加载完成后初始化 Luckysheet
+            });
+        });
+
+        // 定义样式文件路径
+        const styles = [
+            '/luckysheet/plugins/css/pluginsCss.css',
+            '/luckysheet/plugins/plugins.css',
+            '/luckysheet/css/luckysheet.css',
+            '/luckysheet/assets/iconfont/iconfont.css'
+        ];
+
+        // 添加样式文件到页面
+        styles.forEach(style => {
+            $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', style));
+        });
+    };
+
+    // 初始化 Luckysheet
+    const initializeLuckysheet = () => {
+        const callback = (exportJson, luckysheetfile) => {
+            if (!exportJson.sheets || exportJson.sheets.length === 0) {
+                alert("无法读取Excel文件内容,目前不支持xls文件格式!");
+                return;
+            }
+            if (luckyExcel) luckyExcel.destroy(); // 销毁之前的实例
+            luckysheet.create({
+                container: 'luckyexcel',
+                data: exportJson.sheets,
+                title: exportJson.info.name,
+                lang: "zh",
+                showtoolbar: false,
+                showinfobar: false,
+                allowEdit: false,
+                enableAddRow: false,
+                enableAddCol: false,
+                userInfo: false,
+                showRowBar: false,
+                showColumnBar: false,
+                sheetFormulaBar: false,
+                enableAddBackTop: false,
+            });
+            luckyExcel = luckysheet; // 存储实例
+        };
+
+        if (row['url'] === null || row['url'] === '') {
+            // 转换Base64数据为Blob对象
+            const blob = dataURLtoBlob(row.附件内容);
+            luckyexcelVisible.value = true; // 控制页面展示
+            LuckyExcel.transformExcelToLucky(blob, callback);
+        } else {
+            // 文件路径处理
+            const excelPath = `/${row.url.replace(/\\/g, "/")}`;
+            const excelName = excelPath.split('/').pop();
+            luckyexcelVisible.value = true;
+            LuckyExcel.transformExcelToLuckyByUrl(excelPath, excelName, callback);
+        }
+    };
+
+    // 将Data URL转换为Blob对象
+    const dataURLtoBlob = (dataUrl) => {
+        const byteString = atob(dataUrl.split(',')[1]);
+        const ab = new ArrayBuffer(byteString.length);
+        const ia = new Uint8Array(ab);
+
+        for (let i = 0; i < byteString.length; i++) {
+            ia[i] = byteString.charCodeAt(i);
+        }
+
+        return new Blob([ab], { type: 'application/octet-stream' });
+    };
+
+    loadScriptsAndStyles(); // 开始加载插件和样式
+};
+// const gdbomupdateCompanyFunc = (row) => {
+//     // 加载插件和样式
+//     const loadScriptsAndStyles = () => {
+//         $.getScript('/luckysheet/plugins/js/plugin.js', () => {
+//             $script('/luckysheet/luckysheet.umd.js', () => {
+//                 initializeLuckysheet();
+//             });
+//         });
+
+//         const styles = [
+//             '/luckysheet/plugins/css/pluginsCss.css',
+//             '/luckysheet/plugins/plugins.css',
+//             '/luckysheet/css/luckysheet.css',
+//             '/luckysheet/assets/iconfont/iconfont.css'
+//         ];
+
+//         styles.forEach(style => {
+//             $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', style));
+//         });
+//     };
+
+//     // 初始化 Luckysheet
+//     const initializeLuckysheet = () => {
+//         const callback = (exportJson, luckysheetfile) => {
+//             if (!exportJson.sheets || exportJson.sheets.length === 0) {
+//                 alert("Failed to read the content of the excel file, currently does not support xls files!");
+//                 return;
+//             }
+//             if (luckyExcel) luckyExcel.destroy();
+//             luckysheet.create({
+//                 container: 'luckyexcel',
+//                 data: exportJson.sheets,
+//                 title: exportJson.info.name,
+//                 lang: "zh",
+//                 showtoolbar: false,
+//                 showinfobar: false,
+//                 allowEdit: false,
+//                 enableAddRow: false,
+//                 enableAddCol: false,
+//                 userInfo: false,
+//                 showRowBar: false,
+//                 showColumnBar: false,
+//                 sheetFormulaBar: false,
+//                 enableAddBackTop: false,
+//             });
+//             luckyExcel = luckysheet;
+//         };
+
+//         if (row['url'] === null || row['url'] === '') {
+//             const blob = dataURLtoBlob(row.附件内容);
+//             luckyexcelVisible.value = true;
+//             LuckyExcel.transformExcelToLucky(blob, callback);
+//         } else {
+//             const excelPath = `/${row.url.replace(/\\/g, "/")}`;
+//             const excelName = excelPath.split('/').pop();
+//             luckyexcelVisible.value = true;
+//             LuckyExcel.transformExcelToLuckyByUrl(excelPath, excelName, callback);
+//         }
+//     };
+
+//     // Data URL 转 Blob
+//     const dataURLtoBlob = (dataUrl) => {
+//         const byteString = atob(dataUrl.split(',')[1]);
+//         const ab = new ArrayBuffer(byteString.length);
+//         const ia = new Uint8Array(ab);
+
+//         for (let i = 0; i < byteString.length; i++) {
+//             ia[i] = byteString.charCodeAt(i);
+//         }
+
+//         return new Blob([ab], { type: 'application/octet-stream' });
+//     };
+
+//     loadScriptsAndStyles();
+// };
 
 //技术资料excel展示
 const ExcelShow = (row) =>{
-	console.log("技术资料excel展示")
-	console.log(row)
-	if(!row.附件内容) return
-	$.getScript('/luckysheet/plugins/js/plugin.js', () => {
-		$script('/luckysheet/luckysheet.umd.js', () => {
-					function dataURLtoBlob(dataUrl) {
-					    const byteString = atob(dataUrl.split(',')[1]);
-					    const ab = new ArrayBuffer(byteString.length);
-					    const ia = new Uint8Array(ab);
-
-					    for (let i = 0; i < byteString.length; i++) {
-					        ia[i] = byteString.charCodeAt(i);
-					    }
-
-					    return new Blob([ab], { type: 'application/octet-stream' });
-					}
-
-					const blob = dataURLtoBlob(row.附件内容);
-					luckyexcelVisible.value = true
-					LuckyExcel.transformExcelToLucky(blob, function(exportJson, luckysheetfile){
-						if(exportJson.sheets==null || exportJson.sheets.length==0){
-							alert("Failed to read the content of the excel file, currently does not support xls files!");
-							return;
-						}
-						if(luckyExcel) luckyExcel.destroy();
-						luckysheet.create({
-							container: 'luckyexcel', //容器的ID
-							data: exportJson.sheets,
-							title: exportJson.info.name, // 工作簿名称
-							lang: "zh", // 设定表格语言 国际化设置,允许设置表格的语言,支持中文("zh")和英文("en")
-							showtoolbar: false, // 是否显示工具栏
-							showinfobar: false, // 是否显示顶部信息栏
-							allowEdit: false, // 是否允许前台编辑
-							enableAddRow: false, // 允许增加行
-							enableAddCol: false, // 允许增加列
-							userInfo: false, // 右上角的用户信息展示样式
-							showRowBar: false, // 是否显示行号区域
-							showColumnBar: false, // 是否显示列号区域
-							sheetFormulaBar: false, // 是否显示公式栏
-							enableAddBackTop: false,//返回头部按钮
-						});
-						luckyExcel = luckysheet;
-					})
-		})
-	})
-	$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/css/pluginsCss.css'));
-	$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/plugins/plugins.css'));
-	$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/css/luckysheet.css'));
-	$('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', '/luckysheet/assets/iconfont/iconfont.css'));
-
+	// 加载插件和样式
+	const loadScriptsAndStyles = () => {
+	    $.getScript('/luckysheet/plugins/js/plugin.js', () => {
+	        $script('/luckysheet/luckysheet.umd.js', () => {
+	            initializeLuckysheet();
+	        });
+	    });
+	
+	    const styles = [
+	        '/luckysheet/plugins/css/pluginsCss.css',
+	        '/luckysheet/plugins/plugins.css',
+	        '/luckysheet/css/luckysheet.css',
+	        '/luckysheet/assets/iconfont/iconfont.css'
+	    ];
+	
+	    styles.forEach(style => {
+	        $('head').append($('<link rel="stylesheet" type="text/css" />').attr('href', style));
+	    });
+	};
+	
+	// 初始化 Luckysheet
+	const initializeLuckysheet = () => {
+	    const callback = (exportJson, luckysheetfile) => {
+	        if (!exportJson.sheets || exportJson.sheets.length === 0) {
+	            alert("Failed to read the content of the excel file, currently does not support xls files!");
+	            return;
+	        }
+	        if (luckyExcel) luckyExcel.destroy();
+	        luckysheet.create({
+	            container: 'luckyexcel',
+	            data: exportJson.sheets,
+	            title: exportJson.info.name,
+	            lang: "zh",
+	            showtoolbar: false,
+	            showinfobar: false,
+	            allowEdit: false,
+	            enableAddRow: false,
+	            enableAddCol: false,
+	            userInfo: false,
+	            showRowBar: false,
+	            showColumnBar: false,
+	            sheetFormulaBar: false,
+	            enableAddBackTop: false,
+	        });
+	        luckyExcel = luckysheet;
+	    };
+	
+	    if (row['url'] === null || row['url'] === '') {
+	        const blob = dataURLtoBlob(row.附件内容);
+	        luckyexcelVisible.value = true;
+	        LuckyExcel.transformExcelToLucky(blob, callback);
+	    } else {
+	        const excelPath = `/${row.url.replace(/\\/g, "/")}`;
+	        const excelName = excelPath.split('/').pop();
+	        luckyexcelVisible.value = true;
+	        LuckyExcel.transformExcelToLuckyByUrl(excelPath, excelName, callback);
+	    }
+	};
+	
+	// Data URL 转 Blob
+	const dataURLtoBlob = (dataUrl) => {
+	    const byteString = atob(dataUrl.split(',')[1]);
+	    const ab = new ArrayBuffer(byteString.length);
+	    const ia = new Uint8Array(ab);
+	
+	    for (let i = 0; i < byteString.length; i++) {
+	        ia[i] = byteString.charCodeAt(i);
+	    }
+	
+	    return new Blob([ab], { type: 'application/octet-stream' });
+	};
+	
+	loadScriptsAndStyles();
 }
 
-let luckyExcel = null
 
+let luckyExcel = null
 const luckyexcelVisible = ref(false)
 const luckyexcelCloseDialog = () => {
   luckyexcelVisible.value = false
@@ -2478,8 +2612,6 @@ const luckyexcelCloseDialog = () => {
 
 
 
-
-
 </script>
 <style scoped>
 /* 在样式表中使用媒体查询 */

+ 50 - 21
src/view/yunyin/shengchanguanli/shengchanpaichan.vue

@@ -7,8 +7,8 @@
           <el-form ref="elSearchFormRef"  :model="searchInfo" class="demo-form-inline" :rules="searchRule" @keyup.enter="onSubmit">
             <el-form-item>
               <!--按钮-->
-              <el-input v-model="searchInfo" placeholder="搜索" clearable style="width: 180px;"></el-input>
-              <el-button type="primary" icon="search" @click="onSubmit" >查询</el-button>
+             <!-- <el-input v-model="searchInfo" placeholder="搜索" clearable style="width: 180px;"></el-input>
+              <el-button type="primary" icon="search" @click="onSubmit" >查询</el-button> -->
               <!-- <el-button type="primary" title="设置工单的状态--【计划中】 【生产中】 【已完成】" icon="edit" @click="onStatusClick" class="bt">工单状态设置</el-button> -->
               <div v-if="(currentNode == '计划中') && treeType === 'customTree'">
                 <!-- <el-button type="primary" title="排产" icon="edit" @click="ongxztgzClick" class="bt">排产</el-button> -->
@@ -456,6 +456,8 @@
                   { align:'left', title: '客户编号', prop: '客户编号', width: 110, sortable: 'sortable', },
                   { align:'left', title: '款式', prop: '款式', width: 110,  sortable: 'sortable', },
 				  { align:'left', title: '生产款号', prop: '生产款号', width: 160,  sortable: 'sortable', },
+				  { align:'left', title: '制单数', prop: '制单数', width: 160,  sortable: 'sortable', },
+				  { align:'left', title: '工单完工数量', prop: '工单完工数量', width: 160,  sortable: 'sortable', },
 				  { align:'left', title: '落货日期', prop: '落货日期', width: 120,  sortable: 'sortable', },
 				  { align:'left', title: '生产时间', prop: '创建时间', width: 160,  sortable: 'sortable', },
               ]">
@@ -556,34 +558,56 @@ const machine = ref('');//记录左侧车间机台编号
 // =========== 获取左侧树侧形结构 ===========
 const treeData = ref([]);
 const _department_code = ref(null); 
+
 const getDepartmentdata = async () => {
   try {
-    //车缝派工菜单
+    // 车缝派工菜单
     const CfmachineLists = await CfmachineList();
-    console.log(CfmachineLists); 
-    const [yearMonth, machineList] = Object.entries(CfmachineLists.data)[0];
-    treeData.value.push({
-      label: yearMonth,  // 年月作为一级节点
-      children: machineList.map(id => ({
-        label: id  // 每个设备编号作为二级节点
-      }))
-    });	
-	_Machine_riqi.value=yearMonth
+    console.log(CfmachineLists);
+
+    // 清空 treeData.value 以防止重复添加
+    treeData.value = [];
+
+    // 获取并排序年份月份,从大到小排列
+    const sortedYearMonths = Object.keys(CfmachineLists.data).sort((a, b) => b - a);
+
+    // 处理排序后的数据
+    for (const yearMonth of sortedYearMonths) {
+      const machineList = CfmachineLists.data[yearMonth];
+      treeData.value.push({
+        label: yearMonth,  // 年月作为一级节点
+        children: machineList.map(id => ({
+          label: id,  // 每个设备编号作为二级节点
+          yearMonth: yearMonth  // 添加年月信息到节点
+        }))
+      });
+    }
+
+    // 设置 _Machine_riqi.value 为最新的年月
+    _Machine_riqi.value = sortedYearMonths[0];
+
     console.log(treeData.value);
   } catch (error) {
     console.error('获取数据失败:', error);
   }
 };
-getDepartmentdata();
 
+getDepartmentdata();
 
-//点击左侧菜单栏
+// 点击左侧菜单栏
 const handleNodeClick = async (node) => {
+  // 判断是否为设备编号节点
+  if (!node.yearMonth) {
+    console.log("点击的是日期节点,无需传递参数");
+    return;
+  }
+
   // 取消所有节点的颜色
   const allNodes = document.querySelectorAll('.treecolor .el-tree-node');
   allNodes.forEach(node => {
     node.querySelector('.el-tree-node__label').style.color = '';
   });
+
   // 获取点击的节点
   const clickedNodeId = node['$treeNodeId'];
   const clickedNode = document.querySelector(`.treecolor .el-tree-node[data-key="${clickedNodeId}"]`);
@@ -591,15 +615,20 @@ const handleNodeClick = async (node) => {
     // 给当前点击的节点改变颜色
     clickedNode.querySelector('.el-tree-node__label').style.color = 'red';
   }
-   // 以 '【' 分隔,取第一部分
-  const machineCode = node.label.split('【')[0]; 
+
+  // 以 '【' 分隔,取第一部分
+  const machineCode = node.label.split('【')[0];
   console.log(machineCode);  // 输出: CF01
-  console.log(_Machine_riqi.value);  // 输出: 日期
-  const CfdataListtable = await CfdataList({machine:machineCode});
-  chejianData.splice(0,chejianData.length,...CfdataListtable.data.table);
-  jhz_total.value = CfdataListtable.data.table
-};
 
+  // 获取点击节点的年月信息
+  const yearMonth = node.yearMonth;
+  console.log(yearMonth);  // 输出: 日期
+
+  // 调用 CfdataList 函数获取数据
+  const CfdataListtable = await CfdataList({ machine: machineCode, date: yearMonth });
+  chejianData.splice(0, chejianData.length, ...CfdataListtable.data.table);
+  jhz_total.value = CfdataListtable.data.table;
+};
 //默认显示计划中表格
 const currentNode = ref("计划中")
 //计划中、已完工下方印件资料

+ 3 - 2
src/view/yunyin/shengchanguanli/yangyipihe.vue

@@ -4,7 +4,7 @@
 		<layout-header>
 		  <div class="">
 			<!--          按钮部分-->
-			<el-form ref="elSearchFormRef"   class="demo-form-inline" :rules="searchRule" @keyup.enter="onSubmit">
+			<el-form ref="elSearchFormRef"   class="demo-form-inline" :rules="searchRule" >
 			  <el-form-item>
 				<el-input v-model="searchInfo" placeholder="搜索订单编号"  style="width: 180px;"></el-input>
 				<el-button type="primary" icon="search" @click="onSubmit" >查询</el-button>
@@ -266,7 +266,8 @@ const onSubmit = async ()  => {
 		// return false;
 	// }else{
 		const UnapprovalListtable = await UnapprovalList({search:searchInfo.value});
-		tableData1.splice(0,tableData1.length,...UnapprovalListtable.data);
+		tableData1.splice(0,tableData1.length,...UnapprovalListtable.data.table);
+		total.value = UnapprovalListtable.data.total
 	// }
 };
 

Niektóre pliki nie zostały wyświetlone z powodu dużej ilości zmienionych plików