feat: 新增规格校验功能并优化钢卷号输入处理
1. 新增validSpecification规格校验函数,校验格式为数字.两位小数*数字的钢卷规格 2. 为多个页面的钢卷号输入框添加trim修饰符自动去除首尾空格 3. 在API层统一对钢卷号字段做trim预处理 4. 为原料和产品表单添加规格必填校验和格式校验 5. 新增钢卷信息修正页面,添加生产耗时自动计算功能 6. 优化部分页面的UI和代码冗余
This commit is contained in:
@@ -35,27 +35,42 @@ export function getMaterialCoil(CoilMaterialId) {
|
||||
}
|
||||
|
||||
export function addMaterialCoil(data) {
|
||||
// 对data进行预处理,将currentCoilNo去除首位的空格
|
||||
const payload = {
|
||||
...data,
|
||||
currentCoilNo: data.currentCoilNo.trim(),
|
||||
}
|
||||
return request({
|
||||
url: '/wms/materialCoil',
|
||||
method: 'post',
|
||||
data: data
|
||||
data: payload
|
||||
})
|
||||
}
|
||||
|
||||
export function updateMaterialCoil(data) {
|
||||
// 对data进行预处理,将currentCoilNo去除首位的空格
|
||||
const payload = {
|
||||
...data,
|
||||
currentCoilNo: data.currentCoilNo.trim(),
|
||||
}
|
||||
return request({
|
||||
url: '/wms/materialCoil',
|
||||
method: 'put',
|
||||
data: data
|
||||
data: payload
|
||||
})
|
||||
}
|
||||
|
||||
// 简单更新钢卷物料表
|
||||
export function updateMaterialCoilSimple(data) {
|
||||
// 对data进行预处理,将currentCoilNo去除首位的空格
|
||||
const payload = {
|
||||
...data,
|
||||
currentCoilNo: data.currentCoilNo.trim(),
|
||||
}
|
||||
return request({
|
||||
url: '/wms/materialCoil/update',
|
||||
method: 'put',
|
||||
data: data
|
||||
data: payload
|
||||
})
|
||||
}
|
||||
|
||||
@@ -107,19 +122,32 @@ export function getMaterialCoilDistributionByActualWarehouse(query) {
|
||||
|
||||
// 钢卷分卷
|
||||
export function splitMaterialCoil(data) {
|
||||
const payload = {
|
||||
...data,
|
||||
// currentCoilNo: data.currentCoilNo.trim(),
|
||||
newCoils: data.newCoils?.map(item => ({
|
||||
...item,
|
||||
currentCoilNo: item.currentCoilNo?.trim(),
|
||||
})),
|
||||
}
|
||||
return request({
|
||||
url: '/wms/materialCoil',
|
||||
method: 'put',
|
||||
data: data
|
||||
data: payload
|
||||
})
|
||||
}
|
||||
|
||||
// 钢卷合卷
|
||||
export function mergeMaterialCoil(data) {
|
||||
// 对data进行预处理,将currentCoilNo去除首位的空格
|
||||
const payload = {
|
||||
...data,
|
||||
currentCoilNo: data.currentCoilNo.trim(),
|
||||
}
|
||||
return request({
|
||||
url: '/wms/materialCoil/merge',
|
||||
method: 'post',
|
||||
data: data
|
||||
data: payload
|
||||
})
|
||||
}
|
||||
|
||||
@@ -283,10 +311,15 @@ export function startSpecialSplit(coilId, actionType) {
|
||||
* 创建一个分条
|
||||
*/
|
||||
export function createSpecialChild(parentCoilId, pendingActionId, data) {
|
||||
// 对data进行预处理,将currentCoilNo去除首位的空格
|
||||
const payload = {
|
||||
...data,
|
||||
currentCoilNo: data.currentCoilNo.trim(),
|
||||
}
|
||||
return request({
|
||||
url: '/wms/materialCoil/specialSplit/createChild',
|
||||
method: 'post',
|
||||
data: data,
|
||||
data: payload,
|
||||
params: {
|
||||
parentCoilId,
|
||||
pendingActionId
|
||||
|
||||
Reference in New Issue
Block a user