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.

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