|
@@ -835,7 +835,7 @@
|
|
|
<el-row :gutter="24">
|
|
<el-row :gutter="24">
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
|
<br>
|
|
<br>
|
|
|
- <p style='color: ;'>附件文件类型必须是"XLSX"格式</p>
|
|
|
|
|
|
|
+ <p>附件文件类型必须是"XLSX"格式</p>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="12">
|
|
<el-col :span="12">
|
|
|
<br>
|
|
<br>
|
|
@@ -867,10 +867,10 @@
|
|
|
</layout>
|
|
</layout>
|
|
|
|
|
|
|
|
<PrintPage ref="printPageRef" />
|
|
<PrintPage ref="printPageRef" />
|
|
|
-
|
|
|
|
|
- <div class="print-section">
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <div class="print-section">
|
|
|
<link href="https://cdn.jsdelivr.net/npm/vue-plugin-hiprint@1.0.0/dist/print-lock.css" rel="stylesheet" media="print">
|
|
<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">
|
|
|
|
|
|
|
+ <link href="https://unpkg.com/vue-plugin-hiprint@1.0.0/dist/print-lock.css" rel="stylesheet">
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
@@ -931,103 +931,103 @@ const currentDates = `${year}-${month}-${day}`;
|
|
|
|
|
|
|
|
//==============图片上传=============
|
|
//==============图片上传=============
|
|
|
// const uploadUrl = ref('http://mes-dacheng-api:8083/index.php/api/work_order/ImgUpload')
|
|
// const uploadUrl = ref('http://mes-dacheng-api:8083/index.php/api/work_order/ImgUpload')
|
|
|
-// 上传的URL
|
|
|
|
|
-const uploadUrl = ref('http://192.168.28.22:8082/api/work_order/ImgUpload');
|
|
|
|
|
-const uploadHeaders = { 'Content-Type': 'multipart/form-data' };
|
|
|
|
|
-const fileList = reactive([]);
|
|
|
|
|
-const uploadRef = ref(null);
|
|
|
|
|
-
|
|
|
|
|
-// 预览图片
|
|
|
|
|
-const handlePreview = (file) => {
|
|
|
|
|
- console.log('预览文件:', file);
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-// 移除图片
|
|
|
|
|
-const handleRemove = (file, fileList) => {
|
|
|
|
|
- console.log('移除文件:', file, '剩余文件:', fileList);
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-// 上传错误处理
|
|
|
|
|
-const handleError = (err, file, fileList) => {
|
|
|
|
|
- console.error('上传失败:', err);
|
|
|
|
|
- ElMessage.error(`图片上传失败: ${err.message || '未知错误'}`);
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-// 上传前的检查与图片压缩
|
|
|
|
|
-const beforeUpload = (file) => {
|
|
|
|
|
- const isJPGOrPNG = file.type === 'image/jpeg' || file.type === 'image/png';
|
|
|
|
|
- const isLt500K = file.size / 1024 < 500;
|
|
|
|
|
- if (!isJPGOrPNG) {
|
|
|
|
|
- ElMessage.error('上传图片只能是 JPG 或 PNG 格式!');
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- if (!isLt500K) {
|
|
|
|
|
- ElMessage.error('上传图片大小不能超过 500KB!');
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- // 图片格式和大小符合,压缩图片
|
|
|
|
|
- return new Promise((resolve, reject) => {
|
|
|
|
|
- const reader = new FileReader();
|
|
|
|
|
- reader.readAsDataURL(file);
|
|
|
|
|
- reader.onload = () => {
|
|
|
|
|
- const img = new Image();
|
|
|
|
|
- img.src = reader.result;
|
|
|
|
|
- img.onload = () => {
|
|
|
|
|
- const canvas = document.createElement('canvas');
|
|
|
|
|
- const ctx = canvas.getContext('2d');
|
|
|
|
|
- const fixedWidth = 300;
|
|
|
|
|
- const fixedHeight = 300;
|
|
|
|
|
- canvas.width = fixedWidth;
|
|
|
|
|
- canvas.height = fixedHeight;
|
|
|
|
|
- ctx.drawImage(img, 0, 0, fixedWidth, fixedHeight);
|
|
|
|
|
- canvas.toBlob((blob) => {
|
|
|
|
|
- const compressedFile = new File([blob], file.name, { type: file.type });
|
|
|
|
|
- resolve(compressedFile);
|
|
|
|
|
- }, file.type);
|
|
|
|
|
- };
|
|
|
|
|
- };
|
|
|
|
|
- reader.onerror = (error) => {
|
|
|
|
|
- ElMessage.error('图片处理失败');
|
|
|
|
|
- reject(error);
|
|
|
|
|
- };
|
|
|
|
|
- });
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-// 上传成功处理
|
|
|
|
|
-const handleSuccess = (response, file, fileList) => {
|
|
|
|
|
- console.log('上传成功:', response, file, fileList);
|
|
|
|
|
- // ElMessage.success('图片上传成功');
|
|
|
|
|
-};
|
|
|
|
|
-
|
|
|
|
|
-// 自定义上传逻辑
|
|
|
|
|
-const customUpload = async (options) => {
|
|
|
|
|
- try {
|
|
|
|
|
- const formData = new FormData();
|
|
|
|
|
- formData.append('image', options.file);
|
|
|
|
|
-
|
|
|
|
|
- const response = await axios.post(uploadUrl.value, formData, {
|
|
|
|
|
- headers: uploadHeaders,
|
|
|
|
|
- onUploadProgress: (progressEvent) => {
|
|
|
|
|
- options.onProgress({
|
|
|
|
|
- percent: Math.round((progressEvent.loaded * 100) / progressEvent.total),
|
|
|
|
|
- });
|
|
|
|
|
- },
|
|
|
|
|
- });
|
|
|
|
|
-
|
|
|
|
|
- if (response.data.code === 0) {
|
|
|
|
|
- options.onSuccess(response.data);
|
|
|
|
|
- ElMessage.success('图片上传成功');
|
|
|
|
|
|
|
+// 上传的URL
|
|
|
|
|
+const uploadUrl = ref('http://192.168.28.22:8082/api/work_order/ImgUpload');
|
|
|
|
|
+const uploadHeaders = { 'Content-Type': 'multipart/form-data' };
|
|
|
|
|
+const fileList = reactive([]);
|
|
|
|
|
+const uploadRef = ref(null);
|
|
|
|
|
+
|
|
|
|
|
+// 预览图片
|
|
|
|
|
+const handlePreview = (file) => {
|
|
|
|
|
+ console.log('预览文件:', file);
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+// 移除图片
|
|
|
|
|
+const handleRemove = (file, fileList) => {
|
|
|
|
|
+ console.log('移除文件:', file, '剩余文件:', fileList);
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+// 上传错误处理
|
|
|
|
|
+const handleError = (err, file, fileList) => {
|
|
|
|
|
+ console.error('上传失败:', err);
|
|
|
|
|
+ ElMessage.error(`图片上传失败: ${err.message || '未知错误'}`);
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+// 上传前的检查与图片压缩
|
|
|
|
|
+const beforeUpload = (file) => {
|
|
|
|
|
+ const isJPGOrPNG = file.type === 'image/jpeg' || file.type === 'image/png';
|
|
|
|
|
+ const isLt500K = file.size / 1024 < 500;
|
|
|
|
|
+ if (!isJPGOrPNG) {
|
|
|
|
|
+ ElMessage.error('上传图片只能是 JPG 或 PNG 格式!');
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!isLt500K) {
|
|
|
|
|
+ ElMessage.error('上传图片大小不能超过 500KB!');
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 图片格式和大小符合,压缩图片
|
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
|
+ const reader = new FileReader();
|
|
|
|
|
+ reader.readAsDataURL(file);
|
|
|
|
|
+ reader.onload = () => {
|
|
|
|
|
+ const img = new Image();
|
|
|
|
|
+ img.src = reader.result;
|
|
|
|
|
+ img.onload = () => {
|
|
|
|
|
+ const canvas = document.createElement('canvas');
|
|
|
|
|
+ const ctx = canvas.getContext('2d');
|
|
|
|
|
+ const fixedWidth = 300;
|
|
|
|
|
+ const fixedHeight = 300;
|
|
|
|
|
+ canvas.width = fixedWidth;
|
|
|
|
|
+ canvas.height = fixedHeight;
|
|
|
|
|
+ ctx.drawImage(img, 0, 0, fixedWidth, fixedHeight);
|
|
|
|
|
+ canvas.toBlob((blob) => {
|
|
|
|
|
+ const compressedFile = new File([blob], file.name, { type: file.type });
|
|
|
|
|
+ resolve(compressedFile);
|
|
|
|
|
+ }, file.type);
|
|
|
|
|
+ };
|
|
|
|
|
+ };
|
|
|
|
|
+ reader.onerror = (error) => {
|
|
|
|
|
+ ElMessage.error('图片处理失败');
|
|
|
|
|
+ reject(error);
|
|
|
|
|
+ };
|
|
|
|
|
+ });
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+// 上传成功处理
|
|
|
|
|
+const handleSuccess = (response, file, fileList) => {
|
|
|
|
|
+ console.log('上传成功:', response, file, fileList);
|
|
|
|
|
+ // ElMessage.success('图片上传成功');
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+// 自定义上传逻辑
|
|
|
|
|
+const customUpload = async (options) => {
|
|
|
|
|
+ try {
|
|
|
|
|
+ const formData = new FormData();
|
|
|
|
|
+ formData.append('image', options.file);
|
|
|
|
|
+
|
|
|
|
|
+ const response = await axios.post(uploadUrl.value, formData, {
|
|
|
|
|
+ headers: uploadHeaders,
|
|
|
|
|
+ onUploadProgress: (progressEvent) => {
|
|
|
|
|
+ options.onProgress({
|
|
|
|
|
+ percent: Math.round((progressEvent.loaded * 100) / progressEvent.total),
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ if (response.data.code === 0) {
|
|
|
|
|
+ options.onSuccess(response.data);
|
|
|
|
|
+ ElMessage.success('图片上传成功');
|
|
|
add_gdscgdformData.img = response.data.data.url;
|
|
add_gdscgdformData.img = response.data.data.url;
|
|
|
- edit_ddformData.img = response.data.data.url;
|
|
|
|
|
- } else {
|
|
|
|
|
- throw new Error(response.data.msg);
|
|
|
|
|
- }
|
|
|
|
|
- } catch (error) {
|
|
|
|
|
- console.error('上传失败:', error);
|
|
|
|
|
- options.onError(error);
|
|
|
|
|
- ElMessage.error(`上传失败: ${error.message}`);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ edit_ddformData.img = response.data.data.url;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ throw new Error(response.data.msg);
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error('上传失败:', error);
|
|
|
|
|
+ options.onError(error);
|
|
|
|
|
+ ElMessage.error(`上传失败: ${error.message}`);
|
|
|
|
|
+ }
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// =========== 左侧树侧形结构 ===========
|
|
// =========== 左侧树侧形结构 ===========
|
|
@@ -1370,13 +1370,13 @@ const add_gdscgdformData = reactive({
|
|
|
|
|
|
|
|
const add_gddialogFormVisible = ref(false)
|
|
const add_gddialogFormVisible = ref(false)
|
|
|
//点击新增订单资料按钮
|
|
//点击新增订单资料按钮
|
|
|
-const addgd_onclick = async () => {
|
|
|
|
|
- console.log("用户信息", _username.value);
|
|
|
|
|
- // 判断客户代号是否为空
|
|
|
|
|
- if (!_Gd_khdh.value) {
|
|
|
|
|
- ElMessage({ type: 'warning', message: '请选择具体的订单后,再操作此功能' });
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+const addgd_onclick = async () => {
|
|
|
|
|
+ console.log("用户信息", _username.value);
|
|
|
|
|
+ // 判断客户代号是否为空
|
|
|
|
|
+ if (!_Gd_khdh.value) {
|
|
|
|
|
+ ElMessage({ type: 'warning', message: '请选择具体的订单后,再操作此功能' });
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
add_gddialogFormVisible.value = true
|
|
add_gddialogFormVisible.value = true
|
|
|
//获取订单编号接口
|
|
//获取订单编号接口
|
|
|
const getWorkOrder_list = await getWorkOrder();
|
|
const getWorkOrder_list = await getWorkOrder();
|
|
@@ -1393,7 +1393,7 @@ const addgd_onclick = async () => {
|
|
|
add_gdscgdformData['船样合计'] = ''
|
|
add_gdscgdformData['船样合计'] = ''
|
|
|
add_gdscgdformData['箱唛要求'] = ''
|
|
add_gdscgdformData['箱唛要求'] = ''
|
|
|
add_gdscgdformData['粘衬'] = ''
|
|
add_gdscgdformData['粘衬'] = ''
|
|
|
- add_gdscgdformData['订单数量'] = ''
|
|
|
|
|
|
|
+ add_gdscgdformData['订单数量'] = ''
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//新增工单资料确定
|
|
//新增工单资料确定
|
|
@@ -1640,8 +1640,8 @@ const cyChange = async (value) => {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
-const getSuborderscolor = reactive({
|
|
|
|
|
- colorlist: []
|
|
|
|
|
|
|
+const getSuborderscolor = reactive({
|
|
|
|
|
+ colorlist: []
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
//新增颜色资料按钮
|
|
//新增颜色资料按钮
|
|
@@ -2148,7 +2148,7 @@ const onSubmit = async () => {
|
|
|
ElMessage({type: 'warning',message: '请输入搜索的订单编号'})
|
|
ElMessage({type: 'warning',message: '请输入搜索的订单编号'})
|
|
|
return false;
|
|
return false;
|
|
|
}else{
|
|
}else{
|
|
|
- const WorkListdata = await WorkOrderList({search:_Gd_khdh.value,page:"1",limit:"1"});
|
|
|
|
|
|
|
+ const WorkListdata = await WorkOrderList({search:searchInfo.value,page:"1",limit:"1"});
|
|
|
tableData.value= WorkListdata.data.data
|
|
tableData.value= WorkListdata.data.data
|
|
|
ystableData.splice(0, ystableData.length);//颜色资料清空
|
|
ystableData.splice(0, ystableData.length);//颜色资料清空
|
|
|
gytableData.splice(0, gytableData.length);//工艺资料情空
|
|
gytableData.splice(0, gytableData.length);//工艺资料情空
|