AutoInsuranceDetails.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. <!-- 模板区域 -->
  2. <template>
  3. <div class="p-1">
  4. <!-- 模板内容 -->
  5. <el-form ref="queryFormRef" :model="queryForm" label-width="120px" class="queryform">
  6. <el-row>
  7. <el-col :span="6">
  8. <el-form-item label="任务号">
  9. <el-input size="small" v-model="queryForm.orderNo" placeholder="请输入任务号" clearable></el-input>
  10. </el-form-item>
  11. </el-col>
  12. <el-col :span="6">
  13. <el-form-item label="订单号">
  14. <el-input size="small" v-model="queryForm.subOrderNo" placeholder="请输入订单号" clearable></el-input>
  15. </el-form-item>
  16. </el-col>
  17. <el-col :span="6">
  18. <el-form-item label="保险公司">
  19. <el-select size="small" v-model="queryForm.companyId" placeholder="请选择保险公司" style="width: 100%" filterable clearable>
  20. <el-option :label="item.name" :value="item.id" v-for="(item, index) in ompanyqueryList"
  21. :key="index"></el-option>
  22. </el-select>
  23. </el-form-item>
  24. </el-col>
  25. <el-col :span="6">
  26. <el-form-item label="投保险种">
  27. <el-select size="small" v-model="queryForm.productId" placeholder="请选择投保险种" style="width: 100%" filterable clearable>
  28. <el-option :label="item.dictTag" :value="item.dictValue" v-for="(item, index) in productsTypeoptions"
  29. :key="index"></el-option>
  30. </el-select>
  31. </el-form-item>
  32. </el-col>
  33. <el-col :span="6">
  34. <el-form-item label="车牌号">
  35. <el-input size="small" v-model="queryForm.licenseNo" placeholder="请输入车牌号" clearable></el-input>
  36. </el-form-item>
  37. </el-col>
  38. <el-col :span="6">
  39. <el-form-item label="车架号">
  40. <el-input size="small" v-model="queryForm.frameNo" placeholder="请输入车架号" clearable></el-input>
  41. </el-form-item>
  42. </el-col>
  43. <el-col :span="6">
  44. <el-form-item label="发动机号">
  45. <el-input size="small" v-model="queryForm.engineNo" placeholder="请输入发动机号" clearable></el-input>
  46. </el-form-item>
  47. </el-col>
  48. <el-col :span="6">
  49. <el-form-item label="交强保单号">
  50. <el-input size="small" v-model="queryForm.jqapplyno" placeholder="请输入交强保单号" clearable></el-input>
  51. </el-form-item>
  52. </el-col>
  53. <el-col :span="6">
  54. <el-form-item label="商业保单号">
  55. <el-input size="small" v-model="queryForm.syapplyno" placeholder="请输入交强保单号" clearable></el-input>
  56. </el-form-item>
  57. </el-col>
  58. <el-col :span="6">
  59. <el-form-item label="代理人工号">
  60. <el-input size="small" v-model="queryForm.userDLId" placeholder="请输入录入人" clearable></el-input>
  61. </el-form-item>
  62. </el-col>
  63. <el-col :span="6">
  64. <el-form-item label="代理人姓名">
  65. <el-input size="small" v-model="queryForm.userDLName" placeholder="请输入代理人姓名" clearable></el-input>
  66. </el-form-item>
  67. </el-col>
  68. <el-col :span="6">
  69. <el-form-item label="被保险人">
  70. <el-input size="small" v-model="queryForm.insuredName" placeholder="请输入被保险人姓名" clearable></el-input>
  71. </el-form-item>
  72. </el-col>
  73. <el-col :span="6">
  74. <el-form-item label="签单日期">
  75. <el-date-picker size="small" value-format="yyyy-MM-dd" v-model="dateTime" style="width: 100%" clearable
  76. @change="dataTmeChange" type="daterange" align="left" range-separator="至" start-placeholder="开始日期"
  77. end-placeholder="结束日期">
  78. </el-date-picker>
  79. </el-form-item>
  80. </el-col>
  81. <el-col :span="6">
  82. <el-form-item label="审核状态">
  83. <el-radio-group size="small" v-model="queryForm.auditstatus" style="width: 100%" clearable>
  84. <el-radio label="">全部</el-radio>
  85. <el-radio label="1">已审核</el-radio>
  86. <el-radio label="0">未审核</el-radio>
  87. </el-radio-group>
  88. </el-form-item>
  89. </el-col>
  90. <el-col :span="4" :offset="8" class="flex j-end">
  91. <el-button size="small" type="primary" style="background-color: #2D4D89;border-color:#2D4D89;" @click="exportDetails">导出</el-button>
  92. <el-button size="small" type="primary" @click="autoInsuranceFindPage">查询</el-button>
  93. </el-col>
  94. </el-row>
  95. </el-form>
  96. <kt-common-table :tableHeights="560" :SerialShow="false" :operationWidth="150" :showOperation="true"
  97. :showBatchDelete="false" :showBatchSettled="false" :showBatchPrint="false" :data="autoInsuranceResult"
  98. :columns="autoInsuranceColumns" @findPage="autoInsuranceFindPage" button2Name="详情" button2Type="text"
  99. :button2style="{ color: '#2D4D89' }" button2Background="#E6A23C" @handleButton2="autoInsurancedetails"
  100. button2Icon="">
  101. </kt-common-table>
  102. <detailsDialog ref="detailsDialog" :orderInfo.sync="orderInfo" :Feepermissions="false"></detailsDialog>
  103. </div>
  104. </template>
  105. <!-- 行为区域 -->
  106. <script>
  107. import detailsDialog from "@/views/Core/components/detailsDialog.vue";
  108. import KtCommonTable from "@/views/Core/KtCommonTable.vue"; //表格组件
  109. import Cookies from "js-cookie";
  110. export default {
  111. components: {
  112. KtCommonTable,
  113. detailsDialog
  114. },
  115. // 数据存放区域
  116. data() {
  117. return {
  118. orderInfo: {
  119. //选中的订单
  120. ownerinfo: {},
  121. carinfo: {},
  122. applyinfo: {},
  123. insureinfo: {},
  124. kindinfo: [],
  125. riskinfo: [],
  126. ownerinfo: {},
  127. orderCommissionVo: {},
  128. extendInfo: {}
  129. },
  130. dateTime: [],
  131. queryForm: {
  132. orderNo: "",//任务号
  133. subOrderNo: "",//订单号
  134. companyId: "",//保险公司
  135. productId: "",//投保险种
  136. licenseNo: "",//车牌号
  137. frameNo: "",//车架号
  138. engineNo: "",//发动机号
  139. jqapplyno: "",//保单号
  140. syapplyno: "",//保单号
  141. userDLId: "",//代理人工号
  142. userDLName: "",//代理人姓名
  143. insuredName: "",//被保险人
  144. startDate: "",
  145. endDate: "",
  146. auditstatus: "",//审核状态
  147. userId: '',
  148. },
  149. pageRequest: {
  150. pageNum: 1,
  151. pageSize: 20,
  152. },
  153. ompanyqueryList: [],
  154. productsTypeoptions: [],
  155. autoInsuranceResult: [],
  156. autoInsuranceColumns: [
  157. { prop: "userId", label: "工号", minWidth: 160 },
  158. { prop: "orderNo", label: "任务号", minWidth: 160, },
  159. { prop: "subOrderNo", label: "订单号", minWidth: 160, },
  160. { prop: "companyName", label: "投保公司", minWidth: 160 },
  161. { prop: "userName", label: "姓名", minWidth: 160 },
  162. { prop: "signingTime", label: "签单时间", minWidth: 160 },
  163. { prop: "licenseNo", label: "车牌号", minWidth: 160 },
  164. { prop: "insuredName", label: "被保险人", minWidth: 160 },
  165. { prop: "jqapplyno", label: "交强保单号", minWidth: 160 },
  166. { prop: "syapplyno", label: "商业保单号", minWidth: 160 },
  167. { prop: "amount", label: "交易金额", minWidth: 160, formatter: this.amountFormatter },
  168. { prop: "auditTime", label: "审核时间", minWidth: 160 },
  169. { prop: "auditstatus", label: "审核状态", minWidth: 160 ,formatter: this.validIndFormatter,},
  170. ],
  171. feeView:null,
  172. }
  173. },
  174. // 生命周期函数
  175. created() {
  176. this.queryForm.userId = Cookies.get("user");
  177. this.CompanyList();
  178. this.getDicType("productsType"); //车船税类型
  179. this.$api.user.sysMenuRecordAdd(2,3).then((res) => {
  180. });
  181. },
  182. // 方法函数
  183. methods: {
  184. amountFormatter(row, column){
  185. let amount = row.amount;
  186. if(this.feeView){
  187. return amount;
  188. }else{
  189. return "¥"+amount;
  190. }
  191. },
  192. validIndFormatter(row, column) {
  193. let auditstatus = row.auditstatus;
  194. if (auditstatus == '已审核') {
  195. return <span style="background:linear-gradient( 180deg, #66CDBB 0%, #33A08D 100%); borderRadius: 4px;padding:4px 10px;color:#fff">已审核</span>
  196. } else {
  197. return <span style="background:#A6A6A6; borderRadius: 4px;padding:4px 10px;color:#fff">未审核</span>
  198. }
  199. },
  200. exportDetails() {
  201. this.$api.letter.exportMyInsuranceByUserId(this.queryForm).then((res) => {
  202. if (res.code == '200') {
  203. let url = process.env.BASE_URL + res.msg; // 3.创建一个临时的url指向blob对象
  204. let a = document.createElement("a");
  205. a.href = url;
  206. a.download = "导出文件.xlsx";
  207. a.click();
  208. window.URL.revokeObjectURL(url);
  209. } else {
  210. this.$message({
  211. type: 'error',
  212. message: res.msg,
  213. });
  214. }
  215. });
  216. },
  217. autoInsurancedetails({ row, column }) {
  218. for (let i = 0; i < this.global.insureList.length; i++) {
  219. this.global.insureList[i].coveragePremium = "";
  220. this.global.insureList[i].amount = 0;
  221. }
  222. let params = {
  223. companyId: row.subOrderNo
  224. };
  225. this.$api.letter.getByCompanyId(params).then(res => {
  226. if (res.code == 200) {
  227. this.licenseNo = res.data.licenseno; //车牌号
  228. this.inscompany = res.data.inscompany; //保险公司
  229. if (res.data.accidentInfo) {
  230. res.data.accidentInfo.constructor === Object
  231. ? [res.data.accidentInfo]
  232. : res.data.accidentInfo;
  233. }
  234. Object.assign(this.orderInfo, res.data);
  235. if (this.orderInfo.riskinfo && this.orderInfo.riskinfo.length > 0) {
  236. for (let i = 0; i < this.orderInfo.riskinfo.length; i++) {
  237. if (this.orderInfo.riskinfo[i].riskCode == "0510") {
  238. for (let j = 0; j < this.orderInfo.kindinfo.length; j++) {
  239. for (let m = 0; m < this.global.insureList.length; m++) {
  240. if (
  241. this.orderInfo.kindinfo[j].kindCode ==
  242. this.global.insureList[m].kindCode
  243. ) {
  244. this.global.insureList[
  245. m
  246. ].coveragePremium = this.orderInfo.kindinfo[
  247. j
  248. ].coveragePremium;
  249. if (this.orderInfo.kindinfo[j].kindCode == "B") {
  250. this.global.insureList[9].amtList[0].value = this.orderInfo.kindinfo[
  251. j
  252. ].amount;
  253. }
  254. if (this.orderInfo.kindinfo[j].kindCode == "A") {
  255. this.global.insureList[m].amount = "1";
  256. } else if (this.global.insureList[m].kindCode == "D4") {
  257. this.global.insureList[
  258. m
  259. ].amount = this.orderInfo.kindinfo[j].unitAmount;
  260. } else if (
  261. this.global.insureList[m].isMainRisk ||
  262. this.global.insureList[m].kindCode == "BD" ||
  263. this.global.insureList[m].kindCode == "L"
  264. ) {
  265. this.global.insureList[
  266. m
  267. ].amount = this.orderInfo.kindinfo[j].amount;
  268. } else {
  269. this.global.insureList[
  270. m
  271. ].amount = this.orderInfo.kindinfo[j].deductibleRate;
  272. }
  273. }
  274. }
  275. }
  276. }
  277. }
  278. }
  279. this.$refs.detailsDialog.setBackupVisible(true);
  280. } else {
  281. this.$message.error("订单获取失败");
  282. }
  283. });
  284. },
  285. dataTmeChange(val) {
  286. if (val) {
  287. this.queryForm.startDate = val[0];
  288. this.queryForm.endDate = val[1];
  289. } else {
  290. this.queryForm.startDate = "";
  291. this.queryForm.endDate = "";
  292. }
  293. },
  294. autoInsuranceFindPage(data) {
  295. if (data && data.pageRequest) {
  296. this.pageRequest.pageNum = data.pageRequest.pageNum;
  297. this.pageRequest.pageSize = data.pageRequest.pageSize;
  298. } else {
  299. this.pageRequest.pageNum = 1;
  300. this.pageRequest.pageSize = 20;
  301. }
  302. this.$api.letter
  303. .findMyInsuranceByUserId({ ...this.pageRequest, ...this.queryForm })
  304. .then((res) => {
  305. this.autoInsuranceResult = res.data;
  306. this.feeView=res.data.feeView;
  307. });
  308. },
  309. CompanyList() {
  310. this.$api.letter.gainTopList().then((res) => {
  311. this.ompanyqueryList = res.data;
  312. })
  313. },
  314. getDicType(type) {
  315. this.$api.insCompany.dicType(type).then(res => {
  316. if (res.code == 200) {
  317. this[type + "options"] = res.data.ddList;
  318. }
  319. });
  320. },
  321. },
  322. // 计算属性
  323. computed: {
  324. }
  325. }
  326. </script>
  327. <!-- 样式区域 -->
  328. <style lang='scss' scoped>
  329. /deep/ {
  330. .el-pagination.is-background .el-pager li:not(.disabled).active {
  331. background-color: #2D4D89;
  332. }
  333. .el-form-item {
  334. margin-bottom: 8px;
  335. }
  336. }
  337. </style>