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.

vehicle-change-cheliangmsg-write.vue 30KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947
  1. <template>
  2. <view class="bg">
  3. <view class="title_wrap"><text class="title">变更基本信息</text></view>
  4. <u-form label-width="230" :model="state.form" ref="uForm" :label-style='labelStyle'>
  5. <u-form-item label="车牌号码" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'
  6. borderBottom>
  7. <u-input v-model="state.form.vehiclePlate" input-align='right' disabled/>
  8. </u-form-item>
  9. <u-form-item label="车牌颜色" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'
  10. borderBottom>
  11. <view class="showworld">{{getCodeName('VEHICLE_COLOR_TYPE',state.form.vehiclePlateColor)}}</view>
  12. </u-form-item>
  13. <view class="picture-wrapper" @click="takePhotoMode('3')">
  14. <view class="bg1">
  15. <view class="">
  16. <view class="name"> 新车牌行驶证主页 </view>
  17. <view class="value"> 上传行驶证的主页 </view>
  18. <view class="tip">
  19. <view class="tip-value"> 拍摄规范 </view>
  20. </view>
  21. </view>
  22. <image v-if="!state.form.vehPosImgUrl" class="icon" :src="`${$imgUrl}issuance/xz.png`"
  23. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}">
  24. </image>
  25. <image v-else class="icon" :src="strReplace(state.form.vehPosImgUrl)"
  26. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}"></image>
  27. </view>
  28. </view>
  29. <view class="picture-wrapper" @click="takePhotoMode('4')">
  30. <view class="bg1">
  31. <view class="">
  32. <view class="name"> 新车牌行驶证副页 </view>
  33. <view class="value"> 上传行驶证的副页 </view>
  34. <view class="tip">
  35. <view class="tip-value"> 拍摄规范 </view>
  36. </view>
  37. </view>
  38. <image v-if="!state.form.vehNegImgUrl" class="icon" :src="`${$imgUrl}issuance/xf.png`"
  39. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}">
  40. </image>
  41. <image v-else class="icon" :src="strReplace(state.form.vehNegImgUrl)"
  42. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}"></image>
  43. </view>
  44. </view>
  45. </u-form>
  46. </view>
  47. <view class="bg">
  48. <view class="title_wrap"><text class="title">以下信息选择性修改/填写</text></view>
  49. <u-form label-width="230" :model="state.form" ref="uForm" :label-style='labelStyle'>
  50. <u-form-item label="变更车主姓名" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'
  51. borderBottom>
  52. <u-input v-model="state.form.ownerName" input-align='right'/>
  53. </u-form-item>
  54. <u-form-item label="变更车辆类型" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'
  55. borderBottom>
  56. <u-input v-model="state.form.vehicleType" input-align='right'/>
  57. </u-form-item>
  58. <u-form-item label="变更证件类型" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'
  59. borderBottom>
  60. <u-input v-model="state.form.ownerIdTypeStr" type="select" @click="show1 = true" input-align='right'/>
  61. </u-form-item>
  62. <u-form-item label="变更证件号码" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'
  63. borderBottom>
  64. <u-input v-model="state.form.ownerIdNum" input-align='right'/>
  65. </u-form-item>
  66. <u-form-item label="变更地址" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'
  67. borderBottom>
  68. <u-input v-model="state.form.ownerAddress" input-align='right'/>
  69. </u-form-item>
  70. <u-form-item label="总质量(kg)" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'>
  71. <u-input inputAlign="right" placeholder="请输入总质量" v-model="state.form.totalMass"
  72. />
  73. </u-form-item>
  74. <u-form-item label="整备质量(kg)" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'>
  75. <u-input inputAlign="right" placeholder="请输入整备质量" v-model="state.form.maintenanceMass"
  76. maxlength="7" />
  77. </u-form-item>
  78. <u-form-item label="准牵引总质量(kg)" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon' v-if="state.form.permittedTowWeight">
  79. <u-input inputAlign="right" placeholder="请输入牵引质量" v-model="state.form.permittedTowWeight"/>
  80. </u-form-item>
  81. <u-form-item label="变更车轴数(轴)" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'>
  82. <u-input inputAlign="right" placeholder="请输入车轴数" v-model="state.form.axleCount"/>
  83. </u-form-item>
  84. <u-form-item label="外廓尺寸(mm)" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'>
  85. <u-input inputAlign="right" placeholder="请输入外廓尺寸" v-model="state.form.outsideDimensions" />
  86. </u-form-item>
  87. <u-form-item label="核定载人数(人)" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'>
  88. <u-input inputAlign="right" placeholder="请输入核定载人数" v-model="state.form.approvedCount"
  89. maxlength="3" />
  90. </u-form-item>
  91. <u-form-item label="发动机号" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'>
  92. <u-input inputAlign="right" placeholder="请输入发动机号码" v-model="state.form.engineNum"
  93. maxlength="20" />
  94. </u-form-item>
  95. <u-form-item label="车辆识别号" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'>
  96. <u-input inputAlign="right" placeholder="请输入车辆识别号" v-model="state.form.vin"
  97. maxlength="20" />
  98. </u-form-item>
  99. <u-form-item label="是否本人办理" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'>
  100. <view class="right-show">
  101. <radio-group @change="radioChange">
  102. <label style="margin-right: 60rpx;" class="uni-list-cell uni-list-cell-pd "
  103. v-for="(item, index) in state.items" :key="item.value">
  104. <radio :value="item.value" :checked="index+1 === state.form.isMyselfHandle" />{{item.name}}
  105. </label>
  106. </radio-group>
  107. </view>
  108. </u-form-item>
  109. <view class="picture-wrapper" @click="cardFileImageUpdate(1)" v-if="state.form.isMyselfHandle==2">
  110. <view class="bg1">
  111. <view class="">
  112. <view class="name"> 人像面 </view>
  113. <view class="value"> 经办人身份证的人像面 </view>
  114. <view class="tip">
  115. <view class="tip-value"> 拍摄规范 </view>
  116. </view>
  117. </view>
  118. <image v-if="!state.form.ownerPosImgUrl" class="icon" :src="`${$imgUrl}issuance/sfz.png`"
  119. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}">
  120. </image>
  121. <image v-else class="icon" :src="strReplace(state.form.ownerPosImgUrl)"
  122. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png`}"></image>
  123. </view>
  124. </view>
  125. <view class="picture-wrapper" @click="cardFileImageUpdate(2)" v-if="state.form.isMyselfHandle==2">
  126. <view class="bg1">
  127. <view class="">
  128. <view class="name"> 国徽面 </view>
  129. <view class="value"> 经办人身份证的国徽面 </view>
  130. <view class="tip">
  131. <view class="tip-value"> 拍摄规范 </view>
  132. </view>
  133. </view>
  134. <image v-if="!state.form.ownerNegImgUrl" class="icon" :src="`${$imgUrl}issuance/sff.png`"
  135. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png`}">
  136. </image>
  137. <image v-else class="icon" :src="strReplace(state.form.ownerNegImgUrl)"
  138. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png`}"></image>
  139. </view>
  140. </view>
  141. <view class="picture-wrapper" @click="cardFileImageUpdate(3)" v-if="state.form.isMyselfHandle==2 && state.form.userType==1">
  142. <view class="bg1">
  143. <view class="">
  144. <view class="name"> 开户人授权书 </view>
  145. <view class="value"> 上传授权书 </view>
  146. <view class="tip">
  147. <view class="tip-value"> 拍摄规范 </view>
  148. </view>
  149. </view>
  150. <image v-if="!state.form.ownerLetterOfAuthorizationImgUrl" class="icon" :src="`${$imgUrl}issuance/weituo.png`"
  151. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}">
  152. </image>
  153. <image v-else class="icon" :src="strReplace(state.form.ownerLetterOfAuthorizationImgUrl)"
  154. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}"></image>
  155. </view>
  156. </view>
  157. <view class="picture-wrapper" @click="cardFileImageUpdate(4)" v-if="state.form.isMyselfHandle==2 && state.form.userType==2">
  158. <view class="bg1">
  159. <view class="">
  160. <view class="name"> 开户人授权书 </view>
  161. <view class="value"> 上传授权书 </view>
  162. <view class="tip">
  163. <view class="tip-value"> 拍摄规范 </view>
  164. </view>
  165. </view>
  166. <image v-if="!state.form.unitAuthorizationLetterImgUrl" class="icon" :src="`${$imgUrl}issuance/weituo.png`"
  167. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}">
  168. </image>
  169. <image v-else class="icon" :src="strReplace(state.form.unitAuthorizationLetterImgUrl)"
  170. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}"></image>
  171. </view>
  172. </view>
  173. <u-form-item label="是否牵引车" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon' v-if="state.form.vanType==2">
  174. <radio-group @change="radioChangeqyc">
  175. <view class="right-show">
  176. <label style="margin-right: 60rpx;" class="uni-list-cell uni-list-cell-pd "
  177. v-for="(item, index) in state.itemsqyc" :key="item.value">
  178. <radio :value="item.value" :checked="index === state.form.isTractor" />{{item.name}}
  179. </label>
  180. </view>
  181. </radio-group>
  182. </u-form-item>
  183. <view class="picture-wrapper" @click="cardFileImageUpdate(1)" v-if="state.form.isTractor==0 && state.form.vanType==2">
  184. <view class="bg1">
  185. <view class="">
  186. <view class="name"> 车头照 </view>
  187. <view class="value"> 变更车头照 </view>
  188. <view class="tip">
  189. <view class="tip-value"> 拍摄规范 </view>
  190. </view>
  191. </view>
  192. <image v-if="!state.form.vehFrontUrl" class="icon" :src="`${$imgUrl}issuance/chetou.png`"
  193. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}">
  194. </image>
  195. <image v-else class="icon" :src="strReplace(state.form.vehFrontUrl)"
  196. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}"></image>
  197. </view>
  198. </view>
  199. <view class="picture-wrapper" @click="cardFileImageUpdate(1)" v-if="state.form.isTractor==0 && state.form.vanType==2">
  200. <view class="bg1">
  201. <view class="">
  202. <view class="name"> 车身照 </view>
  203. <view class="value"> 变更车身45°照 </view>
  204. <view class="tip">
  205. <view class="tip-value"> 拍摄规范 </view>
  206. </view>
  207. </view>
  208. <image v-if="!state.form.vehBodyUrl" class="icon" :src="`${$imgUrl}issuance/chetou.png`"
  209. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}">
  210. </image>
  211. <image v-else class="icon" :src="strReplace(state.form.vehBodyUrl)"
  212. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}"></image>
  213. </view>
  214. </view>
  215. <view class="picture-wrapper" @click="cardFileImageUpdate(2)" v-if="state.form.isTractor==1">
  216. <view class="bg1">
  217. <view class="">
  218. <view class="name"> 道路运输许可证 </view>
  219. <view class="value"> 上传道路运输许可证 </view>
  220. <view class="tip">
  221. <view class="tip-value"> 拍摄规范 </view>
  222. </view>
  223. </view>
  224. <image v-if="!state.form.roadTransportPermitPicUrl" class="icon" :src="`${$imgUrl}issuance/chetou.png`"
  225. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}">
  226. </image>
  227. <image v-else class="icon" :src="strReplace(state.form.roadTransportPermitPicUrl)"
  228. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}"></image>
  229. </view>
  230. </view>
  231. <u-form-item label="车辆用户类型" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'
  232. borderBottom>
  233. <u-input v-model="state.form.vehicleCustomerTypeName" type="select" @click="show2 = true" input-align='right'/>
  234. </u-form-item>
  235. </u-form>
  236. </view>
  237. <view class="bg">
  238. <u-form label-width="230" :model="state.form" ref="uForm" :label-style='labelStyle'>
  239. <u-form-item label="手机号码" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'
  240. borderBottom>
  241. <u-input v-model="state.form.ownerTel" input-align='right' disabled/>
  242. </u-form-item>
  243. <u-form-item label="验证码" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'
  244. borderBottom>
  245. <view style="display: flex;align-items: center;flex-shrink: 0;">
  246. <u-input v-model="state.code" input-align='right' maxlength="6"/>
  247. <text @click="getCode" v-if="waitTime==0" class="search">获取验证码</text>
  248. <text class="search" v-else>{{waitTime}}后重试</text>
  249. </view>
  250. </u-form-item>
  251. </u-form>
  252. </view>
  253. <view class="action">
  254. <button type="default" class="ui-btn" @click="savaHandle()">
  255. 提交
  256. </button>
  257. </view>
  258. <!-- 选择证件类型 -->
  259. <u-select v-model="show1" :list="state.ownerIdTypeRange" @confirm="changeOwnerIdType"></u-select>
  260. <!-- 车辆用户类型 -->
  261. <u-select v-model="show2" :list="state.vehicleCustomerTypeRange" @confirm="vehicleCustomerTypeType"></u-select>
  262. <view class="choice-takePhoto-wrap" v-if="state.isTakePhotoModeShow" @click="cancle">
  263. <view class="choice-takePhoto">
  264. <view @click.stop="takePhoto(state.choiceIndex)" style="border-radius: 20rpx 20rpx 0 0;">拍照</view>
  265. <view @click.stop="xiangce(state.choiceIndex)">从手机相册选择</view>
  266. <view @click.stop="cancle">取消</view>
  267. </view>
  268. </view>
  269. <viewfinder v-if="state.phoneType" :phoneType="state.phoneType" :images="state.images" :showStartPhoto="state.showImg"
  270. @confirmReturn="confirmReturn" @camera="camera"></viewfinder>
  271. </template>
  272. <script setup lang="ts">
  273. import { navTo,uploadFile,strReplace,msg,checkStr,chooseImageCompress} from "@/utils/utils";
  274. import { reactive,ref } from "vue";
  275. import carNumberInput from "@/components/car-number-input/car-number-input.vue";
  276. import { onLoad } from "@dcloudio/uni-app";
  277. import { getItem } from "@/utils/storage.ts"
  278. import {sendMessage,vehicleLicenseOcr,vehicleInformationChange,messageValid,vehicleInfoChangeApply} from "@/utils/network/api.js";
  279. import {requestNew} from "@/utils/network/request.js";
  280. import {
  281. getCodeName
  282. } from "@/datas/queryKey.js";
  283. import viewfinder from "../../../components/viewfinder.vue"
  284. import {
  285. calculateVehicleType
  286. } from "@/datas/publicRequest";
  287. const labelStyle = {
  288. color: "#004576",
  289. fontSize: "28rpx",
  290. }
  291. const leftIcon = {
  292. height: '100%',
  293. width: '8rpx',
  294. display: 'flex',
  295. 'align-items': 'center',
  296. 'margin-right': '4rpx',
  297. }
  298. const show1 = ref(false)
  299. const show2 = ref(false)
  300. const state = reactive({
  301. form: {
  302. vehiclePlate: "",
  303. vehiclePlateColor: "",
  304. vehiclePlateColorStr:"",//车牌颜色中文
  305. vehPosImgUrl:"",
  306. vehNegImgUrl:"",
  307. isVehiclePlateChange:"",//是否车牌变更 否_0,是_1
  308. ownerName:"",//车主姓名
  309. ownerAddress:"",
  310. vehicleType:"",
  311. totalMass:"",
  312. maintenanceMass:"",
  313. axleCount:"",
  314. outsideDimensions:"",
  315. approvedCount:"",
  316. engineNum:"",
  317. vin:"",
  318. ownerIdTypeStr:"",
  319. ownerIdType:"",
  320. ownerIdNum:"",
  321. isTractor:0,//是否牵引车 否_0,是_1
  322. cardId:"",
  323. obuId:"",
  324. isMyselfHandle:1,//本人办理_1,代理人办理_2
  325. ownerTel:"",
  326. ownerNegImgUrl:"",//经办人身份证反面URL
  327. ownerPosImgUrl:"",//经办人身份证正面URL
  328. ownerLetterOfAuthorizationImgUrl:"",//开户人授权书URL
  329. unitAuthorizationLetterImgUrl:"",//单位授权书URL
  330. vehFrontUrl:"",//车头照图片地址
  331. vehBodyUrl:"",//车身45度照图片地址
  332. roadTransportPermitPicUrl:"",//道路运输许可证图片地址(牵引车才提供)
  333. vehicleCustomerType: "", //车辆用户类型
  334. vehicleCustomerTypeName: "普通车",
  335. vanType:1,//客货类型,1-客车 2-货车 3-作业车
  336. vehicleTypeNew:1,//收费车型(按新输入的值计算)[变更车辆类型]
  337. vehPosImgOcrId:"",//行驶证正面orcId
  338. vehNegImgOcrId:"",//行驶证反面orcId
  339. userType:1,//1个人 2单位
  340. permittedTowWeight:"",//准牵引总质量
  341. useCharacter:"",//车辆使用性质
  342. },
  343. ownerIdTypeRange: [],
  344. isTakePhotoModeShow: false, //选择拍照方式是否出来
  345. choiceIndex: 1, // 1 身份证正面 2 身份证反面
  346. ownerInfo:false,//非本人 个人 车主信息true ==== 本人 个人 false
  347. phoneType: 0, // 1 身份证正面 2 身份证反面 3行驶证正面 4行驶证反面
  348. images: '',
  349. showImg: true,
  350. vehicleId:"",
  351. code:"",
  352. items: [{
  353. value: 1,
  354. name: '是',
  355. checked: 'true'
  356. },
  357. {
  358. value: 2,
  359. name: '否',
  360. }],
  361. itemsqyc: [{
  362. value: 0,
  363. name: '否',
  364. checked: 'true'
  365. },
  366. {
  367. value: 1,
  368. name: '是',
  369. }],
  370. vehicleCustomerTypeRange:[]
  371. })
  372. onLoad((option : any) => {
  373. state.form.isVehiclePlateChange=option.isVehiclePlateChange
  374. state.form.vehiclePlate=option.vehicleId.split("_")[0]
  375. state.form.vehiclePlateColor=option.vehicleId.split("_")[1]
  376. state.vehicleId=option.vehicleId
  377. state.form.cardId=option.cardId
  378. state.form.obuId=option.obuId
  379. let type = getItem('key')['CERTIFICATE_TYPE'];
  380. for (var k = 0; k < type.length; k++) {
  381. let obj = {};
  382. obj['value'] = type[k]['code']
  383. obj['label'] = type[k]['name']
  384. state.ownerIdTypeRange.push(obj)
  385. }
  386. getCarDetails()
  387. console.log("state.ownerIdTypeRange",state.ownerIdTypeRange,option)
  388. });
  389. const getCarDetails = () => {
  390. const options = {
  391. type: 2,
  392. data: {
  393. vehicleId:state.vehicleId
  394. },
  395. method: "POST",
  396. showLoading: true,
  397. };
  398. //调用方式
  399. requestNew(vehicleInformationChange, options)
  400. .then((res) => {
  401. console.log('车辆信息', res)
  402. state.form.ownerName=res.info.ownerName
  403. state.form.ownerAddress=res.info.ownerAddress
  404. state.form.vehicleType=res.info.vehicleType
  405. // 判断客货类型
  406. judgeVanType()
  407. state.form.totalMass=res.info.totalMass
  408. state.form.maintenanceMass=res.info.maintenanceMass
  409. state.form.axleCount=res.info.axleCount
  410. state.form.outsideDimensions=res.info.vehicleDimensions.slice(0,-2)
  411. state.form.approvedCount=res.info.approvedCount
  412. state.form.engineNum=res.info.engineNum
  413. state.form.vin=res.info.vin
  414. state.form.vehicleCustomerType=res.info.vehicleCustomerType
  415. state.form.ownerTel=res.info.customerInfo.customerTel
  416. state.form.userType=res.userType
  417. // 计算收费车型
  418. calculateVehicleType(state.form.approvedCount,state.form.axleCount,state.form.outsideDimensions,state.form.totalMass,state.form.vanType, function (res) {
  419. state.form.vehicleTypeNew=res
  420. });
  421. // 判断车辆用户类型
  422. judgeUseUserType()
  423. })
  424. .catch((err) => {
  425. console.log(err);
  426. });
  427. }
  428. // 判断客货类型
  429. const judgeVanType=()=>{
  430. if(state.form.vehicleType.indexOf('客车') || state.form.vehicleType.indexOf('轿车')){
  431. state.form.vanType=1
  432. state.form.isTractor = 0
  433. }else if(state.form.vehicleType.indexOf('牵引车') || state.form.vehicleType.indexOf('货车') || state.form.vehicleType.indexOf('挂车')){
  434. state.form.vanType=2
  435. state.form.isTractor = 1;
  436. }else{
  437. state.form.vanType=3
  438. }
  439. }
  440. // 判断车辆用户类型
  441. const judgeUseUserType=()=>{
  442. if(state.form.vanType==1){
  443. state.vehicleCustomerTypeRange=[
  444. {
  445. 'value':0,
  446. 'label':"普通车"
  447. }
  448. ]
  449. state.form.vehicleCustomerType = "0"
  450. state.form.vehicleCustomerTypeName = "普通车"
  451. }else{
  452. state.vehicleCustomerTypeRange=[
  453. {
  454. 'value':0,
  455. 'label':"普通车"
  456. },
  457. {
  458. 'label': "道路运输证经营范围仅有“货物专用运输(集装箱) ”的牵引车办理J类型集装箱",
  459. 'value': 24,
  460. },
  461. {
  462. 'label': "道路运输证经营范围不含“货物专用运输(集装箱)”的牵引车",
  463. 'value': 27,
  464. },
  465. {
  466. 'label': '道路运输证经营范围除“货物专用运输 (集装 箱)"外,还有“普通货运”等其他项目的牵引车办理J2类型集装箱',
  467. 'value': 28,
  468. }
  469. ]
  470. }
  471. }
  472. const checkCodeRequest = () => {
  473. if(!state.code){
  474. msg("请输入验证码");
  475. return;
  476. }
  477. const options = {
  478. type: 2,
  479. data: {
  480. mobile: state.form.ownerTel,
  481. code: state.code
  482. },
  483. method: "POST",
  484. showLoading: true,
  485. };
  486. return new Promise(async (resolve, reject) => {
  487. const res = await requestNew(messageValid, options);
  488. const data = res;
  489. resolve(data);
  490. }).catch((error) => {
  491. reject(error);
  492. });
  493. }
  494. //车牌号输入
  495. const carNumber = (val : any) => {
  496. state.form.vehiclePlate = val.trim();
  497. };
  498. const savaHandle = () => {
  499. if(!state.form.vehPosImgUrl){
  500. msg("请上传行驶证主页");
  501. return;
  502. }
  503. if(!state.form.vehNegImgUrl){
  504. msg("请上传行驶证副页");
  505. return;
  506. }
  507. if(!state.form.ownerName){
  508. msg("请输入变更车主姓名");
  509. return;
  510. }
  511. if(!state.form.vehicleType){
  512. msg("请输入变更车辆类型");
  513. return;
  514. }
  515. if(!state.form.ownerIdTypeStr){
  516. msg("请选择变更证件类型");
  517. return;
  518. }
  519. if(!checkStr(state.form.ownerIdNum, "card")){
  520. msg("请输入正确变更证件号码");
  521. return;
  522. }
  523. if(!state.form.ownerAddress){
  524. msg("请输入变更地址");
  525. return;
  526. }
  527. if(!state.form.totalMass){
  528. msg("请输入总质量");
  529. return;
  530. }
  531. if(!state.form.maintenanceMass){
  532. msg("请输入整备质量");
  533. return;
  534. }
  535. if(!state.form.axleCount){
  536. msg("请输入车轴数");
  537. return;
  538. }
  539. if(!state.form.outsideDimensions){
  540. msg("请输入外廓尺寸");
  541. return;
  542. }
  543. if(!state.form.approvedCount){
  544. msg("请输入核定载人数");
  545. return;
  546. }
  547. if(!state.form.engineNum){
  548. msg("请输入发动机号码");
  549. return;
  550. }
  551. if(!state.form.vin){
  552. msg("请输入车辆识别号");
  553. return;
  554. }
  555. // 测完放开
  556. // checkCodeRequest().then((val : any) => {
  557. const options = {
  558. type: 2,
  559. data: {
  560. ...state.form
  561. },
  562. method: "POST",
  563. showLoading: true,
  564. };
  565. //调用方式
  566. requestNew(vehicleInfoChangeApply, options)
  567. .then((res) => {
  568. console.log("res",res)
  569. msg(res.msg)
  570. setTimeout(() => {
  571. uni.navigateBack({
  572. delta: 2
  573. })
  574. }, 2000)
  575. })
  576. .catch((err) => {
  577. console.log(err);
  578. });
  579. // })
  580. }
  581. const changeOwnerIdType = (item) => {
  582. state.form.ownerIdType = item[0].value
  583. state.form.ownerIdTypeStr = item[0].label
  584. console.log(item)
  585. }
  586. const vehicleCustomerTypeType = (item) => {
  587. state.form.vehicleCustomerType = item[0].value
  588. state.form.vehicleCustomerTypeName = item[0].label
  589. console.log(item)
  590. }
  591. const takePhotoMode = (index) => {
  592. console.log("index", index)
  593. state.isTakePhotoModeShow = true
  594. state.choiceIndex = index
  595. }
  596. // val 1 经办人身份证正面URL 2 办人身份证反面URL 3开户人授权书URL
  597. const cardFileImageUpdate = (val) => {
  598. uni.chooseImage({
  599. count: 1, //只能选取一张照片
  600. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  601. sourceType: ["camera", "album"], //从相册选择
  602. success: function (res) {
  603. uploadFile(res.tempFilePaths[0], "", "").then((data) => {
  604. if (val == 1) {
  605. state.form.ownerPosImgUrl = data;
  606. } else if(val == 2) {
  607. state.form.ownerNegImgUrl = data;
  608. }else if(val == 3) {
  609. state.form.ownerLetterOfAuthorizationImgUrl = data;
  610. }else if(val == 4) {
  611. state.form.unitAuthorizationLetterImgUrl = data;
  612. }
  613. })
  614. },
  615. });
  616. };
  617. let waitTime = ref(0)
  618. //倒计时函数
  619. const codeInterval = () => {
  620. waitTime.value = 60
  621. let timer = setInterval(() => {
  622. if (waitTime.value == 1) {
  623. clearInterval(timer)
  624. }
  625. waitTime.value -= 1
  626. }, 1000)
  627. }
  628. const getCode = () => {
  629. console.log(123);
  630. if (checkStr(state.form.ownerTel, "mobile")) {
  631. sendCodeApi()
  632. codeInterval()
  633. } else {
  634. uni.showToast({
  635. title: '请输入正确的手机号',
  636. icon: 'none'
  637. });
  638. }
  639. }
  640. // 发送验证码
  641. const sendCodeApi = () => {
  642. //参数说明
  643. let options = {
  644. type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
  645. data: {
  646. mobile: state.form.ownerTel
  647. }, //请求参数
  648. method: "POST", //提交方式(默认POST)
  649. showLoading: true, //是否显示加载中(默认显示)
  650. };
  651. //调用方式
  652. requestNew(sendMessage, options)
  653. .then((res) => {
  654. let data = res
  655. console.log(data, "#################");
  656. if (data.info == "成功") {
  657. msg("发送成功")
  658. console.log('######################CCCCCCCCCCCCCCCCC');
  659. }
  660. })
  661. .catch((err) => {
  662. console.log(err);
  663. });
  664. }
  665. const cancle = () => {
  666. state.isTakePhotoModeShow = false
  667. }
  668. const takePhoto = (val) => {
  669. console.log("拍照", val)
  670. state.phoneType = val;
  671. state.showImg = true;
  672. }
  673. const xiangce = (val) => {
  674. console.log("val", val)
  675. if (state.choiceIndex == 3) {
  676. var imageType = 1;
  677. } else {
  678. var imageType = 2;
  679. }
  680. chooseImageCompress((res) => {
  681. state.images = res.tempFilePath ? res.tempFilePath : res.tempFilePaths[0]
  682. state.showImg = false
  683. state.phoneType = state.choiceIndex
  684. state.isTakePhotoModeShow = false
  685. console.log("res==",res,state.choiceIndex,state.images)
  686. })
  687. }
  688. const confirmReturn = (val) => {
  689. console.log("进来了")
  690. if (state.choiceIndex == 3) {
  691. var imageType = 1;
  692. } else {
  693. var imageType = 2;
  694. }
  695. state.phoneType = 0
  696. state.isTakePhotoModeShow = false
  697. uploadFile(val.tempImagePath, imageType, vehicleLicenseOcr).then((data) => {
  698. console.log('输出内容=====================', state.choiceIndex)
  699. if (state.choiceIndex == 3) {
  700. state.form.ownerName = data.man;
  701. state.form.ownerAddress = data.address;
  702. state.form.vehicleType = data.vehicle;
  703. state.form.vin = data.vin;
  704. state.form.engineNum = data.engine;
  705. state.form.vehPosImgUrl = data.imageUrl;
  706. state.form.vehPosImgOcrId = data.ocrResultId;
  707. state.form.useCharacter = data.character;
  708. // 判断客货类型
  709. judgeVanType()
  710. } else {
  711. state.form.approvedCount = data.apc.slice(0,-1);
  712. state.form.maintenanceMass = data.unladen.slice(0,-2);
  713. let overall=data.overall.replaceAll("x", "X")
  714. state.form.outsideDimensions = overall.slice(0,-2);
  715. state.form.totalMass = data.gross ? data.gross.slice(0,-2) : 0;
  716. state.form.vehNegImgUrl = data.imageUrl;
  717. state.form.vehNegImgOcrId = data.ocrResultId;
  718. state.form.permittedTowWeight=data.towing.slice(0,-2)
  719. // 计算收费车型
  720. calculateVehicleType(state.form.approvedCount,state.form.axleCount,state.form.outsideDimensions,state.form.totalMass,state.form.vanType, function (res) {
  721. state.form.vehicleTypeNew=res
  722. });
  723. // 判断车辆用户类型
  724. judgeUseUserType()
  725. console.log('=====================', state.form.vehNegImgUrl, state)
  726. }
  727. state.isTakePhotoModeShow = false
  728. })
  729. console.log("图片地址val", val.tempImagePath)
  730. }
  731. const camera = () => {
  732. state.phoneType = 0
  733. }
  734. const radioChange = (evt) => {
  735. console.log("evt.detail.value", evt.detail.value)
  736. for (let i = 0; i < state.items.length; i++) {
  737. if (state.items[i].value == evt.detail.value) {
  738. state.form.isMyselfHandle = i+1;
  739. break;
  740. }
  741. }
  742. console.log("state.form.isMyselfHandle", state.form.isMyselfHandle)
  743. }
  744. const radioChangeqyc = (evt) => {
  745. console.log("evt.detail.value", evt.detail.value)
  746. for (let i = 0; i < state.itemsqyc.length; i++) {
  747. if (state.itemsqyc[i].value == evt.detail.value) {
  748. state.form.isTractor = state.itemsqyc[i].value;
  749. break;
  750. }
  751. }
  752. console.log("state.form.isTractor", state.form.isTractor)
  753. }
  754. </script>
  755. <style lang="scss" scoped>
  756. .bg {
  757. background-color: white;
  758. width: 90%;
  759. margin: 0 auto;
  760. margin-top: 20rpx;
  761. border-radius: 12px;
  762. border: 1px solid #FFFFFF;
  763. padding: 30rpx 20rpx;
  764. overflow: hidden;
  765. box-sizing: border-box;
  766. .title_wrap {
  767. display: flex;
  768. font-weight: 400;
  769. justify-content: space-between;
  770. .title {
  771. font-size: 30rpx;
  772. color: #01243A;
  773. }
  774. }
  775. .des {
  776. font-weight: 400;
  777. font-size: 28rpx;
  778. color: #01243A;
  779. line-height: 56rpx;
  780. margin-top: 10rpx;
  781. text-indent: 1rem;
  782. }
  783. }
  784. .action {
  785. position: absolute;
  786. left: 0;
  787. height: 160rpx;
  788. background-color: #fff;
  789. border-radius: 30rpx 30rpx 0 0;
  790. width: 100vw;
  791. display: flex;
  792. align-items: center;
  793. justify-content: center;
  794. flex-direction: column;
  795. margin-top: 20rpx;
  796. }
  797. .card{
  798. display: flex;
  799. align-items: center;
  800. image{
  801. width: 120rpx;
  802. height: 120rpx;
  803. margin-right: 20rpx;
  804. }
  805. .details view:first-child{
  806. margin-bottom: 10rpx;
  807. }
  808. }
  809. .picture-wrapper {
  810. margin-top: 30rpx;
  811. .bg1 {
  812. background: #F5F9FB;
  813. border-radius: 10rpx;
  814. padding: 40rpx 30rpx;
  815. display: flex;
  816. justify-content: space-between;
  817. .name {
  818. padding-top: 30rpx;
  819. font-size: 32rpx;
  820. font-family: SourceHanSansSC, SourceHanSansSC;
  821. font-weight: 500;
  822. color: #111;
  823. line-height: 34rpx;
  824. }
  825. .value {
  826. margin-top: 20rpx;
  827. font-size: 22rpx;
  828. font-family: SourceHanSansSC, SourceHanSansSC;
  829. font-weight: 400;
  830. color: #999999;
  831. line-height: 24rpx;
  832. }
  833. .tip {
  834. margin-top: 20rpx;
  835. text-align: center;
  836. width: 100rpx;
  837. height: 30rpx;
  838. border-radius: 6rpx;
  839. border: 1rpx solid #CCB375;
  840. .tip-value {
  841. font-size: 20rpx;
  842. font-family: Microsoft YaHei;
  843. font-weight: 400;
  844. color: #CCB375;
  845. line-height: 30rpx;
  846. opacity: 1;
  847. }
  848. }
  849. }
  850. .icon {
  851. width: 304rpx;
  852. height: 190rpx;
  853. background-image: var(--bgimg);
  854. background-size: 100% 100%;
  855. background-repeat: no-repeat;
  856. }
  857. }
  858. .search{
  859. background: #F8F4E7;
  860. border-radius: 10rpx;
  861. border: 1px solid #CCB375;
  862. font-size: 24rpx;
  863. color: #CCB375;
  864. padding: 0rpx 14rpx;
  865. flex-shrink: 0;
  866. height: 60rpx;
  867. line-height: 60rpx;
  868. margin-left: 20rpx;
  869. }
  870. .showworld{
  871. display: flex;
  872. justify-content: flex-end;
  873. }
  874. .choice-takePhoto-wrap {
  875. width: 100%;
  876. height: 100vh;
  877. background-color: rgba(127, 127, 127, 0.2);
  878. position: fixed;
  879. left: 0;
  880. top: 0;
  881. z-index: 11111;
  882. .choice-takePhoto {
  883. position: absolute;
  884. bottom: 0;
  885. background-color: white;
  886. width: 100%;
  887. border-radius: 20rpx 20rpx 0 0;
  888. }
  889. .choice-takePhoto>view:first-child {
  890. text-align: center;
  891. height: 80rpx;
  892. line-height: 80rpx;
  893. border-bottom: 1rpx solid rgba(127, 127, 127, 0.3);
  894. background-color: white;
  895. }
  896. .choice-takePhoto>view:last-child {
  897. text-align: center;
  898. height: 80rpx;
  899. line-height: 80rpx;
  900. border-top: 6rpx solid rgba(127, 127, 127, 0.1);
  901. background-color: white;
  902. }
  903. .choice-takePhoto>view {
  904. text-align: center;
  905. height: 80rpx;
  906. line-height: 80rpx;
  907. background-color: white;
  908. }
  909. }
  910. .right-show{
  911. display: flex;
  912. justify-content: flex-end;
  913. }
  914. </style>