Commit 6024e992 authored by chicheng's avatar chicheng

销售出库前端控制按时间先进先出

parent b360a192
management:
endpoints:
web:
exposure:
exclude: "*"
blade:
#多团队协作服务配置
loadbalancer:
#开启配置
enabled: true
#灰度版本
#version: 3.0.0
#负载均衡优先调用的ip段
prior-ip-pattern:
- 10.95.37.*
- 127.0.0.1
logging:
level:
org.springframework.cloud.gateway: DEBUG # 启用 Gateway 调试日志
reactor.netty.http.client: DEBUG # 启用 HTTP 客户端调试日志
spring:
redis:
password: dfem.0325@UAT
##redis 集群环境配置
cluster:
nodes: 10.95.37.65:7000,10.95.37.66:7000,10.95.37.64:7000
commandTimeout: 5000
cloud:
gateway:
httpclient:
wiretap: true # 启用底层网络通信日志
server:
wiretap: true # 启用服务器端网络通信日志
globalcors:
cors-configurations:
'[/**]':
allowed-origin-patterns: "*" # spring boot2.4配置
# allowed-origins: "*"
allowed-headers: "*"
allow-credentials: true
allowed-methods:
- GET
- POST
- DELETE
- PUT
- OPTION
routes:
- id: dfem-mos-lcc
uri: lb://dfem-mos-lcc
predicates:
- Path=/dfem-mos-lcc/**
filters:
- id: dfem-mos2
uri: http://plat-mos-pc.dfem.uat
predicates:
- Path=/dfem-mos2/**
filters:
- RewritePath=/dfem-mos2/(?<remaining>.*), /api/dfem-mos/${remaining}
\ No newline at end of file
......@@ -229,5 +229,6 @@
"暂不升级": "ไม่อัปเกรดในขณะนี้",
"立即升级": "อัปเกรดทันที",
"领用套数": "จํานวนชุดที่จะใช้",
"采购发票": "ใบแจ้งหนี้การจัดซื้อ"
"采购发票": "ใบแจ้งหนี้การจัดซื้อ",
"请按顺序先进先出": "กรุณาตรวจสอบตามลำดับการสิ้นสุดก่อน"
}
......@@ -103,13 +103,61 @@ import i18n from '../../lang/index'
},
goSubmit() {
if (this.goodsList.length === 0) {
return;
return;
}
// 验证先进先出规则
const validationResult = this.validateFIFO();
if (!validationResult.valid) {
this.$u.toast(validationResult.message);
return;
}
const data = JSON.parse(JSON.stringify(this.goodsList));
uni.$emit('sendkcData', data, this.info);
uni.navigateBack();
},
// 验证先进先出规则
validateFIFO() {
let previousDate = null;
for (let i = 0; i < this.goodsList.length; i++) {
const currentItem = this.goodsList[i];
const outQuantity = Number(currentItem.outQuantity) || 0;
const stockQuantity = Number(currentItem.ml005) || 0;
const currentDate = currentItem.ml009; // 最近入库日
// 跳过未出库的记录
if (outQuantity === 0) {
continue;
}
// 检查前一条记录(如果存在且日期不同)
if (i > 0) {
const previousItem = this.goodsList[i - 1];
const previousOutQuantity = Number(previousItem.outQuantity) || 0;
const previousStockQuantity = Number(previousItem.ml005) || 0;
const previousDate = previousItem.ml009;
// 如果最近入库日相同,不验证,当作同一批次处理
if (currentDate === previousDate) {
continue;
}
// 如果日期不同,检查前一条是否已出完
if (previousOutQuantity > 0 && previousOutQuantity < previousStockQuantity) {
return {
valid: false,
message: i18n.t('请按顺序先进先出', [i, previousDate, i + 1])
};
}
}
}
return { valid: true };
},
handleTabChange(index) {
this.current = index;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment