1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204 |
- <template>
- <div>
- <el-form
- ref="formDate"
- label-width="80px"
- :rules="rules"
- :model="formDate"
- >
- <div class="formContent-item_title">基本信息</div>
- <el-row>
- <el-col :span="9">
- <el-form-item
- label="名称"
- prop="userName"
- >
- <el-input
- placeholder="请输入车主名称"
- v-model="formDate.userName"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col :span="9">
- <el-form-item
- label="手机号"
- prop="tel"
- >
- <el-input
- placeholder="请输入手机号"
- v-model="formDate.tel"
- ></el-input>
- </el-form-item>
- </el-col>
- <el-col
- :span="4 "
- style="margin-left: 15px;"
- >
- <el-button
- type="primary"
- @click="personnel"
- >调取人员信息</el-button>
- </el-col>
- <el-col :span="9">
- <el-form-item label="房间">
- <el-select
- placeholder="请选择房间"
- clearable
- v-model="formDate.resDate"
- @change='formDateResDate'
- >
- <el-option
- v-for="(itemse,ix) in room"
- :key="ix"
- :label='itemse.name'
- :value='itemse.label'
- @click.native="resDate(itemse)"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="9">
- <el-form-item label="备注信息">
- <el-input
- placeholder="请输入备注信息"
- v-model="formDate.remark"
- ></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- <el-row>
- <el-col :span="9">
- <el-form-item label="车位设置">
- <el-select
- placeholder="请选择停车场"
- clearable
- v-model="formDate.parkId"
- >
- <el-option
- v-for="(item,index) in nameParkingLot"
- :key="index"
- :value="item.label"
- :label="item.name"
- @click.native="parkingLot(item.name)"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- </el-row>
- <div class="formContent-item_title">内部车信息</div>
- <el-row>
- <el-col :span="9">
- <el-form-item
- label="车牌类型"
- prop="carTypes"
- >
- <el-select
- placeholder="请选择车牌类型"
- clearable
- v-model="formDate.carTypes"
- >
- <el-option
- label="临时车"
- value="0"
- ></el-option>
- <el-option
- label="VIP车"
- value="1"
- ></el-option>
- <el-option
- label="月租车"
- value="2"
- ></el-option>
- <el-option
- label="充值车"
- value="3"
- ></el-option>
- <el-option
- label="时租车"
- value="4"
- ></el-option>
- <el-option
- label="产权车"
- value="5"
- ></el-option>
- <el-option
- label="计次车"
- value="6"
- ></el-option>
- <el-option
- label="贵宾卡"
- value="7"
- ></el-option>
- <el-option
- label="员工卡"
- value="8"
- ></el-option>
- <el-option
- label="大客车"
- value="9"
- ></el-option>
- <el-option
- label="预约车"
- value="100"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col :span="9">
- <el-form-item
- label="充值规则"
- prop="ruleId"
- >
- <el-select
- placeholder="请选择充值规则"
- clearable
- v-model="formDate.ruleId"
- @click.native="parkingLotes"
- >
- <!-- recharge -->
- <el-option
- v-for="(itemes,indexes) in recharge"
- :key="indexes"
- :label='itemes.name'
- :value='itemes.label'
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <!-- <el-col :span="9">
- <el-form-item label="首充时间">
- <el-date-picker
- type="date"
- placeholder="首充时间"
- value-format="yyyy-MM-dd"
- :editable="false"
- @change="timeToggle"
- v-model="formDate.beginTime"
- >
- </el-date-picker>
- </el-form-item>
- </el-col> -->
- </el-row>
- <div class="formContent-item_title">
- <el-row>
- <el-col :span="2">车位设置</el-col>
- <el-col
- :span="8"
- style="margin-top: -5px;"
- >
- </el-col>
- </el-row>
- <el-row>
- <el-col-2>
- <el-button
- type="primary"
- @click="addTime"
- >新增</el-button>
- </el-col-2>
- </el-row>
- <el-table
- :data="tableData"
- border
- style="width: 100%"
- :cell-style="{'text-align':'center'}"
- >
- <el-table-column
- class="tableColumn"
- align="center"
- >
- <!-- label="可停区域" -->
- <template slot-scope="scope">
- <el-form-item
- prop="parkingArea"
- ref="againValue"
- style="float: left;"
- >
- <el-select
- placeholder="请选择"
- v-model="tableData[scope.$index].parkingArea"
- @click.native="parking"
- style="float: left;"
- >
- <el-option
- v-for="(item,index) in eloption"
- :key="index"
- :value='item.value'
- :label="item.label"
- @click.native="parked(item)"
- ></el-option>
- </el-select>
- </el-form-item>
- </template>
- </el-table-column>
- <el-table-column
- label="占用车位"
- align="center"
- >
- <el-input-number
- v-model="num"
- :disabled="true"
- ></el-input-number>
- </el-table-column>
- <el-table-column
- label="位置信息"
- align="center"
- >
- <template slot-scope="scope">
- <el-input
- v-model="tableData[scope.$index].positionInformation"
- @click.native="positionInformation(scope.$index)"
- placeholder="请选择车位"
- ></el-input>
- </template>
- </el-table-column>
- <el-table-column
- label="操作"
- align="center"
- width="100"
- >
- <template slot-scope="scope">
- <el-tooltip
- class="item"
- effect="light"
- placement="bottom"
- content="删除"
- >
- <i
- class="zoniot_font zoniot-icon-shanchu redText"
- @click="deleteUserByUserName(scope.$index)"
- ></i>
- </el-tooltip>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <div class="formContent-item_title">
- <el-row>
- <el-col :span="2">车位设置</el-col>
- </el-row>
- <el-row>
- <el-col-2>
- <el-button
- type="primary"
- @click="addTimes"
- >新增</el-button>
- </el-col-2>
- </el-row>
- <el-table
- :data="parkingSpaceSetting"
- border
- style="width: 100%"
- :cell-style="{'text-align':'center'}"
- >
- <el-table-column
- align="center"
- width="230"
- >
- <template slot-scope="scope">
- <el-col
- :span="10"
- style="float: left;"
- >
- <el-form-item
- prop="againInput"
- ref="againInput"
- >
- <el-select v-model="parkingSpaceSetting[scope.$index].licensePlate">
- <el-option
- v-for="(item,index) in beforelicense"
- :key="index"
- :value='item.label'
- :label="item.label"
- @click.native="license"
- ></el-option>
- </el-select>
- </el-form-item>
- </el-col>
- <el-col
- :span="12"
- style="float: left;"
- >
- <!-- <el-form-item
- prop="againInput"
- ref="againInput"
- > -->
- <!-- <input ref="searchInput" v-focus>
- -->
- <el-form-item
- prop="againLicense"
- ref="againLicense"
- >
- <el-input
- placeholder="车牌号"
- v-model="parkingSpaceSetting[scope.$index].license"
- clearable
- ref="searchInput"
- @input="parkingSpace()"
- @blur="Setting()"
- >
- </el-input>
- </el-form-item>
- <!-- </el-form-item> -->
- </el-col>
- </template>
- </el-table-column>
- <el-table-column
- label="进出凭据(卡号/ETC/扫码)"
- align="center"
- width="230"
- >
- <template slot-scope="scope">
- <el-input
- placeholder="进出凭据"
- v-model="parkingSpaceSetting[scope.$index].accessCredentials"
- clearable
- >
- </el-input>
- </template>
- </el-table-column>
- <el-table-column
- label="状态"
- align="center"
- ><template slot-scope="scope">
- <el-select v-model="parkingSpaceSetting[scope.$index].state">
- <el-option
- label="启用"
- value="1"
- ></el-option>
- <el-option
- label="禁用"
- value="2"
- ></el-option>
- </el-select>
- </template>
- </el-table-column>
- <el-table-column
- label="备注"
- align="center"
- >
- <template slot-scope="scope">
- <el-input
- placeholder="备注"
- v-model="parkingSpaceSetting[scope.$index].remarks"
- clearable
- >
- </el-input>
- </template>
- </el-table-column>
- <el-table-column
- label="操作"
- align="center"
- >
- <template slot-scope="scope">
- <el-tooltip
- class="item"
- effect="light"
- placement="bottom"
- content="删除"
- >
- <i
- class="zoniot_font zoniot-icon-shanchu redText"
- @click="defult(scope.$index)"
- ></i>
- </el-tooltip>
- <el-tooltip
- class="item"
- effect="light"
- placement="bottom"
- content="编辑"
- >
- <span>
- <img
- src="../../../assets/img/btn_peizhi.png"
- alt=""
- style="width: 15px; height: 13px; margin-left: 10px; cursor: pointer;"
- @click="addEdit(scope.$index)"
- >
- </span>
- </el-tooltip>
- </template>
- </el-table-column>
- </el-table>
- </div>
- </el-form>
- <!-- </el-form> -->
- </div>
- </template>
- <script>
- import { parse } from 'path';
- import native from './native.vue'
- import configure from './configure.vue';
- export default {
- props: ['params', configure],
- data () {
- return {
- url: '',
- areaNamed: [],
- formDate: {
- userName: '',
- // tel: '17688920088',
- tel: '',
- residentId: '',
- resDate: '',
- remark: '',
- carType: '',
- carTypes: '',
- ruleId: '',
- beginTime: '',
- parkId: '',
- id: '',
- sort: '',
- areaName: '',
- idName: '',
- res: '',
- // 校验
- parking: false,
- parkingArea: '',
- againInput: '',
- againLicense: ''
- },
- tableData: [
- {
- parkingArea: '',
- positionInformation: '',
- areaName: '',
- parkingId: '',
- },
- ],
- parkingSpaceSetting: [
- {
- licensePlate: '',
- license: '',
- accessCredentials: '',
- state: '1',
- remarks: ''
- }
- ],
- eloption: [],
- num: '1',
- // parkingArea: '',//可停区域
- beforelicense: [
- {
- value: '1',
- label: '京'
- },
- {
- value: '2',
- label: '津'
- },
- {
- value: '3',
- label: '冀'
- },
- {
- value: '4',
- label: '晋'
- },
- {
- value: '5',
- label: '蒙'
- },
- {
- value: '6',
- label: '辽'
- },
- {
- value: '7',
- label: '吉'
- },
- {
- value: '8',
- label: '黑'
- },
- {
- value: '9',
- label: '沪'
- },
- {
- value: '10',
- label: '苏'
- },
- {
- value: '11',
- label: '浙'
- },
- {
- value: '12',
- label: '皖'
- },
- {
- value: '13',
- label: '闽'
- },
- {
- value: '14',
- label: '赣'
- },
- {
- value: '15',
- label: '鲁'
- },
- {
- value: '16',
- label: '豫'
- },
- {
- value: '17',
- label: '鄂'
- },
- {
- value: '18',
- label: '湘'
- },
- {
- value: '19',
- label: '粤'
- },
- {
- value: '20',
- label: '桂'
- },
- {
- value: '21',
- label: '琼'
- }
- ,
- {
- value: '22',
- label: '渝'
- }
- ,
- {
- value: '23',
- label: '川'
- }
- ,
- {
- value: '24',
- label: '贵'
- }
- ,
- {
- value: '25',
- label: '云'
- },
- {
- value: '26',
- label: '藏'
- },
- {
- value: '27',
- label: '陕'
- },
- {
- value: '28',
- label: '甘'
- },
- {
- value: '29',
- label: '青'
- }
- ,
- {
- value: '30',
- label: '宁'
- }
- ,
- {
- value: '31',
- label: '新'
- }
- ],
- rules: {
- userName: [
- { required: true, message: '请输入名称', trigger: 'blur' },
- ],
- tel: [
- { required: true, message: '请输入手机号', trigger: 'blur' },
- { pattern: /^(0|86|17951)?(13[0-9]|15[012356789]|17[678]|18[0-9]|14[57])[0-9]{8}$/, message: '请输入正确的电话' }
- ],
- carTypes: [
- { required: true, message: '请选择车牌类型', trigger: 'change' }
- ],
- ruleId: [
- { required: true, message: '请选择充值规则', trigger: 'change' }
- ],
- parkingArea: [
- { required: true, message: '请选择可停区域', trigger: 'change' }
- ],
- againInput: [
- { required: true, message: '请选择车牌', trigger: 'change' },
- ],
- againLicense: [
- { required: true, message: '请输入车牌号', trigger: 'change' },
- ]
- },
- room: [],
- nameParkingLot: [],
- nameParkingLotName: '',
- form: [
- {
- vehicleType: '',
- vehicleColor: '',
- vehicleColors: '',
- vehicleBrand: ''
- }
- ],
- fullCarNoStr: '',
- plateNoInfo: [],
- // 充值规则
- recharge: []
- };
- },
- methods: {
- // 车牌号
- // @input="parkingSpace()"
- // @blur="Setting()"
- parkingSpace () {
- // parkingSpaceSetting[scope.$index].license
- for (let i = 0; i < this.parkingSpaceSetting.length; i++) {
- console.log(this.parkingSpaceSetting[i].license);
- if (this.parkingSpaceSetting[i].license.length == 0) {
- this.formDate.againLicense = ''
- this.rules.againLicense[0].required = !this.formDate.parking;
- } else {
- this.formDate.againLicense = '验证'
- this.rules.againLicense[0].required = this.formDate.parking;
- this.clearValidate('againLicense');
- }
- }
- },
- Setting () {
- for (let i = 0; i < this.parkingSpaceSetting.length; i++) {
- console.log(this.parkingSpaceSetting[i].license);
- if (this.parkingSpaceSetting[i].license.length == 0) {
- this.formDate.againLicense = ''
- this.rules.againLicense[0].required = !this.formDate.parking;
- } else {
- this.formDate.againLicense = '验证'
- this.rules.againLicense[0].required = this.formDate.parking;
- this.clearValidate('againLicense');
- }
- }
- },
- clearValidate (formName) {
- this.$refs[formName].clearValidate();
- },
- resDate (val) {
- debugger
- this.formDate.resDate = val.label;
- this.formDate.id = val.residentId;
- this.formDate.idName = val.name;
- },
- parked (item) {
- this.areaNamed.push(item.label);
- this.formDate.sort = item.startDate;
- if (this.rules.parkingArea[0].required == true && this.formDate.parkingArea == '') {
- this.formDate.parkingArea = '验证'
- this.rules.parkingArea[0].required = this.formDate.parking;
- this.clearValidate('againValue');
- }
- },
- licenseVerification () {
- if (this.rules.againInput[0].required == true && this.formDate.againInput == '') {
- this.formDate.againInput = '验证'
- this.rules.againInput[0].required = this.formDate.parking;
- this.clearValidate('againInput');
- this.$refs.searchInput.focus();
- }
- },
- license () {
- this.licenseVerification();
- },
- // 充值规则
- rechargeRules () {
- this.recharge = []
- this.$http
- .get('/sc-community-web/parkingCar/queryRechargeRules', {
- carType: this.formDate.carTypes == '临时车' ? '0' :
- this.formDate.carTypes == 'VIP车' ? '1' :
- this.formDate.carTypes == '月租车' ? '2' :
- this.formDate.carTypes == '充时车' ? '3' :
- this.formDate.carTypes == '时租车' ? '4' :
- this.formDate.carTypes == '产权车' ? '5' :
- this.formDate.carTypes == '计次车' ? '6' :
- this.formDate.carTypes == '贵宾车' ? '7' :
- this.formDate.carTypes == '员工卡' ? '8' : this.formDate.carTypes
- , parkingId: this.formDate.parkId
- })
- .then(({ data, msg, status }) => {
- console.log('data', data);
- for (let i = 0; i < data.length; i++) {
- this.recharge.push({
- name: data[i].ruleName,
- label: data[i].ruleId
- })
- }
- })
- .catch(() => { });
- },
- parkingLotes () {
- if (this.nameParkingLotName.length == 0) {
- this.$message.error('请选择停车场');
- } else if (this.formDate.carTypes.length == 0) {
- this.$message.error('请选择车牌类型');
- } else {
- this.rechargeRules();
- }
- },
- parkingLot (name) {
- this.nameParkingLotName = name;
- },
- // 调用用户信息
- personnel () {
- if (this.formDate.tel.length == 0) {
- this.$message.error('请输入手机号码');
- } else {
- console.log(this.formDate.tel)
- this.room = [];
- this.$http
- .get('/sc-community/parkingCar/getUserInfo', { phone: this.formDate.tel })
- .then(({ data, msg, status }) => {
- for (let i = 0; i < data.houseInfos.length; i++) {
- debugger
- this.room.push({
- name: data.houseInfos[i].roomNumber,
- label: data.houseInfos[i].id,
- residentId: data.houseInfos[i].residentId,
- })
- }
- this.formDate.resDate = data.houseInfos[0].id;
- this.formDate.id = data.houseInfos[0].residentId;
- this.formDate.idName = data.houseInfos[0].roomNumber
- // if (this.room.length == 1) {
- // this.formDate.resDate = data.houseInfos[0].id;
- // this.formDate.id = data.houseInfos[0].residentId;
- // this.formDate.idName = data.houseInfos[0].roomNumber
- // }
- })
- .catch(() => { });
- }
- },
- DOMInput () {
- document.querySelectorAll('.is-center')[0].children[0].innerHTML = "<span style='width: 5px;color: #F56C6C; margin-right: 5px;'>*</span><span>可停区域</span>"
- document.querySelectorAll('.is-center')[8].children[0].innerHTML = "<span style='width: 5px;color: #F56C6C; margin-right: 5px;'>*</span><span>车牌号码</span>"
- },
- // 事件处理函数
- getMsgFormSon (data) {
- console.log('data', data);
- },
- addTime () {
- debugger
- this.tableData.push({
- parkingArea: '',
- positionInformation: ''
- })
- },
- addTimes () {
- this.parkingSpaceSetting.push({
- licensePlate: '',
- license: '',
- accessCredentials: '',
- state: '1',
- remarks: ''
- })
- },
- deleteUserByUserName (row) {
- // console.log(row)
- debugger
- if (this.tableData.length > 1) {
- this.tableData.splice(row, 1);
- }
- return;
- },
- defult (row) {
- if (this.parkingSpaceSetting.length > 1) {
- this.parkingSpaceSetting.splice(row, 1);
- }
- return;
- },
- positionInformation (id) {
- debugger
- new Promise((resolve) => {
- this.$store.dispatch('addPopup', {
- url: '/vehicleInformation/setpPage/native.vue',
- width: '500px',
- height: '400px',
- props: {
- callback: resolve,
- id: id,
- positionInformation: this.tableData[id].positionInformation,
- value: this.tableData[id].parkingId,
- },
- hideStar: true,
- title: '选择车位'
- });
- }).then((data) => {
- debugger
- var id = data[0].id;
- this.tableData[id].positionInformation = data[0].positionInformation;
- this.tableData[id].parkingId = data[0].value;
- });
- },
- timeToggle (e) {
- console.log(e);
- let start = '00:00:00',
- end = '23:59:59';
- if (!!e) {
- this.formDate.createDate = `${e} ${start}`;
- // this.mixins_query.endDate = `${e} ${end}`;
- } else {
- this.mixins_query.startDate = ``;
- // this.mixins_query.endDate = ``;
- }
- },
- addEdit (row) {
- new Promise((resolve) => {
- this.$store.dispatch('addPopup', {
- url: '/vehicleInformation/setpPage/configure.vue',
- width: '400px',
- height: '340px',
- props: {
- callback: resolve,
- id: row,
- form: this.form
- // positionInformation: this.tableData
- },
- hideStar: true,
- title: '更多配置'
- });
- }).then((data) => {
- var id = data.id;
- this.form[id].vehicleType = data.vehicleType;
- this.form[id].vehicleColor = data.vehicleColor;
- this.form[id].vehicleColors = data.vehicleColors;
- this.form[id].vehicleBrand = data.vehicleBrand;
- });
- },
- // 获取停车场名称
- nameParking () {
- this.$http.post('/sc-community-web/parkingCar/findParkInfo', { pageNum: 1, pageSize: 15 }).then(({ data, status, msg }) => {
- for (let i = 0; i < data.list.length; i++) {
- this.nameParkingLot.push({
- name: data.list[i].garageName,
- label: data.list[i].parkId
- })
- }
- })
- },
- // 获取可停区域
- parking () {
- if (this.formDate.parkId.length == 0) {
- this.$message.error('请输选择停车场');
- } else {
- // 获取可停区域
- this.region();
- }
- },
- region () {
- this.$http.post('/sc-community-web/parkingCar/findAreaInfo', { parkId: this.formDate.parkId }).then(({ data, status, msg }) => {
- this.eloption = [];
- for (let i = 0; i < data.length; i++) {
- this.eloption.push({
- label: data[i].areaName,
- value: data[i].areaCode,
- startDate: data[i].sort,
- })
- }
- });
- },
- mergeObj (arr, Obj) {
- return arr.map(item => {
- return { ...item, ...Obj }
- })
- },
- submit () {
- if (this.params.comm == 'add') {
- this.url = '/sc-community-web/parkingCar/updateVehicleInfor'
- } else {
- this.url = '/sc-community-web/parkingCar/addVehicleInfor'
- }
- this.$refs.formDate.validate((valid) => {
- console.log('valid', valid);
- if (valid) {
- var table = [];
- this.plateNoInfo = []
- console.log('333333', this.tableData);
- for (let i = 0; i < this.tableData.length; i++) {
- debugger
- this.tableData[i].areaName = (Array.from(new Set(this.areaNamed))).join(',');
- console.log(this.tableData[i]);
- table.push({
- areaId: [this.tableData[i].parkingArea],
- areaName: this.tableData[i].areaName,
- lotCount: this.num,
- lotName: this.tableData[i].positionInformation,
- parkingId: this.tableData[i].parkingId,
- // lotName: '',
- carType: '',
- ruleId: this.formDate.ruleId,
- sequence: this.formDate.sort,
- })
- this.formDate.areaName = this.tableData[i].areaName
- }
- var parkingSpace = [];
- for (let k = 0; k < this.parkingSpaceSetting.length; k++) {
- parkingSpace.push({
- carNo: this.parkingSpaceSetting[k].licensePlate + this.parkingSpaceSetting[k].license,
- cardNo: this.parkingSpaceSetting[k].accessCredentials,
- enable: this.parkingSpaceSetting[k].state == '启用' ? '1' : this.parkingSpaceSetting[k].state == '禁用' ? '2' : this.parkingSpaceSetting[k].state,
- remark: this.parkingSpaceSetting[k].remarks,
- carType: this.form[k].vehicleType,
- carNoColor: this.form[k].vehicleColor,
- carColor: this.form[k].vehicleColors,
- carBrand: this.form[k].vehicleBrand,
- });
- this.fullCarNoStr = this.parkingSpaceSetting[k].licensePlate + this.parkingSpaceSetting[k].license;
- this.plateNoInfo.push((this.parkingSpaceSetting[k].licensePlate + this.parkingSpaceSetting[k].license));
- for (let j = 0; j < table.length; j++) {
- table[j].carType = this.formDate.carType;
- }
- }
- debugger
- this.$http.post(this.url, {
- cardId: this.params.cardId != undefined ? this.params.cardId : '',
- cardName: this.formDate.userName,
- userName: this.formDate.userName,
- tel: this.formDate.tel,
- // houseId: this.formDate.residentId,
- houseId: this.formDate.resDate,
- residentId: this.formDate.id,
- // residentId: this.formDate.ruleId,
- remark: this.formDate.remark,
- cardType: this.formDate.carTypes == '临时车' ? '0' :
- this.formDate.carTypes == 'VIP车' ? '1' :
- this.formDate.carTypes == '月租车' ? '2' :
- this.formDate.carTypes == '充时车' ? '3' :
- this.formDate.carTypes == '时租车' ? '4' :
- this.formDate.carTypes == '产权车' ? '5' :
- this.formDate.carTypes == '计次车' ? '6' :
- this.formDate.carTypes == '贵宾车' ? '7' :
- this.formDate.carTypes == '员工卡' ? '8' : this.formDate.carTypes,
- beginTime: this.formDate.beginTime,
- parkId: this.formDate.parkId,
- areaName: this.formDate.areaName,
- ruleId: this.formDate.ruleId,
- idName: this.formDate.idName,
- carLotList: table,
- parkCarDetails: parkingSpace,
- fullCarNoStr: this.fullCarNoStr,
- plateNoInfo: this.plateNoInfo,
- }).then(({ data, status, msg }) => {
- if (status != 0) {
- this.$message.error(msg);
- } else if (status == 0) {
- this.$message.success('成功');
- this.params.callback();
- this.$emit('close');
- }
- })
- } else {
- return false;
- }
- })
- },
- },
- mounted: function () {
- this.$nextTick(function () {
- this.DOMInput()
- })
- },
- created () {
- // <span style="width: 5px;color: #F56C6C; float: left; margin-right: 5px;">*</span>
- this.nameParking();
- if (this.params.cardId != undefined) {
- this.formDate.parkingArea = '验证';
- this.formDate.againInput = '验证';
- this.formDate.againLicense = '验证'
- this.params.cardId;
- this.$http.get('/sc-community-web/parkingCar/getVehicleInfor', { id: this.params.cardId }).then(({ data, msg, status }) => {
- console.log(data);
- this.formDate.userName = data.userName
- this.formDate.tel = data.tel
- // this.personnel();
- // this.formDate.resDate = '1480'
- // this.formDate.resDate = '10243'
- // this.formDate.resDate = val.label;
- // this.personnel();
- this.formDate.remark = data.remark
- this.formDate.carTypes = data.cardType == 0 ? '临时车'
- : data.cardType == 1 ? 'VIP车'
- : data.cardType == 2 ? '月租车'
- : data.cardType == 3 ? '充时车'
- : data.cardType == 4 ? '时租车'
- : data.cardType == 5 ? '产权车'
- : data.cardType == 6 ? '计次车'
- : data.cardType == 7 ? '贵宾卡'
- : '员工卡'
- // this.formDate.areaName = data.areaName;
- this.nameParkingLotName = '1';//随便
- this.formDate.beginTime = data.beginTime
- this.formDate.parkId = data.parkId
- var carLotStr = JSON.parse(data.carLotStr)
- for (let i = 0; i < carLotStr.length; i++) {
- debugger
- this.formDate.areaName = carLotStr[i].areaName;
- this.tableData[i].areaName = carLotStr[i].areaName
- this.areaNamed.push(carLotStr[i].areaName);
- this.tableData[i].carType = data.cardType
- this.tableData[i].lotCount = carLotStr[i].lotCount
- this.tableData[i].positionInformation = carLotStr[i].lotName
- this.tableData[i].parkingId = carLotStr[i].parkingId
- this.formDate.ruleId = carLotStr.ruleId
- this.formDate.sort = carLotStr.sequence
- }
- for (let k = 0; k < data.parkCarDetails.length; k++) {
- this.parkingSpaceSetting[k].licensePlate = (data.fullCarNoStr).substr(0, 1)
- this.parkingSpaceSetting[k].license = (data.fullCarNoStr).substr(1)
- this.parkingSpaceSetting[k].state = data.parkCarDetails[k].enable == 1 ? '启用' : '禁用'
- this.parkingSpaceSetting[k].remarks = data.parkCarDetails[k].remark
- }
- this.personnel();
- this.rechargeRules();
- this.nameParking();
- this.region();
- // this.personnel();
- for (let i = 0; i < carLotStr.length; i++) {
- this.tableData[i].parkingArea = Number(carLotStr[i].areaId)
- this.formDate.ruleId = carLotStr[i].ruleId
- }
- for (let k = 0; k < data.parkCarDetails.length; k++) {
- this.formDate.carType = data.cardType;
- this.form[k].vehicleType = data.parkCarDetails[k].carType;
- this.form[k].vehicleColor = data.parkCarDetails[k].carNoColor
- this.form[k].vehicleColors = data.parkCarDetails[k].carColor
- this.form[k].vehicleBrand = data.parkCarDetails[k].carBrand
- }
- console.log('2222', this.tableData);
- });
- }
- }
- }
- </script >
- <style lang="scss" >
- .el-input--small .el-input__inner {
- cursor: pointer;
- }
- .el-row {
- margin: 10px !important;
- }
- tr {
- .el-form-item__content {
- margin-left: 0 !important;
- }
- }
- </style>
|