Bladeren bron

Merge remote-tracking branch 'origin/master'

Liudijing 11 maanden geleden
bovenliggende
commit
b69a6477a2

+ 11 - 3
src/main/java/com/hz/employmentsite/controller/baseSettings/InstitutionController.java

@@ -3,6 +3,7 @@ package com.hz.employmentsite.controller.baseSettings;
 import com.github.pagehelper.PageInfo;
 import com.hz.employmentsite.filter.exception.BaseResponse;
 import com.hz.employmentsite.filter.exception.RespGenerstor;
+import com.hz.employmentsite.model.SelectProps;
 import com.hz.employmentsite.util.ExcelHelper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
@@ -44,18 +45,23 @@ public class InstitutionController {
 
 
     @GetMapping("get")
-    public BaseResponse<InstitutionVo> get(@RequestParam("pageIndex") int pageIndex, @RequestParam("pageSize") int pageSize, @RequestParam(required = false) String institutionID) {
+    public BaseResponse<InstitutionVo> get(@RequestParam(required = false) String institutionID) {
         InstitutionVo dataModel = new InstitutionVo();
         if (institutionID == null || institutionID == ""){
             dataModel.institutionID = UUID.randomUUID().toString();
-            dataModel.manageSites = null;
         }else{
             dataModel = institutionService.get(institutionID);
-            dataModel.manageSites = siteInfoService.getListByInstitutionID(pageIndex,pageSize,institutionID).getList();
         }
+        dataModel.manageSites = null;
         return RespGenerstor.success(dataModel);
     }
 
+    @ResponseBody
+    @GetMapping("/getDataList")
+    public BaseResponse<ArrayList<SelectProps>> getDataList() {
+        return RespGenerstor.success(institutionService.getDataList());
+    }
+
     @PostMapping("save")
     public BaseResponse<Integer> save(@RequestBody InstitutionVo data) {
         return RespGenerstor.success(institutionService.save(data,accountService.getLoginUserID()));
@@ -104,4 +110,6 @@ public class InstitutionController {
     public BaseResponse<Integer> delete(@RequestBody List<String> idList){
         return RespGenerstor.success(institutionService.delete(idList));
     }
+
+
 }

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

@@ -38,6 +38,11 @@ public class SiteInfoController {
         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));
+    }
+
     @GetMapping("get")
     public BaseResponse<SiteInfoVo> get(@RequestParam(required = false) String siteID) {
         SiteInfoVo dataModel = new SiteInfoVo();
@@ -49,6 +54,7 @@ public class SiteInfoController {
         return RespGenerstor.success(dataModel);
     }
 
+
     @PostMapping("save")
     public BaseResponse<Integer> save(@RequestBody SiteInfoVo data) {
         return RespGenerstor.success(siteService.save(data,accountService.getLoginUserID()));
@@ -56,4 +62,5 @@ public class SiteInfoController {
 
 
 
+
 }

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

@@ -0,0 +1,12 @@
+package com.hz.employmentsite.mapper.cquery;
+
+import com.hz.employmentsite.model.PcSiteInstitution; 
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+public interface SiteInstitutionCQuery {
+
+    List<PcSiteInstitution> getListByInstitutionID(@Param("institutionID") String institutionID);
+
+}

+ 23 - 0
src/main/java/com/hz/employmentsite/model/SelectProps.java

@@ -0,0 +1,23 @@
+package com.hz.employmentsite.model;
+
+public class SelectProps {
+
+    public String text;
+    public String value;
+
+    public String getText() {
+        return text;
+    }
+
+    public void setText(String text) {
+        this.text = text == null ? null : text.trim();
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value == null ? null : value.trim();
+    }
+}

+ 50 - 6
src/main/java/com/hz/employmentsite/services/impl/baseSettings/InstitutionImpl.java

@@ -3,9 +3,10 @@ package com.hz.employmentsite.services.impl.baseSettings;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import com.hz.employmentsite.mapper.PcInstitutionMapper;
+import com.hz.employmentsite.mapper.PcSiteInstitutionMapper;
 import com.hz.employmentsite.mapper.cquery.InstitutionCQuery;
-import com.hz.employmentsite.model.PcInstitution;
-import com.hz.employmentsite.model.PcInstitutionExample;
+import com.hz.employmentsite.mapper.cquery.SiteInstitutionCQuery;
+import com.hz.employmentsite.model.*;
 import com.hz.employmentsite.services.service.baseSettings.InstitutionService;
 import com.hz.employmentsite.util.StringUtils;
 import com.hz.employmentsite.vo.baseSettings.InstitutionVo;
@@ -15,12 +16,11 @@ import org.springframework.stereotype.Service;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.UUID;
 
 @Service("InstitutionService")
 public class InstitutionImpl implements InstitutionService {
 
-    @Autowired
-    private InstitutionCQuery institutionCQuery;
 
     @Autowired
     private StringUtils stringUtils;
@@ -28,6 +28,15 @@ public class InstitutionImpl implements InstitutionService {
     @Autowired
     private PcInstitutionMapper pcInstitutionMapper;
 
+    @Autowired
+    private PcSiteInstitutionMapper pcSiteInstitutionMapper;
+
+    @Autowired
+    private InstitutionCQuery institutionCQuery;
+
+    @Autowired
+    private SiteInstitutionCQuery siteInstitutionCQuery;
+
 
     @Override
     public PageInfo<InstitutionVo> getList(int pageIndex, int pageSize, String primaryKey, String companyName, String companyAddress, String dutyUserName) {
@@ -40,13 +49,26 @@ public class InstitutionImpl implements InstitutionService {
 
 
     @Override
-    public InstitutionVo get(String siteUserID) {
+    public InstitutionVo get(String institutionID) {
         List<String> ids = new ArrayList<>();
-        ids.add(siteUserID);
+        ids.add(institutionID);
         InstitutionVo model = institutionCQuery.getList(stringUtils.ListToInSql(ids),null,null ,null).stream().findFirst().orElse(null);
         return model;
     }
 
+    @Override
+    public List<SelectProps> getDataList() {
+         var dataList = getList(1,99999,null,null,null,null).getList();
+         List<SelectProps> dataResult = new ArrayList<>();
+         for (var item: dataList) {
+             SelectProps  itemResult = new SelectProps();
+             itemResult.setText(item.companyName);
+             itemResult.setValue(item.institutionID);
+             dataResult.add(itemResult);
+         }
+         return dataResult;
+    }
+
     @Override
     public Integer save(InstitutionVo data, String userId) {
         int result = 0;
@@ -82,6 +104,28 @@ public class InstitutionImpl implements InstitutionService {
             dbData.setModifyTime(new Date());
             result = pcInstitutionMapper.updateByPrimaryKey(dbData);
         }
+        /*先删除所有关联数据,再添加*/
+        var allExistData = siteInstitutionCQuery.getListByInstitutionID(data.getInstitutionID());
+        if (allExistData != null && allExistData.size() > 0){
+            for(PcSiteInstitution curLinkData : allExistData) {
+                var siteInstitutionID = curLinkData.getSiteInstitutionID();
+                result += pcSiteInstitutionMapper.deleteByPrimaryKey(siteInstitutionID);
+            }
+        }
+        if (data.manageSites.size()>0){
+            var manageSites = data.manageSites.stream().toList();
+            for (var curData: manageSites) {
+                PcSiteInstitution curLinkData = new  PcSiteInstitution();
+                curLinkData.setSiteInstitutionID(UUID.randomUUID().toString());
+                curLinkData.setSiteID(curData.siteID);
+                curLinkData.setInstitutionID(data.institutionID);
+                curLinkData.setCreateUserID(userId);
+                curLinkData.setCreateTime(new Date());
+                curLinkData.setModifyUserID(userId);
+                curLinkData.setModifyTime(new Date());
+                result += pcSiteInstitutionMapper.insert(curLinkData);
+            }
+        }
         return result;
     }
 

+ 22 - 3
src/main/java/com/hz/employmentsite/services/impl/baseSettings/SiteInfoImpl.java

@@ -4,7 +4,9 @@ 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.PcSite;
+import com.hz.employmentsite.model.PcSiteInstitution;
 import com.hz.employmentsite.services.service.baseSettings.SiteInfoService;
 import com.hz.employmentsite.util.StringUtils;
 import com.hz.employmentsite.vo.baseSettings.SiteInfoVo;
@@ -14,6 +16,7 @@ import org.springframework.stereotype.Service;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
+import java.util.UUID;
 
 @Service("SiteInfoService")
 public class SiteInfoImpl implements SiteInfoService {
@@ -21,12 +24,16 @@ public class SiteInfoImpl implements SiteInfoService {
     @Autowired
     private SiteInfoCQuery siteInfoCQuery;
 
+
     @Autowired
     private StringUtils stringUtils;
 
     @Autowired
     private PcSiteMapper pcSiteMapper;
 
+    @Autowired
+    private PcSiteInstitutionMapper pcSiteInstitutionMapper;
+
     @Override
     public PageInfo<SiteInfoVo> getList(int pageIndex, int pageSize, String primaryKey, String siteCode, String siteName, String institutionName, String regionCode, String streetCode) {
         PageHelper.startPage(pageIndex, pageSize);
@@ -57,7 +64,7 @@ public class SiteInfoImpl implements SiteInfoService {
     public Integer save(SiteInfoVo data, String userId) {
         int result = 0;
         SiteInfoVo record = get(data.siteID);
-        PcSite dbData = record ==null ? null : pcSiteMapper.selectByPrimaryKey(record.siteID);
+        PcSite dbData = record == null ? null : pcSiteMapper.selectByPrimaryKey(record.siteID);
         Boolean isExist = dbData != null;
         if (!isExist) {
             //添加
@@ -75,9 +82,18 @@ 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);
             dbData.setSiteCode(data.siteCode);
             dbData.setSiteName(data.siteName);
@@ -91,9 +107,12 @@ 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);
         }
         return result;
     }
 
-
 }

+ 4 - 0
src/main/java/com/hz/employmentsite/services/service/baseSettings/InstitutionService.java

@@ -1,8 +1,10 @@
 package com.hz.employmentsite.services.service.baseSettings;
 
 import com.github.pagehelper.PageInfo;
+import com.hz.employmentsite.model.SelectProps;
 import com.hz.employmentsite.vo.baseSettings.InstitutionVo;
 
+import java.util.ArrayList;
 import java.util.List;
 
 public interface InstitutionService {
@@ -11,6 +13,8 @@ public interface InstitutionService {
 
     InstitutionVo get(String institutionID);
 
+    List<SelectProps> getDataList();
+
     Integer save(InstitutionVo data, String userId);
 
     Integer delete(List<String> idList);

+ 2 - 0
src/main/java/com/hz/employmentsite/vo/baseSettings/SiteInfoVo.java

@@ -21,6 +21,8 @@ public class SiteInfoVo {
     public String fzrName;
     public String fzrMobile;
 
+    public String siteInstitutionID;
+    public String institutionID;
     public String institutionName;
     public Integer userCount;
 

+ 3 - 3
src/main/resources/mapping/cquery/SiteInfoCQuery.xml

@@ -2,8 +2,8 @@
 <!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.SiteInfoCQuery">
     <select id="getList" resultType="com.hz.employmentsite.vo.baseSettings.SiteInfoVo">
-        select site.*,institution.companyName as InstitutionName,COUNT(siteUser.SiteUserID)as userCount,
-               region.name as RegionName,street.name as StreetName from pc_site site
+        select site.*,inSites.InstitutionID as InstitutionID,inSites.SiteInstitutionID,institution.companyName as InstitutionName,
+        COUNT(siteUser.SiteUserID)as userCount,region.name as RegionName,street.name as StreetName from pc_site site
         left join pc_site_institution inSites on site.SiteID = inSites.SiteID
         left join pc_institution institution on inSites.institutionID = institution.InstitutionID
         left join pc_site_user siteUser on site.SiteID = siteUser.SiteID
@@ -32,7 +32,7 @@
     </select>
 
     <select id="getListByInstitutionID" resultType="com.hz.employmentsite.vo.baseSettings.SiteInfoVo">
-        select  A.* from pc_site A,pc_site_institution B,pc_institution C
+        select  A.*,B.SiteInstitutionID,C.InstitutionID from pc_site A,pc_site_institution B,pc_institution C
         where A.siteID = B.siteID and B.institutionID = C.institutionID and 1=1
         <if test="institutionID!='' and institutionID!=null">
             and C.institutionID = #{institutionID}

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

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!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.SiteInstitutionCQuery">
+    <select id="getListByInstitutionID" resultType="com.hz.employmentsite.model.PcSiteInstitution">
+        select  *  from pc_site_institution  where 1=1
+        <if test="institutionID!='' and institutionID!=null">
+            and institutionID like Concat('%',#{institutionID},'%')
+        </if>
+    </select>
+</mapper>

+ 7 - 8
vue/src/api/baseSettings/institution.ts

@@ -1,7 +1,7 @@
 import {request} from "@/utils/request";
 
 
-export function getList(params: any) {
+export function getInstitutionList(params: any) {
   return request<object>(
     {
       url: "institution/getList",
@@ -14,12 +14,12 @@ export function getList(params: any) {
   );
 }
 
-export function getDataList(params:any){
+export function getDataList(){
   return request<any>(
     {
       url: 'institution/getDataList',
       method: 'get',
-      params: params,
+      params: null,
     },
     {
       isNew: true,
@@ -27,12 +27,12 @@ export function getDataList(params:any){
   );
 }
 
-export function get(params: any) {
+export function getInstitutionByID(institutionID: string) {
   return request<object>(
     {
       url: 'institution/get',
       method: 'get',
-      params: params,
+      params: {institutionID:institutionID},
     },
     {
       isNew: true,
@@ -40,7 +40,7 @@ export function get(params: any) {
   );
 }
 
-export function save(data: any) {
+export function saveInstitution(data: any) {
   return request<object>(
     {
       url: 'institution/save',
@@ -55,8 +55,7 @@ export function save(data: any) {
   );
 }
 
-
-export function del(data: any) {
+export function delInstitution(data: any) {
   return request<object>(
     {
       url: 'institution/delete',

+ 18 - 3
vue/src/api/baseSettings/siteInfo.ts

@@ -1,7 +1,7 @@
 import {request} from "@/utils/request";
 
 
-export function getList(params: any) {
+export function getSiteList(params:any) {
   return request<object>(
     {
       url: "siteInfo/getList",
@@ -13,7 +13,22 @@ export function getList(params: any) {
     },
   );
 }
-export function get(siteID: string) {
+
+
+export function getListByInstitutionID(params: any) {
+  return request<object>(
+    {
+      url: "siteInfo/getListByInstitutionID",
+      method: 'post',
+      params: params,
+    },
+    {
+      isNew: true,
+    },
+  );
+}
+
+export function getSiteByID(siteID: string) {
   return request<object>(
     {
       url: 'siteInfo/get',
@@ -26,7 +41,7 @@ export function get(siteID: string) {
   );
 }
 
-export function save(data: any) {
+export function saveSite(data: any) {
   return request<object>(
     {
       url: 'siteInfo/save',

+ 3 - 3
vue/src/api/baseSettings/userInfo.ts

@@ -1,7 +1,7 @@
 import {request} from "@/utils/request";
 
 
-export function getList(params: any) {
+export function getSiteUserList(params: any) {
   return request<object>(
     {
       url: "userInfo/getList",
@@ -13,7 +13,7 @@ export function getList(params: any) {
     },
   );
 }
-export function get(siteUserID: string) {
+export function getSiteUserByID(siteUserID: string) {
   return request<object>(
     {
       url: 'userInfo/get',
@@ -26,7 +26,7 @@ export function get(siteUserID: string) {
   );
 }
 
-export function save(data: any) {
+export function saveSiteUser(data: any) {
   return request<object>(
     {
       url: 'userInfo/save',

+ 107 - 21
vue/src/views/baseSettings/institution/edit.vue

@@ -68,16 +68,49 @@
         <a-col :span="7"></a-col>
         <a-col :span="10"></a-col>
       </a-row>
-      <a-divider orientation="left">管理驿站 共计:{{dataModel.siteCount}}</a-divider>
+      <a-divider orientation="left">管理驿站 共计:{{manageSites.length}}</a-divider>
       <a-row>
-      <a-table :columns="columns" :data-source="dataModel.manageSites" :scroll="{ x:'100%', y: 500 }" :pagination="pagination"
-                 :loading="formState.loading"
-                 @change="handleTableChange"
-                 :row-selection="{ selectedRowKeys: formState.selectedRowKeys, onChange: onSelectChange}"
-                 :row-key="record=>record.siteId"
-                 bordered>
-          <template #bodyCell="{ column, text, record }"></template>
-        </a-table>
+        <a-col :span="24" style="text-align: right; margin-top: 20px; margin-right: 20px">
+          <Space>
+            <a-button @click="addSite">
+              <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="manageSites" :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 === 'siteName'">
+                <div>
+                  <a-select
+                    ref="select"
+                    v-model:value="manageSites[index][column.key]"
+                    :options="allSites"
+                    @change="manageSitesChange(index,manageSites[index][column.key])"
+                    :field-names="{ label: 'siteName', value: 'siteID' }"
+                    :allow-clear="true" style="width: 200px" >
+                  </a-select>
+                </div>
+              </template>
+              <template v-if="column.key === 'detailAddress'">
+                   {{manageSites[index][column.key]}}
+              </template>
+              <template v-if="column.key === 'operation'">
+                <a-button type="link" size="small" @click="delSite(index)">删除</a-button>
+              </template>
+            </template>
+          </a-table>
+        </a-col>
       </a-row>
       <a-divider orientation="left">其他</a-divider>
       <a-row>
@@ -94,11 +127,12 @@
 </template>
 <script lang="ts">
 import {computed, defineComponent, reactive, ref, toRefs} from "vue";
-import {get, save} from "@/api/baseSettings/institution";
+import {getInstitutionByID, saveInstitution} from "@/api/baseSettings/institution";
+import {getSiteList,getListByInstitutionID,getSiteByID} from "@/api/baseSettings/siteInfo";
 import BUploadFile from "@/components/file/uploadFile.vue";
-/*import dayjs from "dayjs";*/
 import {message, TableColumnsType, TableProps} from "ant-design-vue";
 import {getPaginationTotalTitle} from "@/utils/common";
+/*import dayjs from "dayjs";*/
 
 interface InstitutionModel {
   dataModel: any;
@@ -123,13 +157,14 @@ export default defineComponent({
     const isDetail = ref<boolean>(false);
     const pageParams = reactive({
       pageIndex: 1,
-      pageSize: 20,
+      pageSize: 10,
       institutionID:''
     });
     const columns: TableColumnsType = [
       {title: '序号', align: "center",key: 'siteID',customRender: item => `${pageParams.pageSize * (pageParams.pageIndex - 1) + item.index + 1}`},
       {title: '驿站名称', dataIndex: 'siteName', key: 'siteName', align: "center"},
-      {title: '驿站地址', dataIndex: 'detailAddress', key: 'detailAddress', align: "center"}
+      {title: '驿站地址', dataIndex: 'detailAddress', key: 'detailAddress', align: "center"},
+      {title: '操作', key: 'operation', fixed: 'right',width:170, align: "center"},
     ];
     const pagination = computed(() => ({
       total: formState.total,
@@ -143,24 +178,49 @@ export default defineComponent({
       selectedRowKeys: [],
       loading: false
     });
+    const allSites = ref([]);
+    const manageSites = ref<any>([]);
 
     const loadData = (id: string) => {
-      pageParams.institutionID = id;
-      get(pageParams).then((result: any) => {
+      getInstitutionByID(id).then((result: any) => {
         formData.dataModel = result;
-        console.log(formData.dataModel);
+        console.log('dataModel',formData.dataModel);
+        GetManageSites(formData.dataModel.institutionID);
         /*feedbackDateDetail.value = dayjs(formState.dataModel.feedbackDate).format('YYYY-MM-DD');
         resolveDateDetail.value = formState.dataModel.resolveDate == null?"": dayjs(formState.dataModel.resolveDate).format('YYYY-MM-DD');*/
       });
     }
 
     const show = (id: any,method:string,ifDetail:boolean) => {
+      title.value ="运营机构管理-"+method;
       isDetail.value = ifDetail;
       loadData(id);
-      title.value ="运营机构管理-"+method;
       visible.value = true;
     };
 
+    const getAllSites = () => {
+      pageParams.institutionID = '';
+      getSiteList(pageParams).then((result :any) => {
+        allSites.value = result.list;
+        console.log('allSites',allSites);
+      })
+    }
+
+    const GetManageSites = (id: string) => {
+      pageParams.institutionID = id;
+      getListByInstitutionID(pageParams).then((result :any)=> {
+          manageSites.value = result.list;
+          console.log('manageSites',manageSites);
+      });
+    }
+
+    const addSite = () => {
+      (manageSites.value as any[]).push({siteID: null,siteName: '', detailAddress:''});
+    }
+    const delSite = (site) =>{
+      (manageSites.value as any[]).splice(site, 1);
+    }
+
     const handleTableChange: TableProps['onChange'] = (pag: { pageSize: number; current: number },) => {
       pageParams.pageIndex = pag.current;
       pageParams.pageSize = pag.pageSize;
@@ -170,8 +230,27 @@ export default defineComponent({
       formState.selectedRowKeys = selectedRowKeys;
     };
 
+    const manageSitesChange = (index:any,siteID:any) =>{
+      const isAllowAdd = ref<boolean>(true);
+      manageSites.value.forEach(item=>{
+        if (item.siteID == siteID){
+          isAllowAdd.value = false;
+          return;
+        }
+      });
+      if (isAllowAdd.value){
+        getSiteByID(siteID).then((result :any)=> {
+          manageSites.value[index]= result;
+        });
+        console.log('manageSites',manageSites.value);
+      }else{
+        (manageSites.value as any[]).splice(index, 1);
+        message.error("不允许添加相同的站点!");
+      }
+    }
+
     const validate = ()  =>{
-      console.log(formData.dataModel);
+      console.log('dataModel',formData.dataModel);
       if (formData.dataModel.companyName==null) {
         message.error("请输入企业名称!");
         return;
@@ -200,7 +279,8 @@ export default defineComponent({
     const handleOk = () => {
       validate();
       if (isAllowCommit.value){
-        save(formData.dataModel).then(result => {
+        formData.dataModel.manageSites = manageSites.value;
+        saveInstitution(formData.dataModel).then(result => {
           if (result) {
             visible.value = false;
             props.loadData();
@@ -213,14 +293,14 @@ export default defineComponent({
       visible.value = false;
     };
 
-
-
     return {
       ...toRefs(formData),
       pageParams,
       columns,
       pagination,
       formState,
+      allSites,
+      manageSites,
       /*feedbackDateDetail,
       resolveDateDetail,*/
       isAllowCommit,
@@ -229,14 +309,20 @@ export default defineComponent({
       title,
       confirmLoading,
       show,
+      getAllSites,
+      GetManageSites,
+      addSite,
+      delSite,
       handleTableChange,
       onSelectChange,
+      manageSitesChange,
       handleOk,
       handleCancel,
       validate
     };
   },
   created() {
+    this.getAllSites();
   },
 })
 </script>

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

@@ -102,7 +102,7 @@ import {reactive, ref, computed, defineComponent, createVNode} from 'vue';
 import {DownOutlined, ExclamationCircleOutlined, UpOutlined} from '@ant-design/icons-vue';
 import type {FormInstance} from 'ant-design-vue';
 import type {TableColumnsType, TableProps} from 'ant-design-vue';
-import {getList, del} from '@/api/baseSettings/institution';
+import {getInstitutionList, delInstitution} from '@/api/baseSettings/institution';
 import InstitutionEditForm from "@/views/baseSettings/institution/edit.vue";
 import BExportExcel from "@/components/basic/excel/exportExcel/exportExcel.vue";
 import {getPaginationTotalTitle} from "@/utils/common";
@@ -157,7 +157,7 @@ export default defineComponent({
 
     const loadData = async function () {
       formState.loading = true;
-      const result: any = await getList(searchParams);
+      const result: any = await getInstitutionList(searchParams);
       dataList.value = result.list;
       console.log(dataList.value);
       formState.total = result.total;
@@ -197,7 +197,7 @@ export default defineComponent({
         okButtonProps: {},
         cancelText: '取消',
         onOk() {
-          del(formState.selectedRowKeys).then(() => {
+          delInstitution(formState.selectedRowKeys).then(() => {
             loadData();
           });
         },

+ 23 - 8
vue/src/views/baseSettings/site/edit.vue

@@ -28,14 +28,16 @@
         <a-col :span="10">
           <a-form-item label="所属机构" name="InstitutionName" :label-col="{span:10}" >
             <label v-if="isDetail">{{dataModel.institutionName}}</label>
-            <a-input v-model:value="dataModel.institutionName" placeholder=""/>
+            <a-select v-if ="!isDetail" 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>
+            <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="changeRegion" > </a-select>
           </a-form-item>
@@ -84,10 +86,11 @@
 </template>
 <script lang="ts">
 import {defineComponent, reactive, ref, toRefs} from "vue";
-import {get, save} from "@/api/baseSettings/siteInfo";
+import {getSiteByID, saveSite} from "@/api/baseSettings/siteInfo";
 import BUploadFile from "@/components/file/uploadFile.vue";
 import {message, SelectProps} from "ant-design-vue";
 import {getRegionCodeList, getStreetCodeList} from "@/api/system/area/index";
+import {getDataList} from "@/api/baseSettings/institution";
 
 interface siteModel {
   dataModel: any;
@@ -116,6 +119,7 @@ export default defineComponent({
 
     const regionList = ref<SelectProps['options']>();
     const streetList = ref<SelectProps['options']>();
+    const institutionList =ref<SelectProps["options"]>();
 
     const getRegionList = async function(){
       const regionResult: any = await getRegionCodeList();
@@ -123,17 +127,25 @@ export default defineComponent({
       regionList.value = regionResult;
     }
 
-    const changeRegion = async function(){
-      formData.dataModel.streetCode = '';
-    }
     const getStreetList = async function(){
       const streetResult: any = await getStreetCodeList(formData.dataModel.regionCode);
       console.log('streetResult',streetResult);
       streetList.value = streetResult;
     }
 
+    const getInstitutionList = async function(){
+      const institutionResult :any = await getDataList();
+      console.log('institutionResult',institutionResult);
+      institutionList.value = institutionResult;
+    }
+
+    const changeRegion = async function(){
+      formData.dataModel.streetCode = '';
+      getStreetList();
+    }
+
     const loadData = (siteID: string) => {
-      get(siteID).then((result: any) => {
+      getSiteByID(siteID).then((result: any) => {
         formData.dataModel = result;
         getStreetList();
         if (formData.dataModel.siteX !=null && formData.dataModel.siteY != null){
@@ -170,7 +182,7 @@ export default defineComponent({
     const handleOk = () => {
       validate();
       if (isAllowCommit.value){
-        save(formData.dataModel).then(result => {
+        saveSite(formData.dataModel).then(result => {
           if (result) {
             visible.value = false;
             props.loadData();
@@ -190,6 +202,7 @@ export default defineComponent({
       formState,
       regionList,
       streetList,
+      institutionList,
       isAllowCommit,
       isDetail,
       visible,
@@ -198,6 +211,7 @@ export default defineComponent({
       show,
       getRegionList,
       getStreetList,
+      getInstitutionList,
       onSelectChange,
       changeRegion,
       handleOk,
@@ -207,6 +221,7 @@ export default defineComponent({
   },
   created() {
     this.getRegionList();
+    this.getInstitutionList();
   },
 })
 </script>

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

@@ -87,7 +87,7 @@ import {reactive, ref, computed, defineComponent, createVNode} from 'vue';
 import {DownOutlined, ExclamationCircleOutlined, UpOutlined} from '@ant-design/icons-vue';
 import type {FormInstance} from 'ant-design-vue';
 import type {TableColumnsType, TableProps} from 'ant-design-vue';
-import {getList} from '@/api/baseSettings/siteInfo';
+import {getSiteList} from '@/api/baseSettings/siteInfo';
 import {getRegionCodeList, getStreetCodeList} from "@/api/system/area/index";
 import SiteInfoEditForm from "@/views/baseSettings/site/edit.vue";
 import BExportExcel from "@/components/basic/excel/exportExcel/exportExcel.vue";
@@ -199,7 +199,7 @@ export default defineComponent({
     };
     const loadData = async function () {
       formState.loading = true;
-      const result: any = await getList(searchParams);
+      const result: any = await getSiteList(searchParams);
       dataList.value = result.list;
       formState.total = result.total;
       formState.loading = false;

+ 3 - 3
vue/src/views/baseSettings/user/edit.vue

@@ -51,7 +51,7 @@
 </template>
 <script lang="ts">
 import {defineComponent, reactive, ref, toRefs} from "vue";
-import {get, save} from "@/api/baseSettings/userInfo";
+import {getSiteUserByID, saveSiteUser} from "@/api/baseSettings/userInfo";
 import BUploadFile from "@/components/file/uploadFile.vue";
 import {message} from "ant-design-vue";
 
@@ -81,7 +81,7 @@ export default defineComponent({
     });
 
     const loadData = (siteUserID: string) => {
-      get(siteUserID).then((result: any) => {
+      getSiteUserByID(siteUserID).then((result: any) => {
         formData.dataModel = result;
         console.log(formData.dataModel);
       });
@@ -114,7 +114,7 @@ export default defineComponent({
     const handleOk = () => {
       validate();
       if (isAllowCommit.value){
-        save(formData.dataModel).then(result => {
+        saveSiteUser(formData.dataModel).then(result => {
           if (result) {
             visible.value = false;
             props.loadData();

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

@@ -50,7 +50,7 @@ import {reactive, ref, computed, defineComponent, createVNode} from 'vue';
 import {DownOutlined, ExclamationCircleOutlined, UpOutlined} from '@ant-design/icons-vue';
 import type {FormInstance} from 'ant-design-vue';
 import type {TableColumnsType, TableProps} from 'ant-design-vue';
-import {getList} from '@/api/baseSettings/userInfo';
+import {getSiteUserList} from '@/api/baseSettings/userInfo';
 import UserInfoEditForm from "@/views/baseSettings/user/edit.vue";
 import BExportExcel from "@/components/basic/excel/exportExcel/exportExcel.vue";
 import {getPaginationTotalTitle} from "@/utils/common";
@@ -137,7 +137,7 @@ export default defineComponent({
     };
     const loadData = async function () {
       formState.loading = true;
-      const result: any = await getList(searchParams);
+      const result: any = await getSiteUserList(searchParams);
       dataList.value = result.list;
       formState.total = result.total;
       formState.loading = false;

+ 1 - 0
vue/src/views/taskAndLog/dotask/edit.vue

@@ -192,6 +192,7 @@ export default defineComponent(
         getWorkUserList(id).then(data => {
           if (data)
             userData.value = data;
+          console.log('userData',userData);
         });
       }
 

+ 9 - 3
vue/src/views/taskAndLog/dowork/edit.vue

@@ -36,10 +36,10 @@
         <a-textarea :auto-size="{ minRows: 4, maxRows: 10 }"  v-model:value="dataModel.workContent"  :disabled="isDetail"
                     placeholder="完成情况" style="text-align: center;" />
       </a-row>
-      <a-divider orientation="left">其他信息</a-divider>
-      <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>
 
-      </a-row>
     </a-form>
   </a-modal>
 </template>
@@ -64,6 +64,7 @@ export default defineComponent({
   setup(props) {
     const formData = reactive<InstitutionModel>({ dataModel:{}});
     const visible = ref<boolean>(false);
+    const fileList = ref();
     const confirmLoading = ref<boolean>(false);
     const title = ref();
     const isAllowCommit = ref<boolean>(false);
@@ -73,6 +74,10 @@ export default defineComponent({
       selectedRowKeys: [],
       loading: false
     });
+    const setFileList = (files) => {
+      fileList.value = files;
+    }
+
     const loadData = (doWorkID: string) => {
       get(doWorkID).then((result: any) => {
         formData.dataModel = result;
@@ -130,6 +135,7 @@ export default defineComponent({
       onSelectChange,
       handleOk,
       handleCancel,
+      setFileList,
       validate
     };
   },

+ 1 - 1
vue/vue.config.js

@@ -161,7 +161,7 @@ module.exports = defineConfig({
     };
     config.resolve.fallback = { path: require.resolve('path-browserify') };
 
-    config.devtool = false;//'source-map';
+    config.devtool = 'source-map';
 
     config.plugins.push(
       // 定义全局变量