fix: 修复多处表单与接口适配问题,优化钢卷状态筛选逻辑

1. 修复SalaryPanel输入框边框缺失样式
2. 调整wms报表日期范围计算与视图类型默认值
3. 统一多页面钢卷状态筛选组件:替换为下拉选项新增历史卷,新增状态转换逻辑,修正接口传参格式
4. 同步crm合同、业务员页面的钢卷筛选适配改动
This commit is contained in:
砂糖
2026-07-13 11:19:27 +08:00
parent b5c1cdac12
commit 475a051b1c
5 changed files with 117 additions and 26 deletions

View File

@@ -75,10 +75,11 @@
<el-option label="原料" value="raw_material" />
</el-select>
</el-form-item>
<el-form-item label="发货状态">
<el-select v-model="productCoilBo.status" placeholder="全部" clearable style="width: 100px;">
<el-option label="在库" :value="0" />
<el-option label="已发货" :value="1" />
<el-form-item label="钢卷状态">
<el-select v-model="productCoilBo.coilStatusType" placeholder="全部" clearable style="width: 100px;" @change="handleProductCoilStatusChange">
<el-option label="在库" value="in_stock" />
<el-option label="已发货" value="shipped" />
<el-option label="历史卷" value="history" />
</el-select>
</el-form-item>
<el-form-item label="质量状态">
@@ -134,10 +135,11 @@
<el-option label="原料" value="raw_material" />
</el-select>
</el-form-item>
<el-form-item label="发货状态">
<el-select v-model="deliveryCoilBo.status" placeholder="全部" clearable style="width: 100px;">
<el-option label="在库" :value="0" />
<el-option label="已发货" :value="1" />
<el-form-item label="钢卷状态">
<el-select v-model="deliveryCoilBo.coilStatusType" placeholder="全部" clearable style="width: 100px;" @change="handleDeliveryCoilStatusChange">
<el-option label="在库" value="in_stock" />
<el-option label="已发货" value="shipped" />
<el-option label="历史卷" value="history" />
</el-select>
</el-form-item>
<el-form-item label="质量状态">
@@ -417,7 +419,7 @@ export default {
orderId: this.orderId,
pageNum: this.productPagination.currentPage,
pageSize: this.productPagination.pageSize,
...this.productCoilBo
coilBo: this.productCoilBo
}).then(res => {
this.productCoilList = res.rows || [];
this.productPagination.total = res.total || 0;
@@ -431,7 +433,7 @@ export default {
});
},
fetchProductCoilStatistics() {
getProductCoilsStatisticsByContract({ ...this.productCoilBo, orderId: this.orderId }).then(res => {
getProductCoilsStatisticsByContract({ orderId: this.orderId, coilBo: this.productCoilBo }).then(res => {
this.productCoilStatistics = res.data || {};
});
},
@@ -445,6 +447,21 @@ export default {
this.productCoilBo = {};
this.handleProductFilter();
},
handleProductCoilStatusChange(val) {
if (val === 'in_stock') {
this.productCoilBo.status = 0;
this.productCoilBo.dataType = 1;
} else if (val === 'shipped') {
this.productCoilBo.status = 1;
this.productCoilBo.dataType = undefined;
} else if (val === 'history') {
this.productCoilBo.status = 0;
this.productCoilBo.dataType = 0;
} else {
this.productCoilBo.status = undefined;
this.productCoilBo.dataType = undefined;
}
},
handleDeliveryFilter() {
this.deliveryCoilBo.selectType = this.deliveryCoilBo.itemType || '';
this.deliveryPagination.currentPage = 1;
@@ -455,6 +472,21 @@ export default {
this.deliveryCoilBo = {};
this.handleDeliveryFilter();
},
handleDeliveryCoilStatusChange(val) {
if (val === 'in_stock') {
this.deliveryCoilBo.status = 0;
this.deliveryCoilBo.dataType = 1;
} else if (val === 'shipped') {
this.deliveryCoilBo.status = 1;
this.deliveryCoilBo.dataType = undefined;
} else if (val === 'history') {
this.deliveryCoilBo.status = 0;
this.deliveryCoilBo.dataType = 0;
} else {
this.deliveryCoilBo.status = undefined;
this.deliveryCoilBo.dataType = undefined;
}
},
handleProductPageChange({ currentPage, pageSize }) {
this.productPagination.currentPage = currentPage;
this.productPagination.pageSize = pageSize;

View File

@@ -93,10 +93,11 @@
<el-option label="原料" value="raw_material" />
</el-select>
</el-form-item>
<el-form-item label="发货状态">
<el-select v-model="productCoilBo.status" placeholder="全部" clearable style="width: 100px;">
<el-option label="在库" :value="0" />
<el-option label="已发货" :value="1" />
<el-form-item label="钢卷状态">
<el-select v-model="productCoilBo.coilStatusType" placeholder="全部" clearable style="width: 100px;" @change="handleCoilStatusChange">
<el-option label="在库" value="in_stock" />
<el-option label="已发货" value="shipped" />
<el-option label="历史卷" value="history" />
</el-select>
</el-form-item>
<el-form-item label="质量状态">
@@ -144,6 +145,13 @@
<el-option label="原料" value="raw_material" />
</el-select>
</el-form-item>
<el-form-item label="钢卷状态">
<el-select v-model="deliveryCoilBo.coilStatusType" placeholder="全部" clearable style="width: 100px;" @change="handleDeliveryCoilStatusChange">
<el-option label="在库" value="in_stock" />
<el-option label="已发货" value="shipped" />
<el-option label="历史卷" value="history" />
</el-select>
</el-form-item>
<el-form-item label="质量状态">
<muti-select v-model="deliveryCoilBo.qualityStatusCsv" :options="dict.type.coil_quality_status" placeholder="请选择品质" clearable style="width: 160px;" />
</el-form-item>
@@ -470,6 +478,36 @@ export default {
this.productCoilBo = {};
this.handleProductFilter();
},
handleCoilStatusChange(val) {
if (val === 'in_stock') {
this.productCoilBo.status = 0;
this.productCoilBo.dataType = 1;
} else if (val === 'shipped') {
this.productCoilBo.status = 1;
this.productCoilBo.dataType = undefined;
} else if (val === 'history') {
this.productCoilBo.status = 0;
this.productCoilBo.dataType = 0;
} else {
this.productCoilBo.status = undefined;
this.productCoilBo.dataType = undefined;
}
},
handleDeliveryCoilStatusChange(val) {
if (val === 'in_stock') {
this.deliveryCoilBo.status = 0;
this.deliveryCoilBo.dataType = 1;
} else if (val === 'shipped') {
this.deliveryCoilBo.status = 1;
this.deliveryCoilBo.dataType = undefined;
} else if (val === 'history') {
this.deliveryCoilBo.status = 0;
this.deliveryCoilBo.dataType = 0;
} else {
this.deliveryCoilBo.status = undefined;
this.deliveryCoilBo.dataType = undefined;
}
},
fetchDeliveryCoils(principal) {
this.deliveryCoilLoading = true;
return listDeliveryCoilsByPrincipal({

View File

@@ -751,7 +751,7 @@ export default {
.cell-input {
width: 100%;
height: 28px;
border: none;
border: 1px solid #dcdfe6;
outline: none;
text-align: right;
padding: 0 6px;

View File

@@ -142,10 +142,11 @@
<el-option label="原料" value="raw_material" />
</el-select>
</el-form-item>
<el-form-item label="发货状态">
<el-select v-model="productCoilBo.status" placeholder="全部" clearable style="width: 100px;">
<el-option label="在库" :value="0" />
<el-option label="已发货" :value="1" />
<el-form-item label="钢卷状态">
<el-select v-model="productCoilBo.coilStatusType" placeholder="全部" clearable style="width: 100px;" @change="handleCoilStatusChange">
<el-option label="在库" value="in_stock" />
<el-option label="已发货" value="shipped" />
<el-option label="历史卷" value="history" />
</el-select>
</el-form-item>
<el-form-item label="质量状态">
@@ -433,7 +434,7 @@ export default {
orderId: this.currentOrder.orderId,
pageNum: this.productPagination.currentPage,
pageSize: this.productPagination.pageSize,
...this.productCoilBo
coilBo: this.productCoilBo
}).then(res => {
this.productCoilList = res.rows || []
this.productPagination.total = res.total || 0
@@ -443,7 +444,7 @@ export default {
},
fetchProductCoilStatistics() {
if (!this.currentOrder || !this.currentOrder.orderId) return
getProductCoilsStatisticsByContract({ ...this.productCoilBo, orderId: this.currentOrder.orderId }).then(res => {
getProductCoilsStatisticsByContract({ orderId: this.currentOrder.orderId, coilBo: this.productCoilBo }).then(res => {
this.productCoilStatistics = res.data || {}
})
},
@@ -457,6 +458,21 @@ export default {
this.productCoilBo = {}
this.handleProductFilter()
},
handleCoilStatusChange(val) {
if (val === 'in_stock') {
this.productCoilBo.status = 0;
this.productCoilBo.dataType = 1;
} else if (val === 'shipped') {
this.productCoilBo.status = 1;
this.productCoilBo.dataType = undefined;
} else if (val === 'history') {
this.productCoilBo.status = 0;
this.productCoilBo.dataType = 0;
} else {
this.productCoilBo.status = undefined;
this.productCoilBo.dataType = undefined;
}
},
handleProductSelectionChange(selection) {
this.selectedProductRows = selection
},

View File

@@ -524,7 +524,12 @@ export default {
endDate = `${dateStr}-${lastDayOfMonth.toString().padStart(2, '0')}`;
} else if (dayPattern.test(dateStr)) {
startDate = dateStr;
endDate = dateStr;
const nextDay = new Date(dateStr);
nextDay.setDate(nextDay.getDate() + 1);
const nextYear = nextDay.getFullYear();
const nextMonth = String(nextDay.getMonth() + 1).padStart(2, '0');
const nextDayNum = String(nextDay.getDate()).padStart(2, '0');
endDate = `${nextYear}-${nextMonth}-${nextDayNum}`;
} else {
throw new Error('输入格式错误,请传入 yyyy、yyyy-MM 或 yyyy-MM-dd 格式的字符串');
}
@@ -552,7 +557,7 @@ export default {
defaultEndTime,
getDayTimeRange,
// all 类型专用
viewType: 'custom',
viewType: 'day',
yesterdaySummary: {},
monthChart: null,
dayChart: null,
@@ -734,9 +739,9 @@ export default {
this.queryParams.byCreateTimeStart = start;
this.queryParams.byCreateTimeEnd = end;
} else if (this.reportType === 'all') {
// all 类型默认使用当前月份作为自定义时间范围
this.viewType = 'custom';
const { start, end } = this.getDayTimeRange(this.monthDate);
// all 类型默认使用日视图选中今天筛选今天07:00到明天07:00的数据
this.viewType = 'day';
const { start, end } = this.getDayTimeRange(this.dayDate);
this.queryParams.startTime = start;
this.queryParams.endTime = end;
} else {