更新优化

This commit is contained in:
weipengfei 2023-08-21 15:34:09 +08:00
parent 33ecd1c80c
commit 02420993bf
2 changed files with 82 additions and 69 deletions

View File

@ -282,7 +282,7 @@
"path": "personnelDetails/personnelDetails", "path": "personnelDetails/personnelDetails",
"style": { "style": {
"navigationBarTitleText": "人员详细信息", "navigationBarTitleText": "人员详细信息",
"enablePullDownRefresh": false, "enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#0122C7", "navigationBarBackgroundColor": "#0122C7",
"navigationBarTextStyle": "white" "navigationBarTextStyle": "white"
} }

View File

@ -266,7 +266,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" v-if="timerCount == 0"> <button class="send_btn" @click="clickContract(2)" v-if="timerCount == 0">
发送合同 发送合同
</button> </button>
<button class="send_btn tips_center" v-else> <button class="send_btn tips_center" v-else>
@ -311,6 +311,7 @@
</view> </view>
</block> </block>
</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>
@ -357,7 +358,10 @@
contract: {}, contract: {},
roles: {} roles: {}
}, },
contractTypeList: [] contractTypeList: [],
modelShow: false,
modelType: 1,
nowContractType: -1
} }
}, },
onLoad(options) { onLoad(options) {
@ -377,6 +381,11 @@
return this.timerCount; return this.timerCount;
} }
}, },
onPullDownRefresh(){
this.loadUserDetail().then(()=>{
uni.stopPullDownRefresh()
});
},
methods: { methods: {
// //
naviToContract(contract_no) { naviToContract(contract_no) {
@ -421,12 +430,14 @@
} }
}, },
changeType(e) { changeType(e) {
// console.log(this.contractTypeList[e.detail.value]); // console.log(this.contractTypeList[]);
this.createContract({ this.nowContractType = e.detail.value;
party_b: this.userInfo.id, this.clickContract(1);
contract_type: this.contractTypeList[e.detail.value].id, // this.createContract({
type: 2 //1-,2- // party_b: this.userInfo.id,
}) // contract_type: this.contractTypeList[e.detail.value].id,
// type: 2 //1-,2-
// })
}, },
// //
async initContractTypeList() { async initContractTypeList() {
@ -438,41 +449,39 @@
}) })
this.contractTypeList = res.data; this.contractTypeList = res.data;
}, },
clickContract(e){
this.modelType = e;
this.modelShow = true;
},
// //
createContract(data) { async createContract() {
uni.showModal({
content: '请检查信息无误后再生成合同',
confirmText: '确认无误',
cancelText: '我再看看',
confirmColor: '#3175f9',
success: async (e) => {
if (e.confirm) {
uni.showLoading({ uni.showLoading({
title: '合同生成中', title: '合同生成中',
mask: true mask: true
}) })
let res = await userInitiateContract({ let res = await userInitiateContract({
party_b: data.party_b, party_b: this.userInfo.id,
contract_type: data.contract_type, contract_type: this.contractTypeList[this.nowContractType].id,
type: data.type type: 2
}) })
this.loadUserDetail(); this.loadUserDetail();
uni.hideLoading(); uni.hideLoading();
Toast('合同已生成'); Toast('合同已生成');
this.navTo('/subpkg/submit/submit?type=' + 1); this.navTo('/subpkg/submit/submit?type=' + 1);
} // uni.showModal({
} // content: '',
}) // confirmText: '',
// cancelText: '',
// confirmColor: '#3175f9',
// success: async (e) => {
// if (e.confirm) {
// }
// }
// })
}, },
// //
async addContract(data) { async addContract() {
uni.showModal({
content: '请检查合同无误后再发送',
confirmText: '确认无误',
cancelText: '我再看看',
confirmColor: '#3175f9',
success: async (e) => {
if (e.confirm) {
try { try {
uni.showLoading({ uni.showLoading({
title: '合同发送中', title: '合同发送中',
@ -490,9 +499,17 @@
uni.hideLoading(); uni.hideLoading();
Toast(e.msg || '合同发送失败'); Toast(e.msg || '合同发送失败');
} }
} // uni.showModal({
} // content: '',
}) // confirmText: '',
// cancelText: '',
// confirmColor: '#3175f9',
// success: async (e) => {
// if (e.confirm) {
// }
// }
// })
}, },
// //
async getPostsms() { async getPostsms() {
@ -526,14 +543,13 @@
} }
}, 1000); }, 1000);
}, },
loadUserDetail() { async loadUserDetail() {
if (!this.id) return; if (!this.id) return;
companyUserDetail({ let res = await companyUserDetail({
id: this.id id: this.id
}).then(res => { })
this.userInfo = res.data; this.userInfo = res.data;
this.skeleton = false; this.skeleton = false;
})
}, },
previewImg(urls, index = 0) { previewImg(urls, index = 0) {
uni.previewImage({ uni.previewImage({
@ -541,9 +557,6 @@
current: index current: index
}) })
} }
},
onPullDownRefresh() {
uni.stopPullDownRefresh()
} }
} }
</script> </script>