You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

car-release.vue 18KB

2 yıl önce
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673
  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-car3";
  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. const savaHandle = () => {
  180. state.form.vehicleId =
  181. state.form.vehicleIdNum + "_" + state.vehiclePlateColor;
  182. const options = {
  183. type: 2,
  184. data: state.form,
  185. method: "POST",
  186. showLoading: true,
  187. };
  188. request(etcCarCardInfoSubmit, options)
  189. .then((res) => {
  190. const data = stringToJson(res.bizContent);
  191. queryGuoHuJianCeAction().then(value => {
  192. if (value.transferLogs && value.transferLogs.length > 0) {
  193. state.data.transferLogs = value.transferLogs
  194. state.show = true;
  195. } else {
  196. uni.navigateTo({
  197. url: `/applyCard/choice-product?orderId=${state.form.orderId}`,
  198. });
  199. }
  200. })
  201. })
  202. .catch((res) => {
  203. console.log(res);
  204. });
  205. };
  206. const selectConfirm = (index: any) => {
  207. console.log(index)
  208. state.form.useUserType = state.actionSheetList[index].value
  209. state.form.useUserTypeName = state.actionSheetList[index].text
  210. };
  211. const cardFileImageUpdate = () => {
  212. uni.chooseImage({
  213. count: 1, //只能选取一张照片
  214. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  215. sourceType: ["camera", "album"], //从相册选择
  216. success: function(res) {
  217. pathToBase64(res.tempFilePaths[0])
  218. .then((path) => {
  219. var data = {
  220. fileBase64: path,
  221. };
  222. const options = {
  223. type: 2,
  224. data: data,
  225. method: "POST",
  226. showLoading: true,
  227. };
  228. request(fileUpload, options).then((res) => {
  229. const data = stringToJson(res.bizContent);
  230. console.log(data);
  231. state.form.vehBodyUrl = data.data.url;
  232. });
  233. })
  234. .catch((error) => {});
  235. },
  236. });
  237. };
  238. const state = reactive({
  239. data: {
  240. transferLogs: [],
  241. },
  242. actionSheetShow: false,
  243. actionSheetList: [{
  244. text: "普通车",
  245. value: 0,
  246. },
  247. {
  248. text: "道路运输证经营范围仅有“货物专用运输(集装箱) ”的牵引车办理J类型集装箱",
  249. value: 24,
  250. },
  251. {
  252. text: "道路运输证经营范围不含“货物专用运输(集装箱)”的牵引车",
  253. value: 27,
  254. },
  255. {
  256. text: '道路运输证经营范围除“货物专用运输 (集装 箱)"外,还有“普通货运”等其他项目的牵引车办理J2类型集装箱',
  257. value: 28,
  258. },
  259. ],
  260. form: {
  261. orderId: "", //订单ID
  262. man: "", //所有人
  263. character: "", //使用性质
  264. register: "", //注册日期
  265. customerId: "", //用户编号
  266. vehicleId: "",
  267. vehicleIdNum: "", //车牌编号
  268. issueDate: "", //发证日期
  269. vehPosImgUrl: "", //行驶证正面
  270. vehNegImgUrl: "", //行驶证证反面
  271. type: "0", //0,客车 1.货车
  272. useUserType: 0, //车辆用户类型
  273. useUserTypeName: "普通车",
  274. vehicleSign: 2, //前/后装标识
  275. vin: "", //车辆识别代号
  276. engineNum: "", //发动机号码
  277. vehicleType: "", //车辆类型
  278. vehicleModel: "", //行驶证品牌型号
  279. approvedCount: undefined, //核定人数
  280. totalMass: undefined, //总质量
  281. maintenaceMass: undefined, //整备质量
  282. permittedWeight: "", //核定载质量
  283. vehicleDimensions: "", //车辆尺寸
  284. permittedTowWeight: "", //准牵引总质量
  285. axleCount: "", //车轴数
  286. ownerName: "", //车主姓名
  287. ownerIdType: "", //车主证件类型
  288. ownerIdNum: "", //车主证件号码
  289. ownPosImgUrl: "", //车主证件正面图片
  290. ownNegImgUrl: "", //车主证件反面图片
  291. agreementId: "", //签约编号
  292. channelId: "5201018892300000001", //编号渠道
  293. scenePayType: "", //
  294. transportIdNum: "", //道路运输证编号
  295. licenseIdNum: "", //经营许可证编号
  296. vehBodyUrl: "", //车身照片
  297. proxyUrl: "", //委托书地址
  298. },
  299. vehiclePlateColor: undefined,
  300. orderId: "",
  301. show: false,
  302. isMyPeopple: true,
  303. });
  304. onLoad((option: any) => {
  305. state.form.orderId = option.orderId;
  306. state.vehiclePlateColor = option.vehiclePlateColor;
  307. });
  308. //orc接口调用
  309. const cardImageOcr = (val: any) => {
  310. var imageType = val;
  311. uni.chooseImage({
  312. count: 1, //只能选取一张照片
  313. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  314. sourceType: ["camera", "album"], //从相册选择
  315. success: function(res) {
  316. pathToBase64(res.tempFilePaths[0])
  317. .then((path) => {
  318. var data = {
  319. source: "1",
  320. agencyId: "52010106004",
  321. imageType: imageType,
  322. fileName: res.tempFilePaths[0],
  323. imageBase64: path,
  324. };
  325. const options = {
  326. type: 2,
  327. data: data,
  328. method: "POST",
  329. showLoading: true,
  330. };
  331. request(etcCarOcrCard, options).then((res) => {
  332. const data = stringToJson(res.bizContent);
  333. console.log(data);
  334. if (val === "1") {
  335. state.form.vehicleIdNum = data.plate_a;
  336. state.form.man = data.man;
  337. state.form.vehicleType = data.vehicle;
  338. state.form.character = data.character;
  339. state.form.vin = data.vin;
  340. state.form.engineNum = data.engine;
  341. state.form.register = data.register;
  342. state.form.issueDate = data.issue;
  343. state.form.vehPosImgUrl = data.imageUrl;
  344. state.form.vehicleModel = data.model;
  345. } else {
  346. state.form.approvedCount = parseFloat(data.apc);
  347. state.form.maintenaceMass = parseFloat(data.unladen);
  348. state.form.vehicleDimensions = data.overall;
  349. state.form.totalMass = parseFloat(data.gross);
  350. state.form.vehNegImgUrl = data.imageUrl;
  351. }
  352. });
  353. })
  354. .catch((error) => {});
  355. },
  356. });
  357. };
  358. const queryGuoHuJianCeAction = () => {
  359. var data = {
  360. orderId: state.form.orderId
  361. };
  362. const options = {
  363. type: 2,
  364. data: data,
  365. method: "POST",
  366. showLoading: true,
  367. };
  368. return new Promise(async (resolve, reject) => {
  369. const res = await request(queryGuoHuJianCe, options);
  370. const data = stringToJson(res.bizContent);
  371. resolve(data);
  372. }).catch((error) => {
  373. reject(error);
  374. });
  375. }
  376. const guohuAction = (val) => {
  377. var data = {
  378. orderId: state.form.orderId,
  379. serviceType: 'USE',
  380. obuId: val.obuId,
  381. cardId: val.cardId
  382. };
  383. const options = {
  384. type: 2,
  385. data: data,
  386. method: "POST",
  387. showLoading: true,
  388. };
  389. return new Promise(async (resolve, reject) => {
  390. const res = await request(queryGuoHuCaoZuo, options);
  391. const data = stringToJson(res.bizContent);
  392. state.show = false
  393. uni.navigateTo({
  394. url: `/applyCard/choice-product?orderId=${state.form.orderId}`,
  395. });
  396. }).catch((error) => {
  397. reject(error);
  398. });
  399. }
  400. //替换图片地址
  401. const strReplace = (str: string) => {
  402. return str.replace('192.168.101.145:9000', '222.85.144.89:19002')
  403. }
  404. </script>
  405. <style lang="scss" scoped>
  406. .goto {
  407. margin-right: 20rpx;
  408. padding: 10rpx;
  409. color: #00B38B;
  410. border: 1rpx solid #00B38B;
  411. border-radius: 20rpx;
  412. }
  413. .flex {
  414. display: flex;
  415. align-items: center;
  416. }
  417. .bettwen-center {
  418. display: flex;
  419. align-items: center;
  420. justify-content: space-between;
  421. }
  422. .card {
  423. margin: 20rpx;
  424. height: 150rpx;
  425. background: #FFFFFF;
  426. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  427. border-radius: 20rpx;
  428. padding: 20rpx;
  429. display: flex;
  430. justify-content: space-between;
  431. align-items: center;
  432. margin-bottom: 30rpx;
  433. .card-left {
  434. display: flex;
  435. align-items: center;
  436. image {
  437. width: 100rpx;
  438. height: 90rpx;
  439. }
  440. .card-center {
  441. margin-left: 30rpx;
  442. .card-center-head {
  443. font-size: 32rpx;
  444. font-family: Noto Sans S Chinese;
  445. font-weight: 400;
  446. color: #333333;
  447. }
  448. .tips {
  449. font-size: 26rpx;
  450. font-family: Noto Sans S Chinese;
  451. font-weight: 400;
  452. color: #666666;
  453. .tips-card {
  454. width: 70rpx;
  455. height: 40rpx;
  456. background: #D3F2EF;
  457. border-radius: 6rpx;
  458. font-size: 20rpx;
  459. font-family: Noto Sans S Chinese;
  460. font-weight: 400;
  461. color: #0A8F8A;
  462. padding: 5rpx 10rpx;
  463. margin-left: 20rpx;
  464. }
  465. }
  466. }
  467. }
  468. .choose-item {
  469. margin-right: 20rpx;
  470. width: 50rpx;
  471. height: 50rpx;
  472. border: 1rpx solid #00B38B;
  473. border-radius: 50%;
  474. display: flex;
  475. justify-content: center;
  476. align-items: center;
  477. .active {
  478. width: 38rpx;
  479. height: 38rpx;
  480. background: #00B38B;
  481. border-radius: 50%;
  482. }
  483. }
  484. }
  485. .content {
  486. position: relative;
  487. margin-top: -50rpx;
  488. padding: 0rpx 30rpx;
  489. position: relative;
  490. .img-pos {
  491. position: absolute;
  492. left: 270rpx;
  493. top: -38rpx;
  494. right: 50rpx;
  495. .img-flex {
  496. display: flex;
  497. justify-content: space-between;
  498. align-items: center;
  499. .car-img {
  500. width: 86rpx;
  501. height: 42rpx;
  502. }
  503. .flag-img {
  504. width: 30rpx;
  505. height: 35rpx;
  506. }
  507. }
  508. }
  509. .action {
  510. padding-left: 20rpx;
  511. padding-right: 20rpx;
  512. padding-bottom: 30rpx;
  513. .button {
  514. height: 80rpx;
  515. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  516. border-radius: 40rpx;
  517. font-size: 32rpx;
  518. font-weight: 400;
  519. color: #ffffff;
  520. line-height: 80rpx;
  521. }
  522. }
  523. .item-tips {
  524. .title {
  525. font-size: 30rpx;
  526. font-family: Microsoft YaHei;
  527. font-weight: 400;
  528. color: #000000;
  529. line-height: 24rpx;
  530. }
  531. .tip {
  532. margin-top: 16rpx;
  533. font-size: 24rpx;
  534. font-family: Microsoft YaHei;
  535. font-weight: 400;
  536. color: #999999;
  537. line-height: 24rpx;
  538. }
  539. }
  540. .picture-wrapper {
  541. margin-top: 40rpx;
  542. .bg {
  543. background: #ffffff;
  544. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  545. border-radius: 20rpx;
  546. padding: 40rpx;
  547. display: flex;
  548. // align-items: center;
  549. justify-content: space-between;
  550. .name {
  551. font-size: 34rpx;
  552. font-family: Microsoft YaHei;
  553. font-weight: 400;
  554. color: #000000;
  555. line-height: 34rpx;
  556. }
  557. .value {
  558. margin-top: 20rpx;
  559. font-size: 24rpx;
  560. font-family: Microsoft YaHei;
  561. font-weight: 400;
  562. color: #999999;
  563. line-height: 24rpx;
  564. }
  565. .tip {
  566. margin-top: 20rpx;
  567. text-align: center;
  568. width: 110rpx;
  569. height: 40rpx;
  570. background: rgba(33, 190, 177, 0.2);
  571. border-radius: 6rpx;
  572. .tip-value {
  573. font-size: 20rpx;
  574. font-family: Microsoft YaHei;
  575. font-weight: 400;
  576. color: #0a8f8a;
  577. line-height: 40rpx;
  578. opacity: 1;
  579. }
  580. }
  581. }
  582. .icon {
  583. width: 294rpx;
  584. height: 188rpx;
  585. }
  586. }
  587. .shibie-wrapper {
  588. margin-top: 60rpx;
  589. .title {
  590. font-size: 30rpx;
  591. font-family: Microsoft YaHei;
  592. font-weight: 400;
  593. color: #000000;
  594. line-height: 30rpx;
  595. }
  596. }
  597. .buchong-wrapper {
  598. margin-top: 60rpx;
  599. .title {
  600. font-size: 30rpx;
  601. font-family: Microsoft YaHei;
  602. font-weight: 400;
  603. color: #000000;
  604. line-height: 30rpx;
  605. }
  606. }
  607. .green-tip {
  608. margin-top: 50rpx;
  609. font-size: 24rpx;
  610. font-family: Microsoft YaHei;
  611. font-weight: 400;
  612. color: #00b38b;
  613. line-height: 24rpx;
  614. margin-bottom: 60rpx;
  615. }
  616. }
  617. </style>