更新功能

This commit is contained in:
weipengfei 2023-08-21 17:04:34 +08:00
parent fb8fbb6d83
commit e64511c428
3 changed files with 79 additions and 64 deletions

View File

@ -105,7 +105,6 @@
mounted() { mounted() {
uni.$on('companyInfo', (e) => { uni.$on('companyInfo', (e) => {
this.company = e; this.company = e;
console.log(this.company);
this.initLoad(); this.initLoad();
}) })
}, },

View File

@ -273,7 +273,7 @@
"path": "companySign/companySign", "path": "companySign/companySign",
"style": { "style": {
"navigationBarTitleText": "签约公司详情", "navigationBarTitleText": "签约公司详情",
"enablePullDownRefresh": false, "enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#0122C7", "navigationBarBackgroundColor": "#0122C7",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }

View File

@ -2,14 +2,16 @@
<view class=""> <view class="">
<company :id="id" type="company"></company> <company :id="id" type="company"></company>
<view class="need_contract" v-if="!company.contract||!company.contract.status||!company.company.is_contract"> <view class="need_contract" v-if="!company.contract||!company.contract.status||!company.company.is_contract">
<view class="title">电子合同</view> <!-- <view class="title">电子合同</view> -->
<picker v-if="company.contract&&company.contract.check_status==0||!company.contract" <picker v-if="company.contract&&company.contract.check_status==0||!company.contract"
:range="contractTypeList" range-key="name" @change="changeType"> :range="contractTypeList" range-key="name" @change="changeType">
<u-button class="btns"> <button class="btns" style="width: 694rpx; margin: 0 auto;border-radius: 54rpx;overflow: hidden;background-color: #0122c7;color: #fff;">
<u-icon name="../../static/img/company/HT.png" size="20" style="margin-right: 10rpx;"></u-icon> <u-icon name="../../static/img/company/HT.png" size="20" style="margin-right: 10rpx;"></u-icon>
发起合同 发起合同
</u-button> </button>
<!-- <mybtn text="生成合同" position="false"></mybtn> --> <!-- <view style="width: 694rpx; margin: 0 auto;border-radius: 54rpx;overflow: hidden;">
<mybtn text="生成合同" :position="false"><u-icon name="../../static/img/company/HT.png" size="20" style="margin-right: 10rpx;"></u-icon></mybtn>
</view> -->
</picker> </picker>
<view v-if="company.contract&&company.contract.check_status==1"> <view v-if="company.contract&&company.contract.check_status==1">
<button class="btn tips_center">合同已生成,请等待审核</button> <button class="btn tips_center">合同已生成,请等待审核</button>
@ -34,7 +36,7 @@
</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="clickContract(2)">发送合同</button>
</view> </view>
</view> </view>
<view v-if="company.contract&&company.contract.check_status==3" class="card"> <view v-if="company.contract&&company.contract.check_status==3" class="card">
@ -61,6 +63,7 @@
</view> </view>
</view> </view>
</view> </view>
<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>
</view> </view>
</template> </template>
@ -90,7 +93,10 @@
typeShow: false, typeShow: false,
timer: null, // timer: null, //
timerCount: 0, // timerCount: 0, //
contractTypeList: [] contractTypeList: [],
modelShow: false,
modelType: 1,
nowContractType: -1
} }
}, },
onLoad(options) { onLoad(options) {
@ -122,11 +128,13 @@
}, },
changeType(e) { changeType(e) {
// console.log(this.contractTypeList[e.detail.value]); // console.log(this.contractTypeList[e.detail.value]);
this.createContract({ this.nowContractType = e.detail.value;
party_b: this.id, this.clickContract(1);
contract_type: this.contractTypeList[e.detail.value].id, // this.createContract({
type: 1 //1-,2- // party_b: this.id,
}) // contract_type: this.contractTypeList[e.detail.value].id,
// type: 1 //1-,2-
// })
}, },
// //
naviToContract(file) { naviToContract(file) {
@ -144,61 +152,67 @@
}) })
this.contractTypeList = res.data; this.contractTypeList = res.data;
}, },
clickContract(e){
this.modelType = e;
this.modelShow = true;
},
// //
async createContract(data) { async createContract(data) {
uni.showModal({ uni.showLoading({
content: '请检查信息无误后再生成合同', title: '合同生成中',
confirmText: '确认无误', mask: true
cancelText: '我再看看', })
confirmColor: '#3175f9', let res = await initiateContract({
success: async (e) => { party_b: this.id,
if (e.confirm) { contract_type: this.contractTypeList[this.nowContractType].id,
uni.showLoading({ type: 1
title: '合同生成中', })
mask: true this.initCompany();
}) uni.hideLoading();
let res = await initiateContract({ Toast(res.msg || '合同已生成');
party_b: data.party_b, this.navTo('/subpkg/submit/submit?type=' + 1);
contract_type: data.contract_type, // uni.showModal({
type: data.type // content: '',
}) // confirmText: '',
this.initCompany(); // cancelText: '',
uni.hideLoading(); // confirmColor: '#3175f9',
Toast(res.msg || '合同已生成'); // success: async (e) => {
this.navTo('/subpkg/submit/submit?type=' + 1); // if (e.confirm) {
}
} // }
}) // }
// })
}, },
// //
async addContract(data) { async addContract(data) {
uni.showModal({ try {
content: '请检查合同无误后再发送', uni.showLoading({
confirmText: '确认无误', title: '合同发送中',
cancelText: '我再看看', mask: true
confirmColor: '#3175f9', })
success: async (e) => { let res = await Draftingcontracts({
if (e.confirm) { id: this.id
try { });
uni.showLoading({ this.initCompany();
title: '合同发送中', this.startTimer();
mask: true uni.hideLoading();
}) Toast('合同已发送');
let res = await Draftingcontracts({ // this.navTo('/subpkg/submit/submit');
id: this.id } catch (e) {
}); uni.hideLoading();
this.initCompany(); Toast(e.msg || '合同发送失败');
this.startTimer(); }
uni.hideLoading(); // uni.showModal({
Toast('合同已发送'); // content: '',
// this.navTo('/subpkg/submit/submit'); // confirmText: '',
} catch (e) { // cancelText: '',
uni.hideLoading(); // confirmColor: '#3175f9',
Toast(e.msg || '合同发送失败'); // success: async (e) => {
} // if (e.confirm) {
}
} // }
}) // }
// })
}, },
// //
async getPostsms() { async getPostsms() {
@ -239,7 +253,9 @@
}, },
}, },
onPullDownRefresh() { onPullDownRefresh() {
uni.stopPullDownRefresh() this.initCompany().then(()=>{
uni.stopPullDownRefresh()
})
} }
} }
</script> </script>