绿植管理
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
import {computed, reactive, ref} from 'vue';
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
import { $t } from '@vben/locales';
|
||||
import { cloneDeep } from '@vben/utils';
|
||||
@@ -7,6 +7,7 @@ import { useVbenForm } from '#/adapter/form';
|
||||
import { orderChargeAdd, orderChargeInfo, orderChargeUpdate } from '#/api/property/chargeManagement';
|
||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||
import { modalSchema } from './data';
|
||||
import QueryUserList from "#/views/property/greenPlantRentalManagement/chargeManagement/query-user-list.vue";
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
const isUpdate = ref(false);
|
||||
@@ -65,6 +66,11 @@ async function handleConfirm() {
|
||||
return;
|
||||
}
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
if (userInfo) {
|
||||
console.log(userInfo);
|
||||
data.userId = userInfo.value
|
||||
data.userName = userInfo.userName
|
||||
}
|
||||
await (isUpdate.value ? orderChargeUpdate(data) : orderChargeAdd(data));
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
@@ -75,7 +81,15 @@ async function handleConfirm() {
|
||||
modalApi.lock(false);
|
||||
}
|
||||
}
|
||||
|
||||
let userInfo = reactive({
|
||||
value:'',
|
||||
userId: '',
|
||||
userName: '',
|
||||
});
|
||||
const userName = ref<number | string>('');
|
||||
function getUserInfo(user: any) {
|
||||
userInfo = user;
|
||||
}
|
||||
async function handleClosed() {
|
||||
await formApi.resetForm();
|
||||
resetInitialized();
|
||||
@@ -84,7 +98,11 @@ async function handleClosed() {
|
||||
|
||||
<template>
|
||||
<BasicModal :title="title">
|
||||
<BasicForm />
|
||||
<BasicForm>
|
||||
<template #userName="slotProps">
|
||||
<QueryUserList @update:userInfo="getUserInfo" v-bind="slotProps" :isUpdate="isUpdate" :userName="userName"/>
|
||||
</template>
|
||||
</BasicForm>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
|
Reference in New Issue
Block a user