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

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