Forráskód Böngészése

Merge branch 'master' of http://git.bjzxtw.org.cn:3000/zxt/admin_home

rkljw 17 órája
szülő
commit
b5705dd284

+ 46 - 81
src/layout/components/Navbar.vue

@@ -23,74 +23,65 @@
 
         <div class="noticeTabsBox" v-if="showTabs" ref="noticeTabsBox">
           <div class="noticeTabsTitleBox">
-            <img class="arrowLeft" src="@/assets/chat/left.png" @click="pages <= 1 ? pages = 1 : pages--"
-              v-if="pages == 2">
-            <div class="box1" v-show="pages == 1">
-              <div :class="{ 'noticeTabs': true, 'active': tabsIndex == 1 }" @click="changeTabs(1)">
-                <div class="noticeTabsItem">
-                  资讯
-                  <span class="noticeMessageNew" v-if="msg.apply_articale.length > 0"></span>
-                </div>
+            <div :class="{ 'noticeTabs': true, 'active': tabsIndex == 1 }" @click="changeTabs(1)">
+              <div class="noticeTabsItem">
+                资讯
+                <span class="noticeMessageNew" v-if="msg.apply_articale.length > 0"></span>
               </div>
-              <div :class="{ 'noticeTabs': true, 'active': tabsIndex == 2 }" @click="changeTabs(2)">
-                <div class="noticeTabsItem">
-                  商品
-                  <span class="noticeMessageNew" v-if="msg.good.length > 0"></span>
-                </div>
+            </div>
+            <div :class="{ 'noticeTabs': true, 'active': tabsIndex == 2 }" @click="changeTabs(2)">
+              <div class="noticeTabsItem">
+                商品
+                <span class="noticeMessageNew" v-if="msg.good.length > 0"></span>
               </div>
-              <div :class="{ 'noticeTabs': true, 'active': tabsIndex == 4 }" @click="changeTabs(4)">
-                <div class="noticeTabsItem">
-                  书刊
-                  <span class="noticeMessageNew" v-if="msg.book.length > 0"></span>
-                </div>
+            </div>
+            <div :class="{ 'noticeTabs': true, 'active': tabsIndex == 4 }" @click="changeTabs(4)">
+              <div class="noticeTabsItem">
+                书刊
+                <span class="noticeMessageNew" v-if="msg.book.length > 0"></span>
               </div>
-              <!-- <div :class="{ 'noticeTabs': true, 'active': tabsIndex == 5 }" @click="changeTabs(5)">
+            </div>
+            <!-- <div :class="{ 'noticeTabs': true, 'active': tabsIndex == 5 }" @click="changeTabs(5)">
                 <div class="noticeTabsItem">
                   聊天
                   <span class="noticeMessageNew" v-if="msg.chat.length > 0"></span>
                 </div>
               </div> -->
-              <div :class="{ 'noticeTabs': true, 'active': tabsIndex == 8 }" @click="changeTabs(8)">
-                <div class="noticeTabsItem">
-                  企业
-                  <span class="noticeMessageNew" v-if="msg.complany.length > 0"></span>
-                </div>
+            <div :class="{ 'noticeTabs': true, 'active': tabsIndex == 8 }" @click="changeTabs(8)">
+              <div class="noticeTabsItem">
+                企业
+                <span class="noticeMessageNew" v-if="msg.complany.length > 0"></span>
               </div>
-              <div :class="{ 'noticeTabs': true, 'active': tabsIndex == 9 }" @click="changeTabs(9)">
-                <div class="noticeTabsItem">
-                  项目
-                  <span class="noticeMessageNew" v-if="msg.project.length > 0"></span>
-                </div>
+            </div>
+            <div :class="{ 'noticeTabs': true, 'active': tabsIndex == 9 }" @click="changeTabs(9)">
+              <div class="noticeTabsItem">
+                项目
+                <span class="noticeMessageNew" v-if="msg.project.length > 0"></span>
               </div>
             </div>
-            <div class="box2" v-show="pages == 2">
-              <div :class="{ 'noticeTabs': true, 'active': tabsIndex == 3 }" @click="changeTabs(3)"
-                v-if="userType == 10000 || userType == 1 || userType == 3">
-                <div class="noticeTabsItem">
-                  求职招聘
-                  <span class="noticeMessageNew"
-                    v-if="msg.job_hunting.length > 0 || msg.job_recruiting.length > 0 || msg.job_apply.length > 0 || msg.job_resume.length > 0">
-                  </span>
-                </div>
+            <div :class="{ 'noticeTabs': true, 'active': tabsIndex == 3 }" @click="changeTabs(3)"
+              v-if="userType == 10000 || userType == 1 || userType == 3">
+              <div class="noticeTabsItem">
+                求职招聘
+                <span class="noticeMessageNew"
+                  v-if="msg.job_hunting.length > 0 || msg.job_recruiting.length > 0 || msg.job_apply.length > 0 || msg.job_resume.length > 0">
+                </span>
               </div>
-              <div :class="{ 'noticeTabs': true, 'active': tabsIndex == 6 }" @click="changeTabs(6)"
-                v-if="userType == 10000 || userType == 2">
-                <div class="noticeTabsItem">
-                  通知
-                  <span class="noticeMessageNew" v-if="msg.notice.length > 0"></span>
-                </div>
+            </div>
+            <div :class="{ 'noticeTabs': true, 'active': tabsIndex == 6 }" @click="changeTabs(6)"
+              v-if="userType == 10000 || userType == 2">
+              <div class="noticeTabsItem">
+                通知
+                <span class="noticeMessageNew" v-if="msg.notice.length > 0"></span>
               </div>
-              <div :class="{ 'noticeTabs': true, 'active': tabsIndex == 7 }" @click="changeTabs(7)"
-                v-if="userType == 10000 || userType == 2">
-                <div class="noticeTabsItem">
-                  投诉
-                  <span class="noticeMessageNew"
-                    v-if="msg.complaint.length > 0 || msg.complaint_deal.length > 0"></span>
-                </div>
+            </div>
+            <div :class="{ 'noticeTabs': true, 'active': tabsIndex == 7 }" @click="changeTabs(7)"
+              v-if="userType == 10000 || userType == 2">
+              <div class="noticeTabsItem">
+                投诉
+                <span class="noticeMessageNew" v-if="msg.complaint.length > 0 || msg.complaint_deal.length > 0"></span>
               </div>
             </div>
-            <img class="arrowRight" src="@/assets/chat/right.png" @click="pages >= 2 ? pages = 2 : pages++"
-              v-if="pages == 1 && userType != 4">
           </div>
           <!-- 求职,招聘切换按钮 -->
           <div class="noticeTabsLine" v-if="tabsIndex == 3" style="height: 20px; margin: 0px; margin-top: -20px;">
@@ -1174,7 +1165,7 @@ export default {
       //通知消息 悬浮菜单
       .noticeTabsBox {
         position: absolute;
-        width: 380px;
+        max-width: 570px;
         height: 640px;
         border-radius: 8px;
         background: #fff;
@@ -1187,34 +1178,7 @@ export default {
 
         .noticeTabsTitleBox {
           display: flex;
-          // align-items: center;
           border-bottom: 1px solid #E9EDF7;
-          position: relative;
-          margin-left: 15px;
-          margin-right: 10px;
-
-          .arrowRight {
-            width: 24px;
-            height: 24px;
-            position: absolute;
-            right: -20px;
-            top: 0;
-            cursor: pointer;
-          }
-
-          .arrowLeft {
-            width: 24px;
-            height: 24px;
-            position: absolute;
-            left: -30px;
-            top: 0;
-            cursor: pointer;
-          }
-
-          .box1,
-          .box2 {
-            display: flex;
-          }
 
           .noticeTabs {
             height: 41px;
@@ -1224,6 +1188,7 @@ export default {
             cursor: pointer;
 
             .noticeTabsItem {
+              width: max-content;
               height: 20px;
               line-height: 20px;
               font-size: 16px;

+ 3 - 2
src/views/job/jobOpportunitiesDetails.vue

@@ -24,8 +24,9 @@
                                         &gt;
                                         {{ pageData.jtzw_id }}
                                     </span>
-                                    <span class="cruit_li_2_foot_tag cruit_li_2_foot_addres">{{ pageData.city_arr_id
-                                    }}</span>
+                                    <span class="cruit_li_2_foot_tag cruit_li_2_foot_addres">
+                                        {{ pageData.city_arr_id }}
+                                    </span>
                                 </div>
                             </div>
                         </section>

+ 106 - 0
src/views/profile/components/CityCascader.vue

@@ -0,0 +1,106 @@
+<template>
+  <el-cascader
+    :key="cascaderKey"
+    v-model="internalValue"
+    placeholder="请选择地址.."
+    :props="SearchCityData"
+    filterable
+    clearable
+    @change="handleChange">
+  </el-cascader>
+</template>
+
+<script>
+export default {
+  props: {
+    value: { // 接收外部传递的 v-model 值
+      type: [Array, String], // 允许传入数组或字符串类型的数据
+      default: () => [],
+    },
+  },
+  data() {
+    let self = this;
+    return {
+      internalValue: [], // 用于与级联选择器进行双向绑定的内部数据
+      cascaderKey: 0, // 用于强制刷新 cascader
+      SearchCityData: {
+        checkStrictly: true,
+        lazy: true,
+        async lazyLoad(node, resolve) {
+          const { level, data } = node;
+          let parentId = level == 0 ? 0 : data.value;
+          let parames = {
+            pid: parentId,
+          };
+          self.$store
+            .dispatch("pool/getcityList", parames)
+            .then((res) => {
+              if (res.data) {
+                const nodes = res.data.map((item) => ({
+                  value: item.id,
+                  label: item.name,
+                  leaf: level >= 3,
+                  children: [],
+                }));
+                resolve(nodes);
+              }
+            })
+            .catch(() => {
+              this.$message({
+                type: "info",
+                message: "网络错误,请重试!",
+              });
+            });
+        },
+      },
+    };
+  },
+  watch: {
+    value: {
+      immediate: true, // 组件挂载时立即执行
+      handler(newVal) {
+        try {
+          const parsedValue = Array.isArray(newVal) ? newVal : JSON.parse(newVal);
+          this.internalValue = parsedValue; // 设置内部值
+          if (parsedValue.length) {
+            this.loadCascaderPath(parsedValue); // 动态加载回显的路径
+          }
+        } catch (error) {
+          console.error("无法解析传入的值:", error);
+          this.internalValue = []; // 如果解析失败,重置为默认空数组
+        }
+      },
+    },
+  },
+  methods: {
+    handleChange(value) {
+      // 当选择变化时,向父组件发送更新的值
+      this.$emit("input", value); // v-model 双向绑定
+      this.$emit("update-city-id", value); // 额外事件,方便父组件监听
+    },
+    async loadCascaderPath(path) {
+      for (let i = 0; i < path.length; i++) {
+        const parentId = path[i - 1] || 0; // 获取当前层级的父级ID
+        const level = i; // 当前层级的索引
+        await this.$store.dispatch('pool/getcityList', { pid: parentId })
+          .then((res) => {
+            const nodes = res.data.map(item => ({
+              value: item.id,
+              label: item.name,
+              leaf: level >= 3, // 假设4层结构,设置叶子节点标记
+            }));
+            // 级联选择器加载数据
+            if (level === path.length - 1) {
+              this.internalValue = path; // 确保最后一级路径正确设置
+              this.cascaderKey += 1; // 强制刷新 cascader
+            }
+          });
+      }
+    },
+  },
+};
+</script>
+
+<style scoped>
+/* 可根据需要自定义样式 */
+</style>

+ 199 - 7
src/views/profile/index.vue

@@ -3,7 +3,7 @@
     <div class="userInfoBox">
       <tableTitle :name="tableDivTitle"/>
       <div class="userInfoTabs">
-        <el-tabs :tab-position="tabPosition" style="height:350px" class="demo-tabs">
+        <el-tabs :tab-position="tabPosition" style="height:550px" class="demo-tabs">
           <el-tab-pane label="用户信息">
             <el-form :model="infoform" ref="infoform" :rules="infoFormRules" autocomplete="off" label-position="left">
               <div class="infoBox">
@@ -129,9 +129,61 @@
               </el-tooltip>
               <!--新密码 end------------------------------------------>
             </el-form>
+            <div class="infoBtnBox">
+                <!-- <el-button type="info" @click="clearInput">重置</el-button> -->
+                <el-button type="primary" @click="changePassword">保存</el-button>
+              </div>
+              </el-tab-pane>
+              <!--企业信息 start------------------------------------------>
+              <el-tab-pane label="企业信息" v-if="creatNews_user_type == '3'">
+              <el-form :model="companyform" ref="companyform" :rules="companyRules" autocomplete="off" label-position="left">
+                <div class="infoBox">
+                <div>
+                  <!-- <img :src="user.avatar" class="avatar"> -->
+                  <el-form-item label="公司名称:" :label-width="formLabelWidth" prop="business_name" class="custom-align-right">
+                  <el-input v-model="companyform.business_name" autocomplete="off" placeholder="请输入公司名称"></el-input>
+                  </el-form-item>
+                  <el-form-item label="所属行业:" :label-width="formLabelWidth" prop="company_hy_id" class="custom-align-right">
+                  <el-select v-model="companyform.company_hy_id" clearable placeholder="请输入所属行业" >
+                    <el-option v-for="item in company_hy_id" :key="item.hyid" :label="item.hyname" :value="item.hyid">
+                    </el-option>
+                  </el-select>
+                  </el-form-item>
+                  <el-form-item label="公司规模:" :label-width="formLabelWidth" prop="company_size" class="custom-align-right">
+                  <el-select v-model="companyform.company_size" clearable placeholder="请输入公司规模" >
+                    <el-option v-for="item in company_size" :key="item.evalue" :label="item.ename" :value="item.evalue">
+                    </el-option>
+                  </el-select>
+                  </el-form-item>
+                  <el-form-item label="公司性质:" :label-width="formLabelWidth" prop="company_nature" class="custom-align-right">
+                  <el-select v-model="companyform.company_nature" clearable placeholder="请输入公司性质" >
+                    <el-option v-for="item in company_nature" :key="item.id" :label="item.nature_name" :value="item.id">
+                    </el-option>
+                  </el-select>
+                  </el-form-item>
+                  <el-form-item label="公司简介:" :label-width="formLabelWidth" prop="introduction" class="custom-align-right">
+                  <el-input v-model="companyform.introduction" autocomplete="off" type="textarea" :rows="2"
+                    placeholder="请输入公司简介"> </el-input>
+                  </el-form-item>
+                  <el-form-item label="公司网址:" :label-width="formLabelWidth" prop="company_url" class="custom-align-right">
+                  <el-input v-model="companyform.company_url" autocomplete="off" 
+                    placeholder="请输入公司网址"></el-input>
+                  </el-form-item>
+                  <el-form-item label="地址:" :label-width="formLabelWidth" prop="address_arr_id" class="custom-align-right">
+                  <CityCascader v-model="companyform.address_arr_id" @update-city-id="update_city_arr_id" ></CityCascader> 
+                  <!-- <el-select v-model="form.address_arr_id" placeholder="请选择省" @change="createjob_pronvice"> -->
+                  <!-- <el-option v-for="item in address_arr_id" :key="item.id" :label="item.name" :value="item.id"> -->
+                  <!-- </el-option> -->
+                  <!-- </el-select> -->
+                  <br>
+                  <el-input v-model="companyform.address" :label-width="formLabelWidth" placeholder="请输入公司地址"></el-input>
+                  </el-form-item>
+                </div>
+                </div>
+              </el-form>
             <div class="infoBtnBox">
               <!-- <el-button type="info" @click="clearInput">重置</el-button> -->
-              <el-button type="primary" @click="changePassword">保存</el-button>
+              <el-button type="primary" @click="changeCompany">保存</el-button>
             </div>
           </el-tab-pane>
         </el-tabs>
@@ -145,10 +197,13 @@
 import '@/styles/global.less';
 //表格标题
 import tableTitle from './components/tableTitle';
-
+import CityCascader from './components/CityCascader';
+import { formatLocalDate } from '@/utils/public';
+import { getWebSiteId, getUseType } from '@/utils/auth'
 export default {
   components: {
     tableTitle,//表格标题
+    CityCascader,//城市选择器
   },
   data() {
     // 配置验证规则:用于表单验证
@@ -166,6 +221,14 @@ export default {
         callback();
       }
     }
+    //表单验证
+    const validateCompanyEmpty = (rule, value, callback) => {
+      if (value.length == 0) {
+      callback(new Error('该项不能为空!'))
+      } else {
+      callback()
+      }
+    }
     return {
       tableDivTitle:"修改个人信息",
       tabPosition:"left",
@@ -186,7 +249,21 @@ export default {
         password:"",
         new_password:"",
         new_password1:""
+      }, 
+      // 修改企业信息
+      companyform:{
+        business_name:"",//公司名称
+        company_hy_id:"",//所属行业
+        company_size:"",//公司规模
+        company_nature:"",//公司性质
+        introduction:"",//公司简介
+        real_name:"",//联系人
+        mobile:"",//联系电话
+        company_url:"",//公司网址
+        address_arr_id:[],//地址 
+        address:""//具体地址
       },
+      creatNews_user_type: '0',//判断用户类型'
       capsTooltip1: false,//显示大小写提示
       capsTooltip2: false,
       capsTooltip3: false,
@@ -197,11 +274,35 @@ export default {
         password: [{ required: true, trigger: 'blur', validator: validatePassword }],
         new_password: [{ required: true, trigger: 'blur', validator: validatePassword }],
         new_password1: [{ required: true, trigger: 'blur', validator: validatePassword }]
-      }
+      },
+      companyRules: { //配置from表单验证规则
+        // 公司名称
+        business_name: { required: true, trigger: 'blur', validator: validateCompanyEmpty },
+        // 所属行业
+        company_hy_id: { required: true, trigger: 'blur', validator: validateCompanyEmpty },
+        // 公司规模
+        company_size: { required: true, trigger: 'blur', validator: validateCompanyEmpty },
+        // 公司简介
+        introduction: { required: true, trigger: 'blur', validator: validateCompanyEmpty },
+        // 联系人
+        real_name: { required: true, trigger: 'blur', validator: validateCompanyEmpty },
+        // 联系电话
+        mobile: { required: true, trigger: 'blur', validator: validateCompanyEmpty },
+        // 地址
+        address_arr_id: { required: true, trigger: 'blur', validator: validateCompanyEmpty },
+        // 具体地址
+        address: { required: true, trigger: 'blur', validator: validateCompanyEmpty },
+      },
     }
   },
   mounted() {
-    this.getUserInfo();
+    this.creatNews_user_type = getUseType()
+    this.getUserInfo()
+    this.company_hy_id()
+    this.company_size()
+    this.company_nature()
+    this.address_arr_id()
+    this.getCompanyInfo()
   },
   methods: {
     //0.全局操作 start ---------------------------------------->
@@ -334,8 +435,94 @@ export default {
           this.$message.error('请填写完整信息!');
         }
       })
-    }
+    },
     //2.修改头像和昵称 end ---------------------------------------->
+    // 3.企业信息 start ---------------------------------------->//1.4更新详细地址
+      // 12.获取公司分类
+      company_hy_id(value) {
+      this.$store.dispatch('news/getIndustry').then(res => {
+        this.company_hy_id = res.data;
+      })
+      },
+      //13.获取公司规模
+      company_size(value) {
+      this.$store.dispatch('news/getCompanySize').then(res => {
+        this.company_size = res.data;
+      })
+      },
+      //14.获取公司性质
+      company_nature(value) {
+      this.$store.dispatch('news/getCompanyNature').then(res => {
+        this.company_nature = res.data;
+      })
+      },
+      // 15.获取地址
+      address_arr_id(value) {
+      this.$store.dispatch('news/getJobRecruitingArea').then(res => {
+        this.address_arr_id = res.data;
+      })
+      },
+      getCompanyInfo(){
+        this.$store.dispatch('news/getJobCompany', {}).then(res => {
+        console.log('-----------res------------------',res);
+        
+        this.companyform.address_arr_id = Array.isArray(res.data.address_arr_id) ? res.data.address_arr_id : JSON.parse(res.data.address_arr_id);
+        this.companyform.business_name = res.data.business_name;
+        this.companyform.company_hy_id = res.data.company_hy_id;
+        this.companyform.company_size = res.data.company_size;
+        this.companyform.company_nature = res.data.company_nature;
+        this.companyform.introduction = res.data.introduction;
+        this.companyform.company_url = res.data.company_url;
+        this.companyform.address = res.data.address;
+        })
+      },
+      update_city_arr_id(value) {
+      console.log("行政区划ID已更新:", value);
+      this.form.city_arr_id = value;
+      },
+      //1.3 清理表单
+      cleatForm(type) {
+      if (type == 2) {
+        //使用了外链,进行部分表单清理
+        //this.form.cat_arr_id = "";
+        this.form.address_arr_id = [];
+        this.form.business_name = "";
+        this.form.company_hy_id = "";
+        this.form.company_size = "";
+        this.form.company_nature = "";
+        //this.form.author = "";
+        this.form.introduction = "";
+        this.form.company_url = "";
+        this.form.address = "";
+      }
+      },
+      changeCompany(value){
+      console.log(this.companyform)
+      
+      this.$store.dispatch('news/upJobCompany', this.companyform).then(res => {
+        if (res.code == 200) { 
+        //汇报结果
+        this.$message({
+          type: 'success',
+          message: '已成功修改公司信息!'
+        });
+        this.cleatForm(2);
+        //返回列表页
+        // this.returnPage()
+        } else {
+        this.$message({
+          type: 'error',
+          message: ": '发布失败!'.".this.$message
+        });
+        }
+      }).catch(() => {
+        this.$message({
+        type: 'info',
+        message: '网络错误,请重试!'
+        });
+      })
+      }
+  //3.企业信息 end ---------------------------------------->
   }
 }
 </script>
@@ -420,7 +607,12 @@ export default {
     padding-bottom: @spacingPx;
     text-align: center;
   }
-
+  // ----------------------企业信息下拉框宽度---------------------->
+  .el-select {
+    // text-align: right; /* 设置标签文字右对齐 */
+    width: 100%; /* 设置标签宽度 */; 
+  }
+  // ----------------------企业信息下拉框宽度---------------------->
   //执行v-deep穿透scope选择器 start------------------------------------------------------------>*/
   ::v-deep .custom-form-item > .el-form-item__label {
     line-height: 140px !important;