refactor(wms): 优化钢卷操作界面组件和交互逻辑

替换通用选择器为专用组件,优化按钮加载状态
统一操作后的页面返回延迟时间
This commit is contained in:
砂糖
2025-11-18 15:15:05 +08:00
parent 1a5eadd99e
commit cb77562cdf
4 changed files with 68 additions and 53 deletions

View File

@@ -52,6 +52,8 @@
icon="el-icon-refresh"
size="mini"
@click="handleRefresh"
:disabled="buttonLoading"
v-loading="buttonLoading"
>刷新</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
@@ -137,6 +139,8 @@
type="primary"
icon="el-icon-edit"
@click="handleProcess(scope.row)"
v-loading="buttonLoading"
:disabled="buttonLoading"
>操作</el-button>
<el-button
size="mini"
@@ -152,6 +156,8 @@
type="warning"
icon="el-icon-edit"
@click="handleProcess(scope.row)"
:disabled="buttonLoading"
v-loading="buttonLoading"
>继续</el-button>
<el-button
size="mini"
@@ -250,7 +256,7 @@
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button type="primary" @click="submitForm" :disabled="buttonLoading" v-loading="buttonLoading"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
@@ -286,6 +292,7 @@ export default {
return {
// 遮罩层
loading: true,
buttonLoading: false,
// 选中数组
ids: [],
// 非单个禁用
@@ -359,11 +366,13 @@ export default {
/** 查询待操作列表 */
getList() {
this.loading = true;
this.buttonLoading = true;
listPendingAction(this.queryParams).then(response => {
console.log('response.rows', response.rows);
this.actionList = response.rows;
this.total = response.total;
this.buttonLoading = false;
this.loading = false;
});
},
@@ -429,6 +438,7 @@ export default {
},
/** 提交按钮 */
submitForm() {
this.buttonLoading = true;
this.$refs['form'].validate(valid => {
if (valid) {
if (this.form.actionId != null) {
@@ -436,12 +446,14 @@ export default {
this.$message.success('修改成功');
this.open = false;
this.getList();
this.buttonLoading = false;
});
} else {
addPendingAction(this.form).then(response => {
this.$message.success('新增成功');
this.open = false;
this.getList();
this.buttonLoading = false;
});
}
}
@@ -468,10 +480,12 @@ export default {
console.log('操作类型:', row.actionType);
console.log('钢卷ID:', row.coilId);
this.buttonLoading = true;
this.$forceUpdate();
const actionType = parseInt(row.actionType);
// 特殊处理:发货和移库操作不需要跳转
if (actionType === 4 || actionType === 5) {
if (actionType === 4 || actionType === 5 || actionType === 401 || actionType === 402) {
this.$message.info(actionType === 4 ? '发货操作已在移动端完成' : '移库操作已在移动端完成');
return;
}
@@ -516,10 +530,11 @@ export default {
actionId: row.actionId
}
});
this.buttonLoading = false;
}).catch(error => {
console.error('更新状态失败:', error);
this.$message.error('更新状态失败: ' + (error.message || error));
});
})
},
/** 取消操作 */
handleCancel(row) {