您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

vehicle-change-cheliangmsg-write.vue 30KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944
  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.vehicleDimensions" />
  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. vehicleDimensions:"",
  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: 0, //车辆用户类型
  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. },
  342. ownerIdTypeRange: [],
  343. isTakePhotoModeShow: false, //选择拍照方式是否出来
  344. choiceIndex: 1, // 1 身份证正面 2 身份证反面
  345. ownerInfo:false,//非本人 个人 车主信息true ==== 本人 个人 false
  346. phoneType: 0, // 1 身份证正面 2 身份证反面 3行驶证正面 4行驶证反面
  347. images: '',
  348. showImg: true,
  349. vehicleId:"",
  350. code:"",
  351. items: [{
  352. value: 1,
  353. name: '是',
  354. checked: 'true'
  355. },
  356. {
  357. value: 2,
  358. name: '否',
  359. }],
  360. itemsqyc: [{
  361. value: 0,
  362. name: '否',
  363. checked: 'true'
  364. },
  365. {
  366. value: 1,
  367. name: '是',
  368. }],
  369. vehicleCustomerTypeRange:[]
  370. })
  371. onLoad((option : any) => {
  372. state.form.isVehiclePlateChange=option.isVehiclePlateChange
  373. state.form.vehiclePlate=option.vehicleId.split("_")[0]
  374. state.form.vehiclePlateColor=option.vehicleId.split("_")[1]
  375. state.vehicleId=option.vehicleId
  376. state.form.cardId=option.cardId
  377. state.form.obuId=option.obuId
  378. let type = getItem('key')['CERTIFICATE_TYPE'];
  379. for (var k = 0; k < type.length; k++) {
  380. let obj = {};
  381. obj['value'] = type[k]['code']
  382. obj['label'] = type[k]['name']
  383. state.ownerIdTypeRange.push(obj)
  384. }
  385. getCarDetails()
  386. console.log("state.ownerIdTypeRange",state.ownerIdTypeRange,option)
  387. });
  388. const getCarDetails = () => {
  389. const options = {
  390. type: 2,
  391. data: {
  392. vehicleId:state.vehicleId
  393. },
  394. method: "POST",
  395. showLoading: true,
  396. };
  397. //调用方式
  398. requestNew(vehicleInformationChange, options)
  399. .then((res) => {
  400. console.log('车辆信息', res)
  401. state.form.ownerName=res.info.ownerName
  402. state.form.ownerAddress=res.info.ownerAddress
  403. state.form.vehicleType=res.info.vehicleType
  404. // 判断客货类型
  405. judgeVanType()
  406. state.form.totalMass=res.info.totalMass
  407. state.form.maintenanceMass=res.info.maintenanceMass
  408. state.form.axleCount=res.info.axleCount
  409. state.form.vehicleDimensions=res.info.vehicleDimensions.slice(0,-2)
  410. state.form.approvedCount=res.info.approvedCount
  411. state.form.engineNum=res.info.engineNum
  412. state.form.vin=res.info.vin
  413. state.form.vehicleCustomerType=res.info.vehicleCustomerType
  414. state.form.ownerTel=res.info.customerInfo.customerTel
  415. state.form.userType=res.userType
  416. // 计算收费车型
  417. calculateVehicleType(state.form.approvedCount,state.form.axleCount,state.form.vehicleDimensions,state.form.totalMass,state.form.vanType, function (res) {
  418. state.form.vehicleTypeNew=res
  419. });
  420. // 判断车辆用户类型
  421. judgeUseUserType()
  422. })
  423. .catch((err) => {
  424. console.log(err);
  425. });
  426. }
  427. // 判断客货类型
  428. const judgeVanType=()=>{
  429. if(state.form.vehicleType.indexOf('客车') || state.form.vehicleType.indexOf('轿车')){
  430. state.form.vanType=1
  431. state.form.isTractor = 0
  432. }else if(state.form.vehicleType.indexOf('牵引车') || state.form.vehicleType.indexOf('货车') || state.form.vehicleType.indexOf('挂车')){
  433. state.form.vanType=2
  434. state.form.isTractor = 1;
  435. }else{
  436. state.form.vanType=3
  437. }
  438. }
  439. // 判断车辆用户类型
  440. const judgeUseUserType=()=>{
  441. if(state.form.vanType==1){
  442. state.vehicleCustomerTypeRange=[
  443. {
  444. 'value':0,
  445. 'label':"普通车"
  446. }
  447. ]
  448. }else{
  449. state.vehicleCustomerTypeRange=[
  450. {
  451. 'value':0,
  452. 'label':"普通车"
  453. },
  454. {
  455. 'value': "道路运输证经营范围仅有“货物专用运输(集装箱) ”的牵引车办理J类型集装箱",
  456. 'label': 24,
  457. },
  458. {
  459. 'value': "道路运输证经营范围不含“货物专用运输(集装箱)”的牵引车",
  460. 'label': 27,
  461. },
  462. {
  463. 'value': '道路运输证经营范围除“货物专用运输 (集装 箱)"外,还有“普通货运”等其他项目的牵引车办理J2类型集装箱',
  464. 'label': 28,
  465. }
  466. ]
  467. }
  468. }
  469. const checkCodeRequest = () => {
  470. if(!state.code){
  471. msg("请输入验证码");
  472. return;
  473. }
  474. const options = {
  475. type: 2,
  476. data: {
  477. mobile: state.form.ownerTel,
  478. code: state.code
  479. },
  480. method: "POST",
  481. showLoading: true,
  482. };
  483. return new Promise(async (resolve, reject) => {
  484. const res = await requestNew(messageValid, options);
  485. const data = res;
  486. resolve(data);
  487. }).catch((error) => {
  488. reject(error);
  489. });
  490. }
  491. //车牌号输入
  492. const carNumber = (val : any) => {
  493. state.form.vehiclePlate = val.trim();
  494. };
  495. const savaHandle = () => {
  496. if(!state.form.vehPosImgUrl){
  497. msg("请上传行驶证主页");
  498. return;
  499. }
  500. if(!state.form.vehNegImgUrl){
  501. msg("请上传行驶证副页");
  502. return;
  503. }
  504. if(!state.form.ownerName){
  505. msg("请输入变更车主姓名");
  506. return;
  507. }
  508. if(!state.form.vehicleType){
  509. msg("请输入变更车辆类型");
  510. return;
  511. }
  512. if(!state.form.ownerIdTypeStr){
  513. msg("请选择变更证件类型");
  514. return;
  515. }
  516. if(!checkStr(state.form.ownerIdNum, "card")){
  517. msg("请输入正确变更证件号码");
  518. return;
  519. }
  520. if(!state.form.ownerAddress){
  521. msg("请输入变更地址");
  522. return;
  523. }
  524. if(!state.form.totalMass){
  525. msg("请输入总质量");
  526. return;
  527. }
  528. if(!state.form.maintenanceMass){
  529. msg("请输入整备质量");
  530. return;
  531. }
  532. if(!state.form.axleCount){
  533. msg("请输入车轴数");
  534. return;
  535. }
  536. if(!state.form.vehicleDimensions){
  537. msg("请输入外廓尺寸");
  538. return;
  539. }
  540. if(!state.form.approvedCount){
  541. msg("请输入核定载人数");
  542. return;
  543. }
  544. if(!state.form.engineNum){
  545. msg("请输入发动机号码");
  546. return;
  547. }
  548. if(!state.form.vin){
  549. msg("请输入车辆识别号");
  550. return;
  551. }
  552. // 测完放开
  553. // checkCodeRequest().then((val : any) => {
  554. const options = {
  555. type: 2,
  556. data: {
  557. ...state.form
  558. },
  559. method: "POST",
  560. showLoading: true,
  561. };
  562. //调用方式
  563. requestNew(vehicleInfoChangeApply, options)
  564. .then((res) => {
  565. console.log("res",res)
  566. msg(res.msg)
  567. setTimeout(() => {
  568. uni.navigateBack({
  569. delta: 2
  570. })
  571. }, 2000)
  572. })
  573. .catch((err) => {
  574. console.log(err);
  575. });
  576. // })
  577. }
  578. const changeOwnerIdType = (item) => {
  579. state.form.ownerIdType = item[0].value
  580. state.form.ownerIdTypeStr = item[0].label
  581. console.log(item)
  582. }
  583. const vehicleCustomerTypeType = (item) => {
  584. state.form.vehicleCustomerType = item[0].value
  585. state.form.vehicleCustomerTypeName = item[0].label
  586. console.log(item)
  587. }
  588. const takePhotoMode = (index) => {
  589. console.log("index", index)
  590. state.isTakePhotoModeShow = true
  591. state.choiceIndex = index
  592. }
  593. // val 1 经办人身份证正面URL 2 办人身份证反面URL 3开户人授权书URL
  594. const cardFileImageUpdate = (val) => {
  595. uni.chooseImage({
  596. count: 1, //只能选取一张照片
  597. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  598. sourceType: ["camera", "album"], //从相册选择
  599. success: function (res) {
  600. uploadFile(res.tempFilePaths[0], "", "").then((data) => {
  601. if (val == 1) {
  602. state.form.ownerPosImgUrl = data;
  603. } else if(val == 2) {
  604. state.form.ownerNegImgUrl = data;
  605. }else if(val == 3) {
  606. state.form.ownerLetterOfAuthorizationImgUrl = data;
  607. }else if(val == 4) {
  608. state.form.unitAuthorizationLetterImgUrl = data;
  609. }
  610. })
  611. },
  612. });
  613. };
  614. let waitTime = ref(0)
  615. //倒计时函数
  616. const codeInterval = () => {
  617. waitTime.value = 60
  618. let timer = setInterval(() => {
  619. if (waitTime.value == 1) {
  620. clearInterval(timer)
  621. }
  622. waitTime.value -= 1
  623. }, 1000)
  624. }
  625. const getCode = () => {
  626. console.log(123);
  627. if (checkStr(state.form.ownerTel, "mobile")) {
  628. sendCodeApi()
  629. codeInterval()
  630. } else {
  631. uni.showToast({
  632. title: '请输入正确的手机号',
  633. icon: 'none'
  634. });
  635. }
  636. }
  637. // 发送验证码
  638. const sendCodeApi = () => {
  639. //参数说明
  640. let options = {
  641. type: 2, //type: 2,JSON格式提交数据(默认表单形式提交)
  642. data: {
  643. mobile: state.form.ownerTel
  644. }, //请求参数
  645. method: "POST", //提交方式(默认POST)
  646. showLoading: true, //是否显示加载中(默认显示)
  647. };
  648. //调用方式
  649. requestNew(sendMessage, options)
  650. .then((res) => {
  651. let data = res
  652. console.log(data, "#################");
  653. if (data.info == "成功") {
  654. msg("发送成功")
  655. console.log('######################CCCCCCCCCCCCCCCCC');
  656. }
  657. })
  658. .catch((err) => {
  659. console.log(err);
  660. });
  661. }
  662. const cancle = () => {
  663. state.isTakePhotoModeShow = false
  664. }
  665. const takePhoto = (val) => {
  666. console.log("拍照", val)
  667. state.phoneType = val;
  668. state.showImg = true;
  669. }
  670. const xiangce = (val) => {
  671. console.log("val", val)
  672. if (state.choiceIndex == 3) {
  673. var imageType = 1;
  674. } else {
  675. var imageType = 2;
  676. }
  677. chooseImageCompress((res) => {
  678. state.images = res.tempFilePath ? res.tempFilePath : res.tempFilePaths[0]
  679. state.showImg = false
  680. state.phoneType = state.choiceIndex
  681. state.isTakePhotoModeShow = false
  682. console.log("res==",res,state.choiceIndex,state.images)
  683. })
  684. }
  685. const confirmReturn = (val) => {
  686. console.log("进来了")
  687. if (state.choiceIndex == 3) {
  688. var imageType = 1;
  689. } else {
  690. var imageType = 2;
  691. }
  692. state.phoneType = 0
  693. state.isTakePhotoModeShow = false
  694. uploadFile(val.tempImagePath, imageType, vehicleLicenseOcr).then((data) => {
  695. console.log('输出内容=====================', state.choiceIndex)
  696. if (state.choiceIndex == 3) {
  697. state.form.ownerName = data.man;
  698. state.form.ownerAddress = data.address;
  699. state.form.vehicleType = data.vehicle;
  700. state.form.vin = data.vin;
  701. state.form.engineNum = data.engine;
  702. state.form.vehPosImgUrl = data.imageUrl;
  703. state.form.vehPosImgOcrId = data.ocrResultId;
  704. // 判断客货类型
  705. judgeVanType()
  706. } else {
  707. state.form.approvedCount = data.apc.slice(0,-1);
  708. state.form.maintenanceMass = data.unladen.slice(0,-2);
  709. let overall=data.overall.replaceAll("x", "X")
  710. state.form.vehicleDimensions = overall.slice(0,-2);
  711. state.form.totalMass = data.gross ? data.gross.slice(0,-2) : 0;
  712. state.form.vehNegImgUrl = data.imageUrl;
  713. state.form.vehNegImgOcrId = data.ocrResultId;
  714. state.form.permittedTowWeight=data.towing.slice(0,-2)
  715. // 计算收费车型
  716. calculateVehicleType(state.form.approvedCount,state.form.axleCount,state.form.vehicleDimensions,state.form.totalMass,state.form.vanType, function (res) {
  717. state.form.vehicleTypeNew=res
  718. });
  719. // 判断车辆用户类型
  720. judgeUseUserType()
  721. console.log('=====================', state.form.vehNegImgUrl, state)
  722. }
  723. state.isTakePhotoModeShow = false
  724. })
  725. console.log("图片地址val", val.tempImagePath)
  726. }
  727. const camera = () => {
  728. state.phoneType = 0
  729. }
  730. const radioChange = (evt) => {
  731. console.log("evt.detail.value", evt.detail.value)
  732. for (let i = 0; i < state.items.length; i++) {
  733. if (state.items[i].value == evt.detail.value) {
  734. state.form.isMyselfHandle = i+1;
  735. break;
  736. }
  737. }
  738. console.log("state.form.isMyselfHandle", state.form.isMyselfHandle)
  739. }
  740. const radioChangeqyc = (evt) => {
  741. console.log("evt.detail.value", evt.detail.value)
  742. for (let i = 0; i < state.itemsqyc.length; i++) {
  743. if (state.itemsqyc[i].value == evt.detail.value) {
  744. state.form.isTractor = state.itemsqyc[i].value;
  745. break;
  746. }
  747. }
  748. console.log("state.form.isTractor", state.form.isTractor)
  749. }
  750. </script>
  751. <style lang="scss" scoped>
  752. .bg {
  753. background-color: white;
  754. width: 90%;
  755. margin: 0 auto;
  756. margin-top: 20rpx;
  757. border-radius: 12px;
  758. border: 1px solid #FFFFFF;
  759. padding: 30rpx 20rpx;
  760. overflow: hidden;
  761. box-sizing: border-box;
  762. .title_wrap {
  763. display: flex;
  764. font-weight: 400;
  765. justify-content: space-between;
  766. .title {
  767. font-size: 30rpx;
  768. color: #01243A;
  769. }
  770. }
  771. .des {
  772. font-weight: 400;
  773. font-size: 28rpx;
  774. color: #01243A;
  775. line-height: 56rpx;
  776. margin-top: 10rpx;
  777. text-indent: 1rem;
  778. }
  779. }
  780. .action {
  781. position: absolute;
  782. left: 0;
  783. height: 160rpx;
  784. background-color: #fff;
  785. border-radius: 30rpx 30rpx 0 0;
  786. width: 100vw;
  787. display: flex;
  788. align-items: center;
  789. justify-content: center;
  790. flex-direction: column;
  791. margin-top: 20rpx;
  792. }
  793. .card{
  794. display: flex;
  795. align-items: center;
  796. image{
  797. width: 120rpx;
  798. height: 120rpx;
  799. margin-right: 20rpx;
  800. }
  801. .details view:first-child{
  802. margin-bottom: 10rpx;
  803. }
  804. }
  805. .picture-wrapper {
  806. margin-top: 30rpx;
  807. .bg1 {
  808. background: #F5F9FB;
  809. border-radius: 10rpx;
  810. padding: 40rpx 30rpx;
  811. display: flex;
  812. justify-content: space-between;
  813. .name {
  814. padding-top: 30rpx;
  815. font-size: 32rpx;
  816. font-family: SourceHanSansSC, SourceHanSansSC;
  817. font-weight: 500;
  818. color: #111;
  819. line-height: 34rpx;
  820. }
  821. .value {
  822. margin-top: 20rpx;
  823. font-size: 22rpx;
  824. font-family: SourceHanSansSC, SourceHanSansSC;
  825. font-weight: 400;
  826. color: #999999;
  827. line-height: 24rpx;
  828. }
  829. .tip {
  830. margin-top: 20rpx;
  831. text-align: center;
  832. width: 100rpx;
  833. height: 30rpx;
  834. border-radius: 6rpx;
  835. border: 1rpx solid #CCB375;
  836. .tip-value {
  837. font-size: 20rpx;
  838. font-family: Microsoft YaHei;
  839. font-weight: 400;
  840. color: #CCB375;
  841. line-height: 30rpx;
  842. opacity: 1;
  843. }
  844. }
  845. }
  846. .icon {
  847. width: 304rpx;
  848. height: 190rpx;
  849. background-image: var(--bgimg);
  850. background-size: 100% 100%;
  851. background-repeat: no-repeat;
  852. }
  853. }
  854. .search{
  855. background: #F8F4E7;
  856. border-radius: 10rpx;
  857. border: 1px solid #CCB375;
  858. font-size: 24rpx;
  859. color: #CCB375;
  860. padding: 0rpx 14rpx;
  861. flex-shrink: 0;
  862. height: 60rpx;
  863. line-height: 60rpx;
  864. margin-left: 20rpx;
  865. }
  866. .showworld{
  867. display: flex;
  868. justify-content: flex-end;
  869. }
  870. .choice-takePhoto-wrap {
  871. width: 100%;
  872. height: 100vh;
  873. background-color: rgba(127, 127, 127, 0.2);
  874. position: fixed;
  875. left: 0;
  876. top: 0;
  877. z-index: 11111;
  878. .choice-takePhoto {
  879. position: absolute;
  880. bottom: 0;
  881. background-color: white;
  882. width: 100%;
  883. border-radius: 20rpx 20rpx 0 0;
  884. }
  885. .choice-takePhoto>view:first-child {
  886. text-align: center;
  887. height: 80rpx;
  888. line-height: 80rpx;
  889. border-bottom: 1rpx solid rgba(127, 127, 127, 0.3);
  890. background-color: white;
  891. }
  892. .choice-takePhoto>view:last-child {
  893. text-align: center;
  894. height: 80rpx;
  895. line-height: 80rpx;
  896. border-top: 6rpx solid rgba(127, 127, 127, 0.1);
  897. background-color: white;
  898. }
  899. .choice-takePhoto>view {
  900. text-align: center;
  901. height: 80rpx;
  902. line-height: 80rpx;
  903. background-color: white;
  904. }
  905. }
  906. .right-show{
  907. display: flex;
  908. justify-content: flex-end;
  909. }
  910. </style>