更改签约校验

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

View File

@ -238,15 +238,83 @@
},
methods: {
protocolshowtrue() {
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) {
if (!this.query.residentName) {
this.$refs.uToast.show({
title: '请完善完信息',
title: '请输入名字',
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) {
this.$refs.uToast.show({
title: '签约周期过长',
@ -282,244 +350,247 @@
} else {
this.protocolshow = true
}
},
updata() {
if (this.radio == 2) {
if (!this.query.signYears) this.query.signYears = 1
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
if (month < 10) {
month = '0' + month;
}
},
updata() {
if (this.radio == 2) {
if (!this.query.signYears) this.query.signYears = 1
let date = new Date();
let year = date.getFullYear();
let month = date.getMonth() + 1;
let day = date.getDate();
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',
})
}
}
})
} else {
this.$refs.uToast.show({
title: '请先同意并签署服务协议',
type: 'error',
})
}
},
//
changeRadio() {
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
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',
})
}
})
},
//
gochoosedoctor() {
if (!this.query.orgNo) {
this.$refs.uToast.show({
title: '请先选择签约机构',
type: 'error',
})
} else {
uni.navigateTo({
url: `/pagesC/choosedoctor/choosedoctor?orgNo=${this.query.orgNo}&userNo=${this.query.userNo}&static=${1}`
})
// }
} else {
this.$refs.uToast.show({
title: '请先同意并签署服务协议',
type: 'error',
})
}
},
//
changeRadio() {
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({
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) {
this.$refs.uToast.show({
title: '请先选择区县',
type: 'error',
}
},
//
goselectInstitution() {
uni.navigateTo({
url: `/pagesC/selectInstitution/selectInstitution?orgNo=${this.query.orgNo}`
})
},
//
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
}
},
//
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 => {
getPackageByCrowdNo(obj, '1').then(res => {
res.data.forEach(e => {
e.checked = false
})
this.crowdslist = res.data
this.packageslist = 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.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
}
})
})
var obj = {
crowdNoList: this.query.crowdNoList,
orgNo: this.query.orgNo
}
getPackageByCrowdNo(obj, '1').then(res => {
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
}
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.getCrowdinfo();
let date = new Date();
@ -568,4 +639,4 @@
</script>
<style lang="scss">
@import "./Onlinesigning.scss";
</style>
</style>