+
{{
diff --git a/src/views/wpm_bx/mlogb_form.vue b/src/views/wpm_bx/mlogb_form.vue
index 9c98e7bf..1844e5bd 100644
--- a/src/views/wpm_bx/mlogb_form.vue
+++ b/src/views/wpm_bx/mlogb_form.vue
@@ -34,37 +34,10 @@
-
-
+
-
- 保存
- 取消
-
@@ -74,7 +47,9 @@ const defaultForm = {
mlog: "",
mtask: "",
batch: "",
+ wn_in: "",
count_use: 1,
+ note:''
};
export default {
props: {
@@ -110,14 +85,7 @@ export default {
message: "请填写批次号",
trigger: "blur",
},
- ],
- count_use: [
- {
- required: true,
- message: "请填写领用数量",
- trigger: "blur",
- },
- ],
+ ]
},
wm_in:'',
options: [],
@@ -135,6 +103,7 @@ export default {
open() {
this.visible = true;
},
+ //获取任务列表
getMtask() {
let that = this;
this.$API.pm.mtask.list
@@ -158,29 +127,31 @@ export default {
});
},
//扫描后处理方法
- formWminChange(){
- //根据扫描内容获取输入物料
- this.materialOptions.forEach((item) => {
- if (item.batch == this.wm_in) {
- this.form.wm_in = item.id;
- //提交
- this.submit();
- }
- });
+ formWminChange(wm_in){
+ // wn_in:扫码获取的内容
+ let that = this;
+ let arr = that.materialOptions.filter((item) => {
+ return item.batch == wm_in;
+ });
+ if (arr.length > 0) {
+ that.form.wm_in = arr[0].id;
+ that.form.mlog = that.mlog;
+ that.form.mtask = that.mtask;
+ //提交
+ that.submit();
+ }else{
+ that.wm_in = '';
+ that.$message.error("批次号不存在");
+ }
},
//表单提交方法
submit() {
let that = this;
- that.$refs.dialogForm.validate(async (valid) => {
- if (valid) {
- that.form.mlog = that.mlog;
- that.$API.wpm.mlogb.in.req(that.form).then((res) => {
- that.$emit("mlogbinSuccess");
- that.$message.success("添加成功");
- }).catch((err) => {
- });
- }
- });
+ that.form.mlog = that.mlog;
+ that.$API.wpm.mlogb.in.req(that.form).then((res) => {
+ that.$message.success("添加成功");
+ that.wm_in = '';
+ }).catch((err) => {});
},
//设置过滤项
setFilters(filters) {