更改签约校验

This commit is contained in:
闫晓茹 2023-11-10 09:46:18 +08:00
parent e04acfa2dc
commit ba0c05a4ab

View File

@ -238,15 +238,83 @@
}, },
methods: { methods: {
protocolshowtrue() { protocolshowtrue() {
if (!this.query.county || !this.query.orgNo || !this.query.userName || !this.query.crowdList || this.query if (!this.query.residentName) {
.crowdList.length == 0 || !this.query.packageList ||
this.query.packageList.length == 0) {
this.$refs.uToast.show({ this.$refs.uToast.show({
title: '请完善完信息', title: '请输入名字',
type: 'error', type: 'error',
}) })
return } else if (!this.query.identity) {
} this.$refs.uToast.show({
title: '请输入身份证号',
type: 'error',
})
} else if (!this.query.phone) {
this.$refs.uToast.show({
title: '请输入手机号',
type: 'error',
})
} else if (!this.query.countyName) {
this.$refs.uToast.show({
title: '请选择现住区县',
type: 'error',
})
} else if (!this.query.townName) {
this.$refs.uToast.show({
title: '请选择乡镇/街道',
type: 'error',
})
} else if (!this.query.committeeName) {
this.$refs.uToast.show({
title: '请选择村/社区',
type: 'error',
})
} else if (!this.query.address) {
this.$refs.uToast.show({
title: '请输入详细地址',
type: 'error',
})
} else if (!this.query.orgName) {
this.$refs.uToast.show({
title: '请选择签约机构',
type: 'error',
})
} else if (!this.query.userName) {
this.$refs.uToast.show({
title: '请输入医生名字',
type: 'error',
})
} else if (!this.query.packagesName) {
this.$refs.uToast.show({
title: '请选择服务包',
type: 'error',
})
} else if (!this.query.signTime) {
this.$refs.uToast.show({
title: '请选择签约时间',
type: 'error',
})
} else if (!this.query.signYears) {
this.$refs.uToast.show({
title: '请选择签约周期',
type: 'error',
})
} else if (this.radio != 2) {
this.$refs.uToast.show({
title: '请先同意并签署服务协议',
type: 'error',
})
}else{
// if (!this.query.county || !this.query.orgNo || !this.query.userName || !this.query.crowdList || this.query
// .crowdList.length == 0 || !this.query.packageList ||
// this.query.packageList.length == 0) {
// this.$refs.uToast.show({
// title: '',
// type: 'error',
// })
// return
// }
if (this.query.signYears >= 10) { if (this.query.signYears >= 10) {
this.$refs.uToast.show({ this.$refs.uToast.show({
title: '签约周期过长', title: '签约周期过长',
@ -282,244 +350,247 @@
} else { } else {
this.protocolshow = true this.protocolshow = true
} }
}, }
updata() { },
if (this.radio == 2) { updata() {
if (!this.query.signYears) this.query.signYears = 1 if (this.radio == 2) {
let date = new Date(); if (!this.query.signYears) this.query.signYears = 1
let year = date.getFullYear(); let date = new Date();
let month = date.getMonth() + 1; let year = date.getFullYear();
let day = date.getDate(); let month = date.getMonth() + 1;
if (month < 10) { let day = date.getDate();
month = '0' + month; if (month < 10) {
month = '0' + month;
}
if (day < 10) {
day = '0' + day;
}
this.query.signTime = year + '-' + month + '-' + day;
if (this.query.identity) {
this.query.birthday = getBirthday(this.query.identity)
let gender = getSex(this.query.identity)
if (gender == '女') {
this.query.gender = 2
} else if (gender == '男') {
this.query.gender = 1
} else {
this.query.gender = 99
} }
if (day < 10) { }
day = '0' + day;
}
this.query.signTime = year + '-' + month + '-' + day;
if (this.query.identity) {
this.query.birthday = getBirthday(this.query.identity)
let gender = getSex(this.query.identity)
if (gender == '女') {
this.query.gender = 2
} else if (gender == '男') {
this.query.gender = 1
} else {
this.query.gender = 99
}
}
applysave(this.query).then(res => {
if (res.code == 200) {
this.$refs.uToast.show({
title: '签约成功',
type: 'success',
})
uni.switchTab({
url: "/pages/homepage/homepage"
})
} else {
this.$refs.uToast.show({
title: '签约失败,请重新签约',
type: 'error',
})
}
}) applysave(this.query).then(res => {
} else { if (res.code == 200) {
this.$refs.uToast.show({ this.$refs.uToast.show({
title: '请先同意并签署服务协议', title: '签约成功',
type: 'error', type: 'success',
}) })
} uni.switchTab({
}, url: "/pages/homepage/homepage"
// })
changeRadio() { } else {
this.radio == 1 ? this.radio = 2 : this.radio = 1 this.$refs.uToast.show({
}, title: '签约失败,请重新签约',
// type: 'error',
tapstep(val) { })
if (val == 1) {
this.stepnumber = 1
} else if (val == 2) {
this.stepnumber = 2
} else if (val == '+') {
this.stepnumber++
} else if (val == '-') {
this.stepnumber--
}
},
//
countyconfirm(e) {
this.query.county = e[0].value
this.query.countyName = e[0].label
const pid = this.countylist.find(m => m.areaCode === e[0].value).id
this.arealistinfo(pid, 'Township')
},
//
Townshipconfirm(e) {
this.query.town = e[0].value
this.query.townName = e[0].label
const pid = this.Townshiplist.find(m => m.streetCode === e[0].value).id
this.arealistinfo(pid, 'village')
},
//
villageconfirm(e) {
this.query.committee = e[0].value
this.query.committeeName = e[0].label
},
//list
arealistinfo(code, list) {
arealist(code).then(res => {
if (list == 'county') {
this.countylist = res.data
} else if (list == 'Township') {
this.Townshiplist = res.data
} else if (list == 'village') {
this.villagelist = res.data
} }
}) })
}, // }
// } else {
gochoosedoctor() { this.$refs.uToast.show({
if (!this.query.orgNo) { title: '请先同意并签署服务协议',
this.$refs.uToast.show({ type: 'error',
title: '请先选择签约机构', })
type: 'error', }
}) },
} else { //
uni.navigateTo({ changeRadio() {
url: `/pagesC/choosedoctor/choosedoctor?orgNo=${this.query.orgNo}&userNo=${this.query.userNo}&static=${1}` this.radio == 1 ? this.radio = 2 : this.radio = 1
}) },
//
tapstep(val) {
if (val == 1) {
this.stepnumber = 1
} else if (val == 2) {
this.stepnumber = 2
} else if (val == '+') {
this.stepnumber++
} else if (val == '-') {
this.stepnumber--
}
},
//
countyconfirm(e) {
this.query.county = e[0].value
this.query.countyName = e[0].label
const pid = this.countylist.find(m => m.areaCode === e[0].value).id
this.arealistinfo(pid, 'Township')
},
//
Townshipconfirm(e) {
this.query.town = e[0].value
this.query.townName = e[0].label
const pid = this.Townshiplist.find(m => m.streetCode === e[0].value).id
this.arealistinfo(pid, 'village')
},
//
villageconfirm(e) {
this.query.committee = e[0].value
this.query.committeeName = e[0].label
},
//list
arealistinfo(code, list) {
arealist(code).then(res => {
if (list == 'county') {
this.countylist = res.data
} else if (list == 'Township') {
this.Townshiplist = res.data
} else if (list == 'village') {
this.villagelist = res.data
} }
}, })
// },
goselectInstitution() { //
gochoosedoctor() {
if (!this.query.orgNo) {
this.$refs.uToast.show({
title: '请先选择签约机构',
type: 'error',
})
} else {
uni.navigateTo({ uni.navigateTo({
url: `/pagesC/selectInstitution/selectInstitution?orgNo=${this.query.orgNo}` url: `/pagesC/choosedoctor/choosedoctor?orgNo=${this.query.orgNo}&userNo=${this.query.userNo}&static=${1}`
}) })
}, }
// },
Townshipshowtrue() { //
if (!this.query.county) { goselectInstitution() {
this.$refs.uToast.show({ uni.navigateTo({
title: '请先选择区县', url: `/pagesC/selectInstitution/selectInstitution?orgNo=${this.query.orgNo}`
type: 'error', })
},
//
Townshipshowtrue() {
if (!this.query.county) {
this.$refs.uToast.show({
title: '请先选择区县',
type: 'error',
})
} else {
this.Townshipshow = true
}
},
//
villageshowtrue() {
if (!this.query.town) {
this.$refs.uToast.show({
title: '请先选择街道/乡镇',
type: 'error',
})
} else {
this.villageshow = true
}
},
//
changeCrowd() {
this.showGroup = 1
this.popupShow = true
},
//
changePackages() {
if (!this.query.crowdNoList) {
this.$refs.uToast.show({
title: '请先选择所属人群',
type: 'error',
})
return
}
if (!this.query.orgNo) {
this.$refs.uToast.show({
title: '请先选择签约机构',
type: 'error',
})
return
}
this.showGroup = 2
this.popupShow = true
},
//list
getCrowdinfo() {
getCrowd(uni.getStorageSync('userinfo').cardNo).then(res => {
res.data.forEach(e => {
e.checked = false
})
this.crowdslist = res.data
})
},
closeCrowds() {
this.popupShow = false
if (this.showGroup == 1) {
this.query.crowdList = []
this.query.crowdsName = ''
this.query.crowdNoList.forEach(el => {
this.crowdslist.forEach(ele => {
if (el == ele.crowdNo) {
var obj = {
crowdNo: ele.crowdNo,
crowdName: ele.crowdName
}
this.query.crowdList.push(obj)
this.query.crowdsName = ele.crowdName + ',' + this.query.crowdsName
}
}) })
} else { })
this.Townshipshow = true var obj = {
crowdNoList: this.query.crowdNoList,
orgNo: this.query.orgNo
} }
}, getPackageByCrowdNo(obj, '1').then(res => {
//
villageshowtrue() {
if (!this.query.town) {
this.$refs.uToast.show({
title: '请先选择街道/乡镇',
type: 'error',
})
} else {
this.villageshow = true
}
},
//
changeCrowd() {
this.showGroup = 1
this.popupShow = true
},
//
changePackages() {
if (!this.query.crowdNoList) {
this.$refs.uToast.show({
title: '请先选择所属人群',
type: 'error',
})
return
}
if (!this.query.orgNo) {
this.$refs.uToast.show({
title: '请先选择签约机构',
type: 'error',
})
return
}
this.showGroup = 2
this.popupShow = true
},
//list
getCrowdinfo() {
getCrowd(uni.getStorageSync('userinfo').cardNo).then(res => {
res.data.forEach(e => { res.data.forEach(e => {
e.checked = false e.checked = false
}) })
this.crowdslist = res.data this.packageslist = res.data
}) })
}, } else {
closeCrowds() { this.query.packageList = []
this.popupShow = false this.query.packagesName = ''
if (this.showGroup == 1) { this.query.BasePackage = ''
this.query.crowdList = [] this.query.PersonalityPack = ''
this.query.crowdsName = '' this.query.packSignCost = 0
this.query.crowdNoList.forEach(el => { this.query.packageNoList.forEach(el => {
this.crowdslist.forEach(ele => { this.packageslist.forEach(ele => {
if (el == ele.crowdNo) { if (el == ele.packageNo) {
var obj = { this.query.packSignCost = this.query.packSignCost + ele.packCost
crowdNo: ele.crowdNo, var obj = {
crowdName: ele.crowdName packageNo: ele.packageNo,
} packageName: ele.packageName
this.query.crowdList.push(obj)
this.query.crowdsName = ele.crowdName + ',' + this.query.crowdsName
} }
}) this.query.packageList.push(obj)
}) this.query.packagesName = ele.packageName + ',' + this.query.packagesName
var obj = { if (ele.packCategory == 0) {
crowdNoList: this.query.crowdNoList, this.query.BasePackage = ele.packageName + ',' + this.query.BasePackage
orgNo: this.query.orgNo } else if (ele.packCategory == 1) {
} this.query.PersonalityPack = ele.packageName + ',' + this.query
getPackageByCrowdNo(obj, '1').then(res => { .PersonalityPack
res.data.forEach(e => {
e.checked = false
})
this.packageslist = res.data
})
} else {
this.query.packageList = []
this.query.packagesName = ''
this.query.BasePackage = ''
this.query.PersonalityPack = ''
this.query.packSignCost = 0
this.query.packageNoList.forEach(el => {
this.packageslist.forEach(ele => {
if (el == ele.packageNo) {
this.query.packSignCost = this.query.packSignCost + ele.packCost
var obj = {
packageNo: ele.packageNo,
packageName: ele.packageName
}
this.query.packageList.push(obj)
this.query.packagesName = ele.packageName + ',' + this.query.packagesName
if (ele.packCategory == 0) {
this.query.BasePackage = ele.packageName + ',' + this.query.BasePackage
} else if (ele.packCategory == 1) {
this.query.PersonalityPack = ele.packageName + ',' + this.query
.PersonalityPack
}
} }
}) }
}) })
} })
}, }
crowdscheckboxGroupChange(e) {
this.query.crowdNoList = e
},
packagescheckboxGroupChange(e) {
this.query.packageNoList = e
},
//
residentAutographPath(data) {
this.query.residentAutographPath = data.residentAutographPath
this.protocolshow = false
},
}, },
onLoad(options) { crowdscheckboxGroupChange(e) {
this.query.crowdNoList = e
},
packagescheckboxGroupChange(e) {
this.query.packageNoList = e
},
//
residentAutographPath(data) {
this.query.residentAutographPath = data.residentAutographPath
this.protocolshow = false
},
},
onLoad(options) {
this.arealistinfo('371400000000 ', 'county'); this.arealistinfo('371400000000 ', 'county');
this.getCrowdinfo(); this.getCrowdinfo();
let date = new Date(); let date = new Date();