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

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