feat(acid): 添加规程管理页面和菜单入口
1. 新增酸轧页面的规程菜单入口及对应组件 2. 完善wms规程页面的代码格式与交互细节 3. 修复部分空catch语句的格式问题
This commit is contained in:
@@ -6,31 +6,18 @@
|
||||
<!-- 第一行:规程类型 -->
|
||||
<div class="filter-row">
|
||||
<span class="filter-label filter-label-type">规程类型</span>
|
||||
<dict-select
|
||||
class="filter-select"
|
||||
renderType="radio"
|
||||
v-model="queryParams.specType"
|
||||
dict-type="wms_process_spec_type"
|
||||
:kisv="false"
|
||||
:editable="true"
|
||||
@change="loadSpecs"
|
||||
/>
|
||||
<dict-select class="filter-select" renderType="radio" v-model="queryParams.specType"
|
||||
dict-type="wms_process_spec_type" :kisv="true" :editable="true" @change="loadSpecs" />
|
||||
</div>
|
||||
<!-- 第二行:产线 -->
|
||||
<div class="filter-row">
|
||||
<span class="filter-label filter-label-line">产 线</span>
|
||||
<dict-select
|
||||
class="filter-select"
|
||||
renderType="radio"
|
||||
v-model="queryParams.lineId"
|
||||
dict-type="wms_process_spec_line"
|
||||
:kisv="false"
|
||||
:editable="true"
|
||||
@change="loadSpecs"
|
||||
/>
|
||||
<dict-select class="filter-select" renderType="radio" v-model="queryParams.lineId"
|
||||
dict-type="wms_process_spec_line" :kisv="false" :editable="true" @change="loadSpecs" />
|
||||
</div>
|
||||
</div>
|
||||
<el-button type="primary" size="mini" icon="el-icon-plus" class="new-spec-btn" @click="openSpecDialog()">新建规程</el-button>
|
||||
<el-button type="primary" size="mini" icon="el-icon-plus" class="new-spec-btn"
|
||||
@click="openSpecDialog()">新建规程</el-button>
|
||||
</div>
|
||||
|
||||
<!-- 主体:上规程列表 + 下版本面板 -->
|
||||
@@ -43,15 +30,8 @@
|
||||
<span class="total-badge">共 {{ total }} 条</span>
|
||||
</div>
|
||||
</div>
|
||||
<el-table
|
||||
:data="specList"
|
||||
size="small"
|
||||
highlight-current-row
|
||||
@row-click="onSpecRowClick"
|
||||
:row-class-name="tableRowClassName"
|
||||
style="width:100%"
|
||||
class="spec-table"
|
||||
>
|
||||
<el-table :data="specList" size="small" highlight-current-row @row-click="onSpecRowClick"
|
||||
:row-class-name="tableRowClassName" style="width:100%" class="spec-table">
|
||||
<el-table-column label="编码" prop="specCode" min-width="120" show-overflow-tooltip />
|
||||
<el-table-column label="名称" prop="specName" min-width="180" show-overflow-tooltip />
|
||||
<el-table-column label="创建时间" prop="createTime" width="110" show-overflow-tooltip>
|
||||
@@ -64,8 +44,8 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="loadSpecs" class="spec-pagination" />
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize" @pagination="loadSpecs" class="spec-pagination" />
|
||||
</div>
|
||||
|
||||
<!-- 下:版本面板 -->
|
||||
@@ -84,12 +64,7 @@
|
||||
</div>
|
||||
|
||||
<div class="version-grid" v-loading="versionLoading">
|
||||
<div
|
||||
v-for="v in versionList"
|
||||
:key="v.versionId"
|
||||
class="version-card"
|
||||
@click="goPlanSpec(v)"
|
||||
>
|
||||
<div v-for="v in versionList" :key="v.versionId" class="version-card" @click="goPlanSpec(v)">
|
||||
<div class="vc-header">
|
||||
<span class="vc-code">{{ v.versionCode }}</span>
|
||||
<div class="vc-tags">
|
||||
@@ -106,11 +81,7 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="vc-actions" @click.stop>
|
||||
<el-switch
|
||||
:value="v.isActive === 1"
|
||||
active-color="#5F7BA0"
|
||||
@change="handleActiveChange(v, $event)"
|
||||
/>
|
||||
<el-switch :value="v.isActive === 1" active-color="#5F7BA0" @change="handleActiveChange(v, $event)" />
|
||||
<el-button type="text" size="mini" @click="openVersionDialog(v)">编辑</el-button>
|
||||
<el-button type="text" size="mini" class="btn-danger" @click="removeVersion(v)">删除</el-button>
|
||||
<el-button type="text" size="mini" class="btn-view" @click="goPlanSpec(v)">方案 →</el-button>
|
||||
@@ -130,6 +101,14 @@
|
||||
<!-- 新建/编辑规程 -->
|
||||
<el-dialog :title="specTitle" :visible.sync="specOpen" width="460px" append-to-body @close="specForm = {}">
|
||||
<el-form ref="specFormRef" :model="specForm" :rules="specRules" label-width="88px" size="small">
|
||||
<el-form-item label="规程类型" prop="specType">
|
||||
<dict-select class="filter-select" renderType="radio" v-model="specForm.specType"
|
||||
dict-type="wms_process_spec_type" :kisv="true" :editable="true" @change="loadSpecs" />
|
||||
</el-form-item>
|
||||
<el-form-item label="产线" prop="lineId">
|
||||
<dict-select class="filter-select" renderType="radio" v-model="specForm.lineId"
|
||||
dict-type="wms_process_spec_line" :kisv="false" :editable="true" @change="loadSpecs" />
|
||||
</el-form-item>
|
||||
<el-form-item label="规程编码" prop="specCode">
|
||||
<el-input v-model="specForm.specCode" placeholder="请输入规程编码" maxlength="64" />
|
||||
</el-form-item>
|
||||
@@ -183,9 +162,9 @@ import {
|
||||
} from '@/api/wms/processSpecVersion'
|
||||
|
||||
const STATUS_OPTIONS = [
|
||||
{ value: 'DRAFT', label: '草稿' },
|
||||
{ value: 'DRAFT', label: '草稿' },
|
||||
{ value: 'PUBLISHED', label: '已发布' },
|
||||
{ value: 'OBSOLETE', label: '已作废' }
|
||||
{ value: 'OBSOLETE', label: '已作废' }
|
||||
]
|
||||
|
||||
export default {
|
||||
@@ -280,7 +259,7 @@ export default {
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess('已生效')
|
||||
this.loadVersions()
|
||||
}).catch(() => {})
|
||||
}).catch(() => { })
|
||||
},
|
||||
|
||||
openSpecDialog(row) {
|
||||
@@ -310,7 +289,7 @@ export default {
|
||||
this.currentSpec = null; this.currentSpecId = null; this.versionList = []
|
||||
}
|
||||
this.loadSpecs()
|
||||
}).catch(() => {})
|
||||
}).catch(() => { })
|
||||
},
|
||||
|
||||
openVersionDialog(row) {
|
||||
@@ -341,7 +320,7 @@ export default {
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess('删除成功')
|
||||
this.loadVersions()
|
||||
}).catch(() => {})
|
||||
}).catch(() => { })
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -369,18 +348,21 @@ export default {
|
||||
border-radius: 6px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.filter-rows {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.filter-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
min-height: 28px;
|
||||
}
|
||||
|
||||
.filter-label {
|
||||
font-size: 13px;
|
||||
color: #606266;
|
||||
@@ -391,23 +373,29 @@ export default {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.filter-label-type::after {
|
||||
content: '';
|
||||
}
|
||||
|
||||
.filter-label-line {
|
||||
padding: 0 2px;
|
||||
}
|
||||
|
||||
.filter-select {
|
||||
flex: 1;
|
||||
max-width: 600px;
|
||||
}
|
||||
|
||||
.filter-select ::v-deep .el-radio-group .el-radio-button {
|
||||
margin-right: 2px;
|
||||
}
|
||||
|
||||
.filter-select ::v-deep .el-radio-group .el-radio-button__inner {
|
||||
padding: 5px 10px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.new-spec-btn {
|
||||
flex-shrink: 0;
|
||||
margin-top: 4px;
|
||||
@@ -432,13 +420,16 @@ export default {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.spec-section {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.version-section {
|
||||
flex: 1;
|
||||
min-height: 200px;
|
||||
}
|
||||
|
||||
.empty-section {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -453,16 +444,19 @@ export default {
|
||||
border-bottom: 1px solid #f0f2f5;
|
||||
background: #fafafa;
|
||||
}
|
||||
|
||||
.section-title-wrap {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.section-title {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.total-badge {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
@@ -470,6 +464,7 @@ export default {
|
||||
padding: 2px 8px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
|
||||
.spec-code-tag {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
@@ -482,13 +477,15 @@ export default {
|
||||
.spec-table {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.spec-pagination {
|
||||
padding: 8px 16px;
|
||||
border-top: 1px solid #f0f2f5;
|
||||
}
|
||||
|
||||
/* ── 空状态 ── */
|
||||
.detail-empty, .empty-versions {
|
||||
.detail-empty,
|
||||
.empty-versions {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
@@ -506,6 +503,7 @@ export default {
|
||||
gap: 12px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.version-card {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -517,32 +515,42 @@ export default {
|
||||
background: #fff;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.version-card:hover {
|
||||
border-color: #5F7BA0;
|
||||
box-shadow: 0 4px 12px rgba(95,123,160,0.15);
|
||||
box-shadow: 0 4px 12px rgba(95, 123, 160, 0.15);
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
|
||||
.vc-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.vc-code {
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
color: #303133;
|
||||
}
|
||||
|
||||
.vc-tags {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
.vc-status, .vc-active { border-radius: 10px !important; }
|
||||
|
||||
.vc-status,
|
||||
.vc-active {
|
||||
border-radius: 10px !important;
|
||||
}
|
||||
|
||||
.vc-meta {
|
||||
font-size: 12px;
|
||||
color: #909399;
|
||||
line-height: 1.5;
|
||||
}
|
||||
|
||||
.vc-actions {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@@ -551,11 +559,20 @@ export default {
|
||||
border-top: 1px solid #f0f2f5;
|
||||
margin-top: 4px;
|
||||
}
|
||||
.btn-view { color: #5F7BA0 !important; font-weight: 500; }
|
||||
|
||||
.btn-view {
|
||||
color: #5F7BA0 !important;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
/* ── 表格行高亮 ── */
|
||||
::v-deep .el-table .current-row { background: #f0f7ff !important; }
|
||||
::v-deep .el-table .current-row td { background: #f0f7ff !important; }
|
||||
::v-deep .el-table .current-row {
|
||||
background: #f0f7ff !important;
|
||||
}
|
||||
|
||||
::v-deep .el-table .current-row td {
|
||||
background: #f0f7ff !important;
|
||||
}
|
||||
|
||||
/* ── 按钮主色覆盖 ── */
|
||||
::v-deep .el-button--primary {
|
||||
@@ -563,13 +580,27 @@ export default {
|
||||
background: #5F7BA0 !important;
|
||||
border-color: #5F7BA0 !important;
|
||||
}
|
||||
|
||||
::v-deep .el-button--primary:hover,
|
||||
::v-deep .el-button--primary:focus {
|
||||
background: #4d6a8e !important;
|
||||
border-color: #4d6a8e !important;
|
||||
}
|
||||
::v-deep .el-button--primary.is-disabled { opacity: .5; }
|
||||
::v-deep .el-button--text { background: transparent !important; border-color: transparent !important; }
|
||||
::v-deep .el-button--text.btn-danger { color: #f56c6c !important; }
|
||||
.btn-danger { color: #f56c6c; }
|
||||
|
||||
::v-deep .el-button--primary.is-disabled {
|
||||
opacity: .5;
|
||||
}
|
||||
|
||||
::v-deep .el-button--text {
|
||||
background: transparent !important;
|
||||
border-color: transparent !important;
|
||||
}
|
||||
|
||||
::v-deep .el-button--text.btn-danger {
|
||||
color: #f56c6c !important;
|
||||
}
|
||||
|
||||
.btn-danger {
|
||||
color: #f56c6c;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user