costManagement.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691
  1. <template>
  2. <div>
  3. <PageMain class="vh100">
  4. <SearchForm :fields="fields" isOffset :formInline="formInline" :onSearch="agreementQuery" :onReset="resetForm" />
  5. <ComplexTable :tableData="tableData" :columns="columns" :showIndex="false" :columnwidth="200" :showSelect="true"
  6. :pageInfo="pageInfo" @getList="getList" @selectionChange="selectionChange" uniqueIdName="costId">
  7. <template v-slot:table-title-btn>
  8. <el-button type="primary" @click="agreementSelection()">
  9. 添加费用
  10. <template #icon>
  11. <el-icon>
  12. <Plus />
  13. </el-icon>
  14. </template>
  15. </el-button>
  16. <el-dropdown placement="bottom-start">
  17. <el-button> 批量管理<el-icon>
  18. <arrow-down />
  19. </el-icon>
  20. </el-button>
  21. <template #dropdown>
  22. <el-dropdown-menu>
  23. <el-dropdown-item :disabled="!sysUpAndDownList.length" @click="batchDel">删除</el-dropdown-item>
  24. <el-dropdown-item :disabled="!sysUpAndDownList.length" @click="batchdisable">禁用</el-dropdown-item>
  25. <el-dropdown-item :disabled="!sysUpAndDownList.length" @click="batchenable">启用</el-dropdown-item>
  26. </el-dropdown-menu>
  27. </template>
  28. </el-dropdown>
  29. </template>
  30. <template v-slot:operation="scope">
  31. <el-button type="primary" link @click="agreemenUpdate(scope.operationData)"> 编辑
  32. </el-button>
  33. <el-dropdown placement="bottom-start" trigger="click">
  34. <span class="el-dropdown-link">
  35. 更 多
  36. </span>
  37. <template #dropdown>
  38. <el-dropdown-menu>
  39. <el-dropdown-item @click="enable(scope.operationData.costId)">启用</el-dropdown-item>
  40. <el-dropdown-item @click="disable(scope.operationData.costId)">禁用</el-dropdown-item>
  41. <el-dropdown-item @click="del(scope.operationData.costId)">删除</el-dropdown-item>
  42. </el-dropdown-menu>
  43. </template>
  44. </el-dropdown>
  45. </template>
  46. </ComplexTable>
  47. </PageMain>
  48. <el-dialog :close-on-click-modal="false" v-model="agreementSelectionVisible" title="选择协议" width="50%">
  49. <div class="Selection flex ">
  50. <div class="agreement flex f-c">
  51. <div class="flex a-c">
  52. <el-input v-model="agreementQueryName" style="width: 240px;margin-right: 10px;"
  53. placeholder="输入协议名称,简称,编码查找" />
  54. <el-button type="primary" @click="agreement">查询</el-button>
  55. </div>
  56. <div class="flex f-c m-top-20" style="max-height: 400px;overflow-y: auto;">
  57. <div class="agreementItem flex f-c " :class="{ active: agritem.id == AgreementId }"
  58. v-for="(agritem, agrindex) in agreementList" :key="agrindex" @click="ItemClick(agritem)">
  59. <span class="m-btn-10">{{ agritem.agreementCode }}</span>
  60. <span>{{ agritem.agreementTitle }}-{{ agritem.agreementAbbreviation }}-{{ agritem.agreementName }}</span>
  61. </div>
  62. </div>
  63. </div>
  64. <div class="rule flex f-c">
  65. <span class="strong">承保规则</span>
  66. <div class="flex f-c m-top-20" style="max-height: 400px;overflow-y: auto;">
  67. <el-radio-group v-model="ruleId">
  68. <div class="flex f-c ">
  69. <el-radio :value="item.id" v-for="(item, index) in ruleList" :key="index" @change="ruleItemclick"
  70. style="margin: 20px 0;">
  71. <p class="white-space">{{ item.ruleDescription }}</p>
  72. </el-radio>
  73. </div>
  74. </el-radio-group>
  75. </div>
  76. </div>
  77. </div>
  78. <template #footer>
  79. <div class="dialog-footer">
  80. <el-button class="border-[#0083FF] color-[#0083FF]" plain
  81. @click="agreementSelectionVisible = false">取消</el-button>
  82. <el-button type="primary" @click="agreementSelectionConfirm" :disabled="!ruleInfo">
  83. 确定
  84. </el-button>
  85. </div>
  86. </template>
  87. </el-dialog>
  88. <!-- 规则费用抽屉组件 -->
  89. <ruleFeeDialog v-if="ruleFeeVisible" :ruleFeeVisible="ruleFeeVisible" :agreementInfo="AgreementInfo"
  90. :RulesInfo="ruleInfo" @save="ruleFeeSave" @cancel="ruleFeeVisible = false" :handlingFee="handlingFeeInfo" />
  91. <!-- 规则费用编辑组件 -->
  92. <ruleFeeDialogEdit :ruleFeeVisible="ruleFeeEditVisible" :headerTitle="ruleFeeHeaderTitle" :isHideFoot="true"
  93. :agreementInfo="AgreementInfo" :RulesInfo="ruleInfo" :costitemEditInfo="costitemEditInfo" @save="ruleFeeEditSave"
  94. @cancel="ruleFeeEditVisible = false" />
  95. </div>
  96. </template>
  97. <script lang="ts" setup>
  98. import { ref, reactive } from 'vue'
  99. import { useRoute, useRouter } from 'vue-router';
  100. import { ElMessage, ElMessageBox } from 'element-plus'
  101. import { loadDicts, getDict } from '@/utils/composables/dictService';//字典组件
  102. import ruleFeeDialog from "./agreement/components/ruleFeeDialog.vue";
  103. import ruleFeeDialogEdit from "./agreement/components/ruleFeeDialogEdit.vue";
  104. import api from '@/api';
  105. interface PageInfo {
  106. pageNum: number;
  107. pageSize: number;
  108. sizes: number[];
  109. total: number;
  110. }
  111. onBeforeMount(async () => {
  112. await loadDicts(['valid_status', 'is_enable', 'audit_status', 'insurance_type']);//获取多个字典
  113. if (id.value) {
  114. formInline.agreement = id.value;
  115. }
  116. findpage();//列表数据
  117. getDeptTree();
  118. agreement();
  119. initCompany();
  120. valid_status.value = getDict('valid_status');//生效状态
  121. is_enable.value = getDict('is_enable');//协议状态
  122. insurance_type.value = getDict('insurance_type')
  123. audit_status.value = getDict('audit_status')
  124. });
  125. const tableData = ref([
  126. ]);
  127. const agreementQueryName = ref();//选择协议查询
  128. const agreementList = ref();//协议列表
  129. const sysUpAndDownList = ref<string[]>([])//选中id
  130. const deptOptions = ref()//机构数据
  131. const insurance_type = ref();
  132. const valid_status = ref();
  133. const audit_status = ref();
  134. const is_enable = ref();
  135. const route = useRoute();
  136. const router = useRouter();
  137. const id = ref(route.query.id as string);//id参数
  138. const pageInfo = ref({
  139. pageNum: 1,
  140. pageSize: 20,
  141. sizes: [10, 20, 30, 40, 50],
  142. total: 100,
  143. });
  144. const formInline = reactive({
  145. agreement: '',//协议信息
  146. productId: "",//归属
  147. rulesName: '',//保险公司id
  148. costRules: '',//协议类型
  149. costRulesList: [],//协议类型
  150. agreementStatus: "",//有效状态
  151. auditStatus: "",//协议状态
  152. validState: "",
  153. effectiveTime: [],
  154. failureTime: [],
  155. updateTimeArr: [],
  156. companyId: [],
  157. contactPerson: "",
  158. })
  159. // 保险公司
  160. let companyOption = ref([])
  161. const initCompany = () => {
  162. // api.projectApi.getCompanyList().then(res => {
  163. api.insuranceApi.leftList('').then((res: any) => {
  164. if (res.code == 200) {
  165. companyOption.value = res.data.map(item => {
  166. return {
  167. label: item.name,
  168. value: item.id
  169. }
  170. })
  171. } else {
  172. ElMessage({
  173. message: res.msg,
  174. type: 'warning'
  175. })
  176. }
  177. })
  178. }
  179. //表格字段数据
  180. const fields = ref([
  181. { label: "所属协议", model: "agreement", type: "input", placeholder: "输入协议号,名称,简称查找" },
  182. {
  183. label: "险种", model: "productId", type: "select", options: insurance_type,
  184. },
  185. {
  186. label: "承保规则", model: "rulesName", type: "input", placeholder: "输入业务规则查找",
  187. },
  188. {
  189. label: "费用描述", model: "costRulesList", type: "inputTag", placeholder: "输入费用描述关键字查找",
  190. },
  191. {
  192. label: "费用状态", model: "agreementStatus", type: "select", placeholder: "选择状态", options: is_enable,
  193. },
  194. {
  195. label: "审核状态", model: "auditStatus", type: "select", placeholder: "选择状态", options: audit_status,
  196. },
  197. {
  198. label: "有效状态", model: "validState", type: "select", placeholder: "请选择状态", options: valid_status,
  199. },
  200. {
  201. label: "生效时间", model: "effectiveTime", type: "date", dateType: "datetimerange", startplaceholder: "开始时间", endplaceholder: "结束时间",
  202. format: "YYYY-MM-DD HH:mm:ss", valueFormat: "YYYY-MM-DD HH:mm:ss", timeFormat: "HH:mm:ss",
  203. onChange: (value: any) => {
  204. console.log(value)
  205. formInline.effectiveTime = value;
  206. }
  207. },
  208. {
  209. label: "失效时间", model: "failureTime", type: "date", dateType: "datetimerange", startplaceholder: "开始时间", endplaceholder: "结束时间",
  210. format: "YYYY-MM-DD HH:mm:ss", valueFormat: "YYYY-MM-DD HH:mm:ss", timeFormat: "HH:mm:ss",
  211. onChange: (value: any) => {
  212. formInline.failureTime = value;
  213. }
  214. },
  215. {
  216. label: "保险公司", model: "companyId", type: "select", placeholder: "选择保险公司", options: companyOption, filterable: true
  217. },
  218. {
  219. label: "对接人", model: "contactPerson", type: "input", placeholder: "输入对接人",
  220. },
  221. {
  222. label: "修改时间", model: "updateTimeArr", type: "date", dateType: "datetimerange", startplaceholder: "开始时间", endplaceholder: "结束时间",
  223. onChange: (value: any) => {
  224. formInline.updateTimeArr = value;
  225. }
  226. },
  227. ]);
  228. //费用数据查询
  229. function findpage() {
  230. api.agreementApi.queryByFeePage({ pages: pageInfo.value.pageNum, size: pageInfo.value.pageSize, ...formInline }).then((res: any) => {
  231. if (res.code == '200') {
  232. tableData.value = res.data.records;
  233. pageInfo.value.pageNum = res.data.current;
  234. pageInfo.value.pageSize = res.data.size;
  235. pageInfo.value.total = res.data.total;
  236. } else {
  237. }
  238. });
  239. }
  240. //协议列表查询
  241. function agreement() {
  242. api.agreementApi.agreementList({ pages: pageInfo.value.pageNum, size: 99999, searchValue: agreementQueryName.value }).then((res: any) => {
  243. if (res.code == '200') {
  244. agreementList.value = res.data.records;
  245. } else {
  246. }
  247. });
  248. }
  249. const columns = [
  250. { prop: "companyName", label: "保险公司", width: '120', },
  251. {
  252. prop: "agreementAbbreviation", label: "协议信息", width: '300',
  253. formatter: (row: any) => {
  254. return `${row.agreementCode}\n${row.agreementTitle}-${row.agreementAbbreviation}-${row.agreementName ?? ''}`
  255. }
  256. },
  257. {
  258. prop: "ruleDescription", label: "承保规则", width: '500',
  259. },
  260. { prop: "productName", label: "险种", width: '120', },
  261. {
  262. prop: "costRules", label: "费用规则", width: '500',
  263. },
  264. {
  265. prop: "costDescribe", label: "费用描述", width: '500',
  266. },
  267. {
  268. prop: "isEnabled", label: "费用状态", width: '100', component: "Tag",
  269. formatter: (row: any) => {
  270. let name = getDict('is_enable').find(val => val.value == row.isEnabled).label
  271. if (name) {
  272. return { type: 'primary', text: name };
  273. }
  274. }
  275. },
  276. {
  277. prop: "approved", label: "审核状态", width: '120', component: "Tag",
  278. formatter: (row: any) => {
  279. let name = getDict('audit_status').find(val => val.value == row.approved).label
  280. if (name) {
  281. return { type: 'warning', text: name };
  282. }
  283. }
  284. },
  285. { prop: "dockingPerson", label: "对接人", width: '100' },
  286. { prop: "effectiveTime", label: "生效时间", width: '200' },
  287. { prop: "failureTime", label: "失效时间", width: '200' },
  288. { prop: "updateTime", label: "修改时间", width: '200' },
  289. {
  290. prop: "ruleConditions", label: "交强费用", width: '300', formatter: (row: any) => {
  291. let info = row.ruleConditions.find((val: any) => val.costType == '交强险');
  292. if (info) {
  293. return `入口:${info.inlet.toFixed(2)}% 出口:${info.export.toFixed(2)}%\n加投:${info.addThrow.toFixed(2)}%`
  294. } else {
  295. return '-';
  296. }
  297. }
  298. },
  299. {
  300. prop: "ruleConditions", label: "商业费用", width: '300', formatter: (row: any) => {
  301. let info = row.ruleConditions.find((val: any) => val.costType == '商业险');
  302. if (info) {
  303. return `入口:${info.inlet.toFixed(2)}% 出口:${info.export.toFixed(2)}%\n加投:${info.addThrow.toFixed(2)}%`
  304. } else {
  305. return '-';
  306. }
  307. }
  308. },
  309. {
  310. prop: "ruleConditions", label: "驾意险费用", width: '300', formatter: (row: any) => {
  311. let info = row.ruleConditions.find((val: any) => val.costType == '驾意险');
  312. if (info) {
  313. return `入口:${info.inlet.toFixed(2)}% 出口:${info.export.toFixed(2)}%\n加投:${info.addThrow.toFixed(2)}%`
  314. } else {
  315. return '-';
  316. }
  317. }
  318. },
  319. ];
  320. //分页事件
  321. function getList(item: PageInfo) {
  322. pageInfo.value.pageNum = item.pageNum;
  323. pageInfo.value.pageSize = item.pageSize;
  324. findpage();
  325. };
  326. const agreemenUpdate = async (item: any) => {
  327. let obj = agreementList.value.find(sub => sub.agreementCode === item.agreementCode)
  328. ruleFeeHeaderTitle.value = item.productName;
  329. AgreementInfo.value = { agreementCode: item.agreementCode, agreementTitle: item.agreementAbbreviation, companyId: obj?.companyId };
  330. ruleInfo.value = { ruleDescription: item.ruleDescription };
  331. await regionLicenseRegion('0');//车牌地区
  332. await regionLicenseNumber('14');//车牌号
  333. await api.agreementApi.AgreementFeeById(item.costId).then((res: any) => {
  334. if (res.code == '200') {
  335. res.data.ruleConditions = processArray(res.data.ruleConditions);
  336. costitemEditInfo.value = res.data;
  337. ruleFeeEditVisible.value = true;
  338. }
  339. });
  340. }
  341. const ruleFeeEditSave = (data: object) => {
  342. api.agreementApi.AgreementFeeupdate(data).then((res: any) => {
  343. if (res.code == '200') {
  344. ElMessage({
  345. type: 'success',
  346. message: res.msg,
  347. plain: true,
  348. })
  349. ruleFeeEditVisible.value = false;
  350. findpage();
  351. } else {
  352. }
  353. });
  354. }
  355. //添加车牌和车牌地区
  356. const processArray = (array: any[]) => {
  357. return array.map((val) => {
  358. switch (val.attrType) {
  359. case 'inputNumber':
  360. case 'datetime':
  361. if (!val.operator) {
  362. val.operator = '1'; // 设置默认值
  363. }
  364. break;
  365. default:
  366. break;
  367. }
  368. if (val.attrCode == 'LicenseNo') {
  369. val.dictLabal = licensePlateNumber.value;
  370. }
  371. if (val.attrCode == 'LicenseArea') {
  372. val.dictLabal = licensePlateRegion.value;
  373. }
  374. return val;
  375. });
  376. };
  377. const licensePlateRegion = ref();//车牌地区
  378. const licensePlateNumber = ref();//车牌号
  379. const regionLicenseRegion = (value: string) => {
  380. api.agreementApi.getAreaLicense(value).then((res: any) => {
  381. if (res.code == '200') {
  382. let data: any = [];
  383. res.data.map((val: any) => {
  384. data.push({
  385. code: val.areaNumber,
  386. name: val.license,
  387. })
  388. return val;
  389. })
  390. licensePlateRegion.value = data;
  391. } else {
  392. }
  393. });
  394. }
  395. const regionLicenseNumber = (value: string) => {
  396. api.agreementApi.getAreaLicense(value).then((res: any) => {
  397. if (res.code == '200') {
  398. let data: any = [];
  399. res.data.map((val: any) => {
  400. data.push({
  401. code: val.areaNumber,
  402. name: val.license,
  403. })
  404. return val;
  405. })
  406. licensePlateNumber.value = data;
  407. } else {
  408. }
  409. });
  410. }
  411. //多选事件
  412. const selectionChange = (val: any) => {
  413. console.log(val)
  414. sysUpAndDownList.value = val;
  415. }
  416. //禁用
  417. const disable = (value: string) => {
  418. console.log(value)
  419. ElMessageBox.confirm(
  420. '确定要禁用该协议吗,禁用后,该协议不在支持报价出单,并且已核保待缴费,待支付的订单,都将失效,请确认是否禁用?',
  421. '禁用协议',
  422. {
  423. confirmButtonText: '确定禁用',
  424. type: 'error',
  425. center: true,
  426. confirmButtonClass: 'el-button--danger',
  427. }
  428. )
  429. .then(() => {
  430. sysUpAndDown(false, [value]);
  431. })
  432. }
  433. //启用
  434. const enable = (value: string) => {
  435. sysUpAndDown(true, [value]);
  436. }
  437. const del = (value: string) => {
  438. ElMessageBox.confirm(
  439. '确定要删除该协议吗,删除后,该协议不在支持报价出单,并且已核保待缴费,待支付的订单,都将失效,请确认是否删除?',
  440. '删除协议',
  441. {
  442. confirmButtonText: '确定删除',
  443. type: 'error',
  444. center: true,
  445. confirmButtonClass: 'el-button--danger',
  446. }
  447. )
  448. .then(() => {
  449. api.agreementApi.AgreementFeedeleteByIds([value]).then((res: any) => {
  450. if (res.code == '200') {
  451. findpage()
  452. ElMessage({
  453. type: 'success',
  454. message: res.msg,
  455. plain: true,
  456. })
  457. // router.push({
  458. // name: 'reload',
  459. // })
  460. }
  461. });
  462. })
  463. }
  464. //批量删除
  465. const batchDel = () => {
  466. ElMessageBox.confirm(
  467. '确定要删除该协议吗,删除后,该协议不在支持报价出单,并且已核保待缴费,待支付的订单,都将失效,请确认是否删除?',
  468. '删除协议',
  469. {
  470. confirmButtonText: '确定删除',
  471. type: 'error',
  472. center: true,
  473. confirmButtonClass: 'el-button--danger',
  474. }
  475. )
  476. .then(() => {
  477. api.agreementApi.deleteByIds(sysUpAndDownList.value).then((res: any) => {
  478. if (res.code == '200') {
  479. ElMessage({
  480. type: 'success',
  481. message: res.msg,
  482. plain: true,
  483. })
  484. router.push({
  485. name: 'reload',
  486. })
  487. }
  488. });
  489. })
  490. }
  491. //批量禁用
  492. const batchdisable = () => {
  493. ElMessageBox.confirm(
  494. '确定要禁用该协议吗,禁用后,该协议不在支持报价出单,并且已核保待缴费,待支付的订单,都将失效,请确认是否禁用?',
  495. '禁用协议',
  496. {
  497. confirmButtonText: '确定禁用',
  498. type: 'error',
  499. center: true,
  500. confirmButtonClass: 'el-button--danger',
  501. }
  502. )
  503. .then(async () => {
  504. await sysUpAndDown(false, undefined);
  505. })
  506. .catch(() => {
  507. })
  508. }
  509. //批量启用
  510. const batchenable = async () => {
  511. await sysUpAndDown(true, undefined);
  512. }
  513. const agreementQuery = () => {
  514. findpage();
  515. }
  516. const sysUpAndDown = async (type: boolean, list?: string[]) => {
  517. await api.agreementApi.AgreementFeeEnableByIds(type, list ? list : sysUpAndDownList.value).then((res: any) => {
  518. if (res.code == '200') {
  519. findpage();
  520. ElMessage({
  521. type: 'success',
  522. message: res.msg,
  523. plain: true,
  524. })
  525. }
  526. });
  527. }
  528. const resetForm = () => {
  529. formInline.agreement = '';//协议信息
  530. formInline.productId = "";//归属
  531. formInline.rulesName = '';//保险公司id
  532. formInline.costRules = '';//协议类型
  533. formInline.costRulesList = [];//协议类型
  534. formInline.agreementStatus = "";//有效状态
  535. formInline.auditStatus = "";//协议状态
  536. formInline.validState = "";
  537. formInline.effectiveTime = [];
  538. formInline.failureTime = [];
  539. formInline.companyId = [];
  540. formInline.contactPerson = "";
  541. formInline.updateTimeArr = [];
  542. findpage();
  543. }
  544. const getDeptTree = () => {
  545. api.institutionApi.institutionList({}).then((res: any) => {
  546. if (res.code == '200') {
  547. deptOptions.value = res.data;
  548. } else {
  549. }
  550. });
  551. }
  552. //选择协议弹窗
  553. const agreementSelectionVisible = ref(false);
  554. const ruleFeeVisible = ref(false);
  555. const ruleFeeEditVisible = ref(false);//编辑弹窗
  556. const ruleFeeHeaderTitle = ref();//编辑弹窗title
  557. const costitemEditInfo = ref();//编辑对象
  558. const AgreementInfo = ref();//协议对象
  559. const ruleInfo = ref();//规则对象
  560. const AgreementId = ref();//规则id
  561. const ruleId = ref();//规则id
  562. const ruleList = ref();//协议规则列表
  563. const agreementSelection = () => {
  564. AgreementId.value = '';
  565. ruleList.value = []
  566. agreementSelectionVisible.value = true;
  567. }
  568. let handlingFeeInfo = ref({})
  569. const ItemClick = (item: any) => {
  570. AgreementInfo.value = item;
  571. AgreementId.value = item.id;
  572. ruleId.value = '';
  573. api.agreementApi.agreementRulesList(AgreementId.value).then((res: any) => {
  574. if (res.code == '200') {
  575. ruleList.value = res.data;
  576. }
  577. });
  578. api.agreementApi.agreementGet(AgreementId.value).then((res: any) => {
  579. if (res.code == '200') {
  580. handlingFeeInfo.value = { jqEntranceFeeRatio: res.data.agreement.jqEntranceFeeRatio, syEntranceFeeRatio: res.data.agreement.syEntranceFeeRatio, jyEntranceFeeRatio: res.data.agreement.jyEntranceFeeRatio };
  581. } else {
  582. }
  583. });
  584. }
  585. //
  586. const ruleItemclick = (value: string | number | boolean | undefined) => {
  587. let info = ruleList.value.find((val: any) => val.id == value);
  588. ruleInfo.value = info;
  589. }
  590. const agreementSelectionConfirm = () => {
  591. if (!AgreementId.value) {
  592. ElMessage.error('请选择协议')
  593. return
  594. }
  595. if (!ruleId.value) {
  596. ElMessage.error('请选择规则')
  597. return
  598. }
  599. agreementSelectionVisible.value = false;
  600. ruleFeeVisible.value = true;
  601. }
  602. //规则弹窗回调方法
  603. const ruleFeeSave = (data: object) => {
  604. api.agreementApi.ptlAgreementCostsave(data).then((res: any) => {
  605. if (res.code == '200') {
  606. ElMessage({
  607. type: 'success',
  608. message: res.msg,
  609. plain: true,
  610. })
  611. ruleFeeVisible.value = false;
  612. findpage();
  613. } else {
  614. ElMessage({
  615. type: 'error',
  616. message: res.msg,
  617. plain: true,
  618. })
  619. }
  620. });
  621. }
  622. </script>
  623. <style lang="scss" scoped>
  624. .demo-form-inline .el-input {
  625. --el-input-width: 220px;
  626. }
  627. .demo-form-inline .el-select {
  628. --el-select-width: 220px;
  629. }
  630. :deep(.el-dropdown-link) {
  631. display: flex;
  632. align-items: center;
  633. margin-left: 15px;
  634. color: var(--el-color-primary);
  635. cursor: pointer;
  636. }
  637. .el-inputs {
  638. width: 100% !important;
  639. }
  640. .Selection {
  641. border: 1px solid #dcdfe6;
  642. border-radius: 4px;
  643. .agreement {
  644. width: 40%;
  645. padding: 15px;
  646. border-right: 1px solid #dcdfe6;
  647. .agreementItem {
  648. padding: 10px;
  649. border-radius: 5px;
  650. &:hover {
  651. background: #f2f2f2;
  652. }
  653. }
  654. }
  655. .active {
  656. color: #1890ff;
  657. background: #f2f2f2;
  658. }
  659. .rule {
  660. width: 60%;
  661. padding: 15px;
  662. .white-space {
  663. display: inline-block;
  664. margin-bottom: 10px;
  665. white-space: normal;
  666. }
  667. }
  668. }
  669. </style>