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 @@
+
+
+
+
+
+ {{ item.title }}
+
+
+ 修改时间:{{ item.updateTime }}
+
+
+ 创建时间:{{ item.createTime }}
+
+
+
+
+
+
+
+
\ 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电子合同
-
-
- 甲方:湖南瀚海科技有限公司
-
-
- 乙方:四川特能博世科技有限公司
-
-
-
+
+
+
-
+ clickSwipeAction(e, item)"
+ :options="options">
+
+
+
-
+
@@ -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 @@
+
+
+
+
{
- this.imageArr = res.data
- this.onChangeBgImage()
- }
- })
+ // uni.request({
+ // url : 'http://192.168.1.5:5173/arr',
+ // method: 'GET',
+ // success : res => {
+ // this.imageArr = res.data
+ // this.onChangeBgImage()
+ // }
+ // })
this.id = id
this.getDetail()
@@ -89,14 +93,34 @@
// }
// });
+
+ let a = {}
+ let b = {}
+
+ if(this.id){
+ a = JSON.parse(this.form.bossPosition)
+ b = JSON.parse(this.form.employeePosition)
+
+ for(let ak in a){
+ a[ak] = this.$utils.screenSystemInfoInt(a[ak]) - 0
+ }
+ for(let bk in b){
+ b[bk] = this.$utils.screenSystemInfoInt(b[bk]) - 0
+ }
+
+ console.log(a, b);
+ }
+
uni.getImageInfo({
- src: 'https://img.teyizhao.com/2025-02-03/45a56422-7294-41a0-88af-cf2a41cb9554.png',
+ src: 'https://img.teyizhao.com/2025-02-07/3d837c0e-91f4-4682-82d9-a04c2af737e8.png',
success : res => {
this.setData({
graph: {
id : 'a',
- w: 100,
- h: 50,
+ w: a.w || 100,
+ h: a.h || 50,
+ x: a.x || 30,
+ y: a.y || 30,
type: 'image',
url : res.path
}
@@ -108,13 +132,15 @@
})
uni.getImageInfo({
- src: 'https://img.teyizhao.com/2025-02-03/45a56422-7294-41a0-88af-cf2a41cb9554.png',
+ src: 'https://img.teyizhao.com/2025-02-07/af4786c0-7b62-4a86-a090-9f28eca3674a.png',
success : res => {
this.setData({
graph: {
id : 'b',
- w: 100,
- h: 50,
+ w: b.w || 100,
+ h: b.h || 50,
+ x: b.x || 160,
+ y: b.y || 30,
type: 'image',
url : res.path
}
@@ -139,7 +165,7 @@
// this.form.template = pdfUrl
- // this.pdf2imagebase64()
+ this.pdf2imagebase64()
this.changeBgImage()
@@ -226,6 +252,12 @@
},
async submit() {
+ if(this.$utils.verificationAll(this.form, {
+ title : '请输入标题',
+ })){
+ return
+ }
+
let bossPosition = {
// ...this.drawArr.a,
x : this.$utils.rpxSystemInfoInt(this.drawArr.a.x),
@@ -251,13 +283,13 @@
}
})
},
- pdf2imagebase64(){
- this.$api('pdf2imagebase64', {
+ // pdf2imagebase64(){
+ // this.$api('pdf2imagebase64', {
- }, res => {
+ // }, res => {
- })
- },
+ // })
+ // },
// 修改或者保存模板
saveOrUpdate(){
@@ -275,6 +307,20 @@
this.onAddImage()
return
}
+ this.$api('queryContractTemplateById', {
+ contractTemplateId : this.id
+ }).then(res => {
+ if(res.code == 200){
+ this.form = res.result
+
+ delete this.form.createBy
+ delete this.form.createTime
+ delete this.form.updateBy
+ delete this.form.updateTime
+
+ this.onAddImage()
+ }
+ })
},
}
}
@@ -283,6 +329,18 @@
\ No newline at end of file
diff --git a/pages_order/static/contract/contract.png b/static/image/contract/contract.png
similarity index 100%
rename from pages_order/static/contract/contract.png
rename to static/image/contract/contract.png
diff --git a/utils/utils.js b/utils/utils.js
index c439358..1fc4a0b 100644
--- a/utils/utils.js
+++ b/utils/utils.js
@@ -185,7 +185,7 @@ export function rpxSystemInfoInt(a, fixed = 2){
* @param {Integer} a 数字
*/
export function screenSystemInfoInt(a, fixed = 2){
- return (a * sys.screenWidth / 750).toFixed(fixed)
+ return (a * (sys.screenWidth / 750)).toFixed(fixed)
}
export default {