Commit 6f85768f by cwq0219

修改

1 parent 10753c5a
......@@ -140,14 +140,14 @@ export default {
this.baseData.station = data
},
loadingGetList () {
loadingGetList() {
this.tableLoading = true
this.getList()
},
getParams () {
var time = [{attr: 'startTime', addTime: '00:00:00'}, {attr: 'endTime', addTime: '23:59:59'}]
this.searchForm.reportTime && this.searchForm.reportTime.map((value, i) => this.searchForm[time[i].attr] = value + ' ' + time[i].addTime)
getParams() {
var time = [{ attr: 'startTime', addTime: '00:00:00' }, { attr: 'endTime', addTime: '23:59:59' }]
this.searchForm.reportTime && this.searchForm.reportTime.map((value, i) => { this.searchForm[time[i].attr] = value + ' ' + time[i].addTime })
return {
pageCount: this.pageSize,
pageSize: this.currentPage,
......@@ -155,7 +155,7 @@ export default {
}
},
getList () {
getList() {
const params = this.getParams()
delete params.reportTime
getLogsApi(params).then(res => {
......
<!-- 新增/编辑车辆弹窗 -->
<template>
<div>
<div class="trafficEditDialog">
<el-dialog
:title="title"
:visible.sync="isVisible"
......@@ -19,6 +19,7 @@
:disabled="disabled"
v-model="editForm.trafficCode"
placeholder="请输入车辆编号"
maxlength="4"
clearable
></el-input>
</el-form-item>
......@@ -63,6 +64,7 @@ export default {
rules: {
trafficCode: [
{ required: true, message: '请输入车辆编号', trigger: 'blur' },
{ required: true, message: '车辆编号需输入4位数字', trigger: 'change', validator: this.isNum },
{ required: true, message: '车辆编号已存在', trigger: 'blur', validator: this.isCodeExist }
],
stationCode: [
......@@ -99,12 +101,17 @@ export default {
methods: {
async isCodeExist(rule, value, callback) {
if(!this.editForm.id) {
if (!this.editForm.id) {
const res = await isExistApi({ trafficCode: value })
res.trafficCode ? callback(new Error(rule.message)) : callback()
}
},
isNum(rule, value, callback) {
const regNum = /^[\d]{4,4}$/
regNum.test(value) ? callback() : callback(new Error(rule.message))
},
handleClose() {
this.$emit('closeDialog')
},
......@@ -120,5 +127,10 @@ export default {
}
</script>
<style scoped>
<style>
/* .trafficEditDialog input::-webkit-outer-spin-button,
.trafficEditDialog input::-webkit-inner-spin-button {
-webkit-appearance: none;
margin: 0;
} */
</style>
......@@ -36,8 +36,6 @@
<el-col :span="12">车辆列表</el-col>
<el-col :span="12" style="text-align: right">
<auth-button category="Button" :data="editFormReset"></auth-button>
<!-- <el-button @click="handleEdit(editFormReset)">添加车辆</el-button> -->
<!-- <auth-button label="添加车辆" type="" @e-auth-click="handleEdit(editFormReset)"></auth-button> -->
</el-col>
</el-row>
<el-table
......@@ -75,14 +73,6 @@
>
<template slot-scope="scope">
<auth-button :data="scope.row"></auth-button>
<!-- <auth-button
label="编辑"
@e-auth-click="handleEdit(scope.row, scope.$index)"
></auth-button>
<auth-button
label="删除"
@e-auth-click="handleDelete(scope.$index, scope.row)"
></auth-button> -->
</template>
</el-table-column>
</el-table>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!