mixin.js 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350
  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: "product", label: "投保险种", minWidth: 100 },
  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: "userid", label: "业务员工号", minWidth: 180 },
  132. { prop: "createtime", label: "录单日期", minWidth: 160},
  133. ],
  134. columns1: [
  135. { prop: "subOrderId", label: "订单号", minWidth: 180 },
  136. { prop: "product", label: "投保险种", minWidth: 100 },
  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: "userid", label: "业务员工号", minWidth: 180 },
  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. data.source = row.managementSource
  397. this.queryOrders = data;
  398. }
  399. else{
  400. this.$message.error(res.msg)
  401. }
  402. });
  403. this.$refs.detailsDialog.setBackupVisible(true);
  404. },
  405. batchOrder(row){
  406. this.dialogVisibleOrder=true
  407. let params = {
  408. companyId: row.row.subOrderId
  409. };
  410. this.$api.letter.getTaskByCompanyId(params).then(res => {
  411. if(res.code==200){
  412. this.formDataOrder = res.data;
  413. }
  414. else{
  415. this.$message.error(res.msg)
  416. }
  417. })
  418. },
  419. areaSelectChange(obj) {
  420. switch (obj.filed) {
  421. case 'provinceId':
  422. this.areaqueryList(2, obj.id, 'cityId')
  423. break;
  424. case 'cityId':
  425. this.areaqueryList(3, obj.id, 'countyId')
  426. break;
  427. case 'countyId':
  428. this.areaqueryList(4, obj.id, 'houseId')
  429. break;
  430. default:
  431. }
  432. },
  433. //下拉数据匹配
  434. selectDataMatching(files, name, data) {
  435. files.forEach(filed => {
  436. if (filed.name == name) {
  437. filed.options = data;
  438. }
  439. })
  440. },
  441. //获取机构数据
  442. areaqueryList(level, parentId, filed) {
  443. this.$api.task.queryListByParentId(level, parentId).then((res) => {
  444. this.selectDataMatching(this.retrievalFields, filed, res.data);
  445. });
  446. },
  447. CompanyList() {
  448. this.$api.letter.gainTopList().then((res) => {
  449. this.selectDataMatching(this.retrievalFields, 'companyId', res.data);
  450. })
  451. },
  452. agrmentlist() {
  453. this.$api.task.findPtlAgreementList().then((res) => {
  454. this.selectDataMatching(this.retrievalFields, 'agreeId', res.data);
  455. });
  456. },
  457. getDicType(type) {
  458. this.$api.insCompany.dicType(type).then(res => {
  459. if (res.code == 200) {
  460. this.selectDataMatching(this.retrievalFields, 'riskCode', res.data.ddList);
  461. }
  462. });
  463. },
  464. cpolicy() {
  465. if (this.orderInfo.orderstatus == "3") {
  466. this.oldfileList = [];
  467. let businessList = []
  468. let accidentList = []
  469. if(this.orderInfo.isExternal==1){
  470. this.$api.letter
  471. .getPolicyPrintexternalOrder(this.orderInfo.id).then(res1=>{
  472. if(res1.code==200){
  473. if (res1.data.jqPolicy) {
  474. this.oldfileList.push({
  475. fileTitle: "交强电子保单",
  476. filename: this.orderInfo.jqpolicyno,
  477. fileurl: res1.data.jqPolicy
  478. });
  479. }
  480. if (res1.data.jqSign) {
  481. this.oldfileList.push({
  482. fileTitle: "交强电子标志",
  483. filename: this.orderInfo.jqpolicyno,
  484. fileurl: res1.data.jqSign
  485. });
  486. }
  487. if (res1.data.jqSign) {
  488. accidentList.push({
  489. fileTitle: "商业电子保单",
  490. filename: this.orderInfo.sypolicyno,
  491. fileurl: res1.data.jqSign
  492. });
  493. }
  494. if (res1.data.noPolicy) {
  495. accidentList.push({
  496. fileTitle: "驾意险保单",
  497. filename: "驾意险保单",
  498. fileurl: res1.data.noPolicy
  499. });
  500. }
  501. }
  502. else{
  503. this.$message.error(res1.msg)
  504. }
  505. })
  506. }
  507. else{
  508. switch (this.orderInfo.inscompany) {
  509. case "永安财险":
  510. if (this.orderInfo.jqpolicyno) {
  511. this.$api.letter
  512. .getPolicyPrint({
  513. companyId: this.orderInfo.id,
  514. policytype: "jq",
  515. })
  516. .then((res) => {
  517. //交强保单
  518. if (res.data) {
  519. let result = res.data.replace(/[\r\n]/g, "");
  520. let pdfBase64 = `data:application/pdf;base64,${result}`;
  521. base64ToPath(pdfBase64).then((path) => {
  522. if (path) {
  523. this.oldfileList.push({
  524. fileTitle: "交强电子保单",
  525. filename: this.orderInfo.jqpolicyno,
  526. fileurl: path,
  527. });
  528. }
  529. });
  530. }
  531. });
  532. this.$api.letter
  533. .getPolicyPrint2({
  534. companyId: this.orderInfo.id,
  535. policytype: "jq",
  536. })
  537. .then((res) => {
  538. //交强保单
  539. if (res.data) {
  540. let result = res.data.replace(/[\r\n]/g, "");
  541. let pdfBase64 = `data:application/pdf;base64,${result}`;
  542. base64ToPath(pdfBase64).then((path) => {
  543. if (path) {
  544. this.oldfileList.push({
  545. fileTitle: "交强电子标志",
  546. filename: this.orderInfo.jqpolicyno,
  547. fileurl: path,
  548. });
  549. }
  550. });
  551. }
  552. });
  553. }
  554. if (this.orderInfo.sypolicyno) {
  555. this.$api.letter
  556. .getPolicyPrint({
  557. companyId: this.orderInfo.id,
  558. policytype: "sy",
  559. })
  560. .then((res) => {
  561. //商业保单
  562. if (res.data) {
  563. let result = res.data.replace(/[\r\n]/g, "");
  564. let pdfBase64 = `data:application/pdf;base64,${result}`;
  565. base64ToPath(pdfBase64).then((path) => {
  566. if (path) {
  567. businessList.push({
  568. fileTitle: "商业电子保单",
  569. filename: this.orderInfo.sypolicyno,
  570. fileurl: path,
  571. });
  572. }
  573. });
  574. }
  575. });
  576. }
  577. break;
  578. case "华泰财险":
  579. if (this.orderInfo.jqpolicyno) {
  580. this.$api.letter
  581. .HuataigetPolicyPrint({
  582. companyId: this.orderInfo.id,
  583. riskCode: "0507",
  584. type: "2", //2:保单
  585. })
  586. .then((res) => {
  587. if (res.data) {
  588. if (res.data.jqxPolicyUrl) {
  589. this.oldfileList.push({
  590. fileTitle: "交强电子保单",
  591. filename: this.orderInfo.jqpolicyno,
  592. fileurl: res.data.jqxPolicyUrl,
  593. });
  594. }
  595. if (res.data.jqxFlagUrl) {
  596. this.oldfileList.push({
  597. fileTitle: "交强电子标志",
  598. filename: this.orderInfo.jqpolicyno,
  599. fileurl: res.data.jqxFlagUrl,
  600. });
  601. }
  602. } else {
  603. this.$message.error(res.msg);
  604. }
  605. });
  606. }
  607. if (this.orderInfo.sypolicyno) {
  608. this.$api.letter
  609. .HuataigetPolicyPrint({
  610. companyId: this.orderInfo.id,
  611. riskCode: "0510",
  612. type: "2", //2:保单
  613. })
  614. .then((res) => {
  615. if (res.data && res.data.syxPolicyUrl) {
  616. businessList.push({
  617. fileTitle: "商业电子保单",
  618. filename: this.orderInfo.sypolicyno,
  619. fileurl: res.data.syxPolicyUrl,
  620. });
  621. } else {
  622. this.$message.error(res.msg);
  623. }
  624. });
  625. }
  626. break;
  627. case "中煤财险":
  628. if (this.orderInfo.jqpolicyno) {
  629. this.$api.letter
  630. .ZhongmeigetPolicyPrint({
  631. companyId: this.orderInfo.id,
  632. riskCode: "0507",
  633. type: "2", //2:保单
  634. })
  635. .then((res) => {
  636. if (res.data && res.data[0]) {
  637. this.oldfileList.push({
  638. fileTitle: "交强电子保单",
  639. filename: this.orderInfo.jqpolicyno,
  640. fileurl: res.data[0],
  641. });
  642. } else {
  643. this.$message.error(res.msg);
  644. }
  645. });
  646. this.$api.letter
  647. .ZhongmeigetPolicyPrint({
  648. companyId: this.orderInfo.id,
  649. riskCode: "0507",
  650. type: "1", // 1:标志
  651. })
  652. .then((res) => {
  653. if (res.data && res.data[0]) {
  654. this.oldfileList.push({
  655. fileTitle: "交强电子标志",
  656. filename: this.orderInfo.jqpolicyno,
  657. fileurl: res.data[0],
  658. });
  659. } else {
  660. this.$message.error(res.msg);
  661. }
  662. });
  663. }
  664. if (this.orderInfo.sypolicyno) {
  665. this.$api.letter
  666. .ZhongmeigetPolicyPrint({
  667. companyId: this.orderInfo.id,
  668. riskCode: "0510",
  669. type: "2", //2:保单
  670. })
  671. .then((res) => {
  672. if (res.data && res.data[0]) {
  673. businessList.push({
  674. fileTitle: "商业电子保单",
  675. filename: this.orderInfo.sypolicyno,
  676. fileurl: res.data[0],
  677. });
  678. } else {
  679. this.$message.error(res.msg);
  680. }
  681. });
  682. }
  683. if (this.orderInfo.crossInsurance.length > 0) {
  684. this.orderInfo.crossInsurance.map((ele) => {
  685. this.$api.letter
  686. .ZhongmeigetPolicyPrint({
  687. ridePolicyNo: ele.ridePolicyNo,
  688. companyId: this.orderInfo.id,
  689. riskCode: "0513",
  690. type: "2", //2:保单
  691. })
  692. .then((res) => {
  693. if (res.code == 200 && res.data) {
  694. accidentList.push({
  695. fileTitle: "驾意险保单",
  696. filename: this.orderInfo.sypolicyno,
  697. fileurl: res.data[0],
  698. });
  699. } else {
  700. this.$message.error(res.msg);
  701. }
  702. });
  703. });
  704. }
  705. break;
  706. case "永诚财险":
  707. if (this.orderInfo.jqpolicyno) {
  708. this.$api.letter
  709. .yongchenggetPolicyPrint({
  710. companyId: this.orderInfo.id,
  711. riskCode: "0507",
  712. type: "2", //2:保单
  713. })
  714. .then((res) => {
  715. if (res.code == 200 && res.data) {
  716. if (res.data.jqUrl) {
  717. this.oldfileList.push({
  718. fileTitle: "交强电子保单",
  719. filename: this.orderInfo.jqpolicyno,
  720. fileurl: res.data.jqUrl,
  721. });
  722. }
  723. if (res.data.jqFlagUrl) {
  724. this.oldfileList.push({
  725. fileTitle: "交强电子标志",
  726. filename: this.orderInfo.jqpolicyno,
  727. fileurl: res.data.jqFlagUrl,
  728. });
  729. }
  730. } else {
  731. this.$message.error(res.msg);
  732. }
  733. });
  734. }
  735. if (this.orderInfo.sypolicyno) {
  736. this.$api.letter
  737. .yongchenggetPolicyPrint({
  738. companyId: this.orderInfo.id,
  739. riskCode: "0510",
  740. type: "2", //2:保单
  741. })
  742. .then((res) => {
  743. if (res.data && res.data.syUrl) {
  744. businessList.push({
  745. fileTitle: "商业电子保单",
  746. filename: this.orderInfo.sypolicyno,
  747. fileurl: res.data.syUrl,
  748. });
  749. } else {
  750. this.$message.error(res.msg);
  751. }
  752. });
  753. }
  754. if (this.orderInfo.crossInsurance.length > 0) {
  755. this.orderInfo.crossInsurance.map((ele) => {
  756. this.$api.letter
  757. .yongchenggetPolicyPrint({
  758. companyId: this.orderInfo.id,
  759. policyNumber: ele.policyNumber,
  760. riskCode: "0513",
  761. type: "2", //2:保单
  762. })
  763. .then((res) => {
  764. if (res.code == 200 && res.data) {
  765. accidentList.push({
  766. fileTitle: "驾意险保单",
  767. filename: ele.policyNumber,
  768. fileurl: res.data.jyUrl,
  769. });
  770. } else {
  771. this.$message.error(res.msg);
  772. }
  773. });
  774. });
  775. }
  776. break;
  777. case "国任财险":
  778. if (this.orderInfo.jqpolicyno) {
  779. this.$api.letter
  780. .guoRengetPolicyPrint({
  781. companyId: this.orderInfo.id,
  782. riskCode: "0507",
  783. type: "2", //2:保单
  784. })
  785. .then((res) => {
  786. if (res.data) {
  787. this.oldfileList.push({
  788. fileTitle: "交强电子保单",
  789. filename: this.orderInfo.jqpolicyno,
  790. fileurl: res.data,
  791. });
  792. } else {
  793. this.$message.error(res.msg);
  794. }
  795. });
  796. this.$api.letter
  797. .guoRengetPolicyPrint({
  798. companyId: this.orderInfo.id,
  799. riskCode: "0507",
  800. type: "1", //1:标志
  801. })
  802. .then((res) => {
  803. if (res.data) {
  804. this.oldfileList.push({
  805. fileTitle: "交强电子标志",
  806. filename: this.orderInfo.jqpolicyno,
  807. fileurl: res.data,
  808. });
  809. } else {
  810. this.$message.error(res.msg);
  811. }
  812. });
  813. }
  814. if (this.orderInfo.sypolicyno) {
  815. this.$api.letter
  816. .guoRengetPolicyPrint({
  817. companyId: this.orderInfo.id,
  818. riskCode: "0510",
  819. type: "2", //2:保单
  820. })
  821. .then((res) => {
  822. if (res.data) {
  823. businessList.push({
  824. fileTitle: "商业电子保单",
  825. filename: this.orderInfo.sypolicyno,
  826. fileurl: res.data,
  827. });
  828. } else {
  829. this.$message.error(res.msg);
  830. }
  831. });
  832. }
  833. if (this.orderInfo.crossInsurance.length > 0) {
  834. this.orderInfo.crossInsurance.map((ele) => {
  835. this.$api.letter
  836. .guoRengetPolicyPrint({
  837. companyId: this.orderInfo.id,
  838. policyNumber: ele.policyNumber,
  839. riskCode: "0513",
  840. type: "2", //2:保单
  841. })
  842. .then((res) => {
  843. if (res.data) {
  844. accidentList.push({
  845. fileTitle: "驾意险保单",
  846. filename: ele.policyNumber,
  847. fileurl: res.data,
  848. });
  849. } else {
  850. this.$message.error(res.msg);
  851. }
  852. });
  853. });
  854. }
  855. break;
  856. case "紫金财险":
  857. if (this.orderInfo.jqpolicyno) {
  858. this.$api.letter
  859. .zijingetPolicyPrint({
  860. companyId: this.orderInfo.id,
  861. riskCode: "0507",
  862. type: "2", //2:保单
  863. })
  864. .then((res) => {
  865. if (res.data) {
  866. this.oldfileList.push({
  867. fileTitle: "交强电子保单",
  868. filename: this.orderInfo.jqpolicyno,
  869. fileurl: res.data,
  870. });
  871. } else {
  872. this.$message.error(res.msg);
  873. }
  874. });
  875. this.$api.letter
  876. .zijingetPolicyPrint({
  877. companyId: this.orderInfo.id,
  878. riskCode: "0507",
  879. type: "1", //1:标志
  880. })
  881. .then((res) => {
  882. if (res.data) {
  883. this.oldfileList.push({
  884. fileTitle: "交强电子标志",
  885. filename: this.orderInfo.jqpolicyno,
  886. fileurl: res.data,
  887. });
  888. } else {
  889. this.$message.error(res.msg);
  890. }
  891. });
  892. }
  893. if (this.orderInfo.sypolicyno) {
  894. this.$api.letter
  895. .zijingetPolicyPrint({
  896. companyId: this.orderInfo.id,
  897. riskCode: "0510",
  898. type: "2", //2:保单
  899. })
  900. .then((res) => {
  901. if (res.data) {
  902. businessList.push({
  903. fileTitle: "商业电子保单",
  904. filename: this.orderInfo.sypolicyno,
  905. fileurl: res.data,
  906. });
  907. } else {
  908. this.$message.error(res.msg);
  909. }
  910. });
  911. }
  912. if (this.orderInfo.crossInsurance.length > 0) {
  913. this.orderInfo.crossInsurance.map((ele) => {
  914. this.$api.letter
  915. .zijingetPolicyPrint({
  916. companyId: this.orderInfo.id,
  917. policyNumber: ele.policyNumber,
  918. riskCode: "0513",
  919. type: "2", //2:保单
  920. })
  921. .then((res) => {
  922. if (res.data) {
  923. accidentList.push({
  924. fileTitle: "驾意险保单",
  925. filename: ele.policyNumber,
  926. fileurl: res.data,
  927. });
  928. } else {
  929. this.$message.error(res.msg);
  930. }
  931. });
  932. });
  933. }
  934. break;
  935. case "渤海财险":
  936. if (this.orderInfo.jqpolicyno) {
  937. this.$api.letter
  938. .getPolicyPrintboHai({
  939. companyId: this.orderInfo.id,
  940. })
  941. .then((res) => {
  942. if (res.code == 200 && res.data) {
  943. if (res.data.jqxPolicyUrl) {
  944. this.oldfileList.push({
  945. fileTitle: "交强电子保单",
  946. filename: this.orderInfo.jqpolicyno,
  947. fileurl: res.data.jqxPolicyUrl,
  948. });
  949. }
  950. if (res.data.jqxFlagUrl) {
  951. this.oldfileList.push({
  952. fileTitle: "交强电子标志",
  953. filename: this.orderInfo.jqpolicyno,
  954. fileurl: res.data.jqxFlagUrl,
  955. });
  956. }
  957. if (res.data.syxPolicyUrl) {
  958. businessList.push({
  959. fileTitle: "商业电子保单",
  960. filename: this.orderInfo.sypolicyno,
  961. fileurl: res.data.syxPolicyUrl,
  962. });
  963. }
  964. if (
  965. res.data.jyxInfoList &&
  966. res.data.jyxInfoList.length > 0
  967. ) {
  968. res.data.jyxInfoList.forEach((val) => {
  969. accidentList.push({
  970. fileTitle: "驾意险保单",
  971. filename: "驾意险保单",
  972. fileurl: val.jyx_policy_url,
  973. });
  974. });
  975. }
  976. } else {
  977. this.$message.error(res.msg);
  978. }
  979. });
  980. }
  981. break;
  982. case "恒邦财险":
  983. case "安盛天平":
  984. case "中国人寿":
  985. case "太平财险":
  986. case "华农财险":
  987. case "众安财险":
  988. if (this.orderInfo.jqpolicyno || this.orderInfo.sypolicyno) {
  989. this.$api.letter
  990. .pythongetPolicyPrint({
  991. subOrderNo: this.orderInfo.id,
  992. })
  993. .then((res) => {
  994. if (res.code == 200 && res.data) {
  995. if (res.data.jqxPolicyUrl) {
  996. this.oldfileList.push({
  997. fileTitle: "交强电子保单",
  998. filename: this.orderInfo.jqpolicyno,
  999. fileurl: res.data.jqxPolicyUrl,
  1000. });
  1001. }
  1002. if (res.data.jqxFlagUrl) {
  1003. this.oldfileList.push({
  1004. fileTitle: "交强电子标志",
  1005. filename: this.orderInfo.jqpolicyno,
  1006. fileurl: res.data.jqxFlagUrl,
  1007. });
  1008. }
  1009. if (res.data.syxPolicyUrl) {
  1010. businessList.push({
  1011. fileTitle: "商业电子保单",
  1012. filename: this.orderInfo.sypolicyno,
  1013. fileurl: res.data.syxPolicyUrl,
  1014. });
  1015. }
  1016. if (
  1017. res.data.jyxInfoList &&
  1018. res.data.jyxInfoList.length > 0
  1019. ) {
  1020. res.data.jyxInfoList.forEach((val) => {
  1021. accidentList.push({
  1022. fileTitle: "驾意险保单",
  1023. filename: "驾意险保单",
  1024. fileurl: val.jyx_policy_url,
  1025. });
  1026. });
  1027. }
  1028. } else {
  1029. this.$message.error(res.msg);
  1030. }
  1031. });
  1032. }
  1033. break;
  1034. case "大家财险":
  1035. if (this.orderInfo.jqpolicyno) {
  1036. this.$api.letter
  1037. .obtainWarranty({
  1038. companyId: this.orderInfo.id,
  1039. riskCode: "0507",
  1040. type: "2", //2:保单
  1041. })
  1042. .then((res) => {
  1043. if (res.data) {
  1044. this.oldfileList.push({
  1045. fileTitle: "交强电子保单",
  1046. filename: this.orderInfo.jqpolicyno,
  1047. fileurl: res.data,
  1048. });
  1049. } else {
  1050. this.$message.error(res.msg);
  1051. }
  1052. });
  1053. this.$api.letter
  1054. .obtainWarranty({
  1055. companyId: this.orderInfo.id,
  1056. riskCode: "0507",
  1057. type: "1", //1:标志
  1058. })
  1059. .then((res) => {
  1060. if (res.data) {
  1061. this.oldfileList.push({
  1062. fileTitle: "交强电子标志",
  1063. filename: this.orderInfo.jqpolicyno,
  1064. fileurl: res.data,
  1065. });
  1066. } else {
  1067. this.$message.error(res.msg);
  1068. }
  1069. });
  1070. }
  1071. if (this.orderInfo.sypolicyno) {
  1072. this.$api.letter
  1073. .obtainWarranty({
  1074. companyId: this.orderInfo.id,
  1075. riskCode: "0510",
  1076. type: "2", //2:保单
  1077. })
  1078. .then((res) => {
  1079. if (res.data) {
  1080. businessList.push({
  1081. fileTitle: "商业电子保单",
  1082. filename: this.orderInfo.sypolicyno,
  1083. fileurl: res.data,
  1084. });
  1085. }
  1086. });
  1087. }
  1088. if (this.orderInfo.crossInsurance.length > 0) {
  1089. this.orderInfo.crossInsurance.map((ele) => {
  1090. this.$api.letter
  1091. .zijingetPolicyPrint({
  1092. companyId: this.orderInfo.id,
  1093. policyNumber: ele.policyNumber,
  1094. riskCode: "0513",
  1095. type: "2", //2:保单
  1096. })
  1097. .then((res) => {
  1098. if (res.data) {
  1099. accidentList.push({
  1100. fileTitle: "驾意险保单",
  1101. filename: ele.policyNumber,
  1102. fileurl: res.data,
  1103. });
  1104. } else {
  1105. this.$message.error(res.msg);
  1106. }
  1107. });
  1108. });
  1109. }
  1110. break;
  1111. default:
  1112. }
  1113. }
  1114. let obj = {
  1115. oldfileList: this.oldfileList,
  1116. businessList,
  1117. accidentList
  1118. }
  1119. this.$refs.detailsDialog.warrantyFun(obj);
  1120. }
  1121. },
  1122. ImageList() {
  1123. this.carImageList = [];
  1124. this.ownerImageList = []; //车主影像
  1125. this.policyImageList = []; //投保人影像
  1126. this.insuredImageList = []; //被保人影像
  1127. this.carCheckImageList = []; //验车照影像
  1128. // 获取影像
  1129. this.$api.letter.findByQuoteNo(this.orderInfo.quoteno).then((resImage) => {
  1130. Object.keys(resImage.data).forEach((keys) => {
  1131. if (resImage.data[keys]) {
  1132. resImage.data[keys].url = resImage.data[keys].url
  1133. ? process.env.BASE_URL + resImage.data[keys].url
  1134. : null;
  1135. switch (keys) {
  1136. case "C01":
  1137. case "D01":
  1138. resImage.data[keys].url
  1139. ? this.carImageList.push(resImage.data[keys].url)
  1140. : "";
  1141. break;
  1142. case "C02":
  1143. case "D02":
  1144. resImage.data[keys].url
  1145. ? this.ownerImageList.push(resImage.data[keys].url)
  1146. : "";
  1147. break;
  1148. case "C03":
  1149. case "D03":
  1150. resImage.data[keys].url
  1151. ? this.policyImageList.push(resImage.data[keys].url)
  1152. : "";
  1153. break;
  1154. case "C04":
  1155. case "D04":
  1156. resImage.data[keys].url
  1157. ? this.insuredImageList.push(resImage.data[keys].url)
  1158. : "";
  1159. break;
  1160. case "XC00":
  1161. case "GC00":
  1162. case "GX00":
  1163. resImage.data[keys].url
  1164. ? this.carCheckImageList.push(resImage.data[keys].url)
  1165. : "";
  1166. break;
  1167. default:
  1168. break;
  1169. }
  1170. }
  1171. });
  1172. let obj = {
  1173. carImageList: this.carImageList,
  1174. ownerImageList: this.ownerImageList,
  1175. policyImageList: this.policyImageList,
  1176. insuredImageList: this.insuredImageList,
  1177. carCheckImageList: this.carCheckImageList
  1178. }
  1179. this.$refs.detailsDialog.imageFun(obj);
  1180. });
  1181. },
  1182. toChinesNum(num) {
  1183. if (num.toString().length == 4) {
  1184. let overQian = Math.floor(num / 1000);
  1185. let result = overQian + "千";
  1186. return result;
  1187. } else {
  1188. let overWan = Math.floor(num / 10000);
  1189. let result = overWan + "万";
  1190. return result;
  1191. }
  1192. },
  1193. useridFormatter(row, column) {
  1194. let data = row.username + `(${row.userid})`
  1195. return data;
  1196. },
  1197. managementSourceFormatter(row, column) {
  1198. let managementSource = row.managementSource;
  1199. switch (managementSource) {
  1200. case '渠道':
  1201. return <el-tag>渠道</el-tag>
  1202. case '个代':
  1203. return <el-tag type="success">个代</el-tag>
  1204. case '电销':
  1205. return <el-tag type="warning">电销</el-tag>
  1206. default:
  1207. }
  1208. },
  1209. isExternalFormatter(row, column) {
  1210. let isExternal = row.isExternal;
  1211. switch (isExternal) {
  1212. case 1:
  1213. return '是'
  1214. case 0:
  1215. return '否'
  1216. default:
  1217. }
  1218. },
  1219. trajectory(row){
  1220. this.$api.letter.queryBySuborder(row.subOrderId).then((res) => {
  1221. if (res.code == 200 && res.data.length > 0) {
  1222. this.ddgjdialogVisible = true;
  1223. this.trajectoryTable = res.data;
  1224. } else {
  1225. this.$message({
  1226. message: res.msg || "暂无数据!",
  1227. type: "warning",
  1228. });
  1229. }
  1230. });
  1231. },
  1232. cancelorder(item) {
  1233. this.$api.letter.zijincancelorder({ companyId: item.subOrderId }).then(res => {
  1234. if (res.code == 200) {
  1235. this.$message({
  1236. message: res.msg,
  1237. type: "success"
  1238. });
  1239. this.findPage();
  1240. }
  1241. else{
  1242. this.$message.error(res.msg)
  1243. }
  1244. });
  1245. },
  1246. // 撤销二维码
  1247. revokeCode(row) {
  1248. this.$api.letter.getRevokeQrCode(row.subOrderId).then(res => {
  1249. if (res.code == 200) {
  1250. this.$message({
  1251. message: res.msg,
  1252. type: "success"
  1253. });
  1254. this.findPage();
  1255. }
  1256. });
  1257. },
  1258. //查询缴费状态
  1259. refreshStatus(item) {
  1260. let inscompany = {
  1261. 国任财险: "updateOrderInfoGuoren",
  1262. 华泰财险: "orderStatushuatai",
  1263. 大家财险: "updateOrderInfoDajia",
  1264. 中煤财险: "orderStatuszhongmei",
  1265. 太平财险: "auditStatusQuery",
  1266. 华农财险: "auditStatusQuery",
  1267. 恒邦财险: "auditStatusQuery",
  1268. 众安财险: "auditStatusQuery",
  1269. 中国人寿: "auditStatusQuery",
  1270. 安盛天平: "auditStatusQuery",
  1271. 紫金财险: "auditStatusQueryZijin",
  1272. 渤海财险: "orderStatusbohai"
  1273. };
  1274. Object.keys(inscompany).forEach(val => {
  1275. if (val == item.insCompany) {
  1276. this.$api.letter[inscompany[val]]({ companyId: item.subOrderId }).then(
  1277. res => {
  1278. if (res.code == 200) {
  1279. this.$message({
  1280. message: res.msg ? res.msg : "已刷新状态",
  1281. type: "success"
  1282. });
  1283. this.findPage();
  1284. } else {
  1285. this.$message({
  1286. showClose: true,
  1287. dangerouslyUseHTMLString: true,
  1288. message: res.msg.replace(/\n/g, "<br><br>"),
  1289. type: "error",
  1290. duration: 7000
  1291. });
  1292. }
  1293. }
  1294. );
  1295. }
  1296. });
  1297. if (item.insCompany == "永诚财险") {
  1298. this.$api.letter.orderStatusyongcheng(item.subOrderId).then(res => {
  1299. if (res.code == 200) {
  1300. this.$message({
  1301. message: res.msg ? res.msg : "已刷新状态",
  1302. type: "success"
  1303. });
  1304. this.findPage();
  1305. } else {
  1306. this.$message({
  1307. showClose: true,
  1308. dangerouslyUseHTMLString: true,
  1309. message: res.msg.replace(/\n/g, "<br><br>"),
  1310. type: "error",
  1311. duration: 7000
  1312. });
  1313. }
  1314. });
  1315. }
  1316. if (item.insCompany == "华泰财险") {
  1317. let HtApiType =
  1318. item.apiType == 2
  1319. ? "auditStatusQuery"
  1320. : "orderStatushuatai";
  1321. this.$api.letter[HtApiType](item.subOrderId).then(res => {
  1322. if (res.code == 200) {
  1323. this.$message({
  1324. message: res.msg ? res.msg : "已刷新状态",
  1325. type: "success"
  1326. });
  1327. this.findPage();
  1328. } else {
  1329. this.$message({
  1330. showClose: true,
  1331. dangerouslyUseHTMLString: true,
  1332. message: res.msg.replace(/\n/g, "<br><br>"),
  1333. type: "error",
  1334. duration: 7000
  1335. });
  1336. }
  1337. });
  1338. }
  1339. },
  1340. }
  1341. }