-
+
@@ -303,6 +335,8 @@ export default {
options: ["交送", "接收"],
tableData: [],
selection: [],
+ mgroupOptions:[],
+ handoverbList:[],
handoverItem:{},
values: "交送",
mtask: "",
@@ -311,6 +345,13 @@ export default {
codeText2:"",
printer_name: "",
printVisible:false,
+ backDialogVisible:false,
+ form: { },
+ rules: {
+ recive_mgroup: [
+ { required: true, message: "请选择接收工段", trigger: "blur" },
+ ],
+ },
// setNameVisible: false,
};
},
@@ -321,9 +362,24 @@ export default {
that.params.mgroup = that.mgroupId;
that.apiObj = that.$API.wpm.handover.list;
that.$refs.table.refresh();
+ that.getMgroupOptions();
},
methods: {
-
+ //获取工段列表
+ getMgroupOptions() {
+ let that = this;
+ that.$API.mtm.mgroup.list.req({ page: 0}).then((res) => {
+ that.mgroupOptions = res;
+ if(that.type==40){
+ res.forEach(item=>{
+ if(item.name=="废品库"){
+ that.form.recive_mgroup = item.id;
+ }
+ })
+ that.getCkUserList();//废品库接收人
+ }
+ });
+ },
//添加
table_add(type) {
this.dialog.save = true;
@@ -408,7 +464,7 @@ export default {
that.query.recive_dept = "";
that.query.send_dept = "";
}
- console.log(that.query);
+ // console.log(that.query);
this.$refs.table.queryData(that.query);
},
table_receive(row) {
@@ -424,34 +480,50 @@ export default {
let form = {};
form.send_mgroup = row.recive_mgroup;
form.recive_mgroup = row.send_mgroup;
- form.handoverb =[];
+ form.handoverb = [];
+ that.handoverbList = [];
row.handoverb.forEach((item) => {
let obj = {};
obj.wm = item.wm_to;
+ obj.checked = true;
obj.batch = item.batch;
obj.count = item.count;
- form.handoverb.push(obj)
+ form.handoverb.push(obj);
+ that.handoverbList.push(obj);
})
form.send_user = that.$TOOL.data.get('USER_INFO').id;
form.send_date = that.$TOOL.dateFormat2(new Date());
- form.type = 60;
- that.$API.wpm.handover.create.req(form).then((res) => {
- that.$message.success("操作成功");
- }).catch((err) => {
- return err;
- });
+ form.type = 60;//退料
+ that.form = form;
+ that.backDialogVisible = true;
},
table_print(row) {
let that = this;
that.handoverItem = row;
that.printVisible = true;
},
- // savePrinter() {
- // let that = this;
- // localStorage.setItem("printer_name", that.printer_name);
- // that.setNameVisible = false;
- // that.$message.success("打印机设置成功,请重新进行打印操作。");
- // },
+ savePrinter() {
+ let that = this;
+ that.form.handoverb = [];
+ that.handoverbList.forEach(item=>{
+ if(item.checked){
+ let obj = {};
+ obj.wm = item.wm;
+ obj.batch = item.batch;
+ obj.count = item.count;
+ that.form.handoverb.push(obj);
+ }
+ })
+ // console.log(that.form)
+ that.$API.wpm.handover.create.req(that.form).then((res) => {
+ that.$message.success("操作成功");
+ that.backDialogVisible = false;
+ that.$refs.table.refresh();
+ that.form = {};
+ }).catch((err) => {
+ return err;
+ });
+ },
//本地更新数据
//新增岗位后更新数据
handleSaveSuccess(data, mode) {
diff --git a/src/views/wpm_gx/handover_form.vue b/src/views/wpm_gx/handover_form.vue
index cc9c29ce..c05c0536 100644
--- a/src/views/wpm_gx/handover_form.vue
+++ b/src/views/wpm_gx/handover_form.vue
@@ -51,6 +51,7 @@
:value="item.id"
>
{{ item.batch }}
+ ({{ item.material_name }})
{{ item.count }}
@@ -320,12 +321,15 @@ export default {
that.getUserList();
}
//获取交接物料
- if((that.type==20&&that.mgroupName!=='废品库')||that.type==40){
- //返工交接和报废交接
- that.getMaterialNotok();
+ if(that.type==20&&that.mgroupName!=='废品库'){
+ //返工交接
+ that.getMaterialRework();
}else if(that.type==20&&that.mgroupName=='废品库'){
//废品出库
that.getMaterialFP();
+ }else if(that.type==40){
+ //报废交接
+ that.getMaterialNotok();
}else{
//其他
that.getMaterial();
@@ -406,6 +410,19 @@ export default {
that.materialOptions = res;
});
},
+ getMaterialRework(){
+ let that = this;
+ that.materialOptions = [];
+ var req = {
+ mgroup: that.mgroupId,
+ page: 0,
+ tag : 'done'
+ };
+ that.listParams = req;
+ this.$API.wpm.wmaterial.list.req(req).then((res) => {
+ that.materialOptions = res;
+ });
+ },
//获取废品库物料
getMaterialFP() {
let that = this;