| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203 |
- <template>
- <div>
- <div class="head_operate">
- <el-button size="small" @click="addConditions(1)">添加条件</el-button>
- <el-button size="small" @click="addConditions(2)">常用条件设置</el-button>
- <el-button size="small" @click="saveTemplate()">另存为模板</el-button>
- <el-button size="small" type="primary" @click="importTemplate()"
- >导入模板</el-button
- >
- </div>
- <el-form ref="CostfactorForm" :model="formData" label-width="190px">
- <div v-for="(item, index) in circularContent" :key="index">
- <el-card
- class="box-card"
- :body-style="{ display: item.hideAll ? 'block' : 'none' }"
- style="margin-bottom: 18px"
- >
- <div slot="header" class="clearfix">
- <span>
- <img :src="item.img" />
- {{ item.title }}
- </span>
- <el-button
- v-if="!item.nooperate"
- style="float: right; padding: 3px 0"
- type="text"
- @click="hides(index)"
- >{{ item.hideAll ? "收起" : "展开" }}</el-button
- >
- </div>
- <el-row :gutter="20">
- <el-col
- :span="val.col || 11"
- v-for="val in item.concant"
- :key="val.prop"
- >
- <el-form-item
- :label="val.label"
- :prop="val.prop"
- :label-width="val.labelWidth ? val.labelWidth : '190px'"
- style="margin-bottom: 15px"
- v-if="!val.hide"
- >
- <template v-if="val.type === 'input'">
- <el-input
- style="width: 100%"
- v-model="formData[val.prop]"
- size="small"
- :placeholder="'请输入' + val.label"
- clearable
- ></el-input>
- </template>
- <template v-if="val.type === 'textarea'">
- <el-input
- type="textarea"
- maxlength="100"
- clearable
- show-word-limit
- v-model="formData[val.prop]"
- size="small"
- :placeholder="'请输入' + val.label"
- ></el-input>
- </template>
- <template v-if="val.type === 'select'">
- <el-select
- size="small"
- v-model="formData[val.prop]"
- style="width: 100%"
- clearable
- :placeholder="'请输入' + val.label"
- >
- <el-option
- v-for="(s, i) in val.options"
- :key="i"
- :label="s.label"
- :value="s.value"
- ></el-option>
- </el-select>
- </template>
- <!-- 日期 -->
- <template v-if="val.type === 'date'">
- <el-date-picker
- v-dateFormat
- v-model="formData[val.prop]"
- :picker-options="pickerOptions"
- value-format="yyyy-MM-dd"
- type="date"
- :placeholder="'选择'+val.prop"
- placement="bottom-start"
- ></el-date-picker>
- </template>
- <!-- 带多选的select -->
- <template v-if="val.type === 'selectmultiple'">
- <el-select
- multiple
- size="small"
- v-model="formData[val.prop]"
- style="width: 100%"
- clearable
- :placeholder="'请输入' + val.label"
- >
- <el-option
- v-for="(s, i) in val.options"
- :key="i"
- :label="s.dictTag"
- :value="s.dictValue"
- ></el-option>
- </el-select>
- </template>
- <!-- 带搜索和全选的select -->
- <template v-if="val.type === 'selectsearch'">
- <el-select
- size="small"
- style="width: 60%"
- v-model="formData[val.prop1]"
- multiple
- collapse-tags
- filterable
- clearable
- @change="changeSelect(formData[val.prop1], val)"
- :placeholder="'请输入' + val.label"
- >
- <el-checkbox
- style="text-align: right; width: 92%"
- v-model="val.checked"
- @change="selectAll(val)"
- >全选</el-checkbox
- >
- <el-option
- v-for="item in val.options"
- :key="item.dictValue"
- :label="item.dictTag"
- :value="item.dictValue"
- ></el-option>
- </el-select>
- <el-select
- size="small"
- v-model="formData[val.prop2]"
- clearable
- style="width: 39%"
- placeholder="请输入校验方式"
- >
- <el-option
- v-for="(s, i) in options"
- :key="i"
- :label="s.label"
- :value="s.value"
- ></el-option>
- </el-select>
- </template>
- <!-- 创建条目的select -->
- <template v-if="val.type === 'createSelect'">
- <el-select
- style="width: 100%"
- v-model="formData[val.prop]"
- multiple
- clearable
- filterable
- allow-create
- default-first-option
- placeholder="请选择"
- >
- <el-option
- v-for="item in val.options"
- :key="item.value"
- :label="item.label"
- :value="item.value"
- ></el-option>
- </el-select>
- </template>
- <template v-if="val.type === 'inputconnect'">
- <div>
- <el-input
- style="width: 45%"
- v-model="formData[val.prop1]"
- size="small"
- placeholder="下限"
- ></el-input>
- <span style="color: rgba(0, 0, 0, 0.15)">——</span>
- <el-input
- style="width: 45%"
- v-model="formData[val.prop2]"
- size="small"
- placeholder="上限"
- ></el-input>
- </div>
- </template>
- <!-- 单选框 -->
- <template v-if="val.type === 'radio'">
- <el-radio-group
- size="small"
- v-model="formData[val.prop]"
- v-bind="val.chang"
- :disabled="val.disabled || false"
- >
- <el-radio-button
- v-for="(el, i) in val.options"
- :key="i"
- :label="el.value"
- :disabled="el.disabled"
- :border="el.border"
- >{{ el.label }}</el-radio-button
- >
- </el-radio-group>
- </template>
- <template v-if="val.type === 'slot' && val.label === '车牌'">
- <el-select
- multiple
- size="small"
- v-model="formData[val.prop1]"
- style="width: 70%"
- clearable
- :placeholder="'请输入' + val.label"
- >
- <el-option
- v-for="(s, i) in val.options"
- :key="i"
- :label="s.license"
- :value="s.id"
- ></el-option>
- </el-select>
- <!-- <el-checkbox style="margin-left: 20px;" true-label="1" false-label="0" v-model="formData.chepai2" :disabled="formData[val.prop1].length>0?false:true">含暂未上牌</el-checkbox> -->
- </template>
- <template
- v-if="val.type === 'slot' && val.label === '条件适用对象'"
- >
- <el-checkbox-group v-model="formData[val.prop]">
- <el-checkbox
- :label="item.value"
- :key="item.value"
- v-for="item in objtoubaoren"
- @change="(event) => chooseCondition(event, item)"
- >{{ item.label }}</el-checkbox
- >
- </el-checkbox-group>
- </template>
- <template v-if="val.type === 'slot' && val.prop === '车主'">
- <el-divider content-position="left">
- <b>车主</b>
- </el-divider>
- </template>
- <template v-if="val.type === 'slot' && val.prop === '投保人'">
- <el-divider content-position="left">
- <b>投保人</b>
- <span style="font-size: 12px; margin: 0 5px 0 15px"
- >同车主</span
- >
- <el-switch
- v-model="formData[val.prop]"
- @change="isoOwnerFun"
- active-color="#409EFF"
- inactive-color="#ccc"
- ></el-switch>
- </el-divider>
- </template>
- <template v-if="val.type === 'slot' && val.prop1 === '被保人1'">
- <el-divider content-position="left">
- <b>被保人</b>
- <span style="font-size: 12px; margin: 0 5px 0 15px"
- >同车主</span
- >
- <el-switch
- v-model="formData[val.prop1]"
- @change="isoApplicantFun"
- active-color="#409EFF"
- inactive-color="#ccc"
- ></el-switch>
- <span style="font-size: 12px; margin: 0 5px 0 15px"
- >同投保人</span
- >
- <el-switch
- v-model="formData[val.prop2]"
- @change="isoApplicantFun"
- active-color="#409EFF"
- inactive-color="#ccc"
- ></el-switch>
- </el-divider>
- </template>
- </el-form-item>
- </el-col>
- </el-row>
- </el-card>
- </div>
- </el-form>
- <el-dialog
- :title="dialogTitle"
- :visible.sync="dialogVisible"
- append-to-body
- width="80%"
- >
- <span
- v-for="(ele, index) in conditiondata"
- :key="index"
- class="often-box"
- >
- <div class="often-box-title">
- <span class="title-text">{{ ele.title }}</span>
- <el-checkbox
- :indeterminate="checkedmData[index].isIndeterminate"
- v-model="checkedmData[index].checkAll"
- @change="handleCheckAllChange(index)"
- >全选</el-checkbox
- >
- </div>
- <div
- class="often-content-classify"
- v-for="(cele, cindex) in ele.options"
- :key="cindex"
- >
- <div class="classify-title">{{ cele.name }}</div>
- <el-checkbox-group
- class="often-content"
- v-model="checkedmData[index].checkedCities"
- @change="
- handleCheckedCitiesChange(checkedmData[index],cele.cities, index, cindex)
- "
- >
- <el-checkbox
- class="often-content-child"
- v-for="city in cele.cities"
- :label="city.label"
- :key="city.city"
- >{{ city.label }}</el-checkbox
- >
- <!-- <el-checkbox
- class="often-content-child"
- v-for="city in cele.cities"
- :label="city"
- :key="city"
- >{{ city }}</el-checkbox
- > -->
- </el-checkbox-group>
- </div>
- </span>
- <span slot="footer" class="dialog-footer">
- <el-button size="small" @click="dialogVisible = false">取 消</el-button>
- <el-button size="small" type="primary" @click="conditionSave()"
- >确 定</el-button
- >
- </span>
- </el-dialog>
- <el-dialog
- title="导入条件佣金模板"
- :visible.sync="ImportdialogVisible"
- append-to-body
- width="80%"
- >
- <span>
- <el-table :data="tableData" border style="width: 100%">
- <el-table-column prop="date" label="模板名称"></el-table-column>
- <el-table-column prop="name" label="政策简称"></el-table-column>
- <el-table-column prop="address" label="条件描述"></el-table-column>
- <el-table-column fixed="right" label="操作" width="200">
- <template slot-scope="scope">
- <el-button
- @click.native.prevent="Import(scope.$index)"
- type="primary"
- size="small"
- >导入</el-button
- >
- <el-button
- @click.native.prevent="deleteRow(scope.$index)"
- type="danger"
- size="small"
- >删除</el-button
- >
- </template>
- </el-table-column>
- </el-table>
- </span>
- </el-dialog>
- </div>
- </template>
- <script>
- import imgSrc1 from "../../../../assets/image/bfyz1.png";
- import imgSrc2 from "../../../../assets/image/bfyz2.png";
- import imgSrc3 from "../../../../assets/image/bfyz3.png";
- import imgSrc4 from "../../../../assets/image/bfyz4.png";
- import imgSrc5 from "../../../../assets/image/bfyz5.png";
- let insureOptions=[
- {
- label: "不投保",
- value: "0"
- },
- {
- label: "投保",
- value: "1"
- }
- ]
- export default {
- data() {
- return {
- pickerOptions: {
- disabledDate(time) {
- //若选择的日期小于当前日期(包含今天)
- return time.getTime() > Date.now();
- //若选择的日期大于当前日期(不包含今天): time.getTime() < Date.now()
- //若选择的日期小于当前日期(不包含今天): time.getTime() > Date.now() - 8.64e7
- //若选择的日期小于等于当前日期(包含今天): time.getTime() > Date.now()
- }
- },
- ImportdialogVisible: false,
- tableData: [
- {
- date: "2016-05-02",
- name: "王小虎",
- address: "上海市普陀区金沙江路 1518 弄",
- },
- ],
- objtoubaoren: [
- {
- label: "投保人",
- value: "toubaoren",
- },
- {
- label: "被保人",
- value: "beibaoren",
- },
- {
- label: "车主",
- value: "chezhu",
- },
- ],
- checkedmData: [],
- conditiondata: [
- {
- title: "保单信息",
- options: [
- {
- name: "险种",
- // cities:['机动车损失险','第三者责任险']
- cities: [
- {
- label:'机动车损失险',
- type:'select',
- prop:'机动车损失险',
- options:insureOptions
- },
- {
- label:'第三者责任险',
- type:'select',
- prop:'第三者责任险',
- options:insureOptions
- },{
- label:'司机责任险',
- type:'select',
- prop:'司机责任险',
- options:insureOptions
- },{
- label:'乘客责任险',
- type:'select',
- prop:'乘客责任险',
- options:insureOptions
- },{
- label:'附加医保-三者',
- type:'select',
- prop:'附加医保-三者',
- options:insureOptions
- },{
- label:'附加医保-座位险(乘客)',
- type:'select',
- prop:'附加医保-座位险(乘客)',
- options:insureOptions
- },{
- label:'附加医保-座位险(司机)',
- type:'select',
- prop:'附加医保-座位险(司机)',
- options:insureOptions
- },
- ],
- },
- ],
- },
- {
- title: "车辆信息",
- options: [
- {
- name: "车辆",
- cities: [
- {
- label:'车辆识别代码',
- prop:'车辆识别代码',
- type:'input',
- },
- {
- label:'品牌型号',
- prop:'品牌型号',
- type:'input'
- },{
- label:'新车购置价',
- prop:'新车购置价',
- type:'input'
- },{
- label:'注册日期',
- prop:'注册日期',
- type:'date'
- },
- {
- label:'发证日期',
- prop:'发证日期',
- type:'date'
- },
- ],
- },
- ],
- },
- {
- title: "关系人信息",
- options: [
- {
- name: "车主",
- cities: [
- {
- label:'车主性别',
- prop:'车主性别',
- type:'input',
- hide: true,
- name: "chezhu",
- },
- ],
- }, {
- name: "投保人",
- cities: [
- {
- label:'投保人性别',
- prop:'投保人性别',
- type:'input',
- hide: true,
- name: "toubaoren",
- },
- ],
- }, {
- name: "被保人",
- cities: [
- {
- label:'被保人性别',
- prop:'被保人性别',
- type:'input',
- hide: true,
- name: "beibaoren",
- },
- ],
- },
- ],
- },
-
- ],
- dialogVisible: false,
- dialogTitle: "添加其他条件",
- options: [
- {
- value: "1",
- label: "符合其一",
- },
- {
- value: "2",
- label: "全部除外",
- },
- ],
- formData: {
- chepai2: "",
- 条件适用对象: [],
- },
- trafficManagementVehicleTypeoptions: [],
- natureOfVehicleUseoptions: [],
- licenseOptions: [],
- energyTypeoptions: [],
- };
- },
- computed: {
- circularContent() {
- return [
- {
- title: "车险预核条件",
- hideAll: true,
- img: imgSrc1,
- concant: [
- {
- label: "政策简介",
- prop: "transfer",
- type: "textarea",
- },
- {
- label: "条件描述",
- prop: "条件描述",
- type: "textarea",
- },
- ],
- },
- {
- title: "规则类型",
- hideAll: true,
- img: imgSrc2,
- nooperate: true,
- concant: [
- {
- label: "符合以下条件的车辆,系统将",
- prop: "符合以下条件的车辆,系统将",
- type: "input",
- labelWidth: "250px",
- },
- ],
- },
- {
- title: "保单信息",
- hideAll: true,
- img: imgSrc3,
- concant: [
- {
- label: "含交叉销售",
- prop: "含交叉销售",
- type: "radio",
- options: [
- {
- label: "是",
- value: "1",
- },
- {
- label: "否",
- value: "0",
- },
- ],
- },
- {
- label: "非车产品",
- prop: "非车产品",
- type: "select",
- options: [],
- },
- {
- label: "非车保费(元)",
- prop1: "非车保费1",
- prop2: "非车保费2",
- type: "inputconnect",
- },
- {
- label: "附加医保座位险总保额(乘客-万元)",
- prop1: "附加医保座位险总保额(乘客-万元)1",
- prop2: "附加医保座位险总保额(乘客-万元)2",
- type: "inputconnect",
- },
- {
- label: "座位险保额(乘客每座-万元)",
- prop1: "座位险保额(乘客每座-万元)1",
- prop2: "座位险保额(乘客每座-万元)2",
- type: "inputconnect",
- },
- {
- label: "座位险保额(司乘每座-万元)",
- prop1: "座位险保额(司乘每座-万元)1",
- prop2: "座位险保额(司乘每座-万元)2",
- type: "inputconnect",
- },
- ],
- },
- {
- title: "车辆信息",
- hideAll: true,
- img: imgSrc4,
- concant: [
- {
- label: "过户车",
- prop: "过户车",
- type: "radio",
- options: [
- {
- label: "是",
- value: "1",
- },
- {
- label: "否",
- value: "0",
- },
- ],
- },
- {
- label: "新车",
- prop: "新车",
- type: "radio",
- options: [
- {
- label: "是",
- value: "1",
- },
- {
- label: "否",
- value: "0",
- },
- ],
- },
- {
- label: "新能源",
- prop: "新能源",
- type: "radio",
- options: [
- {
- label: "是",
- value: "1",
- },
- {
- label: "否",
- value: "0",
- },
- ],
- },
- {
- label: "能源类型",
- prop: "能源类型",
- type: "selectmultiple",
- options: this.energyTypeoptions,
- },
- {
- label: "使用性质",
- prop1: "使用性质1",
- prop2: "使用性质2",
- type: "selectsearch",
- options: this.natureOfVehicleUseoptions,
- },
- {
- label: "车辆类型",
- prop1: "车辆类型1",
- prop2: "车辆类型2",
- type: "selectsearch",
- options: this.trafficManagementVehicleTypeoptions,
- },
- {
- label: "额定载重质量(吨)",
- prop1: "额定载重质量1",
- prop2: "额定载重质量2",
- type: "inputconnect",
- },
- {
- label: "整备质量(千克)",
- prop1: "整备质量1",
- prop2: "整备质量2",
- type: "inputconnect",
- },
- {
- label: "总质量(千克)",
- prop1: "总质量1",
- prop2: "总质量2",
- type: "inputconnect",
- },
- {
- label: "座位数(个)",
- prop1: "座位数1",
- prop2: "座位数2",
- type: "inputconnect",
- },
- {
- label: "车龄(月)",
- prop1: "车龄1",
- prop2: "车龄2",
- type: "inputconnect",
- },
- {
- label: "车价(万元)",
- prop1: "车价1",
- prop2: "车价2",
- type: "inputconnect",
- },
- {
- label: "排气量(cc)",
- prop1: "排气量1",
- prop2: "排气量2",
- type: "inputconnect",
- },
- {
- label: "包含品牌",
- prop: "包含品牌",
- type: "createSelect",
- options: [],
- },
- {
- label: "除外品牌",
- prop: "除外品牌",
- type: "createSelect",
- options: [],
- },
- {
- label: "是否上牌",
- prop: "是否上牌",
- type: "radio",
- options: [
- {
- label: "是",
- value: "1",
- },
- {
- label: "否",
- value: "0",
- },
- ],
- },
- {
- label: "车牌",
- prop1: "车牌1",
- prop2: "chepai2",
- type: "slot",
- options: this.licenseOptions,
- },
- ],
- },
- {
- title: "关系人信息",
- hideAll: true,
- img: imgSrc5,
- concant: [
- {
- label: "条件适用对象",
- prop: "条件适用对象",
- type: "slot",
- },
- {
- label: "适用对象校验方式",
- prop: "适用对象校验方式",
- type: "select",
- options: [
- {
- label: "适用对象至少其一符合以下条件",
- value: "1",
- },
- {
- label: "适用对象全部符合以下条件",
- value: "2",
- },
- ],
- },
- {
- label: "",
- prop: "车主",
- type: "slot",
- name: "chezhu",
- hide: true,
- col: 24,
- labelWidth: "0",
- },
- {
- label: "车主年龄(女)(岁)",
- prop: "车主年龄",
- hide: true,
- type: "inputconnect",
- name: "chezhu",
- },
- {
- label: "车主年龄(男)(岁)",
- prop: "车主年龄1",
- hide: true,
- type: "inputconnect",
- name: "chezhu",
- },
- {
- label: "车主证件号",
- prop: "车主证件号",
- hide: true,
- type: "input",
- name: "chezhu",
- },
- {
- label: "",
- prop: "投保人",
- type: "slot",
- name: "toubaoren",
- hide: true,
- col: 24,
- labelWidth: "0",
- },
- {
- label: "投保人年龄(女)(岁)",
- prop: "投保人年龄",
- hide: true,
- type: "inputconnect",
- name: "toubaoren",
- },
- {
- label: "投保人年龄(男)(岁)",
- prop: "投保人年龄1",
- hide: true,
- type: "inputconnect",
- name: "toubaoren",
- },
- {
- label: "投保人证件号",
- prop: "投保人证件号",
- hide: true,
- type: "input",
- name: "toubaoren",
- },
- {
- label: "",
- prop1: "被保人1",
- prop2: "被保人2",
- type: "slot",
- name: "beibaoren",
- hide: true,
- col: 24,
- labelWidth: "0",
- },
- {
- label: "被保人年龄(女)(岁)",
- prop: "被保人年龄",
- hide: true,
- type: "inputconnect",
- name: "beibaoren",
- },
- {
- label: "被保人年龄(男)(岁)",
- prop: "被保人年龄1",
- hide: true,
- type: "inputconnect",
- name: "beibaoren",
- },
- {
- label: "被保人证件号",
- prop: "被保人证件号",
- hide: true,
- type: "input",
- name: "beibaoren",
- },
- ],
- },
- ];
- },
- },
- created() {
- this.getDicType("natureOfVehicleUse"); //车辆使用性质
- this.getDicType("trafficManagementVehicleType"); //车辆类型
- this.getDicType("energyType"); //能源种类
- this.$api.insCompany.license().then((res) => {
- this.licenseOptions = res.data;
- });
- this.conditiondata.forEach((val, index) => {
- this.checkedmData[index] = {
- checkAll: false,
- isIndeterminate: false,
- checkedCities: [],
- option:[]
- };
- });
- },
- methods: {
- //--数据字典 begin --
- getDicType(type) {
- this.$api.insCompany.dicType(type).then((res) => {
- if (res.code == 200) {
- if (type == "insOrderStatus") {
- let data = JSON.parse(JSON.stringify(res.data.ddList));
- data.unshift({
- dictTag: "全部",
- dictValue: "888",
- });
- this[type + "options"] = data;
- } else {
- this[type + "options"] = res.data.ddList;
- }
- }
- });
- },
- hides(index) {
- this.circularContent[index].hideAll =
- !this.circularContent[index].hideAll;
- },
- selectAll(val) {
- this.formData[val.prop1] = [];
- if (val.checked) {
- val.options.map((item) => {
- this.formData[val.prop1].push(item.value);
- });
- } else {
- this.formData[val.prop1] = [];
- }
- },
- changeSelect(data, val) {
- if (data.length === val.options.length) {
- val.checked = true;
- } else {
- val.checked = false;
- }
- },
- chooseCondition(event, item) {
- if (event) {
- this.circularContent[4].concant.forEach((ele) => {
- if (ele.name == item.value) {
- console.log(ele)
- ele.hide = false;
- }
- // return ele;
- });
- } else {
- this.circularContent[4].concant.forEach((ele) => {
- if (ele.name == item.value) {
- ele.hide = true;
- }
- // return ele;
- });
- }
- },
- // 投保人同车主功能
- isoOwnerFun(val) {
- if (val) {
- this.circularContent[4].concant.forEach((ele, index) => {
- if (ele.name == "toubaoren" && ele.label != "") {
- this.circularContent[4].concant[index].hide = true;
- this.circularContent = Array.from(this.circularContent);
- }
- });
- } else {
- this.circularContent[4].concant.forEach((ele, index) => {
- if (ele.name == "toubaoren") {
- ele.hide = false;
- }
- });
- }
- },
- isoApplicantFun(val) {
- if (val) {
- this.circularContent[4].concant.forEach((ele, index) => {
- if (ele.name == "beibaoren" && ele.label != "") {
- this.circularContent[4].concant[index].hide = true;
- this.circularContent = Array.from(this.circularContent);
- }
- });
- } else {
- this.circularContent[4].concant.forEach((ele, index) => {
- if (ele.name == "beibaoren") {
- ele.hide = false;
- }
- });
- }
- },
- addConditions(type) {
- this.dialogVisible = true;
- if (type == "1") {
- this.dialogTitle = "条件配置";
- } else {
- this.dialogTitle = "常用条件配置";
- }
- },
- // 全选
- handleCheckAllChange(index) {
- let arr = [];
- this.conditiondata[index].options.forEach((val) =>{
- this.checkedmData[index].option.push(...val.cities)
- arr.push(...val.cities.map(ele=>ele.label))
- });
- this.checkedmData[index].checkedCities = this.checkedmData[index].checkAll
- ? arr
- : [];
- this.checkedmData[index].isIndeterminate = false;
- this.checkedmData = [...this.checkedmData];
- },
- // 单选
- handleCheckedCitiesChange(value,cities, index, cindex) {
- if(value.checkedCities.length>0){
- this.checkedmData[index].option=[]
- value.checkedCities.forEach(ele=>{
- this.checkedmData[index].option.push(cities.find(val=>val.label==ele))
- })
- }
- let checkedCount = value.checkedCities.length;
- // 全选按钮是否打勾
- this.checkedmData[index].checkAll =checkedCount === this.conditiondata[index].options[cindex].cities.length||checkedCount === this.conditiondata[index].options.length;
- this.checkedmData[index].isIndeterminate = checkedCount > 0 && checkedCount < this.conditiondata[index].options[cindex].cities.length|| checkedCount < this.conditiondata[index].options.length;
- this.checkedmData = [...this.checkedmData];
- },
- // 条件配置保存
- conditionSave() {
- console.log( this.checkedmData,this.circularContent,6666666666666666)
- this.dialogVisible = false;
- this.conditiondata.forEach((val,index)=>{
- this.checkedmData[index].title=val.title
- })
- // 页面数据
- let arr=[]
- let arr1=[]
- this.circularContent.forEach(ele=>{
- // 条件配置返回数据
- this.checkedmData.forEach(ele1=>{
- if(ele.title==ele1.title){
- // 将条件配置返回的数据插入到页面对应模块位置中
- ele.concant.forEach((ele2,index2)=>ele1.option.find((ele3,index3)=>{
- if(ele3.name==ele2.name && ele2.label==''){
- // console.log(ele3,index2,900000000000)
- arr.push(ele3)
- arr1.push(index2)
- ele.concant.splice(index2,0,ele3)
- }
- }))
- let aaa= ele.concant.find((ele2,index2)=>ele1.option.map((ele3,index3)=>ele3.name==ele2.name && ele2.label=='' ))
- console.log(aaa,88888888888888)
- // ele.concant.splice(ele.concant.findIndex(ele2=>ele1.option.find(ele3=>ele3.name==ele2.name && ele2.label==''))+1,0,ele1.option)
- }
- })
- })
- console.log(Array.from(new Set(arr)) ,arr1,900000000000)
- },
- // 另存为模板
- saveTemplate() {
- this.$prompt("请输入模板名称", "提示", {
- inputAttrs: {
- maxlength: 10, // 设置最大长度为10
- },
- })
- .then(({ value }) => {
- console.log(value, 444444444);
- // 处理输入值
- })
- .catch(() => {
- // 取消操作
- });
- },
- // 导入模板
- importTemplate() {
- this.ImportdialogVisible = true;
- },
- deleteRow(index) {
- this.$confirm("确认删除该模板吗?", "提示", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {})
- .catch(() => {});
- },
- },
- };
- </script>
- <style scoped lang="scss">
- .clearfix:before,
- .clearfix:after {
- clear: both;
- display: table;
- content: "";
- }
- .hide-all {
- display: none;
- }
- .clearfix {
- padding-left: 20px;
- span {
- font-weight: 600;
- font-size: 15px;
- }
- span > img {
- vertical-align: middle;
- width: 26px;
- height: 26px;
- margin-right: 5px;
- }
- }
- .head_operate {
- text-align: right;
- padding: 10px 0;
- }
- .often-box-title {
- padding: 10px;
- background-color: #ffeede;
- font-weight: bold;
- }
- .often-content-classify {
- display: flex;
- flex-direction: row;
- justify-content: space-between;
- }
- .often-box .often-content-classify:not(:last-child) {
- border-bottom: 1px solid #ccc;
- }
- .classify-title {
- width: 100px;
- text-align: right;
- padding: 15px 5px 0px 0px;
- font-weight: 600;
- }
- .often-content {
- display: flex;
- flex-wrap: wrap;
- justify-content: flex-start;
- padding: 10px;
- flex: 1;
- }
- .often-content-child {
- width: 22%;
- padding: 5px 0;
- }
- .title-text {
- display: inline-block;
- width: 100px;
- font-size: 15px;
- font-weight: 900;
- }
- </style>
|