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

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