index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  1. <template>
  2. <view class="page">
  3. <image src="/static/image/indexback.png" mode="" style="width: 100%;height: 622rpx;"></image>
  4. <view class="dept dis a-c j-c" @click="deptSelect">
  5. <text class="mr-1">{{deptradioName}}</text>
  6. <u-icon name="arrow-down" color="#333333" size="14"></u-icon>
  7. </view>
  8. <view class="content">
  9. <uni-tab :tabList="tabList" :value="activeTab" noactivebackgroundColor="rgba(254, 249, 239, 55%)">
  10. <!-- 第一个标签内容 -->
  11. <template #content0>
  12. <view class=" dis f-c " style="padding: 20rpx 30rpx 30rpx;">
  13. <text class="imgtitle">请上传车辆行驶证正反页面</text>
  14. <view class="colorBlock"> </view>
  15. <view class="imageUpload" @click="OCRUploadShow=true">
  16. <image src="/static/image/Frame 1321319407.png" mode="aspectFill"></image>
  17. </view>
  18. <view class="quotebtn dis a-c j-c font-weight" @click="manualQuote">
  19. 手动报价
  20. </view>
  21. </view>
  22. </template>
  23. <!-- 第二个标签内容 -->
  24. <template #content1>
  25. <view class=" dis f-c " style="padding: 40rpx 30rpx 30rpx ;">
  26. <view class="license dis f-c ">
  27. <view class="dis a-c ">
  28. <image src="/static/image/licensePlateicon.png" mode=""></image>
  29. <text class="title">车牌号</text>
  30. </view>
  31. <view class="licensePlateRegion mt-2 dis a-c ">
  32. <view class="Region dis a-c j-c " @click="Regionselect">
  33. {{licenseActiveName}}
  34. </view>
  35. <u--input v-model="licenseValue" placeholder="请输入" border="bottom" clearable
  36. maxlength="7" @input="handleInput"
  37. :customStyle="{borderColor:'#FDE935 !important'}"></u--input>
  38. </view>
  39. </view>
  40. <view class="license dis f-c mt-3">
  41. <view class="dis ">
  42. <image src="/static/image/caricon.png" mode=""></image>
  43. <text class="title">车辆种类</text>
  44. </view>
  45. <view class="u--input dis a-c j-s" @tap="carTypeShow = true">
  46. <text v-if="carTypeCode"
  47. style="font-size: 30rpx; color: #303133;line-height: 52rpx;">{{carTypeCode }}</text>
  48. <text v-else style="font-size: 30rpx; color: #999;line-height: 52rpx;">请选择车辆类型</text>
  49. <u-icon name="arrow-down" color="#333333" size="14"></u-icon>
  50. </view>
  51. </view>
  52. <view class="licenslist dis mt-3">
  53. <view class="item dis a-c j-c" v-for="(items,index) in historicalVehicle" :key="index"
  54. @click="licensePlateQuery(items.licenseNo)">
  55. <text>{{items.licenseNo}}</text>
  56. </view>
  57. </view>
  58. <view class="quotebtn dis a-c j-c font-weight" @click="manualQuote">
  59. 手动报价
  60. </view>
  61. </view>
  62. </template>
  63. </uni-tab>
  64. </view>
  65. <view class="swiper">
  66. <u-swiper :list="bannerList" indicator height="180rpx" radius="10" imgMode="heightFix"></u-swiper>
  67. </view>
  68. <!-- 车牌地区选择 -->
  69. <uni-Popup :show="licenseShow" bgColor="#F8F8F8" @close='licenseclose'>
  70. <template #content>
  71. <view class="licenselist dis f-wrap j-s">
  72. <view class="item dis a-c j-c" :class="{active:item=== licenseActiveName}"
  73. v-for="item in licenselist" :key="item" @tap="licenseItem(item)">
  74. <text>{{item}}</text>
  75. </view>
  76. </view>
  77. </template>
  78. </uni-Popup>
  79. <!-- 租户机构选择 -->
  80. <uni-Popup :show="deptSelectShow" @close='deptclose' headerTitle="选择出单机构" overflow="auto" maxHeight="580rpx">
  81. <template #content>
  82. <view class="overflow">
  83. <view class="deptselect dis f-c ">
  84. <u-radio-group v-model="deptradiovalue" placement="column" iconPlacement="right"
  85. @change="deptchange">
  86. <view class="item dis a-c " v-for="(item, index) in tenantOrglist" :key="index">
  87. <u-radio activeColor="#FDE935" iconColor='#333' :name="item.systemCode"
  88. style="width: 100%;">
  89. <view class="textregion dis f-c ">
  90. <text>{{item.sysName}}</text>
  91. <text>{{item.deptName}}</text>
  92. </view>
  93. <image :src="item.iconAddress" mode=""></image>
  94. </u-radio>
  95. </view>
  96. </u-radio-group>
  97. </view>
  98. </view>
  99. </template>
  100. </uni-Popup>
  101. <!-- 车型选择 -->
  102. <u-picker :show="carTypeShow" :columns="car_kind_codeoptions" keyName="label" @cancel="carTypeShow=false"
  103. @confirm="carTypeconfirm"></u-picker>
  104. <uni-OCRUploadPopup :show="OCRUploadShow" :list='carPopuptablist' @close="OCRUploadShow=false"
  105. :checkType="checkType" @carCallback="carCallback">
  106. </uni-OCRUploadPopup>
  107. </view>
  108. </template>
  109. <script>
  110. import {
  111. mapState,
  112. mapMutations
  113. } from "vuex"
  114. import store from '@/store';
  115. export default {
  116. data() {
  117. return {
  118. //历史车辆信息
  119. historicalVehicle: [],
  120. //车辆信息
  121. carInfo: {
  122. licenseNo: "", //车牌号
  123. brandName: "", //车辆品牌型号
  124. vinNo: "", //车架号
  125. engineNo: "", //发动机号
  126. modelCode: "", //车型编码
  127. seatCount: "", //核定载客量 核定载人数
  128. purchasePrice: "", //新车购置价最低,行业实际价值,协商价值
  129. carBrand: "", //车型品牌
  130. ciCarName: "", //行业车型名称
  131. ciModelCode: "", //行业车型编码
  132. completeKerbMass: "", //整备质量
  133. exhaustScale: "", //排量
  134. factory: "", //工厂名称
  135. factoryid: "", //工厂编码
  136. frameNo: "", //车架号
  137. licenseKindCode: "02", //号牌种类
  138. vehicleclass: "", //车辆类型
  139. familyName: "", //车型
  140. modelcname: "", //车型名称
  141. powertypecode: "", //燃料类型编码
  142. vehicleweight: "", //总质量
  143. limitLoad: "", //核定载质量
  144. caryear: "", //年款
  145. carKindCode: "A0", //车辆种类
  146. powertype: "汽油", //燃料类型
  147. energyTypeCode: "0", //能源种类
  148. displacement: "", //排量
  149. powerScale: "", //功率
  150. registerDate: "", //注册日期
  151. issueDate: "", //发证日期
  152. transferFlag: false, //过户标志
  153. transferFlagBi: false, //商业过户标志
  154. transferDate: "", //过户日期
  155. loanStatus: 0, //贷款标志
  156. firstBeneMan: "", //第一受益人
  157. noLicenseFlag: false, //是否新车
  158. carTypeCode: "K33", //客车A0 货车H0          
  159. carNatureCode: "02", //使用性质 家庭自用8A 非营业企业8B 非营业党政机关,事业团体8C 非营业货车8D
  160. propertyCode: "1", //所属性质 1个人 2企业 3个人
  161. outOfInsurance: false, //脱保
  162. usedCar: false, //二手车
  163. vehicleUseCode: "05" //车辆用途
  164. },
  165. ownersInfo: {}, //车主
  166. policyHolderInfo: {}, //投保人
  167. insuredPersonInfo: {}, //被保人
  168. checkType: "carInfo",
  169. OCRUploadShow: false, //上传弹窗
  170. carPopuptablist: [{
  171. name: '行车本正页',
  172. }, {
  173. name: '行车本副页',
  174. }],
  175. licenseNo: "", //车牌号
  176. carTypeCode: "", //车辆类型
  177. carTypeCodeValue: "",
  178. carTypeShow: false, //选择车型
  179. tenantOrglist: [], //租户机构列表
  180. deptradiovalue: '',
  181. deptradioName: '',
  182. licenseActiveName: '晋', //车牌选中
  183. licenseValue: "",
  184. licenseShow: false, //车牌选择
  185. deptSelectShow: false, //机构选择弹窗显示/隐藏
  186. bannerList: [ //轮播图
  187. "/static/image/banner.png",
  188. ],
  189. activeTab: 0, //
  190. tabList: [{
  191. label: '传图报价',
  192. id: 0
  193. },
  194. {
  195. label: '车牌号报价',
  196. id: 1
  197. }
  198. ],
  199. licenselist: ["京", "沪", "粤", "津", "冀", "豫", "云", "辽", "黑", "湘", "皖", "鲁", "苏",
  200. "浙", "赣", "鄂", "桂", "甘", "晋", "陕", "蒙", "吉", "闽", "贵", "渝", "川",
  201. "青", "琼", "宁", "挂", "藏", "港", "澳", "新", "使", "学"
  202. ],
  203. carInfoImgViewList: [],
  204. //影像id
  205. carInfoPositiveList: [], //车辆
  206. ownerInfoPositiveList: [], //车主
  207. policyHolderInfoPositiveList: [], //投保人
  208. insuredPersonInfoPositiveList: [], //被保人
  209. car_kind_codeoptions: [],
  210. }
  211. },
  212. onShow() {},
  213. async onLoad() {
  214. await this.getDicType("car_kind_code"); //车辆种类
  215. let res = await this.$http.post('/userInfo/getTenantList'); //获取机构列表
  216. if (res.code == '200') {
  217. if (res.data.length > 1) {
  218. this.tenantOrglist = res.data;
  219. this.deptSelectShow = true;
  220. } else {
  221. this.tenantOrglist = res.data;
  222. this.deptradiovalue = res.data[0].systemCode;
  223. this.deptradioName = res.data[0].deptName;
  224. store.commit('setUserModules', {
  225. title: 'system_code',
  226. data: this.tenantOrglist[0].systemCode
  227. })
  228. this.bannerquery();
  229. }
  230. }
  231. let res1 = await this.$http.get('/supplementOrder/getHistoryQuote');
  232. if (res1.code == '200') {
  233. this.historicalVehicle = res1.data;
  234. }
  235. },
  236. methods: {
  237. ...mapMutations(['activelicenseNo']),
  238. //车牌号查询相关历史订单
  239. licensePlateQuery(item) {
  240. this.activelicenseNo(item);
  241. uni.switchTab({
  242. url: '/pages/orders/orders',
  243. })
  244. },
  245. //获取轮播图
  246. async bannerquery() {
  247. let res = await this.$http.post('/poster/queryPage');
  248. if (res.code == '200') {
  249. let list = res.data.records.map(val => {
  250. return val.previewUrl;
  251. })
  252. this.bannerList = list;
  253. }
  254. },
  255. //数据字典
  256. async getDicType(type, vehicle) {
  257. if (vehicle) {
  258. let res = await this.$http.get(`/dict/get?dictCode=${type}&parentValue=${vehicle}`);
  259. this[type + vehicle + "options"] = [res.data];
  260. } else {
  261. let res = await this.$http.get('/dict/get?dictCode=' + type);
  262. this[type + "options"] = [res.data];
  263. }
  264. },
  265. //影像识别回调事件
  266. carCallback(obj) {
  267. this.carInfoImgViewList = [];
  268. if (obj.frontImg) {
  269. this.carInfoImgViewList.push({
  270. img: obj.frontImg,
  271. deg: 0,
  272. })
  273. }
  274. if (obj.backImg) {
  275. this.carInfoImgViewList.push({
  276. img: obj.backImg,
  277. deg: 0,
  278. })
  279. }
  280. this.carInfoPositiveList = obj.ImgList;
  281. Object.assign(this.carInfo, obj.Info);
  282. this.OCRUploadShow = false;
  283. let params = {
  284. carInfo: this.carInfo,
  285. carInfoImgViewList: this.carInfoImgViewList,
  286. carInfoPositiveList: this.carInfoPositiveList,
  287. }
  288. uni.navigateTo({
  289. url: '/pages/quote/quoteInfo?info=' + JSON.stringify(params)
  290. })
  291. },
  292. //用户机构选择
  293. deptSelect() {
  294. this.deptSelectShow = true;
  295. },
  296. //车牌地区选择
  297. Regionselect() {
  298. this.licenseShow = true;
  299. },
  300. licenseItem(item) {
  301. this.licenseActiveName = item;
  302. this.licenseShow = false;
  303. },
  304. licenseclose() {
  305. this.licenseShow = false;
  306. },
  307. deptclose() {
  308. this.deptSelectShow = false;
  309. },
  310. handleInput(event) {
  311. // 将过滤后的值转换为大写
  312. this.licenseValue = event.toUpperCase();
  313. },
  314. carTypeconfirm(value) {
  315. this.carTypeCode = value.value[0].label;
  316. this.carTypeCodeValue = value.value[0].value;
  317. this.carTypeShow = false;
  318. },
  319. async deptchange(name) {
  320. let info = this.tenantOrglist.find(val => val.systemCode == name);
  321. this.deptradiovalue = info.systemCode;
  322. this.deptradioName = info.deptName;
  323. await store.commit('setUserModules', {
  324. title: 'system_code',
  325. data: info.systemCode,
  326. })
  327. this.deptSelectShow = false;
  328. this.bannerquery();
  329. },
  330. async manualQuote() {
  331. if (this.licenseValue !== "" && this.carTypeCodeValue !== "") {
  332. let params = {
  333. licenseNo: this.licenseActiveName + this.licenseValue,
  334. carKindCode: this.carTypeCodeValue,
  335. }
  336. let res = await this.$http.get('/supplementOrder/getCarRecord', params);
  337. if (res.code == '200') {
  338. Object.assign(this.carInfo, res.data.carInfoVo);
  339. Object.assign(this.ownersInfo, res.data.ownersInfo);
  340. Object.assign(this.policyHolderInfo, res.data.policyHolderInfo);
  341. Object.assign(this.insuredPersonInfo, res.data.insuredPersonInfo);
  342. }
  343. uni.navigateTo({
  344. url: '/pages/quote/quoteInfo',
  345. success: (res) => {
  346. res.eventChannel
  347. .emit(
  348. "acceptData", {
  349. carInfo: this.carInfo,
  350. ownersInfo: this.ownersInfo,
  351. policyHolderInfo: this.policyHolderInfo,
  352. insuredPersonInfo: this.insuredPersonInfo,
  353. })
  354. }
  355. })
  356. } else {
  357. uni.navigateTo({
  358. url: '/pages/quote/quoteInfo'
  359. })
  360. }
  361. }
  362. }
  363. }
  364. </script>
  365. <style lang="scss" scoped>
  366. .page {
  367. background-color: #F8F8F8;
  368. }
  369. .content {
  370. position: absolute;
  371. top: 327rpx;
  372. left: 0;
  373. right: 0;
  374. padding: 20rpx 30rpx 30rpx;
  375. box-sizing: border-box;
  376. .imgtitle {
  377. font-size: 26rpx;
  378. color: #333;
  379. }
  380. .block {
  381. width: 85%;
  382. height: 50%;
  383. background: #FFFFFF;
  384. border-radius: 10rpx;
  385. border: 1px solid #FFFCB5;
  386. }
  387. .colorBlock {
  388. position: absolute;
  389. top: 52rpx; // 根据实际图片高度调整
  390. left: 50%;
  391. transform: translateX(-50%);
  392. width: 80%;
  393. height: 300rpx;
  394. margin: 0 auto;
  395. margin-top: 16rpx;
  396. background: #fff;
  397. border-radius: 10rpx 10rpx 10rpx 10rpx;
  398. border: 2rpx solid #FFFCB5;
  399. }
  400. .imageUpload {
  401. position: relative;
  402. width: 100%;
  403. height: 376rpx;
  404. background: #fff;
  405. box-shadow: 0px 0px 16px 0px rgba(146, 141, 97, 0.1);
  406. border-radius: 10rpx 10rpx 10rpx 10rpx;
  407. border: 1px solid #FFFCB5;
  408. margin-top: 40rpx;
  409. padding: 30rpx;
  410. box-sizing: border-box;
  411. >image {
  412. width: 100%;
  413. height: 100%;
  414. }
  415. }
  416. .quotebtn {
  417. background: #FDE935;
  418. padding: 19rpx 147rpx;
  419. box-sizing: border-box;
  420. border-radius: 58rpx;
  421. font-size: 36rpx;
  422. color: #1F1F1F;
  423. margin: 60rpx 17rpx 0 17rpx;
  424. }
  425. }
  426. .dept {
  427. position: absolute;
  428. top: 103rpx;
  429. right: 30rpx;
  430. text {
  431. font-size: 30rpx;
  432. color: #333333;
  433. }
  434. }
  435. .swiper {
  436. padding: 30rpx;
  437. margin-top: 480rpx;
  438. box-sizing: border-box;
  439. }
  440. .license {
  441. image {
  442. width: 40rpx;
  443. height: 40rpx;
  444. margin-right: 10rpx;
  445. }
  446. .title {
  447. font-size: 30rpx;
  448. color: #333;
  449. }
  450. .licensePlateRegion {
  451. .Region {
  452. width: 80rpx;
  453. height: 75rpx;
  454. border-radius: 4rpx;
  455. border: 1px solid #FDE935;
  456. padding: 17rpx 25rpx;
  457. font-size: 30rpx;
  458. box-sizing: border-box;
  459. color: #333;
  460. font-weight: bold;
  461. margin-right: 27rpx;
  462. }
  463. }
  464. }
  465. ::v-deep {
  466. .input-placeholder {
  467. font-size: 30rpx;
  468. color: #999 !important;
  469. }
  470. }
  471. //车牌地区选择
  472. .licenselist {
  473. .item {
  474. padding: 12rpx 10rpx;
  475. background-color: #fff;
  476. border-radius: 8rpx;
  477. margin: 8rpx;
  478. font-size: 40rpx;
  479. color: #333;
  480. font-weight: 500;
  481. box-sizing: border-box;
  482. }
  483. .active {
  484. background-color: #FDE935;
  485. }
  486. }
  487. //出单机构选择
  488. .overflow {
  489. padding: 30rpx;
  490. box-sizing: border-box;
  491. .deptselect {
  492. .item {
  493. border-radius: 10rpx;
  494. border: 1px solid #EEEEEE;
  495. padding: 24rpx 25rpx;
  496. margin-bottom: 30rpx;
  497. width: 100%;
  498. box-sizing: border-box;
  499. image {
  500. width: 72rpx;
  501. height: 72rpx;
  502. margin-right: 20rpx;
  503. }
  504. .textregion {
  505. margin-right: auto;
  506. text:first-child {
  507. font-size: 32rpx;
  508. color: #333;
  509. font-weight: bold;
  510. }
  511. text:last-child {
  512. font-size: 30rpx;
  513. color: #666;
  514. }
  515. }
  516. }
  517. }
  518. }
  519. .licenslist {
  520. overflow-x: auto;
  521. /* 超出后可以左右滑动 */
  522. white-space: nowrap;
  523. /* 防止子元素换行 */
  524. padding: 10rpx 0;
  525. /* 添加一些内边距 */
  526. .item {
  527. flex: 0 0 auto;
  528. /* 防止子元素被压缩 */
  529. padding: 8rpx 20rpx;
  530. box-sizing: border-box;
  531. background: linear-gradient(270deg, rgba(253, 233, 53, 0.2) 0%, rgba(220, 238, 111, 0.2) 100%);
  532. border-radius: 2rpx;
  533. margin-right: 10rpx;
  534. font-size: 26rpx;
  535. color: #000;
  536. }
  537. }
  538. .u--input {
  539. padding: 12rpx 18rpx;
  540. border-bottom: 0.5px solid rgb(253, 233, 53);
  541. }
  542. </style>