diff --git a/pageIndex/addSafeCheck/addSafeCheck.vue b/pageIndex/addSafeCheck/addSafeCheck.vue index 8d60cbe..8beda4e 100644 --- a/pageIndex/addSafeCheck/addSafeCheck.vue +++ b/pageIndex/addSafeCheck/addSafeCheck.vue @@ -285,7 +285,7 @@ export default { searchKeyword: '', // 搜索关键词 selectedCompany: null, // 已选择的公司 pics: [],//上传图片 - baseApi: '/admin-api/infra/file/upload', + baseApi: '/prod-api/admin-api/infra/file/upload', enterpriseId: '',//公司id proviceCode: '',//公司id cityCode: '',//公司id diff --git a/pageIndex/checkHsitory/checkHsitory.vue b/pageIndex/checkHsitory/checkHsitory.vue index 69e2ce8..2db8613 100644 --- a/pageIndex/checkHsitory/checkHsitory.vue +++ b/pageIndex/checkHsitory/checkHsitory.vue @@ -71,11 +71,17 @@ - 修改 - 签字 - 查看报告 - 复查 - 查看详情 + 修改 + 签字 + + 查看报告 + + 复查 + 查看详情 @@ -106,7 +112,7 @@ 检查人与企业签字 --> - + @@ -132,8 +138,8 @@ - + @@ -174,6 +180,8 @@ import CustomRefresher from '@/components/custom-refresher/custom-refresher' import { parseTime } from '@/utils/ruoyi' import { getDicts } from '@/api/system/user' import * as Api from '@/api/index/index' +import { baseUrl } from '@/config' +import { getAccessToken, setToken } from '@/utils/auth' import { getLabelByValue } from '@/utils/showDictLabel.js' // 导入工具函数 export default { components: { @@ -204,6 +212,10 @@ export default { signType: null, signItemId: null, selectedItem: null, + expFile: { + fileType: 'png', + }, + baseApi: '/prod-api/admin-api/infra/file/upload', } }, computed: { @@ -214,53 +226,83 @@ export default { mounted() { // 监听,有必要时请正确处理on、once和off uni.$on('getSignImg', (e) => { + let that = this console.log('getSignImg', e) // 多签名场景下可根据 sid 区分不同签名 if (e.sid == 'sign-board-popup') { - if (this.signType == 1) { - this.selectedItem.checkPeopleSignature = e.base64 - Api.updateInitialReview({ - id: this.signItemId, - checkPeopleSignature: e.base64 - }).then(res => { - debugger - uni.showToast({ - title: '检查人签字完成', - icon: 'none', - mask: true - }) - if (this.selectedItem.enterpriseSignature) { - this.updateItemStatus() - }else{ - this.$refs.paging.refresh() + + uni.uploadFile({ + header: { + "Authorization": "Bearer " + getAccessToken(), + }, + url: baseUrl + that.baseApi, + filePath: e.path, + name: 'file', + success(res) { + var obj = JSON.parse(res.data); + if (obj.code != 0) { + uni.showToast({ + title: "签字失败,请重试", + icon: "none" + }) + } + + if (that.signType == 1) { + + that.selectedItem.checkPeopleSignature = e.base64 + Api.updateInitialReview({ + id: that.signItemId, + checkPeopleSignature: obj.data + }).then(res => { + debugger + uni.showToast({ + title: '检查人签字完成', + icon: 'none', + mask: true + }) + if (that.selectedItem.enterpriseSignature) { + that.updateItemStatus() + } else { + that.$refs.paging.refresh() + } + console.log(res) + }).catch(err => { + console.log(err) + }) + } else { + that.selectedItem.enterpriseSignature = e.base64 + Api.updateInitialReview({ + id: that.signItemId, + enterpriseSignature: obj.data + }).then(res => { + debugger + uni.showToast({ + title: '企业签字完成', + icon: 'none', + mask: true + }) + console.log(res) + if (that.selectedItem.checkPeopleSignature) { + that.updateItemStatus() + + } else { + that.$refs.paging.refresh() + } + }).catch(err => { + console.log(err) + }) } - console.log(res) - }).catch(err => { - console.log(err) - }) - } else { - this.selectedItem.enterpriseSignature = e.base64 - Api.updateInitialReview({ - id: this.signItemId, - enterpriseSignature: e.base64 - }).then(res => { - debugger + + }, + fail(res) { uni.showToast({ - title: '企业签字完成', - icon: 'none', - mask: true + title: "签字失败,请重试", + icon: "none" }) - console.log(res) - if (this.selectedItem.checkPeopleSignature) { - this.updateItemStatus() + } + }) + - }else{ - this.$refs.paging.refresh() - } - }).catch(err => { - console.log(err) - }) - } this.signBase64 = e.base64 this.signTempimg = e.path } @@ -382,10 +424,10 @@ export default { // 一定注意不能确认签字完成后立马关闭弹窗,否则签字板会销毁,无法获取签名。需要等签名正确获取到之后再关闭弹窗 }, //查看详情,修改都走这里 - viewDetails(item,val,type){ + viewDetails(item, val, type) { const data = encodeURIComponent(JSON.stringify(item)) uni.navigateTo({ - url: '/pageIndex/addSafeCheck/readdSafeCheck?data='+data+'&val='+val+'&type='+type + url: '/pageIndex/addSafeCheck/readdSafeCheck?data=' + data + '&val=' + val + '&type=' + type }) }, goReport(item) {