产值计划

This commit is contained in:
tcy
2025-08-23 04:36:12 +08:00
parent 59d1f881dd
commit dbb649d1ce
10 changed files with 518 additions and 274 deletions

View File

@ -6,43 +6,20 @@
<el-card shadow="hover">
<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
></el-col
>
<el-col :span="1.5" :offset="0"
><el-button
type="danger"
size="default"
v-hasPermi="['cailiaoshebei:materialbatchdemandplan:remove']"
@click="handleDeleteBatch"
icon="FolderDelete"
plain
>删除</el-button
></el-col
>
<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></el-col>
<el-col :span="1.5" :offset="0"><el-button type="danger" size="default"
v-hasPermi="['cailiaoshebei:materialbatchdemandplan:remove']" @click="handleDeleteBatch"
icon="FolderDelete" plain>删除</el-button></el-col>
</el-row>
</template>
<el-input v-model="batchNumber" placeholder="请输入批次号" @input="searchBatchList" prefix-icon="Search" clearable />
<el-tree
ref="batchTreeRef"
class="mt-2"
node-key="id"
:data="batchOptions"
:props="{ label: 'planCode', children: 'children' }"
:expand-on-click-node="false"
highlight-current
default-expand-all
@node-click="handleNodeClick"
>
<el-input v-model="batchNumber" placeholder="请输入批次号" @input="searchBatchList" prefix-icon="Search"
clearable />
<el-tree ref="batchTreeRef" class="mt-2" node-key="id" :data="batchOptions"
:props="{ label: 'planCode', children: 'children' }" :expand-on-click-node="false" highlight-current
default-expand-all @node-click="handleNodeClick">
<template #default="{ node, data }">
<div class="custom-tree-node">
{{ node.label }}
@ -50,14 +27,8 @@
</div>
</template>
</el-tree>
<pagination
v-show="total > 0"
:total="total"
v-model:page="queryParams.batchData.pageNum"
v-model:limit="queryParams.batchData.pageSize"
@pagination="getList"
layout="prev, pager, next,jumper"
/>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.batchData.pageNum"
v-model:limit="queryParams.batchData.pageSize" @pagination="getList" layout="prev, pager, next,jumper" />
</el-card>
</el-col>
<el-col :span="19">
@ -65,14 +36,12 @@
<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:materialbatchdemandplan:edit']">修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button plain type="warning" icon="Finished" @click="handleAudit()" v-hasPermi="['cailiaoshebei:materialbatchdemandplan:query']"
>审核</el-button
>
<el-button plain type="warning" icon="Finished" @click="handleAudit()"
v-hasPermi="['cailiaoshebei:materialbatchdemandplan:query']">审核</el-button>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
@ -90,19 +59,14 @@
<el-table-column label="需求到货时间" align="center" prop="arrivalTime" width="250" />
<el-table-column label="备注" align="center" prop="remark" />
</el-table>
<pagination
v-show="mainTotal > 0"
:total="mainTotal"
v-model:page="queryParams.mainData.pageNum"
v-model:limit="queryParams.mainData.pageSize"
@pagination="getMainList"
/>
<pagination v-show="mainTotal > 0" :total="mainTotal" v-model:page="queryParams.mainData.pageNum"
v-model:limit="queryParams.mainData.pageSize" @pagination="getMainList" />
</el-card>
</el-col>
</el-row>
<!-- 添加或修改物资-材料设备对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="1250px" append-to-body>
<el-dialog draggable :title="dialog.title" v-model="dialog.visible" width="1300px" append-to-body>
<el-form :model="form" ref="cailiaoshebeiFormRef" :rules="rules" label-width="80px" :inline="false">
<el-divider>基础信息</el-divider>
<el-row :gutter="20">
@ -113,7 +77,8 @@
</el-col>
<el-col :span="8" :offset="0">
<el-form-item label="编制日期" prop="mrpBaseBo.preparedDate">
<el-date-picker v-model="form.mrpBaseBo.preparedDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择编制日期" />
<el-date-picker v-model="form.mrpBaseBo.preparedDate" type="date" value-format="YYYY-MM-DD"
placeholder="请选择编制日期" />
</el-form-item>
</el-col>
<el-col :span="8" :offset="0">
@ -125,10 +90,21 @@
<el-divider>主要信息</el-divider>
<el-table :data="form.planList">
<el-table-column prop="name" align="center" label="版本号 " width="150">
<template #default="scope">
<el-select v-model="scope.row.versions" placeholder="请选择"
@change="(val) => selectNameVersion(val, scope.row)">
<el-option v-for="item in versionList" :key="item.versions" :label="item.versions"
:value="item.versions" />
</el-select>
</template>
</el-table-column>
<el-table-column prop="name" align="center" label="物资名称">
<template #default="scope">
<!-- <el-input v-model="scope.row.name" placeholder="请输入物资" /> -->
<el-select v-model="scope.row.suppliespriceId" placeholder="请选择" @change="(val) => selectName(val, scope.row)">
<el-select :disabled="!scope.row.versions" v-model="scope.row.suppliespriceId" placeholder="请选择"
@change="(val) => selectName(val, scope.row)">
<el-option v-for="item in nameList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
</template>
@ -155,7 +131,8 @@
</el-table-column>
<el-table-column prop="arrivalTime" align="center" label="需求到货时间">
<template #default="scope">
<el-date-picker v-model="scope.row.arrivalTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择" style="width: 140px" />
<el-date-picker v-model="scope.row.arrivalTime" type="date" value-format="YYYY-MM-DD" placeholder="请选择"
style="width: 140px" />
</template>
</el-table-column>
<el-table-column prop="remark" align="center" label="备注" width="150">
@ -188,7 +165,7 @@ import {
listBatch,
getBatch,
delBatch,
listSelectCailiaoshebei,
listSelectCailiaoshebei, obtainTheVersion,
getDictList
} from '@/api/materials/batchPlan';
import { CailiaoshebeiVO, CailiaoshebeiQuery, CailiaoshebeiForm } from '@/api/materials/batchPlan/types';
@ -271,6 +248,7 @@ const data = reactive({
const batchNumber = ref('');
const { queryParams, form, rules } = toRefs(data);
const nameList = ref([]);
const versionList = ref([]);
/** 查询物资-材料设备列表 */
const getList = async (type?: string) => {
loading.value = true;
@ -480,15 +458,26 @@ const handleAudit = async () => {
});
};
const getNameList = () => {
getDictList({ projectId: currentProject.value?.id }).then((res) => {
const getNameList = (versions) => {
getDictList({ projectId: currentProject.value?.id, versions }).then((res) => {
nameList.value = res.data;
});
};
// 获取版本号
const getVersion = () => {
obtainTheVersion({ projectId: currentProject.value?.id }).then((res) => {
versionList.value = res.data;
});
};
const selectNameVersion = (val, row) => {
row.suppliespriceId = undefined;
getNameList(val);
};
onMounted(() => {
getList();
getNameList();
// getNameList();
getVersion();
});
//监听项目id刷新数据