@dongkboy 1 年間 前
コミット
e58ec049a9

+ 2 - 2
.env.development

@@ -6,8 +6,8 @@ VITE_APP_TITLE = 租户平台
 # VITE_APP_API_BASEURL = https://test.baoxianzhanggui.com/web-api #默认地址
 # VITE_APP_API_BASEURL = http://192.168.0.253:8001  #田智
 # VITE_APP_API_BASEURL = http://192.168.0.55:8001  #董鑫
-VITE_APP_API_BASEURL = http://192.168.0.106:8001  #屈晨
-#VITE_APP_API_BASEURL = http://192.168.0.59:8001  #徐强
+# VITE_APP_API_BASEURL = http://192.168.0.106:8001  #屈晨
+VITE_APP_API_BASEURL = http://192.168.0.59:8001  #徐强
 
 # 调试工具,可设置 eruda 或 vconsole,如果不需要开启则留空
 VITE_APP_DEBUG_TOOL =

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

@@ -336,6 +336,10 @@ textarea {
 /* dialog对话框样式 */
 
 /* 全局样式 */
+.el-message {
+  z-index: 9999999 !important;
+}
+
 .bg-\[var\(--g-sub-sidebar-menu-active-bg\)\]\! {
   background:
     var(--g-sub-sidebar-menu-active-bg)

+ 20 - 10
src/components/ruleCondition/index.vue

@@ -62,6 +62,8 @@
 <script lang='ts' setup>
 import { ref, reactive } from 'vue'
 import api from '@/api'
+import { ElMessage } from 'element-plus'
+
 import { defineProps, defineEmits } from "vue";
 const props = defineProps<{
   ruleConditionVisible: boolean,
@@ -76,6 +78,7 @@ const close = () => {
 }
 watch(props, () => {
   if (props.attrIdList && props.attrIdList.length) {
+    console.log(props.attrIdList)
     attractivelist.value = props.attrIdList;//获取编辑数据
     const matchedid = matchDataByIds(attractivelist.value);//
     const matchedinfo = matchDataByInfos(attractivelist.value)
@@ -99,6 +102,13 @@ const save = () => {
     ...checkeddata.InsuranceInformation,
     ...checkeddata.InsuranceCostFactor,
   ]
+  if (mergedData.length == 0) {
+    return ElMessage({
+      type: 'error',
+      message: '至少选一个',
+      plain: true,
+    })
+  }
   emits("save", mergedData)// 返回已选集合
 }
 const attractivelist = ref();
@@ -126,6 +136,7 @@ const matchDataByInfos = (idCollection: any) => {
         // 如果找到匹配项,将 minArray 和 min 赋值给 item
         item.minArray = match.minArray;
         item.min = match.min;
+        item.max = match.max;
         return true; // 保留该项
       }
       return false; // 不保留该项
@@ -212,21 +223,20 @@ interface dataStore {
 }
 
 onMounted(() => {
-    ruleAttr();
-    regionLicenseRegion('0');//车牌地区
-    regionLicenseNumber('14');//车牌号
+  ruleAttr();
+  regionLicenseRegion('0');//车牌地区
+  regionLicenseNumber('14');//车牌号
 })
 
 const ruleAttr = () => {
   api.agreementApi.ruleAttrGroup({ attrName: attrName.value }).then((res: any) => {
     if (res.code == '200') {
-      dataStore.VehicleInformation = processArray(res.data.VehicleInformation);
-      dataStore.VehicleOwnerInformation = processArray(res.data.VehicleOwnerInformation);
-      dataStore.PolicyholderInformation = processArray(res.data.PolicyholderInformation);
-      dataStore.InsuredInformation = processArray(res.data.InsuredInformation);
-      dataStore.InsuranceInformation = processArray(res.data.InsuranceInformation);
-      dataStore.InsuranceCostFactor = processArray(res.data.InsuranceCostFactor);
-    } else {
+      dataStore.VehicleInformation = res.data.VehicleInformation ? processArray(res.data.VehicleInformation) : [];
+      dataStore.VehicleOwnerInformation = res.data.VehicleOwnerInformation ? processArray(res.data.VehicleOwnerInformation) : [];
+      dataStore.PolicyholderInformation = res.data.PolicyholderInformation ? processArray(res.data.PolicyholderInformation) : [];
+      dataStore.InsuredInformation = res.data.InsuredInformation ? processArray(res.data.InsuredInformation) : [];
+      dataStore.InsuranceInformation = res.data.InsuranceInformation ? processArray(res.data.InsuranceInformation) : [];
+      dataStore.InsuranceCostFactor = res.data.InsuranceCostFactor ? processArray(res.data.InsuranceCostFactor) : [];
     }
   });
 }

+ 0 - 5
src/views/externalAgreement/agreement/agreementDetails.vue

@@ -19,7 +19,6 @@
                     <el-dropdown-item command="启用" v-if="agreementInfo.isEnable == '1'">启用</el-dropdown-item>
                     <el-dropdown-item command="禁用" v-else>禁用</el-dropdown-item>
                     <el-dropdown-item command="删除">删除</el-dropdown-item>
-                    <el-dropdown-item command="分配管理人">复制协议</el-dropdown-item>
                   </el-dropdown-menu>
                 </template>
               </el-dropdown>
@@ -67,8 +66,6 @@
             <el-descriptions-item label="保险公司:"> {{ agreementInfo.companyId }}</el-descriptions-item>
             <el-descriptions-item label="协议类型:">{{ agreementInfo.agreementType }} </el-descriptions-item>
             <el-descriptions-item label="管理人:"> {{ agreementInfo.custodianId }}</el-descriptions-item>
-            <el-descriptions-item label="对接人:"> {{ agreementInfo.dockingPerson }} </el-descriptions-item>
-            <el-descriptions-item label="对接人手机号:"> {{ agreementInfo.dockingPhone }} </el-descriptions-item>
           </el-descriptions>
         </el-tab-pane>
         <el-tab-pane label="费用管理" name="costManagement">
@@ -310,8 +307,6 @@ const dropdownCommand = (e: any) => {
           });
         })
       break;
-    case '复制协议':
-      break;
     default:
       break;
   }

+ 1 - 10
src/views/externalAgreement/agreement/agreementIndex.vue

@@ -41,7 +41,6 @@
                 <el-dropdown-item @click="enable(scope.operationData.id)">启用</el-dropdown-item>
                 <el-dropdown-item @click="disable(scope.operationData.id)">禁用</el-dropdown-item>
                 <el-dropdown-item @click="del(scope.operationData.id)">删除</el-dropdown-item>
-                <el-dropdown-item @click="agreemenCopy(scope.operationData.id)">复制协议</el-dropdown-item>
                 <el-dropdown-item @click="batchAuthorization(scope.operationData.id)">协议授权</el-dropdown-item>
               </el-dropdown-menu>
             </template>
@@ -319,15 +318,7 @@ const batchAuthorization = (value: string) => {
   });
 
 }
-//复制协议
-const agreemenCopy = (id:string) => {
-  router.push({
-    name: 'AgreementCopy',
-    query: {
-      id: id
-    }
-  })
-}
+
 //禁用
 const disable = (value: string) => {
   ElMessageBox.confirm(

+ 5 - 1
src/views/externalAgreement/agreement/components/contactPersonFeeDialog.vue

@@ -229,6 +229,10 @@ watch(props, () => {
     Object.assign(ruleFeeinfo, props.contactPersonEditInfo);
     activeName.value = ruleFeeinfo.ptlAgreementCostExternalAddList[0].productName;
   }
+  if(props.agreementInfo){
+  agreementActiveId.value=props.agreementInfo.id;
+
+  }
 })
 onMounted(async () => {
   await loadDicts(['insurance_type'])
@@ -398,7 +402,7 @@ const filterCostTypeList = (name: string) => {
     if (name === "单交" && item.costType === "商业险") {
       return false; // 当 name 为 "单交" 且 costType 为 "商业险" 时,返回 false,不包含该项
     }
-    if (name === "单三" && item.costType === "商业险") {
+    if (name === "单三" && item.costType === "交强险") {
       return false; // 当 name 为 "单交" 且 costType 为 "商业险" 时,返回 false,不包含该项
     }
     if (name === "单商" && item.costType === "交强险") {

+ 0 - 1
src/views/externalAgreement/agreement/components/contactPersonFeeDialogEdit.vue

@@ -69,7 +69,6 @@
             </ElCol>
           </el-form>
         </ElRow>
-
         <el-table :data="contactPersonEditInfo.costExternalTypeAdds" style="width: 100%;" border
           :header-cell-style="{ 'background-color': '#F7F7F9', 'border-bottom': '1px solid #EEF1F6', 'font-size': '15px', 'color': '#333', 'padding': '10px 0' }">
           <template #empty>

+ 4 - 2
src/views/quoteConfig/agreement/agreementAdd.vue

@@ -81,7 +81,7 @@
           <ElCol :md="24" :lg="6">
             <el-form-item label="管理人" prop="custodianId">
               <el-input v-model="managerName" @click="managerModalVisible = true">{{ agreementFrom.custodianId
-              }}</el-input>
+                }}</el-input>
             </el-form-item>
           </ElCol>
           <ElCol :md="24" :lg="6">
@@ -312,6 +312,8 @@ const detailsInfo = () => {
           agreementFrom[key as keyof AgreementForm] = res.data.agreement[key] as AgreementForm[keyof AgreementForm];
         }
       });
+      managerName.value = res.data.agreement.managerName + ' - ' + res.data.agreement.deptName;
+      attributionName.value = `用户名:${res.data.agreement.username}\n简称:${res.data.agreement.userAbbr}`;
     } else {
     }
   });
@@ -419,7 +421,7 @@ const company = () => {
 //选择管理人
 interface managerlist {
   id: string,
-  userId:string,
+  userId: string,
   name: string,
   deptName: string,
 }

+ 5 - 6
src/views/quoteConfig/agreement/agreementCopy.vue

@@ -29,7 +29,7 @@
             </el-button>
             <template #dropdown>
               <el-dropdown-menu>
-                <el-dropdown-item :command="item.label" v-for="(item, index) in getDict('valid_status')" :key="index">{{
+                <el-dropdown-item :command="item.label" v-for="(item, index) in valid_status" :key="index">{{
                   item.label }}</el-dropdown-item>
               </el-dropdown-menu>
             </template>
@@ -72,7 +72,7 @@
 import { ref, reactive } from 'vue'
 import api from '@/api'
 import { useRoute, useRouter } from 'vue-router';
-import { ElMessage, ElMessageBox } from 'element-plus'
+import { ElMessage } from 'element-plus'
 import { loadDicts, getDict } from '@/utils/composables/dictService';//字典组件
 const route = useRoute();
 const router = useRouter();
@@ -158,16 +158,15 @@ onBeforeMount(async () => {
   if (id.value) {
     detailsInfo();//协议信息
     findpage();
-    valid_status.value = getDict('valid_status')
-    is_enable.value = getDict('is_enable')
+    valid_status.value =[{label:"全部",value:""},...getDict('valid_status')]
+
+    is_enable.value =[{label:"全部",value:""},...getDict('is_enable')]
   }
 })
 //协议详情
 const detailsInfo = () => {
   api.agreementApi.agreementGet(id.value).then((res: any) => {
     if (res.code == '200') {
-      res.data.agreement.fileName = processFileName(res.data.agreement.fileName)
-      res.data.agreement.fileSize = formatFileSize(res.data.agreement.fileSize);
       agreementInfo.value = res.data.agreement;
       authDeptlength.value = res.data.dept.length;
     } else {

+ 58 - 34
src/views/quoteConfig/agreement/agreementDetails.vue

@@ -19,7 +19,7 @@
                     <el-dropdown-item command="启用" v-if="agreementInfo.isEnable == '1'">启用</el-dropdown-item>
                     <el-dropdown-item command="禁用" v-else>禁用</el-dropdown-item>
                     <el-dropdown-item command="删除">删除</el-dropdown-item>
-                    <el-dropdown-item command="分配管理人">复制协议</el-dropdown-item>
+                    <el-dropdown-item command="复制协议">复制协议</el-dropdown-item>
                   </el-dropdown-menu>
                 </template>
               </el-dropdown>
@@ -57,42 +57,47 @@
             <el-descriptions-item label="协议生效时间:">{{ agreementInfo.startDate }}</el-descriptions-item>
             <el-descriptions-item label="协议失效时间:">{{ agreementInfo.endDate }}</el-descriptions-item>
             <el-descriptions-item label="是否含增值税结算:">
-              {{ agreementInfo.withTax }}
+              {{  getDict('with_tax').find(val => val.value == agreementInfo.withTax)?.label }}
+
             </el-descriptions-item>
             <el-descriptions-item label="结算周期:">T{{ agreementInfo.moneyTime }} </el-descriptions-item>
             <el-descriptions-item label="协议描述:">{{ agreementInfo.agreementName }}</el-descriptions-item>
           </el-descriptions>
           <el-descriptions title="其他信息" class="m-top-20" :column="3">
             <el-descriptions-item label="协议归属:">{{ agreementInfo.deptName }} </el-descriptions-item>
-            <el-descriptions-item label="保险公司:"> {{ agreementInfo.companyId }}</el-descriptions-item>
-            <el-descriptions-item label="协议类型:">{{ agreementInfo.agreementType }} </el-descriptions-item>
-            <el-descriptions-item label="管理人:"> {{ agreementInfo.custodianId }}</el-descriptions-item>
+            <el-descriptions-item label="保险公司:"> {{ agreementInfo.company }}</el-descriptions-item>
+            <el-descriptions-item label="协议类型:">{{ getDict('agreement_type').find(val => val.value == agreementInfo.agreementType)?.label}} </el-descriptions-item>
+
+            <el-descriptions-item label="管理人:"> {{ agreementInfo.managerName }}</el-descriptions-item>
             <el-descriptions-item label="对接人:"> {{ agreementInfo.dockingPerson }} </el-descriptions-item>
             <el-descriptions-item label="对接人手机号:"> {{ agreementInfo.dockingPhone }} </el-descriptions-item>
             <el-descriptions-item label="出单账号:"> {{ agreementInfo.attributionId }} </el-descriptions-item>
           </el-descriptions>
-          <span class="strong" style="font-size: 16px;color: #303133;">协议文件</span>
-          <span class="strong m-top-20 m-btn-10" style="display: block;">协议费用政策告知单</span>
-          <div class="agreementNotice flex a-c j-s">
-            <div class="flex  a-c">
-              <img src="../../../assets/images/pdf.png" alt="">
-              <div class="flex f-c j-s">
-                <span>{{ agreementInfo.fileName }}</span>
-                <span>{{ agreementInfo.fileSize }}</span>
+          <div v-if="agreementInfo.fileUrl">
+            <span class="strong" style="font-size: 16px;color: #303133;">协议文件</span>
+            <span class="strong m-top-20 m-btn-10" style="display: block;">协议费用政策告知单</span>
+            <div class="agreementNotice flex a-c j-s">
+              <div class="flex  a-c">
+                <img src="../../../assets/images/pdf.png" alt="">
+                <div class="flex f-c j-s">
+                  <span>{{ agreementInfo.fileName }}</span>
+                  <span>{{ agreementInfo.fileSize }}</span>
+                </div>
               </div>
-            </div>
-            <div class="fileBtn flex a-c">
-              <el-upload :show-file-list="false" :auto-upload="false" accept=".pdf, .doc, .docx, .xls, .xlsx"
-                @change="uploadImage($event)" style="display: flex; align-items: center;">
-                <el-icon class="btn-icon">
-                  <Refresh />
+              <div class="fileBtn flex a-c">
+                <el-upload :show-file-list="false" :auto-upload="false" accept=".pdf, .doc, .docx, .xls, .xlsx"
+                  @change="uploadImage($event)" style="display: flex; align-items: center;">
+                  <el-icon class="btn-icon">
+                    <Refresh />
+                  </el-icon>
+                </el-upload>
+                <el-icon class="btn-icon" @click="Fileonload(agreementInfo.fileUrl, agreementInfo.fileName)">
+                  <Download />
                 </el-icon>
-              </el-upload>
-              <el-icon class="btn-icon" @click="Fileonload(agreementInfo.fileUrl, agreementInfo.fileName)">
-                <Download />
-              </el-icon>
+              </div>
             </div>
           </div>
+
         </el-tab-pane>
         <el-tab-pane label="费用管理" name="costManagement">
           <span class="strong m-right-20">规则与费用</span>
@@ -188,10 +193,10 @@
     </el-drawer>
     <!-- 协议授权弹窗 -->
     <auth-Drawer :Drawer="agreementAuthDrawer" @cancel="agreementAuthDrawer = false" @save="DrawerSave"
-      @query="Drawerquery" :deptlist="deptauthList" :checkedKeys="checkedKeys" :checkedIds="checkedIds"></auth-Drawer>
+      @query="Drawerquery" @echoValue="echoValue" :deptlist="deptauthList" :checkedKeys="checkedKeys" :checkedIds="checkedIds"></auth-Drawer>
     <!-- 规则条件弹窗 -->
-    <RuleCondition v-if="ruleConditionVisible" :ruleConditionVisible="ruleConditionVisible"
-      @cancel="ruleConditionVisible = false" @save="ruleConditionSave" :attrIdList="rulesAttrListInfo.rulesAttrList" />
+    <RuleCondition :ruleConditionVisible="ruleConditionVisible" @cancel="ruleConditionVisible = false"
+      @save="ruleConditionSave" :attrIdList="rulesAttrListInfo.rulesAttrList" />
     <!-- 规则费用抽屉组件 -->
     <ruleFeeDialog v-if="ruleFeeVisible" :ruleFeeVisible="ruleFeeVisible" :agreementInfo="agreementInfo"
       :RulesInfo="RulesInfo" @save="ruleFeeSave" @cancel="ruleFeeVisible = false" />
@@ -209,7 +214,7 @@ import { ElMessage, ElMessageBox, DrawerProps, TabsInstance } from 'element-plus
 import { ref, reactive } from 'vue'
 import { useRoute, useRouter } from 'vue-router';
 import { loadDicts, getDict } from '@/utils/composables/dictService';//字典组件
-import { Fileonload, formatFileSize,processFileName } from '@/utils/composables/fileProcessing';//文件处理工具
+import { Fileonload, formatFileSize, processFileName } from '@/utils/composables/fileProcessing';//文件处理工具
 import authDrawer from "./components/agreementAuth.vue";
 import ruleFeeDialog from "./components/ruleFeeDialog.vue";
 import ruleFeeDialogEdit from "./components/ruleFeeDialogEdit.vue";
@@ -238,8 +243,10 @@ onBeforeMount(async () => {
 const detailsInfo = () => {
   api.agreementApi.agreementGet(id.value).then((res: any) => {
     if (res.code == '200') {
-      res.data.agreement.fileName=processFileName(res.data.agreement.fileName)
-      res.data.agreement.fileSize=formatFileSize(res.data.agreement.fileSize);
+      if (res.data.fileUrl) {
+        res.data.agreement.fileName = processFileName(res.data.agreement.fileName)
+        res.data.agreement.fileSize = formatFileSize(res.data.agreement.fileSize);
+      }
       agreementInfo.value = res.data.agreement;
 
       authDeptlength.value = res.data.dept.length;
@@ -268,8 +275,14 @@ const checkedIds = ref<string[]>([])//授权机构回显id
 const Drawerquery = (name: any) => {
   agreementAuth(name)
 }
+//全选赋值
+const echoValue=(ids:any[])=>{
+  checkedKeys.value=ids;
+}
 //授权保存
 const DrawerSave = (list: any) => {
+  console.log(list)
+  return;
   api.agreementApi.authSave({ deptIds: list, id: id.value }).then((res: any) => {
     if (res.code == '200') {
       ElMessage({
@@ -314,6 +327,7 @@ function getUncheckedIds(data: any[]): string[] {
 
 //更多操作集合
 const dropdownCommand = (e: any) => {
+  console.log(e)
   switch (e) {
     case '启用':
       api.agreementApi.sysUpAndDown({ ids: [id.value], opType: '0' }).then((res: any) => {
@@ -382,6 +396,12 @@ const dropdownCommand = (e: any) => {
         })
       break;
     case '复制协议':
+      router.push({
+        name: 'AgreementCopy',
+        query: {
+          id: id.value
+        }
+      })
       break;
     default:
       break;
@@ -487,6 +507,7 @@ const ruleEdit = (id: string) => {
   api.agreementApi.agreementRulesGet(id).then((res: any) => {
     if (res.code == '200') {
       rulesAttrListInfo.rulesAttrList = processArray(res.data.costsAttrLinks);
+      console.log(rulesAttrListInfo.rulesAttrList)
     } else {
     }
   });
@@ -623,11 +644,15 @@ const ruleFeeAdd = (item: any) => {
 }
 //费用提交
 const ruleFeeSave = (data: object) => {
-
   api.agreementApi.ptlAgreementCostsave(data).then((res: any) => {
     if (res.code == '200') {
       ruleFeeVisible.value = false;
     } else {
+      ElMessage({
+        type: 'error',
+        message: res.msg,
+        plain: true,
+      });
     }
   });
 }
@@ -644,9 +669,9 @@ const ruleFeeEditSave = (data: object) => {
   });
 }
 //编辑删除费用
-const costitemEdit =  (id: string, item: any) => {
+const costitemEdit = (id: string, item: any) => {
   RulesInfo.value = item;
-   api.agreementApi.AgreementFeeById(id).then((res: any) => {
+  api.agreementApi.AgreementFeeById(id).then((res: any) => {
     if (res.code == '200') {
       res.data.ruleConditions = processArray(res.data.ruleConditions);
       ruleFeeHeaderTitle.value = res.data.productName;
@@ -695,7 +720,6 @@ const rulesAttrListInfo = reactive<rulesAttrListInfo>({
   rulesAttrList: []
 });//规则条件列表数据
 const ruleConditionSave = (list: string[]) => {//获取规则条件选中集合
-
   rulesAttrListInfo.rulesAttrList = list;
   ruleConditionVisible.value = false;
 }
@@ -716,7 +740,7 @@ const rulesAttrselectChange = (item: any) => {
 }
 //协议文件处理
 //上传
-const uploadImage =  (file: any) => {
+const uploadImage = (file: any) => {
   let files = file.raw
   const params = new FormData(); // 声明formData数据类型
   params.append("file", files);

+ 24 - 3
src/views/quoteConfig/agreement/agreementIndex.vue

@@ -183,7 +183,8 @@ function findpage() {
   });
 }
 const columns = [
-  { prop: "agreementCode", label: "协议编号", width: '200', },
+  { prop: "agreementCode", label: "协议编号", width: '200',component: "RouterLink",
+  formatter: (row: any) => ({ name: 'AgreementDetails', query: { id: row.id} }) },
   {
     prop: "agreementTitle", label: "协议名称", width: '200',
   },
@@ -240,8 +241,14 @@ const columns = [
     }
   },
   { prop: "company", label: "保险公司", width: '200' },
-  { prop: "dockingPerson", label: "对接人", width: '200' },
-  { prop: "custodianId", label: "管理人", width: '200' },
+  { prop: "dockingPerson", label: "对接人", width: '200', formatter: (row: any) => {
+      return `${row.dockingPerson}-${row.dockingPhone}`
+    } },
+  { prop: "custodianId", label: "管理人", width: '200',
+  formatter: (row: any) => {
+      return `${row.managerName}-${row.managerDeptName}`
+    }
+  },
   { prop: "startDate", label: "生效时间", width: '200' },
   { prop: "endDate", label: "失效时间", width: '200' },
   { prop: "createTime", label: "添加时间", width: '200' },
@@ -467,6 +474,20 @@ const sysUpAndDown = async (type: string, list?: string[]) => {
 }
 const resetForm = () => {
   formInline.searchValue = '';
+  formInline.deptId = '';
+  formInline.companyId = '';
+  formInline.agreementType = '';
+  formInline.validStatus = '';
+  formInline.isEnable = '';
+  formInline.withTax = '';
+  formInline.dockingPerson = '';
+  formInline.attributionName = '';
+  formInline.takeStartDate = '';
+  formInline.takeEndDate = '';
+  formInline.loseStartDate = '';
+  formInline.loseEndDate = '';
+  formInline.value1 = [];
+  formInline.value2 = [];
   provinceoptions.value = [];
   findpage();
 }

+ 29 - 6
src/views/quoteConfig/agreement/components/agreementAuth.vue

@@ -12,7 +12,7 @@
               :prefix-icon="Search" />
             <el-button @click="query">查询</el-button>
           </div>
-          <el-checkbox v-model="checkedALL" label="全选" size="large" />
+          <el-checkbox v-model="checkedALL" label="全选" size="large" @change="TreeselectAll" />
           <el-tree :data="props.deptlist" show-checkbox node-key="id" ref="treeRef" :props="defaultProps"
             :default-expand-all="true" @check="handleCheck" :default-checked-keys="props.checkedKeys"
             :check-strictly="true" />
@@ -31,7 +31,7 @@
 <!-- 行为区域 -->
 <script lang="ts" setup>
 import { defineProps, defineEmits } from "vue";
-import { DrawerProps } from 'element-plus';
+import { DrawerProps,ElTree } from 'element-plus';
 import { Search } from '@element-plus/icons-vue'
 const props = defineProps<{
   Drawer: boolean,
@@ -39,15 +39,14 @@ const props = defineProps<{
   checkedKeys: string[]
   checkedIds: string[]
 }>();
-const emits = defineEmits(["cancel", 'save', 'DrawerOpen', 'query']);
+const emits = defineEmits(["cancel", 'save', 'DrawerOpen', 'query','echoValue']);
 const defaultProps = {
   children: 'children',
   label: 'name',
 }
 const direction = ref<DrawerProps['direction']>('rtl')
 const deptName = ref('');
-
-
+const treeRef = ref<InstanceType<typeof ElTree>>();
 const checkedALL = ref(false)
 const ids = ref()//id集合
 const DrawerOpen = () => {
@@ -57,7 +56,9 @@ watch(props, () => {
   if (props.Drawer) {
     ids.value = props.checkedIds;
   }
-
+  if(props.checkedKeys){
+    ids.value=props.checkedKeys;
+  }
 })
 const cancel = () => {
   emits('cancel')
@@ -80,4 +81,26 @@ const handleCheck = (
 ) => {
   ids.value = checkedInfo.checkedKeys;
 };
+//全选
+const TreeselectAll = (value: string | number | boolean) => {
+  ids.value = [];//全选操作是清空历史数据
+  const allKeys = getAllKeys(props.deptlist, 'id');//递归id集合
+  if (value) {
+    emits('echoValue',allKeys)
+  } else {
+    treeRef.value?.setCheckedKeys([]);
+    ids.value = [];
+  }
+}
+//递归
+const getAllKeys = (data: any[], type: string) => {
+  let keys: any = [];
+  data.forEach(item => {
+    keys.push(type == 'id' ? item.id : item); // 假设每个节点有 id 属性
+    if (item.children) {
+      keys = keys.concat(getAllKeys(item.children, type == 'id' ? 'id' : 'perms'));
+    }
+  });
+  return keys;
+}
 </script>

+ 28 - 2
src/views/quoteConfig/agreement/components/ruleFeeDialog.vue

@@ -1,7 +1,8 @@
 <!-- 模板区域 -->
 <template>
   <div>
-    <el-drawer v-model="props.ruleFeeVisible" :direction="direction" :close-on-click-modal="false" size="57%" @close="close">
+    <el-drawer v-model="props.ruleFeeVisible" :direction="direction" :close-on-click-modal="false" size="57%"
+      @close="close">
       <template #header>
         <h4>添加费用</h4>
       </template>
@@ -202,6 +203,9 @@ const feerules = ref<FormRules>({
   ],
 
 })
+interface RuleCondition {
+  min: number | string;
+}
 onMounted(async () => {
   await loadDicts(['insurance_type'])
   const dict = getDict('insurance_type');
@@ -259,7 +263,7 @@ const ruleConditionSave = (list: string[]) => {//获取规则条件选中集合
 const cancel = () => {
   emits("cancel")
 }
-const close=()=>{
+const close = () => {
   emits("cancel")
 }
 const save = async (formEl: FormInstance | undefined | any) => {
@@ -279,6 +283,16 @@ const save = async (formEl: FormInstance | undefined | any) => {
             } else {
               resolve(true);
             }
+            const result = checkArrayValues(ruleFeeinfo.value[insuranceTypeIndex.value].ptlAgreementCostAddList[index].ruleConditions as RuleCondition[], "min");
+            if(!result){
+              ElMessage({
+                type: 'error',
+                message: `规则条件不能为空值`,
+                plain: true,
+              });
+            }else{
+              resolve(true);
+            }
           } else {
             reject(index);
           }
@@ -297,6 +311,8 @@ const save = async (formEl: FormInstance | undefined | any) => {
       val.coverRuleId = props.RulesInfo.id;
       return val;
     })
+    // console.log(ruleFeeinfo.value)
+    // return;
     emits("save", ruleFeeinfo.value)
   } catch (error) {
     const invalidIndex: any = error; // 获取未通过校验的表单索引
@@ -312,6 +328,16 @@ const save = async (formEl: FormInstance | undefined | any) => {
     });
   }
 };
+const checkArrayValues = <T, K extends keyof T>(arr: T[], key: K) => {
+  // 遍历数组
+  for (let item of arr) {
+    // 检查指定键的值是否为空
+    if (item[key] === null || item[key] === undefined || item[key] === "") {
+      return false; // 如果为空,返回 false
+    }
+  }
+  return true; // 如果所有值都不为空,返回 true
+}
 //添加规则条件
 const addRuleCondition = (index: number, Costindex: number) => {
   insuranceTypeIndex.value = index;

+ 1 - 2
src/views/quoteConfig/agreement/components/ruleFeeDialogEdit.vue

@@ -128,7 +128,7 @@
           <el-button @click="cancel">取消</el-button>
           <el-button type="primary" @click="save">提交审核</el-button>
         </div>
-        <div class="flex f-c " v-if="!costitemEditInfo?.reviewDescription">
+        <div class="flex f-c " v-if="!costitemEditInfo?.reviewDescription && props.operationType == 'audit'">
           <el-checkbox v-model="automatic" label="审核后,自动跳支审核下一条费用" size="large" />
           <div class="flex a-c">
             <el-button @click="rejectOperation">审核驳回</el-button>
@@ -218,7 +218,6 @@ const rulesAttrselectChange = (item: any) => {
 }
 //获取到的规则条件列表数据
 const ruleConditionSave = (list: string[]) => {//获取规则条件选中集合
-  console.log(list)
   costitemEditInfo.value.ruleConditions = list;
   ruleConditionVisible.value = false;
 }

+ 5 - 2
src/views/quoteConfig/costManagement.vue

@@ -78,7 +78,7 @@
       <template #footer>
         <div class="dialog-footer">
           <el-button @click="agreementSelectionVisible = false">取消</el-button>
-          <el-button type="primary" @click="agreementSelectionConfirm">
+          <el-button type="primary" @click="agreementSelectionConfirm" :disabled="!ruleInfo">
             确定
           </el-button>
         </div>
@@ -155,7 +155,7 @@ const formInline = reactive({
 
 //表格字段数据
 const fields = ref([
-  { label: "所属协议", model: "agreement", type: "input", placeholder: "输入代码,名称,简称查找" },
+  { label: "所属协议", model: "agreement", type: "input", placeholder: "输入协议号,名称,简称查找" },
   {
     label: "险种", model: "productId", type: "select", options: insurance_type,
   },
@@ -295,6 +295,7 @@ const agreemenUpdate = async (item: any) => {
       res.data.ruleConditions = processArray(res.data.ruleConditions);
       costitemEditInfo.value = res.data;
       ruleFeeEditVisible.value = true;
+      console.log(costitemEditInfo.value)
     } else {
     }
   });
@@ -523,6 +524,8 @@ const agreementSelection = () => {
   agreementSelectionVisible.value = true;
 }
 const ItemClick = (item: any) => {
+  console.log(item)
+  console.log(ruleInfo.value)
   AgreementInfo.value = item;
   AgreementId.value = item.id;
   api.agreementApi.agreementRulesList(AgreementId.value).then((res: any) => {