You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

car-message-change.vue 35KB

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