Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

car-message-change.vue 35KB

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