lizeyu 10 months ago
parent
commit
75572df392

+ 14 - 1
src/main/java/com/hz/employmentsite/services/impl/jobUserManager/JobUserServiceImpl.java

@@ -91,7 +91,7 @@ public class JobUserServiceImpl implements JobUserService {
             throw new BaseException("","id为空");
         }
 
-        JobUserVo data = jobUserCQuery.selectJobUserList(stringUtils.ListToInSql(Arrays.asList(id)), null, null, null, null, null, null, null, null,null).stream().findFirst().orElse(null);
+        JobUserVo data = jobUserCQuery.selectJobUserList(stringUtils.ListToInSql(Arrays.asList(id)), null, null, null, null, null, null, null, null,null,null,null,null).stream().findFirst().orElse(null);
         if(data!=null){
             data.listLabel = labelCQuery.getUserLabelList(id);
         }
@@ -346,6 +346,19 @@ public class JobUserServiceImpl implements JobUserService {
                 pcExperienceMapper.insert(experience);
             });
         }
+
+        if(data.listLabel.size()>0){
+            PcLabelJobuserExample labelEmp = new PcLabelJobuserExample();
+            labelEmp.or().andJobuserIDEqualTo(data.getJobUserID());
+            pcLabelJobuserMapper.deleteByExample(labelEmp);
+            data.listLabel.forEach(x->{
+                PcLabelJobuser labelModel = new PcLabelJobuser();
+                labelModel.setJobuserID(data.getJobUserID());
+                labelModel.setLabelID(x.getLabelID());
+                pcLabelJobuserMapper.insert(labelModel);
+            });
+        }
+
         return result;
     }
 

+ 27 - 2
vue/src/views/jobUserManager/jobuser/edit.vue

@@ -372,6 +372,18 @@
           </a-form-item>
         </a-col>
       </a-row>
+      <a-row :gutter="24">
+        <a-col :span="24">
+          <a-form-item label="标签" :label-col="{ span: 2 }" name="listLabel" >
+            <a-button style="margin-right: 10px;" v-for="item in dataModel.listLabel">
+              {{ item.labelName }}
+            </a-button>
+            <a-button @click="onSelectModel">
+              <plus-circle-outlined/>选择标签
+            </a-button>
+          </a-form-item>
+        </a-col>
+      </a-row>
       <a-row>
         <a-col :span="24" style="text-align: right; margin-top: 20px; margin-right: 20px">
           <Space>
@@ -493,6 +505,7 @@
         <a-button type="primary" html-type="submit">提交</a-button>
       </a-form-item>
     </a-form>
+    <select-label ref="refSelectModel" :list-label="dataModel.listLabel" :big-type="2" @selectLabelChecks="selectLabelChecks"></select-label>
   </div>
 </template>
 
@@ -508,6 +521,7 @@ import {getDataById, getEducationList, getExperienceList, save} from '@/api/jobU
 import {getSiteList} from "@/api/baseSettings/siteInfo";
 import {getInfo} from "@/api/account";
 import dayjs from "dayjs";
+import SelectLabel from "@/views/baseSettings/label/selectLabel.vue";
 
 interface FormState {
   dataModel: any;
@@ -515,10 +529,11 @@ interface FormState {
 
 export default defineComponent(
   {
-    components: {BUploadFile},
+    components: {BUploadFile,SelectLabel},
     setup() {
       // const router = useRouter();
       const isAllowCommit = ref(true);
+      const refSelectModel = ref();
       const formState = reactive<FormState>({dataModel: {}});
       const formTableState = reactive({loading: false});
       const searchParams = reactive({
@@ -848,6 +863,13 @@ export default defineComponent(
           formState.dataModel.occupationalCategoryName = selectedOptions[1].label;
         }
       }
+      const onSelectModel = ()=>{
+        refSelectModel.value.show();
+      }
+
+      const selectLabelChecks = (list: any)=>{
+        formState.dataModel.listLabel = list;
+      }
 
       const loadData = (id: any) => {
         getAllSites();
@@ -865,7 +887,7 @@ export default defineComponent(
         getOccupationalLevelList()
         getFirstOccupationalList()
         getInfo().then((loginUserInfo:any)=>{
-          getDataById(id,loginUserInfo.userID).then(data => {
+          getDataById(id,loginUserInfo.userID,null).then(data => {
             formState.dataModel = data;
             if (formState.dataModel.regionCode) {
               changeCity();
@@ -886,6 +908,9 @@ export default defineComponent(
         loadEducation,
         inputDataValidate,
         onIdentityNumberChange,
+        onSelectModel,
+        selectLabelChecks,
+        refSelectModel,
         siteList,
         regionList,
         streetList,