agent.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658
  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>
  7. <span>时间筛选</span>
  8. <a-range-picker
  9. @change="onChangeTime"
  10. v-model="formState.time"
  11. valueFormat="YYYY-MM-DD"
  12. >
  13. <a-icon slot="suffixIcon" type="calendar" />
  14. </a-range-picker>
  15. <a-radio-group
  16. default-value="0"
  17. button-style="solid"
  18. v-model="formState.days"
  19. >
  20. <a-radio-button
  21. value="1"
  22. @click="
  23. (formState.time = []),
  24. (formState.beginDate = ''),
  25. (formState.endDate = '')
  26. "
  27. >
  28. 当天
  29. </a-radio-button>
  30. <a-radio-button
  31. value="7"
  32. @click="
  33. (formState.time = []),
  34. (formState.beginDate = ''),
  35. (formState.endDate = '')
  36. "
  37. >
  38. 近7天
  39. </a-radio-button>
  40. <a-radio-button
  41. value="30"
  42. @click="
  43. (formState.time = []),
  44. (formState.beginDate = ''),
  45. (formState.endDate = '')
  46. "
  47. >
  48. 近30天
  49. </a-radio-button>
  50. </a-radio-group>
  51. </div>
  52. </div>
  53. <fromRow
  54. :formState="formState"
  55. @getList="getBackLinePersonnel"
  56. :exportExcel="true"
  57. @exportList="exportList"
  58. ></fromRow>
  59. </div>
  60. <standard-table
  61. bordered
  62. :columns="columns"
  63. :dataSource="tableList"
  64. :pagination="pagination"
  65. @clear="onClear"
  66. @change="onChange"
  67. :loading="loading"
  68. :scroll="{ x: 2200 }"
  69. >
  70. <div slot="qutationCount" slot-scope="{ text }">
  71. {{ text + "条" }}
  72. </div>
  73. <div slot="quotationRate" slot-scope="{ text }">
  74. {{ (text * 100).toFixed(2) + "%" }}
  75. </div>
  76. <span slot="title_slot">
  77. 报价率
  78. <a-tooltip
  79. placement="topLeft"
  80. title="报价中 / 报价数"
  81. arrow-point-at-center
  82. >
  83. <a-icon type="question-circle" />
  84. </a-tooltip>
  85. </span>
  86. <span slot="title_slot2">
  87. 承保率
  88. <a-tooltip
  89. placement="topLeft"
  90. title="承保数 / 报价数"
  91. arrow-point-at-center
  92. >
  93. <a-icon type="question-circle" />
  94. </a-tooltip>
  95. </span>
  96. <span slot="title_slot3">
  97. 核保通过率
  98. <a-tooltip
  99. placement="topLeft"
  100. title="(承保数+ 核保数) / 报价数"
  101. arrow-point-at-center
  102. >
  103. <a-icon type="question-circle" />
  104. </a-tooltip>
  105. </span>
  106. <div slot="operation" slot-scope="{ record }">
  107. <a-button type="link" @click="watchMessage(record)">详情</a-button>
  108. </div>
  109. </standard-table>
  110. <a-drawer
  111. :width="1300"
  112. :placement="'right'"
  113. :visible="visible"
  114. :headerStyle="headerStyle"
  115. :closable="false"
  116. >
  117. <template slot="title">
  118. <div class="custom-title" :style="headerStyle">
  119. <div>
  120. <a-icon type="close" @click="onClose" />
  121. 渠道详情
  122. </div>
  123. <div>
  124. <a-button style="margin-right: 8px" @click="onClose">取消</a-button>
  125. <a-button type="primary" @click="onClose">确认</a-button>
  126. </div>
  127. </div>
  128. <div>
  129. <dl>
  130. <dt>
  131. <img
  132. v-show="detailsObj.logo"
  133. :src="process + detailsObj.logo"
  134. alt=""
  135. />
  136. <img
  137. v-if="!detailsObj.logo && detailsObj.sex == 'M'"
  138. src="../../assets/img/man.png"
  139. alt=""
  140. />
  141. <img
  142. v-if="!detailsObj.logo && detailsObj.sex == 'F'"
  143. src="../../assets/img/woman.png"
  144. alt=""
  145. />
  146. <img
  147. v-if="!detailsObj.logo && !detailsObj.sex"
  148. src="../../assets/img/man.png"
  149. alt=""
  150. />
  151. </dt>
  152. <dd>
  153. <p>
  154. <span> {{ detailsObj.userName }} </span>({{
  155. detailsObj.userId
  156. }})
  157. </p>
  158. <p>归属机构:{{ detailsObj.deptName }}</p>
  159. </dd>
  160. </dl>
  161. </div>
  162. <standard-table
  163. bordered
  164. :columns="columns1"
  165. :dataSource="detailList"
  166. :pagination="pageInfo"
  167. @change="detailsChange"
  168. :loading="loading"
  169. :scroll="{ x: 2200 }"
  170. >
  171. <div slot="qutationCount" slot-scope="{ text }">
  172. {{ text + "条" }}
  173. </div>
  174. <div slot="quotationRate" slot-scope="{ text }">
  175. {{ (text * 100).toFixed(2) + "%" }}
  176. </div>
  177. <span slot="title_slot">
  178. 报价率
  179. <a-tooltip
  180. placement="topLeft"
  181. title="报价中 / 报价数"
  182. arrow-point-at-center
  183. >
  184. <a-icon type="question-circle" />
  185. </a-tooltip>
  186. </span>
  187. <span slot="title_slot2">
  188. 承保率
  189. <a-tooltip
  190. placement="topLeft"
  191. title="承保数 / 报价数"
  192. arrow-point-at-center
  193. >
  194. <a-icon type="question-circle" />
  195. </a-tooltip>
  196. </span>
  197. <span slot="title_slot3">
  198. 核保通过率
  199. <a-tooltip
  200. placement="topLeft"
  201. title="(承保数+ 核保数) / 报价数"
  202. arrow-point-at-center
  203. >
  204. <a-icon type="question-circle" />
  205. </a-tooltip>
  206. </span>
  207. </standard-table>
  208. </template>
  209. </a-drawer>
  210. </div>
  211. </template>
  212. <script>
  213. import StandardTable from "@/components/table/StandardTable";
  214. import mixin from "../../minins/mixin";
  215. const columns = [
  216. {
  217. title: "二级机构",
  218. dataIndex: "provinceName",
  219. },
  220. {
  221. title: "三级机构",
  222. dataIndex: "cityName",
  223. },
  224. {
  225. title: "四级机构",
  226. dataIndex: "districtName",
  227. },
  228. {
  229. title: "五级机构",
  230. dataIndex: "storeDeptName",
  231. },
  232. {
  233. title: "归属机构",
  234. dataIndex: "deptName",
  235. // scopedSlots: { customRender: "qutationCount" },
  236. },
  237. {
  238. title: "管理人",
  239. dataIndex: "leaderName",
  240. },
  241. {
  242. title: "业务员姓名",
  243. dataIndex: "userName",
  244. // scopedSlots: { customRender: "qutationCount" },
  245. },
  246. {
  247. title: "业务员工号",
  248. dataIndex: "userId",
  249. // scopedSlots: { customRender: "qutationCount" },
  250. },
  251. {
  252. title: "报价中",
  253. dataIndex: "qutationCount",
  254. scopedSlots: { customRender: "qutationCount" },
  255. },
  256. {
  257. title: "待审核",
  258. dataIndex: "auditOrder",
  259. scopedSlots: { customRender: "qutationCount" },
  260. },
  261. {
  262. title: "已核保待缴费",
  263. dataIndex: "underwritingCount",
  264. scopedSlots: { customRender: "qutationCount" },
  265. // sorter: true,
  266. needTotal: true,
  267. },
  268. {
  269. title: "已承保",
  270. dataIndex: "qutationInsureCount",
  271. needTotal: true,
  272. scopedSlots: { customRender: "qutationCount" },
  273. },
  274. {
  275. title: "核保退回",
  276. dataIndex: "underwritingReturn",
  277. scopedSlots: { customRender: "qutationCount" },
  278. },
  279. {
  280. // title: "报价率",
  281. dataIndex: "quotationRate",
  282. scopedSlots: { title: "title_slot", customRender: "quotationRate" },
  283. },
  284. {
  285. // title: "承保率",
  286. dataIndex: "closeRate",
  287. scopedSlots: { title: "title_slot2", customRender: "quotationRate" },
  288. },
  289. {
  290. // title: "核保通过率",
  291. dataIndex: "contributionRate",
  292. scopedSlots: { title: "title_slot3", customRender: "quotationRate" },
  293. },
  294. {
  295. title: "操作",
  296. dataIndex: "operation",
  297. fixed: "right",
  298. width: 100,
  299. scopedSlots: { customRender: "operation" },
  300. },
  301. ];
  302. const columns1 = [
  303. {
  304. title: "保险公司",
  305. dataIndex: "inscompany",
  306. },
  307. {
  308. title: "报价中(PC)",
  309. dataIndex: "pcOrderSource",
  310. scopedSlots: { customRender: "qutationCount" },
  311. },
  312. {
  313. title: "报价中(APP)",
  314. dataIndex: "appOrderSource",
  315. scopedSlots: { customRender: "qutationCount" },
  316. },
  317. {
  318. title: "待审核",
  319. dataIndex: "auditOrder",
  320. scopedSlots: { customRender: "qutationCount" },
  321. },
  322. {
  323. title: "已核保待缴费",
  324. dataIndex: "underwritingCount",
  325. scopedSlots: { customRender: "qutationCount" },
  326. // sorter: true,
  327. needTotal: true,
  328. },
  329. {
  330. title: "已承保",
  331. dataIndex: "qutationInsureCount",
  332. needTotal: true,
  333. scopedSlots: { customRender: "qutationCount" },
  334. },
  335. {
  336. title: "核保退回",
  337. dataIndex: "underwritingReturn",
  338. scopedSlots: { customRender: "qutationCount" },
  339. },
  340. {
  341. // title: "报价率",
  342. dataIndex: "quotationRate",
  343. scopedSlots: { title: "title_slot", customRender: "quotationRate" },
  344. },
  345. {
  346. // title: "承保率",
  347. dataIndex: "closeRate",
  348. scopedSlots: { title: "title_slot2", customRender: "quotationRate" },
  349. },
  350. {
  351. dataIndex: "contributionRate",
  352. scopedSlots: { title: "title_slot3", customRender: "quotationRate" },
  353. },
  354. ];
  355. import fromRow from "@/components/form/FormRow";
  356. import moment from "moment";
  357. export default {
  358. components: {
  359. StandardTable,
  360. fromRow,
  361. },
  362. mixins: [mixin],
  363. data() {
  364. return {
  365. formState: {
  366. whole: undefined,
  367. cityId: undefined,
  368. countyId: undefined,
  369. houseId: undefined,
  370. provinceId: undefined,
  371. days: undefined,
  372. time: [moment().format("YYYY-MM-DD"), moment().format("YYYY-MM-DD")],
  373. endDate: moment().format("YYYY-MM-DD"),
  374. beginDate: moment().format("YYYY-MM-DD"),
  375. },
  376. backLinePersonnel: {},
  377. columns: columns,
  378. columns1: columns1,
  379. companyList: [],
  380. tableList: [],
  381. pagination: {
  382. current: 1,
  383. defaultPageSize: 10,
  384. total: 0,
  385. pagesize0ptions: ["10", "20", "30", "50", "100"],
  386. hideOnSinglePage: false,
  387. showQuickJumper: true, //
  388. showSizeChanger: true, //是否可以改变pagesize
  389. showTotal: (total) => `共 ${total} 条数据`,
  390. },
  391. loading: false,
  392. wholeList: [],
  393. provinceList: [],
  394. cityList: [],
  395. areaList: [],
  396. storeList: [],
  397. process: process.env.VUE_APP_API_BASE_URL,
  398. visible: false,
  399. headerStyle: {
  400. display: "flex",
  401. "align-items": "center",
  402. "justify-content": "space-between",
  403. },
  404. pageInfo: {
  405. current: 1,
  406. defaultPageSize: 10,
  407. total: 0,
  408. pagesize0ptions: ["10", "20", "30", "50", "100"],
  409. hideOnSinglePage: false,
  410. showQuickJumper: true, //
  411. showSizeChanger: true, //是否可以改变pagesize
  412. showTotal: (total) => `共 ${total} 条数据`,
  413. },
  414. detailsObj: {},
  415. detailList: [],
  416. };
  417. },
  418. watch: {
  419. "formState.days"() {
  420. this.getBackLinePersonnel();
  421. },
  422. },
  423. mounted() {
  424. this.getBackLinePersonnel();
  425. // setTimeout(() => {
  426. // }, 1000);
  427. },
  428. methods: {
  429. watchMessage(item) {
  430. //
  431. this.detailsObj = { ...item };
  432. this.visible = true;
  433. this.getDetailsList(item);
  434. },
  435. getDetailsList(item) {
  436. this.detailList = [];
  437. this.$API.task
  438. .getChannelAgentDetails({
  439. pageNum: this.pageInfo.current,
  440. pageSize: this.pageInfo.defaultPageSize,
  441. userId: item.userId,
  442. beginDate: this.formState.beginDate,
  443. endDate: this.formState.endDate,
  444. })
  445. .then((res) => {
  446. if (res.data.code === 200) {
  447. this.detailList = res.data.data.records;
  448. this.pageInfo = {
  449. current: res.data.data.current,
  450. defaultPageSize: res.data.data.size,
  451. total: res.data.data.total,
  452. };
  453. }
  454. });
  455. },
  456. onClose() {
  457. //
  458. this.visible = false;
  459. },
  460. exportList() {
  461. delete this.formState.time;
  462. this.$API.task
  463. .exportAgentlList({
  464. ...this.formState,
  465. })
  466. .then((res) => {
  467. if (res.data.code == 200) {
  468. let url = this.process + res.data.data; // 3.创建一个临时的url指向blob对象
  469. let a = document.createElement("a");
  470. a.href = url;
  471. a.download = "导出文件.xlsx";
  472. a.click();
  473. window.URL.revokeObjectURL(url);
  474. } else {
  475. this.$message.error(res.msg);
  476. }
  477. });
  478. },
  479. onChangeTime(val) {
  480. // console.log(val);
  481. this.formState.beginDate = val[0];
  482. this.formState.endDate = val[1];
  483. this.formState.days = undefined;
  484. this.getBackLinePersonnel();
  485. },
  486. handleFinish() {
  487. //
  488. },
  489. // wholeHandleChange() {
  490. // this.getProvinceList(this.formState.whole);
  491. // },
  492. // provinceHandleChange() {
  493. // this.getCityList(this.formState.provinceId);
  494. // },
  495. // cityHandleChange() {
  496. // this.getAreaList(this.formState.cityId);
  497. // },
  498. // countyHandleChange() {
  499. // this.getStoreList(this.formState.countyId);
  500. // },
  501. getBackLinePersonnel() {
  502. this.loading = true;
  503. this.$API.task
  504. .getAgentList({
  505. pageNum: this.pagination.current,
  506. pageSize: this.pagination.defaultPageSize,
  507. ...this.formState,
  508. })
  509. .then((res) => {
  510. if (res.data.code === 200) {
  511. this.loading = false;
  512. this.tableList = res.data.data.records;
  513. this.pagination = {
  514. current: res.data.data.current,
  515. defaultPageSize: res.data.data.size,
  516. total: res.data.data.total,
  517. };
  518. }
  519. });
  520. },
  521. onClear() {
  522. this.$message.info("您清空了勾选的所有行");
  523. },
  524. onChange(pagination) {
  525. // this.$message.info('表格状态改变了')
  526. this.pagination = {
  527. current: pagination.current,
  528. defaultPageSize: pagination.pageSize,
  529. total: pagination.total,
  530. };
  531. this.getBackLinePersonnel();
  532. },
  533. detailsChange(pageInfo) {
  534. this.pageInfo = {
  535. current: pageInfo.current,
  536. defaultPageSize: pageInfo.pageSize,
  537. total: pageInfo.total,
  538. };
  539. this.getDetailsList(this.detailsObj);
  540. },
  541. },
  542. };
  543. </script>
  544. <style lang='less' scoped>
  545. .back-line-main {
  546. display: flex;
  547. flex-direction: column;
  548. .back-line-header {
  549. padding: 15px;
  550. box-sizing: border-box;
  551. .back-line-header-title {
  552. display: flex;
  553. align-items: center;
  554. justify-content: space-between;
  555. padding-bottom: 15px;
  556. border-bottom: 1px solid #f0f0f0;
  557. box-sizing: border-box;
  558. h2 {
  559. margin: 0;
  560. }
  561. > div {
  562. flex: 1;
  563. display: flex;
  564. align-items: center;
  565. justify-content: flex-end;
  566. }
  567. span {
  568. display: block;
  569. margin-right: 15px;
  570. }
  571. /deep/.ant-calendar-picker {
  572. width: 300px;
  573. }
  574. }
  575. }
  576. > div {
  577. // height: 152px;
  578. background: #fff;
  579. .ant-form {
  580. display: flex;
  581. > .ant-form-item {
  582. flex: 1;
  583. /deep/.ant-form-item-control-wrapper {
  584. width: 100%;
  585. }
  586. }
  587. }
  588. .form-item-search {
  589. // display: flex;
  590. // justify-content: flex-end;
  591. /deep/ .ant-form-item-control {
  592. display: flex;
  593. justify-content: flex-end;
  594. }
  595. }
  596. }
  597. }
  598. /deep/.ant-drawer-title {
  599. width: 100%;
  600. }
  601. /deep/.custom-title {
  602. display: flex;
  603. > i {
  604. cursor: pointer;
  605. }
  606. }
  607. dl {
  608. width: 346px;
  609. height: 78px;
  610. background: #ffffff;
  611. border-radius: 4px 4px 4px 4px;
  612. border: 1px solid #f87f2c;
  613. display: flex;
  614. margin-left: 15px;
  615. span {
  616. color: #f87f2c;
  617. }
  618. dt {
  619. width: 64px;
  620. height: 100%;
  621. background: #fff9f7;
  622. display: flex;
  623. align-items: center;
  624. justify-content: center;
  625. border-radius: 4px 0 0 4px;
  626. img {
  627. width: 40px;
  628. height: 40px;
  629. }
  630. }
  631. dd {
  632. padding: 8px 0;
  633. box-sizing: border-box;
  634. margin-left: 10px;
  635. p {
  636. margin: 0;
  637. }
  638. p:first-child {
  639. color: #aaa;
  640. }
  641. display: flex;
  642. flex-direction: column;
  643. // align-items: ;
  644. justify-content: space-between;
  645. }
  646. }
  647. </style>