产值管理
This commit is contained in:
@ -158,6 +158,7 @@ export interface CailiaoshebeiQuery extends PageQuery {
|
|||||||
*/
|
*/
|
||||||
batchId?: string | number;
|
batchId?: string | number;
|
||||||
projectId?: string | number;
|
projectId?: string | number;
|
||||||
|
batchNumber?: string;
|
||||||
/**
|
/**
|
||||||
* 供货商ID
|
* 供货商ID
|
||||||
*/
|
*/
|
||||||
|
9
src/api/out/outDesignTable/index.ts
Normal file
9
src/api/out/outDesignTable/index.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
export function listOutTable(query: any) {
|
||||||
|
return request({
|
||||||
|
url: '/out/table/monthlyPurchase',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
}
|
9
src/api/out/outDesignTableVS/index.ts
Normal file
9
src/api/out/outDesignTableVS/index.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
export function listOutTable(query: any) {
|
||||||
|
return request({
|
||||||
|
url: '/out/table/comparisonOfCompletionAndSettlement',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
}
|
9
src/api/out/outTable/index.ts
Normal file
9
src/api/out/outTable/index.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
export function listOutTable(query: any) {
|
||||||
|
return request({
|
||||||
|
url: '/out/table/monthlyConstruct',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
}
|
9
src/api/out/ownerSettlement/index.ts
Normal file
9
src/api/out/ownerSettlement/index.ts
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
import request from '@/utils/request';
|
||||||
|
|
||||||
|
export function listOutTable(query: any) {
|
||||||
|
return request({
|
||||||
|
url: '/out/table/comparisonOfOwnerAndSub',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
});
|
||||||
|
}
|
@ -64,7 +64,7 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<el-input v-model="batchId" placeholder="请输入批次号" @input="getBatchList" prefix-icon="Search" clearable />
|
<el-input v-model="queryParams.batchNumber" placeholder="请输入批次号" @input="getBatchList" prefix-icon="Search" clearable />
|
||||||
<el-tree
|
<el-tree
|
||||||
ref="batchTreeRef"
|
ref="batchTreeRef"
|
||||||
class="mt-2"
|
class="mt-2"
|
||||||
@ -76,6 +76,13 @@
|
|||||||
default-expand-all
|
default-expand-all
|
||||||
@node-click="handleNodeClick"
|
@node-click="handleNodeClick"
|
||||||
></el-tree>
|
></el-tree>
|
||||||
|
<pagination
|
||||||
|
v-show="total > 0"
|
||||||
|
:total="total"
|
||||||
|
v-model:page="queryParams.pageNum"
|
||||||
|
v-model:limit="queryParams.pageSize"
|
||||||
|
@pagination="getBatchList"
|
||||||
|
/>
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :lg="20" :xs="24">
|
<el-col :lg="20" :xs="24">
|
||||||
@ -166,14 +173,6 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
|
||||||
v-show="total > 0"
|
|
||||||
:total="total"
|
|
||||||
v-model:page="queryParams.pageNum"
|
|
||||||
v-model:limit="queryParams.pageSize"
|
|
||||||
@pagination="getList"
|
|
||||||
/>
|
|
||||||
</el-card>
|
</el-card>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@ -267,7 +266,6 @@ const single = ref(true);
|
|||||||
const multiple = ref(true);
|
const multiple = ref(true);
|
||||||
const total = ref(0);
|
const total = ref(0);
|
||||||
const batchOptions = ref<any[]>([]);
|
const batchOptions = ref<any[]>([]);
|
||||||
const batchId = ref('');
|
|
||||||
|
|
||||||
const queryFormRef = ref<ElFormInstance>();
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
const cailiaoshebeiFormRef = ref<ElFormInstance>();
|
const cailiaoshebeiFormRef = ref<ElFormInstance>();
|
||||||
@ -305,6 +303,7 @@ const data = reactive<PageData<CailiaoshebeiForm, CailiaoshebeiQuery>>({
|
|||||||
supplier: undefined,
|
supplier: undefined,
|
||||||
name: undefined,
|
name: undefined,
|
||||||
projectId: currentProject.value.id,
|
projectId: currentProject.value.id,
|
||||||
|
batchNumber: undefined,
|
||||||
supply: undefined,
|
supply: undefined,
|
||||||
specification: undefined,
|
specification: undefined,
|
||||||
signalment: undefined,
|
signalment: undefined,
|
||||||
@ -328,19 +327,15 @@ const getList = async () => {
|
|||||||
loading.value = true;
|
loading.value = true;
|
||||||
const res = await listCailiaoshebei(queryParams.value);
|
const res = await listCailiaoshebei(queryParams.value);
|
||||||
cailiaoshebeiList.value = res.rows;
|
cailiaoshebeiList.value = res.rows;
|
||||||
total.value = res.total;
|
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
//查询批次列表
|
//查询批次列表
|
||||||
const getBatchList = async () => {
|
const getBatchList = async () => {
|
||||||
const res = await listBatch({
|
const res = await listBatch(queryParams.value);
|
||||||
pageNum: 1,
|
|
||||||
pageSize: 1000,
|
|
||||||
projectId: currentProject.value.id,
|
|
||||||
batchNumber: batchId.value
|
|
||||||
});
|
|
||||||
batchOptions.value = res.rows;
|
batchOptions.value = res.rows;
|
||||||
|
total.value = res.total;
|
||||||
try {
|
try {
|
||||||
queryParams.value.batchId = res.rows[0].id;
|
queryParams.value.batchId = res.rows[0].id;
|
||||||
form.value.batchId = res.rows[0].id;
|
form.value.batchId = res.rows[0].id;
|
||||||
|
127
src/views/out/outDesignTable/index.vue
Normal file
127
src/views/out/outDesignTable/index.vue
Normal file
@ -0,0 +1,127 @@
|
|||||||
|
<template>
|
||||||
|
<div class="p-2">
|
||||||
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||||
|
<div v-show="showSearch" class="mb-[10px]">
|
||||||
|
<el-card shadow="hover">
|
||||||
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||||
|
<el-form-item label="计划月份" prop="month">
|
||||||
|
<el-date-picker v-model="queryParams.month" type="month" value-format="YYYY-MM" placeholder="请选择计划月份" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="产值类型" prop="valueType">
|
||||||
|
<el-select v-model="queryParams.valueType" placeholder="请选择产值类型">
|
||||||
|
<el-option v-for="item in out_value_type" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
|
<el-card shadow="never">
|
||||||
|
<template #header>
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['out:valueAllocation:export']">导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="valueAllocationList">
|
||||||
|
<el-table-column label="项目" align="center" prop="projectName" />
|
||||||
|
<el-table-column label="月预计产值" align="center" prop="monthEstimatedValue" />
|
||||||
|
<el-table-column label="完成产值月合计" align="center" prop="monthCompletionValue" />
|
||||||
|
<el-table-column label="产值差额" align="center" prop="valueDifference" />
|
||||||
|
<el-table-column label="项目总产值" align="center" prop="totalValue" />
|
||||||
|
<el-table-column label="累计完成产值" align="center" prop="accumulatedCompletionValue" />
|
||||||
|
<el-table-column label="项目完成率" align="center" prop="projectCompletionRate" />
|
||||||
|
</el-table>
|
||||||
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="ValueAllocation" lang="ts">
|
||||||
|
import { listOutTable } from '@/api/out/outDesignTable';
|
||||||
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
|
import { dayjs } from 'element-plus';
|
||||||
|
// 获取用户 store
|
||||||
|
const userStore = useUserStoreHook();
|
||||||
|
// 从 store 中获取项目列表和当前选中的项目
|
||||||
|
const currentProject = computed(() => userStore.selectedProject);
|
||||||
|
const valueAllocationList = ref([]);
|
||||||
|
const loading = ref(true);
|
||||||
|
const showSearch = ref(true);
|
||||||
|
const total = ref(0);
|
||||||
|
const { out_value_type } = toRefs<any>(proxy?.useDict('out_value_type'));
|
||||||
|
|
||||||
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
|
const data = reactive({
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
valueType: undefined,
|
||||||
|
projectId: currentProject.value.id,
|
||||||
|
month: undefined
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const { queryParams } = toRefs(data);
|
||||||
|
|
||||||
|
/** 查询项目总产值分配列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true;
|
||||||
|
|
||||||
|
const res = await listOutTable(queryParams.value);
|
||||||
|
valueAllocationList.value = res.rows;
|
||||||
|
total.value = res.total;
|
||||||
|
loading.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
queryParams.value.pageNum = 1;
|
||||||
|
getList();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value?.resetFields();
|
||||||
|
handleQuery();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = () => {
|
||||||
|
proxy?.download(
|
||||||
|
'out/valueAllocation/export',
|
||||||
|
{
|
||||||
|
...queryParams.value
|
||||||
|
},
|
||||||
|
`valueAllocation_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
// 也可以使用字符串格式(例如 YYYY-MM)
|
||||||
|
const currentMonthString = ref(dayjs().format('YYYY-MM'));
|
||||||
|
queryParams.value.month = currentMonthString.value;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
|
||||||
|
//监听项目id刷新数据
|
||||||
|
const listeningProject = watch(
|
||||||
|
() => currentProject.value.id,
|
||||||
|
(nid, oid) => {
|
||||||
|
queryParams.value.projectId = nid;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
listeningProject();
|
||||||
|
});
|
||||||
|
</script>
|
135
src/views/out/outDesignTableVS/index.vue
Normal file
135
src/views/out/outDesignTableVS/index.vue
Normal file
@ -0,0 +1,135 @@
|
|||||||
|
<template>
|
||||||
|
<div class="p-2">
|
||||||
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||||
|
<div v-show="showSearch" class="mb-[10px]">
|
||||||
|
<el-card shadow="hover">
|
||||||
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||||
|
<el-form-item label="计划月份" prop="month">
|
||||||
|
<el-date-picker v-model="queryParams.month" type="month" value-format="YYYY-MM" placeholder="请选择计划月份" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="产值类型" prop="valueType">
|
||||||
|
<el-select v-model="queryParams.valueType" placeholder="请选择产值类型">
|
||||||
|
<el-option v-for="item in out_value_type" :key="item.value" :label="item.label" :value="item.value" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
|
<el-card shadow="never">
|
||||||
|
<template #header>
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['out:valueAllocation:export']">导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="valueAllocationList">
|
||||||
|
<el-table-column label="项目" align="center" prop="projectName" />
|
||||||
|
<el-table-column label="累计完工产值" align="center" prop="totalCompletionOutputValue" />
|
||||||
|
<el-table-column label="累计结算产值" align="center" prop="totalSettlementOutputValue" />
|
||||||
|
<el-table-column label="完工未结算额" align="center" prop="completionUnsettledAmount" />
|
||||||
|
<el-table-column label="完工未结算比例" align="center" prop="completionUnsettledRatio" />
|
||||||
|
<el-table-column label="操作" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button type="primary" @click="handleEdit(scope.row)" link icon="Position">联查分包结算</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="ValueAllocation" lang="ts">
|
||||||
|
import { listOutTable } from '@/api/out/outDesignTableVS';
|
||||||
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
|
import { dayjs } from 'element-plus';
|
||||||
|
// 获取用户 store
|
||||||
|
const userStore = useUserStoreHook();
|
||||||
|
// 从 store 中获取项目列表和当前选中的项目
|
||||||
|
const currentProject = computed(() => userStore.selectedProject);
|
||||||
|
const valueAllocationList = ref([]);
|
||||||
|
const loading = ref(true);
|
||||||
|
const showSearch = ref(true);
|
||||||
|
const total = ref(0);
|
||||||
|
const { out_value_type } = toRefs<any>(proxy?.useDict('out_value_type'));
|
||||||
|
|
||||||
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
|
const data = reactive({
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
valueType: '1',
|
||||||
|
projectId: currentProject.value.id,
|
||||||
|
month: undefined
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const { queryParams } = toRefs(data);
|
||||||
|
|
||||||
|
/** 查询项目总产值分配列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true;
|
||||||
|
|
||||||
|
const res = await listOutTable(queryParams.value);
|
||||||
|
valueAllocationList.value = res.rows;
|
||||||
|
total.value = res.total;
|
||||||
|
loading.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
queryParams.value.pageNum = 1;
|
||||||
|
getList();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 联查分包结算 */
|
||||||
|
const handleEdit = (row: any) => {
|
||||||
|
proxy?.$tab.openPage('/out/settlementValueSubcontract');
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value?.resetFields();
|
||||||
|
handleQuery();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = () => {
|
||||||
|
proxy?.download(
|
||||||
|
'out/valueAllocation/export',
|
||||||
|
{
|
||||||
|
...queryParams.value
|
||||||
|
},
|
||||||
|
`valueAllocation_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
// 也可以使用字符串格式(例如 YYYY-MM)
|
||||||
|
const currentMonthString = ref(dayjs().format('YYYY-MM'));
|
||||||
|
queryParams.value.month = currentMonthString.value;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
|
||||||
|
//监听项目id刷新数据
|
||||||
|
const listeningProject = watch(
|
||||||
|
() => currentProject.value.id,
|
||||||
|
(nid, oid) => {
|
||||||
|
queryParams.value.projectId = nid;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
listeningProject();
|
||||||
|
});
|
||||||
|
</script>
|
@ -1,16 +1,127 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>init</div>
|
<div class="p-2">
|
||||||
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||||
|
<div v-show="showSearch" class="mb-[10px]">
|
||||||
|
<el-card shadow="hover">
|
||||||
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||||
|
<el-form-item label="计划月份" prop="month">
|
||||||
|
<el-date-picker v-model="queryParams.month" type="month" value-format="YYYY-MM" placeholder="请选择计划月份" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
|
<el-card shadow="never">
|
||||||
|
<template #header>
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['out:valueAllocation:export']">导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="valueAllocationList">
|
||||||
|
<el-table-column label="项目" align="center" prop="projectName" />
|
||||||
|
<el-table-column label="项目总产值" align="center" prop="totalValue" />
|
||||||
|
<el-table-column label="月预计产值" align="center" prop="monthlyEstimatedValue" />
|
||||||
|
<el-table-column label="完成产值(第一周)" align="center" prop="firstWeekCompletionValue" />
|
||||||
|
<el-table-column label="完成产值(第二周)" align="center" prop="secondWeekCompletionValue" />
|
||||||
|
<el-table-column label="完成产值(第三周)" align="center" prop="thirdWeekCompletionValue" />
|
||||||
|
<el-table-column label="完成产值(第四周)" align="center" prop="fourthWeekCompletionValue" />
|
||||||
|
<el-table-column label="完成产值(第五周)" align="center" prop="fifthWeekCompletionValue" />
|
||||||
|
<el-table-column label="完成产值月合计" align="center" prop="totalCompletionValue" />
|
||||||
|
<el-table-column label="产值差额" align="center" prop="valueDifference" />
|
||||||
|
<el-table-column label="预计累计产值" align="center" prop="estimatedAccumulatedValue" />
|
||||||
|
<el-table-column label="累计完成产值" align="center" prop="accumulatedCompletionValue" />
|
||||||
|
<el-table-column label="产值差额" align="center" prop="valueDifferenceAccumulation" />
|
||||||
|
<el-table-column label="项目完成总进度" align="center" prop="totalCompletionProgress" />
|
||||||
|
</el-table>
|
||||||
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script setup name="ValueAllocation" lang="ts">
|
||||||
import { defineComponent } from 'vue';
|
import { listOutTable } from '@/api/out/outTable';
|
||||||
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
|
import { dayjs } from 'element-plus';
|
||||||
|
// 获取用户 store
|
||||||
|
const userStore = useUserStoreHook();
|
||||||
|
// 从 store 中获取项目列表和当前选中的项目
|
||||||
|
const currentProject = computed(() => userStore.selectedProject);
|
||||||
|
const valueAllocationList = ref([]);
|
||||||
|
const loading = ref(true);
|
||||||
|
const showSearch = ref(true);
|
||||||
|
const total = ref(0);
|
||||||
|
|
||||||
export default defineComponent({
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
setup() {
|
const data = reactive({
|
||||||
// todo
|
queryParams: {
|
||||||
return {};
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
projectId: currentProject.value.id,
|
||||||
|
month: undefined
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="stylus" scoped></style>
|
const { queryParams } = toRefs(data);
|
||||||
|
|
||||||
|
/** 查询项目总产值分配列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true;
|
||||||
|
|
||||||
|
const res = await listOutTable(queryParams.value);
|
||||||
|
valueAllocationList.value = res.rows;
|
||||||
|
total.value = res.total;
|
||||||
|
loading.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
queryParams.value.pageNum = 1;
|
||||||
|
getList();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value?.resetFields();
|
||||||
|
handleQuery();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = () => {
|
||||||
|
proxy?.download(
|
||||||
|
'out/valueAllocation/export',
|
||||||
|
{
|
||||||
|
...queryParams.value
|
||||||
|
},
|
||||||
|
`valueAllocation_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
// 也可以使用字符串格式(例如 YYYY-MM)
|
||||||
|
const currentMonthString = ref(dayjs().format('YYYY-MM'));
|
||||||
|
queryParams.value.month = currentMonthString.value;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
|
||||||
|
//监听项目id刷新数据
|
||||||
|
const listeningProject = watch(
|
||||||
|
() => currentProject.value.id,
|
||||||
|
(nid, oid) => {
|
||||||
|
queryParams.value.projectId = nid;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
listeningProject();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
130
src/views/out/ownerSettlement/index.vue
Normal file
130
src/views/out/ownerSettlement/index.vue
Normal file
@ -0,0 +1,130 @@
|
|||||||
|
<!-- 结算产值 VS 业主结算报表z -->
|
||||||
|
<template>
|
||||||
|
<div class="p-2">
|
||||||
|
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||||
|
<div v-show="showSearch" class="mb-[10px]">
|
||||||
|
<el-card shadow="hover">
|
||||||
|
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||||
|
<el-form-item label="计划月份" prop="month">
|
||||||
|
<el-date-picker v-model="queryParams.month" type="month" value-format="YYYY-MM" placeholder="请选择计划月份" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</transition>
|
||||||
|
<el-card shadow="never">
|
||||||
|
<template #header>
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['out:valueAllocation:export']">导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="valueAllocationList">
|
||||||
|
<el-table-column label="项目" align="center" prop="projectName" />
|
||||||
|
<el-table-column label="累计完工产值" align="center" prop="totalCompletionOutputValue" />
|
||||||
|
<el-table-column label="分包结算金额" align="center" prop="subTotalSettlementOutputValue" />
|
||||||
|
<el-table-column label="业主结算金额" align="center" prop="ownerTotalSettlementOutputValue" />
|
||||||
|
<el-table-column label="业主结算-分包结算" align="center" prop="differenceValue" />
|
||||||
|
<el-table-column label="操作" align="center">
|
||||||
|
<template #default="scope">
|
||||||
|
<el-button type="primary" @click="handleEdit(scope.row)" link icon="Position">联查分包结算</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||||
|
</el-card>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup name="ValueAllocation" lang="ts">
|
||||||
|
import { listOutTable } from '@/api/out/ownerSettlement';
|
||||||
|
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||||
|
import { useUserStoreHook } from '@/store/modules/user';
|
||||||
|
import { dayjs } from 'element-plus';
|
||||||
|
// 获取用户 store
|
||||||
|
const userStore = useUserStoreHook();
|
||||||
|
// 从 store 中获取项目列表和当前选中的项目
|
||||||
|
const currentProject = computed(() => userStore.selectedProject);
|
||||||
|
const valueAllocationList = ref([]);
|
||||||
|
const loading = ref(true);
|
||||||
|
const showSearch = ref(true);
|
||||||
|
const total = ref(0);
|
||||||
|
|
||||||
|
const queryFormRef = ref<ElFormInstance>();
|
||||||
|
const data = reactive({
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
valueType: undefined,
|
||||||
|
projectId: currentProject.value.id,
|
||||||
|
month: undefined
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
const { queryParams } = toRefs(data);
|
||||||
|
|
||||||
|
/** 查询项目总产值分配列表 */
|
||||||
|
const getList = async () => {
|
||||||
|
loading.value = true;
|
||||||
|
|
||||||
|
const res = await listOutTable(queryParams.value);
|
||||||
|
valueAllocationList.value = res.rows;
|
||||||
|
total.value = res.total;
|
||||||
|
loading.value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
const handleQuery = () => {
|
||||||
|
queryParams.value.pageNum = 1;
|
||||||
|
getList();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 联查分包结算 */
|
||||||
|
const handleEdit = (row: any) => {
|
||||||
|
proxy?.$tab.openPage('/out/settlementValueSubcontract');
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
const resetQuery = () => {
|
||||||
|
queryFormRef.value?.resetFields();
|
||||||
|
handleQuery();
|
||||||
|
};
|
||||||
|
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
const handleExport = () => {
|
||||||
|
proxy?.download(
|
||||||
|
'out/valueAllocation/export',
|
||||||
|
{
|
||||||
|
...queryParams.value
|
||||||
|
},
|
||||||
|
`valueAllocation_${new Date().getTime()}.xlsx`
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
// 也可以使用字符串格式(例如 YYYY-MM)
|
||||||
|
const currentMonthString = ref(dayjs().format('YYYY-MM'));
|
||||||
|
queryParams.value.month = currentMonthString.value;
|
||||||
|
getList();
|
||||||
|
});
|
||||||
|
|
||||||
|
//监听项目id刷新数据
|
||||||
|
const listeningProject = watch(
|
||||||
|
() => currentProject.value.id,
|
||||||
|
(nid, oid) => {
|
||||||
|
queryParams.value.projectId = nid;
|
||||||
|
getList();
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
onUnmounted(() => {
|
||||||
|
listeningProject();
|
||||||
|
});
|
||||||
|
</script>
|
Reference in New Issue
Block a user