feat(钢卷管理): 添加钢卷号前缀生成功能并优化样式
添加钢卷号前缀生成工具函数及测试用例 在合并、拆分、分条和录入页面使用自动生成的钢卷号前缀 调整EmployeeSelector组件默认触发器的样式 移除typing.vue中未使用的变更历史代码块 添加钢卷号长度校验规则
This commit is contained in:
@@ -198,6 +198,7 @@ import ProductSelect from "@/components/KLPService/ProductSelect";
|
||||
import RawMaterialSelect from "@/components/KLPService/RawMaterialSelect";
|
||||
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect";
|
||||
import { generateCoilNoPrefix } from "@/utils/coil/coilNo";
|
||||
|
||||
export default {
|
||||
name: 'StepSplit',
|
||||
@@ -223,7 +224,9 @@ export default {
|
||||
},
|
||||
dicts: ['coil_quality_status'],
|
||||
data() {
|
||||
const currentCoilNoPrefix = generateCoilNoPrefix()
|
||||
return {
|
||||
currentCoilNoPrefix,
|
||||
// 待分条钢卷基础信息
|
||||
coilInfo: {},
|
||||
loading: false,
|
||||
@@ -231,7 +234,7 @@ export default {
|
||||
splitForm: {
|
||||
coilId: '', // 分条钢卷ID(编辑时赋值)
|
||||
enterCoilNo: '',
|
||||
currentCoilNo: '',
|
||||
currentCoilNo: currentCoilNoPrefix,
|
||||
supplierCoilNo: '',
|
||||
warehouseId: '',
|
||||
actualWarehouseId: '',
|
||||
@@ -262,6 +265,16 @@ export default {
|
||||
rules: {
|
||||
currentCoilNo: [
|
||||
{ required: true, message: "当前钢卷号不能为空", trigger: "blur" },
|
||||
{
|
||||
// 当前钢卷号必须大于等于10位
|
||||
validator: (rule, value, callback) => {
|
||||
if (value.length < 10) {
|
||||
callback(new Error('当前钢卷号必须大于等于10位'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
}, trigger: 'blur'
|
||||
},
|
||||
// 仅在新增的时候校验
|
||||
{
|
||||
validator: (rule, value, callback) => {
|
||||
@@ -400,7 +413,7 @@ export default {
|
||||
this.splitForm = {
|
||||
coilId: undefined,
|
||||
enterCoilNo: '',
|
||||
currentCoilNo: '',
|
||||
currentCoilNo: this.currentCoilNoPrefix,
|
||||
supplierCoilNo: '',
|
||||
warehouseId: '',
|
||||
actualWarehouseId: '',
|
||||
|
||||
Reference in New Issue
Block a user