Browse Source

Merge remote-tracking branch 'origin/master'

Liudijing 11 tháng trước cách đây
mục cha
commit
aad4c65781
22 tập tin đã thay đổi với 574 bổ sung356 xóa
  1. 25 34
      src/main/java/com/hz/employmentsite/controller/baseSettings/InstitutionController.java
  2. 39 7
      src/main/java/com/hz/employmentsite/controller/baseSettings/SiteInfoController.java
  3. 32 0
      src/main/java/com/hz/employmentsite/controller/baseSettings/UserInfoController.java
  4. 34 0
      src/main/java/com/hz/employmentsite/controller/taskAndLog/DoWorkController.java
  5. 2 0
      src/main/java/com/hz/employmentsite/mapper/cquery/SiteInstitutionCQuery.java
  6. 2 0
      src/main/java/com/hz/employmentsite/mapper/cquery/UserInfoCQuery.java
  7. 39 16
      src/main/java/com/hz/employmentsite/services/impl/baseSettings/SiteInfoImpl.java
  8. 9 1
      src/main/java/com/hz/employmentsite/services/impl/baseSettings/UserInfoImpl.java
  9. 5 0
      src/main/java/com/hz/employmentsite/services/impl/taskAndLog/DoWorkImpl.java
  10. 2 0
      src/main/java/com/hz/employmentsite/services/service/baseSettings/UserInfoService.java
  11. 1 1
      src/main/java/com/hz/employmentsite/vo/baseSettings/UserInfoVo.java
  12. 7 0
      src/main/resources/mapping/cquery/SiteInstitutionCQuery.xml
  13. 10 1
      src/main/resources/mapping/cquery/UserInfoCQuery.xml
  14. 13 0
      vue/src/api/baseSettings/userInfo.ts
  15. 62 91
      vue/src/views/baseSettings/institution/edit.vue
  16. 5 6
      vue/src/views/baseSettings/institution/index.vue
  17. 196 70
      vue/src/views/baseSettings/site/edit.vue
  18. 5 6
      vue/src/views/baseSettings/site/index.vue
  19. 32 56
      vue/src/views/baseSettings/user/edit.vue
  20. 6 5
      vue/src/views/baseSettings/user/index.vue
  21. 34 53
      vue/src/views/taskAndLog/dowork/edit.vue
  22. 14 9
      vue/src/views/taskAndLog/dowork/index.vue

+ 25 - 34
src/main/java/com/hz/employmentsite/controller/baseSettings/InstitutionController.java

@@ -68,41 +68,32 @@ public class InstitutionController {
     }
 
     @GetMapping("export")
-    public BaseResponse export(HttpServletResponse response,
-                               @RequestParam(required = false) Boolean isExport, @RequestParam("page") int page, @RequestParam("rows") int rows,
-                               @RequestParam(required = false) String szkey, @RequestParam(required = false) String companyName,
-                               @RequestParam(required = false) String companyAddress,@RequestParam(required = false) String dutyUserName) throws Exception{
-
-        PageInfo<InstitutionVo> result = institutionService.getList(page,rows,szkey,companyName,companyAddress,dutyUserName);
-        if (isExport == null || !isExport) {
-            return RespGenerstor.success(result);
-        } else {
-            ExcelHelper.ExcelData data = excelHelper.new ExcelData();
-            data.setTitles(Arrays.asList(new String[]{"序号","年级","问题反馈日期", "学院", "问题描述","问题特性", "解决方案", "是否解决", "解决时间", "登记人"}));
-            int i = 0;
-            List<List<Object>> rowDatas = new ArrayList();
-            for (InstitutionVo item : result.getList()) {
-                List<Object> row = new ArrayList();
-                ++i;
-                row.add(i);
-                row.add(item.companyCode);
-                row.add(item.companyCode);
-                row.add(item.fzrName);
-                row.add(item.fzrMobile);
-                row.add(item.frName);
-                row.add(item.frMobile);
-                row.add(item.companyAddress);
-                row.add(item.companyDesc);
-                row.add(item.createUserID);
-                row.add(item.createTime);
-                row.add(item.modifyUserID);
-                row.add(item.modifyTime);
-                rowDatas.add(row);
-            }
-            data.setRows(rowDatas);
-            excelHelper.exportExcel(response, data);
-            return null;
+    public BaseResponse export(HttpServletResponse response, @RequestParam("pageIndex") int pageIndex, @RequestParam("pageSize") int pageSize,
+                               @RequestParam(required = false) String primaryKey, @RequestParam(required = false) String companyName,
+                               @RequestParam(required = false) String companyAddress, @RequestParam(required = false) String dutyUserName) throws Exception{
+
+        PageInfo<InstitutionVo> result = institutionService.getList(pageIndex,pageSize,primaryKey,companyName,companyAddress,dutyUserName);
+        ExcelHelper.ExcelData data = excelHelper.new ExcelData();
+        data.setTitles(Arrays.asList(new String[]{"序号","企业名称","企业地址", "负责人姓名", "负责人电话","法人姓名", "法人电话", "企业机构代码", "管理驿站数量"}));
+        int i = 0;
+        List<List<Object>> rowDatas = new ArrayList();
+        for (InstitutionVo item : result.getList()) {
+            List<Object> row = new ArrayList();
+            ++i;
+            row.add(i);
+            row.add(item.companyName);
+            row.add(item.companyAddress);
+            row.add(item.fzrName);
+            row.add(item.fzrMobile);
+            row.add(item.frName);
+            row.add(item.frMobile);
+            row.add(item.companyCode);
+            row.add(item.siteCount);
+            rowDatas.add(row);
         }
+        data.setRows(rowDatas);
+        excelHelper.exportExcel(response, data);
+        return null;
     }
 
     @ResponseBody

+ 39 - 7
src/main/java/com/hz/employmentsite/controller/baseSettings/SiteInfoController.java

@@ -4,13 +4,15 @@ import com.github.pagehelper.PageInfo;
 import com.hz.employmentsite.filter.exception.BaseResponse;
 import com.hz.employmentsite.filter.exception.RespGenerstor;
 import com.hz.employmentsite.util.ExcelHelper;
-import com.hz.employmentsite.vo.baseSettings.InstitutionVo;
 import com.hz.employmentsite.vo.baseSettings.SiteInfoVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 import com.hz.employmentsite.services.service.baseSettings.SiteInfoService;
 import com.hz.employmentsite.services.service.AccountService;
 
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import java.util.UUID;
 
@@ -22,7 +24,7 @@ public class SiteInfoController {
     private AccountService accountService;
 
     @Autowired
-    private SiteInfoService siteService;
+    private SiteInfoService siteInfoService;
 
     @Autowired
     private ExcelHelper excelHelper;
@@ -34,14 +36,14 @@ public class SiteInfoController {
                                                       @RequestParam(required = false) String siteName, @RequestParam(required = false) String institutionName,
                                                       @RequestParam(required = false) String regionCode, @RequestParam(required = false) String streetCode) {
 
-        PageInfo<SiteInfoVo> result = siteService.getList(pageIndex,pageSize,primaryKey,siteCode,siteName,institutionName,regionCode,streetCode);
+        PageInfo<SiteInfoVo> result = siteInfoService.getList(pageIndex,pageSize,primaryKey,siteCode,siteName,institutionName,regionCode,streetCode);
 
         return RespGenerstor.success(result);
     }
 
     @PostMapping("getListByInstitutionID")
     public BaseResponse<Integer> getListByInstitutionID(@RequestParam("pageIndex") int pageIndex, @RequestParam("pageSize") int pageSize,@RequestParam(required = false) String institutionID) {
-        return RespGenerstor.success(siteService.getListByInstitutionID(pageIndex,pageSize, institutionID));
+        return RespGenerstor.success(siteInfoService.getListByInstitutionID(pageIndex,pageSize, institutionID));
     }
 
     @GetMapping("get")
@@ -50,7 +52,7 @@ public class SiteInfoController {
         if (siteID == null || siteID == ""){
             dataModel.siteID = UUID.randomUUID().toString();
         }else{
-            dataModel = siteService.get(siteID);
+            dataModel = siteInfoService.get(siteID);
         }
         dataModel.manageUsers = null;
         return RespGenerstor.success(dataModel);
@@ -59,14 +61,44 @@ public class SiteInfoController {
 
     @PostMapping("save")
     public BaseResponse<Integer> save(@RequestBody SiteInfoVo data) {
-        return RespGenerstor.success(siteService.save(data,accountService.getLoginUserID()));
+        return RespGenerstor.success(siteInfoService.save(data,accountService.getLoginUserID()));
     }
 
+    @GetMapping("export")
+    public BaseResponse export(HttpServletResponse response, @RequestParam("pageIndex") int pageIndex, @RequestParam("pageSize") int pageSize,
+                               @RequestParam(required = false) String primaryKey, @RequestParam(required = false) String siteCode,
+                               @RequestParam(required = false) String siteName, @RequestParam(required = false) String institutionName,
+                               @RequestParam(required = false) String regionCode, @RequestParam(required = false) String streetCode) throws Exception{
+
+        PageInfo<SiteInfoVo> result = siteInfoService.getList(pageIndex,pageSize,primaryKey,siteCode,siteName,institutionName,regionCode,streetCode);
+        ExcelHelper.ExcelData data = excelHelper.new ExcelData();
+        data.setTitles(Arrays.asList(new String[]{"序号","驿站编号","站点名称", "站点负责人", "联系电话","所属县区", "所属街道", "详细地址", "所属机构","驿站人员数量"}));
+        int i = 0;
+        List<List<Object>> rowDatas = new ArrayList();
+        for (SiteInfoVo item : result.getList()) {
+            List<Object> row = new ArrayList();
+            ++i;
+            row.add(i);
+            row.add(item.siteCode);
+            row.add(item.siteName);
+            row.add(item.fzrName);
+            row.add(item.fzrMobile);
+            row.add(item.regionName);
+            row.add(item.streetName);
+            row.add(item.detailAddress);
+            row.add(item.institutionName);
+            row.add(item.userCount);
+            rowDatas.add(row);
+        }
+        data.setRows(rowDatas);
+        excelHelper.exportExcel(response, data);
+        return null;
+    }
 
     @ResponseBody
     @PostMapping("/delete")
     public BaseResponse<Integer> delete(@RequestBody List<String> idList){
-        return RespGenerstor.success(siteService.delete(idList));
+        return RespGenerstor.success(siteInfoService.delete(idList));
     }
 
 

+ 32 - 0
src/main/java/com/hz/employmentsite/controller/baseSettings/UserInfoController.java

@@ -11,7 +11,9 @@ import com.hz.employmentsite.vo.baseSettings.UserInfoVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletResponse;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import java.util.UUID;
 
@@ -38,6 +40,12 @@ public class UserInfoController {
         return RespGenerstor.success(result);
     }
 
+    @PostMapping("getListBySiteID")
+    public BaseResponse<Integer> getListBySiteID(@RequestParam("pageIndex") int pageIndex, @RequestParam("pageSize") int pageSize,@RequestParam(required = false) String siteID) {
+        return RespGenerstor.success(userInfoService.getListBySiteID(pageIndex,pageSize, siteID));
+    }
+
+
     @GetMapping("get")
     public BaseResponse<UserInfoVo> get(@RequestParam(required = false) String siteUserID) {
         UserInfoVo dataModel = new UserInfoVo();
@@ -60,6 +68,30 @@ public class UserInfoController {
         return RespGenerstor.success(userInfoService.save(data,accountService.getLoginUserID()));
     }
 
+    @GetMapping("export")
+    public BaseResponse export(HttpServletResponse response, @RequestParam("pageIndex") int pageIndex, @RequestParam("pageSize") int pageSize,
+                               @RequestParam(required = false) String primaryKey, @RequestParam(required = false) String userName) throws Exception{
+
+        PageInfo<UserInfoVo> result = userInfoService.getList(pageIndex,pageSize,primaryKey,userName);
+        ExcelHelper.ExcelData data = excelHelper.new ExcelData();
+        data.setTitles(Arrays.asList(new String[]{"序号","人员名称","角色", "性别", "联系电话"}));
+        int i = 0;
+        List<List<Object>> rowDatas = new ArrayList();
+        for (UserInfoVo item : result.getList()) {
+            List<Object> row = new ArrayList();
+            ++i;
+            row.add(i);
+            row.add(item.name);
+            row.add(item.roleName);
+            row.add(item.genderName);
+            row.add(item.mobile);
+            rowDatas.add(row);
+        }
+        data.setRows(rowDatas);
+        excelHelper.exportExcel(response, data);
+        return null;
+    }
+
     @ResponseBody
     @PostMapping("/delete")
     public BaseResponse<Integer> delete(@RequestBody List<String> idList){

+ 34 - 0
src/main/java/com/hz/employmentsite/controller/taskAndLog/DoWorkController.java

@@ -5,10 +5,15 @@ import com.hz.employmentsite.filter.exception.BaseResponse;
 import com.hz.employmentsite.filter.exception.RespGenerstor;
 import com.hz.employmentsite.services.service.AccountService;
 import com.hz.employmentsite.services.service.taskAndLog.DoWorkService;
+import com.hz.employmentsite.util.ExcelHelper;
+import com.hz.employmentsite.vo.baseSettings.UserInfoVo;
 import com.hz.employmentsite.vo.taskAndLog.DoWorkVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import java.util.UUID;
 
@@ -21,6 +26,9 @@ public class DoWorkController {
     @Autowired
     private DoWorkService doWorkService;
 
+    @Autowired
+    private ExcelHelper excelHelper;
+
     @ResponseBody
     @GetMapping("/getList")
     public BaseResponse getList(@RequestParam("pageIndex") int pageIndex, @RequestParam("pageSize") int pageSize, @RequestParam(required = false) String primaryKey,
@@ -47,6 +55,32 @@ public class DoWorkController {
         return RespGenerstor.success(doWorkService.save(data,accountService.getLoginUserID()));
     }
 
+    @GetMapping("export")
+    public BaseResponse export(HttpServletResponse response, @RequestParam("pageIndex") int pageIndex, @RequestParam("pageSize") int pageSize, @RequestParam(required = false) String primaryKey,
+                               @RequestParam(required = false) String userName,@RequestParam(required = false) String workStartDate,  @RequestParam(required = false) String workEndDate,
+                               @RequestParam(required = false) Integer doTypeID, @RequestParam(required = false) String regionCode,@RequestParam(required = false) String streetCode) throws Exception{
+        PageInfo<DoWorkVo> result = doWorkService.getList(pageIndex, pageSize,primaryKey, userName, workStartDate,workEndDate,doTypeID,regionCode,streetCode);
+        ExcelHelper.ExcelData data = excelHelper.new ExcelData();
+        data.setTitles(Arrays.asList(new String[]{"序号","姓名","工作日期", "日志类型", "工作情况","所属县区","所属街道"}));
+        int i = 0;
+        List<List<Object>> rowDatas = new ArrayList();
+        for (DoWorkVo item : result.getList()) {
+            List<Object> row = new ArrayList();
+            ++i;
+            row.add(i);
+            row.add(item.userName);
+            row.add(item.workTime);
+            row.add(item.logTypeName);
+            row.add(item.workContent);
+            row.add(item.regionName);
+            row.add(item.streetName);
+            rowDatas.add(row);
+        }
+        data.setRows(rowDatas);
+        excelHelper.exportExcel(response, data);
+        return null;
+    }
+
     @ResponseBody
     @PostMapping("/delete")
     public BaseResponse<Integer> delete(@RequestBody List<String> idList){

+ 2 - 0
src/main/java/com/hz/employmentsite/mapper/cquery/SiteInstitutionCQuery.java

@@ -9,4 +9,6 @@ public interface SiteInstitutionCQuery {
 
     List<PcSiteInstitution> getListByInstitutionID(@Param("institutionID") String institutionID);
 
+    List<PcSiteInstitution> getListBySiteID(@Param("siteID") String siteID);
+
 }

+ 2 - 0
src/main/java/com/hz/employmentsite/mapper/cquery/UserInfoCQuery.java

@@ -6,6 +6,8 @@ import org.apache.ibatis.annotations.Param;
 import java.util.List;
 
 public interface UserInfoCQuery {
+
     List<UserInfoVo> getList(@Param("primaryKey") String primaryKey, @Param("userName") String userName);
 
+    List<UserInfoVo> getListBySiteID(@Param("siteID") String siteID);
 }

+ 39 - 16
src/main/java/com/hz/employmentsite/services/impl/baseSettings/SiteInfoImpl.java

@@ -3,15 +3,19 @@ package com.hz.employmentsite.services.impl.baseSettings;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.hz.employmentsite.mapper.PcSiteMapper;
-import com.hz.employmentsite.mapper.cquery.SiteInfoCQuery;
 import com.hz.employmentsite.mapper.PcSiteInstitutionMapper;
-import com.hz.employmentsite.model.PcInstitutionExample;
+import com.hz.employmentsite.mapper.PcSiteUserMapper;
+import com.hz.employmentsite.mapper.cquery.SiteInfoCQuery;
+import com.hz.employmentsite.mapper.cquery.SiteInstitutionCQuery;
 import com.hz.employmentsite.model.PcSite;
 import com.hz.employmentsite.model.PcSiteExample;
 import com.hz.employmentsite.model.PcSiteInstitution;
+import com.hz.employmentsite.model.PcSiteUser;
 import com.hz.employmentsite.services.service.baseSettings.SiteInfoService;
 import com.hz.employmentsite.util.StringUtils;
 import com.hz.employmentsite.vo.baseSettings.SiteInfoVo;
+import com.hz.employmentsite.vo.baseSettings.UserInfoVo;
+import com.hz.employmentsite.vo.taskAndLog.SiteUserVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -26,6 +30,8 @@ public class SiteInfoImpl implements SiteInfoService {
     @Autowired
     private SiteInfoCQuery siteInfoCQuery;
 
+    @Autowired
+    private SiteInstitutionCQuery siteInstitutionCQuery;
 
     @Autowired
     private StringUtils stringUtils;
@@ -33,6 +39,9 @@ public class SiteInfoImpl implements SiteInfoService {
     @Autowired
     private PcSiteMapper pcSiteMapper;
 
+    @Autowired
+    private PcSiteUserMapper pcSiteUserMapper;
+
     @Autowired
     private PcSiteInstitutionMapper pcSiteInstitutionMapper;
 
@@ -83,16 +92,6 @@ public class SiteInfoImpl implements SiteInfoService {
             dbData.setCreateUserID(userId);
             dbData.setCreateTime(new Date());
             result = pcSiteMapper.insert(dbData);
-            /*链接表数据添加*/
-            if (data.institutionID != null || data.institutionID !=""){
-                PcSiteInstitution insertLinkData =  new PcSiteInstitution();
-                insertLinkData.setSiteInstitutionID(UUID.randomUUID().toString());
-                insertLinkData.setSiteID(data.getSiteID());
-                insertLinkData.setInstitutionID(data.getInstitutionID());
-                insertLinkData.setCreateTime(new Date());
-                insertLinkData.setCreateUserID(userId);
-                result += pcSiteInstitutionMapper.insert(insertLinkData);
-            }
         } else {
             //修改
             dbData.setSiteID(data.siteID);
@@ -108,10 +107,34 @@ public class SiteInfoImpl implements SiteInfoService {
             dbData.setModifyUserID(userId);
             dbData.setModifyTime(new Date());
             result = pcSiteMapper.updateByPrimaryKey(dbData);
-            /*链接表数据修改*/
-            PcSiteInstitution updateLinkData = pcSiteInstitutionMapper.selectByPrimaryKey(data.siteInstitutionID);
-            updateLinkData.setInstitutionID(data.institutionID);
-            result += pcSiteInstitutionMapper.updateByPrimaryKey(updateLinkData);
+        }
+        /*修改驿站站点信息:先删除所有关联数据,再添加*/
+        var allExistData = siteInstitutionCQuery.getListBySiteID(data.getSiteID());
+        if (allExistData != null && allExistData.size() > 0){
+            for(PcSiteInstitution curLinkData : allExistData) {
+                var siteInstitutionID = curLinkData.getSiteInstitutionID();
+                result += pcSiteInstitutionMapper.deleteByPrimaryKey(siteInstitutionID);
+            }
+        }
+        if (!stringUtils.IsNullOrEmpty(data.institutionID)){
+            PcSiteInstitution insertLinkData =  new PcSiteInstitution();
+            insertLinkData.setSiteInstitutionID(UUID.randomUUID().toString());
+            insertLinkData.setSiteID(data.getSiteID());
+            insertLinkData.setInstitutionID(data.getInstitutionID());
+            insertLinkData.setCreateTime(new Date());
+            insertLinkData.setCreateUserID(userId);
+            result += pcSiteInstitutionMapper.insert(insertLinkData);
+        }
+        /*修改站点人员信息*/
+        if(data.manageUsers.size() > 0){
+            List<UserInfoVo> manageUsers = data.manageUsers.stream().toList();
+            for (var curData: manageUsers) {
+                PcSiteUser curUserData = pcSiteUserMapper.selectByPrimaryKey(curData.getSiteUserID());
+                curUserData.setSiteID(curData.getSiteID());
+                curUserData.setUpdateBy(userId);
+                curUserData.setUpdateTime(new Date());
+                result +=  pcSiteUserMapper.updateByPrimaryKey(curUserData);
+            }
         }
         return result;
     }

+ 9 - 1
src/main/java/com/hz/employmentsite/services/impl/baseSettings/UserInfoImpl.java

@@ -9,6 +9,7 @@ import com.hz.employmentsite.model.PcSiteUserExample;
 import com.hz.employmentsite.model.SelectProps;
 import com.hz.employmentsite.services.service.baseSettings.UserInfoService;
 import com.hz.employmentsite.util.StringUtils;
+import com.hz.employmentsite.vo.baseSettings.SiteInfoVo;
 import com.hz.employmentsite.vo.baseSettings.UserInfoVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -36,6 +37,14 @@ public class UserInfoImpl implements UserInfoService {
         return result;
     }
 
+    @Override
+    public PageInfo<UserInfoVo> getListBySiteID(int pageIndex, int pageSize, String siteID) {
+        PageHelper.startPage(pageIndex, pageSize);
+        List<UserInfoVo> dataList = userInfoCQuery.getListBySiteID(siteID);
+        PageInfo<UserInfoVo> result = new PageInfo(dataList);
+        return result;
+    }
+
     @Override
     public UserInfoVo get(String siteUserID) {
         List<String> ids = new ArrayList<>();
@@ -79,7 +88,6 @@ public class UserInfoImpl implements UserInfoService {
             result = pcSiteUserMapper.insert(dbData);
         } else {
             //修改
-
             dbData.setSiteUserID(data.siteUserID);
             dbData.setSiteID(data.getSiteID());
             dbData.setGender(data.gender);

+ 5 - 0
src/main/java/com/hz/employmentsite/services/impl/taskAndLog/DoWorkImpl.java

@@ -2,15 +2,20 @@ package com.hz.employmentsite.services.impl.taskAndLog;
 
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
+import com.hz.employmentsite.filter.exception.BaseResponse;
+import com.hz.employmentsite.filter.exception.RespGenerstor;
 import com.hz.employmentsite.mapper.PcDoworkMapper;
 import com.hz.employmentsite.mapper.cquery.DoWorkCQuery;
 import com.hz.employmentsite.model.PcDowork;
 import com.hz.employmentsite.model.PcDoworkExample;
 import com.hz.employmentsite.services.service.taskAndLog.DoWorkService;
 import com.hz.employmentsite.util.StringUtils;
+import com.hz.employmentsite.vo.baseSettings.SiteInfoVo;
 import com.hz.employmentsite.vo.taskAndLog.DoWorkVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
 
 import java.util.ArrayList;
 import java.util.Date;

+ 2 - 0
src/main/java/com/hz/employmentsite/services/service/baseSettings/UserInfoService.java

@@ -11,6 +11,8 @@ public interface UserInfoService {
 
     PageInfo<UserInfoVo> getList(int pageIndex, int pageSize, String primaryKey, String userName);
 
+    PageInfo<UserInfoVo> getListBySiteID(int pageIndex, int pageSize, String siteID);
+
     UserInfoVo get(String siteUserID);
 
     List<SelectProps> getDataList();

+ 1 - 1
src/main/java/com/hz/employmentsite/vo/baseSettings/UserInfoVo.java

@@ -13,7 +13,7 @@ public class UserInfoVo {
     public String genderName;
     public String mobile;
     public Integer roleID;
-    public String userTypeName;
+    public String roleName;
 
     public String createBy;
     public Date createTime;

+ 7 - 0
src/main/resources/mapping/cquery/SiteInstitutionCQuery.xml

@@ -7,4 +7,11 @@
             and institutionID like Concat('%',#{institutionID},'%')
         </if>
     </select>
+
+    <select id="getListBySiteID" resultType="com.hz.employmentsite.model.PcSiteInstitution">
+        select  *  from pc_site_institution  where 1=1
+        <if test="siteID!='' and siteID!=null">
+            and siteID like Concat('%',#{siteID},'%')
+        </if>
+    </select>
 </mapper>

+ 10 - 1
src/main/resources/mapping/cquery/UserInfoCQuery.xml

@@ -2,7 +2,7 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.hz.employmentsite.mapper.cquery.UserInfoCQuery">
     <select id="getList" resultType="com.hz.employmentsite.vo.baseSettings.UserInfoVo">
-        select siteUser.*,dic_userRole.Name as userTypeName,dic_gender.Name as genderName  from pc_site_user siteUser
+        select siteUser.*,dic_userRole.Name as RoleName,dic_gender.Name as GenderName  from pc_site_user siteUser
         left join (select * from sys_dictionary_item where DictionaryCode ='SiteUserRole' ) dic_userRole  on siteUser.RoleID = dic_userRole.Value
         left join (select * from sys_dictionary_item where DictionaryCode ='Gender' ) dic_gender  on siteUser.Gender = dic_gender.Value
         where 1=1
@@ -15,4 +15,13 @@
 
     </select>
 
+    <select id="getListBySiteID" resultType="com.hz.employmentsite.vo.baseSettings.UserInfoVo">
+        select siteUser.*,dic_userRole.Name as RoleName,dic_gender.Name as GenderName from pc_site_user siteUser
+        left join (select * from sys_dictionary_item where DictionaryCode ='SiteUserRole' ) dic_userRole  on siteUser.RoleID = dic_userRole.Value
+        left join (select * from sys_dictionary_item where DictionaryCode ='Gender' ) dic_gender  on siteUser.Gender = dic_gender.Value
+        where 1=1
+        <if test="siteID!='' and siteID!=null">
+            and siteID = #{siteID}
+        </if>
+    </select>
 </mapper>

+ 13 - 0
vue/src/api/baseSettings/userInfo.ts

@@ -27,6 +27,19 @@ export function getSiteUserDataList(){
   );
 }
 
+export function getListBySiteID(params: any) {
+  return request<object>(
+    {
+      url: "userInfo/getListBySiteID",
+      method: 'post',
+      params: params,
+    },
+    {
+      isNew: true,
+    },
+  );
+}
+
 export function getSiteUserByID(siteUserID: string) {
   return request<object>(
     {

+ 62 - 91
vue/src/views/baseSettings/institution/edit.vue

@@ -10,58 +10,57 @@
     cancel-text="取消"
     :keyboard="false"
     :mask-closable="false"  >
-    <a-form  autocomplete="off" >
+    <a-form :model="dataModel" autocomplete="off">
       <a-divider orientation="left">基础信息管理</a-divider>
       <a-row type="flex">
         <a-col :span="7">
-          <a-form-item label="企业名称" name="CompanyName" :label-col="{span:7}">
-            <label v-if="isDetail">{{dataModel.companyName}}</label>
+          <a-form-item label="企业名称"  name="companyName" :label-col="{span:7}"  :rules="[{ required: true, message: '请输入企业名称!' }]">
+            <label v-if="opCategory==3">{{dataModel.companyName }}</label>
             <a-input v-model:value="dataModel.companyName" placeholder=""/>
           </a-form-item>
         </a-col>
         <a-col :span="7">
-          <a-form-item label="企业地址" name="CompanyAddress" :label-col="{span:7}">
-            <label v-if="isDetail">{{dataModel.companyAddress }}</label>
+          <a-form-item label="企业地址" name="companyAddress" :label-col="{span:7}" :rules="[{ required: true, message: '请输入企业地址!' }]">
+            <label v-if="opCategory==3">{{dataModel.companyAddress }}</label>
             <a-input v-model:value="dataModel.companyAddress" placeholder=""/>
           </a-form-item>
         </a-col>
         <a-col :span="10">
-          <a-form-item label="负责人姓名" name="DutyUserName" :label-col="{span:10}" >
-            <label v-if="isDetail">{{dataModel.fzrName}}</label>
+          <a-form-item label="负责人姓名" name="fzrName" :label-col="{span:10}" :rules="[{ required: true, message: '请输入负责人姓名!' }]">
+            <label v-if="opCategory==3">{{dataModel.fzrName}}</label>
             <a-input v-model:value="dataModel.fzrName" placeholder=""/>
-<!--            <a-date-picker  name="feedbackDate2" v-model:value="dataModel.feedbackDate"   value-format="YYYY-MM-DD" picker="date"
-                            placeholder="请选择问题反馈日期"  v-if="!isDetail"  />
-                <a-select  ref="select" v-model:value="dataModel.problemCharacteristics"
-                                   :options="problemAttrList"  :field-names="{label:'name',value:'value'}"
-                                   @change="loadData"  :allow-clear="true"  v-if="!isDetail">
-                        </a-select>-->
+            <!--<a-date-picker name="feedbackDate2" v-model:value="dataModel.feedbackDate"
+                               value-format="YYYY-MM-DD" picker="date" placeholder="请选择问题反馈日期"  />-->
+            <!--<a-select ref="select" v-model:value="dataModel.problemCharacteristics"
+                          :options="problemAttrList" :field-names="{label:'name',value:'value'}"
+                          @change="loadData"  :allow-clear="true"></a-select>-->
           </a-form-item>
         </a-col>
       </a-row>
       <a-row type="flex">
         <a-col :span="7">
-          <a-form-item label="负责人电话"  name="DutyUserMobile" :label-col="{span:7}">
-            <label v-if="isDetail">{{dataModel.fzrMobile }}</label>
+          <a-form-item label="负责人电话"  name="fzrMobile" :label-col="{span:7}" :rules="[{ required: true, message: '请输入负责人电话!' }]">
+            <label v-if="opCategory==3">{{dataModel.fzrMobile }}</label>
             <a-input v-model:value="dataModel.fzrMobile" placeholder=""/>
           </a-form-item>
         </a-col>
         <a-col :span="7">
-          <a-form-item label="法人姓名"  name="LegalerName" :label-col="{span:7}">
-            <label v-if="isDetail">{{dataModel.frName }}</label>
+          <a-form-item label="法人姓名"  name="frName" :label-col="{span:7}" :rules="[{ required: true, message: '请输入法人姓名!' }]">
+            <label v-if="opCategory==3">{{dataModel.frName }}</label>
             <a-input v-model:value="dataModel.frName" placeholder=""/>
           </a-form-item>
         </a-col>
         <a-col :span="10">
-          <a-form-item label="法人电话"  name="LegalerMobile" :label-col="{span:10}">
-            <label v-if="isDetail">{{dataModel.frMobile }}</label>
+          <a-form-item label="法人电话"  name="frMobile" :label-col="{span:10}" :rules="[{ required: true, message: '请输入法人电话!' }]">
+            <label v-if="opCategory==3">{{dataModel.frMobile }}</label>
             <a-input v-model:value="dataModel.frMobile" placeholder=""/>
           </a-form-item>
         </a-col>
       </a-row>
       <a-row type="flex">
         <a-col :span="7">
-          <a-form-item label="企业机构代码"  name="CompanyCode" :label-col="{span:7}">
-            <label v-if="isDetail">{{dataModel.companyCode }}</label>
+          <a-form-item label="企业机构代码"  name="companyCode" :label-col="{span:7}" :rules="[{ required: true, message: '请输入企业机构代码!' }]">
+            <label v-if="opCategory==3">{{dataModel.companyCode }}</label>
             <a-input v-model:value="dataModel.companyCode" placeholder=""/>
           </a-form-item>
         </a-col>
@@ -113,12 +112,12 @@
       </a-row>
       <a-divider orientation="left">其他</a-divider>
       <a-row>
-        <a-textarea :auto-size="{ minRows: 4, maxRows: 10 }"  v-model:value="dataModel.companyDesc"  :disabled="isDetail"
+        <a-textarea :auto-size="{ minRows: 4, maxRows: 10 }"  v-model:value="dataModel.companyDesc" :disabled="opCategory==3"
                     placeholder="企业简介" style="text-align: center;" />
       </a-row>
       <a-row style="height: 10px"></a-row>
       <a-row>
-        <a-textarea :auto-size="{ minRows: 4, maxRows: 10 }"  v-model:value="dataModel.remarkDesc"  :disabled="isDetail"
+        <a-textarea :auto-size="{ minRows: 4, maxRows: 10 }"  v-model:value="dataModel.remarkDesc"  :disabled="opCategory==3"
                     placeholder="备注" style="text-align: center;" />
       </a-row>
     </a-form>
@@ -148,13 +147,12 @@ export default defineComponent({
   setup(props) {
     /*const feedbackDateDetail = ref();
     const resolveDateDetail = ref();*/
-    const formData = reactive<InstitutionModel>({ dataModel:{}});
-    const visible = ref<boolean>(false);
-    const confirmLoading = ref<boolean>(false);
     const title = ref();
+    const opCategory = ref<any>();
+    const visible = ref<boolean>(false);
     const isAllowCommit = ref<boolean>(false);
-    const isDetail = ref<boolean>(false);
-    const isAllowAdd = ref<boolean>(true);
+    const confirmLoading = ref<boolean>(false);
+    const formData = reactive<InstitutionModel>({ dataModel:{}});
     const pageParams = reactive({
       pageIndex: 1,
       pageSize: 10,
@@ -173,11 +171,19 @@ export default defineComponent({
       showSizeChanger: true,
       showTotal: total => getPaginationTotalTitle(total)
     }));
+    const onSelectChange = (selectedRowKeys: any) => {
+      formState.selectedRowKeys = selectedRowKeys;
+    };
+    const handleTableChange: TableProps['onChange'] = (pag: { pageSize: number; current: number },) => {
+      pageParams.pageIndex = pag.current;
+      pageParams.pageSize = pag.pageSize;
+    };
     const formState = reactive({
       total: 0,
       selectedRowKeys: [],
       loading: false
     });
+
     const allSites = ref<any>([]);
     const manageSites = ref<any>([]);
 
@@ -191,9 +197,9 @@ export default defineComponent({
       });
     }
 
-    const show = (id: any,method:string,ifDetail:boolean) => {
+    const show = (id: any,method:string,category:any) => {
       title.value ="运营机构管理-"+method;
-      isDetail.value = ifDetail;
+      opCategory.value = category;
       loadData(id);
       visible.value = true;
     };
@@ -217,7 +223,7 @@ export default defineComponent({
       if(allSites.value.length >0){
         const newSite = allSites.value[0];
         (manageSites.value as any[]).push({siteID:newSite.siteID,siteName:newSite.siteName,detailAddress:newSite.detailAddress});
-        isAllowAdd.value = false;
+        validateSameSite();
       }else{
         message.error("未查询到站点信息!");
       }
@@ -227,66 +233,34 @@ export default defineComponent({
       validateSameSite();
     }
 
-    const handleTableChange: TableProps['onChange'] = (pag: { pageSize: number; current: number },) => {
-      pageParams.pageIndex = pag.current;
-      pageParams.pageSize = pag.pageSize;
-    };
-
-    const onSelectChange = (selectedRowKeys: any) => {
-      formState.selectedRowKeys = selectedRowKeys;
-    };
-
     const manageSitesChange = (index:any,siteID:any) =>{
-      isAllowAdd.value = true
-      console.log('manageSite',manageSites.value);
       getSiteByID(siteID).then((result :any)=> {
         manageSites.value[index]= result;
+        console.log("result",result);
+        console.log("manageSites",manageSites.value);
+        validateSameSite();
       });
-      /*validateSameSite();*/
     }
 
     const validateSameSite = ()=>{
-      console.log("manageSites",manageSites.value);
-      manageSites.value.forEach(item=>{
-        const sameData = manageSites.value.filter(x => x.siteID == item.siteID);
-        console.log("sameData",sameData);
-        if (sameData.value.length >1){
-          isAllowAdd.value = false;
-        }
-      });
+      isAllowCommit.value = true;
+      if(manageSites.value.length>1){
+        manageSites.value.forEach(item=>{
+          const sameData = manageSites.value.filter(x => x.siteID == item.siteID);
+          console.log("sameData",sameData);
+          if (sameData.length >1){
+            isAllowCommit.value = false;
+          }
+        });
+      }
+      if (!isAllowCommit.value){
+        message.error("不允许添加相同的站点!");
+      }
     }
 
-    const validateCommit = ()  =>{
-        if (!isAllowAdd.value){
-          message.error("不允许添加相同的站点!");
-          return;
-        }else if (formData.dataModel.companyName==null) {
-          message.error("请输入企业名称!");
-          return;
-        }else if (formData.dataModel.companyAddress==null) {
-          message.error("请输入企业地址!");
-          return;
-        }else if (formData.dataModel.fzrName==null) {
-          message.error("请输入负责人名称!");
-          return;
-        }else if (formData.dataModel.fzrMobile==null) {
-          message.error("请填写负责人电话!");
-          return;
-        }else if (formData.dataModel.frName==null) {
-          message.error("请填写法人姓名!");
-          return;
-        }else if (formData.dataModel.frMobile==null) {
-          message.error("请填写法人电话!");
-          return;
-        }else if (formData.dataModel.companyCode==null) {
-          message.error("请填写企业机构代码!");
-          return;
-        }
-        isAllowCommit.value = true;
-    };
-
     const handleOk = () => {
-      validateCommit();
+      validateSameSite();
+      if (formData.dataModel.name == "")isAllowCommit.value=false;
       if (isAllowCommit.value){
         formData.dataModel.manageSites = manageSites.value;
         saveInstitution(formData.dataModel).then(result => {
@@ -304,20 +278,19 @@ export default defineComponent({
 
     return {
       ...toRefs(formData),
-      pageParams,
+      title,
+      visible,
+      opCategory,
+      confirmLoading,
       columns,
+      pageParams,
       pagination,
       formState,
       allSites,
       manageSites,
+      isAllowCommit,
       /*feedbackDateDetail,
       resolveDateDetail,*/
-      isAllowCommit,
-      isAllowAdd,
-      isDetail,
-      visible,
-      title,
-      confirmLoading,
       show,
       getAllSites,
       GetManageSites,
@@ -327,9 +300,7 @@ export default defineComponent({
       onSelectChange,
       manageSitesChange,
       handleOk,
-      handleCancel,
-      validateCommit,
-      validateSameSite
+      handleCancel
     };
   },
   created() {

+ 5 - 6
vue/src/views/baseSettings/institution/index.vue

@@ -70,9 +70,8 @@
       <a-row class="edit-operation">
         <a-col :span="24" style="text-align: right">
 <!--functioncode="T014001"-->
-          <a-button type="primary" html-type="submit" @click='onOperates(null,"新增",false)' >新增</a-button>
-<!--          <BExportExcel :title="'导出'" :filename="'问题台账记录'" :url="'stitution/export'"
-                        :params="{...searchParams,isExport: true, rows:100000}"></BExportExcel>-->
+          <a-button type="primary" html-type="submit" @click='onOperates(null,"新增",1)' >新增</a-button>
+          <BExportExcel :title="'导出'" :filename="'运营机构信息'" :url="'/institution/export'" :params="{...searchParams, rows:100000}"></BExportExcel>
         </a-col>
       </a-row>
     </a-form>
@@ -86,7 +85,7 @@
         <template #bodyCell="{ column, text, record }">
           <template v-if="column.key === 'operation'">
             <div class="table-operation">
-              <a-button type="link" size="small" @click='onOperates(record.institutionID,"修改",false)' >编辑</a-button>
+              <a-button type="link" size="small" @click='onOperates(record.institutionID,"修改",2)' >编辑</a-button>
               <a-button type="link" size="small" @click="onDel(record)" >删除</a-button>
             </div>
           </template>
@@ -207,8 +206,8 @@ export default defineComponent({
       });
     };
 
-    const onOperates = (id: string,operation:string,isDetail:boolean) => {
-      institutionEditModelRef.value.show(id,operation,isDetail);
+    const onOperates = (id: string,operation:string,opCategory:any) => {
+      institutionEditModelRef.value.show(id,operation,opCategory);
     };
 
     return {

+ 196 - 70
vue/src/views/baseSettings/site/edit.vue

@@ -10,88 +10,137 @@
     cancel-text="取消"
     :keyboard="false"
     :mask-closable="false"  >
-    <a-form  autocomplete="off" >
+    <a-form :model="dataModel" autocomplete="off" >
       <a-divider orientation="left">基础信息管理</a-divider>
       <a-row type="flex">
         <a-col :span="7">
-          <a-form-item label="驿站编号" name="SiteCode" :label-col="{span:7}">
-            <label v-if="isDetail">{{dataModel.siteCode}}</label>
+          <a-form-item label="驿站编号" name="siteCode" :label-col="{span:7}" :rules="[{ required: true, message: '请输入驿站编号!' }]">
+            <label v-if="opCategory==3">{{dataModel.siteCode}}</label>
             <a-input v-model:value="dataModel.siteCode" placeholder=""/>
           </a-form-item>
         </a-col>
-        <a-col :span="7">
-          <a-form-item label="站点名称" name="SiteName" :label-col="{span:7}">
-            <label v-if="isDetail">{{dataModel.siteName }}</label>
+        <a-col :span="8">
+          <a-form-item label="站点名称" name="siteName" :label-col="{span:6}" :rules="[{ required: true, message: '请输入站点名称!' }]">
+            <label v-if="opCategory==3">{{dataModel.siteName }}</label>
             <a-input v-model:value="dataModel.siteName" placeholder=""/>
           </a-form-item>
         </a-col>
-        <a-col :span="10">
-          <a-form-item label="所属机构" name="InstitutionName" :label-col="{span:10}" >
-            <label v-if="isDetail">{{dataModel.institutionName}}</label>
-            <a-select v-if ="!isDetail" ref="select" v-model:value="dataModel.institutionID" :options="institutionList"
+        <a-col :span="8">
+          <a-form-item label="所属机构" name="institutionName" :label-col="{span:6}" :rules="[{ required: true, message: '请选择所属机构!' }]">
+            <label v-if="opCategory==3">{{dataModel.institutionName}}</label>
+            <a-select  ref="select" v-model:value="dataModel.institutionID" :options="institutionList"
                       :field-names="{ label: 'text', value: 'value' }" :allow-clear="true" > </a-select>
-<!--            <a-input v-model:value="dataModel.institutionName" placeholder=""/>-->
           </a-form-item>
         </a-col>
       </a-row>
       <a-row type="flex">
         <a-col :span="7">
-          <a-form-item label="所属县区"  name="RegionCode" :label-col="{span:7}">
-            <label v-if="isDetail">{{dataModel.regionCode}}</label>
-            <a-select v-if ="!isDetail" ref="select" v-model:value="dataModel.regionCode" :options="regionList"
-              :field-names="{ label: 'name', value: 'code' }" :allow-clear="true" @change="getStreetList('')" > </a-select>
+          <a-form-item label="所属县区"  name="regionCode" :label-col="{span:7}" :rules="[{ required: true, message: '请选择所属县区!' }]">
+            <label v-if="opCategory==3">{{dataModel.regionCode}}</label>
+            <a-select ref="select" v-model:value="dataModel.regionCode" :options="regionList"
+              :field-names="{ label: 'name', value: 'code' }" :allow-clear="true" @change="getStreetList()" > </a-select>
           </a-form-item>
         </a-col>
-        <a-col :span="7">
-          <a-form-item label="所属街道"  name="StreetCode" :label-col="{span:7}">
-            <label v-if="isDetail">{{dataModel.streetCode }}</label>
-            <a-select  v-if ="!isDetail" ref="select" v-model:value="dataModel.streetCode" :options="streetList"
+        <a-col :span="8">
+          <a-form-item label="所属街道"  name="streetCode" :label-col="{span:6}" :rules="[{ required: true, message: '请选择所属街道!' }]">
+            <label v-if="opCategory==3">{{dataModel.streetCode }}</label>
+            <a-select ref="select" v-model:value="dataModel.streetCode" :options="streetList"
               :field-names="{ label: 'name', value: 'code' }" :allow-clear="true" > </a-select>
           </a-form-item>
         </a-col>
-        <a-col :span="10">
-          <a-form-item label="详细地址"  name="DetailAddress" :label-col="{span:10}">
-            <label v-if="isDetail">{{dataModel.detailAddress }}</label>
+        <a-col :span="8">
+          <a-form-item label="详细地址"  name="detailAddress" :label-col="{span:6}" :rules="[{ required: true, message: '请输入详细地址!' }]">
+            <label v-if="opCategory==3">{{dataModel.detailAddress }}</label>
             <a-input v-model:value="dataModel.detailAddress" placeholder=""/>
           </a-form-item>
         </a-col>
       </a-row>
       <a-row type="flex">
         <a-col :span="7">
-          <a-form-item label="站点负责人"  name="FzrName" :label-col="{span:7}">
-            <label v-if="isDetail">{{dataModel.fzrName }}</label>
+          <a-form-item label="站点负责人"  name="fzrName" :label-col="{span:7}" :rules="[{ required: true, message: '请输入站点负责人!' }]">
+            <label v-if="opCategory==3">{{dataModel.fzrName }}</label>
             <a-input v-model:value="dataModel.fzrName" placeholder=""/>
           </a-form-item>
         </a-col>
-        <a-col :span="7">
-          <a-form-item label="联系电话"  name="FzrMobile" :label-col="{span:7}">
-            <label v-if="isDetail">{{dataModel.fzrMobile }}</label>
+        <a-col :span="8">
+          <a-form-item label="联系电话"  name="fzrMobile" :label-col="{span:6}" :rules="[{ required: true, message: '请输入联系电话!' }]">
+            <label v-if="opCategory==3">{{dataModel.fzrMobile }}</label>
             <a-input v-model:value="dataModel.fzrMobile" placeholder=""/>
           </a-form-item>
         </a-col>
-        <a-col :span="10">
-          <a-form-item label="驿站坐标"  name="SiteXY" :label-col="{span:10}">
-            <label v-if="isDetail">{{dataModel.sitePosition}}</label>
+        <a-col :span="7">
+          <a-form-item label="驿站坐标"  name="sitePosition" :label-col="{span:7}" :rules="[{ required: true, message: '请选择驿站坐标!' }]">
+            <label v-if="opCategory==3">{{dataModel.sitePosition}}</label>
             <a-input v-model:value="dataModel.sitePosition" placeholder=""/>
           </a-form-item>
         </a-col>
+        <a-col :span="1">
+            <a-button type="primary"  @click='' >选择</a-button>
+        </a-col>
+      </a-row>
+      <a-divider orientation="left">管理人员 共计:{{manageUsers.length}}</a-divider>
+      <a-row>
+        <a-col :span="24" style="text-align: right; margin-top: 20px; margin-right: 20px">
+          <Space>
+            <a-button @click="addSiteUser">
+              <template #icon>
+                <plus-circle-outlined/>
+              </template>
+              新增
+            </a-button>
+          </Space>
+        </a-col>
+      </a-row>
+      <a-row>
+        <a-col style="margin-bottom: 20px;">
+          <a-table :columns="columns" :data-source="manageUsers" :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 === 'name'">
+                <div>
+                  <a-select
+                    ref="select"
+                    v-model:value="manageUsers[index][column.key]"
+                    :options="allUsers"
+                    @change="manageUsersChange(index,manageUsers[index][column.key])"
+                    :field-names="{ label: 'name', value: 'siteUserID' }" style="width: 200px" >
+                  </a-select>
+                </div>
+              </template>
+              <template v-if="column.key === 'genderName'">
+                {{manageUsers[index][column.key]}}
+              </template>
+              <template v-if="column.key === 'roleName'">
+                {{manageUsers[index][column.key]}}
+              </template>
+              <template v-if="column.key === 'operation'">
+                <a-button type="link" size="small" @click="delSiteUser(index)">删除</a-button>
+              </template>
+            </template>
+          </a-table>
+        </a-col>
       </a-row>
       <a-divider orientation="left">其他信息</a-divider>
       <a-row>
-        <a-textarea :auto-size="{ minRows: 4, maxRows: 10 }"  v-model:value="dataModel.remarkDesc"  :disabled="isDetail"
+        <a-textarea :auto-size="{ minRows: 4, maxRows: 10 }"  v-model:value="dataModel.remark"  :disabled="opCategory==3"
                     placeholder="备注" style="text-align: center;" />
       </a-row>
     </a-form>
   </a-modal>
 </template>
 <script lang="ts">
-import {defineComponent, reactive, ref, toRefs} from "vue";
+import {computed, defineComponent, reactive, ref, toRefs} from "vue";
 import {getSiteByID, saveSite} from "@/api/baseSettings/siteInfo";
 import BUploadFile from "@/components/file/uploadFile.vue";
-import {message, SelectProps} from "ant-design-vue";
+import {message, SelectProps, TableColumnsType, TableProps} from "ant-design-vue";
 import {getRegionCodeList, getStreetCodeList} from "@/api/system/area/index";
-import {getSiteUserDataList} from "@/api/baseSettings/userInfo";
+import {getSiteUserList,getSiteUserDataList,getListBySiteID, getSiteUserByID} from "@/api/baseSettings/userInfo";
 import {getInstitutionDataList} from "@/api/baseSettings/institution";
+import {getPaginationTotalTitle} from "@/utils/common";
 
 interface siteModel {
   dataModel: any;
@@ -106,32 +155,61 @@ export default defineComponent({
     }
   },
   setup(props) {
-    const formData = reactive<siteModel>({ dataModel:{}});
     const visible = ref<boolean>(false);
+    const isAllowCommit = ref<boolean>(false);
     const confirmLoading = ref<boolean>(false);
     const title = ref();
-    const isAllowCommit = ref<boolean>(false);
-    const isDetail = ref<boolean>(false);
+    const opCategory = ref<any>();
     const formState = reactive({
       total: 0,
       selectedRowKeys: [],
       loading: false
     });
+    const formData = reactive<siteModel>({ dataModel:{}});
+    const pageParams = reactive({
+      pageIndex: 1,
+      pageSize: 10,
+      siteID:''
+    });
+    const columns: TableColumnsType = [
+      {title: '序号', align: "center",key: 'siteUserID',customRender: item => `${pageParams.pageSize * (pageParams.pageIndex - 1) + item.index + 1}`},
+      {title: '姓名', dataIndex: 'name', key: 'name', align: "center"},
+      {title: '性别', dataIndex: 'genderName', key: 'genderName', align: "center"},
+      {title: '角色', dataIndex: 'roleName', key: 'roleName', align: "center"},
+      {title: '操作', key: 'operation', fixed: 'right',width:170, align: "center"},
+    ];
+    const pagination = computed(() => ({
+      total: formState.total,
+      current: pageParams.pageIndex,
+      pageSize: pageParams.pageSize,
+      showSizeChanger: true,
+      showTotal: total => getPaginationTotalTitle(total)
+    }));
+    const onSelectChange = (selectedRowKeys: any) => {
+      formState.selectedRowKeys = selectedRowKeys;
+    };
+    const handleTableChange: TableProps['onChange'] = (pag: { pageSize: number; current: number },) => {
+      pageParams.pageIndex = pag.current;
+      pageParams.pageSize = pag.pageSize;
+    };
 
     const regionList = ref<SelectProps['options']>();
     const streetList = ref<SelectProps['options']>();
     const siteUserList = ref<SelectProps['options']>();
     const institutionList = ref<SelectProps["options"]>();
 
+    const manageUsers = ref<any>([]);
+    const allUsers = ref<any>([]);
+
     const getRegionList = async function(){
       const regionResult: any = await getRegionCodeList();
       regionList.value = regionResult;
     }
-    const getStreetList = async function(regionCode: string){
-      const streetResult: any = await getStreetCodeList(regionCode);
+    const getStreetList = async function(){
+      const streetResult: any = await getStreetCodeList(formData.dataModel.regionCode);
       streetList.value = streetResult;
     }
-    const getSiteUserList = async function(){
+    const getUserDataList = async function(){
       const siteUserResult :any = await getSiteUserDataList();
       console.log('siteUserResult',siteUserResult);
       siteUserList.value = siteUserResult;
@@ -146,41 +224,83 @@ export default defineComponent({
       getSiteByID(siteID).then((result: any) => {
         formData.dataModel = result;
         console.log("dataModel",formData.dataModel);
+        getManageUsers(formData.dataModel.siteID);
         if (formData.dataModel.regionCode != null){
-          getStreetList(formData.dataModel.regionCode);
+          getStreetList();
         }
         if (formData.dataModel.siteX !=null && formData.dataModel.siteY != null){
           formData.dataModel.sitePosition = "X:"+formData.dataModel.siteX+" Y:"+formData.dataModel.siteX;
         }
       });
     }
-
-    const show = (id: any,method:string,ifDetail:boolean) => {
-      isDetail.value = ifDetail;
-      loadData(id);
+    const show = (id: any,method:string,category:any) => {
       title.value ="驿站站点管理-"+method;
+      opCategory.value = category;
+      getAllUsers();
+      getRegionList();
+      getInstitutionList();
+      getUserDataList();
+      loadData(id);
       visible.value = true;
     };
 
-    const onSelectChange = (selectedRowKeys: any) => {
-      formState.selectedRowKeys = selectedRowKeys;
-    };
+    const getAllUsers = () => {
+      pageParams.siteID = '';
+      getSiteUserList(pageParams).then((result :any) => {
+        allUsers.value = result.list;
+        console.log('allUsers',allUsers);
+      })
+    }
+    const getManageUsers = (id: string) => {
+      pageParams.siteID = id;
+      getListBySiteID(pageParams).then((result :any)=> {
+        manageUsers.value = result.list;
+      });
+    }
 
-    const validate = () => {
-      console.log(formData.dataModel);
-      if (formData.dataModel.siteCode==null) {
-        message.error("请输入驿站编号!");
-        return;
-      }else if (formData.dataModel.detailAddress==null) {
-        message.error("请填写详细地址!");
-        return;
+    const addSiteUser = () => {
+      if(allUsers.value.length >0){
+        const newUser = allUsers.value[0];
+        (manageUsers.value as any[]).push({siteUserID:newUser.siteUserID,siteID:formData.dataModel.siteID,name:newUser.name,genderName:newUser.genderName,roleName:newUser.roleName});
+        validateSameUser();
+      }else{
+        message.error("未查询到站点信息!");
       }
+    }
+    const delSiteUser = (site) =>{
+      (manageUsers.value as any[]).splice(site, 1);
+      validateSameUser();
+    }
+    const manageUsersChange = (index:any,siteUserID:any) =>{
+      console.log('siteUserID',siteUserID);
+      getSiteUserByID(siteUserID).then((result :any)=> {
+        result.siteID = formData.dataModel.siteID;
+        manageUsers.value[index]= result;
+        console.log('manageUsers',manageUsers.value);
+        validateSameUser();
+      });
+    }
+
+    const validateSameUser = ()=>{
       isAllowCommit.value = true;
-    };
+      if (manageUsers.value.length>1){
+        manageUsers.value.forEach(item=>{
+          const sameData = manageUsers.value.filter(x => x.siteUserID == item.siteUserID);
+          console.log("sameData",sameData);
+          if (sameData.length >1){
+            isAllowCommit.value = false;
+          }
+        });
+      }
+      if (!isAllowCommit.value){
+        message.error("不允许添加相同的人员!");
+      }
+    }
 
     const handleOk = () => {
-      validate();
+      validateSameUser();
       if (isAllowCommit.value){
+        formData.dataModel.manageUsers = manageUsers.value;
         saveSite(formData.dataModel).then(result => {
           if (result) {
             visible.value = false;
@@ -196,31 +316,37 @@ export default defineComponent({
 
     return {
       ...toRefs(formData),
+      title,
+      opCategory,
+      visible,
       formState,
+      isAllowCommit,
+      confirmLoading,
+      columns,
+      pageParams,
+      pagination,
       regionList,
       streetList,
       siteUserList,
       institutionList,
-      isAllowCommit,
-      isDetail,
-      visible,
-      title,
-      confirmLoading,
+      allUsers,
+      manageUsers,
       show,
+      onSelectChange,
+      handleTableChange,
       getRegionList,
       getStreetList,
-      getSiteUserList,
+      getUserDataList,
       getInstitutionList,
-      onSelectChange,
+      getAllUsers,
+      addSiteUser,
+      delSiteUser,
+      manageUsersChange,
       handleOk,
-      handleCancel,
-      validate
+      handleCancel
     };
   },
   created() {
-    this.getRegionList();
-    this.getInstitutionList();
-    this.getSiteUserList();
   },
 })
 </script>

+ 5 - 6
vue/src/views/baseSettings/site/index.vue

@@ -55,9 +55,8 @@
       </a-row>
       <a-row class="edit-operation">
         <a-col :span="24" style="text-align: right">
-          <a-button type="primary" html-type="submit" @click='onOperates(null,"新增",false)' >新增</a-button>
-          <a-button type="primary" >驿站地图</a-button>
-          <a-button type="primary" >导出</a-button>
+          <a-button type="primary" html-type="submit" @click='onOperates(null,"新增",1)' >新增</a-button>
+          <BExportExcel :title="'导出'" :filename="'驿站站点信息'" :url="'/siteInfo/export'" :params="{...searchParams, rows:100000}"></BExportExcel>
         </a-col>
       </a-row>
     </a-form>
@@ -71,7 +70,7 @@
         <template #bodyCell="{ column, text, record }">
           <template v-if="column.key === 'operation'">
             <div class="table-operation">
-              <a-button type="link" size="small" @click='onOperates(record.siteID.toString(),"修改",false)' >编辑</a-button>
+              <a-button type="link" size="small" @click='onOperates(record.siteID.toString(),"修改",2)' >编辑</a-button>
               <a-button type="link" size="small" @click="onDel(record)" >删除</a-button>
             </div>
           </template>
@@ -194,8 +193,8 @@ export default defineComponent({
       });
     };
 
-    const onOperates = (id: string,operation:string,isDetail:boolean) => {
-      siteInfoEditModelRef.value.show(id,operation,isDetail);
+    const onOperates = (id: string,operation:string,opCategory:any) => {
+      siteInfoEditModelRef.value.show(id,operation,opCategory);
     };
     const loadData = async function () {
       formState.loading = true;

+ 32 - 56
vue/src/views/baseSettings/user/edit.vue

@@ -4,40 +4,39 @@
     v-model:visible="visible"
     :title="title"
     :confirm-loading="confirmLoading"
-    @ok="handleOk"
     ok-text="提交"
     @cancel="handleCancel"
     cancel-text="取消"
     :keyboard="false"
     :mask-closable="false"  >
-    <a-form  autocomplete="off" >
+    <a-form :model="dataModel" autocomplete="off" @finish="handleOk">
       <a-divider orientation="left">基础信息</a-divider>
       <a-row type="flex">
         <a-col :span="7">
-          <a-form-item label="姓名" name="Name" :label-col="{span:7}">
-            <label v-if="isDetail">{{dataModel.name}}</label>
+          <a-form-item label="姓名" name="name" :label-col="{span:7}" :rules="[{ required: true, message: '请输入人员姓名!' }]">
+            <label v-if="opCategory==3">{{dataModel.name}}</label>
             <a-input v-model:value="dataModel.name" placeholder=""/>
           </a-form-item>
         </a-col>
         <a-col :span="7">
-          <a-form-item label="性别" name="Gender" :label-col="{span:7}">
-            <label v-if="isDetail">{{dataModel.gender }}</label>
-            <a-select v-if ="!isDetail" ref="select" v-model:value="dataModel.gender" :options="genderList"
+          <a-form-item label="性别" name="gender" :label-col="{span:7}" :rules="[{required: true, message: '请选择人员性别!' }]">
+            <label v-if="opCategory==3">{{dataModel.gender}}</label>
+            <a-select ref="select" v-model:value="dataModel.gender" :options="genderList"
                       :field-names="{ label: 'name', value: 'value' }" :allow-clear="false" > </a-select>
           </a-form-item>
         </a-col>
         <a-col :span="10">
-          <a-form-item label="联系电话" name="Mobile" :label-col="{span:10}" >
-            <label v-if="isDetail">{{dataModel.mobile}}</label>
+          <a-form-item label="联系电话" name="mobile" :label-col="{span:10}" :rules="[{ required: true, message: '请输入联系电话!' }]" >
+            <label v-if="opCategory==3">{{dataModel.mobile}}</label>
             <a-input v-model:value="dataModel.mobile" placeholder=""/>
           </a-form-item>
         </a-col>
       </a-row>
       <a-row type="flex">
         <a-col :span="7">
-          <a-form-item label="角色"  name="RoleID" :label-col="{span:7}">
-            <label v-if="isDetail">{{dataModel.roleID }}</label>
-            <a-select v-if ="!isDetail" ref="select" v-model:value="dataModel.roleID" :options="roleList"
+          <a-form-item label="角色"  name="roleID" :label-col="{span:7}" :rules="[{ required: true, message: '请选择人员角色!' }]">
+            <label v-if="opCategory==3">{{dataModel.roleID }}</label>
+            <a-select ref="select" v-model:value="dataModel.roleID" :options="roleList"
                       :field-names="{ label: 'name', value: 'value' }" :allow-clear="false" > </a-select>
           </a-form-item>
         </a-col>
@@ -55,7 +54,7 @@
 import {defineComponent, reactive, ref, toRefs} from "vue";
 import {getSiteUserByID, saveSiteUser} from "@/api/baseSettings/userInfo";
 import BUploadFile from "@/components/file/uploadFile.vue";
-import {message, SelectProps} from "ant-design-vue";
+import type {SelectProps} from "ant-design-vue";
 import {getSysDictionaryList} from "@/api/system/dictionary";
 
 interface InstitutionModel {
@@ -75,8 +74,7 @@ export default defineComponent({
     const visible = ref<boolean>(false);
     const confirmLoading = ref<boolean>(false);
     const title = ref();
-    const isAllowCommit = ref<boolean>(false);
-    const isDetail = ref<boolean>(false);
+    const opCategory = ref<any>();
     const formState = reactive({
       total: 0,
       selectedRowKeys: [],
@@ -84,6 +82,14 @@ export default defineComponent({
     });
     const genderList =  ref<SelectProps["options"]>();
     const roleList =  ref<SelectProps["options"]>();
+    const getGenderList = async function(){
+      const genderResult :any = await getSysDictionaryList("Gender");
+      genderList.value = genderResult;
+    }
+    const getRoleList = async function(){
+      const roleResult :any = await getSysDictionaryList("SiteUserRole");
+      roleList.value = roleResult;
+    }
 
     const loadData = (siteUserID: string) => {
       getSiteUserByID(siteUserID).then((result: any) => {
@@ -91,53 +97,26 @@ export default defineComponent({
         console.log(formData.dataModel);
       });
     }
-
-    const show = (id: any,method:string,ifDetail:boolean) => {
-      loadData(id);
+    const show = (id: any,method:string,category:any) => {
       title.value ="人员管理-"+method;
-      isDetail.value = ifDetail;
+      opCategory.value = category;
       getGenderList();
       getRoleList();
+      loadData(id);
       visible.value = true;
     };
 
-
-    const getGenderList = async function(){
-      const genderResult :any = await getSysDictionaryList("Gender");
-      genderList.value = genderResult;
-    }
-
-    const getRoleList = async function(){
-      const roleResult :any = await getSysDictionaryList("SiteUserRole");
-      roleList.value = roleResult;
-    }
-
     const onSelectChange = (selectedRowKeys: any) => {
       formState.selectedRowKeys = selectedRowKeys;
     };
 
-    const validate = ()  =>{
-      console.log(formData.dataModel);
-      if (formData.dataModel.name==null) {
-        message.error("请输入姓名!");
-        return;
-      }else if (formData.dataModel.mobile==null) {
-        message.error("请填写联系电话!");
-        return;
-      }
-      isAllowCommit.value = true;
-    };
-
     const handleOk = () => {
-      validate();
-      if (isAllowCommit.value){
-        saveSiteUser(formData.dataModel).then(result => {
-          if (result) {
-            visible.value = false;
-            props.loadData();
-          }
-        });
-      }
+      saveSiteUser(formData.dataModel).then(result => {
+        if (result) {
+          visible.value = false;
+          props.loadData();
+        }
+      });
     };
 
     const handleCancel = () => {
@@ -145,12 +124,10 @@ export default defineComponent({
     };
 
 
-
     return {
       ...toRefs(formData),
       formState,
-      isAllowCommit,
-      isDetail,
+      opCategory,
       visible,
       title,
       confirmLoading,
@@ -159,8 +136,7 @@ export default defineComponent({
       show,
       onSelectChange,
       handleOk,
-      handleCancel,
-      validate
+      handleCancel
     };
   },
   created() {

+ 6 - 5
vue/src/views/baseSettings/user/index.vue

@@ -20,7 +20,8 @@
 
       <a-row class="edit-operation">
         <a-col :span="24" style="text-align: right">
-          <a-button type="primary" html-type="submit" @click='onOperates(null,"新增",false)' >新增</a-button>
+          <a-button type="primary" html-type="submit" @click='onOperates(null,"新增",1)' >新增</a-button>
+          <BExportExcel :title="'导出'" :filename="'驿站人员信息'" :url="'/userInfo/export'" :params="{...searchParams, rows:100000}"></BExportExcel>
         </a-col>
       </a-row>
     </a-form>
@@ -34,7 +35,7 @@
         <template #bodyCell="{ column, text, record }">
           <template v-if="column.key === 'operation'">
             <div class="table-operation">
-              <a-button type="link" size="small" @click='onOperates(record.siteUserID.toString(),"修改",false)' >编辑</a-button>
+              <a-button type="link" size="small" @click='onOperates(record.siteUserID.toString(),"修改",2)' >编辑</a-button>
               <a-button type="link" size="small" @click="onDel(record)" >删除</a-button>
             </div>
           </template>
@@ -75,7 +76,7 @@ export default defineComponent({
     const columns: TableColumnsType = [
       {title: '序号', align: "center",key: 'siteUserID',customRender: item => `${searchParams.pageSize * (searchParams.pageIndex - 1) + item.index + 1}`},
       {title: '人员名称', dataIndex: 'name', key: 'name', align: "center"},
-      {title: '角色', dataIndex: 'userTypeName', key: 'userTypeName',width:120, align: "center"},
+      {title: '角色', dataIndex: 'roleName', key: 'roleName',width:120, align: "center"},
       {title: '性别', dataIndex: 'genderName', key: 'genderName', align: "center"},
       {title: '联系电话', dataIndex: 'mobile', key: 'mobile', align: "center"},
       {title: '操作', key: 'operation', fixed: 'right',width:170, align: "center"},
@@ -134,8 +135,8 @@ export default defineComponent({
       });
     };
 
-    const onOperates = (id: string,operation:string,isDetail:boolean) => {
-      userInfoEditModelRef.value.show(id,operation,isDetail);
+    const onOperates = (id: string,operation:string,opCategory:any) => {
+      userInfoEditModelRef.value.show(id,operation,opCategory);
     };
     const loadData = async function () {
       formState.loading = true;

+ 34 - 53
vue/src/views/taskAndLog/dowork/edit.vue

@@ -10,48 +10,44 @@
     cancel-text="取消"
     :keyboard="false"
     :mask-closable="false"  >
-    <a-form  autocomplete="off" >
+    <a-form :model="dataModel" autocomplete="off" >
       <a-divider orientation="left">基础信息管理</a-divider>
       <a-row type="flex">
         <a-col :span="7">
-          <a-form-item label="姓名" name="UserName" :label-col="{span:7}">
-            <label v-if="isDetail">{{dataModel.userName}}</label>
-            <a-select v-if ="!isDetail" ref="select" v-model:value="dataModel.siteUserID" :options="siteUserList"
+          <a-form-item label="姓名" name="userName" :label-col="{span:7}" :rules="[{ required: true, message: '请选择站点人员!' }]">
+            <label v-if="opCategory==3">{{dataModel.userName}}</label>
+            <a-select ref="select" v-model:value="dataModel.siteUserID" :options="siteUserList"
                       :field-names="{ label: 'text', value: 'value' }" :allow-clear="true" > </a-select>
 <!--            <a-input v-model:value="dataModel.userName" placeholder=""/>-->
           </a-form-item>
         </a-col>
         <a-col :span="7">
-            <a-form-item label="日志类型" name="LogTypeName" :label-col="{span:7}">
-            <label v-if="isDetail">{{dataModel.logTypeName }}</label>
-              <a-select v-if ="!isDetail" ref="select" v-model:value="dataModel.doTypeID" :options="logTypeList"
+            <a-form-item label="日志类型" name="logTypeName" :label-col="{span:7}" :rules="[{ required: true, message: '请选择日志类型!' }]">
+            <label v-if="opCategory==3">{{dataModel.logTypeName }}</label>
+              <a-select ref="select" v-model:value="dataModel.doTypeID" :options="logTypeList"
                         :field-names="{ label: 'name', value: 'value' }" :allow-clear="false" > </a-select>
 <!--            <a-input v-model:value="dataModel.logTypeName" placeholder=""/>-->
           </a-form-item>
         </a-col>
         <a-col :span="10">
-          <a-form-item label="完成时间" name="WorkTime" :label-col="{span:10}" >
-            <label v-if="isDetail">{{dataModel.workTime}}</label>
-            <a-date-picker
-              v-model:value="dataModel.workTime"
-              picker="date"
-              value-format="YYYY-MM-DD"
-            />
+          <a-form-item label="完成时间" name="workTime" :label-col="{span:10}" :rules="[{ required: true, message: '请选择完成时间!' }]">
+            <label v-if="opCategory==3">{{dataModel.workTime}}</label>
+            <a-date-picker  v-model:value="dataModel.workTime" picker="date" value-format="YYYY-MM-DD" />
           </a-form-item>
         </a-col>
       </a-row>
       <a-row type="flex">
         <a-col :span="7">
-          <a-form-item label="所属县区"  name="RegionCode" :label-col="{span:7}">
-            <label v-if="isDetail">{{dataModel.regionCode}}</label>
-            <a-select v-if ="!isDetail" ref="select" v-model:value="dataModel.regionCode" :options="regionList"
-                      :field-names="{ label: 'name', value: 'code' }" :allow-clear="true" @change="getStreetList('')" > </a-select>
+          <a-form-item label="所属县区"  name="regionCode" :label-col="{span:7}" :rules="[{ required: true, message: '请选择所属县区!' }]">
+            <label v-if="opCategory==3">{{dataModel.regionCode}}</label>
+            <a-select ref="select" v-model:value="dataModel.regionCode" :options="regionList"
+                      :field-names="{ label: 'name', value: 'code' }" :allow-clear="true" @change="getStreetList()" ></a-select>
           </a-form-item>
         </a-col>
         <a-col :span="7">
-          <a-form-item label="所属街道"  name="StreetCode" :label-col="{span:7}">
-            <label v-if="isDetail">{{dataModel.streetCode }}</label>
-            <a-select  v-if ="!isDetail" ref="select" v-model:value="dataModel.streetCode" :options="streetList"
+          <a-form-item label="所属街道"  name="streetCode" :label-col="{span:7}" :rules="[{ required: true, message: '请选择所属街道!' }]">
+            <label v-if="opCategory==3">{{dataModel.streetCode }}</label>
+            <a-select  ref="select" v-model:value="dataModel.streetCode" :options="streetList"
                        :field-names="{ label: 'name', value: 'code' }" :allow-clear="true" > </a-select>
           </a-form-item>
         </a-col>
@@ -59,12 +55,12 @@
         </a-col>
       </a-row>
       <a-row>
-        <a-textarea :auto-size="{ minRows: 4, maxRows: 10 }"  v-model:value="dataModel.workContent"  :disabled="isDetail"
+        <a-textarea :auto-size="{ minRows: 4, maxRows: 10 }"  v-model:value="dataModel.workContent"  :disabled="opCategory==3"
                     placeholder="完成情况" style="text-align: center;" />
       </a-row>
       <a-divider orientation="left">其他</a-divider>
       <b-upload-file :fileRefId="dataModel.doWorkID" :readonly="false" :multiple="true"
-                     :setFileList="setFileList" :accept="'.pdf,.png,.jpg'" :disabled="isDetail"></b-upload-file>
+                     :setFileList="setFileList" :accept="'.pdf,.png,.jpg'" :disabled="opCategory==3"></b-upload-file>
 
     </a-form>
   </a-modal>
@@ -73,7 +69,7 @@
 import {defineComponent, reactive, ref, toRefs} from "vue";
 import {get, save} from "@/api/taskAndLog/dowork";
 import BUploadFile from "@/components/file/uploadFile.vue";
-import {message, SelectProps} from "ant-design-vue";
+import type {SelectProps} from "ant-design-vue";
 import {getSysDictionaryList} from "@/api/system/dictionary";
 import {getRegionCodeList, getStreetCodeList} from "@/api/system/area/index";
 import {getSiteUserDataList} from "@/api/baseSettings/userInfo";
@@ -95,8 +91,7 @@ export default defineComponent({
     const visible = ref<boolean>(false);
     const confirmLoading = ref<boolean>(false);
     const title = ref();
-    const isAllowCommit = ref<boolean>(false);
-    const isDetail = ref<boolean>(false);
+    const opCategory = ref<any>();
     const formState = reactive({
       total: 0,
       selectedRowKeys: [],
@@ -115,8 +110,8 @@ export default defineComponent({
       const regionResult: any = await getRegionCodeList();
       regionList.value = regionResult;
     }
-    const getStreetList = async function(regionCode: string){
-      const streetResult: any = await getStreetCodeList(regionCode);
+    const getStreetList = async function(){
+      const streetResult: any = await getStreetCodeList(formData.dataModel.regionCode);
       streetList.value = streetResult;
     }
     const getSiteUserList = async function(){
@@ -134,15 +129,15 @@ export default defineComponent({
         formData.dataModel = result;
         console.log(formData.dataModel);
         if (formData.dataModel.regionCode != null){
-          getStreetList(formData.dataModel.regionCode);
+          getStreetList();
         }
       });
     }
 
-    const show = (id: any,method:string,ifDetail:boolean) => {
+    const show = (id: any,method:string,category:any) => {
       loadData(id);
       title.value ="工作日志管理-"+method;
-      isDetail.value = ifDetail;
+      opCategory.value = category;
       getRegionList();
       getLogTypeList();
       getSiteUserList();
@@ -153,25 +148,13 @@ export default defineComponent({
       formState.selectedRowKeys = selectedRowKeys;
     };
 
-    const validate = ()  =>{
-      console.log(formData.dataModel);
-      if (formData.dataModel.siteUserID==null) {
-        message.error("请输入姓名!");
-        return;
-      }
-      isAllowCommit.value = true;
-    };
-
     const handleOk = () => {
-      validate();
-      if (isAllowCommit.value){
-        save(formData.dataModel).then(result => {
-          if (result) {
-            visible.value = false;
-            props.loadData();
-          }
-        });
-      }
+      save(formData.dataModel).then(result => {
+        if (result) {
+          visible.value = false;
+          props.loadData();
+        }
+      });
     };
 
     const handleCancel = () => {
@@ -181,8 +164,7 @@ export default defineComponent({
     return {
       ...toRefs(formData),
       formState,
-      isAllowCommit,
-      isDetail,
+      opCategory,
       visible,
       title,
       confirmLoading,
@@ -196,8 +178,7 @@ export default defineComponent({
       setFileList,
       onSelectChange,
       handleOk,
-      handleCancel,
-      validate
+      handleCancel
     };
   },
   created() {

+ 14 - 9
vue/src/views/taskAndLog/dowork/index.vue

@@ -56,8 +56,8 @@
       </a-row>
       <a-row class="edit-operation">
         <a-col :span="24" style="text-align: right">
-          <a-button type="primary" html-type="submit" @click='onOperates(null,"新增",false)'>新增</a-button>
-          <a-button type="primary" html-type="submit" @click='exportPost()'>导出</a-button>
+          <a-button type="primary" html-type="submit" @click='onOperates(null,"新增",1)'>新增</a-button>
+          <BExportExcel :title="'导出'" :filename="'工作日志信息'" :url="'/doWork/export'" :params="{...searchParams, rows:100000}"></BExportExcel>
         </a-col>
       </a-row>
     </a-form>
@@ -71,7 +71,7 @@
         <template #bodyCell="{ column, text, record }">
           <template v-if="column.key === 'operation'">
             <div class="table-operation">
-              <a-button type="link" size="small" @click='onOperates(record.doWorkID,"修改",false)'>编辑</a-button>
+              <a-button type="link" size="small" @click='onOperates(record.doWorkID,"修改",2)'>编辑</a-button>
               <a-button type="link" size="small" @click="onDel(record)">删除</a-button>
             </div>
           </template>
@@ -88,12 +88,13 @@ import {DownOutlined, ExclamationCircleOutlined, UpOutlined} from '@ant-design/i
 import type {FormInstance,SelectProps,TableColumnsType, TableProps} from 'ant-design-vue';
 import {getList,delWorkLog} from '@/api/taskAndLog/dowork';
 import {getRegionCodeList,getStreetCodeList} from '@/api/system/area/index';
+import {getSysDictionaryList} from "@/api/system/dictionary";
 import DoWorkEditForm from "@/views/taskAndLog/dowork/edit.vue";
 import BExportExcel from "@/components/basic/excel/exportExcel/exportExcel.vue";
 import {getPaginationTotalTitle} from "@/utils/common";
 import {message, Modal} from "ant-design-vue";
 import dayjs from 'dayjs';
-import {get} from "@/api/common";
+
 export default defineComponent({
   name: 'doTaskList',
   components: { DownOutlined, UpOutlined, BExportExcel,DoWorkEditForm},
@@ -149,9 +150,10 @@ export default defineComponent({
     const dataList = ref([]);
     const doWorkEditModelRef = ref();
 
-    get('system/dictionary/getDictionaryItemByCodeList',{code:'LogType'}).then(data=>{
-      logTypeList.value=data;
-    });
+    const getLogTypeList = async function(){
+      const logTypeResult :any = await getSysDictionaryList("LogType");
+      logTypeList.value = logTypeResult;
+    }
 
     const getRegionList = async function(){
       const regionResult: any = await getRegionCodeList();
@@ -232,8 +234,8 @@ export default defineComponent({
     const exportPost = () => {
       console.log('导出');
     }
-    const onOperates = (id: string,operation:string,isDetail:boolean) => {
-      doWorkEditModelRef.value.show(id,operation,isDetail);
+    const onOperates = (id: string,operation:string,opCategory:any) => {
+      doWorkEditModelRef.value.show(id,operation,opCategory);
     };
 
     return {
@@ -256,16 +258,19 @@ export default defineComponent({
       onDel,
       onRangeChange,
       loadData,
+      getLogTypeList,
       getRegionList,
       changeRegion
     };
   },
   created() {
+    this.getLogTypeList();
     this.getRegionList();
     this.loadData();
   },
   activated() {
     if (history.state.params?.reload)
+      this.getLogTypeList();
       this.getRegionList();
       this.loadData();
   }