Compare commits
2 Commits
63c3a8b550
...
4bf741f63d
Author | SHA1 | Date | |
---|---|---|---|
4bf741f63d | |||
4b3d075266 |
@ -2,7 +2,7 @@ import type { FormSchemaGetter } from '#/adapter/form';
|
||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
import { getDictOptions } from '#/utils/dict';
|
||||
import { renderDict } from '#/utils/render';
|
||||
import {orderChargeList} from "#/api/property/chargeManagement";
|
||||
import {rentalOrderList} from "#/api/property/rentalOrder";
|
||||
|
||||
export const querySchema: FormSchemaGetter = () => [
|
||||
{
|
||||
@ -151,28 +151,35 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
triggerFields: [''],
|
||||
},
|
||||
},
|
||||
// {
|
||||
// label: '订单号',
|
||||
// fieldName: 'orderId',
|
||||
// component: 'Input',
|
||||
// rules: 'required',
|
||||
// },
|
||||
{
|
||||
label: '订单号',
|
||||
fieldName: 'orderId',
|
||||
component: 'ApiSelect',
|
||||
componentProps: {
|
||||
api: orderChargeList,
|
||||
api: rentalOrderList,
|
||||
resultField: 'rows',
|
||||
valueField: 'orderId',
|
||||
labelField: 'orderNo',
|
||||
valueField: 'id',
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
// {
|
||||
// label: '租赁人ID',
|
||||
// fieldName: 'userId',
|
||||
// component: 'ApiSelect',
|
||||
// componentProps: {
|
||||
// api: rentalOrderList,
|
||||
// resultField: 'rows',
|
||||
// labelField: 'customerName',
|
||||
// valueField: 'id',
|
||||
// },
|
||||
// rules: 'required',
|
||||
// },
|
||||
{
|
||||
label: '租赁人',
|
||||
fieldName: 'userName',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
component: "Select",
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '租金',
|
||||
@ -192,6 +199,12 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '总金额',
|
||||
fieldName: 'totalAmount',
|
||||
component: 'Input',
|
||||
rules: 'required',
|
||||
},
|
||||
{
|
||||
label: '开票状态',
|
||||
fieldName: 'invoiceStatus',
|
||||
@ -216,4 +229,24 @@ export const modalSchema: FormSchemaGetter = () => [
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '支付方式',
|
||||
fieldName: 'paymentMethod',
|
||||
component: 'Select',
|
||||
componentProps: {
|
||||
options: getDictOptions('pro_payment_method'),
|
||||
},
|
||||
rules: 'selectRequired',
|
||||
},
|
||||
{
|
||||
label: '收费日期',
|
||||
fieldName: 'chargeDate',
|
||||
component: 'DatePicker',
|
||||
componentProps: {
|
||||
showTime: true,
|
||||
format: 'YYYY-MM-DD HH:mm:ss',
|
||||
valueFormat: 'YYYY-MM-DD HH:mm:ss',
|
||||
},
|
||||
rules: 'required',
|
||||
},
|
||||
];
|
||||
|
@ -2,6 +2,7 @@
|
||||
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||
import { getVxePopupContainer } from '@vben/utils';
|
||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||
import { $t } from '@vben/locales';
|
||||
import {
|
||||
useVbenVxeGrid,
|
||||
vxeCheckboxChecked,
|
||||
|
@ -72,11 +72,11 @@ async function handleOpenChange(open: boolean) {
|
||||
<DescriptionsItem label="购买植物">
|
||||
{{ orderChargeDetail.createTime }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="价格">
|
||||
{{ orderChargeDetail.createTime }}
|
||||
<DescriptionsItem label="总金额">
|
||||
{{ orderChargeDetail.totalAmount }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="产品图片">
|
||||
<img :src="orderChargeDetail.imgPath" alt="">
|
||||
<img :src="orderChargeDetail.createTime" alt="">
|
||||
</DescriptionsItem>
|
||||
</Descriptions>
|
||||
</BasicModal>
|
||||
|
@ -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>
|
||||
|
||||
|
@ -0,0 +1,86 @@
|
||||
<script lang="ts" setup>
|
||||
import {ref, watch} from 'vue';
|
||||
import {Select} from 'ant-design-vue';
|
||||
import {rentalOrderInfo, rentalOrderList} from "#/api/property/rentalOrder";
|
||||
|
||||
defineOptions({name: 'QueryUserList'});
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
disabled?: boolean;
|
||||
placeholder?: string;
|
||||
isUpdate?: boolean;
|
||||
userName?: string;
|
||||
}>(), {
|
||||
disabled: false,
|
||||
placeholder: '可根据员工姓名进行搜索...',
|
||||
isUpdate: false,
|
||||
userName: ''
|
||||
});
|
||||
watch(() => props.userName,
|
||||
(newX) => {
|
||||
if (props.isUpdate) {
|
||||
getUserInfo(newX)
|
||||
}
|
||||
}, {immediate: true})
|
||||
|
||||
async function queryUser(value: string, callback: any) {
|
||||
const queryData = {
|
||||
customerName: value,
|
||||
pageSize: 100,
|
||||
pageNum: 1,
|
||||
}
|
||||
const res = await rentalOrderList(queryData);
|
||||
const options = res.rows.map((user) => ({
|
||||
label: user.customerName,
|
||||
value: user.id,
|
||||
userName: user.customerName,
|
||||
}));
|
||||
callback(options);
|
||||
}
|
||||
|
||||
|
||||
const data = ref<any[]>([]);
|
||||
const value = ref('');
|
||||
|
||||
const handleSearch = (val: string) => {
|
||||
queryUser(val, (d: any[]) => (data.value = d));
|
||||
};
|
||||
const emit = defineEmits(['update:userInfo']);
|
||||
const handleChange = (val: string) => {
|
||||
value.value = val;
|
||||
const userInfo = data.value.find(option => option.value === val);
|
||||
queryUser(val, (d: any[]) => (data.value = d));
|
||||
emit('update:userInfo', userInfo);
|
||||
};
|
||||
|
||||
async function getUserInfo(val:number|string) {
|
||||
if (!val) return;
|
||||
const res = await rentalOrderInfo(val)
|
||||
const user = res.user
|
||||
if (user) {
|
||||
data.value = [{
|
||||
label: user.nickName,
|
||||
value: user.userId,
|
||||
userName: user.userName,
|
||||
}]
|
||||
emit('update:userInfo', data.value[0]);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Select
|
||||
v-model="value"
|
||||
show-search
|
||||
:placeholder="placeholder"
|
||||
style="width: 100%"
|
||||
:default-active-first-option="false"
|
||||
:show-arrow="false"
|
||||
:filter-option="false"
|
||||
:not-found-content="null"
|
||||
:options="data"
|
||||
@search="handleSearch"
|
||||
@change="handleChange"
|
||||
></Select>
|
||||
</template>
|
||||
|
@ -22,6 +22,15 @@ export const querySchema: FormSchemaGetter = () => [
|
||||
|
||||
export const columns: VxeGridProps['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{
|
||||
title: '序号',
|
||||
field: 'id',
|
||||
slots: {
|
||||
default: ({ rowIndex }) => {
|
||||
return (rowIndex + 1).toString();
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
title: '养护名称',
|
||||
field: 'maintainName',
|
||||
|
@ -1,14 +1,11 @@
|
||||
<script setup lang="ts">
|
||||
import {computed, reactive, ref} from 'vue';
|
||||
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
import {$t} from '@vben/locales';
|
||||
import {cloneDeep} from '@vben/utils';
|
||||
|
||||
import {useVbenForm} from '#/adapter/form';
|
||||
import {personAdd, personInfo, personUpdate} from '#/api/property/resident/person';
|
||||
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
|
||||
|
||||
import {modalSchema} from './data';
|
||||
import QueryUserList from './query-user-list.vue'
|
||||
import QueryUnitList from './query-unit-list.vue'
|
||||
|
@ -27,8 +27,7 @@ export default defineConfig(async () => {
|
||||
changeOrigin: true,
|
||||
rewrite: (path) => path.replace(/^\/api/, ''),
|
||||
// mock代理目标地址
|
||||
// target: 'http://by.missmoc.top:3010/',
|
||||
// target: 'http://192.168.0.103:8080',
|
||||
// target: 'http://192.168.0.106:8080',
|
||||
target: 'http://47.109.37.87:3010',
|
||||
ws: true,
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user