فهرست منبع

部分新增功能-街道获取调整

liao-sea 11 ماه پیش
والد
کامیت
0ceda3559c

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

@@ -52,6 +52,7 @@ public class SiteInfoController {
         }else{
             dataModel = siteService.get(siteID);
         }
+        dataModel.manageUsers = null;
         return RespGenerstor.success(dataModel);
     }
 

+ 1 - 2
src/main/java/com/hz/employmentsite/services/impl/baseSettings/SiteInfoImpl.java

@@ -57,8 +57,7 @@ public class SiteInfoImpl implements SiteInfoService {
     public SiteInfoVo get(String siteID) {
         List<String> ids = new ArrayList<>();
         ids.add(siteID);
-        String sqlPrimaryKey = stringUtils.ListToInSql(ids);
-        SiteInfoVo model = siteInfoCQuery.getList(sqlPrimaryKey,null,null ,null,null,null).stream().findFirst().orElse(null);
+        SiteInfoVo model = siteInfoCQuery.getList(stringUtils.ListToInSql(ids),null,null ,null,null,null).stream().findFirst().orElse(null);
         return model;
     }
 

+ 1 - 1
vue/src/api/system/area/index.ts

@@ -14,7 +14,7 @@ export function getStreetCodeList(code:string) {
   return request<any>({
     url: 'system/area/getAreaList',
     method: 'get',
-    params: { code:code},
+    params: {code:code},
   }, {
     isNew: true,
   });

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

@@ -39,7 +39,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="changeRegion" > </a-select>
+              :field-names="{ label: 'name', value: 'code' }" :allow-clear="true" @change="getStreetList('')" > </a-select>
           </a-form-item>
         </a-col>
         <a-col :span="7">
@@ -123,35 +123,28 @@ export default defineComponent({
 
     const getRegionList = async function(){
       const regionResult: any = await getRegionCodeList();
-      console.log('regionResult',regionResult);
       regionList.value = regionResult;
     }
-
-    const getStreetList = async function(){
-      const streetResult: any = await getStreetCodeList(formData.dataModel.regionCode);
-      console.log('streetResult',streetResult);
+    const getStreetList = async function(regionCode: string){
+      const streetResult: any = await getStreetCodeList(regionCode);
       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) => {
       getSiteByID(siteID).then((result: any) => {
         formData.dataModel = result;
-        getStreetList();
+        console.log("dataModel",formData.dataModel);
+        if (formData.dataModel.regionCode != null){
+          getStreetList(formData.dataModel.regionCode);
+        }
         if (formData.dataModel.siteX !=null && formData.dataModel.siteY != null){
           formData.dataModel.sitePosition = "X:"+formData.dataModel.siteX+" Y:"+formData.dataModel.siteX;
         }
-        console.log(formData.dataModel);
       });
     }
 
@@ -162,12 +155,11 @@ export default defineComponent({
       visible.value = true;
     };
 
-
     const onSelectChange = (selectedRowKeys: any) => {
       formState.selectedRowKeys = selectedRowKeys;
     };
 
-    const validate = ()  =>{
+    const validate = () => {
       console.log(formData.dataModel);
       if (formData.dataModel.siteCode==null) {
         message.error("请输入驿站编号!");
@@ -195,8 +187,6 @@ export default defineComponent({
       visible.value = false;
     };
 
-
-
     return {
       ...toRefs(formData),
       formState,
@@ -213,7 +203,6 @@ export default defineComponent({
       getStreetList,
       getInstitutionList,
       onSelectChange,
-      changeRegion,
       handleOk,
       handleCancel,
       validate

+ 23 - 31
vue/src/views/taskAndLog/dowork/edit.vue

@@ -45,7 +45,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="changeRegion" > </a-select>
+                      :field-names="{ label: 'name', value: 'code' }" :allow-clear="true" @change="getStreetList('')" > </a-select>
           </a-form-item>
         </a-col>
         <a-col :span="7">
@@ -102,21 +102,40 @@ export default defineComponent({
       selectedRowKeys: [],
       loading: false
     });
-    const logTypeList = ref<SelectProps["options"]>();
-    const siteUserList = ref<SelectProps["options"]>();
-
     const regionList = ref<SelectProps['options']>();
     const streetList = ref<SelectProps['options']>();
+    const logTypeList = ref<SelectProps["options"]>();
+    const siteUserList = ref<SelectProps["options"]>();
 
     const fileList = ref();
     const setFileList = (files) => {
       fileList.value = files;
     };
+    const getRegionList = async function(){
+      const regionResult: any = await getRegionCodeList();
+      regionList.value = regionResult;
+    }
+    const getStreetList = async function(regionCode: string){
+      const streetResult: any = await getStreetCodeList(regionCode);
+      streetList.value = streetResult;
+    }
+    const getSiteUserList = async function(){
+      const siteUserResult :any = await getDataList();
+      console.log('siteUserResult',siteUserResult);
+      siteUserList.value = siteUserResult;
+    }
+    const getLogTypeList = async function(){
+      const logTypeResult :any = await getSysDictionaryList("LogType");
+      logTypeList.value = logTypeResult;
+    }
 
     const loadData = (doWorkID: string) => {
       get(doWorkID).then((result: any) => {
         formData.dataModel = result;
         console.log(formData.dataModel);
+        if (formData.dataModel.regionCode != null){
+          getStreetList(formData.dataModel.regionCode);
+        }
       });
     }
 
@@ -133,32 +152,6 @@ export default defineComponent({
     const onSelectChange = (selectedRowKeys: any) => {
       formState.selectedRowKeys = selectedRowKeys;
     };
-    const getRegionList = async function(){
-      const regionResult: any = await getRegionCodeList();
-      console.log('regionResult',regionResult);
-      regionList.value = regionResult;
-    }
-    const getStreetList = async function(){
-      const streetResult: any = await getStreetCodeList(formData.dataModel.regionCode);
-      console.log('streetResult',streetResult);
-      streetList.value = streetResult;
-    }
-    const changeRegion = async function(){
-      formData.dataModel.streetCode = '';
-      getStreetList();
-    }
-
-    const getSiteUserList = async function(){
-      const siteUserResult :any = await getDataList();
-      console.log('siteUserResult',siteUserResult);
-      siteUserList.value = siteUserResult;
-    }
-
-    const getLogTypeList = async function(){
-      const logTypeResult :any = await getSysDictionaryList("LogType");
-      logTypeList.value = logTypeResult;
-    }
-
 
     const validate = ()  =>{
       console.log(formData.dataModel);
@@ -202,7 +195,6 @@ export default defineComponent({
       getStreetList,
       setFileList,
       onSelectChange,
-      changeRegion,
       handleOk,
       handleCancel,
       validate