From 1e51e80f98a9eca49f6c7a091a2a0d22ed762318 Mon Sep 17 00:00:00 2001 From: ljlong_2630 Date: Tue, 27 Aug 2024 15:34:17 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=9C=80=E6=B1=82=E5=BC=80?= =?UTF-8?q?=E5=8F=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/http.ts | 16 +- src/components/item/slectItemList.vue | 602 ++++++++++++-------- src/pages/sparePartsApplication/addForm.vue | 5 + src/pages/sparePartsApplication/detail.vue | 32 +- 4 files changed, 387 insertions(+), 268 deletions(-) diff --git a/src/api/http.ts b/src/api/http.ts index 30e8a39..c60d201 100644 --- a/src/api/http.ts +++ b/src/api/http.ts @@ -33,10 +33,24 @@ const instance = axios.create({ */ instance.interceptors.request.use((config) => { const { method, params, url } = config + + // 获取当前页面路由 + let pages = getCurrentPages(); // 获取所有页面栈的实例数组 + let currentPage = pages[pages.length - 1]; // 获取最后一个页面的实例 + console.log(currentPage) + let currentRoute='' + if(currentPage){ + currentRoute = currentPage.route; // 获取当前页面的路由 + if (currentRoute.endsWith('/index')) { + currentRoute = currentRoute.slice(0, -'/index'.length); + } + } + // 附带鉴权的token const headers : any = { token: getAccessToken(), - 'Authorization': 'Bearer ' + getAccessToken() + 'Authorization': 'Bearer ' + getAccessToken(), + "Referer1":currentRoute } if (uni.getStorageSync('openId')) { headers['openId'] = uni.getStorageSync('openId') diff --git a/src/components/item/slectItemList.vue b/src/components/item/slectItemList.vue index e205dbd..7a2d9bb 100644 --- a/src/components/item/slectItemList.vue +++ b/src/components/item/slectItemList.vue @@ -1,276 +1,376 @@ - \ No newline at end of file +} + +::v-deep .u-checkbox-group { + display: grid !important; +} + +.image-popup { + position: relative; + width: 100%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + background-color: rgba(0, 0, 0, 0.8); +} + +.close-btn { + position: absolute; + top: 10px; + right: 10px; + color: white; + font-size: 24px; + cursor: pointer; +} + +.full-image { + max-width: 100%; + max-height: 100%; +} + +.item-dec { + display: flex; + align-items: flex-start; +} + +.image-link { + cursor: pointer; + color: blue; + text-decoration: underline; + margin-bottom: 5px; + overflow: hidden; /* 隐藏超出部分 */ + text-overflow: ellipsis; /* 显示省略号 */ + white-space: nowrap; /* 不换行 */ + max-width: 150px; /* 根据需要设置最大宽度 */ +} + +.image-popup { + position: relative; + width: 100%; + height: 100%; + display: flex; + justify-content: center; + align-items: center; + background-color: rgba(0, 0, 0, 0.8); +} + +.close-btn { + position: absolute; + top: 10px; + right: 10px; + color: white; + font-size: 24px; + cursor: pointer; +} + +.full-image { + max-width: 100%; + max-height: 100%; +} +.tooltip { + position: absolute; + background-color: #f9f9f9; + border: 1px solid #ccc; + padding: 10px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); + z-index: 1000; + white-space: normal; +} + \ No newline at end of file diff --git a/src/pages/sparePartsApplication/addForm.vue b/src/pages/sparePartsApplication/addForm.vue index 6e7b203..44ce140 100644 --- a/src/pages/sparePartsApplication/addForm.vue +++ b/src/pages/sparePartsApplication/addForm.vue @@ -171,6 +171,7 @@ const deviceType = ref('DEVICE') const form = ref({ name: '', + costCenter: '', subList: [] }) const form1 = ref({ @@ -195,6 +196,10 @@ proxy.$modal.showToast('请输入主题') return; } + if (!form.value.costCenter) { + proxy.$modal.showToast('请输入成本中心') + return; + } if (form.value.subList.length === 0) { proxy.$modal.showToast('请选择备件') return; diff --git a/src/pages/sparePartsApplication/detail.vue b/src/pages/sparePartsApplication/detail.vue index e5eed1e..6bdcf7e 100644 --- a/src/pages/sparePartsApplication/detail.vue +++ b/src/pages/sparePartsApplication/detail.vue @@ -17,22 +17,22 @@ 申请备件: - - - 备件名称:{{cur.itemName}} - - - 类型:{{cur.type == 'type'?'设备' :'模具'}} - - - {{cur.type == 'type'?'设备' :'模具'}}名称:{{cur.name}} - - - 是否以旧换新:{{cur.isRadeIn == 'TRUE'?'是' :'否'}} - - - 数量:{{cur.qty}} - + + + 备件名称:{{ cur.itemName }} + + + 类型:{{ cur.type == 'type' ? '设备' : '模具' }} + + + {{ cur.type == 'type' ? '设备' : '模具' }}名称:{{ cur.name }} + + + 是否以旧换新:{{ cur.isRadeIn == 'TRUE' ? '是' : '否' }} + + + 数量:{{ cur.qty }} +