Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

car-message-change.vue 35KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302
  1. <template>
  2. <view v-if="state.isMyPeopple" class="content">
  3. <view class="item-tips">
  4. <view class="title"> 上传后请核对识别信息 </view>
  5. <view class="tip"> 如有错误请及时手动修改 </view>
  6. </view>
  7. <view class="picture-wrapper" @click="takePhotoMode('1','my')">
  8. <view class="bg">
  9. <view class="">
  10. <view class="name"> 人像面 </view>
  11. <view class="value"> 上传身份证的人像面 </view>
  12. <view class="tip">
  13. <view class="tip-value"> 拍摄规范 </view>
  14. </view>
  15. </view>
  16. <image v-if="!state.form.ownPosImgUrl" class="icon" :src="`${$imgUrl}applyCard/renxiang.png`">
  17. </image>
  18. <image v-else class="icon" :src="strReplace(state.form.ownPosImgUrl)"></image>
  19. </view>
  20. </view>
  21. <view class="picture-wrapper" @click="takePhotoMode('2','my')">
  22. <view class="bg">
  23. <view class="">
  24. <view class="name"> 国徽面 </view>
  25. <view class="value"> 上传身份证的国徽面 </view>
  26. <view class="tip">
  27. <view class="tip-value"> 拍摄规范 </view>
  28. </view>
  29. </view>
  30. <image v-if="!state.form.ownNegImgUrl" class="icon" :src="`${$imgUrl}applyCard/guohui.png`">
  31. </image>
  32. <image v-else class="icon" :src="strReplace(state.form.ownNegImgUrl)"></image>
  33. </view>
  34. </view>
  35. <view class="shibie-wrapper">
  36. <view class="title"> 识别内容如下 </view>
  37. <u-form label-width="230" :model="state.form" ref="uForm">
  38. <u-form-item label="姓名">
  39. <u-input v-model="state.form.userName" placeholder='请输入姓名' :disabled="state.isEnableOCRData"
  40. maxlength="20" @input="replaceInput" />
  41. </u-form-item>
  42. <u-form-item label="身份证号">
  43. <u-input placeholder='请输入身份证' type="idcard" v-model="state.form.userIdNum"
  44. :disabled="state.isEnableOCRData" maxlength="18" />
  45. </u-form-item>
  46. <u-form-item label="地址">
  47. <u-input placeholder='请输入地址' :autoHeight='true' v-model="state.form.address"
  48. :disabled="state.isEnableOCRData" maxlength="100" />
  49. </u-form-item>
  50. <u-form-item label="联系方式">
  51. <u-input placeholder='请输入联系方式' type="number" v-model="state.form.tel" maxlength="11" />
  52. </u-form-item>
  53. </u-form>
  54. </view>
  55. <view class="picture-wrapper" @click="takePhotoMode('3')">
  56. <view class="bg">
  57. <view class="">
  58. <view class="name"> 行驶证主页 </view>
  59. <view class="value"> 上传行驶证的主页 </view>
  60. <view class="tip">
  61. <view class="tip-value"> 拍摄规范 </view>
  62. </view>
  63. </view>
  64. <image v-if="!state.form.vehPosImgUrl" class="icon" :src="`${$imgUrl}applyCard/car-zhu.png`">
  65. </image>
  66. <image v-else class="icon" :src="strReplace(state.form.vehPosImgUrl)"></image>
  67. </view>
  68. </view>
  69. <view class="picture-wrapper" @click="takePhotoMode('4')">
  70. <view class="bg">
  71. <view class="">
  72. <view class="name"> 行驶证副页 </view>
  73. <view class="value"> 上传行驶证的副页 </view>
  74. <view class="tip">
  75. <view class="tip-value"> 拍摄规范 </view>
  76. </view>
  77. </view>
  78. <image v-if="!state.form.vehNegImgUrl" class="icon" :src="`${$imgUrl}applyCard/car-fu.png`">
  79. </image>
  80. <image v-else class="icon" :src="strReplace(state.form.vehNegImgUrl)"></image>
  81. </view>
  82. </view>
  83. <view class="picture-wrapper" @click="cardFileImageUpdate()">
  84. <view class="bg">
  85. <view class="">
  86. <view class="name"> 车头照 </view>
  87. <view class="value"> 上传汽车的车头照片 </view>
  88. <view class="tip">
  89. <view class="tip-value"> 拍摄规范 </view>
  90. </view>
  91. </view>
  92. <image v-if="!state.form.vehBodyUrl" class="icon" :src="`${$imgUrl}applyCard/chetou.png`">
  93. </image>
  94. <image v-else class="icon" :src="strReplace(state.form.vehBodyUrl)"></image>
  95. </view>
  96. </view>
  97. <view class="shibie-wrapper">
  98. <view class="title"> 识别内容如下 </view>
  99. <view class="">
  100. <u-form label-width="200" :model="state.form" ref="uForm">
  101. <u-form-item label="车牌号">
  102. <car-number-input @numberInputResult="carNumber"
  103. :defaultStr="state.form.vehicleIdNum"></car-number-input>
  104. </u-form-item>
  105. <u-form-item label="所有人">
  106. <u-input inputAlign="right" placeholder="请输入所有人" v-model="state.form.ownerName"
  107. :disabled="state.isEnableChangeOCRCarInfo" />
  108. </u-form-item>
  109. <u-form-item label="车辆类型">
  110. <u-input inputAlign="right" placeholder="请输入车辆类型" v-model="state.form.vehicleType"
  111. :disabled="state.isEnableChangeOCRCarInfo" />
  112. </u-form-item>
  113. <!-- <u-form-item label="使用性质">
  114. <u-input inputAlign="right" placeholder="请输入使用性质" v-model="state.form.character"
  115. :disabled="state.isEnableChangeOCRCarInfo" />
  116. </u-form-item> -->
  117. <u-form-item label="车辆识别代号">
  118. <u-input inputAlign="right" placeholder="请输入车辆识别代号" v-model="state.form.vin"
  119. :disabled="state.isEnableChangeOCRCarInfo" />
  120. </u-form-item>
  121. <u-form-item label="发动机号码">
  122. <u-input inputAlign="right" placeholder="请输入发动机号码" v-model="state.form.engineNum"
  123. :disabled="state.isEnableChangeOCRCarInfo" />
  124. </u-form-item>
  125. <u-form-item label="注册日期">
  126. <picker mode="date" :value="state.form.register" @change="bindDateChange1"
  127. :disabled="state.isEnableChangeOCRCarInfo">
  128. <view class="uni-input" style="text-align: right;">
  129. {{state.form.register}}
  130. </view>
  131. </picker>
  132. </u-form-item>
  133. <u-form-item label="发证日期">
  134. <picker mode="date" :value="state.form.issueDate" @change="bindDateChange2"
  135. :disabled="state.isEnableChangeOCRCarInfo">
  136. <view class="uni-input" style="text-align: right;">
  137. {{state.form.issueDate}}
  138. </view>
  139. </picker>
  140. </u-form-item>
  141. <u-form-item label="核定载人数">
  142. <u-input inputAlign="right" placeholder="请输入核定载人数" v-model="state.form.approvedCountShow"
  143. :disabled="state.isEnableChangeOCRCarInfo" />
  144. </u-form-item>
  145. <u-form-item label="整备质量">
  146. <u-input inputAlign="right" placeholder="请输入整备质量" v-model="state.form.maintenaceMassShow"
  147. :disabled="state.isEnableChangeOCRCarInfo" />
  148. </u-form-item>
  149. <view class="form-item">
  150. <label>外廊尺寸</label>
  151. <view class="input-box">
  152. <text class="sub-label">长</text>
  153. <input v-model="state.outlineL" @input="outlineInput"
  154. :disabled="state.isEnableChangeOCRCarInfo" />
  155. <text class="sub-text">X</text>
  156. <text class="sub-label">宽</text>
  157. <input v-model="state.outlineW" @input="outlineInput"
  158. :disabled="state.isEnableChangeOCRCarInfo" />
  159. <text class="sub-text">X</text>
  160. <text class="sub-label">高</text>
  161. <input v-model="state.outlineH" @input="outlineInput"
  162. :disabled="state.isEnableChangeOCRCarInfo" />
  163. <text class="sub-text">mm</text>
  164. </view>
  165. </view>
  166. <u-form-item label="总质量">
  167. <u-input inputAlign="right" placeholder="请输入总质量" v-model="state.form.totalMassShow"
  168. :disabled="state.isEnableChangeOCRCarInfo" />
  169. </u-form-item>
  170. <u-form-item label="车轴数">
  171. <u-input inputAlign="right" placeholder="请输入车轴数" v-model="state.form.axleCount" type="number"
  172. maxlength="2" />
  173. </u-form-item>
  174. <view class="form-item">
  175. <label>车辆用户类型</label>
  176. <view class="select" @click="state.actionSheetShow = true">{{state.form.useUserTypeName}}</view>
  177. <image :src="`${$imgUrl}common/arror-down.png`" class="icon"
  178. @click="state.actionSheetShow = true"></image>
  179. </view>
  180. </u-form>
  181. </view>
  182. </view>
  183. <view class="green-tip">
  184. 如识别信息有误,请手动修改,确认无误后,点击下一步!
  185. </view>
  186. <view class="action">
  187. <button type="default" class="button" @click="savaHandleCar()">
  188. 下一步
  189. </button>
  190. </view>
  191. <!-- 车辆类型弹窗 -->
  192. <u-popup mode="bottom" v-model="state.actionSheetShow">
  193. <view class="window">
  194. <view class="window-item" v-for="item in state.actionSheetList" :key="item.value"
  195. @click="userType(item)">{{item.text}}</view>
  196. </view>
  197. </u-popup>
  198. </view>
  199. <u-select mode="single-column" :list="state.genderList" v-model="state.genderShow" @confirm="genderSelectConfirm">
  200. </u-select>
  201. <view class="choice-takePhoto-wrap" v-if="state.isTakePhotoModeShow" @click="cancle">
  202. <view class="choice-takePhoto">
  203. <view @click.stop="takePhoto(state.choiceIndex)" style="border-radius: 20rpx 20rpx 0 0;">拍照</view>
  204. <view @click.stop="xiangce(state.choiceIndex)">从手机相册选择</view>
  205. <view @click.stop="cancle">取消</view>
  206. </view>
  207. </view>
  208. <viewfinder v-if="state.phoneType" :phoneType="state.phoneType" :images="state.images"
  209. :showStartPhoto="state.showImg" @confirmReturn="confirmReturn" @camera="camera"></viewfinder>
  210. </template>
  211. <script setup lang="ts">
  212. import viewfinder from "../../components/viewfinder.vue"
  213. import {
  214. reactive,
  215. ref,
  216. } from "vue";
  217. import {
  218. msg,
  219. checkStr,
  220. strReplace,
  221. uploadFile, hasLogin
  222. } from "@/utils/utils";
  223. import {
  224. onLoad,
  225. onPageScroll,
  226. } from "@dcloudio/uni-app";
  227. import {
  228. etcOcrCard,
  229. etcUserCardInfoSubmit,
  230. fileUpload,
  231. register,
  232. envs,
  233. getUserMsg,
  234. ocrAllQuery,
  235. etcCarOcrCard,
  236. searchVehicleInfo,
  237. carChangeApi
  238. } from "@/utils/network/api.js";
  239. import {
  240. request
  241. } from "@/utils/network/request.js";
  242. import {
  243. stringToJson
  244. } from "@/utils/network/encryption";
  245. import {
  246. setItem,
  247. getItem,
  248. StorageKeys
  249. } from "@/utils/storage";
  250. import {
  251. getCodeName
  252. } from "@/datas/queryKey.js";
  253. import navBar from "@/components/nav-bar/nav-bar2.vue";
  254. import carNumberInput from "@/components/car-number-input/car-number-input.vue";
  255. import { getObuStatus } from "@/datas/obuStatus.js";
  256. import { getEtcCardStatus } from "@/datas/etcCardStatus.js";
  257. const scrollTop = ref(0)
  258. const state = reactive({
  259. showImg: true,
  260. isMy: "",//自己办理 他人办理
  261. phoneType: 0, // 1 身份证正面 2 身份证反面 3行驶证正面 4行驶证反面
  262. choiceIndex: 1, // 1 身份证正面 2 身份证反面
  263. isTakePhotoModeShow: false, //选择拍照方式是否出来
  264. images: '',
  265. genderList: [{
  266. value: '男',
  267. label: '男'
  268. },
  269. {
  270. value: '女',
  271. label: '女'
  272. }
  273. ],
  274. form: {
  275. orderId: "", //订单ID
  276. userName: "", //开户人姓名
  277. userIdType: "101", //用户证件类型 101//身份证
  278. userIdNum: "", //用户证件号码
  279. tel: "", //开户人手机号
  280. address: "", //开户人地址
  281. sceneType: "", //用户协议支撑服务场景(发行服务机构和用户签订的协议)
  282. channelId: "", //渠道id
  283. gender: "",
  284. customerIdVld: "",
  285. agentName: "",
  286. agentGender: "",
  287. agentTel: '',
  288. agentPhone: "",
  289. agentIdType: "101",
  290. agentIdNum: "",
  291. agentPosImgUrl: "",
  292. agentNegImgUrl: "",
  293. proxyUrl: "",
  294. agentAddress: "",
  295. agentIdVld: '',
  296. opId: '',
  297. orderSource: 'WECHAT',
  298. ownerName: "", //所有人
  299. character: "", //使用性质
  300. register: "请输入注册日期", //注册日期
  301. customerId: "", //用户编号
  302. vehicleId: "",
  303. vehicleIdNum: "", //车牌编号
  304. issueDate: "请输入发证日期", //发证日期
  305. vehPosImgUrl: "", //行驶证正面
  306. vehNegImgUrl: "", //行驶证证反面
  307. type: "0", //0,客车 1.货车
  308. useUserType: 0, //车辆用户类型
  309. useUserTypeName: "普通车",
  310. vehicleSign: 2, //前/后装标识
  311. vin: "", //车辆识别代号
  312. engineNum: "", //发动机号码
  313. vehicleType: "", //车辆类型
  314. vehicleModel: "", //行驶证品牌型号
  315. approvedCount: undefined, //核定人数
  316. approvedCountShow: undefined,//展示的
  317. totalMass: undefined, //总质量
  318. totalMassShow: undefined, //总质量
  319. maintenaceMass: undefined, //整备质量
  320. maintenaceMassShow: undefined, //整备质量展示的
  321. permittedWeight: "", //核定载质量
  322. vehicleDimensions: "", //车辆尺寸
  323. permittedTowWeight: "", //准牵引总质量
  324. axleCount: "", //车轴数
  325. ownerName: "", //车主姓名
  326. ownerIdType: "", //车主证件类型
  327. ownerIdNum: "", //车主证件号码
  328. ownPosImgUrl: "", //车主证件正面图片
  329. ownNegImgUrl: "", //车主证件反面图片
  330. agreementId: "", //签约编号
  331. // channelId: "5201018892300000001", //编号渠道
  332. scenePayType: "", //
  333. transportIdNum: "", //道路运输证编号
  334. licenseIdNum: "", //经营许可证编号
  335. vehBodyUrl: "", //车身照片
  336. // proxyUrl: "", //委托书地址
  337. },
  338. genderShow: false,
  339. orderId: "",
  340. vehiclePlateColor: undefined,
  341. isMyPeopple: true,
  342. isSign: '',
  343. type: 1,
  344. isEnableOther: true, //小程序是否支持他人办理
  345. isEnableBook: true, //他人办理时是否上传委托书
  346. isEnableInfo: true, //小程序信息带出
  347. isEnableOCRData: true, //允许修改OCR识别出来的数据
  348. changeColor: false,
  349. data: {
  350. transferLogs: [],
  351. },
  352. actionSheetShow: false,
  353. actionSheetList: [{
  354. text: "普通车",
  355. value: 0,
  356. },
  357. {
  358. text: "道路运输证经营范围仅有“货物专用运输(集装箱) ”的牵引车办理J类型集装箱",
  359. value: 24,
  360. },
  361. {
  362. text: "道路运输证经营范围不含“货物专用运输(集装箱)”的牵引车",
  363. value: 27,
  364. },
  365. {
  366. text: '道路运输证经营范围除“货物专用运输 (集装 箱)"外,还有“普通货运”等其他项目的牵引车办理J2类型集装箱',
  367. value: 28,
  368. }],
  369. orderId: "",
  370. // type: undefined, //标记来源是否登录 1为未登录数据 - 需要新增地址
  371. show: false,
  372. isMyPeopple: true,
  373. outlineL: "",
  374. outlineW: "",
  375. outlineH: "",
  376. isEnableChangeOCRCarInfo: false, //申办时是否允许修改OCR识别出来的车辆信息数据
  377. // allData: {}
  378. });
  379. const searchVehicleInfoQuery = () => {
  380. const options = {
  381. type: 2,
  382. data: {
  383. vehicleId: state.form.vehicleId
  384. },
  385. method: "POST",
  386. showLoading: true,
  387. };
  388. request(searchVehicleInfo, options).then((res) => {
  389. let result = stringToJson(res.bizContent);
  390. // state.allData = result.vehicles[0]
  391. writeMsg(result.vehicles[0])
  392. });
  393. }
  394. const writeMsg = (allData) => {
  395. console.log("车辆信息", allData);
  396. state.form.ownPosImgUrl = allData['ownerPosImgUrl']
  397. state.form.ownNegImgUrl = allData['ownerNegImgUrl']
  398. state.form.userName = allData['contacts']
  399. state.form.userIdNum = allData['ownerIdNum']
  400. state.form.ownerIdNum = allData['ownerIdNum']
  401. state.form.address = allData['ownerAddress']
  402. state.form.tel = allData['ownerTel']
  403. state.form.vehPosImgUrl = allData['vehPosImgUrl']
  404. state.form.vehNegImgUrl = allData['vehNegImgUrl']
  405. state.form.vehBodyUrl = allData['vehBodyUrl']
  406. state.form.vehicleIdNum = allData['vehiclePlate']
  407. state.form.ownerName = allData['ownerName']
  408. state.form.vehicleType = allData['vehicleType']
  409. // state.form.character = allData['vehicleType'] //使用性质
  410. state.form.vin = allData['vin']
  411. state.form.engineNum = allData['engineNum']
  412. state.form.register = allData['registerDate']
  413. state.form.issueDate = allData['issueDate']
  414. state.form.approvedCountShow = allData['approvedCount']
  415. state.form.maintenaceMassShow = allData['maintenaceMass']
  416. state.form.approvedCount = allData['approvedCount']
  417. state.form.maintenaceMass = allData['maintenaceMass']
  418. allData['vehicleDimensions']
  419. let arr = allData['vehicleDimensions'].split("X");
  420. state.outlineL = parseInt(arr[0]); //外廓 长
  421. state.outlineW = parseInt(arr[1]); //外廓 宽
  422. state.outlineH = parseInt(arr[2].substring(0, arr[2].length - 2)); //外廓 高
  423. state.form.totalMassShow = allData['totalMass']
  424. state.form.totalMass = allData['totalMass']
  425. state.form.axleCount = allData['axleCount'] ? allData['axleCount'] : 2
  426. if (allData['useUserType'] == 0) {
  427. state.form.useUserTypeName = "普通车"
  428. } else if (allData['useUserType'] == 24) {
  429. state.form.useUserTypeName = "道路运输证经营范围仅有“货物专用运输(集装箱) ”的牵引车办理J类型集装箱"
  430. } else if (allData['useUserType'] == 27) {
  431. state.form.useUserTypeName = "道路运输证经营范围不含“货物专用运输(集装箱)”的牵引车"
  432. } else if (allData['useUserType'] == 28) {
  433. state.form.useUserTypeName = "道路运输证经营范围除'货物专用运输 (集装 箱)'外,还有“普通货运”等其他项目的牵引车办理J2类型集装箱"
  434. }
  435. state.vehiclePlateColor = allData['vehiclePlateColor']
  436. state.form.customerId = allData['customerId']
  437. }
  438. const userGenderAction = () => {
  439. state.genderShow = true;
  440. };
  441. const genderSelectConfirm = (e) => {
  442. state.form.gender = ''
  443. e.map((val, index) => {
  444. state.form.gender = val.label;
  445. })
  446. };
  447. const camera = () => {
  448. state.phoneType = 0
  449. }
  450. onLoad((option : any) => {
  451. state.form.vehicleId = option.vehicleId;
  452. state.form.opId = getItem('openId') ? getItem('openId') : '';
  453. getGlobalParam(); //全局配置数据
  454. console.log("option", option)
  455. searchVehicleInfoQuery(); //车辆信息查询
  456. });
  457. //监听页面滚动
  458. onPageScroll((e) => {
  459. scrollTop.value = e.scrollTop;
  460. });
  461. const replaceInput = (event) => {
  462. console.log("event", event)
  463. const screeningStr = /[^\u4E00-\u9FA5]/g; //想禁止什么类型,在这里替换正则就可以了
  464. if (screeningStr.test(event)) {
  465. setTimeout(() => {
  466. state.form.userName = event.replace(screeningStr, '');
  467. }, 100)
  468. } else {
  469. setTimeout(() => {
  470. state.form.userName = event;
  471. }, 100)
  472. }
  473. console.log("event.replace(screeningStr, '')", event.replace(screeningStr, ''), event, state.form.userName)
  474. }
  475. const getGlobalParam = () => {
  476. const data = getItem('globalParam')
  477. console.log("全局配置数据", getCodeName('IS_ENABLE', data.miniSupportOther), getCodeName('IS_ENABLE', data.otherUploadProxy), getCodeName('IS_ENABLE', data.miniInfoShow), getCodeName('IS_ENABLE', data.changeOCRData))
  478. // 小程序是否支持他人办理
  479. if (getCodeName('IS_ENABLE', data.miniSupportOther) == '启用') {
  480. state.isEnableOther = true;
  481. } else {
  482. state.isEnableOther = false;
  483. }
  484. // 他人办理时是否上传委托书
  485. if (getCodeName('IS_ENABLE', data.otherUploadProxy) == '启用') {
  486. state.isEnableBook = true;
  487. } else {
  488. state.isEnableBook = false;
  489. }
  490. // 小程序信息带出
  491. if (getCodeName('IS_ENABLE', data.miniInfoShow) == '启用') {
  492. state.isEnableInfo = true;
  493. uni.showModal({
  494. // title: '提示',
  495. content: '是否允许带出用户信息',
  496. success: function (res) {
  497. if (res.confirm) {
  498. console.log('用户点击确定');
  499. } else if (res.cancel) {
  500. console.log('用户点击取消');
  501. }
  502. }
  503. });
  504. } else {
  505. state.isEnableInfo = false;
  506. }
  507. // 允许修改OCR识别出来的数据
  508. if (getCodeName('IS_ENABLE', data.changeOCRData) == '启用') {
  509. state.isEnableOCRData = false;
  510. } else {
  511. state.isEnableOCRData = true;
  512. }
  513. // 申办时是否允许修改OCR识别出来的车辆信息数据
  514. // if (getCodeName('IS_ENABLE', data.applyChangeOCRCarInfo) == '启用') {
  515. // state.isEnableChangeOCRCarInfo = true;
  516. // } else {
  517. // state.isEnableChangeOCRCarInfo = false;
  518. // }
  519. }
  520. const takePhotoMode = (index, isMy) => {
  521. console.log("index", index, isMy)
  522. state.isTakePhotoModeShow = true
  523. state.choiceIndex = index
  524. state.isMy = isMy
  525. }
  526. const xiangce = (val) => {
  527. console.log("val", val)
  528. var imageType = val;
  529. if (state.choiceIndex == 3) {
  530. var imageType = 1;
  531. } else {
  532. var imageType = 2;
  533. }
  534. uni.chooseImage({
  535. count: 1, //只能选取一张照片
  536. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  537. sourceType: ["album"], //从相册选择
  538. success: function (res) {
  539. state.showImg = false
  540. state.images = res.tempFilePaths[0]
  541. state.phoneType = state.choiceIndex
  542. state.isTakePhotoModeShow = false
  543. if (state.choiceIndex == 3 || state.choiceIndex == 4) {
  544. state.showImg = false
  545. state.images = res.tempFilePaths[0]
  546. state.phoneType = state.choiceIndex
  547. state.isTakePhotoModeShow = false
  548. return
  549. }
  550. console.log("tempFilePaths[0].startsWith('file://')", res.tempFilePaths[0], res.tempFilePaths[0].startsWith('file://'))
  551. },
  552. })
  553. }
  554. const takePhoto = (val) => {
  555. state.showImg = true
  556. console.log("拍照", val)
  557. state.phoneType = val;
  558. }
  559. const confirmReturn = (val) => {
  560. console.log("图片地址val", val)
  561. state.phoneType = 0
  562. state.isTakePhotoModeShow = false
  563. // var imageType = state.choiceIndex;
  564. if (state.choiceIndex == 1) {
  565. var imageType = 1;
  566. var queryCode = etcOcrCard
  567. } else if (state.choiceIndex == 2) {
  568. var imageType = 2;
  569. var queryCode = etcOcrCard
  570. }
  571. if (state.choiceIndex == 3) {
  572. var imageType = 1;
  573. var queryCode = etcCarOcrCard
  574. } else if (state.choiceIndex == 4) {
  575. var imageType = 2;
  576. var queryCode = etcCarOcrCard
  577. }
  578. // uploadFile(val.tempImagePath, imageType, ocrAllQuery).then((data) => {
  579. uploadFile(val.tempImagePath, imageType, queryCode).then((data) => {
  580. if (state.isMy == "my") {
  581. if (state.choiceIndex == "1") {
  582. console.log("身份证上传", data)
  583. state.form.userName = data.name;
  584. state.form.gender = data.gender;
  585. state.form.userIdNum = data.idno;
  586. state.form.ownPosImgUrl = data.imageUrl;
  587. state.form.address = data.address;
  588. } else {
  589. state.form.customerIdVld = data.enddate;
  590. state.form.ownNegImgUrl = data.imageUrl;
  591. }
  592. state.isTakePhotoModeShow = false
  593. } else {
  594. if (state.choiceIndex == "1") {
  595. state.form.agentName = data.name;
  596. state.form.agentGender = data.gender;
  597. state.form.agentIdNum = data.idno;
  598. state.form.agentPosImgUrl = data.imageUrl;
  599. state.form.agentAddress = data.address;
  600. } else if (state.choiceIndex == "2") {
  601. console.log("state.isMy", state.isMy, state.choiceIndex, state.choiceIndex == "1", data)
  602. state.form.agentIdVld = data.enddate;
  603. state.form.agentNegImgUrl = data.imageUrl;
  604. } else if (state.choiceIndex == "3") {
  605. if (data.plate_a.length > 8) {
  606. state.form.vehicleIdNum = data.plate_a.substring(0, 8);
  607. } else {
  608. state.form.vehicleIdNum = data.plate_a;
  609. }
  610. state.form.ownerName = data.ownerName;
  611. state.form.vehicleType = data.vehicle;
  612. state.form.character = data.character;
  613. state.form.vin = data.vin;
  614. state.form.engineNum = data.engine;
  615. state.form.register = data.register;
  616. state.form.issueDate = data.issue;
  617. state.form.vehPosImgUrl = data.imageUrl;
  618. state.form.vehicleModel = data.model;
  619. } else {
  620. state.form.approvedCount = data.apc;
  621. state.form.approvedCountShow = data.apc;
  622. state.form.maintenaceMass = data.unladen;
  623. state.form.maintenaceMassShow = data.unladen;
  624. // 91接口差
  625. // // #ifdef MP-WEIXIN
  626. // state.form.vehicleDimensions = data.overall.replaceAll("×", "X");
  627. // // #endif
  628. // // #ifdef MP-ALIPAY
  629. // state.form.vehicleDimensions = data.overall.replace(/×/g, "X");
  630. // // #endif
  631. // let arr = data.overall.split("×");
  632. // #ifdef MP-WEIXIN
  633. state.form.vehicleDimensions = data.overall.replaceAll("x", "X");
  634. // #endif
  635. // #ifdef MP-ALIPAY
  636. state.form.vehicleDimensions = data.overall.replace(/x/g, "X");
  637. // #endif
  638. let arr = data.overall.split("x");
  639. state.outlineL = arr[0]; //外廓 长
  640. state.outlineW = arr[1]; //外廓 宽
  641. state.outlineH = arr[2].substring(0, arr[2].length - 2); //外廓 高
  642. state.form.totalMass = data.gross;
  643. state.form.totalMassShow = data.gross;
  644. state.form.vehNegImgUrl = data.imageUrl;
  645. state.form.permittedWeight = data.alc ? data.alc : 0;
  646. state.form.permittedTowWeight = data.towing ? data.towing : 0;
  647. console.log('=====================', state.form.vehNegImgUrl, state)
  648. }
  649. state.isTakePhotoModeShow = false
  650. }
  651. })
  652. }
  653. const cancle = () => {
  654. state.isTakePhotoModeShow = false
  655. }
  656. // 车辆信息
  657. //车牌号输入
  658. const carNumber = (val : any) => {
  659. state.form.vehicleIdNum = val.trim();
  660. };
  661. //提交车辆信息
  662. const savaHandleCar = () => {
  663. if (!checkStr(state.form.userIdNum, 'card')) {
  664. msg('请输入正确身份证');
  665. return;
  666. }
  667. if (!checkStr(state.form.tel, 'mobile')) {
  668. msg('请输入正确手机号');
  669. return;
  670. }
  671. if (!state.form.vehBodyUrl) {
  672. msg("请上传车头照");
  673. return;
  674. }
  675. if (state.form.type == 1) {
  676. state.form.axleCount = 2;
  677. } else {
  678. if (!state.form.axleCount) {
  679. msg("请输入车轴数");
  680. return;
  681. }
  682. }
  683. state.form.vehicleId =
  684. state.form.vehicleIdNum + "_" + state.vehiclePlateColor;
  685. state.form.opId = getItem(StorageKeys.OpenId);
  686. state.form.approvedCount = parseFloat(state.form.approvedCount);
  687. state.form.maintenaceMass = parseFloat(state.form.maintenaceMass);
  688. state.form.totalMass = parseFloat(state.form.totalMass);
  689. state.form.permittedWeight = parseFloat(state.form.permittedWeight);
  690. state.form.permittedTowWeight = parseFloat(state.form.permittedTowWeight);
  691. const options = {
  692. type: 2,
  693. data: state.form,
  694. method: "POST",
  695. showLoading: true,
  696. };
  697. request(carChangeApi, options)
  698. .then((res) => {
  699. const data = stringToJson(res.bizContent);
  700. msg("车辆信息变更成功")
  701. setTimeout(() => {
  702. uni.navigateBack({
  703. delta: 2
  704. })
  705. }, 2000)
  706. })
  707. .catch((res) => {
  708. console.log(res);
  709. });
  710. };
  711. const selectConfirm = (index : any) => {
  712. console.log(index);
  713. state.form.useUserType = state.actionSheetList[index].value;
  714. state.form.useUserTypeName = state.actionSheetList[index].text;
  715. };
  716. //选择车辆用户类型
  717. const userType = (item : any) => {
  718. state.form.useUserType = item.value;
  719. state.form.useUserTypeName = item.text;
  720. state.actionSheetShow = false;
  721. }
  722. // 车头照图片上传
  723. const cardFileImageUpdate = () => {
  724. uni.chooseImage({
  725. count: 1, //只能选取一张照片
  726. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  727. sourceType: ["camera", "album"], //从相册选择
  728. success: function (res) {
  729. uploadFile(res.tempFilePaths[0], "", "").then((data) => {
  730. state.form.vehBodyUrl = data;
  731. })
  732. },
  733. });
  734. };
  735. //外廓尺寸输入框
  736. const outlineInput = (e) => {
  737. state.form.vehicleDimensions =
  738. state.outlineL + "X" + state.outlineW + "X" + state.outlineH + "mm";
  739. };
  740. const bindDateChange1 = (e) => {
  741. state.form.register = e.detail.value
  742. state.changeColor = true;
  743. }
  744. const bindDateChange2 = (e) => {
  745. state.form.issueDate = e.detail.value
  746. state.changeColor = true;
  747. }
  748. </script>
  749. <style lang="scss" scoped>
  750. .title {
  751. font-size: 35rpx;
  752. font-family: Microsoft YaHei;
  753. font-weight: 400;
  754. color: #000000;
  755. line-height: 80rpx;
  756. margin-bottom: 10rpx;
  757. }
  758. .content-wrap {
  759. position: relative;
  760. // margin-top: -50rpx;
  761. padding: 0rpx 30rpx;
  762. display: flex;
  763. .big {
  764. font-size: 30rpx;
  765. font-family: Microsoft YaHei;
  766. font-weight: 400;
  767. color: #333333;
  768. line-height: 24rpx;
  769. }
  770. .nomal {
  771. font-size: 26rpx;
  772. font-family: Microsoft YaHei;
  773. font-weight: 400;
  774. color: #666666;
  775. line-height: 24rpx;
  776. }
  777. .tip {
  778. margin-top: -5px;
  779. width: 117rpx;
  780. height: 16rpx;
  781. background: #00b38b;
  782. opacity: 0.3;
  783. }
  784. }
  785. .content {
  786. padding: 50rpx 30rpx 50rpx 30rpx;
  787. .action {
  788. padding-left: 20rpx;
  789. padding-right: 20rpx;
  790. padding-bottom: 30rpx;
  791. .button {
  792. height: 80rpx;
  793. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  794. border-radius: 40rpx;
  795. font-size: 32rpx;
  796. font-weight: 400;
  797. color: #ffffff;
  798. line-height: 80rpx;
  799. }
  800. }
  801. .item-tips {
  802. .title {
  803. font-size: 30rpx;
  804. font-family: Microsoft YaHei;
  805. font-weight: 400;
  806. color: #000000;
  807. line-height: 24rpx;
  808. }
  809. .tip {
  810. margin-top: 16rpx;
  811. font-size: 24rpx;
  812. font-family: Microsoft YaHei;
  813. font-weight: 400;
  814. color: #999999;
  815. line-height: 24rpx;
  816. }
  817. }
  818. .picture-wrapper {
  819. margin-top: 40rpx;
  820. .bg {
  821. background: #ffffff;
  822. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  823. border-radius: 20rpx;
  824. padding: 40rpx;
  825. display: flex;
  826. // align-items: center;
  827. justify-content: space-between;
  828. .name {
  829. font-size: 34rpx;
  830. font-family: Microsoft YaHei;
  831. font-weight: 400;
  832. color: #000000;
  833. line-height: 34rpx;
  834. }
  835. .value {
  836. margin-top: 20rpx;
  837. font-size: 24rpx;
  838. font-family: Microsoft YaHei;
  839. font-weight: 400;
  840. color: #999999;
  841. line-height: 24rpx;
  842. }
  843. .tip {
  844. margin-top: 20rpx;
  845. text-align: center;
  846. width: 110rpx;
  847. height: 40rpx;
  848. background: rgba(33, 190, 177, 0.2);
  849. border-radius: 6rpx;
  850. .tip-value {
  851. font-size: 20rpx;
  852. font-family: Microsoft YaHei;
  853. font-weight: 400;
  854. color: #0a8f8a;
  855. line-height: 40rpx;
  856. opacity: 1;
  857. }
  858. }
  859. }
  860. .icon {
  861. width: 294rpx;
  862. height: 188rpx;
  863. }
  864. }
  865. .shibie-wrapper {
  866. margin-top: 60rpx;
  867. .title {
  868. font-size: 30rpx;
  869. font-family: Microsoft YaHei;
  870. font-weight: 400;
  871. color: #000000;
  872. line-height: 30rpx;
  873. }
  874. }
  875. .buchong-wrapper {
  876. margin-top: 60rpx;
  877. .title {
  878. font-size: 30rpx;
  879. font-family: Microsoft YaHei;
  880. font-weight: 400;
  881. color: #000000;
  882. line-height: 30rpx;
  883. }
  884. }
  885. .green-tip {
  886. margin-top: 50rpx;
  887. font-size: 24rpx;
  888. font-family: Microsoft YaHei;
  889. font-weight: 400;
  890. color: #00b38b;
  891. line-height: 24rpx;
  892. margin-bottom: 60rpx;
  893. }
  894. }
  895. .choice-takePhoto {
  896. position: absolute;
  897. bottom: 0;
  898. background-color: white;
  899. width: 100%;
  900. border-radius: 20rpx 20rpx 0 0;
  901. }
  902. .choice-takePhoto>view:first-child {
  903. text-align: center;
  904. height: 80rpx;
  905. line-height: 80rpx;
  906. border-bottom: 1rpx solid rgba(127, 127, 127, 0.3);
  907. background-color: white;
  908. }
  909. .choice-takePhoto>view:last-child {
  910. text-align: center;
  911. height: 80rpx;
  912. line-height: 80rpx;
  913. border-top: 6rpx solid rgba(127, 127, 127, 0.1);
  914. background-color: white;
  915. }
  916. .choice-takePhoto>view {
  917. text-align: center;
  918. height: 80rpx;
  919. line-height: 80rpx;
  920. background-color: white;
  921. }
  922. .choice-takePhoto-wrap {
  923. width: 100%;
  924. height: 100vh;
  925. background-color: rgba(127, 127, 127, 0.2);
  926. position: fixed;
  927. left: 0;
  928. top: 0;
  929. z-index: 11111;
  930. }
  931. .hui {
  932. color: #ccc;
  933. }
  934. .hei {
  935. color: black;
  936. }
  937. .goto {
  938. margin-right: 20rpx;
  939. padding: 10rpx;
  940. color: #00b38b;
  941. border: 1rpx solid #00b38b;
  942. border-radius: 20rpx;
  943. }
  944. .flex {
  945. display: flex;
  946. align-items: center;
  947. }
  948. .bettwen-center {
  949. display: flex;
  950. align-items: center;
  951. justify-content: space-between;
  952. }
  953. .card {
  954. margin: 20rpx;
  955. height: 150rpx;
  956. background: #ffffff;
  957. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  958. border-radius: 20rpx;
  959. padding: 20rpx;
  960. display: flex;
  961. justify-content: space-between;
  962. align-items: center;
  963. margin-bottom: 30rpx;
  964. .card-left {
  965. display: flex;
  966. align-items: center;
  967. image {
  968. width: 100rpx;
  969. height: 90rpx;
  970. }
  971. .card-center {
  972. margin-left: 30rpx;
  973. .card-center-head {
  974. font-size: 32rpx;
  975. font-family: Noto Sans S Chinese;
  976. font-weight: 400;
  977. color: #333333;
  978. }
  979. .tips {
  980. font-size: 26rpx;
  981. font-family: Noto Sans S Chinese;
  982. font-weight: 400;
  983. color: #666666;
  984. .tips-card {
  985. width: 70rpx;
  986. height: 40rpx;
  987. background: #d3f2ef;
  988. border-radius: 6rpx;
  989. font-size: 20rpx;
  990. font-family: Noto Sans S Chinese;
  991. font-weight: 400;
  992. color: #0a8f8a;
  993. padding: 5rpx 10rpx;
  994. margin-left: 20rpx;
  995. }
  996. }
  997. }
  998. }
  999. .choose-item {
  1000. margin-right: 20rpx;
  1001. width: 50rpx;
  1002. height: 50rpx;
  1003. border: 1rpx solid #00b38b;
  1004. border-radius: 50%;
  1005. display: flex;
  1006. justify-content: center;
  1007. align-items: center;
  1008. .active {
  1009. width: 38rpx;
  1010. height: 38rpx;
  1011. background: #00b38b;
  1012. border-radius: 50%;
  1013. }
  1014. }
  1015. }
  1016. .content {
  1017. // position: relative;
  1018. // margin-top: -50rpx;
  1019. // padding: 0rpx 30rpx;
  1020. // position: relative;
  1021. .img-pos {
  1022. position: absolute;
  1023. left: 270rpx;
  1024. top: -38rpx;
  1025. right: 50rpx;
  1026. .img-flex {
  1027. display: flex;
  1028. justify-content: space-between;
  1029. align-items: center;
  1030. .car-img {
  1031. width: 86rpx;
  1032. height: 42rpx;
  1033. }
  1034. .flag-img {
  1035. width: 30rpx;
  1036. height: 35rpx;
  1037. }
  1038. }
  1039. }
  1040. .action {
  1041. padding-left: 20rpx;
  1042. padding-right: 20rpx;
  1043. padding-bottom: 30rpx;
  1044. .button {
  1045. height: 80rpx;
  1046. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  1047. border-radius: 40rpx;
  1048. font-size: 32rpx;
  1049. font-weight: 400;
  1050. color: #ffffff;
  1051. line-height: 80rpx;
  1052. }
  1053. }
  1054. .item-tips {
  1055. .title {
  1056. font-size: 30rpx;
  1057. font-family: Microsoft YaHei;
  1058. font-weight: 400;
  1059. color: #000000;
  1060. line-height: 24rpx;
  1061. }
  1062. .tip {
  1063. margin-top: 16rpx;
  1064. font-size: 24rpx;
  1065. font-family: Microsoft YaHei;
  1066. font-weight: 400;
  1067. color: #999999;
  1068. line-height: 24rpx;
  1069. }
  1070. }
  1071. .picture-wrapper {
  1072. margin-top: 40rpx;
  1073. .bg {
  1074. background: #ffffff;
  1075. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  1076. border-radius: 20rpx;
  1077. padding: 40rpx;
  1078. display: flex;
  1079. // align-items: center;
  1080. justify-content: space-between;
  1081. .name {
  1082. font-size: 34rpx;
  1083. font-family: Microsoft YaHei;
  1084. font-weight: 400;
  1085. color: #000000;
  1086. line-height: 34rpx;
  1087. }
  1088. .value {
  1089. margin-top: 20rpx;
  1090. font-size: 24rpx;
  1091. font-family: Microsoft YaHei;
  1092. font-weight: 400;
  1093. color: #999999;
  1094. line-height: 24rpx;
  1095. }
  1096. .tip {
  1097. margin-top: 20rpx;
  1098. text-align: center;
  1099. width: 110rpx;
  1100. height: 40rpx;
  1101. background: rgba(33, 190, 177, 0.2);
  1102. border-radius: 6rpx;
  1103. .tip-value {
  1104. font-size: 20rpx;
  1105. font-family: Microsoft YaHei;
  1106. font-weight: 400;
  1107. color: #0a8f8a;
  1108. line-height: 40rpx;
  1109. opacity: 1;
  1110. }
  1111. }
  1112. }
  1113. .icon {
  1114. width: 294rpx;
  1115. height: 188rpx;
  1116. }
  1117. }
  1118. .shibie-wrapper {
  1119. margin-top: 60rpx;
  1120. .title {
  1121. font-size: 30rpx;
  1122. font-family: Microsoft YaHei;
  1123. font-weight: 400;
  1124. color: #000000;
  1125. line-height: 30rpx;
  1126. }
  1127. }
  1128. .buchong-wrapper {
  1129. margin-top: 60rpx;
  1130. .title {
  1131. font-size: 30rpx;
  1132. font-family: Microsoft YaHei;
  1133. font-weight: 400;
  1134. color: #000000;
  1135. line-height: 30rpx;
  1136. }
  1137. }
  1138. .green-tip {
  1139. margin-top: 50rpx;
  1140. font-size: 24rpx;
  1141. font-family: Microsoft YaHei;
  1142. font-weight: 400;
  1143. color: #00b38b;
  1144. line-height: 24rpx;
  1145. margin-bottom: 60rpx;
  1146. }
  1147. }
  1148. .form-item {
  1149. display: flex;
  1150. font-size: 28rpx;
  1151. justify-content: space-between;
  1152. align-items: center;
  1153. }
  1154. .form-item label {}
  1155. .form-item .input-box {
  1156. display: flex;
  1157. align-items: center;
  1158. }
  1159. .form-item .select {
  1160. flex: 1;
  1161. background: #f1f1f1;
  1162. padding: 6rpx 20rpx;
  1163. margin: 0 10rpx;
  1164. min-height: 48rpx;
  1165. line-height: 48rpx;
  1166. border-radius: 8rpx;
  1167. }
  1168. .form-item .icon {
  1169. width: 28rpx;
  1170. height: 32rpx;
  1171. }
  1172. .form-item .input-box input {
  1173. width: 90rpx;
  1174. background: #f1f1f1;
  1175. border-radius: 8rpx;
  1176. padding: 0 5rpx;
  1177. }
  1178. .form-item .sub-text {
  1179. color: #808080;
  1180. padding-left: 10rpx;
  1181. }
  1182. .form-item .sub-label {
  1183. padding: 0 10rpx;
  1184. }
  1185. .window {
  1186. padding: 60rpx 30rpx;
  1187. }
  1188. .window .window-item {
  1189. border: 1px solid #00b38b;
  1190. background: rgba(0, 179, 139, .1);
  1191. border-radius: 10rpx;
  1192. padding: 16rpx 30rpx;
  1193. font-size: 30rpx;
  1194. margin-bottom: 10rpx;
  1195. }
  1196. ::v-deep .u-input__input {
  1197. background: transparent;
  1198. }
  1199. </style>