Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

car-message-change.vue 34KB

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