Commit 6f85768f by cwq0219

修改

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