Browse Source

前端-简历

armg 1 year ago
parent
commit
d5258de9d8

+ 1 - 1
ruoyi-ui/.env.development

@@ -1,5 +1,5 @@
 # 页面标题
-VUE_APP_TITLE = CRM系统
+VUE_APP_TITLE = 简历系统
 
 # 开发环境配置
 ENV = 'development'

+ 1 - 1
ruoyi-ui/.env.production

@@ -1,5 +1,5 @@
 # 页面标题
-VUE_APP_TITLE = CRM系统
+VUE_APP_TITLE = 简历系统
 
 # 生产环境配置
 ENV = 'production'

+ 1 - 0
ruoyi-ui/package.json

@@ -62,6 +62,7 @@
     "js-beautify": "1.13.0",
     "js-cookie": "3.0.1",
     "jsencrypt": "3.0.0-rc.1",
+    "moment": "^2.30.1",
     "nprogress": "0.2.0",
     "quill": "1.3.7",
     "screenfull": "5.0.2",

+ 3 - 0
ruoyi-ui/src/api/mobile/resume/index.js

@@ -0,0 +1,3 @@
+import request from '@/utils/request'
+const system = "/system"
+

+ 1 - 0
ruoyi-ui/src/permission.js

@@ -11,6 +11,7 @@ NProgress.configure({ showSpinner: false })
 const whiteList = ['/login', '/register']
 
 router.beforeEach((to, from, next) => {
+  console.log("====",to, from)
   NProgress.start()
   if (getToken()) {
     to.meta.title && store.dispatch('settings/setTitle', to.meta.title)

+ 10 - 10
ruoyi-ui/src/router/index.js

@@ -114,21 +114,21 @@ export const constantRoutes = [
       }
     ]
   },
-  // mobile - CRM系统-路由
+  // mobile - 简历-路由
   {
-    path: "/mobile/crm/index",
-    name: 'MobileCrmIndex',
-    component: () => import('../views/mobile/crm/index.vue')
+    path: "/mobile/resume/index",
+    name: 'MobileResumeIndex',
+    component: () => import('../views/mobile/resume/index')
   },
   {
-    path: "/mobile/crm/form",
-    name: 'MobileCrmForm',
-    component: () => import('../views/mobile/crm/form.vue')
+    path: "/mobile/resume/form",
+    name: 'MobileResumeForm',
+    component: () => import('../views/mobile/resume/form')
   },
   {
-    path: "/mobile/crm/detail",
-    name: 'MobileCrmDetail',
-    component: () => import('../views/mobile/crm/detail.vue')
+    path: "/mobile/resume/detail",
+    name: 'MobileResumeDetail',
+    component: () => import('../views/mobile/resume/detail')
   },
   {
     // path: '/index',

+ 155 - 0
ruoyi-ui/src/views/mobile/resume/detail.vue

@@ -0,0 +1,155 @@
+<template>
+  <div class="mobileWrapper">
+    <van-nav-bar
+      left-text="返回"
+      left-arrow
+      v-preventReClick
+      @click-left="onClickLeft"
+      title="简历详情"
+    />
+    <van-cell-group>
+      <van-cell title="姓名" :value="userForm.userName" />
+      <van-cell title="手机号码" :value="userForm.mobile" />
+      <van-cell title="简历" :value="userForm.resumeFile" />
+      <van-cell title="工作地" :value="userForm.workingPlace" />
+      <van-cell title="学历" :value="userForm.degree" />
+      <van-cell title="性别" :value="userForm.gender" />
+      <van-cell title="年龄" :value="userForm.age" />
+      <van-cell title="居住地" :value="userForm.residence" />
+      <van-cell title="专业" :value="userForm.major" />
+      <van-cell title="行业经验" :value="userForm.industryExperience" />
+      <van-cell title="毕业院校" :value="userForm.graduateCollege" />
+      <van-cell title="语言能力" :value="userForm.languageAbility" />
+      <van-cell title="证书" :value="userForm.certificate" />
+      <van-cell title="电子邮箱" :value="userForm.email" />
+      <van-cell title="生日" :value="userForm.birthday" />
+      <van-cell title="工作年限" :value="userForm.experience" />
+      <van-cell title="期望薪资" :value="userForm.exceptedSalary" />
+      <van-cell title="最近工作公司" :value="userForm.lastCompany" />
+      <van-cell title="最近工作行业" :value="userForm.lastIndustry" />
+      <van-cell title="最近工作职位" :value="userForm.lastPosition" />
+      <van-cell title="专业技能" :value="userForm.keyWords" />
+      <van-cell title="自我评价" :value="userForm.selfEvaluation" />
+      <van-cell title="工作履历" :value="userForm.resumeWork" />
+      <van-cell title="项目经验" :value="userForm.resumeProject" />
+      <van-cell title="教育经历" :value="userForm.resumeEducation" />
+    </van-cell-group>
+    <div class="public-flex-around btnlist">
+      <van-button type="info" round v-preventReClick @click="toForm"
+        >修改</van-button
+      >
+      <van-button type="danger" round v-preventReClick @click="toDetele"
+        >删除</van-button
+      >
+    </div>
+  </div>
+</template>
+<script>
+import {
+  listResume,
+  getResume,
+  delResume,
+  addResume,
+  updateResume,
+} from "@/api/system/resume";
+import { Dialog } from "vant";
+export default {
+  name: "MobileResumeDetail",
+  data() {
+    return {
+      id: "",
+      userForm: {
+        userName: "",
+        mobile: "",
+        resumeFile: [],
+        workingPlace: "",
+        degree: "",
+        gender: "",
+        age: "",
+        residence: "",
+        major: "",
+        industryExperience: "",
+        graduateCollege: "",
+        position: "",
+        languageAbility: "",
+        certificate: "",
+        email: "",
+        birthday: "",
+        experience: "",
+        exceptedSalary: "",
+        lastCompany: "",
+        lastIndustry: "",
+        lastPosition: "",
+        keyWords: "",
+        selfEvaluation: "",
+        resumeWork: "",
+        resumeProject: "",
+        resumeEducation: "",
+      },
+    };
+  },
+  created() {},
+  mounted() {
+    let that = this;
+    this.id = this.$route.query.id ? this.$route.query.id : null;
+    that.$toast.loading({
+      duration: 0,
+      forbidClick: true,
+      message: "加载中...",
+    });
+    getResume(this.id)
+      .then((response) => {
+        that.$toast.clear();
+        that.userForm = response.data;
+      })
+      .catch((err) => {
+        that.$toast(err.msg);
+      });
+  },
+  methods: {
+    toForm() {
+      this.$router.push({
+        name: "MobileCrmForm",
+        query: { type: 2, id: this.id },
+      });
+    },
+    // 删除
+    toDetele() {
+      let that = this;
+      Dialog.confirm({
+        title: "提示",
+        message: "是否删除该条数据?",
+      })
+        .then(async () => {
+          delResume(this.id)
+            .then((response) => {
+              if (response.code == 200) {
+                that.$toast.success("删除成功");
+                that.$router.back(-1);
+              }
+            })
+            .catch(() => {
+              that.$toast(err.msg);
+            });
+        })
+        .catch(() => {});
+    },
+    onClickLeft() {
+      this.$router.back(-1);
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+h5 {
+  background: #f4f4f4;
+  margin: 0;
+  padding: 10px 5px;
+}
+.btnlist {
+  margin-top: 20px;
+  button {
+    width: 40%;
+  }
+}
+</style>

+ 342 - 0
ruoyi-ui/src/views/mobile/resume/form.vue

@@ -0,0 +1,342 @@
+<template>
+  <div class="mobileWrapper">
+    <van-nav-bar
+      left-text="返回"
+      left-arrow
+      v-preventReClick
+      @click-left="onClickLeft"
+      :title="title"
+    />
+    <van-form ref="userForm" @submit="onSubmit">
+      <!-- <h5>简历</h5> -->
+      <van-field
+        v-model="userForm.userName"
+        name="userName"
+        label="姓名"
+        maxlength="20"
+        placeholder="请输入姓名"
+        :rules="[{ required: true }]"
+      />
+      <van-field
+        v-model="userForm.mobile"
+        name="mobile"
+        type="tel"
+        maxlength="11"
+        label="手机号码"
+        placeholder="请输入手机号码"
+        :rules="[
+          { required: true, message: '请输入手机号码' },
+          { pattern: /^1[3456789]\d{9}$/, message: '手机号码格式错误!' },
+        ]"
+      />
+      <van-field name="resumeFile" label="简历" :rules="[{ required: true }]">
+        <template #input>
+          <van-uploader
+            v-model="userForm.resumeFile"
+          >
+            <van-button icon="plus" type="primary" size="small">上传简历</van-button>
+          </van-uploader>
+        </template>
+      </van-field>
+
+      <van-field
+        v-model="userForm.workingPlace"
+        name="workingPlace"
+        label="工作地"
+        placeholder="请输入工作地"
+      />
+      <van-field
+        v-model="userForm.degree"
+        name="degree"
+        label="学历"
+        placeholder="请输入学历"
+      />
+      <van-field
+        readonly
+        clickable
+        :value="userForm.gender"
+        name="gender"
+        label="性别"
+        placeholder="请选择性别"
+        @click="showPicker_gender = true"
+      />
+      <van-popup v-model="showPicker_gender" position="bottom">
+        <van-picker
+          show-toolbar
+          :columns="columns_gender"
+          @confirm="onConfirmGender"
+          @cancel="showPicker_gender = false"
+        />
+        <!-- value-key="dictLabel" -->
+      </van-popup>
+      <van-field
+        v-model="userForm.age"
+        name="age"
+        label="年龄"
+        placeholder="请输入年龄"
+      />
+      <van-field
+        v-model="userForm.residence"
+        name="residence"
+        label="居住地"
+        placeholder="请输入居住地"
+      />
+      <van-field
+        v-model="userForm.major"
+        name="major"
+        label="专业"
+        placeholder="请输入专业"
+      />
+      <van-field
+        v-model="userForm.industryExperience"
+        name="industryExperience"
+        label="行业经验"
+        placeholder="请输入行业经验"
+      />
+      <van-field
+        v-model="userForm.graduateCollege"
+        name="graduateCollege"
+        label="毕业院校"
+        placeholder="请输入毕业院校"
+      />
+      <van-field
+        v-model="userForm.position"
+        name="position"
+        label="岗位"
+        placeholder="请输入岗位"
+      />
+      <van-field
+        v-model="userForm.languageAbility"
+        name="languageAbility"
+        label="语言能力"
+        placeholder="请输入语言能力"
+      />
+      <van-field
+        v-model="userForm.certificate"
+        name="certificate"
+        label="证书"
+        placeholder="请输入证书"
+      />
+      <van-field
+        v-model="userForm.email"
+        name="email"
+        label="电子邮箱"
+        placeholder="请输入电子邮箱"
+      />
+      <van-field
+        readonly
+        clickable
+        name="birthday"
+        :value="userForm.birthday"
+        label="生日"
+        placeholder="点击选择生日"
+        @click="showPicker_birthday = true"
+        :rules="[{ required: true }]"
+      />
+      <van-popup v-model="showPicker_birthday" position="bottom">
+        <van-datetime-picker
+          :value="currentDate"
+          type="date"
+          :min-date="minDate"
+          :max-date="maxDate"
+          @cancel="showPicker_birthday = false"
+          @confirm="onUpdateBirthday"
+        />
+      </van-popup>
+      <van-field
+        v-model="userForm.experience"
+        name="experience"
+        label="工作年限"
+        placeholder="请输入工作年限"
+      />
+      <van-field
+        v-model="userForm.exceptedSalary"
+        name="exceptedSalary"
+        label="期望薪资"
+        placeholder="请输入期望薪资"
+      />
+      <van-field
+        v-model="userForm.lastCompany"
+        name="lastCompany"
+        label="最近工作公司"
+        placeholder="请输入最近工作公司"
+      />
+      <van-field
+        v-model="userForm.lastIndustry"
+        name="lastIndustry"
+        label="最近工作行业"
+        placeholder="请输入最近工作行业"
+      />
+      <van-field
+        v-model="userForm.lastPosition"
+        name="lastPosition"
+        label="最近工作职位"
+        placeholder="请输入最近工作职位"
+      />
+      <van-field
+        v-model="userForm.keyWords"
+        name="keyWords"
+        label="专业技能"
+        placeholder="请输入专业技能"
+      />
+      <van-field
+        v-model="userForm.selfEvaluation"
+        name="selfEvaluation"
+        label="自我评价"
+        placeholder="请输入自我评价"
+      />
+      <van-field
+        v-model="userForm.resumeWork"
+        name="resumeWork"
+        label="工作履历"
+        placeholder="请输入工作履历"
+      />
+      <van-field
+        v-model="userForm.resumeProject"
+        name="resumeProject"
+        label="项目经验"
+        placeholder="请输入项目经验"
+      />
+      <van-field
+        v-model="userForm.resumeEducation"
+        name="resumeEducation"
+        label="教育经历"
+        placeholder="请输入教育经历"
+      />
+      <div style="margin: 16px">
+        <van-button round block type="info" native-type="submit"
+          >提交</van-button
+        >
+      </div>
+    </van-form>
+  </div>
+</template>
+<script>
+import moment from "moment";
+import {
+  listResume,
+  getResume,
+  delResume,
+  addResume,
+  updateResume,
+} from "@/api/system/resume";
+export default {
+  name: "MobileResumeForm",
+  dicts: [
+    // "CUSTOMER_STATUS", //客户状态
+  ],
+  data() {
+    return {
+      columns_gender: ["男", "女"],
+      showPicker_gender: false,
+      showPicker_birthday: false,
+      title: "新增简历",
+      id: "",
+      minDate: new Date(1924, 1, 1),
+      maxDate: new Date(),
+      currentDate: new Date(),
+      userForm: {
+        userName: "",
+        mobile: "",
+        resumeFile: [],
+        workingPlace: "",
+        degree: "",
+        gender: "",
+        age: "",
+        residence: "",
+        major: "",
+        industryExperience: "",
+        graduateCollege: "",
+        position: "",
+        languageAbility: "",
+        certificate: "",
+        email: "",
+        birthday: "",
+        experience: "",
+        exceptedSalary: "",
+        lastCompany: "",
+        lastIndustry: "",
+        lastPosition: "",
+        keyWords: "",
+        selfEvaluation: "",
+        resumeWork: "",
+        resumeProject: "",
+        resumeEducation: "",
+      },
+    };
+  },
+  created() {},
+  mounted() {
+    this.getDicts("CUSTOMER_NATURE").then((res) => {
+      this.columns_nature = res.data;
+    });
+
+    let that = this;
+    this.title = this.$route.query.type == 2 ? "修改简历" : "新增简历";
+    this.id = this.$route.query.id ? this.$route.query.id : null;
+    if (this.id) {
+      getResume(this.id)
+        .then((response) => {
+          that.userForm = response.data;
+        })
+        .catch((err) => {
+          that.$toast(err.msg);
+        });
+    }
+  },
+  methods: {
+    onUpdateBirthday(value) {
+      // 使用moment格式化日期
+      const data = moment(value).format("YYYY-MM-DD");
+      this.userForm.birthday = data;
+      this.showPicker_birthday = false;
+    },
+    onConfirmGender(value) {
+      this.userForm.gender = value;
+      this.showPicker_gender = false;
+    },
+    onSubmit(values) {
+      let that = this;
+      // console.log("submit", values);
+      if (that.id) {
+        values.id = that.id;
+        updateResume(values)
+          .then((response) => {
+            if (response.code == 200) {
+              that.$toast.success(response.msg);
+              setTimeout(() => {
+                that.$router.go(-2);
+                that.$toast.clear();
+              }, 1000);
+            }
+          })
+          .catch((err) => {
+            that.$toast(err.msg);
+          });
+      } else {
+        addResume(values)
+          .then((response) => {
+            if (response.code == 200) {
+              that.$toast.success(response.msg);
+              setTimeout(() => {
+                that.$router.back(-1);
+                that.$toast.clear();
+              }, 1000);
+            }
+          })
+          .catch((err) => {
+            that.$toast(err.msg);
+          });
+      }
+    },
+    onClickLeft() {
+      this.$router.back(-1);
+    },
+  },
+};
+</script>
+<style lang="scss" scoped>
+h5 {
+  margin: 10px 5px;
+}
+</style>

+ 189 - 0
ruoyi-ui/src/views/mobile/resume/index.vue

@@ -0,0 +1,189 @@
+<template>
+  <div class="mobileWrapper">
+    <div class="fixedTop">
+      <van-nav-bar
+        title="简历系统"
+        right-text="新建"
+        v-preventReClick
+        @click-right="onClickRight"
+      />
+      <van-search
+        v-model="queryParams.companyName"
+        show-action
+        label="姓名"
+        placeholder="请输入姓名"
+        @search="onSearch"
+      >
+        <template #action>
+          <div @click="onSearch" v-preventReClick>搜索</div>
+        </template>
+      </van-search>
+    </div>
+
+    <div class="listWrapper">
+      <!-- 内容 -->
+      <van-pull-refresh v-model="refreshing" @refresh="onRefresh">
+        <van-list
+          v-model="loading"
+          :finished="finished"
+          finished-text=""
+          @load="onLoad"
+          class="list"
+        >
+          <div
+            class="item"
+            v-for="(item, index) in list"
+            :key="index"
+            v-preventReClick
+            @click="toDetail(item.id)"
+          >
+            <div>{{ item.companyName }}</div>
+            <div>负责人:{{ item.createBy }}</div>
+            <van-tag class="public-margin-t-10" type="primary" size="large">{{
+              item.companyEnterprisepro
+            }}</van-tag>
+            <van-tag class="public-margin-l-10" type="primary" size="large">{{
+              item.companyState
+            }}</van-tag>
+          </div>
+        </van-list>
+      </van-pull-refresh>
+      <div v-if="noDate" class="noDateWrapper">
+        <div>没有相关数据</div>
+        <div>您可以尝试以下操作</div>
+        <van-button type="info" round v-preventReClick @click="onClickRight"
+          >新建重点客户</van-button
+        >
+      </div>
+    </div>
+  </div>
+</template>
+<script>
+import { listResume, getResume, delResume, addResume, updateResume } from "@/api/system/resume";
+export default {
+  name: "MobileResumeIndex",
+  data() {
+    return {
+      list: [],
+      refreshing: false,
+      loading: false,
+      finished: false,
+      noDate: false,
+      // 查询参数
+      queryParams: {
+        pageNum: 1,
+        pageSize: 10,
+      },
+    };
+  },
+  created() {},
+  mounted() {},
+  methods: {
+    toDetail(id) {
+      this.$router.push({ path: "/mobile/resume/detail", query: { id } });
+    },
+    onRefresh() {
+      // 清空列表数据
+      this.finished = false;
+      // 将 loading 设置为 true,表示处于加载状态
+      this.loading = true;
+      this.onLoad();
+    },
+    onClickRight() {
+      this.$router.push({ name: "MobileResumeForm", query: { type: 1 } });
+    },
+    onSearch() {
+      this.getList();
+    },
+    onLoad() {
+      this.getList();
+    },
+    getList() {
+      let that = this;
+      if (this.refreshing) {
+        this.list = [];
+        this.refreshing = false;
+      }
+      that.$toast.loading({
+        duration: 0,
+        forbidClick: true,
+        message: "加载中...",
+      });
+      listResume(that.queryParams)
+        .then((response) => {
+          if (response.code == 200) {
+            that.$toast.clear();
+            let data = response.rows,
+              total = response.total;
+            that.finished = true;
+            that.noDate = false;
+            if (total == 0) {
+              that.list = [];
+              that.noDate = true;
+            } else if (total < 10) {
+              that.list = data;
+            } else {
+              that.finished = false;
+              that.list.push(...data);
+              that.queryParams.page += 1;
+            }
+            that.loading = false;
+          }
+        })
+        .catch((err) => {
+          that.$toast(err.msg);
+        });
+    },
+  },
+};
+</script>
+<style lang="scss">
+.fixedTop{
+  width:100%;
+  position: fixed;
+  top:0;
+  left:0;
+  z-index: 99;
+}
+.listWrapper {
+  margin-top:100px;
+  background: #f4f4f4;
+  // padding-bottom:100px;
+}
+.searchBar {
+  text-align: center;
+  background: #fff;
+  padding: 10px 0;
+}
+.list {
+  width: 100%;
+  .item {
+    margin: 10px 0;
+    padding: 10px 3%;
+    background: #fff;
+    color: #aaa;
+    font-size: 14px;
+    // border: 1px solid #ccc;
+    > div:first-child {
+      font-weight: bold;
+      font-size: 18px;
+      line-height: 30px;
+      color: #333;
+    }
+  }
+}
+.noDateWrapper {
+  width: 100%;
+  text-align: center;
+  position: absolute;
+  top: 50%;
+  left: 50%;
+  transform: translate(-50%, -50%);
+  > div {
+    color: #8a8989;
+  }
+  button {
+    margin-top: 10px;
+  }
+}
+</style>