Browse Source

'1'

master
前端-胡立永 3 weeks ago
parent
commit
d53197b83c
13 changed files with 380 additions and 100 deletions
  1. +1
    -1
      api/model/contact.js
  2. +3
    -3
      components/canvas-drag/index.vue
  3. +72
    -0
      components/list/contract/contractManageItem.vue
  4. +83
    -0
      components/list/contract/contractManagePopup.vue
  5. +1
    -1
      config.js
  6. +34
    -4
      pages_order/contract/contract.vue
  7. +55
    -12
      pages_order/contract/contractDetail.vue
  8. +37
    -57
      pages_order/contract/contractManage.vue
  9. +78
    -20
      pages_order/contract/contractManageEdit.vue
  10. +1
    -1
      pages_order/mine/promotion.vue
  11. +14
    -0
      pages_order/work/userDetail.vue
  12. +0
    -0
      static/image/contract/contract.png
  13. +1
    -1
      utils/utils.js

+ 1
- 1
api/model/contact.js View File

@ -35,7 +35,7 @@ const api = {
},
//电子合同-根据id查询电子合同详情
queryContracById: {
url: '/employ/contract/queryContracById',
url: '/employ/contract/queryContractById',
method: 'GET',
auth: true,
},


+ 3
- 3
components/canvas-drag/index.vue View File

@ -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 {


+ 72
- 0
components/list/contract/contractManageItem.vue View File

@ -0,0 +1,72 @@
<template>
<view class="projectContent"
@click="$emit('click')">
<image src="/static/image/contract/contract.png" mode="aspectFill" />
<view class="info">
<view class="projectName">
{{ item.title }}
</view>
<view class="text"
v-if="item.updateTime">
修改时间{{ item.updateTime }}
</view>
<view class="text">
创建时间{{ item.createTime }}
</view>
</view>
</view>
</template>
<script>
export default {
props : ['item'],
data() {
return {
}
},
methods: {
}
}
</script>
<style scoped lang="scss">
.projectContent {
background-color: #fff;
display: flex;
image {
width: 140rpx;
height: 120rpx;
margin: 20rpx;
}
.info {
margin: 28rpx 10rpx;
flex-direction: column;
display: flex;
gap: 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;
}
}
</style>

+ 83
- 0
components/list/contract/contractManagePopup.vue View File

@ -0,0 +1,83 @@
<template>
<uv-popup ref="popup" :round="30">
<view class="content">
<scroll-view
scroll-y="true"
style="height: 100%;"
@scrolltolower="loadMoreData">
<view class="item"
v-for="(item, index) in list"
:key="item.id"
>
<contractManageItem
@click="send(item)"
:item="item"/>
</view>
</scroll-view>
</view>
</uv-popup>
</template>
<script>
import mixinList from '@/mixins/list.js'
import contractManageItem from './contractManageItem'
export default {
components : {
contractManageItem,
},
mixins : [mixinList],
data() {
return {
mixinsListApi : 'queryContractTemplateList',
uid : 0,
}
},
methods: {
open(id){
this.uid = id
this.getData()
this.$refs.popup.open('bottom')
},
send(item){
uni.showModal({
title: `确认发送${item.title}合同吗?`,
success : e => {
if(e.confirm){
this.$api('addContract', {
bossPage : item.bossPage,
bossPosition : item.bossPosition,
bossStatus : 0,
employeePage : item.employeePage,
employeePosition : item.employeePosition,
template : item.template,
contract : item.contract,
employeeStatus : 0,
employeeId : this.uid,
title : item.title,
}).then(res => {
if(res.code == 200){
uni.showToast({
title: '发送成功',
icon: 'none'
})
this.$refs.popup.close()
}
})
}
}
})
},
}
}
</script>
<style scoped lang="scss">
.content{
height: 60vh;
width: 100%;
padding-top: 30rpx;
.item{
}
}
</style>

+ 1
- 1
config.js View File

@ -7,7 +7,7 @@ import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI);
// 当前环境
const type = 'prod'
const type = 'dev'
// 环境配置


+ 34
- 4
pages_order/contract/contract.vue View File

@ -14,12 +14,13 @@
@click="clickTabs"></uv-tabs>
</view>
<view class="content">
<view class="projectContent"
v-for="(item, index) in list"
@click="$utils.navigateTo('/pages_order/contract/contractDetail?id=' + item.id)"
@click="showPDF(item)"
:key="index">
<image src="../static/contract/contract.png" alt="" />
<image src="/static/image/contract/contract.png" mode="aspectFill"/>
<view class="itemList">
<view class="projectName">
<!-- xxxx电子合同 -->
@ -27,11 +28,11 @@
</view>
<view class="buyer">
<!-- 甲方湖南瀚海科技有限公司 -->
{{ item.nameA }}
甲方{{ item.companyName }}
</view>
<view class="seller">
<!-- 乙方四川特能博世科技有限公司 -->
{{ item.nameB }}
乙方{{ item.employeeName }}
</view>
</view>
<view class="run">
@ -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)
// }
// }
// })
},
}
}
</script>


+ 55
- 12
pages_order/contract/contractDetail.vue View File

@ -4,6 +4,7 @@
leftClick
@leftClick="$utils.navigateBack"/>
<view style="padding: 25rpx;">
<canvas-drag ref="canvasRef"
id="canvas-drag"
@ -26,19 +27,24 @@
mode="widthFix"></image>
</view>
<view class="uni-color-btn"
<!-- <view class="uni-color-btn"
@click.stop="onChangeBgImage">
导入合同
</view>
</view> -->
<view class="uni-color-btn"
@click.stop="toSignature">
签名
</view>
<view class="uni-color-btn"
<!-- <view class="uni-color-btn"
@click.stop="onExportJSON">
保存合同
</view> -->
<view class="uni-color-btn"
@click.stop="showPDF">
查看完整内容
</view>
</view>
@ -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()
})
},
}
}


+ 37
- 57
pages_order/contract/contractManage.vue View File

@ -4,34 +4,24 @@
leftClick
@leftClick="$utils.navigateBack"/>
<view class="content">
<view class="projectContent"
v-for="(item, index) in list"
:key="item.id"
@click="$utils.navigateTo('/pages_order/contract/contractManageEdit')"
>
<image src="../static/contract/contract.png" alt="" />
<view class="info">
<view class="projectName">
xxxx电子合同
</view>
<view class="text">
甲方湖南瀚海科技有限公司
</view>
<view class="text">
乙方四川特能博世科技有限公司
</view>
</view>
<view class="run"
<uv-swipe-action>
<view class="content">
<view class="projectContent"
v-for="(item, index) in list"
:key="item.id"
>
<uv-icon
name="arrow-right"
color="#2979ff"
size="30rpx"></uv-icon>
<uv-swipe-action-item
@click="e => clickSwipeAction(e, item)"
:options="options">
<contractManageItem
@click="$utils.navigateTo('/pages_order/contract/contractManageEdit?id=' + item.id)"
:item="item"/>
</uv-swipe-action-item>
</view>
</view>
</view>
</uv-swipe-action>
<view class="plus-contract"
@click="$utils.navigateTo('/pages_order/contract/contractManageEdit')">
@ -43,15 +33,35 @@
<script>
import mixinList from '@/mixins/list.js'
import contractManageItem from '@/components/list/contract/contractManageItem.vue'
export default {
components : {
contractManageItem,
},
mixins : [mixinList],
data() {
return {
mixinsListApi : 'queryContractTemplateList',
options : [
{
text: '删除',
style: {
backgroundColor: '#FA5A0A'
}
},
],
}
},
methods: {
clickSwipeAction(e, item){
this.$api('', {
}).then(res => {
if(res.code == 200){
this.getData()
}
})
},
}
}
</script>
@ -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;


+ 78
- 20
pages_order/contract/contractManageEdit.vue View File

@ -1,6 +1,10 @@
<template>
<view class="page">
<navbar title="编辑模板" leftClick @leftClick="$utils.navigateBack" />
<view class="title">
<input type="text" placeholder="请输入标题" v-model="form.title"/>
</view>
<view style="padding: 25rpx;background-color: #fff;">
<canvas-drag ref="canvasRef"
@ -51,14 +55,14 @@
}
},
onLoad({id}) {
uni.request({
url : 'http://192.168.1.5:5173/arr',
method: 'GET',
success : res => {
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 @@
<style scoped lang="scss">
.page {
padding-bottom: 100rpx;
.title{
padding: 10rpx 30rpx;
background-color: #fff;
margin-bottom: 10rpx;
input{
padding: 20rpx;
background-color: rgba($uni-color, 0.1);
color: $uni-color;
border: 1rpx solid $uni-color;
border-radius: 10rpx;
}
}
.btn-list {
display: flex;
flex-wrap: wrap;


+ 1
- 1
pages_order/mine/promotion.vue View File

@ -23,7 +23,7 @@
return {
url: '',
title: '123123',
baseUrl: 'https://img.teyizhao.com/',
baseUrl: 'https://img.teyizhao.com/',//https://img.teyizhao.com/employ/employ.jpg
canvas: {},
imagePath: '',
}


+ 14
- 0
pages_order/work/userDetail.vue View File

@ -122,14 +122,23 @@
</view>
</view>
<view class="uni-color-btn"
@click="$refs.contractManagePopup.open(hanHaiMember.id)">
发送合同
</view>
<contractManagePopup ref="contractManagePopup"/>
</view>
</template>
<script>
import userHead from '../components/user/userHead.vue'
import contractManagePopup from '@/components/list/contract/contractManagePopup.vue'
export default {
components: {
userHead,
contractManagePopup,
},
data() {
return {
@ -302,5 +311,10 @@
}
}
}
.uni-color-btn{
// position: fixed;
// right: 40rpx;
// bottom: 30vh;
}
}
</style>

pages_order/static/contract/contract.png → static/image/contract/contract.png View File


+ 1
- 1
utils/utils.js View File

@ -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 {


Loading…
Cancel
Save