This commit is contained in:
2025-08-29 19:25:18 +08:00
63 changed files with 2176 additions and 552 deletions

View File

@ -7,13 +7,7 @@
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5" :offset="0">
<el-button
type="primary"
v-hasPermi="['cailiaoshebei:materialbatchdemandplan:add']"
size="default"
@click="handleAdd"
icon="FolderAdd"
plain
<el-button type="primary" v-hasPermi="['cailiaoshebei:mrpBase:addbatch']" size="default" @click="handleAdd" icon="FolderAdd" plain
>新增</el-button
>
</el-col>
@ -21,7 +15,7 @@
<el-button
type="danger"
size="default"
v-hasPermi="['cailiaoshebei:materialbatchdemandplan:remove']"
v-hasPermi="['cailiaoshebei:mrpBase:remove']"
@click="handleDeleteBatch"
:disabled="form.mrpBaseBo.status != 'draft'"
icon="FolderDelete"
@ -66,9 +60,7 @@
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5" v-if="form.mrpBaseBo.status == 'draft'">
<el-button type="primary" plain icon="Edit" @click="handleUpdata" v-hasPermi="['cailiaoshebei:materialbatchdemandplan:edit']"
>修改</el-button
>
<el-button type="primary" plain icon="Edit" @click="handleUpdata" v-hasPermi="['cailiaoshebei:mrpBase:addbatch']">修改</el-button>
</el-col>
<el-col :span="1.5" v-if="form.mrpBaseBo.status == 'draft'">
<el-button plain type="primary" icon="Finished" @click="handleAudit()">审核</el-button>

View File

@ -1,11 +1,13 @@
<template>
<div class="p-2">
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<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" label-width="auto">
<el-form-item label="材料名称" prop="materialsName">
<el-input v-model="queryParams.materialsName" placeholder="请输入材料名称" clearable @keyup.enter="handleQuery" />
<el-input v-model="queryParams.materialsName" placeholder="请输入材料名称" clearable
@keyup.enter="handleQuery" />
</el-form-item>
<el-form-item label="材料提供商" prop="companyId">
<el-select v-model="queryParams.companyId" clearable placeholder="全部">
@ -25,20 +27,22 @@
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['materials:materials:add']"> 新增 </el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['materials:materials:edit']"
>修改
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['materials:materials:add']"> 新增
</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['materials:materials:remove']"
>删除
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()"
v-hasPermi="['materials:materials:edit']">修改
</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['materials:materials:export']">导出 </el-button>
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()"
v-hasPermi="['materials:materials:remove']">删除
</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="warning" plain icon="Download" @click="handleExport"
v-hasPermi="['materials:materials:export']">导出 </el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -68,20 +72,25 @@
<el-table-column fixed="right" label="操作" align="center" class-name="small-padding fixed-width" width="320">
<template #default="scope">
<el-space>
<el-button link type="primary" icon="View" @click="handleShowDrawer(scope.row)" v-hasPermi="['materials:materials:query']">
<el-button link type="primary" icon="View" @click="handleShowDrawer(scope.row)"
v-hasPermi="['materials:materials:query']">
详情
</el-button>
<el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['materials:materials:edit']"> 修改 </el-button>
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['materials:materials:remove']">
<el-button link type="success" icon="Edit" @click="handleUpdate(scope.row)"
v-hasPermi="['materials:materials:edit']"> 修改 </el-button>
<el-button link type="danger" icon="Delete" @click="handleDelete(scope.row)"
v-hasPermi="['materials:materials:remove']">
删除
</el-button>
<el-button link type="primary" icon="Plus" @click="handleAddMaterialsInventory(scope.row)"> 出入库 </el-button>
<el-button v-hasPermi="['materials:materialsInventory:edit']" link type="primary" icon="Plus"
@click="handleAddMaterialsInventory(scope.row)"> 出入库 </el-button>
</el-space>
</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" />
<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>
@ -112,17 +121,12 @@
<el-form-item label="材料文件" prop="fileOssIdMap">
<div :key="item.value" v-for="item in materials_file_type">
<h3>{{ item.label }}</h3>
<file-upload
v-model="ossIdMap[item.value]"
:limit="1"
:file-size="50"
:file-type="['pdf']"
<file-upload v-model="ossIdMap[item.value]" :limit="1" :file-size="50" :file-type="['pdf']"
@update:model-value="
(args) => {
handleOssUpdate(args, item.value);
}
"
/>
" />
</div>
</el-form-item>
</el-form>
@ -133,7 +137,8 @@
</div>
</template>
</el-dialog>
<materials-inventory-add-dialog :materials-id="currentMaterialsId" :project-id="currentProject.id" ref="dialogRef" @submit="getList" />
<materials-inventory-add-dialog :materials-id="currentMaterialsId" :project-id="currentProject.id" ref="dialogRef"
@submit="getList" />
<el-dialog title="材料详情" v-model="showDetailDrawer" width="700px">
<materials-detail-drawer :materials-id="currentMaterialsId" />
</el-dialog>

View File

@ -1,7 +1,7 @@
<template>
<el-dialog v-model="isShowDialog" title="材料设备详情" draggable width="1200px" :close-on-click-modal="false" :destroy-on-close="true">
<el-card :body-style="{ padding: '20px' }" style="border: none; box-shadow: none">
<div class="dialog-footer">
<div class="dialog-footer" v-hasPermi="['materials:materialReceive:exportWord']">
<div class="btn-item" @click="onLoad">
<img src="./icon/down.png" />
<span>导出</span>

View File

@ -11,6 +11,23 @@
<el-form-item v-if="state.masterData.status == 'waiting' || state.masterData.status == 'finish'">
<el-button icon="view" @click="lookApprovalFlow()" type="warning">查看流程</el-button>
</el-form-item>
<el-form-item>
<el-button icon="Finished" @click="editApprovalSheet()" type="success">保存</el-button>
</el-form-item>
<el-form-item>
<file-upload
upload-url="/design/totalsupplyplan/import"
v-model="file"
:limit="1"
:file-type="['xls', 'xlsx']"
:on-upload-success="handleSuccess"
>
<el-button type="primary" plain icon="Compass">导入</el-button>
</file-upload>
</el-form-item>
<el-form-item>
<el-button type="primary" plain icon="Filter" @click="handleExport">导出</el-button>
</el-form-item>
</el-form>
<right-toolbar @queryTable="getMasterDataList"></right-toolbar>
</el-row>
@ -23,6 +40,7 @@
style="width: 100%; margin-bottom: 20px; height: calc(100vh - 230px)"
row-key="id"
border
:tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
>
<el-table-column prop="num" label="编号" />
<el-table-column prop="name" label="工程或费用名称" width="180" />
@ -30,18 +48,38 @@
<el-table-column prop="specification" label="规格型号" />
<el-table-column prop="quantity" label="数量" width="60" />
<el-table-column prop="batchNumber" label="批次号" width="200" />
<el-table-column prop="brand" label="品牌" />
<el-table-column prop="texture" label="材质" />
<el-table-column prop="qualityStandard" label="质量标准" />
<el-table-column prop="partUsed" label="使用部位" />
<el-table-column prop="deliveryPoints" label="交货地点" />
<el-table-column prop="brand" label="品牌">
<template #default="{ row }">
<el-input v-model="row.brand" placeholder="" clearable />
</template>
</el-table-column>
<el-table-column prop="texture" label="材质">
<template #default="{ row }">
<el-input v-model="row.texture" placeholder="" clearable />
</template>
</el-table-column>
<el-table-column prop="qualityStandard" label="质量标准">
<template #default="{ row }">
<el-input v-model="row.qualityStandard" placeholder="" clearable />
</template>
</el-table-column>
<el-table-column prop="partUsed" label="使用部位">
<template #default="{ row }">
<el-input v-model="row.partUsed" placeholder="" clearable />
</template>
</el-table-column>
<el-table-column prop="deliveryPoints" label="交货地点">
<template #default="{ row }">
<el-input v-model="row.deliveryPoints" placeholder="" clearable />
</template>
</el-table-column>
<el-table-column label="预计使用日期">
<template #default="{ row }">
<span>{{ row.dateService ? row.dateService.split(' ')[0] : '' }}</span>
<el-date-picker v-model="row.dateService" type="date" value-format="YYYY-MM-DD" placeholder="" />
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" />
<el-table-column label="操作">
<!-- <el-table-column label="操作">
<template #default="{ row }">
<el-button
:disabled="state.masterData.status == 'waiting' || state.masterData.status == 'finish'"
@ -51,7 +89,7 @@
>修改</el-button
>
</template>
</el-table-column>
</el-table-column> -->
</el-table>
<!-- 编辑 -->
<el-dialog v-model="visible" title="修改物料信息" :width="800" :close-on-click-modal="false" @close="handleClose">
@ -124,7 +162,8 @@ import {
obtainMasterDataList,
totalsupplyplan,
totalSupplyplanDetails,
materialChangeSupplyplan
materialChangeSupplyplan,
totalSupplyplanBatchEdit
} from '@/api/materials/overallPlanMaterialSupply/index';
import { useUserStoreHook } from '@/store/modules/user';
const userStore = useUserStoreHook();
@ -210,7 +249,8 @@ async function getMasterDataList() {
// 处理结果
if (supplyPlanRes.list == null) {
state.tableData = supplyPlanRes.rows || [];
// state.tableData = supplyPlanRes.rows || [];
state.tableData = proxy?.handleTree(supplyPlanRes.rows, 'sid', 'pid');
console.log('state.tableData', state.tableData);
} else {
// 根据实际业务逻辑处理有list的情况
@ -261,11 +301,13 @@ async function totalSupplyplanDetail(id) {
}
}
// 修改
function editApprovalSheet(row) {
console.log(row);
totalSupplyplanDetail(row.id);
visible.value = true;
}
const editApprovalSheet = async () => {
state.loading.list = true;
await totalSupplyplanBatchEdit(state.tableData);
proxy.$modal.msgSuccess('修改成功');
state.loading.list = false;
};
// 提交表单
const handleSubmit = async () => {
try {
@ -292,6 +334,17 @@ function editMaterialSupply(formData) {
});
}
const handleExport = async () => {
proxy?.download(
'/design/totalsupplyplan/export',
{
projectId: currentProject.value?.id
},
`物资供应总计划.xlsx`,
true
);
};
// 关闭弹窗
const handleClose = () => {
visible.value = false;

View File

@ -116,7 +116,7 @@
<el-button link type="primary" icon="View" @click="handleDetail(scope.row)" v-hasPermi="['cailiaoshebei:purchaseDoc:remove']"
>详情</el-button
>
<el-button link type="primary" icon="Download" @click="handleDownload(scope.row)" v-hasPermi="['cailiaoshebei:purchaseDoc:downloadWord']"
<el-button link type="primary" icon="Download" @click="handleDownload(scope.row)" v-hasPermi="['cailiaoshebei:purchaseDoc:exportWord']"
>下载</el-button
>
</template>