From 78aeae76d0e8295468b852366c603326c1d9b7cc Mon Sep 17 00:00:00 2001 From: ruanqi Date: Mon, 16 Oct 2023 10:45:17 +0800 Subject: [PATCH] plm --- src/api/base/site.js | 14 + src/api/project/project.js | 1 + .../technicalSpecificationList.js | 1 + src/views/modules/base/buInfo.vue | 457 ++++++++++++++++++ .../com_projectInfo-add-or-update.vue | 57 ++- .../project/projectInfo/projectInfo.vue | 191 ++++++-- .../com_technical-add-or-update.vue | 41 +- .../com_tsd_basicInformation.vue | 14 - .../technicalSpecificationList.vue | 37 +- src/views/modules/sys/user.vue | 67 +++ 10 files changed, 770 insertions(+), 110 deletions(-) create mode 100644 src/views/modules/base/buInfo.vue diff --git a/src/api/base/site.js b/src/api/base/site.js index 6b0611e..ee14841 100644 --- a/src/api/base/site.js +++ b/src/api/base/site.js @@ -31,3 +31,17 @@ export const saveCompanyInformation = data => createAPI(`/base/saveCompanyInform // 删除停机原因 export const deleteCompanyInformation = data => createAPI(`/base/deleteCompanyInformation`,'post',data) +//------------BU---------------- +// 获取BU +export const getBUList = data => createAPI(`/base/getBUList`,'post',data) + +// 保存修改BU +export const saveBU = data => createAPI(`/base/saveBU`,'post',data) + +// 删除BU +export const deleteBU = data => createAPI(`/base/deleteBU`,'post',data) + +export const searchAccessBuList = data => createAPI(`/base/searchAccessBuList`,'post',data) +export const saveAccessBU = data => createAPI(`/base/saveAccessBU`,'post',data) +export const searchAccessBuListForUser= data => createAPI(`/base/searchAccessBuListForUser`,'post',data) +export const saveAccessBuListForBu= data => createAPI(`/base/saveAccessBuListForBu`,'post',data) diff --git a/src/api/project/project.js b/src/api/project/project.js index 9c70fe9..b582995 100644 --- a/src/api/project/project.js +++ b/src/api/project/project.js @@ -34,3 +34,4 @@ export const deleteProjectPartWithId= data => createAPI(`/project/deleteProjectP export const getPlmToolPurchaseRequestDataByProject= data => createAPI(`/project/getPlmToolPurchaseRequestDataByProject`,'post',data) export const savePlmToolPurchaseRequestData= data => createAPI(`/project/savePlmToolPurchaseRequestData`,'post',data) export const searchBIAddress= data => createAPI(`/project/searchBIAddress`,'post',data) +export const getProjectUserRole= data => createAPI(`/project/getProjectUserRole`,'post',data) diff --git a/src/api/sampleManagement/technicalSpecificationList.js b/src/api/sampleManagement/technicalSpecificationList.js index fbebeda..8d6127c 100644 --- a/src/api/sampleManagement/technicalSpecificationList.js +++ b/src/api/sampleManagement/technicalSpecificationList.js @@ -6,3 +6,4 @@ export const searchTechnicalSpecificationTeamStr = data => createAPI(`/technical export const deleteTechnicalSpecificationList = data => createAPI(`/technicalSpecification/deleteTechnicalSpecificationList`,'post',data) export const getTechnicalCustomerInfoData = data => createAPI(`/technicalSpecification/getTechnicalCustomerInfoData`,'post',data) export const tsdBasicInformationSearch = data => createAPI(`/technicalSpecification/tsdBasicInformationSearch`,'post',data) +export const getTestPartChangeData = data => createAPI(`/technicalSpecification/getTestPartChangeData`,'post',data) diff --git a/src/views/modules/base/buInfo.vue b/src/views/modules/base/buInfo.vue new file mode 100644 index 0000000..90e289b --- /dev/null +++ b/src/views/modules/base/buInfo.vue @@ -0,0 +1,457 @@ + + + + + diff --git a/src/views/modules/project/projectInfo/com_projectInfo-add-or-update.vue b/src/views/modules/project/projectInfo/com_projectInfo-add-or-update.vue index 201e2ac..8100dfb 100644 --- a/src/views/modules/project/projectInfo/com_projectInfo-add-or-update.vue +++ b/src/views/modules/project/projectInfo/com_projectInfo-add-or-update.vue @@ -39,6 +39,10 @@ + + BU + + 项目来源 @@ -261,6 +265,8 @@ projectManagerList:[], projectOwnerList:[], userRoleList:[], + buNo:[], + buDesc:[], }, projectManagerList:[], projectOwnerList:[], @@ -294,6 +300,13 @@ trigger: 'change' } ], + buDesc: [ + { + required: true, + message: ' ', + trigger: 'change' + } + ], projectSourceDesc: [ { required: true, @@ -354,6 +367,11 @@ strVal = this.dataForm.projectTypeDb } } + if (val === 106) { + if(type==1) { + strVal = this.dataForm.buNo + } + } if (val === 102) { if(type==1) { strVal = this.dataForm.customerId @@ -398,6 +416,12 @@ this.dataForm.priorityDesc = val.Base_desc } } + if (this.tagNo === 106) { + if(this.tagNo1==1) { + this.dataForm.buNo = val.Bu_no + this.dataForm.buDesc = val.Bu_desc + } + } }, init (id) { this.dataForm.id = id || 0 @@ -459,6 +483,8 @@ userRoleName:'', projectManagerList:[], projectOwnerList:[], + buNo:'', + buDesc:'', } let inData={ site:this.dataForm.site, @@ -519,10 +545,33 @@ }, userRollModal(){ this.userRoleList=JSON.parse(JSON.stringify(this.dataForm.userRoleList)); + for (let i = 0; i @@ -109,12 +109,17 @@ -
+
+ + + +
+
-
+
@@ -352,6 +357,7 @@ getContactChooseData, saveProjectContactList, deleteProjectInfo, + getProjectUserRole, } from "@/api/project/project.js" import projectUploadFile from "./com_project_upload_file";/*上传文件的組件*/ import projectPart from "./com_project_info_part";/*組件*/ @@ -390,6 +396,7 @@ projectId:'', projectType:'', projectOwnerName:'', + userName:this.$store.state.user.name, }, contactChooseFlag:false, currentRow:'', @@ -505,6 +512,42 @@ fixed: '', columnWidth: 40 }, + { + userId: this.$store.state.user.name, + functionId: 101002001, + serialNumber: '101002001Table1BuNo', + tableId: "101002001Table1", + tableName: "项目信息主表", + columnProp: "buNo", + headerAlign: "center", + align: "left", + columnLabel: "BU编码", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 40 + }, + { + userId: this.$store.state.user.name, + functionId: 101002001, + serialNumber: '101002001Table1BuDesc', + tableId: "101002001Table1", + tableName: "项目信息主表", + columnProp: "buDesc", + headerAlign: "center", + align: "left", + columnLabel: "BU名称", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 40 + }, { userId: this.$store.state.user.name, functionId: 101002001, @@ -871,6 +914,8 @@ customerRemark:'', remark:'', userRoleName:'', + buDesc:'', + buNo:'', }, customerData:{ site: '', @@ -904,17 +949,17 @@ sortLv: 0, status: true, fixed: false - }, { - columnProp: 'createdBy', - headeralign: 'left', - align: 'left', - columnLabel: '上传人', - columnHidden: false, - columnImage: false, - columnSortable: true, - sortLv: 0, - status: true, - fixed: false + // }, { + // columnProp: 'createdBy', + // headeralign: 'left', + // align: 'left', + // columnLabel: '上传人', + // columnHidden: false, + // columnImage: false, + // columnSortable: true, + // sortLv: 0, + // status: true, + // fixed: false }, { columnProp: 'createDate', headeralign: 'left', @@ -1004,6 +1049,25 @@ this.$refs.addOrUpdate.init(id) }) }, + UpdateHandle (row) { + let inData={ + site:row.site, + username:this.$store.state.user.name, + projectId:row.projectId + } + getProjectUserRole(inData).then(({data}) => { + if(this.$store.state.user.name=='admin'||data.row.updateFlag=='Y') { + this.addOrUpdateVisible = true + this.$nextTick(() => { + this.$refs.addOrUpdate.init(row.id) + }) + }else { + this.$alert('没有权限修改这个项目信息!', '错误', { + confirmButtonText: '确定' + }) + } + }) + }, //导出excel async createExportData() { this.searchData.limit = -1 @@ -1240,28 +1304,41 @@ // 'token': Vue.cookie.get('token') // } // }) - downLoadProjectFile(row) - .then(({data}) => { - // 不限制文件下载类型 - const blob = new Blob([data], {type:'application/octet-stream;charset=utf-8'}) - // 下载文件名称 - const fileName = row.fileName - // a标签下载 - const linkNode = document.createElement('a') - linkNode.download = fileName // a标签的download属性规定下载文件的名称 - linkNode.style.display = 'none' - linkNode.href = URL.createObjectURL(blob) // 生成一个Blob URL - console.log(linkNode) - // if(val == 'Y'){ - // this.pdfVisible = true - // this.pdfUrl = linkNode.href - // }else { - document.body.appendChild(linkNode) - linkNode.click() // 模拟在按钮上的一次鼠标单击 - URL.revokeObjectURL(linkNode.href) // 释放URL 对象 - document.body.removeChild(linkNode) - // } - }) + let inData={ + site:this.currentRow.site, + username:this.$store.state.user.name, + projectId:this.currentRow.projectId + } + getProjectUserRole(inData).then(({data}) => { + if(this.$store.state.user.name=='admin'||data.row.downFlag=='Y') { + downLoadProjectFile(row) + .then(({data}) => { + // 不限制文件下载类型 + const blob = new Blob([data], {type:'application/octet-stream;charset=utf-8'}) + // 下载文件名称 + const fileName = row.fileName + // a标签下载 + const linkNode = document.createElement('a') + linkNode.download = fileName // a标签的download属性规定下载文件的名称 + linkNode.style.display = 'none' + linkNode.href = URL.createObjectURL(blob) // 生成一个Blob URL + console.log(linkNode) + // if(val == 'Y'){ + // this.pdfVisible = true + // this.pdfUrl = linkNode.href + // }else { + document.body.appendChild(linkNode) + linkNode.click() // 模拟在按钮上的一次鼠标单击 + URL.revokeObjectURL(linkNode.href) // 释放URL 对象 + document.body.removeChild(linkNode) + // } + }) + }else { + this.$alert('没有权限下载这个项目的文件!', '错误', { + confirmButtonText: '确定' + }) + } + }) }, // 每页数 sizeChangeHandle (val) { @@ -1404,21 +1481,35 @@ }, deleteProjectInfo(row){ - this.$confirm(`确定删除当前记录?`, '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - deleteProjectInfo(row).then(({data}) => { - if (data && data.code === 0) { - this.$message.success( '操作成功') - this.contactChooseFlag = false - this.search() - } else { - this.$message.error(data.msg) - } + let inData={ + site:row.site, + username:this.$store.state.user.name, + projectId:row.projectId + } + getProjectUserRole(inData).then(({data}) => { + if(this.$store.state.user.name=='admin'||data.row.deleteFlag=='Y') { + this.$confirm(`确定删除当前记录?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + deleteProjectInfo(row).then(({data}) => { + if (data && data.code === 0) { + this.$message.success( '操作成功') + this.contactChooseFlag = false + this.search() + } else { + this.$message.error(data.msg) + } + }) + }).catch(() => {}) + }else { + this.$alert('没有权限删除这个项目信息!', '错误', { + confirmButtonText: '确定' }) - }).catch(() => {}) + } + }) + }, }, diff --git a/src/views/modules/sampleManagement/com_technical-add-or-update.vue b/src/views/modules/sampleManagement/com_technical-add-or-update.vue index de92402..29cd87c 100644 --- a/src/views/modules/sampleManagement/com_technical-add-or-update.vue +++ b/src/views/modules/sampleManagement/com_technical-add-or-update.vue @@ -6,20 +6,17 @@ :close-on-click-modal="false" :visible.sync="visible"> - - 打样申请号 - + + 项目料号 + - - - - + @@ -126,6 +123,7 @@ import {technicalSpecificationListSearch, saveTechnicalSpecificationSheet, searchTechnicalSpecificationTeamStr, + getTestPartChangeData, } from "@/api/sampleManagement/technicalSpecificationList.js" import Chooselist from '@/views/modules/common/Chooselist' export default { @@ -146,7 +144,6 @@ dataForm: { id: 0, site:this.$store.state.user.site, - proofingNo:'', projectId:'', codeNo:'', testPartNo:'', @@ -165,7 +162,7 @@ engineerList:[], technicianList:[], dataRole: { - proofingNo: [ + testPartNo: [ { required: true, message: ' ', @@ -214,7 +211,7 @@ this.tagNo1 = type this.$nextTick(() => { let strVal = '' - if (val === 501) { + if (val === 105) { if(type==1) { strVal = '' } @@ -239,12 +236,10 @@ }, /* 列表方法的回调 */ getBaseData (val) { - if (this.tagNo === 501) { + if (this.tagNo === 105) { if(this.tagNo1==1) { - this.dataForm.proofingNo = val.Proofing_no - this.dataForm.projectId = val.Project_id this.dataForm.testPartNo = val.Test_part_no - this.dataForm.partName = val.Part_name + this.changeTestDesc(); } } if (this.tagNo === 102) { @@ -308,7 +303,6 @@ this.dataForm={ id: 0, site:this.$store.state.user.site, - proofingNo:'', projectId:'', codeNo:'', testPartNo:'', @@ -411,6 +405,23 @@ }) }, + changeTestDesc(){ + let inData={ + site:this.$store.state.user.site, + testPartNo: this.dataForm.testPartNo + } + getTestPartChangeData(inData).then(({data}) => { + if (data && data.code === 0) { + if(data.row!=null){ + this.dataForm.projectId=data.row.projectId + this.dataForm.partName=data.row.partName + }else { + this.dataForm.projectId='' + this.dataForm.partName='' + } + } + }) + }, }, } diff --git a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_tsd_basicInformation.vue b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_tsd_basicInformation.vue index 5e4a3ae..cbebce0 100644 --- a/src/views/modules/sampleManagement/technicalSpecificationDetail/com_tsd_basicInformation.vue +++ b/src/views/modules/sampleManagement/technicalSpecificationDetail/com_tsd_basicInformation.vue @@ -23,18 +23,6 @@
- -
- - - -
-
- - - -
-
@@ -180,8 +168,6 @@ revNo:'', workCenterNo:'', workCenterDesc:'', - proofingNo:'', - proofingDesc:'', finalPartNo:'', testPartNo:'', customerPartNo:'', diff --git a/src/views/modules/sampleManagement/technicalSpecificationList.vue b/src/views/modules/sampleManagement/technicalSpecificationList.vue index af3dcd3..1e74756 100644 --- a/src/views/modules/sampleManagement/technicalSpecificationList.vue +++ b/src/views/modules/sampleManagement/technicalSpecificationList.vue @@ -80,44 +80,39 @@ -
+
-
+
-
+
-
- - - -
-
+
-
+
-
+
-
+
@@ -457,23 +452,6 @@ status: true, fixed: '', columnWidth: 80 - },{ - userId: this.$store.state.user.name, - functionId: 103002, - serialNumber: '103002Table1ProofingNo', - tableId: "103002Table1", - tableName: "技术参数卡列表", - columnProp: "proofingNo", - headerAlign: "center", - align: "left", - columnLabel: "打样申请单号", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: '', - columnWidth: 80 },{ userId: this.$store.state.user.name, functionId: 103002, @@ -565,7 +543,6 @@ testPartNo:'', partTypeDesc:'', revNo:'', - proofingNo:'', projectId:'', ecnFlag:'', ecnNo:'', diff --git a/src/views/modules/sys/user.vue b/src/views/modules/sys/user.vue index fbc24d1..8e7ae52 100644 --- a/src/views/modules/sys/user.vue +++ b/src/views/modules/sys/user.vue @@ -17,6 +17,10 @@ @click="siteAuthorize()" > {{ buttons.factoryAuthorization || '工厂授权' }} + {{ buttons.buAuthorization || 'BU授权' }} + @@ -166,12 +170,35 @@ + + + + + +
+ 确定 + 取消 +
+ +
+