diff --git a/src/views/wpm_gx/inm_record.vue b/src/views/wpm_gx/inm_record.vue
index 7aa10c22..546bf113 100644
--- a/src/views/wpm_gx/inm_record.vue
+++ b/src/views/wpm_gx/inm_record.vue
@@ -135,8 +135,9 @@
icon="el-icon-plus"
@click="table_add"
>
-
+
-
+
-
+
物料标签
@@ -337,7 +338,12 @@ export default {
mio_user: "",
},
stateDict: {10: "创建中",20: "已提交",},
- typeDict:{'do_in':'生产入库','do_out':'生产领料'},
+ typeDict:{
+ 'do_in':'生产入库',
+ 'do_out':'生产领料',
+ 'borrow_out': "领用出库",
+ 'return_in': "退还入库"
+ },
apiworkerObj: null,
materials: [],
apiObj: null,
@@ -362,6 +368,7 @@ export default {
};
},
mounted() {
+ this.active = 0;
this.isSaveing = false;
this.form.mgroup = this.mgroupId;
this.form.type = this.cate;
@@ -413,6 +420,7 @@ export default {
//车间人员
getDeptUsers() {
let that = this;
+ that.userList = [];
let userInfo = that.$TOOL.data.get("USER_INFO");
that.$API.system.user.list.req({ depts: that.deptId, page: 0 }).then((res) => {
that.userOptions = res;
diff --git a/src/views/wpm_gx/inm_record_form.vue b/src/views/wpm_gx/inm_record_form.vue
index 54cc9fe2..e8ba3213 100644
--- a/src/views/wpm_gx/inm_record_form.vue
+++ b/src/views/wpm_gx/inm_record_form.vue
@@ -12,182 +12,273 @@
:rules="rules"
label-width="120px"
>
-
-
-
+
+
- {{ item.full_name }}
- 隐
-
-
-
-
-
-
- {{item.material_.name}}|{{ item.batch }}
- {{ item.defect_name }}
- {{ item.count }}
-
-
-
-
-
-
-
-
-
-
- {{ item.batch }}
- {{ item.count }} -- {{ item.warehouse_name }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ item.full_name }}
+ 隐
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+ {{item.material_.name}}|{{ item.batch }}
+ {{ item.defect_name }}
+ {{ item.count }}
+
+
+
+
+
+
+
+
+
+
+ {{ item.batch }}
+ {{ item.count }} -- {{ item.warehouse_name }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+ {{ item.batch }}
+ {{ item.count }} -- {{ item.warehouse_name }}
+
+
+
+
+
+
+
+
+
+
+
+ {{item.material_name}} {{ item.batch }}
+ {{ item.count }}
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
- 保存
-
+ 保存
+ 保存
取消
@@ -213,6 +304,8 @@ export default {
titleMap: {
do_out: "生产领料",
do_in: "生产入库",
+ borrow_out: "领用出库",
+ return_in: "退还入库",
},
form: {},
rules: {
@@ -232,6 +325,9 @@ export default {
selectMaterial: null,
selectBatch: null,
wbatchOptions: [],//工段物料批次
+ selectObj: {},
+ query: {},
+ apiObj:this.$API.mtm.material.list,
};
},
mounted() {
@@ -241,7 +337,7 @@ export default {
this.inputBatchDisable = true;
this.getMaterialOptions();
this.getBatchOptions();
- }else{//入库----工段
+ }else if(this.cate == 'do_in'||this.cate == 'return_in'){//入库----工段
this.getMgroupWmaterial();
}
this.getWarehouseOptions();
@@ -249,8 +345,17 @@ export default {
methods: {
//获取仓库
getWarehouseOptions() {
+ let that = this;
this.$API.inm.warehouse.list.req({ page: 0 }).then((res) => {
this.warehouseOptions = res;
+ if(that.cate=='return_in'||that.cate=='borrow_out'){
+ res.forEach(item => {
+ if (item.name =="辅料库") {
+ that.form.warehouse = item.id;
+ }
+ })
+
+ }
});
},
//获取物料列表
@@ -275,10 +380,14 @@ export default {
getMgroupWmaterial() {
let that = this;
let obj = {};
- obj.state = 10;
+ if(that.cate== 'do_in'){
+ obj.state = 10;
+ obj.material__process= that.process;
+ }else if(that.cate== 'return_in'){
+ obj.material__type = 40;
+ }
obj.page= 0;
obj.mgroupx= that.mgroupId;
- obj.material__process= that.process;
if (that.mgroupId != null &&that.mgroupId != undefined &&that.mgroupId != "") {
that.$API.wpm.wmaterial.list.req(obj).then((res) => {
that.wbatchOptions = res;
@@ -358,6 +467,14 @@ export default {
selectMaterialChange() {
this.getBatchOptions();
},
+ selectMaterialChange2(){
+ var that = this;
+ console.log('that.selectObj',that.selectObj.id);
+ that.form.material = that.selectObj.id;
+ if(that.selectObj.id!==undefined){
+ this.getBatchOptions();
+ }
+ },
getItem(options, id) {
for (var i = 0; i < options.length; i++) {
if (options[i].id == id) {
@@ -367,10 +484,8 @@ export default {
},
selectBatchChange() {
let that = this;
- console.log('selectBatch',that.selectBatch);
that.selectList = [];
that.batchOptions.forEach((item) => {
- console.log('indexOfselectBatch',that.selectBatch.indexOf(item.id));
if(that.mode == "add"){//领料
if(that.selectBatch.indexOf(item.id)>-1){
let obj = {};
@@ -391,6 +506,33 @@ export default {
}
})
},
+ //选择借用的物料批次后调用的方法
+ selectBatchChange2(item) {
+ let that = this;
+ if(item){
+ that.$API.wpm.wpr.list.req({ page: 0, mb: item.id }).then((res) => {
+ that.wprList = res;
+ })
+ that.form.batch = item.batch;
+ that.form.mb = item.id;
+ that.batchcount = Number(item.count);
+ that.form.count = Number(item.count);
+ that.form.warehouse = item.warehouse;
+ }
+ },
+ //归还时选择车间辅料后的处理
+ selectChange(){
+ let that = this;
+ that.wbatchOptions.forEach((item) => {
+ if(that.form.batch == item.batch){
+ that.form.wm = item.id;
+ that.form.batch = item.batch;
+ that.form.count = Number(item.count);
+ that.batchcount = Number(item.count);
+ }
+ })
+ },
+
//选择车间库存物料后的处理
selectwmChange(id){
let that = this;
@@ -416,6 +558,7 @@ export default {
},
selectBatchClear() {
this.form.batch = "";
+ this.form.count =0;
this.form.warehouse = "";
},
//显示
@@ -464,6 +607,32 @@ export default {
}
});
},
+ submit2() {
+ let that = this;
+ that.$refs.dialogForm.validate(async (valid) => {
+ if (valid) {
+ that.isSaveing = true;
+ that.form.mio = that.mioId;
+ try {
+ let res;
+ 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);
+ }
+ that.isSaveing = false;
+ that.$emit("success");
+ that.visible = false;
+ that.$message.success("操作成功");
+ } catch (err) {
+ console.log(err);
+ //可以处理校验错误
+ that.isSaveing = false;
+ return err;
+ }
+ }
+ })
+ },
//表单注入数据
setData(data) {
Object.assign(this.form, data);