Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

drivingLicense.vue 8.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344
  1. <template>
  2. <div>
  3. <custom-header title="车辆信息"></custom-header>
  4. <div style="padding: 20rpx 0">
  5. <form-builder-vue :formData="formData" :config="config" @radioChange="radioChange" @uploadImg="uploadImg"
  6. @submit="submit">
  7. </form-builder-vue>
  8. </div>
  9. </div>
  10. </template>
  11. <script setup lang='ts'>
  12. import formBuilderVue from '@/components/form-builder/form-builder-vue3'
  13. import {
  14. TypeData,
  15. Index
  16. } from '@/components/form-builder/tools'
  17. import {
  18. IdCard,
  19. NatureVehicle,
  20. TollModel
  21. } from '../../static/data/testData.js'
  22. import {
  23. reactive
  24. } from 'vue'
  25. import {
  26. fileURL
  27. } from '@/static/js/network/api.js';
  28. // import {
  29. // request
  30. // } from '../../static/js/network/request';
  31. import {
  32. onLoad
  33. } from '@dcloudio/uni-app';
  34. import {
  35. storageKey
  36. } from '../../static/data/storageKey.js'
  37. import CustomHeader from '@/components/CustomHeader.vue';
  38. let config = ({
  39. submitName: '下一步',
  40. titleWidth: 250
  41. })
  42. let formData = reactive([{
  43. 'title': '行驶证照片',
  44. 'type': 8,
  45. 'vertical': 2,
  46. 'inputType': 2,
  47. 'value': 'licensePoImageUrl,licenseNeImageUrl',
  48. 'required': false,
  49. 'hint': '注意事项:且上传有效证件照且图片大小不超过2M',
  50. 'hint1': '行驶证主页',
  51. 'hint2': '行驶证副业',
  52. 'placeholderImg1':fileURL + '/image/applyCard/car-zhu.png',
  53. 'placeholderImg2': fileURL + '/image/applyCard/car-fu.png'
  54. }, {
  55. 'title': '上传车辆照片',
  56. 'type': 8,
  57. 'vertical': 2,
  58. 'required': false,
  59. 'value': 'vehicleBodyFortyFiveUrl,vehicleFrontUrl',
  60. 'hint': '注意事项:且上传有效证件照且图片大小不超过2M',
  61. 'hint1': '车身45°照',
  62. 'hint2': '车头照片',
  63. 'placeholderImg1': '../../static/image/car1.jpg',
  64. 'placeholderImg2': '../../static/image/car2.jpg'
  65. }, {
  66. 'title': '上传人车合影和车轴照片',
  67. 'type': 8,
  68. 'vertical': 2,
  69. 'value': 'oneCarImageUrl,axleImageUrl',
  70. 'hint': '注意事项:且上传有效证件照且图片大小不超过2M',
  71. 'hint1': '人车合影照',
  72. 'hint2': '车轴照片'
  73. }, {
  74. 'title': '相关证书',
  75. 'type': 8,
  76. 'vertical': 2,
  77. 'value': 'roadTransCertUrl,vehicleAuthUrl',
  78. 'hint': '注意事项:且上传有效证件照且图片大小不超过2M',
  79. 'hint1': '牵引车道路运输证',
  80. 'hint2': '车辆授权书'
  81. }, {
  82. 'title': '车辆用户类型',
  83. 'type': 4,
  84. 'value': 'vehicleCustomerType',
  85. 'required': false,
  86. 'name': 'key',
  87. 'itemKey': 'value',
  88. 'itemData': [{
  89. 'value': '普通车',
  90. 'key': 0
  91. }, {
  92. 'value': '含【货物专用运输(集装箱)】的牵引车',
  93. 'key': 24
  94. }, {
  95. 'value': '不含【货物专用运输(集装箱)】的牵引车',
  96. 'key': 27
  97. }, {
  98. 'value': '其他牵引车',
  99. 'key': 28
  100. }]
  101. }, {
  102. 'title': '收费车型',
  103. 'type': 4,
  104. 'value': 'chargeBusType',
  105. 'required': false,
  106. 'name': 'key',
  107. 'itemKey': 'value',
  108. 'itemData': TollModel
  109. }, {
  110. 'title': '车轮数',
  111. 'type': 2,
  112. 'value': 'wheelCount',
  113. 'inputType': 'number',
  114. 'maxlength': 8
  115. }, {
  116. 'title': '车轴数',
  117. 'type': 2,
  118. 'value': 'axleCount',
  119. 'inputType': 'number',
  120. 'maxlength': 8
  121. }, {
  122. 'title': '轴距',
  123. 'type': 2,
  124. 'value': 'axleDistance',
  125. 'inputType': 'number',
  126. 'maxlength': 8
  127. }, {
  128. 'title': '轴型',
  129. 'type': 2,
  130. 'value': 'axisType'
  131. }, {
  132. 'title': '所有人证件类型',
  133. 'type': 4,
  134. 'value': 'ownerIdType',
  135. 'required': false,
  136. 'hint': '请选择证件类型',
  137. 'name': 'key',
  138. 'itemKey': 'value',
  139. 'itemData': IdCard
  140. }, {
  141. 'title': '所有人证件号',
  142. 'type': 2,
  143. 'required': false,
  144. 'value': 'ownerIdNum'
  145. }, {
  146. 'title': '所有人手机号',
  147. 'type': 2,
  148. 'required': false,
  149. 'value': 'ownerTel'
  150. }, {
  151. 'title': '所有人',
  152. 'type': 2,
  153. 'required': false,
  154. 'value': 'ownerName',
  155. 'hint': '请输入所有人',
  156. 'show': false
  157. }, {
  158. 'title': '车辆类型',
  159. 'type': 4,
  160. 'required': false,
  161. 'value': 'vehicleType',
  162. 'hint': '请选择车辆类型',
  163. 'maxlength': 3,
  164. 'show': false
  165. }, {
  166. 'title': '住址',
  167. 'type': 2,
  168. 'required': false,
  169. 'value': 'licenseAddress',
  170. 'hint': '请输入住址',
  171. 'show': false
  172. }, {
  173. 'title': '使用性质',
  174. 'type': 4,
  175. 'required': false,
  176. 'value': 'useCharacter',
  177. 'show': false,
  178. 'name': 'key',
  179. 'itemKey': 'value',
  180. 'itemData': NatureVehicle
  181. }, {
  182. 'title': '品牌型号',
  183. 'type': 2,
  184. 'required': false,
  185. 'value': 'vehicleModel',
  186. 'hint': '请输入品牌型号',
  187. 'show': false
  188. }, {
  189. 'title': '车辆识别代码',
  190. 'type': 2,
  191. 'value': 'vin',
  192. 'required': false,
  193. 'hint': '请输入车辆识别代码',
  194. 'show': false
  195. }, {
  196. 'title': '发动机号码',
  197. 'type': 2,
  198. 'required': false,
  199. 'value': 'engineNum',
  200. 'hint': '请输入发动机号码',
  201. 'show': false
  202. }, {
  203. 'title': '注册日期',
  204. 'type': 4,
  205. 'mode': 'date',
  206. 'value': 'registerDate',
  207. 'hint': '请输入注册日期',
  208. 'show': false
  209. }, {
  210. 'title': '发证日期',
  211. 'type': 4,
  212. 'mode': 'date',
  213. 'value': 'issueDate',
  214. 'hint': '请输入发证日期',
  215. 'show': false
  216. }, {
  217. 'title': '档案编号',
  218. 'type': 2,
  219. 'value': 'fileNum',
  220. 'hint': '请输入档案编号',
  221. 'show': false
  222. }, {
  223. 'title': '核定载人数',
  224. 'type': 2,
  225. 'required': false,
  226. 'inputType': 'number',
  227. 'value': 'approvedCount',
  228. 'hint': '请输入核定载人数',
  229. 'show': false
  230. }, {
  231. 'title': '总质量(kg)',
  232. 'type': 2,
  233. 'required': false,
  234. 'inputType': 'number',
  235. 'value': 'totalMass',
  236. 'hint': '请输入总质量',
  237. 'show': false
  238. }, {
  239. 'title': '整备质量(kg)',
  240. 'type': 2,
  241. 'required': false,
  242. 'inputType': 'number',
  243. 'value': 'maIntegerenanceMass',
  244. 'hint': '请输入整备质量',
  245. 'show': false
  246. }, {
  247. 'title': '核定载质量(kg)',
  248. 'type': 2,
  249. 'inputType': 'number',
  250. 'value': 'permittedWeight',
  251. 'hint': '请输入核定载质量',
  252. 'show': false
  253. }, {
  254. 'title': '外廓尺寸',
  255. 'type': 2,
  256. 'required': false,
  257. 'value': 'outsideDimensions',
  258. 'hint': '请输入外廓尺寸',
  259. 'show': false
  260. }, {
  261. 'title': '准牵引总质量(kg)',
  262. 'type': 2,
  263. 'inputType': 'number',
  264. 'value': 'permittedTowWeight',
  265. 'hint': '请输入准牵引总质量',
  266. 'show': false
  267. }])
  268. onLoad((option) => {
  269. console.log('内容', option, uni.getStorageSync(storageKey.userIdType))
  270. })
  271. for (let IdData of IdCard) {
  272. if (IdData.key === uni.getStorageSync(storageKey.userIdType)) {
  273. formData[Index('所有人证件类型', formData)][formData[Index('所有人证件类型', formData)].value] = IdData
  274. }
  275. }
  276. formData[Index('所有人证件号', formData)][formData[Index('所有人证件号', formData)].value] = uni.getStorageSync(storageKey.userIdNum)
  277. formData[Index('所有人手机号', formData)][formData[Index('所有人手机号', formData)].value] = uni.getStorageSync('operatorId')
  278. console.log('formData', formData)
  279. //单项选择器
  280. function radioChange(e: any, item: TypeData) {
  281. }
  282. //图像文件上传
  283. function uploadImg(data: any, item: TypeData, index: Number) {
  284. console.log('图片文件', data, item, index)
  285. if (index != 1) {
  286. data.apc = data.apc.replaceAll('人', '')
  287. data.gross = data.gross.replaceAll('kg', '')
  288. data.unladen = data.unladen.replaceAll('kg', '')
  289. data.alc = data.alc.replaceAll('kg', '')
  290. data.towing = data.towing.replaceAll('kg', '')
  291. }
  292. console.log('输出内容', data)
  293. //调整文件格式
  294. if (item.title === '行驶证照片') {
  295. let arr = [
  296. [Index('所有人', formData), 'man'],
  297. [Index('车辆类型', formData), 'vehicle'],
  298. [Index('住址', formData), 'address'],
  299. [Index('使用性质', formData), ''],
  300. [Index('品牌型号', formData), 'model'],
  301. [Index('车辆识别代码', formData), 'vin'],
  302. [Index('发动机号码', formData), 'engine'],
  303. [Index('注册日期', formData), 'register'],
  304. [Index('发证日期', formData), 'issue'],
  305. [Index('档案编号', formData), 'file'],
  306. [Index('核定载人数', formData), 'apc'],
  307. [Index('总质量(kg)', formData), 'gross'],
  308. [Index('整备质量(kg)', formData), 'unladen'],
  309. [Index('核定载质量(kg)', formData), 'alc'],
  310. [Index('外廓尺寸', formData), 'overall'],
  311. [Index('准牵引总质量(kg)', formData), 'towing']
  312. ]
  313. for (var i = 0; i < arr.length; i++) {
  314. if (formData[arr[i][0]] && formData[arr[i][0]].show) {
  315. formData[arr[i][0]].show = false
  316. }
  317. if (data[arr[i][1]]) {
  318. formData[arr[i][0]][formData[arr[i][0]].value] = data[arr[i][1]]
  319. }
  320. }
  321. }
  322. }
  323. function submit(item: any) {
  324. console.log('输出内容', item);
  325. uni.navigateTo({
  326. url: '/pages/mailingAddress/mailingAddress',
  327. animationType: 'pop-in',
  328. animationDuration: 500
  329. })
  330. }
  331. </script>
  332. <style lang='scss' scoped>
  333. </style>