youxioaqi&batch
This commit is contained in:
parent
bd527d31c6
commit
7640f53757
|
@ -160,7 +160,7 @@
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="编号">
|
<el-form-item label="编号">
|
||||||
<el-input v-model="number" placeholder="编号"/>
|
<el-input v-model="number" @input="checkValue" placeholder="编号"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
|
@ -306,6 +306,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
checkValue() {
|
||||||
|
this.number = this.number.replace(/[^0-9a-zA-Z]/g, '');
|
||||||
|
},
|
||||||
filterBlock(rule, index, field_key) {
|
filterBlock(rule, index, field_key) {
|
||||||
let that = this;
|
let that = this;
|
||||||
if (rule !== '' && rule !== null && rule !== undefined) {
|
if (rule !== '' && rule !== null && rule !== undefined) {
|
||||||
|
|
|
@ -346,7 +346,7 @@
|
||||||
label="批次"
|
label="批次"
|
||||||
:prop="'details.' + index + '.batch'"
|
:prop="'details.' + index + '.batch'"
|
||||||
>
|
>
|
||||||
<el-input v-model="item.batch" placeholder="批次号"></el-input>
|
<el-input v-model="item.batch" @input="checkValueItem(index)" minlength="6" placeholder="请输入数字或字母且最小六位数"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -379,7 +379,7 @@
|
||||||
<i class="el-icon-remove-outline" style="font-size: 20px"></i>
|
<i class="el-icon-remove-outline" style="font-size: 20px"></i>
|
||||||
</el-button>
|
</el-button>
|
||||||
</div>
|
</div>
|
||||||
<el-input style="width: 300px;" clearable v-model="itemDetails" placeholder="物料编号,回车确定编号" @keyup.enter.native="detailEnter(itemDetails,index)"></el-input>
|
<el-input style="width: 300px;" @input="checkValue" clearable v-model="itemDetails" placeholder="物料编号,回车确定编号" @keyup.enter.native="detailEnter(itemDetails,index)"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
<!-- 删除按钮 -->
|
<!-- 删除按钮 -->
|
||||||
|
@ -465,7 +465,7 @@
|
||||||
material: "", // 物料
|
material: "", // 物料
|
||||||
count: "", //数量
|
count: "", //数量
|
||||||
batch: "", //批次
|
batch: "", //批次
|
||||||
expiration_date: "", //
|
expiration_date: null, //
|
||||||
details:[],
|
details:[],
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -481,6 +481,13 @@
|
||||||
export default {
|
export default {
|
||||||
components: {Pagination},
|
components: {Pagination},
|
||||||
data() {
|
data() {
|
||||||
|
const validateBatch = (rule, value, callback) => {
|
||||||
|
if (value.length < 6) {
|
||||||
|
callback(new Error("请输入不小于六位!"));
|
||||||
|
} else {
|
||||||
|
callback();
|
||||||
|
}
|
||||||
|
};
|
||||||
return {
|
return {
|
||||||
inventory: defaulteinventory,
|
inventory: defaulteinventory,
|
||||||
outfifo: defaulteoutfifo,
|
outfifo: defaulteoutfifo,
|
||||||
|
@ -513,6 +520,7 @@
|
||||||
dialogVisibles: false,
|
dialogVisibles: false,
|
||||||
rule1: {
|
rule1: {
|
||||||
name: [{required: true, message: "请输入", trigger: "blur"}],
|
name: [{required: true, message: "请输入", trigger: "blur"}],
|
||||||
|
batch: [{required: true, message: "请输入不小于六位", trigger: "blur", validator: validateBatch},],
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -526,6 +534,12 @@
|
||||||
this.getpuorderList();
|
this.getpuorderList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
checkValue() {
|
||||||
|
this.itemDetails = this.itemDetails.replace(/[^0-9a-zA-Z]/g, '');
|
||||||
|
},
|
||||||
|
checkValueItem(index) {
|
||||||
|
this.inventory.details[index].batch = this.inventory.details[index].batch.replace(/[^0-9a-zA-Z]/g, '');
|
||||||
|
},
|
||||||
detailEnter(item,index){
|
detailEnter(item,index){
|
||||||
this.inventory.details[index].details.push({number:item});
|
this.inventory.details[index].details.push({number:item});
|
||||||
this.itemDetails = '';
|
this.itemDetails = '';
|
||||||
|
@ -639,7 +653,7 @@
|
||||||
material: "", // 物料
|
material: "", // 物料
|
||||||
count: "", //数量
|
count: "", //数量
|
||||||
batch: "", //批次
|
batch: "", //批次
|
||||||
expiration_date: "", //
|
expiration_date: null, //
|
||||||
details:[],
|
details:[],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
@ -711,9 +725,12 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
async confirm(form) {
|
async confirm(form) {
|
||||||
console.log(this.inventory);
|
let isbatch = false;
|
||||||
let details = [];
|
let details = [];
|
||||||
this.inventory.details.forEach(item=>{
|
this.inventory.details.forEach(item=>{
|
||||||
|
if(item.batch.length<6){
|
||||||
|
isbatch = true;
|
||||||
|
}
|
||||||
let obj = new Object();
|
let obj = new Object();
|
||||||
if(item.details.length>0){
|
if(item.details.length>0){
|
||||||
obj = item;
|
obj = item;
|
||||||
|
@ -726,14 +743,18 @@
|
||||||
}
|
}
|
||||||
details.push(obj);
|
details.push(obj);
|
||||||
});
|
});
|
||||||
this.inventory.details = details;
|
if(isbatch){
|
||||||
createInother(this.inventory).then((res) => {
|
this.$message.warning("批次号不能少于六位数");
|
||||||
if (res.code >= 200) {
|
}else{
|
||||||
this.getList();
|
this.inventory.details = details;
|
||||||
this.dialogVisible = false;
|
createInother(this.inventory).then((res) => {
|
||||||
this.$message.success("成功");
|
if (res.code >= 200) {
|
||||||
}
|
this.getList();
|
||||||
});
|
this.dialogVisible = false;
|
||||||
|
this.$message.success("成功");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
handleDelete(scope) {
|
handleDelete(scope) {
|
||||||
this.$confirm("确认删除?", "警告", {
|
this.$confirm("确认删除?", "警告", {
|
||||||
|
|
|
@ -238,7 +238,7 @@
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="任务编号" prop="number">
|
<el-form-item label="任务编号" prop="number">
|
||||||
<el-input v-model="orderplan.number" placeholder="任务编号"/>
|
<el-input v-model="orderplan.number" @input="checkValue" placeholder="任务编号"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div style="text-align: right">
|
<div style="text-align: right">
|
||||||
|
@ -336,7 +336,9 @@
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
checkPermission,
|
checkPermission,
|
||||||
|
checkValue() {
|
||||||
|
this.orderplan.number = this.orderplan.number.replace(/[^0-9a-zA-Z]/g, '');
|
||||||
|
},
|
||||||
//订单列表
|
//订单列表
|
||||||
getorderList() {
|
getorderList() {
|
||||||
this.listLoading = true;
|
this.listLoading = true;
|
||||||
|
|
Loading…
Reference in New Issue