This commit is contained in:
2025-09-04 18:53:10 +08:00
parent 0f439c9220
commit 6f7d7e56c2
8 changed files with 108 additions and 82 deletions

View File

@ -6,13 +6,13 @@ VITE_APP_ENV = 'development'
# 开发环境 # 开发环境
# 李陈杰 209 # 李陈杰 209
VITE_APP_BASE_API = 'http://192.168.110.149:8899' # VITE_APP_BASE_API = 'http://192.168.110.209:8899'
# 曾涛 # 曾涛
# VITE_APP_BASE_API = 'http://192.168.110.180:8899' # VITE_APP_BASE_API = 'http://192.168.110.180:8899'
# 罗成 # 罗成
# VITE_APP_BASE_API = 'http://192.168.110.188:8899' # VITE_APP_BASE_API = 'http://192.168.110.188:8899'
# 朱银 # 朱银
# VITE_APP_BASE_API = 'http://192.168.110.149:8899' VITE_APP_BASE_API = 'http://192.168.110.149:8899'
#曾涛 #曾涛
# VITE_APP_BASE_API = 'http://192.168.110.171:8899' # VITE_APP_BASE_API = 'http://192.168.110.171:8899'

View File

@ -50,7 +50,7 @@
<div class="p-4"> <div class="p-4">
<p class="text-gray-600 mb-4">请选择要启动的流程</p> <p class="text-gray-600 mb-4">请选择要启动的流程</p>
<el-select v-model="flowCode" placeholder="请选择流程" style="width: 100%"> <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-option v-for="item in [flowCodeOptions[optionIndex]]" :key="item.value" :label="item.label" :value="item.value" />
</el-select> </el-select>
</div> </div>
<template #footer> <template #footer>
@ -98,6 +98,7 @@ const flowCodeOptions = ref([
label: '资金设计变更审批' label: '资金设计变更审批'
} }
]); ]);
const optionIndex = ref<number>(0);
const flowCode = ref<string>(''); const flowCode = ref<string>('');
const status = ref<string>(''); const status = ref<string>('');
@ -272,12 +273,12 @@ const submit = async (status, data) => {
} else { } else {
if ((form.value.status === 'draft' && (flowCode.value === '' || flowCode.value === null)) || routeParams.value.type === 'add') { if ((form.value.status === 'draft' && (flowCode.value === '' || flowCode.value === null)) || routeParams.value.type === 'add') {
if (form.value.costEstimation == '0') { if (form.value.costEstimation == '0') {
flowCodeOptions.value = [flowCodeOptions.value[0]]; optionIndex.value = 0;
} else { } else {
console.log('🚀 ~ submit ~ flowCodeOptions.value:', flowCodeOptions.value[1]); console.log('🚀 ~ submit ~ flowCodeOptions.value:', flowCodeOptions.value[1]);
flowCodeOptions.value = [flowCodeOptions.value[1]]; optionIndex.value = 1;
} }
flowCode.value = flowCodeOptions.value[0].value; flowCode.value = flowCodeOptions.value[optionIndex.value].value;
dialogVisible.visible = true; dialogVisible.visible = true;
return; return;
} }

View File

@ -63,7 +63,7 @@
</el-tooltip> </el-tooltip>
</span> </span>
</el-col> </el-col>
<el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button <el-button
type="success" type="success"
plain plain
@ -73,7 +73,7 @@
v-hasPermi="['formalities:formalitiesAreConsolidated:edit']" v-hasPermi="['formalities:formalitiesAreConsolidated:edit']"
>修改</el-button >修改</el-button
> >
</el-col> </el-col> -->
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
</template> </template>

View File

@ -1,14 +1,13 @@
<template> <template>
<div class="p-2"> <div class="p-2">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
:leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]"> <div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover"> <el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" :inline="true"> <el-form ref="queryFormRef" :model="queryParams" :inline="true">
<el-form-item label="表单编号" prop="formCode"> <el-form-item label="表单编号" prop="formCode">
<el-input v-model="queryParams.formCode" placeholder="请输入表单编号" clearable @keyup.enter="handleQuery" /> <el-input v-model="queryParams.formCode" placeholder="请输入表单编号" clearable @keyup.enter="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item label="材料来源" prop="materialSource"> <el-form-item label="材料来源" prop="materialSource">
<el-select v-model="queryParams.materialSource" filterable placeholder="请选择材料来源"> <el-select v-model="queryParams.materialSource" filterable placeholder="请选择材料来源">
<el-option label="全部" value="0"></el-option> <el-option label="全部" value="0"></el-option>
<el-option label="甲供材料" value="1"></el-option> <el-option label="甲供材料" value="1"></el-option>
@ -16,8 +15,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="材料名称" prop="materialName"> <el-form-item label="材料名称" prop="materialName">
<el-input v-model="queryParams.materialName" placeholder="请输入设备材料名称" clearable <el-input v-model="queryParams.materialName" placeholder="请输入设备材料名称" clearable @keyup.enter="handleQuery" />
@keyup.enter="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item label="订货单位" prop="orderingUnit"> <el-form-item label="订货单位" prop="orderingUnit">
<el-input v-model="queryParams.orderingUnit" placeholder="请输入订货单位" clearable @keyup.enter="handleQuery" /> <el-input v-model="queryParams.orderingUnit" placeholder="请输入订货单位" clearable @keyup.enter="handleQuery" />
@ -38,8 +36,7 @@
<template #header> <template #header>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['materials:materialReceive:add']">新增</el-button>
v-hasPermi="['materials:materialReceive:add']">新增</el-button>
</el-col> </el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
@ -50,8 +47,9 @@
<el-table-column label="表单编号" align="center" prop="formCode" /> <el-table-column label="表单编号" align="center" prop="formCode" />
<el-table-column label="材料来源" align="center" prop="projectName"> <el-table-column label="材料来源" align="center" prop="projectName">
<template #default="scope"> <template #default="scope">
<el-tag :type="scope.row.materialSource == '1' ? 'success' : 'warning'">{{ scope.row.materialSource == '1' ? <el-tag :type="scope.row.materialSource == '1' ? 'success' : 'warning'">{{
'甲供材料' : '乙供材料' }}</el-tag> scope.row.materialSource == '1' ? '甲供材料' : '乙供材料'
}}</el-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="设备材料名称" align="center" prop="materialName" /> <el-table-column label="设备材料名称" align="center" prop="materialName" />
@ -77,20 +75,28 @@
<!-- <el-button link type="primary" icon="edit" @click="handleUpdate(scope.row)" v-hasPermi="['materials:materialReceive:edit']" <!-- <el-button link type="primary" icon="edit" @click="handleUpdate(scope.row)" v-hasPermi="['materials:materialReceive:edit']"
>修改</el-button >修改</el-button
> --> > -->
<el-button link type="primary" icon="View" @click="handleView(scope.row)" <el-button link type="primary" icon="View" @click="handleView(scope.row)" v-hasPermi="['materials:materialReceive:query']"
v-hasPermi="['materials:materialReceive:query']">查看</el-button> >查看</el-button
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" >
v-hasPermi="['materials:materialReceive:remove']">删除</el-button> <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['materials:materialReceive:remove']"
>删除</el-button
>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" <pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card> </el-card>
<!-- 添加或修改物料接收单对话框 --> <!-- 添加或修改物料接收单对话框 -->
<el-dialog :close-on-click-modal="false" :close-on-press-escape="false" draggable :title="dialog.title" <el-dialog
v-model="dialog.visible" width="800px" append-to-body> :close-on-click-modal="false"
:close-on-press-escape="false"
draggable
:title="dialog.title"
v-model="dialog.visible"
width="800px"
append-to-body
>
<el-form ref="materialReceiveFormRef" :model="form" :rules="rules" label-width="110px"> <el-form ref="materialReceiveFormRef" :model="form" :rules="rules" label-width="110px">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
@ -108,10 +114,8 @@
</el-col> </el-col>
<el-col v-if="form.materialSource == '2'" :span="12"> <el-col v-if="form.materialSource == '2'" :span="12">
<el-form-item label="采购单编号" prop="docId"> <el-form-item label="采购单编号" prop="docId">
<el-select @change="handleSelect" v-model="form.docId" filterable placeholder="请选择采购单" <el-select @change="handleSelect" v-model="form.docId" filterable placeholder="请选择采购单" style="width: 100%">
style="width: 100%"> <el-option v-for="item in purchaseDocList" :key="item.id" :label="item.docCode" :value="item.id"></el-option>
<el-option v-for="item in purchaseDocList" :key="item.id" :label="item.docCode"
:value="item.id"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -130,11 +134,20 @@
<el-input disabled v-model="form.projectName" placeholder="请输入工程名称" /> <el-input disabled v-model="form.projectName" placeholder="请输入工程名称" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" :offset="0"
><el-form-item label="材料名称" prop="materialName">
<el-input v-model="form.materialName" placeholder="请输入设备材料名称" clearable /> </el-form-item
></el-col>
<el-col :span="12" v-if="form.materialSource == '2'"> <el-col :span="12" v-if="form.materialSource == '2'">
<el-form-item label="合同编号" prop="contractName"> <el-form-item label="合同编号" prop="contractName">
<el-select v-model="form.contractName" filterable placeholder="请选择合同" style="width: 100%"> <el-select v-model="form.contractName" filterable placeholder="请选择合同" style="width: 100%">
<el-option v-for="item in contractNameList" :key="item.contractCode" :label="item.contractCode" <el-option
:value="item.contractCode"></el-option> v-for="item in contractNameList"
:key="item.contractCode"
:label="item.contractCode"
:value="item.contractCode"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
@ -149,48 +162,59 @@
<div class="detail"> <div class="detail">
<div class="detail-header"> <div class="detail-header">
<span>数量验收</span> <span>数量验收</span>
<el-button type="primary" v-if="form.materialSource == '1'" link @click="addItem" <el-button type="primary" v-if="form.materialSource == '1'" link @click="addItem" icon="Plus">添加数量验收</el-button>
icon="Plus">添加数量验收</el-button>
</div> </div>
<div v-for="(item, index) in form.itemList" :key="item.id" class="detail-item"> <div v-for="(item, index) in form.itemList" :key="item.id" class="detail-item">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="名称" :prop="`itemList.${index}.name`" <el-form-item label="名称" :prop="`itemList.${index}.name`" :rules="{ required: true, message: '名称不能为空', trigger: 'blur' }">
:rules="{ required: true, message: '名称不能为空', trigger: 'blur' }">
<el-input :disabled="form.materialSource == '2'" v-model="item.name" placeholder="请输入名称" /> <el-input :disabled="form.materialSource == '2'" v-model="item.name" placeholder="请输入名称" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="规格" :prop="`itemList.${index}.specification`" <el-form-item
:rules="{ required: true, message: '规格不能为空', trigger: 'blur' }"> label="规格"
<el-input :disabled="form.materialSource == '2'" v-model="item.specification" :prop="`itemList.${index}.specification`"
placeholder="请输入规格" /> :rules="{ required: true, message: '规格不能为空', trigger: 'blur' }"
>
<el-input :disabled="form.materialSource == '2'" v-model="item.specification" placeholder="请输入规格" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="单位" :prop="`itemList.${index}.unit`" <el-form-item label="单位" :prop="`itemList.${index}.unit`" :rules="{ required: true, message: '单位不能为空', trigger: 'blur' }">
:rules="{ required: true, message: '单位不能为空', trigger: 'blur' }">
<el-input :disabled="form.materialSource == '2'" v-model="item.unit" placeholder="请输入单位" /> <el-input :disabled="form.materialSource == '2'" v-model="item.unit" placeholder="请输入单位" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="数量" :prop="`itemList.${index}.quantity`" :rules="rules.quantityRule" <el-form-item label="数量" :prop="`itemList.${index}.quantity`" :rules="rules.quantityRule" ref="quantityFormItemRefs[index]">
ref="quantityFormItemRefs[index]"> <el-input
<el-input :disabled="form.materialSource == '2'" type="number" v-model.number="item.quantity" :disabled="form.materialSource == '2'"
placeholder="请输入数量" min="0" @input="handleQuantityInput(index)" type="number"
@blur="handleQuantityBlur(index)" /> v-model.number="item.quantity"
placeholder="请输入数量"
min="0"
@input="handleQuantityInput(index)"
@blur="handleQuantityBlur(index)"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="验收" :prop="`itemList.${index}.acceptedQuantity`" <el-form-item label="验收" :prop="`itemList.${index}.acceptedQuantity`" :rules="rules.acceptedQuantityRule">
:rules="rules.acceptedQuantityRule"> <el-input
<el-input type="number" v-model.number="item.acceptedQuantity" placeholder="请输入验收" min="0" type="number"
@input="handleAcceptedInput(index)" /> v-model.number="item.acceptedQuantity"
placeholder="请输入验收"
min="0"
@input="handleAcceptedInput(index)"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="缺件" :prop="`itemList.${index}.shortageQuantity`" <el-form-item
:rules="{ required: true, message: '缺件数量不能为空', trigger: 'blur' }"> label="缺件"
:prop="`itemList.${index}.shortageQuantity`"
:rules="{ required: true, message: '缺件数量不能为空', trigger: 'blur' }"
>
<el-input type="number" min="0" v-model="item.shortageQuantity" placeholder="自动计算" readonly /> <el-input type="number" min="0" v-model="item.shortageQuantity" placeholder="自动计算" readonly />
<span class="tips">*自动计算数量-验收数量</span> <span class="tips">*自动计算数量-验收数量</span>
</el-form-item> </el-form-item>
@ -212,26 +236,22 @@
<el-col :span="12"> <el-col :span="12">
<el-form-item label="合格证文件" prop="certCountFileId"> <el-form-item label="合格证文件" prop="certCountFileId">
<file-upload :isShowTip="false" :fileType="['pdf', 'png', 'jpg', 'jpeg']" <file-upload :isShowTip="false" :fileType="['pdf', 'png', 'jpg', 'jpeg']" v-model="form.certCountFileId" />
v-model="form.certCountFileId" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="出厂报告文件" prop="reportCountFileId"> <el-form-item label="出厂报告文件" prop="reportCountFileId">
<file-upload :isShowTip="false" :fileType="['pdf', 'png', 'jpg', 'jpeg']" <file-upload :isShowTip="false" :fileType="['pdf', 'png', 'jpg', 'jpeg']" v-model="form.reportCountFileId" />
v-model="form.reportCountFileId" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="技术资料文件" prop="techDocCountFileId"> <el-form-item label="技术资料文件" prop="techDocCountFileId">
<file-upload :isShowTip="false" :fileType="['pdf', 'png', 'jpg', 'jpeg']" <file-upload :isShowTip="false" :fileType="['pdf', 'png', 'jpg', 'jpeg']" v-model="form.techDocCountFileId" />
v-model="form.techDocCountFileId" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12"> <el-col :span="12">
<el-form-item label="厂家资质文件" prop="licenseCountFileId"> <el-form-item label="厂家资质文件" prop="licenseCountFileId">
<file-upload :isShowTip="false" :fileType="['pdf', 'png', 'jpg', 'jpeg']" <file-upload :isShowTip="false" :fileType="['pdf', 'png', 'jpg', 'jpeg']" v-model="form.licenseCountFileId" />
v-model="form.licenseCountFileId" />
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="24"> <el-col :span="24">
@ -412,7 +432,7 @@ const { queryParams, form, rules } = toRefs(data);
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
try { try {
if(queryParams.value.materialSource=='0'){ if (queryParams.value.materialSource == '0') {
delete queryParams.value.materialSource; delete queryParams.value.materialSource;
} }
const res = await listMaterialReceive(queryParams.value); const res = await listMaterialReceive(queryParams.value);
@ -506,9 +526,9 @@ const handleUpdate = async (row?: MaterialReceiveVO) => {
watchItemChanges(index); watchItemChanges(index);
// 手动触发当前条目的数量、验收数量、缺件数量验证 // 手动触发当前条目的数量、验收数量、缺件数量验证
if (materialReceiveFormRef.value) { if (materialReceiveFormRef.value) {
materialReceiveFormRef.value.validateField(`itemList.${index}.quantity`, () => { }); materialReceiveFormRef.value.validateField(`itemList.${index}.quantity`, () => {});
materialReceiveFormRef.value.validateField(`itemList.${index}.acceptedQuantity`, () => { }); materialReceiveFormRef.value.validateField(`itemList.${index}.acceptedQuantity`, () => {});
materialReceiveFormRef.value.validateField(`itemList.${index}.shortageQuantity`, () => { }); materialReceiveFormRef.value.validateField(`itemList.${index}.shortageQuantity`, () => {});
} }
}); });
@ -619,9 +639,9 @@ const handleAcceptedInput = (index: number) => {
// 手动验证数量和验收数量字段 // 手动验证数量和验收数量字段
const validateQuantityField = (index: number) => { const validateQuantityField = (index: number) => {
if (materialReceiveFormRef.value) { if (materialReceiveFormRef.value) {
materialReceiveFormRef.value.validateField(`itemList.${index}.quantity`, () => { }); materialReceiveFormRef.value.validateField(`itemList.${index}.quantity`, () => {});
materialReceiveFormRef.value.validateField(`itemList.${index}.acceptedQuantity`, () => { }); materialReceiveFormRef.value.validateField(`itemList.${index}.acceptedQuantity`, () => {});
materialReceiveFormRef.value.validateField(`itemList.${index}.shortageQuantity`, () => { }); materialReceiveFormRef.value.validateField(`itemList.${index}.shortageQuantity`, () => {});
} }
}; };

View File

@ -86,13 +86,14 @@ const handleTabChange = (tab) => {
activeTab.value = tab; activeTab.value = tab;
data.queryParams.valueType = '1'; data.queryParams.valueType = '1';
// data.queryParams.month = ''; // data.queryParams.month = '';
getList();
}; };
/** 查询项目总产值分配列表 */ /** 查询项目总产值分配列表 */
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
const res = await listOutTable(queryParams.value); const res = await listOutTable({ ...queryParams.value, type: activeTab.value });
valueAllocationList.value = res.rows; valueAllocationList.value = res.rows;
total.value = res.total; total.value = res.total;
loading.value = false; loading.value = false;

View File

@ -298,6 +298,11 @@ const getList = async () => {
const res = await getProjectSquare(currentProject.value?.id); const res = await getProjectSquare(currentProject.value?.id);
if (res.data.length === 0) { if (res.data.length === 0) {
proxy?.$modal.msgWarning('当前项目下没有方阵,请先创建方阵'); proxy?.$modal.msgWarning('当前项目下没有方阵,请先创建方阵');
matrixOptions.value = [];
queryParams.value.projectId = '';
form.value.projectId = '';
tabList.value = [];
activeTab.value = '';
} else { } else {
let matrixList = res.data.map((item) => { let matrixList = res.data.map((item) => {
return { return {
@ -472,6 +477,7 @@ const matrixValue = ref<number | undefined>(matrixOptions.value.length > 0 ? mat
const resetMatrix = () => { const resetMatrix = () => {
matrixValue.value = undefined; matrixValue.value = undefined;
queryParams.value.matrixId = undefined; queryParams.value.matrixId = undefined;
queryParams.value.projectId = undefined;
matrixOptions.value = []; matrixOptions.value = [];
}; };
@ -491,8 +497,6 @@ onMounted(() => {
const listeningProject = watch( const listeningProject = watch(
() => currentProject.value?.id, () => currentProject.value?.id,
(nid, oid) => { (nid, oid) => {
queryParams.value.projectId = nid;
form.value.projectId = nid;
resetMatrix(); resetMatrix();
getList(); getList();
} }

View File

@ -234,7 +234,7 @@ const showSearch = ref(true);
const uploadRef = ref<any>(null); const uploadRef = ref<any>(null);
// 方阵表单模型核心修复使用reactive并显式声明结构 // 方阵表单模型核心修复使用reactive并显式声明结构
const formM = reactive<MatrixForm>({ const formM = ref<MatrixForm>({
landId: undefined, landId: undefined,
unitBoList: [{ unitProjectArea: '', unitProjectStatus: '', unitProjectId: [] }] unitBoList: [{ unitProjectArea: '', unitProjectStatus: '', unitProjectId: [] }]
}); });
@ -424,11 +424,11 @@ const getfangzhenList = async () => {
/** 关联方阵 */ /** 关联方阵 */
const handleView = async (row: LandBlockVO) => { const handleView = async (row: LandBlockVO) => {
if (!row?.id) return proxy?.$modal.msgWarning('请选择有效的地块'); if (!row?.id) return proxy?.$modal.msgWarning('请选择有效的地块');
console.log('🚀 ~ handleView ~ row:', row);
// 重置方阵表单 // 重置方阵表单
resetMatrix(); resetMatrix();
// 绑定当前地块ID // 绑定当前地块ID
formM.landId = row.id; formM.value.landId = row.id;
// 打开弹窗 // 打开弹窗
dialogMatrix.visible = true; dialogMatrix.visible = true;
@ -437,7 +437,7 @@ const handleView = async (row: LandBlockVO) => {
/** 新增方阵表单项 */ /** 新增方阵表单项 */
const addUnitBoItem = () => { const addUnitBoItem = () => {
formM.unitBoList.push({ formM.value.unitBoList.push({
unitProjectArea: '', unitProjectArea: '',
unitProjectStatus: '', unitProjectStatus: '',
unitProjectId: [] unitProjectId: []
@ -448,10 +448,10 @@ const addUnitBoItem = () => {
/** 删除方阵表单项 */ /** 删除方阵表单项 */
const removeUnitBoItem = (index: number) => { const removeUnitBoItem = (index: number) => {
if (formM.unitBoList.length <= 1) { if (formM.value.unitBoList.length <= 1) {
return proxy?.$modal.msgWarning('至少保留一项方阵配置'); return proxy?.$modal.msgWarning('至少保留一项方阵配置');
} }
formM.unitBoList.splice(index, 1); formM.value.unitBoList.splice(index, 1);
landBlockFormMatrixRef.value?.clearValidate(); landBlockFormMatrixRef.value?.clearValidate();
}; };
@ -459,11 +459,11 @@ const removeUnitBoItem = (index: number) => {
const submitFormMatrix = () => { const submitFormMatrix = () => {
landBlockFormMatrixRef.value?.validate(async (valid: boolean) => { landBlockFormMatrixRef.value?.validate(async (valid: boolean) => {
if (!valid) return; if (!valid) return;
if (!formM.landId) return proxy?.$modal.msgWarning('地块ID异常请重新选择地块'); if (!formM.value.landId) return proxy?.$modal.msgWarning('地块ID异常请重新选择地块');
try { try {
// 处理方阵数据修复ID拆分逻辑 // 处理方阵数据修复ID拆分逻辑
const unitBoListParams = formM.unitBoList.map((item) => { const unitBoListParams = formM.value.unitBoList.map((item) => {
// 取级联选择的最后一层值 // 取级联选择的最后一层值
const lastLevelValue = item.unitProjectId[item.unitProjectId.length - 1]; const lastLevelValue = item.unitProjectId[item.unitProjectId.length - 1];
if (!lastLevelValue) throw new Error('请选择完整的方阵'); if (!lastLevelValue) throw new Error('请选择完整的方阵');
@ -482,7 +482,7 @@ const submitFormMatrix = () => {
// 调用关联接口 // 调用关联接口
const res = await LandUnit({ const res = await LandUnit({
landId: formM.landId, landId: formM.value.landId,
unitBoList: unitBoListParams unitBoList: unitBoListParams
}); });
@ -507,12 +507,12 @@ const cancelMatrix = () => {
/** 方阵表单重置 */ /** 方阵表单重置 */
const resetMatrix = () => { const resetMatrix = () => {
formM.landId = undefined;
formM.unitBoList = [{ unitProjectArea: '', unitProjectStatus: '', unitProjectId: [] }];
if (landBlockFormMatrixRef.value) { if (landBlockFormMatrixRef.value) {
landBlockFormMatrixRef.value.resetFields(); landBlockFormMatrixRef.value.resetFields();
landBlockFormMatrixRef.value.clearValidate(); landBlockFormMatrixRef.value.clearValidate();
} }
formM.value.landId = undefined;
formM.value.unitBoList = [{ unitProjectArea: '', unitProjectStatus: '', unitProjectId: [] }];
}; };
/** 监听项目变化,刷新数据 */ /** 监听项目变化,刷新数据 */

View File

@ -17,7 +17,7 @@
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" @click="toggleExpandAll">{{ isExpandAll ? '一键收起' : '一键展开' }}</el-button> <el-button type="primary" @click="handleToggleExpandAll">{{ isExpandAll ? '一键收起' : '一键展开' }}</el-button>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>