From d3caac349d587580b5f4b7aee7deb99f21509e7c Mon Sep 17 00:00:00 2001
From: fengyuan_yang <1976974459@qq.com>
Date: Mon, 9 Sep 2024 11:03:28 +0800
Subject: [PATCH] =?UTF-8?q?2024-09-09=20=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/api/part/bomManagement.js | 7 +
src/api/part/routingManagement.js | 7 +
src/views/modules/common/Chooselist.vue | 27 +-
src/views/modules/part/bomManagement.vue | 429 +++++++++++++--
src/views/modules/part/partInformation.vue | 58 +-
src/views/modules/part/routingManagement.vue | 499 ++++++++++++++++--
src/views/modules/tooling/searchToolApply.vue | 14 +-
7 files changed, 894 insertions(+), 147 deletions(-)
diff --git a/src/api/part/bomManagement.js b/src/api/part/bomManagement.js
index 5deb760..e072028 100644
--- a/src/api/part/bomManagement.js
+++ b/src/api/part/bomManagement.js
@@ -189,4 +189,11 @@ export const queryManufStructCostDistribtionTable = data => createAPI(`/plm/bomM
*/
export const queryMultiLevelStructureTable = data => createAPI(`/plm/bomManagement/queryMultiLevelStructureTable`,'post',data)
+/**
+ * 查出可创建BOM的物料
+ * @param data
+ * @returns {*}
+ */
+export const queryPartListBom = data => createAPI(`/plm/bomManagement/queryPartListBom`,'post',data)
+
diff --git a/src/api/part/routingManagement.js b/src/api/part/routingManagement.js
index 1d9182d..81c20a0 100644
--- a/src/api/part/routingManagement.js
+++ b/src/api/part/routingManagement.js
@@ -196,3 +196,10 @@ export const toBecomeOfficialRouting = data => createAPI(`/plm/routingManagement
* @returns {*}
*/
export const queryMaxOperationNo = data => createAPI(`/plm/routingManagement/queryMaxOperationNo`,'post',data)
+
+/**
+ * 查出可创建Routing的物料
+ * @param data
+ * @returns {*}
+ */
+export const queryPartListRouting = data => createAPI(`/plm/routingManagement/queryPartListRouting`,'post',data)
diff --git a/src/views/modules/common/Chooselist.vue b/src/views/modules/common/Chooselist.vue
index 5e9286a..afe9888 100644
--- a/src/views/modules/common/Chooselist.vue
+++ b/src/views/modules/common/Chooselist.vue
@@ -1,30 +1,22 @@
-
-
+
+
-
-
-
-
-
+
+
+
+
查询
@@ -191,11 +183,6 @@ export default {
if (this.param2) {
sql += " and a." + this.baseListData.fieldname2 + " like '%" + this.param2 + "%'"
}
- if (this.tagNo < 1000 && this.tagNo !== 93){
- if (this.param4) {
- sql += " and site = " + this.param4
- }
- }
} else {
if (bool) {
sql += " and (" + this.baseListData.fieldname1 + " like '%" + this.param + "%' OR "+this.baseListData.fieldname2 + " like '%" + this.param + "%'" +" ) "
@@ -209,7 +196,7 @@ export default {
if (this.param3) {
sql += " and active like '%" + this.param3 + "%'"
}
- if (this.tagNo <1000 && this.tagNo !== 93){
+ if (this.tagNo <1000 && this.tagNo !== 93) {
if (this.param4) {
sql += " and site=" + "'" + this.param4 + "'"
}
diff --git a/src/views/modules/part/bomManagement.vue b/src/views/modules/part/bomManagement.vue
index 0af4aa4..17dd6cf 100644
--- a/src/views/modules/part/bomManagement.vue
+++ b/src/views/modules/part/bomManagement.vue
@@ -9,9 +9,14 @@
-
+
+
+
+
+
+
-
+
@@ -168,7 +173,7 @@
Copy
Build
Retire
- 转正式BOM
+ 转正式BOM
@@ -423,6 +428,16 @@
+
+
+
关闭
@@ -470,6 +485,16 @@
+
+
+
关闭
@@ -519,9 +544,10 @@
-
+
+
@@ -630,15 +656,18 @@
-
+
-
-
+
+
-
-
+
+
+
+
+
@@ -677,19 +706,23 @@
- 保存
+ 保存
关闭
+
+
+
+
+
+
+
+
+
+
+ 查询
+
+
+
+
+
+ {{scope.row[item.columnProp]}}
+
+
+
+
+
+
+
+
+ 关闭
+
+
+
@@ -813,10 +903,9 @@ import {
queryBomByProductTable, // 刷新副产品
queryManufStructCostDistribtionTable, // 刷新项目成本分配
queryMultiLevelStructureTable, // 刷新多级别结构
+ queryPartListBom, // 查出可创建BOM的物料
} from '@/api/part/bomManagement.js'
import ChooseList from '@/views/modules/common/Chooselist'
-import dayjs from "dayjs";
-import fa from "element-ui/src/locale/lang/fa";
export default {
// 组件
@@ -883,6 +972,15 @@ export default {
pageIndex: 1,
pageSize: 50,
totalPage: 0,
+ pageIndex2: 1,
+ pageSize2: 20,
+ totalPage2: 0,
+ pageIndex3: 1,
+ pageSize3: 20,
+ totalPage3: 0,
+ pageIndex4: 1,
+ pageSize4: 20,
+ totalPage4: 0,
selectedDataNum: 0,
// 条件查询
searchData: {
@@ -900,6 +998,7 @@ export default {
saveDetailLoading: false,
saveAllLoading: false,
toBecomeOfficialLoading: false,
+ copyLoading: false,
// 初始页签
detailTable: 'bom_detail',
subDetailTable: 'bom_sub_detail',
@@ -976,12 +1075,24 @@ export default {
site: this.$store.state.user.site,
partNo: '',
partDesc: '',
+ page: 1,
+ limit: 10
},
componentPartData: {
site: this.$store.state.user.site,
partNo: '',
partDesc: '',
- status: ''
+ status: '',
+ page: 1,
+ limit: 10
+ },
+ copyPartData: {
+ type: '',
+ site: this.$store.state.user.site,
+ partNo: '',
+ partDesc: '',
+ page: 1,
+ limit: 10
},
saveDetailData: {
flag: '',
@@ -1013,6 +1124,7 @@ export default {
copyBomData: {
site: '',
partNo: '',
+ partDesc: '',
engChgLevel: '',
bomType: '',
effPhaseInDate: '',
@@ -1024,6 +1136,7 @@ export default {
copyAlternativeData: {
site: '',
partNo: '',
+ partDesc: '',
engChgLevel: '',
bomType: '',
alternativeNo: '',
@@ -1055,6 +1168,7 @@ export default {
dataList: [],
partList: [],
componentPartList: [],
+ copyPartList: [],
componentPartSelections: [],
subDetailList: [],
byProductList: [],
@@ -1916,6 +2030,7 @@ export default {
columnImage: false,
status: true,
fixed: '',
+ columnWidth: 100
},
{
columnProp: 'alternativeDescription',
@@ -1926,6 +2041,7 @@ export default {
columnImage: false,
status: true,
fixed: '',
+ columnWidth: 200
},
{
columnProp: 'status',
@@ -1936,6 +2052,7 @@ export default {
columnImage: false,
status: true,
fixed: '',
+ columnWidth: 100
},
],
columnManufStructCostDistribList: [
@@ -2343,6 +2460,7 @@ export default {
modalDisableFlag: false,
partModelFlag: false,
componentPartModelFlag: false,
+ copyPartModelFlag: false,
saveDetailModalFlag :false,
saveDetailModalDisable: false,
componentSaveModal: false,
@@ -2416,6 +2534,63 @@ export default {
this.getDataList()
},
+ /**
+ * 每页数
+ * @param val
+ */
+ sizeChangeHandle2 (val) {
+ this.pageSize2 = val
+ this.pageIndex2 = 1
+ this.queryPartList()
+ },
+
+ /**
+ * 当前页
+ * @param val
+ */
+ currentChangeHandle2 (val) {
+ this.pageIndex2 = val
+ this.queryPartList()
+ },
+
+ /**
+ * 每页数
+ * @param val
+ */
+ sizeChangeHandle3 (val) {
+ this.pageSize3 = val
+ this.pageIndex3 = 1
+ this.queryComponentPartModal()
+ },
+
+ /**
+ * 当前页
+ * @param val
+ */
+ currentChangeHandle3 (val) {
+ this.pageIndex3 = val
+ this.queryComponentPartModal()
+ },
+
+ /**
+ * 每页数
+ * @param val
+ */
+ sizeChangeHandle4 (val) {
+ this.pageSize4 = val
+ this.pageIndex4 = 1
+ this.queryCopyPartModal()
+ },
+
+ /**
+ * 当前页
+ * @param val
+ */
+ currentChangeHandle4 (val) {
+ this.pageIndex4 = val
+ this.queryCopyPartModal()
+ },
+
// ======== 页签切换相关方法 ========
/**
* 明细页签选择替换
@@ -2611,6 +2786,8 @@ export default {
printUnit: row.printUnit,
printUnitName: row.printUnitName,
officialFlag: row.officialFlag,
+ alternativeNo: row.alternativeNo,
+ ifsPartNo: row.ifsPartNo
}
this.subDetailTable = 'bom_sub_detail'
// 查bom明细
@@ -2618,9 +2795,6 @@ export default {
if (data && data.code === 0) {
this.detailDataList = data.rows.detailList
this.subDetailList = data.rows.componentList
- this.byProductList = data.rows.byProductList
- this.manufStructCostDistribList = data.rows.manufStructCostDistribList
- this.multiLevelStructureList = data.rows.multiLevelStructureList
this.detailData = data.rows.detailData
this.modalDisableFlag = true
this.modalFlag = true
@@ -2751,7 +2925,7 @@ export default {
printUnitName: '',
qtyPerAssembly: 0,
componentScrap: 0,
- issueType: 'Reserve and Backflush',
+ issueType: 'Reserve And Backflush',
shrinkageFactor: 0,
lineItemNo: '',
operationId: '',
@@ -2802,7 +2976,7 @@ export default {
printUnitName: '',
qtyPerAssembly: 0,
componentScrap: 0,
- issueType: 'Reserve and Backflush',
+ issueType: 'Reserve And Backflush',
shrinkageFactor: 0,
lineItemNo: '',
operationId: '',
@@ -3141,9 +3315,14 @@ export default {
* 查询物料
*/
queryPartList () {
- queryPartList(this.partData).then(({data}) => {
+ this.partData.limit = this.pageSize2
+ this.partData.page = this.pageIndex2
+ queryPartListBom(this.partData).then(({data}) => {
if (data && data.code === 0) {
- this.partList = data.rows
+ this.partList = data.page.list
+ this.pageIndex2 = data.page.currPage
+ this.pageSize2 = data.page.pageSize
+ this.totalPage2 = data.page.totalCount
this.partModelFlag = true
} else {
this.$alert(data.msg, '错误', {
@@ -3155,13 +3334,15 @@ export default {
// 物料编码失焦事件
partNoBlur () {
+ this.partData.limit = this.pageSize2
+ this.partData.page = this.pageIndex2
this.partData.partNo = this.modalData.partNo
queryPartList(this.partData).then(({data}) => {
if (data && data.code === 0) {
- if (data.rows.length === 1) {
- this.modalData.partDesc = data.rows[0].partDesc
- this.modalData.printUnit = data.rows[0].printUnit
- this.modalData.printUnitName = data.rows[0].printUnitName
+ if (data.page.list.length === 1) {
+ this.modalData.partDesc = data.page.list[0].partDesc
+ this.modalData.printUnit = data.page.list[0].printUnit
+ this.modalData.printUnitName = data.page[0].printUnitName
} else {
this.modalData.partDesc = ''
this.modalData.printUnit = ''
@@ -3218,6 +3399,7 @@ export default {
this.operationModelFlag = false
},
+ // 双击选中子物料
getComponentRowData (row) {
this.componentData.componentPart = row.partNo
this.componentData.componentPartDesc = row.partDesc
@@ -3226,15 +3408,33 @@ export default {
this.componentPartModelFlag = false
},
+ // 双击选择copy物料
+ getCopyRowData (row) {
+ if (this.copyPartData.type === '1') {
+ this.copyBomData.partNo = row.partNo
+ this.copyBomData.partDesc = row.partDesc
+ this.copyBomTypeChange()
+ } else {
+ this.copyAlternativeData.partNo = row.partNo
+ this.copyAlternativeData.partDesc = row.partDesc
+ }
+ this.copyPartModelFlag = false
+ },
+
/**
- * 物料列表
+ * 子物料列表
*/
queryComponentPartModal () {
+ this.componentPartData.limit = this.pageSize3
+ this.componentPartData.page = this.pageIndex3
this.componentPartData.status = 'Y'
// 查询所有物料
queryPartList(this.componentPartData).then(({data}) => {
if (data && data.code === 0) {
- this.componentPartList = data.rows
+ this.componentPartList = data.page.list
+ this.pageIndex3 = data.page.currPage
+ this.pageSize3 = data.page.pageSize
+ this.totalPage3 = data.page.totalCount
this.componentPartModelFlag = true
} else {
this.$alert(data.msg, '错误', {
@@ -3244,30 +3444,78 @@ export default {
})
},
+ /**
+ * copy物料列表
+ */
+ queryCopyPartModal () {
+ this.copyPartData.limit = this.pageSize4
+ this.copyPartData.page = this.pageIndex4
+ // 查询所有物料
+ queryPartList(this.copyPartData).then(({data}) => {
+ if (data && data.code === 0) {
+ this.copyPartList = data.page.list
+ this.pageIndex4 = data.page.currPage
+ this.pageSize4 = data.page.pageSize
+ this.totalPage4 = data.page.totalCount
+ this.copyPartModelFlag = true
+ } else {
+ this.$alert(data.msg, '错误', {
+ confirmButtonText: '确定'
+ })
+ }
+ })
+ },
+
/**
* 物料列表
*/
queryComponentPartList () {
+ this.componentPartData.limit = this.pageSize3
+ this.componentPartData.page = this.pageIndex3
// 查询所有物料
queryPartList(this.componentPartData).then(({data}) => {
if (data && data.code === 0) {
- this.componentPartList = data.rows
+ this.componentPartList = data.page.list
+ this.pageIndex3 = data.page.currPage
+ this.pageSize3 = data.page.pageSize
+ this.totalPage3 = data.page.totalCount
} else {
this.componentPartList = []
}
})
},
+ /**
+ * copy物料查询列表
+ */
+ queryCopyPartList () {
+ this.copyPartData.limit = this.pageSize4
+ this.copyPartData.page = this.pageIndex4
+ // 查询所有物料
+ queryPartList(this.copyPartData).then(({data}) => {
+ if (data && data.code === 0) {
+ this.copyPartList = data.page.list
+ this.pageIndex4 = data.page.currPage
+ this.pageSize4 = data.page.pageSize
+ this.totalPage4 = data.page.totalCount
+ } else {
+ this.copyPartList = []
+ }
+ })
+ },
+
// 子物料编码失焦事件
componentPartBlur () {
if (this.componentData.componentPart != null && this.componentData.componentPart !== '') {
+ this.componentPartData.limit = this.pageSize3
+ this.componentPartData.page = this.pageIndex3
this.componentPartData.partNo = this.componentData.componentPart
queryPartList(this.componentPartData).then(({data}) => {
if (data && data.code === 0) {
if (data.rows.length === 1) {
- this.componentData.componentPartDesc = data.rows[0].partDesc
- this.componentData.printUnit = data.rows[0].printUnit
- this.componentData.printUnitName = data.rows[0].printUnitName
+ this.componentData.componentPartDesc = data.page.list[0].partDesc
+ this.componentData.printUnit = data.page.list[0].printUnit
+ this.componentData.printUnitName = data.page.list[0].printUnitName
} else {
this.$message.warning('该子物料不存在!')
this.componentData.componentPartDesc = ''
@@ -3279,6 +3527,55 @@ export default {
}
},
+ // copy物料编码失焦事件
+ copyPartBlur () {
+ if (this.copyPartData.type === '1') {
+ if (this.copyBomData.partNo != null && this.copyBomData.partNo !== '') {
+ this.copyPartData.limit = this.pageSize4
+ this.copyPartData.page = this.pageIndex4
+ this.copyPartData.partNo = this.copyBomData.partNo
+ queryPartList(this.copyPartData).then(({data}) => {
+ if (data && data.code === 0) {
+ if (data.page.list.length === 1) {
+ this.copyBomData.partDesc = data.page.list[0].partDesc
+ } else {
+ this.$message.warning('该物料不存在!')
+ this.copyBomData.partDesc = ''
+ }
+ }
+ })
+ }
+ } else {
+ if (this.copyAlternativeData.partNo != null && this.copyAlternativeData.partNo !== '') {
+ this.copyPartData.limit = this.pageSize4
+ this.copyPartData.page = this.pageIndex4
+ this.copyPartData.partNo = this.copyAlternativeData.partNo
+ queryPartList(this.copyPartData).then(({data}) => {
+ if (data && data.code === 0) {
+ if (data.page.list.length === 1) {
+ this.copyAlternativeData.partDesc = data.page.list[0].partDesc
+ } else {
+ this.$message.warning('该物料不存在!')
+ this.copyAlternativeData.partDesc = ''
+ }
+ }
+ })
+ }
+ }
+ },
+
+ // copy BOM类型改变
+ copyBomTypeChange () {
+ // 获取物料的bom版本号
+ getBomEngChgLevel(this.copyBomData).then(({data}) => {
+ if (data && data.code === 0) {
+ this.copyBomData.engChgLevel = data.engChgLevel
+ } else {
+ this.copyBomData.engChgLevel = ''
+ }
+ })
+ },
+
/**
* 表格的新增
* @param row
@@ -3608,6 +3905,7 @@ export default {
this.copyBomData = {
site: this.modalData.site,
partNo: this.modalData.partNo,
+ partDesc: this.modalData.partDesc,
engChgLevel: this.modalData.engChgLevel + 1,
bomType: this.modalData.bomType,
effPhaseInDate: this.dayjs(new Date()).format('YYYY-MM-DD'),
@@ -3616,6 +3914,14 @@ export default {
createBy: this.$store.state.user.name,
officialFlag: 'N'
}
+ this.copyPartData = {
+ type: '1',
+ site: this.$store.state.user.site,
+ partNo: '',
+ partDesc: '',
+ page: 1,
+ limit: 10
+ }
this.copyBomModelFlag = true
},
/**
@@ -3634,12 +3940,17 @@ export default {
this.$message.warning('请选择制造类型!')
return
}
+ if (this.copyBomData.effPhaseOutDate != null && this.copyBomData.effPhaseOutDate !== '' && this.copyBomData.effPhaseOutDate < this.copyBomData.effPhaseInDate) {
+ this.$message.warning('失效日期必须大于生效日期!')
+ return
+ }
this.copyBomData.previousVersion = this.modalData
+ this.copyLoading = true
// 新增主表信息
copyBom(this.copyBomData).then(({data}) => {
if (data && data.code === 0) {
- this.modalData.effPhaseOutDate = data.rows.effPhaseOutDate
this.copyBomModelFlag = false
+ this.updateModal(data.rows)
this.$message({
message: '操作成功',
type: 'success',
@@ -3651,6 +3962,9 @@ export default {
confirmButtonText: '确定'
})
}
+ this.copyLoading = false
+ }).catch(()=>{
+ this.copyLoading = false
})
},
/**
@@ -3660,6 +3974,7 @@ export default {
this.copyAlternativeData = {
site: this.detailData.site,
partNo: this.detailData.partNo,
+ partDesc: this.modalData.partDesc,
engChgLevel: this.detailData.engChgLevel,
bomType: this.detailData.bomType,
alternativeNo: this.detailData.alternativeNo,
@@ -3672,6 +3987,14 @@ export default {
previousVersion: {},
createBy: this.$store.state.user.name
}
+ this.copyPartData = {
+ type: '2',
+ site: this.$store.state.user.site,
+ partNo: '',
+ partDesc: '',
+ page: 1,
+ limit: 10
+ }
this.copyAlternativeModelFlag = true
},
@@ -3700,10 +4023,11 @@ export default {
return
}
this.copyAlternativeData.previousVersion = this.detailData
+ this.copyLoading = true
copyAlternative(this.copyAlternativeData).then(({data}) => {
if (data && data.code === 0) {
- this.detailDataList = data.rows.detailDataList
this.copyAlternativeModelFlag = false
+ this.updateModal(data.rows)
this.$message({
message: '操作成功',
type: 'success',
@@ -3715,6 +4039,9 @@ export default {
confirmButtonText: '确定'
})
}
+ this.copyLoading = false
+ }).catch(()=>{
+ this.copyLoading = false
})
},
diff --git a/src/views/modules/part/partInformation.vue b/src/views/modules/part/partInformation.vue
index a1c4096..058a3ad 100644
--- a/src/views/modules/part/partInformation.vue
+++ b/src/views/modules/part/partInformation.vue
@@ -94,7 +94,7 @@
BOM
Routing
- 转正式物料
+ 转正式物料
@@ -116,22 +116,22 @@
-
+
-
- Next Part No
-
Copy
+
+ Next Part No
+
@@ -571,9 +571,9 @@
- 同步
- 保存
- 关闭
+ 同步
+ 保存
+ 关闭
@@ -1518,7 +1518,7 @@
},
// 其它
loading: false,
- toBecomeOfficialLoading: false,
+ saveLoading: false,
// 初始页签
activeTable: 'part_item',
inventoryPartTable: 'General',
@@ -2034,6 +2034,22 @@
fixed: '',
columnWidth: 120
},
+ {
+ userId: this.$store.state.user.name,
+ functionId: 104001,
+ serialNumber: '104001Table1IfsPartNo',
+ tableId: '104001Table1',
+ tableName: '物料信息表',
+ columnProp: 'ifsPartNo',
+ headerAlign: 'center',
+ align: 'center',
+ columnLabel: 'IFS料号',
+ columnHidden: false,
+ columnImage: false,
+ status: true,
+ fixed: '',
+ columnWidth: 120
+ },
{
userId: this.$store.state.user.name,
functionId: 104001,
@@ -3136,7 +3152,7 @@
this.$message.warning('请填写版本号(Revision)!')
return
}
- if (this.revisionData.engRevision === '' || this.revisionData.engRevision == null) {
+ if (this.revisionData.flag === '2' && (this.revisionData.engRevision === '' || this.revisionData.engRevision == null)) {
this.$message.warning('请填写工程版本号(Eng Rev)!')
return
}
@@ -3144,10 +3160,14 @@
this.$message.warning('请选择生效日期(Phase In)!')
return
}
- if (this.revisionData.effPhaseOutDate === '' || this.revisionData.effPhaseOutDate == null) {
+ 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) {
@@ -4484,6 +4504,7 @@
return
}
if (this.modalData.flag === '1') {
+ this.saveLoading = true
partInformationSave(this.modalData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
@@ -4499,6 +4520,9 @@
confirmButtonText: '确定'
})
}
+ this.saveLoading = false
+ }).catch(()=>{
+ this.saveLoading = false
})
} else if (this.modalData.flag === '3') { // 转正式物料
if (this.modalData.ifsPartNo === '' || this.modalData.ifsPartNo == null) {
@@ -4509,7 +4533,7 @@
this.$message.warning('IFS物料编码不能等于PLM物料编码!')
return
}
- this.toBecomeOfficialLoading = true
+ this.saveLoading = true
this.modalData.bomAlternativeList = this.bomAlternativeSelections
this.modalData.routingAlternativeList = this.routingAlternativeSelections
partInformationToOfficial(this.modalData).then(({data}) => {
@@ -4527,11 +4551,12 @@
confirmButtonText: '确定'
})
}
- this.toBecomeOfficialLoading = false
+ this.saveLoading = false
}).catch(()=>{
- this.toBecomeOfficialLoading = false
+ this.saveLoading = false
})
} else {
+ this.saveLoading = true
partInformationEdit(this.modalData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
@@ -4547,6 +4572,9 @@
confirmButtonText: '确定'
})
}
+ this.saveLoading = false
+ }).catch(()=>{
+ this.saveLoading = false
})
}
},
@@ -5067,7 +5095,7 @@
// 下一个物料编码
nextPartNo () {
- if (this.modalData.partNo.length !== 3) {
+ if (this.modalData.ifsPartNo.length !== 3) {
this.$message.warning('Part No的前缀必须是3位!')
return
}
diff --git a/src/views/modules/part/routingManagement.vue b/src/views/modules/part/routingManagement.vue
index da9c4da..daf1f35 100644
--- a/src/views/modules/part/routingManagement.vue
+++ b/src/views/modules/part/routingManagement.vue
@@ -9,7 +9,11 @@
-
+
+
+
+
+
@@ -158,7 +162,7 @@
Copy
Build
Retire
- 转正式Routing
+ 转正式Routing
@@ -344,6 +348,16 @@
+
+
+
关闭
@@ -400,7 +414,10 @@
加工中心编码
-
+
+
+
+
@@ -456,7 +473,7 @@
-
+
@@ -523,15 +540,18 @@
-
+
-
-
+
+
+
+
+
-
+
@@ -570,19 +590,23 @@
-
-
+
+ 物料编码
+
-
-
+
+
+
+
+
-
+
-
+
@@ -599,7 +623,7 @@
- 保存
+ 保存
关闭
@@ -610,15 +634,18 @@
-
+
-
-
+
+
+
+
+
-
+
@@ -636,16 +663,20 @@
-
-
+
+ 物料编码
+
-
-
+
+
+
+
+
-
+
@@ -665,7 +696,7 @@
- 保存
+ 保存
关闭
@@ -794,6 +825,56 @@
+
+
+
+
+
+
+
+
+
+
+ 查询
+
+
+
+
+
+ {{scope.row[item.columnProp]}}
+
+
+
+
+
+
+
+
+ 关闭
+
+
+
@@ -813,6 +894,7 @@ import {
updateAlternativeStatus, // 修改明细状态
routingDetailDelete, // routing 明细删除
queryPartList, // 查询物料清单
+ queryPartListRouting, // 查出可创建Routing的物料
queryRoutingComponent, // 查询 routing 子明细
saveRoutingComponent, // 新增 routing 子明细
updateRoutingComponent, // 修改 routing 子明细
@@ -908,6 +990,12 @@ export default {
pageIndex: 1,
pageSize: 50,
totalPage: 0,
+ pageIndex2: 1,
+ pageSize2: 20,
+ totalPage2: 0,
+ pageIndex4: 1,
+ pageSize4: 20,
+ totalPage4: 0,
selectedDataNum: 0,
// 条件查询
searchData: {
@@ -925,6 +1013,7 @@ export default {
saveDetailLoading: false,
saveAllLoading: false,
toBecomeOfficialLoading: false,
+ copyLoading: false,
// 初始页签
detailTable: 'routing_detail',
subDetailTable: 'routing_sub_detail',
@@ -994,6 +1083,7 @@ export default {
machineNo: '',
workCenterNo: '',
workCenterDesc: '',
+ workCenterType: '',
laborClassNo: '',
laborClassDesc: '',
setupLaborClassNo: '',
@@ -1011,6 +1101,8 @@ export default {
site: this.$store.state.user.site,
partNo: '',
partDesc: '',
+ page: 1,
+ limit: 10
},
operationData: {
site: this.$store.state.user.site,
@@ -1070,6 +1162,7 @@ export default {
copyRoutingData: {
site: '',
partNo: '',
+ partDesc: '',
routingRevision: '',
routingType: '',
phaseInDate: '',
@@ -1080,6 +1173,7 @@ export default {
copyAlternativeData: {
site: '',
partNo: '',
+ partDesc: '',
routingRevision: '',
routingType: '',
alternativeNo: '',
@@ -1134,6 +1228,14 @@ export default {
ifsRowId: '',
ifsRowVersion: ''
},
+ copyPartData: {
+ type: '',
+ site: this.$store.state.user.site,
+ partNo: '',
+ partDesc: '',
+ page: 1,
+ limit: 10
+ },
// ======== 数据列表 ========
dataList: [],
partList: [],
@@ -1146,6 +1248,7 @@ export default {
routingToolList: [],
alternativeList: [],
workGuidelineList: [],
+ copyPartList: [],
// ======== 列表表头 ========
columnList: [
{
@@ -1398,7 +1501,7 @@ export default {
sortLv: 0,
status: true,
fixed: '',
- columnWidth: 60
+ columnWidth: 100
},
{
userId: this.$store.state.user.name,
@@ -1416,7 +1519,7 @@ export default {
sortLv: 0,
status: true,
fixed: '',
- columnWidth: 100
+ columnWidth: 150
},
{
userId: this.$store.state.user.name,
@@ -1434,7 +1537,7 @@ export default {
sortLv: 0,
status: true,
fixed: '',
- columnWidth: 60
+ columnWidth: 100
},
{
userId: this.$store.state.user.name,
@@ -1452,7 +1555,7 @@ export default {
sortLv: 0,
status: true,
fixed: '',
- columnWidth: 85
+ columnWidth: 100
},
{
userId: this.$store.state.user.name,
@@ -1470,7 +1573,7 @@ export default {
sortLv: 0,
status: true,
fixed: '',
- columnWidth: 85
+ columnWidth: 100
},
{
userId: this.$store.state.user.name,
@@ -1488,7 +1591,7 @@ export default {
sortLv: 0,
status: true,
fixed: '',
- columnWidth: 80
+ columnWidth: 100
},
{
userId: this.$store.state.user.name,
@@ -1506,7 +1609,7 @@ export default {
sortLv: 0,
status: true,
fixed: '',
- columnWidth: 85
+ columnWidth: 100
},
{
userId: this.$store.state.user.name,
@@ -1524,7 +1627,7 @@ export default {
sortLv: 0,
status: true,
fixed: '',
- columnWidth: 85
+ columnWidth: 100
},
{
userId: this.$store.state.user.name,
@@ -1542,7 +1645,7 @@ export default {
sortLv: 0,
status: true,
fixed: '',
- columnWidth: 85
+ columnWidth: 100
},
{
userId: this.$store.state.user.name,
@@ -1560,7 +1663,7 @@ export default {
sortLv: 0,
status: true,
fixed: '',
- columnWidth: 85
+ columnWidth: 100
},
{
userId: this.$store.state.user.name,
@@ -1578,6 +1681,24 @@ export default {
sortLv: 0,
status: true,
fixed: '',
+ columnWidth: 120
+ },
+ {
+ userId: this.$store.state.user.name,
+ functionId: 104003,
+ serialNumber: '104003Table2WorkCenterNo',
+ tableId: '104003Table2',
+ tableName: 'Routing工序表',
+ columnProp: 'workCenterNo',
+ headerAlign: 'center',
+ align: 'center',
+ columnLabel: '加工中心编码',
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 0,
+ status: true,
+ fixed: '',
columnWidth: 100
},
{
@@ -1588,8 +1709,26 @@ export default {
tableName: 'Routing工序表',
columnProp: 'workCenterDesc',
headerAlign: 'center',
+ align: 'left',
+ columnLabel: '加工中心名称',
+ columnHidden: false,
+ columnImage: false,
+ columnSortable: false,
+ sortLv: 0,
+ status: true,
+ fixed: '',
+ columnWidth: 200
+ },
+ {
+ userId: this.$store.state.user.name,
+ functionId: 104003,
+ serialNumber: '104003Table2WorkCenterType',
+ tableId: '104003Table2',
+ tableName: 'Routing工序表',
+ columnProp: 'workCenterType',
+ headerAlign: 'center',
align: 'center',
- columnLabel: '加工中心',
+ columnLabel: '加工中心类型',
columnHidden: false,
columnImage: false,
columnSortable: false,
@@ -1650,7 +1789,7 @@ export default {
sortLv: 0,
status: true,
fixed: '',
- columnWidth: 120
+ columnWidth: 200
},
],
columnRoutingToolList: [
@@ -2019,6 +2158,68 @@ export default {
columnWidth: 80
}
],
+ componentPartColumnList: [
+ {
+ columnProp: 'partNo',
+ headerAlign: "center",
+ align: "center",
+ columnLabel: '物料编码',
+ columnHidden: false,
+ columnImage: false,
+ status: true,
+ fixed: '',
+ },
+ {
+ columnProp: 'partDesc',
+ headerAlign: "center",
+ align: "left",
+ columnLabel: '物料名称',
+ columnHidden: false,
+ columnImage: false,
+ status: true,
+ fixed: '',
+ },
+ {
+ columnProp: 'familyName',
+ headerAlign: "center",
+ align: "center",
+ columnLabel: '物料分类',
+ columnHidden: false,
+ columnImage: false,
+ status: true,
+ fixed: '',
+ },
+ {
+ columnProp: 'printUnit',
+ headerAlign: "center",
+ align: "center",
+ columnLabel: '计量单位',
+ columnHidden: false,
+ columnImage: false,
+ status: true,
+ fixed: '',
+ },
+ {
+ columnProp: 'spec',
+ headerAlign: "center",
+ align: "center",
+ columnLabel: '规格型号',
+ columnHidden: false,
+ columnImage: false,
+ status: true,
+ fixed: '',
+ },
+ {
+ columnProp: 'partType',
+ headerAlign: "center",
+ align: "center",
+ columnLabel: '零件类型',
+ columnHidden: false,
+ columnImage: false,
+ status: true,
+ fixed: '',
+ }
+ ],
// ======== 必填规则 ========
rules: {
partNo: [
@@ -2266,7 +2467,8 @@ export default {
queryWorkGuidelineModal: false,
saveWorkGuidelineModal: false,
workGuidelineDisableModal: false,
- headerSaveFlag: false
+ headerSaveFlag: false,
+ copyPartModelFlag: false,
}
},
@@ -2332,6 +2534,148 @@ export default {
this.getDataList()
},
+ /**
+ * 每页数
+ * @param val
+ */
+ sizeChangeHandle2 (val) {
+ this.pageSize2 = val
+ this.pageIndex2 = 1
+ this.queryPartList()
+ },
+
+ /**
+ * 当前页
+ * @param val
+ */
+ currentChangeHandle2 (val) {
+ this.pageIndex2 = val
+ this.queryPartList()
+ },
+
+ /**
+ * 每页数
+ * @param val
+ */
+ sizeChangeHandle4 (val) {
+ this.pageSize4 = val
+ this.pageIndex4 = 1
+ this.queryCopyPartModal()
+ },
+
+ /**
+ * 当前页
+ * @param val
+ */
+ currentChangeHandle4 (val) {
+ this.pageIndex4 = val
+ this.queryCopyPartModal()
+ },
+
+ /**
+ * copy物料列表
+ */
+ queryCopyPartModal () {
+ this.copyPartData.limit = this.pageSize4
+ this.copyPartData.page = this.pageIndex4
+ // 查询所有物料
+ queryPartList(this.copyPartData).then(({data}) => {
+ if (data && data.code === 0) {
+ this.copyPartList = data.page.list
+ this.pageIndex4 = data.page.currPage
+ this.pageSize4 = data.page.pageSize
+ this.totalPage4 = data.page.totalCount
+ this.copyPartModelFlag = true
+ } else {
+ this.$alert(data.msg, '错误', {
+ confirmButtonText: '确定'
+ })
+ }
+ })
+ },
+
+ /**
+ * copy物料查询列表
+ */
+ queryCopyPartList () {
+ this.copyPartData.limit = this.pageSize4
+ this.copyPartData.page = this.pageIndex4
+ // 查询所有物料
+ queryPartList(this.copyPartData).then(({data}) => {
+ if (data && data.code === 0) {
+ this.copyPartList = data.page.list
+ this.pageIndex4 = data.page.currPage
+ this.pageSize4 = data.page.pageSize
+ this.totalPage4 = data.page.totalCount
+ } else {
+ this.copyPartList = []
+ }
+ })
+ },
+
+ // copy物料编码失焦事件
+ copyPartBlur () {
+ if (this.copyPartData.type === '1') {
+ if (this.copyRoutingData.partNo != null && this.copyRoutingData.partNo !== '') {
+ this.copyPartData.limit = this.pageSize4
+ this.copyPartData.page = this.pageIndex4
+ this.copyPartData.partNo = this.copyRoutingData.partNo
+ queryPartList(this.copyPartData).then(({data}) => {
+ if (data && data.code === 0) {
+ if (data.page.list.length === 1) {
+ this.copyRoutingData.partDesc = data.page.list[0].partDesc
+ } else {
+ this.$message.warning('该物料不存在!')
+ this.copyRoutingData.partDesc = ''
+ }
+ }
+ })
+ }
+ } else {
+ if (this.copyAlternativeData.partNo != null && this.copyAlternativeData.partNo !== '') {
+ this.copyPartData.limit = this.pageSize4
+ this.copyPartData.page = this.pageIndex4
+ this.copyPartData.partNo = this.copyAlternativeData.partNo
+ queryPartList(this.copyPartData).then(({data}) => {
+ if (data && data.code === 0) {
+ if (data.page.list.length === 1) {
+ this.copyAlternativeData.partDesc = data.page.list[0].partDesc
+ } else {
+ this.$message.warning('该物料不存在!')
+ this.copyAlternativeData.partDesc = ''
+ }
+ }
+ })
+ }
+ }
+ },
+
+ // 双击选择copy物料
+ getCopyRowData (row) {
+ if (this.copyPartData.type === '1') {
+ this.copyRoutingData.partNo = row.partNo
+ this.copyRoutingData.partDesc = row.partDesc
+ this.copyRoutingTypeChange()
+ } else {
+ this.copyAlternativeData.partNo = row.partNo
+ this.copyAlternativeData.partDesc = row.partDesc
+ }
+ this.copyPartModelFlag = false
+ },
+
+ // copy BOM类型改变
+ copyRoutingTypeChange () {
+ // 获取物料的routing版本号
+ getRottingRevision(this.copyRoutingData).then(({data}) => {
+ if (data && data.code === 0) {
+ this.copyRoutingData.routingRevision = data.routingRevision
+ } else {
+ this.copyRoutingData.routingRevision = ''
+ }
+ })
+ },
+
+
// ======== 页签切换相关方法 ========
/**
* 明细页签选择替换
@@ -2383,11 +2727,11 @@ export default {
*/
getDataList () {
//如果是跳转过来的 要判断
- if(localStorage.getItem('routeData')!=undefined){
- let data=JSON.parse(localStorage.getItem('routeData'));
- this.searchData.partNo=data.partNo
- this.searchData.routingType=data.routingType
- this.searchData.routingRevision=data.routingRevision
+ if (localStorage.getItem('routeData') != undefined) {
+ let data = JSON.parse(localStorage.getItem('routeData'))
+ this.searchData.partNo = data.partNo
+ this.searchData.routingType = data.routingType
+ this.searchData.routingRevision = data.routingRevision
}
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
@@ -2399,16 +2743,14 @@ export default {
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
this.$refs.selectDiv.setLengthAll( this.dataList.length)
- if(localStorage.getItem('routeData')!=undefined){
-
+ if (localStorage.getItem('routeData') != undefined) {
this.updateModal(this.dataList[0])
-
}
}
this.queryLoading = false
- if(localStorage.getItem('routeData')!=undefined){
+ if (localStorage.getItem('routeData') != undefined) {
this.$nextTick(function () {
- localStorage.removeItem('routeData');
+ localStorage.removeItem('routeData')
})
}
})
@@ -2504,7 +2846,9 @@ export default {
updateBy: this.$store.state.user.name,
printUnit: row.printUnit,
printUnitName: row.printUnitName,
- officialFlag: row.officialFlag
+ officialFlag: row.officialFlag,
+ alternativeNo: row.alternativeNo,
+ ifsPartNo: row.ifsPartNo
}
// 查routing明细
queryRoutingDetail(this.modalData).then(({data}) => {
@@ -2665,6 +3009,7 @@ export default {
machineNo: '',
workCenterNo: '',
workCenterDesc: '',
+ workCenterType: '',
laborClassNo: '',
laborClassDesc: '',
setupLaborClassNo: '',
@@ -2719,6 +3064,7 @@ export default {
machineNo: row.machineNo,
workCenterNo: row.workCenterNo,
workCenterDesc: row.workCenterDesc,
+ workCenterType: row.workCenterType,
laborClassNo: row.laborClassNo,
laborClassDesc: row.laborClassDesc,
setupLaborClassNo: row.setupLaborClassNo,
@@ -2934,9 +3280,14 @@ export default {
* 查询物料
*/
queryPartList () {
- queryPartList(this.partData).then(({data}) => {
+ this.partData.limit = this.pageSize2
+ this.partData.page = this.pageIndex2
+ queryPartListRouting(this.partData).then(({data}) => {
if (data && data.code === 0) {
- this.partList = data.rows
+ this.partList = data.page.list
+ this.pageIndex2 = data.page.currPage
+ this.pageSize2 = data.page.pageSize
+ this.totalPage2 = data.page.totalCount
this.partModelFlag = true
} else {
this.$alert(data.msg, '错误', {
@@ -2948,13 +3299,15 @@ export default {
// 物料编码失焦事件
partNoBlur () {
+ this.partData.limit = this.pageSize2
+ this.partData.page = this.pageIndex2
this.partData.partNo = this.modalData.partNo
queryPartList(this.partData).then(({data}) => {
if (data && data.code === 0) {
- if (data.rows.length === 1) {
- this.modalData.partDesc = data.rows[0].partDesc
- this.modalData.printUnit = data.rows[0].printUnit
- this.modalData.printUnitName = data.rows[0].printUnitName
+ if (data.page.list.length === 1) {
+ this.modalData.partDesc = data.page.list[0].partDesc
+ this.modalData.printUnit = data.page.list[0].printUnit
+ this.modalData.printUnitName = data.page.list[0].printUnitName
// 获取物料的routing版本号
getRottingRevision(this.modalData).then(({data}) => {
if (data && data.code === 0) {
@@ -3315,6 +3668,7 @@ export default {
this.copyRoutingData = {
site: this.modalData.site,
partNo: this.modalData.partNo,
+ partDesc: this.modalData.partDesc,
routingRevision: this.modalData.routingRevision + 1,
routingType: this.modalData.routingType,
phaseInDate: this.dayjs(new Date()).format('YYYY-MM-DD'),
@@ -3323,6 +3677,14 @@ export default {
createBy: this.$store.state.user.name,
officialFlag: 'N'
}
+ this.copyPartData = {
+ type: '1',
+ site: this.$store.state.user.site,
+ partNo: '',
+ partDesc: '',
+ page: 1,
+ limit: 10
+ }
this.copyRoutingModelFlag = true
},
/**
@@ -3341,12 +3703,17 @@ export default {
this.$message.warning('请选择工艺类型!')
return
}
+ if (this.copyRoutingData.phaseOutDate != null && this.copyRoutingData.phaseOutDate !== '' && this.copyRoutingData.phaseOutDate < this.copyRoutingData.phaseInDate) {
+ this.$message.warning('失效日期必须大于生效日期!')
+ return
+ }
this.copyRoutingData.previousVersion = this.modalData
+ this.copyLoading = true
// 新增主表信息
copyRouting(this.copyRoutingData).then(({data}) => {
if (data && data.code === 0) {
- this.modalData.phaseOutDate = data.rows.phaseOutDate
this.copyRoutingModelFlag = false
+ this.updateModal(data.rows)
this.$message({
message: '操作成功',
type: 'success',
@@ -3358,6 +3725,9 @@ export default {
confirmButtonText: '确定'
})
}
+ this.copyLoading = false
+ }).catch(()=>{
+ this.copyLoading = false
})
},
/**
@@ -3367,6 +3737,7 @@ export default {
this.copyAlternativeData = {
site: this.detailData.site,
partNo: this.detailData.partNo,
+ partDesc: this.modalData.partDesc,
routingRevision: this.detailData.routingRevision,
routingType: this.detailData.routingType,
alternativeNo: this.detailData.alternativeNo,
@@ -3386,6 +3757,14 @@ export default {
previousVersion: {},
createBy: this.$store.state.user.name
}
+ this.copyPartData = {
+ type: '2',
+ site: this.$store.state.user.site,
+ partNo: '',
+ partDesc: '',
+ page: 1,
+ limit: 10
+ }
this.copyAlternativeModelFlag = true
},
@@ -3623,10 +4002,11 @@ export default {
return
}
this.copyAlternativeData.previousVersion = this.detailData
+ this.copyLoading = true
copyAlternative(this.copyAlternativeData).then(({data}) => {
if (data && data.code === 0) {
- this.detailDataList = data.rows.detailDataList
this.copyAlternativeModelFlag = false
+ this.updateModal(data.rows)
this.$message({
message: '操作成功',
type: 'success',
@@ -3638,6 +4018,9 @@ export default {
confirmButtonText: '确定'
})
}
+ this.copyLoading = false
+ }).catch(()=>{
+ this.copyLoading = false
})
},
@@ -4020,6 +4403,7 @@ export default {
if (this.tagNo === 119) {
this.componentData.workCenterNo = val.work_center_no
this.componentData.workCenterDesc = val.work_center_desc
+ this.componentData.workCenterType = val.work_center_type
}
if (this.tagNo === 122) {
this.routingToolData.toolId = val.tool_id
@@ -4049,6 +4433,7 @@ export default {
if (data.baseListData.length > 0) {
this.componentData.workCenterNo = data.baseListData[0].work_center_no
this.componentData.workCenterDesc = data.baseListData[0].work_center_desc
+ this.componentData.workCenterType = data.baseListData[0].work_center_type
} else {
this.$message.warning('该加工中心不存在!')
this.componentData.workCenterDesc = ''
diff --git a/src/views/modules/tooling/searchToolApply.vue b/src/views/modules/tooling/searchToolApply.vue
index 94b0cb0..6ba3c8e 100644
--- a/src/views/modules/tooling/searchToolApply.vue
+++ b/src/views/modules/tooling/searchToolApply.vue
@@ -922,16 +922,22 @@
}
})
},
- comfirmApply(row){
+ comfirmApply (row) {
this.$confirm(`确定下达这个申请`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
- comfirmProjectToolApply(row).then(({data}) => {
+ let tempData = {
+ site: row.site,
+ userName: this.$store.state.user.name,
+ applyNo: row.applyNo,
+ menuId: this.$route.meta.menuId
+ }
+ comfirmProjectToolApply(tempData).then(({data}) => {
if (data && data.code === 0) {
- row.statusCode='10'
- row.status='下达'
+ row.statusCode = '10'
+ row.status = '下达'
this.$message({
message: '操作成功',
type: 'success',