优化
This commit is contained in:
parent
253fa0a543
commit
013df81349
@ -44,4 +44,9 @@ 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)
|
||||
|
@ -140,28 +140,50 @@
|
||||
return {
|
||||
landPlanList: ['自己种养', '出租', '代种养', '租更多地扩大种植'],
|
||||
formData: {
|
||||
"cultivated_area": "20", //耕地总面积
|
||||
"planning": 1, //土地规划
|
||||
"breeding_training": 1, //有无种养殖培训
|
||||
"planting_company": 0, //有无注册成立种殖公司
|
||||
"notes": "试试备注", //备注
|
||||
"breeding_type": 22, //种养殖类型
|
||||
"area": 20, //面积
|
||||
"breeding_time": "2022-07-22", //种养殖开始时间
|
||||
"mature_time": "2022-07-22", //上市时间
|
||||
"yield": 600, //产量
|
||||
"estimated_income": 1500, //预计收益
|
||||
"farm_tools": "收割机一台,打米机一台", //农资农具使用情况
|
||||
"ecological_farming": 1, //是否生态种养殖
|
||||
"modernization": 30, //现代化程度
|
||||
"pre_price": "30.00", //预售卖价格
|
||||
"method_sales": 1, //销售方式
|
||||
"processing_storage": 0, //有无加工仓储
|
||||
"promote": 0, //有无宣传推广
|
||||
"transportation": 0, //有无运输
|
||||
"expand_business_needs": 0, //是否有扩大经营需求
|
||||
"demand": "没有述求", //种养殖述求
|
||||
"policy_subsidies": "无补助" //政策补助
|
||||
// "cultivated_area": "20", //耕地总面积
|
||||
// "planning": 1, //土地规划
|
||||
// "breeding_training": 1, //有无种养殖培训
|
||||
// "planting_company": 0, //有无注册成立种殖公司
|
||||
// "notes": "试试备注", //备注
|
||||
// "breeding_type": 22, //种养殖类型
|
||||
// "area": 20, //面积
|
||||
// "breeding_time": "2022-07-22", //种养殖开始时间
|
||||
// "mature_time": "2022-07-22", //上市时间
|
||||
// "yield": 600, //产量
|
||||
// "estimated_income": 1500, //预计收益
|
||||
// "farm_tools": "收割机一台,打米机一台", //农资农具使用情况
|
||||
// "ecological_farming": 1, //是否生态种养殖
|
||||
// "modernization": 30, //现代化程度
|
||||
// "pre_price": "30.00", //预售卖价格
|
||||
// "method_sales": 1, //销售方式
|
||||
// "processing_storage": 0, //有无加工仓储
|
||||
// "promote": 0, //有无宣传推广
|
||||
// "transportation": 0, //有无运输
|
||||
// "expand_business_needs": 0, //是否有扩大经营需求
|
||||
// "demand": "没有述求", //种养殖述求
|
||||
// "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: {
|
||||
|
||||
|
@ -144,7 +144,26 @@
|
||||
</view>
|
||||
<u-line color="#999999FF" style="margin: 31rpx 0;"></u-line>
|
||||
<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>
|
||||
</block>
|
||||
@ -156,7 +175,7 @@
|
||||
<script>
|
||||
import { Toast } from '@/libs/uniApi.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"
|
||||
export default {
|
||||
onReady() {
|
||||
@ -190,6 +209,11 @@
|
||||
this.loadUserDetail();
|
||||
},
|
||||
onShow() { },
|
||||
computed:{
|
||||
cTimerCount(){
|
||||
return this.timerCount;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
naviTo(url) {
|
||||
url ?
|
||||
@ -216,7 +240,7 @@
|
||||
this.createContract({
|
||||
party_b:this.userInfo.id,
|
||||
contract_type:this.contractTypeList[e.detail.value].id,
|
||||
type:1 //1-公司,2-个人
|
||||
type:2 //1-公司,2-个人
|
||||
})
|
||||
},
|
||||
// 初始化合同类型
|
||||
@ -238,17 +262,37 @@
|
||||
},
|
||||
// 生成合同
|
||||
async addContract(data){
|
||||
if(!this.timer){
|
||||
let res = await userDraftingcontracts({
|
||||
id: this.userInfo.id
|
||||
});
|
||||
Toast('合同已生成');
|
||||
this.loadUserDetail();
|
||||
if(this.userInfo.contract.check_status==3){
|
||||
this.timerCount = 60;
|
||||
let res = await userDraftingcontracts({
|
||||
id: this.userInfo.id
|
||||
});
|
||||
Toast('合同已生成');
|
||||
this.loadUserDetail();
|
||||
this.timer = setInterval(()=>{
|
||||
this.timerCount--;
|
||||
if(this.timerCount==0)clearInterval(this.timer);
|
||||
}, 1000)
|
||||
if(this.timerCount==0){
|
||||
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() {
|
||||
@ -501,6 +545,10 @@
|
||||
line-height: 80rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.tips_center{
|
||||
background-color: #666;
|
||||
color: #eee;
|
||||
}
|
||||
}
|
||||
|
||||
.btn {
|
||||
|
Loading…
x
Reference in New Issue
Block a user