Ver código fonte

fix:修改bug

wuguojie 1 ano atrás
pai
commit
08c0ebd4ca

+ 5 - 2
src/api/modules/project.ts

@@ -20,8 +20,11 @@ const projectApi = (axiosInstance: ApiInstance) => ({
   getSchemeByCompany: (data: {
     companyId: string,
     productId: string,
-    schemeType: string
-  }) => axiosInstance.get(`/scheme/getSchemeByCompany?companyId=${data.companyId}&productId=${data.productId}&schemeType=${data.schemeType}`), // 新增时如果有方案获取对应方案
+    schemeType: string,
+    energyType: string,
+    vehicleType: string,
+    carnature: string
+  }) => axiosInstance.get(`/scheme/getSchemeByCompany?companyId=${data.companyId}&productId=${data.productId}&schemeType=${data.schemeType}&energyType=${data.energyType}&vehicleType=${data.vehicleType}&carnature=${data.carnature}`), // 新增时如果有方案获取对应方案
   getCompanyList:() => axiosInstance.get(`/scheme/getCompanyList?systemCode=${localStorage.getItem('login_system')}`), // 保司list
   getById: (data: string) => axiosInstance.get(`/jyxConfig/getById?id=${data}`), // 驾意险详情
 })

+ 0 - 21
src/components/ruleCondition/index.vue

@@ -210,14 +210,6 @@ const dataStore = reactive<dataStore>({
     InsuranceInformation: [], //车主信息
     InsuranceCostFactor: [],//保司费用因子
 })
-const dataStoreNo = reactive<dataStore>({
-    VehicleInformation: [],//车辆信息
-    VehicleOwnerInformation: [],//车主信息
-    PolicyholderInformation: [],//车主信息
-    InsuredInformation: [],//车主信息
-    InsuranceInformation: [], //车主信息
-    InsuranceCostFactor: [],//保司费用因子
-})
 interface checkeddata {
   [key: string]: any[]
 }
@@ -245,7 +237,6 @@ interface dataStore {
 
 onMounted(() => {
   ruleAttr();
-  ruleAttrNo();
   regionLicenseRegion('0');//车牌地区
   regionLicenseNumber('14');//车牌号
 })
@@ -262,18 +253,6 @@ const ruleAttr = () => {
     }
   });
 }
-const ruleAttrNo = () => {
-    api.agreementApi.ruleAttrGroup({ attrName: '' }).then((res: any) => {
-        if (res.code == '200') {
-            dataStoreNo.VehicleInformation = res.data.VehicleInformation ? processArray(res.data.VehicleInformation) : [];
-            dataStoreNo.VehicleOwnerInformation = res.data.VehicleOwnerInformation ? processArray(res.data.VehicleOwnerInformation) : [];
-            dataStoreNo.PolicyholderInformation = res.data.PolicyholderInformation ? processArray(res.data.PolicyholderInformation) : [];
-            dataStoreNo.InsuredInformation = res.data.InsuredInformation ? processArray(res.data.InsuredInformation) : [];
-            dataStoreNo.InsuranceInformation = res.data.InsuranceInformation ? processArray(res.data.InsuranceInformation) : [];
-            dataStoreNo.InsuranceCostFactor = res.data.InsuranceCostFactor ? processArray(res.data.InsuranceCostFactor) : [];
-        }
-    });
-}
 //选择事件集中处理
 type title = keyof typeof dataStore;
 const change = (value: any, title: title) => {

+ 1 - 3
src/components/ruleConditionContainer/index.vue

@@ -30,7 +30,7 @@
             <el-select v-model="item.minArray" placeholder="选择值" clearable filterable multiple :disabled="disabled"
               @change="change($event, index)">
               <el-option v-for="dictLabalitem in item.dictLabal" :key="dictLabalitem.id" :label="dictLabalitem.name"
-                :value="dictLabalitem.name" />
+                :value="item.attrName == '车辆种类' ||item.attrName == '使用性质' ||item.attrName == '能源类型'  ? dictLabalitem.code : dictLabalitem.name" />
             </el-select>
           </template>
           <template v-if="item.attrType == 'inputNumber'">
@@ -143,12 +143,10 @@ const props = defineProps<{
 const emits = defineEmits(["Del", 'save', 'selectChange']);
 //右侧删除图标
 const attrDel = (index: number) => {
-  console.log(index)
   emits('Del', index)
 }
 
 const change = (e: string[] | undefined, index: number) => {
-  console.log(e)
   emits('selectChange', { e, index })
 }
 onMounted(() => {

+ 218 - 0
src/layouts/components/ruleSelect/index.vue

@@ -0,0 +1,218 @@
+<template>
+    <div class="rule">
+        <div class="header">
+            <el-input v-model="searchValue" clearable>
+                <template #append>
+                    <el-button type="primary" @click="search">搜索</el-button>
+                </template>
+            </el-input>
+        </div>
+        <div class="content">
+            <div class="types">
+                <div class="typesItem" :class="{'active': itemIndex === index}" v-for="(item, index) in typeList" :key="index" @click="handleItemClick(item, index)">
+                    {{ item.name }}
+                </div>
+            </div>
+            <el-divider direction="vertical" style="height: 260px"></el-divider>
+            <template v-for="(item, index) in dataStore" :key="index">
+                <div class="selectList" v-if="itemIndex === index">
+                    <div class="selectItem" :class="{'active': sub.checked}" v-for="(sub,min) in item.list" :key="min" @click="handleSubClick(sub, min)">
+                        <el-icon class="icon"><Select v-show="sub.checked" /></el-icon>
+                        <span>{{ sub.attrName }}</span>
+                    </div>
+                </div>
+            </template>
+        </div>
+        <div class="footer">
+            <el-button @click="handleCancel">取消</el-button>
+            <el-button type="primary" @click="handleSubmit">确定</el-button>
+        </div>
+    </div>
+</template>
+
+<script setup lang="ts">
+import api from '@/api'
+
+const emit = defineEmits(['close'])
+
+let searchValue = ref('')
+const search = () => {
+    ruleAttr();
+}
+
+const typeList = ref([
+    {
+        name: "车辆信息",
+        type: 'VehicleInformation'
+    },
+    {
+        name: "车主信息",
+        type: 'VehicleOwnerInformation'
+
+    },
+    {
+        name: "投保人信息",
+        type: 'PolicyholderInformation'
+
+    },
+    {
+        name: "被保人信息",
+        type: 'InsuredInformation'
+
+    },
+    {
+        name: "商业险",
+        type: 'InsuranceInformation'
+
+    },
+    {
+        name: "保司费用因子",
+        type: 'InsuranceCostFactor'
+
+    }
+])
+
+let itemIndex = ref(0)
+let selectedList = ref([]) // 初始已选数据
+let selectList = ref([]) // 已选的数据
+let dataStore = ref([])
+const ruleAttr = () => {
+    api.agreementApi.ruleAttrGroup({ attrName: searchValue.value }).then((res: any) => {
+        if (res.code == '200') {
+            let arr = typeList.value
+            arr.forEach(a => {
+                a.list = res.data[a.type]
+            })
+            dataStore.value = arr
+            dataStore.value.forEach(a => {
+                a.list?.forEach(b => {
+                    b.checked = false
+                    selectList.value.forEach(c => {
+                        if(c.attrName === b.attrName) {
+                            b.checked = true
+                        }
+                    })
+                })
+            })
+        }
+    });
+}
+const handleItemClick = (item, index) => {
+    itemIndex.value = index
+}
+const handleSubClick = (item, index) => {
+    item.checked = !item.checked
+    if(item.checked) {
+        selectList.value.push(item)
+    } else {
+        selectList.value = selectList.value.filter(a => a.attrName != item.attrName)
+    }
+    console.log('变化后的数据', selectList.value)
+}
+
+// 取消
+const handleCancel = () => {
+    console.log('取消', selectedList.value)
+    emit('close', selectedList.value)
+}
+// 确定
+const handleSubmit = () => {
+    console.log('确定', dataStore.value)
+    let arr = []
+    dataStore.value.forEach(a => {
+        a.list?.forEach(b => {
+            if(b.checked) {
+                arr.push(b)
+            }
+        })
+    })
+    emit('close', arr)
+}
+
+const initEditData = (data) => {
+    dataStore.value = []
+    api.agreementApi.ruleAttrGroup({ attrName: '' }).then(res => {
+        let arr = typeList.value
+        arr.forEach(a => {
+            a.list = res.data[a.type]
+        })
+        dataStore.value = arr
+        if(data&&data.length>0) {
+            selectedList.value = JSON.parse(JSON.stringify(data))
+            selectList.value = JSON.parse(JSON.stringify(data))
+            dataStore.value.forEach(a => {
+                a.list?.forEach(b => {
+                    b.checked = false
+                    data.forEach(c => {
+                        if(c.attrName === b.attrName) {
+                            b.checked = true
+                        }
+                    })
+                })
+            })
+        }
+    })
+}
+
+defineExpose({
+    initEditData
+})
+
+
+</script>
+
+<style scoped lang="scss">
+.rule{
+    width: 100%;
+    .content{
+        width: 100%;
+        height: 260px;
+        overflow: hidden;
+        display: flex;
+        justify-content: flex-start;
+        margin-top: 10px;
+        .types{
+            width: 110px;
+            .typesItem{
+                padding: 6px 8px;
+                text-align: center;
+                margin-bottom: 10px;
+                cursor: pointer;
+            }
+            .active{
+                color: #0083ff;
+                background: #f4faff;
+                transition: .3s;
+            }
+        }
+        .selectList{
+            max-height: 260px;
+            overflow-y: auto;
+            width: calc(100% - 130px);
+            .selectItem{
+                display: flex;
+                align-items: center;
+                justify-content: flex-start;
+                cursor: pointer;
+                .icon{
+                    border: 1px solid #ccc;
+                    margin: 5px;
+                }
+            }
+            .active{
+                .icon{
+                    background: #0083ff;
+                    border-color: #0083ff;
+                    color: #FFFFFF;
+                }
+
+            }
+        }
+    }
+    .footer{
+        display: flex;
+        align-items: center;
+        justify-content: flex-end;
+    }
+}
+</style>

+ 1 - 1
src/views/insurancePolicy/index.vue

@@ -1092,7 +1092,7 @@
                 <div v-if="currentRow.some(a => a.id === scope.row.id)">
                   <el-button link type="primary" @click="handleCount(scope)">优惠测算</el-button>
                   <el-button link type="primary">详情</el-button>
-                  <el-button link type="primary" :loading="loading" @click="handleSubmit(InsurancePolicyRefs,scope)">计算保费</el-button>
+                  <el-button link type="primary" :loading="scope.row.loading" @click="handleSubmit(InsurancePolicyRefs,scope)">计算保费</el-button>
                   <el-button link type="primary" @click="handleShare(scope)">分享</el-button>
                   <el-button link type="primary" @click="handleUnderwriting(scope)">核保</el-button>
                 </div>

+ 29 - 9
src/views/operationManagement/channel.vue

@@ -126,15 +126,27 @@
       title="设置负责人"
       width="800"
     >
-      <el-radio-group v-if="tableData?.length>0" v-model="radioValue" class="allocation-radio">
-        <el-radio v-for="item in tableData" :value="item.id" size="large">
-          <template #default>
-            <div>{{ item.name }}</div>
-            <div>{{ item.id }}</div>
-          </template>
-        </el-radio>
-      </el-radio-group>
-      <el-empty v-else description="暂无数据" />
+        <el-row :gutter="20">
+            <el-col :span="12">
+                <el-tree
+                        ref="treeRef"
+                        :data="options"
+                        :props="cascaderProps"
+                        @node-click="handleNodeClick"
+                />
+            </el-col>
+            <el-col :span="12">
+                <el-radio-group v-if="tableData?.length>0" v-model="radioValue" class="allocation-radio">
+                    <el-radio v-for="item in tableData" :value="item.id" size="large">
+                        <template #default>
+                            <div>{{ item.name }}</div>
+                            <div>{{ item.id }}</div>
+                        </template>
+                    </el-radio>
+                </el-radio-group>
+                <el-empty v-else description="暂无数据" />
+            </el-col>
+        </el-row>
       <template #footer>
         <el-button @click="onCancel">取消</el-button>
         <el-button type="primary" @click="onConfirm">确定</el-button>
@@ -161,6 +173,11 @@ const AddOperationRef = ref(null)
 const AllocationRef = ref(null)
 
 // 机构数据
+const cascaderProps = {
+    value: 'id',
+    label: 'name',
+    children: 'children'
+}
 let options = ref([])
 // 获取机构数据
 const institutionList = () => {
@@ -175,6 +192,9 @@ const institutionList = () => {
     }
   })
 }
+const handleNodeClick = (data) => {
+    initList(teamData.value[0])
+}
 
 // 团队
 let treeValue = ref('')

+ 0 - 1
src/views/operationManagement/modules/allocation.vue

@@ -37,7 +37,6 @@
 </template>
 
 <script setup lang="ts">
-import { ref, onMounted, defineEmits,watch } from 'vue'
 import api from '@/api'
 import { ElMessage } from 'element-plus'
 

+ 7 - 6
src/views/operationManagement/operationDetail.vue

@@ -81,6 +81,7 @@
                 <template #default>
                   <el-table
                     :data="dataDetail?.bankCardList"
+                    height="200"
                   >
                     <el-table-column prop="name" label="姓名"></el-table-column>
                     <el-table-column prop="bankName" label="开户行">
@@ -552,6 +553,12 @@ onMounted(() => {
     .allName{
       font-size: 14px;
     }
+  }
+  .message{
+    background: white;
+    :deep(.el-tabs__nav-scroll) {
+      padding: 24px 0 0 24px;
+    }
     .other{
       .fileItem{
         display: flex;
@@ -601,12 +608,6 @@ onMounted(() => {
       }
     }
   }
-  .message{
-    background: white;
-    :deep(.el-tabs__nav-scroll) {
-      padding: 24px 0 0 24px;
-    }
-  }
   .image-box{
     display: flex;
     align-content: center;

+ 29 - 11
src/views/operationManagement/team.vue

@@ -126,15 +126,27 @@
       title="设置负责人"
       width="800"
     >
-      <el-radio-group v-if="tableData?.length>0" v-model="radioValue" class="allocation-radio">
-        <el-radio v-for="item in tableData" :value="item.id" size="large">
-          <template #default>
-            <div>{{ item.name }}</div>
-            <div>{{ item.id }}</div>
-          </template>
-        </el-radio>
-      </el-radio-group>
-      <el-empty v-else description="暂无数据" />
+        <el-row :gutter="20">
+            <el-col :span="12">
+                <el-tree
+                        ref="treeRef"
+                        :data="options"
+                        :props="cascaderProps"
+                        @node-click="handleNodeClick"
+                />
+            </el-col>
+            <el-col :span="12">
+                <el-radio-group v-if="tableData?.length>0" v-model="radioValue" class="allocation-radio">
+                    <el-radio v-for="item in tableData" :value="item.id" size="large">
+                        <template #default>
+                            <div>{{ item.name }}</div>
+                            <div>{{ item.id }}</div>
+                        </template>
+                    </el-radio>
+                </el-radio-group>
+                <el-empty v-else description="暂无数据" />
+            </el-col>
+        </el-row>
       <template #footer>
         <el-button @click="onCancel">取消</el-button>
         <el-button type="primary" @click="onConfirm">确定</el-button>
@@ -144,14 +156,12 @@
 </template>
 
 <script setup lang="ts">
-import { ref, onMounted } from 'vue'
 import {ElMessageBox, ElMessage, TableInstance} from 'element-plus'
 import { useRouter } from 'vue-router'
 import api from "@/api";
 import addOperation from './modules/addOperation.vue'
 import allocation from './modules/allocation.vue'
 import addTeam from './modules/addTeam.vue'
-import Allocation from "@/views/operationManagement/modules/allocation.vue";
 import {initial} from "lodash-es";
 import team from "@/api/modules/team.ts";
 
@@ -161,6 +171,11 @@ const AddOperationRef = ref(null)
 const AllocationRef = ref(null)
 
 // 机构数据
+const cascaderProps = {
+    value: 'id',
+    label: 'name',
+    children: 'children'
+}
 let options = ref([])
 // 获取机构数据
 const institutionList = () => {
@@ -175,6 +190,9 @@ const institutionList = () => {
     }
   })
 }
+const handleNodeClick = (data) => {
+    initList(teamData.value[0])
+}
 
 // 团队
 let treeValue = ref('')

+ 29 - 9
src/views/operationManagement/telemarketing.vue

@@ -126,15 +126,27 @@
       title="设置负责人"
       width="800"
     >
-      <el-radio-group v-if="tableData?.length>0" v-model="radioValue" class="allocation-radio">
-        <el-radio v-for="item in tableData" :value="item.id" size="large">
-          <template #default>
-            <div>{{ item.name }}</div>
-            <div>{{ item.id }}</div>
-          </template>
-        </el-radio>
-      </el-radio-group>
-      <el-empty v-else description="暂无数据" />
+        <el-row :gutter="20">
+            <el-col :span="12">
+                <el-tree
+                        ref="treeRef"
+                        :data="options"
+                        :props="cascaderProps"
+                        @node-click="handleNodeClick"
+                />
+            </el-col>
+            <el-col :span="12">
+                <el-radio-group v-if="tableData?.length>0" v-model="radioValue" class="allocation-radio">
+                    <el-radio v-for="item in tableData" :value="item.id" size="large">
+                        <template #default>
+                            <div>{{ item.name }}</div>
+                            <div>{{ item.id }}</div>
+                        </template>
+                    </el-radio>
+                </el-radio-group>
+                <el-empty v-else description="暂无数据" />
+            </el-col>
+        </el-row>
       <template #footer>
         <el-button @click="onCancel">取消</el-button>
         <el-button type="primary" @click="onConfirm">确定</el-button>
@@ -161,6 +173,11 @@ const AddOperationRef = ref(null)
 const AllocationRef = ref(null)
 
 // 机构数据
+const cascaderProps = {
+    value: 'id',
+    label: 'name',
+    children: 'children'
+}
 let options = ref([])
 // 获取机构数据
 const institutionList = () => {
@@ -175,6 +192,9 @@ const institutionList = () => {
     }
   })
 }
+const handleNodeClick = (data) => {
+    initList(teamData.value[0])
+}
 
 // 团队
 let treeValue = ref('')

+ 1 - 2
src/views/personnel/memberManagement.vue

@@ -554,9 +554,7 @@ const deptDialogVisible=ref(false)
 const changeDeptDialog = ref(false);
 const operationForm=ref({})
 function changeDept(item:any) {
-console.log('列表点击的', item)
   operationForm.value=item.operationData.row
-    deptItem.name = item.operationData.row.deptName
   api.userApi
     .checkChangeDept({
       userId: item.operationData.row.userId,
@@ -567,6 +565,7 @@ console.log('列表点击的', item)
 
         changeDeptDialog.value = true;
         deptItem.value={}
+        deptItem.value.name = item.operationData.row.deptName
       }
     });
 }

+ 5 - 10
src/views/personnel/modules/addOperation.vue

@@ -64,7 +64,7 @@
             </el-row>
             <el-row :gutter="24">
                 <el-col :span="12">
-                    <el-form-item prop="isAddSalesman" label="同时添加为业务员">
+                    <el-form-item prop="isAddSalesman" label="同时添加为业务员" v-show="!route.query.id">
                         <el-select v-model="operationForm.isAddSalesman">
                             <el-option label="是" value="1" key="1"></el-option>
                             <el-option label="否" value="0" key="0"></el-option>
@@ -72,7 +72,7 @@
                     </el-form-item>
                 </el-col>
                 <el-col :span="12">
-                    <el-form-item prop="typeAttr" label="业务员类型">
+                    <el-form-item prop="typeAttr" label="业务员类型" v-show="operationForm.isAddSalesman == '1'">
                         <el-select v-model="operationForm.typeAttr" placeholder="请选择业务员类型" @change="typeAttrChange">
                             <el-option key="1" value="1" label="个代"></el-option>
                             <el-option key="2" value="3" label="渠道"></el-option>
@@ -827,23 +827,18 @@ onMounted(async () => {
       // console.log(res);
       if (res.code === 200) {
         operationForm.value = res.data;
+        if(operationForm.value.typeAttr != 6) {
+            initTeamData(operationForm.value.typeAttr==='5'?'1':operationForm.value.typeAttr==='8'?'2':operationForm.value.typeAttr==='7'?'3':'')
+        }
         let formData = res.data
-
         if(formData.fileList) {
-
-
           let sfz1 = formData.fileList.find(item => item.fileType == 'sfz1')
           let sfz2 = formData.fileList.find(item => item.fileType == 'sfz2')
-
           let qualification = formData.fileList.find(item => item.fileType == 'bankCard')
           let contractImg = formData.fileList.find(item => item.fileType == 'contract')
           let applicantImg = formData.fileList.find(item => item.fileType == 'applicant')
           let salaryTable = formData.fileList.find(item => item.fileType == 'salaryTable')
           let leaveTable = formData.fileList.find(item => item.fileType == 'leaveTable')
-
-
-
-
           if(sfz1) {
             operationForm.value.sfz1 = sfz1.id
             IDCardFrontName.value = sfz1.fileName

+ 1 - 1
src/views/personnel/modules/memberMessage.vue

@@ -1247,7 +1247,7 @@ function changeDept() {
     .then((res: any) => {
       if (res.code === 200) {
         // transferInfo.value=res.data
-
+        deptItem.value.name = operationForm.value.deptName
         changeDeptDialog.value = true;
       }
     });

+ 115 - 13
src/views/quoteConfig/project/modules/projectAdd.vue

@@ -36,7 +36,7 @@
             <div style="width: 60%">
               <rule-condition-container :rulesAttrList="rulesAttrList" @Del="handleDel"></rule-condition-container>
             </div>
-            <rule-condition :ruleConditionVisible="rulesShow" :attrIdList="rulesAttrList" @save="saveRule" @cancel="cancelRule"></rule-condition>
+<!--            <rule-condition :ruleConditionVisible="rulesShow" :attrIdList="rulesAttrList" @save="saveRule" @cancel="cancelRule"></rule-condition>-->
           </div>
           <el-button style="margin: 10px 10%" plain type="primary" icon="plus" @click="addRules">添加条件</el-button>
           <el-descriptions>
@@ -155,6 +155,13 @@
     >
       <detail ref="JYXDetail"></detail>
     </el-dialog>
+      <el-dialog
+        v-model="ruleSelectShow"
+        title="规则条件"
+        width="600"
+      >
+          <ruleSelect ref="RuleSelect" @close="handleRuleSelectClose"></ruleSelect>
+      </el-dialog>
   </div>
 </template>
 
@@ -167,6 +174,7 @@ import insurance from '../../../../layouts/components/InsuranceType/index.vue'
 import driving from '../../../../layouts/components/DrivingType/index.vue'
 import rule from '../../../../components/ruleConditionContainer/index.vue'
 import detail from '../../../../layouts/components/JYXDetail/index.vue'
+import ruleSelect from '../../../../layouts/components/ruleSelect/index.vue'
 import Detail from "@/views/representative/detail.vue";
 
 const myRouter = useRouter()
@@ -176,6 +184,23 @@ const InsuranceTypeRef = ref(null)
 const DrivingTypeRef = ref(null)
 const JYXDetail = ref(null)
 
+let RuleSelect = ref()
+
+// 规则条件
+let ruleSelectShow = ref(false)
+const handleRuleSelectClose = (data) => {
+    if(data&&data.length>0) {
+        rulesAttrList.value = data.map(a => {
+            return {
+                ...a,
+                min: a.attrName == '能源类型'? '0':'',
+                minArray: a.attrName == '使用性质' || a.attrName == '车辆种类'?[a.dictLabal[0].code]:[]
+            }
+        })
+    }
+    ruleSelectShow.value = false
+}
+
 // 是否编辑
 let isEdit = ref(false)
 let projectAddFrom = ref({
@@ -222,7 +247,16 @@ const numberChange = (e, row) => {
 
 // 新增的时候初始化已有的方案
 const initProduct = (e) => {
-    initAttr()
+    // energyType   能源类型
+    // vehicleType   车辆种类
+    // carnature      使用性质
+    let energyType = null, vehicleType = null, carnature = null
+    if(rulesAttrList.value && rulesAttrList.value.length > 0) {
+        energyType = rulesAttrList.value.find(a => a.attrName === '能源类型')
+        vehicleType = rulesAttrList.value.find(a => a.attrName === '车辆种类')
+        carnature = rulesAttrList.value.find(a => a.attrName === '使用性质')
+    }
+    // initAttr()
     if(e == '0330' || e == '0330034001') {
         let obj = insuranceTypeList.value.filter(item => item.id == '19')
         if(obj) {
@@ -233,6 +267,8 @@ const initProduct = (e) => {
                 }
             })
             projectAddFrom.value.schemeList.forEach(item => {
+                item.schemeName = ''
+                item.description = ''
                 item.drivingList = []
                 item.tableData = [...obj]
             })
@@ -241,6 +277,8 @@ const initProduct = (e) => {
       let obj = insuranceTypeList.value.find(item => item.id == '2')
       obj.insuranceId = obj.id
       projectAddFrom.value.schemeList.forEach(item => {
+        item.schemeName = ''
+        item.description = ''
         item.drivingList = []
         item.tableData = [obj]
       })
@@ -254,21 +292,29 @@ const initProduct = (e) => {
           }
         })
         projectAddFrom.value.schemeList.forEach(item => {
+          item.schemeName = ''
+          item.description = ''
           item.drivingList = []
           item.tableData = [...obj]
         })
       }
     } else {
       projectAddFrom.value.schemeList.forEach(item => {
+        item.schemeName = ''
+        item.description = ''
         item.drivingList = []
         item.tableData = []
       })
     }
   if(projectAddFrom.value.companyId&&projectAddFrom.value.productId&&projectAddFrom.value.schemeType) {
+      console.log('选项123', energyType)
     api.projectApi.getSchemeByCompany({
       companyId: projectAddFrom.value.companyId,
       productId: projectAddFrom.value.productId,
-      schemeType: projectAddFrom.value.schemeType
+      schemeType: projectAddFrom.value.schemeType,
+      energyType: energyType.min,
+      vehicleType: vehicleType.minArray.join(','),
+      carnature: carnature.minArray.join(','),
     }).then(res => {
       if(res.code == 200) {
         if(res.data && res.data.schemeList.length > 0) {
@@ -335,6 +381,47 @@ const initInsurance = () => {
       //   })
       // })
       insuranceTypeList.value = res.data
+        if(projectAddFrom.value.productId == '0330' || projectAddFrom.value.productId == '0330034001') {
+            let obj = insuranceTypeList.value.filter(item => item.id == '19')
+            if(obj) {
+                obj.forEach(item => {
+                    item.insuranceId = item.id
+                    if(item.id == '19') {
+                        item.moneyId = item.options[0].id
+                    }
+                })
+                projectAddFrom.value.schemeList.forEach(item => {
+                    item.drivingList = []
+                    item.tableData = [...obj]
+                })
+            }
+        } else if(projectAddFrom.value.productId == '034002') {
+            let obj = insuranceTypeList.value.find(item => item.id == '2')
+            obj.insuranceId = obj.id
+            projectAddFrom.value.schemeList.forEach(item => {
+                item.drivingList = []
+                item.tableData = [obj]
+            })
+        } else if(projectAddFrom.value.productId == '0330034002') {
+            let obj = insuranceTypeList.value.filter(item => item.id == '2' || item.id == '19')
+            if(obj) {
+                obj.forEach(item => {
+                    item.insuranceId = item.id
+                    if(item.id == '19') {
+                        item.moneyId = item.options[0].id
+                    }
+                })
+                projectAddFrom.value.schemeList.forEach(item => {
+                    item.drivingList = []
+                    item.tableData = [...obj]
+                })
+            }
+        } else {
+            projectAddFrom.value.schemeList.forEach(item => {
+                item.drivingList = []
+                item.tableData = []
+            })
+        }
     } else {
       ElMessage({
         message: res.msg,
@@ -380,17 +467,20 @@ const addProject = () => {
 // 规则
 let rulesShow = ref(false)
 const addRules = () => {
-  rulesShow.value = true
+    ruleSelectShow.value = true
+    nextTick(() => {
+        RuleSelect.value.initEditData(rulesAttrList.value)
+    })
 }
 let rulesAttrList = ref([])
 let defaultAttrList = ref([])
-const saveRule = (data) => {
-    console.log(123123123, data)
-  if(data && data.length > 0) {
-    rulesAttrList.value = data
-  }
-  rulesShow.value = false
-}
+// const saveRule = (data) => {
+//     console.log(123123123, data)
+//   if(data && data.length > 0) {
+//     rulesAttrList.value = data
+//   }
+//   rulesShow.value = false
+// }
 const cancelRule = (data) => {
   rulesShow.value = false
 }
@@ -489,7 +579,13 @@ const initAttr = () => {
   api.agreementApi.ruleAttrGroup({ attrName: '' }).then(res => {
     if(res.code == 200) {
       let list = res.data?.VehicleInformation?.filter(e => e.attrName === '能源类型' || e.attrName === '使用性质' || e.attrName === '车辆种类')
-      rulesAttrList.value = [...list]
+      rulesAttrList.value = list?.map(a => {
+          return {
+              ...a,
+              min: a.attrName == '能源类型'? '0':'',
+              minArray: a.minArray?a.minArray:a.attrName == '使用性质' || a.attrName == '车辆种类'?[a.dictLabal[0].code]:[]
+          }
+      })
       defaultAttrList.value = [...list]
     } else {
       ElMessage({
@@ -518,7 +614,13 @@ const initEdit = () => {
           })
         })
         projectAddFrom.value = res.data
-        rulesAttrList.value = res.data.ruleAttrs
+        rulesAttrList.value = res.data.ruleAttrs.map(a => {
+            return {
+                ...a,
+                min: a.attrName == '能源类型'? '0':'',
+                minArray: a.attrName == '使用性质' || a.attrName == '车辆种类'?[a.dictLabal[0].code]:[]
+            }
+        })
       }
     } else {
       ElMessage({