1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312 |
- <template>
- <view v-if="state.isMyPeopple" class="content">
- <view class="item-tips">
- <view class="title"> 上传后请核对识别信息 </view>
- <view class="tip"> 如有错误请及时手动修改 </view>
- </view>
- <view class="picture-wrapper" @click="takePhotoMode('1','my')">
- <view class="bg">
- <view class="">
- <view class="name"> 人像面 </view>
- <view class="value"> 上传身份证的人像面 </view>
- <view class="tip">
- <view class="tip-value"> 拍摄规范 </view>
- </view>
- </view>
- <image v-if="!state.form.ownPosImgUrl" class="icon" :src="`${$imgUrl}applyCard/renxiang.png`">
- </image>
- <image v-else class="icon" :src="strReplace(state.form.ownPosImgUrl)"></image>
- </view>
- </view>
- <view class="picture-wrapper" @click="takePhotoMode('2','my')">
- <view class="bg">
- <view class="">
- <view class="name"> 国徽面 </view>
- <view class="value"> 上传身份证的国徽面 </view>
- <view class="tip">
- <view class="tip-value"> 拍摄规范 </view>
- </view>
- </view>
- <image v-if="!state.form.ownNegImgUrl" class="icon" :src="`${$imgUrl}applyCard/guohui.png`">
- </image>
- <image v-else class="icon" :src="strReplace(state.form.ownNegImgUrl)"></image>
- </view>
- </view>
- <view class="shibie-wrapper">
- <view class="title"> 识别内容如下 </view>
- <u-form label-width="230" :model="state.form" ref="uForm">
- <!-- <u-form-item label="姓名">
- <u-input v-model="state.form.userName" placeholder='请输入姓名' :disabled="state.isEnableOCRData"
- maxlength="20" @input="replaceInput" />
- </u-form-item> -->
- <u-form-item label="身份证号">
- <u-input placeholder='请输入身份证' type="idcard" v-model="state.form.userIdNum"
- :disabled="state.isEnableOCRData" maxlength="18" />
- </u-form-item>
- <u-form-item label="地址">
- <u-input placeholder='请输入地址' :autoHeight='true' v-model="state.form.address"
- :disabled="state.isEnableOCRData" maxlength="50" />
- </u-form-item>
- <u-form-item label="联系方式">
- <u-input placeholder='请输入联系方式' type="number" v-model="state.form.tel" maxlength="11" />
- </u-form-item>
- </u-form>
- </view>
- <view class="picture-wrapper" @click="takePhotoMode('3')">
- <view class="bg">
- <view class="">
- <view class="name"> 行驶证主页 </view>
- <view class="value"> 上传行驶证的主页 </view>
- <view class="tip">
- <view class="tip-value"> 拍摄规范 </view>
- </view>
- </view>
-
- <image v-if="!state.form.vehPosImgUrl" class="icon" :src="`${$imgUrl}applyCard/car-zhu.png`">
- </image>
- <image v-else class="icon" :src="strReplace(state.form.vehPosImgUrl)"></image>
- </view>
- </view>
- <view class="picture-wrapper" @click="takePhotoMode('4')">
- <view class="bg">
- <view class="">
- <view class="name"> 行驶证副页 </view>
- <view class="value"> 上传行驶证的副页 </view>
- <view class="tip">
- <view class="tip-value"> 拍摄规范 </view>
- </view>
- </view>
- <image v-if="!state.form.vehNegImgUrl" class="icon" :src="`${$imgUrl}applyCard/car-fu.png`">
- </image>
- <image v-else class="icon" :src="strReplace(state.form.vehNegImgUrl)"></image>
- </view>
- </view>
- <view class="picture-wrapper" @click="cardFileImageUpdate()">
- <view class="bg">
- <view class="">
- <view class="name"> 车头照 </view>
- <view class="value"> 上传汽车的车头照片 </view>
- <view class="tip">
- <view class="tip-value"> 拍摄规范 </view>
- </view>
- </view>
- <image v-if="!state.form.vehBodyUrl" class="icon" :src="`${$imgUrl}applyCard/chetou.png`">
- </image>
- <image v-else class="icon" :src="strReplace(state.form.vehBodyUrl)"></image>
- </view>
- </view>
- <view class="shibie-wrapper">
- <view class="title"> 识别内容如下 </view>
- <view class="">
- <u-form label-width="200" :model="state.form" ref="uForm">
- <u-form-item label="车牌号">
- <u-input inputAlign="right" placeholder="请输入车牌号" v-model="state.form.vehicleIdNum" disabled />
- </u-form-item>
-
- <u-form-item label="所有人">
- <u-input inputAlign="right" placeholder="请输入所有人" v-model="state.form.ownerName"
- :disabled="state.isEnableChangeOCRCarInfo" />
- </u-form-item>
- <u-form-item label="车辆类型">
- <u-input inputAlign="right" placeholder="请输入车辆类型" v-model="state.form.vehicleType"
- :disabled="state.isEnableChangeOCRCarInfo" />
- </u-form-item>
- <u-form-item label="车辆识别代号">
- <u-input inputAlign="right" placeholder="请输入车辆识别代号" v-model="state.form.vin"
- :disabled="state.isEnableChangeOCRCarInfo" />
- </u-form-item>
- <u-form-item label="发动机号码">
- <u-input inputAlign="right" placeholder="请输入发动机号码" v-model="state.form.engineNum"
- :disabled="state.isEnableChangeOCRCarInfo" />
- </u-form-item>
-
- <u-form-item label="注册日期">
- <picker mode="date" :value="state.form.register" @change="bindDateChange1"
- :disabled="state.isEnableChangeOCRCarInfo">
- <view class="uni-input" style="text-align: right;">
- {{state.form.register}}
- </view>
- </picker>
- </u-form-item>
- <u-form-item label="发证日期">
- <picker mode="date" :value="state.form.issueDate" @change="bindDateChange2"
- :disabled="state.isEnableChangeOCRCarInfo">
- <view class="uni-input" style="text-align: right;">
- {{state.form.issueDate}}
- </view>
- </picker>
- </u-form-item>
- <u-form-item label="核定载人数">
- <u-input inputAlign="right" placeholder="请输入核定载人数" v-model="state.form.approvedCount"
- :disabled="state.isEnableChangeOCRCarInfo" />
- </u-form-item>
- <u-form-item label="整备质量">
- <u-input inputAlign="right" placeholder="请输入整备质量" v-model="state.form.maintenaceMass"
- :disabled="state.isEnableChangeOCRCarInfo" />
- </u-form-item>
- <view class="form-item">
- <label>外廊尺寸</label>
- <view class="input-box">
- <text class="sub-label">长</text>
- <input v-model="state.outlineL" @input="outlineInput"
- :disabled="state.isEnableChangeOCRCarInfo" />
- <text class="sub-text">X</text>
- <text class="sub-label">宽</text>
- <input v-model="state.outlineW" @input="outlineInput"
- :disabled="state.isEnableChangeOCRCarInfo" />
- <text class="sub-text">X</text>
- <text class="sub-label">高</text>
- <input v-model="state.outlineH" @input="outlineInput"
- :disabled="state.isEnableChangeOCRCarInfo" />
- <text class="sub-text">mm</text>
- </view>
- </view>
- <u-form-item label="总质量">
- <u-input inputAlign="right" placeholder="请输入总质量" v-model="state.form.totalMass"
- :disabled="state.isEnableChangeOCRCarInfo" />
- </u-form-item>
- <u-form-item label="车轴数">
- <u-input inputAlign="right" placeholder="请输入车轴数" v-model="state.form.axleCount" type="number"
- maxlength="2" />
- </u-form-item>
- <view class="form-item">
- <label>车辆用户类型</label>
- <view class="select" @click="state.actionSheetShow = true">{{state.form.useUserTypeName}}</view>
- <image :src="`${$imgUrl}common/arror-down.png`" class="icon"
- @click="state.actionSheetShow = true"></image>
- </view>
- </u-form>
- </view>
- </view>
- <view class="green-tip">
- 如识别信息有误,请手动修改,确认无误后,点击下一步!
- </view>
- <view class="action">
- <button type="default" class="button" @click="savaHandleCar()">
- 提交
- </button>
- </view>
- <!-- 车辆类型弹窗 -->
- <u-popup mode="bottom" v-model="state.actionSheetShow">
- <view class="window">
- <view class="window-item" v-for="item in state.actionSheetList" :key="item.value"
- @click="userType(item)">{{item.text}}</view>
- </view>
- </u-popup>
- </view>
- <u-select mode="single-column" :list="state.genderList" v-model="state.genderShow" @confirm="genderSelectConfirm">
- </u-select>
- <view class="choice-takePhoto-wrap" v-if="state.isTakePhotoModeShow" @click="cancle">
- <view class="choice-takePhoto">
- <view @click.stop="takePhoto(state.choiceIndex)" style="border-radius: 20rpx 20rpx 0 0;">拍照</view>
- <view @click.stop="xiangce(state.choiceIndex)">从手机相册选择</view>
- <view @click.stop="cancle">取消</view>
- </view>
- </view>
-
- <viewfinder v-if="state.phoneType" :phoneType="state.phoneType" :images="state.images"
- :showStartPhoto="state.showImg" @confirmReturn="confirmReturn" @camera="camera"></viewfinder>
- </template>
-
- <script setup lang="ts">
- import viewfinder from "../../components/viewfinder.vue"
- import {
- reactive,
- ref,
- } from "vue";
- import {
- msg,
- checkStr,
- strReplace,
- uploadFile, hasLogin
- } from "@/utils/utils";
- import {
- onLoad,
- onPageScroll,
- } from "@dcloudio/uni-app";
- import {
- etcOcrCard,
- etcUserCardInfoSubmit,
- fileUpload,
- register,
- envs,
- getUserMsg,
- ocrAllQuery,
- etcCarOcrCard,
- searchVehicleInfo,
- carChangeApi,
- creactWorkOrder
- } from "@/utils/network/api.js";
-
- import {
- request
- } from "@/utils/network/request.js";
-
- import {
- stringToJson
- } from "@/utils/network/encryption";
- import {
- setItem,
- getItem,
- StorageKeys
- } from "@/utils/storage";
- import {
- getCodeName
- } from "@/datas/queryKey.js";
- import navBar from "@/components/nav-bar/nav-bar2.vue";
- import carNumberInput from "@/components/car-number-input/car-number-input.vue";
- import { getObuStatus } from "@/datas/obuStatus.js";
-
- import { getEtcCardStatus } from "@/datas/etcCardStatus.js";
- const scrollTop = ref(0)
- const state = reactive({
- showImg: true,
- isMy: "",//自己办理 他人办理
- phoneType: 0, // 1 身份证正面 2 身份证反面 3行驶证正面 4行驶证反面
- choiceIndex: 1, // 1 身份证正面 2 身份证反面
- isTakePhotoModeShow: false, //选择拍照方式是否出来
- images: '',
- genderList: [{
- value: '男',
- label: '男'
- },
- {
- value: '女',
- label: '女'
- }
- ],
- form: {
- orderId: "", //订单ID
- userName: "", //开户人姓名
- userIdType: "101", //用户证件类型 101//身份证
- userIdNum: "", //用户证件号码
- tel: "", //开户人手机号
- address: "", //开户人地址
- sceneType: "", //用户协议支撑服务场景(发行服务机构和用户签订的协议)
- channelId: "", //渠道id
- gender: "",
- customerIdVld: "",
- agentName: "",
- agentGender: "",
- agentTel: '',
- agentPhone: "",
- agentIdType: "101",
- agentIdNum: "",
- agentPosImgUrl: "",
- agentNegImgUrl: "",
- proxyUrl: "",
- agentAddress: "",
- agentIdVld: '',
- opId: '',
- orderSource: 'WECHAT',
- // ownerName: "", //所有人
- character: "", //使用性质
- register: "请输入注册日期", //注册日期
-
- customerId: "", //用户编号
- vehicleId: "",
- vehicleIdNum: "", //车牌编号
- issueDate: "请输入发证日期", //发证日期
- vehPosImgUrl: "", //行驶证正面
- vehNegImgUrl: "", //行驶证证反面
- type: "0", //0,客车 1.货车
- useUserType: 0, //车辆用户类型
- useUserTypeName: "普通车",
- vehicleSign: 2, //前/后装标识
- vin: "", //车辆识别代号
- engineNum: "", //发动机号码
- vehicleType: "", //车辆类型
- vehicleModel: "", //行驶证品牌型号
- approvedCount: undefined, //核定人数
- approvedCountShow: undefined,//展示的
- totalMass: undefined, //总质量
- totalMassShow: undefined, //总质量
- maintenaceMass: undefined, //整备质量
- maintenaceMassShow: undefined, //整备质量展示的
- permittedWeight: "", //核定载质量
- vehicleDimensions: "", //车辆尺寸
- permittedTowWeight: "", //准牵引总质量
- axleCount: "", //车轴数
- ownerName: "", //车主姓名
- ownerIdType: "", //车主证件类型
- ownerIdNum: "", //车主证件号码
- ownPosImgUrl: "", //车主证件正面图片
- ownNegImgUrl: "", //车主证件反面图片
- agreementId: "", //签约编号
- // channelId: "5201018892300000001", //编号渠道
- scenePayType: "", //
- transportIdNum: "", //道路运输证编号
- licenseIdNum: "", //经营许可证编号
- vehBodyUrl: "", //车身照片
- // proxyUrl: "", //委托书地址
- },
-
- genderShow: false,
- orderId: "",
- vehiclePlateColor: undefined,
- isMyPeopple: true,
- isSign: '',
- type: 1,
- isEnableOther: true, //小程序是否支持他人办理
- isEnableBook: true, //他人办理时是否上传委托书
- isEnableInfo: true, //小程序信息带出
- isEnableOCRData: true, //允许修改OCR识别出来的数据
- changeColor: false,
- data: {
- transferLogs: [],
- },
- actionSheetShow: false,
- actionSheetList: [{
- text: "普通车",
- value: 0,
- },
- {
- text: "道路运输证经营范围仅有“货物专用运输(集装箱) ”的牵引车办理J类型集装箱",
- value: 24,
- },
- {
- text: "道路运输证经营范围不含“货物专用运输(集装箱)”的牵引车",
- value: 27,
- },
- {
- text: '道路运输证经营范围除“货物专用运输 (集装 箱)"外,还有“普通货运”等其他项目的牵引车办理J2类型集装箱',
- value: 28,
- }],
- show: false,
- outlineL: "",
- outlineW: "",
- outlineH: "",
- isEnableChangeOCRCarInfo: false, //申办时是否允许修改OCR识别出来的车辆信息数据
- businessType: "",
- });
- const searchVehicleInfoQuery = () => {
- const options = {
- type: 2,
- data: {
- vehicleId: state.form.vehicleId
- },
- method: "POST",
- showLoading: true,
- };
- request(searchVehicleInfo, options).then((res) => {
- let result = stringToJson(res.bizContent);
- writeMsg(result.vehicles[0])
- });
- }
- const writeMsg = (allData) => {
- console.log("车辆信息", allData);
- state.form.ownPosImgUrl = allData['ownerPosImgUrl']
- state.form.ownNegImgUrl = allData['ownerNegImgUrl']
- state.form.userName = allData['contacts']
- state.form.userIdNum = allData['ownerIdNum']
- state.form.ownerIdNum = allData['ownerIdNum']
- state.form.address = allData['ownerAddress']
- state.form.tel = allData['ownerTel']
- state.form.vehPosImgUrl = allData['vehPosImgUrl']
- state.form.vehNegImgUrl = allData['vehNegImgUrl']
- state.form.vehBodyUrl = allData['vehBodyUrl']
- state.form.vehicleIdNum = allData['vehiclePlate']
- state.form.ownerName = allData['ownerName']
- state.form.vehicleType = allData['vehicleType']
- // state.form.character = allData['vehicleType'] //使用性质
- state.form.vin = allData['vin']
- state.form.engineNum = allData['engineNum']
- state.form.register = allData['registerDate']
- state.form.issueDate = allData['issueDate']
- state.form.approvedCountShow = allData['approvedCount']
- state.form.maintenaceMassShow = allData['maintenaceMass']
- state.form.approvedCount = allData['approvedCount']
- state.form.maintenaceMass = allData['maintenaceMass']
- allData['vehicleDimensions']
- let arr = allData['vehicleDimensions'].split("X");
- state.outlineL = parseInt(arr[0]); //外廓 长
- state.outlineW = parseInt(arr[1]); //外廓 宽
- state.outlineH = parseInt(arr[2].substring(0, arr[2].length - 2)); //外廓 高
- state.form.totalMassShow = allData['totalMass']
- state.form.totalMass = allData['totalMass']
- state.form.axleCount = allData['axleCount'] ? allData['axleCount'] : 2
- if (allData['useUserType'] == 0) {
- state.form.useUserTypeName = "普通车"
- } else if (allData['useUserType'] == 24) {
- state.form.useUserTypeName = "道路运输证经营范围仅有“货物专用运输(集装箱) ”的牵引车办理J类型集装箱"
- } else if (allData['useUserType'] == 27) {
- state.form.useUserTypeName = "道路运输证经营范围不含“货物专用运输(集装箱)”的牵引车"
- } else if (allData['useUserType'] == 28) {
- state.form.useUserTypeName = "道路运输证经营范围除'货物专用运输 (集装 箱)'外,还有“普通货运”等其他项目的牵引车办理J2类型集装箱"
- }
-
- state.vehiclePlateColor = allData['vehiclePlateColor']
- state.form.customerId = allData['customerId']
- }
- const userGenderAction = () => {
- state.genderShow = true;
- };
-
- const genderSelectConfirm = (e) => {
- state.form.gender = ''
- e.map((val, index) => {
- state.form.gender = val.label;
- })
- };
-
- const camera = () => {
- state.phoneType = 0
- }
-
- onLoad((option : any) => {
- state.form.vehicleId = option.vehicleId;
- state.form.opId = getItem('openId') ? getItem('openId') : '';
- getGlobalParam(); //全局配置数据
- console.log("option", option)
- searchVehicleInfoQuery(); //车辆信息查询
- state.businessType = getItem('key')['DASP_PUSH_TYPE'][0]['code']
- console.log("getItem('key')['DASP_PUSH_TYPE']", getItem('key')['DASP_PUSH_TYPE'])
- });
-
- //监听页面滚动
- onPageScroll((e) => {
- scrollTop.value = e.scrollTop;
- });
- const replaceInput = (event) => {
- console.log("event", event)
- const screeningStr = /[^\u4E00-\u9FA5]/g; //想禁止什么类型,在这里替换正则就可以了
- if (screeningStr.test(event)) {
- setTimeout(() => {
- state.form.userName = event.replace(screeningStr, '');
- }, 100)
- } else {
- setTimeout(() => {
- state.form.userName = event;
- }, 100)
- }
- console.log("event.replace(screeningStr, '')", event.replace(screeningStr, ''), event, state.form.userName)
- }
-
- const getGlobalParam = () => {
- const data = getItem('globalParam')
- console.log("全局配置数据", getCodeName('IS_ENABLE', data.miniSupportOther), getCodeName('IS_ENABLE', data.otherUploadProxy), getCodeName('IS_ENABLE', data.miniInfoShow), getCodeName('IS_ENABLE', data.changeOCRData))
- // 小程序是否支持他人办理
- if (getCodeName('IS_ENABLE', data.miniSupportOther) == '启用') {
- state.isEnableOther = true;
- } else {
- state.isEnableOther = false;
- }
- // 他人办理时是否上传委托书
- if (getCodeName('IS_ENABLE', data.otherUploadProxy) == '启用') {
- state.isEnableBook = true;
- } else {
- state.isEnableBook = false;
- }
- // 小程序信息带出
- if (getCodeName('IS_ENABLE', data.miniInfoShow) == '启用') {
- state.isEnableInfo = true;
- uni.showModal({
- // title: '提示',
- content: '是否允许带出用户信息',
- success: function (res) {
- if (res.confirm) {
- console.log('用户点击确定');
- } else if (res.cancel) {
- console.log('用户点击取消');
- }
- }
- });
- } else {
- state.isEnableInfo = false;
- }
- // 允许修改OCR识别出来的数据
- if (getCodeName('IS_ENABLE', data.changeOCRData) == '启用') {
- state.isEnableOCRData = false;
- } else {
- state.isEnableOCRData = true;
- }
- // 申办时是否允许修改OCR识别出来的车辆信息数据
- // if (getCodeName('IS_ENABLE', data.applyChangeOCRCarInfo) == '启用') {
- // state.isEnableChangeOCRCarInfo = true;
- // } else {
- // state.isEnableChangeOCRCarInfo = false;
- // }
- }
- const takePhotoMode = (index, isMy) => {
- console.log("index", index, isMy)
- state.isTakePhotoModeShow = true
- state.choiceIndex = index
- state.isMy = isMy
- }
- const xiangce = (val) => {
- console.log("val", val)
- var imageType = val;
- if (state.choiceIndex == 3) {
- var imageType = 1;
- } else {
- var imageType = 2;
- }
- uni.chooseImage({
- count: 1, //只能选取一张照片
- sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
- sourceType: ["album"], //从相册选择
- success: function (res) {
- state.showImg = false
- state.images = res.tempFilePaths[0]
- state.phoneType = state.choiceIndex
- state.isTakePhotoModeShow = false
- if (state.choiceIndex == 3 || state.choiceIndex == 4) {
- state.showImg = false
- state.images = res.tempFilePaths[0]
- state.phoneType = state.choiceIndex
- state.isTakePhotoModeShow = false
- return
- }
- console.log("tempFilePaths[0].startsWith('file://')", res.tempFilePaths[0], res.tempFilePaths[0].startsWith('file://'))
-
- },
- })
- }
- const takePhoto = (val) => {
- state.showImg = true
- console.log("拍照", val)
- state.phoneType = val;
- }
- const confirmReturn = (val) => {
- console.log("图片地址val", val)
- state.phoneType = 0
-
- state.isTakePhotoModeShow = false
- // var imageType = state.choiceIndex;
- if (state.choiceIndex == 1) {
- var imageType = 1;
- var queryCode = etcOcrCard
- } else if (state.choiceIndex == 2) {
- var imageType = 2;
- var queryCode = etcOcrCard
- }
- if (state.choiceIndex == 3) {
- var imageType = 1;
- var queryCode = etcCarOcrCard
- } else if (state.choiceIndex == 4) {
- var imageType = 2;
- var queryCode = etcCarOcrCard
- }
- // uploadFile(val.tempImagePath, imageType, ocrAllQuery).then((data) => {
- uploadFile(val.tempImagePath, imageType, queryCode).then((data) => {
- if (state.isMy == "my") {
- if (state.choiceIndex == "1") {
- console.log("身份证上传", data)
- state.form.userName = data.name;
- state.form.gender = data.gender;
- state.form.userIdNum = data.idno;
- state.form.ownPosImgUrl = data.imageUrl;
- state.form.address = data.address;
- } else {
- state.form.customerIdVld = data.enddate;
- state.form.ownNegImgUrl = data.imageUrl;
- }
- state.isTakePhotoModeShow = false
- } else {
- if (state.choiceIndex == "1") {
- state.form.agentName = data.name;
- state.form.agentGender = data.gender;
- state.form.agentIdNum = data.idno;
- state.form.agentPosImgUrl = data.imageUrl;
- state.form.agentAddress = data.address;
- } else if (state.choiceIndex == "2") {
- console.log("state.isMy", state.isMy, state.choiceIndex, state.choiceIndex == "1", data)
- state.form.agentIdVld = data.enddate;
- state.form.agentNegImgUrl = data.imageUrl;
- } else if (state.choiceIndex == "3") {
- if (data.plate_a.length > 8) {
- state.form.vehicleIdNum = data.plate_a.substring(0, 8);
- } else {
- state.form.vehicleIdNum = data.plate_a;
- }
- state.form.ownerName = data.man;
- state.form.vehicleType = data.vehicle;
- state.form.character = data.character;
- state.form.vin = data.vin;
- state.form.engineNum = data.engine;
- state.form.register = data.register;
- state.form.issueDate = data.issue;
- state.form.vehPosImgUrl = data.imageUrl;
- state.form.vehicleModel = data.model;
-
- } else {
- state.form.approvedCount = data.apc;
- state.form.approvedCountShow = data.apc;
- state.form.maintenaceMass = data.unladen;
- state.form.maintenaceMassShow = data.unladen;
- // 91接口差
- // // #ifdef MP-WEIXIN
- // state.form.vehicleDimensions = data.overall.replaceAll("×", "X");
- // // #endif
- // // #ifdef MP-ALIPAY
- // state.form.vehicleDimensions = data.overall.replace(/×/g, "X");
- // // #endif
-
- // let arr = data.overall.split("×");
- // #ifdef MP-WEIXIN
- state.form.vehicleDimensions = data.overall.replaceAll("x", "X");
- // #endif
- // #ifdef MP-ALIPAY
- state.form.vehicleDimensions = data.overall.replace(/x/g, "X");
- // #endif
-
- let arr = data.overall.split("x");
- state.outlineL = arr[0]; //外廓 长
- state.outlineW = arr[1]; //外廓 宽
- state.outlineH = arr[2].substring(0, arr[2].length - 2); //外廓 高
- state.form.totalMass = data.gross;
- state.form.totalMassShow = data.gross;
- state.form.vehNegImgUrl = data.imageUrl;
- state.form.permittedWeight = data.alc ? data.alc : 0;
- state.form.permittedTowWeight = data.towing ? data.towing : 0;
- console.log('=====================', state.form.vehNegImgUrl, state)
- }
- state.isTakePhotoModeShow = false
- }
- })
- }
- const cancle = () => {
- state.isTakePhotoModeShow = false
- }
- // 车辆信息
- //车牌号输入
- const carNumber = (val : any) => {
- state.form.vehicleIdNum = val.trim();
- };
- //提交车辆信息
- const savaHandleCar = () => {
- if (!checkStr(state.form.userIdNum, 'card')) {
- msg('请输入正确身份证');
- return;
- }
- if (!checkStr(state.form.tel, 'mobile')) {
- msg('请输入正确手机号');
- return;
- }
- if (!state.form.vehBodyUrl) {
- msg("请上传车头照");
- return;
- }
- if (state.form.type == 1) {
- state.form.axleCount = 2;
- } else {
- if (!state.form.axleCount) {
- msg("请输入车轴数");
- return;
- }
- }
- state.form.vehicleId =
- state.form.vehicleIdNum + "_" + state.vehiclePlateColor;
- state.form.opId = getItem(StorageKeys.OpenId);
- state.form.approvedCount = parseFloat(state.form.approvedCount);
- state.form.maintenaceMass = parseFloat(state.form.maintenaceMass);
- state.form.totalMass = parseFloat(state.form.totalMass);
- state.form.permittedWeight = parseFloat(state.form.permittedWeight);
- state.form.permittedTowWeight = parseFloat(state.form.permittedTowWeight);
-
- const options = {
- type: 2,
- data: state.form,
- method: "POST",
- showLoading: true,
- };
- request(carChangeApi, options)
- .then((res) => {
- const data = stringToJson(res.bizContent);
- // 创建工单
- msg("待审核")
- setTimeout(() => {
- uni.navigateBack({
- delta: 2
- })
- }, 2000)
- })
- .catch((res) => {
- console.log(res);
- });
- };
- const creactWorkOrderRequest = () => {
- const options = {
- type: 2,
- data: {
- businessType: state.businessType,
- vehiclePlate: state.form.vehicleIdNum,
- vehiclePlateColor: state.vehiclePlateColor,
- customerId: state.form.customerId
- },
- method: "POST",
- showLoading: true,
- };
-
- return new Promise(async (resolve, reject) => {
- const res = await request(creactWorkOrder, options);
- const data = stringToJson(res.bizContent);
- resolve(data);
- }).catch((error) => {
- reject(error);
- });
- }
- const selectConfirm = (index : any) => {
- console.log(index);
- state.form.useUserType = state.actionSheetList[index].value;
- state.form.useUserTypeName = state.actionSheetList[index].text;
- };
-
- //选择车辆用户类型
- const userType = (item : any) => {
- state.form.useUserType = item.value;
- state.form.useUserTypeName = item.text;
- state.actionSheetShow = false;
- }
- // 车头照图片上传
- const cardFileImageUpdate = () => {
- uni.chooseImage({
- count: 1, //只能选取一张照片
- sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
- sourceType: ["camera", "album"], //从相册选择
- success: function (res) {
- uploadFile(res.tempFilePaths[0], "", "").then((data) => {
- state.form.vehBodyUrl = data;
- })
- },
- });
- };
- //外廓尺寸输入框
- const outlineInput = (e) => {
- state.form.vehicleDimensions =
- state.outlineL + "X" + state.outlineW + "X" + state.outlineH + "mm";
- };
-
- const bindDateChange1 = (e) => {
- state.form.register = e.detail.value
- state.changeColor = true;
- }
- const bindDateChange2 = (e) => {
- state.form.issueDate = e.detail.value
- state.changeColor = true;
- }
- </script>
-
- <style lang="scss" scoped>
- .title {
- font-size: 35rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #000000;
- line-height: 80rpx;
- margin-bottom: 10rpx;
- }
-
- .content-wrap {
- position: relative;
- // margin-top: -50rpx;
- padding: 0rpx 30rpx;
- display: flex;
-
- .big {
- font-size: 30rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #333333;
- line-height: 24rpx;
- }
-
- .nomal {
- font-size: 26rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #666666;
- line-height: 24rpx;
- }
-
- .tip {
- margin-top: -5px;
- width: 117rpx;
- height: 16rpx;
- background: #00b38b;
- opacity: 0.3;
- }
- }
-
- .content {
- padding: 50rpx 30rpx 50rpx 30rpx;
-
- .action {
- padding-left: 20rpx;
- padding-right: 20rpx;
- padding-bottom: 30rpx;
-
- .button {
- height: 80rpx;
- background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
- border-radius: 40rpx;
- font-size: 32rpx;
- font-weight: 400;
- color: #ffffff;
- line-height: 80rpx;
- }
- }
-
- .item-tips {
- .title {
- font-size: 30rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #000000;
- line-height: 24rpx;
- }
-
- .tip {
- margin-top: 16rpx;
- font-size: 24rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #999999;
- line-height: 24rpx;
- }
- }
-
- .picture-wrapper {
- margin-top: 40rpx;
-
- .bg {
- background: #ffffff;
- box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
- border-radius: 20rpx;
- padding: 40rpx;
- display: flex;
- // align-items: center;
- justify-content: space-between;
-
- .name {
- font-size: 34rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #000000;
- line-height: 34rpx;
- }
-
- .value {
- margin-top: 20rpx;
- font-size: 24rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #999999;
- line-height: 24rpx;
- }
-
- .tip {
- margin-top: 20rpx;
- text-align: center;
- width: 110rpx;
- height: 40rpx;
- background: rgba(33, 190, 177, 0.2);
- border-radius: 6rpx;
-
- .tip-value {
- font-size: 20rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #0a8f8a;
- line-height: 40rpx;
- opacity: 1;
- }
- }
- }
-
- .icon {
- width: 294rpx;
- height: 188rpx;
- }
- }
-
- .shibie-wrapper {
- margin-top: 60rpx;
-
- .title {
- font-size: 30rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #000000;
- line-height: 30rpx;
- }
- }
-
- .buchong-wrapper {
- margin-top: 60rpx;
-
- .title {
- font-size: 30rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #000000;
- line-height: 30rpx;
- }
- }
-
- .green-tip {
- margin-top: 50rpx;
- font-size: 24rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #00b38b;
- line-height: 24rpx;
- margin-bottom: 60rpx;
- }
- }
-
- .choice-takePhoto {
- position: absolute;
- bottom: 0;
- background-color: white;
- width: 100%;
- border-radius: 20rpx 20rpx 0 0;
- }
-
- .choice-takePhoto>view:first-child {
- text-align: center;
- height: 80rpx;
- line-height: 80rpx;
- border-bottom: 1rpx solid rgba(127, 127, 127, 0.3);
- background-color: white;
- }
-
- .choice-takePhoto>view:last-child {
- text-align: center;
- height: 80rpx;
- line-height: 80rpx;
- border-top: 6rpx solid rgba(127, 127, 127, 0.1);
- background-color: white;
- }
-
- .choice-takePhoto>view {
- text-align: center;
- height: 80rpx;
- line-height: 80rpx;
- background-color: white;
- }
-
- .choice-takePhoto-wrap {
- width: 100%;
- height: 100vh;
- background-color: rgba(127, 127, 127, 0.2);
- position: fixed;
- left: 0;
- top: 0;
- z-index: 11111;
- }
-
- .hui {
- color: #ccc;
- }
-
- .hei {
- color: black;
- }
-
- .goto {
- margin-right: 20rpx;
- padding: 10rpx;
- color: #00b38b;
- border: 1rpx solid #00b38b;
- border-radius: 20rpx;
- }
-
- .flex {
- display: flex;
- align-items: center;
- }
-
- .bettwen-center {
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
-
- .card {
- margin: 20rpx;
- height: 150rpx;
- background: #ffffff;
- box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
- border-radius: 20rpx;
- padding: 20rpx;
- display: flex;
- justify-content: space-between;
- align-items: center;
- margin-bottom: 30rpx;
-
- .card-left {
- display: flex;
- align-items: center;
-
- image {
- width: 100rpx;
- height: 90rpx;
- }
-
- .card-center {
- margin-left: 30rpx;
-
- .card-center-head {
- font-size: 32rpx;
- font-family: Noto Sans S Chinese;
- font-weight: 400;
- color: #333333;
- }
-
- .tips {
- font-size: 26rpx;
- font-family: Noto Sans S Chinese;
- font-weight: 400;
- color: #666666;
-
- .tips-card {
- width: 70rpx;
- height: 40rpx;
- background: #d3f2ef;
- border-radius: 6rpx;
- font-size: 20rpx;
- font-family: Noto Sans S Chinese;
- font-weight: 400;
- color: #0a8f8a;
- padding: 5rpx 10rpx;
- margin-left: 20rpx;
- }
- }
- }
- }
-
- .choose-item {
- margin-right: 20rpx;
- width: 50rpx;
- height: 50rpx;
- border: 1rpx solid #00b38b;
- border-radius: 50%;
- display: flex;
- justify-content: center;
- align-items: center;
-
- .active {
- width: 38rpx;
- height: 38rpx;
- background: #00b38b;
- border-radius: 50%;
- }
- }
- }
-
- .content {
- // position: relative;
- // margin-top: -50rpx;
- // padding: 0rpx 30rpx;
- // position: relative;
-
- .img-pos {
- position: absolute;
- left: 270rpx;
- top: -38rpx;
- right: 50rpx;
-
- .img-flex {
- display: flex;
- justify-content: space-between;
- align-items: center;
-
- .car-img {
- width: 86rpx;
- height: 42rpx;
- }
-
- .flag-img {
- width: 30rpx;
- height: 35rpx;
- }
- }
- }
-
- .action {
- padding-left: 20rpx;
- padding-right: 20rpx;
- padding-bottom: 30rpx;
-
- .button {
- height: 80rpx;
- background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
- border-radius: 40rpx;
- font-size: 32rpx;
- font-weight: 400;
- color: #ffffff;
- line-height: 80rpx;
- }
- }
-
- .item-tips {
- .title {
- font-size: 30rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #000000;
- line-height: 24rpx;
- }
-
- .tip {
- margin-top: 16rpx;
- font-size: 24rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #999999;
- line-height: 24rpx;
- }
- }
-
- .picture-wrapper {
- margin-top: 40rpx;
-
- .bg {
- background: #ffffff;
- box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
- border-radius: 20rpx;
- padding: 40rpx;
- display: flex;
- // align-items: center;
- justify-content: space-between;
-
- .name {
- font-size: 34rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #000000;
- line-height: 34rpx;
- }
-
- .value {
- margin-top: 20rpx;
- font-size: 24rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #999999;
- line-height: 24rpx;
- }
-
- .tip {
- margin-top: 20rpx;
- text-align: center;
- width: 110rpx;
- height: 40rpx;
- background: rgba(33, 190, 177, 0.2);
- border-radius: 6rpx;
-
- .tip-value {
- font-size: 20rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #0a8f8a;
- line-height: 40rpx;
- opacity: 1;
- }
- }
- }
-
- .icon {
- width: 294rpx;
- height: 188rpx;
- }
- }
-
- .shibie-wrapper {
- margin-top: 60rpx;
-
- .title {
- font-size: 30rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #000000;
- line-height: 30rpx;
- }
- }
-
- .buchong-wrapper {
- margin-top: 60rpx;
-
- .title {
- font-size: 30rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #000000;
- line-height: 30rpx;
- }
- }
-
- .green-tip {
- margin-top: 50rpx;
- font-size: 24rpx;
- font-family: Microsoft YaHei;
- font-weight: 400;
- color: #00b38b;
- line-height: 24rpx;
- margin-bottom: 60rpx;
- }
- }
-
- .form-item {
- display: flex;
- font-size: 28rpx;
- justify-content: space-between;
- align-items: center;
- }
-
- .form-item label {}
-
- .form-item .input-box {
- display: flex;
- align-items: center;
- }
-
- .form-item .select {
- flex: 1;
- background: #f1f1f1;
- padding: 6rpx 20rpx;
- margin: 0 10rpx;
- min-height: 48rpx;
- line-height: 48rpx;
- border-radius: 8rpx;
- }
-
- .form-item .icon {
- width: 28rpx;
- height: 32rpx;
- }
-
- .form-item .input-box input {
- width: 90rpx;
- background: #f1f1f1;
- border-radius: 8rpx;
- padding: 0 5rpx;
- }
-
- .form-item .sub-text {
- color: #808080;
- padding-left: 10rpx;
- }
-
- .form-item .sub-label {
- padding: 0 10rpx;
- }
-
- .window {
- padding: 60rpx 30rpx;
- }
-
- .window .window-item {
- border: 1px solid #00b38b;
- background: rgba(0, 179, 139, .1);
- border-radius: 10rpx;
- padding: 16rpx 30rpx;
- font-size: 30rpx;
- margin-bottom: 10rpx;
- }
-
- ::v-deep .u-input__input {
- background: transparent;
- }
- </style>
|