OfficeApp/subpkg/shareCapital/shareCapital.vue

639 lines
16 KiB
Vue
Raw Normal View History

2023-08-29 18:24:09 +08:00
<template>
<view style="padding-bottom: 160rpx;">
<view class="price_card">
<view>账户入股金额</view>
2023-08-30 14:40:01 +08:00
<view><text class="money">{{shareholder.shareholder_money}}</text></view>
2023-08-29 18:24:09 +08:00
</view>
2023-09-01 11:11:26 +08:00
<view v-if="!is_village" style="text-align: center;color: #aaa;">暂无村公司</view>
<view class="card" v-else-if="shareholder.is_contract">
2023-08-30 11:19:26 +08:00
<view class="contract">
2023-08-30 11:32:59 +08:00
<view class="left">
<image class="contract_img" src="../../static/img/contract/pdf.png"></image>
<view class="text">
2023-08-31 19:25:03 +08:00
<view class="name">股金合同</view>
2023-08-30 11:32:59 +08:00
<view>
2023-08-30 14:40:01 +08:00
<text>{{shareholder.contract_time}}</text>
2023-08-30 11:32:59 +08:00
</view>
</view>
</view>
2023-08-30 14:40:01 +08:00
<view class="right" @click="navToContract(shareholder.contract_url)">
2023-08-30 11:32:59 +08:00
<uni-icons type="paperclip" color="#3274F9"></uni-icons>
<view>查看</view>
</view>
2023-08-30 11:19:26 +08:00
</view>
2023-08-30 11:32:59 +08:00
</view>
2023-08-31 19:25:03 +08:00
<view class="need_contract" v-else>
<button v-if="shareholder.check_status==0" class="btns" style="width: 694rpx;height: 90rpx; margin: 0 auto;border-radius: 54rpx;overflow: hidden;background-color: #0122c7;color: #fff;" @click="clickContract(1)">
<u-icon name="../../static/img/company/HT.png" size="20" style="margin-right: 10rpx;"></u-icon>
发起合同
</button>
<view v-if="shareholder.check_status==1">
<button class="btn tips_center">合同已生成,请等待审核</button>
</view>
<view v-if="shareholder.check_status==2" class="card">
<view class="contract_box send">
<view class="left">
<image class="contract_img" src="../../static/img/contract/pdf.png"></image>
<view class="text">
<view class="name">股金合同</view>
<view>
<text>{{shareholder.contract_time}}</text>
</view>
</view>
</view>
<view class="right" @click="navToContract(shareholder.contract_url)">
<!-- <image class="icon"></image> -->
<uni-icons type="paperclip" color="#3274F9"></uni-icons>
<view>查看</view>
</view>
</view>
<u-line color="#999999FF" style="margin: 31rpx 0;"></u-line>
<view class="bottom">
<button class="send_btn" @click="clickContract(2)">发送合同</button>
</view>
</view>
<view v-if="shareholder.check_status==3" class="card">
<view class="contract_box send">
<view class="left">
<image class="contract_img" src="../../static/img/contract/pdf.png"></image>
<view class="text">
<view class="name">股金合同</view>
<view>
<text>{{shareholder.contract_time}}</text>
</view>
</view>
</view>
<view class="right" @click="navToContract(shareholder.contract_url)">
<!-- <image class="icon"></image> -->
<uni-icons type="paperclip" color="#3274F9"></uni-icons>
<view>查看</view>
</view>
</view>
<u-line color="#999999FF" style="margin: 31rpx 0;"></u-line>
<view class="bottom">
<button class="send_btn" @click="getPostsms" v-if="timerCount==0">再次发送短信</button>
<button class="send_btn tips_center" v-else>{{cTimerCount+'秒后可继续再次发送短信'}}</button>
</view>
</view>
</view>
2023-08-30 11:19:26 +08:00
<view class="card">
<view class="c_title">账单记录</view>
<u-line></u-line>
2023-08-30 11:32:59 +08:00
<u-steps style="padding: 28rpx;" :current="-1" direction="column" activeColor="#0122c7" dot
inactiveColor="#0122c7">
2023-08-30 14:40:01 +08:00
<u-steps-item v-for="(item, index) in list" :key="index" :title="item.update_time" :desc="item.remark">
2023-08-30 11:32:59 +08:00
</u-steps-item>
2023-08-30 15:13:12 +08:00
<u-loadmore :status="loadConfig.status" :loading-text="loadConfig.loadingText"
:loadmore-text="loadConfig.loadmoreText" :nomore-text="loadConfig.nomoreText" />
2023-08-30 11:32:59 +08:00
</u-steps>
</view>
2023-08-30 11:19:26 +08:00
<!-- <view class="card">
2023-08-29 18:24:09 +08:00
<view class="c_title">账单记录</view>
<u-line></u-line>
<view class="c_body" v-for="i in 3" :key="i">
<image class="icon" src="/static/icons/share.png"></image>
<view class="body_text">
<view class="b_title">入股金额充值</view>
<view class="b_text">
<view class="b_text_left">
<view>充值账户</view>
<image class="b_avatar" src="../../static/img/public/man.png"></image>
<view>张三三</view>
</view>
<view class="b_text_right">+1000.00</view>
</view>
<view class="b_time">完成时间2023-06-15 18:00</view>
</view>
</view>
2023-08-30 11:19:26 +08:00
</view> -->
2023-08-29 18:24:09 +08:00
<view class="button">
<view class="retreat" @click="retreat">退股</view>
2023-09-01 11:11:26 +08:00
<view class="hand" :class="{'disable': !shareholder.is_amount_turned||!shareholder.is_village}" @click="hand">上交</view>
2023-08-29 18:24:09 +08:00
</view>
2023-09-01 11:11:26 +08:00
<u-modal :show="modelShow" title="提醒" :content="modelType==1?'确定要生成合同吗':'请确认合同无误后再发送'" closeOnClickOverlay showCancelButton cancel-text="取消" confirm-text="确认" close="modelShow=false" @cancel="modelShow=false" @confirm="modelType==1?createContract():addContract();modelShow=false"></u-modal>
2023-08-29 18:24:09 +08:00
</view>
</template>
<script>
2023-08-30 11:32:59 +08:00
import { Toast } from '../../libs/uniApi';
import {
download_file
} from "@/api/junziqian.js"
2023-08-30 14:40:01 +08:00
import {
companyAccountLog,
2023-08-31 19:25:03 +08:00
companyShareholderInfo,
initiateShareholderContract
2023-08-30 14:40:01 +08:00
} from "@/api/shareholder.js"
2023-08-31 19:25:03 +08:00
import {
companyView,
initiateContract,
Draftingcontracts,
postsms
} from "@/api/company.js"
import {
dictDataLists
} from "@/api/oaPbulic.js"
2023-08-29 18:24:09 +08:00
export default {
data() {
return {
2023-08-30 14:40:01 +08:00
shareholder: {
contract_url: "",
is_contract: 0,
shareholder_money: "0.00",
2023-08-30 14:52:37 +08:00
contract_time: "",
is_amount_turned: ""
2023-08-30 14:40:01 +08:00
},
list: [],
loadConfig: {
page: 1,
limit: 25,
lastpage: '',
loadingText: '努力加载中',
loadmoreText: '轻轻上拉',
2023-08-30 15:13:12 +08:00
nomoreText: '没有更多记录了~~',
2023-08-30 14:40:01 +08:00
status: 'loadmore'
},
2023-08-31 19:25:03 +08:00
timer: null, // 计时器
timerCount: 0, //倒计时
modelShow: false,
modelType: 1,
nowContractType: 40, //当前合同类型, 40为股金合同
2023-08-29 18:24:09 +08:00
};
},
2023-08-31 19:25:03 +08:00
onLoad(options) {
2023-08-30 14:40:01 +08:00
this.initInfo();
2023-08-30 14:46:17 +08:00
this.initLoad();
2023-08-31 19:25:03 +08:00
let time = uni.getStorageSync('share_time' + this.id);
if (time > 0 && (time - Date.now()) / 1000 > 0) {
this.startTimer((time - Date.now()) / 1000);
}
2023-08-30 14:46:17 +08:00
},
2023-08-31 19:25:03 +08:00
onUnload() {
if (this.timerCount > 0) uni.setStorageSync('share_time' + this.id, this.timerCount * 1000 + Date.now());
},
computed: {
cTimerCount() {
return this.timerCount;
}
},
async onPullDownRefresh() {
await this.initLoad();
uni.stopPullDownRefresh();
2023-08-30 14:46:17 +08:00
},
onReachBottom() {
2023-08-30 14:40:01 +08:00
this.loadList();
},
2023-08-30 11:32:59 +08:00
methods: {
2023-08-30 14:40:01 +08:00
async initInfo() {
let res = await companyShareholderInfo();
this.shareholder = res.data;
},
2023-08-30 14:46:17 +08:00
async initLoad() {
this.loadConfig.page = 1;
this.loadConfig.status = "loadmore";
2023-09-01 10:11:49 +08:00
this.list = [];
2023-08-30 14:46:17 +08:00
await this.loadList();
},
2023-08-30 14:40:01 +08:00
async loadList(){
if (this.loadConfig.status == "nomore") return;
this.loadConfig.status = "loading";
let res = await companyAccountLog({
page: this.loadConfig.page,
limit: this.loadConfig.limit
})
this.loadConfig.status = "loadmore"
if (res.data.list.length < this.loadConfig.limit) {
this.loadConfig.status = "nomore"
} else {
this.loadConfig.page++;
}
2023-08-30 14:46:17 +08:00
this.list = [...this.list, ...res.data.list];
2023-08-30 14:40:01 +08:00
},
2023-08-30 11:19:26 +08:00
navToContract(contract_no) {
2023-08-30 11:32:59 +08:00
if (!contract_no) return Toast('暂无合同');
2023-08-30 15:13:12 +08:00
return uni.navigateTo({
2023-08-31 19:25:03 +08:00
url: `/subpkg/pdfView/pdfView?url=${contract_no}`
2023-08-30 11:32:59 +08:00
})
2023-08-30 15:13:12 +08:00
// download_file({
// applyNo: contract_no
// }).then(res => {
// if (res.code != 1) {
// uni.hideLoading();
// Toast(res.msg)
// }
// uni.showLoading({
// title: '加载中',
// mask: true
// });
// uni.navigateTo({
// url: `/subpkg/pdfView/pdfView?url=${res.data.url}`,
// fail() {
// uni.hideLoading();
// }
// })
// })
2023-08-30 11:19:26 +08:00
},
2023-08-30 11:32:59 +08:00
retreat() {
2023-08-31 15:49:26 +08:00
Toast('暂无内容')
2023-08-29 18:24:09 +08:00
},
2023-08-30 11:32:59 +08:00
hand() {
2023-08-30 14:52:37 +08:00
if(!this.shareholder.is_amount_turned) return Toast('暂时无法上交');
2023-08-31 15:49:26 +08:00
Toast('暂无内容')
2023-08-31 19:25:03 +08:00
},
clickContract(e){
this.modelType = e;
this.modelShow = true;
},
// 生成合同
async createContract(data) {
uni.showLoading({
title: '合同生成中',
mask: true
})
let res = await initiateShareholderContract({
contract_type: this.nowContractType, //股金合同
})
this.initInfo();
uni.hideLoading();
Toast(res.msg || '合同已生成');
this.navTo('/subpkg/submit/submit?type=' + 1);
},
// 发送合同
async addContract(data) {
try {
uni.showLoading({
title: '合同发送中',
mask: true
})
let res = await Draftingcontracts({
id: this.$store.state.app.userInfo.company_id,
contract_type: this.nowContractType,
});
this.initInfo();
this.startTimer();
uni.hideLoading();
Toast('合同已发送');
} catch (e) {
uni.hideLoading();
Toast(e.msg || '合同发送失败');
}
},
// 发送短信
async getPostsms() {
try {
uni.showLoading({
title: '发送中',
mask: true
})
if (this.timerCount == 0) {
this.startTimer();
let res = await postsms({
id: this.id
})
Toast('短信已发送');
// this.navTo('/subpkg/submit/submit');
}
} catch (e) {
uni.hideLoading();
Toast(e.msg || '短信发送失败');
}
},
// 定时器
startTimer(time = 60) {
this.timerCount = time.toFixed(0);
this.timer = setInterval(() => {
this.timerCount--;
if (this.timerCount <= 0) {
clearInterval(this.timer);
this.loadUserDetail();
}
}, 1000);
},
navTo(url) {
if(url){
uni.showLoading({
title: '加载中',
mask: true
});
uni.navigateTo({
url: url,
success() {
uni.hideLoading()
}
})
}else Toast('暂未开放')
},
2023-08-29 18:24:09 +08:00
}
}
</script>
<style lang="scss">
2023-08-30 11:32:59 +08:00
.price_card {
width: 694rpx;
height: 180rpx;
padding: 10rpx 0;
background: #0022C7;
2023-08-29 18:24:09 +08:00
margin: 28rpx;
2023-08-30 11:32:59 +08:00
border-radius: 21rpx;
color: white;
2023-08-29 18:24:09 +08:00
display: flex;
2023-08-30 11:32:59 +08:00
flex-direction: column;
align-items: center;
justify-content: space-evenly;
.money {
font-size: 70rpx;
2023-08-29 18:24:09 +08:00
}
2023-08-30 11:32:59 +08:00
}
.card {
margin: 28rpx;
width: 694rpx;
background-color: #fff;
border-radius: 14rpx;
.c_title {
color: #0022C7;
font-size: 32rpx;
font-weight: 500;
padding: 28rpx;
2023-08-29 18:24:09 +08:00
}
2023-08-30 11:32:59 +08:00
.c_body {
margin: 28rpx;
padding-bottom: 28rpx;
display: flex;
border-bottom: 1px solid #F3F4F8;
&:last-child {
border-bottom: none;
2023-08-29 18:24:09 +08:00
}
2023-08-30 11:32:59 +08:00
.icon {
width: 77rpx;
height: 77rpx;
flex-shrink: 0;
margin-right: 12rpx;
}
.body_text {
flex: 1;
font-size: 25rpx;
.b_title {
font-size: 32rpx;
color: #333;
font-weight: 500;
2023-08-29 18:24:09 +08:00
}
2023-08-30 11:32:59 +08:00
.b_text {
2023-08-29 18:24:09 +08:00
display: flex;
2023-08-30 11:32:59 +08:00
justify-content: space-between;
padding: 16rpx 0;
font-size: 28rpx;
.b_avatar {
width: 52rpx;
height: 52rpx;
margin-right: 8rpx;
}
&_left {
display: flex;
align-items: center;
}
&_right {
color: #F02828;
display: flex;
align-items: center;
font-size: 35rpx;
}
2023-08-29 18:24:09 +08:00
}
2023-08-30 11:32:59 +08:00
.b_time {
color: #666666;
2023-08-29 18:24:09 +08:00
}
}
}
2023-08-30 11:32:59 +08:00
2023-08-29 18:24:09 +08:00
}
2023-08-30 11:32:59 +08:00
.button {
position: fixed;
bottom: 0;
left: 0;
// z-index: 9999999;
z-index: 1;
width: 100%;
border-radius: 0;
color: #fff;
height: 90rpx;
line-height: 90rpx;
background-color: $theme-oa-color;
display: flex;
.retreat {
color: $theme-oa-color;
background-color: #fff;
}
.hand,
.retreat {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
font-size: 32rpx;
}
2023-08-30 15:06:03 +08:00
.disable {
background-color: #666;
color: #eee;
}
2023-08-29 18:24:09 +08:00
}
2023-08-30 11:32:59 +08:00
.contract {
2023-08-29 18:24:09 +08:00
display: flex;
2023-08-30 11:32:59 +08:00
justify-content: space-between;
padding: 28rpx;
.left {
display: flex;
.contract_img {
width: 102rpx;
height: 102rpx;
background: #f5f5f5;
border-radius: 14rpx 14rpx 14rpx 14rpx;
margin-right: 21rpx;
}
.text {
display: flex;
flex-direction: column;
justify-content: space-around;
.name {
font-size: 32rpx;
font-weight: 500;
color: rgba(0, 0, 0, 0.8);
line-height: 35rpx;
}
.nickname {
margin-right: 35rpx;
}
text {
height: 39rpx;
font-size: 28rpx;
font-weight: 400;
color: #666666;
line-height: 35rpx;
}
}
}
.right {
font-size: 28rpx;
font-weight: 500;
color: $theme-oa-color;
line-height: 35rpx;
display: flex;
justify-content: center;
align-items: center;
.icon {
width: 35rpx;
height: 39rpx;
background-color: $theme-oa-color;
opacity: 1;
margin-right: 10rpx;
}
}
2023-08-29 18:24:09 +08:00
}
2023-08-31 19:25:03 +08:00
.need_contract {
// padding-bottom: 30rpx;
.title {
font-size: 35rpx;
font-weight: 500;
color: #333333;
margin-bottom: 21rpx;
margin-left: 28rpx;
}
.card {
padding-top: 0;
margin: 28rpx;
padding: 28rpx;
background-color: #fff;
border-radius: 14rpx;
.contract_box {
display: flex;
justify-content: space-between;
.left {
display: flex;
.contract_img {
width: 102rpx;
height: 102rpx;
background: #F5F5F5;
border-radius: 14rpx 14rpx 14rpx 14rpx;
margin-right: 21rpx;
}
.text {
display: flex;
flex-direction: column;
justify-content: space-between;
.name {
font-size: 32rpx;
;
font-weight: 500;
color: rgba(0, 0, 0, 0.8);
line-height: 35rpx;
}
.nickname {
margin-right: 35rpx;
}
text {
height: 39rpx;
font-size: 28rpx;
font-weight: 400;
color: #666666;
line-height: 35rpx;
}
}
}
.right {
font-size: 28rpx;
font-weight: 500;
color: #3274F9;
line-height: 35rpx;
display: flex;
justify-content: center;
align-items: center;
.icon {
width: 35rpx;
height: 39rpx;
background-color: #3274F9;
opacity: 1;
margin-right: 10rpx
}
}
}
.send_btn {
width: 100%;
height: 84rpx;
background: $theme-oa-color;
border-radius: 42rpx 42rpx 42rpx 42rpx;
color: #fff;
line-height: 80rpx;
text-align: center;
}
.tips_center {
background-color: #666;
color: #eee;
}
}
.btn {
margin: 0 auto;
margin-top: 32rpx;
// margin-bottom: 40rpx;
width: 694rpx;
height: 84rpx;
background: $theme-oa-color;
border-radius: 42rpx 42rpx 42rpx 42rpx;
color: #fff;
line-height: 80rpx;
text-align: center;
}
.tips_center {
background-color: #666;
color: #eee;
}
}
.btns {
color: white;
background-color: $theme-oa-color;
display: flex;
justify-content: center;
align-items: center;
}
2023-08-30 11:32:59 +08:00
</style>