index.vue 17 KB

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