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 35KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239
  1. <template>
  2. <navBar title="行驶证信息上传" :scrollTop="scrollTop"></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="takePhotoMode('3')">
  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="takePhotoMode('4')">
  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(1)">
  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="uni-list tractor">
  52. <radio-group @change="radioChange" v-if="state.form.type=='2'">
  53. <text class="title">是否是牵引车</text>
  54. <label style="margin-right: 60rpx;" class="uni-list-cell uni-list-cell-pd "
  55. v-for="(item, index) in state.items" :key="item.value">
  56. <radio :value="item.value" :checked="index === state.current" />{{item.name}}
  57. </label>
  58. </radio-group>
  59. </view>
  60. <!-- 货车 牵引车 需要传道路运输许可证-->
  61. <view class="picture-wrapper" v-if="state.form.type=='2' && state.form.tractorSign==1"
  62. @click="cardFileImageUpdate(2)">
  63. <view class="bg">
  64. <view class="">
  65. <view class="name"> 道路运输许可证 </view>
  66. <view class="value"> 上传道路运输许可证 </view>
  67. <view class="tip">
  68. <view class="tip-value"> 拍摄规范 </view>
  69. </view>
  70. </view>
  71. <image v-if="!state.form.roadTransportPermitPicUrl" class="icon"
  72. :src="`${$imgUrl}applyCard/chetou.png`">
  73. </image>
  74. <image v-else class="icon" :src="strReplace(state.form.roadTransportPermitPicUrl)"></image>
  75. </view>
  76. </view>
  77. <view class="shibie-wrapper">
  78. <view class="title"> 识别内容如下 </view>
  79. <view class="">
  80. <u-form label-width="200" :model="state.form" ref="uForm">
  81. <u-form-item label="车牌号">
  82. <car-number-input @numberInputResult="carNumber"
  83. :defaultStr="state.form.vehicleIdNum"></car-number-input>
  84. </u-form-item>
  85. <u-form-item label="所有人">
  86. <u-input inputAlign="right" placeholder="请输入所有人" v-model="state.form.ownerName"
  87. :disabled="state.isEnableChangeOCRCarInfo" maxlength="20" />
  88. </u-form-item>
  89. <u-form-item label="车辆类型">
  90. <u-input inputAlign="right" placeholder="请输入车辆类型" v-model="state.form.vehicleType"
  91. :disabled="state.isEnableChangeOCRCarInfo" maxlength="20" />
  92. </u-form-item>
  93. <u-form-item label="使用性质">
  94. <u-input inputAlign="right" placeholder="请输入使用性质" v-model="state.form.character"
  95. :disabled="state.isEnableChangeOCRCarInfo" maxlength="20" />
  96. </u-form-item>
  97. <u-form-item label="车辆识别代号">
  98. <u-input inputAlign="right" placeholder="请输入车辆识别代号" v-model="state.form.vin"
  99. :disabled="state.isEnableChangeOCRCarInfo" maxlength="50" />
  100. </u-form-item>
  101. <u-form-item label="发动机号码">
  102. <u-input inputAlign="right" placeholder="请输入发动机号码" v-model="state.form.engineNum"
  103. :disabled="state.isEnableChangeOCRCarInfo" maxlength="20" />
  104. </u-form-item>
  105. <u-form-item label="注册日期">
  106. <picker mode="date" :value="state.form.register" @change="bindDateChange1"
  107. :disabled="state.isEnableChangeOCRCarInfo">
  108. <view class="uni-input" style="text-align: right;" :class="state.changeColor?'hei':'hui'">
  109. {{state.form.register}}
  110. </view>
  111. </picker>
  112. </u-form-item>
  113. <u-form-item label="发证日期">
  114. <picker mode="date" :value="state.form.issueDate" @change="bindDateChange2"
  115. :disabled="state.isEnableChangeOCRCarInfo">
  116. <view class="uni-input" style="text-align: right;" :class="state.changeColor?'hei':'hui'">
  117. {{state.form.issueDate}}
  118. </view>
  119. </picker>
  120. </u-form-item>
  121. <u-form-item label="核定载人数">
  122. <u-input inputAlign="right" placeholder="请输入核定载人数" v-model="state.form.approvedCountShow"
  123. :disabled="state.isEnableChangeOCRCarInfo" maxlength="3" />
  124. </u-form-item>
  125. <u-form-item label="整备质量">
  126. <u-input inputAlign="right" placeholder="请输入整备质量" v-model="state.form.maintenaceMassShow"
  127. :disabled="state.isEnableChangeOCRCarInfo" maxlength="7" />
  128. </u-form-item>
  129. <view class="form-item">
  130. <label>外廊尺寸</label>
  131. <view class="input-box">
  132. <text class="sub-label">长</text>
  133. <input v-model="state.outlineL" @input="outlineInput"
  134. :disabled="state.isEnableChangeOCRCarInfo" type="number" maxlength="5" />
  135. <text class="sub-text">X</text>
  136. <text class="sub-label">宽</text>
  137. <input v-model="state.outlineW" @input="outlineInput"
  138. :disabled="state.isEnableChangeOCRCarInfo" type="number" maxlength="5" />
  139. <text class="sub-text">X</text>
  140. <text class="sub-label">高</text>
  141. <input v-model="state.outlineH" @input="outlineInput"
  142. :disabled="state.isEnableChangeOCRCarInfo" type="number" maxlength="5" />
  143. <text class="sub-text">mm</text>
  144. </view>
  145. </view>
  146. <u-form-item label="总质量">
  147. <u-input inputAlign="right" placeholder="请输入总质量" v-model="state.form.totalMassShow"
  148. :disabled="state.isEnableChangeOCRCarInfo" />
  149. </u-form-item>
  150. <u-form-item label="核定载质量" v-if="state.form.permittedWeight">
  151. <u-input inputAlign="right" placeholder="核定载质量" v-model="state.form.permittedWeight"
  152. :disabled="state.isEnableChangeOCRCarInfo" />
  153. </u-form-item>
  154. <u-form-item label="车轴数">
  155. <u-input inputAlign="right" placeholder="请输入车轴数" v-model="state.form.axleCount" type="number"
  156. maxlength="2" />
  157. </u-form-item>
  158. <view class="form-item">
  159. <label>车辆用户类型</label>
  160. <view class="select" @click="state.actionSheetShow = true">{{state.form.useUserTypeName}}</view>
  161. <image :src="`${$imgUrl}common/arror-down.png`" class="icon"
  162. @click="state.actionSheetShow = true"></image>
  163. </view>
  164. </u-form>
  165. </view>
  166. </view>
  167. <view class="green-tip">
  168. 如识别信息有误,请手动修改,确认无误后,点击下一步!
  169. </view>
  170. <view class="action">
  171. <button type="default" class="button" @click="savaHandle()">
  172. 下一步
  173. </button>
  174. </view>
  175. <!-- 车辆类型弹窗 -->
  176. <u-popup mode="bottom" v-model="state.actionSheetShow">
  177. <view class="window">
  178. <view class="window-item" v-for="item in state.actionSheetList" :key="item.value"
  179. @click="userType(item)">{{item.text}}</view>
  180. </view>
  181. </u-popup>
  182. <u-popup mode="bottom" v-model="state.show">
  183. <view v-if="state.data.transferLogs && state.data.transferLogs.length" class="">
  184. <view class="bettwen-center">
  185. <view style="padding: 20rpx" class="title"> 选择卡签 </view>
  186. <view class="goto" @click="pass"> 直接跳过,不使用此套卡签 </view>
  187. </view>
  188. <view @click="guohuAction(item)" class="card" v-for="(item, index) in state.data.transferLogs"
  189. :key="index" style="margin-top: 30rpx; margin-bottom: 30rpx">
  190. <view v-if="item.status === 'WAITING'" class="card-left">
  191. <image :src="`${$imgUrl}card2.png`" mode=""></image>
  192. <view class="card-center">
  193. <view class="flex">
  194. <view class=""> 卡号: </view>
  195. <view class="card-center-head">
  196. {{ item.cardId }}
  197. </view>
  198. </view>
  199. <view style="margin-top: 10rpx" class="flex">
  200. <view class=""> OBU编号: </view>
  201. <view class="card-center-head">
  202. {{ item.obuId }}
  203. </view>
  204. </view>
  205. </view>
  206. </view>
  207. </view>
  208. </view>
  209. </u-popup>
  210. </view>
  211. <view class="choice-takePhoto-wrap" v-if="state.isTakePhotoModeShow" @click="cancle">
  212. <view class="choice-takePhoto">
  213. <view @click.stop="takePhoto(state.choiceIndex)" style="border-radius: 20rpx 20rpx 0 0;">拍照</view>
  214. <view @click.stop="xiangce(state.choiceIndex)">从手机相册选择</view>
  215. <view @click.stop="cancle">取消</view>
  216. </view>
  217. </view>
  218. <viewfinder v-if="state.phoneType" :phoneType="state.phoneType" :images="state.images"
  219. :showStartPhoto="state.showImg" @confirmReturn="confirmReturn" @camera="camera"></viewfinder>
  220. </template>
  221. <script setup lang="ts">
  222. import { reactive, ref } from "vue";
  223. import viewfinder from "../../components/viewfinder.vue"
  224. import navBgCar from "./components/nav-bg-car4";
  225. import navBar from "@/components/nav-bar/nav-bar2.vue";
  226. import carNumberInput from "@/components/car-number-input/car-number-input.vue";
  227. import {
  228. etcCarCardInfoSubmit,
  229. etcCarOcrCard,
  230. fileUpload,
  231. envs,
  232. queryGuoHuJianCe,
  233. queryGuoHuCaoZuo,
  234. ocrAllQuery,
  235. carMessageApi
  236. } from "@/utils/network/api.js";
  237. import { request } from "@/utils/network/request.js";
  238. import { stringToJson } from "@/utils/network/encryption";
  239. import { onLoad, onPageScroll } from "@dcloudio/uni-app";
  240. import { getObuStatus } from "@/datas/obuStatus.js";
  241. import { getEtcCardStatus } from "@/datas/etcCardStatus.js";
  242. import { getItem, StorageKeys } from "@/utils/storage";
  243. import { msg, strReplace, hasLogin, uploadFile, compressImage } from "@/utils/utils";
  244. import {
  245. getCodeName
  246. } from "@/datas/queryKey.js";
  247. const scrollTop = ref(0);
  248. //监听页面滚动
  249. onPageScroll((e) => {
  250. scrollTop.value = e.scrollTop;
  251. });
  252. //车牌号输入
  253. const carNumber = (val : any) => {
  254. state.form.vehicleIdNum = val.trim();
  255. };
  256. const camera = () => {
  257. state.phoneType = 0
  258. }
  259. //提交车辆信息
  260. const savaHandle = () => {
  261. if (!state.form.vehPosImgUrl) {
  262. msg("请上传行驶证的主页");
  263. return;
  264. }
  265. if (!state.form.vehNegImgUrl) {
  266. msg("请上传行驶证的副页");
  267. return;
  268. }
  269. if (!state.form.vehBodyUrl) {
  270. msg("请上传车头照");
  271. return;
  272. }
  273. if (!state.form.ownerName) {
  274. msg("请输入所有人");
  275. return;
  276. }
  277. if (!state.form.vehicleType) {
  278. msg("请输入车辆类型");
  279. return;
  280. }
  281. if (!state.form.character) {
  282. msg("请输入使用性质");
  283. return;
  284. }
  285. if (!state.form.vin) {
  286. msg("请输入车辆识别代号");
  287. return;
  288. }
  289. if (!state.form.engineNum) {
  290. msg("请输入发动机号码");
  291. return;
  292. }
  293. if (!state.form.approvedCountShow) {
  294. msg("请输入核定载人数");
  295. return;
  296. }
  297. if (!state.outlineL || state.outlineL == '0') {
  298. msg("请输入外廊尺寸长");
  299. return;
  300. }
  301. if (!state.outlineW || state.outlineW == '0') {
  302. msg("请输入外廊尺寸宽");
  303. return;
  304. }
  305. if (!state.outlineH || state.outlineH == '0') {
  306. msg("请输入外廊尺寸高");
  307. return;
  308. }
  309. if (state.form.tractorSign == 1 && !state.form.roadTransportPermitPicUrl) {
  310. msg("请上传道路运输许可证");
  311. return;
  312. }
  313. if (state.form.type == 1) {
  314. state.form.axleCount = 2;
  315. } else {
  316. if (!state.form.axleCount) {
  317. msg("请输入车轴数");
  318. return;
  319. }
  320. }
  321. state.form.vehicleId =
  322. state.form.vehicleIdNum + "_" + state.vehiclePlateColor;
  323. state.form.opId = getItem(StorageKeys.OpenId);
  324. state.form.approvedCount = parseFloat(state.form.approvedCount);
  325. state.form.maintenaceMass = parseFloat(state.form.maintenaceMass);
  326. state.form.totalMass = parseFloat(state.form.totalMass);
  327. state.form.permittedWeight = parseFloat(state.form.permittedWeight);
  328. state.form.permittedTowWeight = parseFloat(state.form.permittedTowWeight);
  329. state.form.approvedCount = state.form.approvedCountShow.replace("人", "");
  330. state.form.maintenaceMass = state.form.maintenaceMassShow.replace("kg", "");
  331. state.form.totalMass = state.form.totalMassShow.replace("kg", "");
  332. const options = {
  333. type: 2,
  334. data: state.form,
  335. method: "POST",
  336. showLoading: true,
  337. };
  338. request(etcCarCardInfoSubmit, options)
  339. .then((res) => {
  340. const data = stringToJson(res.bizContent);
  341. queryGuoHuJianCeAction().then((value) => {
  342. console.log("过户检测", value)
  343. if (value.transferLogs && value.transferLogs.length > 0) {
  344. let arr = value.transferLogs;
  345. state.data.transferLogs = []
  346. for (var k = 0; k < arr.length; k++) {
  347. if (arr[k]['status'] == "WAITING") {
  348. state.data.transferLogs.push(arr[k])
  349. }
  350. }
  351. console.log("state.data.transferLogs", state.data.transferLogs)
  352. console.log("state.data.transferLogs", state.data.transferLogs.length)
  353. setTimeout(() => {
  354. if (state.data.transferLogs.length > 0) {
  355. state.show = true;
  356. } else {
  357. uni.redirectTo({
  358. url: `/subpackage/orders/product-detail?orderId=${state.form.orderId}&&clientFee=${getItem("clientFee")}&&id=${getItem("productId")}&&isValueCard=${getItem("isValueCard")}`,
  359. });
  360. }
  361. }, 1000)
  362. } else {
  363. if (!hasLogin()) {
  364. uni.redirectTo({
  365. url: `/subpackage/orders/addAddress?orderId=${state.form.orderId
  366. }&clientFee=${getItem("clientFee")}&&id=${getItem("productId")}`,
  367. });
  368. } else {
  369. uni.redirectTo({
  370. url: `/subpackage/orders/product-detail?orderId=${state.form.orderId}&&clientFee=${getItem("clientFee")}&&id=${getItem("productId")}&&isValueCard=${getItem("isValueCard")}`,
  371. });
  372. }
  373. }
  374. });
  375. })
  376. .catch((res) => {
  377. console.log(res);
  378. });
  379. };
  380. const pass = () => {
  381. state.show = false
  382. state.form.vehicleId =
  383. state.form.vehicleIdNum + "_" + state.vehiclePlateColor;
  384. state.form.opId = getItem(StorageKeys.OpenId);
  385. state.form.approvedCount = parseFloat(state.form.approvedCount);
  386. state.form.maintenaceMass = parseFloat(state.form.maintenaceMass);
  387. state.form.totalMass = parseFloat(state.form.totalMass);
  388. state.form.permittedWeight = parseFloat(state.form.permittedWeight);
  389. state.form.permittedTowWeight = parseFloat(state.form.permittedTowWeight);
  390. const options = {
  391. type: 2,
  392. data: state.form,
  393. method: "POST",
  394. showLoading: true,
  395. };
  396. request(etcCarCardInfoSubmit, options).then((res) => {
  397. uni.redirectTo({
  398. url: `/subpackage/orders/product-detail?orderId=${state.form.orderId}&&clientFee=${getItem("clientFee")}&&id=${getItem("productId")}&&isValueCard=${getItem("isValueCard")}`,
  399. });
  400. })
  401. }
  402. const selectConfirm = (index : any) => {
  403. console.log(index);
  404. state.form.useUserType = state.actionSheetList[index].value;
  405. state.form.useUserTypeName = state.actionSheetList[index].text;
  406. };
  407. //选择车辆用户类型
  408. const userType = (item : any) => {
  409. state.form.useUserType = item.value;
  410. state.form.useUserTypeName = item.text;
  411. state.actionSheetShow = false;
  412. }
  413. //车头照图片上传 val 1 车头照 2 道路运输证
  414. const cardFileImageUpdate = (val) => {
  415. uni.chooseImage({
  416. count: 1, //只能选取一张照片
  417. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  418. sourceType: ["camera", "album"], //从相册选择
  419. success: function (res) {
  420. uploadFile(res.tempFilePaths[0], "", "").then((data) => {
  421. if (val == 1) {
  422. state.form.vehBodyUrl = data;
  423. } else {
  424. state.form.roadTransportPermitPicUrl = data;
  425. }
  426. })
  427. },
  428. });
  429. };
  430. const state = reactive({
  431. phoneType: 0, // 1 身份证正面 2 身份证反面 3行驶证正面 4行驶证反面
  432. choiceIndex: 1, // 1 身份证正面 2 身份证反面
  433. isTakePhotoModeShow: false, //选择拍照方式是否出来
  434. changeColor: false,
  435. showImg: true,
  436. images: '',
  437. data: {
  438. transferLogs: [],
  439. },
  440. actionSheetShow: false,
  441. actionSheetList: [],
  442. form: {
  443. orderId: "", //订单ID
  444. character: "", //使用性质
  445. register: "请输入注册日期", //注册日期
  446. customerId: "", //用户编号
  447. vehicleId: "",
  448. vehicleIdNum: "", //车牌编号
  449. issueDate: "请输入发证日期", //发证日期
  450. vehPosImgUrl: "", //行驶证正面
  451. vehNegImgUrl: "", //行驶证证反面
  452. type: "0", //1,客车 2.货车
  453. useUserType: 0, //车辆用户类型
  454. useUserTypeName: "普通车",
  455. vehicleSign: 2, //前/后装标识
  456. vin: "", //车辆识别代号
  457. engineNum: "", //发动机号码
  458. vehicleType: "", //车辆类型
  459. vehicleModel: "", //行驶证品牌型号
  460. approvedCount: undefined, //核定人数
  461. approvedCountShow: undefined,//展示的
  462. totalMass: undefined, //总质量
  463. totalMassShow: undefined, //总质量
  464. maintenaceMass: undefined, //整备质量
  465. maintenaceMassShow: undefined, //整备质量展示的
  466. permittedWeight: "", //核定载质量
  467. vehicleDimensions: "", //车辆尺寸
  468. permittedTowWeight: "", //准牵引总质量
  469. axleCount: "", //车轴数
  470. ownerName: "", //车主姓名
  471. ownerIdType: "", //车主证件类型
  472. ownerIdNum: "", //车主证件号码
  473. ownPosImgUrl: "", //车主证件正面图片
  474. ownNegImgUrl: "", //车主证件反面图片
  475. agreementId: "", //签约编号
  476. channelId: "5201018892300000001", //编号渠道
  477. scenePayType: "", //
  478. transportIdNum: "", //道路运输证编号
  479. licenseIdNum: "", //经营许可证编号
  480. vehBodyUrl: "", //车身照片
  481. proxyUrl: "", //委托书地址
  482. roadTransportPermitPicUrl: "", //道路运输许可证
  483. opId: "",
  484. tractorSign: 0, //是否是牵引车 1 是 0 不是
  485. },
  486. vehiclePlateColor: undefined,
  487. orderId: "",
  488. // type: undefined, //标记来源是否登录 1为未登录数据 - 需要新增地址
  489. show: false,
  490. isMyPeopple: true,
  491. outlineL: "",
  492. outlineW: "",
  493. outlineH: "",
  494. isEnableChangeOCRCarInfo: true, //申办时是否允许修改OCR识别出来的车辆信息数据
  495. items: [{
  496. value: '1',
  497. name: '是',
  498. },
  499. {
  500. value: '0',
  501. name: '否',
  502. checked: 'true'
  503. }],
  504. current: 1,
  505. });
  506. onLoad((option : any) => {
  507. state.form.orderId = option.orderId;
  508. state.form.type = option.type;
  509. state.vehiclePlateColor = option.vehiclePlateColor;
  510. if (option.vehicleId) {
  511. state.form.vehicleId = option.vehicleId;
  512. }
  513. console.log("option", option)
  514. getGlobalParam();
  515. if (option.type == 1) {
  516. state.actionSheetList = [{
  517. text: "普通车",
  518. value: 0,
  519. }]
  520. } else {
  521. state.actionSheetList = [{
  522. text: "普通车",
  523. value: 0,
  524. },
  525. {
  526. text: "道路运输证经营范围仅有“货物专用运输(集装箱) ”的牵引车办理J类型集装箱",
  527. value: 24,
  528. },
  529. {
  530. text: "道路运输证经营范围不含“货物专用运输(集装箱)”的牵引车",
  531. value: 27,
  532. },
  533. {
  534. text: '道路运输证经营范围除“货物专用运输 (集装 箱)"外,还有“普通货运”等其他项目的牵引车办理J2类型集装箱',
  535. value: 28,
  536. }]
  537. }
  538. });
  539. //外廓尺寸输入框
  540. const outlineInput = (e) => {
  541. state.form.vehicleDimensions =
  542. state.outlineL + "X" + state.outlineW + "X" + state.outlineH + "mm";
  543. };
  544. //过户检测
  545. const queryGuoHuJianCeAction = () => {
  546. var data = {
  547. orderId: state.form.orderId,
  548. };
  549. const options = {
  550. type: 2,
  551. data: data,
  552. method: "POST",
  553. showLoading: true,
  554. };
  555. return new Promise(async (resolve, reject) => {
  556. const res = await request(queryGuoHuJianCe, options);
  557. const data = stringToJson(res.bizContent);
  558. console.log("过户检测111", data)
  559. resolve(data);
  560. }).catch((error) => {
  561. reject(error);
  562. });
  563. };
  564. //过户操作
  565. const guohuAction = (val) => {
  566. var data = {
  567. orderId: state.form.orderId,
  568. serviceType: "USE",
  569. obuId: val.obuId,
  570. cardId: val.cardId,
  571. };
  572. const options = {
  573. type: 2,
  574. data: data,
  575. method: "POST",
  576. showLoading: true,
  577. };
  578. return new Promise(async (resolve, reject) => {
  579. const res = await request(queryGuoHuCaoZuo, options);
  580. const data = stringToJson(res.bizContent);
  581. state.show = false;
  582. uni.redirectTo({
  583. url: `/subpackage/orders/product-detail?orderId=${state.form.orderId}&&clientFee=${getItem("clientFee")}&&id=${getItem("productId")}&&isValueCard=${getItem("isValueCard")}`,
  584. });
  585. }).catch((error) => {
  586. reject(error);
  587. });
  588. };
  589. const getGlobalParam = () => {
  590. const data = getItem('globalParam')
  591. console.log("全局配置数据", getCodeName('IS_ENABLE', data.applyChangeOCRCarInfo))
  592. // 申办时是否允许修改OCR识别出来的车辆信息数据
  593. if (getCodeName('IS_ENABLE', data.applyChangeOCRCarInfo) == '启用') {
  594. state.isEnableChangeOCRCarInfo = false;
  595. } else {
  596. state.isEnableChangeOCRCarInfo = true;
  597. }
  598. // 中办时是否允许带出车辆信息
  599. console.log("11", getCodeName('IS_ENABLE', data.applyCarInfo))
  600. if (getCodeName('IS_ENABLE', data.applyCarInfo) == '启用') {
  601. // 获取车辆信息
  602. getCarMessage()
  603. console.log("11")
  604. }
  605. }
  606. const getCarMessage = () => {
  607. const options = {
  608. type: 2,
  609. data: {
  610. vehicleId: state.form.vehicleId,
  611. // vehicleId: "贵ZAAA47_0",
  612. },
  613. method: "POST",
  614. showLoading: true,
  615. };
  616. request(carMessageApi, options).then((res) => {
  617. const data = stringToJson(res.bizContent);
  618. console.log("通过vehicleId查询车辆信息", data)
  619. if (data.data) {
  620. writeMsg(data.data)
  621. }
  622. })
  623. }
  624. const writeMsg = (allData) => {
  625. console.log("车辆信息", allData);
  626. state.form.ownPosImgUrl = allData['ownerPosImgUrl']
  627. state.form.ownNegImgUrl = allData['ownerNegImgUrl']
  628. state.form.userName = allData['contacts']
  629. state.form.userIdNum = allData['ownerIdNum']
  630. state.form.ownerIdNum = allData['ownerIdNum']
  631. state.form.address = allData['ownerAddress']
  632. state.form.tel = allData['ownerTel']
  633. state.form.vehPosImgUrl = allData['vehPosImgUrl']
  634. state.form.vehNegImgUrl = allData['vehNegImgUrl']
  635. state.form.vehBodyUrl = allData['vehBodyUrl']
  636. state.form.vehicleIdNum = allData['vehiclePlate']
  637. state.form.ownerName = allData['ownerName']
  638. state.form.vehicleType = allData['vehicleType']
  639. // state.form.character = allData['vehicleType'] //使用性质
  640. state.form.vin = allData['vin']
  641. state.form.engineNum = allData['engineNum']
  642. state.form.register = allData['registerDate']
  643. state.form.issueDate = allData['issueDate']
  644. state.form.approvedCountShow = allData['approvedCount']
  645. state.form.maintenaceMassShow = allData['maintenaceMass']
  646. state.form.approvedCount = allData['approvedCount']
  647. state.form.maintenaceMass = allData['maintenaceMass']
  648. allData['vehicleDimensions']
  649. let arr = allData['vehicleDimensions'].split("X");
  650. state.outlineL = parseInt(arr[0]); //外廓 长
  651. state.outlineW = parseInt(arr[1]); //外廓 宽
  652. state.outlineH = parseInt(arr[2].substring(0, arr[2].length - 2)); //外廓 高
  653. state.form.totalMassShow = allData['totalMass']
  654. state.form.totalMass = allData['totalMass']
  655. state.form.axleCount = allData['axleCount'] ? allData['axleCount'] : 2
  656. if (allData['useUserType'] == 0) {
  657. state.form.useUserTypeName = "普通车"
  658. } else if (allData['useUserType'] == 24) {
  659. state.form.useUserTypeName = "道路运输证经营范围仅有“货物专用运输(集装箱) ”的牵引车办理J类型集装箱"
  660. } else if (allData['useUserType'] == 27) {
  661. state.form.useUserTypeName = "道路运输证经营范围不含“货物专用运输(集装箱)”的牵引车"
  662. } else if (allData['useUserType'] == 28) {
  663. state.form.useUserTypeName = "道路运输证经营范围除'货物专用运输 (集装 箱)'外,还有“普通货运”等其他项目的牵引车办理J2类型集装箱"
  664. }
  665. state.vehiclePlateColor = allData['vehiclePlateColor']
  666. state.form.customerId = allData['customerId']
  667. }
  668. const bindDateChange1 = (e) => {
  669. state.form.register = e.detail.value
  670. state.changeColor = true;
  671. }
  672. const bindDateChange2 = (e) => {
  673. state.form.issueDate = e.detail.value
  674. state.changeColor = true;
  675. }
  676. const xiangce = (val) => {
  677. console.log("val", val)
  678. if (state.choiceIndex == 3) {
  679. var imageType = 1;
  680. } else {
  681. var imageType = 2;
  682. }
  683. state.changeColor = true;
  684. uni.chooseImage({
  685. count: 1, //只能选取一张照片
  686. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  687. sourceType: ["album"], //从相册选择
  688. success: function (res) {
  689. console.log("tempFilePaths[0].startsWith('file://')", res.tempFilePaths[0], res.tempFilePaths[0].startsWith('file://'))
  690. compressImage(res.tempFilePaths[0], (res) => {
  691. console.log("过来了", res)
  692. if (state.choiceIndex == 3 || state.choiceIndex == 4) {
  693. state.showImg = false
  694. state.images = res.tempFilePath
  695. state.phoneType = state.choiceIndex
  696. state.isTakePhotoModeShow = false
  697. return
  698. }
  699. })
  700. },
  701. })
  702. }
  703. const takePhoto = (val) => {
  704. console.log("拍照", val)
  705. state.phoneType = val;
  706. state.showImg = true;
  707. }
  708. const confirmReturn = (val) => {
  709. if (state.choiceIndex == 3) {
  710. var imageType = 1;
  711. } else {
  712. var imageType = 2;
  713. }
  714. state.changeColor = true;
  715. state.phoneType = 0
  716. state.isTakePhotoModeShow = false
  717. uploadFile(val.tempImagePath, imageType, etcCarOcrCard).then((data) => {
  718. // uploadFile(val.tempImagePath, state.choiceIndex, ocrAllQuery).then((data) => {
  719. console.log('输出内容=====================', state.choiceIndex)
  720. if (state.choiceIndex === "3") {
  721. if (data.plate_a.length > 8) {
  722. state.form.vehicleIdNum = data.plate_a.substring(0, 8);
  723. } else {
  724. state.form.vehicleIdNum = data.plate_a;
  725. }
  726. state.form.ownerName = data.man;
  727. state.form.vehicleType = data.vehicle;
  728. state.form.character = data.character;
  729. state.form.vin = data.vin;
  730. state.form.engineNum = data.engine;
  731. state.form.register = data.register;
  732. state.form.issueDate = data.issue;
  733. state.form.vehPosImgUrl = data.imageUrl;
  734. state.form.vehicleModel = data.model;
  735. console.log("走不是牵引车的", data.vehicle.indexOf('牵引车'), data.vehicle)
  736. if (data.vehicle.indexOf('牵引车') > 0) {
  737. qian()
  738. } else {
  739. console.log("走不是牵引车的")
  740. notQian()
  741. }
  742. } else {
  743. state.form.approvedCount = data.apc;
  744. state.form.approvedCountShow = data.apc;
  745. state.form.maintenaceMass = data.unladen;
  746. state.form.maintenaceMassShow = data.unladen;
  747. // 91接口差
  748. // // #ifdef MP-WEIXIN
  749. // state.form.vehicleDimensions = data.overall.replaceAll("×", "X");
  750. // // #endif
  751. // // #ifdef MP-ALIPAY
  752. // state.form.vehicleDimensions = data.overall.replace(/×/g, "X");
  753. // // #endif
  754. // let arr = data.overall.split("×");
  755. // #ifdef MP-WEIXIN
  756. state.form.vehicleDimensions = data.overall.replaceAll("x", "X");
  757. // #endif
  758. // #ifdef MP-ALIPAY
  759. state.form.vehicleDimensions = data.overall.replace(/x/g, "X");
  760. // #endif
  761. let arr = data.overall.split("x");
  762. state.outlineL = arr[0]; //外廓 长
  763. state.outlineW = arr[1]; //外廓 宽
  764. state.outlineH = arr[2].substring(0, arr[2].length - 2); //外廓 高
  765. state.form.totalMass = data.gross;
  766. state.form.totalMassShow = data.gross;
  767. state.form.vehNegImgUrl = data.imageUrl;
  768. state.form.permittedWeight = data.alc ? data.alc : 0;
  769. state.form.permittedTowWeight = data.towing ? data.towing : 0;
  770. if (data.towing) {
  771. qian()
  772. } else {
  773. notQian()
  774. }
  775. console.log('=====================', state.form.vehNegImgUrl, state)
  776. }
  777. state.isTakePhotoModeShow = false
  778. })
  779. console.log("图片地址val", val.tempImagePath)
  780. }
  781. const takePhotoMode = (index) => {
  782. console.log("index", index)
  783. state.isTakePhotoModeShow = true
  784. state.choiceIndex = index
  785. }
  786. const cancle = () => {
  787. state.isTakePhotoModeShow = false
  788. }
  789. const radioChange = (evt) => {
  790. console.log("evt.detail.value", evt.detail.value)
  791. for (let i = 0; i < state.items.length; i++) {
  792. if (state.items[i].value === evt.detail.value) {
  793. state.current = i;
  794. state.form.tractorSign = evt.detail.value;
  795. break;
  796. }
  797. }
  798. }
  799. // 牵引车
  800. const qian = () => {
  801. state.items = [{
  802. value: '1',
  803. name: '是',
  804. checked: 'true'
  805. },
  806. {
  807. value: '0',
  808. name: '否',
  809. }]
  810. for (let i = 0; i < state.items.length; i++) {
  811. if (state.items[i].value === '1') {
  812. state.current = i;
  813. state.form.tractorSign = 1;
  814. break;
  815. }
  816. }
  817. }
  818. // 不是牵引车
  819. const notQian = () => {
  820. state.items = [{
  821. value: '1',
  822. name: '是',
  823. },
  824. {
  825. value: '0',
  826. name: '否',
  827. checked: 'true'
  828. }]
  829. for (let i = 0; i < state.items.length; i++) {
  830. console.log("不是牵引车", state.items[i].value, state.items[i].value === '0')
  831. if (state.items[i].value === '0') {
  832. state.current = i;
  833. state.form.tractorSign = 0;
  834. break;
  835. }
  836. }
  837. }
  838. </script>
  839. <style lang="scss" scoped>
  840. .hui {
  841. color: #ccc;
  842. }
  843. .hei {
  844. color: black;
  845. }
  846. .goto {
  847. margin-right: 20rpx;
  848. padding: 10rpx;
  849. color: #00b38b;
  850. border: 1rpx solid #00b38b;
  851. border-radius: 20rpx;
  852. }
  853. .flex {
  854. display: flex;
  855. align-items: center;
  856. }
  857. .bettwen-center {
  858. display: flex;
  859. align-items: center;
  860. justify-content: space-between;
  861. }
  862. .card {
  863. margin: 20rpx;
  864. height: 150rpx;
  865. background: #ffffff;
  866. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  867. border-radius: 20rpx;
  868. padding: 20rpx;
  869. display: flex;
  870. justify-content: space-between;
  871. align-items: center;
  872. margin-bottom: 30rpx;
  873. .card-left {
  874. display: flex;
  875. align-items: center;
  876. image {
  877. width: 100rpx;
  878. height: 90rpx;
  879. }
  880. .card-center {
  881. margin-left: 30rpx;
  882. .card-center-head {
  883. font-size: 32rpx;
  884. font-family: Noto Sans S Chinese;
  885. font-weight: 400;
  886. color: #333333;
  887. }
  888. .tips {
  889. font-size: 26rpx;
  890. font-family: Noto Sans S Chinese;
  891. font-weight: 400;
  892. color: #666666;
  893. .tips-card {
  894. width: 70rpx;
  895. height: 40rpx;
  896. background: #d3f2ef;
  897. border-radius: 6rpx;
  898. font-size: 20rpx;
  899. font-family: Noto Sans S Chinese;
  900. font-weight: 400;
  901. color: #0a8f8a;
  902. padding: 5rpx 10rpx;
  903. margin-left: 20rpx;
  904. }
  905. }
  906. }
  907. }
  908. .choose-item {
  909. margin-right: 20rpx;
  910. width: 50rpx;
  911. height: 50rpx;
  912. border: 1rpx solid #00b38b;
  913. border-radius: 50%;
  914. display: flex;
  915. justify-content: center;
  916. align-items: center;
  917. .active {
  918. width: 38rpx;
  919. height: 38rpx;
  920. background: #00b38b;
  921. border-radius: 50%;
  922. }
  923. }
  924. }
  925. .content {
  926. position: relative;
  927. margin-top: -50rpx;
  928. padding: 0rpx 30rpx;
  929. position: relative;
  930. .img-pos {
  931. position: absolute;
  932. left: 270rpx;
  933. top: -38rpx;
  934. right: 50rpx;
  935. .img-flex {
  936. display: flex;
  937. justify-content: space-between;
  938. align-items: center;
  939. .car-img {
  940. width: 86rpx;
  941. height: 42rpx;
  942. }
  943. .flag-img {
  944. width: 30rpx;
  945. height: 35rpx;
  946. }
  947. }
  948. }
  949. .action {
  950. padding-left: 20rpx;
  951. padding-right: 20rpx;
  952. padding-bottom: 30rpx;
  953. .button {
  954. height: 80rpx;
  955. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  956. border-radius: 40rpx;
  957. font-size: 32rpx;
  958. font-weight: 400;
  959. color: #ffffff;
  960. line-height: 80rpx;
  961. }
  962. }
  963. .item-tips {
  964. .title {
  965. font-size: 30rpx;
  966. font-family: Microsoft YaHei;
  967. font-weight: 400;
  968. color: #000000;
  969. line-height: 24rpx;
  970. }
  971. .tip {
  972. margin-top: 16rpx;
  973. font-size: 24rpx;
  974. font-family: Microsoft YaHei;
  975. font-weight: 400;
  976. color: #999999;
  977. line-height: 24rpx;
  978. }
  979. }
  980. .picture-wrapper {
  981. margin-top: 40rpx;
  982. .bg {
  983. background: #ffffff;
  984. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  985. border-radius: 20rpx;
  986. padding: 40rpx;
  987. display: flex;
  988. // align-items: center;
  989. justify-content: space-between;
  990. .name {
  991. font-size: 34rpx;
  992. font-family: Microsoft YaHei;
  993. font-weight: 400;
  994. color: #000000;
  995. line-height: 34rpx;
  996. }
  997. .value {
  998. margin-top: 20rpx;
  999. font-size: 24rpx;
  1000. font-family: Microsoft YaHei;
  1001. font-weight: 400;
  1002. color: #999999;
  1003. line-height: 24rpx;
  1004. }
  1005. .tip {
  1006. margin-top: 20rpx;
  1007. text-align: center;
  1008. width: 110rpx;
  1009. height: 40rpx;
  1010. background: rgba(33, 190, 177, 0.2);
  1011. border-radius: 6rpx;
  1012. .tip-value {
  1013. font-size: 20rpx;
  1014. font-family: Microsoft YaHei;
  1015. font-weight: 400;
  1016. color: #0a8f8a;
  1017. line-height: 40rpx;
  1018. opacity: 1;
  1019. }
  1020. }
  1021. }
  1022. .icon {
  1023. width: 294rpx;
  1024. height: 188rpx;
  1025. }
  1026. }
  1027. .shibie-wrapper {
  1028. margin-top: 60rpx;
  1029. .title {
  1030. font-size: 30rpx;
  1031. font-family: Microsoft YaHei;
  1032. font-weight: 400;
  1033. color: #000000;
  1034. line-height: 30rpx;
  1035. }
  1036. }
  1037. .buchong-wrapper {
  1038. margin-top: 60rpx;
  1039. .title {
  1040. font-size: 30rpx;
  1041. font-family: Microsoft YaHei;
  1042. font-weight: 400;
  1043. color: #000000;
  1044. line-height: 30rpx;
  1045. }
  1046. }
  1047. .green-tip {
  1048. margin-top: 50rpx;
  1049. font-size: 24rpx;
  1050. font-family: Microsoft YaHei;
  1051. font-weight: 400;
  1052. color: #00b38b;
  1053. line-height: 24rpx;
  1054. margin-bottom: 60rpx;
  1055. }
  1056. }
  1057. .form-item {
  1058. display: flex;
  1059. font-size: 28rpx;
  1060. justify-content: space-between;
  1061. align-items: center;
  1062. }
  1063. .form-item label {}
  1064. .form-item .input-box {
  1065. display: flex;
  1066. align-items: center;
  1067. }
  1068. .form-item .select {
  1069. flex: 1;
  1070. background: #f1f1f1;
  1071. padding: 6rpx 20rpx;
  1072. margin: 0 10rpx;
  1073. min-height: 48rpx;
  1074. line-height: 48rpx;
  1075. border-radius: 8rpx;
  1076. }
  1077. .form-item .icon {
  1078. width: 28rpx;
  1079. height: 32rpx;
  1080. }
  1081. .form-item .input-box input {
  1082. width: 90rpx;
  1083. background: #f1f1f1;
  1084. border-radius: 8rpx;
  1085. padding: 0 5rpx;
  1086. }
  1087. .form-item .sub-text {
  1088. color: #808080;
  1089. padding-left: 10rpx;
  1090. }
  1091. .form-item .sub-label {
  1092. padding: 0 10rpx;
  1093. }
  1094. .window {
  1095. padding: 60rpx 30rpx;
  1096. }
  1097. .window .window-item {
  1098. border: 1px solid #00b38b;
  1099. background: rgba(0, 179, 139, .1);
  1100. border-radius: 10rpx;
  1101. padding: 16rpx 30rpx;
  1102. font-size: 30rpx;
  1103. margin-bottom: 10rpx;
  1104. }
  1105. ::v-deep .u-input__input {
  1106. background: transparent;
  1107. }
  1108. .choice-takePhoto {
  1109. position: absolute;
  1110. bottom: 0;
  1111. background-color: white;
  1112. width: 100%;
  1113. border-radius: 20rpx 20rpx 0 0;
  1114. }
  1115. .choice-takePhoto>view:first-child {
  1116. text-align: center;
  1117. height: 80rpx;
  1118. line-height: 80rpx;
  1119. border-bottom: 1rpx solid rgba(127, 127, 127, 0.3);
  1120. background-color: white;
  1121. }
  1122. .choice-takePhoto>view:last-child {
  1123. text-align: center;
  1124. height: 80rpx;
  1125. line-height: 80rpx;
  1126. border-top: 6rpx solid rgba(127, 127, 127, 0.1);
  1127. background-color: white;
  1128. }
  1129. .choice-takePhoto>view {
  1130. text-align: center;
  1131. height: 80rpx;
  1132. line-height: 80rpx;
  1133. background-color: white;
  1134. }
  1135. .choice-takePhoto-wrap {
  1136. width: 100%;
  1137. height: 100vh;
  1138. background-color: rgba(127, 127, 127, 0.2);
  1139. position: fixed;
  1140. left: 0;
  1141. top: 0;
  1142. z-index: 11111;
  1143. }
  1144. .tractor {
  1145. font-size: 32rpx;
  1146. margin-top: 40rpx;
  1147. }
  1148. .tractor .title {
  1149. margin-right: 60rpx;
  1150. }
  1151. // .tractor .title .label {
  1152. // margin-right: 40rpx !important;
  1153. // }
  1154. </style>