settlementInfo_body.html 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  1. <!DOCTYPE html>
  2. <html class="">
  3. <!--STATUS OK-->
  4. <head>
  5. <meta name="referrer" content="always" />
  6. <meta charset='utf-8' />
  7. <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
  8. <meta http-equiv="x-dns-prefetch-control" content="on">
  9. <meta name="description" content="">
  10. <meta name="format-detection" content="telephone=no" />
  11. <link rel="stylesheet" type="text/css" href="css/vant-ui.css" />
  12. <link rel="stylesheet" type="text/css" href="css/iconfont.css">
  13. <link rel="stylesheet" type="text/css" href="css/main.css" />
  14. <script src="js/vue.js"></script>
  15. <script src="js/vant-ui.js"></script>
  16. <script src="js/main.js"></script>
  17. <title></title>
  18. </head>
  19. <style>
  20. .uploadImg {
  21. width: 1.5rem !important;
  22. height: 1.5rem !important;
  23. margin: 1rem auto;
  24. }
  25. </style>
  26. <body>
  27. <div id="app" v-cloak>
  28. <div class="pageView peifuxiangqing">
  29. <div class="">
  30. <div class="userInfos card">
  31. <div class="title"></div>
  32. <div class="Forms">
  33. <div class="item flex a-center">
  34. <div class="label flex a-center">
  35. <div class="icon i1"></div>
  36. 门店名称:
  37. </div>
  38. <div class="value">
  39. <input type="text" placeholder="" v-model="tlementInfo.storeName" readonly="readonly">
  40. </div>
  41. <van-icon name="checked" size="0.3rem" color="#00a0ea" />
  42. </div>
  43. <div class="item flex a-center">
  44. <div class="label flex a-center">
  45. <div class="icon i2"></div>
  46. 联系人:
  47. </div>
  48. <div class="value">
  49. <input type="text" placeholder="" readonly="readonly" v-model="tlementInfo.telName">
  50. </div>
  51. <van-icon name="checked" size="0.3rem" color="#00a0ea" />
  52. </div>
  53. <div class="item flex a-center">
  54. <div class="label flex a-center">
  55. <div class="icon i3"></div>
  56. 联系电话:
  57. </div>
  58. <div class="value">
  59. <input type="number" placeholder="" readonly="readonly" v-model="tlementInfo.telephone">
  60. </div>
  61. <van-icon name="checked" size="0.3rem" color="#00a0ea" />
  62. </div>
  63. <div class="item flex a-center">
  64. <div class="label flex a-center">
  65. <div class="icon i4"></div>
  66. 车牌号:
  67. </div>
  68. <div class="value">
  69. <input type="text" placeholder="" readonly="readonly" v-model="tlementInfo.plateNumber">
  70. </div>
  71. <van-icon name="checked" size="0.3rem" color="#00a0ea" />
  72. </div>
  73. </div>
  74. </div>
  75. <div class="card court" style="margin-top: 0.2rem;">
  76. <div class="title">
  77. 轮胎信息
  78. </div>
  79. <div class="Forms">
  80. <div class="item flex a-center">
  81. <div class="label flex a-center">
  82. 轮胎胎号:
  83. </div>
  84. <div class="value">
  85. {{ tlementInfo.tireDtoList ? tlementInfo.tireDtoList[0].tireNum : '' }}
  86. </div>
  87. </div>
  88. <div class="item flex a-center">
  89. <div class="label flex a-center">
  90. 轮胎规格:
  91. </div>
  92. <div class="value">
  93. {{ tlementInfo.tireDtoList ? tlementInfo.tireDtoList[0].spec : '' }}
  94. </div>
  95. </div>
  96. <div class="item flex a-center">
  97. <div class="label flex a-center">
  98. 轮胎DOT:
  99. </div>
  100. <div class="value">
  101. {{ tlementInfo.tireDtoList ? tlementInfo.tireDtoList[0].dot : '' }}
  102. </div>
  103. </div>
  104. <div class="item flex a-center">
  105. <div class="label flex a-center">
  106. 余花深:
  107. </div>
  108. <div class="value" style="display:flex">
  109. <input type="number" placeholder="请输入余花深" style="width:80%" v-model="leftDept" v-on:input="onInput" />
  110. <p style="width:20%">毫米</p>
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. <!-- <div class="card court" style="margin-top: 0.2rem;" v-for="(img,index) in tlementInfo.carFileDtoList" v-show="img.type == 2 || img.type == 3">
  116. <div class="title">
  117. {{ ['','','行驶证照片','车辆照片'][img.type] }}
  118. </div>
  119. <div class="fileImage" v-show="img.type == 2" >
  120. <img v-if="img.url == '' || !img.url" src="./image/usercar.jpg" />
  121. <img v-else :src="img.url" />
  122. </div>
  123. <div class="fileImage" v-show="img.type == 3" v-on:click="chooseCarNetoImg">
  124. <img v-if="img.url == '' || !img.url" src="./image/car.png" />
  125. <img v-else :src="img.url" />
  126. </div>
  127. </div> -->
  128. <div class="card court" style="margin-top: 0.2rem;" v-for="(img,index) in imgTypes">
  129. <div class="title">
  130. <div>
  131. {{ img.name }}
  132. </div>
  133. </div>
  134. <div class="fileImage" v-on:click="chooseImg(img.type,index)" v-show="parseInt(img.type) < 2">
  135. <img v-if="!img.url || img.url == ''" :src="getImg(img.type)" />
  136. <img v-else :src="img.url" />
  137. </div>
  138. <div class="fileImage" v-on:click="chooseUserCarPho" v-show="parseInt(img.type) == 2">
  139. <img v-if="!img.url || img.url == ''" src="./image/usercar.jpg" />
  140. <img v-else :src="img.url" />
  141. </div>
  142. <div class="fileImage" v-on:click="chooseCarNetoImg" v-show="parseInt(img.type) == 3">
  143. <img v-if="!img.url || img.url == ''" src="./image/car.png" />
  144. <img v-else :src="img.url" />
  145. </div>
  146. <div class="fileImage" v-on:click="chooseCarNetoDot" v-show="parseInt(img.type) == 4">
  147. <img v-if="!img.url || img.url == ''" src="./image/dot.png" />
  148. <img v-else :src="img.url" />
  149. </div>
  150. </div>
  151. <div class="nextFoot flex a-center" style="border-radius: 5px !important;">
  152. <div class="nextBtns2 flex a-center j-center" v-on:click="cancelLipei">
  153. 取消提交
  154. </div>
  155. <div class="nextBtns1 flex a-center j-center" v-on:click="sumbiltLipei">
  156. 确认提交
  157. </div>
  158. </div>
  159. <input accept="image/x-png,image/gif,image/jpeg,image/bmp" class="change" id="files2" type="file" multiple="multiple" style="width: 0px;height : 0px;opacity: 1" onchange="changePhoto(event)" />
  160. </div>
  161. </div>
  162. </div>
  163. </body>
  164. <script type="text/javascript" src="../script/aui_compress.min.js"></script>
  165. <script type="text/javascript" src="../script/jquery-1.11.0.min.js"></script>
  166. <script type="text/javascript" src="../script/api.js"></script>
  167. <script type="text/javascript" src="../script/httpRequest.js"></script>
  168. <script type="text/javascript" src="../script/vue_plugins.js"></script>
  169. <script type="text/javascript">
  170. var cm = "";
  171. apiready = function() {
  172. var code = api.pageParam.code;
  173. cm = new Vue({
  174. el: '#app',
  175. data: {
  176. list: [],
  177. code: code,
  178. tlementInfo: {}, // 理赔单详情
  179. userid: '',
  180. chooseImgIndex: 0, // 选择图片的index
  181. chooseImgCode: 0, // 选择图片的code
  182. userPhotos: [], // 车辆照片和行驶证照片
  183. imgTypes: [{
  184. name: "轮胎整体照片",
  185. type: "0"
  186. }, {
  187. name: "鼓包或爆胎位置照片",
  188. type: "1"
  189. },{
  190. name: "行驶证照片",
  191. type: "2"
  192. },{
  193. name: "车辆照片",
  194. type: "3"
  195. },{
  196. name: "DOT周期号照片",
  197. type: "4"
  198. }],
  199. trans: '', // 转换格式插件
  200. leftDept: '', // 余华深
  201. },
  202. computed: {
  203. getImg: function() {
  204. return function(type) {
  205. return 'image/upload' + type + '.png';
  206. }
  207. },
  208. getImgCar: function() {
  209. return function(type) {
  210. return 'image/upload' + type + '.png';
  211. }
  212. }
  213. },
  214. methods: {
  215. // 通过码号获取理赔单详情
  216. init: function() {
  217. this.userid = $api.getStorage('userid');
  218. this.trans = api.require('trans');
  219. this.getInfoByCode();
  220. },
  221. // 通过code获取理赔单详情
  222. getInfoByCode: function() {
  223. var url = "getLipeiInfoU",
  224. _this = this;
  225. var data = {
  226. "storeId": this.userid,
  227. "orderno": this.code,
  228. "url": "json",
  229. "type": "body"
  230. }
  231. this.$post(url, data, function(ret) {
  232. console.log(JSON.stringify(ret));
  233. if (ret.code == 0 || ret.code == '0') {
  234. _this.tlementInfo = ret.data;
  235. // if (ret.data.carFileDtoList.length == 1) {
  236. // ret.data.carFileDtoList.push({
  237. // "realName": "照片1",
  238. // "fileName": "行驶证照片",
  239. // "type": "2",
  240. // "url": ""
  241. // })
  242. // ret.data.carFileDtoList.push({
  243. // "realName": "照片2",
  244. // "fileName": "车辆照片",
  245. // "type": "3",
  246. // "url": ""
  247. // })
  248. // }
  249. _this.extend(_this.tlementInfo, {
  250. "storeId": $api.getStorage('userid'),
  251. "storeName": $api.getStorage('storeName'),
  252. "kunnr": $api.getStorage('kunnr'),
  253. })
  254. } else {
  255. api.alert({
  256. title: '温馨提示',
  257. msg: ret.msg,
  258. }, function(ret, err){
  259. if( ret ){
  260. api.closeWin({});
  261. }
  262. });
  263. }
  264. })
  265. },
  266. onInput:function(){
  267. if(this.leftDept<0){
  268. this.leftDept=0;
  269. api.toast({
  270. msg: '请输入非负数'
  271. })
  272. }
  273. },
  274. cancelLipei: function() {
  275. api.closeWin({});
  276. },
  277. // 选择行驶证照片
  278. chooseUserCarPho: function() {
  279. var _this = this;
  280. this.ifHasPrme('storage', function(ret) {
  281. if (ret == true) {
  282. _this.ifHasPrme('camera', function(res) {
  283. if (res == true) {
  284. _this.chooseImage_onlycamer(function(ret) {
  285. changePhoto2(ret);
  286. })
  287. }
  288. })
  289. }
  290. })
  291. },
  292. // 选择车辆照片
  293. chooseCarNetoImg: function() {
  294. var _this = this;
  295. this.ifHasPrme('storage', function(ret) {
  296. if (ret == true) {
  297. _this.ifHasPrme('camera', function(res) {
  298. if (res == true) {
  299. _this.chooseImage_onlycamer(function(ret) {
  300. changePhoto3(ret);
  301. })
  302. }
  303. })
  304. }
  305. })
  306. },
  307. //选择DOT照片
  308. chooseCarNetoDot: function() {
  309. var _this = this;
  310. this.ifHasPrme('storage', function(ret) {
  311. if (ret == true) {
  312. _this.ifHasPrme('camera', function(res) {
  313. if (res == true) {
  314. _this.chooseImage_onlycamer(function(ret) {
  315. changePhoto4(ret);
  316. })
  317. }
  318. })
  319. }
  320. })
  321. },
  322. // 选择图片
  323. chooseImg: function(type, index) {
  324. var _this = this;
  325. this.chooseImgCode = type;
  326. this.chooseImgIndex = index;
  327. this.ifHasPrme('storage', function(ret) {
  328. if (ret == true) {
  329. _this.ifHasPrme('camera', function(res) {
  330. if (res == true) {
  331. _this.chooseImage_onlycamer(function(ret) {
  332. changePhoto(ret);
  333. })
  334. }
  335. })
  336. }
  337. })
  338. // $('#files2').click();
  339. },
  340. //上传DOT照片
  341. uploadFile4 : function(ret){
  342. var _this = this;
  343. ret.data.url = ret.data.url
  344. _this.imgTypes.map(function(img, index) {
  345. if (img.type == 4 || img.type == '4') {
  346. _this.$set(_this.imgTypes[index], 'carImg', ret.data);
  347. _this.$set(_this.imgTypes[index], 'url', ret.data.url);
  348. }
  349. })
  350. },
  351. // 上传车辆照片
  352. uploadFile3 : function(ret){
  353. var _this = this;
  354. ret.data.url = ret.data.url
  355. _this.imgTypes.map(function(img, index) {
  356. if (img.type == 3 || img.type == '3') {
  357. _this.$set(_this.imgTypes[index], 'carImg', ret.data);
  358. _this.$set(_this.imgTypes[index], 'url', ret.data.url);
  359. }
  360. })
  361. },
  362. // 上传行驶证图片
  363. uploadFile2: function(ret) {
  364. var _this = this;
  365. ret.data.url = ret.data.url
  366. _this.imgTypes.map(function(img, index) {
  367. if (img.type == 2 || img.type == '2') {
  368. _this.$set(_this.imgTypes[index], 'carImg', ret.data);
  369. _this.$set(_this.imgTypes[index], 'url', ret.data.url);
  370. }
  371. })
  372. },
  373. // 开始上传照片
  374. uploadFile1: function(ret) {
  375. var _this = this;
  376. ret.data.url = ret.data.url
  377. _this.imgTypes.map(function(img, index) {
  378. if (img.type == 0 || img.type == '0') {
  379. _this.$set(_this.imgTypes[index], 'carImg', ret.data);
  380. _this.$set(_this.imgTypes[index], 'url', ret.data.url);
  381. }
  382. })
  383. },
  384. // 开始上传照片
  385. uploadFile: function(ret) {
  386. var _this = this;
  387. this.$set(_this.imgTypes[_this.chooseImgIndex], "carImg", ret.data);
  388. this.$set(_this.imgTypes[_this.chooseImgIndex], "url", ret.data.url);
  389. },
  390. // 提交轮胎包理赔记录
  391. sumbiltLipei: function() {
  392. for(var i = 0;i<this.imgTypes.length;i++){
  393. if(!this.imgTypes[i].url || this.imgTypes[i].url == ''){
  394. api.toast({
  395. msg : '请上传' + this.imgTypes[i].name
  396. })
  397. return;
  398. }
  399. }
  400. if (this.leftDept == '') {
  401. api.toast({
  402. msg: '请输入余花深信息'
  403. })
  404. return;
  405. }
  406. var url = "sumbiltLipeiU",
  407. _this = this;
  408. var data = {
  409. "storeId": this.tlementInfo.storeId,
  410. "storeName": this.tlementInfo.storeName,
  411. "kunnr": this.tlementInfo.kunnr,
  412. "telName": this.tlementInfo.telName,
  413. "telephone": this.tlementInfo.telephone,
  414. "operatingType": this.tlementInfo.operatingType,
  415. "plateNumber": this.tlementInfo.plateNumber,
  416. "orderno": this.tlementInfo.orderno,
  417. "tireNum": this.tlementInfo.tireDtoList[0].tireNum,
  418. "brand": this.tlementInfo.tireDtoList[0].brand,
  419. "spec": this.tlementInfo.tireDtoList[0].spec,
  420. "pattern": this.tlementInfo.tireDtoList[0].pattern,
  421. "dot": this.tlementInfo.tireDtoList[0].dot,
  422. "plyRating": this.tlementInfo.tireDtoList[0].plyRating,
  423. "matnr": this.tlementInfo.tireDtoList[0].matnr,
  424. "leftDepth": this.leftDept,
  425. "maktx": this.tlementInfo.tireDtoList[0].maktx,
  426. "carFileDtoList": this.tlementInfo.carFileDtoList,
  427. "policyStart":this.tlementInfo.startDate,
  428. "policyEnd":this.tlementInfo.endDate,
  429. "taihaoUrl":this.tlementInfo.tireDtoList[0].taihaoUrl,
  430. }
  431. var policyFileDtoList = new Array();
  432. this.imgTypes.map(function(img, index) {
  433. if (img.carImg != null) {
  434. policyFileDtoList.push(img.carImg);
  435. }
  436. })
  437. var other = {
  438. policyFileDtoList: policyFileDtoList,
  439. url: 'json',
  440. type: 'body'
  441. }
  442. data = this.extend(data, other);
  443. console.log(JSON.stringify(data));
  444. this.$post(url, data, function(ret) {
  445. if (ret.code == 0 || ret.code == '0') {
  446. api.toast({
  447. msg: '理赔单审核成功'
  448. });
  449. setTimeout(function() {
  450. _this.closeWin({});
  451. }, 500);
  452. }
  453. })
  454. }
  455. },
  456. mounted: function() {
  457. this.init();
  458. }
  459. })
  460. }
  461. /**
  462. * 这是门店图片更改触发时间.target.files[0]
  463. */
  464. function changePhoto(event) {
  465. var url = "uploadLipeU";
  466. var data = {
  467. type: cm.chooseImgCode,
  468. file: event,
  469. }
  470. cm.$uploadfile(url, data, function(ret) {
  471. if (ret.code == 0 || ret.code == '0') {
  472. cm.uploadFile(ret)
  473. }
  474. })
  475. }
  476. //上传DOT
  477. function changePhoto4(event) {
  478. var url = "uploadLipeU";
  479. var data = {
  480. type: 4,
  481. file: event,
  482. }
  483. cm.$uploadfile(url, data, function(ret) {
  484. if (ret.code == 0 || ret.code == '0') {
  485. cm.uploadFile4(ret)
  486. }
  487. })
  488. }
  489. // 上传行驶证照片
  490. function changePhoto3(event) {
  491. var url = "uploadLipeU";
  492. var data = {
  493. type: 3,
  494. file: event,
  495. }
  496. cm.$uploadfile(url, data, function(ret) {
  497. if (ret.code == 0 || ret.code == '0') {
  498. cm.uploadFile3(ret)
  499. }
  500. })
  501. // var url = "uploadUserCarU";
  502. // var data = {
  503. // type: 1,
  504. // file: event,
  505. // },
  506. // _this = this;
  507. // cm.$uploadfile(url, data, function(ret) {
  508. // if (ret.code == 0 || ret.code == '0') {
  509. // cm.uploadFile2(ret)
  510. // }
  511. // })
  512. }
  513. // 上传行驶证照片
  514. function changePhoto2(event) {
  515. var url = "uploadLipeU";
  516. var data = {
  517. type: 2,
  518. file: event,
  519. }
  520. cm.$uploadfile(url, data, function(ret) {
  521. if (ret.code == 0 || ret.code == '0') {
  522. cm.uploadFile2(ret)
  523. }
  524. })
  525. // var url = "uploadUserCarU";
  526. // var data = {
  527. // type: 1,
  528. // file: event,
  529. // },
  530. // _this = this;
  531. // cm.$uploadfile(url, data, function(ret) {
  532. // if (ret.code == 0 || ret.code == '0') {
  533. // cm.uploadFile2(ret)
  534. // }
  535. // })
  536. }
  537. // 上传车辆照片
  538. function changePhoto1(event) {
  539. var url = "uploadCarPhotoU";
  540. var data = {
  541. type: 1,
  542. file: event,
  543. }
  544. cm.$uploadfile(url, data, function(ret) {
  545. if (ret.code == 0 || ret.code == '0') {
  546. cm.uploadFile1(ret)
  547. }
  548. })
  549. }
  550. // 上传文件
  551. function uploadFile(src) {
  552. api.ajax({
  553. url: "http://b2bcnapi.sailuntire.com/api/test/wx/sailun/insurance/tireImageUpload",
  554. method: 'post',
  555. data: {
  556. body: {
  557. type: 0
  558. },
  559. files: {
  560. file: src
  561. }
  562. },
  563. headers: {
  564. "Content-type": "multipart/form-data"
  565. },
  566. }, function(ret, err) {
  567. api.hideProgress();
  568. api.refreshHeaderLoadDone();
  569. if (ret) {
  570. callback(ret);
  571. } else {
  572. api.toast({
  573. msg: JSON.stringify(err)
  574. });
  575. }
  576. });
  577. }
  578. </script>
  579. </html>