From 9af27be8cc1e387cee078e5f3e988c6fb076dd4f Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Mon, 24 Mar 2025 15:56:46 +0800 Subject: [PATCH] 2025-03-24 copy part --- src/api/part/bomSearch3.js | 66 +- src/views/modules/part/agentInformation.vue | 1 - src/views/modules/part/bomSearch3.vue | 120 +- src/views/modules/part/copy_bom_modal.vue | 2324 +++++++++++++++++++ 4 files changed, 2441 insertions(+), 70 deletions(-) create mode 100644 src/views/modules/part/copy_bom_modal.vue diff --git a/src/api/part/bomSearch3.js b/src/api/part/bomSearch3.js index 966626e..afd81a9 100644 --- a/src/api/part/bomSearch3.js +++ b/src/api/part/bomSearch3.js @@ -1,26 +1,62 @@ import { createAPI } from "@/utils/httpRequest.js"; -/** - * bom列表查询 - * @param data - * @returns {*} - */ +// bom列表查询 export const bomSearchHeader = data => createAPI(`/part/bomSearch3/bomSearchHeader`,'post',data) -/** - * 查询bom替代树形 - * @param data - * @returns {*} - */ +// 查询bom替代树形 export const getAlternativeTree = data => createAPI(`/part/bomSearch3/getAlternativeTree`,'post',data) -/** - * 查询子物料 - * @param data - * @returns {*} - */ +// 查询子物料 export const getComponentPartList = data => createAPI(`/part/bomSearch3/getComponentPartList`,'post',data) +// 新增数据到临时表 +export const saveCopyBomInfo = data => createAPI(`/part/bomSearch3/saveCopyBomInfo`,'post',data) + +// 查询树形 +export const queryCopyTempBomTree = data => createAPI(`/part/bomSearch3/queryCopyTempBomTree`,'post',data) + +// 查BOM +export const queryCopyTempBom = data => createAPI(`/part/bomSearch3/queryCopyTempBom`,'post',data) + +// 查Routing +export const queryCopyTempRouting = data => createAPI(`/part/bomSearch3/queryCopyTempRouting`,'post',data) + +export const queryCopyTempRoutingVersion = data => createAPI(`/part/bomSearch3/queryCopyTempRoutingVersion`,'post',data) + +export const queryCopyTempRoutingAlternative = data => createAPI(`/part/bomSearch3/queryCopyTempRoutingAlternative`,'post',data) + +export const changeCopyTempRoutingChange = data => createAPI(`/part/bomSearch3/changeCopyTempRoutingChange`,'post',data) + +export const queryCopyTempBomTreeLevel = data => createAPI(`/part/bomSearch3/queryCopyTempBomTreeLevel`,'post',data) + +export const handleQueryCopyTempBomAlternative = data => createAPI(`/part/bomSearch3/handleQueryCopyTempBomAlternative`,'post',data) + +export const changeCopyTempBomTree = data => createAPI(`/part/bomSearch3/changeCopyTempBomTree`,'post',data) + +export const changePart = data => createAPI(`/part/bomSearch3/changePart`,'post',data) + +export const getTempComponentLineSequence = data => createAPI(`/part/bomSearch3/getTempComponentLineSequence`,'post',data) + +export const saveTempBomComponent = data => createAPI(`/part/bomSearch3/saveTempBomComponent`,'post',data) + +export const updateTempBomComponent = data => createAPI(`/part/bomSearch3/updateTempBomComponent`,'post',data) + +export const deleteTempBomComponent = data => createAPI(`/part/bomSearch3/deleteTempBomComponent`,'post',data) + +export const queryTempMaxOperationNo = data => createAPI(`/part/bomSearch3/queryTempMaxOperationNo`,'post',data) + +export const saveTempRoutingComponent = data => createAPI(`/part/bomSearch3/saveTempRoutingComponent`,'post',data) + +export const updateTempRoutingComponent = data => createAPI(`/part/bomSearch3/updateTempRoutingComponent`,'post',data) + +export const deleteTempRoutingComponent = data => createAPI(`/part/bomSearch3/deleteTempRoutingComponent`,'post',data) + +export const queryCopyTempItemValue = data => createAPI(`/part/bomSearch3/queryCopyTempItemValue`,'post',data) + +export const commitTempItemValue = data => createAPI(`/part/bomSearch3/commitTempItemValue`,'post',data) + +export const saveCopyResult = data => createAPI(`/part/bomSearch3/saveCopyResult`,'post',data) + diff --git a/src/views/modules/part/agentInformation.vue b/src/views/modules/part/agentInformation.vue index 7abd165..49962b7 100644 --- a/src/views/modules/part/agentInformation.vue +++ b/src/views/modules/part/agentInformation.vue @@ -585,7 +585,6 @@ export default { }) } }) - }).catch(() => { }) }, diff --git a/src/views/modules/part/bomSearch3.vue b/src/views/modules/part/bomSearch3.vue index fb230c9..97eb685 100644 --- a/src/views/modules/part/bomSearch3.vue +++ b/src/views/modules/part/bomSearch3.vue @@ -28,7 +28,7 @@ - 查询 + 查询 + + + @@ -129,6 +140,8 @@ + + @@ -137,16 +150,17 @@ import { bomSearchHeader, // bom列表查询 getAlternativeTree, // 查询bom替代树形 getComponentPartList, // 查询子物料 + saveCopyBomInfo, // 新增数据到临时表 } from '@/api/part/bomSearch3.js' import {getSiteAndBuByUserName2} from "@/api/qc/qc.js" import ChooseList from '@/views/modules/common/Chooselist_eam' -import dayjs from "dayjs"; +import copyBomModal from "./copy_bom_modal.vue" export default { - // 组件 components: { + copyBomModal, ChooseList }, - // 监听 + watch: { searchData: { deep: true, @@ -155,7 +169,7 @@ export default { } } }, - // 对象 + data () { return { // 导出 @@ -698,23 +712,19 @@ export default { this.getDataList() } }, - // js + methods: { + // ======== 分页相关方法 ======== - /** - * 每页数 - * @param val - */ + + // 每页数 sizeChangeHandle (val) { this.pageSize = val this.pageIndex = 1 this.getDataList() }, - /** - * 当前页 - * @param val - */ + // 当前页 currentChangeHandle (val) { this.pageIndex = val this.getDataList() @@ -733,9 +743,8 @@ export default { }, // ======== 列表数据操作方法 ======== - /** - * 获取数据列表 - */ + + // 获取数据列表 getDataList () { this.searchData.limit = this.pageSize this.searchData.page = this.pageIndex @@ -761,20 +770,13 @@ export default { }) }, - /** - * 单机选中信息 - * @param row - */ + // 单机选中信息 headerClickRow (row) { this.$refs.bomHeaderTable.toggleRowSelection(row) this.headerCurrentRow = JSON.parse(JSON.stringify(row)) }, - /** - * 树节点单机事件 - * @param e - * @param node - */ + // 树节点单机事件 handleNodeClick (e) { // 查询替代子物料 getComponentPartList(e).then(({data}) => { @@ -785,22 +787,39 @@ export default { } }) }, + + // copyBom + copyBomModal (row) { + this.queryLoading = true + row.createBy = this.$store.state.user.name + // 新增数据到临时表 + saveCopyBomInfo(row).then(({data}) => { + if (data && data.code === 0) { + this.$nextTick(() => { + this.$refs.copyBomModal.init(row) + }) + this.queryLoading = false + } else { + this.queryLoading = false + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }).catch(() => { + this.queryLoading = false + }) + + }, + // ======== 页签切换相关方法 ======== - /** - * 列表表格选择替换 - * @param tab - * @param event - */ + + // 列表表格选择替换 tabClick (tab, event) { // 刷新列表数据 this.refreshCurrentTabTable() }, - /** - * 当前值发生变化的时候修改 - * @param row - * @param oldRow - */ + // 当前值发生变化的时候修改 changeCurrentRow (row, oldRow) { // 判断是否是获取焦点的事件 if (row) { @@ -811,9 +830,7 @@ export default { } }, - /** - * 刷新页签的table数据 - */ + // 刷新页签的table数据 refreshCurrentTabTable () { if (this.activeTable === 'GraphicalStructure') { // 获取bom替代树形 @@ -821,9 +838,7 @@ export default { } }, - /** - * 获取bom替代树形 - */ + // 获取bom替代树形 getAlternativeTree () { getAlternativeTree(this.headerCurrentRow).then(({data}) => { if (data && data.code === 0) { @@ -841,11 +856,8 @@ export default { }, // ======== chooseList相关方法 ======== - /** - * 获取基础数据列表S - * @param val - * @param type - */ + + // 获取基础数据列表S getBaseList (val, type) { this.tagNo = val this.$nextTick(() => { @@ -856,10 +868,8 @@ export default { this.$refs.baseList.init(val, strVal) }) }, - /** - * 列表方法的回调 - * @param val - */ + + // 列表方法的回调 getBaseData (val) { if (this.tagNo === 117) { this.componentData.issueToLoc = val.location_id @@ -875,9 +885,8 @@ export default { }, // ======== 导出相关方法 ======== - /** - * 导出excel - */ + + // 导出excel async createExportData () { this.searchData.limit = -1 this.searchData.page = 1 @@ -886,8 +895,11 @@ export default { }) return this.resultList }, + startDownload () {}, + finishDownload () {}, + fields () { let json = '{' this.columnList.forEach((item, index) => { diff --git a/src/views/modules/part/copy_bom_modal.vue b/src/views/modules/part/copy_bom_modal.vue new file mode 100644 index 0000000..1a22426 --- /dev/null +++ b/src/views/modules/part/copy_bom_modal.vue @@ -0,0 +1,2324 @@ + + + + +