Browse Source

2025/8/26

java8
Aoi_Tori 5 months ago
parent
commit
7ab2e626b1
  1. 69
      src/views/modules/part/quicklyCreateBom.vue

69
src/views/modules/part/quicklyCreateBom.vue

@ -1020,14 +1020,14 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="生效日期" v-if="copyData.routingFlag==='Y'||copyData.bomFlag==='Y'" prop="effPhaseInDate"> <el-form-item label="生效日期" v-if="copyData.routingFlag==='Y'||copyData.bomFlag==='Y'" prop="effPhaseInDate">
<el-date-picker style="width: 7vw" v-model="copyData.effPhaseInDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
<el-date-picker style="width: 7vw" v-model="copyData.effPhaseInDate" clearable type="date" value-format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="失效日期" v-if="copyData.routingFlag==='Y'||copyData.bomFlag==='Y'" prop="effPhaseOutDate">
<el-date-picker style="width: 7vw" v-model="copyData.effPhaseOutDate" type="date" value-format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
<el-form-item label="失效日期" v-if="copyData.routingFlag==='Y'||copyData.bomFlag==='Y'">
<el-date-picker style="width: 7vw" v-model="copyData.effPhaseOutDate" clearable type="date" value-format="yyyy-MM-dd" placeholder="选择日期"></el-date-picker>
</el-form-item> </el-form-item>
</el-form> </el-form>
</fieldset> </fieldset>
<fieldset style="width: 55vw">
<fieldset style="width: 57vw">
<legend>被复制的物料</legend> <legend>被复制的物料</legend>
<el-form :inline="true" label-position="top" :model="copyData"> <el-form :inline="true" label-position="top" :model="copyData">
<el-form-item> <el-form-item>
@ -1425,18 +1425,34 @@ export default {
deep: true, deep: true,
handler: function (newV, oldV) { handler: function (newV, oldV) {
if (!newV) { if (!newV) {
this.copyData = {
this.copyData= {
flag: '', flag: '',
site: this.$store.state.user.site, site: this.$store.state.user.site,
partNo: '', partNo: '',
partDesc: '', partDesc: '',
umId2: null,
productGroupId1: null,
productGroupId2: null,
productGroupId3: null,
codeNo: null,
familyID: null,
partType2: null,
routingType: 'Manufacturing',
bomType: 'Manufacturing',
effPhaseInDate: null,
effPhaseOutDate: null,
phaseOutDate: null,
phaseInDate: null,
previousVersion: {}, previousVersion: {},
nodeFlag: false, nodeFlag: false,
mainPart: '', mainPart: '',
nodeId: '', nodeId: '',
engChgLevel: null, engChgLevel: null,
bomFlag: 'N',
routingFlag: 'N',
routingRevision: null,
active: '',
createBy: '',
routingFlag: 'Y',
bomFlag: 'Y',
page: 1, page: 1,
limit: 10 limit: 10
} }
@ -1540,13 +1556,6 @@ export default {
trigger: ['blur', 'change'] trigger: ['blur', 'change']
} }
], ],
effPhaseOutDate: [
{
required: true,
message: ' ',
trigger: ['blur', 'change']
}
],
effPhaseInDate: [ effPhaseInDate: [
{ {
required: true, required: true,
@ -1610,15 +1619,22 @@ export default {
codeNo: null, codeNo: null,
familyID: null, familyID: null,
partType2: null, partType2: null,
routingType: 'Manufacturing',
bomType: 'Manufacturing',
effPhaseInDate: null,
effPhaseOutDate: null,
phaseOutDate: null,
phaseInDate: null,
previousVersion: {}, previousVersion: {},
nodeFlag: false, nodeFlag: false,
mainPart: '', mainPart: '',
nodeId: '', nodeId: '',
engChgLevel: null, engChgLevel: null,
routingRevision: null,
active: '', active: '',
createBy: '', createBy: '',
routingFlag: 'N',
bomFlag: 'N',
routingFlag: 'Y',
bomFlag: 'Y',
page: 1, page: 1,
limit: 10 limit: 10
}, },
@ -4817,8 +4833,8 @@ export default {
}, },
bomInfoRowDblClick1(row){ bomInfoRowDblClick1(row){
// this.copyData.previousVersion.engChgLevel = row.engChgLevel
this.$set(this.copyData.previousVersion, 'engChgLevel', row.engChgLevel) this.$set(this.copyData.previousVersion, 'engChgLevel', row.engChgLevel)
this.$set(this.copyData.previousVersion, 'bomType', row.bomType)
}, },
routingInfoRowDblClick(row){ routingInfoRowDblClick(row){
@ -4844,6 +4860,7 @@ export default {
routingInfoRowDblClick1(row){ routingInfoRowDblClick1(row){
this.copyData.previousVersion.routingRevision = row.routingRevision this.copyData.previousVersion.routingRevision = row.routingRevision
this.copyData.previousVersion.routingType = row.routingType
}, },
routingInfoRowClick(row) { routingInfoRowClick(row) {
@ -5037,6 +5054,10 @@ export default {
this.copyData.partNo = this.partCurrentRow.partNo this.copyData.partNo = this.partCurrentRow.partNo
this.copyData.partDesc = this.partCurrentRow.partDesc this.copyData.partDesc = this.partCurrentRow.partDesc
this.copyData.buNo = this.partCurrentRow.buNo this.copyData.buNo = this.partCurrentRow.buNo
this.copyData.bomType = 'Manufacturing'
this.copyData.routingType = 'Manufacturing'
this.copyData.effPhaseInDate = new Date()
this.copyData.effPhaseOutDate = new Date()
this.copyVisible = true this.copyVisible = true
}, },
@ -5089,6 +5110,14 @@ export default {
this.$message.warning('请先选择要复制的料号!') this.$message.warning('请先选择要复制的料号!')
return return
} }
if (this.copyData.bomFlag&&this.copyData.bomFlag==='Y'&&!this.copyData.previousVersion.engChgLevel) {
this.$message.warning('请选择要复制的BOM版本!')
return
}
if (this.copyData.routingFlag&&this.copyData.routingFlag==='Y'&&!this.copyData.previousVersion.routingRevision) {
this.$message.warning('请选择要复制的routing版本!')
return
}
let flag = true let flag = true
if (!this.copyData.partNo||this.copyData.partNo==='') { if (!this.copyData.partNo||this.copyData.partNo==='') {
// //
@ -5129,9 +5158,6 @@ export default {
}) })
} }
if (this.copyData.bomFlag&&this.copyData.bomFlag==='Y') { if (this.copyData.bomFlag&&this.copyData.bomFlag==='Y') {
this.copyData.previousVersion.noteText = this.bomCurrentRow1.noteText
this.copyData.previousVersion.engChgLevel = this.bomCurrentRow1.engChgLevel
this.copyData.previousVersion.bomType = this.bomCurrentRow1.bomType
await copyBom(this.copyData).then(({data}) => { await copyBom(this.copyData).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
this.$message({ this.$message({
@ -5151,9 +5177,6 @@ export default {
}) })
} }
if (this.copyData.routingFlag&&this.copyData.routingFlag==='Y') { if (this.copyData.routingFlag&&this.copyData.routingFlag==='Y') {
this.copyData.previousVersion.noteText = this.routingCurrentRow1.noteText
this.copyData.previousVersion.routingRevision = this.routingCurrentRow1.routingRevision
this.copyData.previousVersion.routingType = this.routingCurrentRow1.routingType
this.copyData.phaseInDate = this.copyData.effPhaseInDate this.copyData.phaseInDate = this.copyData.effPhaseInDate
this.copyData.phaseOutDate = this.copyData.effPhaseOutDate this.copyData.phaseOutDate = this.copyData.effPhaseOutDate
await copyRouting(this.copyData).then(({data}) => { await copyRouting(this.copyData).then(({data}) => {

Loading…
Cancel
Save