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

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