Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3m1s
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 3m1s
This commit is contained in:
commit
171d3ef133
@ -3,21 +3,35 @@ run-name: ${{ gitea.actor }} is testing out Gitea Actions 🚀
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
|
||||
Explore-Gitea-Actions:
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
|
||||
- name: Checkout code
|
||||
uses: http://127.0.0.1:3000/bichangxiong/checkout@v4 # 使用 Gitea 镜像
|
||||
uses: http://47.109.37.87:3000/bichangxiong/checkout@v4 # 使用 Gitea 镜像
|
||||
with:
|
||||
fetch-depth: 1 # 只拉取最新一次提交
|
||||
|
||||
- name: Set up Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20.x
|
||||
- name: pnpm
|
||||
run: npm i pnpm -g
|
||||
- name: node
|
||||
run: pnpm i
|
||||
- name: Build
|
||||
run: pnpm build:antd
|
||||
- name: cp
|
||||
# run: robocopy ./apps/web-antd/dist C:\devtool\nginx-1.28.0\html\propety /E
|
||||
run: Copy-Item -Path "./apps/web-antd/dist" -Destination "C:\devtool\nginx-1.28.0\html\property" -Recurse -Force -ErrorAction SilentlyContinue
|
||||
- name: copy file via ssh password
|
||||
uses: appleboy/scp-action@v0.1.7
|
||||
with:
|
||||
host: 192.168.1.3
|
||||
username: root
|
||||
password: by@2025!
|
||||
port: 22
|
||||
source: "./apps/web-antd/dist"
|
||||
target: "/project/wl/web/dist"
|
||||
|
||||
|
||||
|
||||
|
@ -76,6 +76,11 @@ export interface RentalOrderVO {
|
||||
*/
|
||||
contractStatus: number;
|
||||
|
||||
/**
|
||||
* 合同编号
|
||||
*/
|
||||
contractCode: string;
|
||||
|
||||
/**
|
||||
* 签署时间
|
||||
*/
|
||||
@ -159,6 +164,11 @@ export interface RentalOrderForm extends BaseEntity {
|
||||
*/
|
||||
contractStatus?: number;
|
||||
|
||||
/**
|
||||
* 合同编号
|
||||
*/
|
||||
contractCode?: string;
|
||||
|
||||
/**
|
||||
* 签署时间
|
||||
*/
|
||||
@ -236,6 +246,10 @@ export interface RentalOrderQuery extends PageQuery {
|
||||
* 合同状态
|
||||
*/
|
||||
contractStatus?: number;
|
||||
/**
|
||||
* 合同编号
|
||||
*/
|
||||
contractCode?: string;
|
||||
|
||||
/**
|
||||
* 签署时间
|
||||
|
@ -99,12 +99,6 @@ export const columns: VxeGridProps['columns'] = [
|
||||
},
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '租赁商品',
|
||||
field: 'planId',
|
||||
// slots: {default: 'planId'},
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '支付状态',
|
||||
field: 'paymentStatus',
|
||||
@ -135,11 +129,6 @@ export const columns: VxeGridProps['columns'] = [
|
||||
},
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
title: '签署时间',
|
||||
field: 'signTime',
|
||||
width: 100
|
||||
},
|
||||
{
|
||||
field: 'action',
|
||||
fixed: 'right',
|
||||
@ -175,3 +164,30 @@ export const planInfoColumns: VxeGridProps['columns'] = [
|
||||
align: 'center'
|
||||
},
|
||||
]
|
||||
export const rentalColumns: VxeGridProps['columns'] = [
|
||||
{
|
||||
title: '序号',
|
||||
field: 'id',
|
||||
width: 100,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '产品名称',
|
||||
field: 'plantName',
|
||||
minWidth: 100,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '产品租金(元)',
|
||||
field: 'rent',
|
||||
width: 180,
|
||||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '租赁数量',
|
||||
field: 'planProNumber',
|
||||
width: 180,
|
||||
align: 'center'
|
||||
},
|
||||
]
|
||||
|
||||
|
@ -20,6 +20,7 @@ import type { RentalOrderForm } from '#/api/property/rentalOrder/model';
|
||||
import { commonDownloadExcel } from '#/utils/file/download';
|
||||
|
||||
import rentalOrderModal from './rentalOrder-modal.vue';
|
||||
import orderDetailModal from './order-detail.vue';
|
||||
import { columns, querySchema } from './data';
|
||||
|
||||
const formOptions: VbenFormProps = {
|
||||
@ -31,15 +32,6 @@ const formOptions: VbenFormProps = {
|
||||
},
|
||||
schema: querySchema(),
|
||||
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
|
||||
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
|
||||
// 不需要直接删除
|
||||
// fieldMappingTime: [
|
||||
// [
|
||||
// 'createTime',
|
||||
// ['params[beginTime]', 'params[endTime]'],
|
||||
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
|
||||
// ],
|
||||
// ],
|
||||
};
|
||||
|
||||
const gridOptions: VxeGridProps = {
|
||||
@ -51,8 +43,6 @@ const gridOptions: VxeGridProps = {
|
||||
// 点击行选中
|
||||
// trigger: 'row',
|
||||
},
|
||||
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
|
||||
// columns: columns(),
|
||||
columns,
|
||||
height: 'auto',
|
||||
keepSource: true,
|
||||
@ -84,15 +74,19 @@ const [RentalOrderModal, modalApi] = useVbenModal({
|
||||
connectedComponent: rentalOrderModal,
|
||||
});
|
||||
|
||||
const [OrderDetail, detailApi] = useVbenModal({
|
||||
connectedComponent: orderDetailModal,
|
||||
});
|
||||
|
||||
function handleAdd() {
|
||||
modalApi.setData({});
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
// async function handleEdit(row: Required<RentalOrderForm>) {
|
||||
// modalApi.setData({ id: row.id });
|
||||
// modalApi.open();
|
||||
// }
|
||||
async function handleInfo(row: Required<RentalOrderForm>) {
|
||||
detailApi.setData({ id: row.id });
|
||||
detailApi.open();
|
||||
}
|
||||
|
||||
async function handleDelete(row: Required<RentalOrderForm>) {
|
||||
await rentalOrderRemove(row.id);
|
||||
@ -150,13 +144,13 @@ function handleDownloadExcel() {
|
||||
</template>
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<!-- <ghost-button-->
|
||||
<!-- v-access:code="['property:rentalOrder:edit']"-->
|
||||
<!-- @click.stop="handleEdit(row)"-->
|
||||
<!-- >-->
|
||||
<!-- {{ $t('pages.common.edit') }}-->
|
||||
<!-- </ghost-button>-->
|
||||
<ghost-button
|
||||
v-access:code="['property:rentalOrder:info']"
|
||||
@click.stop="handleInfo(row)">
|
||||
{{ $t('pages.common.info') }}
|
||||
</ghost-button>
|
||||
<Popconfirm
|
||||
:disabled="row.paymentStatus==1&&row.contractStatus==1"
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
title="确认删除?"
|
||||
@ -174,5 +168,6 @@ function handleDownloadExcel() {
|
||||
</template>
|
||||
</BasicTable>
|
||||
<RentalOrderModal @reload="tableApi.query()" />
|
||||
<OrderDetail></OrderDetail>
|
||||
</Page>
|
||||
</template>
|
||||
|
@ -0,0 +1,116 @@
|
||||
<script setup lang="ts">
|
||||
|
||||
import {ref, shallowRef} from 'vue';
|
||||
|
||||
import {useVbenModal} from '@vben/common-ui';
|
||||
|
||||
import {Descriptions, DescriptionsItem} from 'ant-design-vue';
|
||||
import dayjs from 'dayjs';
|
||||
import duration from 'dayjs/plugin/duration';
|
||||
import relativeTime from 'dayjs/plugin/relativeTime';
|
||||
|
||||
import {renderDict} from "#/utils/render";
|
||||
import type {RentalOrderVO} from "#/api/property/rentalOrder/model";
|
||||
import {rentalOrderInfo} from "#/api/property/rentalOrder";
|
||||
import {rentalColumns} from "./data";
|
||||
import {Table} from "ant-design-vue";
|
||||
|
||||
dayjs.extend(duration);
|
||||
dayjs.extend(relativeTime);
|
||||
|
||||
const planProducts=ref([]);
|
||||
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
onOpenChange: handleOpenChange,
|
||||
onClosed() {
|
||||
orderDetail.value = null;
|
||||
},
|
||||
});
|
||||
|
||||
const orderDetail = shallowRef<null |RentalOrderVO>(null);
|
||||
|
||||
async function handleOpenChange(open: boolean) {
|
||||
if (!open) {
|
||||
return null;
|
||||
}
|
||||
modalApi.modalLoading(true);
|
||||
|
||||
const {id} = modalApi.getData() as { id: number | string };
|
||||
// 赋值
|
||||
orderDetail.value = await rentalOrderInfo(id);
|
||||
planProducts.value=orderDetail.value?.productList
|
||||
|
||||
modalApi.modalLoading(false);
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal :footer="false" :fullscreen-button="false" title="租赁订单信息" class="w-[70%]">
|
||||
<Descriptions v-if="orderDetail" size="small" :column="2" bordered :labelStyle="{width:'100px'}">
|
||||
<DescriptionsItem label="订单号">
|
||||
{{ orderDetail.orderNo }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="客户名称">
|
||||
{{ orderDetail.customerName }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="客户类型" v-if="orderDetail.type!=null">
|
||||
<component
|
||||
:is="renderDict(orderDetail.customerType,'wy_khlx')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="租赁周期">
|
||||
{{ orderDetail.rentalPeriod}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="租赁时间" :span="2">
|
||||
{{dayjs(orderDetail.startTime).format("YYYY-MM-DD")+' 至 '+dayjs(orderDetail.endTime).format("YYYY-MM-DD")}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="总金额">
|
||||
{{ orderDetail.totalAmount +"元"}}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="租赁方式">
|
||||
<component
|
||||
:is="renderDict(orderDetail.rentalType,'wy_zlfs')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="支付状态">
|
||||
<component
|
||||
:is="renderDict(orderDetail.paymentStatus,'pro_charging_status')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="是否续租">
|
||||
<component
|
||||
:is="renderDict(orderDetail.isRelet,'wy_sf')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="合同状态">
|
||||
<component
|
||||
:is="renderDict(orderDetail.contractStatus,'wy_htzt')"
|
||||
/>
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="合同编号" v-if="orderDetail.contractStatus!='1'">
|
||||
{{ orderDetail.contractCode ?? '无' }}
|
||||
</DescriptionsItem>
|
||||
<DescriptionsItem label="签署时间" v-if="orderDetail.contractStatus!='1'">
|
||||
{{ orderDetail.signTime ?? '无' }}
|
||||
</DescriptionsItem>
|
||||
</Descriptions>
|
||||
<div v-if="planProducts.length">
|
||||
<div style="margin: 10px 0;font-weight: 500">
|
||||
订单产品详情
|
||||
</div>
|
||||
<Table :dataSource="planProducts" :columns="rentalColumns" :pagination="false"
|
||||
bordered size="small">
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
<template v-if="column.field === 'id'">
|
||||
{{ index + 1 }}
|
||||
</template>
|
||||
<template v-else>
|
||||
{{ record[column.field] }}
|
||||
</template>
|
||||
</template>
|
||||
</Table>
|
||||
</div>
|
||||
</BasicModal>
|
||||
</template>
|
@ -28,7 +28,7 @@ const planList = ref<RentalPlanVO[]>([]);
|
||||
const plantsList = ref<PropertyVO[]>([]);
|
||||
const planProducts = ref<any[]>([]);
|
||||
const totalAmount = ref(0);
|
||||
const singleAmount = ref(0);
|
||||
const singleAmount = ref('0');
|
||||
const plantInfo = ref<PropertyVO>();
|
||||
const title = computed(() => {
|
||||
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
|
||||
@ -141,7 +141,7 @@ const modalSchema = [
|
||||
formItemClass: 'col-span-2',
|
||||
componentProps: {
|
||||
api: async () => {
|
||||
const res = await plantsProductList({pageNum: 1, pageSize: 1000, inventory: 1});
|
||||
const res = await plantsProductList({pageNum: 1, pageSize: 1000, inventory: 0});
|
||||
plantsList.value = res.rows || [];
|
||||
return plantsList.value.map(item => ({
|
||||
label: item.plantName + '-' + item.plantCode + '\xa0\xa0租金(元):' + item.rent + '\xa0\xa0库存数量:' + item.inventory,
|
||||
@ -151,10 +151,20 @@ const modalSchema = [
|
||||
onChange: async (value: string) => {
|
||||
plantInfo.value = plantsList.value.find(item => item.id === value);
|
||||
if (plantInfo.value) {
|
||||
formApi.updateSchema([{
|
||||
componentProps: () => ({
|
||||
min: 1,
|
||||
max: plantInfo.value?.inventory,
|
||||
precision: 0,
|
||||
onChange:async ()=>{
|
||||
const formValues = await formApi.getValues();
|
||||
if (formValues.productNum) {
|
||||
if (formValues.productNum&&plantInfo.value?.rent) {
|
||||
singleAmount.value = (plantInfo.value.rent * formValues.productNum).toFixed(2);
|
||||
}
|
||||
},
|
||||
}),
|
||||
fieldName: 'productNum',
|
||||
}])
|
||||
}
|
||||
},
|
||||
showSearch: true,
|
||||
@ -172,6 +182,7 @@ const modalSchema = [
|
||||
step: 1,
|
||||
placeholder: '租赁数量不可超出绿植产品库存数量',
|
||||
onChange: async (value: number) => {
|
||||
console.log(value,'================vvvv')
|
||||
if (plantInfo.value) {
|
||||
singleAmount.value = (plantInfo.value.rent * value).toFixed(2);
|
||||
}
|
||||
@ -313,7 +324,7 @@ async function handleConfirm() {
|
||||
data.startTime = data.rentalTime[0];
|
||||
data.endTime = data.rentalTime[1];
|
||||
}
|
||||
|
||||
data.paymentStatus=0
|
||||
await (isUpdate.value ? rentalOrderUpdate(data) : rentalOrderAdd(data));
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
@ -329,16 +340,6 @@ async function handleConfirm() {
|
||||
async function getPlanProducts(id: string) {
|
||||
const res = await rentalPlanInfo(id)
|
||||
plantsList.value=res.productList;
|
||||
// planProducts.value = [{
|
||||
// plantName: '发财树',
|
||||
// inventory: 3,
|
||||
// rent: 10,
|
||||
// }, {
|
||||
// plantName: '绿萝',
|
||||
// inventory: 5,
|
||||
// rent: 3,
|
||||
// }
|
||||
// ]
|
||||
totalAmount.value = planProducts.value?.reduce((sum, item: any) => sum + (item.rent * item.inventory), 0).toFixed(2)
|
||||
|
||||
}
|
||||
@ -354,7 +355,7 @@ async function handleClosed() {
|
||||
<BasicModal :title="title">
|
||||
<BasicForm>
|
||||
<template #planInfo="slotProps">
|
||||
<div v-if="planProducts.length" style="width: 100%">
|
||||
<div v-if="planProducts.length" style="width: 100%" v-bind="slotProps">
|
||||
<Table :dataSource="planProducts" :columns="planInfoColumns" :pagination="false"
|
||||
bordered size="small">
|
||||
<template #bodyCell="{ column, record, index }">
|
||||
@ -375,7 +376,7 @@ async function handleClosed() {
|
||||
</div>
|
||||
</template>
|
||||
<template #totalAmount="slotProps">
|
||||
<div>{{ singleAmount }}</div>
|
||||
<div v-bind="slotProps">{{ singleAmount }}</div>
|
||||
</template>
|
||||
</BasicForm>
|
||||
</BasicModal>
|
||||
|
Loading…
Reference in New Issue
Block a user