channel.vue 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  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 :formState="formState" @getList="getList"></fromRow>
  54. </div>
  55. <standard-table
  56. bordered
  57. :columns="columns"
  58. :dataSource="tableList"
  59. :pagination="pagination"
  60. @clear="onClear"
  61. @change="onChange"
  62. :loading="loading"
  63. >
  64. <div slot="qutationCount" slot-scope="{ text }">
  65. {{ text + "条" }}
  66. </div>
  67. <div slot="quotationRate" slot-scope="{ text }">
  68. {{ (text * 100).toFixed(2) + "%" }}
  69. </div>
  70. </standard-table>
  71. </div>
  72. </template>
  73. <script>
  74. import StandardTable from "@/components/table/StandardTable";
  75. import fromRow from "@/components/form/FormRow";
  76. import mixin from "../../minins/mixin";
  77. const columns = [
  78. {
  79. title: "归属机构",
  80. dataIndex: "deptName",
  81. // scopedSlots: { customRender: "qutationCount" },
  82. },
  83. {
  84. title: "业务员姓名",
  85. dataIndex: "userName",
  86. // scopedSlots: { customRender: "qutationCount" },
  87. },
  88. {
  89. title: "业务员工号",
  90. dataIndex: "userId",
  91. // scopedSlots: { customRender: "qutationCount" },
  92. },
  93. {
  94. title: "报价中",
  95. dataIndex: "qutationCount",
  96. scopedSlots: { customRender: "qutationCount" },
  97. },
  98. {
  99. title: "待审核",
  100. dataIndex: "auditOrder",
  101. scopedSlots: { customRender: "qutationCount" },
  102. },
  103. {
  104. title: "已核保待缴费",
  105. dataIndex: "underwritingCount",
  106. scopedSlots: { customRender: "qutationCount" },
  107. // sorter: true,
  108. needTotal: true,
  109. },
  110. {
  111. title: "已承保",
  112. dataIndex: "qutationInsureCount",
  113. needTotal: true,
  114. scopedSlots: { customRender: "qutationCount" },
  115. },
  116. {
  117. title: "核保退回",
  118. dataIndex: "underwritingReturn",
  119. scopedSlots: { customRender: "qutationCount" },
  120. },
  121. {
  122. title: "报价率",
  123. dataIndex: "quotationRate",
  124. scopedSlots: { customRender: "quotationRate" },
  125. },
  126. {
  127. title: "承保率",
  128. dataIndex: "closeRate",
  129. scopedSlots: { customRender: "quotationRate" },
  130. },
  131. {
  132. title: "核保通过率",
  133. dataIndex: "contributionRate",
  134. scopedSlots: { customRender: "quotationRate" },
  135. },
  136. ];
  137. import moment from "moment";
  138. export default {
  139. components: {
  140. StandardTable,
  141. fromRow,
  142. },
  143. mixins: [mixin],
  144. data() {
  145. return {
  146. formState: {
  147. whole: undefined,
  148. cityId: undefined,
  149. countyId: undefined,
  150. houseId: undefined,
  151. provinceId: undefined,
  152. days: undefined,
  153. time: [moment().format("YYYY-MM-DD"), moment().format("YYYY-MM-DD")],
  154. endDate: moment().format("YYYY-MM-DD"),
  155. beginDate: moment().format("YYYY-MM-DD"),
  156. },
  157. backLinePersonnel: {},
  158. columns: columns,
  159. companyList: [],
  160. tableList: [],
  161. pagination: {
  162. current: 1,
  163. defaultPageSize: 10,
  164. total: 0,
  165. pagesize0ptions: ["10", "20", "30", "50", "100"],
  166. hideOnSinglePage: false,
  167. showQuickJumper: true, //
  168. showSizeChanger: true, //是否可以改变pagesize
  169. showTotal: (total) => `共 ${total} 条数据`,
  170. },
  171. loading: false,
  172. wholeList: [],
  173. provinceList: [],
  174. cityList: [],
  175. areaList: [],
  176. storeList: [],
  177. };
  178. },
  179. watch: {
  180. "formState.days"() {
  181. this.getList();
  182. },
  183. },
  184. mounted() {
  185. this.getList();
  186. // setTimeout(() => {
  187. // }, 1000);
  188. },
  189. methods: {
  190. handleFinish() {
  191. //
  192. },
  193. getList(val) {
  194. this.loading = true;
  195. this.$API.task
  196. .getTaskStatistics({
  197. pageNum: this.pagination.current,
  198. pageSize: this.pagination.defaultPageSize,
  199. ...this.formState,
  200. ...val,
  201. })
  202. .then((res) => {
  203. if (res.data.code === 200) {
  204. this.loading = false;
  205. this.tableList = res.data.data.records;
  206. this.pagination = {
  207. current: res.data.data.current,
  208. defaultPageSize: res.data.data.size,
  209. total: res.data.data.total,
  210. };
  211. }
  212. });
  213. },
  214. onClear() {
  215. this.$message.info("您清空了勾选的所有行");
  216. },
  217. onChangeTime(val) {
  218. // console.log(val);
  219. this.formState.beginDate = val[0];
  220. this.formState.endDate = val[1];
  221. this.formState.days = undefined;
  222. this.getList();
  223. },
  224. onChange(pagination, filters, sorter, { currentDataSource }) {
  225. // this.$message.info('表格状态改变了')
  226. console.log(pagination, filters, sorter, { currentDataSource });
  227. this.pagination = {
  228. current: pagination.current,
  229. defaultPageSize: pagination.pageSize,
  230. total: pagination.total,
  231. };
  232. this.getList();
  233. },
  234. },
  235. };
  236. </script>
  237. <style lang='less' scoped>
  238. .back-line-main {
  239. display: flex;
  240. flex-direction: column;
  241. .back-line-header {
  242. padding: 15px;
  243. box-sizing: border-box;
  244. .back-line-header-title {
  245. display: flex;
  246. align-items: center;
  247. justify-content: space-between;
  248. padding-bottom: 15px;
  249. border-bottom: 1px solid #f0f0f0;
  250. box-sizing: border-box;
  251. h2 {
  252. margin: 0;
  253. }
  254. > div {
  255. flex: 1;
  256. display: flex;
  257. align-items: center;
  258. justify-content: flex-end;
  259. }
  260. span {
  261. display: block;
  262. margin-right: 15px;
  263. }
  264. /deep/.ant-calendar-picker {
  265. width: 300px;
  266. }
  267. }
  268. }
  269. > div {
  270. // height: 152px;
  271. background: #fff;
  272. .ant-form {
  273. display: flex;
  274. > .ant-form-item {
  275. flex: 1;
  276. /deep/.ant-form-item-control-wrapper {
  277. width: 100%;
  278. }
  279. }
  280. }
  281. .form-item-search {
  282. // display: flex;
  283. // justify-content: flex-end;
  284. /deep/ .ant-form-item-control {
  285. display: flex;
  286. justify-content: flex-end;
  287. }
  288. }
  289. }
  290. }
  291. </style>