diff --git a/src/api/part/partInformation.js b/src/api/part/partInformation.js index ed87515..383b332 100644 --- a/src/api/part/partInformation.js +++ b/src/api/part/partInformation.js @@ -199,3 +199,5 @@ export const handleQueryPart = (data) => createAPI('/part/partInformation','post export const handleQueryPartByPage = (data) => createAPI(`/part/partInformation/${data.no}/${data.size}`,'post',data) +export const getPreviousPartNo = data => createAPI(`/part/partInformation/getPreviousPartNo`,'post',data) + diff --git a/src/views/modules/part/partInformation.vue b/src/views/modules/part/partInformation.vue index 22bb688..ff2d1c0 100644 --- a/src/views/modules/part/partInformation.vue +++ b/src/views/modules/part/partInformation.vue @@ -139,7 +139,7 @@ - + - + - + @@ -164,6 +164,9 @@ Copy + + 复制属性({{previousPartNo}}) + @@ -988,6 +991,7 @@ copyPart, // 复制物料 getProjectPartNo, // 获取物料编码 verifyData, // 校验参数 + getPreviousPartNo, // 获取上一个物料编码 } from '@/api/part/partInformation.js' import {getFileContentList, downLoadObjectFile} from '@/api/eam/eam_object_list.js' import {deleteObjectFile} from '@/api/eam/eam.js' @@ -1105,7 +1109,8 @@ partDesceEn: '', remark: '', codeNo: '', - codeDesc: '' + codeDesc: '', + tblBaseFlag: '' }, itemData: { site: this.$store.state.user.site, @@ -2224,6 +2229,7 @@ attributeDialog: true, uploadDialog: false, menuId: this.$route.meta.menuId, + previousPartNo: '' } }, @@ -2676,19 +2682,34 @@ partDesceEn: '', remark: '', codeNo: '', - codeDesc: '' + codeDesc: '', + tblBaseFlag: '', + createBy: this.$store.state.user.name } this.inventoryPartTable = 'General' this.modalDisableFlag = false this.modalFlag = true - // getProjectPartNo(this.searchData).then(({data}) => { - // if (data && data.code === 0) { - // - // } else { - // this.$message.error(data.msg) - // } - // }) + this.getPreviousPartNo() }, + + // 获取上一个物料编码 + getPreviousPartNo () { + let tempData = { + site: this.modalData.bu.split('_')[0], + type: 'thePreviousPartItem', + thirdType: this.modalData.bu.split('_')[1], + secondType: this.$store.state.user.name + } + getPreviousPartNo(tempData).then(({data}) => { + if (data && data.code === 0) { + this.previousPartNo = data.previousPartNo + } else { + this.previousPartNo = '' + } + }) + }, + + /** * 物料信息编辑模态框 * @param row @@ -2719,7 +2740,9 @@ partDesceEn: row.partDesceEn, remark: row.remark, codeNo: row.codeNo, - codeDesc: row.codeDesc + codeDesc: row.codeDesc, + tblBaseFlag: '', + createBy: '' } this.inventoryPartTable = 'General' this.modalDisableFlag = true @@ -3141,6 +3164,10 @@ this.$message.warning('请选择计量单位!') return } + if (this.modalData.tblBaseFlag === 'Y' && this.modalData.codeNo === '') { + this.$message.warning('请选择属性模板!') + return + } if (this.modalData.flag === '1') { partInformationSave(this.modalData).then(({data}) => { if (data && data.code === 0) {