Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

car-release.vue 35KB

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