| | |
| | | label="联系电话" |
| | | :rules="[ |
| | | { required: true, message: '请填写您的手机号码!' }, |
| | | { pattern: /^1[3456789]\d{9}$/, message: '手机号码格式错误!' } |
| | | { pattern: /^1[3456789]\d{9}$/, message: '手机号码格式错误!' }, |
| | | ]" |
| | | placeholder="请输入您的联系电话" |
| | | /> |
| | |
| | | </div> |
| | | <div |
| | | v-if="!stateDisable" |
| | | style="background-color: rgb(240, 240, 240); padding-top: 25px; height: 175px" |
| | | style=" |
| | | background-color: rgb(240, 240, 240); |
| | | padding-top: 25px; |
| | | height: 175px; |
| | | " |
| | | > |
| | | <van-checkbox |
| | | v-model="approve.agree" |
| | |
| | | </div> |
| | | </div> |
| | | <div v-if="stateDisable && approve.state != 'WaitAudit'"> |
| | | <div style="margin:40px;"> |
| | | <div style="margin: 40px"> |
| | | <van-button round block type="info" @click="stateDisable = false" |
| | | >修 改</van-button |
| | | > |
| | |
| | | protocolTxt: "", |
| | | refCode: "", |
| | | headers: { |
| | | Authorization: "" |
| | | Authorization: "", |
| | | }, |
| | | submitDisabled: true, // 提交按钮,默认禁选 |
| | | showPicker: false, |
| | |
| | | //相关证件 |
| | | certificate: [], |
| | | // 教师同意勾选框 |
| | | checked: false |
| | | checked: false, |
| | | }, |
| | | isUpdate: false, |
| | | |
| | |
| | | // description: "", //个人简介 |
| | | relevantCertificates: [], //相关证件 |
| | | state: "", //审核状态默认待审核 |
| | | agree: false |
| | | agree: false, |
| | | }, |
| | | //picker选择列表 |
| | | colunmsJob: [ |
| | |
| | | "系副主任", |
| | | "专业负责人", |
| | | "主任", |
| | | "其他" |
| | | "其他", |
| | | ], |
| | | colunmsTitle: ["正高级", "高级", "一级", "二级", "三级", "无"], |
| | | colunmsEdu: ["大专", "本科", "硕士", "博士"], |
| | |
| | | fileList: [], |
| | | isWaitAudit: false, |
| | | userId: "", |
| | | isFree: false |
| | | isFree: false, |
| | | }; |
| | | }, |
| | | watch: { |
| | | "approve.agree": { |
| | | handler(val) { |
| | | this.submitDisabled = !val; |
| | | } |
| | | }, |
| | | }, |
| | | $route(to, from) { |
| | | if ( |
| | |
| | | ) { |
| | | this.getProtocol(); |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | created() { |
| | | var that = this; |
| | |
| | | finishAddress({ selectedOptions }) { |
| | | this.showPicker3 = false; |
| | | this.approve.region = selectedOptions |
| | | .map(option => option.text) |
| | | .map((option) => option.text) |
| | | .join("/"); |
| | | }, |
| | | deleteFile(file) { |
| | |
| | | }, |
| | | getUserRole() { |
| | | let that = this; |
| | | that.MG.identity.getCurrentAppUser().then(res => { |
| | | that.MG.identity.getCurrentAppUser().then((res) => { |
| | | that.userId = res.userId; |
| | | let teacherRole = res.roleLinks.find(item => item.role?.refCode == "teacher"); |
| | | let teacherInfo = res.infoList.find(item => item.type == "teacherInfo") ?? {}; |
| | | let wechatInfo = res.infoList.find(item => item.type == "WeChat") ?? {}; |
| | | let studentInfo = res.infoList.find(item => item.type == "Default"); |
| | | let phoneInfo = res.secretList.find(item => item.type == "MobilePhone"); |
| | | let teacherRole = res.roleLinks.find( |
| | | (item) => item.role?.refCode == "teacher" |
| | | ); |
| | | let teacherInfo = |
| | | res.infoList.find((item) => item.type == "teacherInfo") ?? {}; |
| | | let wechatInfo = |
| | | res.infoList.find((item) => item.type == "WeChat") ?? {}; |
| | | let studentInfo = res.infoList.find((item) => item.type == "Default"); |
| | | let phoneInfo = res.secretList.find( |
| | | (item) => item.type == "MobilePhone" |
| | | ); |
| | | if (teacherRole && teacherInfo) { |
| | | this.$store.dispatch("setUserInfo", { |
| | | ...teacherInfo, |
| | | phoneNumber: phoneInfo?.credential, |
| | | icon: wechatInfo?.icon, |
| | | role: "Teacher", |
| | | roleId: teacherRole.role.id |
| | | roleId: teacherRole.role.id, |
| | | }); |
| | | } else if (wechatInfo) { |
| | | this.$store.dispatch("setUserInfo", { |
| | | ...wechatInfo, |
| | | phoneNumber: phoneInfo?.credential, |
| | | role: "Student" |
| | | role: "Student", |
| | | }); |
| | | } else if (studentInfo) { |
| | | this.$store.dispatch("setUserInfo", { |
| | | ...studentInfo, |
| | | icon: wechatInfo?.icon, |
| | | phoneNumber: phoneInfo?.credential, |
| | | role: "Student" |
| | | role: "Student", |
| | | }); |
| | | } |
| | | }); |
| | |
| | | |
| | | getType() { |
| | | const data = { |
| | | refCodes: ["tourism_teacherCertification"] |
| | | refCodes: ["tourism_teacherCertification"], |
| | | }; |
| | | this.MG.resource.getCmsTypeByRefCode(data).then(res => { |
| | | this.MG.resource.getCmsTypeByRefCode(data).then((res) => { |
| | | this.newGetTeacherInfo(); |
| | | this.worksInfo = res[0].cmsTypeLinks[0].children; |
| | | }); |
| | |
| | | appRefCode: "tourismWebsite", |
| | | sort: { |
| | | type: "Desc", |
| | | field: "CreateDate" |
| | | } |
| | | field: "CreateDate", |
| | | }, |
| | | }; |
| | | that.MG.ugc.getTopicMessageList(data).then(res => { |
| | | that.MG.ugc.getTopicMessageList(data).then((res) => { |
| | | try { |
| | | if (res.datas.length > 0) { |
| | | that.fileList = []; |
| | | const resData = res.datas.find( |
| | | i => i.appUserCreator.userId == that.userId |
| | | (i) => i.appUserCreator.userId == that.userId |
| | | ); |
| | | that.approve = that.tool.resultsBytool( |
| | | that.worksInfo, |
| | |
| | | } |
| | | if (that.approve.relevantCertificates.length > 0) { |
| | | if (typeof that.approve.relevantCertificates == "object") { |
| | | that.approve.relevantCertificates.forEach(ele => { |
| | | that.approve.relevantCertificates.forEach((ele) => { |
| | | let imgObj = { |
| | | md5: ele.file.md5, |
| | | url: |
| | |
| | | ele.file.md5, |
| | | linkType: "LinkFile", |
| | | linkProtectType: "Public", |
| | | isImage: true |
| | | isImage: true, |
| | | }; |
| | | that.fileList.push(imgObj); |
| | | }); |
| | |
| | | md5: that.approve.relevantCertificates, |
| | | linkType: "LinkFile", |
| | | linkProtectType: "Public", |
| | | isImage: true |
| | | isImage: true, |
| | | }; |
| | | that.fileList.push(imgObj); |
| | | } |
| | |
| | | .getItem({ |
| | | path: "tourism_protocol", |
| | | fields: { |
| | | tourism_content: [] |
| | | } |
| | | tourism_content: [], |
| | | }, |
| | | }) |
| | | .then(res => { |
| | | .then((res) => { |
| | | try { |
| | | const data = res.datas.find( |
| | | e => e.refCode == "tourism_teacherCertificationAgreement" |
| | | (e) => e.refCode == "tourism_teacherCertificationAgreement" |
| | | ); |
| | | this.protocolTxt = data ? data.tourism_content : "暂无协议"; |
| | | } catch (error) { |
| | |
| | | this.worksInfo, |
| | | this.approve, |
| | | this.fileList |
| | | ) |
| | | ), |
| | | }; |
| | | let basicInfo = JSON.parse(JSON.stringify(this.approve)); |
| | | delete basicInfo.agree; |
| | |
| | | { |
| | | data: JSON.stringify(basicInfo), |
| | | name: basicInfo.fullName, |
| | | type: "teacherInfo" |
| | | } |
| | | ] |
| | | type: "teacherInfo", |
| | | }, |
| | | ], |
| | | }; |
| | | this.MG.identity.setAppUserInfo(userInfo).then(res => { |
| | | this.MG.identity.setAppUserInfo(userInfo).then((res) => { |
| | | this.MG.ugc.newTopicMessage(data).then(() => { |
| | | console.log(res); |
| | | this.subLoading = true; |
| | | const fromRouter = this.$route.query; |
| | | if (res !== false) { |
| | | that.newGetTeacherInfo(); |
| | | } |
| | | if (fromRouter.from && fromRouter.from == "bookDetail") { |
| | | this.$router.replace({ |
| | | name: "bookDetail", |
| | | query: { |
| | | id: this.$route.query.id, |
| | | }, |
| | | }); |
| | | } |
| | | }); |
| | | }); |
| | |
| | | newDataRequests: fields.newData, |
| | | updateDataRequests: fields.updateData, |
| | | delDataRequest: { |
| | | ids: [] |
| | | } |
| | | ids: [], |
| | | }, |
| | | }; |
| | | delete basicInfo.tourism_relevantCertificates; |
| | | delete basicInfo.agree; |
| | |
| | | { |
| | | data: JSON.stringify(basicInfo), |
| | | name: basicInfo.fullName, |
| | | type: "newTeacherInfo" |
| | | } |
| | | ] |
| | | type: "newTeacherInfo", |
| | | }, |
| | | ], |
| | | }; |
| | | this.MG.identity.setAppUserInfo(userInfo).then(res => { |
| | | this.MG.identity.setAppUserInfo(userInfo).then((res) => { |
| | | if (res) { |
| | | this.MG.ugc.updateTopicMessage(data).then(res => { |
| | | this.MG.ugc.updateTopicMessage(data).then((res) => { |
| | | this.subLoading = false; |
| | | const fromRouter = this.$route.query; |
| | | if (res !== false) { |
| | | this.getUserRole(); |
| | | this.newGetTeacherInfo(); |
| | | } |
| | | if (fromRouter.from && fromRouter.from == "bookDetail") { |
| | | this.$router.replace({ |
| | | name: "bookDetail", |
| | | query: { |
| | | id: this.$route.query.id, |
| | | }, |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | |
| | | let size = 1024; |
| | | that.tool |
| | | .getFileMd5(file.file, size * 1024) |
| | | .then(e => { |
| | | .then((e) => { |
| | | const imgData = new FormData(); |
| | | that.fileMd5 = e; |
| | | imgData.append("Md5", e); |
| | |
| | | imgData.append("FileType", FileType); |
| | | imgData.append("MetaData", null); |
| | | imgData.append("file", file.file); |
| | | that.MG.file.upload(imgData).then(res => { |
| | | that.MG.file.upload(imgData).then((res) => { |
| | | if (res) { |
| | | this.fileList.push({ |
| | | md5: e, |
| | | url: this.config.requestCtx + `/file/GetPreViewImage?md5=` + e, |
| | | linkType: "LinkFile", |
| | | linkProtectType: "Public", |
| | | isImage: true |
| | | isImage: true, |
| | | }); |
| | | this.approve.relevantCertificates = this.fileList; |
| | | // this.fileList = this.approve.relevantCertificates |
| | |
| | | } |
| | | }); |
| | | }) |
| | | .catch(e => { |
| | | .catch((e) => { |
| | | that.isLoding = false; |
| | | console.error(e); |
| | | }); |
| | |
| | | } |
| | | this.MG.store |
| | | .getProductTypeField({ |
| | | refCodes: ["post"] |
| | | refCodes: ["post"], |
| | | }) |
| | | .then(res => { |
| | | .then((res) => { |
| | | if (res && res[0].config) { |
| | | let list = JSON.parse(res[0].config).option; |
| | | list.forEach(item => { |
| | | list.forEach((item) => { |
| | | item.text = item.name; |
| | | }); |
| | | this.colunmsJob = list; |
| | |
| | | } |
| | | this.MG.store |
| | | .getProductTypeField({ |
| | | refCodes: ["positionalTitle"] |
| | | refCodes: ["positionalTitle"], |
| | | }) |
| | | .then(res => { |
| | | .then((res) => { |
| | | if (res && res[0].config) { |
| | | let list = JSON.parse(res[0].config).option; |
| | | list.forEach(item => { |
| | | list.forEach((item) => { |
| | | item.text = item.name; |
| | | }); |
| | | this.colunmsTitle = list; |
| | |
| | | } |
| | | this.MG.store |
| | | .getProductTypeField({ |
| | | refCodes: ["education"] |
| | | refCodes: ["education"], |
| | | }) |
| | | .then(res => { |
| | | .then((res) => { |
| | | if (res && res[0].config) { |
| | | let list = JSON.parse(res[0].config).option; |
| | | list.forEach(item => { |
| | | list.forEach((item) => { |
| | | item.text = item.name; |
| | | }); |
| | | this.colunmsEdu = list; |
| | |
| | | onConfirm2(value) { |
| | | this.approve.education = value.text; |
| | | this.showPicker2 = false; |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |