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

car-message-change.vue 35KB

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