This commit is contained in:
weipengfei 2023-08-03 14:47:44 +08:00
parent 253fa0a543
commit 013df81349
3 changed files with 109 additions and 34 deletions

View File

@ -45,3 +45,8 @@ export const userDraftingcontracts = (data) => oahttp.post('/user/Draftingcontra
* 发起合同 * 发起合同
*/ */
export const userInitiateContract = (data) => oahttp.post('/user/initiate_contract', data) export const userInitiateContract = (data) => oahttp.post('/user/initiate_contract', data)
/**
* 发送短信
*/
export const userPostsms = (data) => oahttp.post('/user/postsms', data)

View File

@ -140,28 +140,50 @@
return { return {
landPlanList: ['自己种养', '出租', '代种养', '租更多地扩大种植'], landPlanList: ['自己种养', '出租', '代种养', '租更多地扩大种植'],
formData: { formData: {
"cultivated_area": "20", // // "cultivated_area": "20", //
"planning": 1, // // "planning": 1, //
"breeding_training": 1, // // "breeding_training": 1, //
"planting_company": 0, // // "planting_company": 0, //
"notes": "试试备注", // // "notes": "", //
"breeding_type": 22, // // "breeding_type": 22, //
"area": 20, // // "area": 20, //
"breeding_time": "2022-07-22", // // "breeding_time": "2022-07-22", //
"mature_time": "2022-07-22", // // "mature_time": "2022-07-22", //
"yield": 600, // // "yield": 600, //
"estimated_income": 1500, // // "estimated_income": 1500, //
"farm_tools": "收割机一台,打米机一台", //使 // "farm_tools": ",", //使
"ecological_farming": 1, // // "ecological_farming": 1, //
"modernization": 30, // // "modernization": 30, //
"pre_price": "30.00", // // "pre_price": "30.00", //
"method_sales": 1, // // "method_sales": 1, //
"processing_storage": 0, // // "processing_storage": 0, //
"promote": 0, //广 // "promote": 0, //广
"transportation": 0, // // "transportation": 0, //
"expand_business_needs": 0, // // "expand_business_needs": 0, //
"demand": "没有述求", // // "demand": "", //
"policy_subsidies": "无补助" // // "policy_subsidies": "" ,//
"cultivated_area": "", //
"planning": "", //
"breeding_training": "", //
"planting_company": "", //
"notes": "", //
"breeding_type": "", //
"area": "", //
"breeding_time": "", //
"mature_time": "", //
"yield": "", //
"estimated_income": "", //
"farm_tools": "", //使
"ecological_farming": "", //
"modernization": "", //
"pre_price": "", //
"method_sales": "", //
"processing_storage": "", //
"promote": "", //广
"transportation": "", //
"expand_business_needs": "", //
"demand": "", //
"policy_subsidies": "" //
}, },
rules: { rules: {

View File

@ -144,7 +144,26 @@
</view> </view>
<u-line color="#999999FF" style="margin: 31rpx 0;"></u-line> <u-line color="#999999FF" style="margin: 31rpx 0;"></u-line>
<view class="bottom"> <view class="bottom">
<button class="send_btn" @click="addContract">发送合同</button> <button class="send_btn" @click="addContract" v-if="timerCount==0">发送合同</button>
<button class="send_btn tips_center" v-else>{{cTimerCount+'秒后可继续发送合同'}}</button>
</view>
</view>
<view v-if="userInfo.contract&&userInfo.contract.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">{{userInfo.contract.contract_type_name}}</view>
<view>
<text>{{userInfo.contract&&userInfo.contract.create_time}}</text>
</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> </view>
</block> </block>
@ -156,7 +175,7 @@
<script> <script>
import { Toast } from '@/libs/uniApi.js' import { Toast } from '@/libs/uniApi.js'
import { companyUserDetail } from "@/api/company.js" import { companyUserDetail } from "@/api/company.js"
import { loginSetInfo, userDraftingcontracts, userInitiateContract } from "@/api/oaUser.js" import { loginSetInfo, userDraftingcontracts, userInitiateContract, userPostsms } from "@/api/oaUser.js"
import { dictDataLists } from "@/api/oaPbulic.js" import { dictDataLists } from "@/api/oaPbulic.js"
export default { export default {
onReady() { onReady() {
@ -190,6 +209,11 @@
this.loadUserDetail(); this.loadUserDetail();
}, },
onShow() { }, onShow() { },
computed:{
cTimerCount(){
return this.timerCount;
}
},
methods: { methods: {
naviTo(url) { naviTo(url) {
url ? url ?
@ -216,7 +240,7 @@
this.createContract({ this.createContract({
party_b:this.userInfo.id, party_b:this.userInfo.id,
contract_type:this.contractTypeList[e.detail.value].id, contract_type:this.contractTypeList[e.detail.value].id,
type:1 //1-,2- type:2 //1-,2-
}) })
}, },
// //
@ -238,17 +262,37 @@
}, },
// //
async addContract(data){ async addContract(data){
if(!this.timer){
this.timerCount = 60;
let res = await userDraftingcontracts({ let res = await userDraftingcontracts({
id: this.userInfo.id id: this.userInfo.id
}); });
Toast('合同已生成'); Toast('合同已生成');
this.loadUserDetail(); this.loadUserDetail();
if(this.userInfo.contract.check_status==3){
this.timerCount = 60;
this.timer = setInterval(()=>{ this.timer = setInterval(()=>{
this.timerCount--; this.timerCount--;
if(this.timerCount==0)clearInterval(this.timer); if(this.timerCount==0){
}, 1000) clearInterval(this.timer);
this.loadUserDetail();
}
}, 1000);
}
},
//
async getPostsms(){
if(this.timerCount==0){
this.timerCount = 60;
this.timer = setInterval(()=>{
this.timerCount--;
if(this.timerCount==0){
clearInterval(this.timer);
this.loadUserDetail();
}
}, 1000);
let res = await userPostsms({
id: this.userInfo.id
})
Toast('短信已发送');
} }
}, },
loadUserDetail() { loadUserDetail() {
@ -501,6 +545,10 @@
line-height: 80rpx; line-height: 80rpx;
text-align: center; text-align: center;
} }
.tips_center{
background-color: #666;
color: #eee;
}
} }
.btn { .btn {