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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581
  1. <template>
  2. <view class="page-content">
  3. <view class="bg">
  4. <view class="title"> 办理人身份信息 </view>
  5. <!--身份证正面-->
  6. <ocr-cert-block :img="formData.agentPosImgUrl" :type="1" @click="takePhotoMode"></ocr-cert-block>
  7. <!--身份证反面-->
  8. <ocr-cert-block :img="formData.agentNegImgUrl" :type="2" @click="takePhotoMode"></ocr-cert-block>
  9. <!--委托书-->
  10. <ocr-cert-block
  11. :text="{
  12. title: '委托书',
  13. tag1: '上传委托书',
  14. img: 'issuance/weituo.png'
  15. }"
  16. :img="formData.proxyUrl" :type="2" @click="uploadOtherFile"></ocr-cert-block>
  17. <!--驾驶证主页-->
  18. <ocr-cert-block :img="formData.vehPosImgUrl" :type="3" @click="takePhotoMode"></ocr-cert-block>
  19. <!--驾驶证副业-->
  20. <ocr-cert-block :img="formData.vehNegImgUrl" :type="4" @click="takePhotoMode"></ocr-cert-block>
  21. </view>
  22. <view class="bg">
  23. <view class="title"> 办理人基本信息 </view>
  24. <u-form label-width="230" :model="formData" ref="uForm" :label-style='labelStyle'>
  25. <u-form-item label="姓名" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon' borderBottom>
  26. <u-input v-model="formData.agentName" placeholder='请输入姓名' inputAlign="right"/>
  27. </u-form-item>
  28. <u-form-item label="证件号码" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon' borderBottom>
  29. <u-input placeholder='请填写证件号码' type="number" v-model="formData.agentIdNum" inputAlign="right"/>
  30. </u-form-item>
  31. <u-form-item label="手机号" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon' borderBottom>
  32. <u-input placeholder='请填写手机号' type="number" v-model="formData.agentTel" inputAlign="right"></u-input>
  33. </u-form-item>
  34. <u-form-item label="车牌号" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon' borderBottom>
  35. <car-number-input @numberInputResult="carNumber" :defaultStr="formData.vehiclePlate" :isClick="false"></car-number-input>
  36. </u-form-item>
  37. </u-form>
  38. </view>
  39. <!-- 储存卡的时候才需要填写退费信息 -->
  40. <view class="bg" v-if="formData.cardType === 'STORED_VALUE_CARD'">
  41. <view class="title"> 退费信息 </view>
  42. <u-form label-width="230" :model="formData" ref="uForm" :label-style='labelStyle'>
  43. <u-form-item label="退费信息" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon' borderBottom>
  44. <view class="form-item-value-block">
  45. <view class="form-item-value"><custom-select-data v-model="state.chooseBankInfo" :dataList="state.refundInfoList" placeholder="请选择开户行" @change="chooseBank"></custom-select-data></view>
  46. <view class="btn btn-primary" @click="addBank">新增</view>
  47. </view>
  48. </u-form-item>
  49. </u-form>
  50. </view>
  51. <!-- 是否可以连接设备 -->
  52. <view class="bg">
  53. <view class="title"> 是否可以连接设备 </view>
  54. <u-form label-width="230" :model="formData" ref="uForm" :label-style='labelStyle'>
  55. <u-form-item label=" " borderBottom>
  56. <!-- <u-radio-group activeColor="#2CE242" v-model="state.isConnectDevice" @change="isConnectDeviceChange">
  57. <view class="u-radio-list">
  58. <view class="u-radio-block"><u-radio name="1">是</u-radio></view>
  59. <view class="u-radio-block"><u-radio name="2">否</u-radio></view>
  60. </view>
  61. </u-radio-group> -->
  62. <view class="column-checkbox-group">
  63. <view
  64. v-for="item in state.checkboxOption"
  65. :key="item.value"
  66. class="column-checkbox"
  67. style="justify-content: flex-end;"
  68. @click="isConnectDeviceChange(item.value)">
  69. <view class="checkbox-icon" :class="{'is-checked': item.value === state.isConnectDevice}">
  70. <u-icon name="checkbox-mark" :color="item.value === state.isConnectDevice ? '#FFFFFF' : '#FFFFFF'"></u-icon>
  71. </view>
  72. <text>{{ item.label }}</text>
  73. </view>
  74. </view>
  75. </u-form-item>
  76. </u-form>
  77. </view>
  78. <view class="action">
  79. <button type="default" class="ui-btn" @click="submit()">
  80. 提交
  81. </button>
  82. </view>
  83. </view>
  84. <!--证件照上传 start-->
  85. <uploadOcr
  86. :isTakePhotoModeShow="state.isTakePhotoModeShow"
  87. :phoneType="state.choiceIndex"
  88. @close="close"
  89. @ocrResult="ocrResult">
  90. </uploadOcr>
  91. <!--证件照上传 end-->
  92. </template>
  93. <script setup lang="ts">
  94. import { reactive, ref, computed } from "vue";
  95. import { onLoad, onShow } from "@dcloudio/uni-app";
  96. import { getItem, StorageKeys } from "@/utils/storage";
  97. import { checkStr, navTo, uploadFile, msg, getFullImageUrl, replaceBaseImageUrl, maskBankCard } from "@/utils/utils";
  98. import { requestNew } from "@/utils/network/request.js";
  99. import { deviceLogOutApply, vehicleInfoView, getCustomerDetail, getRefundInfoPage } from "@/utils/network/api.js";
  100. import { useUserStore } from "@/stores/user";
  101. import { commonStore } from '@/stores/common.js'
  102. import { getCodeName } from '@/datas/queryKey.js'
  103. import carNumberInput from "@/components/car-number-input/car-number-input.vue";
  104. import { getVehiclePlateColorPai } from '@/datas/vehiclePlateColor'
  105. import uploadOcr from '@/components/uploadOcr';
  106. import { compareDates, objectToQueryString } from '@/utils/utils'
  107. // import { getCardDetail } from '@/static/etcUtil/etc-bluethooh.js'
  108. import { deviceStore } from '@/stores/device.js'
  109. import { logOffOver } from './js/log-off.js'
  110. const deviceStores = deviceStore()
  111. const isMultiProvince = [
  112. {name: '单省', id: 0},
  113. {name: '跨省', id: 1},
  114. ]
  115. interface uploadFileParams{
  116. imageUrl: string
  117. }
  118. interface pageParams{
  119. vehicleId: string,
  120. }
  121. const labelStyle = {
  122. color: "#004576",
  123. fontSize: "28rpx",
  124. }
  125. const leftIcon = {
  126. height: '100%',
  127. width: '8rpx',
  128. display: 'flex',
  129. 'align-items': 'center',
  130. 'margin-right': '4rpx',
  131. }
  132. const formData = reactive({
  133. vehicleId: '',
  134. bankIdCode: '',
  135. bankName: '',
  136. bankProvince: '',
  137. bankBranchName: '',
  138. cardId: '',
  139. cardType: '',
  140. obuId: '',
  141. operateType: '',
  142. vehiclePlate: '',
  143. userName: '', // 持卡人姓名
  144. userMobile: '', // 持卡人手机号
  145. agentPosImgUrl: '', // 办理人
  146. agentNegImgUrl: '',
  147. agentName: '', // 办理人姓名
  148. agentIdVld: '', // 办理人证件有效期
  149. agentIdType: '101', // 证件类型
  150. agentIdNum: '', // 办理人证件号码
  151. agentAddress: '', // 办理人地址
  152. agentTel: '', // 办理人手机号
  153. proxyUrl: '',
  154. vehPosImgUrl: '',
  155. vehNegImgUrl: ''
  156. })
  157. const state = reactive({
  158. vehicleId: '',
  159. isTakePhotoModeShow: false,
  160. choiceIndex: null,
  161. chooseBankInfo: '',
  162. refundInfoList: [],
  163. isConnectDevice: "", // 是否可以连接设备
  164. checkboxOption: [
  165. {value: '1', label: '是'},
  166. {value: '2', label: '否'}
  167. ],
  168. })
  169. onLoad((option: pageParams) => {
  170. if (option.vehicleId) {
  171. formData.vehicleId = state.vehicleId = decodeURIComponent(option.vehicleId)
  172. let arr = state.vehicleId.split('_')
  173. formData.vehiclePlate = arr[0]
  174. }
  175. let deviceInfo = deviceStores.deviceInfo
  176. console.log(deviceStores.deviceInfo)
  177. formData.cardId = deviceInfo.cardId
  178. formData.obuId = deviceInfo.obuId
  179. if (deviceInfo.cardType) {
  180. formData.cardType = deviceInfo.cardTypeNew
  181. if (formData.cardType === 'STORED_VALUE_CARD') {
  182. formData.operateType = 'BANK'
  183. } else {
  184. formData.operateType = 'ORIGINAL'
  185. }
  186. }
  187. })
  188. onShow(() => {
  189. // 储存卡才需要填写退费信息
  190. if (formData.cardType === 'STORED_VALUE_CARD') {
  191. getRefundInfoList() // 查询退费信息
  192. }
  193. })
  194. /**
  195. * 身份证ocr识别后接收参数
  196. */
  197. interface OCRData {
  198. imageUrl: string,
  199. bizContent: string,
  200. screditCode: string,
  201. enddate: string
  202. }
  203. const submit = () => {
  204. // 如果需要缴纳违约金
  205. if (!paramsVerify()) return;
  206. const options = {
  207. type: 2,
  208. data: {
  209. ...formData,
  210. hasDevice: state.isConnectDevice === '1'
  211. },
  212. method: "POST",
  213. showLoading: true,
  214. }
  215. //调用方式
  216. requestNew(deviceLogOutApply, options).then(res => {
  217. console.log(res)
  218. if (deviceStores.logOff.isCancel) {
  219. let params = {
  220. orderNo: res.orderNo,
  221. vehicleId: formData.vehicleId,
  222. isConnectDevice: '2'
  223. }
  224. uni.navigateTo({
  225. url: `/subpackage/after-sale/ETC-log-off/breach_contract_pay?${objectToQueryString(params)}`
  226. })
  227. } else {
  228. // 是否可以连接设备
  229. if (state.isConnectDevice === '1') { // 如果可以连接设备
  230. uni.navigateTo({
  231. url: `/pages/bluetooth/bluetooth?routeType=13&vehicleId=${formData.vehicleId}`
  232. })
  233. } else {
  234. logOffOver()
  235. }
  236. }
  237. })
  238. }
  239. // 字段校验
  240. const paramsVerify = () => {
  241. let isVerify = true;
  242. if(!formData.agentPosImgUrl){
  243. msg('请上传身份证人像面');
  244. isVerify = false;
  245. } else if (!formData.agentNegImgUrl) {
  246. msg('请上传身份证国徽面');
  247. isVerify = false;
  248. } else if (!formData.proxyUrl) {
  249. msg('请上传单位授权书');
  250. isVerify = false;
  251. } else if (!formData.vehPosImgUrl) {
  252. msg('请上传行驶证主页');
  253. isVerify = false;
  254. } else if (!formData.vehNegImgUrl) {
  255. msg('请上传行驶副业');
  256. isVerify = false;
  257. } else if(!formData.agentTel){
  258. msg('请输入手机号');
  259. isVerify = false;
  260. } else if (!checkStr(formData.agentTel, "mobile")) {
  261. msg('请输入正确的手机号');
  262. isVerify = false;
  263. } else if(!formData.vehiclePlate){
  264. msg('请输入车牌号码');
  265. isVerify = false;
  266. } else if (formData.cardType === 'STORED_VALUE_CARD' && !state.chooseBankInfo) {
  267. msg('请选择退费信息');
  268. isVerify = false;
  269. } else if (!state.isConnectDevice) {
  270. msg('请选择是否可以连接设备');
  271. isVerify = false;
  272. }
  273. return isVerify;
  274. }
  275. // 获取退费信息列表
  276. const getRefundInfoList = () => {
  277. let option = {
  278. type: 2,
  279. data: {pageSize: 50, staffId: 'opId'},
  280. method: "POST",
  281. showLoading: true,
  282. }
  283. requestNew(getRefundInfoPage, option).then(res => {
  284. const data = res.result ? res.result.map(item => {
  285. item.bankNameStr = getCodeName('BANK_TYPE', item.bankName)
  286. return {
  287. ...item,
  288. name: `${item.bankNameStr}(${maskBankCard(item.bankIdCode)})`,
  289. }
  290. }) : [];
  291. state.refundInfoList = data
  292. })
  293. }
  294. //车牌号输入
  295. const carNumber = (val : any) => {
  296. formData.vehiclePlate = val.trim();
  297. };
  298. const close = (e) => {
  299. state.isTakePhotoModeShow = e
  300. }
  301. const takePhotoMode = (index: number) => {
  302. state.isTakePhotoModeShow = true
  303. state.choiceIndex = index
  304. }
  305. const ocrResult = (data: OCRData) => {
  306. let bizContent = data.bizContent = data.bizContent ? JSON.parse(data.bizContent) : {}
  307. if (state.choiceIndex === 1) {
  308. if (!bizContent.idno) {
  309. msg('识别失败,请重新上传')
  310. } else {
  311. formData.agentPosImgUrl = data.imageUrl;
  312. formData.agentName = bizContent.name;
  313. formData.agentIdNum = bizContent.idno;
  314. formData.agentAddress = bizContent.address
  315. }
  316. } else if (state.choiceIndex === 2) {
  317. if (!bizContent.begindate) {
  318. msg('识别失败,请重新上传')
  319. } else {
  320. formData.agentNegImgUrl = data.imageUrl;
  321. formData.agentIdVld = data.enddate
  322. compareDates(data.enddate)
  323. }
  324. } else if (state.choiceIndex === 3) {
  325. formData.vehPosImgUrl = bizContent.imageUrl
  326. } else if (state.choiceIndex === 4) {
  327. formData.vehNegImgUrl = bizContent.imageUrl
  328. }
  329. }
  330. // 授权证书上传
  331. const uploadOtherFile = () => {
  332. uni.chooseImage({
  333. count: 1, // 只能选取一张照片
  334. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  335. sourceType: ["camera", "album"], //从相册选择
  336. success: (res) => {
  337. uploadFile(res.tempFilePaths[0]).then((data: uploadFileParams) => {
  338. formData.proxyUrl = data.imageUrl
  339. })
  340. },
  341. });
  342. }
  343. // 选择开户航
  344. const chooseBank = (val, obj) => {
  345. formData.bankIdCode = obj.bankIdCode
  346. formData.bankName = obj.bankName
  347. formData.bankProvince = obj.bankProvince
  348. formData.bankBranchName = obj.bankBranchName
  349. formData.userName = obj.userName
  350. formData.userMobile = obj.userMobile
  351. }
  352. const isConnectDeviceChange = (e) => {
  353. state.isConnectDevice = e
  354. }
  355. // 新增银行卡信息
  356. const addBank = () => {
  357. uni.navigateTo({
  358. url: '/subpackage/after-sale/refund-info/add'
  359. })
  360. }
  361. </script>
  362. <style lang="scss" scoped>
  363. .bg{
  364. background-color: white;
  365. margin:0 32rpx;
  366. margin-top: 20rpx;
  367. border-radius: 12rpx;
  368. border: 1px solid #FFFFFF;
  369. padding: 20rpx;
  370. }
  371. .card {
  372. display: flex;
  373. margin: 0 20rpx;
  374. align-items: center;
  375. }
  376. .action {
  377. background-color: #fff;
  378. border-radius: 30rpx 30rpx 0 0;
  379. width: 100vw;
  380. display: flex;
  381. align-items: center;
  382. justify-content: center;
  383. flex-direction: column;
  384. margin-top: 20rpx;
  385. padding: 24rpx 0 calc(24rpx + env(safe-area-inset-bottom));
  386. }
  387. ::deep.uni-select {
  388. font-size: 13px;
  389. height: 30px;
  390. line-height: 30px;
  391. }
  392. .choice-takePhoto-wrap {
  393. width: 100%;
  394. height: 100vh;
  395. background-color: rgba(127, 127, 127, 0.2);
  396. position: fixed;
  397. left: 0;
  398. top: 0;
  399. z-index: 11111;
  400. }
  401. .choice-takePhoto {
  402. position: absolute;
  403. bottom: 0;
  404. background-color: white;
  405. width: 100%;
  406. border-radius: 20rpx 20rpx 0 0;
  407. }
  408. .choice-takePhoto>view:first-child {
  409. text-align: center;
  410. height: 80rpx;
  411. line-height: 80rpx;
  412. border-bottom: 1rpx solid rgba(127, 127, 127, 0.3);
  413. background-color: white;
  414. }
  415. .choice-takePhoto>view:last-child {
  416. text-align: center;
  417. height: 80rpx;
  418. line-height: 80rpx;
  419. border-top: 6rpx solid rgba(127, 127, 127, 0.1);
  420. background-color: white;
  421. }
  422. .choice-takePhoto>view {
  423. text-align: center;
  424. height: 80rpx;
  425. line-height: 80rpx;
  426. background-color: white;
  427. }
  428. .choice-takePhoto-wrap {
  429. width: 100%;
  430. height: 100vh;
  431. background-color: rgba(127, 127, 127, 0.2);
  432. position: fixed;
  433. left: 0;
  434. top: 0;
  435. z-index: 11111;
  436. }
  437. .car-type{
  438. width: 400rpx;
  439. height: 68rpx;
  440. margin: 50rpx auto;
  441. border-radius: 68rpx;
  442. border: 1px #CCB375 solid;
  443. font-size: 28rpx;
  444. overflow: hidden;
  445. display: flex;
  446. .car-type-item{
  447. width: 50%;
  448. height: 100%;
  449. line-height: 68rpx;
  450. text-align: center;
  451. color: #CCB375;
  452. flex-shrink: 0;
  453. flex-grow: 0;
  454. }
  455. .active{
  456. color: #FFFFFF;
  457. background-color: #CCB375;
  458. }
  459. }
  460. .disabled-text{
  461. color: #999999;
  462. }
  463. .uni-list{
  464. width: 88%;
  465. margin: 24rpx auto;
  466. .left-owner-radio{
  467. margin-right: 12rpx;
  468. }
  469. }
  470. .page-content{
  471. position: relative;
  472. min-height: 100vh;
  473. }
  474. .flex-input{
  475. flex: 1;
  476. display: flex;
  477. align-items: center;
  478. justify-content: flex-end;
  479. .unit{
  480. color: #01243A;
  481. font-size: 26rpx;
  482. width: 60rpx;
  483. text-align: center;
  484. }
  485. }
  486. .image-list{
  487. display: flex;
  488. flex-wrap: wrap;
  489. margin-top: 24rpx;
  490. .icon{
  491. width: 180rpx;
  492. height: 180rpx;
  493. margin: 0 24rpx 24rpx 0;
  494. }
  495. .image-out{
  496. width: 180rpx;
  497. height: 180rpx;
  498. margin: 0 24rpx 24rpx 0;
  499. position: relative;
  500. .delete{
  501. position: absolute;
  502. right: 0;
  503. top: 0;
  504. }
  505. }
  506. }
  507. .upload-num{
  508. color: #999999;
  509. font-size: 26rpx;
  510. margin-left: 12rpx;
  511. }
  512. .u-radio-list{
  513. flex: 1;
  514. display: flex;
  515. justify-content: flex-end;
  516. .u-radio-block{
  517. width: 50%;
  518. display: flex;
  519. justify-content: flex-end;
  520. }
  521. }
  522. .form-item-value-block{
  523. display: flex;
  524. align-items: center;
  525. .form-item-value{
  526. flex: 1;
  527. }
  528. .btn {
  529. height: 60rpx;
  530. line-height: 58rpx;
  531. border-radius: 30rpx;
  532. padding: 0 34rpx;
  533. font-size: 23rpx;
  534. box-sizing: border-box;
  535. margin-left: 12rpx;
  536. color: white;
  537. background-color: #133850;
  538. }
  539. }
  540. </style>