``
This commit is contained in:
parent
90f8bfe677
commit
c9468784b0
117
public/mrp2.html
Normal file
117
public/mrp2.html
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="zh-CN">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>MRP运算结果管理</title>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
||||||
|
background: #f5f5f5;
|
||||||
|
}
|
||||||
|
.container {
|
||||||
|
max-width: 1200px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
.header {
|
||||||
|
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||||
|
color: white;
|
||||||
|
padding: 20px;
|
||||||
|
border-radius: 8px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
text-align: center;
|
||||||
|
box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
.header h1 {
|
||||||
|
margin: 0;
|
||||||
|
font-size: 24px;
|
||||||
|
}
|
||||||
|
.header p {
|
||||||
|
margin: 8px 0 0 0;
|
||||||
|
opacity: 0.9;
|
||||||
|
}
|
||||||
|
.content {
|
||||||
|
background: white;
|
||||||
|
padding: 20px;
|
||||||
|
border-radius: 8px;
|
||||||
|
box-shadow: 0 2px 8px 0 rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
.info-box {
|
||||||
|
background: #f0f9ff;
|
||||||
|
border: 1px solid #b3d8ff;
|
||||||
|
border-radius: 6px;
|
||||||
|
padding: 16px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.info-box h3 {
|
||||||
|
margin: 0 0 12px 0;
|
||||||
|
color: #409eff;
|
||||||
|
}
|
||||||
|
.info-box p {
|
||||||
|
margin: 8px 0;
|
||||||
|
color: #606266;
|
||||||
|
}
|
||||||
|
.button-group {
|
||||||
|
display: flex;
|
||||||
|
gap: 12px;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
.btn {
|
||||||
|
padding: 10px 20px;
|
||||||
|
border: none;
|
||||||
|
border-radius: 4px;
|
||||||
|
cursor: pointer;
|
||||||
|
text-decoration: none;
|
||||||
|
display: inline-block;
|
||||||
|
font-size: 14px;
|
||||||
|
transition: all 0.3s;
|
||||||
|
}
|
||||||
|
.btn-primary {
|
||||||
|
background: #409eff;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
.btn-primary:hover {
|
||||||
|
background: #66b1ff;
|
||||||
|
}
|
||||||
|
.btn-info {
|
||||||
|
background: #909399;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
.btn-info:hover {
|
||||||
|
background: #a6a9ad;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="container">
|
||||||
|
<div class="header">
|
||||||
|
<h1>📊 MRP运算结果核算</h1>
|
||||||
|
<p>物料需求计划运算结果查询与分析</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="content">
|
||||||
|
<div class="info-box">
|
||||||
|
<h3>🚀 快速访问</h3>
|
||||||
|
<p><strong>独立访问地址:</strong> <code>/MRP</code></p>
|
||||||
|
<p><strong>功能说明:</strong> 无需登录即可访问MRP运算结果管理页面</p>
|
||||||
|
<p><strong>主要功能:</strong></p>
|
||||||
|
<ul>
|
||||||
|
<li>生产令号选择与搜索</li>
|
||||||
|
<li>MRP运算执行</li>
|
||||||
|
<li>运算结果查看与分析</li>
|
||||||
|
<li>数据导出功能</li>
|
||||||
|
<li>统计信息展示</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="button-group">
|
||||||
|
<a href="/MRP" class="btn btn-primary">🎯 进入MRP页面</a>
|
||||||
|
<a href="/" class="btn btn-info">🏠 返回首页</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@ -3,34 +3,34 @@
|
|||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="生产令号" prop="productionOrderNo">
|
<el-form-item label="生产令号" prop="productionOrderNo">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.productionOrderNo"
|
v-model="queryParams.productionOrderNo"
|
||||||
placeholder="请输入生产令号"
|
placeholder="请输入生产令号"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="项目名称" prop="productionName">
|
<el-form-item label="项目名称" prop="productionName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.productionName"
|
v-model="queryParams.productionName"
|
||||||
placeholder="请输入项目名称"
|
placeholder="请输入项目名称"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="图号" prop="drawingNo">
|
<el-form-item label="图号" prop="drawingNo">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.drawingNo"
|
v-model="queryParams.drawingNo"
|
||||||
placeholder="请输入图号"
|
placeholder="请输入图号"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="名称" prop="drawingName">
|
<el-form-item label="名称" prop="drawingName">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.drawingName"
|
v-model="queryParams.drawingName"
|
||||||
placeholder="请输入名称"
|
placeholder="请输入名称"
|
||||||
clearable
|
clearable
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <el-form-item label="创建人" prop="createdBy">
|
<!-- <el-form-item label="创建人" prop="createdBy">
|
||||||
@ -49,21 +49,15 @@
|
|||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
/>
|
/>
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
<el-form-item label="计划结束时间" prop="planEndTime">
|
<el-form-item label="项目类型" prop="isEnterpriseStandard">
|
||||||
<el-date-picker clearable
|
<el-select
|
||||||
v-model="queryParams.planEndTime"
|
v-model="queryParams.isEnterpriseStandard"
|
||||||
type="date"
|
placeholder="请选择"
|
||||||
value-format="yyyy-MM-dd"
|
clearable>
|
||||||
placeholder="请选择计划结束时间">
|
<el-option label="非标单" :value="0"/>
|
||||||
</el-date-picker>
|
<el-option label="企标单" :value="1"/>
|
||||||
</el-form-item>
|
<el-option label="变更单" :value="2"/>
|
||||||
<el-form-item label="计划开始时间" prop="planStartTime">
|
</el-select>
|
||||||
<el-date-picker clearable
|
|
||||||
v-model="queryParams.planStartTime"
|
|
||||||
type="date"
|
|
||||||
value-format="yyyy-MM-dd"
|
|
||||||
placeholder="请选择计划开始时间">
|
|
||||||
</el-date-picker>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
@ -74,47 +68,47 @@
|
|||||||
<el-row :gutter="10" class="mb8">
|
<el-row :gutter="10" class="mb8">
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
plain
|
plain
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleAdd"
|
@click="handleAdd"
|
||||||
v-hasPermi="['system:orderPro:add']"
|
v-hasPermi="['system:orderPro:add']"
|
||||||
>新增
|
>新增
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
plain
|
plain
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
size="mini"
|
size="mini"
|
||||||
:disabled="single"
|
:disabled="single"
|
||||||
@click="handleUpdate"
|
@click="handleUpdate"
|
||||||
v-hasPermi="['system:orderPro:edit']"
|
v-hasPermi="['system:orderPro:edit']"
|
||||||
>修改
|
>修改
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="danger"
|
type="danger"
|
||||||
plain
|
plain
|
||||||
icon="el-icon-delete"
|
icon="el-icon-delete"
|
||||||
size="mini"
|
size="mini"
|
||||||
:disabled="multiple"
|
:disabled="multiple"
|
||||||
@click="handleDelete"
|
@click="handleDelete"
|
||||||
v-hasPermi="['system:orderPro:remove']"
|
v-hasPermi="['system:orderPro:remove']"
|
||||||
>删除
|
>删除
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="1.5">
|
<el-col :span="1.5">
|
||||||
<el-button
|
<el-button
|
||||||
type="warning"
|
type="warning"
|
||||||
plain
|
plain
|
||||||
icon="el-icon-download"
|
icon="el-icon-download"
|
||||||
size="mini"
|
size="mini"
|
||||||
@click="handleExport"
|
@click="handleExport"
|
||||||
v-hasPermi="['system:orderPro:export']"
|
v-hasPermi="['system:orderPro:export']"
|
||||||
>导出
|
>导出
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
@ -135,41 +129,60 @@
|
|||||||
<el-table-column label="执行单图" align="center" min-width="100">
|
<el-table-column label="执行单图" align="center" min-width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-image
|
<el-image
|
||||||
v-if="scope.row.drawingPath"
|
v-if="scope.row.drawingPath"
|
||||||
:src="getFullImageUrl(scope.row.drawingPath)"
|
:src="getFullImageUrl(scope.row.drawingPath)"
|
||||||
style="width:80px; height:80px; object-fit:cover; border-radius:4px;"
|
style="width:80px; height:80px; object-fit:cover; border-radius:4px;"
|
||||||
:preview-src-list="[getFullImageUrl(scope.row.drawingPath)]"
|
:preview-src-list="[getFullImageUrl(scope.row.drawingPath)]"
|
||||||
fit="cover"
|
fit="cover"
|
||||||
/>
|
/>
|
||||||
<span v-else style="color: #909399; font-size: 12px;">暂无执行单图</span>
|
<span v-else style="color: #909399; font-size: 12px;">暂无执行单图</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="图纸类型" align="center" prop="drawingType">
|
<!-- <el-table-column label="项目类型" align="center" prop="drawingType">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span v-if="scope.row.drawingType">
|
<span v-if="scope.row.drawingType">
|
||||||
{{ getDrawingTypeLabel(scope.row.drawingType) }}
|
{{ getDrawingTypeLabel(scope.row.drawingType) }}
|
||||||
</span>
|
</span>
|
||||||
<span v-else>-</span>
|
<span v-else>-</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>-->
|
||||||
<el-table-column label="计量单位" align="center" prop="unit"/>
|
|
||||||
<!-- <el-table-column label="产品数量" align="center" prop="quantity"/>-->
|
<el-table-column label="项目状态" align="center" prop="imCategory">
|
||||||
<el-table-column label="是否企标" align="center" prop="isEnterpriseStandard">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ scope.row.isEnterpriseStandard === 1 ? '是' : '否' }}</span>
|
<dict-tag :options="dict.type.process_status" :value="scope.row.bomStatus"/>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
|
|
||||||
|
<el-table-column label="计量单位" align="center" prop="unit"/>
|
||||||
|
<!-- <el-table-column label="产品数量" align="center" prop="quantity"/>-->
|
||||||
|
<el-table-column label="项目类型" align="center" prop="isEnterpriseStandard">
|
||||||
|
<template v-slot="scope">
|
||||||
|
<span>
|
||||||
|
{{
|
||||||
|
scope.row.isEnterpriseStandard === 0
|
||||||
|
? '非标单'
|
||||||
|
: scope.row.isEnterpriseStandard === 1
|
||||||
|
? '企标单'
|
||||||
|
: scope.row.isEnterpriseStandard === 2
|
||||||
|
? '变更单'
|
||||||
|
: ''
|
||||||
|
}}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="项目完成时间" align="center" prop="projectEndTime" width="180">
|
<el-table-column label="项目完成时间" align="center" prop="projectEndTime" width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.projectEndTime, '{y}-{m}-{d}') }}</span>
|
<span>{{ parseTime(scope.row.projectEndTime, '{y}-{m}-{d}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="生产开始时间" align="center" prop="planStartTime" width="180">
|
<el-table-column label="生产开始时间" align="center" prop="planStartTime" width="180">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span>{{ parseTime(scope.row.planStartTime, '{y}年{m}月{d}日') }}</span>
|
<span>{{ parseTime(scope.row.planStartTime, '{y}年{m}月{d}日') }}</span>
|
||||||
@ -180,7 +193,7 @@
|
|||||||
<span>{{ parseTime(scope.row.planEndTime, '{y}年{m}月{d}日') }}</span>
|
<span>{{ parseTime(scope.row.planEndTime, '{y}年{m}月{d}日') }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-dropdown :split-button="true" size="small" type="primary" @click="handleBOM(scope.row.productionOrderNo)"
|
<el-dropdown :split-button="true" size="small" type="primary" @click="handleBOM(scope.row.productionOrderNo)"
|
||||||
@ -196,24 +209,23 @@
|
|||||||
</el-dropdown>
|
</el-dropdown>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
|
||||||
<pagination
|
<pagination
|
||||||
v-show="total>0"
|
v-show="total>0"
|
||||||
:total="total"
|
:total="total"
|
||||||
:page.sync="queryParams.pageNum"
|
:page.sync="queryParams.pageNum"
|
||||||
:limit.sync="queryParams.pageSize"
|
:limit.sync="queryParams.pageSize"
|
||||||
@pagination="getList"
|
@pagination="getList"
|
||||||
/>
|
/>
|
||||||
<el-drawer
|
<el-drawer
|
||||||
:title="getDrawerTitle()"
|
:title="getDrawerTitle()"
|
||||||
:visible.sync="drawer"
|
:visible.sync="drawer"
|
||||||
:direction="direction"
|
:direction="direction"
|
||||||
:before-close="handleClose"
|
:before-close="handleClose"
|
||||||
:size="1500"
|
:size="1500"
|
||||||
>
|
>
|
||||||
<el-divider content-position="center">
|
<el-divider content-position="center">
|
||||||
<span style="color: #67C23A; font-weight: 600; font-size: 14px;">
|
<span style="color: #67C23A; font-weight: 600; font-size: 14px;">
|
||||||
@ -225,13 +237,13 @@
|
|||||||
<!-- 第一部分:销齿链型号表格管理 -->
|
<!-- 第一部分:销齿链型号表格管理 -->
|
||||||
<el-button type="primary" @click="openAddChainDialog" size="mini" style="margin-bottom:10px;">新增</el-button>
|
<el-button type="primary" @click="openAddChainDialog" size="mini" style="margin-bottom:10px;">新增</el-button>
|
||||||
<el-table
|
<el-table
|
||||||
:data="chainTable"
|
:data="chainTable"
|
||||||
border
|
border
|
||||||
stripe
|
stripe
|
||||||
size="small"
|
size="small"
|
||||||
style="width: 100%; margin-bottom: 10px;"
|
style="width: 100%; margin-bottom: 10px;"
|
||||||
highlight-current-row
|
highlight-current-row
|
||||||
:header-cell-style="{ fontWeight: 'bold', background: '#f5f7fa' }"
|
:header-cell-style="{ fontWeight: 'bold', background: '#f5f7fa' }"
|
||||||
>
|
>
|
||||||
|
|
||||||
<el-table-column prop="figureNumber" label="产品型号" min-width="100"/>
|
<el-table-column prop="figureNumber" label="产品型号" min-width="100"/>
|
||||||
@ -244,25 +256,25 @@
|
|||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<div style="display: flex; align-items: center; gap: 8px;">
|
<div style="display: flex; align-items: center; gap: 8px;">
|
||||||
<el-upload
|
<el-upload
|
||||||
:action="dwgUploadUrl"
|
:action="dwgUploadUrl"
|
||||||
:headers="uploadHeaders"
|
:headers="uploadHeaders"
|
||||||
:data="{ id: scope.row.id }"
|
:data="{ id: scope.row.id }"
|
||||||
:show-file-list="false"
|
:show-file-list="false"
|
||||||
:before-upload="(file) => beforeDwgUpload(file, scope.row)"
|
:before-upload="(file) => beforeDwgUpload(file, scope.row)"
|
||||||
:on-success="(response, file) => handleDwgUploadSuccess(response, file, scope.row)"
|
:on-success="(response, file) => handleDwgUploadSuccess(response, file, scope.row)"
|
||||||
:on-error="(error, file) => handleDwgUploadError(error, file, scope.row)"
|
:on-error="(error, file) => handleDwgUploadError(error, file, scope.row)"
|
||||||
accept=".dwg"
|
accept=".dwg"
|
||||||
:disabled="form.isEnterpriseStandard === 1"
|
:disabled="form.isEnterpriseStandard === 1"
|
||||||
>
|
>
|
||||||
<el-button size="mini" type="primary" :disabled="form.isEnterpriseStandard === 1">
|
<el-button size="mini" type="primary" :disabled="form.isEnterpriseStandard === 1">
|
||||||
<i class="el-icon-upload2"></i> 上传
|
<i class="el-icon-upload2"></i> 上传
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
|
|
||||||
<el-button type="text" size="mini" @click="editChain(scope.$index, scope.row)">
|
<el-button type="text" size="mini" @click="editChain(scope.$index, scope.row)">
|
||||||
<i class="el-icon-edit"></i> 修改
|
<i class="el-icon-edit"></i> 修改
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
<el-button type="text" size="mini" @click="removeChain(scope.$index)">
|
<el-button type="text" size="mini" @click="removeChain(scope.$index)">
|
||||||
<i class="el-icon-delete"></i> 删除
|
<i class="el-icon-delete"></i> 删除
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -284,7 +296,8 @@
|
|||||||
<el-button type="primary" @click="downloadPDF" style="margin-bottom: 10px; margin-left: 10px;">
|
<el-button type="primary" @click="downloadPDF" style="margin-bottom: 10px; margin-left: 10px;">
|
||||||
下载PDF
|
下载PDF
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-button type="warning" @click="downloadRoute" style="margin-bottom: 10px; margin-left: 10px;" v-hasPermi="['system:route:exportRoute']">
|
<el-button type="warning" @click="downloadRoute" style="margin-bottom: 10px; margin-left: 10px;"
|
||||||
|
v-hasPermi="['system:route:exportRoute']">
|
||||||
下载生产工艺计划表
|
下载生产工艺计划表
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-progress :text-inside="true" :stroke-width="26" :percentage="percentage"></el-progress>
|
<el-progress :text-inside="true" :stroke-width="26" :percentage="percentage"></el-progress>
|
||||||
@ -319,40 +332,40 @@
|
|||||||
|
|
||||||
<!-- 运算结果按钮 -->
|
<!-- 运算结果按钮 -->
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
size="medium"
|
size="medium"
|
||||||
:loading="loadingMRP"
|
:loading="loadingMRP"
|
||||||
:disabled="loadingMRP"
|
:disabled="loadingMRP"
|
||||||
@click="getMRPResults()"
|
@click="getMRPResults()"
|
||||||
class="mrp-calculate-btn"
|
class="mrp-calculate-btn"
|
||||||
>
|
>
|
||||||
{{ loadingMRP ? '核算中...' : '开始核算' }}
|
{{ loadingMRP ? '核算中...' : '开始核算' }}
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
||||||
<!-- 搜索输入框 -->
|
<!-- 搜索输入框 -->
|
||||||
<el-input
|
<el-input
|
||||||
v-model="mrpSearchKeyword"
|
v-model="mrpSearchKeyword"
|
||||||
placeholder="搜索物料名称或编码"
|
placeholder="搜索物料名称或编码"
|
||||||
style="width: 220px;"
|
style="width: 220px;"
|
||||||
size="small"
|
size="small"
|
||||||
clearable
|
clearable
|
||||||
@input="handleMrpSearch"
|
@input="handleMrpSearch"
|
||||||
@clear="clearMrpSearch"
|
@clear="clearMrpSearch"
|
||||||
class="mrp-search-input"
|
class="mrp-search-input"
|
||||||
>
|
>
|
||||||
<i slot="prefix" class="el-input__icon el-icon-search"></i>
|
<i slot="prefix" class="el-input__icon el-icon-search"></i>
|
||||||
</el-input>
|
</el-input>
|
||||||
|
|
||||||
<!-- 导出按钮 -->
|
<!-- 导出按钮 -->
|
||||||
<el-button
|
<el-button
|
||||||
type="success"
|
type="success"
|
||||||
size="small"
|
size="small"
|
||||||
icon="el-icon-download"
|
icon="el-icon-download"
|
||||||
@click="handleExportMrp"
|
@click="handleExportMrp"
|
||||||
:loading="exportLoading"
|
:loading="exportLoading"
|
||||||
:disabled="!productionObj || !productionObj.id"
|
:disabled="!productionObj || !productionObj.id"
|
||||||
class="mrp-export-btn"
|
class="mrp-export-btn"
|
||||||
:title="productionObj && productionObj.id ? `导出${productionObj.productionOrderNo}的MRP数据` : '请先选择生产令号'"
|
:title="productionObj && productionObj.id ? `导出${productionObj.productionOrderNo}的MRP数据` : '请先选择生产令号'"
|
||||||
>
|
>
|
||||||
导出Excel
|
导出Excel
|
||||||
</el-button>
|
</el-button>
|
||||||
@ -364,7 +377,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- 统计信息 -->
|
<!-- 统计信息 -->
|
||||||
<div
|
<div
|
||||||
style="margin-bottom: 15px; padding: 15px; background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); border-radius: 8px; border-left: 4px solid #409EFF;">
|
style="margin-bottom: 15px; padding: 15px; background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%); border-radius: 8px; border-left: 4px solid #409EFF;">
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col :span="6">
|
<el-col :span="6">
|
||||||
<div style="text-align: center;">
|
<div style="text-align: center;">
|
||||||
@ -393,24 +406,24 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
<el-table
|
<el-table
|
||||||
:data="mrpResultData"
|
:data="mrpResultData"
|
||||||
style="width: 100%"
|
style="width: 100%"
|
||||||
:header-cell-style="{ background: '#f5f7fa', color: '#606266' }"
|
:header-cell-style="{ background: '#f5f7fa', color: '#606266' }"
|
||||||
:row-class-name="getMrpRowClass"
|
:row-class-name="getMrpRowClass"
|
||||||
border
|
border
|
||||||
stripe
|
stripe
|
||||||
size="small"
|
size="small"
|
||||||
v-loading="mrpLoading"
|
v-loading="mrpLoading"
|
||||||
>
|
>
|
||||||
<el-table-column prop="materialCode" label="物料编码" min-width="120" show-overflow-tooltip/>
|
<el-table-column prop="materialCode" label="物料编码" min-width="120" show-overflow-tooltip/>
|
||||||
<el-table-column prop="materialName" label="物料名称" min-width="100" show-overflow-tooltip/>
|
<el-table-column prop="materialName" label="物料名称" min-width="100" show-overflow-tooltip/>
|
||||||
<el-table-column label="项目本批数" width="130" align="right">
|
<el-table-column label="项目本批数" width="130" align="right">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span style="color: #e6a23c">
|
<span style="color: #e6a23c">
|
||||||
{{ formatFraction(scope.row.purchaseNotInStock) }}
|
{{ formatFraction(scope.row.purchaseNotInStock) }}
|
||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column prop="availableStock" label="本项目可用库存" width="120" align="right">
|
<el-table-column prop="availableStock" label="本项目可用库存" width="120" align="right">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@ -436,7 +449,7 @@
|
|||||||
<span style="color: #409eff">{{ scope.row.purchaseRequestQty.toFixed(3) }}</span>
|
<span style="color: #409eff">{{ scope.row.purchaseRequestQty.toFixed(3) }}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
||||||
<el-table-column prop="childNotPickedQty" label="子项未领料数量" width="130" align="right">
|
<el-table-column prop="childNotPickedQty" label="子项未领料数量" width="130" align="right">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<span style="color: #f56c6c">{{ scope.row.childNotPickedQty.toFixed(3) }}</span>
|
<span style="color: #f56c6c">{{ scope.row.childNotPickedQty.toFixed(3) }}</span>
|
||||||
@ -456,26 +469,26 @@
|
|||||||
|
|
||||||
<!-- 分页 -->
|
<!-- 分页 -->
|
||||||
<el-pagination
|
<el-pagination
|
||||||
@size-change="handleMrpSizeChange"
|
@size-change="handleMrpSizeChange"
|
||||||
@current-change="handleMrpCurrentChange"
|
@current-change="handleMrpCurrentChange"
|
||||||
:current-page="mrpQueryParams.pageNum"
|
:current-page="mrpQueryParams.pageNum"
|
||||||
:page-sizes="[10, 20, 50, 100]"
|
:page-sizes="[10, 20, 50, 100]"
|
||||||
:page-size="mrpQueryParams.pageSize"
|
:page-size="mrpQueryParams.pageSize"
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
:total="mrpTotal"
|
:total="mrpTotal"
|
||||||
style="margin-top: 20px; text-align: right;"
|
style="margin-top: 20px; text-align: right;"
|
||||||
/>
|
/>
|
||||||
</el-card>
|
</el-card>
|
||||||
<!-- 新增/编辑弹窗 -->
|
<!-- 新增/编辑弹窗 -->
|
||||||
<el-dialog
|
<el-dialog
|
||||||
:title="isEditChain ? '编辑销齿链型号' : '新增销齿链型号'"
|
:title="isEditChain ? '编辑销齿链型号' : '新增销齿链型号'"
|
||||||
:visible.sync="chainDialogVisible"
|
:visible.sync="chainDialogVisible"
|
||||||
width="420px"
|
width="420px"
|
||||||
append-to-body
|
append-to-body
|
||||||
>
|
>
|
||||||
<el-form :model="chainForm" label-width="100px">
|
<el-form :model="chainForm" label-width="100px">
|
||||||
<div
|
<div
|
||||||
style="margin-bottom: 16px; padding: 12px; background-color: #f0f9ff; border: 1px solid #b3d8ff; border-radius: 4px; color: #409eff; font-size: 13px;">
|
style="margin-bottom: 16px; padding: 12px; background-color: #f0f9ff; border: 1px solid #b3d8ff; border-radius: 4px; color: #409eff; font-size: 13px;">
|
||||||
<i class="el-icon-info" style="margin-right: 6px;"></i>
|
<i class="el-icon-info" style="margin-right: 6px;"></i>
|
||||||
<strong>操作说明:</strong>可以先搜索选择已有型号自动填充,或直接手动填写所有必填字段(带*号)
|
<strong>操作说明:</strong>可以先搜索选择已有型号自动填充,或直接手动填写所有必填字段(带*号)
|
||||||
</div>
|
</div>
|
||||||
@ -484,23 +497,23 @@
|
|||||||
可选择已有型号或手动填写所有信息
|
可选择已有型号或手动填写所有信息
|
||||||
</div>
|
</div>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="chainForm.id"
|
v-model="chainForm.id"
|
||||||
filterable
|
filterable
|
||||||
remote
|
remote
|
||||||
reserve-keyword
|
reserve-keyword
|
||||||
placeholder="请输入行程/类型/名称/产品名(可选)"
|
placeholder="请输入行程/类型/名称/产品名(可选)"
|
||||||
:remote-method="searchRigidChain"
|
:remote-method="searchRigidChain"
|
||||||
:loading="chainLoading"
|
:loading="chainLoading"
|
||||||
@change="onRigidChainSelect"
|
@change="onRigidChainSelect"
|
||||||
popper-class="chain-autocomplete-dropdown"
|
popper-class="chain-autocomplete-dropdown"
|
||||||
:default-first-option="false"
|
:default-first-option="false"
|
||||||
clearable
|
clearable
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in rigidChainOptions"
|
v-for="item in rigidChainOptions"
|
||||||
:key="item.id"
|
:key="item.id"
|
||||||
:label="item.productName"
|
:label="item.productName"
|
||||||
:value="item.id"
|
:value="item.id"
|
||||||
>
|
>
|
||||||
<div class="chain-suggestion-item">
|
<div class="chain-suggestion-item">
|
||||||
<div class="chain-name">{{ item.figureNumber }}</div>
|
<div class="chain-name">{{ item.figureNumber }}</div>
|
||||||
@ -533,17 +546,17 @@
|
|||||||
<el-form-item label="文件路径">
|
<el-form-item label="文件路径">
|
||||||
<div>
|
<div>
|
||||||
<el-select
|
<el-select
|
||||||
v-model="chainForm.selectedFileType"
|
v-model="chainForm.selectedFileType"
|
||||||
placeholder="请选择文件类型"
|
placeholder="请选择文件类型"
|
||||||
@change="onConfigIniSelect"
|
@change="onConfigIniSelect"
|
||||||
filterable
|
filterable
|
||||||
clearable
|
clearable
|
||||||
>
|
>
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in configIniOptions"
|
v-for="item in configIniOptions"
|
||||||
:key="item.fileType"
|
:key="item.fileType"
|
||||||
:label="item.fileType"
|
:label="item.fileType"
|
||||||
:value="item.fileType"
|
:value="item.fileType"
|
||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
@ -565,14 +578,14 @@
|
|||||||
|
|
||||||
|
|
||||||
<el-drawer
|
<el-drawer
|
||||||
title="BOM明细 " :visible.sync="bomDrawer" direction="rtl" :size="1500">
|
title="BOM明细 " :visible.sync="bomDrawer" direction="rtl" :size="1500">
|
||||||
<div style="padding: 20px;">
|
<div style="padding: 20px;">
|
||||||
<bomInfo v-if="bomDrawer" :params="bomParams"/>
|
<bomInfo v-if="bomDrawer" :params="bomParams"/>
|
||||||
</div>
|
</div>
|
||||||
</el-drawer>
|
</el-drawer>
|
||||||
|
|
||||||
<el-drawer
|
<el-drawer
|
||||||
title="工艺路线 " :visible.sync="processDrawer" direction="rtl" :size="1500">
|
title="工艺路线 " :visible.sync="processDrawer" direction="rtl" :size="1500">
|
||||||
<div style="padding: 20px;">
|
<div style="padding: 20px;">
|
||||||
<processInfo v-if="processDrawer" :params="processParams"/>
|
<processInfo v-if="processDrawer" :params="processParams"/>
|
||||||
</div>
|
</div>
|
||||||
@ -604,15 +617,16 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="是否企标" prop="isEnterpriseStandard">
|
<el-form-item label="是否企标" prop="isEnterpriseStandard">
|
||||||
<el-select v-model="form.isEnterpriseStandard" placeholder="请选择是否企标" clearable>
|
<el-select v-model="form.isEnterpriseStandard" placeholder="请选择是否企标" clearable>
|
||||||
<el-option label="否" :value="0"/>
|
<el-option label="非标单" :value="0"/>
|
||||||
<el-option label="是" :value="1"/>
|
<el-option label="变更单" :value="2"/>
|
||||||
|
<el-option label="企标单" :value="1"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<!-- <!– 文件路径输入框,非企标时只读 –>
|
<!-- <!– 文件路径输入框,非企标时只读 –>
|
||||||
<el-form-item label="文件路径" prop="drawingPath">
|
<el-form-item label="文件路径" prop="drawingPath">
|
||||||
<el-input v-model="form.drawingPath" :readonly="form.isEnterpriseStandard !== 1"
|
<el-input v-model="form.drawingPath" :readonly="form.isEnterpriseStandard !== 1"
|
||||||
placeholder="企标可填写,非企标请在子表单上传DWG文件"/>
|
placeholder="企标可填写,非企标请在子表单上传DWG文件"/>
|
||||||
</el-form-item>-->
|
</el-form-item>-->
|
||||||
</el-form>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||||
@ -665,6 +679,7 @@ import dayjs from "dayjs";
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "OrderPro",
|
name: "OrderPro",
|
||||||
|
dicts: ['process_status'],
|
||||||
components: {
|
components: {
|
||||||
ImageUpload,
|
ImageUpload,
|
||||||
bomInfo,
|
bomInfo,
|
||||||
@ -789,18 +804,18 @@ export default {
|
|||||||
isEnterpriseStandard: [
|
isEnterpriseStandard: [
|
||||||
{required: true, message: "是否企标 (0-否, 1-是)不能为空", trigger: "blur"}
|
{required: true, message: "是否企标 (0-否, 1-是)不能为空", trigger: "blur"}
|
||||||
],
|
],
|
||||||
/* drawingPath: [
|
/* drawingPath: [
|
||||||
{
|
{
|
||||||
validator: (rule, value, callback) => {
|
validator: (rule, value, callback) => {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
callback(new Error('图纸路径不能为空'));
|
callback(new Error('图纸路径不能为空'));
|
||||||
}
|
}
|
||||||
// 你可以加更多条件
|
// 你可以加更多条件
|
||||||
callback();
|
callback();
|
||||||
},
|
},
|
||||||
trigger: "blur"
|
trigger: "blur"
|
||||||
}
|
}
|
||||||
]*/
|
]*/
|
||||||
},
|
},
|
||||||
productionObj: null,
|
productionObj: null,
|
||||||
id: '',
|
id: '',
|
||||||
@ -858,18 +873,18 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
formatFraction(value) {
|
formatFraction(value) {
|
||||||
// 如果本身就是分数字符串,直接返回
|
// 如果本身就是分数字符串,直接返回
|
||||||
if (typeof value === 'string' && value.includes('/')) {
|
if (typeof value === 'string' && value.includes('/')) {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
// 如果是数字或数字字符串,直接原样返回(或保留三位小数)
|
// 如果是数字或数字字符串,直接原样返回(或保留三位小数)
|
||||||
if (!isNaN(value)) {
|
if (!isNaN(value)) {
|
||||||
return parseFloat(value).toFixed(3);
|
return parseFloat(value).toFixed(3);
|
||||||
}
|
}
|
||||||
return value; // 兜底
|
return value; // 兜底
|
||||||
},
|
},
|
||||||
|
|
||||||
// 处理分数值,用于数据处理阶段
|
// 处理分数值,用于数据处理阶段
|
||||||
formatFractionValue(value) {
|
formatFractionValue(value) {
|
||||||
// 如果本身就是分数字符串,直接返回
|
// 如果本身就是分数字符串,直接返回
|
||||||
@ -1036,36 +1051,36 @@ export default {
|
|||||||
|
|
||||||
// 获取MRP数据
|
// 获取MRP数据
|
||||||
async getMrpData() {
|
async getMrpData() {
|
||||||
this.mrpLoading = true;
|
this.mrpLoading = true;
|
||||||
try {
|
try {
|
||||||
this.mrpQueryParams.orderProId = this.productionObj.id;
|
this.mrpQueryParams.orderProId = this.productionObj.id;
|
||||||
const response = await listMrp(this.mrpQueryParams);
|
const response = await listMrp(this.mrpQueryParams);
|
||||||
|
|
||||||
if (response && response.rows) {
|
if (response && response.rows) {
|
||||||
// 统一转Number,避免 toFixed 报错
|
// 统一转Number,避免 toFixed 报错
|
||||||
const processedRows = response.rows.map(item => ({
|
const processedRows = response.rows.map(item => ({
|
||||||
...item,
|
...item,
|
||||||
availableStock: Number(item.availableStock) || 0,
|
availableStock: Number(item.availableStock) || 0,
|
||||||
realTimeStock: Number(item.realTimeStock) || 0,
|
realTimeStock: Number(item.realTimeStock) || 0,
|
||||||
prodNotInStock: Number(item.prodNotInStock) || 0,
|
prodNotInStock: Number(item.prodNotInStock) || 0,
|
||||||
purchaseRequestQty: Number(item.purchaseRequestQty) || 0,
|
purchaseRequestQty: Number(item.purchaseRequestQty) || 0,
|
||||||
purchaseNotInStock: this.formatFractionValue(item.purchaseNotInStock),
|
purchaseNotInStock: this.formatFractionValue(item.purchaseNotInStock),
|
||||||
childNotPickedQty: Number(item.childNotPickedQty) || 0,
|
childNotPickedQty: Number(item.childNotPickedQty) || 0,
|
||||||
createTime: item.createTime ? dayjs(item.createTime).format('YYYY-MM-DD HH:mm:ss') : '',
|
createTime: item.createTime ? dayjs(item.createTime).format('YYYY-MM-DD HH:mm:ss') : '',
|
||||||
updateTime: item.updateTime ? dayjs(item.updateTime).format('YYYY-MM-DD HH:mm:ss') : ''
|
updateTime: item.updateTime ? dayjs(item.updateTime).format('YYYY-MM-DD HH:mm:ss') : ''
|
||||||
}));
|
}));
|
||||||
this.mrpResultData = processedRows;
|
this.mrpResultData = processedRows;
|
||||||
this.mrpTotal = response.total || processedRows.length;
|
this.mrpTotal = response.total || processedRows.length;
|
||||||
// 统计计算也用处理过的数字数据
|
// 统计计算也用处理过的数字数据
|
||||||
this.calculateMrpStats(processedRows);
|
this.calculateMrpStats(processedRows);
|
||||||
}
|
|
||||||
} catch (error) {
|
|
||||||
console.error('获取MRP数据失败:', error);
|
|
||||||
this.$message.error('获取MRP数据失败');
|
|
||||||
} finally {
|
|
||||||
this.mrpLoading = false;
|
|
||||||
}
|
}
|
||||||
},
|
} catch (error) {
|
||||||
|
console.error('获取MRP数据失败:', error);
|
||||||
|
this.$message.error('获取MRP数据失败');
|
||||||
|
} finally {
|
||||||
|
this.mrpLoading = false;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
// MRP分页大小改变
|
// MRP分页大小改变
|
||||||
@ -1122,8 +1137,8 @@ export default {
|
|||||||
|
|
||||||
const keyword = this.mrpSearchKeyword.toLowerCase();
|
const keyword = this.mrpSearchKeyword.toLowerCase();
|
||||||
return data.filter(item =>
|
return data.filter(item =>
|
||||||
item.materialName.toLowerCase().includes(keyword) ||
|
item.materialName.toLowerCase().includes(keyword) ||
|
||||||
item.materialCode.toLowerCase().includes(keyword)
|
item.materialCode.toLowerCase().includes(keyword)
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1142,15 +1157,15 @@ export default {
|
|||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|
||||||
// 获取抽屉标题
|
// 获取抽屉标题
|
||||||
getDrawerTitle() {
|
getDrawerTitle() {
|
||||||
if (!this.productionObj) {
|
if (!this.productionObj) {
|
||||||
return '项目详情';
|
return '项目详情';
|
||||||
}
|
}
|
||||||
|
|
||||||
const orderNo = this.productionObj.productionOrderNo || '';
|
const orderNo = this.productionObj.productionOrderNo || '';
|
||||||
const projectName = this.productionObj.productionName || '';
|
const projectName = this.productionObj.productionName || '';
|
||||||
|
|
||||||
if (orderNo && projectName) {
|
if (orderNo && projectName) {
|
||||||
return `项目详情 - ${orderNo} | ${projectName}`;
|
return `项目详情 - ${orderNo} | ${projectName}`;
|
||||||
} else if (orderNo) {
|
} else if (orderNo) {
|
||||||
@ -1161,11 +1176,11 @@ export default {
|
|||||||
return '项目详情';
|
return '项目详情';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
// 刷新MRP数据
|
// 刷新MRP数据
|
||||||
handleRefreshMrpData() {
|
handleRefreshMrpData() {
|
||||||
this.mrpQueryParams.pageNum = 1;
|
this.mrpQueryParams.pageNum = 1;
|
||||||
this.getMrpData();
|
this.getMrpData();
|
||||||
},
|
},
|
||||||
|
|
||||||
// 导出MRP数据
|
// 导出MRP数据
|
||||||
@ -1538,20 +1553,20 @@ export default {
|
|||||||
this.$message.error('仅支持dwg格式文件上传');
|
this.$message.error('仅支持dwg格式文件上传');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 验证行数据
|
// 验证行数据
|
||||||
if (!row || !row.id) {
|
if (!row || !row.id) {
|
||||||
this.$message.error('行数据无效,无法上传');
|
this.$message.error('行数据无效,无法上传');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 验证文件大小(可选,限制为50MB)
|
// 验证文件大小(可选,限制为50MB)
|
||||||
const maxSize = 50 * 1024 * 1024; // 50MB
|
const maxSize = 50 * 1024 * 1024; // 50MB
|
||||||
if (file.size > maxSize) {
|
if (file.size > maxSize) {
|
||||||
this.$message.error('文件大小不能超过50MB');
|
this.$message.error('文件大小不能超过50MB');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
handleDwgUploadSuccess(response, file, row) {
|
handleDwgUploadSuccess(response, file, row) {
|
||||||
@ -1559,7 +1574,7 @@ export default {
|
|||||||
// 刷新列表
|
// 刷新列表
|
||||||
this.loadChainTableData();
|
this.loadChainTableData();
|
||||||
this.$message.success(`图纸上传成功:${file.name}`);
|
this.$message.success(`图纸上传成功:${file.name}`);
|
||||||
|
|
||||||
// 可以在这里更新行的drawPath字段
|
// 可以在这里更新行的drawPath字段
|
||||||
if (response.data && response.data.filePath) {
|
if (response.data && response.data.filePath) {
|
||||||
row.drawPath = response.data.filePath;
|
row.drawPath = response.data.filePath;
|
||||||
@ -1583,40 +1598,40 @@ export default {
|
|||||||
|
|
||||||
// 调用API获取文件流
|
// 调用API获取文件流
|
||||||
uploadPDF(this.productionObj.id)
|
uploadPDF(this.productionObj.id)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
console.log('API响应:', response);
|
console.log('API响应:', response);
|
||||||
console.log('响应类型:', typeof response);
|
console.log('响应类型:', typeof response);
|
||||||
console.log('是否为Blob:', response instanceof Blob);
|
console.log('是否为Blob:', response instanceof Blob);
|
||||||
|
|
||||||
// 检查响应是否为blob类型
|
// 检查响应是否为blob类型
|
||||||
if (!(response instanceof Blob)) {
|
if (!(response instanceof Blob)) {
|
||||||
console.error('响应不是文件流:', response);
|
console.error('响应不是文件流:', response);
|
||||||
this.$message.error('服务器返回的不是文件流');
|
this.$message.error('服务器返回的不是文件流');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 检查文件大小
|
// 检查文件大小
|
||||||
console.log('文件大小:', response.size);
|
console.log('文件大小:', response.size);
|
||||||
if (response.size === 0) {
|
if (response.size === 0) {
|
||||||
this.$message.error('文件为空或下载失败');
|
this.$message.error('文件为空或下载失败');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建blob对象并下载
|
// 创建blob对象并下载
|
||||||
let blob = new Blob([response], {type: 'application/zip'});
|
let blob = new Blob([response], {type: 'application/zip'});
|
||||||
let url = window.URL.createObjectURL(blob);
|
let url = window.URL.createObjectURL(blob);
|
||||||
const link = document.createElement('a');
|
const link = document.createElement('a');
|
||||||
link.href = url;
|
link.href = url;
|
||||||
link.download = `${this.productionObj.productionOrderNo}_PDF.zip`;
|
link.download = `${this.productionObj.productionOrderNo}_PDF.zip`;
|
||||||
link.click();
|
link.click();
|
||||||
window.URL.revokeObjectURL(url);
|
window.URL.revokeObjectURL(url);
|
||||||
|
|
||||||
this.$message.success('PDF文件下载成功');
|
this.$message.success('PDF文件下载成功');
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
|
|
||||||
this.$message.error('PDF文件下载失败: ' + (error.message || error));
|
this.$message.error('PDF文件下载失败: ' + (error.message || error));
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
downloadRoute() {
|
downloadRoute() {
|
||||||
if (!this.productionObj || !this.productionObj.id) {
|
if (!this.productionObj || !this.productionObj.id) {
|
||||||
@ -1629,29 +1644,29 @@ export default {
|
|||||||
|
|
||||||
// 调用API获取文件流
|
// 调用API获取文件流
|
||||||
exportRoute(this.productionObj.id)
|
exportRoute(this.productionObj.id)
|
||||||
.then(response => {
|
.then(response => {
|
||||||
// 检查文件大小
|
// 检查文件大小
|
||||||
if (response.size === 0) {
|
if (response.size === 0) {
|
||||||
this.$message.error('文件为空或下载失败');
|
this.$message.error('文件为空或下载失败');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建blob对象并下载
|
// 创建blob对象并下载
|
||||||
let blob = new Blob([response], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});
|
let blob = new Blob([response], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'});
|
||||||
let url = window.URL.createObjectURL(blob);
|
let url = window.URL.createObjectURL(blob);
|
||||||
const link = document.createElement('a');
|
const link = document.createElement('a');
|
||||||
link.href = url;
|
link.href = url;
|
||||||
link.download = `${this.productionObj.productionOrderNo}_生产工艺计划表.xlsx`;
|
link.download = `${this.productionObj.productionOrderNo}_生产工艺计划表.xlsx`;
|
||||||
link.click();
|
link.click();
|
||||||
window.URL.revokeObjectURL(url);
|
window.URL.revokeObjectURL(url);
|
||||||
|
|
||||||
this.$message.success('生产工艺计划表下载成功');
|
this.$message.success('生产工艺计划表下载成功');
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch(error => {
|
||||||
console.error('下载失败:', error);
|
console.error('下载失败:', error);
|
||||||
// 后端异常会直接抛出,显示错误信息
|
// 后端异常会直接抛出,显示错误信息
|
||||||
this.$message.error('下载失败: ' + (error.message || '项目未出图'));
|
this.$message.error('下载失败: ' + (error.message || '项目未出图'));
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
beforeMount() {
|
beforeMount() {
|
||||||
|
|||||||
386
src/views/system/proPlan/index.vue
Normal file
386
src/views/system/proPlan/index.vue
Normal file
@ -0,0 +1,386 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
|
<el-form-item label="方案编码" prop="projectCode">
|
||||||
|
<el-input
|
||||||
|
v-model="queryParams.projectCode"
|
||||||
|
placeholder="请输入方案编码"
|
||||||
|
clearable
|
||||||
|
@keyup.enter.native="handleQuery"
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设计人" prop="designer">
|
||||||
|
<el-select v-model="queryParams.designer" placeholder="请选择设计人" clearable>
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.plan_proer"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="预计开始时间" prop="startDate">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="queryParams.startDate"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择预计开始时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="预计完成时间" prop="endDate">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="queryParams.endDate"
|
||||||
|
type="date"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
placeholder="请选择预计完成时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="方案状态" prop="processStatus">
|
||||||
|
<el-select v-model="queryParams.processStatus" placeholder="请选择方案状态" clearable>
|
||||||
|
<el-option label="未开始" value="0" />
|
||||||
|
<el-option label="已完成" value="1" />
|
||||||
|
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item>
|
||||||
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||||
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
|
||||||
|
<el-row :gutter="10" class="mb8">
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="primary"
|
||||||
|
plain
|
||||||
|
icon="el-icon-plus"
|
||||||
|
size="mini"
|
||||||
|
@click="handleAdd"
|
||||||
|
v-hasPermi="['system:proPlan:add']"
|
||||||
|
>新增</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="success"
|
||||||
|
plain
|
||||||
|
icon="el-icon-edit"
|
||||||
|
size="mini"
|
||||||
|
:disabled="single"
|
||||||
|
@click="handleUpdate"
|
||||||
|
v-hasPermi="['system:proPlan:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="danger"
|
||||||
|
plain
|
||||||
|
icon="el-icon-delete"
|
||||||
|
size="mini"
|
||||||
|
:disabled="multiple"
|
||||||
|
@click="handleDelete"
|
||||||
|
v-hasPermi="['system:proPlan:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</el-col>
|
||||||
|
<el-col :span="1.5">
|
||||||
|
<el-button
|
||||||
|
type="warning"
|
||||||
|
plain
|
||||||
|
icon="el-icon-download"
|
||||||
|
size="mini"
|
||||||
|
@click="handleExport"
|
||||||
|
v-hasPermi="['system:proPlan:export']"
|
||||||
|
>导出</el-button>
|
||||||
|
</el-col>
|
||||||
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
<el-table v-loading="loading" :data="proPlanList" @selection-change="handleSelectionChange">
|
||||||
|
<el-table-column type="selection" width="55" align="center" />
|
||||||
|
|
||||||
|
<el-table-column label="方案编码" align="center" prop="projectCode" />
|
||||||
|
<el-table-column label="设计人" align="center" prop="designer">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.plan_proer" :value="scope.row.designer"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="方案备注" align="center" prop="remark" />
|
||||||
|
|
||||||
|
<el-table-column label="预计开始时间" align="center" prop="startDate" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.startDate, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="预计完成时间" align="center" prop="endDate" width="180">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column label="方案状态" align="center" prop="processStatus">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<dict-tag :options="dict.type.pro_status" :value="scope.row.processStatus"/>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
|
||||||
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-edit"
|
||||||
|
@click="handleUpdate(scope.row)"
|
||||||
|
v-hasPermi="['system:proPlan:edit']"
|
||||||
|
>修改</el-button>
|
||||||
|
<el-button
|
||||||
|
size="mini"
|
||||||
|
type="text"
|
||||||
|
icon="el-icon-delete"
|
||||||
|
@click="handleDelete(scope.row)"
|
||||||
|
v-hasPermi="['system:proPlan:remove']"
|
||||||
|
>删除</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
v-show="total>0"
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.pageNum"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 添加或修改方案管理对话框 -->
|
||||||
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||||
|
<el-form-item label="方案编码" prop="projectCode">
|
||||||
|
<el-input v-model="form.projectCode" placeholder="请输入方案编码" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设计人" prop="designer">
|
||||||
|
<el-select v-model="form.designer" placeholder="请选择设计人">
|
||||||
|
<el-option
|
||||||
|
v-for="dict in dict.type.plan_proer"
|
||||||
|
:key="dict.value"
|
||||||
|
:label="dict.label"
|
||||||
|
:value="dict.value"
|
||||||
|
></el-option>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="方案备注" prop="remark">
|
||||||
|
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="预计开始时间" prop="startDate">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="form.startDate"
|
||||||
|
type="datetime"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
placeholder="请选择预计开始时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="预计完成时间" prop="endDate">
|
||||||
|
<el-date-picker clearable
|
||||||
|
v-model="form.endDate"
|
||||||
|
type="datetime"
|
||||||
|
value-format="yyyy-MM-dd HH:mm:ss"
|
||||||
|
placeholder="请选择预计完成时间">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="方案/设计状态" prop="processStatus">
|
||||||
|
<el-select v-model="form.processStatus" placeholder="请选择方案状态">
|
||||||
|
<el-option label="未开始" value="0" />
|
||||||
|
<el-option label="已完成" value="1" />
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||||
|
<el-button @click="cancel">取 消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { listProPlan, getProPlan, delProPlan, addProPlan, updateProPlan } from "@/api/system/proPlan";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: "ProPlan",
|
||||||
|
dicts: ['plan_proer','pro_status'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
// 按钮loading
|
||||||
|
buttonLoading: false,
|
||||||
|
// 遮罩层
|
||||||
|
loading: true,
|
||||||
|
// 选中数组
|
||||||
|
ids: [],
|
||||||
|
// 非单个禁用
|
||||||
|
single: true,
|
||||||
|
// 非多个禁用
|
||||||
|
multiple: true,
|
||||||
|
// 显示搜索条件
|
||||||
|
showSearch: true,
|
||||||
|
// 总条数
|
||||||
|
total: 0,
|
||||||
|
// 方案管理表格数据
|
||||||
|
proPlanList: [],
|
||||||
|
// 弹出层标题
|
||||||
|
title: "",
|
||||||
|
// 是否显示弹出层
|
||||||
|
open: false,
|
||||||
|
// 查询参数
|
||||||
|
queryParams: {
|
||||||
|
pageNum: 1,
|
||||||
|
pageSize: 10,
|
||||||
|
projectCode: undefined,
|
||||||
|
designer: undefined,
|
||||||
|
overdueDays: undefined,
|
||||||
|
startDate: undefined,
|
||||||
|
endDate: undefined,
|
||||||
|
processStatus: undefined
|
||||||
|
},
|
||||||
|
// 表单参数
|
||||||
|
form: {},
|
||||||
|
// 表单校验
|
||||||
|
rules: {
|
||||||
|
|
||||||
|
projectCode: [
|
||||||
|
{ required: true, message: "方案编码不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
designer: [
|
||||||
|
{ required: true, message: "设计人不能为空", trigger: "change" }
|
||||||
|
],
|
||||||
|
|
||||||
|
remark: [
|
||||||
|
{ required: true, message: "方案备注不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
startDate: [
|
||||||
|
{ required: true, message: "预计开始时间不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
endDate: [
|
||||||
|
{ required: true, message: "预计完成时间不能为空", trigger: "blur" }
|
||||||
|
],
|
||||||
|
processStatus: [
|
||||||
|
{ required: true, message: "方案状态不能为空", trigger: "change" }
|
||||||
|
]
|
||||||
|
}
|
||||||
|
};
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
/** 查询方案管理列表 */
|
||||||
|
getList() {
|
||||||
|
this.loading = true;
|
||||||
|
listProPlan(this.queryParams).then(response => {
|
||||||
|
this.proPlanList = response.rows;
|
||||||
|
this.total = response.total;
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
// 取消按钮
|
||||||
|
cancel() {
|
||||||
|
this.open = false;
|
||||||
|
this.reset();
|
||||||
|
},
|
||||||
|
// 表单重置
|
||||||
|
reset() {
|
||||||
|
this.form = {
|
||||||
|
id: undefined,
|
||||||
|
projectCode: undefined,
|
||||||
|
designer: undefined,
|
||||||
|
overdueDays: undefined,
|
||||||
|
remark: undefined,
|
||||||
|
startDate: undefined,
|
||||||
|
endDate: undefined,
|
||||||
|
createTime: undefined,
|
||||||
|
updateTime: undefined,
|
||||||
|
createBy: undefined,
|
||||||
|
updateBy: undefined,
|
||||||
|
processStatus: undefined
|
||||||
|
};
|
||||||
|
this.resetForm("form");
|
||||||
|
},
|
||||||
|
/** 搜索按钮操作 */
|
||||||
|
handleQuery() {
|
||||||
|
this.queryParams.pageNum = 1;
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
/** 重置按钮操作 */
|
||||||
|
resetQuery() {
|
||||||
|
this.resetForm("queryForm");
|
||||||
|
this.handleQuery();
|
||||||
|
},
|
||||||
|
// 多选框选中数据
|
||||||
|
handleSelectionChange(selection) {
|
||||||
|
this.ids = selection.map(item => item.id)
|
||||||
|
this.single = selection.length!==1
|
||||||
|
this.multiple = !selection.length
|
||||||
|
},
|
||||||
|
/** 新增按钮操作 */
|
||||||
|
handleAdd() {
|
||||||
|
this.reset();
|
||||||
|
this.open = true;
|
||||||
|
this.title = "添加方案";
|
||||||
|
},
|
||||||
|
/** 修改按钮操作 */
|
||||||
|
handleUpdate(row) {
|
||||||
|
this.loading = true;
|
||||||
|
this.reset();
|
||||||
|
const id = row.id || this.ids
|
||||||
|
getProPlan(id).then(response => {
|
||||||
|
this.loading = false;
|
||||||
|
this.form = response.data;
|
||||||
|
this.open = true;
|
||||||
|
this.title = "修改方案管理";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 提交按钮 */
|
||||||
|
submitForm() {
|
||||||
|
this.$refs["form"].validate(valid => {
|
||||||
|
if (valid) {
|
||||||
|
this.buttonLoading = true;
|
||||||
|
if (this.form.id != null) {
|
||||||
|
updateProPlan(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("修改成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
}).finally(() => {
|
||||||
|
this.buttonLoading = false;
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
addProPlan(this.form).then(response => {
|
||||||
|
this.$modal.msgSuccess("新增成功");
|
||||||
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
}).finally(() => {
|
||||||
|
this.buttonLoading = false;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 删除按钮操作 */
|
||||||
|
handleDelete(row) {
|
||||||
|
const ids = row.id || this.ids;
|
||||||
|
this.$modal.confirm('是否确认删除方案管理编号为"' + ids + '"的数据项?').then(() => {
|
||||||
|
this.loading = true;
|
||||||
|
return delProPlan(ids);
|
||||||
|
}).then(() => {
|
||||||
|
this.loading = false;
|
||||||
|
this.getList();
|
||||||
|
this.$modal.msgSuccess("删除成功");
|
||||||
|
}).catch(() => {
|
||||||
|
}).finally(() => {
|
||||||
|
this.loading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 导出按钮操作 */
|
||||||
|
handleExport() {
|
||||||
|
this.download('system/proPlan/export', {
|
||||||
|
...this.queryParams
|
||||||
|
}, `proPlan_${new Date().getTime()}.xlsx`)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user