diff --git a/src/views/modules/part/bomManagement.vue b/src/views/modules/part/bomManagement.vue index ed6be04..194ec5e 100644 --- a/src/views/modules/part/bomManagement.vue +++ b/src/views/modules/part/bomManagement.vue @@ -85,7 +85,7 @@ - + 物料编码 @@ -96,59 +96,57 @@ - + - - - - - - + + + + + + - + - + - + - + - + - 保存 + 保存 - + - + @@ -169,15 +167,15 @@ - + - + - + @@ -236,7 +234,7 @@ - + @@ -245,7 +243,7 @@ - + @@ -350,6 +348,17 @@ + + + + + + + + + + + @@ -376,17 +385,6 @@ - - - - - - - - - - - @@ -1074,13 +1072,6 @@ export default { message: ' ', trigger: 'change' } - ], - typeFlag: [ - { - required: true, - message: ' ', - trigger: 'change' - } ] }, detailRules: { @@ -1274,9 +1265,9 @@ export default { partNo: '', partDesc: '', engChgLevel: '', - bomType: '', + bomType: 'manufacturing', noteText: '', - effPhaseInDate: '', + effPhaseInDate: new Date(+ new Date() + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, ''), effPhaseOutDate: '', engRevision: '', typeFlag: 'B', @@ -1355,10 +1346,10 @@ export default { componentPartDesc: '', printUnit: '', printUnitName: '', - qtyPerAssembly: '', - componentScrap: '', + qtyPerAssembly: 0, + componentScrap: 0, issueType: '', - shrinkageFactor: '', + shrinkageFactor: 0, lineItemNo: '', operationNo: '', operationName: '', @@ -1632,6 +1623,8 @@ export default { getComponentRowData (row) { this.componentData.componentPart = row.partNo this.componentData.componentPartDesc = row.partDesc + this.componentData.printUnit = row.printUnit + this.componentData.printUnitName = row.printUnitName this.componentPartModelFlag = false }, /** @@ -1895,7 +1888,7 @@ export default { bomType: this.modalData.bomType, alternativeNo: '', alternativeDescription: '', - minLotQty: '', + minLotQty: 0, defaultFlag: '', detailNoteText: '', createDate: '', @@ -2018,6 +2011,38 @@ export default { }) }, + + + // ======= 正则校验 ======= + handleInput (value, type) { + // 大于等于0,且只能输入4位小数 + let val = value.replace(/^\D*([0-9]\d*\.?\d{0,4})?.*$/,'$1') + if (val == null || val == undefined || val == '') { + val = 0 + } + if (type === 1) { + this.modalData.netWeight = val + } else if (type === 2) { + this.detailData.minLotQty = val + } else if (type === 3) { + this.saveDetailData.minLotQty = val + } else if (type === 4) { + this.componentData.qtyPerAssembly = val + } else if (type === 5) { + this.componentData.componentScrap = val + } + }, + handleInputB (value) { + const reg = /^(([1-9]?\d{0,1}(\.\d{1,2})?)|100|100\.(0){1,2})$/ + if (reg.test(value) === true) { + this.componentData.shrinkageFactor = value + } else if (value > 100) { + this.componentData.shrinkageFactor = 100 + } else { + this.componentData.shrinkageFactor = 0 + } + }, + // ======== chooseList相关方法 ======== /** * 获取基础数据列表S @@ -2080,7 +2105,7 @@ export default { diff --git a/src/views/modules/part/routingManagement.vue b/src/views/modules/part/routingManagement.vue index 6526a16..1bac6d0 100644 --- a/src/views/modules/part/routingManagement.vue +++ b/src/views/modules/part/routingManagement.vue @@ -85,7 +85,7 @@ - + 物料编码 @@ -96,36 +96,34 @@ - + - + - + - + 保存 @@ -133,10 +131,10 @@ - + - + @@ -157,12 +155,12 @@ - + - + @@ -323,75 +321,79 @@ - - 工序号 - 工序号 - + + + + + + + - + - - - - 加工中心 - + 加工中心编码 + + + + - - + + - + - + - - - - - + + - - + + 调机时的人员等级 + - - + + - + - - + + + + 人员等级 + + - - - - - 人员等级 - + + + + + + - - 调机时的人员等级 - + + @@ -795,24 +797,6 @@ export default { } ], columnSubDetailList: [ - { - userId: this.$store.state.user.name, - functionId: 104003, - serialNumber: '104003Table2OperationId', - tableId: '104003Table2', - tableName: 'Routing工序表', - columnProp: 'operationId', - headerAlign: 'center', - align: 'center', - columnLabel: '工序号', - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: '', - columnWidth: 80 - }, { userId: this.$store.state.user.name, functionId: 104003, @@ -1319,7 +1303,7 @@ export default { routingRevision: '', routingType: '', noteText: '', - phaseInDate: '', + phaseInDate: new Date(+ new Date() + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, ''), phaseOutDate: '', createBy: this.$store.state.user.name } @@ -1398,14 +1382,14 @@ export default { operationId: '', operationNo: '', operationName: '', - efficiencyFactor: '', + efficiencyFactor: 100, machRunFactor: '', machSetupTime: '', runTimeCode: '', - laborRunFactor: '', + laborRunFactor: 100, laborSetupTime: '', crewSize: '', - setupCrewSize: '', + setupCrewSize: 1, outsideOpItem: '', machineNo: '', workCenterNo: '', @@ -1790,14 +1774,14 @@ export default { this.$message.warning('请填写主记录Routing版本号!') return } - if (this.componentData.operationId === '' || this.componentData.operationId == null) { - this.$message.warning('请选择工序号!') - return - } if (this.componentData.operationNo === '' || this.componentData.operationNo == null) { this.$message.warning('请填写工序编码!') return } + if (this.componentData.operationName === '' || this.componentData.operationName == null) { + this.$message.warning('请选择工序名称!') + return + } if (this.componentData.flag === '1') { this.saveComponentLoading = true saveRoutingComponent(this.componentData).then(({data}) => { @@ -2054,6 +2038,47 @@ export default { }) }, + // ======= 正则校验 ======= + handleInput (value, type) { + // 大于等于0,且只能输入4位小数 + let val = value.replace(/^\D*([0-9]\d*\.?\d{0,4})?.*$/,'$1') + if (val == null || val == undefined || val == '') { + val = 0 + } + if (type === 1) { + this.modalData.machRunFactor = val + } else if (type === 2) { + this.detailData.machSetupTime = val + } else if (type === 3) { + this.saveDetailData.setupCrewSize = val + } else if (type === 4) { + this.componentData.crewSize = val + } else if (type === 5) { + this.componentData.laborSetupTime = val + } + }, + handleInputB (value, type) { + const reg = /^(([1-9]?\d{0,1}(\.\d{1,2})?)|100|100\.(0){1,2})$/ + if (type === 1) { + if (reg.test(value) === true) { + this.componentData.efficiencyFactor = value + } else if (value > 100) { + this.componentData.efficiencyFactor = 100 + } else { + this.componentData.efficiencyFactor = 0 + } + } else if (type === 2) { + if (reg.test(value) === true) { + this.componentData.laborRunFactor = value + } else if (value > 100) { + this.componentData.laborRunFactor = 100 + } else { + this.componentData.laborRunFactor = 0 + } + } + + }, + // ======== chooseList相关方法 ======== /** * 获取基础数据列表S @@ -2065,9 +2090,6 @@ export default { this.tagNo1 = type this.$nextTick(() => { let strVal = '' - if (val === 117) { - strVal = this.componentData.issueToLoc - } if (val === 118) { if(type === 1) { strVal = this.componentData.laborClassNo @@ -2075,6 +2097,9 @@ export default { strVal = this.componentData.setupLaborClassNo } } + if (val === 119) { + strVal = this.componentData.workCenterNo + } this.$refs.baseList.init(val, strVal) }) }, @@ -2083,10 +2108,6 @@ export default { * @param val */ getBaseData (val) { - if (this.tagNo === 117) { - this.componentData.issueToLoc = val.location_id - this.componentData.issueToLocName = val.location_name - } if (this.tagNo === 118) { if (this.tagNo1 === 1) { this.componentData.laborClassNo = val.level_id @@ -2096,6 +2117,10 @@ export default { this.componentData.setupLaborClassDesc = val.level_desc } } + if (this.tagNo === 119) { + this.componentData.workCenterNo = val.work_center_no + this.componentData.workCenterDesc = val.work_center_desc + } }, // ======== 导出相关方法 ======== @@ -2133,14 +2158,16 @@ export default {