diff --git a/src/views/inm/mainso.vue b/src/views/inm/mainso.vue
index b9b004b3..bf59197c 100644
--- a/src/views/inm/mainso.vue
+++ b/src/views/inm/mainso.vue
@@ -44,12 +44,13 @@
-
-
+
+
@@ -92,12 +93,26 @@ export default {
materialsVisible:false,
apiObjPrint:this.$API.cm.labelmat.fromMb,
wmId:'',
+ state_:{
+ 10:'合格',
+ 20:'不合格',
+ 30:'返修',
+ },
};
},
mounted() {
this.getWarehouse();
},
methods: {
+ getType(type){
+ if(type==10){
+ return 'success'
+ }else if(type==20){
+ return 'danger'
+ }else if(type==30){
+ return 'warning'
+ }
+ },
getWarehouse() {
this.$API.inm.warehouse.list.req({ page: 0 }).then((res) => {
this.warehouseOptions = res;
diff --git a/src/views/wpm_bx/handover_form.vue b/src/views/wpm_bx/handover_form.vue
index fbd2b890..f631311a 100644
--- a/src/views/wpm_bx/handover_form.vue
+++ b/src/views/wpm_bx/handover_form.vue
@@ -113,6 +113,16 @@
+
+
+
+
+
+
+
+
+
+
@@ -182,7 +192,7 @@
v-model="listItem.count"
controls-position="right"
:min="0"
- step="1"
+ :step="1"
:max="listItem.count_cando"
:disabled="mode==='show'"
:step-strictly="true"
@@ -258,6 +268,7 @@ export default {
recive_user: null,
recive_mgroup: null,
handoverb:[],
+ new_batch:''
},
rules: {
batch: [
@@ -321,6 +332,7 @@ export default {
bwVisible:false,
scanVisible:false,
isSaveing: false,
+ change_batch:false,
setFiltersVisible: false,
};
},
@@ -364,7 +376,6 @@ export default {
},
showbw(index){
this.bwIndex = index;
- console.log('this.form.handoverb[index].handoverbw',this.form.handoverb[index].handoverbw);
this.bwVisible = true;
},
bwVisibleClose(){
@@ -390,6 +401,10 @@ export default {
}
})
that.getCkUserList();//废品库接收人
+ }else if(that.type==30){
+ this.getUserList3();
+ }else{
+ this.getUserList2();
}
});
},
@@ -563,6 +578,9 @@ export default {
}else{
this.getUserList2();
}
+ if(data.new_batch!==''&&data.new_batch!==undefined&&data.new_batch!==null){
+ this.change_batch = true;
+ }
},
//设置过滤项
setFilters(filters) {
@@ -592,20 +610,21 @@ export default {
//handoverb里有这个物料批次
if(arr.length>0){
//判断是否有wpr,若无将wpr放进去
- if(arr[0].handoverbw&&arr[0].handoverbw.length>0){
+ if(that.form.handoverb[0].handoverbw&&that.form.handoverb[0].handoverbw.length>0){
let arr1 = [];
- arr1 = arr[0].handoverbw.filter((item1) => {
- item1.wpr = item1.id;
+ arr1 = that.form.handoverb[0].handoverbw.filter((item1) => {
+ return item1.wpr == res.id;
})
if(arr1.length>0){
that.$message.error("该物料已存在");
+ // console.log('0',that.form);
}else{
let obj1 = {};
obj1.wpr = res.id;
obj1.number = res.number;
that.form.handoverb[indexs].count+=1;
that.form.handoverb[indexs].handoverbw.push(obj1);
- console.log('1',that.form);
+ // console.log('1',that.form);
}
}else{
that.form.handoverb[indexs].handoverbw = [];
@@ -614,11 +633,10 @@ export default {
obj1.number = res.number;
that.form.handoverb[indexs].count=1;
that.form.handoverb[indexs].handoverbw.push(obj1);
- console.log('2',that.form);
+ // console.log('2',that.form);
}
}else{//handoverb里没有有这个物料批次
that.materialOptions.forEach((item) => {
- console.log('item.id',item.id);
if(item.id == res.wm){
let obj2 = {};
obj2.wm = item.id;
@@ -631,7 +649,7 @@ export default {
obj3.number = res.number;
obj2.handoverbw.push(obj3);
that.form.handoverb.push(obj2);
- console.log('3',that.form);
+ // console.log('3',that.form);
}
})
}
@@ -653,7 +671,7 @@ export default {
obj.count_cando = item.count;
obj.count = item.count;
that.form.handoverb.push(obj);
- console.log('4',that.form);
+ // console.log('4',that.form);
}
})
}
diff --git a/src/views/wpm_bx/inm.vue b/src/views/wpm_bx/inm.vue
index b7b7a4ec..a663f516 100644
--- a/src/views/wpm_bx/inm.vue
+++ b/src/views/wpm_bx/inm.vue
@@ -6,9 +6,9 @@
v-if="mgroupName=='清洗'"
>领料
- 入库
+ > -->
报废
@@ -112,7 +112,7 @@
>
物料标签
- 检验记录
+ 检验记录
-
-
+
{{ item.defect_name }}
@@ -193,6 +191,7 @@
>
物料标签
+
diff --git a/src/views/wpm_bx/inm_record.vue b/src/views/wpm_bx/inm_record.vue
index a3496365..1be2d05c 100644
--- a/src/views/wpm_bx/inm_record.vue
+++ b/src/views/wpm_bx/inm_record.vue
@@ -152,22 +152,32 @@
hideDo
stripe
>
-
-
- {{ scope.row.material_name }}
-
-
-
-
-
-
-
-
+
+
+ {{ scope.row.material_name }}
+
+
+
+
+
+
+
+
+
+
+ 删除
+
+
@@ -482,6 +492,13 @@ export default {
that.visible = false;
});
},
+ itemdelete(row){
+ let that = this;
+ that.$API.inm.mioitem.delete.req(row.id).then((res) => {
+ that.$message.success("删除成功");
+ that.$refs.tables.refresh();
+ });
+ },
submitOut() {},
//打印
handlePrint(){
diff --git a/src/views/wpm_bx/inm_record_form.vue b/src/views/wpm_bx/inm_record_form.vue
index 872843e2..cdac687e 100644
--- a/src/views/wpm_bx/inm_record_form.vue
+++ b/src/views/wpm_bx/inm_record_form.vue
@@ -12,7 +12,7 @@
:rules="rules"
label-width="120px"
>
-
+
-
+
-
+
@@ -144,9 +144,13 @@ export default {
do_out: "生产领料",
do_in: "生产入库",
},
- form: {},
+ form: {
+ count:1
+ },
rules: {
- material: [{required: true,message: "请选择物料",trigger: "blur",},],
+ material: [{required: true,message: "请选择物料",trigger: "blur"}],
+ batch: [{required: true,message: "请选择物料批次",trigger: "blur"}],
+ warehouse: [{required: true,message: "请选择仓库",trigger: "blur"}],
},
visible: false,
isSaveing: false,
@@ -158,6 +162,7 @@ export default {
selectBatchDisable: false,
selectMaterial: null,
selectBatch: null,
+ mioitemlist:[],
wbatchOptions: [],//工段物料批次
};
},
@@ -168,6 +173,7 @@ export default {
this.inputBatchDisable = true;
this.getMaterialOptions();
this.getBatchOptions();
+ this.getList();
}else{//入库----工段
this.getMgroupWmaterial();
}
@@ -180,6 +186,14 @@ export default {
this.warehouseOptions = res;
});
},
+ getList(){
+ let that = this;
+ that.$API.inm.mioitem.list.req({mio:that.mioId,page:0}).then(res=>{
+ console.log('mioitemlist',res);
+ that.mioitemlist = res;
+ })
+ },
+
//获取物料列表
getMaterialOptions() {
let that = this;
@@ -240,9 +254,21 @@ export default {
}
},
selectBatchChange(item) {
- this.form.batch = item.batch;
- this.form.mb = item.id;
- this.form.warehouse = item.warehouse;
+ let that = this;
+ if(item&&item.batch){
+ let arr = this.mioitemlist.filter((mioitem) => {
+ return mioitem.batch == item.batch;
+ });
+ console.log('arr',arr);
+ if(arr.length > 0){
+ this.$message.error('该批次已存在');
+ that.selectBatchClear();
+ }else{
+ this.form.batch = item.batch;
+ this.form.mb = item.id;
+ this.form.warehouse = item.warehouse;
+ }
+ }
},
//选择车间库存物料后的处理
selectwmChange(val){
@@ -254,6 +280,7 @@ export default {
})
},
selectBatchClear() {
+ this.selectBatch = "";
this.form.batch = "";
this.form.mb = "";
this.form.warehouse = "";
@@ -266,24 +293,25 @@ export default {
},
//提交
submit() {
- this.$refs.dialogForm.validate(async (valid) => {
+ let that = this;
+ that.$refs.dialogForm.validate(async (valid) => {
if (valid) {
- this.isSaveing = true;
- this.form.mio = this.mioId;
+ that.isSaveing = true;
+ that.form.mio = that.mioId;
try {
var res;
- if (this.mode == "add") {
- res = await this.$API.inm.mioitem.create.req(this.form);
- } else if (this.mode == "edit") {
- res = await this.$API.inm.mioitem.update.req(this.form.id,this.form);
+ if (that.mode == "add") {
+ res = await that.$API.inm.mioitem.create.req(that.form);
+ } else if (that.mode == "edit") {
+ res = await that.$API.inm.mioitem.update.req(that.form.id,that.form);
}
- this.isSaveing = false;
- this.$emit("success");
- this.visible = false;
- this.$message.success("操作成功");
+ that.isSaveing = false;
+ that.$emit("success");
+ that.visible = false;
+ that.$message.success("操作成功");
} catch (err) {
//可以处理校验错误
- this.isSaveing = false;
+ that.isSaveing = false;
return err;
}
}
diff --git a/src/views/wpm_bx/mlog_detail.vue b/src/views/wpm_bx/mlog_detail.vue
index ee5da236..0cc6166d 100644
--- a/src/views/wpm_bx/mlog_detail.vue
+++ b/src/views/wpm_bx/mlog_detail.vue
@@ -367,6 +367,7 @@
v-if="dialog.edit"
ref="editDialog"
:dept="deptId"
+ :process="process"
:mgroupName= "mlogItem.mgroup_name"
@success="handleEditSuccess"
@closed="dialog.edit = false"
@@ -390,6 +391,10 @@ export default {
type: String,
default: "",
},
+ process:{
+ type: String,
+ default: "",
+ }
},
components: {
editDialog,
diff --git a/src/views/wpm_bx/mlog_form.vue b/src/views/wpm_bx/mlog_form.vue
index b42732a7..4dd0672b 100644
--- a/src/views/wpm_bx/mlog_form.vue
+++ b/src/views/wpm_bx/mlog_form.vue
@@ -119,6 +119,61 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
new Date().getTime();
},
+ gettestitem(){
+ let that = this;
+ that.$API.qm.testitem.list.req({ process: that.process,type:20 }).then((res) => {
+ res.results.forEach((item) => {
+ let obj = {};
+ Object.assign(obj, item);
+ obj.value = '';
+ that.testitems.push(obj);
+ })
+ });
+ },
//获取
getUser() {
this.$API.system.user.list.req({ depts: this.dept }).then((res) => {
@@ -337,12 +405,26 @@ export default {
},
//表单注入数据
setData(data) {
+ let that = this;
console.log("data", data);
Object.assign(this.form, data);
if(data.test_file!==null){
this.form.test_file = data.test_file;
this.fileList = [{name:data.test_file,url:data.test_file}];
}
+ if(data.oinfo_json!==null){
+ if(that.testitems.length>0){
+ that.testitems.forEach((item) => {
+ item.value = data.oinfo_json[item.id];
+ });
+ }else{
+ setTimeout(() => {
+ that.testitems.forEach((item) => {
+ item.value = data.oinfo_json[item.id];
+ });
+ },500)
+ }
+ }
this.getRoute(data.id);
},
changeMtask(){
@@ -365,6 +447,11 @@ export default {
if (valid) {
that.isSaveing = true;
that.form.mgroup = that.mgroup;
+ let oinfo_json = {};
+ that.testitems.forEach((item) => {
+ oinfo_json[item.id] = item.value;
+ })
+ that.form.oinfo_json = oinfo_json;
if (that.mode === "add") {
that.$API.wpm.mlog.init.req(that.form).then((res) => {
that.isSaveing = false;
diff --git a/src/views/wpm_bx/mlogs.vue b/src/views/wpm_bx/mlogs.vue
index b0395724..d8dca1ab 100644
--- a/src/views/wpm_bx/mlogs.vue
+++ b/src/views/wpm_bx/mlogs.vue
@@ -146,7 +146,7 @@
:process="processId"
:mgroup="mgroupId"
:dept="deptId"
- :mgroup_name = "mgroup_name"
+ :mgroupName = "mgroupName"
@success="handleSaveSuccess"
@closed="dialog.save = false"
>
@@ -155,6 +155,7 @@
v-if="dialog.detail"
ref="detailDialog"
:mlogId="mlogId"
+ :process="processId"
:mtask="mtask"
@closed="detailClose"
>
@@ -197,7 +198,6 @@ export default {
deptId: null,
processId: "",
processCate: "",
- mgroup_name:''
};
},
watch: {
@@ -206,8 +206,7 @@ export default {
let that = this;
that.params.mgroup = "";
that.apiObj = null;
- that.mgroup_name = newval;
- // that.getMgroupInfo();
+ that.getMgroupInfo();
},
},
},
@@ -215,9 +214,7 @@ export default {
let that = this;
that.params.mgroup =that.mgroupId;
that.apiObj = that.$API.wpm.mlog.list;
- // this.mgroup_name = this.mgroupName;
- // this.getMgroupInfo();
- // console.log("mgroupName",this.mgroupName);
+ this.getMgroupInfo();
},
methods: {
getMgroupInfo(){
@@ -227,7 +224,6 @@ export default {
that.$message.error("获取工段错误");
return;
}
- that.mgroupId = res.id;
that.deptId = res.belong_dept;
that.processId = res.process;
that.processCate = res.process_cate;