PageAdmin网站内容管理系统(CMS)交流论坛

注册

 

QQ登录

只需一步,快速开始

发新话题 回复该主题

在线应聘表单问题 [复制链接]

1#
做一个招聘平台的网站遇到一个问题,其中有一个在线应聘表单的工作经历和教育经历,用信息表怎么设计,求版主大神指导
1.png (, 下载次数:0)

(2021/6/18 17:45:47 上传)

1.png

分享 转发
TOP
2#

工作经历和教育经历可以动态添加和删除,求版主指点
TOP
3#

江湖救急,xiyou大佬
TOP
4#

这两块可以用附属表做,比如你的工作经历附属表字段是:WorkHistory,在提交数据前需要进行数据处理,把属性值改为下面这种数组形式
  1. WorkHistory:[{附属表字段1:字段值1,附属表字段2:字段值2},{附属表字段1:字段值1,附属表字段2:字段值2}]
复制代码
TOP
5#

回复 4楼xiyou的帖子谢谢版主,下面是我做的表单的js部分,你帮我看看哪里有问题
  1. <script type="text/javascript">
  2.     var employmentFormData = { "Id": "", "ColumnId": "3333", "State": "", "IsGood": "", "IsHot": "", "IsTop": "", "PublishFrom": "", "IsOnline": "", "IsExpire": "", "HasThumbnail": "", "IsSubColumnData": "", "Uid": "", "Username": "", "Clicks": "", "Title": "", "Thumbnail": "", "Thedate": "", "IDCard": "", "Sex": "", "NativePlace": "", "Nation": "", "Telephone": "", "MaritalStatus": "", "Mailbox": "", "Politic": "", "Level": "", "Education": "", "ResidenceAddress": "", "MailAddress": "", "ExpectedSalary": "", "Turn": "", "Accept": "", "OtherPositions": "", "WorkExtrahours": "", "Relation": "", "ContactName": "", "LinkTel": "", "DriverLicense": "", "Reward": "", "Punish": "", "Post": "机械设计", "EduHistory":"",WorkHistory:""};
  3.     employmentFormData.Guid = guid();
  4.      employmentFormData.verificationCode = "";
  5.                     new Vue({
  6.                         el: "#employmentForm",
  7.                         data: {
  8.                             submitOk:false,//是否提交成功
  9.                             showWorkHistory:true,
  10.                             formData: employmentFormData,
  11.                             workHistory: [{ workTime: "", workCompany: "", workContent: "", workPay: "", workPosition: "", leavingReason: "" }],//工作经历
  12.                             eduHistory: [{ eduTime: "", eduSchool: "", eduMajor: "", eduDegree: "", eduPosts: "" }],//教育经历
  13.                         },
  14.                         created: function () {

  15.                             this.formData.Guid = guid();
  16.                             this.formData.verificationCode = "";
  17.                         },
  18.                         methods: {
  19.                             addHistory: function (type) {//添加工作或教育经历
  20.                                 if (type ==0) {
  21.                                     this.workHistory.push({ workTime: "", workCompany: "", workContent: "", workPay: "", workPosition: "", leavingReason: "" });
  22.                                 } else
  23.                                 {
  24.                                     this.eduHistory.push({ eduTime: "", eduSchool: "", eduMajor: "", eduDegree: "", eduPosts: "" });
  25.                                 }
  26.                             },
  27.                             removeHistory: function (type, idx) {//移除工作或教育经历
  28.                                 if (type == 0) {
  29.                                     this.workHistory.splice(idx, 1)
  30.                                 }
  31.                                 else {
  32.                                     this.eduHistory.splice(idx, 1)
  33.                                 }

  34.                             },
  35.                             hideWorkHistory: function () {//应届生隐藏工作经历
  36.                                 this.showWorkHistory = !this.showWorkHistory;
  37.                             },
  38.                             postSubmit: function () {
  39.                                 var _this = this;
  40.                                 var validated = this.validateForm({ tipsStyle: 0, beforeSubmit: function () { return _this.beforeSubmitExecute() } });//表单验证
  41.                                 if (validated) {
  42.                                     _this.formData.WorkHistory = _this.workHistory;
  43.                                     _this.formData.EduHistory =_this.eduHistory;
  44.                                     _this.submit({ url: "/e/InfoData/Add?table=employment",data: _this.formData,showSuccessMsg: false, failCallback: _this.failSubmit, success: _this.submitSuccess });
  45.                                 }
  46.                             },
  47.                             beforeSubmitExecute: function () {

  48.                                 return true;
  49.                             },
  50.                             failSubmit: function () {
  51.                                 var _this = this;
  52.                                 if (_this.$refs.verificationCodeImg != undefined) {
  53.                                     _this.$refs.verificationCodeImg.change();//改变验证码。
  54.                                 }
  55.                             },
  56.                             submitSuccess: function (tipsInfo) {
  57.                                 var _this = this;
  58.                                 //回调内容,以下内容可根据需求自行修改。
  59.                                 _this.formData.Guid = guid();//在有附属表的情况下,多次提交必须更新Guid属性值,否则附属表数据会混乱
  60.                                 //重置验证码
  61.                                 if (_this.$refs.verificationCodeImg != undefined) {
  62.                                     _this.$refs.verificationCodeImg.change();//改变验证码。
  63.                                 }
  64.                                 _this.submitOk = true;

  65.                             }
  66.                         },
  67.                     });
  68. </script>
复制代码
已经按你说的了,下面这两属性都改为数组
  1. _this.formData.WorkHistory = _this.workHistory;
  2. _this.formData.EduHistory =_this.eduHistory;
复制代码
但是提交后附属表没有数据,这两个属性我前端调试已经有值,版主帮看看哪里出了问题?
最后编辑古得运维 最后编辑于 2021-06-18 17:27:17
TOP
6#

_this.formData.WorkHistory = _this.workHistory;
改为
_this.formData.WorkHistory =JSON.stringify(_this.workHistory);
数组先转为字符串后再提交。
TOP
7#

回复 6楼xiyou的帖子

谢谢大神,完美解决问题
TOP
发新话题 回复该主题