選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

car-message-change.vue 35KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301
  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. register,
  225. ocrAllQuery,
  226. etcCarOcrCard,
  227. searchVehicleInfo,
  228. carChangeApi,
  229. creactWorkOrder
  230. } from "@/utils/network/api.js";
  231. import {
  232. request
  233. } from "@/utils/network/request.js";
  234. import {
  235. stringToJson
  236. } from "@/utils/network/encryption";
  237. import {
  238. setItem,
  239. getItem,
  240. StorageKeys
  241. } from "@/utils/storage";
  242. import {
  243. getCodeName
  244. } from "@/datas/queryKey.js";
  245. import navBar from "@/components/nav-bar/nav-bar2.vue";
  246. import carNumberInput from "@/components/car-number-input/car-number-input.vue";
  247. const scrollTop = ref(0)
  248. const state = reactive({
  249. showImg: true,
  250. isMy: "",//自己办理 他人办理
  251. phoneType: 0, // 1 身份证正面 2 身份证反面 3行驶证正面 4行驶证反面
  252. choiceIndex: 1, // 1 身份证正面 2 身份证反面
  253. isTakePhotoModeShow: false, //选择拍照方式是否出来
  254. images: '',
  255. genderList: [{
  256. value: '男',
  257. label: '男'
  258. },
  259. {
  260. value: '女',
  261. label: '女'
  262. }
  263. ],
  264. form: {
  265. orderId: "", //订单ID
  266. userName: "", //开户人姓名
  267. userIdType: "101", //用户证件类型 101//身份证
  268. userIdNum: "", //用户证件号码
  269. tel: "", //开户人手机号
  270. address: "", //开户人地址
  271. sceneType: "", //用户协议支撑服务场景(发行服务机构和用户签订的协议)
  272. channelId: "", //渠道id
  273. gender: "",
  274. customerIdVld: "",
  275. agentName: "",
  276. agentGender: "",
  277. agentTel: '',
  278. agentPhone: "",
  279. agentIdType: "101",
  280. agentIdNum: "",
  281. agentPosImgUrl: "",
  282. agentNegImgUrl: "",
  283. proxyUrl: "",
  284. agentAddress: "",
  285. agentIdVld: '',
  286. opId: '',
  287. orderSource: 'WECHAT',
  288. // ownerName: "", //所有人
  289. character: "", //使用性质
  290. register: "请输入注册日期", //注册日期
  291. customerId: "", //用户编号
  292. vehicleId: "",
  293. vehicleIdNum: "", //车牌编号
  294. issueDate: "请输入发证日期", //发证日期
  295. vehPosImgUrl: "", //行驶证正面
  296. vehNegImgUrl: "", //行驶证证反面
  297. type: "0", //0,客车 1.货车
  298. useUserType: 0, //车辆用户类型
  299. useUserTypeName: "普通车",
  300. vehicleSign: 2, //前/后装标识
  301. vin: "", //车辆识别代号
  302. engineNum: "", //发动机号码
  303. vehicleType: "", //车辆类型
  304. vehicleModel: "", //行驶证品牌型号
  305. approvedCount: undefined, //核定人数
  306. approvedCountShow: undefined,//展示的
  307. totalMass: undefined, //总质量
  308. totalMassShow: undefined, //总质量
  309. maintenaceMass: undefined, //整备质量
  310. maintenaceMassShow: undefined, //整备质量展示的
  311. permittedWeight: "", //核定载质量
  312. vehicleDimensions: "", //车辆尺寸
  313. permittedTowWeight: "", //准牵引总质量
  314. axleCount: "", //车轴数
  315. ownerName: "", //车主姓名
  316. ownerIdType: "", //车主证件类型
  317. ownerIdNum: "", //车主证件号码
  318. ownPosImgUrl: "", //车主证件正面图片
  319. ownNegImgUrl: "", //车主证件反面图片
  320. agreementId: "", //签约编号
  321. // channelId: "5201018892300000001", //编号渠道
  322. scenePayType: "", //
  323. transportIdNum: "", //道路运输证编号
  324. licenseIdNum: "", //经营许可证编号
  325. vehBodyUrl: "", //车身照片
  326. // proxyUrl: "", //委托书地址
  327. },
  328. genderShow: false,
  329. orderId: "",
  330. vehiclePlateColor: undefined,
  331. isMyPeopple: true,
  332. isSign: '',
  333. type: 1,
  334. isEnableOther: true, //小程序是否支持他人办理
  335. isEnableBook: true, //他人办理时是否上传委托书
  336. isEnableInfo: true, //小程序信息带出
  337. isEnableOCRData: true, //允许修改OCR识别出来的数据
  338. changeColor: false,
  339. data: {
  340. transferLogs: [],
  341. },
  342. actionSheetShow: false,
  343. actionSheetList: [{
  344. text: "普通车",
  345. value: 0,
  346. },
  347. {
  348. text: "道路运输证经营范围仅有“货物专用运输(集装箱) ”的牵引车办理J类型集装箱",
  349. value: 24,
  350. },
  351. {
  352. text: "道路运输证经营范围不含“货物专用运输(集装箱)”的牵引车",
  353. value: 27,
  354. },
  355. {
  356. text: '道路运输证经营范围除“货物专用运输 (集装 箱)"外,还有“普通货运”等其他项目的牵引车办理J2类型集装箱',
  357. value: 28,
  358. }],
  359. show: false,
  360. outlineL: "",
  361. outlineW: "",
  362. outlineH: "",
  363. isEnableChangeOCRCarInfo: false, //申办时是否允许修改OCR识别出来的车辆信息数据
  364. businessType: "",
  365. });
  366. const searchVehicleInfoQuery = () => {
  367. const options = {
  368. type: 2,
  369. data: {
  370. vehicleId: state.form.vehicleId
  371. },
  372. method: "POST",
  373. showLoading: true,
  374. };
  375. request(searchVehicleInfo, options).then((res) => {
  376. let result = stringToJson(res.bizContent);
  377. writeMsg(result.vehicles[0])
  378. });
  379. }
  380. const writeMsg = (allData) => {
  381. console.log("车辆信息", allData);
  382. state.form.ownPosImgUrl = allData['ownerPosImgUrl']
  383. state.form.ownNegImgUrl = allData['ownerNegImgUrl']
  384. state.form.userName = allData['contacts']
  385. state.form.userIdNum = allData['ownerIdNum']
  386. state.form.ownerIdNum = allData['ownerIdNum']
  387. state.form.address = allData['ownerAddress']
  388. state.form.tel = allData['ownerTel']
  389. state.form.vehPosImgUrl = allData['vehPosImgUrl']
  390. state.form.vehNegImgUrl = allData['vehNegImgUrl']
  391. state.form.vehBodyUrl = allData['vehBodyUrl']
  392. state.form.vehicleIdNum = allData['vehiclePlate']
  393. state.form.ownerName = allData['ownerName']
  394. state.form.vehicleType = allData['vehicleType']
  395. // state.form.character = allData['vehicleType'] //使用性质
  396. state.form.vin = allData['vin']
  397. state.form.engineNum = allData['engineNum']
  398. state.form.register = allData['registerDate']
  399. state.form.issueDate = allData['issueDate']
  400. state.form.approvedCountShow = allData['approvedCount']
  401. state.form.maintenaceMassShow = allData['maintenaceMass']
  402. state.form.approvedCount = allData['approvedCount']
  403. state.form.maintenaceMass = allData['maintenaceMass']
  404. allData['vehicleDimensions']
  405. let arr = allData['vehicleDimensions'].split("X");
  406. state.outlineL = parseInt(arr[0]); //外廓 长
  407. state.outlineW = parseInt(arr[1]); //外廓 宽
  408. state.outlineH = parseInt(arr[2].substring(0, arr[2].length - 2)); //外廓 高
  409. state.form.totalMassShow = allData['totalMass']
  410. state.form.totalMass = allData['totalMass']
  411. state.form.axleCount = allData['axleCount'] ? allData['axleCount'] : 2
  412. if (allData['useUserType'] == 0) {
  413. state.form.useUserTypeName = "普通车"
  414. } else if (allData['useUserType'] == 24) {
  415. state.form.useUserTypeName = "道路运输证经营范围仅有“货物专用运输(集装箱) ”的牵引车办理J类型集装箱"
  416. } else if (allData['useUserType'] == 27) {
  417. state.form.useUserTypeName = "道路运输证经营范围不含“货物专用运输(集装箱)”的牵引车"
  418. } else if (allData['useUserType'] == 28) {
  419. state.form.useUserTypeName = "道路运输证经营范围除'货物专用运输 (集装 箱)'外,还有“普通货运”等其他项目的牵引车办理J2类型集装箱"
  420. }
  421. state.vehiclePlateColor = allData['vehiclePlateColor']
  422. state.form.customerId = allData['customerId']
  423. }
  424. const userGenderAction = () => {
  425. state.genderShow = true;
  426. };
  427. const genderSelectConfirm = (e) => {
  428. state.form.gender = ''
  429. e.map((val, index) => {
  430. state.form.gender = val.label;
  431. })
  432. };
  433. const camera = () => {
  434. state.phoneType = 0
  435. }
  436. onLoad((option : any) => {
  437. state.form.vehicleId = option.vehicleId;
  438. state.form.opId = getItem('openId') ? getItem('openId') : '';
  439. getGlobalParam(); //全局配置数据
  440. console.log("option", option)
  441. searchVehicleInfoQuery(); //车辆信息查询
  442. state.businessType = getItem('key')['DASP_PUSH_TYPE'][0]['code']
  443. console.log("getItem('key')['DASP_PUSH_TYPE']", getItem('key')['DASP_PUSH_TYPE'])
  444. });
  445. //监听页面滚动
  446. onPageScroll((e) => {
  447. scrollTop.value = e.scrollTop;
  448. });
  449. const replaceInput = (event) => {
  450. console.log("event", event)
  451. const screeningStr = /[^\u4E00-\u9FA5]/g; //想禁止什么类型,在这里替换正则就可以了
  452. if (screeningStr.test(event)) {
  453. setTimeout(() => {
  454. state.form.userName = event.replace(screeningStr, '');
  455. }, 100)
  456. } else {
  457. setTimeout(() => {
  458. state.form.userName = event;
  459. }, 100)
  460. }
  461. console.log("event.replace(screeningStr, '')", event.replace(screeningStr, ''), event, state.form.userName)
  462. }
  463. const getGlobalParam = () => {
  464. const data = getItem('globalParam')
  465. console.log("全局配置数据", getCodeName('IS_ENABLE', data.miniSupportOther), getCodeName('IS_ENABLE', data.otherUploadProxy), getCodeName('IS_ENABLE', data.miniInfoShow), getCodeName('IS_ENABLE', data.changeOCRData))
  466. // 小程序是否支持他人办理
  467. if (getCodeName('IS_ENABLE', data.miniSupportOther) == '启用') {
  468. state.isEnableOther = true;
  469. } else {
  470. state.isEnableOther = false;
  471. }
  472. // 他人办理时是否上传委托书
  473. if (getCodeName('IS_ENABLE', data.otherUploadProxy) == '启用') {
  474. state.isEnableBook = true;
  475. } else {
  476. state.isEnableBook = false;
  477. }
  478. // 小程序信息带出
  479. if (getCodeName('IS_ENABLE', data.miniInfoShow) == '启用') {
  480. state.isEnableInfo = true;
  481. uni.showModal({
  482. // title: '提示',
  483. content: '是否允许带出用户信息',
  484. success: function (res) {
  485. if (res.confirm) {
  486. console.log('用户点击确定');
  487. } else if (res.cancel) {
  488. console.log('用户点击取消');
  489. }
  490. }
  491. });
  492. } else {
  493. state.isEnableInfo = false;
  494. }
  495. // 允许修改OCR识别出来的数据
  496. if (getCodeName('IS_ENABLE', data.changeOCRData) == '启用') {
  497. state.isEnableOCRData = false;
  498. } else {
  499. state.isEnableOCRData = true;
  500. }
  501. // 申办时是否允许修改OCR识别出来的车辆信息数据
  502. // if (getCodeName('IS_ENABLE', data.applyChangeOCRCarInfo) == '启用') {
  503. // state.isEnableChangeOCRCarInfo = true;
  504. // } else {
  505. // state.isEnableChangeOCRCarInfo = false;
  506. // }
  507. }
  508. const takePhotoMode = (index, isMy) => {
  509. console.log("index", index, isMy)
  510. state.isTakePhotoModeShow = true
  511. state.choiceIndex = index
  512. state.isMy = isMy
  513. }
  514. const xiangce = (val) => {
  515. console.log("val", val)
  516. var imageType = val;
  517. if (state.choiceIndex == 3) {
  518. var imageType = 1;
  519. } else {
  520. var imageType = 2;
  521. }
  522. uni.chooseImage({
  523. count: 1, //只能选取一张照片
  524. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  525. sourceType: ["album"], //从相册选择
  526. success: function (res) {
  527. state.showImg = false
  528. state.images = res.tempFilePaths[0]
  529. state.phoneType = state.choiceIndex
  530. state.isTakePhotoModeShow = false
  531. if (state.choiceIndex == 3 || state.choiceIndex == 4) {
  532. state.showImg = false
  533. state.images = res.tempFilePaths[0]
  534. state.phoneType = state.choiceIndex
  535. state.isTakePhotoModeShow = false
  536. return
  537. }
  538. console.log("tempFilePaths[0].startsWith('file://')", res.tempFilePaths[0], res.tempFilePaths[0].startsWith('file://'))
  539. },
  540. })
  541. }
  542. const takePhoto = (val) => {
  543. state.showImg = true
  544. console.log("拍照", val)
  545. state.phoneType = val;
  546. }
  547. const confirmReturn = (val) => {
  548. console.log("图片地址val", val)
  549. state.phoneType = 0
  550. state.isTakePhotoModeShow = false
  551. // var imageType = state.choiceIndex;
  552. if (state.choiceIndex == 1) {
  553. var imageType = 1;
  554. var queryCode = etcOcrCard
  555. } else if (state.choiceIndex == 2) {
  556. var imageType = 2;
  557. var queryCode = etcOcrCard
  558. }
  559. if (state.choiceIndex == 3) {
  560. var imageType = 1;
  561. var queryCode = etcCarOcrCard
  562. } else if (state.choiceIndex == 4) {
  563. var imageType = 2;
  564. var queryCode = etcCarOcrCard
  565. }
  566. // uploadFile(val.tempImagePath, imageType, ocrAllQuery).then((data) => {
  567. uploadFile(val.tempImagePath, imageType, queryCode).then((data) => {
  568. if (state.isMy == "my") {
  569. if (state.choiceIndex == "1") {
  570. console.log("身份证上传", data)
  571. state.form.userName = data.name;
  572. state.form.gender = data.gender;
  573. state.form.userIdNum = data.idno;
  574. state.form.ownPosImgUrl = data.imageUrl;
  575. state.form.address = data.address;
  576. } else {
  577. state.form.customerIdVld = data.enddate;
  578. state.form.ownNegImgUrl = data.imageUrl;
  579. }
  580. state.isTakePhotoModeShow = false
  581. } else {
  582. if (state.choiceIndex == "1") {
  583. state.form.agentName = data.name;
  584. state.form.agentGender = data.gender;
  585. state.form.agentIdNum = data.idno;
  586. state.form.agentPosImgUrl = data.imageUrl;
  587. state.form.agentAddress = data.address;
  588. } else if (state.choiceIndex == "2") {
  589. console.log("state.isMy", state.isMy, state.choiceIndex, state.choiceIndex == "1", data)
  590. state.form.agentIdVld = data.enddate;
  591. state.form.agentNegImgUrl = data.imageUrl;
  592. } else if (state.choiceIndex == "3") {
  593. if (data.plate_a.length > 8) {
  594. state.form.vehicleIdNum = data.plate_a.substring(0, 8);
  595. } else {
  596. state.form.vehicleIdNum = data.plate_a;
  597. }
  598. state.form.ownerName = data.man;
  599. state.form.vehicleType = data.vehicle;
  600. state.form.character = data.character;
  601. state.form.vin = data.vin;
  602. state.form.engineNum = data.engine;
  603. state.form.register = data.register;
  604. state.form.issueDate = data.issue;
  605. state.form.vehPosImgUrl = data.imageUrl;
  606. state.form.vehicleModel = data.model;
  607. } else {
  608. state.form.approvedCount = data.apc;
  609. state.form.approvedCountShow = data.apc;
  610. state.form.maintenaceMass = data.unladen;
  611. state.form.maintenaceMassShow = data.unladen;
  612. // 91接口差
  613. // // #ifdef MP-WEIXIN
  614. // state.form.vehicleDimensions = data.overall.replaceAll("×", "X");
  615. // // #endif
  616. // // #ifdef MP-ALIPAY
  617. // state.form.vehicleDimensions = data.overall.replace(/×/g, "X");
  618. // // #endif
  619. // let arr = data.overall.split("×");
  620. // #ifdef MP-WEIXIN
  621. state.form.vehicleDimensions = data.overall.replaceAll("x", "X");
  622. // #endif
  623. // #ifdef MP-ALIPAY
  624. state.form.vehicleDimensions = data.overall.replace(/x/g, "X");
  625. // #endif
  626. let arr = data.overall.split("x");
  627. state.outlineL = arr[0]; //外廓 长
  628. state.outlineW = arr[1]; //外廓 宽
  629. state.outlineH = arr[2].substring(0, arr[2].length - 2); //外廓 高
  630. state.form.totalMass = data.gross;
  631. state.form.totalMassShow = data.gross;
  632. state.form.vehNegImgUrl = data.imageUrl;
  633. state.form.permittedWeight = data.alc ? data.alc : 0;
  634. state.form.permittedTowWeight = data.towing ? data.towing : 0;
  635. console.log('=====================', state.form.vehNegImgUrl, state)
  636. }
  637. state.isTakePhotoModeShow = false
  638. }
  639. })
  640. }
  641. const cancle = () => {
  642. state.isTakePhotoModeShow = false
  643. }
  644. // 车辆信息
  645. //车牌号输入
  646. const carNumber = (val : any) => {
  647. state.form.vehicleIdNum = val.trim();
  648. };
  649. //提交车辆信息
  650. const savaHandleCar = () => {
  651. if (!checkStr(state.form.userIdNum, 'card')) {
  652. msg('请输入正确身份证');
  653. return;
  654. }
  655. if (!checkStr(state.form.tel, 'mobile')) {
  656. msg('请输入正确手机号');
  657. return;
  658. }
  659. if (!state.form.vehBodyUrl) {
  660. msg("请上传车头照");
  661. return;
  662. }
  663. if (state.form.type == 1) {
  664. state.form.axleCount = 2;
  665. } else {
  666. if (!state.form.axleCount) {
  667. msg("请输入车轴数");
  668. return;
  669. }
  670. }
  671. state.form.vehicleId =
  672. state.form.vehicleIdNum + "_" + state.vehiclePlateColor;
  673. state.form.opId = getItem(StorageKeys.OpenId);
  674. state.form.approvedCount = parseFloat(state.form.approvedCount);
  675. state.form.maintenaceMass = parseFloat(state.form.maintenaceMass);
  676. state.form.totalMass = parseFloat(state.form.totalMass);
  677. state.form.permittedWeight = parseFloat(state.form.permittedWeight);
  678. state.form.permittedTowWeight = parseFloat(state.form.permittedTowWeight);
  679. const options = {
  680. type: 2,
  681. data: state.form,
  682. method: "POST",
  683. showLoading: true,
  684. };
  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. .img-pos {
  1027. position: absolute;
  1028. left: 270rpx;
  1029. top: -38rpx;
  1030. right: 50rpx;
  1031. .img-flex {
  1032. display: flex;
  1033. justify-content: space-between;
  1034. align-items: center;
  1035. .car-img {
  1036. width: 86rpx;
  1037. height: 42rpx;
  1038. }
  1039. .flag-img {
  1040. width: 30rpx;
  1041. height: 35rpx;
  1042. }
  1043. }
  1044. }
  1045. .action {
  1046. padding-left: 20rpx;
  1047. padding-right: 20rpx;
  1048. padding-bottom: 30rpx;
  1049. .button {
  1050. height: 80rpx;
  1051. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  1052. border-radius: 40rpx;
  1053. font-size: 32rpx;
  1054. font-weight: 400;
  1055. color: #ffffff;
  1056. line-height: 80rpx;
  1057. }
  1058. }
  1059. .item-tips {
  1060. .title {
  1061. font-size: 30rpx;
  1062. font-family: Microsoft YaHei;
  1063. font-weight: 400;
  1064. color: #000000;
  1065. line-height: 24rpx;
  1066. }
  1067. .tip {
  1068. margin-top: 16rpx;
  1069. font-size: 24rpx;
  1070. font-family: Microsoft YaHei;
  1071. font-weight: 400;
  1072. color: #999999;
  1073. line-height: 24rpx;
  1074. }
  1075. }
  1076. .picture-wrapper {
  1077. margin-top: 40rpx;
  1078. .bg {
  1079. background: #ffffff;
  1080. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  1081. border-radius: 20rpx;
  1082. padding: 40rpx;
  1083. display: flex;
  1084. justify-content: space-between;
  1085. .name {
  1086. font-size: 34rpx;
  1087. font-family: Microsoft YaHei;
  1088. font-weight: 400;
  1089. color: #000000;
  1090. line-height: 34rpx;
  1091. }
  1092. .value {
  1093. margin-top: 20rpx;
  1094. font-size: 24rpx;
  1095. font-family: Microsoft YaHei;
  1096. font-weight: 400;
  1097. color: #999999;
  1098. line-height: 24rpx;
  1099. }
  1100. .tip {
  1101. margin-top: 20rpx;
  1102. text-align: center;
  1103. width: 110rpx;
  1104. height: 40rpx;
  1105. background: rgba(33, 190, 177, 0.2);
  1106. border-radius: 6rpx;
  1107. .tip-value {
  1108. font-size: 20rpx;
  1109. font-family: Microsoft YaHei;
  1110. font-weight: 400;
  1111. color: #0a8f8a;
  1112. line-height: 40rpx;
  1113. opacity: 1;
  1114. }
  1115. }
  1116. }
  1117. .icon {
  1118. width: 294rpx;
  1119. height: 188rpx;
  1120. }
  1121. }
  1122. .shibie-wrapper {
  1123. margin-top: 60rpx;
  1124. .title {
  1125. font-size: 30rpx;
  1126. font-family: Microsoft YaHei;
  1127. font-weight: 400;
  1128. color: #000000;
  1129. line-height: 30rpx;
  1130. }
  1131. }
  1132. .buchong-wrapper {
  1133. margin-top: 60rpx;
  1134. .title {
  1135. font-size: 30rpx;
  1136. font-family: Microsoft YaHei;
  1137. font-weight: 400;
  1138. color: #000000;
  1139. line-height: 30rpx;
  1140. }
  1141. }
  1142. .green-tip {
  1143. margin-top: 50rpx;
  1144. font-size: 24rpx;
  1145. font-family: Microsoft YaHei;
  1146. font-weight: 400;
  1147. color: #00b38b;
  1148. line-height: 24rpx;
  1149. margin-bottom: 60rpx;
  1150. }
  1151. }
  1152. .form-item {
  1153. display: flex;
  1154. font-size: 28rpx;
  1155. justify-content: space-between;
  1156. align-items: center;
  1157. }
  1158. .form-item label {}
  1159. .form-item .input-box {
  1160. display: flex;
  1161. align-items: center;
  1162. }
  1163. .form-item .select {
  1164. flex: 1;
  1165. background: #f1f1f1;
  1166. padding: 6rpx 20rpx;
  1167. margin: 0 10rpx;
  1168. min-height: 48rpx;
  1169. line-height: 48rpx;
  1170. border-radius: 8rpx;
  1171. }
  1172. .form-item .icon {
  1173. width: 28rpx;
  1174. height: 32rpx;
  1175. }
  1176. .form-item .input-box input {
  1177. width: 90rpx;
  1178. background: #f1f1f1;
  1179. border-radius: 8rpx;
  1180. padding: 0 5rpx;
  1181. }
  1182. .form-item .sub-text {
  1183. color: #808080;
  1184. padding-left: 10rpx;
  1185. }
  1186. .form-item .sub-label {
  1187. padding: 0 10rpx;
  1188. }
  1189. .window {
  1190. padding: 60rpx 30rpx;
  1191. }
  1192. .window .window-item {
  1193. border: 1px solid #00b38b;
  1194. background: rgba(0, 179, 139, .1);
  1195. border-radius: 10rpx;
  1196. padding: 16rpx 30rpx;
  1197. font-size: 30rpx;
  1198. margin-bottom: 10rpx;
  1199. }
  1200. ::v-deep .u-input__input {
  1201. background: transparent;
  1202. }
  1203. </style>