소스 검색

web-bug处理1

liao-sea 1 년 전
부모
커밋
92eeb3e2b6

+ 14 - 2
src/main/java/com/hz/employmentsite/controller/companyService/PostController.java

@@ -132,9 +132,21 @@ public class PostController {
                 row.add(dateUtils.dateToStr(item.endTime));
                 row.add(item.companyName);
                 row.add(item.recordStatus == 1 ? "启用" : "停用");
-                row.add("");
+                row.add(item.workName);
                 row.add(item.cultureLevelName);
-                row.add(item.minSalary+"-"+item.maxSalary);
+                if(item.minSalary!=null){
+                    if(item.maxSalary!=null){
+                        row.add(item.minSalary+"-"+item.maxSalary);
+                    }else{
+                        row.add("≥"+item.minSalary);
+                    }
+                }else{
+                    if(item.maxSalary!=null){
+                        row.add("≤"+item.maxSalary);
+                    }else{
+                        row.add("");
+                    }
+                }
                 row.add(item.userName);
                 row.add(item.userMobile);
                 rowsData.add(row);

+ 5 - 8
src/main/java/com/hz/employmentsite/services/impl/taskAndLog/DoTaskImpl.java

@@ -173,17 +173,14 @@ public class DoTaskImpl implements DoTaskService {
     @Override
     public int delete(List<String> ids) {
         int result = 0;
-
         PcDotaskUserExample expUser = new PcDotaskUserExample();
         PcDotaskUserExample.Criteria croUser = expUser.or();
         croUser.andDotaskIDIn(ids);
-        int userRows = doTaskUserMapper.deleteByExample(expUser);
-        if (userRows > 0) {
-            PcDotaskExample exp = new PcDotaskExample();
-            PcDotaskExample.Criteria cro = exp.or();
-            cro.andDotaskIDIn(ids);
-            result = doTaskMapper.deleteByExample(exp);
-        }
+        result += doTaskUserMapper.deleteByExample(expUser);
+        PcDotaskExample exp = new PcDotaskExample();
+        PcDotaskExample.Criteria cro = exp.or();
+        cro.andDotaskIDIn(ids);
+        result += doTaskMapper.deleteByExample(exp);
         return result;
     }
 

+ 5 - 3
src/main/java/com/hz/employmentsite/vo/taskAndLog/DoTaskUserVo.java

@@ -1,8 +1,10 @@
 package com.hz.employmentsite.vo.taskAndLog;
 
 public class DoTaskUserVo {
-    public  String dotaskUserID;
-    public  String dotaskID;
+    public  String doTaskID;
     public  String siteUserID;
-    public  String userName;
+    public  String siteUserName;
+    public  String genderName;
+    public  String mobile;
+    public  String taskStatusName;
 }

+ 10 - 7
src/main/resources/mapping/cquery/DoTaskCQuery.xml

@@ -18,7 +18,7 @@
             and task.dotaskName like Concat('%',#{name},'%')
         </if>
         <if test="startTime != null and startTime != ''">
-            and task.createTime <![CDATA[ >= ]]> STR_TO_DATE(#{beiginDate},'%Y-%m-%d')
+            and task.createTime <![CDATA[ >= ]]> STR_TO_DATE(#{startTime},'%Y-%m-%d')
         </if>
         <if test="endTime != null and endTime != ''">
             and task.createTime <![CDATA[ <= ]]> STR_TO_DATE(#{endTime},'%Y-%m-%d')
@@ -41,20 +41,23 @@
         <if test="taskStatus != null and taskStatus != ''">
             and task.taskStatus = #{taskStatus}
         </if>
+            group by task.dotaskID order by task.createTime
     </select>
 
     <select id="getWorkUserList" resultType="com.hz.employmentsite.vo.taskAndLog.DoTaskUserVo">
-        select su.SiteUserName as userName, u.* from pc_dotask_user u
-        left join pc_dotask tk on u.DotaskID = tk.DotaskID
-        left join pc_site_user su on su.SiteUserID = u.SiteUserID
+        select task.*,dic_taskStatus.Name as TaskStatusName,siteUser.SiteUserID, siteUser.SiteUserName,dic_gender.Name as GenderName,siteUser.Mobile  from  pc_dotask_user taskUser
+        left join pc_dotask task on taskUser.DotaskID = task.DotaskID
+        left join pc_site_user siteUser on taskUser.SiteUserID = siteUser.SiteUserID
+        left join (select * from sys_dictionary_item where DictionaryCode ='TaskStatusType') dic_taskStatus on task.TaskStatus = dic_taskStatus.Value
+        left join (select * from sys_dictionary_item where DictionaryCode ='Gender') dic_gender on siteUser.Gender = dic_gender.Value
         where 1 = 1
         <if test="doTaskID!='' and doTaskID!=null">
-            and u.DotaskID = #{doTaskID}
+            and taskUser.DotaskID = #{doTaskID}
         </if>
 
     </select>
     <select id="getUserList" resultType="com.hz.employmentsite.vo.baseSettings.SiteUserVo">
-        select SiteUserID, SiteUserName
-        from pc_site_user;
+        select SiteUserID, SiteUserName,Mobile,Gender,dic_gender.Name as GenderName from pc_site_user siteUser
+        left join (select * from sys_dictionary_item where DictionaryCode ='Gender') dic_gender on siteUser.Gender = dic_gender.Value;
     </select>
 </mapper>

+ 8 - 11
src/main/resources/mapping/cquery/JobHuntCQuery.xml

@@ -12,22 +12,19 @@
             and jobHuntId in (${jobHuntIDList})
         </if>
         <if test="jobUserID != '' and jobUserID != null">
-            and jobHunt.jobUserId = #{jobUserID}
+            and jobHunt.jobUserID = #{jobUserID}
         </if>
         <if test="jobUserName != '' and jobUserName != null">
             and jobUser.name like Concat('%',#{jobUserName},'%')
         </if>
         <if test="workName != '' and workName != null">
-            and workName like Concat('%',#{workName},'%')
-        </if>
-        <if test="jobUserName != '' and jobUserName != null">
-            and jobUser.name like Concat('%',#{jobUserName},'%')
+            and jobHunt.workName like Concat('%',#{workName},'%')
         </if>
         <if test="minWorkYear != '' and minWorkYear != null">
-            and workYear <![CDATA[ >= ]]> #{minWorkYear}
+            and jobHunt.workYear <![CDATA[ >= ]]> #{minWorkYear}
         </if>
         <if test="maxWorkYear != '' and maxWorkYear != null">
-            and workYear <![CDATA[ <= ]]>  #{maxWorkYear}
+            and jobHunt.workYear <![CDATA[ <= ]]>  #{maxWorkYear}
         </if>
         <if test="jobHuntTypeID != '' and jobHuntTypeID != null">
             and jobHuntType = #{jobHuntTypeID}
@@ -36,14 +33,14 @@
             and jobUserType = #{jobUserTypeID}
         </if>
         <if test="minSalary != '' and minSalary != null and (maxSalary == '' or maxSalary == null)" >
-            and minSalary <![CDATA[ <= ]]> #{minSalary} and maxSalary <![CDATA[ >= ]]> #{minSalary}
+            and jobHunt.minSalary <![CDATA[ <= ]]> #{minSalary} and jobHunt.maxSalary <![CDATA[ >= ]]> #{minSalary}
         </if>
         <if test="maxSalary != '' and maxSalary != null and (minSalary == '' or minSalary == null)">
-            and minSalary <![CDATA[ <= ]]> #{maxSalary} and maxSalary <![CDATA[ >= ]]> #{maxSalary}
+            and jobHunt.minSalary <![CDATA[ <= ]]> #{maxSalary} and jobHunt.maxSalary <![CDATA[ >= ]]> #{maxSalary}
         </if>
         <if test="minSalary != '' and minSalary != null and maxSalary != '' and maxSalary != null">
-            and (minSalary <![CDATA[ <= ]]> #{minSalary} and maxSalary <![CDATA[ >= ]]> #{minSalary})
-            or  (minSalary <![CDATA[ <= ]]> #{maxSalary} and maxSalary <![CDATA[ >= ]]> #{maxSalary})
+            and (jobHunt.minSalary <![CDATA[ <= ]]> #{minSalary} and jobHunt.maxSalary <![CDATA[ >= ]]> #{minSalary})
+            or  (jobHunt.minSalary <![CDATA[ <= ]]> #{maxSalary} and jobHunt.maxSalary <![CDATA[ >= ]]> #{maxSalary})
         </if>
        <!-- <if test="isAccomplish != '' and isAccomplish != null">
             and isAccomplish = #{isAccomplish}

+ 2 - 2
vue/src/api/jobUserManager/jobhunt/index.ts

@@ -1,11 +1,11 @@
 import { request } from '@/utils/request';
 
-export function getJobHuntList(query: any) {
+export function getJobHuntList(params: any) {
   return request(
     {
       url: 'jobUserService/jobHunt/getList',
       method: 'get',
-      params: query,
+      params: params,
     },
     { isNew: true },
   );

+ 3 - 3
vue/src/views/baseSettings/institution/index.vue

@@ -4,18 +4,18 @@
       <a-row :gutter="24">
         <a-col :span="6">
           <a-form-item label="企业名称" :label-col="{span:8}" name="companyName">
-            <a-input v-model:value="searchParams.companyName" placeholder=""/>
+            <a-input v-model:value="searchParams.companyName" placeholder="" :allow-clear="true"/>
           </a-form-item>
         </a-col>
         <a-col :span="6">
           <a-form-item label="企业地址" :label-col="{span:8}" name="companyAddress">
-            <a-input v-model:value="searchParams.companyAddress" placeholder=""/>
+            <a-input v-model:value="searchParams.companyAddress" placeholder="" :allow-clear="true"/>
             <!--<a-range-picker format="YYYY-MM-DD" :placeholder="['开始日期', '结束日期']" @change="onRangeChange"/>-->
           </a-form-item>
         </a-col>
         <a-col :span="6">
           <a-form-item label="负责人名称" :label-col="{span:8}" name="dutyUserName">
-            <a-input v-model:value="searchParams.dutyUserName" placeholder=""/>
+            <a-input v-model:value="searchParams.dutyUserName" placeholder="" :allow-clear="true"/>
           </a-form-item>
         </a-col>
       <a-col :span="6" style="text-align: left">

+ 2 - 2
vue/src/views/baseSettings/siteInfo/index.vue

@@ -4,12 +4,12 @@
       <a-row :gutter="24">
         <a-col :span="6">
           <a-form-item label="驿站编号" :label-col="{span:8}" name="siteCode">
-            <a-input v-model:value="searchParams.siteCode" placeholder=""/>
+            <a-input v-model:value="searchParams.siteCode" placeholder="" :allow-clear="true"/>
           </a-form-item>
         </a-col>
         <a-col :span="6">
           <a-form-item label="站点名称" :label-col="{span:8}" name="siteName">
-            <a-input v-model:value="searchParams.siteName" placeholder=""/>
+            <a-input v-model:value="searchParams.siteName" placeholder="" :allow-clear="true"/>
           </a-form-item>
         </a-col>
         <a-col :span="6">

+ 1 - 1
vue/src/views/baseSettings/siteUser/index.vue

@@ -4,7 +4,7 @@
       <a-row :gutter="24">
         <a-col :span="6">
           <a-form-item label="人员名称" :label-col="{span:8}" name="siteUserName">
-            <a-input v-model:value="searchParams.siteUserName" placeholder=""/>
+            <a-input v-model:value="searchParams.siteUserName" placeholder="" :allow-clear="true"/>
           </a-form-item>
         </a-col>
         <a-col :span="6">

+ 2 - 2
vue/src/views/companyService/company/index.vue

@@ -4,12 +4,12 @@
       <a-row :gutter="24">
         <a-col :span="6">
           <a-form-item label="企业名称" :label-col="{span:6}" name="companyName">
-            <a-input v-model:value="searchParams.companyName" placeholder=""/>
+            <a-input v-model:value="searchParams.companyName" placeholder="" :allow-clear="true"/>
           </a-form-item>
         </a-col>
         <a-col :span="6">
           <a-form-item label="统一信用代码" :label-col="{span:6}" name="companyCode">
-            <a-input v-model:value="searchParams.companyCode" placeholder=""/>
+            <a-input v-model:value="searchParams.companyCode" placeholder="" :allow-clear="true"/>
           </a-form-item>
         </a-col>
         <a-col :span="6">

+ 23 - 14
vue/src/views/companyService/post/index.vue

@@ -4,7 +4,7 @@
       <a-row :gutter="24">
         <a-col :span="6">
           <a-form-item label="岗位名称" :label-col="{span:6}" name="postName">
-            <a-input v-model:value="searchParams.postName" placeholder=""/>
+            <a-input v-model:value="searchParams.postName" placeholder="" :allow-clear="true"/>
           </a-form-item>
         </a-col>
         <a-col :span="6">
@@ -18,10 +18,10 @@
         </a-col>
         <a-col :span="6">
           <a-form-item label="招聘企业" :label-col="{span:6}" name="companyName">
-            <!--            <a-input v-model:value="searchParams.companyName" placeholder=""/>-->
-            <a-select ref="select" @change="loadData"
+           <a-select ref="select" @change="loadData"
                       show-search optionFilterProp="label"
-                      v-model:value="searchParams.companyName">
+                      v-model:value="searchParams.companyName"
+                      :allow-clear="true">
               <a-select-option v-for="item in companyList" :label="item.companyName" :value="item.companyName"
                                :key="item.companyID">
                 <span>{{ item.companyName }}</span>
@@ -201,7 +201,7 @@ export default defineComponent({
       {title: '文化程度', dataIndex: 'cultureLevelName', key: 'cultureLevelName', align: "center"},
       {
         title: '薪酬', dataIndex: 'siteCount', key: 'siteCount', align: "center", customRender: (item) => {
-          const salary = `${item.record.minSalary ?? ""}-${item.record.maxSalary ?? ""}`
+          const salary = showSalary(item.record.minSalary,item.record.maxSalary);/*`${item.record.minSalary ?? ""}-${item.record.maxSalary ?? ""}`*/
           return salary;
         }
       },
@@ -259,6 +259,22 @@ export default defineComponent({
       loadData();
     }
 
+    const showSalary =(minSalary:any,maxSalary:any)=>{
+      if(minSalary!=null){
+        if(maxSalary!=null){
+           return minSalary.toString()+"-"+maxSalary.toString();
+        }else{
+          return "≥"+minSalary.toString();
+        }
+      }else{
+        if(maxSalary!=null){
+          return "≤"+maxSalary.toString();
+        }else{
+          return "";
+        }
+      }
+    }
+
     const onDel = (item: any) => {
       console.log(item.postID);
       Modal.confirm({
@@ -279,12 +295,6 @@ export default defineComponent({
       })
     };
 
-    const importPost = () => {
-      console.log('导入');
-    }
-    const exportPost = () => {
-      console.log('导出');
-    }
 
     return {
       formRef,
@@ -294,18 +304,17 @@ export default defineComponent({
       pagination,
       dataList,
       importOptions,
+      showSalary,
+      getCompanyList,
       handleTableChange,
       onSelectChange,
       onSearch,
-      importPost,
-      exportPost,
       onDel,
       loadData,
       onAdd,
       onEdit,
       expand,
       postStatusList,
-      getCompanyList,
       companyList
     };
   },

+ 16 - 20
vue/src/views/jobUserManager/jobhunt/edit.vue

@@ -6,8 +6,17 @@
         <a-col :span="7">
           <a-form-item label="姓名"  name="jobUserID" :label-col="{span:8}"  :rules="[{ required: true, message: '请输选择求职人员!' }]">
             <label v-if="opCategory==3">{{dataModel.name}}</label>
-            <a-select  ref="select"  v-model:value="dataModel.jobUserID" :options="jobUserList"
+<!--            <a-select  ref="select"  v-model:value="dataModel.jobUserID" :options="jobUserList"
                        :field-names="{label:'text',value:'value'}"  :allow-clear="true"  >
+            </a-select>-->
+
+            <a-select ref="select"   show-search optionFilterProp="label"
+                      v-model:value="dataModel.jobUserID"
+                      :allow-clear="true">
+              <a-select-option v-for="item in jobUserList" :label="item.text" :value="item.value"
+                               :key="item.value">
+                <span>{{ item.text }}</span>
+              </a-select-option>
             </a-select>
           </a-form-item>
         </a-col>
@@ -96,22 +105,6 @@ import {message,SelectProps} from "ant-design-vue";
 
 interface jobHuntModel {
   dataModel: any;
-    /*{
-    jobHuntID:string|null,
-    jobHuntType:number|null,
-    jobUserID:string|null,
-    jobUserName:string|null,
-    jobUserType:number|null,
-    minSalary:number|null,
-    maxSalary:string|null,
-    postID:string|null,
-    workName:string|null,
-    workCode:string|null,
-    workYear:string|null,
-    areaWork:string|null,
-    inDate:string|null,
-    isAccomplish:string|null
-  };*/
 }
 export default defineComponent({
   name:'JobHuntEditForm',
@@ -185,10 +178,13 @@ export default defineComponent({
     };
 
     const onFinish = () => {
-      if(formData.dataModel.minSalary>formData.dataModel.maxSalary){
-        message.error("最低月薪不能大于最高月薪!");
-        isAllowCommit.value = false;
+      if(formData.dataModel.minSalary!=""&&formData.dataModel.maxSalary!=""){
+        if(formData.dataModel.minSalary>formData.dataModel.maxSalary){
+          message.error("最低月薪不能大于最高月薪!");
+          isAllowCommit.value = false;
+        }
       }
+
       if (isAllowCommit.value){
         saveJobHunt(formData.dataModel).then(result => {
           if (result) {

+ 31 - 14
vue/src/views/jobUserManager/jobhunt/index.vue

@@ -17,14 +17,14 @@
             <a-input v-model:value="searchParamsState.workName" placeholder="" />
           </a-form-item>
         </a-col>
-        <a-col :span="6">
-          <a-form-item label="工作年限" :label-col="{ span: 8 }" name="workYear">
+        <a-col :span="8">
+          <a-form-item label="工作年限" :label-col="{ span: 6 }" name="workYear">
             <a-input type="number" v-model:value="searchParamsState.minWorkYear" style="width:110px;" placeholder="" />
             <label style="margin:10px;">-</label>
             <a-input type="number" v-model:value="searchParamsState.maxWorkYear" style="width:110px;" placeholder="" />
           </a-form-item>
         </a-col>
-        <a-col :span="6" style="text-align: left">
+        <a-col :span="4" style="text-align: left">
           <a-button type="primary" html-type="submit" @click="onSearch">查询</a-button>
           <a-button
             style="margin: 0 8px"
@@ -69,14 +69,14 @@
             </a-select>
           </a-form-item>
         </a-col>
-        <a-col :span="6">
-          <a-form-item label="月薪要求" :label-col="{ span: 8 }" name="salary">
-            <a-input type="number" v-model:value="searchParamsState.minSalary" style="min-width:20px;width:40%;" placeholder="" />
+        <a-col :span="8">
+          <a-form-item label="月薪要求" :label-col="{ span: 6 }" name="salary">
+            <a-input type="number" v-model:value="searchParamsState.minSalary" style="width:110px;" placeholder="" />
             <label style="margin:10px;">-</label>
-            <a-input type="number" v-model:value="searchParamsState.maxSalary" style="min-width:20px;width:40%;" placeholder="" />
+            <a-input type="number" v-model:value="searchParamsState.maxSalary" style="width:110px;" placeholder="" />
           </a-form-item>
         </a-col>
-        <a-col :span="6" style="text-align: left"></a-col>
+        <a-col :span="4" style="text-align: left"></a-col>
       </a-row>
       <a-row :gutter="24"  v-show="expand">
         <a-col :span="6">
@@ -92,8 +92,8 @@
           </a-form-item>
         </a-col>
         <a-col :span="6"> </a-col>
-        <a-col :span="6"> </a-col>
-        <a-col :span="6" style="text-align: left"> </a-col>
+        <a-col :span="8"> </a-col>
+        <a-col :span="4" style="text-align: left"> </a-col>
       </a-row>
       <a-row class="edit-operation">
         <a-col :span="24" style="text-align: right">
@@ -181,9 +181,11 @@ import {useTabsViewStore} from "@/store/modules/tabsView";
         { title: '求职岗位', dataIndex: 'postName', key: 'postName', align: "center", },
         { title: '人才类型', dataIndex: 'jobUserTypeStr', key: 'jobUserTypeStr' , align: "center",},
         { title: '月薪要求', dataIndex: 'salary', key: 'salary' , align: "center",
-          customRender: ({record}) => (
-            record.minSalary+"-"+record.maxSalary
-          )},
+          customRender: (item) => {
+          const salary = showSalary(item.record.minSalary,item.record.maxSalary);
+          return salary;
+          }
+        },
         { title: '操作', key: 'operation', width: 100, align: 'center' },
       ];
       const pagination = computed(() => ({
@@ -216,7 +218,21 @@ import {useTabsViewStore} from "@/store/modules/tabsView";
       const jobHuntTypeList = ref<SelectProps['options']>();
       const jobUserTypeList = ref<SelectProps['options']>();
       const isAccomplishList = ref<SelectProps['options']>();
-
+      const showSalary =(minSalary:any,maxSalary:any)=>{
+        if(minSalary!=null){
+          if(maxSalary!=null){
+            return minSalary.toString()+"-"+maxSalary.toString();
+          }else{
+            return "≥"+minSalary.toString();
+          }
+        }else{
+          if(maxSalary!=null){
+            return "≤"+maxSalary.toString();
+          }else{
+            return "";
+          }
+        }
+      }
       const onSelectChange = (selectedRowKeys: any) => {
         formState.selectedRowKeys = selectedRowKeys;
       };
@@ -313,6 +329,7 @@ import {useTabsViewStore} from "@/store/modules/tabsView";
         jobHuntTypeList,
         jobUserTypeList,
         isAccomplishList,
+        showSalary,
         loadData,
         onSearch,
         onAdd,

+ 1 - 1
vue/src/views/jobUserManager/jobuser/index.vue

@@ -9,7 +9,7 @@
       <a-row :gutter="24">
         <a-col :span="6">
           <a-form-item label="姓名" :label-col="{ span: 8 }" name="name">
-            <a-input v-model:value="searchParamsState.name" placeholder=""/>
+            <a-input v-model:value="searchParamsState.name" placeholder="" :allow-clear="true"/>
           </a-form-item>
         </a-col>
         <a-col :span="6">

+ 97 - 64
vue/src/views/taskAndLog/dotask/edit.vue

@@ -91,24 +91,38 @@
           </Space>
         </a-col>
       </a-row>
-      <a-divider orientation="left">任务执行人员</a-divider>
+      <a-divider orientation="left">任务执行人员  共计:{{userData.length}}</a-divider>
       <a-row>
         <a-col style="margin-bottom: 20px;">
-          <a-table :columns="columns" :data-source="userData" :pagination="false"
+          <a-table :columns="columns" :data-source="userData" :pagination="pagination"
+                   :loading="formState.loading"
+                   @change="handleTableChange"
+                   :row-selection="{ selectedRowKeys: formState.selectedRowKeys, onChange: onSelectChange}"
+                   :row-key="record=>record.siteId"
                    bordered>
             <template #bodyCell="{ column ,index}">
-              <template v-if="column.key === 'siteUserID'">
+              <template v-if="column.key === 'siteUserName'">
                 <div>
-                  <a-select
+                  <a-input v-model:value="userData[index][column.key]" style="border:none;text-align: center;"></a-input>
+<!--                  <a-select
                     ref="select"
                     v-model:value="userData[index][column.key]"
                     :options="siteUserList"
                     :field-names="{ label: 'siteUserName', value: 'siteUserID' }"
                     :allow-clear="true" style="width: 200px"
                   >
-                  </a-select>
+                  </a-select>-->
                 </div>
               </template>
+              <template v-if="column.key === 'genderName'">
+                {{userData[index][column.key]}}
+              </template>
+              <template v-if="column.key === 'mobile'">
+                {{userData[index][column.key]}}
+              </template>
+              <template v-if="column.key === 'taskStatusName'">
+                {{userData[index][column.key]}}
+              </template>
               <template v-if="column.key === 'operation'">
                 <a-button type="link" size="small" @click="deleteUser(index)">删除</a-button>
               </template>
@@ -119,7 +133,7 @@
 
       <a-divider orientation="left">其他信息</a-divider>
       <b-upload-file
-        :file-ref-id="dataModel.dotaskID"
+        :file-ref-id="dataModel.doTaskID"
         :readonly="false"
         :multiple="true"
         :set-file-list="setFileList"
@@ -130,42 +144,79 @@
         <a-button type="primary" html-type="submit">提交</a-button>
       </a-form-item>
     </a-form>
+    <SiteUserModel ref="modalSiteUserRef"></SiteUserModel>
   </div>
 </template>
 
 <script lang="ts">
-import {defineComponent, reactive, ref, toRefs} from 'vue';
-// import {useRouter} from 'vue-router';
-import type {SelectProps, TableColumnsType} from 'ant-design-vue';
+import {computed, defineComponent, reactive, ref, toRefs} from 'vue';
+import type {SelectProps, TableColumnsType, TableProps} from 'ant-design-vue';
 import {useTabsViewStore} from '@/store/modules/tabsView';
 import BUploadFile from '@/components/file/uploadFile.vue';
+import SiteUserModel from "./siteUser.vue"
 import {get} from "@/api/common";
 import {getUserList, getWorkUserList, getDataById, save} from '@/api/taskAndLog/dotask'
+import {getPaginationTotalTitle} from "@/utils/common";
 
-interface FormState {
+interface taskModel {
   dataModel: any;
 }
 
 export default defineComponent(
   {
-    components: {BUploadFile},
+    components: {BUploadFile,SiteUserModel},
     setup() {
-      const formState = reactive<FormState>({dataModel: {}});
-      const formTableState = reactive({loading: false});
+      const isEdit = true;
+      const modalSiteUserRef = ref();
+      const formData = reactive<taskModel>({dataModel: {}});
       const searchParams = reactive({
         pageIndex: 1,
-        pageSize: 99
+        pageSize: 10
+      });
+      const pagination = computed(() => ({
+        total: formState.total,
+        current: searchParams.pageIndex,
+        pageSize: searchParams.pageSize,
+        showSizeChanger: true,
+        showTotal: total => getPaginationTotalTitle(total)
+      }));
+      const tabsViewStore = useTabsViewStore();
+      const onSelectChange = (selectedRowKeys: any) => {
+        formState.selectedRowKeys = selectedRowKeys;
+      };
+      const handleTableChange: TableProps['onChange'] = (pag: { pageSize: number; current: number }) => {
+        searchParams.pageIndex = pag.current;
+        searchParams.pageSize = pag.pageSize;
+      };
+      const formState = reactive({
+        total: 0,
+        selectedRowKeys: [],
+        loading: false
       });
-      // const router = useRouter();
+      const columns: TableColumnsType = [
+        {
+          title: '序号', align: "center", key: 'doTaskID', width: 120,
+          customRender: item => `${searchParams.pageSize * (searchParams.pageIndex - 1) + item.index + 1}`
+        },
+        {
+          title: '姓名', dataIndex: 'siteUserName', key: 'siteUserName', align: "center", width: 120
+        },
+        {
+          title: '性别', dataIndex: 'genderName', key: 'genderName', align: "center", width: 120
+        },
+        {
+          title: '联系电话',dataIndex: 'mobile',key: 'mobile', align: "center", width: 120
+        },
+        {
+          title: '执行情况',dataIndex: 'taskStatusName',key: 'taskStatusName',align: "center",width: 120
+        },
+        {title: '操作', key: 'operation', fixed: 'right', width: 120, align: "center"},
+      ]
+      const fileList = ref();
       const siteUserList = ref([]);
       const regionList = ref<SelectProps['options']>();
       const streetList = ref<SelectProps['options']>();
       const taskTypeList = ref<SelectProps['options']>();
-      // const fullpath = router.currentRoute.value.fullPath;
-      const tabsViewStore = useTabsViewStore();
-      const isEdit = true;
-
-      const fileList = ref();
       const setFileList = (files) => {
         fileList.value = files;
       };
@@ -179,7 +230,7 @@ export default defineComponent(
       });
 
       const regionChange =async function(){
-        formState.dataModel.streetCode = null;
+        formData.dataModel.streetCode = null;
         changeCity();
       }
 
@@ -191,8 +242,8 @@ export default defineComponent(
       }
 
       const changeCity = () => {
-        if(formState.dataModel.regionCode){
-          get('system/area/getAreaList', {code: formState.dataModel.regionCode}).then(data => {
+        if(formData.dataModel.regionCode){
+          get('system/area/getAreaList', {code: formData.dataModel.regionCode}).then(data => {
             streetList.value = data;
           })
         }
@@ -208,29 +259,26 @@ export default defineComponent(
       }
 
       const addUser = () => {
-        (userData.value as any[]).push({siteUserID: null, name: ''});
-
+        /*if(siteUserList.value.length>0){
+          const defaultSiteUser:any = siteUserList.value[0];
+          console.log("hhh",defaultSiteUser);
+          (userData.value as any[]).push({siteUserID: defaultSiteUser.siteUserID,siteUserName:defaultSiteUser.siteUserName,genderName:defaultSiteUser.genderName,mobile:defaultSiteUser.mobile,taskStatusName:"待完成"});
+        }*/
+        modalSiteUserRef.value.show(formData.dataModel.doTaskID);
       }
       const deleteUser = (record) => {
         (userData.value as any[]).splice(record, 1);
       }
 
-      const onAdd = () => {
-        tabsViewStore.addTabByPath('', null);
-      };
-      const onDel = () => {
-
-      };
       const onClose = (reload: any) => {
         tabsViewStore.closeCurrentTabByPath('/taskAndLog/dotask/add');
         tabsViewStore.closeCurrentTabByPath('/taskAndLog/dotask/edit');
-        // router.push({name: '/taskAndLog/dotask/index'});
         tabsViewStore.openTab('/taskAndLog/dotask/index', {reload: reload});
       };
 
       const onFinish = () => {
-        formState.dataModel.doTaskUser = userData.value;
-        save(formState.dataModel).then(result => {
+        formData.dataModel.doTaskUser = userData.value;
+        save(formData.dataModel).then(result => {
           if (result) {
             onClose(1)
           }
@@ -239,52 +287,37 @@ export default defineComponent(
 
       const loadData = (id: any) => {
         getDataById(id).then(data => {
-          formState.dataModel = data;
+          formData.dataModel = data;
           changeCity();
         });
       };
 
-      const columns: TableColumnsType = [
-        {
-          title: '序号',
-          align: "center",
-          key: 'doTaskID',
-          width: 120,
-          customRender: item => `${searchParams.pageSize * (searchParams.pageIndex - 1) + item.index + 1}`
-        },
-        {
-          title: '人员',
-          dataIndex: 'siteUserID',
-          key: 'siteUserID',
-          align: "center",
-          width: 120
-        },
-        {title: '操作', key: 'operation', fixed: 'right', width: 120, align: "center"},
-      ]
+
 
       return {
-        ...toRefs(formState),
+        ...toRefs(formData),
+        modalSiteUserRef,
         isEdit,
-        loadData,
-        onClose,
-        onFinish,
-        onAdd,
-        onDel,
-        addUser,
-        deleteUser,
         columns,
+        pagination,
         formState,
-        formTableState,
-        setFileList,
-        regionList,
         userData,
+        regionList,
         streetList,
         taskTypeList,
         siteUserList,
+        loadData,
+        onClose,
+        onFinish,
+        addUser,
+        deleteUser,
+        setFileList,
         getSiteUserList,
         loadUserData,
         changeCity,
-        regionChange
+        regionChange,
+        onSelectChange,
+        handleTableChange
       }
     },
     created() {

+ 3 - 3
vue/src/views/taskAndLog/dotask/index.vue

@@ -8,12 +8,12 @@
           </a-form-item>
         </a-col>
         <a-col  :span="6">
-          <a-form-item label="下达时间" :label-col="{span:6}" name="name">
+          <a-form-item label="下达时间" :label-col="{span:6}" name="orderDate">
             <a-range-picker format="YYYY-MM-DD" :placeholder="['开始日期', '结束日期']" @change="onRangeChange"/>
           </a-form-item>
         </a-col>
         <a-col  :span="6">
-          <a-form-item label="完成时间" :label-col="{span:6}" name="name">
+          <a-form-item label="完成时间" :label-col="{span:6}" name="finishDate">
             <a-range-picker format="YYYY-MM-DD" :placeholder="['开始日期', '结束日期']" @change="onFinishChange"/>
           </a-form-item>
         </a-col>
@@ -245,7 +245,7 @@ export default defineComponent({
 
     const onDel = (item: any) => {
       if (item) {
-        formState.selectedRowKeys.push(item.dotaskID as never)
+        formState.selectedRowKeys.push(item.doTaskID as never)
       }
 
       if (formState.selectedRowKeys.length <= 0) {

+ 168 - 0
vue/src/views/taskAndLog/dotask/siteUser.vue

@@ -0,0 +1,168 @@
+<template>
+  <a-modal
+    :width="800"
+    v-model:visible="visible"
+    title="添加人员"
+    :keyboard="false"
+    :mask-closable="false"
+    :closable="false"
+    cancel-text="取消"
+    :ok-button-props="{ style: { display: 'none' } }"
+  >
+    <div class="modal-search">
+      <a-form
+        ref="formRef"
+        name="advanced_search"
+        class="ant-advanced-search-form"
+        :model="searchParamsState"
+      >
+        <a-row :gutter="24">
+          <a-col :span="10">
+            <a-form-item label="姓名" :label-col="{span:8}" name="name">
+              <a-input v-model:value="searchParamsState.siteUserName" placeholder=""/>
+            </a-form-item>
+          </a-col>
+          <a-col :span="10">
+
+          </a-col>
+          <a-col :span="4" style="text-align: left">
+            <a-button type="primary" html-type="submit" @click="loadSiteUserList">查询</a-button>
+          </a-col>
+        </a-row>
+      </a-form>
+      <div class="search-result-list">
+        <a-table :columns="columns" :data-source="siteUserList" :scroll="{ x: 500, y: 500 }" :pagination="pagination"
+                 :loading="formState.loading"
+                 @change="handleTableChange"
+                 :row-selection="{ selectedRowKeys: formState.selectedRowKeys, onChange: onSelectChange}"
+                 :row-key="record=>record.siteUserID"
+                 bordered>
+        </a-table>
+      </div>
+    </div>
+    <a-button type="primary" @click="onCommit">确定</a-button>
+  </a-modal>
+</template>
+<script lang="ts">
+import {computed, defineComponent, reactive, ref} from "vue";
+import type {TableColumnsType, TableProps} from 'ant-design-vue';
+import type {FormInstance} from 'ant-design-vue';
+import {getWorkUserList} from '@/api/taskAndLog/dotask'
+import {getSiteUserList} from '@/api/baseSettings/userInfo';
+
+interface siteUserModel{
+  siteUserID:string
+}
+
+export default defineComponent({
+  props: {
+    loadData: {
+      type: Function,
+      default: null
+    }
+  },
+  setup() {
+    const siteUserList = ref([]);
+    const curUserList = ref([]);
+    const curPageSelectUserID = ref<siteUserModel[]>([]);
+    const visible = ref<boolean>(false);
+    const searchParamsState = reactive({
+      pageIndex: 1,
+      pageSize: 10,
+      siteUserIDList: [],
+      siteUserName: '',
+    });
+    const modalFormRef = ref<FormInstance>();
+    const columns: TableColumnsType = [
+      {
+        title: '序号',align: 'center',width: 60,key: 'siteUserID',
+        customRender: item => `${searchParamsState.pageSize * (searchParamsState.pageIndex - 1) + item.index + 1}`
+      },
+      {title: '姓名', dataIndex: 'siteUserName', key: 'siteUserName', width: 150},
+      {title: '性别', dataIndex: 'genderName', key: 'genderName', width: 150},
+      {title: '联系电话', dataIndex: 'mobile', key: 'mobile', width: 150},
+    ];
+    const formState = reactive({
+      total: 0,
+      selectedRowKeys: [],
+      loading: false
+    });
+    const pagination = computed(() => ({
+      total: formState.total,
+      current: searchParamsState.pageIndex,
+      pageSize: searchParamsState.pageSize,
+      showSizeChanger: true
+    }));
+
+    const targetKeys = ref<string[]>();
+    const onSelectChange = (selectedRowKeys: any) => {
+      formState.selectedRowKeys = selectedRowKeys;
+    };
+
+    const handleTableChange: TableProps['onChange'] = (
+      pag: { pageSize: number; current: number }
+    ) => {
+      searchParamsState.pageIndex = pag.current;
+      searchParamsState.pageSize = pag.pageSize;
+      loadSiteUserList();
+    };
+
+    const loadSiteUserList = async function () {
+      const allSiteUsers: any = await getSiteUserList(searchParamsState);
+      siteUserList.value = allSiteUsers.list;
+      formState.total = allSiteUsers.total;
+      console.log("所有站点人员",siteUserList.value);
+    }
+
+    const show = async function (curTaskID:any) {
+      formState.loading = true;
+      curPageSelectUserID.value = [];
+      formState.selectedRowKeys = [];
+      getWorkUserList(curTaskID).then(curTaskUsers => {
+        curUserList.value = curTaskUsers;
+        console.log("当前站点人员",curUserList.value);
+      });
+      await loadSiteUserList();
+      if(curUserList.value.length>0 && siteUserList.value.length>0){
+        (curUserList.value as siteUserModel[]).filter(item=>{
+          const curIndex = (siteUserList.value  as siteUserModel[]).findIndex(x=>x.siteUserID == item.siteUserID);
+          if(curIndex>-1){
+            (formState.selectedRowKeys as string[]).push(item.siteUserID);
+          }
+        })
+      }
+      formState.loading = false;
+      visible.value = true;
+    };
+
+    const onCommit = async function (){
+      const allSelectSiteUser: any = await getSiteUserList({pageIndex:1,pageSize:9999,siteUserIDList:formState.selectedRowKeys.join(',')});
+      console.log("allSelectSiteUser",allSelectSiteUser.list);
+      allSelectSiteUser.list.map(x=>{
+        (curUserList.value as any[]).push({siteUserID: x.siteUserID,siteUserName:x.siteUserName,genderName:x.genderName,mobile:x.mobile,taskStatusName:"待完成"});
+      })
+     /*visible.value = false;*/
+    };
+
+    return {
+      visible,
+      modalFormRef,
+      searchParamsState,
+      columns,
+      siteUserList,
+      pagination,
+      show,
+      loadSiteUserList,
+      onCommit,
+      handleTableChange,
+      onSelectChange,
+      formState,
+      targetKeys,
+    };
+  },
+  created() {
+
+  },
+})
+</script>
+

+ 13 - 13
vue/src/views/taskAndLog/dowork/index.vue

@@ -4,7 +4,7 @@
       <a-row :gutter="24">
         <a-col :span="6">
           <a-form-item label="姓名" :label-col="{span:6}" name="userName">
-            <a-input v-model:value="searchParams.userName" placeholder=""/>
+            <a-input v-model:value="searchParams.userName" placeholder="" :allow-clear="true"/>
           </a-form-item>
         </a-col>
         <a-col :span="6">
@@ -16,20 +16,13 @@
           <a-form-item label="日志类型" :label-col="{span:6}" name="doTypeID">
             <a-select  ref="select"
               v-model:value="searchParams.doTypeID" :options="logTypeList"
-              :field-names="{ label: 'name', value: 'value' }" @change="onSearch">
+              :field-names="{ label: 'name', value: 'value' }" @change="onSearch" :allow-clear="true">
             </a-select>
           </a-form-item>
         </a-col>
         <a-col :span="6" style="text-align: left">
           <a-button type="primary" html-type="submit" @click="onSearch">查询</a-button>
-          <a-button
-            style="margin: 0 8px"
-            @click="
-              () => {
-                formRef.resetFields();
-                loadData();
-              }
-            ">重置</a-button>
+          <a-button style="margin: 0 8px" @click="formRef.resetFields();onReset();">重置</a-button>
           <a style="font-size: 12px" @click="expand = !expand">
             <template v-if="expand">
               <UpOutlined />
@@ -120,8 +113,8 @@ export default defineComponent({
       pageIndex: 1,
       pageSize: 20,
       userName:'',
-      workStartDate:null,
-      workEndDate:null,
+      workStartDate:'',
+      workEndDate:'',
       doTypeID: null,
       regionCode:'',
       streetCode:''
@@ -254,6 +247,11 @@ export default defineComponent({
       tabsViewStore.addTabByPath('/taskAndLog/workLog/edit', {id:id});
     };
 
+    const onReset =()=>{
+        searchParams.workStartDate = '';
+        searchParams.workEndDate ='';
+        loadData();
+    };
 
     return {
       formRef,
@@ -272,9 +270,11 @@ export default defineComponent({
       onAdd,
       onEdit,
       onDel,
+      onReset,
       onRangeChange,
       loadData,
-      changeRegion
+      changeRegion,
+      dayjs
     };
   },
   created() {