refactor(wms): 优化发货记录和钢卷列表页面逻辑
移除发货记录页面的planId校验,增加默认分页大小 简化钢卷列表页面的查询逻辑和样式类名
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="coil-selector-container">
|
||||
<div class="app-container">
|
||||
<el-form :inline="true" :model="queryParams" class="search-form">
|
||||
<el-form-item label="卷号">
|
||||
<el-input v-model="queryParams.currentCoilNo" placeholder="请输入卷号" clearable size="small"
|
||||
@@ -38,8 +38,6 @@
|
||||
<!-- 分页 -->
|
||||
<pagination v-if="!rangeMode" v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize" @pagination="getList" />
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -134,32 +132,12 @@ export default {
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
// 根据模式决定对话框显隐逻辑
|
||||
dialogVisible: {
|
||||
get() {
|
||||
// 触发器模式:使用内部变量
|
||||
if (this.useTrigger) {
|
||||
return this.innerVisible;
|
||||
}
|
||||
// 非触发器模式:使用外部传入的visible属性
|
||||
return this.visible;
|
||||
},
|
||||
set(val) {
|
||||
if (this.useTrigger) {
|
||||
// 触发器模式:更新内部变量
|
||||
this.innerVisible = val;
|
||||
} else {
|
||||
// 非触发器模式:通知父组件更新
|
||||
this.$emit('update:visible', val);
|
||||
}
|
||||
}
|
||||
},
|
||||
currentUserId() {
|
||||
return this.$store.getters.id;
|
||||
},
|
||||
renderColumns() {
|
||||
// 如果有自定义列配置,使用它;否则使用默认列
|
||||
return this.coilColumn.length;
|
||||
return this.columns;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -168,41 +146,22 @@ export default {
|
||||
methods: {
|
||||
// 表格行类名动态生成 - 核心:区分权限行/禁用行
|
||||
tableRowClassName({ row }) {
|
||||
// 销售受限模式下,判断当前行是否有权限
|
||||
if (this.salesRestricted && row.saleId !== this.currentUserId) {
|
||||
return 'disabled-coil-row'; // 禁用行类名
|
||||
}
|
||||
|
||||
return '';
|
||||
},
|
||||
|
||||
// 获取钢卷列表
|
||||
async getList() {
|
||||
// 如果是范围模式,直接使用传入数据
|
||||
if (this.rangeMode) {
|
||||
this.coilList = this.rangeData || [];
|
||||
this.total = this.coilList.length;
|
||||
return;
|
||||
}
|
||||
try {
|
||||
this.loading = true;
|
||||
// 设置筛选条件
|
||||
const queryPayload = {
|
||||
...this.queryParams,
|
||||
...this.filters,
|
||||
};
|
||||
// 处于销售视角,且my视图时,只查询当前用户的钢卷
|
||||
console.log('this.salesRestricted', this.salesRestricted, this.currentTab, this.currentUserId);
|
||||
if (this.salesRestricted && this.currentTab === 'my') {
|
||||
queryPayload.saleId = this.currentUserId;
|
||||
}
|
||||
const response = await listMaterialCoil(queryPayload);
|
||||
if (response.code === 200) {
|
||||
this.coilList = response.rows || [];
|
||||
this.total = response.total || 0;
|
||||
// 如果有初始coilId,尝试匹配数据
|
||||
if (this.value && !this.selectedCoil) {
|
||||
this.matchCoilById(this.value);
|
||||
}
|
||||
} else {
|
||||
this.$message.warning(`获取钢卷列表失败:${response.msg || '未知错误'}`);
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ export default {
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
pageSize: 50,
|
||||
planId: undefined,
|
||||
coilId: undefined,
|
||||
operateType: undefined,
|
||||
@@ -81,9 +81,9 @@ export default {
|
||||
methods: {
|
||||
/** 查询发货计划钢卷操作记录列表 */
|
||||
getList() {
|
||||
if (!this.planId) {
|
||||
return
|
||||
}
|
||||
// if (!this.planId) {
|
||||
// return
|
||||
// }
|
||||
this.loading = true;
|
||||
listDeliveryPlanCoilOperate(this.queryParams).then(response => {
|
||||
this.deliveryPlanCoilOperateList = response.rows;
|
||||
|
||||
Reference in New Issue
Block a user