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 34KB

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