Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

car-release.vue 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677
  1. <template>
  2. <navBar title="行驶证信息上传"></navBar>
  3. <navBgCar></navBgCar>
  4. <view class="content">
  5. <view class="item-tips">
  6. <view class="title"> 上传后请核对识别信息 </view>
  7. <view class="tip"> 如有错误请及时手动修改 </view>
  8. </view>
  9. <view class="picture-wrapper" @click="cardImageOcr('1')">
  10. <view class="bg">
  11. <view class="">
  12. <view class="name"> 行驶证主页 </view>
  13. <view class="value"> 上传行驶证的主页 </view>
  14. <view class="tip">
  15. <view class="tip-value"> 拍摄规范 </view>
  16. </view>
  17. </view>
  18. <image v-if="!state.form.vehPosImgUrl" class="icon" :src="`${$imgUrl}applyCard/car-zhu.png`">
  19. </image>
  20. <image v-else class="icon" :src="strReplace(state.form.vehPosImgUrl)"></image>
  21. </view>
  22. </view>
  23. <view class="picture-wrapper" @click="cardImageOcr('2')">
  24. <view class="bg">
  25. <view class="">
  26. <view class="name"> 行驶证副页 </view>
  27. <view class="value"> 上传行驶证的副页 </view>
  28. <view class="tip">
  29. <view class="tip-value"> 拍摄规范 </view>
  30. </view>
  31. </view>
  32. <image v-if="!state.form.vehNegImgUrl" class="icon" :src="`${$imgUrl}applyCard/car-fu.png`">
  33. </image>
  34. <image v-else class="icon" :src="strReplace(state.form.vehNegImgUrl)"></image>
  35. </view>
  36. </view>
  37. <view class="picture-wrapper" @click="cardFileImageUpdate()">
  38. <view class="bg">
  39. <view class="">
  40. <view class="name"> 车头照 </view>
  41. <view class="value"> 上传汽车的车头照片 </view>
  42. <view class="tip">
  43. <view class="tip-value"> 拍摄规范 </view>
  44. </view>
  45. </view>
  46. <image v-if="!state.form.vehBodyUrl" class="icon" :src="`${$imgUrl}applyCard/chetou.png`">
  47. </image>
  48. <image v-else class="icon" :src="strReplace(state.form.vehBodyUrl)"></image>
  49. </view>
  50. </view>
  51. <view class="shibie-wrapper">
  52. <view class="title"> 识别内容如下 </view>
  53. <view class="">
  54. <u-form label-width="200" :model="state.form" ref="uForm">
  55. <u-form-item label="车牌号">
  56. <u-input inputAlign="right" placeholder='请输入车牌号' v-model="state.form.vehicleIdNum" />
  57. </u-form-item>
  58. <u-form-item label="所有人">
  59. <u-input inputAlign="right" placeholder='请输入所有人' v-model="state.form.man" />
  60. </u-form-item>
  61. <u-form-item label="车辆类型">
  62. <u-input inputAlign="right" placeholder='请输入车辆类型' v-model="state.form.vehicleType" />
  63. </u-form-item>
  64. <u-form-item label="使用性质">
  65. <u-input inputAlign="right" placeholder='请输入使用性质' v-model="state.form.character" />
  66. </u-form-item>
  67. <u-form-item label="车辆识别代号">
  68. <u-input inputAlign="right" placeholder='请输入车辆识别代号' v-model="state.form.vin" />
  69. </u-form-item>
  70. <u-form-item label="发动机号码">
  71. <u-input inputAlign="right" placeholder='请输入发动机号码' v-model="state.form.engineNum" />
  72. </u-form-item>
  73. <u-form-item label="注册日期">
  74. <u-input inputAlign="right" placeholder='请输入注册日期' v-model="state.form.register" />
  75. </u-form-item>
  76. <u-form-item label="发证日期">
  77. <u-input inputAlign="right" placeholder='请输入发证日期' v-model="state.form.issueDate" />
  78. </u-form-item>
  79. <u-form-item label="核定载人数">
  80. <u-input inputAlign="right" placeholder='请输入核定载人数' v-model="state.form.approvedCount" />
  81. </u-form-item>
  82. <u-form-item label="整备质量">
  83. <u-input inputAlign="right" placeholder='请输入整备质量' v-model="state.form.maintenaceMass" />
  84. </u-form-item>
  85. <u-form-item label="外廊尺寸">
  86. <u-input inputAlign="right" placeholder='请输入外廊尺寸' v-model="state.form.vehicleDimensions" />
  87. </u-form-item>
  88. <u-form-item label="总质量">
  89. <u-input inputAlign="right" placeholder='请输入总质量' v-model="state.form.totalMass" />
  90. </u-form-item>
  91. <u-form-item label="车辆用户类型">
  92. <u-input @click="state.actionSheetShow = true" placeholder='请输入车辆用户类型' inputAlign="right"
  93. v-model="state.form.useUserTypeName" height='38' type='textarea' :autoHeight='true' />
  94. </u-form-item>
  95. </u-form>
  96. </view>
  97. </view>
  98. <view class="green-tip">
  99. 如识别信息有误,请手动修改,确认无误后,点击下一步!
  100. </view>
  101. <view class="action">
  102. <button type="default" class="button" @click="savaHandle()">
  103. 下一步
  104. </button>
  105. </view>
  106. <!-- <u-select v-model="state.actionSheetShow" :list="state.actionSheetList" @confirm="selectConfirm"></u-select> -->
  107. <u-action-sheet @click="selectConfirm" :list="state.actionSheetList" v-model="state.actionSheetShow">
  108. </u-action-sheet>
  109. <u-popup mode="bottom" v-model="state.show">
  110. <view v-if="state.data.transferLogs&&state.data.transferLogs.length" class="">
  111. <view class="bettwen-center">
  112. <view style="padding: 20rpx;" class="title">
  113. 选择卡签
  114. </view>
  115. <view class="goto">
  116. 直接跳过,不使用此套卡签
  117. </view>
  118. </view>
  119. <view @click="guohuAction(item)" class="card" v-for="(item,index) in state.data.transferLogs"
  120. :key="index" style="margin-top: 30rpx;margin-bottom: 30rpx;">
  121. <view v-if="item.status==='WAITING'" class="card-left">
  122. <image :src="`${$imgUrl}card2.png`" mode=""></image>
  123. <view class="card-center">
  124. <view class="flex">
  125. <view class="">
  126. 卡号:
  127. </view>
  128. <view class="card-center-head">
  129. {{item.cardId}}
  130. </view>
  131. </view>
  132. <view style="margin-top: 10rpx;" class="flex">
  133. <view class="">
  134. OBU编号:
  135. </view>
  136. <view class="card-center-head">
  137. {{item.obuId}}
  138. </view>
  139. </view>
  140. </view>
  141. </view>
  142. </view>
  143. </view>
  144. </u-popup>
  145. </view>
  146. </template>
  147. <script setup lang="ts">
  148. import {
  149. reactive
  150. } from "vue";
  151. import navBgCar from "./components/nav-bg-car4";
  152. import navBar from "../components/nav-bar/nav-bar2.vue";
  153. import {
  154. pathToBase64
  155. } from "@/utils/util/imageTool.js";
  156. import {
  157. etcCarCardInfoSubmit,
  158. etcCarOcrCard,
  159. fileUpload,
  160. queryGuoHuJianCe,
  161. queryGuoHuCaoZuo
  162. } from "@/utils/network/api.js";
  163. import {
  164. request
  165. } from "@/utils/network/request.js";
  166. import {
  167. stringToJson
  168. } from "@/utils/network/encryption";
  169. import {
  170. onLoad,
  171. onShow
  172. } from "@dcloudio/uni-app";
  173. import {
  174. getObuStatus
  175. } from "@/datas/obuStatus.js";
  176. import {
  177. getEtcCardStatus
  178. } from "@/datas/etcCardStatus.js";
  179. import {
  180. getItem
  181. } from "@/utils/storage";
  182. const savaHandle = () => {
  183. state.form.vehicleId =
  184. state.form.vehicleIdNum + "_" + state.vehiclePlateColor;
  185. const options = {
  186. type: 2,
  187. data: state.form,
  188. method: "POST",
  189. showLoading: true,
  190. };
  191. request(etcCarCardInfoSubmit, options)
  192. .then((res) => {
  193. const data = stringToJson(res.bizContent);
  194. queryGuoHuJianCeAction().then(value => {
  195. if (value.transferLogs && value.transferLogs.length > 0) {
  196. state.data.transferLogs = value.transferLogs
  197. state.show = true;
  198. } else {
  199. uni.navigateTo({
  200. // url: `/applyCard/choice-product?orderId=${state.form.orderId}`,
  201. url: `/applyCard/release-products?orderId=${state.form.orderId}&clientFee=${getItem('clientFee')}&&id=${getItem('productId')}`,
  202. });
  203. }
  204. })
  205. })
  206. .catch((res) => {
  207. console.log(res);
  208. });
  209. };
  210. const selectConfirm = (index: any) => {
  211. console.log(index)
  212. state.form.useUserType = state.actionSheetList[index].value
  213. state.form.useUserTypeName = state.actionSheetList[index].text
  214. };
  215. const cardFileImageUpdate = () => {
  216. uni.chooseImage({
  217. count: 1, //只能选取一张照片
  218. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  219. sourceType: ["camera", "album"], //从相册选择
  220. success: function(res) {
  221. pathToBase64(res.tempFilePaths[0])
  222. .then((path) => {
  223. var data = {
  224. fileBase64: path,
  225. };
  226. const options = {
  227. type: 2,
  228. data: data,
  229. method: "POST",
  230. showLoading: true,
  231. };
  232. request(fileUpload, options).then((res) => {
  233. const data = stringToJson(res.bizContent);
  234. console.log(data);
  235. state.form.vehBodyUrl = data.data.url;
  236. });
  237. })
  238. .catch((error) => {});
  239. },
  240. });
  241. };
  242. const state = reactive({
  243. data: {
  244. transferLogs: [],
  245. },
  246. actionSheetShow: false,
  247. actionSheetList: [{
  248. text: "普通车",
  249. value: 0,
  250. },
  251. {
  252. text: "道路运输证经营范围仅有“货物专用运输(集装箱) ”的牵引车办理J类型集装箱",
  253. value: 24,
  254. },
  255. {
  256. text: "道路运输证经营范围不含“货物专用运输(集装箱)”的牵引车",
  257. value: 27,
  258. },
  259. {
  260. text: '道路运输证经营范围除“货物专用运输 (集装 箱)"外,还有“普通货运”等其他项目的牵引车办理J2类型集装箱',
  261. value: 28,
  262. },
  263. ],
  264. form: {
  265. orderId: "", //订单ID
  266. man: "", //所有人
  267. character: "", //使用性质
  268. register: "", //注册日期
  269. customerId: "", //用户编号
  270. vehicleId: "",
  271. vehicleIdNum: "", //车牌编号
  272. issueDate: "", //发证日期
  273. vehPosImgUrl: "", //行驶证正面
  274. vehNegImgUrl: "", //行驶证证反面
  275. type: "0", //0,客车 1.货车
  276. useUserType: 0, //车辆用户类型
  277. useUserTypeName: "普通车",
  278. vehicleSign: 2, //前/后装标识
  279. vin: "", //车辆识别代号
  280. engineNum: "", //发动机号码
  281. vehicleType: "", //车辆类型
  282. vehicleModel: "", //行驶证品牌型号
  283. approvedCount: undefined, //核定人数
  284. totalMass: undefined, //总质量
  285. maintenaceMass: undefined, //整备质量
  286. permittedWeight: "", //核定载质量
  287. vehicleDimensions: "", //车辆尺寸
  288. permittedTowWeight: "", //准牵引总质量
  289. axleCount: "", //车轴数
  290. ownerName: "", //车主姓名
  291. ownerIdType: "", //车主证件类型
  292. ownerIdNum: "", //车主证件号码
  293. ownPosImgUrl: "", //车主证件正面图片
  294. ownNegImgUrl: "", //车主证件反面图片
  295. agreementId: "", //签约编号
  296. channelId: "5201018892300000001", //编号渠道
  297. scenePayType: "", //
  298. transportIdNum: "", //道路运输证编号
  299. licenseIdNum: "", //经营许可证编号
  300. vehBodyUrl: "", //车身照片
  301. proxyUrl: "", //委托书地址
  302. },
  303. vehiclePlateColor: undefined,
  304. orderId: "",
  305. show: false,
  306. isMyPeopple: true,
  307. });
  308. onLoad((option: any) => {
  309. state.form.orderId = option.orderId;
  310. state.vehiclePlateColor = option.vehiclePlateColor;
  311. });
  312. //orc接口调用
  313. const cardImageOcr = (val: any) => {
  314. var imageType = val;
  315. uni.chooseImage({
  316. count: 1, //只能选取一张照片
  317. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  318. sourceType: ["camera", "album"], //从相册选择
  319. success: function(res) {
  320. pathToBase64(res.tempFilePaths[0])
  321. .then((path) => {
  322. var data = {
  323. source: "1",
  324. agencyId: "52010106004",
  325. imageType: imageType,
  326. fileName: res.tempFilePaths[0],
  327. imageBase64: path,
  328. };
  329. const options = {
  330. type: 2,
  331. data: data,
  332. method: "POST",
  333. showLoading: true,
  334. };
  335. request(etcCarOcrCard, options).then((res) => {
  336. const data = stringToJson(res.bizContent);
  337. console.log(data);
  338. if (val === "1") {
  339. state.form.vehicleIdNum = data.plate_a;
  340. state.form.man = data.man;
  341. state.form.vehicleType = data.vehicle;
  342. state.form.character = data.character;
  343. state.form.vin = data.vin;
  344. state.form.engineNum = data.engine;
  345. state.form.register = data.register;
  346. state.form.issueDate = data.issue;
  347. state.form.vehPosImgUrl = data.imageUrl;
  348. state.form.vehicleModel = data.model;
  349. } else {
  350. state.form.approvedCount = parseFloat(data.apc);
  351. state.form.maintenaceMass = parseFloat(data.unladen);
  352. state.form.vehicleDimensions = data.overall;
  353. state.form.totalMass = parseFloat(data.gross);
  354. state.form.vehNegImgUrl = data.imageUrl;
  355. }
  356. });
  357. })
  358. .catch((error) => {});
  359. },
  360. });
  361. };
  362. const queryGuoHuJianCeAction = () => {
  363. var data = {
  364. orderId: state.form.orderId
  365. };
  366. const options = {
  367. type: 2,
  368. data: data,
  369. method: "POST",
  370. showLoading: true,
  371. };
  372. return new Promise(async (resolve, reject) => {
  373. const res = await request(queryGuoHuJianCe, options);
  374. const data = stringToJson(res.bizContent);
  375. resolve(data);
  376. }).catch((error) => {
  377. reject(error);
  378. });
  379. }
  380. const guohuAction = (val) => {
  381. var data = {
  382. orderId: state.form.orderId,
  383. serviceType: 'USE',
  384. obuId: val.obuId,
  385. cardId: val.cardId
  386. };
  387. const options = {
  388. type: 2,
  389. data: data,
  390. method: "POST",
  391. showLoading: true,
  392. };
  393. return new Promise(async (resolve, reject) => {
  394. const res = await request(queryGuoHuCaoZuo, options);
  395. const data = stringToJson(res.bizContent);
  396. state.show = false
  397. uni.navigateTo({
  398. url: `/applyCard/choice-product?orderId=${state.form.orderId}`,
  399. });
  400. }).catch((error) => {
  401. reject(error);
  402. });
  403. }
  404. //替换图片地址
  405. const strReplace = (str: string) => {
  406. return str.replace('192.168.101.145:9000', '222.85.144.89:19002')
  407. }
  408. </script>
  409. <style lang="scss" scoped>
  410. .goto {
  411. margin-right: 20rpx;
  412. padding: 10rpx;
  413. color: #00B38B;
  414. border: 1rpx solid #00B38B;
  415. border-radius: 20rpx;
  416. }
  417. .flex {
  418. display: flex;
  419. align-items: center;
  420. }
  421. .bettwen-center {
  422. display: flex;
  423. align-items: center;
  424. justify-content: space-between;
  425. }
  426. .card {
  427. margin: 20rpx;
  428. height: 150rpx;
  429. background: #FFFFFF;
  430. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  431. border-radius: 20rpx;
  432. padding: 20rpx;
  433. display: flex;
  434. justify-content: space-between;
  435. align-items: center;
  436. margin-bottom: 30rpx;
  437. .card-left {
  438. display: flex;
  439. align-items: center;
  440. image {
  441. width: 100rpx;
  442. height: 90rpx;
  443. }
  444. .card-center {
  445. margin-left: 30rpx;
  446. .card-center-head {
  447. font-size: 32rpx;
  448. font-family: Noto Sans S Chinese;
  449. font-weight: 400;
  450. color: #333333;
  451. }
  452. .tips {
  453. font-size: 26rpx;
  454. font-family: Noto Sans S Chinese;
  455. font-weight: 400;
  456. color: #666666;
  457. .tips-card {
  458. width: 70rpx;
  459. height: 40rpx;
  460. background: #D3F2EF;
  461. border-radius: 6rpx;
  462. font-size: 20rpx;
  463. font-family: Noto Sans S Chinese;
  464. font-weight: 400;
  465. color: #0A8F8A;
  466. padding: 5rpx 10rpx;
  467. margin-left: 20rpx;
  468. }
  469. }
  470. }
  471. }
  472. .choose-item {
  473. margin-right: 20rpx;
  474. width: 50rpx;
  475. height: 50rpx;
  476. border: 1rpx solid #00B38B;
  477. border-radius: 50%;
  478. display: flex;
  479. justify-content: center;
  480. align-items: center;
  481. .active {
  482. width: 38rpx;
  483. height: 38rpx;
  484. background: #00B38B;
  485. border-radius: 50%;
  486. }
  487. }
  488. }
  489. .content {
  490. position: relative;
  491. margin-top: -50rpx;
  492. padding: 0rpx 30rpx;
  493. position: relative;
  494. .img-pos {
  495. position: absolute;
  496. left: 270rpx;
  497. top: -38rpx;
  498. right: 50rpx;
  499. .img-flex {
  500. display: flex;
  501. justify-content: space-between;
  502. align-items: center;
  503. .car-img {
  504. width: 86rpx;
  505. height: 42rpx;
  506. }
  507. .flag-img {
  508. width: 30rpx;
  509. height: 35rpx;
  510. }
  511. }
  512. }
  513. .action {
  514. padding-left: 20rpx;
  515. padding-right: 20rpx;
  516. padding-bottom: 30rpx;
  517. .button {
  518. height: 80rpx;
  519. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  520. border-radius: 40rpx;
  521. font-size: 32rpx;
  522. font-weight: 400;
  523. color: #ffffff;
  524. line-height: 80rpx;
  525. }
  526. }
  527. .item-tips {
  528. .title {
  529. font-size: 30rpx;
  530. font-family: Microsoft YaHei;
  531. font-weight: 400;
  532. color: #000000;
  533. line-height: 24rpx;
  534. }
  535. .tip {
  536. margin-top: 16rpx;
  537. font-size: 24rpx;
  538. font-family: Microsoft YaHei;
  539. font-weight: 400;
  540. color: #999999;
  541. line-height: 24rpx;
  542. }
  543. }
  544. .picture-wrapper {
  545. margin-top: 40rpx;
  546. .bg {
  547. background: #ffffff;
  548. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  549. border-radius: 20rpx;
  550. padding: 40rpx;
  551. display: flex;
  552. // align-items: center;
  553. justify-content: space-between;
  554. .name {
  555. font-size: 34rpx;
  556. font-family: Microsoft YaHei;
  557. font-weight: 400;
  558. color: #000000;
  559. line-height: 34rpx;
  560. }
  561. .value {
  562. margin-top: 20rpx;
  563. font-size: 24rpx;
  564. font-family: Microsoft YaHei;
  565. font-weight: 400;
  566. color: #999999;
  567. line-height: 24rpx;
  568. }
  569. .tip {
  570. margin-top: 20rpx;
  571. text-align: center;
  572. width: 110rpx;
  573. height: 40rpx;
  574. background: rgba(33, 190, 177, 0.2);
  575. border-radius: 6rpx;
  576. .tip-value {
  577. font-size: 20rpx;
  578. font-family: Microsoft YaHei;
  579. font-weight: 400;
  580. color: #0a8f8a;
  581. line-height: 40rpx;
  582. opacity: 1;
  583. }
  584. }
  585. }
  586. .icon {
  587. width: 294rpx;
  588. height: 188rpx;
  589. }
  590. }
  591. .shibie-wrapper {
  592. margin-top: 60rpx;
  593. .title {
  594. font-size: 30rpx;
  595. font-family: Microsoft YaHei;
  596. font-weight: 400;
  597. color: #000000;
  598. line-height: 30rpx;
  599. }
  600. }
  601. .buchong-wrapper {
  602. margin-top: 60rpx;
  603. .title {
  604. font-size: 30rpx;
  605. font-family: Microsoft YaHei;
  606. font-weight: 400;
  607. color: #000000;
  608. line-height: 30rpx;
  609. }
  610. }
  611. .green-tip {
  612. margin-top: 50rpx;
  613. font-size: 24rpx;
  614. font-family: Microsoft YaHei;
  615. font-weight: 400;
  616. color: #00b38b;
  617. line-height: 24rpx;
  618. margin-bottom: 60rpx;
  619. }
  620. }
  621. </style>