From b972465907945d5c143e133e82e0888bf4f72c12 Mon Sep 17 00:00:00 2001 From: bb_pan Date: Tue, 8 Jul 2025 10:12:51 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E9=83=A8=E6=8E=88=E6=9D=83?= =?UTF-8?q?=E4=B9=A6-=E7=AD=BE=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages.json | 7 + .../authorizeSignature/authorizeSignature.vue | 191 ++++++++++++++++++ src/pages/materialsStation/index/index.vue | 2 +- .../materialsStation/toolsLease/codeOut.vue | 10 +- src/pages/my/signature.vue | 134 ++---------- src/services/materialsStation.js | 18 ++ src/static/home/authorizeSignature.png | Bin 0 -> 5599 bytes 7 files changed, 243 insertions(+), 119 deletions(-) create mode 100644 src/pages/materialsStation/authorizeSignature/authorizeSignature.vue create mode 100644 src/static/home/authorizeSignature.png diff --git a/src/pages.json b/src/pages.json index 512be57..533cead 100644 --- a/src/pages.json +++ b/src/pages.json @@ -813,6 +813,13 @@ "style": { "navigationStyle": "custom" } + }, + // 项目部授权书 + { + "path": "pages/materialsStation/authorizeSignature/authorizeSignature", + "style": { + "navigationStyle": "custom" + } } // 材料站 end ], diff --git a/src/pages/materialsStation/authorizeSignature/authorizeSignature.vue b/src/pages/materialsStation/authorizeSignature/authorizeSignature.vue new file mode 100644 index 0000000..354ce9d --- /dev/null +++ b/src/pages/materialsStation/authorizeSignature/authorizeSignature.vue @@ -0,0 +1,191 @@ + + + + + diff --git a/src/pages/materialsStation/index/index.vue b/src/pages/materialsStation/index/index.vue index f6502f2..00751eb 100644 --- a/src/pages/materialsStation/index/index.vue +++ b/src/pages/materialsStation/index/index.vue @@ -63,6 +63,7 @@ const isUsingList = ref([ { path: 'teamBackRecord', src: 'teamBack', isShow: true }, { path: 'teamStore', src: 'teamStore', isShow: true }, { path: 'teamWarning', src: 'teamWarning', isShow: true }, + { path: 'authorizeSignature', src: 'authorizeSignature', isShow: true }, ]) let statusBarHeight = ref('50px') @@ -279,7 +280,6 @@ onShow(async () => { } .sections { display: flex; - justify-content: space-around; flex-wrap: wrap; box-sizing: border-box; padding-top: 6%; diff --git a/src/pages/materialsStation/toolsLease/codeOut.vue b/src/pages/materialsStation/toolsLease/codeOut.vue index 8d6a3a7..046f5b5 100644 --- a/src/pages/materialsStation/toolsLease/codeOut.vue +++ b/src/pages/materialsStation/toolsLease/codeOut.vue @@ -174,6 +174,7 @@ import { getCodeScanAPI, getMachineByIdApi, getCodeDeviceListAPI, + getMachine, } from '@/services/materialsStation' import ScanQrCode from '@/pages/devicesSearch/ScanQrCode.vue' const scanQrCodeRef = ref(null) @@ -446,7 +447,14 @@ const handleQrCode = async (qrCode) => { const params = { qrCode, typeId: queryParams.value.typeId } console.log('🚀 ~ success: ~ queryParams.value.isAddCode:', queryParams.value.isAddCode) try { - const res = await getCodeScanAPI(params) + const res = null + if (queryParamsTemp.value.isBack) { + params.proId = queryParamsTemp.value.projectId + params.teamId = queryParamsTemp.value.teamId + res = await getMachine(params) + } else { + res = await getCodeScanAPI(params) + } console.log('🚀 ~ success: ~ res:', res) if (res.code === 200) { if (res.data && res.data.recordList.length > 0) { diff --git a/src/pages/my/signature.vue b/src/pages/my/signature.vue index 71aacc4..7626173 100644 --- a/src/pages/my/signature.vue +++ b/src/pages/my/signature.vue @@ -24,7 +24,7 @@ import { updateLeaseApplyInfoSign, updateSignById, } from '@/services/signature.js' -import { toolsLeaseApplyInfoSign } from '@/services/materialsStation' +import { toolsLeaseApplyInfoSign, updateLeaseApplyInfoSignApi } from '@/services/materialsStation' import { baseURL } from '@/utils/http' let isCanvas = ref(false) @@ -56,7 +56,7 @@ onLoad((opt) => { }) onMounted(() => { - if (opts.isLease || opts.isBack) return + if (opts.isLease || opts.isBack || opts.isAuthorize) return getSignData() }) @@ -112,7 +112,7 @@ const complete = (e) => { .replace(/^data:image\/(jpeg|png|webp);base64,/, '') // console.log('🚀 ~ WebP base64:', webpBase64) - uploadImg2(webpBase64) + uploadSignUrl(webpBase64) } } @@ -183,71 +183,15 @@ const onCameraSuccess = (file) => { isRotate.value = false signType.value = 1 const signUrl = file - - try { - if (opts.isLease) { - const params = { - id: opts.id, - leaseSignUrl: signUrl, - leaseSignType: signType.value, - taskType: opts.taskType || '', - publishTask: opts.publishTask || '', - } - console.log('🚀 ~ success: ~ params:', params) - const res = updateLeaseApplyInfoSign(params).then((res) => { - console.log('🚀 ~ uploadImg-领料 ~ res:', res) - uni.navigateBack() - }) - console.log('🚀 ~ uploadImg-领料 ~ res:', res) - uni.navigateBack() - } else if (opts.isToolsLease) { - const params = { - id: opts.id, - leaseSignUrl: signUrl, - leaseSignType: signType.value, - taskType: opts.taskType || '', - publishTask: opts.publishTask || '', - } - console.log('🚀 ~ success: ~ params:', params) - toolsLeaseApplyInfoSign(params).then((res) => { - console.log('🚀 ~ uploadImg-领料 ~ res:', res) - uni.navigateBack() - }) - } else if (opts.isBack) { - const params = { - id: opts.id, - backSignUrl: signUrl, - backSignType: signType.value, - } - console.log('🚀 ~ success: ~ params:', params) - updateSignById(params).then((res) => { - console.log('🚀 ~ uploadImg-退料 ~ res:', res) - uni.navigateBack() - }) - } else { - const params = { - signUrl: signUrl, - signType: signType.value, - } - updateSign(params).then((res) => { - console.log('🚀 ~ uploadImg-个人中心 ~ res:', res) - getSignData() - }) - } - } catch (error) { - console.log('🚀 ~ uploadImg ~ error:', error) - uni.showToast({ - title: '上传失败', - icon: 'none', - }) - } + + uploadSignUrl(signUrl) } // 上传 -const uploadImg2 = async (base64Data) => { +const uploadSignUrl = async (base64Data) => { try { const signUrl = base64Data if (opts.isLease) { - console.log('🚀 ~ uploadImg2 ~ opts:', opts) + console.log('🚀 ~ uploadSignUrl ~ opts:', opts) const params = { id: opts.id, leaseSignUrl: signUrl, @@ -271,6 +215,15 @@ const uploadImg2 = async (base64Data) => { const res = await toolsLeaseApplyInfoSign(params) console.log('🚀 ~ uploadImg-领料 ~ res:', res) uni.navigateBack() + } else if (opts.isAuthorize) { + const params = { + parentId: opts.id, + signName: signUrl, + signType: signType.value, + } + const res = await updateLeaseApplyInfoSignApi(params) + console.log('🚀 ~ uploadSignUrl ~ 项目部授权:', res) + uni.navigateBack() } else if (opts.isBack) { const params = { id: opts.id, @@ -298,60 +251,7 @@ const uploadImg2 = async (base64Data) => { }) } } -const uploadImg = (path) => { - uni.uploadFile({ - url: '/file/upload', - filePath: path, - name: 'file', - header: { - // Authorization: this.token, - }, - success: async (res) => { - console.log('🚀 ~ uploadImg ~ res:', res) - try { - const signUrl = JSON.parse(res.data).data.url - if (opts.isLease) { - const params = { - id: opts.id, - leaseSignUrl: signUrl, - leaseSignType: signType.value, - } - console.log('🚀 ~ success: ~ params:', params) - const res = await updateLeaseApplyInfoSign(params) - console.log('🚀 ~ uploadImg-领料 ~ res:', res) - uni.navigateBack() - } else if (opts.isBack) { - const params = { - id: opts.id, - backSignUrl: signUrl, - backSignType: signType.value, - } - console.log('🚀 ~ success: ~ params:', params) - const res = await updateSignById(params) - console.log('🚀 ~ uploadImg-退料 ~ res:', res) - uni.navigateBack() - } else { - const params = { - signUrl: signUrl, - signType: signType.value, - } - const res = await updateSign(params) - console.log('🚀 ~ uploadImg-个人中心 ~ res:', res) - getSignData() - } - } catch (error) { - console.log('🚀 ~ uploadImg ~ error:', error) - uni.showToast({ - title: '上传失败', - icon: 'none', - }) - } - }, - fail: (err) => { - console.log('🚀 ~ uploadImg ~ err:', err) - }, - }) -} +