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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245
  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: "贵ZAAA44_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. // state.form.userPosImgUrl = data.customerPosImgUrl;
  623. // state.form.userNegImgUrl = data.customerNegImgUrl;
  624. // state.form.userName = data.customerName;
  625. // state.form.userIdNum = data.customerIdNum;
  626. // state.form.address = data.customerAddress;
  627. // state.form.tel = data.customerTel;
  628. })
  629. }
  630. const writeMsg = (allData) => {
  631. console.log("车辆信息", allData);
  632. state.form.ownPosImgUrl = allData['ownerPosImgUrl']
  633. state.form.ownNegImgUrl = allData['ownerNegImgUrl']
  634. state.form.userName = allData['contacts']
  635. state.form.userIdNum = allData['ownerIdNum']
  636. state.form.ownerIdNum = allData['ownerIdNum']
  637. state.form.address = allData['ownerAddress']
  638. state.form.tel = allData['ownerTel']
  639. state.form.vehPosImgUrl = allData['vehPosImgUrl']
  640. state.form.vehNegImgUrl = allData['vehNegImgUrl']
  641. state.form.vehBodyUrl = allData['vehBodyUrl']
  642. state.form.vehicleIdNum = allData['vehiclePlate']
  643. state.form.ownerName = allData['ownerName']
  644. state.form.vehicleType = allData['vehicleType']
  645. // state.form.character = allData['vehicleType'] //使用性质
  646. state.form.vin = allData['vin']
  647. state.form.engineNum = allData['engineNum']
  648. state.form.register = allData['registerDate']
  649. state.form.issueDate = allData['issueDate']
  650. state.form.approvedCountShow = allData['approvedCount']
  651. state.form.maintenaceMassShow = allData['maintenaceMass']
  652. state.form.approvedCount = allData['approvedCount']
  653. state.form.maintenaceMass = allData['maintenaceMass']
  654. allData['vehicleDimensions']
  655. let arr = allData['vehicleDimensions'].split("X");
  656. state.outlineL = parseInt(arr[0]); //外廓 长
  657. state.outlineW = parseInt(arr[1]); //外廓 宽
  658. state.outlineH = parseInt(arr[2].substring(0, arr[2].length - 2)); //外廓 高
  659. state.form.totalMassShow = allData['totalMass']
  660. state.form.totalMass = allData['totalMass']
  661. state.form.axleCount = allData['axleCount'] ? allData['axleCount'] : 2
  662. if (allData['useUserType'] == 0) {
  663. state.form.useUserTypeName = "普通车"
  664. } else if (allData['useUserType'] == 24) {
  665. state.form.useUserTypeName = "道路运输证经营范围仅有“货物专用运输(集装箱) ”的牵引车办理J类型集装箱"
  666. } else if (allData['useUserType'] == 27) {
  667. state.form.useUserTypeName = "道路运输证经营范围不含“货物专用运输(集装箱)”的牵引车"
  668. } else if (allData['useUserType'] == 28) {
  669. state.form.useUserTypeName = "道路运输证经营范围除'货物专用运输 (集装 箱)'外,还有“普通货运”等其他项目的牵引车办理J2类型集装箱"
  670. }
  671. state.vehiclePlateColor = allData['vehiclePlateColor']
  672. state.form.customerId = allData['customerId']
  673. }
  674. const bindDateChange1 = (e) => {
  675. state.form.register = e.detail.value
  676. state.changeColor = true;
  677. }
  678. const bindDateChange2 = (e) => {
  679. state.form.issueDate = e.detail.value
  680. state.changeColor = true;
  681. }
  682. const xiangce = (val) => {
  683. console.log("val", val)
  684. if (state.choiceIndex == 3) {
  685. var imageType = 1;
  686. } else {
  687. var imageType = 2;
  688. }
  689. state.changeColor = true;
  690. uni.chooseImage({
  691. count: 1, //只能选取一张照片
  692. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  693. sourceType: ["album"], //从相册选择
  694. success: function (res) {
  695. console.log("tempFilePaths[0].startsWith('file://')", res.tempFilePaths[0], res.tempFilePaths[0].startsWith('file://'))
  696. compressImage(res.tempFilePaths[0], (res) => {
  697. console.log("过来了", res)
  698. if (state.choiceIndex == 3 || state.choiceIndex == 4) {
  699. state.showImg = false
  700. state.images = res.tempFilePath
  701. state.phoneType = state.choiceIndex
  702. state.isTakePhotoModeShow = false
  703. return
  704. }
  705. })
  706. },
  707. })
  708. }
  709. const takePhoto = (val) => {
  710. console.log("拍照", val)
  711. state.phoneType = val;
  712. state.showImg = true;
  713. }
  714. const confirmReturn = (val) => {
  715. if (state.choiceIndex == 3) {
  716. var imageType = 1;
  717. } else {
  718. var imageType = 2;
  719. }
  720. state.changeColor = true;
  721. state.phoneType = 0
  722. state.isTakePhotoModeShow = false
  723. uploadFile(val.tempImagePath, imageType, etcCarOcrCard).then((data) => {
  724. // uploadFile(val.tempImagePath, state.choiceIndex, ocrAllQuery).then((data) => {
  725. console.log('输出内容=====================', state.choiceIndex)
  726. if (state.choiceIndex === "3") {
  727. if (data.plate_a.length > 8) {
  728. state.form.vehicleIdNum = data.plate_a.substring(0, 8);
  729. } else {
  730. state.form.vehicleIdNum = data.plate_a;
  731. }
  732. state.form.ownerName = data.man;
  733. state.form.vehicleType = data.vehicle;
  734. state.form.character = data.character;
  735. state.form.vin = data.vin;
  736. state.form.engineNum = data.engine;
  737. state.form.register = data.register;
  738. state.form.issueDate = data.issue;
  739. state.form.vehPosImgUrl = data.imageUrl;
  740. state.form.vehicleModel = data.model;
  741. console.log("走不是牵引车的", data.vehicle.indexOf('牵引车'), data.vehicle)
  742. if (data.vehicle.indexOf('牵引车') > 0) {
  743. qian()
  744. } else {
  745. console.log("走不是牵引车的")
  746. notQian()
  747. }
  748. } else {
  749. state.form.approvedCount = data.apc;
  750. state.form.approvedCountShow = data.apc;
  751. state.form.maintenaceMass = data.unladen;
  752. state.form.maintenaceMassShow = data.unladen;
  753. // 91接口差
  754. // // #ifdef MP-WEIXIN
  755. // state.form.vehicleDimensions = data.overall.replaceAll("×", "X");
  756. // // #endif
  757. // // #ifdef MP-ALIPAY
  758. // state.form.vehicleDimensions = data.overall.replace(/×/g, "X");
  759. // // #endif
  760. // let arr = data.overall.split("×");
  761. // #ifdef MP-WEIXIN
  762. state.form.vehicleDimensions = data.overall.replaceAll("x", "X");
  763. // #endif
  764. // #ifdef MP-ALIPAY
  765. state.form.vehicleDimensions = data.overall.replace(/x/g, "X");
  766. // #endif
  767. let arr = data.overall.split("x");
  768. state.outlineL = arr[0]; //外廓 长
  769. state.outlineW = arr[1]; //外廓 宽
  770. state.outlineH = arr[2].substring(0, arr[2].length - 2); //外廓 高
  771. state.form.totalMass = data.gross;
  772. state.form.totalMassShow = data.gross;
  773. state.form.vehNegImgUrl = data.imageUrl;
  774. state.form.permittedWeight = data.alc ? data.alc : 0;
  775. state.form.permittedTowWeight = data.towing ? data.towing : 0;
  776. if (data.towing) {
  777. qian()
  778. } else {
  779. notQian()
  780. }
  781. console.log('=====================', state.form.vehNegImgUrl, state)
  782. }
  783. state.isTakePhotoModeShow = false
  784. })
  785. console.log("图片地址val", val.tempImagePath)
  786. }
  787. const takePhotoMode = (index) => {
  788. console.log("index", index)
  789. state.isTakePhotoModeShow = true
  790. state.choiceIndex = index
  791. }
  792. const cancle = () => {
  793. state.isTakePhotoModeShow = false
  794. }
  795. const radioChange = (evt) => {
  796. console.log("evt.detail.value", evt.detail.value)
  797. for (let i = 0; i < state.items.length; i++) {
  798. if (state.items[i].value === evt.detail.value) {
  799. state.current = i;
  800. state.form.tractorSign = evt.detail.value;
  801. break;
  802. }
  803. }
  804. }
  805. // 牵引车
  806. const qian = () => {
  807. state.items = [{
  808. value: '1',
  809. name: '是',
  810. checked: 'true'
  811. },
  812. {
  813. value: '0',
  814. name: '否',
  815. }]
  816. for (let i = 0; i < state.items.length; i++) {
  817. if (state.items[i].value === '1') {
  818. state.current = i;
  819. state.form.tractorSign = 1;
  820. break;
  821. }
  822. }
  823. }
  824. // 不是牵引车
  825. const notQian = () => {
  826. state.items = [{
  827. value: '1',
  828. name: '是',
  829. },
  830. {
  831. value: '0',
  832. name: '否',
  833. checked: 'true'
  834. }]
  835. for (let i = 0; i < state.items.length; i++) {
  836. console.log("不是牵引车", state.items[i].value, state.items[i].value === '0')
  837. if (state.items[i].value === '0') {
  838. state.current = i;
  839. state.form.tractorSign = 0;
  840. break;
  841. }
  842. }
  843. }
  844. </script>
  845. <style lang="scss" scoped>
  846. .hui {
  847. color: #ccc;
  848. }
  849. .hei {
  850. color: black;
  851. }
  852. .goto {
  853. margin-right: 20rpx;
  854. padding: 10rpx;
  855. color: #00b38b;
  856. border: 1rpx solid #00b38b;
  857. border-radius: 20rpx;
  858. }
  859. .flex {
  860. display: flex;
  861. align-items: center;
  862. }
  863. .bettwen-center {
  864. display: flex;
  865. align-items: center;
  866. justify-content: space-between;
  867. }
  868. .card {
  869. margin: 20rpx;
  870. height: 150rpx;
  871. background: #ffffff;
  872. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  873. border-radius: 20rpx;
  874. padding: 20rpx;
  875. display: flex;
  876. justify-content: space-between;
  877. align-items: center;
  878. margin-bottom: 30rpx;
  879. .card-left {
  880. display: flex;
  881. align-items: center;
  882. image {
  883. width: 100rpx;
  884. height: 90rpx;
  885. }
  886. .card-center {
  887. margin-left: 30rpx;
  888. .card-center-head {
  889. font-size: 32rpx;
  890. font-family: Noto Sans S Chinese;
  891. font-weight: 400;
  892. color: #333333;
  893. }
  894. .tips {
  895. font-size: 26rpx;
  896. font-family: Noto Sans S Chinese;
  897. font-weight: 400;
  898. color: #666666;
  899. .tips-card {
  900. width: 70rpx;
  901. height: 40rpx;
  902. background: #d3f2ef;
  903. border-radius: 6rpx;
  904. font-size: 20rpx;
  905. font-family: Noto Sans S Chinese;
  906. font-weight: 400;
  907. color: #0a8f8a;
  908. padding: 5rpx 10rpx;
  909. margin-left: 20rpx;
  910. }
  911. }
  912. }
  913. }
  914. .choose-item {
  915. margin-right: 20rpx;
  916. width: 50rpx;
  917. height: 50rpx;
  918. border: 1rpx solid #00b38b;
  919. border-radius: 50%;
  920. display: flex;
  921. justify-content: center;
  922. align-items: center;
  923. .active {
  924. width: 38rpx;
  925. height: 38rpx;
  926. background: #00b38b;
  927. border-radius: 50%;
  928. }
  929. }
  930. }
  931. .content {
  932. position: relative;
  933. margin-top: -50rpx;
  934. padding: 0rpx 30rpx;
  935. position: relative;
  936. .img-pos {
  937. position: absolute;
  938. left: 270rpx;
  939. top: -38rpx;
  940. right: 50rpx;
  941. .img-flex {
  942. display: flex;
  943. justify-content: space-between;
  944. align-items: center;
  945. .car-img {
  946. width: 86rpx;
  947. height: 42rpx;
  948. }
  949. .flag-img {
  950. width: 30rpx;
  951. height: 35rpx;
  952. }
  953. }
  954. }
  955. .action {
  956. padding-left: 20rpx;
  957. padding-right: 20rpx;
  958. padding-bottom: 30rpx;
  959. .button {
  960. height: 80rpx;
  961. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  962. border-radius: 40rpx;
  963. font-size: 32rpx;
  964. font-weight: 400;
  965. color: #ffffff;
  966. line-height: 80rpx;
  967. }
  968. }
  969. .item-tips {
  970. .title {
  971. font-size: 30rpx;
  972. font-family: Microsoft YaHei;
  973. font-weight: 400;
  974. color: #000000;
  975. line-height: 24rpx;
  976. }
  977. .tip {
  978. margin-top: 16rpx;
  979. font-size: 24rpx;
  980. font-family: Microsoft YaHei;
  981. font-weight: 400;
  982. color: #999999;
  983. line-height: 24rpx;
  984. }
  985. }
  986. .picture-wrapper {
  987. margin-top: 40rpx;
  988. .bg {
  989. background: #ffffff;
  990. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  991. border-radius: 20rpx;
  992. padding: 40rpx;
  993. display: flex;
  994. // align-items: center;
  995. justify-content: space-between;
  996. .name {
  997. font-size: 34rpx;
  998. font-family: Microsoft YaHei;
  999. font-weight: 400;
  1000. color: #000000;
  1001. line-height: 34rpx;
  1002. }
  1003. .value {
  1004. margin-top: 20rpx;
  1005. font-size: 24rpx;
  1006. font-family: Microsoft YaHei;
  1007. font-weight: 400;
  1008. color: #999999;
  1009. line-height: 24rpx;
  1010. }
  1011. .tip {
  1012. margin-top: 20rpx;
  1013. text-align: center;
  1014. width: 110rpx;
  1015. height: 40rpx;
  1016. background: rgba(33, 190, 177, 0.2);
  1017. border-radius: 6rpx;
  1018. .tip-value {
  1019. font-size: 20rpx;
  1020. font-family: Microsoft YaHei;
  1021. font-weight: 400;
  1022. color: #0a8f8a;
  1023. line-height: 40rpx;
  1024. opacity: 1;
  1025. }
  1026. }
  1027. }
  1028. .icon {
  1029. width: 294rpx;
  1030. height: 188rpx;
  1031. }
  1032. }
  1033. .shibie-wrapper {
  1034. margin-top: 60rpx;
  1035. .title {
  1036. font-size: 30rpx;
  1037. font-family: Microsoft YaHei;
  1038. font-weight: 400;
  1039. color: #000000;
  1040. line-height: 30rpx;
  1041. }
  1042. }
  1043. .buchong-wrapper {
  1044. margin-top: 60rpx;
  1045. .title {
  1046. font-size: 30rpx;
  1047. font-family: Microsoft YaHei;
  1048. font-weight: 400;
  1049. color: #000000;
  1050. line-height: 30rpx;
  1051. }
  1052. }
  1053. .green-tip {
  1054. margin-top: 50rpx;
  1055. font-size: 24rpx;
  1056. font-family: Microsoft YaHei;
  1057. font-weight: 400;
  1058. color: #00b38b;
  1059. line-height: 24rpx;
  1060. margin-bottom: 60rpx;
  1061. }
  1062. }
  1063. .form-item {
  1064. display: flex;
  1065. font-size: 28rpx;
  1066. justify-content: space-between;
  1067. align-items: center;
  1068. }
  1069. .form-item label {}
  1070. .form-item .input-box {
  1071. display: flex;
  1072. align-items: center;
  1073. }
  1074. .form-item .select {
  1075. flex: 1;
  1076. background: #f1f1f1;
  1077. padding: 6rpx 20rpx;
  1078. margin: 0 10rpx;
  1079. min-height: 48rpx;
  1080. line-height: 48rpx;
  1081. border-radius: 8rpx;
  1082. }
  1083. .form-item .icon {
  1084. width: 28rpx;
  1085. height: 32rpx;
  1086. }
  1087. .form-item .input-box input {
  1088. width: 90rpx;
  1089. background: #f1f1f1;
  1090. border-radius: 8rpx;
  1091. padding: 0 5rpx;
  1092. }
  1093. .form-item .sub-text {
  1094. color: #808080;
  1095. padding-left: 10rpx;
  1096. }
  1097. .form-item .sub-label {
  1098. padding: 0 10rpx;
  1099. }
  1100. .window {
  1101. padding: 60rpx 30rpx;
  1102. }
  1103. .window .window-item {
  1104. border: 1px solid #00b38b;
  1105. background: rgba(0, 179, 139, .1);
  1106. border-radius: 10rpx;
  1107. padding: 16rpx 30rpx;
  1108. font-size: 30rpx;
  1109. margin-bottom: 10rpx;
  1110. }
  1111. ::v-deep .u-input__input {
  1112. background: transparent;
  1113. }
  1114. .choice-takePhoto {
  1115. position: absolute;
  1116. bottom: 0;
  1117. background-color: white;
  1118. width: 100%;
  1119. border-radius: 20rpx 20rpx 0 0;
  1120. }
  1121. .choice-takePhoto>view:first-child {
  1122. text-align: center;
  1123. height: 80rpx;
  1124. line-height: 80rpx;
  1125. border-bottom: 1rpx solid rgba(127, 127, 127, 0.3);
  1126. background-color: white;
  1127. }
  1128. .choice-takePhoto>view:last-child {
  1129. text-align: center;
  1130. height: 80rpx;
  1131. line-height: 80rpx;
  1132. border-top: 6rpx solid rgba(127, 127, 127, 0.1);
  1133. background-color: white;
  1134. }
  1135. .choice-takePhoto>view {
  1136. text-align: center;
  1137. height: 80rpx;
  1138. line-height: 80rpx;
  1139. background-color: white;
  1140. }
  1141. .choice-takePhoto-wrap {
  1142. width: 100%;
  1143. height: 100vh;
  1144. background-color: rgba(127, 127, 127, 0.2);
  1145. position: fixed;
  1146. left: 0;
  1147. top: 0;
  1148. z-index: 11111;
  1149. }
  1150. .tractor {
  1151. font-size: 32rpx;
  1152. margin-top: 40rpx;
  1153. }
  1154. .tractor .title {
  1155. margin-right: 60rpx;
  1156. }
  1157. // .tractor .title .label {
  1158. // margin-right: 40rpx !important;
  1159. // }
  1160. </style>