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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146
  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 } 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. if (state.choiceIndex == 3 || state.choiceIndex == 4) {
  602. state.showImg = false
  603. state.images = res.tempFilePaths[0]
  604. state.phoneType = state.choiceIndex
  605. state.isTakePhotoModeShow = false
  606. return
  607. }
  608. },
  609. })
  610. }
  611. const takePhoto = (val) => {
  612. console.log("拍照", val)
  613. state.phoneType = val;
  614. state.showImg = true;
  615. }
  616. const confirmReturn = (val) => {
  617. if (state.choiceIndex == 3) {
  618. var imageType = 1;
  619. } else {
  620. var imageType = 2;
  621. }
  622. state.changeColor = true;
  623. state.phoneType = 0
  624. state.isTakePhotoModeShow = false
  625. uploadFile(val.tempImagePath, imageType, etcCarOcrCard).then((data) => {
  626. // uploadFile(val.tempImagePath, state.choiceIndex, ocrAllQuery).then((data) => {
  627. console.log('输出内容=====================', state.choiceIndex)
  628. if (state.choiceIndex === "3") {
  629. if (data.plate_a.length > 8) {
  630. state.form.vehicleIdNum = data.plate_a.substring(0, 8);
  631. } else {
  632. state.form.vehicleIdNum = data.plate_a;
  633. }
  634. state.form.man = data.man;
  635. state.form.vehicleType = data.vehicle;
  636. state.form.character = data.character;
  637. state.form.vin = data.vin;
  638. state.form.engineNum = data.engine;
  639. state.form.register = data.register;
  640. state.form.issueDate = data.issue;
  641. state.form.vehPosImgUrl = data.imageUrl;
  642. state.form.vehicleModel = data.model;
  643. console.log("走不是牵引车的", data.vehicle.indexOf('牵引车'), data.vehicle)
  644. if (data.vehicle.indexOf('牵引车') > 0) {
  645. qian()
  646. } else {
  647. console.log("走不是牵引车的")
  648. notQian()
  649. }
  650. } else {
  651. state.form.approvedCount = data.apc;
  652. state.form.approvedCountShow = data.apc;
  653. state.form.maintenaceMass = data.unladen;
  654. state.form.maintenaceMassShow = data.unladen;
  655. // 91接口差
  656. // // #ifdef MP-WEIXIN
  657. // state.form.vehicleDimensions = data.overall.replaceAll("×", "X");
  658. // // #endif
  659. // // #ifdef MP-ALIPAY
  660. // state.form.vehicleDimensions = data.overall.replace(/×/g, "X");
  661. // // #endif
  662. // let arr = data.overall.split("×");
  663. // #ifdef MP-WEIXIN
  664. state.form.vehicleDimensions = data.overall.replaceAll("x", "X");
  665. // #endif
  666. // #ifdef MP-ALIPAY
  667. state.form.vehicleDimensions = data.overall.replace(/x/g, "X");
  668. // #endif
  669. let arr = data.overall.split("x");
  670. state.outlineL = arr[0]; //外廓 长
  671. state.outlineW = arr[1]; //外廓 宽
  672. state.outlineH = arr[2].substring(0, arr[2].length - 2); //外廓 高
  673. state.form.totalMass = data.gross;
  674. state.form.totalMassShow = data.gross;
  675. state.form.vehNegImgUrl = data.imageUrl;
  676. state.form.permittedWeight = data.alc ? data.alc : 0;
  677. state.form.permittedTowWeight = data.towing ? data.towing : 0;
  678. if (data.towing) {
  679. qian()
  680. } else {
  681. notQian()
  682. }
  683. console.log('=====================', state.form.vehNegImgUrl, state)
  684. }
  685. state.isTakePhotoModeShow = false
  686. })
  687. console.log("图片地址val", val.tempImagePath)
  688. }
  689. const takePhotoMode = (index) => {
  690. console.log("index", index)
  691. state.isTakePhotoModeShow = true
  692. state.choiceIndex = index
  693. }
  694. const cancle = () => {
  695. state.isTakePhotoModeShow = false
  696. }
  697. const radioChange = (evt) => {
  698. console.log("evt.detail.value", evt.detail.value)
  699. for (let i = 0; i < state.items.length; i++) {
  700. if (state.items[i].value === evt.detail.value) {
  701. state.current = i;
  702. state.form.tractorSign = evt.detail.value;
  703. break;
  704. }
  705. }
  706. }
  707. // 牵引车
  708. const qian = () => {
  709. state.items = [{
  710. value: '1',
  711. name: '是',
  712. checked: 'true'
  713. },
  714. {
  715. value: '0',
  716. name: '否',
  717. }]
  718. for (let i = 0; i < state.items.length; i++) {
  719. if (state.items[i].value === '1') {
  720. state.current = i;
  721. state.form.tractorSign = 1;
  722. break;
  723. }
  724. }
  725. }
  726. // 不是牵引车
  727. const notQian = () => {
  728. state.items = [{
  729. value: '1',
  730. name: '是',
  731. },
  732. {
  733. value: '0',
  734. name: '否',
  735. checked: 'true'
  736. }]
  737. for (let i = 0; i < state.items.length; i++) {
  738. console.log("不是牵引车", state.items[i].value, state.items[i].value === '0')
  739. if (state.items[i].value === '0') {
  740. state.current = i;
  741. state.form.tractorSign = 0;
  742. break;
  743. }
  744. }
  745. }
  746. </script>
  747. <style lang="scss" scoped>
  748. .hui {
  749. color: #ccc;
  750. }
  751. .hei {
  752. color: black;
  753. }
  754. .goto {
  755. margin-right: 20rpx;
  756. padding: 10rpx;
  757. color: #00b38b;
  758. border: 1rpx solid #00b38b;
  759. border-radius: 20rpx;
  760. }
  761. .flex {
  762. display: flex;
  763. align-items: center;
  764. }
  765. .bettwen-center {
  766. display: flex;
  767. align-items: center;
  768. justify-content: space-between;
  769. }
  770. .card {
  771. margin: 20rpx;
  772. height: 150rpx;
  773. background: #ffffff;
  774. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  775. border-radius: 20rpx;
  776. padding: 20rpx;
  777. display: flex;
  778. justify-content: space-between;
  779. align-items: center;
  780. margin-bottom: 30rpx;
  781. .card-left {
  782. display: flex;
  783. align-items: center;
  784. image {
  785. width: 100rpx;
  786. height: 90rpx;
  787. }
  788. .card-center {
  789. margin-left: 30rpx;
  790. .card-center-head {
  791. font-size: 32rpx;
  792. font-family: Noto Sans S Chinese;
  793. font-weight: 400;
  794. color: #333333;
  795. }
  796. .tips {
  797. font-size: 26rpx;
  798. font-family: Noto Sans S Chinese;
  799. font-weight: 400;
  800. color: #666666;
  801. .tips-card {
  802. width: 70rpx;
  803. height: 40rpx;
  804. background: #d3f2ef;
  805. border-radius: 6rpx;
  806. font-size: 20rpx;
  807. font-family: Noto Sans S Chinese;
  808. font-weight: 400;
  809. color: #0a8f8a;
  810. padding: 5rpx 10rpx;
  811. margin-left: 20rpx;
  812. }
  813. }
  814. }
  815. }
  816. .choose-item {
  817. margin-right: 20rpx;
  818. width: 50rpx;
  819. height: 50rpx;
  820. border: 1rpx solid #00b38b;
  821. border-radius: 50%;
  822. display: flex;
  823. justify-content: center;
  824. align-items: center;
  825. .active {
  826. width: 38rpx;
  827. height: 38rpx;
  828. background: #00b38b;
  829. border-radius: 50%;
  830. }
  831. }
  832. }
  833. .content {
  834. position: relative;
  835. margin-top: -50rpx;
  836. padding: 0rpx 30rpx;
  837. position: relative;
  838. .img-pos {
  839. position: absolute;
  840. left: 270rpx;
  841. top: -38rpx;
  842. right: 50rpx;
  843. .img-flex {
  844. display: flex;
  845. justify-content: space-between;
  846. align-items: center;
  847. .car-img {
  848. width: 86rpx;
  849. height: 42rpx;
  850. }
  851. .flag-img {
  852. width: 30rpx;
  853. height: 35rpx;
  854. }
  855. }
  856. }
  857. .action {
  858. padding-left: 20rpx;
  859. padding-right: 20rpx;
  860. padding-bottom: 30rpx;
  861. .button {
  862. height: 80rpx;
  863. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  864. border-radius: 40rpx;
  865. font-size: 32rpx;
  866. font-weight: 400;
  867. color: #ffffff;
  868. line-height: 80rpx;
  869. }
  870. }
  871. .item-tips {
  872. .title {
  873. font-size: 30rpx;
  874. font-family: Microsoft YaHei;
  875. font-weight: 400;
  876. color: #000000;
  877. line-height: 24rpx;
  878. }
  879. .tip {
  880. margin-top: 16rpx;
  881. font-size: 24rpx;
  882. font-family: Microsoft YaHei;
  883. font-weight: 400;
  884. color: #999999;
  885. line-height: 24rpx;
  886. }
  887. }
  888. .picture-wrapper {
  889. margin-top: 40rpx;
  890. .bg {
  891. background: #ffffff;
  892. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  893. border-radius: 20rpx;
  894. padding: 40rpx;
  895. display: flex;
  896. // align-items: center;
  897. justify-content: space-between;
  898. .name {
  899. font-size: 34rpx;
  900. font-family: Microsoft YaHei;
  901. font-weight: 400;
  902. color: #000000;
  903. line-height: 34rpx;
  904. }
  905. .value {
  906. margin-top: 20rpx;
  907. font-size: 24rpx;
  908. font-family: Microsoft YaHei;
  909. font-weight: 400;
  910. color: #999999;
  911. line-height: 24rpx;
  912. }
  913. .tip {
  914. margin-top: 20rpx;
  915. text-align: center;
  916. width: 110rpx;
  917. height: 40rpx;
  918. background: rgba(33, 190, 177, 0.2);
  919. border-radius: 6rpx;
  920. .tip-value {
  921. font-size: 20rpx;
  922. font-family: Microsoft YaHei;
  923. font-weight: 400;
  924. color: #0a8f8a;
  925. line-height: 40rpx;
  926. opacity: 1;
  927. }
  928. }
  929. }
  930. .icon {
  931. width: 294rpx;
  932. height: 188rpx;
  933. }
  934. }
  935. .shibie-wrapper {
  936. margin-top: 60rpx;
  937. .title {
  938. font-size: 30rpx;
  939. font-family: Microsoft YaHei;
  940. font-weight: 400;
  941. color: #000000;
  942. line-height: 30rpx;
  943. }
  944. }
  945. .buchong-wrapper {
  946. margin-top: 60rpx;
  947. .title {
  948. font-size: 30rpx;
  949. font-family: Microsoft YaHei;
  950. font-weight: 400;
  951. color: #000000;
  952. line-height: 30rpx;
  953. }
  954. }
  955. .green-tip {
  956. margin-top: 50rpx;
  957. font-size: 24rpx;
  958. font-family: Microsoft YaHei;
  959. font-weight: 400;
  960. color: #00b38b;
  961. line-height: 24rpx;
  962. margin-bottom: 60rpx;
  963. }
  964. }
  965. .form-item {
  966. display: flex;
  967. font-size: 28rpx;
  968. justify-content: space-between;
  969. align-items: center;
  970. }
  971. .form-item label {}
  972. .form-item .input-box {
  973. display: flex;
  974. align-items: center;
  975. }
  976. .form-item .select {
  977. flex: 1;
  978. background: #f1f1f1;
  979. padding: 6rpx 20rpx;
  980. margin: 0 10rpx;
  981. min-height: 48rpx;
  982. line-height: 48rpx;
  983. border-radius: 8rpx;
  984. }
  985. .form-item .icon {
  986. width: 28rpx;
  987. height: 32rpx;
  988. }
  989. .form-item .input-box input {
  990. width: 90rpx;
  991. background: #f1f1f1;
  992. border-radius: 8rpx;
  993. padding: 0 5rpx;
  994. }
  995. .form-item .sub-text {
  996. color: #808080;
  997. padding-left: 10rpx;
  998. }
  999. .form-item .sub-label {
  1000. padding: 0 10rpx;
  1001. }
  1002. .window {
  1003. padding: 60rpx 30rpx;
  1004. }
  1005. .window .window-item {
  1006. border: 1px solid #00b38b;
  1007. background: rgba(0, 179, 139, .1);
  1008. border-radius: 10rpx;
  1009. padding: 16rpx 30rpx;
  1010. font-size: 30rpx;
  1011. margin-bottom: 10rpx;
  1012. }
  1013. ::v-deep .u-input__input {
  1014. background: transparent;
  1015. }
  1016. .choice-takePhoto {
  1017. position: absolute;
  1018. bottom: 0;
  1019. background-color: white;
  1020. width: 100%;
  1021. border-radius: 20rpx 20rpx 0 0;
  1022. }
  1023. .choice-takePhoto>view:first-child {
  1024. text-align: center;
  1025. height: 80rpx;
  1026. line-height: 80rpx;
  1027. border-bottom: 1rpx solid rgba(127, 127, 127, 0.3);
  1028. background-color: white;
  1029. }
  1030. .choice-takePhoto>view:last-child {
  1031. text-align: center;
  1032. height: 80rpx;
  1033. line-height: 80rpx;
  1034. border-top: 6rpx solid rgba(127, 127, 127, 0.1);
  1035. background-color: white;
  1036. }
  1037. .choice-takePhoto>view {
  1038. text-align: center;
  1039. height: 80rpx;
  1040. line-height: 80rpx;
  1041. background-color: white;
  1042. }
  1043. .choice-takePhoto-wrap {
  1044. width: 100%;
  1045. height: 100vh;
  1046. background-color: rgba(127, 127, 127, 0.2);
  1047. position: fixed;
  1048. left: 0;
  1049. top: 0;
  1050. z-index: 11111;
  1051. }
  1052. .tractor {
  1053. font-size: 32rpx;
  1054. margin-top: 40rpx;
  1055. }
  1056. .tractor .title {
  1057. margin-right: 60rpx;
  1058. }
  1059. // .tractor .title .label {
  1060. // margin-right: 40rpx !important;
  1061. // }
  1062. </style>