From ba0c05a4abae323f0d9e910b060855f02520250e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=97=AB=E6=99=93=E8=8C=B9?= <1935832701@qq.com> Date: Fri, 10 Nov 2023 09:46:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9=E7=AD=BE=E7=BA=A6=E6=A0=A1?= =?UTF-8?q?=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pagesC/Onlinesigning/Onlinesigning.vue | 527 ++++++++++++++----------- 1 file changed, 299 insertions(+), 228 deletions(-) diff --git a/pagesC/Onlinesigning/Onlinesigning.vue b/pagesC/Onlinesigning/Onlinesigning.vue index dc38921..b6ee73d 100644 --- a/pagesC/Onlinesigning/Onlinesigning.vue +++ b/pagesC/Onlinesigning/Onlinesigning.vue @@ -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 @@ + \ No newline at end of file