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.

car-message-change.vue 35KB

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