|
|
|
@ -101,7 +101,11 @@ |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="testNumber" header-align="center" align="center" label="测试编码" width="140"></el-table-column> |
|
|
|
<el-table-column prop="tester" header-align="center" align="center" label="测试人" width="180" :show-overflow-tooltip="true"></el-table-column> |
|
|
|
<el-table-column prop="testerName" header-align="center" align="center" label="测试人" width="180" :show-overflow-tooltip="true"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<span>{{ scope.row.testerName || scope.row.tester || '' }}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column fixed="right" header-align="center" align="center" width="130" label="操作"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-link v-if="authUpdate && scope.row.status !== '已完成'" style="cursor: pointer" @click="addOrUpdateHandle(scope.row)">编辑</el-link> |
|
|
|
@ -355,24 +359,20 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 45px"> |
|
|
|
<el-form-item label="测试人"> |
|
|
|
<el-select |
|
|
|
v-model="modalData.testerList" |
|
|
|
multiple |
|
|
|
filterable |
|
|
|
allow-create |
|
|
|
default-first-option |
|
|
|
clearable |
|
|
|
<el-form-item> |
|
|
|
<span style="cursor: pointer" v-if="!isLabFieldDisabled('tester')" slot="label" @click="openTesterChooseModal"><a herf="#">测试人</a></span> |
|
|
|
<span v-else slot="label">测试人</span> |
|
|
|
<el-input |
|
|
|
v-model="modalData.testerName" |
|
|
|
readonly |
|
|
|
:disabled="isLabFieldDisabled('tester')" |
|
|
|
style="width: 780px" |
|
|
|
placeholder="请输入或选择人员编码,回车添加"> |
|
|
|
<el-option |
|
|
|
v-for="item in (modalData.testerList || [])" |
|
|
|
:key="item" |
|
|
|
:label="item" |
|
|
|
:value="item"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
placeholder="请选择测试人" |
|
|
|
@focus="openTesterChooseModal"> |
|
|
|
<span slot="suffix" v-show="modalData.testerName && !isLabFieldDisabled('tester')" @click.stop="clearTesterSelection"> |
|
|
|
<i class="el-icon-circle-close" style="margin-left: 5px;cursor: pointer;"></i> |
|
|
|
</span> |
|
|
|
</el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
@ -522,6 +522,43 @@ |
|
|
|
</oss-components> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<el-dialog title="人员选择" @open="openTesterDialog" @close="closeTesterDialog" v-drag |
|
|
|
:visible.sync="testerFlag" width="40vw" :close-on-click-modal="false"> |
|
|
|
<el-form :inline="true" label-position="top" :model="testerSearchData"> |
|
|
|
<el-form-item label="编码"> |
|
|
|
<el-input v-model="testerSearchData.operatorId" clearable style="width: 120px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="名称"> |
|
|
|
<el-input v-model="testerSearchData.operatorName" clearable style="width: 120px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label=" "> |
|
|
|
<el-button type="primary" @click="filterTesterOptions">查询</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-table v-if="testerFlag" |
|
|
|
:height="300" |
|
|
|
:data="testerDisplayList" |
|
|
|
@selection-change="handleTesterSelectionChange" |
|
|
|
@row-click="(row,column,event) => handleTesterTableClick(row,column,event,'testerTable')" |
|
|
|
ref="testerTable" |
|
|
|
border row-key="operatorId" |
|
|
|
style="width: 100%;"> |
|
|
|
<el-table-column |
|
|
|
type="selection" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
:reserve-selection="true" |
|
|
|
width="50"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column label="编码" property="operatorId" align="left" header-align="center"/> |
|
|
|
<el-table-column label="名称" property="operatorName" align="left" header-align="center"/> |
|
|
|
</el-table> |
|
|
|
<el-footer style="height:40px;margin-top: 20px;text-align:center"> |
|
|
|
<el-button type="primary" @click="saveTesterChooseModal">确定</el-button> |
|
|
|
<el-button type="primary" @click="testerFlag = false">关闭</el-button> |
|
|
|
</el-footer> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<el-dialog title="选择-项目" :close-on-click-modal="false" @close="closeProjectInfoDialog" |
|
|
|
@open="searchProjectInfoList" :visible.sync="chooseProjectListFlag" width="35%"> |
|
|
|
<el-form label-position="top" :model="searchProjectData" ref="closeProjectInfoForm"> |
|
|
|
@ -577,7 +614,7 @@ |
|
|
|
|
|
|
|
<script> |
|
|
|
import * as api from '@/api/lab/lab' |
|
|
|
import { getSiteList } from '@/api/base/site' |
|
|
|
import { getSiteList, searchUserListForRole } from '@/api/base/site' |
|
|
|
import { queryOss, previewOssFileById } from '@/api/oss/oss' |
|
|
|
import { checkSuperAdmin } from '@/api/changeManagement/changeManagement' |
|
|
|
import { verifyData } from '@/api/chooselist/chooselist.js' |
|
|
|
@ -719,7 +756,15 @@ export default { |
|
|
|
propertyModelList: [], |
|
|
|
propertyItemList: [], |
|
|
|
propertyItemSelections: [], |
|
|
|
propertyChooseData: this.buildDefaultPropertyChooseData() |
|
|
|
propertyChooseData: this.buildDefaultPropertyChooseData(), |
|
|
|
testerOptionList: [], |
|
|
|
testerDisplayList: [], |
|
|
|
testerSelectionCache: [], |
|
|
|
testerFlag: false, |
|
|
|
testerSearchData: { |
|
|
|
operatorId: '', |
|
|
|
operatorName: '' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
created () { |
|
|
|
@ -811,6 +856,8 @@ export default { |
|
|
|
departmentManagerComments: '', |
|
|
|
labComments: '', |
|
|
|
tester: '', |
|
|
|
testerName: '', |
|
|
|
testerCodeList: [], |
|
|
|
testerList: [], |
|
|
|
status: '草稿', |
|
|
|
stepId: 10, |
|
|
|
@ -854,11 +901,23 @@ export default { |
|
|
|
} |
|
|
|
this.testSpecDialogVisible = false |
|
|
|
this.testReportDialogVisible = false |
|
|
|
this.testerFlag = false |
|
|
|
this.testerOptionList = [] |
|
|
|
this.testerDisplayList = [] |
|
|
|
this.testerSelectionCache = [] |
|
|
|
this.testerSearchData = { |
|
|
|
operatorId: '', |
|
|
|
operatorName: '' |
|
|
|
} |
|
|
|
this.modalData.customerId = '' |
|
|
|
this.modalData.customerName = '' |
|
|
|
this.modalData.projectId = '' |
|
|
|
this.modalData.projectName = '' |
|
|
|
this.modalData.projectIdFlag = true |
|
|
|
this.$set(this.modalData, 'testerCodeList', []) |
|
|
|
this.$set(this.modalData, 'testerList', []) |
|
|
|
this.$set(this.modalData, 'tester', '') |
|
|
|
this.$set(this.modalData, 'testerName', '') |
|
|
|
this.$set(this.modalData, 'propertyItemList', []) |
|
|
|
this.judgeCriteriaFileList = [] |
|
|
|
this.testReportFileList = [] |
|
|
|
@ -1275,7 +1334,7 @@ export default { |
|
|
|
}, |
|
|
|
getLabSubmitFieldValue (fieldId) { |
|
|
|
if (fieldId === 'tester') { |
|
|
|
return this.modalData.testerList |
|
|
|
return this.modalData.testerCodeList |
|
|
|
} |
|
|
|
return this.modalData[fieldId] |
|
|
|
}, |
|
|
|
@ -1318,10 +1377,149 @@ export default { |
|
|
|
}) |
|
|
|
return uniqueList |
|
|
|
}, |
|
|
|
normalizeTesterOptionList (rows) { |
|
|
|
if (!Array.isArray(rows)) { |
|
|
|
return [] |
|
|
|
} |
|
|
|
return rows |
|
|
|
.map(item => { |
|
|
|
const operatorId = String(item.operatorId || item.operator_id || item.username || item.userName || '').trim() |
|
|
|
const operatorName = String(item.operatorName || item.operator_name || item.userDisplay || item.user_display || '').trim() |
|
|
|
if (!operatorId || !operatorName) { |
|
|
|
return null |
|
|
|
} |
|
|
|
return { |
|
|
|
operatorId, |
|
|
|
operatorName |
|
|
|
} |
|
|
|
}) |
|
|
|
.filter(item => !!item) |
|
|
|
}, |
|
|
|
resolveTesterNameById (operatorId) { |
|
|
|
const normalizedId = String(operatorId || '').trim() |
|
|
|
if (!normalizedId) { |
|
|
|
return '' |
|
|
|
} |
|
|
|
const target = (this.testerOptionList || []).find(item => String(item.operatorId || '').trim() === normalizedId) |
|
|
|
return target ? String(target.operatorName || '').trim() : normalizedId |
|
|
|
}, |
|
|
|
syncTesterField () { |
|
|
|
const testerList = this.normalizeTesterList(this.modalData.testerList || []) |
|
|
|
const testerList = this.normalizeTesterList(this.modalData.testerCodeList || this.modalData.testerList || this.modalData.tester) |
|
|
|
this.$set(this.modalData, 'testerCodeList', testerList) |
|
|
|
this.$set(this.modalData, 'testerList', testerList) |
|
|
|
this.$set(this.modalData, 'tester', testerList.join(';')) |
|
|
|
this.$set(this.modalData, 'testerName', testerList.map(item => this.resolveTesterNameById(item)).join(';')) |
|
|
|
}, |
|
|
|
filterTesterOptions () { |
|
|
|
const operatorIdKeyword = String(this.testerSearchData.operatorId || '').trim().toUpperCase() |
|
|
|
const operatorNameKeyword = String(this.testerSearchData.operatorName || '').trim().toUpperCase() |
|
|
|
this.testerDisplayList = (this.testerOptionList || []).filter(item => { |
|
|
|
const operatorId = String(item.operatorId || '').toUpperCase() |
|
|
|
const operatorName = String(item.operatorName || '').toUpperCase() |
|
|
|
const matchOperatorId = !operatorIdKeyword || operatorId.includes(operatorIdKeyword) |
|
|
|
const matchOperatorName = !operatorNameKeyword || operatorName.includes(operatorNameKeyword) |
|
|
|
return matchOperatorId && matchOperatorName |
|
|
|
}) |
|
|
|
}, |
|
|
|
loadTesterOptions () { |
|
|
|
if (!this.modalData || !this.modalData.site) { |
|
|
|
this.testerOptionList = [] |
|
|
|
this.testerDisplayList = [] |
|
|
|
this.testerSelectionCache = [] |
|
|
|
return Promise.resolve() |
|
|
|
} |
|
|
|
const params = { |
|
|
|
site: this.modalData.site, |
|
|
|
roleNo: 'R015', |
|
|
|
active: 'Y' |
|
|
|
} |
|
|
|
return searchUserListForRole(params).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
const roleUserSet = new Set( |
|
|
|
(Array.isArray(data.searchUserListForRole) ? data.searchUserListForRole : []) |
|
|
|
.map(item => String(item || '').trim()) |
|
|
|
.filter(item => !!item) |
|
|
|
) |
|
|
|
const userList = (Array.isArray(data.userList) ? data.userList : []).filter(item => { |
|
|
|
const username = String(item.username || item.userName || '').trim() |
|
|
|
return !!username && roleUserSet.has(username) |
|
|
|
}) |
|
|
|
this.testerOptionList = this.normalizeTesterOptionList(userList) |
|
|
|
this.filterTesterOptions() |
|
|
|
this.testerSelectionCache = [] |
|
|
|
this.syncTesterField() |
|
|
|
} else { |
|
|
|
this.testerOptionList = [] |
|
|
|
this.testerDisplayList = [] |
|
|
|
this.testerSelectionCache = [] |
|
|
|
} |
|
|
|
}).catch(() => { |
|
|
|
this.testerOptionList = [] |
|
|
|
this.testerDisplayList = [] |
|
|
|
this.testerSelectionCache = [] |
|
|
|
}) |
|
|
|
}, |
|
|
|
openTesterChooseModal () { |
|
|
|
if (this.isLabFieldDisabled('tester')) { |
|
|
|
return |
|
|
|
} |
|
|
|
if (!this.modalData || !String(this.modalData.site || '').trim()) { |
|
|
|
this.$message.warning('请先选择工厂') |
|
|
|
return |
|
|
|
} |
|
|
|
this.loadTesterOptions().then(() => { |
|
|
|
if (!this.testerOptionList || this.testerOptionList.length === 0) { |
|
|
|
this.$message.warning('未查询到可选测试人') |
|
|
|
return |
|
|
|
} |
|
|
|
this.testerFlag = true |
|
|
|
}) |
|
|
|
}, |
|
|
|
openTesterDialog () { |
|
|
|
this.testerSearchData = { |
|
|
|
operatorId: '', |
|
|
|
operatorName: '' |
|
|
|
} |
|
|
|
this.filterTesterOptions() |
|
|
|
const selectedOperatorSet = new Set( |
|
|
|
(this.modalData.testerCodeList || []) |
|
|
|
.map(item => String(item || '').trim()) |
|
|
|
.filter(item => !!item) |
|
|
|
) |
|
|
|
const selectedRows = (this.testerOptionList || []).filter(item => selectedOperatorSet.has(String(item.operatorId || '').trim())) |
|
|
|
this.testerSelectionCache = JSON.parse(JSON.stringify(selectedRows)) |
|
|
|
this.$nextTick(() => { |
|
|
|
if (!this.$refs.testerTable) { |
|
|
|
return |
|
|
|
} |
|
|
|
this.$refs.testerTable.clearSelection() |
|
|
|
selectedRows.forEach(item => { |
|
|
|
this.$refs.testerTable.toggleRowSelection(item, true) |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
closeTesterDialog () { |
|
|
|
this.testerSelectionCache = [] |
|
|
|
}, |
|
|
|
handleTesterSelectionChange (rows) { |
|
|
|
this.testerSelectionCache = rows || [] |
|
|
|
}, |
|
|
|
handleTesterTableClick (row, column, event, tableRef) { |
|
|
|
if (this.$refs[tableRef]) { |
|
|
|
this.$refs[tableRef].toggleRowSelection(row) |
|
|
|
} |
|
|
|
}, |
|
|
|
saveTesterChooseModal () { |
|
|
|
const selectedCodes = (this.testerSelectionCache || []) |
|
|
|
.map(item => String(item.operatorId || '').trim()) |
|
|
|
.filter(item => !!item) |
|
|
|
this.$set(this.modalData, 'testerCodeList', selectedCodes) |
|
|
|
this.syncTesterField() |
|
|
|
this.testerFlag = false |
|
|
|
}, |
|
|
|
clearTesterSelection () { |
|
|
|
this.$set(this.modalData, 'testerCodeList', []) |
|
|
|
this.syncTesterField() |
|
|
|
}, |
|
|
|
isCurrentApprover () { |
|
|
|
return this.superAdmin || (this.modalData.createBy2 && this.modalData.createBy2.split(';').includes(this.createBy2)) |
|
|
|
@ -1419,6 +1617,7 @@ export default { |
|
|
|
applicantName: '', |
|
|
|
customerName: '', |
|
|
|
projectName: '', |
|
|
|
testerName: '', |
|
|
|
nodeId: '', |
|
|
|
nodeName: '', |
|
|
|
currentApprover: '', |
|
|
|
@ -1489,6 +1688,7 @@ export default { |
|
|
|
row.testStartDate = this.normalizeDateOnly(row.testStartDate) |
|
|
|
row.completedDate = this.normalizeDateOnly(row.completedDate) |
|
|
|
row.returnSample = this.displayYesNo(row.returnSample) |
|
|
|
row.testerName = row.testerName || row.tester || '' |
|
|
|
return row |
|
|
|
}) |
|
|
|
} else { |
|
|
|
@ -1543,6 +1743,14 @@ export default { |
|
|
|
this.activeName = 'basicInfo' |
|
|
|
this.submitModalFlag = false |
|
|
|
this.rejectOpinion = '' |
|
|
|
this.testerFlag = false |
|
|
|
this.testerOptionList = [] |
|
|
|
this.testerDisplayList = [] |
|
|
|
this.testerSelectionCache = [] |
|
|
|
this.testerSearchData = { |
|
|
|
operatorId: '', |
|
|
|
operatorName: '' |
|
|
|
} |
|
|
|
this.plmLabAuthorityArr = [] |
|
|
|
this.nodeAuthorityLoaded = !row |
|
|
|
this.isEditMode = !!row |
|
|
|
@ -1560,13 +1768,16 @@ export default { |
|
|
|
} |
|
|
|
this.fillDisplayFields(this.modalData, row || {}) |
|
|
|
this.$set(this.modalData, 'propertyItemList', (detail.propertyItemList || []).map(item => this.normalizePropertyItem(item))) |
|
|
|
this.$set(this.modalData, 'testerList', this.normalizeTesterList(this.modalData.tester)) |
|
|
|
this.$set(this.modalData, 'testerCodeList', this.normalizeTesterList(this.modalData.tester)) |
|
|
|
this.$set(this.modalData, 'testerList', this.modalData.testerCodeList || []) |
|
|
|
this.$set(this.modalData, 'customerIdFlag', true) |
|
|
|
this.$set(this.modalData, 'projectIdFlag', true) |
|
|
|
this.$set(this.modalData, 'createBy2', '') |
|
|
|
this.$set(this.modalData, 'isReject', 'Y') |
|
|
|
this.$set(this.modalData, 'tpProcessControl', 'N') |
|
|
|
this.$set(this.modalData, 'csProcessControl', 'N') |
|
|
|
this.$set(this.modalData, 'testerName', this.modalData.testerName || this.modalData.tester || '') |
|
|
|
this.loadTesterOptions() |
|
|
|
this.loadModalButtonCondition() |
|
|
|
this.loadNodeAuthority(this.modalData.site || row.site, this.modalData.stepId !== null && this.modalData.stepId !== undefined ? this.modalData.stepId : 10) |
|
|
|
this.refreshJudgeCriteriaFileList() |
|
|
|
@ -1598,7 +1809,9 @@ export default { |
|
|
|
rejectFlag: 'N' |
|
|
|
} |
|
|
|
this.$set(this.modalData, 'propertyItemList', []) |
|
|
|
this.$set(this.modalData, 'testerCodeList', []) |
|
|
|
this.$set(this.modalData, 'testerList', []) |
|
|
|
this.$set(this.modalData, 'testerName', '') |
|
|
|
this.judgeCriteriaFileList = [] |
|
|
|
this.testReportFileList = [] |
|
|
|
this.searchProjectData.site = defaultSite |
|
|
|
@ -1632,6 +1845,7 @@ export default { |
|
|
|
this.judgeCriteriaDialogVisible = false |
|
|
|
this.testSpecDialogVisible = false |
|
|
|
this.testReportDialogVisible = false |
|
|
|
this.testerFlag = false |
|
|
|
this.modalFlag = false |
|
|
|
}, |
|
|
|
buildLabPayload (source) { |
|
|
|
|