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