From d53197b83c67d336c7898e8922264cb3acb96a47 Mon Sep 17 00:00:00 2001 From: huliyong <2783385703@qq.com> Date: Fri, 7 Feb 2025 21:08:32 +0800 Subject: [PATCH] '1' --- api/model/contact.js | 2 +- components/canvas-drag/index.vue | 6 +- components/list/contract/contractManageItem.vue | 72 +++++++++++++++ components/list/contract/contractManagePopup.vue | 83 +++++++++++++++++ config.js | 2 +- pages_order/contract/contract.vue | 38 +++++++- pages_order/contract/contractDetail.vue | 67 +++++++++++--- pages_order/contract/contractManage.vue | 94 ++++++++------------ pages_order/contract/contractManageEdit.vue | 98 ++++++++++++++++----- pages_order/mine/promotion.vue | 2 +- pages_order/work/userDetail.vue | 14 +++ .../static => static/image}/contract/contract.png | Bin utils/utils.js | 2 +- 13 files changed, 380 insertions(+), 100 deletions(-) create mode 100644 components/list/contract/contractManageItem.vue create mode 100644 components/list/contract/contractManagePopup.vue rename {pages_order/static => static/image}/contract/contract.png (100%) diff --git a/api/model/contact.js b/api/model/contact.js index 74fbdc5..b949893 100644 --- a/api/model/contact.js +++ b/api/model/contact.js @@ -35,7 +35,7 @@ const api = { }, //电子合同-根据id查询电子合同详情 queryContracById: { - url: '/employ/contract/queryContracById', + url: '/employ/contract/queryContractById', method: 'GET', auth: true, }, diff --git a/components/canvas-drag/index.vue b/components/canvas-drag/index.vue index 4f3394c..08f0543 100644 --- a/components/canvas-drag/index.vue +++ b/components/canvas-drag/index.vue @@ -9,7 +9,7 @@ // 删除按钮 let DRAG_ICON = '/static/components/canvas-drag/scale.png'; // 缩放按钮 // 缩放按钮 - const STROKE_COLOR = 'red'; + const STROKE_COLOR = '#fff'; const ROTATE_ENABLED = false; let isMove = false; // 标识触摸后是否有移动,用来判断是否需要增加操作历史 // 标识触摸后是否有移动,用来判断是否需要增加操作历史 @@ -116,7 +116,7 @@ this.ctx.drawImage(DRAG_ICON, this.x + textWidth - 15, this.y + textHeight - 15, 30, 30); } else { this.ctx.strokeRect(this.x, this.y, this.w, this.h); - this.ctx.drawImage(DELETE_ICON, this.x - 15, this.y - 15, 30, 30); + // this.ctx.drawImage(DELETE_ICON, this.x - 15, this.y - 15, 30, 30); this.ctx.drawImage(DRAG_ICON, this.x + this.w - 15, this.y + this.h - 15, 30, 30); } } @@ -826,7 +826,7 @@ }; if (action === 'del') { - lastDelIndex = index; // 标记需要删除的元素 + // lastDelIndex = index; // 标记需要删除的元素 item.selected = true; } } else { diff --git a/components/list/contract/contractManageItem.vue b/components/list/contract/contractManageItem.vue new file mode 100644 index 0000000..c40a81f --- /dev/null +++ b/components/list/contract/contractManageItem.vue @@ -0,0 +1,72 @@ + + + + + \ No newline at end of file diff --git a/components/list/contract/contractManagePopup.vue b/components/list/contract/contractManagePopup.vue new file mode 100644 index 0000000..ff27d59 --- /dev/null +++ b/components/list/contract/contractManagePopup.vue @@ -0,0 +1,83 @@ + + + + + diff --git a/config.js b/config.js index 03ac722..2ca1da3 100644 --- a/config.js +++ b/config.js @@ -7,7 +7,7 @@ import uvUI from '@/uni_modules/uv-ui-tools' Vue.use(uvUI); // 当前环境 -const type = 'prod' +const type = 'dev' // 环境配置 diff --git a/pages_order/contract/contract.vue b/pages_order/contract/contract.vue index 0d16439..0e60215 100644 --- a/pages_order/contract/contract.vue +++ b/pages_order/contract/contract.vue @@ -14,12 +14,13 @@ @click="clickTabs"> + - + @@ -27,11 +28,11 @@ - {{ item.nameA }} + 甲方:{{ item.companyName }} - {{ item.nameB }} + 乙方:{{ item.employeeName }} @@ -80,6 +81,35 @@ this.type = index this.getData() }, + showPDF(item){ + + this.$utils. + navigateTo('/pages_order/contract/contractDetail?id=' + + item.id) + + + // uni.showModal({ + // title: '签署前请熟知合同内容!', + // cancelText: '已知晓', + // confirmText: '查看内容', + // success : e => { + // if(e.confirm){ + // uni.downloadFile({ + // url : item.contract, + // success : res => { + // uni.openDocument({ + // filePath: res.tempFilePath, + // }) + // } + // }) + // }else{ + // this.$utils. + // navigateTo('/pages_order/contract/contractDetail?id=' + // + item.id) + // } + // } + // }) + }, } } diff --git a/pages_order/contract/contractDetail.vue b/pages_order/contract/contractDetail.vue index e60bb0a..c6e3a49 100644 --- a/pages_order/contract/contractDetail.vue +++ b/pages_order/contract/contractDetail.vue @@ -4,6 +4,7 @@ leftClick @leftClick="$utils.navigateBack"/> + - 导入合同 - + --> 签名 - 保存合同 + --> + + + 查看完整内容 @@ -85,6 +91,17 @@ } }) }, + showPDF(){ + console.log(1); + uni.downloadFile({ + url : this.detail.contract, + success : res => { + uni.openDocument({ + filePath: res.tempFilePath, + }) + } + }) + }, initCanvas() { this.ctx = uni.createCanvasContext("mycanvas") @@ -92,8 +109,19 @@ // 去签名 toSignature(){ - uni.navigateTo({ - url: `/pages_order/contract/electronicSignature?id=${this.id}&signature=1` + uni.showModal({ + title: '签署前请熟知合同完整内容!', + cancelText: '已知晓', + confirmText: '查看完整内容', + success : e => { + if(e.confirm){ + this.showPDF() + }else{ + uni.navigateTo({ + url: `/pages_order/contract/electronicSignature?id=${this.id}&signature=1` + }) + } + } }) }, @@ -167,20 +195,35 @@ let url = uni.getStorageSync('electronicSignature') if(!url) return uni.removeStorageSync('electronicSignature') + + let graph = {} + + if(this.role){ + graph = JSON.parse(this.form.bossPosition) + this.detail.bossImage = url + }else{ + graph = JSON.parse(this.form.employeePosition) + this.detail.employeeImage = url + } + + for(let k in graph){ + graph[k] = this.$utils.screenSystemInfoInt(graph[k]) - 0 + } + this.setData({ graph: { - w: 100, - h: 50, - x : 0, - y : 0, + w: graph.w, + h: graph.h, + x : graph.x, + y : graph.y, type: 'image', url, permitSelected : true, } }); - // this.$nextTick(() => { - // this.onExportJSON() - // }) + this.$nextTick(() => { + this.onExportJSON() + }) }, } } diff --git a/pages_order/contract/contractManage.vue b/pages_order/contract/contractManage.vue index 6bf854e..522b325 100644 --- a/pages_order/contract/contractManage.vue +++ b/pages_order/contract/contractManage.vue @@ -4,34 +4,24 @@ leftClick @leftClick="$utils.navigateBack"/> - - - - - - - xxxx电子合同 - - - 甲方:湖南瀚海科技有限公司 - - - 乙方:四川特能博世科技有限公司 - - - + + + - + + + + - + @@ -43,15 +33,35 @@ @@ -61,37 +71,7 @@ .content { width: 100%; height: 100%; - .projectContent { - background-color: #fff; - display: flex; - margin: 30rpx; - border-radius: 20rpx; - image { - width: 140rpx; - height: 120rpx; - margin: 20rpx; - } - .info { - margin: 28rpx 10rpx; - .projectName { - font-size: 32rpx; - } - .text { - font-size: 24rpx; - } - } - .run{ - margin: auto; - margin-right: 30rpx; - height: 60rpx; - width: 60rpx; - border-radius: 50%; - border: 1px solid $uni-color; - display: flex; - justify-content: center; - align-items: center; - } - } + } .plus-contract{ position: fixed; diff --git a/pages_order/contract/contractManageEdit.vue b/pages_order/contract/contractManageEdit.vue index e0e3998..693bec0 100644 --- a/pages_order/contract/contractManageEdit.vue +++ b/pages_order/contract/contractManageEdit.vue @@ -1,6 +1,10 @@