diff --git a/src/api/part/partInformation.js b/src/api/part/partInformation.js index dc3e26e..1a87c67 100644 --- a/src/api/part/partInformation.js +++ b/src/api/part/partInformation.js @@ -290,4 +290,12 @@ export const getNextPartNo = data => createAPI(`/plm/partInformation/getNextPart export const queryPart = (data) => createAPI(`/plm/partInformation`,'post',data); +// 导入项目物料 +export const uploadProjectPartExcel = data => createAPI(`/plm/partInformation/uploadProjectPartExcel`,'post',data) + +// 查询文件ID +export const queryFileId = data => createAPI(`/plm/partInformation/queryFileId`,'post',data) + +// 下载文件 +export const downLoadFile = data => createAPI(`/plm/partInformation/downLoadFile?id=`+data.id,'post','download') diff --git a/src/views/modules/part/partInformation.vue b/src/views/modules/part/partInformation.vue index ab541eb..c033399 100644 --- a/src/views/modules/part/partInformation.vue +++ b/src/views/modules/part/partInformation.vue @@ -1164,7 +1164,7 @@ - +
@@ -1179,7 +1179,7 @@
- + 可选库位: + + + -
+
添加>>
-
+
删除<<
- + 已有库位: { if (data && data.code === 0) { @@ -3561,6 +3577,24 @@ this.getDataList() }, + /** + * 每页数 + * @param val + */ + locationSizeChangeHandle (val) { + this.locationPageSize = val + this.locationPageIndex = 1 + this.getLocationList() + }, + /** + * 当前页 + * @param val + */ + locationCurrentChangeHandle (val) { + this.locationPageIndex = val + this.getLocationList() + }, + // ======== 页签切换相关方法 ======== /** * 未知 @@ -4259,14 +4293,17 @@ * 选择默认库位 */ getLocationList () { - // 查询所有库位 + this.locationData.limit = this.locationPageSize + this.locationData.page = this.locationPageIndex + this.locationData.partNo = this.partCurrentRow.partNo getLocationListBy(this.locationData).then(({data}) => { if (data && data.code === 0) { - this.locationList1 = data.rows + this.locationList1 = data.page.list + this.locationPageIndex = data.page.currPage + this.locationPageSize = data.page.pageSize + this.locationTotalPage = data.page.totalCount } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) + this.locationList1 = [] } }) }, @@ -4417,14 +4454,23 @@ saveDefaultLocation () { this.locationSelections1 = null this.locationSelections2 = null - getLocationList(this.partCurrentRow).then(({data}) => { - this.locationList1 = data.row1 + this.locationData.limit = this.locationPageSize + this.locationData.page = this.locationPageIndex + this.locationData.partNo = this.partCurrentRow.partNo + getLocationList(this.locationData).then(({data}) => { + this.locationList1 = data.row1.list this.locationList2 = data.row2 + this.locationPageIndex = data.row1.currPage + this.locationPageSize = data.row1.pageSize + this.locationTotalPage = data.row1.totalCount }) this.locationData = { site: this.$store.state.user.site, locationId: '', locationName: '', + partNo: this.partCurrentRow.partNo, + page: 1, + limit: 10 } this.locationModelFlag = true }, @@ -4455,9 +4501,12 @@ } addDefaultLocation(inData).then(({data}) => { if (data && data.code === 0) { - getLocationList(this.partCurrentRow).then(({data}) => { - this.locationList1 = data.row1 + getLocationList(this.locationData).then(({data}) => { + this.locationList1 = data.row1.list this.locationList2 = data.row2 + this.locationPageIndex = data.row1.currPage + this.locationPageSize = data.row1.pageSize + this.locationTotalPage = data.row1.totalCount }) this.locationSelections1 = [] } else { @@ -4480,9 +4529,12 @@ } deleteDefaultLocation(inData).then(({data}) => { if (data && data.code === 0) { - getLocationList(this.partCurrentRow).then(({data}) => { - this.locationList1 = data.row1 + getLocationList(this.locationData).then(({data}) => { + this.locationList1 = data.row1.list this.locationList2 = data.row2 + this.locationPageIndex = data.row1.currPage + this.locationPageSize = data.row1.pageSize + this.locationTotalPage = data.row1.totalCount }) this.locationSelections2 = [] } else { diff --git a/src/views/modules/project/projectInfo/com_project_info_part.vue b/src/views/modules/project/projectInfo/com_project_info_part.vue index 8ca8fe8..ad061d3 100644 --- a/src/views/modules/project/projectInfo/com_project_info_part.vue +++ b/src/views/modules/project/projectInfo/com_project_info_part.vue @@ -4,6 +4,7 @@ 新增 料号导入 + Excel导入 {{ '导出' }} - @@ -576,7 +576,7 @@ - 保存 + 保存 关闭 @@ -716,7 +716,10 @@ - + + + +
@@ -751,11 +754,14 @@ } from '@/api/part/partInformation.js' import {verifyData} from "@/api/chooselist/chooselist.js" import Chooselist from '@/views/modules/common/Chooselist' - import DictDataSelect from "../../sys/dict-data-select.vue"; + import DictDataSelect from "../../sys/dict-data-select.vue" + import ProjectPartUpload from "./project_part_upload.vue"; + export default { components: { + ProjectPartUpload, DictDataSelect, - Chooselist + Chooselist, }, watch: { modalData: { @@ -791,9 +797,9 @@ projectId: '', customerId: '' }, - visible:false, + visible: false, dataListLoading: false, - currentRow:'', + currentRow: '', columnList:[ { userId: this.$store.state.user.name, @@ -2686,14 +2692,14 @@ this.$message.warning('请选择生效日期(Phase In)!') return } - if (this.revisionData.flag === '2' && (this.revisionData.effPhaseOutDate === '' || this.revisionData.effPhaseOutDate == null)) { - this.$message.warning('请选择失效日期(Phase Out)!') - return - } - if (this.revisionData.flag === '2' && (this.revisionData.effPhaseOutDate < this.revisionData.effPhaseInDate)) { - this.$message.warning('失效日期不能早于生效日期!') - return - } + // if (this.revisionData.flag === '2' && (this.revisionData.effPhaseOutDate === '' || this.revisionData.effPhaseOutDate == null)) { + // this.$message.warning('请选择失效日期(Phase Out)!') + // return + // } + // if (this.revisionData.flag === '2' && (this.revisionData.effPhaseOutDate < this.revisionData.effPhaseInDate)) { + // this.$message.warning('失效日期不能早于生效日期!') + // return + // } if (this.revisionData.flag === '1') { saveRevision(this.revisionData).then(({data}) => { if (data && data.code === 0) { @@ -3102,13 +3108,28 @@ this.modalData.durabilityWeek = this.modalData.durabilityDay / 7 }, - toPartMenu(partNo){ - if (this.$router.resolve(`/part-partInformation`).resolved.name === '404'){ - this.$alert('权限不足,访问失败', '警告', {confirmButtonText: '确定',}); - }else { + toPartMenu (partNo) { + if (this.$router.resolve(`/part-partInformation`).resolved.name === '404') { + this.$alert('权限不足,访问失败', '警告', {confirmButtonText: '确定',}) + } else { this.$router.push({name:`part-partInformation`,params:{partNo:partNo},}) } - } + }, + + // 导入 + projectPartUpload () { + let currentData = { + createBy: this.$store.state.user.name, + site: this.searchData.site, + projectId: this.searchData.projectId, + customerNo: this.searchData.customerId, + } + //打开组件 去做新增业务 + this.$nextTick(() => { + this.$refs.projectPartUpload.init(currentData) + }) + }, + }, } diff --git a/src/views/modules/project/projectInfo/project_part_upload.vue b/src/views/modules/project/projectInfo/project_part_upload.vue new file mode 100644 index 0000000..c113412 --- /dev/null +++ b/src/views/modules/project/projectInfo/project_part_upload.vue @@ -0,0 +1,150 @@ + + + +