diff --git a/pages.json b/pages.json
index 7fd0b50..e2deb82 100644
--- a/pages.json
+++ b/pages.json
@@ -282,7 +282,7 @@
"path": "personnelDetails/personnelDetails",
"style": {
"navigationBarTitleText": "人员详细信息",
- "enablePullDownRefresh": false,
+ "enablePullDownRefresh": true,
"navigationBarBackgroundColor": "#0122C7",
"navigationBarTextStyle": "white"
}
diff --git a/subpkg/personnelDetails/personnelDetails.vue b/subpkg/personnelDetails/personnelDetails.vue
index 60a69d6..a91b79b 100644
--- a/subpkg/personnelDetails/personnelDetails.vue
+++ b/subpkg/personnelDetails/personnelDetails.vue
@@ -266,7 +266,7 @@
-
+
@@ -357,7 +358,10 @@
contract: {},
roles: {}
},
- contractTypeList: []
+ contractTypeList: [],
+ modelShow: false,
+ modelType: 1,
+ nowContractType: -1
}
},
onLoad(options) {
@@ -377,6 +381,11 @@
return this.timerCount;
}
},
+ onPullDownRefresh(){
+ this.loadUserDetail().then(()=>{
+ uni.stopPullDownRefresh()
+ });
+ },
methods: {
// 查看合同
naviToContract(contract_no) {
@@ -421,12 +430,14 @@
}
},
changeType(e) {
- // console.log(this.contractTypeList[e.detail.value]);
- this.createContract({
- party_b: this.userInfo.id,
- contract_type: this.contractTypeList[e.detail.value].id,
- type: 2 //1-公司,2-个人
- })
+ // console.log(this.contractTypeList[]);
+ this.nowContractType = e.detail.value;
+ this.clickContract(1);
+ // this.createContract({
+ // party_b: this.userInfo.id,
+ // contract_type: this.contractTypeList[e.detail.value].id,
+ // type: 2 //1-公司,2-个人
+ // })
},
// 初始化合同类型
async initContractTypeList() {
@@ -438,61 +449,67 @@
})
this.contractTypeList = res.data;
},
+ clickContract(e){
+ this.modelType = e;
+ this.modelShow = true;
+ },
// 生成合同
- createContract(data) {
- uni.showModal({
- content: '请检查信息无误后再生成合同',
- confirmText: '确认无误',
- cancelText: '我再看看',
- confirmColor: '#3175f9',
- success: async (e) => {
- if (e.confirm) {
- uni.showLoading({
- title: '合同生成中',
- mask: true
- })
- let res = await userInitiateContract({
- party_b: data.party_b,
- contract_type: data.contract_type,
- type: data.type
- })
- this.loadUserDetail();
- uni.hideLoading();
- Toast('合同已生成');
- this.navTo('/subpkg/submit/submit?type=' + 1);
- }
- }
- })
+ async createContract() {
+ uni.showLoading({
+ title: '合同生成中',
+ mask: true
+ })
+ let res = await userInitiateContract({
+ party_b: this.userInfo.id,
+ contract_type: this.contractTypeList[this.nowContractType].id,
+ type: 2
+ })
+ this.loadUserDetail();
+ uni.hideLoading();
+ Toast('合同已生成');
+ this.navTo('/subpkg/submit/submit?type=' + 1);
+ // uni.showModal({
+ // content: '请检查信息无误后再生成合同',
+ // confirmText: '确认无误',
+ // cancelText: '我再看看',
+ // confirmColor: '#3175f9',
+ // success: async (e) => {
+ // if (e.confirm) {
+
+ // }
+ // }
+ // })
},
// 发送合同
- async addContract(data) {
- uni.showModal({
- content: '请检查合同无误后再发送',
- confirmText: '确认无误',
- cancelText: '我再看看',
- confirmColor: '#3175f9',
- success: async (e) => {
- if (e.confirm) {
- try {
- uni.showLoading({
- title: '合同发送中',
- mask: true
- })
- let res = await userDraftingcontracts({
- id: this.userInfo.id
- });
- this.loadUserDetail();
- this.startTimer();
- uni.hideLoading();
- Toast('合同已发送');
- // this.navTo('/subpkg/submit/submit?type='+2);
- } catch (e) {
- uni.hideLoading();
- Toast(e.msg || '合同发送失败');
- }
- }
- }
- })
+ async addContract() {
+ try {
+ uni.showLoading({
+ title: '合同发送中',
+ mask: true
+ })
+ let res = await userDraftingcontracts({
+ id: this.userInfo.id
+ });
+ this.loadUserDetail();
+ this.startTimer();
+ uni.hideLoading();
+ Toast('合同已发送');
+ // this.navTo('/subpkg/submit/submit?type='+2);
+ } catch (e) {
+ uni.hideLoading();
+ Toast(e.msg || '合同发送失败');
+ }
+ // uni.showModal({
+ // content: '请检查合同无误后再发送',
+ // confirmText: '确认无误',
+ // cancelText: '我再看看',
+ // confirmColor: '#3175f9',
+ // success: async (e) => {
+ // if (e.confirm) {
+
+ // }
+ // }
+ // })
},
// 发送短信
async getPostsms() {
@@ -526,14 +543,13 @@
}
}, 1000);
},
- loadUserDetail() {
+ async loadUserDetail() {
if (!this.id) return;
- companyUserDetail({
+ let res = await companyUserDetail({
id: this.id
- }).then(res => {
- this.userInfo = res.data;
- this.skeleton = false;
})
+ this.userInfo = res.data;
+ this.skeleton = false;
},
previewImg(urls, index = 0) {
uni.previewImage({
@@ -541,9 +557,6 @@
current: index
})
}
- },
- onPullDownRefresh() {
- uni.stopPullDownRefresh()
}
}