feat(wms/processSpec): 新增筛选条件和分页功能,优化页面布局

1. 新增规程类型和产线的单选筛选框,支持按条件查询规程列表
2. 为规程列表添加分页组件,支持分页查询
3. 重构页面元素布局,压缩冗余的标签换行和空格
4. 优化版本列表的加载状态提示,完善空数据处理逻辑
5. 统一调整按钮样式的代码格式,修复部分代码格式问题
This commit is contained in:
2026-05-12 09:08:55 +08:00
parent 9225ceba38
commit a36d874652

View File

@@ -3,25 +3,29 @@
<!-- 头部 --> <!-- 头部 -->
<div class="page-header"> <div class="page-header">
<span class="page-title">规程版本管理</span> <span class="page-title">规程版本管理</span>
<el-button <el-button type="primary" size="small" icon="el-icon-plus" style="margin-left:auto"
type="primary" @click="openSpecDialog()">新建规程</el-button>
size="small" </div>
icon="el-icon-plus"
style="margin-left:auto" <div>
@click="openSpecDialog()" <el-form>
>新建规程</el-button> <el-form-item label="规程类型">
<dict-select @change="loadSpecs" renderType="radio" v-model="queryParams.specType"
dict-type="wms_process_spec_type" :kisv="false" :editable="true"></dict-select>
</el-form-item>
<el-form-item label="产线">
<dict-select @change="loadSpecs" renderType="radio" v-model="queryParams.lineId"
dict-type="wms_process_spec_line" :kisv="false" :editable="true"></dict-select>
</el-form-item>
</el-form>
</div> </div>
<!-- 规程列表 --> <!-- 规程列表 -->
<div class="section-wrapper"> <div class="section-wrapper">
<div class="section-title">规程列表</div> <div class="section-title">规程列表</div>
<el-table
:data="specList" <el-table :data="specList" size="small" highlight-current-row @row-click="onSpecRowClick"
size="small" :row-class-name="tableRowClassName">
highlight-current-row
@row-click="onSpecRowClick"
:row-class-name="tableRowClassName"
>
<el-table-column label="规程编码" prop="specCode" width="150" /> <el-table-column label="规程编码" prop="specCode" width="150" />
<el-table-column label="规程名称" prop="specName" /> <el-table-column label="规程名称" prop="specName" />
<el-table-column label="创建时间" prop="createTime" width="180" /> <el-table-column label="创建时间" prop="createTime" width="180" />
@@ -32,36 +36,25 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="loadSpecs" />
</div> </div>
<!-- 版本列表 --> <!-- 版本列表 -->
<div class="section-wrapper" v-if="currentSpec"> <div class="section-wrapper" v-if="currentSpec" v-loading="versionLoading">
<div class="section-title"> <div class="section-title">
版本列表 - {{ currentSpec.specName }} 版本列表 - {{ currentSpec.specName }}
<el-button <el-button type="primary" size="mini" icon="el-icon-plus" @click="openVersionDialog()">新建版本</el-button>
type="primary"
size="mini"
icon="el-icon-plus"
@click="openVersionDialog()"
>新建版本</el-button>
</div> </div>
<el-table <el-table :data="versionList" size="small" highlight-current-row @row-click="onVersionRowClick">
:data="versionList"
size="small"
highlight-current-row
@row-click="onVersionRowClick"
>
<el-table-column label="版本号" prop="versionCode" /> <el-table-column label="版本号" prop="versionCode" />
<el-table-column label="状态" prop="status" /> <el-table-column label="状态" prop="status" />
<el-table-column label="创建时间" prop="createTime" /> <el-table-column label="创建时间" prop="createTime" />
<el-table-column label="生效" align="center"> <el-table-column label="生效" align="center">
<template slot-scope="{ row }"> <template slot-scope="{ row }">
<el-switch <el-switch :value="row.isActive === 1" active-color="#5F7BA0" @click.native.stop
:value="row.isActive === 1" @change="handleActiveChange(row, $event)" />
active-color="#5F7BA0"
@click.native.stop
@change="handleActiveChange(row, $event)"
/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="right"> <el-table-column label="操作" align="right">
@@ -142,6 +135,15 @@ export default {
versionLoading: false, versionLoading: false,
statusOptions: ['DRAFT', 'PUBLISHED', 'OBSOLETE'], statusOptions: ['DRAFT', 'PUBLISHED', 'OBSOLETE'],
// 分页相关
total: 0,
queryParams: {
pageNum: 1,
pageSize: 10,
specType: '',
lineId: ''
},
// 规程相关 // 规程相关
specOpen: false, specOpen: false,
specTitle: '', specTitle: '',
@@ -175,10 +177,15 @@ export default {
// 加载规程列表 // 加载规程列表
loadSpecs() { loadSpecs() {
this.pageLoading = true this.pageLoading = true
listProcessSpec({ pageNum: 1, pageSize: 500 }).then(res => { listProcessSpec(this.queryParams).then(res => {
this.total = res.total || 0
this.specList = res.rows || [] this.specList = res.rows || []
if (this.specList.length > 0 && !this.currentSpec) { if (this.specList.length > 0 && !this.currentSpec) {
this.selectSpec(this.specList[0]) this.selectSpec(this.specList[0])
} else {
this.currentSpec = null
this.currentSpecId = null
this.versionList = []
} }
}).catch(e => console.error(e)).finally(() => { this.pageLoading = false }) }).catch(e => console.error(e)).finally(() => { this.pageLoading = false })
}, },
@@ -230,7 +237,7 @@ export default {
}).then(() => { }).then(() => {
this.$modal.msgSuccess('已生效') this.$modal.msgSuccess('已生效')
this.loadVersions() this.loadVersions()
}).catch(() => {}) }).catch(() => { })
}, },
// 规程对话框 // 规程对话框
@@ -269,7 +276,7 @@ export default {
this.versionList = [] this.versionList = []
} }
this.loadSpecs() this.loadSpecs()
}).catch(() => {}) }).catch(() => { })
}, },
// 版本对话框 // 版本对话框
@@ -305,7 +312,7 @@ export default {
}).then(() => { }).then(() => {
this.$modal.msgSuccess('删除成功') this.$modal.msgSuccess('删除成功')
this.loadVersions() this.loadVersions()
}).catch(() => {}) }).catch(() => { })
} }
} }
} }
@@ -370,23 +377,43 @@ export default {
background: #5F7BA0 !important; background: #5F7BA0 !important;
border-color: #5F7BA0 !important; border-color: #5F7BA0 !important;
} }
::v-deep .el-button--primary:hover, ::v-deep .el-button--primary:hover,
::v-deep .el-button--primary:focus { background: #4d6a8e !important; border-color: #4d6a8e !important; } ::v-deep .el-button--primary:focus {
::v-deep .el-button--primary:active { background: #4a6585 !important; border-color: #4a6585 !important; } background: #4d6a8e !important;
::v-deep .el-button--primary.is-disabled { opacity: .5; } border-color: #4d6a8e !important;
}
::v-deep .el-button--primary:active {
background: #4a6585 !important;
border-color: #4a6585 !important;
}
::v-deep .el-button--primary.is-disabled {
opacity: .5;
}
::v-deep .el-button:not(.el-button--primary):not(.el-button--text):not(.el-button--danger) { ::v-deep .el-button:not(.el-button--primary):not(.el-button--text):not(.el-button--danger) {
color: #606266 !important; color: #606266 !important;
background: #fff !important; background: #fff !important;
border-color: #dcdfe6 !important; border-color: #dcdfe6 !important;
} }
::v-deep .el-button:not(.el-button--primary):not(.el-button--text):not(.el-button--danger):hover { ::v-deep .el-button:not(.el-button--primary):not(.el-button--text):not(.el-button--danger):hover {
color: #5F7BA0 !important; color: #5F7BA0 !important;
border-color: #5F7BA0 !important; border-color: #5F7BA0 !important;
} }
::v-deep .el-button--text { background: transparent !important; border-color: transparent !important; } ::v-deep .el-button--text {
::v-deep .el-button--text.btn-danger { color: #f56c6c !important; } background: transparent !important;
border-color: transparent !important;
}
.btn-danger { color: #f56c6c; } ::v-deep .el-button--text.btn-danger {
color: #f56c6c !important;
}
.btn-danger {
color: #f56c6c;
}
</style> </style>