diff --git a/src/components/scFormTable/index.vue b/src/components/scFormTable/index.vue index a596ac6b..c2334964 100644 --- a/src/components/scFormTable/index.vue +++ b/src/components/scFormTable/index.vue @@ -124,11 +124,15 @@ }, //表格勾选事件 select(rows, row){ - var isSelect = rows.length && rows.indexOf(row) !== -1&& this.defaultValue.indexOf(row) !== -1 - if(isSelect){ - this.defaultValue.push(row) - }else{ - this.defaultValue.splice(this.defaultValue.findIndex(item => item.id == row.id), 1) + var isSelect = rows.length && rows.indexOf(row) !== -1; + if(isSelect){//被选中 + if(this.defaultValue.indexOf(row) == -1){ + this.defaultValue.push(row) + } + }else{//被取消 + if(this.defaultValue.indexOf(row) !== -1){ + this.defaultValue.splice(this.defaultValue.findIndex(item => item.id == row.id), 1) + } } this.$emit('selectChange', this.defaultValue); }, @@ -147,6 +151,11 @@ } this.$emit('selectAllChange', this.defaultValue); }, + clearSelection(){ + let that = this; + that.defaultValue = []; + this.$emit('selectChange', this.defaultValue); + }, setCurrentRows(row){ let that = this; that.$nextTick(() => { diff --git a/src/views/inm/mioitem_form.vue b/src/views/inm/mioitem_form.vue index f7ff9cb3..2af8a4df 100644 --- a/src/views/inm/mioitem_form.vue +++ b/src/views/inm/mioitem_form.vue @@ -562,8 +562,8 @@ export default { // that.getnumberOutLast(); that.form.batch = items.batch; that.form.mb = items.id; - that.batchcount = Number(items.count); - that.form.count = Number(items.count); + that.batchcount = Number(items.count_canmio); + that.form.count = Number(items.count_canmio); that.form.warehouse = items.warehouse; that.inputBatchDisable = true; } diff --git a/src/views/mtm/route_form.vue b/src/views/mtm/route_form.vue index 155ac56a..762659cb 100644 --- a/src/views/mtm/route_form.vue +++ b/src/views/mtm/route_form.vue @@ -473,6 +473,9 @@ export default { that.routeId = data.id; that.addTemplate.route = data.id; that.params_json=that.form.params_json; + if((this.project_code=='bxerp'||this.project_code=='tcerp')&&this.form.material_out_tracking==null){ + this.form.material_out_tracking = 20; + } setTimeout(() => { that.options.forEach((item) => { if (item.id == data.process) { diff --git a/src/views/statistics/stock_statistics.vue b/src/views/statistics/stock_statistics.vue index 92d425d9..0debe0b7 100644 --- a/src/views/statistics/stock_statistics.vue +++ b/src/views/statistics/stock_statistics.vue @@ -10,6 +10,7 @@ + + + + + @@ -228,16 +243,28 @@ export default { materialType: "", params: { is_hidden: false, type: 10, count__gte: 1 }, query: { + material: "", mio_type: mioTypeEnum.values[0].key, }, + mquery:{ + page: 0, + type__in: "10", + is_hidden: false, + is_assemb: false, + }, + selectObj: {}, mio_type_name: mioTypeEnum.values[0].text, - queryType: "月", + queryType: "年", queryDate: "", start_date: "", end_date: "", currentYear: "", currentMonth: "", currentLastDay: "", + material_name: "", + material_type: "", + material_model: "", + material_specification: "", tableData: [], tableData1: [], tableData11: [], @@ -258,7 +285,6 @@ export default { { id: 20, name: "半成品" }, { id: 30, name: "主要原料" }, { id: 40, name: "辅助材料" }, - { id: 70, name: "办公用品" }, ], }; }, @@ -271,9 +297,9 @@ export default { that.currentYear = year; that.currentMonth = month > 9 ? month : "0" + month; that.currentLastDay = lastDay; - that.queryDate = that.currentYear + "-" + that.currentMonth; - that.start_date = that.currentYear + "-" + that.currentMonth + "-01"; - that.end_date = that.currentYear + "-" + that.currentMonth + "-" + lastDay; + that.queryDate = that.currentYear+''; + that.start_date = that.currentYear + "-01-01"; + that.end_date = that.currentYear + "-12-31"; that.getTableData(); that.getTableData1(); }, @@ -340,6 +366,9 @@ export default { that.modelFilters11 = []; that.specsFilters11 = []; let nameList=[],specsList=[],modelList=[]; + if(that.material_name!==''&&that.material_name!==null){ + that.params.name = that.material_name; + } this.$API.mtm.material.list.req(that.params).then((res) => { that.tableData11 = res.results; if(res.results.length>0){ @@ -371,11 +400,14 @@ export default { }, materialTypeChange(){ let that = this; + that.mquery.type__in = that.params.type; + that.material_type = that.params.type; if(that.params.type == 10 || that.params.type == 20){ that.getTableData1(); }else{ that.getTableData11(); } + that.getTableData(); }, //更改周预估用量 weekcountChange(row) { @@ -400,6 +432,18 @@ export default { mio_type: that.query.mio_type, }, }; + if(that.material_name!==''&&that.material_name!==null){ + obj.query.material_name = that.material_name; + } + if(that.material_type!==''&&that.material_type!==null){ + obj.query.material_type = that.material_type; + } + if(that.material_model!==''&&that.material_model!==null){ + obj.query.material_model = that.material_model; + } + if(that.material_specification!==''&&that.material_specification!==null){ + obj.query.material_specification = that.material_specification; + } that.$API.bi.dataset.exec.req(exec, obj).then((res) => { if (res.data2.ds0) { let data = res.data2.ds0; @@ -447,6 +491,16 @@ export default { } this.getTableData(); }, + selectMaterialChange() { + var that = this; + console.log(that.selectObj); + that.query.material = that.selectObj.id; + that.material_name = that.selectObj.name; + that.material_type = that.selectObj.type; + that.material_model = that.selectObj.model; + that.material_specification = that.selectObj.specification; + that.getTableData(); + }, handleQuery() { let that = this; if (that.queryType == "月") { @@ -523,25 +577,25 @@ export default { }, filterName1(value, row) { - return row.物料名 == value; + return row.material_name == value; }, filterSpecs1(value, row) { - return row.规格 == value; + return row.material_specification == value; }, filterModel1(value, row) { - return row.型号 == value; + return row.material_model == value; }, filterDept1(value, row) { - return row.完成车间 == value; + return row.dept_name == value; }, filterName11(value, row) { - return row.物料名 == value; + return row.name == value; }, filterSpecs11(value, row) { - return row.规格 == value; + return row.specification == value; }, filterModel11(value, row) { - return row.型号 == value; + return row.model == value; }, filterName2(value, row) { return row.物料名 == value; diff --git a/src/views/wpm_bx/handover_form2.vue b/src/views/wpm_bx/handover_form2.vue index 0be633cb..993d710e 100644 --- a/src/views/wpm_bx/handover_form2.vue +++ b/src/views/wpm_bx/handover_form2.vue @@ -33,9 +33,9 @@ 选择物料: { - if(item.number== number){ - if(item.disabled){ - that.$message.error("该物料已被分配"); - that.form.handoverb[index].wpr = ''; - }else{ - item.disabled = true; - let obj = {}; - obj.number = item.number; - obj.wpr = item.id; - that.form.handoverb[index].handoverbw.push(obj); - that.form.handoverb[index].count = that.form.handoverb[index].handoverbw.length; - that.form.handoverb[index].wpr = ''; + // console.log('number',number.split(" ")); + let arrs = number.split(" "); + that.form.handoverb[index].wm_in = ""; + if(arrs.length>1){ + that.form.handoverb[index].wpr = ''; + arrs.forEach(arr=>{ + that.wprOptions.forEach(item=>{ + if(item.number.indexOf(arr) > -1&&!item.disabled){ + item.disabled = true; + let obj = {}; + obj.number = item.number; + obj.wpr = item.id; + that.form.handoverb[index].handoverbw.push(obj); + that.form.handoverb[index].count = that.form.handoverb[index].handoverbw.length; + } + }) + }) + + }else{ + //放入对应的行中的handoverb中,并且在列表中disabled + that.wprOptions.forEach(item=>{ + if(item.number.indexOf(arr) > -1){ + if(item.disabled){ + that.$message.error("该物料已被分配"); + that.form.handoverb[index].wpr = ''; + }else{ + item.disabled = true; + let obj = {}; + obj.number = item.number; + obj.wpr = item.id; + that.form.handoverb[index].handoverbw.push(obj); + that.form.handoverb[index].count = that.form.handoverb[index].handoverbw.length; + that.form.handoverb[index].wpr = ''; + } } - } - }) + }) + } this.$refs.codeInput.focus(); }, deleteWpr(index1,index2,wpr){ @@ -240,6 +261,7 @@ export default { batchAdd(){ let that = this; let obj = { }; + obj.wm_in = ""; obj.wm = that.batchOrign.id; obj.batch = that.batchOrign.batch+"-"+that.addBactchNum; that.addBactchNum++; @@ -327,6 +349,7 @@ export default { height: 30px; line-height: 30px; margin-right: 20px; + margin-top: 5px; } .circleCloseFilled{ position: absolute; diff --git a/src/views/wpm_bx/inmIn.vue b/src/views/wpm_bx/inmIn.vue index a7e4c610..9c942023 100644 --- a/src/views/wpm_bx/inmIn.vue +++ b/src/views/wpm_bx/inmIn.vue @@ -93,7 +93,7 @@ min-width="150" > diff --git a/src/views/wpm_bx/mlog_detail.vue b/src/views/wpm_bx/mlog_detail.vue index 1d330d25..8a92e9f0 100644 --- a/src/views/wpm_bx/mlog_detail.vue +++ b/src/views/wpm_bx/mlog_detail.vue @@ -113,18 +113,18 @@ > - + - + - + + + + + + + + @@ -509,6 +526,7 @@ export default { shiftOtions:[], tableDataWm:[], qct_defects:[], + equipmentOtions:[], defectOptions:[], qct_testitems:[], processOptions:[], @@ -528,6 +546,10 @@ export default { count_use: [{required: true,message: "请输入领取数量",trigger: "blur"}], process:[{required: true,message: "请选择工序",trigger: "blur"}], shift:[{required: true,message: "请选择班次",trigger: "blur"}], + work_start_time:[{required: true,message: "请选择开始时间",trigger: "blur"}], + handle_user:[{required: true,message: "请选择操作人",trigger: "blur"}], + process:[{required: true,message: "请选择子工序",trigger: "blur"}], + equipment:[{required: true,message: "请选择设备",trigger: "blur"}], }, route_file:null, handle_date:'', @@ -571,6 +593,7 @@ export default { that.getMlogItem(); that.getPreocess(); that.getShift(); + that.getEquipment(); }, methods: { open() { @@ -615,6 +638,12 @@ export default { }) }); }, + getEquipment(){ + let that = this; + that.$API.em.equipment.list.req({page:0,belong_dept:that.dept}).then((res) => { + that.equipmentOtions = res; + }) + }, //获取指定工序的切分数量 getcutCount(material_id){ let that = this; @@ -640,52 +669,6 @@ export default { that.shiftOtions = res; }); }, - // getdefects(qct){ - // let that = this; - // if(qct!==''&&qct!==null){//输出 - // that.$API.qm.qct.item.req(qct).then((res) => { - // that.qct_defects = []; - // that.testdefectss(res); - // }) - // }else{ - // that.$API.qm.qct.getQct.req({ material: that.mlogItem.material_out,type:'out',tag:'process' }).then((res) => { - // that.testdefectss(res); - // }).catch(()=>{ - // // that.getList(); - // }) - // } - // }, - // testdefectss(res){ - // let that = this; - // res.qct_defects.forEach((item) => { - // that.addTemplate[item.defect_name] = false; - // let obj = Object.assign({}, item); - // that.qct_defects.push(obj); - // }) - // that.qct_defects_origin = that.qct_defects; - // that.qct_testitems = []; - // res.qct_testitems.forEach((item2) => { - // if(item2.testitem_type!=='20'){ - // let obj2 = Object.assign({}, item2); - // obj2.value = ''; - // obj2.addto_wpr = item2.addto_wpr; - // if(item2.testitem_field_type=='input-number'||item2.testitem_field_type=='input-int'){ - // obj2.value = null; - // that.addTemplate[item2.testitem_name] = null; - // } - // if(item2.testitem_field_type=='select-text'||item2.testitem_field_type=='selects-text'){ - // let str = obj2.testitem_choices.replace(/'/g, '"'); - // let arr = JSON.parse(str); - // obj2.testitem_choices = arr; - // that.addTemplate[item2.testitem_name] = null; - // } - // that.qct_testitems.push(obj2); - // } - // }) - // that.qct_testitems_origin = that.qct_testitems; - // // that.getList(); - // }, - //获取生产工序的mlogbw getMlogbw(){ let that = this; let params = {}; @@ -939,7 +922,7 @@ export default { that.muserForm.mlog = that.mlogItem.id; that.muserForm.handle_user = userInfo.id; that.muserForm.handle_user_name = userInfo.name; - that.muserForm.handle_date = this.$TOOL.dateFormat2(new Date()); + that.muserForm.work_start_time = this.$TOOL.dateFormat(new Date()); that.saveMuserDialog = true; }, saveMuserSubmit (){ diff --git a/src/views/wpm_bx/mlogbw_check_table.vue b/src/views/wpm_bx/mlogbw_check_table.vue index d98feef8..e6584f95 100644 --- a/src/views/wpm_bx/mlogbw_check_table.vue +++ b/src/views/wpm_bx/mlogbw_check_table.vue @@ -288,6 +288,7 @@ + @@ -489,7 +490,6 @@ export default { selectChange(rows){ let that = this; that.selectWprList = rows; - console.log('selectChangerows',rows); }, selectAllChange(datas){ let that = this; @@ -632,19 +632,19 @@ export default { obj.note = row.note; //qct不为空,有检验表 if((that.qct!==''&&that.qct!==null)||(that.qctId!==''&&that.qctId!==null)){ - that.qct_defects.forEach(item => { - if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){ - let str = item.rule_expression.replace(/`/g, ''); - str = str.replace(/\${(.*?)}/g, 'row.\$1') - let judge = false; - try { - judge = eval(str); - row[index][item.defect_name] = judge; - }catch (error) { - console.error('error',error); - } - } - }); + // that.qct_defects.forEach(item => { + // if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){ + // let str = item.rule_expression.replace(/`/g, ''); + // str = str.replace(/\${(.*?)}/g, 'row.\$1') + // let judge = false; + // try { + // judge = eval(str); + // that.mlogbwlist[editIndex][item.defect_name] = judge; + // }catch (error) { + // console.error('error',error); + // } + // } + // }); obj.ftest = {}; obj.ftest.ftestitems = []; obj.ftest.ftestdefects = []; @@ -937,10 +937,26 @@ export default { }, getEqData(index){ let that = this; + let row = that.mlogbwlist[index]; that.$API.em.cd.req({method:that.setForm.cd_req_addr}).then((res) => { that.qct_testitems.forEach(item0 => { if(item0.testitem_cd_expr!=null){ that.mlogbwlist[index][item0.testitem_name]= eval(item0.testitem_cd_expr); + that.qct_defects.forEach(item => { + if(item.rule_expression!==''&&item.rule_expression!==undefined&&item.rule_expression!==null){ + let str = item.rule_expression.replace(/`/g, ''); + str = str.replace(/\${(.*?)}/g, 'row.\$1'); + let judge = false; + try { + judge = eval(str); + that.mlogbwlist[index][item.defect_name] = judge; + }catch (error) { + console.error(error); + } + }else{ + that.mlogbwlist[index][item.defect_name] = false; + } + }); } }) }).catch((err) => { @@ -989,6 +1005,11 @@ export default { }); that.$API.wpm.mlogbw.update.req("bulk",that.selectWpr).then((res) => { that.setVisible = false; + that.selectWprList = []; + that.$refs.mlogbwTable.clearSelection(); + that.defectlists.forEach(item => { + item.value = false; + }); that.getList(); }).catch((err) => { return err;