物业之前,新工作台
This commit is contained in:
@@ -79,7 +79,7 @@
|
||||
<el-col :span="24">
|
||||
<el-form-item label="持有人">
|
||||
<!-- 公共组件 持有人 -->
|
||||
<Holder :userid="String(form.residentId)" @change="handleChange"></Holder>
|
||||
<Holder :userid="form.residentId" @change="handleChange"></Holder>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@@ -121,6 +121,7 @@ const form = ref({
|
||||
id: null,
|
||||
areaId: null, // 区域id
|
||||
residentId: null, // 车位id
|
||||
villageId: Number(localStorage.getItem('villageid')), // 小区id
|
||||
parkingId: null, // 持有人id
|
||||
carNum: '', //车牌号
|
||||
carBrand: '', //车辆品牌
|
||||
@@ -175,7 +176,6 @@ const carArealist = ref([]);
|
||||
const parkinglist = ref([]);
|
||||
function init() {
|
||||
listArea().then((res) => {
|
||||
console.log(res);
|
||||
carArealist.value = res.rows;
|
||||
});
|
||||
}
|
||||
@@ -193,13 +193,11 @@ if (route.query.id) {
|
||||
}
|
||||
|
||||
function changeArealist(val: string) {
|
||||
console.log(val, typeof val);
|
||||
listParking({
|
||||
areaId: val,
|
||||
pageSize: 9999999,
|
||||
pageNum: 1
|
||||
}).then((res) => {
|
||||
console.log(res);
|
||||
parkinglist.value = res.rows;
|
||||
});
|
||||
}
|
||||
@@ -209,17 +207,14 @@ function changeArealist(val: string) {
|
||||
const submitForm = () => {
|
||||
formRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
console.log(form.value);
|
||||
form.value.villageId = Number(localStorage.getItem('villageid'));
|
||||
if (userid.value.trim() !== '') {
|
||||
console.log('edit');
|
||||
updateCar(form.value).then((res) => {
|
||||
updateCar(form.value).then(() => {
|
||||
ElMessage.success('编辑成功');
|
||||
cancelForm();
|
||||
});
|
||||
} else {
|
||||
console.log('add');
|
||||
addCar(form.value).then((res) => {
|
||||
console.log(res);
|
||||
addCar(form.value).then(() => {
|
||||
ElMessage.success('添加成功');
|
||||
cancelForm();
|
||||
});
|
||||
|
||||
@@ -109,6 +109,7 @@ const data = reactive<PageData<CarForm, CarQuery>>({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
villageId: Number(localStorage.getItem('villageid')),
|
||||
areaId: undefined,
|
||||
parkingId: undefined,
|
||||
residentId: undefined,
|
||||
@@ -129,7 +130,9 @@ const { queryParams, form, rules } = toRefs(data);
|
||||
/** 持有人 */
|
||||
const ResidentList = ref([]);
|
||||
const getResidentName = (id: string | number) => {
|
||||
const find = ResidentList.value.find((item) => item.id === id);
|
||||
console.log(ResidentList.value, id);
|
||||
const find = ResidentList.value.find((item) => item.id == id);
|
||||
console.log(find);
|
||||
return find.name;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user