first commit
This commit is contained in:
387
src/views/out/constructionValue/index.vue
Normal file
387
src/views/out/constructionValue/index.vue
Normal file
@ -0,0 +1,387 @@
|
||||
<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="reportDate">
|
||||
<el-date-picker clearable v-model="queryParams.reportDate" type="date" value-format="YYYY-MM-DD" 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="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['out:constructionValue:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['out:constructionValue:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="constructionValueList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<!-- <el-table-column label="主键ID" align="center" prop="id" v-if="true" /> -->
|
||||
<el-table-column label="上报日期" align="center" prop="reportDate" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.reportDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="项目子项" align="center" prop="subProjectName" />
|
||||
<el-table-column label="分部工程" align="center" prop="categoryName" />
|
||||
<el-table-column label="分项工程" align="center" prop="progressCategoryName" />
|
||||
<el-table-column label="人工填报数量" align="center" prop="artificialNum" />
|
||||
<el-table-column label="无人机识别数量" align="center" prop="uavNum" />
|
||||
<el-table-column label="确认数量" align="center" prop="confirmNum" />
|
||||
<el-table-column label="产值" align="center" prop="outValue" />
|
||||
<el-table-column label="流程状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="wf_business_status" :value="scope.row.auditStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="210">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['out:constructionValue:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['out:constructionValue:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
<el-button link type="primary" icon="Finished" @click="handleAudit(scope.row)" v-hasPermi="['out:constructionValue:remove']"
|
||||
>审核</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>
|
||||
<!-- 添加或修改施工产值对话框 -->
|
||||
<el-dialog draggable :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="constructionValueFormRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="方阵" prop="matrixId" v-if="!form.id">
|
||||
<el-cascader
|
||||
:options="matrixOptions"
|
||||
placeholder="请选择"
|
||||
:props="{ value: 'matrixId', label: 'name', emitPath: false }"
|
||||
v-model="form.matrixId"
|
||||
@clear="resetCascader(1)"
|
||||
@change="handleChange"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="分项工程" prop="progressCategoryId" v-if="!form.id">
|
||||
<el-cascader
|
||||
:options="progressCategoryList"
|
||||
v-model="form.progressCategoryId"
|
||||
@clear="resetCascader()"
|
||||
:disabled="!form.matrixId"
|
||||
@change="selectTime"
|
||||
:props="{ expandTrigger: 'hover', value: 'id', label: 'name', emitPath: false }"
|
||||
placeholder="请选择分项工程"
|
||||
clearable
|
||||
>
|
||||
</el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划日期" prop="reportDateId" v-if="!form.id">
|
||||
<el-cascader
|
||||
:options="progressTimeList"
|
||||
v-model="form.reportDateId"
|
||||
:disabled="!form.progressCategoryId"
|
||||
:props="{ expandTrigger: 'hover', value: 'id', label: 'date', emitPath: false }"
|
||||
placeholder="请选择计划日期"
|
||||
@change="submitTime"
|
||||
clearable
|
||||
>
|
||||
</el-cascader>
|
||||
</el-form-item>
|
||||
<el-form-item label="人工填报数量" prop="artificialNum">
|
||||
<el-input v-model="form.artificialNum" placeholder="请输入人工填报数量" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="无人机识别数量" prop="uavNum">
|
||||
<el-input v-model="form.uavNum" placeholder="请输入无人机识别数量" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="上报日期" prop="planDate">
|
||||
<el-date-picker v-model="form.planDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择上报日期" />
|
||||
</el-form-item>
|
||||
<el-form-item label="确认数量" prop="confirmNum">
|
||||
<el-input v-model="form.confirmNum" placeholder="请输入确认数量" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="产值" prop="outValue">
|
||||
<el-input v-model="form.outValue" disabled />
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="ConstructionValue" lang="ts">
|
||||
import {
|
||||
listConstructionValue,
|
||||
getConstructionValue,
|
||||
delConstructionValue,
|
||||
addConstructionValue,
|
||||
updateConstructionValue
|
||||
} from '@/api/out/constructionValue';
|
||||
import { ConstructionValueVO, ConstructionValueQuery, ConstructionValueForm } from '@/api/out/constructionValue/types';
|
||||
import { getProjectSquare, listProgressCategory, workScheduleList, workScheduleListDetail, workScheduleListPosition } from '@/api/progress/plan';
|
||||
import { ProgressCategoryVO } from '@/api/progress/plan/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const constructionValueList = ref<ConstructionValueVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const matrixOptions = ref([]);
|
||||
const progressCategoryList = ref<ProgressCategoryVO[]>([]);
|
||||
const progressTimeList = ref<any[]>([]);
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const constructionValueFormRef = ref<ElFormInstance>();
|
||||
const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status'));
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: ConstructionValueForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value?.id,
|
||||
matrixId: undefined,
|
||||
progressCategoryId: undefined,
|
||||
artificialNum: undefined,
|
||||
planNum: undefined,
|
||||
planDate: undefined,
|
||||
uavNum: undefined,
|
||||
confirmNum: undefined,
|
||||
outValue: undefined,
|
||||
reportDate: undefined,
|
||||
reportDateId: undefined,
|
||||
auditStatus: undefined
|
||||
};
|
||||
const data = reactive<PageData<ConstructionValueForm, ConstructionValueQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value?.id,
|
||||
matrixId: undefined,
|
||||
progressCategoryId: undefined,
|
||||
artificialNum: undefined,
|
||||
uavNum: undefined,
|
||||
confirmNum: undefined,
|
||||
outValue: undefined,
|
||||
reportDate: undefined,
|
||||
auditStatus: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
||||
projectId: [{ required: true, message: '项目ID不能为空', trigger: 'blur' }],
|
||||
matrixId: [{ required: true, message: '方阵id不能为空', trigger: 'blur' }],
|
||||
progressCategoryId: [{ required: true, message: '分项工程不能为空', trigger: 'blur' }],
|
||||
artificialNum: [{ required: true, message: '人工填报数量不能为空', trigger: 'blur' }],
|
||||
reportDateId: [{ required: true, message: '上报日期不能为空', trigger: 'blur' }],
|
||||
uavNum: [{ required: true, message: '无人机识别数量不能为空', trigger: 'blur' }],
|
||||
confirmNum: [{ required: true, message: '确认数量不能为空', trigger: 'blur' }],
|
||||
outValue: [{ required: true, message: '产值不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询施工产值列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listConstructionValue(queryParams.value);
|
||||
constructionValueList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
constructionValueFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: ConstructionValueVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = async () => {
|
||||
reset();
|
||||
const res = await getProjectSquare(currentProject.value?.id);
|
||||
if (res.data.length === 0) return proxy?.$modal.msgWarning('当前项目下没有方阵,请先创建方阵');
|
||||
const isFangzhen = res.data.some((item) => item.children && item.children.length);
|
||||
console.log('🚀 ~ handleAdd ~ isFangzhen:', isFangzhen);
|
||||
|
||||
if (!isFangzhen) return proxy?.$modal.msgWarning('当前项目下没有方阵,请先创建方阵');
|
||||
let matrixList = res.data.map((item) => {
|
||||
return {
|
||||
...item,
|
||||
matrixId: item?.projectId
|
||||
};
|
||||
});
|
||||
matrixOptions.value = matrixList;
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加施工产值';
|
||||
};
|
||||
|
||||
/** 方阵选择器改变事件 */
|
||||
const handleChange = async (value: number) => {
|
||||
queryParams.value.matrixId = value;
|
||||
const res = await listProgressCategory(queryParams.value);
|
||||
const data = proxy?.handleTree<ProgressCategoryVO>(res.data, 'id', 'pid');
|
||||
if (data) {
|
||||
progressCategoryList.value = data;
|
||||
console.log('🚀 ~ handleChange ~ progressCategoryList.value :', progressCategoryList.value);
|
||||
}
|
||||
};
|
||||
|
||||
/** 分项工程选择器改变事件 */
|
||||
const selectTime = async (value: string) => {
|
||||
const res = await workScheduleListDetail(value);
|
||||
console.log('🚀 ~ selectTime ~ res:', res);
|
||||
progressTimeList.value = res.rows;
|
||||
};
|
||||
|
||||
/** 上报日期选择器改变事件 */
|
||||
const submitTime = async (value: string) => {
|
||||
const data = progressTimeList.value.filter((item) => item.id === value)[0];
|
||||
form.value.uavNum = data?.aiFill;
|
||||
form.value.reportDate = data?.date;
|
||||
form.value.planNum = data?.planNumber;
|
||||
form.value.artificialNum = data?.finishedNumber;
|
||||
};
|
||||
|
||||
/** 重置选择器 */
|
||||
const resetCascader = (index?: number) => {
|
||||
if (index) {
|
||||
form.value.progressCategoryId = undefined;
|
||||
}
|
||||
form.value.reportDate = undefined;
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: ConstructionValueVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getConstructionValue(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改施工产值';
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
constructionValueFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateConstructionValue(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
console.log('🚀 ~ submitForm ~ form.value :', form.value);
|
||||
await addConstructionValue(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
reset();
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: ConstructionValueVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除施工产值编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delConstructionValue(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
/** 审核按钮操作 */
|
||||
const handleAudit = async (row?: ConstructionValueVO) => {
|
||||
proxy?.$tab.openPage('/approval/constructionValue/indexEdit', '审核施工产值', {
|
||||
id: row?.id,
|
||||
type: 'update'
|
||||
});
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'out/constructionValue/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`constructionValue_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
</script>
|
||||
384
src/views/out/constructionValue/indexEdit.vue
Normal file
384
src/views/out/constructionValue/indexEdit.vue
Normal file
@ -0,0 +1,384 @@
|
||||
<template>
|
||||
<div class="p-4 bg-gray-50">
|
||||
<div class="max-w-4xl mx-auto">
|
||||
<!-- 顶部按钮区域 -->
|
||||
<el-card class="mb-4 rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md">
|
||||
<approvalButton
|
||||
@submitForm="submitForm"
|
||||
@approvalVerifyOpen="approvalVerifyOpen"
|
||||
@handleApprovalRecord="handleApprovalRecord"
|
||||
:buttonLoading="buttonLoading"
|
||||
:id="form.id"
|
||||
:status="form.auditStatus"
|
||||
:pageType="routeParams.type"
|
||||
/>
|
||||
</el-card>
|
||||
<!-- 表单区域 -->
|
||||
<el-card class="rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md overflow-hidden">
|
||||
<div class="p-4 bg-gradient-to-r from-blue-50 to-indigo-50 border-b border-gray-100">
|
||||
<h3 class="text-lg font-semibold text-gray-800">施工产值</h3>
|
||||
</div>
|
||||
<div class="p-6">
|
||||
<el-form
|
||||
ref="leaveFormRef"
|
||||
v-loading="loading"
|
||||
:disabled="routeParams.type === 'view' || form.auditStatus == 'waiting'"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="120px"
|
||||
class="space-y-4"
|
||||
>
|
||||
<div class="grid grid-cols-1 gap-4">
|
||||
<el-row :gutter="20" justify="center">
|
||||
<el-col :span="13" :offset="0">
|
||||
<el-form-item label="方阵" prop="matrixName">
|
||||
<el-input v-model="form.matrixName" clearable disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="13" :offset="0">
|
||||
<el-form-item label="分项工程" prop="progressCategoryName">
|
||||
<el-input v-model="form.progressCategoryName" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="13" :offset="0">
|
||||
<el-form-item label="计划日期" prop="planDate">
|
||||
<el-input v-model="form.planDate" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="13" :offset="0">
|
||||
<el-form-item label="人工填报数量" prop="artificialNum">
|
||||
<el-input v-model="form.artificialNum" placeholder="请输入人工填报数量" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="13" :offset="0">
|
||||
<el-form-item label="无人机识别数量" prop="uavNum">
|
||||
<el-input v-model="form.uavNum" placeholder="请输入无人机识别数量" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="13" :offset="0">
|
||||
<el-form-item label="上报日期" prop="planDate">
|
||||
<el-date-picker v-model="form.planDate" type="date" value-format="YYYY-MM-DD" disabled placeholder="请选择上报日期" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="13" :offset="0">
|
||||
<el-form-item label="确认数量" prop="confirmNum">
|
||||
<el-input v-model="form.confirmNum" placeholder="请输入确认数量" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<!-- 提交组件 -->
|
||||
<submitVerify ref="submitVerifyRef" :task-variables="taskVariables" @submit-callback="submitCallback" />
|
||||
<approvalRecord ref="approvalRecordRef"></approvalRecord>
|
||||
<!-- 流程选择对话框 -->
|
||||
<el-dialog
|
||||
draggable
|
||||
v-model="dialogVisible.visible"
|
||||
:title="dialogVisible.title"
|
||||
:before-close="handleClose"
|
||||
width="500"
|
||||
class="rounded-lg shadow-lg"
|
||||
>
|
||||
<div class="p-4">
|
||||
<p class="text-gray-600 mb-4">请选择要启动的流程:</p>
|
||||
<el-select v-model="flowCode" placeholder="请选择流程" style="width: 100%">
|
||||
<el-option v-for="item in flowCodeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer p-4 border-t border-gray-100 flex justify-end space-x-3">
|
||||
<el-button @click="handleClose" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition-colors"
|
||||
>取消</el-button
|
||||
>
|
||||
<el-button type="primary" @click="submitFlow()" class="px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors"
|
||||
>确认</el-button
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Leave" lang="ts">
|
||||
import { LeaveForm, LeaveQuery, LeaveVO } from '@/api/workflow/leave/types';
|
||||
import { startWorkFlow } from '@/api/workflow/task';
|
||||
import SubmitVerify from '@/components/Process/submitVerify.vue';
|
||||
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
||||
import ApprovalButton from '@/components/Process/approvalButton.vue';
|
||||
import { StartProcessBo } from '@/api/workflow/workflowCommon/types';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
const { design_change_reason_type } = toRefs<any>(proxy?.useDict('design_change_reason_type'));
|
||||
import { getKnowledgeDocument } from '@/api/design/technicalStandard';
|
||||
import { getConstructionValue } from '@/api/out/constructionValue';
|
||||
import { workScheduleListDetail } from '@/api/progress/plan';
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
//路由参数
|
||||
const routeParams = ref<Record<string, any>>({});
|
||||
const flowCode = ref<string>('');
|
||||
const status = ref<string>('');
|
||||
const dialogVisible = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: '流程定义'
|
||||
});
|
||||
//提交组件
|
||||
const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>();
|
||||
//审批记录组件
|
||||
const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
|
||||
//按钮组件
|
||||
const flowCodeOptions = [
|
||||
{
|
||||
value: currentProject.value?.id + '_constructionValue',
|
||||
label: '施工产值审批'
|
||||
}
|
||||
];
|
||||
|
||||
const leaveFormRef = ref<ElFormInstance>();
|
||||
const dialog = reactive({
|
||||
visible: false,
|
||||
title: '',
|
||||
isEdit: false
|
||||
});
|
||||
const submitFormData = ref<StartProcessBo>({
|
||||
businessId: '',
|
||||
flowCode: '',
|
||||
variables: {}
|
||||
});
|
||||
const taskVariables = ref<Record<string, any>>({});
|
||||
|
||||
const initFormData = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value?.id,
|
||||
matrixName: undefined,
|
||||
progressCategoryName: undefined,
|
||||
artificialNum: undefined,
|
||||
planNum: undefined,
|
||||
planDate: undefined,
|
||||
uavNum: undefined,
|
||||
confirmNum: undefined,
|
||||
outValue: undefined,
|
||||
reportDate: undefined,
|
||||
reportDateId: undefined,
|
||||
auditStatus: undefined
|
||||
};
|
||||
const data = reactive({
|
||||
form: { ...initFormData },
|
||||
rules: {}
|
||||
});
|
||||
|
||||
const handleClose = () => {
|
||||
dialogVisible.visible = false;
|
||||
flowCode.value = '';
|
||||
buttonLoading.value = false;
|
||||
};
|
||||
const { form, rules } = toRefs(data);
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
leaveFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 获取详情 */
|
||||
const getInfo = () => {
|
||||
loading.value = true;
|
||||
buttonLoading.value = false;
|
||||
nextTick(async () => {
|
||||
const res = await getConstructionValue(routeParams.value.id);
|
||||
Object.assign(form.value, res.data);
|
||||
loading.value = false;
|
||||
buttonLoading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = (status1: string) => {
|
||||
status.value = status1;
|
||||
submit(status.value, form.value);
|
||||
};
|
||||
|
||||
const submitFlow = async () => {
|
||||
handleStartWorkFlow(form.value);
|
||||
dialogVisible.visible = false;
|
||||
};
|
||||
//提交申请
|
||||
const handleStartWorkFlow = async (data: LeaveForm) => {
|
||||
try {
|
||||
submitFormData.value.flowCode = flowCode.value;
|
||||
submitFormData.value.businessId = data.id;
|
||||
//流程变量
|
||||
taskVariables.value = {
|
||||
// leave4/5 使用的流程变量
|
||||
userList: ['1', '3', '4']
|
||||
};
|
||||
submitFormData.value.variables = taskVariables.value;
|
||||
const resp = await startWorkFlow(submitFormData.value);
|
||||
if (submitVerifyRef.value) {
|
||||
buttonLoading.value = false;
|
||||
submitVerifyRef.value.openDialog(resp.data.taskId);
|
||||
}
|
||||
} finally {
|
||||
buttonLoading.value = false;
|
||||
}
|
||||
};
|
||||
//审批记录
|
||||
const handleApprovalRecord = () => {
|
||||
approvalRecordRef.value.init(form.value.id);
|
||||
};
|
||||
//提交回调
|
||||
const submitCallback = async () => {
|
||||
await proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.go(-1);
|
||||
};
|
||||
//审批
|
||||
const approvalVerifyOpen = async () => {
|
||||
submitVerifyRef.value.openDialog(routeParams.value.taskId);
|
||||
};
|
||||
// 图纸上传成功之后 开始提交
|
||||
const submit = async (status, data) => {
|
||||
form.value = data;
|
||||
if (status === 'draft') {
|
||||
buttonLoading.value = false;
|
||||
proxy?.$modal.msgSuccess('暂存成功');
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.go(-1);
|
||||
} else {
|
||||
if ((form.value.auditStatus === 'draft' && (flowCode.value === '' || flowCode.value === null)) || routeParams.value.type === 'add') {
|
||||
flowCode.value = flowCodeOptions[0].value;
|
||||
dialogVisible.visible = true;
|
||||
return;
|
||||
}
|
||||
//说明启动过先随意穿个参数
|
||||
if (flowCode.value === '' || flowCode.value === null) {
|
||||
flowCode.value = 'xx';
|
||||
}
|
||||
await handleStartWorkFlow(data);
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
nextTick(async () => {
|
||||
routeParams.value = proxy.$route.query;
|
||||
console.log('🚀 ~ proxy.$route.query:', proxy.$route.query);
|
||||
reset();
|
||||
loading.value = false;
|
||||
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
|
||||
getInfo();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
/* 全局样式 */
|
||||
:root {
|
||||
--primary: #409eff;
|
||||
--primary-light: #66b1ff;
|
||||
--primary-dark: #3a8ee6;
|
||||
--success: #67c23a;
|
||||
--warning: #e6a23c;
|
||||
--danger: #f56c6c;
|
||||
--info: #909399;
|
||||
}
|
||||
|
||||
/* 表单样式优化 */
|
||||
.el-form-item {
|
||||
.el-form-item__label {
|
||||
color: #606266;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.el-input__inner,
|
||||
.el-select .el-input__inner {
|
||||
border-radius: 4px;
|
||||
transition:
|
||||
border-color 0.2s,
|
||||
box-shadow 0.2s;
|
||||
|
||||
&:focus {
|
||||
border-color: var(--primary-light);
|
||||
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.el-textarea__inner {
|
||||
border-radius: 4px;
|
||||
transition:
|
||||
border-color 0.2s,
|
||||
box-shadow 0.2s;
|
||||
|
||||
&:focus {
|
||||
border-color: var(--primary-light);
|
||||
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 按钮样式优化 */
|
||||
.el-button {
|
||||
border-radius: 4px;
|
||||
transition: all 0.2s;
|
||||
|
||||
&.is-primary {
|
||||
background-color: var(--primary);
|
||||
border-color: var(--primary);
|
||||
|
||||
&:hover {
|
||||
background-color: var(--primary-light);
|
||||
border-color: var(--primary-light);
|
||||
}
|
||||
|
||||
&:active {
|
||||
background-color: var(--primary-dark);
|
||||
border-color: var(--primary-dark);
|
||||
}
|
||||
}
|
||||
|
||||
&.is-text {
|
||||
color: var(--primary);
|
||||
|
||||
&:hover {
|
||||
color: var(--primary-light);
|
||||
background-color: rgba(64, 158, 255, 0.05);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 卡片样式优化 */
|
||||
.el-card {
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
/* transform: translateY(-2px); */
|
||||
}
|
||||
}
|
||||
|
||||
/* 对话框样式优化 */
|
||||
.el-dialog {
|
||||
.el-dialog__header {
|
||||
background-color: #f5f7fa;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
padding: 15px 20px;
|
||||
}
|
||||
|
||||
.el-dialog__title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.el-dialog__footer {
|
||||
padding: 15px 20px;
|
||||
border-top: 1px solid #ebeef5;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
290
src/views/out/designCompletion/index.vue
Normal file
290
src/views/out/designCompletion/index.vue
Normal file
@ -0,0 +1,290 @@
|
||||
<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="planMonth">
|
||||
<el-date-picker v-model="queryParams.planMonth" 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">
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="monthPlanList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="计划月份" align="center" prop="planMonth" />
|
||||
<el-table-column label="计划产值" align="center" prop="planValue" />
|
||||
<el-table-column label="完成产值" align="center" prop="completeValue" />
|
||||
<el-table-column label="差额" align="center" prop="differenceValue" />
|
||||
<el-table-column label="产值类型" align="center" prop="valueType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="out_value_type" :value="scope.row.valueType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="流程状态" align="center" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="wf_business_status" :value="scope.row.completeAuditStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="210">
|
||||
<template #default="scope">
|
||||
<el-button type="primary" link icon="Edit" @click="handleAdd(scope.row)" v-hasPermi="['out:monthPlan:add']">编辑</el-button>
|
||||
|
||||
<el-button link type="primary" icon="Finished" @click="handleAudit(scope.row)" v-hasPermi="['out:constructionValue:remove']"
|
||||
>审核</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>
|
||||
<!-- 添加或修改月度产值计划对话框 -->
|
||||
<el-dialog draggable :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="monthPlanFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="所属项目" prop="projectId">
|
||||
<el-select v-model="form.projectId" placeholder="请选择所属项目" disabled>
|
||||
<el-option v-for="item in projectList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划月份" prop="planMonth">
|
||||
<el-date-picker
|
||||
v-model="form.planMonth"
|
||||
type="month"
|
||||
value-format="YYYY-MM"
|
||||
disabled
|
||||
placeholder="请选择计划月份"
|
||||
@change="handlePlanMonthChange"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="计划产值" prop="planValue">
|
||||
<el-input v-model="form.planValue" placeholder="请输入计划产值" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="完成产值" prop="completeValue">
|
||||
<el-input v-model="form.completeValue" placeholder="请输入完成产值" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="MonthPlan" lang="ts">
|
||||
import { listMonthPlan, getMonthPlan, delMonthPlan, addMonthPlan, updateMonthPlan, getMonth } from '@/api/out/monthPlan';
|
||||
import { MonthPlanVO, MonthPlanQuery, MonthPlanForm } from '@/api/out/monthPlan/types';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { out_value_type } = toRefs<any>(proxy?.useDict('out_value_type'));
|
||||
const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status'));
|
||||
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const projectList = computed(() => userStore.projects);
|
||||
const monthPlanList = ref<MonthPlanVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const monthPlanFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: MonthPlanForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value?.id,
|
||||
planValue: undefined,
|
||||
completeValue: undefined,
|
||||
differenceValue: undefined,
|
||||
isDesign: false,
|
||||
planMonth: undefined,
|
||||
valueType: '1',
|
||||
planAuditStatus: undefined,
|
||||
completeAuditStatus: undefined
|
||||
};
|
||||
const data = reactive<PageData<MonthPlanForm, MonthPlanQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: undefined,
|
||||
planValue: undefined,
|
||||
completeValue: undefined,
|
||||
differenceValue: undefined,
|
||||
planMonth: undefined,
|
||||
valueType: '1',
|
||||
planAuditStatus: undefined,
|
||||
completeAuditStatus: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
||||
projectId: [{ required: true, message: '项目ID不能为空', trigger: 'blur' }],
|
||||
planValue: [{ required: true, message: '计划产值不能为空', trigger: 'blur' }],
|
||||
planMonth: [{ required: true, message: '计划月份不能为空', trigger: 'blur' }],
|
||||
valueType: [{ required: true, message: '1-设计 2-采购 3-施工不能为空', trigger: 'change' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询月度产值计划列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listMonthPlan(queryParams.value);
|
||||
monthPlanList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
monthPlanFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: MonthPlanVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = (row?: MonthPlanVO) => {
|
||||
reset();
|
||||
if (row) {
|
||||
Object.assign(form.value, row);
|
||||
}
|
||||
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加设计完工产值';
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: MonthPlanVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getMonthPlan(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改设计完工产值';
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
monthPlanFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.isDesign = false;
|
||||
await updateMonthPlan(form.value).finally(() => (buttonLoading.value = false));
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: MonthPlanVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除月度产值计划编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delMonthPlan(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
/** 计划月份改变 */
|
||||
const handlePlanMonthChange = async (val: string) => {
|
||||
const res = await getMonth({
|
||||
projectId: form.value.projectId,
|
||||
planMonth: val,
|
||||
valueType: form.value.valueType
|
||||
});
|
||||
if (!res.data) return proxy?.$modal.msgError('该月份未计划');
|
||||
form.value.planValue = res.data.planValue;
|
||||
form.value.id = res.data.id;
|
||||
console.log(res);
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'out/monthPlan/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`monthPlan_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
||||
/** 审核按钮操作 */
|
||||
const handleAudit = async (row?: MonthPlanVO) => {
|
||||
proxy?.$tab.openPage('/approval/designCompletion/indexEdit', '审核设计完工产值', {
|
||||
id: row?.id,
|
||||
type: 'update'
|
||||
});
|
||||
};
|
||||
|
||||
//监听项目id刷新数据
|
||||
// const listeningProject = watch(
|
||||
// () => currentProject.value?.id,
|
||||
// (nid, oid) => {
|
||||
// queryParams.value.projectId = nid;
|
||||
// form.value.projectId = nid;
|
||||
// getList();
|
||||
// }
|
||||
// );
|
||||
|
||||
// onUnmounted(() => {
|
||||
// listeningProject();
|
||||
// });
|
||||
</script>
|
||||
356
src/views/out/designCompletion/indexEdit.vue
Normal file
356
src/views/out/designCompletion/indexEdit.vue
Normal file
@ -0,0 +1,356 @@
|
||||
<template>
|
||||
<div class="p-4 bg-gray-50">
|
||||
<div class="max-w-4xl mx-auto">
|
||||
<!-- 顶部按钮区域 -->
|
||||
<el-card class="mb-4 rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md">
|
||||
<approvalButton
|
||||
@submitForm="submitForm"
|
||||
@approvalVerifyOpen="approvalVerifyOpen"
|
||||
@handleApprovalRecord="handleApprovalRecord"
|
||||
:buttonLoading="buttonLoading"
|
||||
:id="form.id"
|
||||
:status="form.completeAuditStatus"
|
||||
:pageType="routeParams.type"
|
||||
/>
|
||||
</el-card>
|
||||
<!-- 表单区域 -->
|
||||
<el-card class="rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md overflow-hidden">
|
||||
<div class="p-4 bg-gradient-to-r from-blue-50 to-indigo-50 border-b border-gray-100">
|
||||
<h3 class="text-lg font-semibold text-gray-800">设计完工产值</h3>
|
||||
</div>
|
||||
<div class="p-6">
|
||||
<el-form
|
||||
ref="leaveFormRef"
|
||||
v-loading="loading"
|
||||
:disabled="routeParams.type === 'view' || form.completeAuditStatus == 'waiting'"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="120px"
|
||||
class="space-y-4"
|
||||
>
|
||||
<div class="grid grid-cols-1 gap-4">
|
||||
<el-row :gutter="20" justify="center">
|
||||
<el-col :span="13" :offset="0">
|
||||
<el-form-item label="计划月份" prop="planMonth">
|
||||
<el-input v-model="form.planMonth" clearable disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="13" :offset="0">
|
||||
<el-form-item label="完成产值" prop="completeValue">
|
||||
<el-input v-model="form.completeValue" disabled></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<!-- 提交组件 -->
|
||||
<submitVerify ref="submitVerifyRef" :task-variables="taskVariables" @submit-callback="submitCallback" />
|
||||
<approvalRecord ref="approvalRecordRef"></approvalRecord>
|
||||
<!-- 流程选择对话框 -->
|
||||
<el-dialog
|
||||
draggable
|
||||
v-model="dialogVisible.visible"
|
||||
:title="dialogVisible.title"
|
||||
:before-close="handleClose"
|
||||
width="500"
|
||||
class="rounded-lg shadow-lg"
|
||||
>
|
||||
<div class="p-4">
|
||||
<p class="text-gray-600 mb-4">请选择要启动的流程:</p>
|
||||
<el-select v-model="flowCode" placeholder="请选择流程" style="width: 100%">
|
||||
<el-option v-for="item in flowCodeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer p-4 border-t border-gray-100 flex justify-end space-x-3">
|
||||
<el-button @click="handleClose" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition-colors"
|
||||
>取消</el-button
|
||||
>
|
||||
<el-button type="primary" @click="submitFlow()" class="px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors"
|
||||
>确认</el-button
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Leave" lang="ts">
|
||||
import { LeaveForm, LeaveQuery, LeaveVO } from '@/api/workflow/leave/types';
|
||||
import { startWorkFlow } from '@/api/workflow/task';
|
||||
import SubmitVerify from '@/components/Process/submitVerify.vue';
|
||||
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
||||
import ApprovalButton from '@/components/Process/approvalButton.vue';
|
||||
import { StartProcessBo } from '@/api/workflow/workflowCommon/types';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
const { design_change_reason_type } = toRefs<any>(proxy?.useDict('design_change_reason_type'));
|
||||
import { getKnowledgeDocument } from '@/api/design/technicalStandard';
|
||||
import { getConstructionValue } from '@/api/out/constructionValue';
|
||||
import { workScheduleListDetail } from '@/api/progress/plan';
|
||||
import { getMonthPlan } from '@/api/out/monthPlan';
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
//路由参数
|
||||
const routeParams = ref<Record<string, any>>({});
|
||||
const flowCode = ref<string>('');
|
||||
const status = ref<string>('');
|
||||
const dialogVisible = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: '流程定义'
|
||||
});
|
||||
//提交组件
|
||||
const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>();
|
||||
//审批记录组件
|
||||
const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
|
||||
//按钮组件
|
||||
const flowCodeOptions = [
|
||||
{
|
||||
value: currentProject.value?.id + '_designCompleteValue',
|
||||
label: '设计完工产值审批'
|
||||
}
|
||||
];
|
||||
|
||||
const leaveFormRef = ref<ElFormInstance>();
|
||||
const dialog = reactive({
|
||||
visible: false,
|
||||
title: '',
|
||||
isEdit: false
|
||||
});
|
||||
const submitFormData = ref<StartProcessBo>({
|
||||
businessId: '',
|
||||
flowCode: '',
|
||||
variables: {}
|
||||
});
|
||||
const taskVariables = ref<Record<string, any>>({});
|
||||
|
||||
const initFormData = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value?.id,
|
||||
planValue: undefined,
|
||||
completeValue: undefined,
|
||||
differenceValue: undefined,
|
||||
planMonth: undefined,
|
||||
valueType: '1',
|
||||
planAuditStatus: undefined,
|
||||
completeAuditStatus: undefined
|
||||
};
|
||||
const data = reactive({
|
||||
form: { ...initFormData },
|
||||
rules: {}
|
||||
});
|
||||
|
||||
const handleClose = () => {
|
||||
dialogVisible.visible = false;
|
||||
flowCode.value = '';
|
||||
buttonLoading.value = false;
|
||||
};
|
||||
const { form, rules } = toRefs(data);
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
leaveFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 获取详情 */
|
||||
const getInfo = () => {
|
||||
loading.value = true;
|
||||
buttonLoading.value = false;
|
||||
nextTick(async () => {
|
||||
const res = await getMonthPlan(routeParams.value.id);
|
||||
Object.assign(form.value, res.data);
|
||||
loading.value = false;
|
||||
buttonLoading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = (status1: string) => {
|
||||
status.value = status1;
|
||||
submit(status.value, form.value);
|
||||
};
|
||||
|
||||
const submitFlow = async () => {
|
||||
handleStartWorkFlow(form.value);
|
||||
dialogVisible.visible = false;
|
||||
};
|
||||
//提交申请
|
||||
const handleStartWorkFlow = async (data: LeaveForm) => {
|
||||
try {
|
||||
submitFormData.value.flowCode = flowCode.value;
|
||||
submitFormData.value.businessId = data.id;
|
||||
//流程变量
|
||||
taskVariables.value = {
|
||||
// leave4/5 使用的流程变量
|
||||
userList: ['1', '3', '4']
|
||||
};
|
||||
submitFormData.value.variables = taskVariables.value;
|
||||
const resp = await startWorkFlow(submitFormData.value);
|
||||
if (submitVerifyRef.value) {
|
||||
buttonLoading.value = false;
|
||||
submitVerifyRef.value.openDialog(resp.data.taskId);
|
||||
}
|
||||
} finally {
|
||||
buttonLoading.value = false;
|
||||
}
|
||||
};
|
||||
//审批记录
|
||||
const handleApprovalRecord = () => {
|
||||
approvalRecordRef.value.init(form.value.id);
|
||||
};
|
||||
//提交回调
|
||||
const submitCallback = async () => {
|
||||
await proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.go(-1);
|
||||
};
|
||||
//审批
|
||||
const approvalVerifyOpen = async () => {
|
||||
submitVerifyRef.value.openDialog(routeParams.value.taskId);
|
||||
};
|
||||
// 图纸上传成功之后 开始提交
|
||||
const submit = async (status, data) => {
|
||||
form.value = data;
|
||||
if (status === 'draft') {
|
||||
buttonLoading.value = false;
|
||||
proxy?.$modal.msgSuccess('暂存成功');
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.go(-1);
|
||||
} else {
|
||||
if ((form.value.completeAuditStatus === 'draft' && (flowCode.value === '' || flowCode.value === null)) || routeParams.value.type === 'add') {
|
||||
flowCode.value = flowCodeOptions[0].value;
|
||||
dialogVisible.visible = true;
|
||||
return;
|
||||
}
|
||||
//说明启动过先随意穿个参数
|
||||
if (flowCode.value === '' || flowCode.value === null) {
|
||||
flowCode.value = 'xx';
|
||||
}
|
||||
await handleStartWorkFlow(data);
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
nextTick(async () => {
|
||||
routeParams.value = proxy.$route.query;
|
||||
console.log('🚀 ~ proxy.$route.query:', proxy.$route.query);
|
||||
reset();
|
||||
loading.value = false;
|
||||
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
|
||||
getInfo();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
/* 全局样式 */
|
||||
:root {
|
||||
--primary: #409eff;
|
||||
--primary-light: #66b1ff;
|
||||
--primary-dark: #3a8ee6;
|
||||
--success: #67c23a;
|
||||
--warning: #e6a23c;
|
||||
--danger: #f56c6c;
|
||||
--info: #909399;
|
||||
}
|
||||
|
||||
/* 表单样式优化 */
|
||||
.el-form-item {
|
||||
.el-form-item__label {
|
||||
color: #606266;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.el-input__inner,
|
||||
.el-select .el-input__inner {
|
||||
border-radius: 4px;
|
||||
transition:
|
||||
border-color 0.2s,
|
||||
box-shadow 0.2s;
|
||||
|
||||
&:focus {
|
||||
border-color: var(--primary-light);
|
||||
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.el-textarea__inner {
|
||||
border-radius: 4px;
|
||||
transition:
|
||||
border-color 0.2s,
|
||||
box-shadow 0.2s;
|
||||
|
||||
&:focus {
|
||||
border-color: var(--primary-light);
|
||||
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 按钮样式优化 */
|
||||
.el-button {
|
||||
border-radius: 4px;
|
||||
transition: all 0.2s;
|
||||
|
||||
&.is-primary {
|
||||
background-color: var(--primary);
|
||||
border-color: var(--primary);
|
||||
|
||||
&:hover {
|
||||
background-color: var(--primary-light);
|
||||
border-color: var(--primary-light);
|
||||
}
|
||||
|
||||
&:active {
|
||||
background-color: var(--primary-dark);
|
||||
border-color: var(--primary-dark);
|
||||
}
|
||||
}
|
||||
|
||||
&.is-text {
|
||||
color: var(--primary);
|
||||
|
||||
&:hover {
|
||||
color: var(--primary-light);
|
||||
background-color: rgba(64, 158, 255, 0.05);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 卡片样式优化 */
|
||||
.el-card {
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
/* transform: translateY(-2px); */
|
||||
}
|
||||
}
|
||||
|
||||
/* 对话框样式优化 */
|
||||
.el-dialog {
|
||||
.el-dialog__header {
|
||||
background-color: #f5f7fa;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
padding: 15px 20px;
|
||||
}
|
||||
|
||||
.el-dialog__title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.el-dialog__footer {
|
||||
padding: 15px 20px;
|
||||
border-top: 1px solid #ebeef5;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
272
src/views/out/monthPlan/index.vue
Normal file
272
src/views/out/monthPlan/index.vue
Normal file
@ -0,0 +1,272 @@
|
||||
<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="planMonth">
|
||||
<el-date-picker v-model="queryParams.planMonth" 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="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['out:monthPlan:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['out:monthPlan:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="monthPlanList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="计划月份" align="center" prop="planMonth" />
|
||||
<el-table-column label="计划产值" align="center" prop="planValue" />
|
||||
<el-table-column label="完成产值" align="center" prop="completeValue" />
|
||||
<el-table-column label="差额" align="center" prop="differenceValue" />
|
||||
<el-table-column label="产值类型" align="center" prop="valueType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="out_value_type" :value="scope.row.valueType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="流程状态" align="center" prop="planAuditStatus">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="wf_business_status" :value="scope.row.planAuditStatus" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope"
|
||||
><el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['out:monthPlan:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['out:monthPlan:remove']">删除</el-button>
|
||||
<el-button link type="primary" icon="Finished" @click="handleAudit(scope.row)" v-hasPermi="['out:monthPlan:remove']">审核</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>
|
||||
<!-- 添加或修改月度产值计划对话框 -->
|
||||
<el-dialog draggable :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="monthPlanFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="计划产值" prop="planValue">
|
||||
<el-input v-model="form.planValue" placeholder="请输入计划产值" type="number" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计划月份" prop="planMonth">
|
||||
<el-date-picker v-model="form.planMonth" type="month" value-format="YYYY-MM" placeholder="请选择计划月份" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产值类型" prop="valueType">
|
||||
<el-select v-model="form.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>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="MonthPlan" lang="ts">
|
||||
import { listMonthPlan, getMonthPlan, delMonthPlan, addMonthPlan, updateMonthPlan } from '@/api/out/monthPlan';
|
||||
import { MonthPlanVO, MonthPlanQuery, MonthPlanForm } from '@/api/out/monthPlan/types';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { out_value_type } = toRefs<any>(proxy?.useDict('out_value_type'));
|
||||
const { wf_business_status } = toRefs<any>(proxy?.useDict('wf_business_status'));
|
||||
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const monthPlanList = ref<MonthPlanVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const monthPlanFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: MonthPlanForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value?.id,
|
||||
planValue: undefined,
|
||||
completeValue: undefined,
|
||||
differenceValue: undefined,
|
||||
planMonth: undefined,
|
||||
isDesign: true,
|
||||
|
||||
valueType: undefined,
|
||||
planAuditStatus: undefined,
|
||||
completeAuditStatus: undefined
|
||||
};
|
||||
const data = reactive<PageData<MonthPlanForm, MonthPlanQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value?.id,
|
||||
planValue: undefined,
|
||||
completeValue: undefined,
|
||||
differenceValue: undefined,
|
||||
planMonth: undefined,
|
||||
valueType: undefined,
|
||||
planAuditStatus: undefined,
|
||||
completeAuditStatus: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
||||
projectId: [{ required: true, message: '项目ID不能为空', trigger: 'blur' }],
|
||||
planValue: [{ required: true, message: '计划产值不能为空', trigger: 'blur' }],
|
||||
planMonth: [{ required: true, message: '计划月份不能为空', trigger: 'blur' }],
|
||||
valueType: [{ required: true, message: '1-设计 2-采购 3-施工不能为空', trigger: 'change' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询月度产值计划列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listMonthPlan(queryParams.value);
|
||||
monthPlanList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
monthPlanFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: MonthPlanVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加月度产值计划';
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: MonthPlanVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getMonthPlan(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改月度产值计划';
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
form.value.projectId = currentProject.value?.id;
|
||||
monthPlanFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
form.value.isDesign = true;
|
||||
|
||||
if (form.value.id) {
|
||||
await updateMonthPlan(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addMonthPlan(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: MonthPlanVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除月度产值计划编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delMonthPlan(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
/** 审核按钮操作 */
|
||||
const handleAudit = async (row?: MonthPlanVO) => {
|
||||
proxy?.$tab.openPage('/approval/monthPlan/indexEdit', '审核月度产值计划', {
|
||||
planMonth: row?.planMonth,
|
||||
type: 'update'
|
||||
});
|
||||
};
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
defineExpose({
|
||||
getList
|
||||
});
|
||||
</script>
|
||||
30
src/views/out/monthPlan/indexAll.vue
Normal file
30
src/views/out/monthPlan/indexAll.vue
Normal file
@ -0,0 +1,30 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
|
||||
<el-tab-pane label="月度产值计划" name="first">
|
||||
<monthPlan ref="monthPlanChild"></monthPlan>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="已通过月度计划" name="second">
|
||||
<monthPlanAudit ref="monthPlanAuditChild"></monthPlanAudit>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="MonthPlan" lang="ts">
|
||||
import { ref, watch, computed } from 'vue';
|
||||
import monthPlan from './index.vue'; //子组件
|
||||
import monthPlanAudit from '../monthPlanAudit/index.vue'; //子组件
|
||||
// 引用子组件
|
||||
const activeName = ref('first');
|
||||
const monthPlanChild = ref<InstanceType<typeof monthPlan> | null>(null);
|
||||
const monthPlanAuditChild = ref<InstanceType<typeof monthPlanAudit> | null>(null);
|
||||
const handleClick = () => {
|
||||
// 调用子组件方法
|
||||
if (activeName.value == 'first') {
|
||||
monthPlanChild.value.getList(); //子组件方法
|
||||
} else if (activeName.value == 'second') {
|
||||
monthPlanAuditChild.value.getList(); //子组件方法
|
||||
}
|
||||
};
|
||||
</script>
|
||||
368
src/views/out/monthPlan/indexEdit.vue
Normal file
368
src/views/out/monthPlan/indexEdit.vue
Normal file
@ -0,0 +1,368 @@
|
||||
<template>
|
||||
<div class="p-4 bg-gray-50">
|
||||
<div class="max-w-4xl mx-auto">
|
||||
<!-- 顶部按钮区域 -->
|
||||
<el-card class="mb-4 rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md">
|
||||
<approvalButton
|
||||
@submitForm="submitForm"
|
||||
@approvalVerifyOpen="approvalVerifyOpen"
|
||||
@handleApprovalRecord="handleApprovalRecord"
|
||||
:buttonLoading="buttonLoading"
|
||||
:id="form[0]?.id"
|
||||
:status="form[0]?.planAuditStatus"
|
||||
:pageType="routeParams.type"
|
||||
/>
|
||||
</el-card>
|
||||
<!-- 表单区域 -->
|
||||
<el-card class="rounded-lg shadow-sm bg-white border border-gray-100 transition-all hover:shadow-md overflow-hidden">
|
||||
<div class="p-4 bg-gradient-to-r from-blue-50 to-indigo-50 border-b border-gray-100">
|
||||
<h3 class="text-lg font-semibold text-gray-800">月度产值计划</h3>
|
||||
</div>
|
||||
<div class="p-6">
|
||||
<el-form
|
||||
ref="leaveFormRef"
|
||||
v-loading="loading"
|
||||
:disabled="routeParams.type === 'view' || form.status == 'waiting'"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="120px"
|
||||
class="space-y-4"
|
||||
>
|
||||
<div class="grid grid-cols-1 gap-4">
|
||||
<el-row :gutter="20" justify="space-between" v-for="item in form">
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="计划产值" prop="planValue">
|
||||
<el-input v-model="item.planValue" placeholder="请输入计划产值" disabled />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="计划月份" prop="planMonth">
|
||||
<el-date-picker v-model="item.planMonth" type="month" value-format="YYYY-MM" disabled placeholder="请选择计划月份" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8" :offset="0">
|
||||
<el-form-item label="产值类型" prop="valueType">
|
||||
<el-select v-model="item.valueType" placeholder="请选择产值类型" disabled>
|
||||
<el-option v-for="it in out_value_type" :key="it.value" :label="it.label" :value="it.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
</el-card>
|
||||
<!-- 提交组件 -->
|
||||
<submitVerify ref="submitVerifyRef" :task-variables="taskVariables" @submit-callback="submitCallback" />
|
||||
<approvalRecord ref="approvalRecordRef"></approvalRecord>
|
||||
<!-- 流程选择对话框 -->
|
||||
<el-dialog
|
||||
draggable
|
||||
v-model="dialogVisible.visible"
|
||||
:title="dialogVisible.title"
|
||||
:before-close="handleClose"
|
||||
width="500"
|
||||
class="rounded-lg shadow-lg"
|
||||
>
|
||||
<div class="p-4">
|
||||
<p class="text-gray-600 mb-4">请选择要启动的流程:</p>
|
||||
<el-select v-model="flowCode" placeholder="请选择流程" style="width: 100%">
|
||||
<el-option v-for="item in flowCodeOptions" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer p-4 border-t border-gray-100 flex justify-end space-x-3">
|
||||
<el-button @click="handleClose" class="px-4 py-2 border border-gray-300 rounded-md text-gray-700 hover:bg-gray-50 transition-colors"
|
||||
>取消</el-button
|
||||
>
|
||||
<el-button type="primary" @click="submitFlow()" class="px-4 py-2 bg-primary text-white rounded-md hover:bg-primary/90 transition-colors"
|
||||
>确认</el-button
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="Leave" lang="ts">
|
||||
import { LeaveForm, LeaveQuery, LeaveVO } from '@/api/workflow/leave/types';
|
||||
import { startWorkFlow } from '@/api/workflow/task';
|
||||
import SubmitVerify from '@/components/Process/submitVerify.vue';
|
||||
import ApprovalRecord from '@/components/Process/approvalRecord.vue';
|
||||
import ApprovalButton from '@/components/Process/approvalButton.vue';
|
||||
import { StartProcessBo } from '@/api/workflow/workflowCommon/types';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
import { getMonthInfo, isSubmit } from '@/api/out/monthPlan';
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const { out_value_type } = toRefs<any>(proxy?.useDict('out_value_type'));
|
||||
|
||||
//路由参数
|
||||
const routeParams = ref<Record<string, any>>({});
|
||||
const flowCode = ref<string>('');
|
||||
const status = ref<string>('');
|
||||
const dialogVisible = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: '流程定义'
|
||||
});
|
||||
//提交组件
|
||||
const submitVerifyRef = ref<InstanceType<typeof SubmitVerify>>();
|
||||
//审批记录组件
|
||||
const approvalRecordRef = ref<InstanceType<typeof ApprovalRecord>>();
|
||||
//按钮组件
|
||||
const flowCodeOptions = [
|
||||
{
|
||||
value: currentProject.value?.id + '_monthPlan',
|
||||
label: '月度产值计划审批'
|
||||
}
|
||||
];
|
||||
|
||||
const leaveFormRef = ref<ElFormInstance>();
|
||||
const dialog = reactive({
|
||||
visible: false,
|
||||
title: '',
|
||||
isEdit: false
|
||||
});
|
||||
const submitFormData = ref<StartProcessBo>({
|
||||
businessId: '',
|
||||
flowCode: '',
|
||||
variables: {}
|
||||
});
|
||||
const taskVariables = ref<Record<string, any>>({});
|
||||
|
||||
const initFormData = [];
|
||||
const data = reactive({
|
||||
form: { ...initFormData },
|
||||
rules: {}
|
||||
});
|
||||
|
||||
const handleClose = () => {
|
||||
dialogVisible.visible = false;
|
||||
flowCode.value = '';
|
||||
buttonLoading.value = false;
|
||||
};
|
||||
const { form, rules } = toRefs(data);
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
leaveFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 获取详情 */
|
||||
const getInfo = () => {
|
||||
loading.value = true;
|
||||
buttonLoading.value = false;
|
||||
nextTick(async () => {
|
||||
console.log('🚀 ~ routeParams.value:', routeParams.value.businessId);
|
||||
const projectId = routeParams.value.businessId ? routeParams.value.businessId.split('_')[0] : currentProject.value?.id;
|
||||
const res = await getMonthInfo({ projectId: projectId, planMonth: routeParams.value.planMonth });
|
||||
form.value = res.data as any;
|
||||
|
||||
console.log('🚀 ~ getInfo ~ form.value:', form.value[0].projectId);
|
||||
|
||||
form.value[0].id = form.value[0].projectId + '_' + form.value[0].planMonth;
|
||||
loading.value = false;
|
||||
buttonLoading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = (status1: string) => {
|
||||
status.value = status1;
|
||||
submit(status.value, form.value);
|
||||
};
|
||||
|
||||
const submitFlow = async () => {
|
||||
handleStartWorkFlow(form.value);
|
||||
dialogVisible.visible = false;
|
||||
};
|
||||
//提交申请
|
||||
const handleStartWorkFlow = async (data: LeaveForm) => {
|
||||
try {
|
||||
submitFormData.value.flowCode = flowCode.value;
|
||||
submitFormData.value.businessId = currentProject.value?.id + '_' + form.value[0]?.planMonth;
|
||||
|
||||
//流程变量
|
||||
taskVariables.value = {
|
||||
// leave4/5 使用的流程变量
|
||||
userList: ['1', '3', '4']
|
||||
};
|
||||
submitFormData.value.variables = taskVariables.value;
|
||||
const resp = await startWorkFlow(submitFormData.value);
|
||||
if (submitVerifyRef.value) {
|
||||
buttonLoading.value = false;
|
||||
submitVerifyRef.value.openDialog(resp.data.taskId);
|
||||
}
|
||||
} finally {
|
||||
buttonLoading.value = false;
|
||||
}
|
||||
};
|
||||
//审批记录
|
||||
const handleApprovalRecord = () => {
|
||||
console.log(form.value[0]?.id);
|
||||
|
||||
approvalRecordRef.value.init(form.value[0]?.id);
|
||||
};
|
||||
//提交回调
|
||||
const submitCallback = async () => {
|
||||
await proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.go(-1);
|
||||
};
|
||||
//审批
|
||||
const approvalVerifyOpen = async () => {
|
||||
submitVerifyRef.value.openDialog(routeParams.value.taskId);
|
||||
};
|
||||
// 图纸上传成功之后 开始提交
|
||||
const submit = async (status, data) => {
|
||||
form.value = data;
|
||||
if (status === 'draft') {
|
||||
buttonLoading.value = false;
|
||||
proxy?.$modal.msgSuccess('暂存成功');
|
||||
proxy.$tab.closePage(proxy.$route);
|
||||
proxy.$router.go(-1);
|
||||
} else {
|
||||
const res = await isSubmit(data[1]?.id);
|
||||
|
||||
if (!res.data) {
|
||||
proxy?.$modal.msgError('三种计划产值必须填写');
|
||||
return;
|
||||
}
|
||||
if ((form.value[0]?.planAuditStatus === 'draft' && (flowCode.value === '' || flowCode.value === null)) || routeParams.value.type === 'add') {
|
||||
flowCode.value = flowCodeOptions[0].value;
|
||||
dialogVisible.visible = true;
|
||||
return;
|
||||
}
|
||||
//说明启动过先随意穿个参数
|
||||
if (flowCode.value === '' || flowCode.value === null) {
|
||||
flowCode.value = 'xx';
|
||||
}
|
||||
await handleStartWorkFlow(data);
|
||||
}
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
nextTick(async () => {
|
||||
routeParams.value = proxy.$route.query;
|
||||
console.log('🚀 ~ proxy.$route.query:', proxy.$route.query);
|
||||
reset();
|
||||
loading.value = false;
|
||||
if (routeParams.value.type === 'update' || routeParams.value.type === 'view' || routeParams.value.type === 'approval') {
|
||||
console.log('🚀 ~ routeParams.value:', routeParams.value);
|
||||
|
||||
getInfo();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
/* 全局样式 */
|
||||
:root {
|
||||
--primary: #409eff;
|
||||
--primary-light: #66b1ff;
|
||||
--primary-dark: #3a8ee6;
|
||||
--success: #67c23a;
|
||||
--warning: #e6a23c;
|
||||
--danger: #f56c6c;
|
||||
--info: #909399;
|
||||
}
|
||||
|
||||
/* 表单样式优化 */
|
||||
.el-form-item {
|
||||
.el-form-item__label {
|
||||
color: #606266;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.el-input__inner,
|
||||
.el-select .el-input__inner {
|
||||
border-radius: 4px;
|
||||
transition:
|
||||
border-color 0.2s,
|
||||
box-shadow 0.2s;
|
||||
|
||||
&:focus {
|
||||
border-color: var(--primary-light);
|
||||
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
|
||||
}
|
||||
}
|
||||
|
||||
.el-textarea__inner {
|
||||
border-radius: 4px;
|
||||
transition:
|
||||
border-color 0.2s,
|
||||
box-shadow 0.2s;
|
||||
|
||||
&:focus {
|
||||
border-color: var(--primary-light);
|
||||
box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 按钮样式优化 */
|
||||
.el-button {
|
||||
border-radius: 4px;
|
||||
transition: all 0.2s;
|
||||
|
||||
&.is-primary {
|
||||
background-color: var(--primary);
|
||||
border-color: var(--primary);
|
||||
|
||||
&:hover {
|
||||
background-color: var(--primary-light);
|
||||
border-color: var(--primary-light);
|
||||
}
|
||||
|
||||
&:active {
|
||||
background-color: var(--primary-dark);
|
||||
border-color: var(--primary-dark);
|
||||
}
|
||||
}
|
||||
|
||||
&.is-text {
|
||||
color: var(--primary);
|
||||
|
||||
&:hover {
|
||||
color: var(--primary-light);
|
||||
background-color: rgba(64, 158, 255, 0.05);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* 卡片样式优化 */
|
||||
.el-card {
|
||||
transition: all 0.3s ease;
|
||||
|
||||
&:hover {
|
||||
/* transform: translateY(-2px); */
|
||||
}
|
||||
}
|
||||
|
||||
/* 对话框样式优化 */
|
||||
.el-dialog {
|
||||
.el-dialog__header {
|
||||
background-color: #f5f7fa;
|
||||
border-bottom: 1px solid #ebeef5;
|
||||
padding: 15px 20px;
|
||||
}
|
||||
|
||||
.el-dialog__title {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.el-dialog__footer {
|
||||
padding: 15px 20px;
|
||||
border-top: 1px solid #ebeef5;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
238
src/views/out/monthPlanAudit/index.vue
Normal file
238
src/views/out/monthPlanAudit/index.vue
Normal file
@ -0,0 +1,238 @@
|
||||
<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="planMonth">
|
||||
<el-date-picker
|
||||
v-model="queryParams.planMonth"
|
||||
type="month"
|
||||
value-format="YYYY-MM"
|
||||
placeholder="请选择计划月份"
|
||||
clearable
|
||||
@change="handleQuery"
|
||||
/>
|
||||
</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">
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="monthPlanAuditList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="设计产值" align="center" prop="designValue" />
|
||||
<el-table-column label="采购产值" align="center" prop="purchaseValue" />
|
||||
<el-table-column label="施工产值" align="center" prop="constructionValue" />
|
||||
<el-table-column label="总产值" align="center" prop="totalValue" />
|
||||
<el-table-column label="计划月份" align="center" prop="planMonth" />
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改审核通过月度产值计划对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="monthPlanAuditFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="设计产值" prop="designValue">
|
||||
<el-input v-model="form.designValue" placeholder="请输入设计产值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="采购产值" prop="purchaseValue">
|
||||
<el-input v-model="form.purchaseValue" placeholder="请输入采购产值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="施工产值" prop="constructionValue">
|
||||
<el-input v-model="form.constructionValue" placeholder="请输入施工产值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="总产值" prop="totalValue">
|
||||
<el-input v-model="form.totalValue" placeholder="请输入总产值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="计划月份" prop="planMonth">
|
||||
<el-date-picker v-model="form.planMonth" type="month" value-format="YYYY-MM" placeholder="请选择计划月份" clearable />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="MonthPlanAudit" lang="ts">
|
||||
import { listMonthPlanAudit, getMonthPlanAudit, delMonthPlanAudit, addMonthPlanAudit, updateMonthPlanAudit } from '@/api/out/monthPlanAudit';
|
||||
import { MonthPlanAuditVO, MonthPlanAuditQuery, MonthPlanAuditForm } from '@/api/out/monthPlanAudit/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const monthPlanAuditList = ref<MonthPlanAuditVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const monthPlanAuditFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: MonthPlanAuditForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value?.id,
|
||||
designValue: undefined,
|
||||
purchaseValue: undefined,
|
||||
constructionValue: undefined,
|
||||
totalValue: undefined,
|
||||
planMonth: undefined
|
||||
};
|
||||
const data = reactive<PageData<MonthPlanAuditForm, MonthPlanAuditQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value?.id,
|
||||
designValue: undefined,
|
||||
purchaseValue: undefined,
|
||||
constructionValue: undefined,
|
||||
totalValue: undefined,
|
||||
planMonth: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
||||
projectId: [{ required: true, message: '项目ID不能为空', trigger: 'blur' }],
|
||||
designValue: [{ required: true, message: '设计产值不能为空', trigger: 'blur' }],
|
||||
purchaseValue: [{ required: true, message: '采购产值不能为空', trigger: 'blur' }],
|
||||
constructionValue: [{ required: true, message: '施工产值不能为空', trigger: 'blur' }],
|
||||
totalValue: [{ required: true, message: '总产值不能为空', trigger: 'blur' }],
|
||||
planMonth: [{ required: true, message: '计划月份不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询审核通过月度产值计划列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listMonthPlanAudit(queryParams.value);
|
||||
monthPlanAuditList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
monthPlanAuditFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: MonthPlanAuditVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加审核通过月度产值计划';
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: MonthPlanAuditVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getMonthPlanAudit(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改审核通过月度产值计划';
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
monthPlanAuditFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateMonthPlanAudit(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addMonthPlanAudit(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: MonthPlanAuditVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除审核通过月度产值计划编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delMonthPlanAudit(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
defineExpose({
|
||||
getList
|
||||
});
|
||||
</script>
|
||||
124
src/views/out/outDesignTable/index.vue
Normal file
124
src/views/out/outDesignTable/index.vue
Normal file
@ -0,0 +1,124 @@
|
||||
<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 label="设计" value="1" />
|
||||
<el-option label="采购" value="2" />
|
||||
</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">
|
||||
<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);
|
||||
var { 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 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>
|
||||
132
src/views/out/outDesignTableVS/index.vue
Normal file
132
src/views/out/outDesignTableVS/index.vue
Normal file
@ -0,0 +1,132 @@
|
||||
<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">
|
||||
<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>
|
||||
124
src/views/out/outTable/index.vue
Normal file
124
src/views/out/outTable/index.vue
Normal file
@ -0,0 +1,124 @@
|
||||
<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">
|
||||
<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>
|
||||
|
||||
<script setup name="ValueAllocation" lang="ts">
|
||||
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);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const data = reactive({
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
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>
|
||||
127
src/views/out/ownerSettlement/index.vue
Normal file
127
src/views/out/ownerSettlement/index.vue
Normal file
@ -0,0 +1,127 @@
|
||||
<!-- 结算产值 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">
|
||||
<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>
|
||||
276
src/views/out/settlementValueOwner/index.vue
Normal file
276
src/views/out/settlementValueOwner/index.vue
Normal file
@ -0,0 +1,276 @@
|
||||
<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="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 label="结算日期" prop="settlementDate">
|
||||
<el-date-picker clearable v-model="queryParams.settlementDate" type="date" value-format="YYYY-MM-DD" 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="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['out:settlementValueOwner:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['out:settlementValueOwner:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="settlementValueOwnerList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="填报人" align="center" prop="createByName" />
|
||||
<el-table-column label="结算产值" align="center" prop="settlementValue" />
|
||||
<el-table-column label="产值类型" align="center" prop="valueType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="out_value_type" :value="scope.row.valueType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结算日期" align="center" prop="settlementDate" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.settlementDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="填报日期" align="center" prop="createTime" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="说明" align="center" prop="remark" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['out:settlementValueOwner:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['out:settlementValueOwner:remove']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</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>
|
||||
<!-- 添加或修改结算产值登记(对甲)对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="settlementValueOwnerFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="结算产值" prop="settlementValue">
|
||||
<el-input v-model="form.settlementValue" type="number" placeholder="请输入结算产值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产值类型" prop="valueType">
|
||||
<el-select v-model="form.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 label="说明" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入说明" />
|
||||
</el-form-item>
|
||||
<el-form-item label="结算日期" prop="settlementDate">
|
||||
<el-date-picker clearable v-model="form.settlementDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择结算日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="SettlementValueOwner" lang="ts">
|
||||
import {
|
||||
listSettlementValueOwner,
|
||||
getSettlementValueOwner,
|
||||
delSettlementValueOwner,
|
||||
addSettlementValueOwner,
|
||||
updateSettlementValueOwner
|
||||
} from '@/api/out/settlementValueOwner';
|
||||
import { SettlementValueOwnerVO, SettlementValueOwnerQuery, SettlementValueOwnerForm } from '@/api/out/settlementValueOwner/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { out_value_type } = toRefs<any>(proxy?.useDict('out_value_type'));
|
||||
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const settlementValueOwnerList = ref<SettlementValueOwnerVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const settlementValueOwnerFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: SettlementValueOwnerForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value?.id,
|
||||
settlementValue: undefined,
|
||||
valueType: undefined,
|
||||
remark: undefined,
|
||||
settlementDate: undefined
|
||||
};
|
||||
const data = reactive<PageData<SettlementValueOwnerForm, SettlementValueOwnerQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value?.id,
|
||||
settlementValue: undefined,
|
||||
valueType: undefined,
|
||||
settlementDate: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
||||
projectId: [{ required: true, message: '项目ID不能为空', trigger: 'blur' }],
|
||||
settlementValue: [{ required: true, message: '结算产值不能为空', trigger: 'blur' }],
|
||||
valueType: [{ required: true, message: '产值类型不能为空', trigger: 'change' }],
|
||||
settlementDate: [{ required: true, message: '结算日期不能为空', trigger: 'change' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询结算产值登记(对甲)列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listSettlementValueOwner(queryParams.value);
|
||||
settlementValueOwnerList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
settlementValueOwnerFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: SettlementValueOwnerVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加结算产值登记(对甲)';
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: SettlementValueOwnerVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getSettlementValueOwner(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改结算产值登记(对甲)';
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
settlementValueOwnerFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateSettlementValueOwner(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addSettlementValueOwner(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: SettlementValueOwnerVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除结算产值登记(对甲)编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delSettlementValueOwner(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
defineExpose({
|
||||
getList
|
||||
});
|
||||
</script>
|
||||
338
src/views/out/settlementValueSubcontract/index.vue
Normal file
338
src/views/out/settlementValueSubcontract/index.vue
Normal file
@ -0,0 +1,338 @@
|
||||
<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="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 label="结算周期" prop="settlementMonth">
|
||||
<el-date-picker clearable v-model="queryParams.settlementMonth" 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="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['out:settlementValueSubcontract:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="danger"
|
||||
plain
|
||||
icon="Delete"
|
||||
:disabled="multiple"
|
||||
@click="handleDelete()"
|
||||
v-hasPermi="['out:settlementValueSubcontract:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="settlementValueSubcontractList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="分包单位" align="center" prop="contractorName" />
|
||||
<el-table-column label="单据编码" align="center" prop="documentCode" />
|
||||
<el-table-column label="结算说明" align="center" prop="settlementDescribe" />
|
||||
<el-table-column label="产值类型" align="center" prop="valueType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="out_value_type" :value="scope.row.valueType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结算周期" align="center" prop="settlementMonth" />
|
||||
<el-table-column label="结算日期" align="center" prop="settlementDate" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.settlementDate, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结算产值" align="center" prop="settlementValue" />
|
||||
<el-table-column label="说明" align="center" prop="remark" />
|
||||
<el-table-column label="合同编码" align="center" prop="contractCode" />
|
||||
<el-table-column label="合同名称" align="center" prop="contractName" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['out:settlementValueSubcontract:edit']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
icon="Delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['out:settlementValueSubcontract:remove']"
|
||||
></el-button>
|
||||
</el-tooltip>
|
||||
</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>
|
||||
<!-- 添加或修改结算产值登记(对乙)对话框 -->
|
||||
<el-dialog draggable :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="settlementValueSubcontractFormRef" :model="form" :rules="rules" label-width="100px">
|
||||
<el-form-item label="单据编码" prop="documentCode">
|
||||
<el-input v-model="form.documentCode" placeholder="请输入单据编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="结算说明" prop="settlementDescribe">
|
||||
<el-input v-model="form.settlementDescribe" placeholder="请输入结算说明" />
|
||||
</el-form-item>
|
||||
<el-form-item label="结算周期" prop="settlementMonth">
|
||||
<el-date-picker clearable v-model="form.settlementMonth" type="month" value-format="YYYY-MM" placeholder="请选择结算周期"> </el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="结算日期" prop="settlementDate">
|
||||
<el-date-picker clearable v-model="form.settlementDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择结算日期">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="产值类型" prop="valueType">
|
||||
<el-select v-model="form.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 label="分包单位" prop="contractorId">
|
||||
<el-select v-model="form.contractorId" value-key="id" placeholder="请选择分包单位" clearable filterable @change="">
|
||||
<el-option v-for="item in contractorList" :key="item.id" :label="item.name" :value="item.id"> </el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="结算产值" prop="settlementValue">
|
||||
<el-input v-model="form.settlementValue" type="number" placeholder="请输入结算产值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="说明" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入说明" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同编码" prop="contractCode">
|
||||
<el-input v-model="form.contractCode" placeholder="请输入合同编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="合同名称" prop="contractName">
|
||||
<el-input v-model="form.contractName" placeholder="请输入合同名称" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="SettlementValueSubcontract" lang="ts">
|
||||
import {
|
||||
listSettlementValueSubcontract,
|
||||
getSettlementValueSubcontract,
|
||||
delSettlementValueSubcontract,
|
||||
addSettlementValueSubcontract,
|
||||
updateSettlementValueSubcontract
|
||||
} from '@/api/out/settlementValueSubcontract';
|
||||
import {
|
||||
SettlementValueSubcontractVO,
|
||||
SettlementValueSubcontractQuery,
|
||||
SettlementValueSubcontractForm
|
||||
} from '@/api/out/settlementValueSubcontract/types';
|
||||
import { listContractor } from '@/api/project/contractor';
|
||||
import { ContractorVO } from '@/api/project/contractor/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { out_value_type } = toRefs<any>(proxy?.useDict('out_value_type'));
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const settlementValueSubcontractList = ref<SettlementValueSubcontractVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const settlementValueSubcontractFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: SettlementValueSubcontractForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value?.id,
|
||||
documentCode: undefined,
|
||||
settlementDescribe: undefined,
|
||||
valueType: undefined,
|
||||
settlementMonth: undefined,
|
||||
settlementDate: undefined,
|
||||
contractorId: undefined,
|
||||
contractorName: undefined,
|
||||
settlementValue: undefined,
|
||||
remark: undefined,
|
||||
contractCode: undefined,
|
||||
contractName: undefined,
|
||||
contractUrl: undefined
|
||||
};
|
||||
const data = reactive<PageData<SettlementValueSubcontractForm, SettlementValueSubcontractQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value?.id,
|
||||
documentCode: undefined,
|
||||
settlementDescribe: undefined,
|
||||
valueType: undefined,
|
||||
settlementMonth: undefined,
|
||||
settlementDate: undefined,
|
||||
contractorId: undefined,
|
||||
contractorName: undefined,
|
||||
settlementValue: undefined,
|
||||
contractCode: undefined,
|
||||
contractName: undefined,
|
||||
contractUrl: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
||||
projectId: [{ required: true, message: '项目ID不能为空', trigger: 'blur' }],
|
||||
settlementMonth: [{ required: true, message: '结算周期不能为空', trigger: 'blur' }],
|
||||
settlementDate: [{ required: true, message: '结算日期不能为空', trigger: 'blur' }],
|
||||
settlementValue: [{ required: true, message: '结算产值不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询结算产值登记(对乙)列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listSettlementValueSubcontract(queryParams.value);
|
||||
settlementValueSubcontractList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
//获取分包单位
|
||||
const contractorList = ref<ContractorVO[]>([]);
|
||||
const getContractorList = async () => {
|
||||
const res = await listContractor({ projectId: currentProject.value?.id } as any);
|
||||
contractorList.value = res.rows;
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
settlementValueSubcontractFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: SettlementValueSubcontractVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
getContractorList();
|
||||
dialog.title = '添加结算产值登记(对乙)';
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: SettlementValueSubcontractVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
await getContractorList();
|
||||
const res = await getSettlementValueSubcontract(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改结算产值登记(对乙)';
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
settlementValueSubcontractFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateSettlementValueSubcontract(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addSettlementValueSubcontract(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: SettlementValueSubcontractVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除结算产值登记(对乙)编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delSettlementValueSubcontract(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
defineExpose({
|
||||
getList
|
||||
});
|
||||
</script>
|
||||
30
src/views/out/settlementValueSubcontract/indexAll.vue
Normal file
30
src/views/out/settlementValueSubcontract/indexAll.vue
Normal file
@ -0,0 +1,30 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<el-tabs v-model="activeName" class="demo-tabs" @tab-click="handleClick">
|
||||
<el-tab-pane label="对甲-结算登记" name="second">
|
||||
<settlementValueOwner ref="settlementValueOwnerChild"></settlementValueOwner>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="对乙-结算登记" name="first">
|
||||
<settlementValueSubcontract ref="settlementValueSubcontractChild"></settlementValueSubcontract>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="MonthPlan" lang="ts">
|
||||
import { ref, watch, computed } from 'vue';
|
||||
import settlementValueSubcontract from './index.vue'; //子组件
|
||||
import settlementValueOwner from '../settlementValueOwner/index.vue'; //子组件
|
||||
// 引用子组件
|
||||
const activeName = ref('second');
|
||||
const settlementValueSubcontractChild = ref<InstanceType<typeof settlementValueSubcontract> | null>(null);
|
||||
const settlementValueOwnerChild = ref<InstanceType<typeof settlementValueOwner> | null>(null);
|
||||
const handleClick = () => {
|
||||
// 调用子组件方法
|
||||
if (activeName.value == 'first') {
|
||||
settlementValueSubcontractChild.value.getList(); //子组件方法
|
||||
} else if (activeName.value == 'second') {
|
||||
settlementValueOwnerChild.value.getList(); //子组件方法
|
||||
}
|
||||
};
|
||||
</script>
|
||||
264
src/views/out/valueAllocation/index.vue
Normal file
264
src/views/out/valueAllocation/index.vue
Normal file
@ -0,0 +1,264 @@
|
||||
<template>
|
||||
<div class="p-2">
|
||||
<el-card shadow="never">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['out:valueAllocation:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['out:valueAllocation:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" :data="valueAllocationList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="对甲总产值" align="center" prop="ownerTotalValue" />
|
||||
<el-table-column label="对甲设计产值" align="center" prop="ownerDesignValue" />
|
||||
<el-table-column label="对甲采购产值" align="center" prop="ownerPurchaseValue" />
|
||||
<el-table-column label="对甲施工产值" align="center" prop="ownerConstructionValue" />
|
||||
<el-table-column label="对乙总产值" align="center" prop="subTotalValue" />
|
||||
<el-table-column label="对乙设计产值" align="center" prop="subDesignValue" />
|
||||
<el-table-column label="对乙采购产值" align="center" prop="subPurchaseValue" />
|
||||
<el-table-column label="对乙施工产值" align="center" prop="subConstructionValue" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['out:valueAllocation:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['out:valueAllocation:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
</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>
|
||||
<!-- 添加或修改项目总产值分配对话框 -->
|
||||
<el-dialog draggable :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="valueAllocationFormRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="对甲总产值" prop="ownerTotalValue">
|
||||
<el-input v-model="form.ownerTotalValue" placeholder="请输入对甲总产值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="对甲设计产值" prop="ownerDesignValue">
|
||||
<el-input v-model="form.ownerDesignValue" placeholder="请输入对甲设计产值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="对甲采购产值" prop="ownerPurchaseValue">
|
||||
<el-input v-model="form.ownerPurchaseValue" placeholder="请输入对甲采购产值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="对甲施工产值" prop="ownerConstructionValue">
|
||||
<el-input v-model="form.ownerConstructionValue" placeholder="请输入对甲施工产值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="对乙总产值" prop="subTotalValue">
|
||||
<el-input v-model="form.subTotalValue" placeholder="请输入对乙总产值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="对乙设计产值" prop="subDesignValue">
|
||||
<el-input v-model="form.subDesignValue" placeholder="请输入对乙设计产值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="对乙采购产值" prop="subPurchaseValue">
|
||||
<el-input v-model="form.subPurchaseValue" placeholder="请输入对乙采购产值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="对乙施工产值" prop="subConstructionValue">
|
||||
<el-input v-model="form.subConstructionValue" placeholder="请输入对乙施工产值" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="ValueAllocation" lang="ts">
|
||||
import { listValueAllocation, getValueAllocation, delValueAllocation, addValueAllocation, updateValueAllocation } from '@/api/out/valueAllocation';
|
||||
import { ValueAllocationVO, ValueAllocationQuery, ValueAllocationForm } from '@/api/out/valueAllocation/types';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
import { useUserStoreHook } from '@/store/modules/user';
|
||||
// 获取用户 store
|
||||
const userStore = useUserStoreHook();
|
||||
// 从 store 中获取项目列表和当前选中的项目
|
||||
const currentProject = computed(() => userStore.selectedProject);
|
||||
const valueAllocationList = ref<ValueAllocationVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const valueAllocationFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: ValueAllocationForm = {
|
||||
id: undefined,
|
||||
projectId: currentProject.value?.id,
|
||||
ownerDesignValue: undefined,
|
||||
ownerPurchaseValue: undefined,
|
||||
ownerConstructionValue: undefined,
|
||||
ownerTotalValue: undefined,
|
||||
subDesignValue: undefined,
|
||||
subPurchaseValue: undefined,
|
||||
valueType: undefined,
|
||||
subConstructionValue: undefined,
|
||||
subTotalValue: undefined
|
||||
};
|
||||
const data = reactive<PageData<ValueAllocationForm, ValueAllocationQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
projectId: currentProject.value?.id,
|
||||
ownerDesignValue: undefined,
|
||||
ownerPurchaseValue: undefined,
|
||||
ownerConstructionValue: undefined,
|
||||
valueType: undefined,
|
||||
ownerTotalValue: undefined,
|
||||
subDesignValue: undefined,
|
||||
subPurchaseValue: undefined,
|
||||
subConstructionValue: undefined,
|
||||
subTotalValue: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '主键ID不能为空', trigger: 'blur' }],
|
||||
projectId: [{ required: true, message: '项目ID不能为空', trigger: 'blur' }],
|
||||
ownerDesignValue: [{ required: true, message: '对甲设计产值不能为空', trigger: 'blur' }],
|
||||
ownerPurchaseValue: [{ required: true, message: '对甲采购产值不能为空', trigger: 'blur' }],
|
||||
ownerConstructionValue: [{ required: true, message: '对甲施工产值不能为空', trigger: 'blur' }],
|
||||
ownerTotalValue: [{ required: true, message: '对甲总产值不能为空', trigger: 'blur' }],
|
||||
subDesignValue: [{ required: true, message: '对乙设计产值不能为空', trigger: 'blur' }],
|
||||
subPurchaseValue: [{ required: true, message: '对乙采购产值不能为空', trigger: 'blur' }],
|
||||
subConstructionValue: [{ required: true, message: '对乙施工产值不能为空', trigger: 'blur' }],
|
||||
subTotalValue: [{ required: true, message: '对乙总产值不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询项目总产值分配列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listValueAllocation(queryParams.value);
|
||||
valueAllocationList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
valueAllocationFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: ValueAllocationVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加项目总产值分配';
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: ValueAllocationVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getValueAllocation(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改项目总产值分配';
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
valueAllocationFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateValueAllocation(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addValueAllocation(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: ValueAllocationVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除项目总产值分配编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delValueAllocation(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'out/valueAllocation/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`valueAllocation_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
|
||||
//监听项目id刷新数据
|
||||
const listeningProject = watch(
|
||||
() => currentProject.value?.id,
|
||||
(nid, oid) => {
|
||||
queryParams.value.projectId = nid;
|
||||
form.value.projectId = nid;
|
||||
getList();
|
||||
}
|
||||
);
|
||||
|
||||
onUnmounted(() => {
|
||||
listeningProject();
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user