|
|
@@ -16,7 +16,7 @@
|
|
|
</el-form-item>
|
|
|
<el-form-item label="险种类型" prop="productId">
|
|
|
<el-radio-group v-model="projectAddFrom.productId">
|
|
|
- <el-radio-button v-for="item in insuranceType" :key="item.id" :value="item.id">{{ item.label }}</el-radio-button>
|
|
|
+ <el-radio-button v-for="item in insuranceType" :key="item.value" :value="item.value">{{ item.label }}</el-radio-button>
|
|
|
</el-radio-group>
|
|
|
</el-form-item>
|
|
|
<div style="display: flex;">
|
|
|
@@ -53,31 +53,40 @@
|
|
|
<div>
|
|
|
<div style="display: flex; align-items: center; margin-bottom: 10px">
|
|
|
<span style="margin-right: 20px">驾意险</span>
|
|
|
- <el-button link icon="plus" type="primary">选择驾意险</el-button>
|
|
|
+ <el-button link icon="plus" type="primary" @click="handleDriving(item, index)">选择驾意险</el-button>
|
|
|
+ <el-dialog
|
|
|
+ v-model="drivingShow"
|
|
|
+ title="选择驾意险"
|
|
|
+ width="700"
|
|
|
+ >
|
|
|
+ <driving @close="handleDrivingClose(item, $event)"></driving>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
<el-table
|
|
|
- :data="projectAddFrom.A"
|
|
|
+ :data="item.drivingList"
|
|
|
>
|
|
|
- <el-table-column label="名称" prop="a">
|
|
|
+ <el-table-column label="名称" prop="productName">
|
|
|
<template #default="scope">
|
|
|
- <a>名称名称</a>
|
|
|
+ <a>{{ scope.row.productName }}</a>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="客户端状态" prop="f">
|
|
|
<template #default="scope">
|
|
|
- <el-select v-model="projectAddFrom.f">
|
|
|
+ <el-select v-model="scope.row.selectedStatus">
|
|
|
<el-option label="默认不选中" key="1" value="1"></el-option>
|
|
|
<el-option label="默认选中" key="2" value="2"></el-option>
|
|
|
<el-option label="强制选中" key="3" value="3"></el-option>
|
|
|
</el-select>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="份数" prop="g">
|
|
|
- <el-input v-model="projectAddFrom.g"></el-input>份
|
|
|
+ <el-table-column label="份数" prop="quantity">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-input v-model="scope.row.quantity" style="width: 100px;"></el-input>份
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
<el-table-column label="操作">
|
|
|
<template #default="scope">
|
|
|
- <el-button link>删除</el-button>
|
|
|
+ <el-button link type="primary" @click="drivingTypeDel(item, scope.row)">删除</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -140,18 +149,19 @@
|
|
|
import api from "@/api";
|
|
|
import { ElMessage } from "element-plus";
|
|
|
import insurance from '../../../../layouts/components/InsuranceType/index.vue'
|
|
|
+import driving from '../../../../layouts/components/DrivingType/index.vue'
|
|
|
|
|
|
const InsuranceTypeRef = ref(null)
|
|
|
|
|
|
let projectAddFrom = ref({
|
|
|
- rulesList: [{
|
|
|
-
|
|
|
- }],
|
|
|
+ rulesList: [],
|
|
|
schemeList: [{
|
|
|
schemeName: '',
|
|
|
description: '',
|
|
|
tableData: [],
|
|
|
- schemeInsuranceList: []
|
|
|
+ drivingList: [],
|
|
|
+ schemeInsuranceList: [],
|
|
|
+ drivingIntentionList: []
|
|
|
}]
|
|
|
})
|
|
|
let projectAddRules = ref({
|
|
|
@@ -184,7 +194,9 @@ const addProject = () => {
|
|
|
schemeName: '',
|
|
|
description: '',
|
|
|
tableData: [],
|
|
|
- schemeInsuranceList: []
|
|
|
+ drivingList: [],
|
|
|
+ schemeInsuranceList: [],
|
|
|
+ drivingIntentionList: []
|
|
|
})
|
|
|
}
|
|
|
|
|
|
@@ -226,6 +238,27 @@ const insuranceTypeDel = (item, row) => {
|
|
|
item.tableData = [...data]
|
|
|
}
|
|
|
|
|
|
+// 驾意险
|
|
|
+let drivingShow = ref(false)
|
|
|
+const handleDriving = (item, index) => {
|
|
|
+ drivingShow.value = true
|
|
|
+}
|
|
|
+const handleDrivingClose = (item, list ) => {
|
|
|
+ if(list && list.length > 0) {
|
|
|
+ list.forEach(sub => {
|
|
|
+ sub.drivingIntentionId = sub.id
|
|
|
+ sub.selectedStatus = '1'
|
|
|
+ sub.quantity = '1'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ item.drivingList = list
|
|
|
+ drivingShow.value = false
|
|
|
+}
|
|
|
+const drivingTypeDel = (item, row) => {
|
|
|
+ let data = item.drivingList.filter(a => a.id != row.id)
|
|
|
+ item.drivingList = [...data]
|
|
|
+}
|
|
|
+
|
|
|
const handlePopover = (item, index) => {
|
|
|
insuranceShow.value = true
|
|
|
nextTick(() => {
|
|
|
@@ -239,7 +272,35 @@ const quit = () => {
|
|
|
}
|
|
|
// 保存
|
|
|
const save = () => {
|
|
|
- console.log(123, projectAddFrom.value)
|
|
|
+ let formData = {...projectAddFrom.value}
|
|
|
+ formData.schemeList.forEach(item => {
|
|
|
+ item.drivingList.forEach(sub => {
|
|
|
+ let obj = {
|
|
|
+ drivingIntentionId: sub.id,
|
|
|
+ selectedStatus: sub.selectedStatus,
|
|
|
+ quantity: sub.quantity
|
|
|
+ }
|
|
|
+ item.drivingIntentionList.push(obj)
|
|
|
+ })
|
|
|
+ item.tableData.forEach(ins => {
|
|
|
+ let obj = {
|
|
|
+ insuranceId: ins.id,
|
|
|
+ optionId: ins.options.find(a => a.checked)?.value
|
|
|
+ }
|
|
|
+ item.schemeInsuranceList.push(obj)
|
|
|
+ })
|
|
|
+ })
|
|
|
+ console.log(123, formData)
|
|
|
+ api.projectApi.saveScheme({...formData}).then(res => {
|
|
|
+ if(res.code == 200) {
|
|
|
+
|
|
|
+ } else {
|
|
|
+ ElMessage({
|
|
|
+ message: res.msg,
|
|
|
+ type: 'warning'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|