Browse Source

2025-06-27

Copy part功能(Inventory Part编辑中的Copy Part功能)
    1、Copy后根据原料号的项目+BU
    2、Copy后的料号插入到项目料号中(如果没有项目则不处理
master
fengyuan_yang 7 months ago
parent
commit
bafb00b8e6
  1. 61
      src/views/modules/part/partInformation.vue
  2. 2
      src/views/modules/project/projectInfo/com_project_info_part.vue

61
src/views/modules/part/partInformation.vue

@ -1201,14 +1201,14 @@
</el-dialog> </el-dialog>
<!-- copyPart --> <!-- copyPart -->
<el-dialog title="Copy Part" :close-on-click-modal="false" v-drag :visible.sync="copyPartModelFlag" width="480px">
<fieldset style="width: 456px">
<el-dialog title="Copy Part" :close-on-click-modal="false" v-drag :visible.sync="copyPartModelFlag" width="800px">
<fieldset style="width: 775px">
<legend>Part No To Copy</legend> <legend>Part No To Copy</legend>
<el-form v-if="modalData.flag === '3'" :inline="true" label-position="top" style="margin-left: 7px"> <el-form v-if="modalData.flag === '3'" :inline="true" label-position="top" style="margin-left: 7px">
<el-form-item> <el-form-item>
<span style="cursor: pointer" slot="label" @click="queryPartModal"><a>From Part</a></span> <span style="cursor: pointer" slot="label" @click="queryPartModal"><a>From Part</a></span>
<el-input v-model="copyPartData.fromPartNo" readonly style="width: 135px"></el-input>
<el-input v-model="copyPartData.fromPartDesc" readonly style="width: 200px"></el-input>
<el-input v-model="copyPartData.fromPartNo" readonly style="width: 120px"></el-input>
<el-input v-model="copyPartData.fromPartDesc" readonly style="width: 300px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="From Site"> <el-form-item label="From Site">
<el-input v-model="copyPartData.fromPartSite" readonly style="width: 60px"></el-input> <el-input v-model="copyPartData.fromPartSite" readonly style="width: 60px"></el-input>
@ -1216,8 +1216,8 @@
</el-form> </el-form>
<el-form v-else :inline="true" label-position="top" style="margin-left: 7px"> <el-form v-else :inline="true" label-position="top" style="margin-left: 7px">
<el-form-item label="From Part"> <el-form-item label="From Part">
<el-input v-model="copyPartData.fromPartNo" readonly style="width: 135px"></el-input>
<el-input v-model="copyPartData.fromPartDesc" readonly style="width: 200px"></el-input>
<el-input v-model="copyPartData.fromPartNo" readonly style="width: 120px"></el-input>
<el-input v-model="copyPartData.fromPartDesc" readonly style="width: 300px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="From Site"> <el-form-item label="From Site">
<el-input v-model="copyPartData.fromPartSite" readonly style="width: 60px"></el-input> <el-input v-model="copyPartData.fromPartSite" readonly style="width: 60px"></el-input>
@ -1229,15 +1229,22 @@
<span>To Part</span> <span>To Part</span>
<el-button style="margin-left: 2px;width: 83px;line-height: 0.5;font-size: 10px;" type="primary" @click="nextPartNo2">Next Part No</el-button> <el-button style="margin-left: 2px;width: 83px;line-height: 0.5;font-size: 10px;" type="primary" @click="nextPartNo2">Next Part No</el-button>
</template> </template>
<el-input v-model="copyPartData.partNo" style="width: 135px"></el-input>
<el-input v-model="copyPartData.partDesc" style="width: 200px"></el-input>
<el-input v-model="copyPartData.partNo" :disabled="modalData.flag === '2'" style="width: 120px"></el-input>
<el-input v-model="copyPartData.partDesc" style="width: 300px"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="To Site"> <el-form-item label="To Site">
<el-input v-model="copyPartData.site" :readonly="modalData.flag === '3'" style="width: 60px"></el-input> <el-input v-model="copyPartData.site" :readonly="modalData.flag === '3'" style="width: 60px"></el-input>
</el-form-item> </el-form-item>
<!-- <el-form-item v-if="modalData.flag === '2'">-->
<!-- <span slot="label" @click="getBaseList(106,1)"><a herf="#">BU</a></span>-->
<!-- <el-input v-model="copyPartData.buDesc" readonly style="width: 80px"></el-input>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="客户料号" v-if="modalData.flag === '2'">-->
<!-- <el-input v-model="copyPartData.customerPartNo" clearable style="width: 120px"></el-input>-->
<!-- </el-form-item>-->
</el-form> </el-form>
</fieldset> </fieldset>
<fieldset style="width: 456px">
<fieldset style="width: 775px">
<legend>Select Part Information to Copy</legend> <legend>Select Part Information to Copy</legend>
<el-form :inline="true"> <el-form :inline="true">
<el-form-item label=" "> <el-form-item label=" ">
@ -1305,7 +1312,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</fieldset> </fieldset>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-footer style="height:35px;margin-top: 20px;text-align:center">
<el-button type="primary" :loading="copyLoading" @click="copyPart">保存</el-button> <el-button type="primary" :loading="copyLoading" @click="copyPart">保存</el-button>
<el-button type="primary" @click="copyPartModelFlag = false">关闭</el-button> <el-button type="primary" @click="copyPartModelFlag = false">关闭</el-button>
</el-footer> </el-footer>
@ -1740,7 +1747,10 @@
fromPartSite: '', fromPartSite: '',
fromPartNo: '', fromPartNo: '',
fromPartDesc: '', fromPartDesc: '',
copyFlag: ''
copyFlag: '',
buNo: '',
buDesc: '',
customerPartNo: '',
}, },
fromPartData: { fromPartData: {
site: this.$store.state.user.site, site: this.$store.state.user.site,
@ -4980,7 +4990,19 @@
fromPartSite: this.modalData.site, fromPartSite: this.modalData.site,
fromPartNo: '', fromPartNo: '',
fromPartDesc: '', fromPartDesc: '',
copyFlag: ''
copyFlag: '',
buNo: '',
buDesc: '',
customerPartNo: '',
}
if (this.modalData.flag === '2') {
getProjectPartNo(this.searchData).then(({data}) => {
if (data && data.code === 0) {
this.copyPartData.partNo = data.partNo
} else {
this.copyPartData.partNo = ''
}
})
} }
if (this.modalData.flag !== '3') { if (this.modalData.flag !== '3') {
this.copyPartData.fromPartNo = this.modalData.partNo this.copyPartData.fromPartNo = this.modalData.partNo
@ -5014,6 +5036,16 @@
if (this.modalData.flag === '3') { // copyPart if (this.modalData.flag === '3') { // copyPart
this.copyPartData.copyFlag = 'Y' this.copyPartData.copyFlag = 'Y'
} }
// if (this.modalData.flag === '2') {
// if (this.copyPartData.buNo === '' || this.copyPartData.buNo == null) {
// this.$message.warning('BU')
// return
// }
// if (this.copyPartData.customerPartNo === '' || this.copyPartData.customerPartNo == null) {
// this.$message.warning('')
// return
// }
// }
this.copyLoading = true this.copyLoading = true
copyPart(this.copyPartData).then(({data}) => { copyPart(this.copyPartData).then(({data}) => {
if (data && data.code === 0) { if (data && data.code === 0) {
@ -5651,6 +5683,8 @@
strVal = this.modalData.partCostGroupId strVal = this.modalData.partCostGroupId
} else if (val === 132) { } else if (val === 132) {
strVal = this.modalData.planningMethod strVal = this.modalData.planningMethod
} else if (val === 106) {
strVal = this.copyPartData.buNo
} }
this.$refs.baseList.init(val, strVal) this.$refs.baseList.init(val, strVal)
}) })
@ -5713,6 +5747,9 @@
} else if (this.tagNo === 132) { } else if (this.tagNo === 132) {
this.modalData.planningMethod = val.planning_method this.modalData.planningMethod = val.planning_method
this.modalData.planningMethodDesc = val.planning_method_desc this.modalData.planningMethodDesc = val.planning_method_desc
} else if (this.tagNo === 106) {
this.copyPartData.buNo = val.Bu_no
this.copyPartData.buDesc = val.Bu_desc
} }
}, },

2
src/views/modules/project/projectInfo/com_project_info_part.vue

@ -1861,7 +1861,7 @@ import {
if (val === 1007) { if (val === 1007) {
strVal = this.modalData.umId strVal = this.modalData.umId
} else if (val === 106) { } else if (val === 106) {
strVal = this.modalData.buNo;
strVal = this.modalData.buNo
} else if (val === 108) { } else if (val === 108) {
strVal = this.modalData.familyId strVal = this.modalData.familyId
} else if (val === 109) { } else if (val === 109) {

Loading…
Cancel
Save