vadd.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745
  1. <template>
  2. <view class="check">
  3. <uni-forms ref="form" :model="datainfo" :rules="rules">
  4. <view class="cbox" style="padding-bottom: 24rpx;">
  5. <view class="chtop flexc" @click="zhanflag=!zhanflag">
  6. <view class="line"></view>
  7. <view class="atit">常用访客</view>
  8. <view v-if="!delflag" class="btntit" @click.stop="delflag=true">删除</view>
  9. <view v-else class="btntit bttita" @click.stop="delflag=false">完成</view>
  10. <view class="flex1"></view>
  11. <image :src="upimg" class="upimg" :class="zhanflag?'act':''"></image>
  12. </view>
  13. <view class="peobox flexc" v-if="zhanflag">
  14. <view class="plists flexcc" v-for="(ite,idx) in visitList" :key="idx">
  15. <view class="tit overtwo">{{ite.name}}</view>
  16. <view class="addimg flexcc" v-if="delflag" @click.stop="getcyvisDel(ite.frequentlyVisitorManageId,idx)">
  17. <image :src="delimg" class="imgb"></image>
  18. </view>
  19. <view class="addimg flexcc" v-else @click.stop="getcyvisEdit(ite)">
  20. <image :src="addimg" class="imga"></image>
  21. </view>
  22. </view>
  23. <!-- <view class="plists flexcc">
  24. <view class="tit overtwo">王一</view>
  25. <view class="addimg flexcc">
  26. <image :src="addimg"></image>
  27. </view>
  28. </view> -->
  29. </view>
  30. </view>
  31. <view class="cbox">
  32. <view class="chtop flexc">
  33. <view class="line"></view>
  34. <view class="atit">访客信息</view>
  35. </view>
  36. <view class="chmain">
  37. <!-- 选择房屋 -->
  38. <uni-forms-item label="访客姓名" name="name">
  39. <view class="flexc">
  40. <uni-easyinput :disabled="isdisabled" v-model="datainfo.name" :inputBorder='false' placeholder="请输入访客姓名" />
  41. <!-- <uni-data-checkbox selectedColor="#0156FE" selectedTextColor="#272727" v-model="datainfo.sex" :localdata="sexs" /> -->
  42. </view>
  43. </uni-forms-item>
  44. <uni-forms-item label="来访人数" name="num">
  45. <view class="flexc">
  46. <!-- <uni-easyinput :disabled="isdisabled" v-model="datainfo.num" type="Number" :inputBorder='false' placeholder="请输入来访人数" /> -->
  47. <!-- <view class="flex1"></view> -->
  48. <view class="libox flexcw rslist">
  49. <view class="sylist flexcc" :class="datainfo.num==ite.value?'act':''" v-for="(ite,idx) in rslist" :key="idx" @click="getRsFn(ite)">{{ite.label}}</view>
  50. </view>
  51. <uni-easyinput :disabled="isdisabled" v-model="datainfo.num" type="Number" :inputBorder='false' placeholder="输入" />
  52. <view class="rimg"><image :src="rimg"></image></view>
  53. </view>
  54. </uni-forms-item>
  55. <uni-forms-item label="来访时间" name="visitorTime">
  56. <!-- :hide-second='true' -->
  57. <view class="flexc">
  58. <uni-datetime-picker type="datetime" :disabled="isdisabled" :class="datainfo.visitorTime?'co27':'coa'" placeholder="请选择来访时间" :border="false" v-model="datainfo.visitorTime" @change="changeLog" />
  59. <view class="rimg"><image :src="rimg"></image></view>
  60. </view>
  61. <!-- <picker range-key='dictLabel' :value="vxlbidx" :range="vxlbList" @change='bindDateChangea'>
  62. <view class="flexc">
  63. <view class="flex1 txr f13 co27" v-if="datainfo.maintenanceCategory&&!vxlb">{{statusFormats(datainfo.maintenanceCategory,vxlbList,'vxlb')}}</view>
  64. <view class="flex1 txr f13" v-else :class="vxlb?'co27':'coa'">{{vxlb||"请选择来访时间"}}</view>
  65. <view class="rimg"><image :src="rimg"></image></view>
  66. </view>
  67. </picker> -->
  68. </uni-forms-item>
  69. <uni-forms-item label="来访事由" name="reason">
  70. <view class="flexc ">
  71. <view class="flex1"></view>
  72. <view class="sylist flexcc" :class="syidx==ite.dictValue?'act':''" v-for="(ite,idx) in sylist" :key="idx" @click="getSyFn(ite.dictValue)">{{ite.dictLabel}}</view>
  73. <!-- <uni-easyinput :disabled="isdisabled" v-model="datainfo.reason" :inputBorder='false' placeholder="请输入来访事由" /> -->
  74. <view class="rimg"><image :src="rimg"></image></view>
  75. <!-- <picker range-key='dictLabel' :value="syqxidx" :range="sexs" @change='bindDateChange'>
  76. <view class="rimg"><image :src="rimg"></image></view>
  77. </picker> -->
  78. </view>
  79. </uni-forms-item>
  80. <uni-forms-item label="来访门户" name="houseId">
  81. <w-select
  82. style="margin-left: 20rpx;"
  83. v-model="chooseValue"
  84. :list='fwlist'
  85. valueName='label'
  86. keyName="value"
  87. :chosevalue="datainfo.houseAddress"
  88. :filterable='filterable'
  89. @change='getchange'
  90. >
  91. </w-select>
  92. </uni-forms-item>
  93. </view>
  94. </view>
  95. <view class="cbox">
  96. <view class="chtop flexc">
  97. <view class="line"></view>
  98. <view class="atit">驾车信息</view>
  99. </view>
  100. <view class="chmain">
  101. <uni-forms-item label="是否驾车" name="isCar">
  102. <view class="flexc" @click="getChangeFn">
  103. <view class="flex1"></view>
  104. <image :src="check" v-if="datainfo.isCar=='Y'" class="checkimg"></image>
  105. <image :src="ncheck" v-else class="checkimg"></image>
  106. </view>
  107. </uni-forms-item>
  108. <uni-forms-item label="车牌号码" name="plateNumber" v-if="datainfo.isCar=='Y'">
  109. <view class="flexc">
  110. <!-- disabled -->
  111. <!-- <uni-easyinput :disabled="isdisabled" v-model="datainfo.plateNumber" :inputBorder='false' placeholder="请输入车牌号" /> -->
  112. <view class="flex1"></view>
  113. <view class="carinput-input">
  114. <view class="carinput-input-i" :class="{'input-active':carIndex == i}" @tap.stop="inputKey" :data-index="i" v-for="(v,i) in carInput" :key="i" v-if="i < 2">
  115. {{carInput[i].val}}
  116. </view>
  117. <!-- 塞个点 -->
  118. <view class="cir"></view>
  119. <view class="carinput-input-i" :class="{'input-active':carIndex == i}" @tap.stop="inputKey" :data-index="i" v-for="(v,i) in carInput" :key="i" v-if="i < 7&&i>1">
  120. {{carInput[i].val}}
  121. </view>
  122. <view class="carinput-input-i " :class="{'input-active':carIndex == 7}" @tap.stop="inputKey" data-index="7">
  123. <block v-if="carInput[7].val">{{carInput[7].val}}</block>
  124. <view v-else class="newtit flexccc">
  125. <image :src="addnew"></image>
  126. 新能源
  127. </view>
  128. <!-- {{carInput[7].val?carInput[7].val:'+新能源'}} -->
  129. </view>
  130. </view>
  131. </view>
  132. </uni-forms-item>
  133. <uni-forms-item label="手机号码" name="mobileNumber">
  134. <view class="flexc">
  135. <uni-easyinput :disabled="isdisabled" v-model="datainfo.mobileNumber" :inputBorder='false' placeholder="请输入手机号码" />
  136. <view class="rimg"></view>
  137. </view>
  138. </uni-forms-item>
  139. <view class="tips">
  140. 如驾车,填写车牌后,访客到访时,车闸机自动打开
  141. </view>
  142. </view>
  143. </view>
  144. </uni-forms>
  145. <view class="pdlr12 mt34">
  146. <view class="rhbtnw mb20" @click="getVisAdd">设为常用访客</view>
  147. <view class="rhbtn" @click="getEditFn" v-if="isdisabled">修改</view>
  148. <view class="rhbtn" @click="getSubmit" v-else>确定</view>
  149. </view>
  150. <tki-float-keyboard ref="keybd" :mode="'car'" :type="keyType" :title="'车牌键盘'" @del="keyCbDel" @val="keyCbVal" @hide="keyCbHide"></tki-float-keyboard>
  151. <loading></loading>
  152. </view>
  153. </template>
  154. <script>
  155. import config from '@/config'
  156. import {checkPermi,checkRole} from "@/utils/permission"; // 权限判断函数
  157. import {uploadIdentify,uploadmore,geocodeAddress} from '@/utils/common.js'
  158. import {reservAdd,reservDet,reservPut,cyManageList,cyManageDet,cyManageAdd,cyManagePut,cyManageDel} from "@/api/work/people.js"
  159. import {getDictionaryFn} from "@/api/system/user.js"
  160. import {houseInfolistNoPage} from "@/api/work/work.js"
  161. import wSelect from "@/work/components/w-select/w-select.vue"
  162. import tkiFloatKeyboard from "@/mine/components/tki-float-keyboard/tki-float-keyboard.vue";
  163. var key='';
  164. // #ifdef H5
  165. key='8de52b560193f01932ad997dba3e76c0'
  166. // #endif
  167. // #ifdef APP-PLUS
  168. key='8de52b560193f01932ad997dba3e76c0'
  169. // #endif
  170. // #ifdef MP-WEIXIN
  171. key='8de52b560193f01932ad997dba3e76c0'
  172. // #endif
  173. export default {
  174. components: {wSelect,tkiFloatKeyboard},
  175. data() {
  176. return {
  177. rimg: require('@/static/images/rimg.png'),
  178. aphoto: require('@/work/static/visitor/aphoto.png'),
  179. upimg: require('@/work/static/manage/up.png'),
  180. addimg: require('@/work/static/manage/add.png'),
  181. delimg: require('@/mine/static/house/del.png'),
  182. check: require('@/mine/static/check.png'),
  183. ncheck: require('@/mine/static/ncheck.png'),
  184. baseUrl: config.baseUrl,
  185. checkflag:true,
  186. delflag:false,
  187. datainfo: {
  188. // "visitorManageId":"",//来访主键
  189. "houseId":"",//门户id
  190. "houseAddress":"",//门牌号
  191. "name":"",//访客姓名
  192. "num":"",//来访人数
  193. "reason":"",//来访事由
  194. "mobileNumber":"",//手机号码
  195. "isCar":"N",//是否驾车 N:否 Y:是
  196. "plateNumber":"",//车牌号码
  197. // "reserveTime":"",//预约时间
  198. "visitorTime":"",//来访时间
  199. // "status":"",//状态 1:预约成功 2:已来访 3:已过期
  200. // "photo":""//人脸信息
  201. },
  202. syqxidx:'',
  203. sexs: [{
  204. text: '男',
  205. value: 0
  206. }, {
  207. text: '女',
  208. value: 1
  209. }],
  210. rules:{name: {rules: [{required: true,errorMessage: '请输入访客姓名' }]},
  211. houseId: {rules: [{required: true,errorMessage: '请选择来访门户' }]},
  212. mobileNumber: {rules: [{required: true,errorMessage: '请输入手机号'}, {pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/,errorMessage:'请输入正确的手机号码'}]},},
  213. phofile:[],
  214. filterable:true,
  215. chooseValue:'',
  216. fwlist:[],
  217. id:'',
  218. zhanflag:false,
  219. isdisabled:false,
  220. ptype:'add',
  221. userId:this.$store.state.user.userId,
  222. syidx:'',
  223. rsidx:'',
  224. sylist:[],
  225. rslist:[{label:'1',value:'1'},{label:'2',value:'2'},{label:'3',value:'3'},{label:'4',value:'4'},{label:'5',value:'5'},{label:'6',value:'6'},{label:'7',value:'7'}],
  226. carIndex: -1,
  227. carInput: [
  228. { type: 2, val: "皖" },
  229. { type: 4, val: "A" },
  230. { type: 1, val: "" },
  231. { type: 1, val: "" },
  232. { type: 1, val: "" },
  233. { type: 1, val: "" },
  234. { type: 3, val: "" },
  235. { type: 1, val: "" }
  236. ],
  237. keyType: 0,
  238. isPower: false, // 新能源
  239. addnew:require('@/mine/static/house/add.png'),
  240. visitList:[],//常用访客
  241. }
  242. },
  243. onLoad: function(e) {
  244. if(e.id){
  245. this.id=e.id;
  246. this.ptype="edit";
  247. // this.isdisabled=true;
  248. this.getDetail()
  249. }
  250. this.init()
  251. this.getcyManageList()
  252. if(this.ptype=='add'){
  253. this.time()
  254. }
  255. },
  256. methods: {
  257. checkPermi,
  258. checkRole,
  259. getEditFn(){
  260. this.isdisabled=false;
  261. },
  262. changeLog(){
  263. },
  264. kaType(data, list) {
  265. return selectDictValue(list, data);
  266. },
  267. async getLocation(address) {
  268. var that=this;
  269. if (!address) {
  270. uni.showToast({ title: '请输入地址', icon: 'none' });
  271. return;
  272. }
  273. try {
  274. const { latitude, longitude } = await geocodeAddress(address, key);
  275. this.datainfo.lat=latitude;
  276. this.datainfo.lgt=longitude;
  277. } catch (error) {
  278. // uni.showToast({ title: '获取经纬度失败', icon: 'none' });
  279. }
  280. },
  281. time() {
  282. var date = new Date();
  283. var y = date.getFullYear();
  284. var m = date.getMonth() + 1;
  285. var d = date.getDate();
  286. var h = date.getHours();
  287. var min = date.getMinutes();
  288. var s = date.getSeconds();
  289. var yearStr = y + '-' + (m < 10 ? ('0' + m) : m) + '-' + (d < 10 ? ('0' + d) : d)
  290. var timeStr = (h < 10 ? ('0' + h) : h) + ':' + (min < 10 ? ('0' + min) : min) + ':' + (s < 10 ? (
  291. '0' + s) : s);
  292. var kaTime = yearStr + ' ' + timeStr;
  293. this.datainfo.visitorTime=kaTime
  294. },
  295. getSyFn(e){
  296. this.syidx=e;
  297. this.datainfo.reason=e;
  298. },
  299. getRsFn(e){
  300. this.rsidx=e.value;
  301. this.datainfo.num=e.label;
  302. },
  303. getcyManageList(){
  304. var params={
  305. userId:this.userId,
  306. pageSize: 100,
  307. pageNum: 1,
  308. }
  309. cyManageList(params).then(res=>{
  310. if(res.code==200){
  311. this.visitList=res.rows
  312. }
  313. })
  314. },
  315. init(){
  316. // 自己的房屋
  317. var params={
  318. userId:this.userId,
  319. pageSize: 100,
  320. pageNum: 1,
  321. }
  322. houseInfolistNoPage(params).then(res=>{
  323. if(res.code==200){
  324. this.fwlist= res.rows.map(v => {
  325. return {
  326. label: v.detailedAddress,
  327. value: v.houseId,
  328. location: v.location
  329. }
  330. })
  331. }
  332. })
  333. // 获取事由
  334. getDictionaryFn('visit_reason').then(res=>{
  335. if(res.code==200){
  336. this.sylist = res.data.map(v => {
  337. return {
  338. dictLabel: v.dictLabel,
  339. dictValue: v.dictValue
  340. }
  341. })
  342. }
  343. })
  344. },
  345. bindDateChange(e){
  346. var val=e.detail.value;
  347. // this.datainfo.applicationBank=this.sdyhlist[val].value;
  348. // this.applicationBank=this.sdyhlist[val].label;
  349. },
  350. getChangeFn(){
  351. if(this.isdisabled){
  352. return
  353. }
  354. if(this.datainfo.isCar=='Y'){
  355. this.datainfo.isCar='N'
  356. }else{
  357. this.datainfo.isCar='Y'
  358. }
  359. },
  360. getDetail(){
  361. reservDet(this.id).then(res=>{
  362. if(res.code==200){
  363. this.datainfo=res.data;
  364. this.chooseValue=res.data.houseId
  365. }
  366. })
  367. },
  368. // 常用访客
  369. getVisAdd(){
  370. var params=JSON.parse(JSON.stringify(this.datainfo))
  371. if(params.frequentlyVisitorManageId){
  372. cyManagePut(params).then(res=>{
  373. if(res.code==200){
  374. this.$toast('操作成功')
  375. // this.getcyManageList()
  376. }
  377. })
  378. }else{
  379. cyManageAdd(params).then(res=>{
  380. if(res.code==200){
  381. this.$toast('添加成功')
  382. this.getcyManageList()
  383. }
  384. })
  385. }
  386. },
  387. getcyvisEdit(ite){
  388. this.datainfo=JSON.parse(JSON.stringify(ite))
  389. this.syidx=ite.reason
  390. },
  391. getcyvisDel(id,idx){
  392. cyManageDel(id).then(res=>{
  393. if(res.code==200){
  394. this.visitList.splice(idx,1)
  395. if(this.visitList.length<1){
  396. this.delflag=false;
  397. }
  398. var visid=this.datainfo.frequentlyVisitorManageId
  399. if(id==visid){
  400. this.datainfo.frequentlyVisitorManageId=''
  401. }
  402. }
  403. })
  404. },
  405. getSubmit(){
  406. var num=this.toBind()
  407. this.$refs.form.validate().then(res => {
  408. var params=JSON.parse(JSON.stringify(this.datainfo))
  409. if(!params.houseId){
  410. this.$toast("请选择来访门户")
  411. return
  412. }
  413. if(!params.visitorTime){
  414. this.$toast("请选择来访时间")
  415. return
  416. }
  417. if(params.isCar=='Y'&&!params.plateNumber){
  418. this.$toast("请输入车牌号")
  419. return
  420. }
  421. if(params.isCar!='Y'){
  422. params.plateNumber=''
  423. }else{
  424. if(num=='-1'){
  425. this.$toast('请输入完整的车牌号')
  426. return
  427. }
  428. }
  429. if(this.ptype=='add'){
  430. reservAdd(params).then(res=>{
  431. if(res.code==200){
  432. this.$toast("新增成功")
  433. setTimeout(function(){
  434. // uni.$emit("refComelist")
  435. uni.navigateBack({
  436. delta:1
  437. })
  438. },1500)
  439. }
  440. })
  441. }else{
  442. reservPut(params).then(res=>{
  443. if(res.code==200){
  444. this.$toast("修改成功")
  445. setTimeout(function(){
  446. // uni.$emit("refComelist")
  447. uni.navigateBack({
  448. delta:1
  449. })
  450. },1500)
  451. }
  452. })
  453. }
  454. })
  455. },
  456. getchange(e){
  457. this.datainfo.houseId=e.value;
  458. this.datainfo.houseAddress=e.label;
  459. this.datainfo.detailAddress=e.location;
  460. this.getLocation(e.location)
  461. },
  462. getaddImage(e) {
  463. let that = this;
  464. let file = [],
  465. count = 9
  466. uni.chooseImage({
  467. success: function(res) {
  468. let img = res.tempFilePaths;
  469. if (img.length + file.length > count) {
  470. uni.showToast({
  471. title: '最多上传' + count + '张图片',
  472. icon: 'none',
  473. duration: 2000
  474. })
  475. } else {
  476. let imglen = res.tempFilePaths.length;
  477. var fuwufile = [];
  478. uploadmore('/common/upload', img, 0, 0, 0, imglen, fuwufile, function(rs) {
  479. that.phofile = that.phofile.concat(rs);
  480. })
  481. }
  482. }
  483. });
  484. },
  485. // 车牌
  486. // 判定是否为空
  487. empty(v) {
  488. let tp = typeof v,
  489. rt = false;
  490. if (tp == "number" && String(v) == "") {
  491. rt = true
  492. } else if (tp == "undefined") {
  493. rt = true
  494. } else if (tp == "object") {
  495. if (JSON.stringify(v) == "{}" || JSON.stringify(v) == "[]" || v == null) rt = true
  496. } else if (tp == "string") {
  497. if (v == "" || v == "undefined" || v == "null" || v == "{}" || v == "[]") rt = true
  498. } else if (tp == "function") {
  499. rt = false
  500. }
  501. return rt
  502. },
  503. inputKey(e) {
  504. let that = this;
  505. let data = e.currentTarget.dataset;
  506. that.carIndex = data.index;
  507. if (data.index >= 7) {
  508. that.isPower=true;
  509. that.carIndex = 7;
  510. // if (!that.isPower) {
  511. // return false;
  512. // } else {
  513. // that.carIndex = 7;
  514. // }
  515. } else {
  516. that.carIndex = data.index;
  517. }
  518. that.upKeyType();
  519. that.keyShow();
  520. },
  521. keyCbVal(e) {
  522. let that = this;
  523. let index = Number(that.carIndex);
  524. if (index >= 0 && index < 6) {
  525. that.carInput[index].val = e;
  526. that.carIndex = index + 1;
  527. } else if (index == 6) {
  528. that.carInput[index].val = e;
  529. if (that.isPower) {
  530. // 新能源
  531. that.carIndex = 7;
  532. } else {
  533. // 不是新能源出输入结束
  534. that.keyHide();
  535. that.carIndex = -2;
  536. console.log('非新能源车输入完毕')
  537. }
  538. } else if (index == 7) {
  539. // 新能源车输入完毕
  540. that.carInput[index].val = e;
  541. that.keyHide();
  542. that.carIndex = -3;
  543. console.log('新能源车输入完毕')
  544. }
  545. that.upKeyType();
  546. },
  547. keyCbDel(e) {
  548. let index = this.carIndex;
  549. console.log(index,1)
  550. if (index > 0) {
  551. if (!this.empty(this.carInput[index].val)) {
  552. this.carInput[index].val = "";
  553. this.carIndex = index;
  554. } else {
  555. this.carInput[index - 1].val = "";
  556. this.carIndex = index - 1;
  557. }
  558. if(index==7){
  559. var obj={ type: 1, val: "" }
  560. this.carInput.splice(index,1,obj)
  561. this.isPower=false;
  562. }
  563. console.log(this.carInput)
  564. }
  565. this.upKeyType();
  566. },
  567. upKeyType() {
  568. if (!this.empty(this.carInput[this.carIndex])) {
  569. this.keyType = this.carInput[this.carIndex].type;
  570. }
  571. },
  572. keyShow() {
  573. this.$refs.keybd._keyShow();
  574. },
  575. keyHide() {
  576. this.$refs.keybd._keyHide();
  577. },
  578. keyCbHide() {
  579. if (this.carIndex != -3 || this.carIndex != -2) {
  580. this.carIndex = -1;
  581. }
  582. },
  583. powerChange(e) {
  584. let that = this
  585. let i = that.checkCar().i
  586. if (e.detail.value.length > 0) {
  587. that.isPower = true;
  588. if (i == -1) {
  589. that.carIndex = 7;
  590. } else {
  591. that.carIndex = i;
  592. }
  593. that.keyShow();
  594. } else {
  595. that.isPower = false;
  596. that.carInput[7].val = "";
  597. if (that.carIndex == 7) {
  598. that.keyHide();
  599. that.carIndex = -2;
  600. }
  601. }
  602. that.upKeyType();
  603. },
  604. checkCar() {
  605. // 检查车牌是否输入完成
  606. let that = this;
  607. let i = 7;
  608. let rt = { i: -1, isempty: false, val: "" };
  609. if (that.isPower) {
  610. i = 8;
  611. }
  612. for (let index = 0; index < i; index++) {
  613. const obj = that.carInput[index];
  614. if (this.empty(String(obj.val))) {
  615. rt.i = index;
  616. rt.isempty = true;
  617. rt.val = "";
  618. break;
  619. }
  620. rt.val += that.carInput[index].val;
  621. }
  622. return rt;
  623. },
  624. toBind() {
  625. let that = this
  626. let ck = that.checkCar();
  627. if (ck.i == -1 && !ck.isempty) {
  628. that.datainfo.plateNumber=ck.val;
  629. // if(this.isPower){
  630. // this.datainfo.vehicleEnergy='新能源'
  631. // }else{
  632. // this.datainfo.vehicleEnergy='燃油车'
  633. // }
  634. return ck.val
  635. } else {
  636. // 显示键盘输入
  637. // that.keyShow();
  638. // that.carIndex = ck.i;
  639. // that.keyType = that.carInput[ck.i].type;
  640. return '-1'
  641. }
  642. },
  643. //分解车牌
  644. toCarCode(code){
  645. var list=JSON.parse(JSON.stringify(this.carInput))
  646. var newArr=[]
  647. if(code){
  648. newArr=code.split('')
  649. }
  650. list.forEach((ite,idx)=>{
  651. ite.val=newArr[idx]
  652. })
  653. if(newArr.length==8){
  654. this.isPower=true;
  655. }
  656. this.carInput=JSON.parse(JSON.stringify(list))
  657. }
  658. }
  659. }
  660. </script>
  661. <style>
  662. page{background: #F3F3F0;}
  663. </style>
  664. <style lang="scss" scoped>
  665. .carinput-input{display: flex;justify-content: center;align-items: center;
  666. .input-active {color: #0256FD;border: 2rpx solid #0256FD;}
  667. .cir{width: 14rpx;height: 14rpx;background: #8D8D8D;border-radius: 50%;margin-right: 4rpx;}
  668. }
  669. .carinput-input-i{width: 52rpx;height: 80rpx;background: #F5F4F7;border-radius: 10rpx;font-weight: bold;font-size: 26rpx;color: #272727;margin-right: 4rpx;text-align: center;box-sizing: border-box;display: flex;flex-direction: column;align-items: center;justify-content: center;
  670. .newtit{
  671. font-weight: bold;font-size: 16rpx;color: #0256FD;
  672. image{width: 20rpx;height: 20rpx;margin-bottom: 4rpx;}
  673. }
  674. }
  675. .check /deep/ .uni-date-editor--x__disabled{opacity: 1;}
  676. .carinput-input-i:nth-last-child(1) {margin-right: 0}
  677. .coa /deep/ .uni-date__x-input{text-align: right;color: #AAAAAA;}
  678. .check /deep/ .select-wrap{border: none;width: 100%;}
  679. .check /deep/ .uni-forms-item{min-height: 106rpx;box-sizing: border-box;display: flex;align-items: center;margin-bottom: 0;border-bottom: 2rpx solid #E6E6E6;padding:10rpx 0;}
  680. .check .cbox /deep/ .uni-forms-item:last-child{border: none;}
  681. .check /deep/ .uni-forms-item__label{font-weight: bold;font-size: 26rpx;color: #222327;flex: 0 0 auto;width: auto !important;}
  682. .check /deep/ .uni-easyinput{flex: 1;text-align: right;font-size: 26rpx;color: #222327;}
  683. .check /deep/ .uni-easyinput__content-textarea{min-height: 40rpx;font-size: 26rpx;}
  684. .check /deep/ .uni-easyinput__placeholder-class{font-size: 26rpx;color: #AAAAAA;}
  685. .check /deep/ .uni-input-input{font-size: 26rpx;}
  686. .check /deep/ .uni-textarea-textarea{font-size: 26rpx;}
  687. .check /deep/ .is-disabled{color: #222327;background-color: #ffffff !important;}
  688. .check /deep/ .uni-data-checklist .checklist-group .checklist-box{margin:10rpx 8rpx 10rpx 16rpx;}
  689. .check /deep/ .uni-data-checklist{flex: 0 0 auto;}
  690. .check{min-height: 100vh;padding: 20rpx 18rpx 24rpx;box-sizing: border-box;}
  691. .cbox{background: #FFFFFF;border-radius: 20rpx;flex: 1;margin-bottom: 24rpx;
  692. .chtop{padding-top: 32rpx;margin-bottom: 8rpx;
  693. // image{width: 14rpx;height: 48rpx;margin-right: 20rpx;}
  694. .atit{font-weight: bold;font-size: 32rpx;color: #272727;}
  695. .upimg{width: 22rpx;height: 14rpx;margin-right: 36rpx;transform: rotate(180deg);transition: all 0.3s;
  696. &.act{transform: rotate(0deg);}
  697. }
  698. }
  699. .chmain{
  700. padding: 0 32rpx;
  701. .upbox{height: 224rpx;background: #EFF4FF;border-radius: 20rpx;display: flex;align-items: center;justify-content: center;flex-direction: column;margin-bottom: 8rpx;overflow: auto;
  702. .img{width: 100%;height: 100%;}
  703. .addimg{width: 70rpx;height: 70rpx;margin-bottom: 16rpx;}
  704. view{font-weight: bold;font-size: 26rpx;color: #4C6686;}
  705. }
  706. .rimg{width: 16rpx;height: 28rpx;flex: 0 0 auto;margin-left: 20rpx;
  707. image{width: 100%;height: 100%;}
  708. }
  709. .checkimg{width: 80rpx;height: 40rpx;margin-right: 8rpx;}
  710. .aphoto{padding: 0 24rpx;border-left: 2rpx solid #e6e6e6;margin-left: 26rpx;
  711. image{width: 40rpx;height: 38rpx;}
  712. }
  713. }
  714. .peobox{padding:24rpx 16rpx 0;
  715. .plists{position: relative;background: #EEF4FF;position: relative;
  716. border-radius: 50%;width: 94rpx;height: 94rpx;margin: 0 20rpx 20rpx;padding: 4rpx;box-sizing: border-box;
  717. .tit{font-weight: 500;font-size: 22rpx;color: #0256FD;}
  718. .addimg{width: 36rpx;height: 36rpx;background: #FFFFFF;box-shadow: 0px 3px 5px 0px rgba(147,147,147,0.35);border-radius: 50%;position: absolute;bottom: -4rpx;right: 4rpx;
  719. .imga{width: 18rpx;height: 18rpx;}
  720. .imgb{width: 26rpx;height: 26rpx;}
  721. }
  722. }
  723. }
  724. }
  725. .libox{
  726. &.rslist{
  727. .sylist{min-width:40rpx;height: 40rpx;margin-left: 14rpx;}
  728. }
  729. }
  730. .sylist{background: #F0F0F0;border-radius: 26rpx;border:2rpx solid #DADADA;margin-left: 26rpx;font-weight: 500;min-width:112rpx;height: 54rpx;box-sizing: border-box;
  731. font-size: 26rpx;
  732. color: #666666;
  733. &.act{border: 2rpx solid #0256FD;background: #DCE8FF;color: #0256FD;}
  734. }
  735. .line{width: 14rpx;height: 48rpx;background: #0256FD;border-radius:0 12rpx 12rpx 0;margin-right: 18rpx;}
  736. .tips{font-weight: 500;font-size: 22rpx;color: #0256FD;padding: 20rpx 0;}
  737. .btntit{font-size: 26rpx;color: #FF6969;margin-left: 20rpx;
  738. &.bttita{color: #0256fd;}
  739. }
  740. </style>