From 956ed64fd138b8422a2bc0a2e6701e4e75017dbc Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Wed, 21 Jan 2026 11:08:21 +0800 Subject: [PATCH] =?UTF-8?q?2026-01-21=20=E6=94=B6=E8=B4=A7=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E4=BB=BB=E5=8A=A1=E9=80=9A=E7=9F=A5=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E7=9A=84=E5=85=A5=E5=BA=93=E6=98=8E=E7=BB=86=E9=A1=B5=E7=AD=BE?= =?UTF-8?q?=EF=BC=8C=E5=9C=A8=E8=A1=8C=E6=93=8D=E4=BD=9C=E4=B8=8A=E5=8A=A0?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E3=80=90=E6=A0=87=E7=AD=BE=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E3=80=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/qc/Inbound_notification.js | 14 +- src/utils/httpRequest.js | 41 +++++ src/views/modules/qc/inboundNotification.vue | 32 +++- src/views/modules/qc/label_import_upload.vue | 155 +++++++++++++++++++ 4 files changed, 240 insertions(+), 2 deletions(-) create mode 100644 src/views/modules/qc/label_import_upload.vue diff --git a/src/api/qc/Inbound_notification.js b/src/api/qc/Inbound_notification.js index 893c90e..8291bcd 100644 --- a/src/api/qc/Inbound_notification.js +++ b/src/api/qc/Inbound_notification.js @@ -1,4 +1,5 @@ -import { createAPI } from "@/utils/httpRequest.js"; +import { createAPI, createFormAPI } from "@/utils/httpRequest.js"; +import httpRequest from '@/utils/httpRequest' // 查询收获入库单 export const searchInboundNotification = data => createAPI('/inbound/searchInboundNotification','post',data) @@ -30,3 +31,14 @@ export const getInboundCategoryList = data => createAPI('/inbound/getInboundCate // 查询部门列表 export const getDepartmentList = data => createAPI('/inbound/getDepartmentList','post',data) +// 标签导入 +export const labelImport = data => createFormAPI('/inbound/labelImport','post',data) +// 下载标签导入模板 +export const downloadLabelTemplate = () => { + return httpRequest({ + url: httpRequest.adornUrl('/inbound/downloadLabelTemplate'), + method: 'get', + responseType: 'blob' + }) +} + diff --git a/src/utils/httpRequest.js b/src/utils/httpRequest.js index 0105d14..b3015eb 100644 --- a/src/utils/httpRequest.js +++ b/src/utils/httpRequest.js @@ -167,3 +167,44 @@ export const createAPI = (url, method, data, type) => { ...config }) } + +// ============================= FormData上传请求 ============================= +const instanceForm = axios.create({ + baseURL: (process.env.NODE_ENV !== 'production' && process.env.OPEN_PROXY ? '/proxyApi/' : window.SITE_CONFIG.baseUrl), + timeout: 10000 * 30, + withCredentials: true, + headers: { + 'Content-Type': 'multipart/form-data' + } +}) + +/** + * 请求拦截 + */ +instanceForm.interceptors.request.use(config => { + config.headers['token'] = Vue.cookie.get('token') // 请求头带上token + return config +}, error => { + return Promise.reject(error) +}) + +/** + * 响应拦截 + */ +instanceForm.interceptors.response.use(response => { + if (response.data && response.data.code === 401) { // 401, token失效 + clearLoginInfo() + router.push({ name: 'login' }) + } + return response +}, error => { + return Promise.reject(error) +}) + +export const createFormAPI = (url, method, data) => { + return instanceForm({ + url, + method, + data + }) +} diff --git a/src/views/modules/qc/inboundNotification.vue b/src/views/modules/qc/inboundNotification.vue index 52c097b..0da1da0 100644 --- a/src/views/modules/qc/inboundNotification.vue +++ b/src/views/modules/qc/inboundNotification.vue @@ -296,10 +296,11 @@ fixed="right" header-align="center" align="center" - width="90" + width="150" label="操作"> @@ -666,6 +667,9 @@ + + + @@ -691,12 +695,14 @@ } from "@/api/qc/qc.js" import {getTableDefaultListLanguage, getTableUserListLanguage} from "@/api/table.js" import Chooselist from '@/views/modules/common/Chooselist_eam' + import LabelImportUpload from './label_import_upload' import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js' import excel from "@/utils/excel-util.js" import {verifyData} from "@/api/chooselist/chooselist.js" export default { components: { Chooselist, + LabelImportUpload, }, data () { return { @@ -1995,6 +2001,30 @@ } }) }, + + // 标签导入 + labelImportModal (row) { + // 权限检查:与批量编辑按钮相同的权限控制 + if (this.currentRow.orderStatus !== '草稿' && this.currentRow.orderStatus !== '编辑中') { + this.$message.warning('只有草稿或编辑中状态的单据才能导入标签!') + return + } + // 准备传递给组件的数据 + let currentData = { + site: this.currentRow.site, + buNo: this.currentRow.buNo, + orderNo: this.currentRow.orderNo, + orderType: this.currentRow.orderType, + orderStatus: this.currentRow.orderStatus, + relatedOrderNo: row.relatedOrderNo, + relatedOrderLineNo: row.relatedOrderLineNo, + partNo: row.partNo + } + // 打开标签导入组件 + this.$nextTick(() => { + this.$refs.labelImportUpload.init(currentData) + }) + }, } } diff --git a/src/views/modules/qc/label_import_upload.vue b/src/views/modules/qc/label_import_upload.vue new file mode 100644 index 0000000..2d3c114 --- /dev/null +++ b/src/views/modules/qc/label_import_upload.vue @@ -0,0 +1,155 @@ + + + + +