insurancePolicy-list.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342
  1. <template>
  2. <div>
  3. <el-breadcrumb separator=">">
  4. <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
  5. <el-breadcrumb-item>
  6. <a href="#">人才超市审批</a>
  7. </el-breadcrumb-item>
  8. <el-breadcrumb-item>
  9. <a href="/businessInsuranceApplication">下月投保审批</a>
  10. </el-breadcrumb-item>
  11. </el-breadcrumb>
  12. <el-divider></el-divider>
  13. <!--
  14. 要resetFields起作用,必须配置:model和prop
  15. -->
  16. <el-form ref="queryForm" :model="queryModel" inline class="demo-form-inline">
  17. <el-form-item label="险种信息" prop="definitionId">
  18. <el-select
  19. v-model="queryModel.definitionId"
  20. filterable
  21. placeholder="请选择"
  22. style="width:300px"
  23. >
  24. <el-option
  25. v-for="result in queryResult"
  26. :key="result.id"
  27. :label="result.name"
  28. :value="result.id"
  29. ></el-option>
  30. </el-select>
  31. </el-form-item>
  32. <el-form-item label="投保人姓名" prop="insuredName">
  33. <el-input type="text" size="mini" v-model="queryModel.insuredName"></el-input>
  34. </el-form-item>
  35. <!-- <el-form-item label="投保期间" prop="companyId">
  36. <el-input type="text" size="mini" v-model="queryModel.companyId"></el-input>
  37. </el-form-item>-->
  38. <el-form-item>
  39. <el-button
  40. type="primary"
  41. size="mini"
  42. icon="ios-search"
  43. @click="changePage(1)"
  44. :loading="loading"
  45. >查询</el-button>&nbsp;
  46. <el-button
  47. type="info"
  48. size="mini"
  49. style="margin-left: 8px"
  50. @click="handleReset('queryForm')"
  51. >重置</el-button>&nbsp;
  52. </el-form-item>
  53. </el-form>
  54. <el-divider></el-divider>
  55. <el-tabs type="card" activeName @tab-click="handleClick">
  56. <el-tab-pane label="全部" name></el-tab-pane>
  57. <el-tab-pane label="待初审" name="20"></el-tab-pane>
  58. <el-tab-pane label="待复审" name="30"></el-tab-pane>
  59. <el-tab-pane label="待缴费" name="40"></el-tab-pane>
  60. <el-tab-pane label="待制单" name="50"></el-tab-pane>
  61. <el-tab-pane label="待出单" name="60"></el-tab-pane>
  62. <el-tab-pane label="已出单" name="70"></el-tab-pane>
  63. <el-tab-pane label="已过期" name="80"></el-tab-pane>
  64. <el-table
  65. :data="tableData"
  66. style="min-height:400px;"
  67. v-loading="loading"
  68. stripe
  69. @sort-change="sortChange"
  70. @selection-change="handleSelectionChange"
  71. >
  72. <el-table-column type="selection" width="55"></el-table-column>
  73. <el-table-column prop="application.definitionName" label="保险种类" width="180"></el-table-column>
  74. <!-- <el-table-column prop="application.insuredName" label="投保人姓名" width="180"></el-table-column>
  75. <el-table-column prop="application.insuredTel" label="联系电话" width="180"></el-table-column>-->
  76. <el-table-column label="投保期间" width="280">
  77. <template slot-scope="{row}">{{row.policy.startTime}}-{{row.policy.endTime}}</template>
  78. </el-table-column>
  79. <el-table-column prop="insuranceFee" label="保险费合计" width="100">
  80. <template slot-scope="scope">
  81. <span class="insure-money">¥{{scope.row.policy.insuranceFee}}</span>
  82. </template>
  83. </el-table-column>
  84. <el-table-column prop="policy.statusN" label="投保单状态" width="180"></el-table-column>
  85. <el-table-column label="操作" width="320">
  86. <template slot-scope="{row}">
  87. <el-button size="mini" @click="openPolicyDetails(row)">查看详情</el-button>&#12288;&#12288;
  88. <span v-if="row.policy.status=='20'">
  89. <el-button size="mini" type="primary" @click="openFirstApproval(row)">处理</el-button>
  90. </span>
  91. <span v-if="row.policy.status=='50'">
  92. <el-button size="mini" type="primary" @click="openTransfer(row)">处理</el-button>
  93. </span>
  94. <!-- <el-button size="mini" @click="handleDelete(row)">退回理由</el-button>
  95. <el-button size="mini" @click="handleDelete(row)">投保历史信息</el-button>-->
  96. </template>
  97. </el-table-column>
  98. </el-table>
  99. </el-tabs>
  100. <el-pagination
  101. :current-page.sync="pageIndex"
  102. :total="totalElements"
  103. :page-sizes="pageSizeList"
  104. @current-change="changePage"
  105. @size-change="pageSizeChange"
  106. layout="total, sizes, prev, pager, next, jumper"
  107. ></el-pagination>
  108. <insuranceJobs-detail
  109. v-if="showModal"
  110. :id="id"
  111. :policyId="policyId"
  112. @close="onDetailModalClose"
  113. ></insuranceJobs-detail>
  114. </div>
  115. </template>
  116. <script>
  117. import Constant from "@/constant";
  118. import insuranceJobsDetail from "./insurancePolicy-firstDetails";
  119. import approvalApi from "@/api/business/approval";
  120. import insuranceDefinitionApi from "@/api/base/insuranceDefinition";
  121. import NProgress from "nprogress"; // progress bar
  122. import "nprogress/nprogress.css"; // progress bar style
  123. export default {
  124. components: {
  125. "insuranceJobs-detail": insuranceJobsDetail
  126. },
  127. data() {
  128. var self = this;
  129. return {
  130. queryModel: {
  131. companyId: "",
  132. definitionId: "",
  133. insuredName: "",
  134. insuredTel: "",
  135. startTime: "",
  136. endTime: "",
  137. number: "",
  138. insuranceFee: "",
  139. status: "",
  140. userType: "",
  141. applicationId: ""
  142. },
  143. loading: false,
  144. tableData: [],
  145. pageIndex: 1,
  146. pageSize: 10,
  147. totalPages: 0,
  148. totalElements: 0,
  149. field: "",
  150. direction: "",
  151. pageSizeList: [10, 20, 30],
  152. multipleSelection: [],
  153. showModal: false,
  154. modalTitle: "",
  155. id: "",
  156. policyId: "",
  157. tabStatus: "",
  158. queryResult: []
  159. };
  160. },
  161. methods: {
  162. changePage(pageIndex) {
  163. var self = this;
  164. self.loading = true;
  165. self.pageIndex = pageIndex;
  166. var formData = new FormData();
  167. formData.append("pageIndex", self.pageIndex);
  168. formData.append("pageSize", self.pageSize);
  169. formData.append("applicationId", self.queryModel.applicationId);
  170. formData.append("companyId", self.queryModel.companyId);
  171. formData.append("definitionId", self.queryModel.definitionId);
  172. formData.append("insuredName", self.queryModel.insuredName);
  173. formData.append("insuredTel", self.queryModel.insuredTel);
  174. formData.append("startTime", self.queryModel.startTime);
  175. formData.append("endTime", self.queryModel.endTime);
  176. formData.append("insuranceFee", self.queryModel.insuranceFee);
  177. formData.append("status", this.tabStatus);
  178. formData.append("userType", "0");
  179. if (this.field != null) {
  180. formData.append("field", this.field);
  181. }
  182. if (this.direction != null) {
  183. formData.append("direction", this.direction);
  184. }
  185. approvalApi
  186. .otherPageList(formData)
  187. .then(function(response) {
  188. self.loading = false;
  189. var jsonData = response.data.data;
  190. self.tableData = jsonData.data;
  191. self.totalPages = jsonData.totalPages;
  192. self.totalElements = jsonData.recordsTotal;
  193. })
  194. .catch(error => {
  195. self.loading = false;
  196. // self.$message.error(error + "");
  197. });
  198. },
  199. pageSizeChange(pageSize) {
  200. this.pageSize = pageSize;
  201. },
  202. sortChange(data) {
  203. this.field = data.column.field;
  204. this.direction = data.order;
  205. this.changePage(this.pageIndex);
  206. },
  207. handleSelectionChange(val) {
  208. this.multipleSelection = val;
  209. },
  210. handleReset(name) {
  211. this.$refs[name].resetFields();
  212. },
  213. openPolicyDetails(record) {
  214. this.id = record.application.id;
  215. this.policyId = record.policy.id;
  216. this.showModal = true;
  217. },
  218. openFirstApproval(record) {
  219. this.$router.push({
  220. path: "/business/insurancePolicy/firstApproval",
  221. query: { id: record.application.id, policyId: record.policy.id }
  222. });
  223. },
  224. openTransfer(record) {
  225. this.$router.push({
  226. path: "/business/insurancePolicy/transfer",
  227. query: { id: record.application.id, policyId: record.policy.id }
  228. });
  229. },
  230. handleDelete(record) {
  231. var self = this;
  232. self
  233. .$confirm("是否确认删除?", "提示", {
  234. confirmButtonText: "确定",
  235. cancelButtonText: "取消",
  236. type: "warning"
  237. })
  238. .then(() => {
  239. approvalApi.remove(record.id).then(function(response) {
  240. var jsonData = response.data;
  241. if (jsonData.result) {
  242. // var index = self.tableData.indexOf(record);
  243. // self.tableData.splice(index, 1);
  244. self.changePage(self.pageIndex);
  245. self.$message({
  246. type: "success",
  247. message: "删除成功!"
  248. });
  249. }
  250. });
  251. });
  252. },
  253. handleBatchDelete() {
  254. var self = this;
  255. var idList = this.multipleSelection.map(record => {
  256. return record.id;
  257. });
  258. this.$confirm("是否确认删除选中项?", "提示", {
  259. confirmButtonText: "确定",
  260. cancelButtonText: "取消",
  261. type: "warning"
  262. }).then(() => {
  263. approvalApi.batchRemove(idList).then(function(response) {
  264. var jsonData = response.data;
  265. if (jsonData.result) {
  266. self.changePage(self.pageIndex);
  267. self.$message({
  268. type: "success",
  269. message: "删除成功!"
  270. });
  271. }
  272. });
  273. });
  274. },
  275. onDetailModalClose(refreshed) {
  276. //保存成功后回调
  277. this.showModal = false;
  278. if (refreshed) {
  279. this.changePage(this.pageIndex);
  280. }
  281. },
  282. handleClick(tab, event) {
  283. this.tabStatus = tab.name;
  284. this.changePage(1);
  285. if (this.tabStatus == "20") {
  286. //待初审20
  287. } else if (this.tabStatus == "50") {
  288. //带制单50
  289. }
  290. }
  291. },
  292. mounted: function() {
  293. this.changePage(1);
  294. insuranceDefinitionApi.list().then(response => {
  295. var jsonData = response.data;
  296. this.queryResult = jsonData.data;
  297. });
  298. }
  299. };
  300. </script>
  301. <style lang="scss" scoped>
  302. .el-breadcrumb {
  303. margin: 10px;
  304. line-height: 20px;
  305. }
  306. .el-divider {
  307. margin: 5px 0;
  308. }
  309. .demo-form-inline {
  310. margin-left: 10px;
  311. text-align: left;
  312. }
  313. .button-group {
  314. margin-left: 10px;
  315. text-align: left;
  316. }
  317. </style>