Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
Some checks are pending
Gitea Actions Demo / Explore-Gitea-Actions (push) Waiting to run
# Conflicts: # apps/web-antd/vite.config.mts
This commit is contained in:
@@ -39,6 +39,8 @@ const totalSumPeices = computed(() => {
|
||||
|
||||
const isUpdate = ref(false);
|
||||
const isReadonly = ref(false);
|
||||
const isAudit = ref(false);
|
||||
const isRefund = ref(false);
|
||||
const title = computed(() => {
|
||||
return isUpdate.value ? $t('pages.common.edit') : isReadonly.value ? '详情' : $t('pages.common.add');
|
||||
});
|
||||
@@ -121,12 +123,16 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
// 查询服务地址树形结构
|
||||
setupCommunitySelect()
|
||||
modalApi.modalLoading(true);
|
||||
const { id, readonly } = modalApi.getData() as {
|
||||
const { id, readonly,audit,refund } = modalApi.getData() as {
|
||||
id?: string;
|
||||
readonly?: boolean;
|
||||
audit?: boolean;
|
||||
refund?: boolean;
|
||||
};
|
||||
editCleanOrderId.value = id || '';
|
||||
isReadonly.value = !!readonly;
|
||||
isAudit.value = !!audit;
|
||||
isRefund.value = !!refund;
|
||||
//判断是否是编辑状态需要先判断是否是只读状态
|
||||
if(isReadonly.value){
|
||||
isUpdate.value = false;
|
||||
@@ -139,6 +145,14 @@ const [BasicModal, modalApi] = useVbenModal({
|
||||
if (record.endTime) record.endTime = dayjs(record.endTime);
|
||||
editUnitId.value = record.unitId || '';
|
||||
detailTable.value = record.cleanList || [];
|
||||
for(const item of record.relationList){
|
||||
for(let i = 0; i < detailTable.value.length; i++){
|
||||
if(item.cleanId === detailTable.value[i].id){
|
||||
detailTable.value[i].area = item.areas;
|
||||
detailTable.value[i].sumPeices = item.sumPrice;
|
||||
}
|
||||
}
|
||||
}
|
||||
await formApi.setValues(record);
|
||||
}
|
||||
await markInitialized();
|
||||
@@ -275,14 +289,10 @@ function handleAddDetail() {
|
||||
}
|
||||
// 添加订单服务详情
|
||||
function handleDetailReload(data: any) {
|
||||
console.log(data,'afawed');
|
||||
|
||||
detailTable.value.push(data);
|
||||
}
|
||||
// 编辑订单服务详情
|
||||
function handleEditDetailReload(data: any) {
|
||||
console.log(data,'1203342423');
|
||||
|
||||
detailTable.value[data.index] = data;
|
||||
|
||||
}
|
||||
@@ -326,7 +336,8 @@ async function handleConfirm() {
|
||||
data.unit = unitObj ? unitObj.name : data.unit || '';
|
||||
data.name = cleanObj ? cleanObj.name : data.name || '';
|
||||
data.unitId = unitObj ? unitObj.id : isUpdate.value ? editUnitId.value : '';
|
||||
data.sumPeices = parseInt(totalSumPeices.value, 10);
|
||||
data.sumPeices = Number(totalSumPeices.value)
|
||||
// data.sumPeices = parseInt(totalSumPeices.value, 10);
|
||||
// 组装 cleanIds
|
||||
// data.cleanIds = detailTable.value.map((item: any) => item.id);
|
||||
data.cleanList = detailTable.value;
|
||||
@@ -382,6 +393,46 @@ async function setupCommunitySelect() {
|
||||
},
|
||||
]);
|
||||
}
|
||||
async function handleAudit(params: any) {
|
||||
modalApi.lock(true);
|
||||
const { valid } = await formApi.validate();
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
const data = cloneDeep(await formApi.getValues());
|
||||
// 单位数据缓存
|
||||
if (unitListData.length === 0) {
|
||||
const res = await resident_unitList();
|
||||
unitListData = res.rows || [];
|
||||
}
|
||||
// 劳务数据缓存 cleanListData 已有
|
||||
// 查找label
|
||||
const unitObj = unitListData.find((item) => item.id === data.unitId);
|
||||
const cleanObj = cleanListData.find((item) => item.id === data.name);
|
||||
data.unit = unitObj ? unitObj.name : data.unit || '';
|
||||
data.name = cleanObj ? cleanObj.name : data.name || '';
|
||||
data.unitId = unitObj ? unitObj.id : isUpdate.value ? editUnitId.value : '';
|
||||
data.sumPeices = Number(totalSumPeices.value)
|
||||
data.starTime = dayjs(data.starTime).format('YYYY-MM-DD HH:mm:ss');
|
||||
data.endTime = dayjs(data.endTime).format('YYYY-MM-DD HH:mm:ss');
|
||||
// data.sumPeices = parseInt(totalSumPeices.value, 10);
|
||||
// 组装 cleanIds
|
||||
// data.cleanIds = detailTable.value.map((item: any) => item.id);
|
||||
data.cleanList = detailTable.value;
|
||||
if(params.isRefund){
|
||||
data.isUnbooking = 1;
|
||||
} else if(params.isAudit){
|
||||
data.state = 1;
|
||||
}else{
|
||||
data.state = 2;
|
||||
}
|
||||
console.log(data,'data');
|
||||
// 0:未审核 1:审核通过 2:审核不通过
|
||||
await clean_orderUpdate({...data,id:editCleanOrderId.value})
|
||||
resetInitialized();
|
||||
emit('reload');
|
||||
modalApi.close();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -422,7 +473,16 @@ async function setupCommunitySelect() {
|
||||
<div>费用合计:{{ totalSumPeices }}元</div>
|
||||
</div>
|
||||
<CleanDetailModal @reload="handleDetailReload" @editReload="handleEditDetailReload"/>
|
||||
</BasicModal>
|
||||
<template #footer v-if="isAudit">
|
||||
<a-button @click="modalApi.close()">取消</a-button>
|
||||
<a-button type="primary" @click="handleAudit({isAudit:true})">审核通过</a-button>
|
||||
<a-button danger @click="handleAudit({isAudit:false})">审核不通过</a-button>
|
||||
</template>
|
||||
<template #footer v-if="isRefund">
|
||||
<a-button @click="modalApi.close()">取消</a-button>
|
||||
<a-button type="primary" @click="handleAudit({isRefund:true})">退定</a-button>
|
||||
</template>
|
||||
</BasicModal>
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
|
@@ -127,10 +127,26 @@ function handleDownloadExcel() {
|
||||
);
|
||||
}
|
||||
|
||||
async function handleView(row: Required<CleanForm>) {
|
||||
function handleView(row: Required<CleanForm>) {
|
||||
modalApi.setData({ id: row.id, readonly: true });
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
function handleAudit(row:any) {
|
||||
// 审核逻辑
|
||||
// TODO: 实现审核功能
|
||||
console.log('审核', row);
|
||||
modalApi.setData({ id: row.id, readonly: true,audit:true });
|
||||
modalApi.open();
|
||||
}
|
||||
|
||||
function handleRefund(row:any) {
|
||||
// 退定逻辑
|
||||
// TODO: 实现退定功能
|
||||
console.log('退定', row);
|
||||
modalApi.setData({ id: row.id, readonly: true,refund:true });
|
||||
modalApi.open();
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -170,26 +186,13 @@ async function handleView(row: Required<CleanForm>) {
|
||||
<template #action="{ row }">
|
||||
<Space>
|
||||
<ghost-button @click.stop="handleView(row)"> 查看 </ghost-button>
|
||||
<ghost-button
|
||||
v-access:code="['property:clean:edit']"
|
||||
@click.stop="handleEdit(row)"
|
||||
>
|
||||
{{ $t('pages.common.edit') }}
|
||||
</ghost-button>
|
||||
<Popconfirm
|
||||
:get-popup-container="getVxePopupContainer"
|
||||
placement="left"
|
||||
title="确认删除?"
|
||||
@confirm="handleDelete(row)"
|
||||
>
|
||||
<ghost-button
|
||||
danger
|
||||
v-access:code="['property:clean:remove']"
|
||||
@click.stop=""
|
||||
>
|
||||
{{ $t('pages.common.delete') }}
|
||||
</ghost-button>
|
||||
</Popconfirm>
|
||||
<template v-if="row.state === 0">
|
||||
<ghost-button type="primary" @click.stop="handleAudit(row)">审核</ghost-button>
|
||||
</template>
|
||||
<template v-else>
|
||||
<ghost-button danger @click.stop="handleRefund(row)" v-if="row.isUnbooking === 0">退定</ghost-button>
|
||||
<ghost-button disabled v-else>已退定</ghost-button>
|
||||
</template>
|
||||
</Space>
|
||||
</template>
|
||||
</BasicTable>
|
||||
|
Reference in New Issue
Block a user