17b2d8f117
2、新增用户等级
576 lines
23 KiB
Vue
576 lines
23 KiB
Vue
<template>
|
||
<view class="">
|
||
<top-bar></top-bar>
|
||
<common-nav></common-nav>
|
||
<view class="w-1200">
|
||
<el-row :gutter="20">
|
||
<el-col :span="6">
|
||
<el-menu @select="menuSelect" :default-active="menuIndex" class="el-menu-vertical-demo">
|
||
<el-menu-item index="0">
|
||
<i class="el-icon-edit"></i>
|
||
<span slot="title">待创建</span>
|
||
</el-menu-item>
|
||
<el-menu-item index="1">
|
||
<i class="el-icon-warning-outline"></i>
|
||
<span slot="title">待签署</span>
|
||
</el-menu-item>
|
||
<el-menu-item index="2">
|
||
<i class="el-icon-circle-check"></i>
|
||
<span slot="title">已完成</span>
|
||
</el-menu-item>
|
||
<el-menu-item index="-1">
|
||
<i class="el-icon-delete"></i>
|
||
<span slot="title">已作废</span>
|
||
</el-menu-item>
|
||
</el-menu>
|
||
<view class="mt-20 bg-white flex justify-start items-center sign pointer" @click="selectSign">
|
||
<view class="icon">
|
||
<agreement theme="outline" size="18" fill="#999" strokeLinecap="square"/>
|
||
</view>
|
||
<text class="ml-20" :class="[isSign ? 'text-main' : '']">签约宝</text>
|
||
</view>
|
||
</el-col>
|
||
<el-col :span="18">
|
||
<view class="contract-list" v-if="!isSign">
|
||
<view class="trade-method">
|
||
<view @click="formData.tradeMethod = 1" class="trade-method-item"
|
||
:class="{active: formData.tradeMethod == 1}">自主交易
|
||
</view>
|
||
<view @click="formData.tradeMethod = 0" class="trade-method-item"
|
||
:class="{active: formData.tradeMethod == 0}">金久信公正
|
||
</view>
|
||
</view>
|
||
<view v-for="(item,index) in tableData.rows" class="contract-box" :key="index">
|
||
<view class="contract-left">
|
||
<view class="contract-left-top">
|
||
<el-tag size="mini" v-if="item.contract.type === 'enquiry'" type="danger"
|
||
effect="plain">询价单
|
||
</el-tag>
|
||
<el-tag size="mini" v-else-if="item.contract.type === 'process'" type="warning"
|
||
effect="plain">加工单
|
||
</el-tag>
|
||
<el-tag size="mini" v-else-if="item.contract.type === 'sign'" type="success"
|
||
effect="plain">签约宝
|
||
</el-tag>
|
||
<view class="contract-product">
|
||
{{ item.contract.productTitle }}
|
||
</view>
|
||
<view class="contract-status">
|
||
<text v-if="item.contract.status == 0">待创建</text>
|
||
<template v-if="item.contract.status == 1">
|
||
<view class="contract-status-tag"
|
||
v-for="(party, pIndex) in item.contract.partyList" :key="pIndex">
|
||
<el-tag size="mini"
|
||
v-if="party.userId !== vk.getVuex('$user.userInfo._id') && !party.sign"
|
||
type="warning" effect="plain">待交易方签署
|
||
</el-tag>
|
||
<el-tag size="mini"
|
||
v-if="party.userId === vk.getVuex('$user.userInfo._id') && !party.sign"
|
||
type="warning" effect="plain">待我签署
|
||
</el-tag>
|
||
</view>
|
||
</template>
|
||
<text v-if="item.contract.status == -1">已作废</text>
|
||
</view>
|
||
</view>
|
||
<view class="contract-left-center">
|
||
<view>
|
||
交易编码:{{ item.contract.transactionId }}
|
||
</view>
|
||
<view>
|
||
创建时间:{{ item.contract._add_time_str }}
|
||
</view>
|
||
</view>
|
||
<view class="contract-left-bottom">
|
||
<el-button size="mini" type="text">查看交易方</el-button>
|
||
<el-button
|
||
v-if="item.contract.status === 0 && item.contract.userId === vk.getVuex('$user.userInfo._id')"
|
||
@click="createContract(item.contract)" size="mini" type="text">创建合同
|
||
</el-button>
|
||
<el-button v-if="item.contract.status == 1" @click="extSign(item.contract)"
|
||
size="mini" type="text">签署合同
|
||
</el-button>
|
||
<el-button v-if="item.contract.status == 2" @click="viewContract(item.contract)"
|
||
size="mini" type="text">查看合同
|
||
</el-button>
|
||
</view>
|
||
</view>
|
||
<view class="contract-right">
|
||
<!-- <view class="">
|
||
{{item._add_time_str}}到期,到期将无法签署合同
|
||
</view> -->
|
||
<view class="">
|
||
<el-button @click.native="changeContract(item.contract)"
|
||
v-if="item.contract.status == 1 && item.contract.userId == vk.getVuex('$user.userInfo._id')"
|
||
size="mini" type="primary">修改合同内容
|
||
</el-button>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
|
||
<view class="paginatio">
|
||
<el-pagination @current-change="query" background layout="prev, pager, next"
|
||
:total="tableData.total"></el-pagination>
|
||
</view>
|
||
</view>
|
||
<view v-else class="bg-white p-20">
|
||
<vk-data-form ref="form2" v-model="form2.data" :action="form2.props.action"
|
||
:columns="form2.props.columns"
|
||
:rules="form2.props.rules" :form-type="form2.props.formType"
|
||
:loading.sync="form2.props.loading"
|
||
:auto-close="true" label-width="140px" @success="onFormSuccess"></vk-data-form>
|
||
</view>
|
||
</el-col>
|
||
</el-row>
|
||
|
||
</view>
|
||
<common-footer></common-footer>
|
||
|
||
<el-dialog :visible.sync="form1.props.show">
|
||
<vk-data-form ref="form1" v-model="form1.data" :action="form1.props.action" :columns="form1.props.columns"
|
||
:rules="form1.props.rules" :form-type="form1.props.formType"
|
||
:loading.sync="form1.props.loading"
|
||
:auto-close="true" label-width="140px" @success="onFormSuccess"></vk-data-form>
|
||
</el-dialog>
|
||
|
||
<!-- 上传合同弹窗 -->
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
import {Agreement} from "@icon-park/vue";
|
||
|
||
export default {
|
||
components: {Agreement},
|
||
data() {
|
||
return {
|
||
pageIndex: 1,
|
||
menuIndex: '0',
|
||
isSign: false,
|
||
formData: {
|
||
status: 0,
|
||
tradeMethod: null
|
||
},
|
||
tableData: {},
|
||
// 表单相关开始-----------------------------------------------------------
|
||
form1: {
|
||
// 表单请求数据,此处可以设置默认值
|
||
data: {
|
||
contractId: '',
|
||
signEndDate: '',
|
||
title: '',
|
||
contractFile: '',
|
||
buyerSignKeyword: '',
|
||
sellerSignKeyword: '',
|
||
otherFile: '',
|
||
},
|
||
// 表单属性
|
||
props: {
|
||
// 表单请求地址
|
||
action: 'client/contract/kh/launch',
|
||
// 表单字段显示规则
|
||
columns: [{
|
||
key: "title",
|
||
title: "标题",
|
||
type: "text"
|
||
},
|
||
{
|
||
key: "signEndDate",
|
||
title: "签署截止日期",
|
||
type: "date",
|
||
pickerOptions: {
|
||
disabledDate: (date) => {
|
||
const now = new Date()
|
||
return now > date
|
||
}
|
||
}
|
||
|
||
},
|
||
{
|
||
key: "contractFile",
|
||
title: "签署文档",
|
||
type: "file",
|
||
limit: 1,
|
||
accept: ".pdf",
|
||
tips: "仅支持PDF文件",
|
||
},
|
||
{
|
||
key: "buyerSignKeyword",
|
||
title: "买家签章关键字",
|
||
type: "text",
|
||
tips: '关键字为文档中的文字内容(要能使用ctrl+f搜索到)。法大大按此关键字进行签章位置的定位,将电子章盖在这个关键字上面。凡出现关键字的地方均会盖上指定用户的电子章,建议关键字在合同中保持唯一。'
|
||
},
|
||
{
|
||
key: "sellerSignKeyword",
|
||
title: "卖家签章关键字",
|
||
type: "text",
|
||
tips: '关键字为文档中的文字内容(要能使用ctrl+f搜索到)。法大大按此关键字进行签章位置的定位,将电子章盖在这个关键字上面。凡出现关键字的地方均会盖上指定用户的电子章,建议关键字在合同中保持唯一。'
|
||
},
|
||
{
|
||
key: "otherFile",
|
||
title: "附件",
|
||
type: "file"
|
||
},
|
||
],
|
||
// 表单验证规则
|
||
rules: {
|
||
title: [{
|
||
required: true,
|
||
message: "标题不能为空",
|
||
trigger: "change"
|
||
},],
|
||
signEndDate: [{
|
||
required: true,
|
||
message: "签署截止日期不能为空",
|
||
trigger: "change"
|
||
}],
|
||
buyerSignKeyword: [{
|
||
required: true,
|
||
message: "买家签章关键字不能为空",
|
||
trigger: "change"
|
||
}],
|
||
sellerSignKeyword: [{
|
||
required: true,
|
||
message: "卖家签章关键字不能为空",
|
||
trigger: "change"
|
||
}],
|
||
contractFile: [{
|
||
required: true,
|
||
message: "签署文档不能为空",
|
||
trigger: "change"
|
||
},]
|
||
},
|
||
// add 代表添加 update 代表修改
|
||
formType: "",
|
||
// 表单是否在请求中
|
||
loading: false,
|
||
// 是否显示表单1 的弹窗
|
||
show: false
|
||
}
|
||
},
|
||
form2: {
|
||
// 表单请求数据,此处可以设置默认值
|
||
data: {
|
||
contractId: '',
|
||
signEndDate: '',
|
||
title: '',
|
||
contractFile: '',
|
||
buyerSignKeyword: '',
|
||
sellerSignKeyword: '',
|
||
otherFile: '',
|
||
},
|
||
// 表单属性
|
||
props: {
|
||
// 表单请求地址
|
||
action: 'client/contract/kh/addSign',
|
||
// 表单字段显示规则
|
||
columns: [
|
||
{
|
||
key: "title",
|
||
title: "标题",
|
||
type: "text"
|
||
},
|
||
{
|
||
key: "phone",
|
||
title: "对方手机号",
|
||
type: "text"
|
||
},
|
||
{
|
||
key: "userType",
|
||
title: "对方身份",
|
||
type: "select",
|
||
data: [
|
||
{
|
||
value: 1,
|
||
label: "买家"
|
||
},
|
||
{
|
||
value: 2,
|
||
label: "卖家"
|
||
}
|
||
]
|
||
},
|
||
{
|
||
key: "signEndDate",
|
||
title: "签署截止日期",
|
||
type: "date",
|
||
pickerOptions: {
|
||
disabledDate: (date) => {
|
||
const now = new Date()
|
||
return now > date
|
||
}
|
||
}
|
||
},
|
||
{
|
||
key: "contractFile",
|
||
title: "签署文档",
|
||
type: "file",
|
||
limit: 1,
|
||
accept: ".pdf",
|
||
tips: "仅支持PDF文件",
|
||
},
|
||
{
|
||
key: "buyerSignKeyword",
|
||
title: "买家签章关键字",
|
||
type: "text",
|
||
tips: '关键字为文档中的文字内容(要能使用ctrl+f搜索到)。法大大按此关键字进行签章位置的定位,将电子章盖在这个关键字上面。凡出现关键字的地方均会盖上指定用户的电子章,建议关键字在合同中保持唯一。'
|
||
},
|
||
{
|
||
key: "sellerSignKeyword",
|
||
title: "卖家签章关键字",
|
||
type: "text",
|
||
tips: '关键字为文档中的文字内容(要能使用ctrl+f搜索到)。法大大按此关键字进行签章位置的定位,将电子章盖在这个关键字上面。凡出现关键字的地方均会盖上指定用户的电子章,建议关键字在合同中保持唯一。'
|
||
},
|
||
{
|
||
key: "otherFile",
|
||
title: "附件",
|
||
type: "file"
|
||
},
|
||
],
|
||
// 表单验证规则
|
||
rules: {
|
||
title: [{
|
||
required: true,
|
||
message: "标题不能为空",
|
||
trigger: "change"
|
||
},],
|
||
phone: [{
|
||
required: true,
|
||
message: "标题不能为空",
|
||
trigger: "change"
|
||
},],
|
||
signEndDate: [{
|
||
required: true,
|
||
message: "签署截止日期不能为空",
|
||
trigger: "change"
|
||
}],
|
||
buyerSignKeyword: [{
|
||
required: true,
|
||
message: "买家签章关键字不能为空",
|
||
trigger: "change"
|
||
}],
|
||
sellerSignKeyword: [{
|
||
required: true,
|
||
message: "卖家签章关键字不能为空",
|
||
trigger: "change"
|
||
}],
|
||
contractFile: [{
|
||
required: true,
|
||
message: "签署文档不能为空",
|
||
trigger: "change"
|
||
},]
|
||
},
|
||
// add 代表添加 update 代表修改
|
||
formType: "",
|
||
// 表单是否在请求中
|
||
loading: false,
|
||
// 是否显示表单1 的弹窗
|
||
show: false
|
||
}
|
||
},
|
||
// 表单相关结束-----------------------------------------------------------
|
||
}
|
||
},
|
||
onLoad(options) {
|
||
if (options.tab) {
|
||
if (options.tab === 'sign') {
|
||
this.isSign = true
|
||
} else {
|
||
this.menuIndex = String(options.tab)
|
||
this.formData.status = Number(options.tab)
|
||
this.isSign = false
|
||
this.query(1)
|
||
}
|
||
}else {
|
||
this.menuIndex = '0'
|
||
this.formData.status = 0
|
||
this.isSign = false
|
||
this.query(1)
|
||
}
|
||
},
|
||
methods: {
|
||
menuSelect(e) {
|
||
this.menuIndex = String(e)
|
||
this.formData.status = Number(e)
|
||
this.isSign = false
|
||
this.query(1)
|
||
},
|
||
selectSign() {
|
||
this.isSign = true
|
||
this.menuIndex = ''
|
||
},
|
||
async query(pageIndex) {
|
||
this.tableData = await vk.callFunction({
|
||
url: 'client/contract/kh/getList',
|
||
title: '请求中...',
|
||
data: {
|
||
pageIndex,
|
||
pageSize: 10,
|
||
status: this.formData.status
|
||
},
|
||
|
||
});
|
||
},
|
||
/**
|
||
* 创建合同
|
||
* @param contract
|
||
*/
|
||
createContract(contract) {
|
||
this.form1.data.contractId = contract._id
|
||
this.form1.props.action = 'client/contract/kh/launch'
|
||
this.form1.props.show = true
|
||
},
|
||
async changeContract(contract) {
|
||
this.form1.data.contractId = contract._id
|
||
const res = await vk.callFunction({
|
||
url: 'client/contract/kh/getDetail',
|
||
title: '请求中...',
|
||
data: {
|
||
contractId: contract._id
|
||
},
|
||
});
|
||
this.form1.data.signEndDate = res.signEndDate
|
||
this.form1.data.title = res.docTitle
|
||
this.form1.data.contractFile = res.contractBase
|
||
this.form1.data.buyerSignKeyword = res.buyerSignKeyword
|
||
this.form1.data.sellerSignKeyword = res.sellerSignKeyword
|
||
this.form1.data.otherFile = res.otherFile
|
||
this.form1.props.show = true
|
||
},
|
||
onFormSuccess() {
|
||
this.form1.props.show = false
|
||
this.form1.data.contractId = null
|
||
this.formData.status = 1
|
||
this.menuIndex = '1'
|
||
this.isSign = false
|
||
this.$refs.form2.resetForm()
|
||
this.query(1)
|
||
},
|
||
/**
|
||
* 签署合同
|
||
* @param {Object} contract
|
||
*/
|
||
extSign(contract) {
|
||
vk.callFunction({
|
||
url: 'client/contract/kh/extSign',
|
||
title: '请求中...',
|
||
data: {
|
||
contractId: contract._id
|
||
},
|
||
success: (res) => {
|
||
window.open(res.data)
|
||
}
|
||
});
|
||
},
|
||
viewContract(contract) {
|
||
vk.callFunction({
|
||
url: 'client/contract/kh/viewContract',
|
||
title: '请求中...',
|
||
data: {
|
||
contractId: contract._id
|
||
},
|
||
success: (res) => {
|
||
window.open(res.data)
|
||
this.query(1)
|
||
}
|
||
});
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style scoped lang="scss">
|
||
.w-1200 {
|
||
width: 1200px;
|
||
margin: 20px auto;
|
||
}
|
||
|
||
.contract-list {
|
||
background-color: #FFFFFF;
|
||
padding: 10px 20px 20px;
|
||
}
|
||
|
||
.paginatio {
|
||
margin: 20px auto;
|
||
display: flex;
|
||
justify-content: center;
|
||
}
|
||
|
||
|
||
.contract-box {
|
||
display: flex;
|
||
justify-content: space-between;
|
||
border-bottom: solid 1px #e8e8e8;
|
||
padding: 10rpx 0;
|
||
}
|
||
|
||
.contract-left {
|
||
}
|
||
|
||
.contract-right {
|
||
text-align: right;
|
||
font-size: 13px;
|
||
}
|
||
|
||
.trade-method {
|
||
display: flex;
|
||
margin-bottom: 20px;
|
||
border-bottom: solid 2px #f4f4f4;
|
||
}
|
||
|
||
.trade-method-item {
|
||
cursor: pointer;
|
||
font-size: 18px;
|
||
margin-right: 15px;
|
||
height: 40px;
|
||
line-height: 40px;
|
||
}
|
||
|
||
.trade-method-item.active {
|
||
color: #A92924;
|
||
border-bottom: solid 2px #A92924;
|
||
}
|
||
|
||
.contract-left-top {
|
||
display: flex;
|
||
align-items: center;
|
||
|
||
}
|
||
|
||
.contract-product {
|
||
margin: 0 10px;
|
||
}
|
||
|
||
.contract-left-center {
|
||
height: 40px;
|
||
display: flex;
|
||
justify-content: flex-start;
|
||
align-items: flex-start;
|
||
color: #999999;
|
||
font-size: 12px;
|
||
flex-direction: column;
|
||
margin-top: 5px;
|
||
}
|
||
|
||
.contract-left-bottom {
|
||
display: flex;
|
||
}
|
||
|
||
.contract-status {
|
||
display: flex;
|
||
}
|
||
|
||
.contract-status-tag {
|
||
margin-left: 2px;
|
||
}
|
||
|
||
.sign {
|
||
padding: 20px 20px 20px 25px;
|
||
font-size: 14px;
|
||
|
||
.icon {
|
||
line-height: 18px;
|
||
}
|
||
}
|
||
</style> |