insurance.vue 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552
  1. <template>
  2. <div class="back-line-main">
  3. <div class="back-line-header">
  4. <div class="back-line-header-title">
  5. <h2>保险公司</h2>
  6. <div class="area-city">
  7. <div>
  8. 省份:<a-select
  9. style="width: 200px"
  10. @change="getList()"
  11. v-model="formState.provinceId"
  12. allowClear
  13. >
  14. <a-select-option
  15. v-for="item in areaList"
  16. :key="item.areaCode"
  17. :label="item.areaCname"
  18. :value="item.areaCode"
  19. >
  20. {{ item.areaCname }}
  21. </a-select-option>
  22. </a-select>
  23. </div>
  24. <div>
  25. <span>城市:</span>
  26. <a-select
  27. style="width: 200px"
  28. v-model="formState.cityId"
  29. @change="getList()"
  30. allowClear
  31. >
  32. <a-select-option
  33. v-for="item in cityList"
  34. :key="item.areaCode"
  35. :label="item.areaCname"
  36. :value="item.areaCode"
  37. >
  38. {{ item.areaCname }}
  39. </a-select-option>
  40. </a-select>
  41. </div>
  42. </div>
  43. <div>
  44. <span>时间筛选</span>
  45. <a-range-picker
  46. @change="onChangeTime"
  47. v-model="formState.time"
  48. valueFormat="YYYY-MM-DD"
  49. >
  50. <a-icon slot="suffixIcon" type="calendar" />
  51. </a-range-picker>
  52. <a-radio-group
  53. default-value="0"
  54. button-style="solid"
  55. v-model="formState.days"
  56. >
  57. <a-radio-button
  58. value="1"
  59. @click="
  60. (formState.time = []),
  61. (formState.beginDate = ''),
  62. (formState.endDate = '')
  63. "
  64. >
  65. 当天
  66. </a-radio-button>
  67. <a-radio-button
  68. value="7"
  69. @click="
  70. (formState.time = []),
  71. (formState.beginDate = ''),
  72. (formState.endDate = '')
  73. "
  74. >
  75. 近7天
  76. </a-radio-button>
  77. <a-radio-button
  78. value="30"
  79. @click="
  80. (formState.time = []),
  81. (formState.beginDate = ''),
  82. (formState.endDate = '')
  83. "
  84. >
  85. 近30天
  86. </a-radio-button>
  87. </a-radio-group>
  88. </div>
  89. </div>
  90. <a-row class="insurer-list">
  91. <a-button shape="circle" icon="left" class="left btn" @click="prev">
  92. </a-button>
  93. <a-col
  94. :span="5"
  95. v-for="item in companyList.slice(
  96. (this.companyPage.page - 1) * this.companyPage.size,
  97. this.companyPage.size * this.companyPage.page
  98. )"
  99. :key="item.insuranceCompanyId"
  100. @click="chooseInsurer(item)"
  101. >
  102. <div
  103. class="insurer"
  104. :class="companyId === item.insuranceCompanyId ? 'on' : 'insurer'"
  105. >
  106. <div>
  107. <img :width="50" :height="50" :src="item.logo" />
  108. </div>
  109. <div>
  110. <p>{{ item.namesimple }}</p>
  111. <!-- <p>保险公司</p> -->
  112. </div>
  113. </div>
  114. </a-col>
  115. <a-button shape="circle" icon="right" class="right btn" @click="next">
  116. </a-button>
  117. </a-row>
  118. </div>
  119. <div class="btn-opreation">
  120. <a-button type="primary" @click="exportList">导出</a-button>
  121. </div>
  122. <standard-table
  123. bordered
  124. :columns="columns"
  125. :dataSource="tableList"
  126. :pagination="pagination"
  127. @clear="onClear"
  128. @change="onChange"
  129. :loading="loading"
  130. >
  131. <div slot="qutationCount" slot-scope="{ text }">
  132. {{ text + "条" }}
  133. </div>
  134. <div slot="quotationRate" slot-scope="{ text }">
  135. {{ (text * 100).toFixed(2) + "%" }}
  136. </div>
  137. </standard-table>
  138. </div>
  139. </template>
  140. <script>
  141. import StandardTable from "@/components/table/StandardTable";
  142. import mixin from "../../minins/mixin";
  143. const columns = [
  144. {
  145. title: "保险公司",
  146. dataIndex: "insuranceCompanyName",
  147. // scopedSlots: { customRender: "qutationCount" },
  148. },
  149. {
  150. title: "合作公司",
  151. dataIndex: "partnerCompaniesName",
  152. // scopedSlots: { customRender: "qutationCount" },
  153. },
  154. {
  155. title: "报价中",
  156. dataIndex: "qutationCount",
  157. scopedSlots: { customRender: "qutationCount" },
  158. },
  159. {
  160. title: "待审核",
  161. dataIndex: "auditOrder",
  162. scopedSlots: { customRender: "qutationCount" },
  163. },
  164. {
  165. title: "已核保待缴费",
  166. dataIndex: "underwritingCount",
  167. scopedSlots: { customRender: "qutationCount" },
  168. // sorter: true,
  169. needTotal: true,
  170. },
  171. {
  172. title: "已承保",
  173. dataIndex: "qutationInsureCount",
  174. needTotal: true,
  175. scopedSlots: { customRender: "qutationCount" },
  176. },
  177. {
  178. title: "核保退回",
  179. dataIndex: "underwritingReturn",
  180. scopedSlots: { customRender: "qutationCount" },
  181. },
  182. // {
  183. // title: "报价率",
  184. // dataIndex: "quotationRate",
  185. // scopedSlots: { customRender: "quotationRate" },
  186. // },
  187. // {
  188. // title: "承保率",
  189. // dataIndex: "contributionRate",
  190. // scopedSlots: { customRender: "quotationRate" },
  191. // },
  192. // {
  193. // title: "核保通过率",
  194. // dataIndex: "passingRate",
  195. // scopedSlots: { customRender: "quotationRate" },
  196. // },
  197. ];
  198. import moment from "moment";
  199. export default {
  200. components: {
  201. StandardTable,
  202. },
  203. mixins: [mixin],
  204. data() {
  205. return {
  206. formState: {
  207. cityId: undefined,
  208. provinceId: undefined,
  209. days: undefined,
  210. time: [moment().format("YYYY-MM-DD"), moment().format("YYYY-MM-DD")],
  211. endDate: moment().format("YYYY-MM-DD"),
  212. beginDate: moment().format("YYYY-MM-DD"),
  213. },
  214. backLinePersonnel: {},
  215. columns: columns,
  216. companyList: [],
  217. tableList: [],
  218. pagination: {
  219. current: 1,
  220. defaultPageSize: 10,
  221. total: 0,
  222. pagesize0ptions: ["10", "20", "30", "50", "100"],
  223. hideOnSinglePage: false,
  224. showQuickJumper: true, //
  225. showSizeChanger: true, //是否可以改变pagesize
  226. showTotal: (total) => `共 ${total} 条数据`,
  227. },
  228. loading: false,
  229. wholeList: [],
  230. provinceList: [],
  231. cityList: [],
  232. areaList: [],
  233. storeList: [],
  234. companyPage: {
  235. page: 1,
  236. size: 15,
  237. total: 0,
  238. perPage: 0,
  239. },
  240. companyId: "",
  241. process: process.env.VUE_APP_API_BASE_URL,
  242. city: [],
  243. };
  244. },
  245. watch: {
  246. "formState.days"() {
  247. this.getBackLinePersonnel();
  248. },
  249. "formState.provinceId"(val) {
  250. console.log(val);
  251. if (val != undefined) {
  252. this.cityList = [...this.city];
  253. } else {
  254. this.formState.cityId = undefined;
  255. this.cityList = [];
  256. }
  257. },
  258. },
  259. mounted() {
  260. this.getBackLinePersonnel();
  261. this.getAreaList();
  262. // setTimeout(() => {
  263. // }, 1000);
  264. this.getCompanyList();
  265. },
  266. methods: {
  267. getList() {
  268. this.pagination.current = 1;
  269. this.getBackLinePersonnel();
  270. },
  271. getAreaList() {
  272. this.$API.personnel.getAreaList().then((res) => {
  273. // console.log(res);
  274. if (res.data.code === 200) {
  275. let arr = [];
  276. res.data.data.map((item) => {
  277. if (item.areaCname === "山西省") {
  278. arr.push(item);
  279. }
  280. });
  281. this.areaList = [...arr];
  282. // this.cityList = [...arr[0].child];
  283. this.city = [...arr[0].child];
  284. }
  285. });
  286. },
  287. exportList() {
  288. delete this.formState.time;
  289. this.$API.task
  290. .exportInsurancelList({
  291. ...this.formState,
  292. })
  293. .then((res) => {
  294. console.log(res);
  295. if (res.data.code == 200) {
  296. let url = this.process + res.data.data; // 3.创建一个临时的url指向blob对象
  297. let a = document.createElement("a");
  298. a.href = url;
  299. a.download = "导出文件.xlsx";
  300. a.click();
  301. window.URL.revokeObjectURL(url);
  302. } else {
  303. this.$message.error(res.msg);
  304. }
  305. });
  306. },
  307. prev() {
  308. if (this.companyPage.page != 1) this.companyPage.page -= 1;
  309. },
  310. next() {
  311. this.companyPage.page += 1;
  312. // this.getCompanyList();
  313. if (this.companyPage.page >= this.companyPage.perPage) {
  314. this.companyPage.page = this.companyPage.perPage;
  315. }
  316. // console.log(this.companyPage.page);
  317. },
  318. chooseInsurer(item) {
  319. this.companyId = item.insuranceCompanyId;
  320. // // console.log(item,this.companyId)
  321. this.getBackLinePersonnel();
  322. },
  323. onChangeTime(val) {
  324. // console.log(val);
  325. this.formState.beginDate = val[0];
  326. this.formState.endDate = val[1];
  327. this.pagination.current = 1;
  328. this.formState.days = undefined;
  329. this.getBackLinePersonnel();
  330. },
  331. getCompanyList() {
  332. this.$API.agreement
  333. .getCompanyList({
  334. areaId: "",
  335. deptId: "",
  336. partnerCompaniesId: "",
  337. warningDay: "",
  338. warningStatus: "",
  339. })
  340. .then((res) => {
  341. if (res.data.code === 200) {
  342. this.companyList = res.data.data;
  343. this.companyPage.perPage = Math.ceil(
  344. res.data.data.length / this.companyPage.size
  345. );
  346. // console.log(this.companyPage);
  347. this.companyPage.total = res.data.data.length;
  348. }
  349. });
  350. },
  351. handleFinish() {
  352. //
  353. },
  354. getBackLinePersonnel() {
  355. this.loading = true;
  356. this.$API.task
  357. .getCompanyList({
  358. pageNum: this.pagination.current,
  359. pageSize: this.pagination.defaultPageSize,
  360. ...this.formState,
  361. companyId: this.companyId,
  362. })
  363. .then((res) => {
  364. if (res.data.code === 200) {
  365. this.loading = false;
  366. this.tableList = res.data.data.records;
  367. this.pagination = {
  368. current: res.data.data.current,
  369. defaultPageSize: res.data.data.size,
  370. total: res.data.data.total,
  371. };
  372. } else {
  373. this.loading = false;
  374. this.tableList = [];
  375. this.$message.error(res.data.msg);
  376. }
  377. });
  378. },
  379. onClear() {
  380. this.$message.info("您清空了勾选的所有行");
  381. },
  382. onChange(pagination, filters, sorter, { currentDataSource }) {
  383. // this.$message.info('表格状态改变了')
  384. console.log(pagination, filters, sorter, { currentDataSource });
  385. this.pagination = {
  386. current: pagination.current,
  387. defaultPageSize: pagination.pageSize,
  388. total: pagination.total,
  389. };
  390. this.getBackLinePersonnel();
  391. },
  392. },
  393. };
  394. </script>
  395. <style lang='less' scoped>
  396. .back-line-main {
  397. display: flex;
  398. flex-direction: column;
  399. .back-line-header {
  400. padding: 15px;
  401. box-sizing: border-box;
  402. position: relative;
  403. // padding: 0px 35px;
  404. box-sizing: border-box;
  405. .insurer-list {
  406. // display:flex;
  407. // flex-wrap: wrap;
  408. width: 100%;
  409. // justify-content: stretch;
  410. position: relative;
  411. padding: 0px 35px;
  412. box-sizing: border-box;
  413. .btn {
  414. position: absolute;
  415. top: 50%;
  416. transform: translate(-50%, -50%);
  417. z-index: 999;
  418. }
  419. .btn.left {
  420. left: 20px;
  421. }
  422. .btn.right {
  423. right: -10px;
  424. }
  425. .ant-col {
  426. height: 90px;
  427. flex: none;
  428. // width: 18%;
  429. padding: 5px 10px;
  430. margin-bottom: 15px;
  431. box-sizing: border-box;
  432. width: 20%;
  433. }
  434. .insurer {
  435. width: 100%;
  436. height: 100%;
  437. background: #fff;
  438. border-radius: 3px;
  439. display: flex;
  440. align-items: center;
  441. // justify-content: space-between;
  442. padding: 0 15px;
  443. box-shadow: 0px 2px 8px 0px rgba(42, 85, 229, 0.15);
  444. border-radius: 8px 8px 8px 8px;
  445. border: 2px solid rgba(255, 255, 255, 0.2);
  446. > a-image {
  447. display: block;
  448. }
  449. p {
  450. margin: 0;
  451. }
  452. > div:first-child {
  453. background: #000;
  454. width: 50px;
  455. height: 50px;
  456. }
  457. > div:last-child {
  458. padding-left: 30px;
  459. box-sizing: border-box;
  460. font-size: 16px;
  461. font-style: "PingFang SC-Medium";
  462. color: #181818;
  463. }
  464. }
  465. .on {
  466. background: rgb(234, 238, 253);
  467. }
  468. }
  469. .back-line-header-title {
  470. display: flex;
  471. align-items: center;
  472. justify-content: space-between;
  473. padding-bottom: 15px;
  474. border-bottom: 1px solid #f0f0f0;
  475. box-sizing: border-box;
  476. h2 {
  477. margin: 0;
  478. }
  479. > div.area-city {
  480. flex: 1;
  481. display: flex;
  482. justify-content: center;
  483. align-items: center;
  484. > div {
  485. // flex: 1;
  486. display: flex;
  487. align-items: center;
  488. > span {
  489. margin-left: 10px;
  490. }
  491. }
  492. }
  493. > div:last-child {
  494. flex: none;
  495. display: flex;
  496. align-items: center;
  497. justify-content: flex-end;
  498. }
  499. span {
  500. display: block;
  501. margin-right: 15px;
  502. }
  503. /deep/.ant-calendar-picker {
  504. width: 300px;
  505. }
  506. }
  507. }
  508. > div {
  509. // height: 152px;
  510. background: #fff;
  511. .ant-form {
  512. display: flex;
  513. > .ant-form-item {
  514. flex: 1;
  515. /deep/.ant-form-item-control-wrapper {
  516. width: 100%;
  517. }
  518. }
  519. }
  520. .form-item-search {
  521. // display: flex;
  522. // justify-content: flex-end;
  523. /deep/ .ant-form-item-control {
  524. display: flex;
  525. justify-content: flex-end;
  526. }
  527. }
  528. }
  529. }
  530. .btn-opreation {
  531. display: flex;
  532. justify-content: flex-end;
  533. padding: 0 15px;
  534. box-sizing: border-box;
  535. }
  536. </style>