PremiumFactor.vue 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203
  1. <template>
  2. <div>
  3. <div class="head_operate">
  4. <el-button size="small" @click="addConditions(1)">添加条件</el-button>
  5. <el-button size="small" @click="addConditions(2)">常用条件设置</el-button>
  6. <el-button size="small" @click="saveTemplate()">另存为模板</el-button>
  7. <el-button size="small" type="primary" @click="importTemplate()"
  8. >导入模板</el-button
  9. >
  10. </div>
  11. <el-form ref="CostfactorForm" :model="formData" label-width="190px">
  12. <div v-for="(item, index) in circularContent" :key="index">
  13. <el-card
  14. class="box-card"
  15. :body-style="{ display: item.hideAll ? 'block' : 'none' }"
  16. style="margin-bottom: 18px"
  17. >
  18. <div slot="header" class="clearfix">
  19. <span>
  20. <img :src="item.img" />
  21. {{ item.title }}
  22. </span>
  23. <el-button
  24. v-if="!item.nooperate"
  25. style="float: right; padding: 3px 0"
  26. type="text"
  27. @click="hides(index)"
  28. >{{ item.hideAll ? "收起" : "展开" }}</el-button
  29. >
  30. </div>
  31. <el-row :gutter="20">
  32. <el-col
  33. :span="val.col || 11"
  34. v-for="val in item.concant"
  35. :key="val.prop"
  36. >
  37. <el-form-item
  38. :label="val.label"
  39. :prop="val.prop"
  40. :label-width="val.labelWidth ? val.labelWidth : '190px'"
  41. style="margin-bottom: 15px"
  42. v-if="!val.hide"
  43. >
  44. <template v-if="val.type === 'input'">
  45. <el-input
  46. style="width: 100%"
  47. v-model="formData[val.prop]"
  48. size="small"
  49. :placeholder="'请输入' + val.label"
  50. clearable
  51. ></el-input>
  52. </template>
  53. <template v-if="val.type === 'textarea'">
  54. <el-input
  55. type="textarea"
  56. maxlength="100"
  57. clearable
  58. show-word-limit
  59. v-model="formData[val.prop]"
  60. size="small"
  61. :placeholder="'请输入' + val.label"
  62. ></el-input>
  63. </template>
  64. <template v-if="val.type === 'select'">
  65. <el-select
  66. size="small"
  67. v-model="formData[val.prop]"
  68. style="width: 100%"
  69. clearable
  70. :placeholder="'请输入' + val.label"
  71. >
  72. <el-option
  73. v-for="(s, i) in val.options"
  74. :key="i"
  75. :label="s.label"
  76. :value="s.value"
  77. ></el-option>
  78. </el-select>
  79. </template>
  80. <!-- 日期 -->
  81. <template v-if="val.type === 'date'">
  82. <el-date-picker
  83. v-dateFormat
  84. v-model="formData[val.prop]"
  85. :picker-options="pickerOptions"
  86. value-format="yyyy-MM-dd"
  87. type="date"
  88. :placeholder="'选择'+val.prop"
  89. placement="bottom-start"
  90. ></el-date-picker>
  91. </template>
  92. <!-- 带多选的select -->
  93. <template v-if="val.type === 'selectmultiple'">
  94. <el-select
  95. multiple
  96. size="small"
  97. v-model="formData[val.prop]"
  98. style="width: 100%"
  99. clearable
  100. :placeholder="'请输入' + val.label"
  101. >
  102. <el-option
  103. v-for="(s, i) in val.options"
  104. :key="i"
  105. :label="s.dictTag"
  106. :value="s.dictValue"
  107. ></el-option>
  108. </el-select>
  109. </template>
  110. <!-- 带搜索和全选的select -->
  111. <template v-if="val.type === 'selectsearch'">
  112. <el-select
  113. size="small"
  114. style="width: 60%"
  115. v-model="formData[val.prop1]"
  116. multiple
  117. collapse-tags
  118. filterable
  119. clearable
  120. @change="changeSelect(formData[val.prop1], val)"
  121. :placeholder="'请输入' + val.label"
  122. >
  123. <el-checkbox
  124. style="text-align: right; width: 92%"
  125. v-model="val.checked"
  126. @change="selectAll(val)"
  127. >全选</el-checkbox
  128. >
  129. <el-option
  130. v-for="item in val.options"
  131. :key="item.dictValue"
  132. :label="item.dictTag"
  133. :value="item.dictValue"
  134. ></el-option>
  135. </el-select>
  136. <el-select
  137. size="small"
  138. v-model="formData[val.prop2]"
  139. clearable
  140. style="width: 39%"
  141. placeholder="请输入校验方式"
  142. >
  143. <el-option
  144. v-for="(s, i) in options"
  145. :key="i"
  146. :label="s.label"
  147. :value="s.value"
  148. ></el-option>
  149. </el-select>
  150. </template>
  151. <!-- 创建条目的select -->
  152. <template v-if="val.type === 'createSelect'">
  153. <el-select
  154. style="width: 100%"
  155. v-model="formData[val.prop]"
  156. multiple
  157. clearable
  158. filterable
  159. allow-create
  160. default-first-option
  161. placeholder="请选择"
  162. >
  163. <el-option
  164. v-for="item in val.options"
  165. :key="item.value"
  166. :label="item.label"
  167. :value="item.value"
  168. ></el-option>
  169. </el-select>
  170. </template>
  171. <template v-if="val.type === 'inputconnect'">
  172. <div>
  173. <el-input
  174. style="width: 45%"
  175. v-model="formData[val.prop1]"
  176. size="small"
  177. placeholder="下限"
  178. ></el-input>
  179. <span style="color: rgba(0, 0, 0, 0.15)">——</span>
  180. <el-input
  181. style="width: 45%"
  182. v-model="formData[val.prop2]"
  183. size="small"
  184. placeholder="上限"
  185. ></el-input>
  186. </div>
  187. </template>
  188. <!-- 单选框 -->
  189. <template v-if="val.type === 'radio'">
  190. <el-radio-group
  191. size="small"
  192. v-model="formData[val.prop]"
  193. v-bind="val.chang"
  194. :disabled="val.disabled || false"
  195. >
  196. <el-radio-button
  197. v-for="(el, i) in val.options"
  198. :key="i"
  199. :label="el.value"
  200. :disabled="el.disabled"
  201. :border="el.border"
  202. >{{ el.label }}</el-radio-button
  203. >
  204. </el-radio-group>
  205. </template>
  206. <template v-if="val.type === 'slot' && val.label === '车牌'">
  207. <el-select
  208. multiple
  209. size="small"
  210. v-model="formData[val.prop1]"
  211. style="width: 70%"
  212. clearable
  213. :placeholder="'请输入' + val.label"
  214. >
  215. <el-option
  216. v-for="(s, i) in val.options"
  217. :key="i"
  218. :label="s.license"
  219. :value="s.id"
  220. ></el-option>
  221. </el-select>
  222. <!-- <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> -->
  223. </template>
  224. <template
  225. v-if="val.type === 'slot' && val.label === '条件适用对象'"
  226. >
  227. <el-checkbox-group v-model="formData[val.prop]">
  228. <el-checkbox
  229. :label="item.value"
  230. :key="item.value"
  231. v-for="item in objtoubaoren"
  232. @change="(event) => chooseCondition(event, item)"
  233. >{{ item.label }}</el-checkbox
  234. >
  235. </el-checkbox-group>
  236. </template>
  237. <template v-if="val.type === 'slot' && val.prop === '车主'">
  238. <el-divider content-position="left">
  239. <b>车主</b>
  240. </el-divider>
  241. </template>
  242. <template v-if="val.type === 'slot' && val.prop === '投保人'">
  243. <el-divider content-position="left">
  244. <b>投保人</b>
  245. <span style="font-size: 12px; margin: 0 5px 0 15px"
  246. >同车主</span
  247. >
  248. <el-switch
  249. v-model="formData[val.prop]"
  250. @change="isoOwnerFun"
  251. active-color="#409EFF"
  252. inactive-color="#ccc"
  253. ></el-switch>
  254. </el-divider>
  255. </template>
  256. <template v-if="val.type === 'slot' && val.prop1 === '被保人1'">
  257. <el-divider content-position="left">
  258. <b>被保人</b>
  259. <span style="font-size: 12px; margin: 0 5px 0 15px"
  260. >同车主</span
  261. >
  262. <el-switch
  263. v-model="formData[val.prop1]"
  264. @change="isoApplicantFun"
  265. active-color="#409EFF"
  266. inactive-color="#ccc"
  267. ></el-switch>
  268. <span style="font-size: 12px; margin: 0 5px 0 15px"
  269. >同投保人</span
  270. >
  271. <el-switch
  272. v-model="formData[val.prop2]"
  273. @change="isoApplicantFun"
  274. active-color="#409EFF"
  275. inactive-color="#ccc"
  276. ></el-switch>
  277. </el-divider>
  278. </template>
  279. </el-form-item>
  280. </el-col>
  281. </el-row>
  282. </el-card>
  283. </div>
  284. </el-form>
  285. <el-dialog
  286. :title="dialogTitle"
  287. :visible.sync="dialogVisible"
  288. append-to-body
  289. width="80%"
  290. >
  291. <span
  292. v-for="(ele, index) in conditiondata"
  293. :key="index"
  294. class="often-box"
  295. >
  296. <div class="often-box-title">
  297. <span class="title-text">{{ ele.title }}</span>
  298. <el-checkbox
  299. :indeterminate="checkedmData[index].isIndeterminate"
  300. v-model="checkedmData[index].checkAll"
  301. @change="handleCheckAllChange(index)"
  302. >全选</el-checkbox
  303. >
  304. </div>
  305. <div
  306. class="often-content-classify"
  307. v-for="(cele, cindex) in ele.options"
  308. :key="cindex"
  309. >
  310. <div class="classify-title">{{ cele.name }}</div>
  311. <el-checkbox-group
  312. class="often-content"
  313. v-model="checkedmData[index].checkedCities"
  314. @change="
  315. handleCheckedCitiesChange(checkedmData[index],cele.cities, index, cindex)
  316. "
  317. >
  318. <el-checkbox
  319. class="often-content-child"
  320. v-for="city in cele.cities"
  321. :label="city.label"
  322. :key="city.city"
  323. >{{ city.label }}</el-checkbox
  324. >
  325. <!-- <el-checkbox
  326. class="often-content-child"
  327. v-for="city in cele.cities"
  328. :label="city"
  329. :key="city"
  330. >{{ city }}</el-checkbox
  331. > -->
  332. </el-checkbox-group>
  333. </div>
  334. </span>
  335. <span slot="footer" class="dialog-footer">
  336. <el-button size="small" @click="dialogVisible = false">取 消</el-button>
  337. <el-button size="small" type="primary" @click="conditionSave()"
  338. >确 定</el-button
  339. >
  340. </span>
  341. </el-dialog>
  342. <el-dialog
  343. title="导入条件佣金模板"
  344. :visible.sync="ImportdialogVisible"
  345. append-to-body
  346. width="80%"
  347. >
  348. <span>
  349. <el-table :data="tableData" border style="width: 100%">
  350. <el-table-column prop="date" label="模板名称"></el-table-column>
  351. <el-table-column prop="name" label="政策简称"></el-table-column>
  352. <el-table-column prop="address" label="条件描述"></el-table-column>
  353. <el-table-column fixed="right" label="操作" width="200">
  354. <template slot-scope="scope">
  355. <el-button
  356. @click.native.prevent="Import(scope.$index)"
  357. type="primary"
  358. size="small"
  359. >导入</el-button
  360. >
  361. <el-button
  362. @click.native.prevent="deleteRow(scope.$index)"
  363. type="danger"
  364. size="small"
  365. >删除</el-button
  366. >
  367. </template>
  368. </el-table-column>
  369. </el-table>
  370. </span>
  371. </el-dialog>
  372. </div>
  373. </template>
  374. <script>
  375. import imgSrc1 from "../../../../assets/image/bfyz1.png";
  376. import imgSrc2 from "../../../../assets/image/bfyz2.png";
  377. import imgSrc3 from "../../../../assets/image/bfyz3.png";
  378. import imgSrc4 from "../../../../assets/image/bfyz4.png";
  379. import imgSrc5 from "../../../../assets/image/bfyz5.png";
  380. let insureOptions=[
  381. {
  382. label: "不投保",
  383. value: "0"
  384. },
  385. {
  386. label: "投保",
  387. value: "1"
  388. }
  389. ]
  390. export default {
  391. data() {
  392. return {
  393. pickerOptions: {
  394. disabledDate(time) {
  395. //若选择的日期小于当前日期(包含今天)
  396. return time.getTime() > Date.now();
  397. //若选择的日期大于当前日期(不包含今天): time.getTime() < Date.now()
  398. //若选择的日期小于当前日期(不包含今天): time.getTime() > Date.now() - 8.64e7
  399. //若选择的日期小于等于当前日期(包含今天): time.getTime() > Date.now()
  400. }
  401. },
  402. ImportdialogVisible: false,
  403. tableData: [
  404. {
  405. date: "2016-05-02",
  406. name: "王小虎",
  407. address: "上海市普陀区金沙江路 1518 弄",
  408. },
  409. ],
  410. objtoubaoren: [
  411. {
  412. label: "投保人",
  413. value: "toubaoren",
  414. },
  415. {
  416. label: "被保人",
  417. value: "beibaoren",
  418. },
  419. {
  420. label: "车主",
  421. value: "chezhu",
  422. },
  423. ],
  424. checkedmData: [],
  425. conditiondata: [
  426. {
  427. title: "保单信息",
  428. options: [
  429. {
  430. name: "险种",
  431. // cities:['机动车损失险','第三者责任险']
  432. cities: [
  433. {
  434. label:'机动车损失险',
  435. type:'select',
  436. prop:'机动车损失险',
  437. options:insureOptions
  438. },
  439. {
  440. label:'第三者责任险',
  441. type:'select',
  442. prop:'第三者责任险',
  443. options:insureOptions
  444. },{
  445. label:'司机责任险',
  446. type:'select',
  447. prop:'司机责任险',
  448. options:insureOptions
  449. },{
  450. label:'乘客责任险',
  451. type:'select',
  452. prop:'乘客责任险',
  453. options:insureOptions
  454. },{
  455. label:'附加医保-三者',
  456. type:'select',
  457. prop:'附加医保-三者',
  458. options:insureOptions
  459. },{
  460. label:'附加医保-座位险(乘客)',
  461. type:'select',
  462. prop:'附加医保-座位险(乘客)',
  463. options:insureOptions
  464. },{
  465. label:'附加医保-座位险(司机)',
  466. type:'select',
  467. prop:'附加医保-座位险(司机)',
  468. options:insureOptions
  469. },
  470. ],
  471. },
  472. ],
  473. },
  474. {
  475. title: "车辆信息",
  476. options: [
  477. {
  478. name: "车辆",
  479. cities: [
  480. {
  481. label:'车辆识别代码',
  482. prop:'车辆识别代码',
  483. type:'input',
  484. },
  485. {
  486. label:'品牌型号',
  487. prop:'品牌型号',
  488. type:'input'
  489. },{
  490. label:'新车购置价',
  491. prop:'新车购置价',
  492. type:'input'
  493. },{
  494. label:'注册日期',
  495. prop:'注册日期',
  496. type:'date'
  497. },
  498. {
  499. label:'发证日期',
  500. prop:'发证日期',
  501. type:'date'
  502. },
  503. ],
  504. },
  505. ],
  506. },
  507. {
  508. title: "关系人信息",
  509. options: [
  510. {
  511. name: "车主",
  512. cities: [
  513. {
  514. label:'车主性别',
  515. prop:'车主性别',
  516. type:'input',
  517. hide: true,
  518. name: "chezhu",
  519. },
  520. ],
  521. }, {
  522. name: "投保人",
  523. cities: [
  524. {
  525. label:'投保人性别',
  526. prop:'投保人性别',
  527. type:'input',
  528. hide: true,
  529. name: "toubaoren",
  530. },
  531. ],
  532. }, {
  533. name: "被保人",
  534. cities: [
  535. {
  536. label:'被保人性别',
  537. prop:'被保人性别',
  538. type:'input',
  539. hide: true,
  540. name: "beibaoren",
  541. },
  542. ],
  543. },
  544. ],
  545. },
  546. ],
  547. dialogVisible: false,
  548. dialogTitle: "添加其他条件",
  549. options: [
  550. {
  551. value: "1",
  552. label: "符合其一",
  553. },
  554. {
  555. value: "2",
  556. label: "全部除外",
  557. },
  558. ],
  559. formData: {
  560. chepai2: "",
  561. 条件适用对象: [],
  562. },
  563. trafficManagementVehicleTypeoptions: [],
  564. natureOfVehicleUseoptions: [],
  565. licenseOptions: [],
  566. energyTypeoptions: [],
  567. };
  568. },
  569. computed: {
  570. circularContent() {
  571. return [
  572. {
  573. title: "车险预核条件",
  574. hideAll: true,
  575. img: imgSrc1,
  576. concant: [
  577. {
  578. label: "政策简介",
  579. prop: "transfer",
  580. type: "textarea",
  581. },
  582. {
  583. label: "条件描述",
  584. prop: "条件描述",
  585. type: "textarea",
  586. },
  587. ],
  588. },
  589. {
  590. title: "规则类型",
  591. hideAll: true,
  592. img: imgSrc2,
  593. nooperate: true,
  594. concant: [
  595. {
  596. label: "符合以下条件的车辆,系统将",
  597. prop: "符合以下条件的车辆,系统将",
  598. type: "input",
  599. labelWidth: "250px",
  600. },
  601. ],
  602. },
  603. {
  604. title: "保单信息",
  605. hideAll: true,
  606. img: imgSrc3,
  607. concant: [
  608. {
  609. label: "含交叉销售",
  610. prop: "含交叉销售",
  611. type: "radio",
  612. options: [
  613. {
  614. label: "是",
  615. value: "1",
  616. },
  617. {
  618. label: "否",
  619. value: "0",
  620. },
  621. ],
  622. },
  623. {
  624. label: "非车产品",
  625. prop: "非车产品",
  626. type: "select",
  627. options: [],
  628. },
  629. {
  630. label: "非车保费(元)",
  631. prop1: "非车保费1",
  632. prop2: "非车保费2",
  633. type: "inputconnect",
  634. },
  635. {
  636. label: "附加医保座位险总保额(乘客-万元)",
  637. prop1: "附加医保座位险总保额(乘客-万元)1",
  638. prop2: "附加医保座位险总保额(乘客-万元)2",
  639. type: "inputconnect",
  640. },
  641. {
  642. label: "座位险保额(乘客每座-万元)",
  643. prop1: "座位险保额(乘客每座-万元)1",
  644. prop2: "座位险保额(乘客每座-万元)2",
  645. type: "inputconnect",
  646. },
  647. {
  648. label: "座位险保额(司乘每座-万元)",
  649. prop1: "座位险保额(司乘每座-万元)1",
  650. prop2: "座位险保额(司乘每座-万元)2",
  651. type: "inputconnect",
  652. },
  653. ],
  654. },
  655. {
  656. title: "车辆信息",
  657. hideAll: true,
  658. img: imgSrc4,
  659. concant: [
  660. {
  661. label: "过户车",
  662. prop: "过户车",
  663. type: "radio",
  664. options: [
  665. {
  666. label: "是",
  667. value: "1",
  668. },
  669. {
  670. label: "否",
  671. value: "0",
  672. },
  673. ],
  674. },
  675. {
  676. label: "新车",
  677. prop: "新车",
  678. type: "radio",
  679. options: [
  680. {
  681. label: "是",
  682. value: "1",
  683. },
  684. {
  685. label: "否",
  686. value: "0",
  687. },
  688. ],
  689. },
  690. {
  691. label: "新能源",
  692. prop: "新能源",
  693. type: "radio",
  694. options: [
  695. {
  696. label: "是",
  697. value: "1",
  698. },
  699. {
  700. label: "否",
  701. value: "0",
  702. },
  703. ],
  704. },
  705. {
  706. label: "能源类型",
  707. prop: "能源类型",
  708. type: "selectmultiple",
  709. options: this.energyTypeoptions,
  710. },
  711. {
  712. label: "使用性质",
  713. prop1: "使用性质1",
  714. prop2: "使用性质2",
  715. type: "selectsearch",
  716. options: this.natureOfVehicleUseoptions,
  717. },
  718. {
  719. label: "车辆类型",
  720. prop1: "车辆类型1",
  721. prop2: "车辆类型2",
  722. type: "selectsearch",
  723. options: this.trafficManagementVehicleTypeoptions,
  724. },
  725. {
  726. label: "额定载重质量(吨)",
  727. prop1: "额定载重质量1",
  728. prop2: "额定载重质量2",
  729. type: "inputconnect",
  730. },
  731. {
  732. label: "整备质量(千克)",
  733. prop1: "整备质量1",
  734. prop2: "整备质量2",
  735. type: "inputconnect",
  736. },
  737. {
  738. label: "总质量(千克)",
  739. prop1: "总质量1",
  740. prop2: "总质量2",
  741. type: "inputconnect",
  742. },
  743. {
  744. label: "座位数(个)",
  745. prop1: "座位数1",
  746. prop2: "座位数2",
  747. type: "inputconnect",
  748. },
  749. {
  750. label: "车龄(月)",
  751. prop1: "车龄1",
  752. prop2: "车龄2",
  753. type: "inputconnect",
  754. },
  755. {
  756. label: "车价(万元)",
  757. prop1: "车价1",
  758. prop2: "车价2",
  759. type: "inputconnect",
  760. },
  761. {
  762. label: "排气量(cc)",
  763. prop1: "排气量1",
  764. prop2: "排气量2",
  765. type: "inputconnect",
  766. },
  767. {
  768. label: "包含品牌",
  769. prop: "包含品牌",
  770. type: "createSelect",
  771. options: [],
  772. },
  773. {
  774. label: "除外品牌",
  775. prop: "除外品牌",
  776. type: "createSelect",
  777. options: [],
  778. },
  779. {
  780. label: "是否上牌",
  781. prop: "是否上牌",
  782. type: "radio",
  783. options: [
  784. {
  785. label: "是",
  786. value: "1",
  787. },
  788. {
  789. label: "否",
  790. value: "0",
  791. },
  792. ],
  793. },
  794. {
  795. label: "车牌",
  796. prop1: "车牌1",
  797. prop2: "chepai2",
  798. type: "slot",
  799. options: this.licenseOptions,
  800. },
  801. ],
  802. },
  803. {
  804. title: "关系人信息",
  805. hideAll: true,
  806. img: imgSrc5,
  807. concant: [
  808. {
  809. label: "条件适用对象",
  810. prop: "条件适用对象",
  811. type: "slot",
  812. },
  813. {
  814. label: "适用对象校验方式",
  815. prop: "适用对象校验方式",
  816. type: "select",
  817. options: [
  818. {
  819. label: "适用对象至少其一符合以下条件",
  820. value: "1",
  821. },
  822. {
  823. label: "适用对象全部符合以下条件",
  824. value: "2",
  825. },
  826. ],
  827. },
  828. {
  829. label: "",
  830. prop: "车主",
  831. type: "slot",
  832. name: "chezhu",
  833. hide: true,
  834. col: 24,
  835. labelWidth: "0",
  836. },
  837. {
  838. label: "车主年龄(女)(岁)",
  839. prop: "车主年龄",
  840. hide: true,
  841. type: "inputconnect",
  842. name: "chezhu",
  843. },
  844. {
  845. label: "车主年龄(男)(岁)",
  846. prop: "车主年龄1",
  847. hide: true,
  848. type: "inputconnect",
  849. name: "chezhu",
  850. },
  851. {
  852. label: "车主证件号",
  853. prop: "车主证件号",
  854. hide: true,
  855. type: "input",
  856. name: "chezhu",
  857. },
  858. {
  859. label: "",
  860. prop: "投保人",
  861. type: "slot",
  862. name: "toubaoren",
  863. hide: true,
  864. col: 24,
  865. labelWidth: "0",
  866. },
  867. {
  868. label: "投保人年龄(女)(岁)",
  869. prop: "投保人年龄",
  870. hide: true,
  871. type: "inputconnect",
  872. name: "toubaoren",
  873. },
  874. {
  875. label: "投保人年龄(男)(岁)",
  876. prop: "投保人年龄1",
  877. hide: true,
  878. type: "inputconnect",
  879. name: "toubaoren",
  880. },
  881. {
  882. label: "投保人证件号",
  883. prop: "投保人证件号",
  884. hide: true,
  885. type: "input",
  886. name: "toubaoren",
  887. },
  888. {
  889. label: "",
  890. prop1: "被保人1",
  891. prop2: "被保人2",
  892. type: "slot",
  893. name: "beibaoren",
  894. hide: true,
  895. col: 24,
  896. labelWidth: "0",
  897. },
  898. {
  899. label: "被保人年龄(女)(岁)",
  900. prop: "被保人年龄",
  901. hide: true,
  902. type: "inputconnect",
  903. name: "beibaoren",
  904. },
  905. {
  906. label: "被保人年龄(男)(岁)",
  907. prop: "被保人年龄1",
  908. hide: true,
  909. type: "inputconnect",
  910. name: "beibaoren",
  911. },
  912. {
  913. label: "被保人证件号",
  914. prop: "被保人证件号",
  915. hide: true,
  916. type: "input",
  917. name: "beibaoren",
  918. },
  919. ],
  920. },
  921. ];
  922. },
  923. },
  924. created() {
  925. this.getDicType("natureOfVehicleUse"); //车辆使用性质
  926. this.getDicType("trafficManagementVehicleType"); //车辆类型
  927. this.getDicType("energyType"); //能源种类
  928. this.$api.insCompany.license().then((res) => {
  929. this.licenseOptions = res.data;
  930. });
  931. this.conditiondata.forEach((val, index) => {
  932. this.checkedmData[index] = {
  933. checkAll: false,
  934. isIndeterminate: false,
  935. checkedCities: [],
  936. option:[]
  937. };
  938. });
  939. },
  940. methods: {
  941. //--数据字典 begin --
  942. getDicType(type) {
  943. this.$api.insCompany.dicType(type).then((res) => {
  944. if (res.code == 200) {
  945. if (type == "insOrderStatus") {
  946. let data = JSON.parse(JSON.stringify(res.data.ddList));
  947. data.unshift({
  948. dictTag: "全部",
  949. dictValue: "888",
  950. });
  951. this[type + "options"] = data;
  952. } else {
  953. this[type + "options"] = res.data.ddList;
  954. }
  955. }
  956. });
  957. },
  958. hides(index) {
  959. this.circularContent[index].hideAll =
  960. !this.circularContent[index].hideAll;
  961. },
  962. selectAll(val) {
  963. this.formData[val.prop1] = [];
  964. if (val.checked) {
  965. val.options.map((item) => {
  966. this.formData[val.prop1].push(item.value);
  967. });
  968. } else {
  969. this.formData[val.prop1] = [];
  970. }
  971. },
  972. changeSelect(data, val) {
  973. if (data.length === val.options.length) {
  974. val.checked = true;
  975. } else {
  976. val.checked = false;
  977. }
  978. },
  979. chooseCondition(event, item) {
  980. if (event) {
  981. this.circularContent[4].concant.forEach((ele) => {
  982. if (ele.name == item.value) {
  983. console.log(ele)
  984. ele.hide = false;
  985. }
  986. // return ele;
  987. });
  988. } else {
  989. this.circularContent[4].concant.forEach((ele) => {
  990. if (ele.name == item.value) {
  991. ele.hide = true;
  992. }
  993. // return ele;
  994. });
  995. }
  996. },
  997. // 投保人同车主功能
  998. isoOwnerFun(val) {
  999. if (val) {
  1000. this.circularContent[4].concant.forEach((ele, index) => {
  1001. if (ele.name == "toubaoren" && ele.label != "") {
  1002. this.circularContent[4].concant[index].hide = true;
  1003. this.circularContent = Array.from(this.circularContent);
  1004. }
  1005. });
  1006. } else {
  1007. this.circularContent[4].concant.forEach((ele, index) => {
  1008. if (ele.name == "toubaoren") {
  1009. ele.hide = false;
  1010. }
  1011. });
  1012. }
  1013. },
  1014. isoApplicantFun(val) {
  1015. if (val) {
  1016. this.circularContent[4].concant.forEach((ele, index) => {
  1017. if (ele.name == "beibaoren" && ele.label != "") {
  1018. this.circularContent[4].concant[index].hide = true;
  1019. this.circularContent = Array.from(this.circularContent);
  1020. }
  1021. });
  1022. } else {
  1023. this.circularContent[4].concant.forEach((ele, index) => {
  1024. if (ele.name == "beibaoren") {
  1025. ele.hide = false;
  1026. }
  1027. });
  1028. }
  1029. },
  1030. addConditions(type) {
  1031. this.dialogVisible = true;
  1032. if (type == "1") {
  1033. this.dialogTitle = "条件配置";
  1034. } else {
  1035. this.dialogTitle = "常用条件配置";
  1036. }
  1037. },
  1038. // 全选
  1039. handleCheckAllChange(index) {
  1040. let arr = [];
  1041. this.conditiondata[index].options.forEach((val) =>{
  1042. this.checkedmData[index].option.push(...val.cities)
  1043. arr.push(...val.cities.map(ele=>ele.label))
  1044. });
  1045. this.checkedmData[index].checkedCities = this.checkedmData[index].checkAll
  1046. ? arr
  1047. : [];
  1048. this.checkedmData[index].isIndeterminate = false;
  1049. this.checkedmData = [...this.checkedmData];
  1050. },
  1051. // 单选
  1052. handleCheckedCitiesChange(value,cities, index, cindex) {
  1053. if(value.checkedCities.length>0){
  1054. this.checkedmData[index].option=[]
  1055. value.checkedCities.forEach(ele=>{
  1056. this.checkedmData[index].option.push(cities.find(val=>val.label==ele))
  1057. })
  1058. }
  1059. let checkedCount = value.checkedCities.length;
  1060. // 全选按钮是否打勾
  1061. this.checkedmData[index].checkAll =checkedCount === this.conditiondata[index].options[cindex].cities.length||checkedCount === this.conditiondata[index].options.length;
  1062. this.checkedmData[index].isIndeterminate = checkedCount > 0 && checkedCount < this.conditiondata[index].options[cindex].cities.length|| checkedCount < this.conditiondata[index].options.length;
  1063. this.checkedmData = [...this.checkedmData];
  1064. },
  1065. // 条件配置保存
  1066. conditionSave() {
  1067. console.log( this.checkedmData,this.circularContent,6666666666666666)
  1068. this.dialogVisible = false;
  1069. this.conditiondata.forEach((val,index)=>{
  1070. this.checkedmData[index].title=val.title
  1071. })
  1072. // 页面数据
  1073. let arr=[]
  1074. let arr1=[]
  1075. this.circularContent.forEach(ele=>{
  1076. // 条件配置返回数据
  1077. this.checkedmData.forEach(ele1=>{
  1078. if(ele.title==ele1.title){
  1079. // 将条件配置返回的数据插入到页面对应模块位置中
  1080. ele.concant.forEach((ele2,index2)=>ele1.option.find((ele3,index3)=>{
  1081. if(ele3.name==ele2.name && ele2.label==''){
  1082. // console.log(ele3,index2,900000000000)
  1083. arr.push(ele3)
  1084. arr1.push(index2)
  1085. ele.concant.splice(index2,0,ele3)
  1086. }
  1087. }))
  1088. let aaa= ele.concant.find((ele2,index2)=>ele1.option.map((ele3,index3)=>ele3.name==ele2.name && ele2.label=='' ))
  1089. console.log(aaa,88888888888888)
  1090. // ele.concant.splice(ele.concant.findIndex(ele2=>ele1.option.find(ele3=>ele3.name==ele2.name && ele2.label==''))+1,0,ele1.option)
  1091. }
  1092. })
  1093. })
  1094. console.log(Array.from(new Set(arr)) ,arr1,900000000000)
  1095. },
  1096. // 另存为模板
  1097. saveTemplate() {
  1098. this.$prompt("请输入模板名称", "提示", {
  1099. inputAttrs: {
  1100. maxlength: 10, // 设置最大长度为10
  1101. },
  1102. })
  1103. .then(({ value }) => {
  1104. console.log(value, 444444444);
  1105. // 处理输入值
  1106. })
  1107. .catch(() => {
  1108. // 取消操作
  1109. });
  1110. },
  1111. // 导入模板
  1112. importTemplate() {
  1113. this.ImportdialogVisible = true;
  1114. },
  1115. deleteRow(index) {
  1116. this.$confirm("确认删除该模板吗?", "提示", {
  1117. confirmButtonText: "确定",
  1118. cancelButtonText: "取消",
  1119. type: "warning",
  1120. })
  1121. .then(() => {})
  1122. .catch(() => {});
  1123. },
  1124. },
  1125. };
  1126. </script>
  1127. <style scoped lang="scss">
  1128. .clearfix:before,
  1129. .clearfix:after {
  1130. clear: both;
  1131. display: table;
  1132. content: "";
  1133. }
  1134. .hide-all {
  1135. display: none;
  1136. }
  1137. .clearfix {
  1138. padding-left: 20px;
  1139. span {
  1140. font-weight: 600;
  1141. font-size: 15px;
  1142. }
  1143. span > img {
  1144. vertical-align: middle;
  1145. width: 26px;
  1146. height: 26px;
  1147. margin-right: 5px;
  1148. }
  1149. }
  1150. .head_operate {
  1151. text-align: right;
  1152. padding: 10px 0;
  1153. }
  1154. .often-box-title {
  1155. padding: 10px;
  1156. background-color: #ffeede;
  1157. font-weight: bold;
  1158. }
  1159. .often-content-classify {
  1160. display: flex;
  1161. flex-direction: row;
  1162. justify-content: space-between;
  1163. }
  1164. .often-box .often-content-classify:not(:last-child) {
  1165. border-bottom: 1px solid #ccc;
  1166. }
  1167. .classify-title {
  1168. width: 100px;
  1169. text-align: right;
  1170. padding: 15px 5px 0px 0px;
  1171. font-weight: 600;
  1172. }
  1173. .often-content {
  1174. display: flex;
  1175. flex-wrap: wrap;
  1176. justify-content: flex-start;
  1177. padding: 10px;
  1178. flex: 1;
  1179. }
  1180. .often-content-child {
  1181. width: 22%;
  1182. padding: 5px 0;
  1183. }
  1184. .title-text {
  1185. display: inline-block;
  1186. width: 100px;
  1187. font-size: 15px;
  1188. font-weight: 900;
  1189. }
  1190. </style>