|
|
@@ -2,17 +2,22 @@
|
|
|
<div>
|
|
|
<el-form inline>
|
|
|
<el-form-item>
|
|
|
- <el-input placeholder="请输入手机号" v-model="mobilePhone">
|
|
|
- <template #append>
|
|
|
- <el-button @click="phoneCarOwnerList">搜索</el-button>
|
|
|
- </template>
|
|
|
- </el-input>
|
|
|
+ <el-input placeholder="请输入手机号" v-model="obtainData.owner_phone" />
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button icon="Plus" @click="openCarOwner('新增车主','')">新增</el-button>
|
|
|
+ <el-input placeholder="请输入车主名称" v-model="obtainData.owner_name"></el-input>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-select placeholder="是否是vip" v-model="obtainData.is_vip" @change="changeVip">
|
|
|
+ <el-option label="未成为vip" :value="false"></el-option>
|
|
|
+ <el-option label="已成为vip" :value="true"></el-option>
|
|
|
+ </el-select>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
- <el-button icon="Edit">编辑</el-button>
|
|
|
+ <el-button type="primary" icon="Search" @click="getCarOwnerList">搜索</el-button>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item>
|
|
|
+ <el-button icon="Plus" @click="openCarOwner('新增车主','')">新增</el-button>
|
|
|
</el-form-item>
|
|
|
<el-form-item>
|
|
|
<el-button icon="Delete">删除</el-button>
|
|
|
@@ -33,7 +38,7 @@
|
|
|
<el-button icon="ChatLineRound">其他</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
- <el-table :data="carOwnerList">
|
|
|
+ <el-table :data="carOwnerList" height="605">
|
|
|
<el-table-column label="名字" align="center" width="180" prop="owner_name"></el-table-column>
|
|
|
<el-table-column label="姓氏" align="center" width="180" prop="owner_surname"></el-table-column>
|
|
|
<el-table-column label="手机" align="center" prop="owner_phone"></el-table-column>
|
|
|
@@ -56,6 +61,18 @@
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
+ <div style="width: 100%;display: flex;justify-content: end">
|
|
|
+ <el-pagination
|
|
|
+ :current-page="obtainData.page"
|
|
|
+ :page-size="obtainData.pageSize"
|
|
|
+ :page-sizes="[10, 30, 50, 100]"
|
|
|
+ :total="carOwnerTotal"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ style="padding-right: 10px"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
<el-dialog v-model="carOwnerShow" :title="carOwnerTitle" width="650">
|
|
|
<el-form label-width="100" size="large">
|
|
|
<el-form-item label="名称:">
|
|
|
@@ -90,7 +107,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
-import { obtainCarOwnerList, addCarOwner, editCarOwner, removeCarOwner, carOwnerInfoPhone } from '@/api/carOwner'
|
|
|
+import { obtainCarOwnerList, addCarOwner, editCarOwner, removeCarOwner } from '@/api/carOwner'
|
|
|
import { onMounted, reactive, ref } from 'vue'
|
|
|
import { ElMessage, ElMessageBox } from 'element-plus'
|
|
|
import {deleteGuardBooth} from "@/api/guardBooth";
|
|
|
@@ -105,11 +122,36 @@ const carOwnerData = reactive({
|
|
|
is_vip: false,
|
|
|
vip_expire_time: ''
|
|
|
})
|
|
|
+const changeVip = (val) => {
|
|
|
+ obtainData.is_vip = val
|
|
|
+ getCarOwnerList()
|
|
|
+}
|
|
|
+const obtainData = reactive({
|
|
|
+ owner_name: '',
|
|
|
+ owner_phone: '',
|
|
|
+ is_vip: false,
|
|
|
+ page: 1,
|
|
|
+ pageSize: 10
|
|
|
+})
|
|
|
+
|
|
|
+const carOwnerTotal = ref(0)
|
|
|
+
|
|
|
+const handleCurrentChange = (val) => {
|
|
|
+ obtainData.page = val
|
|
|
+ getCarOwnerList()
|
|
|
+}
|
|
|
+
|
|
|
+const handleSizeChange = (val) => {
|
|
|
+ obtainData.pageSize = val
|
|
|
+ obtainData.page = 1
|
|
|
+ getCarOwnerList()
|
|
|
+}
|
|
|
const getCarOwnerList = () => {
|
|
|
- obtainCarOwnerList().then(res => {
|
|
|
+ obtainCarOwnerList(obtainData).then(res => {
|
|
|
if (res.code === 0) {
|
|
|
carOwnerList.length = 0
|
|
|
carOwnerList.push(...res.data.list)
|
|
|
+ carOwnerTotal.value = res.data.total
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
@@ -191,16 +233,6 @@ const carOwnerOperation = async () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const mobilePhone = ref('')
|
|
|
-
|
|
|
-const phoneCarOwnerList = () => {
|
|
|
- carOwnerInfoPhone(mobilePhone.value).then(res => {
|
|
|
- if (res.code === 0) {
|
|
|
- carOwnerList.length = 0
|
|
|
- carOwnerList.push(...res.data)
|
|
|
- }
|
|
|
- })
|
|
|
-}
|
|
|
onMounted(() => {
|
|
|
getCarOwnerList()
|
|
|
})
|