Browse Source

项目编码和项目物料如果是已经同步的,需要加超链接,点击可以跳转到NPI

ecss-tx
han\hanst 2 weeks ago
parent
commit
51b2c19356
  1. 35
      src/views/modules/eam/eamProjectInfo.vue
  2. 54
      src/views/modules/eam/eamProjectPartInfo.vue
  3. 74
      src/views/modules/sampleTracking/projectProofTracking.vue

35
src/views/modules/eam/eamProjectInfo.vue

@ -1332,6 +1332,7 @@ import {updateColumnSize} from "../../../api/table";
page: 1,
limit: 10,
},
lastAppliedRouteQueryKey: '',
height: 200,
dialogHeight: 200,
dialogWidth: 200,
@ -2998,6 +2999,9 @@ import {updateColumnSize} from "../../../api/table";
},
activated() {
if (this.applyProjectInfoRouteQuery() && !this.authSearch) {
this.getDataList()
}
this.$store.commit("sift/commitSearchFunction",this.queryDataList)
},
@ -3011,6 +3015,7 @@ import {updateColumnSize} from "../../../api/table";
//
this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
this.getTableUserColumn(this.$route.meta.menuId+'table2',2)
this.applyProjectInfoRouteQuery()
if (!this.authSearch) {
if (!this.agencyMatters){
//
@ -3020,6 +3025,36 @@ import {updateColumnSize} from "../../../api/table";
},
methods: {
applyProjectInfoRouteQuery () {
const queryProjectNo = this.$route.query && this.$route.query.projectNo
if (queryProjectNo === undefined || queryProjectNo === null || String(queryProjectNo).trim() === '') {
return false
}
const projectNo = String(queryProjectNo).trim()
const queryKey = 'projectNo=' + projectNo
// keep-alive
if (this.lastAppliedRouteQueryKey === queryKey) {
return false
}
this.lastAppliedRouteQueryKey = queryKey
this.searchData.projectNo = projectNo
//
this.searchData.projectDesc = ''
this.searchData.customerNo = ''
this.searchData.customerDesc = ''
this.searchData.buDesc = ''
this.searchData.projectCategory = ''
this.searchData.status = ''
this.searchData.projectManager = ''
this.searchData.projectOwner = ''
this.searchData.engineer = ''
this.searchData.startDate = ''
this.searchData.endDate = ''
this.searchData.cProjectRegion = ''
this.pageIndex = 1
this.searchData.page = 1
return true
},
normalizeBuText (value) {
if (value === null || value === undefined) {
return ''

54
src/views/modules/eam/eamProjectPartInfo.vue

@ -1985,6 +1985,7 @@ import {uploadFileList} from '@/api/base/baseFunction.js';
confirmVisible: false,
confirmationPrompted: false, //
agencyMatters: false, //
lastAppliedRouteQueryKey: '',
finalPartFlag: false,
visible: false, //
dataListIndex: 0,
@ -3902,11 +3903,7 @@ import {uploadFileList} from '@/api/base/baseFunction.js';
this.getTableUserColumn(this.$route.meta.menuId+'table1',1)
if (!this.authSearch) {
if (!this.agencyMatters){
if (this.$route.query.projectNo || this.$route.query.testPartNo) {
this.searchData1.projectNo = this.$route.query.projectNo;
this.searchData1.testPartNo = this.$route.query.testPartNo;
this.agencyMatters = true;
}
this.applyProjectPartRouteQuery()
// URL
const { projectPartId } = this.$route.query;
// searchData
@ -3920,16 +3917,55 @@ import {uploadFileList} from '@/api/base/baseFunction.js';
},
activated() {
if (this.$route.query.projectNo || this.$route.query.testPartNo) {
this.searchData1.projectNo = this.$route.query.projectNo;
this.searchData1.testPartNo = this.$route.query.testPartNo;
this.agencyMatters = true;
if (this.applyProjectPartRouteQuery()) {
this.getDataList();
}
this.$store.commit("sift/commitSearchFunction",this.queryEamProjectPart)
},
methods: {
applyProjectPartRouteQuery () {
const query = this.$route.query || {}
const projectNo = query.projectNo === undefined || query.projectNo === null ? '' : String(query.projectNo).trim()
const testPartNo = query.testPartNo === undefined || query.testPartNo === null ? '' : String(query.testPartNo).trim()
if (!projectNo && !testPartNo) {
return false
}
const queryKey = 'projectNo=' + projectNo + '|testPartNo=' + testPartNo
// keep-alive
if (this.lastAppliedRouteQueryKey === queryKey) {
return false
}
this.lastAppliedRouteQueryKey = queryKey
// 便searchData1 使
this.searchData.projectNo = projectNo
this.searchData.testPartNo = testPartNo
this.searchData.projectDesc = ''
this.searchData.partDesc = ''
this.searchData.buDesc = ''
this.searchData.customerNo = ''
this.searchData.customerDesc = ''
this.searchData.projectCategory = ''
this.searchData.status = ''
this.searchData.projectManager = ''
this.searchData.projectOwner = ''
this.searchData.engineer = ''
this.searchData.startDate = ''
this.searchData.endDate = ''
this.searchData.cProjectRegion = ''
this.searchData1.projectNo = projectNo
this.searchData1.testPartNo = testPartNo
this.searchData1.buDesc = ''
this.searchData1.projectDesc = ''
this.searchData1.partDesc = ''
this.searchData1.customerNo = ''
this.searchData1.customerDesc = ''
this.agencyMatters = true
this.pageIndex = 1
this.searchData.page = 1
this.searchData1.page = 1
return true
},
resolveCurrentPartSite (site) {
if (site !== null && site !== undefined && site !== '') {
return site

74
src/views/modules/sampleTracking/projectProofTracking.vue

@ -143,7 +143,13 @@
class="el-icon-success project-part-sync-icon"
aria-hidden="true"
></i>
{{ getTrackingColumnDisplayValue(scope.row, item.columnProp) }}
<a
v-if="canOpenNpiFromTracking(scope.row, item.columnProp)"
class="npi-jump-link"
href="javascript:void(0)"
@click.stop="openNpiFromTracking(item.columnProp, scope.row)"
>{{ getTrackingColumnDisplayValue(scope.row, item.columnProp) }}</a>
<span v-else>{{ getTrackingColumnDisplayValue(scope.row, item.columnProp) }}</span>
</span>
<a
v-else-if="item.columnProp === 'proofingStatus'"
@ -470,7 +476,7 @@
</el-dialog>
<el-dialog :title="oneKeyDialogTitle" :visible.sync="oneKeyDialogVisible" :close-on-click-modal="false" width="1000px">
<el-form :model="oneKeyForm" label-position="top" :class="['one-key-grid-form', { 'one-key-grid-form--detail': isOneKeyDetailMode }]">
<el-form :model="oneKeyForm" label-position="top" class="one-key-grid-form">
<el-row :gutter="16">
<el-col :span="6" v-show="isOneKeyCreateFieldVisible('buNo')">
<el-form-item label="BU" required>
@ -522,7 +528,7 @@
</el-col>
<el-col :span="12" v-show="isOneKeyCreateFieldVisible('customerDesc')">
<el-form-item label="客户名称">
<el-input v-model="oneKeyForm.customerDesc" disabled style="width: 100%"></el-input>
<el-input v-model="oneKeyForm.customerDesc" :disabled="!isOneKeyDetailMode" style="width: 100%"></el-input>
</el-form-item>
</el-col>
<el-col :span="6" v-show="isOneKeyCreateFieldVisible('cProjectRegion')">
@ -621,7 +627,7 @@
<el-col :span="6" v-show="isOneKeyCreateFieldVisible('projectManager')">
<el-form-item>
<span slot="label" class="big-label"><a href="javascript:void(0)" @click="openRoleDialog('projectManager')">PM/Sales</a></span>
<el-input v-model="oneKeyForm.projectManagerName" disabled style="width: 100%"></el-input>
<el-input v-model="oneKeyForm.projectManagerName" :disabled="!isOneKeyDetailMode" style="width: 100%"></el-input>
</el-form-item>
</el-col>
<el-col :span="6" v-show="isOneKeyCreateFieldVisible('projectOwner')">
@ -1843,6 +1849,53 @@ export default {
isSyncIconTrackingColumn (columnProp) {
return ['projectNo', 'testPartNo', 'proofingNo'].indexOf(columnProp) > -1
},
// NPI / tracking
canOpenNpiFromTracking (row, columnProp) {
if (!row || this.isBlankValue(this.getTrackingColumnDisplayValue(row, columnProp))) {
return false
}
if (columnProp === 'projectNo') {
return this.isSyncedByIdRule(row.projectId || row.project_id)
}
if (columnProp === 'testPartNo') {
return this.isSyncedByIdRule(this.getTrackingProjectPartId(row))
}
return false
},
openNpiFromTracking (columnProp, row) {
if (!this.canOpenNpiFromTracking(row, columnProp)) {
return
}
if (columnProp === 'projectNo') {
this.openNpiTab('eam-eamProjectInfo', {
projectNo: this.getTrackingColumnDisplayValue(row, 'projectNo')
})
return
}
this.openNpiTab('eam-eamProjectPartInfo', {
projectNo: this.getTrackingColumnDisplayValue(row, 'projectNo'),
testPartNo: this.getTrackingColumnDisplayValue(row, 'testPartNo')
})
},
// query
openNpiTab (routeName, query) {
const tabs = this.$store.state.common.mainTabs || []
const existingTab = tabs.find(item => item && item.name === routeName)
if (existingTab) {
this.$store.commit('common/updateMainTabs', tabs.map(item => {
if (!item || item.name !== routeName) {
return item
}
return Object.assign({}, item, { query: query })
}))
}
this.$router.push({ name: routeName, query: query }).catch((err) => {
if (err && err.name === 'NavigationDuplicated') {
return
}
this.$message.error('未找到对应NPI页面,请确认是否有菜单权限')
})
},
getTrackingColumnDisplayValue (row, columnProp) {
if (!row || !columnProp) {
return ''
@ -6116,10 +6169,6 @@ export default {
padding: 0 8px;
}
.one-key-grid-form--detail {
pointer-events: none;
}
.one-key-grid-form .el-form-item {
margin-bottom: 10px;
}
@ -6163,6 +6212,15 @@ export default {
align-items: center;
}
.npi-jump-link {
color: #0c4dbb;
cursor: pointer;
}
.npi-jump-link:hover {
text-decoration: underline;
}
.project-part-sync-icon {
margin-left: -4px;
margin-right: 2px;

Loading…
Cancel
Save