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