Browse Source

fix:功能配置功能开发

wuguojie 1 year ago
parent
commit
a5e7232c3c

+ 6 - 2
src/api/modules/configurate.ts

@@ -19,9 +19,13 @@ export interface SaveBusPerms {
 
 const configurateApi = (axiosInstance: ApiInstance) => ({
   getDeptListBySystemCode: (data: string) => axiosInstance.get(`/sysDept/getDeptListBySystemCode?systemCode=${data}`),
-  liveCompanyList: () => axiosInstance.get('/esmInsCompany/liveCompanyList'), // 保司
+  // liveCompanyList: () => axiosInstance.get('/esmInsCompany/liveCompanyList'), // 保司
+  sysList: (data: any) => axiosInstance.post('/system/sysList', data), // 保司
   saveBusPerms: (data: SaveBusPerms) => axiosInstance.post('/system/saveBusPerms', data), // 保存
-  getBusPerms: (data: { systemCode: string, companyId: string }) => axiosInstance.get(`/system/getBusPerms?systemCode=${data.systemCode}&&companyId=${data.companyId}`)
+  getBusPerms: (data: { systemCode: string, companyId: string }) => axiosInstance.get(`/system/getBusPerms?systemCode=${data.systemCode}&&companyId=${data.companyId}`),
+  getBusPerms11: (data: any) => axiosInstance.get(`/system/getBusPerms?systemCode=${data}`),
+  gainTopList: () => axiosInstance.get(`/esmInsCompany/gainTopList?type=`), //可选择的保司
+  // getDeptListBySystemCode: (data: any) => axiosInstance.get(`/sysDept/getDeptListBySystemCode?systemCode=${data}`)
 })
 
 export default configurateApi;

+ 5 - 0
src/assets/styles/globals.css

@@ -321,6 +321,11 @@ textarea {
   overflow-y: auto;
 }
 
+.vh190 {
+  height: calc(100vh - 190px);
+  overflow-y: auto;
+}
+
 .strong {
   font-size: 14px;
   font-weight: bold;

+ 29 - 21
src/views/organizationManagement/functionConfiguration.vue

@@ -1,18 +1,18 @@
 <!-- 模板区域 -->
 <template>
   <div>
-    <PageMain class="vh100">
-      <el-row :gutter="20" class="vh100">
-        <el-col :span="5" class="vh100">
+    <PageMain class="vh190">
+      <el-row :gutter="20">
+        <el-col :span="5">
           <el-input v-model="filterText" prefix-icon="search"></el-input>
           <div class="company">
             <div class="companyItem" :class="{'active': filterIndex === index}" v-for="(item, index) in filterChange" @click="handleClick(item, index)">
-              {{ item?.nameSimple }}
+              {{ item?.sysName }}
             </div>
           </div>
         </el-col>
         <el-divider direction="vertical" class="vh100"></el-divider>
-        <el-col :span="18" class="vh100">
+        <el-col :span="18">
           <el-row :gutter="20">
             <el-col :span="20">
               <h4>租户功能配置</h4>
@@ -38,8 +38,9 @@
                       </el-col>
                     </el-row>
                   </el-radio-group>
-                  <div v-if="functionForm.quoteCompany == 2" style="display: flex; justify-content: flex-start;">
-                    <div style="display: flex; align-items: center; padding: 3px 16px; margin-right: 10px; color: #0083ff; background: #e9f4ff; border-radius: 3px;" v-for="(item, index) in companySelected">{{ item.nameSimple }}
+                  <div v-if="functionForm.quoteCompany == 2" style="display: flex; justify-content: flex-start; flex-wrap: wrap">
+                    <div style="display: flex; align-items: center; padding: 3px 16px; margin-right: 10px; color: #0083ff; background: #e9f4ff; border-radius: 3px; width: 240px" v-for="(item, index) in companySelected">
+                      <span>{{ item.nameSimple }}</span>
                     <el-icon style=" margin-left: 20px;cursor: pointer;" @click="handleDelete(item, index)"><Close /></el-icon></div>
                   </div>
                 </el-form-item>
@@ -152,7 +153,7 @@ import api from '@/api'
 import companys from './modules/companySelect.vue'
 
 const functionRef = ref<FormInstance>()
-const companyRef = ref(null)
+const companyRef = ref()
 
 // 保司相关数据
 // 保司查询条件
@@ -160,20 +161,26 @@ let filterText = ref('')
 let company = ref([])
 let filterIndex = ref(0)
 let companyId = ref('')
+let sysCode = ref('')
 const filterChange = computed(() => {
-  return company.value.filter((a:any) => a.nameSimple.includes(filterText.value))
+  return company.value.filter((a:any) => a.sysCode.includes(filterText.value))
 })
 const handleClick = (item:any, index:any) => {
   filterIndex.value = index
   companyId.value = item.id
-  console.log(11111, index)
+  sysCode.value = item.sysCode
   handleCancel()
+  initInstitution(sysCode.value)
 }
 // 保司
 const initCompany = () => {
-  api.configurate.liveCompanyList().then((res:any) => {
+  api.configurate.sysList({
+    size: 200
+  }).then((res:any) => {
     if(res.code == 200) {
-      company.value = res.data
+      company.value = res.data.records
+      sysCode.value = res.data.records[0].sysCode
+      initInstitution(sysCode.value)
     } else {
       ElMessage.error(res.msg)
     }
@@ -182,9 +189,8 @@ const initCompany = () => {
 
 // 机构
 let institutionList = ref([])
-const initInstitution = () => {
-  let code = localStorage.getItem('login_system')
-  api.configurate.getDeptListBySystemCode(code).then(res => {
+const initInstitution = (val) => {
+  api.configurate.getDeptListBySystemCode(val).then(res => {
     if(res.code == 200) {
       institutionList.value = res.data
     } else {
@@ -194,10 +200,13 @@ const initInstitution = () => {
 }
 
 const handleEdit = () => {
-  return api.configurate.getBusPerms({
-    systemCode: localStorage.getItem('login_system'),
-    companyId: companyId.value?companyId.value:filterChange.value[0].id
-  }).then(res => {
+  return api.configurate.getBusPerms11(
+    sysCode.value
+    // {
+    // // systemCode: localStorage.getItem('login_system'),
+    // // companyId: companyId.value?companyId.value:filterChange.value[0].id
+    // }
+  ).then(res => {
     if(res.code == 200) {
       functionForm.value = res.data
       functionForm.value.orderAuditDeptList = functionForm.value.orderAuditDeptList[0]
@@ -285,7 +294,7 @@ const handleCancel = () => {
 const handleComfirm = () => {
   let formData = {...functionForm.value}
   formData.companyId = companyId.value?companyId.value:filterChange.value[0].id
-  formData.systemCode = localStorage.getItem('login_system')
+  formData.systemCode = sysCode.value
   if(companySelected.value.length > 0) {
     formData.quoteCompanyList = companySelected.value.map(a => {
       return a.id
@@ -308,7 +317,6 @@ const handleComfirm = () => {
 
 onMounted(() => {
   initCompany()
-  initInstitution()
 })
 
 </script>

+ 13 - 4
src/views/organizationManagement/modules/companySelect.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="companySelect">
     <el-row class="content" :gutter="20">
-      <el-col :span="11">
+      <el-col :span="11" style="height: 100%; overflow-y: auto; overflow-x: hidden">
         <el-input v-model="searchName" placeholder="输入驾意险名称查找" style="margin-bottom: 10px;">
           <template #append>
             <el-button type="primary" @click="handleSearchName">查找</el-button>
@@ -15,9 +15,9 @@
         </div>
       </el-col>
       <el-divider direction="vertical" style="height: 100%;"></el-divider>
-      <el-col :span="12">
+      <el-col :span="12" style="height: 100%; overflow-y: auto; overflow-x: hidden">
         <div style="display: flex; align-items: center; justify-content: space-between; margin: 8px 0;">
-          <span>已选: {{ selectedList.length }}家保险公司</span>
+          <span>已选: {{ selectedList?.length }}家保险公司</span>
           <el-button link type="primary">清空</el-button>
         </div>
         <div class="selectedList">
@@ -94,7 +94,7 @@ const handleDel = (_item:any, index:any) => {
 }
 
 const initEditData = (list:any) => {
-  api.configurate.liveCompanyList().then((res:any) => {
+  api.configurate.gainTopList().then((res:any) => {
     if (res.code == 200) {
       company.value = JSON.parse(JSON.stringify(res.data))
       selectList.value = JSON.parse(JSON.stringify(res.data))
@@ -136,5 +136,14 @@ defineExpose({
     align-items: center;
     justify-content: center;
   }
+  :deep(.el-checkbox) {
+    width: 100%;
+  }
+  :deep(.el-checkbox__label) {
+    width: calc(100% - 20px);
+    overflow: hidden;
+    text-overflow: ellipsis;
+    white-space: nowrap;
+  }
 }
 </style>