835 lines
33 KiB
Vue
835 lines
33 KiB
Vue
<template> <!-- 合同管理 -->
|
||
<view class="wrap">
|
||
<!-- 吸顶 -->
|
||
<u-sticky offset-top="0" customNavHeight="0">
|
||
<!-- 顶部 -->
|
||
<uititle title="金久信签约宝"></uititle>
|
||
</u-sticky>
|
||
<view class="p-20">
|
||
<common-swiper page="qyb"/>
|
||
<view class="layout layout-publish m-top-20 bg-white p-20">
|
||
<view class="pb-30">
|
||
<text class="text-main">您剩余金久信签约宝次数: {{ userInfo.qybNum }}次</text>
|
||
<view class="qyb-action-row flex justify-start items-center mt-20">
|
||
<view class="qyb-buy-action">
|
||
<u-button size="mini" type="primary" @click.native="dialogVisible = true"
|
||
:custom-style="{padding: 0, width: '100%'}">立即购买</u-button>
|
||
</view>
|
||
<view class="qyb-log-action ml-25">
|
||
<u-button size="mini" type="success" @click.native="openLog"
|
||
:custom-style="{padding: 0, width: '100%'}">明细</u-button>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<view class="text-main mt-10">温馨提示:尊敬的用户如果您的剩余金久信签约宝次数为0次,请先进行购买,再进行签约。</view>
|
||
<view class="card m-20">
|
||
<view class="flex justify-between items-center" @click="showSignIntro = !showSignIntro">
|
||
<text>金久信签约宝简介</text>
|
||
<u-icon name="arrow-down"></u-icon>
|
||
</view>
|
||
<view v-if="showSignIntro" class="py-15">
|
||
<u-parse class="w-100p" :content="signIntro"></u-parse>
|
||
</view>
|
||
</view>
|
||
<view class="card m-20">
|
||
<view class="flex justify-between items-center" @click="showSignFlow = !showSignFlow">
|
||
<text>{{ signFlowTitle }}</text>
|
||
<u-icon name="arrow-down"></u-icon>
|
||
</view>
|
||
<view v-if="showSignFlow" class="py-15">
|
||
<u-parse class="w-100p" :content="signFlow"></u-parse>
|
||
</view>
|
||
</view>
|
||
<view class="card m-20">
|
||
<view class="flex justify-between items-center" @click="showSignTips = !showSignTips">
|
||
<text>金久信签约宝重要提示</text>
|
||
<u-icon name="arrow-down"></u-icon>
|
||
</view>
|
||
<view v-if="showSignTips" class="py-15">
|
||
<u-parse class="w-100p" :content="signTips"></u-parse>
|
||
</view>
|
||
</view>
|
||
<view class="flex justify-start align-center m-top-30">
|
||
<view class="lb need m-right-20">签约内容:</view>
|
||
<u-radio-group
|
||
v-model="formData.signType"
|
||
placement="row"
|
||
>
|
||
<u-radio activeColor="#a92924" name='1' label="单据签约"
|
||
:customStyle="{marginRight: '30px'}"></u-radio>
|
||
<u-radio activeColor="#a92924" name='2' label="合同签约"></u-radio>
|
||
</u-radio-group>
|
||
</view>
|
||
|
||
<!-- <view class="flex justify-start align-center m-top-30">-->
|
||
<!-- <view class="lb need m-right-20">交易方式:</view>-->
|
||
<!-- <u-radio-group-->
|
||
<!-- v-model="formData.tradeMethod"-->
|
||
<!-- placement="row"-->
|
||
<!-- >-->
|
||
<!-- <u-radio activeColor="#a92924" :name='0' label="自主交易"-->
|
||
<!-- :customStyle="{marginRight: '30px'}"></u-radio>-->
|
||
<!-- <u-radio activeColor="#a92924" :name='1' label="金久信公正"></u-radio>-->
|
||
<!-- </u-radio-group>-->
|
||
<!-- </view>-->
|
||
<view class="flex justify-start align-center m-top-30">
|
||
<view class="lb need m-right-20">签约费用承担方:</view>
|
||
<u-radio-group
|
||
v-model="formData.payBy"
|
||
placement="row"
|
||
>
|
||
<u-radio activeColor="#a92924" :name='0' label="发起方"
|
||
:customStyle="{marginRight: '10px'}"></u-radio>
|
||
<u-radio activeColor="#a92924" :name='1' :customStyle="{marginRight: '10px'}" label="接收方"></u-radio>
|
||
<u-radio activeColor="#a92924" :name='2' label="第三方"></u-radio>
|
||
</u-radio-group>
|
||
</view>
|
||
<view class="group flex align-center m-top-30">
|
||
<view class="lb need m-right-20">标题:</view>
|
||
<view class="vl flex-1">
|
||
<u--input
|
||
placeholder="请输入标题"
|
||
border="surround"
|
||
v-model="formData.title"
|
||
/>
|
||
</view>
|
||
</view>
|
||
<view class="group flex align-center m-top-30">
|
||
<view class="lb need m-right-20">对方手机号:</view>
|
||
<view class="vl flex-1">
|
||
<u--input
|
||
placeholder="请输入对方手机号"
|
||
border="surround"
|
||
v-model="formData.phone"
|
||
/>
|
||
</view>
|
||
</view>
|
||
<view class="tips">手机号请连续输入,请勿添加空格和断开输入,系统无法准确识别。</view>
|
||
<view class="group flex align-center m-top-30">
|
||
<view class="lb need m-right-20">对方身份:</view>
|
||
<view class="vl flex-1" @click="showContactPicker = true">
|
||
<u--input
|
||
style="pointer-events:none"
|
||
disabledColor="#fff"
|
||
disabled
|
||
placeholder="请选择对方身份"
|
||
border="surround"
|
||
v-model="userType"
|
||
/>
|
||
</view>
|
||
</view>
|
||
<view class="goods-item half flex align-center flex-wrap mt-20 w-100p">
|
||
<view class="lb">签署截止日期:</view>
|
||
<view class="vl flex-1 p-right-20" @click="showExpire = true">
|
||
<u--input placeholder="请选择" v-model="signEndDate" style="pointer-events:none"
|
||
fontSize="24rpx"
|
||
suffixIcon="arrow-down-fill"
|
||
suffixIconStyle="font-size: 10px;color: #d5d5d5"
|
||
:disabled="true"
|
||
disabledColor="#fff"></u--input>
|
||
</view>
|
||
</view>
|
||
<view class="text-24 text-gray mt-10">
|
||
发起方填写签署截止日期和时间即为各签约方共同认可的签署时间,请酌情填写仔细阅读签署文件。
|
||
</view>
|
||
<view class="group m-top-20">
|
||
<view class="lb m-right-20">签署文档:</view>
|
||
<view class="flex justify-between align-center m-top-20">
|
||
<view class="text-25 text-gray flex-1">
|
||
仅支持PDF文件,如有其他附件或多个单据签约请合并成一个PDF文档上传。且仅支持纵向文档上传,横向文档显示不完整。
|
||
电子签署文件中需添加以下内容以增强双方约束力和文件法律效力:签约双方均自愿通过以“电子签约”形式进行签约,电子签名和加盖电子印章双方均予以认可具有法律效力。
|
||
</view>
|
||
</view>
|
||
<view class="m-top-30">
|
||
<u-upload
|
||
accept="file"
|
||
:fileList="formData.files"
|
||
@afterRead="afterRead"
|
||
:maxCount="1"
|
||
:previewImage="false"
|
||
>
|
||
<u-button type="primary" v-if="!formData.files">点击上传</u-button>
|
||
<p class="mt-30" @click="previewDoc" v-if="fileName">预览: {{ fileName }}</p>
|
||
</u-upload>
|
||
</view>
|
||
</view>
|
||
<view class="group flex justify-start m-top-30 flex-col">
|
||
<view class="lb need m-right-20">签约发起方关键字:</view>
|
||
<view class="vl flex-1 mt-10">
|
||
<u--input
|
||
placeholder="请输入签约发起方关键字"
|
||
border="surround"
|
||
v-model="formData.buyerSignKeyword"
|
||
/>
|
||
</view>
|
||
<view class="mt-10 text-24 text-gray">
|
||
请先在手机办公软件上(Office、WPS等)内,复制粘贴或输入预盖章部位关键字核验确认位置和内容,再点击上传文档核实无误后可返回签署页面输入测验关键字后进行签署(如同一关键字文档多次使用无误后可考虑省略检测流程)。系统将按此关键字进行签章位置的定位,将电子章盖在这个关键字上面。凡出现关键字的地方均会盖上指定用户的电子章,建议关键字在合同中保持唯一。
|
||
</view>
|
||
</view>
|
||
<view class="group flex justify-start m-top-30 flex-col">
|
||
<view class="lb need m-right-20">签约接收方关键字:</view>
|
||
<view class="vl flex-1 mt-10">
|
||
<u--input
|
||
placeholder="请输入签约接收方关键字"
|
||
border="surround"
|
||
v-model="formData.sellerSignKeyword"
|
||
/>
|
||
</view>
|
||
<view class="mt-10 text-24 text-gray">
|
||
请先在手机办公软件上(Office、WPS等)内,复制粘贴或输入预盖章部位关键字核验确认位置和内容,再点击上传文档核实无误后可返回签署页面输入测验关键字后进行签署(如同一关键字文档多次使用无误后可考虑省略检测流程)。系统将按此关键字进行签章位置的定位,将电子章盖在这个关键字上面。凡出现关键字的地方均会盖上指定用户的电子章,建议关键字在合同中保持唯一。
|
||
</view>
|
||
</view>
|
||
<view v-for="(item, index) in formData.thirdList" :key="index"
|
||
class="flex justify-start items-start my-10 flex-col">
|
||
<view class="text-left">第{{ ['三', '四', '五', '六', '七', '八', '九', '十'][index] }}方:</view>
|
||
<view class="mt-10 w-100p">
|
||
<el-input v-model="formData.thirdList[index].phone"
|
||
:placeholder="`请输入第${['三', '四', '五', '六', '七', '八', '九', '十'][index]}方手机号`"/>
|
||
</view>
|
||
<view class="mt-10 w-100p flex justify-start items-center">
|
||
<el-input v-model="formData.thirdList[index].signKeyword"
|
||
:placeholder="`请输入第${['三', '四', '五', '六', '七', '八', '九', '十'][index]}方签章关键字`"/>
|
||
<view class="flex justify-center items-center mt-10">
|
||
<i class="el-icon-circle-plus text-main text-50 ml-35" @click="addThird"/>
|
||
<i class="el-icon-remove text-50 ml-35" @click="removeThird(index)"/>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<p class="text-25 text-gray mt-20">如无第三方签约可忽略,签章关键字使用方法同下。</p>
|
||
<p class="text-25 text-gray mt-20">手机号码请连续填写,不能断开或加入空格,否则系统无法识别。</p>
|
||
<view class="tips text-24 text-gray mt-30">注意事项(电子签名不适用文件):</view>
|
||
<view class="tips text-24 text-gray">1.婚姻、继承、收养等人身关系的;</view>
|
||
<view class="tips text-24 text-gray">2.涉及停止供水、供热、供气等公用事业服务的;</view>
|
||
<view class="tips text-24 text-gray">3.其他法律、行政法规规定的不适用电子文书的其他形式;</view>
|
||
<u-button class="m-top-30" type="primary" text="提交" @click="submit"></u-button>
|
||
</view>
|
||
</view>
|
||
<u-datetime-picker :show="showExpire" v-model="expireTime" mode="datetime" @cancel="showExpire = false"
|
||
:minDate="minDate"
|
||
@confirm="handConfirmDate"></u-datetime-picker>
|
||
<u-picker :show="showContactPicker" :columns="[userTypeList]" keyName="label"
|
||
@cancel="showContactPicker = false" @close="showContactPicker = false" closeOnClickOverlay
|
||
@confirm="confirmContact"/>
|
||
<el-dialog title="金久信签约宝次数" :visible.sync="dialogVisible" width="95%">
|
||
<div class="flex justify-center items-center w-100p">
|
||
<div class="flex flex-col justify-center items-center w-100p">
|
||
<div class="p-15 rounded m-10 shadow flex flex-col justify-center items-center flex-1 w-100p"
|
||
:class="[selectedQyb === item._id ? 'buy-quote-mode-active' : '']"
|
||
v-for="(item, index) in qybPackageList" :key="index"
|
||
@click="selectedQyb = item._id">
|
||
<p>{{ item.amount }}元</p>
|
||
<p>可获得{{ item.getNum }}次</p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="mt-20 text-main font-bold">
|
||
剩余金久信签约宝次数:{{ userInfo.qybNum }}次
|
||
</div>
|
||
<div class="mt-20 flex justify-center items-center">
|
||
<view class="flex-1 mx-20">
|
||
<u-button type="primary" :disabled="!selectedQyb" @click.native="doBuyQyb">确定
|
||
</u-button>
|
||
</view>
|
||
<view class="flex-1 mx-20">
|
||
<u-button plain @click.native="dialogVisible = false">取消</u-button>
|
||
</view>
|
||
</div>
|
||
</el-dialog>
|
||
<u-popup :show="showLog" title="金久信签约宝明细" mode="center" @close="showLog = false" z-index="997" :overlayStyle="{
|
||
zIndex: 997
|
||
}">
|
||
<view style="max-height: 80vh" class="p-20 overflow-y rounded">
|
||
<u-tabs :list="[{name: '使用明细'}, {name: '付费明细'}]" :activeStyle="{fontWeight: 'bold', fontSize: '18px'}" :current="logIndex" @click="changeLogTab"></u-tabs>
|
||
<view class="flex flex-col justify-center items-center m-20" style="max-height: 60vh;overflow-y: scroll">
|
||
<template v-if="logIndex === 0">
|
||
<view class="p-15 border-bottom w-100p" v-for="(item, index) in signLog.rows" :key="index">
|
||
<view>日期: {{ item._add_time_str }}</view>
|
||
<view>项目: {{ parseInt(item.contract.signType) === 1 ? '单据签约' : '合同签约' }}</view>
|
||
<view>合同编号: {{ item.contract.transactionId }}</view>
|
||
<view>签约身份: {{
|
||
item.mineContract ? (item.mineContract.role === 'third' ? '第三方' : (item.mineContract.userId === item.userId ? '发起方' : '接收方')) : ''
|
||
}}
|
||
</view>
|
||
<view>
|
||
<view>扣除次数: 1</view>
|
||
<view v-if="item.remainNum !== undefined && item.remainNum != null">剩余次数: {{
|
||
item.remainNum
|
||
}}
|
||
</view>
|
||
</view>
|
||
</view>
|
||
<view class="text-center mt-20">
|
||
<el-pagination
|
||
:page-size="10"
|
||
@current-change="getSignLog"
|
||
background
|
||
layout="prev, pager, next"
|
||
:total="signLog.total">
|
||
</el-pagination>
|
||
</view>
|
||
</template>
|
||
<template v-else>
|
||
<view class="p-15 border-bottom w-100p" v-for="(item, index) in signLog.rows" :key="index">
|
||
<view>日期: {{ item._add_time_str }}</view>
|
||
<view>项目: {{ item.type === 12 ? '合同司法调证' : '金久信签约宝续费' }}</view>
|
||
<view>流水号: {{ item.orderNo }}</view>
|
||
<view>缴费金额: {{ item.type === 12 ? item.amount : item.payAmount }}
|
||
</view>
|
||
<view>
|
||
<view>采购次数: {{ item.goods[0].goodsName }}</view>
|
||
<view v-if="item.remainNum">剩余次数: {{ item.remainNum }}</view>
|
||
</view>
|
||
<view class="flex justify-start items-center">
|
||
<text class="mr-15">操作:</text>
|
||
<el-button size="mini" @click="openInvoice(item._id)" type="primary"
|
||
v-if="!item.isInvoice">申请发票
|
||
</el-button>
|
||
<template v-else>
|
||
<el-button size="mini" v-if="item.isInvoice === 1">开票中</el-button>
|
||
<el-button size="mini" type="success" v-if="item.isInvoice === 2"
|
||
@click.native="copyInvoice(item)">下载
|
||
</el-button>
|
||
</template>
|
||
<el-button size="mini" style="margin-left: 10px"
|
||
v-if="item.type === 12 && item.certificate && item.certificate.paymentMethod === 'advance'"
|
||
@click.native="openPayVoucher(item.certificate)">查看支付凭证
|
||
</el-button>
|
||
</view>
|
||
</view>
|
||
<view class="text-center mt-20">
|
||
<el-pagination
|
||
:page-size="10"
|
||
@current-change="getSignBuyLog"
|
||
background
|
||
layout="prev, pager, next"
|
||
:total="signLog.total">
|
||
</el-pagination>
|
||
</view>
|
||
</template>
|
||
</view>
|
||
</view>
|
||
</u-popup>
|
||
<el-dialog title="申请发票" :visible.sync="showInvoice" width="80%" top="10px" append-to-body>
|
||
<p>请输入开票信息</p>
|
||
<u-form ref="invoiceForm" :model="invoiceForm" label-width="140px" labelPosition="top">
|
||
<u-form-item label="名称" required>
|
||
<u-input v-model="invoiceForm.name" placeholder="请输入企业名称或个人姓名"/>
|
||
</u-form-item>
|
||
<u-form-item label="税号/证号" required>
|
||
<u-input v-model="invoiceForm.code" placeholder="请输入税号或身份证号"/>
|
||
</u-form-item>
|
||
<u-form-item label="手机号" required>
|
||
<u-input v-model="invoiceForm.phone" placeholder="请输入手机号"/>
|
||
</u-form-item>
|
||
<u-form-item label="电子邮箱" required>
|
||
<u-input v-model="invoiceForm.email" placeholder="请输入电子邮箱"/>
|
||
</u-form-item>
|
||
<u-form-item label="开户行">
|
||
<u-input v-model="invoiceForm.bankName" placeholder="请输入开户行"/>
|
||
</u-form-item>
|
||
<u-form-item label="银行账号">
|
||
<u-input v-model="invoiceForm.bankAccount" placeholder="请输入银行账号"/>
|
||
</u-form-item>
|
||
<u-form-item label="地址" required>
|
||
<u-input v-model="invoiceForm.address" placeholder="请输入地址"/>
|
||
</u-form-item>
|
||
<u-form-item label="单位/个人电话">
|
||
<u-input v-model="invoiceForm.tel" placeholder="请输入单位/个人电话"/>
|
||
</u-form-item>
|
||
</u-form>
|
||
<div class="mt-20 flex justify-center items-center">
|
||
<el-button type="primary" @click.native="doInvoice">确定</el-button>
|
||
<el-button plain @click.native="showInvoice = false">取消</el-button>
|
||
</div>
|
||
</el-dialog>
|
||
<el-dialog title="合同预览" :visible.sync="showPdf" width="90%" append-to-body>
|
||
<view style="height: 1000rpx">
|
||
<u-pdf :url="pdfUrl" v-if="pdfUrl" :showBottom="false" :show-timer="false" :disabled="false" viewHeight="800rpx"
|
||
@onClickReader="closePdf"/>
|
||
</view>
|
||
</el-dialog>
|
||
<collapse></collapse>
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
import uititle from '@/components/common/title'
|
||
import cmsearch from '@/components/common/search'
|
||
import cmempty from '@/components/common/empty'
|
||
import dayjs from "dayjs";
|
||
import md5 from "js-md5";
|
||
import uPdf from '@/components/u-pdf/u-pdf.vue'
|
||
import Collapse from "@/components/index/collapse.vue";
|
||
|
||
const SIGN_CONFIRM_CONTENT = `1、您确认,若全体各签约方未完成全部签约流程,本签约文件不发生法律效力,系统无法对该签约文件予以保存及提供司法调证服务;
|
||
2、您确认,当前签约的实名主体名称、手机号码与注册认证阶段提交的信息未发生变更;若发生变更,必须及时进行重新认证后方可继续签约,避免产生严重法律风险与经济损失;
|
||
3、您确认,本次签约为本系统实名认证主体操作,如若不是实名认证主体操作,授权委托人需本系统进行授权认证后签约;
|
||
4、您确认,您与其他签约方均系在平等、自愿的基础上完成本次签约;
|
||
5、你确认,此次签约内容符合《中华人民共和国电子签名法》《民法典》生效保护范畴;
|
||
6、如因法律法规、监管部门政策更新等原因,系统提示您重新进行实名认证、证书续期等重要提示时,请您必须在签约前完成,否则造成任何损失,平台不承担任何责任;以上签约条件您均已经知悉并确认,否则您有权拒绝本次签约。`
|
||
|
||
export default {
|
||
components: {
|
||
Collapse,
|
||
uititle,
|
||
cmsearch,
|
||
cmempty,
|
||
uPdf,
|
||
},
|
||
data() {
|
||
return {
|
||
tabIndex: 0,
|
||
tableData: {},
|
||
userInfo: {
|
||
qybNum: 0
|
||
},
|
||
show: false,
|
||
title: '',
|
||
name: '',
|
||
companyMobile: '',
|
||
pdfUrl: '',
|
||
showPdf: false,
|
||
formData: {
|
||
signType: '1',
|
||
tradeMethod: 0,
|
||
payBy: 0,
|
||
title: null,
|
||
phone: null,
|
||
userType: null,
|
||
third: null,
|
||
signEndDate: null,
|
||
contractFile: '',
|
||
buyerSignKeyword: null,
|
||
sellerSignKeyword: null,
|
||
otherFile: null,
|
||
thirdList: [{phone: '', signKeyword: ''}],
|
||
},
|
||
showExpire: false,
|
||
expireTime: '',
|
||
minDate: dayjs().valueOf(),
|
||
showContactPicker: false,
|
||
invoiceForm: {
|
||
id: null,
|
||
name: null,
|
||
code: null,
|
||
phone: null,
|
||
email: null,
|
||
bankName: null,
|
||
bankAccount: null,
|
||
address: null,
|
||
tel: null,
|
||
},
|
||
userTypeList: [
|
||
{
|
||
value: 1,
|
||
label: "买家"
|
||
},
|
||
{
|
||
value: 2,
|
||
label: "卖家"
|
||
},
|
||
{
|
||
value: 3,
|
||
label: "甲方"
|
||
},
|
||
{
|
||
value: 4,
|
||
label: "乙方"
|
||
},
|
||
{
|
||
value: 5,
|
||
label: "授权签约方"
|
||
},
|
||
|
||
],
|
||
userType: '',
|
||
fileName: '',
|
||
dialogVisible: false,
|
||
qybPackageList: [],
|
||
selectedQyb: null,
|
||
showSignIntro: false,
|
||
showSignFlow: false,
|
||
signFlowTitle: '',
|
||
showSignTips: false,
|
||
signTips: '',
|
||
showLog: false,
|
||
signIntro: null,
|
||
signFlow: null,
|
||
signEndDate: null,
|
||
signLog: {},
|
||
logIndex: 0,
|
||
showInvoice: false,
|
||
}
|
||
},
|
||
methods: {
|
||
dayjs,
|
||
afterRead({file}) {
|
||
console.log(file)
|
||
if (!file) return
|
||
// 仅PDF
|
||
if (file.type !== 'application/pdf') {
|
||
uni.showToast({
|
||
title: '请上传PDF文件',
|
||
icon: 'none'
|
||
})
|
||
return
|
||
}
|
||
if ((new RegExp(/\s+/g).test(file.name))) {
|
||
uni.showToast({
|
||
title: '文件名不能有空格',
|
||
icon: 'none'
|
||
})
|
||
return
|
||
}
|
||
uniCloud.uploadFile({
|
||
filePath: file.url,
|
||
cloudPath: dayjs().format('YYYY/MM/DD') + '/' + md5(file.name + Date.now().toString()) + `-${file.name}`,
|
||
success: ({fileID}) => {
|
||
console.log(fileID)
|
||
uniCloud.getTempFileURL({
|
||
fileList: [fileID]
|
||
}).then(res => {
|
||
console.log(res)
|
||
this.formData.contractFile = res.fileList[0].tempFileURL
|
||
this.fileName = file.name
|
||
// console.log(this.formData.contractFile)
|
||
})
|
||
}
|
||
})
|
||
},
|
||
addThird() {
|
||
if (this.formData.thirdList.length < 8) this.formData.thirdList.push({
|
||
phone: '',
|
||
signKeyword: '',
|
||
})
|
||
},
|
||
removeThird(index) {
|
||
if (this.formData.thirdList.length === 1) return
|
||
this.formData.thirdList.splice(index, 1)
|
||
},
|
||
handConfirmDate({value}) {
|
||
this.signEndDate = dayjs(value).format('YYYY-MM-DD HH:mm:ss')
|
||
this.formData.signEndDate = dayjs(value).toISOString()
|
||
console.log(this.formData.signEndDate)
|
||
this.showExpire = false
|
||
},
|
||
confirmContact({value}) {
|
||
this.formData.userType = value[0].value
|
||
this.userType = value[0].label
|
||
this.showContactPicker = false
|
||
},
|
||
async submit() {
|
||
if (!this.formData.title) return vk.toast('标题不能为空')
|
||
if (!this.formData.phone) return vk.toast('标题不能为空')
|
||
if (!this.signEndDate) return vk.toast('签署截止日期不能为空')
|
||
if (!this.formData.buyerSignKeyword) return vk.toast('签约发起方关键字不能为空')
|
||
if (!this.formData.sellerSignKeyword) return vk.toast('签约接收方关键字不能为空')
|
||
if (!this.formData.contractFile) return vk.toast('签署文档不能为空')
|
||
this.formData.thirdList = this.formData.thirdList.filter(item => item.phone && item.signKeyword)
|
||
if (this.formData.thirdList.length > 0) {
|
||
for (let i = 0; i < this.formData.thirdList.length; i++) {
|
||
const item = this.formData.thirdList[i]
|
||
if (item.phone === '') {
|
||
vk.toast('请填写手机号')
|
||
return false
|
||
}
|
||
if (item.signKeyword === '') {
|
||
vk.toast('请填写签章关键字')
|
||
return false
|
||
}
|
||
if (item.phone === this.formData.phone) {
|
||
vk.toast('第三方手机号不能与接收方手机号相同')
|
||
return false
|
||
}
|
||
}
|
||
}
|
||
const thirdKeywords = []
|
||
for (let i = 0; i < this.formData.thirdList.length; i++) {
|
||
const item = this.formData.thirdList[i]
|
||
if (item.phone && item.signKeyword) {
|
||
thirdKeywords.push(item.signKeyword)
|
||
}
|
||
}
|
||
uni.showLoading({title: '查验中'})
|
||
vk.request({
|
||
method: "POST",
|
||
url: 'https://hcsc.gxwebsoft.com/api/read-pdf',
|
||
header: {
|
||
"content-type": "application/json; charset=utf-8",
|
||
},
|
||
data: {
|
||
file: this.formData.contractFile,
|
||
buyerSignKeyword: this.formData.buyerSignKeyword,
|
||
sellerSignKeyword: this.formData.sellerSignKeyword,
|
||
thirdKeywords
|
||
},
|
||
success: async (pdfRes) => {
|
||
|
||
},
|
||
fail: (pdfRes) => {
|
||
uni.hideLoading()
|
||
this.$message.error(pdfRes.content.msg)
|
||
},
|
||
complete: async (pdfRes) => {
|
||
uni.hideLoading()
|
||
if (pdfRes.code !== 200) {
|
||
this.$message.error(pdfRes.content.msg)
|
||
} else {
|
||
uni.removeStorageSync(`signInfo`)
|
||
uni.removeStorageSync(`fileName`)
|
||
// 此处统一使用 SIGN_CONFIRM_CONTENT
|
||
// confirmButtonText: '知悉同意',
|
||
// showCancelButton: false,
|
||
// type: 'warning'
|
||
// })
|
||
uni.showModal({
|
||
title: '提示',
|
||
content: SIGN_CONFIRM_CONTENT,
|
||
showCancel: false,
|
||
confirmText: '知悉同意',
|
||
success: res => {
|
||
if (res.confirm) {
|
||
vk.callFunction({
|
||
url: 'client/contract/kh/addSign',
|
||
title: '请求中...',
|
||
data: this.formData,
|
||
success: (data) => {
|
||
// console.log(data)
|
||
vk.navigateTo('/pages/public/contract?tab=1')
|
||
},
|
||
fail: (err) => {
|
||
vk.confirm(err.msg, '提示');
|
||
},
|
||
});
|
||
}
|
||
}
|
||
})
|
||
}
|
||
console.log('complete:', pdfRes)
|
||
|
||
},
|
||
})
|
||
|
||
|
||
},
|
||
async doBuyQyb() {
|
||
const {data} = await vk.callFunction({
|
||
url: 'client/qyb/list/kh/buy',
|
||
title: '请求中...',
|
||
data: {
|
||
qybId: this.selectedQyb,
|
||
}
|
||
})
|
||
this.dialogVisible = false
|
||
vk.navigateTo({
|
||
url: `/pages/shop/pay?id=${data}`
|
||
})
|
||
},
|
||
async getQybPackage() {
|
||
const {rows} = await vk.callFunction({
|
||
url: 'client/qyb/list/pub/getList',
|
||
data: {
|
||
pageIndex: 1,
|
||
pageSize: 500
|
||
}
|
||
});
|
||
this.qybPackageList = rows
|
||
},
|
||
async getSignIntro() {
|
||
const res = await vk.callFunction({
|
||
url: 'client/dict/pub/getDetail',
|
||
data: {
|
||
id: 'ef45322e671cece4110ec73b36ca2b7d'
|
||
},
|
||
})
|
||
this.signIntro = res.content
|
||
},
|
||
async getSignFlow() {
|
||
const res = await vk.callFunction({
|
||
url: 'client/dict/pub/getDetail',
|
||
data: {
|
||
id: 'd77d384f686b9bd204bd4dc744cf75d0'
|
||
},
|
||
})
|
||
this.signFlow = res.content
|
||
this.signFlowTitle = res.name
|
||
},
|
||
async getSignTips() {
|
||
const res = await vk.callFunction({
|
||
url: 'client/dict/pub/getDetail',
|
||
data: {
|
||
id: '614937966875c18505570c357541c6e0'
|
||
},
|
||
})
|
||
this.signTips = res.content
|
||
},
|
||
previewDoc() {
|
||
// uni.setStorageSync(`signInfo_${this.formData.contractId}`, JSON.stringify(this.formData))
|
||
// uni.setStorageSync(`fileName`, this.fileName)
|
||
// window.location.href = this.formData.contractFile
|
||
if (Array.isArray(this.formData.contractFile)) {
|
||
this.pdfUrl = this.formData.contractFile[0]
|
||
} else
|
||
this.pdfUrl = this.formData.contractFile
|
||
this.showPdf = true
|
||
},
|
||
openLog() {
|
||
this.showLog = true
|
||
this.changeLogTab({index: 0})
|
||
},
|
||
changeLogTab({index}) {
|
||
this.logIndex = index
|
||
if (index === 0) this.getSignLog(1)
|
||
else this.getSignBuyLog(1)
|
||
},
|
||
async getSignLog(pageIndex) {
|
||
this.signLog = await vk.callFunction({
|
||
url: 'client/qyb/list/kh/payList',
|
||
data: {
|
||
pageIndex: pageIndex,
|
||
pageSize: 10
|
||
}
|
||
})
|
||
this.signLog.rows = this.signLog.rows.filter(item => !!item.contract)
|
||
this.$forceUpdate()
|
||
},
|
||
async getSignBuyLog(pageIndex) {
|
||
this.signLog = await vk.callFunction({
|
||
url: 'client/order/kh/getList',
|
||
data: {
|
||
isSeller: 0,
|
||
keyword: null,
|
||
orderStatus: 4,
|
||
pageIndex,
|
||
pageSize: 10,
|
||
signMethod: null,
|
||
type: [12, 13]
|
||
}
|
||
})
|
||
this.$forceUpdate()
|
||
},
|
||
openInvoice(id) {
|
||
this.invoiceForm.id = id
|
||
this.showInvoice = true
|
||
},
|
||
async doInvoice() {
|
||
if (!this.invoiceForm.name) return this.$message.error('请输入发票抬头')
|
||
if (!this.invoiceForm.code) return this.$message.error('请输入纳税人识别号')
|
||
if (!this.invoiceForm.phone) return this.$message.error('请输入手机号码')
|
||
if (!this.invoiceForm.email) return this.$message.error('请输入邮箱')
|
||
if (!this.invoiceForm.address) return this.$message.error('请输入地址')
|
||
await vk.callFunction({
|
||
url: 'client/order/kh/changeInvoice',
|
||
data: {
|
||
...this.invoiceForm,
|
||
isInvoice: 1
|
||
}
|
||
})
|
||
this.showInvoice = false
|
||
this.$message.success('申请成功')
|
||
await this.getSignBuyLog(1)
|
||
},
|
||
copyInvoice(row) {
|
||
// const url = row.invoiceUrl[0]
|
||
// document.oncopy = function (e) {
|
||
// e.clipboardData.setData('text', url);
|
||
// e.preventDefault();
|
||
// document.oncopy = null;
|
||
// }
|
||
// document.execCommand('Copy');
|
||
// this.$message({
|
||
// type: 'success',
|
||
// message: '已复制'
|
||
// })
|
||
window.location.href = row.invoiceUrl
|
||
},
|
||
closePdf() {
|
||
this.pdfUrl = ''
|
||
this.showPdf = false
|
||
},
|
||
openPayVoucher(row) {
|
||
// window.open(row.payVoucher)
|
||
uni.previewImage({
|
||
urls: [row.payVoucher],
|
||
})
|
||
},
|
||
},
|
||
onShow() {
|
||
this.getQybPackage()
|
||
this.getSignIntro()
|
||
this.getSignFlow()
|
||
this.getSignTips()
|
||
vk.userCenter.getCurrentUserInfo({
|
||
success: async (data) => {
|
||
this.userInfo = data.userInfo
|
||
if (!this.userInfo.fadadaConfirm) {
|
||
uni.showModal({
|
||
title: '提示',
|
||
content: '您尚未认证, 请前往认证',
|
||
showCancel: false,
|
||
success: res => {
|
||
if (res.confirm) {
|
||
uni.setStorageSync('user_tab', 0)
|
||
uni.switchTab({url: '/pages/user/user'})
|
||
}
|
||
}
|
||
})
|
||
}
|
||
this.invoiceForm.phone = this.userInfo.mobile
|
||
this.invoiceForm.email = this.userInfo.businessCard ? this.userInfo.businessCard.email : ''
|
||
if (this.userInfo.accountType === 2) {
|
||
if (this.userInfo.fadadaConfirm && this.userInfo.company) {
|
||
this.invoiceForm.name = this.userInfo.company.companyName
|
||
this.invoiceForm.code = this.userInfo.company.organization
|
||
this.invoiceForm.address = this.userInfo.company.addressDetail
|
||
this.invoiceForm.tel = this.userInfo.company.mobile
|
||
this.invoiceForm.bankName = this.userInfo.company.companyBankName
|
||
this.invoiceForm.bankAccount = this.userInfo.company.companyAccount
|
||
}
|
||
} else {
|
||
this.invoiceForm.name = this.userInfo.person.personName
|
||
this.invoiceForm.code = this.userInfo.person.idCard
|
||
this.invoiceForm.address = this.userInfo.person.address
|
||
this.invoiceForm.tel = this.userInfo.mobile
|
||
}
|
||
}
|
||
})
|
||
if (uni.getStorageSync('signInfo')) {
|
||
this.formData = JSON.parse(uni.getStorageSync('signInfo'))
|
||
if (this.formData.signEndDate) this.signEndDate = dayjs(this.formData.signEndDate).format('YYYY-MM-DD')
|
||
if (uni.getStorageSync('fileName')) this.fileName = uni.getStorageSync('fileName')
|
||
}
|
||
console.log(this.formData)
|
||
},
|
||
onLoad(e) {
|
||
if (e.tab && e.tab === 'signBuyLog') {
|
||
this.showLog = true
|
||
this.changeLogTab({index: 1})
|
||
}
|
||
}
|
||
}
|
||
</script>
|
||
|
||
<style lang="scss">
|
||
page {
|
||
background: #f7f7f7;
|
||
}
|
||
|
||
.buy-quote-mode-active {
|
||
border: 1px solid #a92924;
|
||
background-color: #f1c7c7;
|
||
}
|
||
|
||
.qyb-action-row {
|
||
width: 100%;
|
||
}
|
||
|
||
.qyb-buy-action {
|
||
flex: 0 0 28%;
|
||
}
|
||
|
||
.qyb-log-action {
|
||
flex: 1;
|
||
}
|
||
</style>
|