绿植管理
This commit is contained in:
parent
44b91fc587
commit
4b3d075266
@ -2,7 +2,7 @@ import type { FormSchemaGetter } from '#/adapter/form';
|
|||||||
import type { VxeGridProps } from '#/adapter/vxe-table';
|
import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||||
import { getDictOptions } from '#/utils/dict';
|
import { getDictOptions } from '#/utils/dict';
|
||||||
import { renderDict } from '#/utils/render';
|
import { renderDict } from '#/utils/render';
|
||||||
import {orderChargeList} from "#/api/property/chargeManagement";
|
import {rentalOrderList} from "#/api/property/rentalOrder";
|
||||||
|
|
||||||
export const querySchema: FormSchemaGetter = () => [
|
export const querySchema: FormSchemaGetter = () => [
|
||||||
{
|
{
|
||||||
@ -151,28 +151,35 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
triggerFields: [''],
|
triggerFields: [''],
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// label: '订单号',
|
|
||||||
// fieldName: 'orderId',
|
|
||||||
// component: 'Input',
|
|
||||||
// rules: 'required',
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
label: '订单号',
|
label: '订单号',
|
||||||
fieldName: 'orderId',
|
fieldName: 'orderId',
|
||||||
component: 'ApiSelect',
|
component: 'ApiSelect',
|
||||||
componentProps: {
|
componentProps: {
|
||||||
api: orderChargeList,
|
api: rentalOrderList,
|
||||||
resultField: 'rows',
|
resultField: 'rows',
|
||||||
valueField: 'orderId',
|
labelField: 'orderNo',
|
||||||
|
valueField: 'id',
|
||||||
},
|
},
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// label: '租赁人ID',
|
||||||
|
// fieldName: 'userId',
|
||||||
|
// component: 'ApiSelect',
|
||||||
|
// componentProps: {
|
||||||
|
// api: rentalOrderList,
|
||||||
|
// resultField: 'rows',
|
||||||
|
// labelField: 'customerName',
|
||||||
|
// valueField: 'id',
|
||||||
|
// },
|
||||||
|
// rules: 'required',
|
||||||
|
// },
|
||||||
{
|
{
|
||||||
label: '租赁人',
|
label: '租赁人',
|
||||||
fieldName: 'userName',
|
fieldName: 'userName',
|
||||||
component: 'Input',
|
component: "Select",
|
||||||
rules: 'required',
|
rules: 'selectRequired',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: '租金',
|
label: '租金',
|
||||||
@ -192,6 +199,12 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
component: 'Input',
|
component: 'Input',
|
||||||
rules: 'required',
|
rules: 'required',
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: '总金额',
|
||||||
|
fieldName: 'totalAmount',
|
||||||
|
component: 'Input',
|
||||||
|
rules: 'required',
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '开票状态',
|
label: '开票状态',
|
||||||
fieldName: 'invoiceStatus',
|
fieldName: 'invoiceStatus',
|
||||||
@ -216,4 +229,24 @@ export const modalSchema: FormSchemaGetter = () => [
|
|||||||
},
|
},
|
||||||
rules: 'selectRequired',
|
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 { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
|
||||||
import { getVxePopupContainer } from '@vben/utils';
|
import { getVxePopupContainer } from '@vben/utils';
|
||||||
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
import { Modal, Popconfirm, Space } from 'ant-design-vue';
|
||||||
|
import { $t } from '@vben/locales';
|
||||||
import {
|
import {
|
||||||
useVbenVxeGrid,
|
useVbenVxeGrid,
|
||||||
vxeCheckboxChecked,
|
vxeCheckboxChecked,
|
||||||
|
@ -72,11 +72,11 @@ async function handleOpenChange(open: boolean) {
|
|||||||
<DescriptionsItem label="购买植物">
|
<DescriptionsItem label="购买植物">
|
||||||
{{ orderChargeDetail.createTime }}
|
{{ orderChargeDetail.createTime }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
<DescriptionsItem label="价格">
|
<DescriptionsItem label="总金额">
|
||||||
{{ orderChargeDetail.createTime }}
|
{{ orderChargeDetail.totalAmount }}
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
<DescriptionsItem label="产品图片">
|
<DescriptionsItem label="产品图片">
|
||||||
<img :src="orderChargeDetail.imgPath" alt="">
|
<img :src="orderChargeDetail.createTime" alt="">
|
||||||
</DescriptionsItem>
|
</DescriptionsItem>
|
||||||
</Descriptions>
|
</Descriptions>
|
||||||
</BasicModal>
|
</BasicModal>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { computed, ref } from 'vue';
|
import {computed, reactive, ref} from 'vue';
|
||||||
import { useVbenModal } from '@vben/common-ui';
|
import { useVbenModal } from '@vben/common-ui';
|
||||||
import { $t } from '@vben/locales';
|
import { $t } from '@vben/locales';
|
||||||
import { cloneDeep } from '@vben/utils';
|
import { cloneDeep } from '@vben/utils';
|
||||||
@ -7,6 +7,7 @@ import { useVbenForm } from '#/adapter/form';
|
|||||||
import { orderChargeAdd, orderChargeInfo, orderChargeUpdate } from '#/api/property/chargeManagement';
|
import { orderChargeAdd, orderChargeInfo, orderChargeUpdate } from '#/api/property/chargeManagement';
|
||||||
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
|
||||||
import { modalSchema } from './data';
|
import { modalSchema } from './data';
|
||||||
|
import QueryUserList from "#/views/property/greenPlantRentalManagement/chargeManagement/query-user-list.vue";
|
||||||
|
|
||||||
const emit = defineEmits<{ reload: [] }>();
|
const emit = defineEmits<{ reload: [] }>();
|
||||||
const isUpdate = ref(false);
|
const isUpdate = ref(false);
|
||||||
@ -65,6 +66,11 @@ async function handleConfirm() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const data = cloneDeep(await formApi.getValues());
|
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));
|
await (isUpdate.value ? orderChargeUpdate(data) : orderChargeAdd(data));
|
||||||
resetInitialized();
|
resetInitialized();
|
||||||
emit('reload');
|
emit('reload');
|
||||||
@ -75,7 +81,15 @@ async function handleConfirm() {
|
|||||||
modalApi.lock(false);
|
modalApi.lock(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
let userInfo = reactive({
|
||||||
|
value:'',
|
||||||
|
userId: '',
|
||||||
|
userName: '',
|
||||||
|
});
|
||||||
|
const userName = ref<number | string>('');
|
||||||
|
function getUserInfo(user: any) {
|
||||||
|
userInfo = user;
|
||||||
|
}
|
||||||
async function handleClosed() {
|
async function handleClosed() {
|
||||||
await formApi.resetForm();
|
await formApi.resetForm();
|
||||||
resetInitialized();
|
resetInitialized();
|
||||||
@ -84,7 +98,11 @@ async function handleClosed() {
|
|||||||
|
|
||||||
<template>
|
<template>
|
||||||
<BasicModal :title="title">
|
<BasicModal :title="title">
|
||||||
<BasicForm />
|
<BasicForm>
|
||||||
|
<template #userName="slotProps">
|
||||||
|
<QueryUserList @update:userInfo="getUserInfo" v-bind="slotProps" :isUpdate="isUpdate" :userName="userName"/>
|
||||||
|
</template>
|
||||||
|
</BasicForm>
|
||||||
</BasicModal>
|
</BasicModal>
|
||||||
</template>
|
</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'] = [
|
export const columns: VxeGridProps['columns'] = [
|
||||||
{ type: 'checkbox', width: 60 },
|
{ type: 'checkbox', width: 60 },
|
||||||
|
{
|
||||||
|
title: '序号',
|
||||||
|
field: 'id',
|
||||||
|
slots: {
|
||||||
|
default: ({ rowIndex }) => {
|
||||||
|
return (rowIndex + 1).toString();
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '养护名称',
|
title: '养护名称',
|
||||||
field: 'maintainName',
|
field: 'maintainName',
|
||||||
|
@ -1,14 +1,11 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import {computed, reactive, ref} from 'vue';
|
import {computed, reactive, ref} from 'vue';
|
||||||
|
|
||||||
import {useVbenModal} from '@vben/common-ui';
|
import {useVbenModal} from '@vben/common-ui';
|
||||||
import {$t} from '@vben/locales';
|
import {$t} from '@vben/locales';
|
||||||
import {cloneDeep} from '@vben/utils';
|
import {cloneDeep} from '@vben/utils';
|
||||||
|
|
||||||
import {useVbenForm} from '#/adapter/form';
|
import {useVbenForm} from '#/adapter/form';
|
||||||
import {personAdd, personInfo, personUpdate} from '#/api/property/resident/person';
|
import {personAdd, personInfo, personUpdate} from '#/api/property/resident/person';
|
||||||
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
|
import {defaultFormValueGetter, useBeforeCloseDiff} from '#/utils/popup';
|
||||||
|
|
||||||
import {modalSchema} from './data';
|
import {modalSchema} from './data';
|
||||||
import QueryUserList from './query-user-list.vue'
|
import QueryUserList from './query-user-list.vue'
|
||||||
import QueryUnitList from './query-unit-list.vue'
|
import QueryUnitList from './query-unit-list.vue'
|
||||||
|
@ -27,8 +27,7 @@ export default defineConfig(async () => {
|
|||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
rewrite: (path) => path.replace(/^\/api/, ''),
|
rewrite: (path) => path.replace(/^\/api/, ''),
|
||||||
// mock代理目标地址
|
// mock代理目标地址
|
||||||
// target: 'http://by.missmoc.top:3010/',
|
// target: 'http://192.168.0.106:8080',
|
||||||
// target: 'http://192.168.0.103:8080',
|
|
||||||
target: 'http://47.109.37.87:3010',
|
target: 'http://47.109.37.87:3010',
|
||||||
ws: true,
|
ws: true,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user