feat: 会议室查看
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>
|
||||
|
Reference in New Issue
Block a user