mixin.js 46 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354
  1. import CommonUtil from "@/utils/comutil.js";
  2. export const mixin = { // 导出混入对象
  3. data() {
  4. return {
  5. retrievalFields: [
  6. {
  7. name: 'provinceId',
  8. label: '省机构名称',
  9. type: 'select',
  10. options: []
  11. },
  12. {
  13. name: 'cityId',
  14. label: '市机构名称',
  15. type: 'select',
  16. options: []
  17. },
  18. {
  19. name: 'countyId',
  20. label: '区机构名称',
  21. type: 'select',
  22. options: []
  23. },
  24. {
  25. name: 'houseId',
  26. label: '门店名称',
  27. type: 'select',
  28. options: []
  29. },
  30. {
  31. name: 'taskNo',
  32. label: '任务池号',
  33. type: 'input',
  34. },
  35. {
  36. name: 'orderNo',
  37. label: '订单号',
  38. type: 'input',
  39. },
  40. {
  41. name: 'companyId',
  42. label: '保险公司',
  43. type: 'select',
  44. options: []
  45. },
  46. {
  47. name: 'agreeId',
  48. label: '协议选择',
  49. type: 'select',
  50. options: [],
  51. optionsIabel: "agreementName",
  52. },
  53. {
  54. name: 'licenseNo',
  55. label: '车牌号',
  56. type: 'input',
  57. Retained: true,
  58. },
  59. {
  60. name: 'frameNo',
  61. label: '车架号',
  62. type: 'input',
  63. Retained: true,
  64. },
  65. {
  66. name: 'engineNo',
  67. label: '发动机号',
  68. type: 'input',
  69. Retained: true,
  70. },
  71. {
  72. name: 'riskCode',
  73. label: '投保险种',
  74. type: 'select',
  75. Retained: true,
  76. options: [],
  77. optionsIabel: "dictTag",
  78. optionsValue: "dictTag",
  79. },
  80. {
  81. name: 'operatorId',
  82. label: '代理人工号',
  83. type: 'input',
  84. Retained: true,
  85. },
  86. {
  87. name: 'operatorName',
  88. label: '代理人姓名',
  89. type: 'input',
  90. Retained: true,
  91. },
  92. {
  93. name: 'auditId',
  94. label: '受理人工号',
  95. type: 'input',
  96. Retained: true,
  97. },
  98. {
  99. name: 'insuredName',
  100. label: '被保险人',
  101. type: 'input',
  102. Retained: true,
  103. },
  104. {
  105. name: ["quoteStartDateStr", "quoteEndDateStr"],
  106. label: '报价时间',
  107. type: 'date',
  108. list: 'quoteList'
  109. },
  110. {
  111. name: ["attachStartDateStr", "attachEndDateStr"],
  112. label: '起保时间',
  113. type: 'date',
  114. list: 'attachList'
  115. },
  116. ],
  117. loading: false,
  118. queryFrom: {},
  119. pageResult: {},
  120. columns: [
  121. { prop: "subOrderId", label: "订单号", minWidth: 180 },
  122. { prop: "userid", label: "业务员工号", minWidth: 180 },
  123. { prop: "username", label: "业务员姓名", minWidth: 180 },
  124. // { prop: "userid", label: "业务员", minWidth: 160, formatter: this.useridFormatter },
  125. { prop: "managementSource", label: "业务来源", minWidth: 160, formatter: this.managementSourceFormatter },
  126. // { prop: "insCompany", label: "保险公司", minWidth: 120 },
  127. { prop: "partnerCompaniesName", label: "合作公司", minWidth: 120 },
  128. // { prop: "agreementName", label: "协议", minWidth: 160 },
  129. { prop: "licenseno", label: "车牌号", minWidth: 160 },
  130. { prop: "insuredname", label: "投保人姓名", minWidth: 120 },
  131. { prop: "product", label: "投保险种", minWidth: 100 },
  132. { prop: "createtime", label: "录单日期", minWidth: 160},
  133. ],
  134. columns1: [
  135. { prop: "subOrderId", label: "订单号", minWidth: 180 },
  136. { prop: "userid", label: "业务员工号", minWidth: 180 },
  137. { prop: "username", label: "业务员姓名", minWidth: 180 },
  138. // { prop: "userid", label: "业务员", minWidth: 160, formatter: this.useridFormatter },
  139. { prop: "managementSource", label: "业务来源", minWidth: 160, formatter: this.managementSourceFormatter },
  140. // { prop: "insCompany", label: "保险公司", minWidth: 120 },
  141. { prop: "partnerCompaniesName", label: "已承保公司", minWidth: 120 },
  142. { prop: "licenseno", label: "车牌号", minWidth: 160 },
  143. { prop: "jqpremium", label: "交强险保费", minWidth: 160 },
  144. { prop: "sypremium", label: "商业险保费", minWidth: 160 },
  145. // { prop: "agreementName", label: "协议", minWidth: 160 },
  146. { prop: "taxamount", label: "车船税", minWidth: 160 },
  147. { prop: "jypremium", label: "驾意险保费", minWidth: 160 },
  148. // { prop: "isExternal", label: "外部订单", formatter: this.isExternalFormatter},
  149. { prop: "insuredname", label: "投保人姓名", minWidth: 120 },
  150. { prop: "product", label: "投保险种", minWidth: 100 },
  151. { prop: "createtime", label: "录单日期", minWidth: 160},
  152. ],
  153. statusoptions: "",
  154. dialogVisible: false,
  155. companyList: [], //保险公司
  156. institutionOptions: [], //机构名称列表
  157. options: [],//转发人列表
  158. transmitValue: "", //选中的转发人
  159. orderNo: '', //主订单号
  160. id: '', //子订单号
  161. queryOrders: {},
  162. carImageList: [], //车辆影像
  163. ownerImageList: [], //车主影像
  164. policyImageList: [], //投保人影像
  165. insuredImageList: [], //被保人影像
  166. carCheckImageList: [], //验车照影像
  167. quoteno: "",
  168. oldfileList: [],
  169. orderInfo: {},
  170. forwardingRecordsdialogVisible:false,
  171. gridData:[],
  172. natureOfVehicleUseoptions: [],
  173. businessVehicleUseoptions:[],
  174. energyTypeoptions:[],
  175. vehicleTypeoptions:[],
  176. trafficManagementVehicleTypeoptions:[],
  177. outOfBusinessVehicleUseoptions: [],
  178. isAuditing:{
  179. adjustFeeFlag:false,
  180. },
  181. feeOrderNewVoList:{},
  182. dialogVisibleOrder:false,
  183. formDataOrder:{
  184. carinfo:{},
  185. ownerinfo:{},
  186. applyinfo:{},
  187. insureinfo:{},
  188. },
  189. formvehicleList: [
  190. { prop: "licenseNo", label: "车牌号" },
  191. { prop: "vinNo", label: "车辆识别代码" },
  192. { prop: "modelcname", label: "品牌型号" },
  193. { prop: "engineNo", label: "发动机号" },
  194. { prop: "caryear", label: "年款" },
  195. { prop: "seatCount", label: "座位数" },
  196. { prop: "completeKerbMass", label: "整备质量" },
  197. { prop: "limitLoad", label: "核定载质量" },
  198. { prop: "enginedesc", label: "排量" },
  199. { prop: "powerScale", label: "功率" },
  200. { prop: "purchasePrice", label: "新车购置价" },
  201. ],
  202. formownersList: [
  203. { prop: "name", label: "车主姓名" },
  204. { prop: "identifyType", label: "证件类型" ,type:'select'},
  205. { prop: "identifyNumber", label: "身份证号" },
  206. { prop: "mobile", label: "手机号" },
  207. { prop: "email", label: "电子邮箱" },
  208. { prop: "addr", label: "地址" },
  209. ],
  210. formPolicyholderList: [
  211. { prop: "name", label: "投保人姓名" },
  212. { prop: "identifyType", label: "证件类型" ,type:'select'},
  213. { prop: "identifyNumber", label: "身份证号" },
  214. { prop: "mobile", label: "手机号" },
  215. { prop: "email", label: "电子邮箱" },
  216. { prop: "addr", label: "地址" },
  217. ],
  218. forminsureinfoList: [
  219. { prop: "name", label: "被保人姓名" },
  220. { prop: "identifyType", label: "证件类型" ,type:'select'},
  221. { prop: "identifyNumber", label: "身份证号" },
  222. { prop: "mobile", label: "手机号" },
  223. { prop: "email", label: "电子邮箱" },
  224. { prop: "addr", label: "地址" },
  225. ],
  226. pickerOptions: {
  227. disabledDate(time) {
  228. return time.getTime() > Date.now();
  229. }
  230. },
  231. whetheroptions:[
  232. {
  233. label:'是',
  234. value:false
  235. }, {
  236. label:'否',
  237. value:true
  238. },
  239. ]
  240. }
  241. },
  242. computed: {
  243. issueDateOptions() {
  244. return {
  245. disabledDate: this.disabledDate
  246. };
  247. },
  248. currentDate() {
  249. const today = new Date();
  250. const year = today.getFullYear();
  251. const month = String(today.getMonth() + 1).padStart(2, '0');
  252. const day = String(today.getDate()).padStart(2, '0');
  253. return `${year}-${month}-${day}`;
  254. }
  255. },
  256. created() {
  257. this.pageRequest.quoteStartDateStr=this.currentDate;
  258. this.pageRequest.quoteEndDateStr=this.currentDate;
  259. this.$api.letter.gainTopList().then(res => {
  260. this.companyList = res.data;
  261. });
  262. this.$api.dept.findAllTree().then(res => {
  263. this.institutionOptions = res.data;
  264. });
  265. this.areaqueryList(1, 99, "provinceId");
  266. this.CompanyList();
  267. this.agrmentlist();
  268. this.getDicType("productsType"); //车船税类型
  269. this.getDicTypePro("natureOfVehicleUse"); //车辆使用性质
  270. this.getDicTypePro("vehicleType"); //车辆种类
  271. this.getDicTypePro("trafficManagementVehicleType"); //车辆类型
  272. this.getDicTypePro("energyType"); //能源种类
  273. this.getDicTypePro("businessVehicleUse"); //(车辆用途)营业
  274. this.getDicTypePro("outOfBusinessVehicleUse"); //(车辆用途)非营业
  275. },
  276. methods: {
  277. submitOrder(){
  278. let data={
  279. ownerInfo:this.formDataOrder.ownerinfo,
  280. carInfo:this.formDataOrder.carinfo,
  281. applyInfo:this.formDataOrder.applyinfo,
  282. insureInfo:this.formDataOrder.insureinfo,
  283. subOrderNo:this.formDataOrder.id
  284. }
  285. this.$api.task.batchOrder(data).then(res => {
  286. if (res.code == 200) {
  287. this.findPage();
  288. this.dialogVisibleOrder=false
  289. this.$message({
  290. message: res.msg ||'操作成功',
  291. type: 'success'
  292. });
  293. }
  294. else{
  295. this.$message.error(res.msg);
  296. }
  297. });
  298. },
  299. disabledDate(time) {
  300. let datetime = this.formDataOrder.registerDate;
  301. return time.getTime() < new Date(datetime).getTime();
  302. },
  303. natureFun() {
  304. if (this.formDataOrder.carinfo.carnature == "01") {
  305. this.formDataOrder.carinfo.vehicleUse = "";
  306. }
  307. },
  308. handleCloseOrder(){
  309. this.dialogVisibleOrder=false
  310. },
  311. getDicTypePro(type) {
  312. this.$api.insCompany.dicType(type).then(res => {
  313. if (res.code == 200) {
  314. this[type + "options"] = res.data.ddList;
  315. }
  316. });
  317. },
  318. capTypedictTag(val,option) {
  319. if(option.find(item => item.dictValue == val)){
  320. return option.find(item => item.dictValue == val).dictTag;
  321. }
  322. else{
  323. return '-'
  324. }
  325. },
  326. forwardingRecords(row){
  327. let id=row.row.subOrderId;
  328. this.forwardingRecordsQuery(id);
  329. },
  330. forwardingRecordsQuery(id) {
  331. this.$api.letter.findForwardingListBySubOrderId(id).then((res) => {
  332. if (res.code == '200' && res.data.length) {
  333. this.gridData=res.data;
  334. this.forwardingRecordsdialogVisible=true;
  335. } else {
  336. this.$message({
  337. type: 'error',
  338. message: "没有转发记录",
  339. });
  340. }
  341. });
  342. },
  343. detailFun(row) {
  344. let params = {
  345. companyId: row.row.subOrderId
  346. };
  347. this.$api.letter.getTaskByCompanyId(params).then(res => {
  348. if (res.code == "200") {
  349. var data = res.data;
  350. this.orderInfo = res.data;
  351. this.cpolicy();
  352. this.ImageList();
  353. data.kindinfo.map((ele, index) => {
  354. switch (ele.kindCode) {
  355. case "A":
  356. ele.amount = "投保";
  357. break;
  358. case "D4":
  359. case "SY_FJ_YBW2":
  360. ele.unitAmount = this.toChinesNum(ele.unitAmount);
  361. break;
  362. case "MJ1":
  363. case "MJ2":
  364. case "MJ3":
  365. case "MJ4":
  366. ele.deductibleRate = ele.deductibleRate + "%";
  367. break;
  368. default:
  369. ele.amount = this.toChinesNum(ele.amount);
  370. }
  371. return ele;
  372. });
  373. if (data.feeOrderNewVo && data.feeOrderNewVo.exportFee && data.feeOrderNewVo.entranceFee) {
  374. let data1 = JSON.parse(JSON.stringify(res.data.feeOrderNewVo))
  375. data1.exportFee.map((val, index) => {
  376. val.type = "出口费用"
  377. return val;
  378. })
  379. data1.entranceFee.map((val, index) => {
  380. val.type = "入口费用"
  381. return val;
  382. })
  383. this.feeOrderNewVoList = {
  384. list: [...data1.entranceFee,...data1.exportFee],
  385. }
  386. }
  387. if(data.carinfo.carnature && data.carinfo.carnature == '02' || data.carinfo.carnature == '非营业'){
  388. data.carinfo.vehicleUse=this.capTypedictTag(data.carinfo.vehicleUse,this.outOfBusinessVehicleUseoptions)
  389. }else{
  390. data.carinfo.vehicleUse=this.capTypedictTag(data.carinfo.vehicleUse,this.businessVehicleUseoptions)
  391. }
  392. data.carinfo.carnature = this.capTypedictTag(data.carinfo.carnature,this.natureOfVehicleUseoptions);
  393. data.carinfo.cartype=data.carinfo.cartype?this.capTypedictTag(data.carinfo.cartype,this.trafficManagementVehicleTypeoptions):''
  394. data.carinfo.cimodelclass=data.carinfo.cimodelclass?this.capTypedictTag(data.carinfo.cimodelclass,this.vehicleTypeoptions):''
  395. data.carinfo.energyType=data.carinfo.energyType?this.capTypedictTag(data.carinfo.energyType,this.energyTypeoptions):''
  396. this.queryOrders = data;
  397. }
  398. else{
  399. this.$message.error(res.msg)
  400. }
  401. });
  402. this.$refs.detailsDialog.setBackupVisible(true);
  403. },
  404. batchOrder(row){
  405. this.dialogVisibleOrder=true
  406. let params = {
  407. companyId: row.row.subOrderId
  408. };
  409. this.$api.letter.getTaskByCompanyId(params).then(res => {
  410. if(res.code==200){
  411. this.formDataOrder = res.data;
  412. }
  413. else{
  414. this.$message.error(res.msg)
  415. }
  416. })
  417. },
  418. areaSelectChange(obj) {
  419. switch (obj.filed) {
  420. case 'provinceId':
  421. this.areaqueryList(2, obj.id, 'cityId')
  422. break;
  423. case 'cityId':
  424. this.areaqueryList(3, obj.id, 'countyId')
  425. break;
  426. case 'countyId':
  427. this.areaqueryList(4, obj.id, 'houseId')
  428. break;
  429. default:
  430. }
  431. },
  432. //下拉数据匹配
  433. selectDataMatching(files, name, data) {
  434. files.forEach(filed => {
  435. if (filed.name == name) {
  436. filed.options = data;
  437. }
  438. })
  439. },
  440. //获取机构数据
  441. areaqueryList(level, parentId, filed) {
  442. this.$api.task.queryListByParentId(level, parentId).then((res) => {
  443. this.selectDataMatching(this.retrievalFields, filed, res.data);
  444. });
  445. },
  446. CompanyList() {
  447. this.$api.letter.gainTopList().then((res) => {
  448. this.selectDataMatching(this.retrievalFields, 'companyId', res.data);
  449. })
  450. },
  451. agrmentlist() {
  452. this.$api.task.findPtlAgreementList().then((res) => {
  453. this.selectDataMatching(this.retrievalFields, 'agreeId', res.data);
  454. });
  455. },
  456. getDicType(type) {
  457. this.$api.insCompany.dicType(type).then(res => {
  458. if (res.code == 200) {
  459. this.selectDataMatching(this.retrievalFields, 'riskCode', res.data.ddList);
  460. }
  461. });
  462. },
  463. cpolicy() {
  464. if (this.orderInfo.orderstatus == "3") {
  465. this.oldfileList = [];
  466. let businessList = []
  467. let accidentList = []
  468. if(this.orderInfo.isExternal==1){
  469. this.$api.letter
  470. .getPolicyPrintexternalOrder(this.orderInfo.id).then(res1=>{
  471. if(res1.code==200){
  472. if (res1.data.jqPolicy) {
  473. this.oldfileList.push({
  474. fileTitle: "交强电子保单",
  475. filename: this.orderInfo.jqpolicyno,
  476. fileurl: res1.data.jqPolicy
  477. });
  478. }
  479. if (res1.data.jqSign) {
  480. this.oldfileList.push({
  481. fileTitle: "交强电子标志",
  482. filename: this.orderInfo.jqpolicyno,
  483. fileurl: res1.data.jqSign
  484. });
  485. }
  486. if (res1.data.jqSign) {
  487. accidentList.push({
  488. fileTitle: "商业电子保单",
  489. filename: this.orderInfo.sypolicyno,
  490. fileurl: res1.data.jqSign
  491. });
  492. }
  493. if (res1.data.noPolicy) {
  494. accidentList.push({
  495. fileTitle: "驾意险保单",
  496. filename: "驾意险保单",
  497. fileurl: res1.data.noPolicy
  498. });
  499. }
  500. }
  501. else{
  502. this.$message.error(res1.msg)
  503. }
  504. })
  505. }
  506. else{
  507. switch (this.orderInfo.inscompany) {
  508. case "永安财险":
  509. if (this.orderInfo.jqpolicyno) {
  510. this.$api.letter
  511. .getPolicyPrint({
  512. companyId: this.orderInfo.id,
  513. policytype: "jq",
  514. })
  515. .then((res) => {
  516. //交强保单
  517. if (res.data) {
  518. let result = res.data.replace(/[\r\n]/g, "");
  519. let pdfBase64 = `data:application/pdf;base64,${result}`;
  520. base64ToPath(pdfBase64).then((path) => {
  521. if (path) {
  522. this.oldfileList.push({
  523. fileTitle: "交强电子保单",
  524. filename: this.orderInfo.jqpolicyno,
  525. fileurl: path,
  526. });
  527. }
  528. });
  529. }
  530. });
  531. this.$api.letter
  532. .getPolicyPrint2({
  533. companyId: this.orderInfo.id,
  534. policytype: "jq",
  535. })
  536. .then((res) => {
  537. //交强保单
  538. if (res.data) {
  539. let result = res.data.replace(/[\r\n]/g, "");
  540. let pdfBase64 = `data:application/pdf;base64,${result}`;
  541. base64ToPath(pdfBase64).then((path) => {
  542. if (path) {
  543. this.oldfileList.push({
  544. fileTitle: "交强电子标志",
  545. filename: this.orderInfo.jqpolicyno,
  546. fileurl: path,
  547. });
  548. }
  549. });
  550. }
  551. });
  552. }
  553. if (this.orderInfo.sypolicyno) {
  554. this.$api.letter
  555. .getPolicyPrint({
  556. companyId: this.orderInfo.id,
  557. policytype: "sy",
  558. })
  559. .then((res) => {
  560. //商业保单
  561. if (res.data) {
  562. let result = res.data.replace(/[\r\n]/g, "");
  563. let pdfBase64 = `data:application/pdf;base64,${result}`;
  564. base64ToPath(pdfBase64).then((path) => {
  565. if (path) {
  566. businessList.push({
  567. fileTitle: "商业电子保单",
  568. filename: this.orderInfo.sypolicyno,
  569. fileurl: path,
  570. });
  571. }
  572. });
  573. }
  574. });
  575. }
  576. break;
  577. case "华泰财险":
  578. if (this.orderInfo.jqpolicyno) {
  579. this.$api.letter
  580. .HuataigetPolicyPrint({
  581. companyId: this.orderInfo.id,
  582. riskCode: "0507",
  583. type: "2", //2:保单
  584. })
  585. .then((res) => {
  586. if (res.data) {
  587. if (res.data.jqxPolicyUrl) {
  588. this.oldfileList.push({
  589. fileTitle: "交强电子保单",
  590. filename: this.orderInfo.jqpolicyno,
  591. fileurl: res.data.jqxPolicyUrl,
  592. });
  593. }
  594. if (res.data.jqxFlagUrl) {
  595. this.oldfileList.push({
  596. fileTitle: "交强电子标志",
  597. filename: this.orderInfo.jqpolicyno,
  598. fileurl: res.data.jqxFlagUrl,
  599. });
  600. }
  601. } else {
  602. this.$message.error(res.msg);
  603. }
  604. });
  605. }
  606. if (this.orderInfo.sypolicyno) {
  607. this.$api.letter
  608. .HuataigetPolicyPrint({
  609. companyId: this.orderInfo.id,
  610. riskCode: "0510",
  611. type: "2", //2:保单
  612. })
  613. .then((res) => {
  614. if (res.data && res.data.syxPolicyUrl) {
  615. businessList.push({
  616. fileTitle: "商业电子保单",
  617. filename: this.orderInfo.sypolicyno,
  618. fileurl: res.data.syxPolicyUrl,
  619. });
  620. } else {
  621. this.$message.error(res.msg);
  622. }
  623. });
  624. }
  625. break;
  626. case "中煤财险":
  627. if (this.orderInfo.jqpolicyno) {
  628. this.$api.letter
  629. .ZhongmeigetPolicyPrint({
  630. companyId: this.orderInfo.id,
  631. riskCode: "0507",
  632. type: "2", //2:保单
  633. })
  634. .then((res) => {
  635. if (res.data && res.data[0]) {
  636. this.oldfileList.push({
  637. fileTitle: "交强电子保单",
  638. filename: this.orderInfo.jqpolicyno,
  639. fileurl: res.data[0],
  640. });
  641. } else {
  642. this.$message.error(res.msg);
  643. }
  644. });
  645. this.$api.letter
  646. .ZhongmeigetPolicyPrint({
  647. companyId: this.orderInfo.id,
  648. riskCode: "0507",
  649. type: "1", // 1:标志
  650. })
  651. .then((res) => {
  652. if (res.data && res.data[0]) {
  653. this.oldfileList.push({
  654. fileTitle: "交强电子标志",
  655. filename: this.orderInfo.jqpolicyno,
  656. fileurl: res.data[0],
  657. });
  658. } else {
  659. this.$message.error(res.msg);
  660. }
  661. });
  662. }
  663. if (this.orderInfo.sypolicyno) {
  664. this.$api.letter
  665. .ZhongmeigetPolicyPrint({
  666. companyId: this.orderInfo.id,
  667. riskCode: "0510",
  668. type: "2", //2:保单
  669. })
  670. .then((res) => {
  671. if (res.data && res.data[0]) {
  672. businessList.push({
  673. fileTitle: "商业电子保单",
  674. filename: this.orderInfo.sypolicyno,
  675. fileurl: res.data[0],
  676. });
  677. } else {
  678. this.$message.error(res.msg);
  679. }
  680. });
  681. }
  682. if (this.orderInfo.crossInsurance.length > 0) {
  683. this.orderInfo.crossInsurance.map((ele) => {
  684. this.$api.letter
  685. .ZhongmeigetPolicyPrint({
  686. ridePolicyNo: ele.ridePolicyNo,
  687. companyId: this.orderInfo.id,
  688. riskCode: "0513",
  689. type: "2", //2:保单
  690. })
  691. .then((res) => {
  692. if (res.code == 200 && res.data) {
  693. accidentList.push({
  694. fileTitle: "驾意险保单",
  695. filename: this.orderInfo.sypolicyno,
  696. fileurl: res.data[0],
  697. });
  698. } else {
  699. this.$message.error(res.msg);
  700. }
  701. });
  702. });
  703. }
  704. break;
  705. case "永诚财险":
  706. if (this.orderInfo.jqpolicyno) {
  707. this.$api.letter
  708. .yongchenggetPolicyPrint({
  709. companyId: this.orderInfo.id,
  710. riskCode: "0507",
  711. type: "2", //2:保单
  712. })
  713. .then((res) => {
  714. if (res.code == 200 && res.data) {
  715. if (res.data.jqUrl) {
  716. this.oldfileList.push({
  717. fileTitle: "交强电子保单",
  718. filename: this.orderInfo.jqpolicyno,
  719. fileurl: res.data.jqUrl,
  720. });
  721. }
  722. if (res.data.jqFlagUrl) {
  723. this.oldfileList.push({
  724. fileTitle: "交强电子标志",
  725. filename: this.orderInfo.jqpolicyno,
  726. fileurl: res.data.jqFlagUrl,
  727. });
  728. }
  729. } else {
  730. this.$message.error(res.msg);
  731. }
  732. });
  733. }
  734. if (this.orderInfo.sypolicyno) {
  735. this.$api.letter
  736. .yongchenggetPolicyPrint({
  737. companyId: this.orderInfo.id,
  738. riskCode: "0510",
  739. type: "2", //2:保单
  740. })
  741. .then((res) => {
  742. if (res.data && res.data.syUrl) {
  743. businessList.push({
  744. fileTitle: "商业电子保单",
  745. filename: this.orderInfo.sypolicyno,
  746. fileurl: res.data.syUrl,
  747. });
  748. } else {
  749. this.$message.error(res.msg);
  750. }
  751. });
  752. }
  753. if (this.orderInfo.crossInsurance.length > 0) {
  754. this.orderInfo.crossInsurance.map((ele) => {
  755. this.$api.letter
  756. .yongchenggetPolicyPrint({
  757. companyId: this.orderInfo.id,
  758. policyNumber: ele.policyNumber,
  759. riskCode: "0513",
  760. type: "2", //2:保单
  761. })
  762. .then((res) => {
  763. if (res.code == 200 && res.data) {
  764. accidentList.push({
  765. fileTitle: "驾意险保单",
  766. filename: ele.policyNumber,
  767. fileurl: res.data.jyUrl,
  768. });
  769. } else {
  770. this.$message.error(res.msg);
  771. }
  772. });
  773. });
  774. }
  775. break;
  776. case "国任财险":
  777. if (this.orderInfo.jqpolicyno) {
  778. this.$api.letter
  779. .guoRengetPolicyPrint({
  780. companyId: this.orderInfo.id,
  781. riskCode: "0507",
  782. type: "2", //2:保单
  783. })
  784. .then((res) => {
  785. if (res.data) {
  786. this.oldfileList.push({
  787. fileTitle: "交强电子保单",
  788. filename: this.orderInfo.jqpolicyno,
  789. fileurl: res.data,
  790. });
  791. } else {
  792. this.$message.error(res.msg);
  793. }
  794. });
  795. this.$api.letter
  796. .guoRengetPolicyPrint({
  797. companyId: this.orderInfo.id,
  798. riskCode: "0507",
  799. type: "1", //1:标志
  800. })
  801. .then((res) => {
  802. if (res.data) {
  803. this.oldfileList.push({
  804. fileTitle: "交强电子标志",
  805. filename: this.orderInfo.jqpolicyno,
  806. fileurl: res.data,
  807. });
  808. } else {
  809. this.$message.error(res.msg);
  810. }
  811. });
  812. }
  813. if (this.orderInfo.sypolicyno) {
  814. this.$api.letter
  815. .guoRengetPolicyPrint({
  816. companyId: this.orderInfo.id,
  817. riskCode: "0510",
  818. type: "2", //2:保单
  819. })
  820. .then((res) => {
  821. if (res.data) {
  822. businessList.push({
  823. fileTitle: "商业电子保单",
  824. filename: this.orderInfo.sypolicyno,
  825. fileurl: res.data,
  826. });
  827. } else {
  828. this.$message.error(res.msg);
  829. }
  830. });
  831. }
  832. if (this.orderInfo.crossInsurance.length > 0) {
  833. this.orderInfo.crossInsurance.map((ele) => {
  834. this.$api.letter
  835. .guoRengetPolicyPrint({
  836. companyId: this.orderInfo.id,
  837. policyNumber: ele.policyNumber,
  838. riskCode: "0513",
  839. type: "2", //2:保单
  840. })
  841. .then((res) => {
  842. if (res.data) {
  843. accidentList.push({
  844. fileTitle: "驾意险保单",
  845. filename: ele.policyNumber,
  846. fileurl: res.data,
  847. });
  848. } else {
  849. this.$message.error(res.msg);
  850. }
  851. });
  852. });
  853. }
  854. break;
  855. case "紫金财险":
  856. if (this.orderInfo.jqpolicyno) {
  857. this.$api.letter
  858. .zijingetPolicyPrint({
  859. companyId: this.orderInfo.id,
  860. riskCode: "0507",
  861. type: "2", //2:保单
  862. })
  863. .then((res) => {
  864. if (res.data) {
  865. this.oldfileList.push({
  866. fileTitle: "交强电子保单",
  867. filename: this.orderInfo.jqpolicyno,
  868. fileurl: res.data,
  869. });
  870. } else {
  871. this.$message.error(res.msg);
  872. }
  873. });
  874. this.$api.letter
  875. .zijingetPolicyPrint({
  876. companyId: this.orderInfo.id,
  877. riskCode: "0507",
  878. type: "1", //1:标志
  879. })
  880. .then((res) => {
  881. if (res.data) {
  882. this.oldfileList.push({
  883. fileTitle: "交强电子标志",
  884. filename: this.orderInfo.jqpolicyno,
  885. fileurl: res.data,
  886. });
  887. } else {
  888. this.$message.error(res.msg);
  889. }
  890. });
  891. }
  892. if (this.orderInfo.sypolicyno) {
  893. this.$api.letter
  894. .zijingetPolicyPrint({
  895. companyId: this.orderInfo.id,
  896. riskCode: "0510",
  897. type: "2", //2:保单
  898. })
  899. .then((res) => {
  900. if (res.data) {
  901. businessList.push({
  902. fileTitle: "商业电子保单",
  903. filename: this.orderInfo.sypolicyno,
  904. fileurl: res.data,
  905. });
  906. } else {
  907. this.$message.error(res.msg);
  908. }
  909. });
  910. }
  911. if (this.orderInfo.crossInsurance.length > 0) {
  912. this.orderInfo.crossInsurance.map((ele) => {
  913. this.$api.letter
  914. .zijingetPolicyPrint({
  915. companyId: this.orderInfo.id,
  916. policyNumber: ele.policyNumber,
  917. riskCode: "0513",
  918. type: "2", //2:保单
  919. })
  920. .then((res) => {
  921. if (res.data) {
  922. accidentList.push({
  923. fileTitle: "驾意险保单",
  924. filename: ele.policyNumber,
  925. fileurl: res.data,
  926. });
  927. } else {
  928. this.$message.error(res.msg);
  929. }
  930. });
  931. });
  932. }
  933. break;
  934. case "渤海财险":
  935. if (this.orderInfo.jqpolicyno) {
  936. this.$api.letter
  937. .getPolicyPrintboHai({
  938. companyId: this.orderInfo.id,
  939. })
  940. .then((res) => {
  941. if (res.code == 200 && res.data) {
  942. if (res.data.jqxPolicyUrl) {
  943. this.oldfileList.push({
  944. fileTitle: "交强电子保单",
  945. filename: this.orderInfo.jqpolicyno,
  946. fileurl: res.data.jqxPolicyUrl,
  947. });
  948. }
  949. if (res.data.jqxFlagUrl) {
  950. this.oldfileList.push({
  951. fileTitle: "交强电子标志",
  952. filename: this.orderInfo.jqpolicyno,
  953. fileurl: res.data.jqxFlagUrl,
  954. });
  955. }
  956. if (res.data.syxPolicyUrl) {
  957. businessList.push({
  958. fileTitle: "商业电子保单",
  959. filename: this.orderInfo.sypolicyno,
  960. fileurl: res.data.syxPolicyUrl,
  961. });
  962. }
  963. if (
  964. res.data.jyxInfoList &&
  965. res.data.jyxInfoList.length > 0
  966. ) {
  967. res.data.jyxInfoList.forEach((val) => {
  968. accidentList.push({
  969. fileTitle: "驾意险保单",
  970. filename: "驾意险保单",
  971. fileurl: val.jyx_policy_url,
  972. });
  973. });
  974. }
  975. } else {
  976. this.$message.error(res.msg);
  977. }
  978. });
  979. }
  980. break;
  981. case "恒邦财险":
  982. case "安盛天平":
  983. case "中国人寿":
  984. case "太平财险":
  985. case "华农财险":
  986. case "众安财险":
  987. if (this.orderInfo.jqpolicyno || this.orderInfo.sypolicyno) {
  988. this.$api.letter
  989. .pythongetPolicyPrint({
  990. subOrderNo: this.orderInfo.id,
  991. })
  992. .then((res) => {
  993. if (res.code == 200 && res.data) {
  994. if (res.data.jqxPolicyUrl) {
  995. this.oldfileList.push({
  996. fileTitle: "交强电子保单",
  997. filename: this.orderInfo.jqpolicyno,
  998. fileurl: res.data.jqxPolicyUrl,
  999. });
  1000. }
  1001. if (res.data.jqxFlagUrl) {
  1002. this.oldfileList.push({
  1003. fileTitle: "交强电子标志",
  1004. filename: this.orderInfo.jqpolicyno,
  1005. fileurl: res.data.jqxFlagUrl,
  1006. });
  1007. }
  1008. if (res.data.syxPolicyUrl) {
  1009. businessList.push({
  1010. fileTitle: "商业电子保单",
  1011. filename: this.orderInfo.sypolicyno,
  1012. fileurl: res.data.syxPolicyUrl,
  1013. });
  1014. }
  1015. if (
  1016. res.data.jyxInfoList &&
  1017. res.data.jyxInfoList.length > 0
  1018. ) {
  1019. res.data.jyxInfoList.forEach((val) => {
  1020. accidentList.push({
  1021. fileTitle: "驾意险保单",
  1022. filename: "驾意险保单",
  1023. fileurl: val.jyx_policy_url,
  1024. });
  1025. });
  1026. }
  1027. } else {
  1028. this.$message.error(res.msg);
  1029. }
  1030. });
  1031. }
  1032. break;
  1033. case "大家财险":
  1034. if (this.orderInfo.jqpolicyno) {
  1035. this.$api.letter
  1036. .obtainWarranty({
  1037. companyId: this.orderInfo.id,
  1038. riskCode: "0507",
  1039. type: "2", //2:保单
  1040. })
  1041. .then((res) => {
  1042. if (res.data) {
  1043. this.oldfileList.push({
  1044. fileTitle: "交强电子保单",
  1045. filename: this.orderInfo.jqpolicyno,
  1046. fileurl: res.data,
  1047. });
  1048. } else {
  1049. this.$message.error(res.msg);
  1050. }
  1051. });
  1052. this.$api.letter
  1053. .obtainWarranty({
  1054. companyId: this.orderInfo.id,
  1055. riskCode: "0507",
  1056. type: "1", //1:标志
  1057. })
  1058. .then((res) => {
  1059. if (res.data) {
  1060. this.oldfileList.push({
  1061. fileTitle: "交强电子标志",
  1062. filename: this.orderInfo.jqpolicyno,
  1063. fileurl: res.data,
  1064. });
  1065. } else {
  1066. this.$message.error(res.msg);
  1067. }
  1068. });
  1069. }
  1070. if (this.orderInfo.sypolicyno) {
  1071. this.$api.letter
  1072. .obtainWarranty({
  1073. companyId: this.orderInfo.id,
  1074. riskCode: "0510",
  1075. type: "2", //2:保单
  1076. })
  1077. .then((res) => {
  1078. if (res.data) {
  1079. businessList.push({
  1080. fileTitle: "商业电子保单",
  1081. filename: this.orderInfo.sypolicyno,
  1082. fileurl: res.data,
  1083. });
  1084. }
  1085. });
  1086. }
  1087. if (this.orderInfo.crossInsurance.length > 0) {
  1088. this.orderInfo.crossInsurance.map((ele) => {
  1089. this.$api.letter
  1090. .zijingetPolicyPrint({
  1091. companyId: this.orderInfo.id,
  1092. policyNumber: ele.policyNumber,
  1093. riskCode: "0513",
  1094. type: "2", //2:保单
  1095. })
  1096. .then((res) => {
  1097. if (res.data) {
  1098. accidentList.push({
  1099. fileTitle: "驾意险保单",
  1100. filename: ele.policyNumber,
  1101. fileurl: res.data,
  1102. });
  1103. } else {
  1104. this.$message.error(res.msg);
  1105. }
  1106. });
  1107. });
  1108. }
  1109. break;
  1110. default:
  1111. }
  1112. }
  1113. let obj = {
  1114. oldfileList: this.oldfileList,
  1115. businessList,
  1116. accidentList
  1117. }
  1118. this.$refs.detailsDialog.warrantyFun(obj);
  1119. }
  1120. },
  1121. ImageList() {
  1122. this.carImageList = [];
  1123. this.ownerImageList = []; //车主影像
  1124. this.policyImageList = []; //投保人影像
  1125. this.insuredImageList = []; //被保人影像
  1126. this.carCheckImageList = []; //验车照影像
  1127. // 获取影像
  1128. this.$api.letter.findByQuoteNo(this.orderInfo.quoteno).then((resImage) => {
  1129. Object.keys(resImage.data).forEach((keys) => {
  1130. if (resImage.data[keys]) {
  1131. resImage.data[keys].url = resImage.data[keys].url
  1132. ? process.env.BASE_URL + resImage.data[keys].url
  1133. : null;
  1134. switch (keys) {
  1135. case "C01":
  1136. case "D01":
  1137. resImage.data[keys].url
  1138. ? this.carImageList.push(resImage.data[keys].url)
  1139. : "";
  1140. break;
  1141. case "C02":
  1142. case "D02":
  1143. resImage.data[keys].url
  1144. ? this.ownerImageList.push(resImage.data[keys].url)
  1145. : "";
  1146. break;
  1147. case "C03":
  1148. case "D03":
  1149. resImage.data[keys].url
  1150. ? this.policyImageList.push(resImage.data[keys].url)
  1151. : "";
  1152. break;
  1153. case "C04":
  1154. case "D04":
  1155. resImage.data[keys].url
  1156. ? this.insuredImageList.push(resImage.data[keys].url)
  1157. : "";
  1158. break;
  1159. case "XC00":
  1160. case "GC00":
  1161. case "GX00":
  1162. resImage.data[keys].url
  1163. ? this.carCheckImageList.push(resImage.data[keys].url)
  1164. : "";
  1165. break;
  1166. default:
  1167. break;
  1168. }
  1169. }
  1170. });
  1171. let obj = {
  1172. carImageList: this.carImageList,
  1173. ownerImageList: this.ownerImageList,
  1174. policyImageList: this.policyImageList,
  1175. insuredImageList: this.insuredImageList,
  1176. carCheckImageList: this.carCheckImageList
  1177. }
  1178. this.$refs.detailsDialog.imageFun(obj);
  1179. });
  1180. },
  1181. toChinesNum(num) {
  1182. if (num.toString().length == 4) {
  1183. let overQian = Math.floor(num / 1000);
  1184. let result = overQian + "千";
  1185. return result;
  1186. } else {
  1187. let overWan = Math.floor(num / 10000);
  1188. let result = overWan + "万";
  1189. return result;
  1190. }
  1191. },
  1192. useridFormatter(row, column) {
  1193. let data = row.username + `(${row.userid})`
  1194. return data;
  1195. },
  1196. managementSourceFormatter(row, column) {
  1197. let managementSource = row.managementSource;
  1198. switch (managementSource) {
  1199. case '渠道':
  1200. return <el-tag>渠道</el-tag>
  1201. case '个代':
  1202. return <el-tag type="success">个代</el-tag>
  1203. case '电销':
  1204. return <el-tag type="warning">电销</el-tag>
  1205. default:
  1206. }
  1207. },
  1208. isExternalFormatter(row, column) {
  1209. let isExternal = row.isExternal;
  1210. switch (isExternal) {
  1211. case 1:
  1212. return '是'
  1213. case 0:
  1214. return '否'
  1215. default:
  1216. }
  1217. },
  1218. trajectory(row){
  1219. this.$api.letter.queryBySuborder(row.subOrderId).then((res) => {
  1220. if (res.code == 200 && res.data.length > 0) {
  1221. this.ddgjdialogVisible = true;
  1222. this.trajectoryTable = res.data;
  1223. } else {
  1224. this.$message({
  1225. message: res.msg || "暂无数据!",
  1226. type: "warning",
  1227. });
  1228. }
  1229. });
  1230. },
  1231. cancelorder(item) {
  1232. this.$api.letter.zijincancelorder({ companyId: item.subOrderId }).then(res => {
  1233. if (res.code == 200) {
  1234. this.$message({
  1235. message: res.msg,
  1236. type: "success"
  1237. });
  1238. this.findPage();
  1239. }
  1240. else{
  1241. this.$message.error(res.msg)
  1242. }
  1243. });
  1244. },
  1245. // 撤销二维码
  1246. revokeCode(row) {
  1247. this.$api.letter.getRevokeQrCode(row.subOrderId).then(res => {
  1248. if (res.code == 200) {
  1249. this.$message({
  1250. message: res.msg,
  1251. type: "success"
  1252. });
  1253. this.findPage();
  1254. }
  1255. });
  1256. },
  1257. //查询缴费状态
  1258. refreshStatus(item) {
  1259. let inscompany = {
  1260. 国任财险: "updateOrderInfoGuoren",
  1261. 华泰财险: "orderStatushuatai",
  1262. 大家财险: "updateOrderInfoDajia",
  1263. 中煤财险: "orderStatuszhongmei",
  1264. 太平财险: "auditStatusQuery",
  1265. 华农财险: "auditStatusQuery",
  1266. 恒邦财险: "auditStatusQuery",
  1267. 众安财险: "auditStatusQuery",
  1268. 中国人寿: "auditStatusQuery",
  1269. 安盛天平: "auditStatusQuery",
  1270. 紫金财险: "auditStatusQueryZijin",
  1271. 渤海财险: "orderStatusbohai"
  1272. };
  1273. Object.keys(inscompany).forEach(val => {
  1274. if (val == item.insCompany) {
  1275. this.$api.letter[inscompany[val]]({ companyId: item.subOrderId }).then(
  1276. res => {
  1277. if (res.code == 200) {
  1278. this.$message({
  1279. message: res.msg ? res.msg : "已刷新状态",
  1280. type: "success"
  1281. });
  1282. this.findPage();
  1283. } else {
  1284. this.$message({
  1285. showClose: true,
  1286. dangerouslyUseHTMLString: true,
  1287. message: res.msg.replace(/\n/g, "<br><br>"),
  1288. type: "error",
  1289. duration: 7000
  1290. });
  1291. }
  1292. }
  1293. );
  1294. }
  1295. });
  1296. if (item.insCompany == "永诚财险") {
  1297. this.$api.letter.orderStatusyongcheng(item.subOrderId).then(res => {
  1298. if (res.code == 200) {
  1299. this.$message({
  1300. message: res.msg ? res.msg : "已刷新状态",
  1301. type: "success"
  1302. });
  1303. this.findPage();
  1304. } else {
  1305. this.$message({
  1306. showClose: true,
  1307. dangerouslyUseHTMLString: true,
  1308. message: res.msg.replace(/\n/g, "<br><br>"),
  1309. type: "error",
  1310. duration: 7000
  1311. });
  1312. }
  1313. });
  1314. }
  1315. if (item.insCompany == "华泰财险") {
  1316. let HtApiType =
  1317. item.apiType == 2
  1318. ? "auditStatusQuery"
  1319. : "orderStatushuatai";
  1320. this.$api.letter[HtApiType](item.subOrderId).then(res => {
  1321. if (res.code == 200) {
  1322. this.$message({
  1323. message: res.msg ? res.msg : "已刷新状态",
  1324. type: "success"
  1325. });
  1326. this.findPage();
  1327. } else {
  1328. this.$message({
  1329. showClose: true,
  1330. dangerouslyUseHTMLString: true,
  1331. message: res.msg.replace(/\n/g, "<br><br>"),
  1332. type: "error",
  1333. duration: 7000
  1334. });
  1335. }
  1336. });
  1337. }
  1338. },
  1339. }
  1340. }