|
|
@ -124,7 +124,7 @@ |
|
|
<el-dialog |
|
|
<el-dialog |
|
|
:title="modalTitle" |
|
|
:title="modalTitle" |
|
|
:visible.sync="modalFlag" |
|
|
:visible.sync="modalFlag" |
|
|
width="980px" |
|
|
|
|
|
|
|
|
width="1010px" |
|
|
top="10vh" |
|
|
top="10vh" |
|
|
v-drag |
|
|
v-drag |
|
|
:close-on-click-modal="false" |
|
|
:close-on-click-modal="false" |
|
|
@ -134,14 +134,21 @@ |
|
|
<el-tab-pane label="基本信息" name="basicInfo"> |
|
|
<el-tab-pane label="基本信息" name="basicInfo"> |
|
|
<div style="height: 635px; overflow-y: auto;"> |
|
|
<div style="height: 635px; overflow-y: auto;"> |
|
|
<el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -5px;"> |
|
|
<el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -5px;"> |
|
|
<el-form-item label="序列号/Reference No"> |
|
|
|
|
|
<el-input v-model="modalData.referenceNo" disabled style="width: 180px"></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item> |
|
|
<el-form-item> |
|
|
<span style="cursor: pointer" v-if="!isLabFieldDisabled('applicant')" slot="label" @click="getBaseList(103, 1)"><a herf="#">申请人/Applicant</a></span> |
|
|
<span style="cursor: pointer" v-if="!isLabFieldDisabled('applicant')" slot="label" @click="getBaseList(103, 1)"><a herf="#">申请人/Applicant</a></span> |
|
|
<span v-else slot="label">申请人/Applicant</span> |
|
|
<span v-else slot="label">申请人/Applicant</span> |
|
|
<el-input v-model="modalData.applicant" @blur="applicantBlur(103)" :disabled="isLabFieldDisabled('applicant')" style="width: 140px"></el-input> |
|
|
|
|
|
<el-input v-model="modalData.applicantName" disabled style="width: 180px"></el-input> |
|
|
|
|
|
|
|
|
<el-input v-model="modalData.applicant" @blur="applicantBlur(103)" :disabled="isLabFieldDisabled('applicant')" style="width: 150px"></el-input> |
|
|
|
|
|
<el-input v-model="modalData.applicantName" disabled style="width: 240px"></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="申请工厂/Site"> |
|
|
|
|
|
<el-select v-model="modalData.site" :disabled="isEditMode || showModalFlag" style="width: 170px" @change="handleModalSiteChange"> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="item in siteOptions" |
|
|
|
|
|
:key="item.siteID" |
|
|
|
|
|
:label="item.siteID + '-' + item.siteName" |
|
|
|
|
|
:value="item.siteID"> |
|
|
|
|
|
</el-option> |
|
|
|
|
|
</el-select> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<el-form-item label="申请日期/Application Date"> |
|
|
<el-form-item label="申请日期/Application Date"> |
|
|
<el-date-picker v-model="modalData.applicationDate" type="date" value-format="yyyy-MM-dd" :disabled="isLabFieldDisabled('applicationDate')" style="width: 170px" :editable="false"></el-date-picker> |
|
|
<el-date-picker v-model="modalData.applicationDate" type="date" value-format="yyyy-MM-dd" :disabled="isLabFieldDisabled('applicationDate')" style="width: 170px" :editable="false"></el-date-picker> |
|
|
@ -149,11 +156,7 @@ |
|
|
</el-form> |
|
|
</el-form> |
|
|
|
|
|
|
|
|
<el-form :inline="true" label-position="top" :model="modalData"> |
|
|
<el-form :inline="true" label-position="top" :model="modalData"> |
|
|
<el-form-item label="申请工厂/Site"> |
|
|
|
|
|
<el-select v-model="modalData.site" :disabled="true" style="width: 160px"> |
|
|
|
|
|
<el-option :label="$store.state.user.site" :value="$store.state.user.site"></el-option> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
|
|
|
|
<el-form-item label="申请部门/Apply Department"> |
|
|
<el-form-item label="申请部门/Apply Department"> |
|
|
<el-input v-model="modalData.applyDepartment" :disabled="isLabFieldDisabled('applyDepartment')" style="width: 170px"></el-input> |
|
|
<el-input v-model="modalData.applyDepartment" :disabled="isLabFieldDisabled('applyDepartment')" style="width: 170px"></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
@ -233,6 +236,42 @@ |
|
|
<el-input type="textarea" :rows="3" v-model="modalData.attention" :disabled="isLabFieldDisabled('attention')" resize="none" style="width: 780px"></el-input> |
|
|
<el-input type="textarea" :rows="3" v-model="modalData.attention" :disabled="isLabFieldDisabled('attention')" resize="none" style="width: 780px"></el-input> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
|
|
|
|
|
|
|
|
|
<el-form :inline="true" label-position="top"> |
|
|
|
|
|
<el-form-item label=" "> |
|
|
|
|
|
<el-button type="primary" :disabled="showModalFlag" @click="openPropertyChooseModal">选择属性信息</el-button> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
|
|
|
|
|
|
<div class="rq" style="width: 780px;"> |
|
|
|
|
|
<el-table |
|
|
|
|
|
:data="modalData.propertyItemList" |
|
|
|
|
|
border |
|
|
|
|
|
:height="220" |
|
|
|
|
|
style="width: 100%;"> |
|
|
|
|
|
<el-table-column prop="itemNo" header-align="center" align="center" label="属性编码" width="100"></el-table-column> |
|
|
|
|
|
<el-table-column prop="itemDesc" header-align="center" align="left" label="属性名称" min-width="200"></el-table-column> |
|
|
|
|
|
<el-table-column header-align="center" align="center" label="属性值" min-width="240"> |
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
|
<el-select |
|
|
|
|
|
v-if="scope.row.valueChooseFlag === 'Y'" |
|
|
|
|
|
v-model="scope.row.itemValue" |
|
|
|
|
|
:disabled="showModalFlag" |
|
|
|
|
|
clearable |
|
|
|
|
|
filterable |
|
|
|
|
|
style="width: 100%;"> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="(option, index) in (scope.row.availableValueList || [])" |
|
|
|
|
|
:key="scope.row.itemNo + '-' + index + '-' + option.availableValue" |
|
|
|
|
|
:label="option.availableValue" |
|
|
|
|
|
:value="option.availableValue"> |
|
|
|
|
|
</el-option> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
<el-input v-else v-model="scope.row.itemValue" :disabled="showModalFlag" clearable></el-input> |
|
|
|
|
|
</template> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</el-tab-pane> |
|
|
</el-tab-pane> |
|
|
|
|
|
|
|
|
@ -324,6 +363,54 @@ |
|
|
</div> |
|
|
</div> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="属性清单" :close-on-click-modal="false" v-drag :visible.sync="propertyChooseModalFlag" width="820px"> |
|
|
|
|
|
<div class="rq"> |
|
|
|
|
|
<el-form :inline="true" label-position="top" :model="propertyChooseData"> |
|
|
|
|
|
<el-form-item label="模板"> |
|
|
|
|
|
<el-select v-model="propertyChooseData.codeNo" placeholder="请选择模板" style="width: 180px"> |
|
|
|
|
|
<el-option |
|
|
|
|
|
v-for="item in propertyModelList" |
|
|
|
|
|
:key="item.codeNo" |
|
|
|
|
|
:label="item.codeDesc" |
|
|
|
|
|
:value="item.codeNo"> |
|
|
|
|
|
</el-option> |
|
|
|
|
|
</el-select> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="属性编码"> |
|
|
|
|
|
<el-input v-model="propertyChooseData.itemNo" clearable style="width: 140px"></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item label="属性名称"> |
|
|
|
|
|
<el-input v-model="propertyChooseData.itemDesc" clearable style="width: 140px"></el-input> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item :label="' '"> |
|
|
|
|
|
<el-button type="primary" @click="searchPropertyItemList()">查询</el-button> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
<el-table |
|
|
|
|
|
:height="320" |
|
|
|
|
|
:data="propertyItemList" |
|
|
|
|
|
ref="propertyItemTable" |
|
|
|
|
|
@row-click="propertyItemClickRow" |
|
|
|
|
|
@selection-change="selectionPropertyItem" |
|
|
|
|
|
border |
|
|
|
|
|
style="width: 100%;"> |
|
|
|
|
|
<el-table-column |
|
|
|
|
|
type="selection" |
|
|
|
|
|
header-align="center" |
|
|
|
|
|
align="center" |
|
|
|
|
|
width="50"> |
|
|
|
|
|
</el-table-column> |
|
|
|
|
|
<el-table-column prop="itemNo" header-align="center" align="center" label="属性编码" width="180"></el-table-column> |
|
|
|
|
|
<el-table-column prop="itemDesc" header-align="center" align="left" label="属性名称" min-width="300"></el-table-column> |
|
|
|
|
|
<el-table-column prop="defaultValue" header-align="center" align="left" label="参照值" min-width="180"></el-table-column> |
|
|
|
|
|
</el-table> |
|
|
|
|
|
</div> |
|
|
|
|
|
<el-footer style="height:40px;margin-top: 20px;text-align:center"> |
|
|
|
|
|
<el-button type="primary" @click="confirmPropertyItem">确认</el-button> |
|
|
|
|
|
<el-button type="primary" @click="propertyChooseModalFlag = false">关闭</el-button> |
|
|
|
|
|
</el-footer> |
|
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
<el-dialog title="选择-项目" :close-on-click-modal="false" @close="closeProjectInfoDialog" |
|
|
<el-dialog title="选择-项目" :close-on-click-modal="false" @close="closeProjectInfoDialog" |
|
|
@open="searchProjectInfoList" :visible.sync="chooseProjectListFlag" width="35%"> |
|
|
@open="searchProjectInfoList" :visible.sync="chooseProjectListFlag" width="35%"> |
|
|
<el-form label-position="top" :model="searchProjectData" ref="closeProjectInfoForm"> |
|
|
<el-form label-position="top" :model="searchProjectData" ref="closeProjectInfoForm"> |
|
|
@ -357,7 +444,6 @@ |
|
|
<el-tabs v-model="activeTable" type="border-card" style="margin-top: 6px; width: 100%; min-height: 300px;" @tab-click="tabClick"> |
|
|
<el-tabs v-model="activeTable" type="border-card" style="margin-top: 6px; width: 100%; min-height: 300px;" @tab-click="tabClick"> |
|
|
<el-tab-pane label="基本信息" name="basicInfo"> |
|
|
<el-tab-pane label="基本信息" name="basicInfo"> |
|
|
<el-form :inline="true" label-position="top" :model="currentRow" style="margin-top: 5px;"> |
|
|
<el-form :inline="true" label-position="top" :model="currentRow" style="margin-top: 5px;"> |
|
|
<el-form-item label="序列号"><el-input :value="currentRow.referenceNo || ''" disabled style="width: 180px"></el-input></el-form-item> |
|
|
|
|
|
<el-form-item label="申请人"><el-input :value="currentRow.applicant || ''" disabled style="width: 150px"></el-input></el-form-item> |
|
|
<el-form-item label="申请人"><el-input :value="currentRow.applicant || ''" disabled style="width: 150px"></el-input></el-form-item> |
|
|
<el-form-item label="申请人名称"><el-input :value="currentRow.applicantName || ''" disabled style="width: 180px"></el-input></el-form-item> |
|
|
<el-form-item label="申请人名称"><el-input :value="currentRow.applicantName || ''" disabled style="width: 180px"></el-input></el-form-item> |
|
|
<el-form-item label="申请日期"><el-input :value="normalizeDateOnly(currentRow.applicationDate)" disabled style="width: 150px"></el-input></el-form-item> |
|
|
<el-form-item label="申请日期"><el-input :value="normalizeDateOnly(currentRow.applicationDate)" disabled style="width: 150px"></el-input></el-form-item> |
|
|
@ -380,6 +466,7 @@ |
|
|
|
|
|
|
|
|
<script> |
|
|
<script> |
|
|
import * as api from '@/api/lab/lab' |
|
|
import * as api from '@/api/lab/lab' |
|
|
|
|
|
import { getSiteList } from '@/api/base/site' |
|
|
import { checkSuperAdmin } from '@/api/changeManagement/changeManagement' |
|
|
import { checkSuperAdmin } from '@/api/changeManagement/changeManagement' |
|
|
import { verifyData } from '@/api/chooselist/chooselist.js' |
|
|
import { verifyData } from '@/api/chooselist/chooselist.js' |
|
|
import { searchProjectInfoList } from '@/api/quotation/quotationInformation.js' |
|
|
import { searchProjectInfoList } from '@/api/quotation/quotationInformation.js' |
|
|
@ -398,7 +485,7 @@ export default { |
|
|
data () { |
|
|
data () { |
|
|
return { |
|
|
return { |
|
|
searchData: { |
|
|
searchData: { |
|
|
site: this.$store.state.user.site, |
|
|
|
|
|
|
|
|
site: '', |
|
|
referenceNo: '', |
|
|
referenceNo: '', |
|
|
status: '', |
|
|
status: '', |
|
|
currentApprover: '', |
|
|
currentApprover: '', |
|
|
@ -445,6 +532,7 @@ export default { |
|
|
tagNo: null, |
|
|
tagNo: null, |
|
|
tagNo1: null, |
|
|
tagNo1: null, |
|
|
modalFlag: false, |
|
|
modalFlag: false, |
|
|
|
|
|
siteOptions: [], |
|
|
chooseProjectListFlag: false, |
|
|
chooseProjectListFlag: false, |
|
|
searchProjectData: { |
|
|
searchProjectData: { |
|
|
site: '', |
|
|
site: '', |
|
|
@ -453,13 +541,19 @@ export default { |
|
|
customerId: undefined |
|
|
customerId: undefined |
|
|
}, |
|
|
}, |
|
|
projectList: [], |
|
|
projectList: [], |
|
|
modalData: this.buildDefaultModalData() |
|
|
|
|
|
|
|
|
modalData: this.buildDefaultModalData(), |
|
|
|
|
|
propertyChooseModalFlag: false, |
|
|
|
|
|
propertyModelList: [], |
|
|
|
|
|
propertyItemList: [], |
|
|
|
|
|
propertyItemSelections: [], |
|
|
|
|
|
propertyChooseData: this.buildDefaultPropertyChooseData() |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
created () { |
|
|
created () { |
|
|
this.menuId = this.$route.meta.menuId |
|
|
this.menuId = this.$route.meta.menuId |
|
|
this.getButtonAuthData() |
|
|
this.getButtonAuthData() |
|
|
this.checkSuperAdmin() |
|
|
this.checkSuperAdmin() |
|
|
|
|
|
this.loadSiteOptions() |
|
|
}, |
|
|
}, |
|
|
mounted () { |
|
|
mounted () { |
|
|
this.fetchNodeOptions() |
|
|
this.fetchNodeOptions() |
|
|
@ -472,6 +566,44 @@ export default { |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
buildDefaultPropertyChooseData () { |
|
|
|
|
|
const currentSite = this.modalData && this.modalData.site ? this.modalData.site : this.$store.state.user.site |
|
|
|
|
|
return { |
|
|
|
|
|
site: currentSite, |
|
|
|
|
|
functionType: 'LAB', |
|
|
|
|
|
codeNo: '', |
|
|
|
|
|
itemNo: '', |
|
|
|
|
|
itemDesc: '' |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
getDefaultSiteValue () { |
|
|
|
|
|
const loginSite = this.$store.state.user.site || '' |
|
|
|
|
|
if (this.siteOptions.some(item => item.siteID === loginSite)) { |
|
|
|
|
|
return loginSite |
|
|
|
|
|
} |
|
|
|
|
|
if (this.siteOptions.length > 0) { |
|
|
|
|
|
return this.siteOptions[0].siteID || loginSite |
|
|
|
|
|
} |
|
|
|
|
|
return loginSite |
|
|
|
|
|
}, |
|
|
|
|
|
loadSiteOptions () { |
|
|
|
|
|
getSiteList().then(({data}) => { |
|
|
|
|
|
if (data && data.code === 0 && Array.isArray(data.rows)) { |
|
|
|
|
|
this.siteOptions = data.rows |
|
|
|
|
|
} else { |
|
|
|
|
|
this.siteOptions = [] |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
this.siteOptions = [] |
|
|
|
|
|
}).finally(() => { |
|
|
|
|
|
if (this.siteOptions.length === 0 && this.$store.state.user.site) { |
|
|
|
|
|
this.siteOptions = [{ |
|
|
|
|
|
siteID: this.$store.state.user.site, |
|
|
|
|
|
siteName: this.$store.state.user.site |
|
|
|
|
|
}] |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
buildDefaultModalData () { |
|
|
buildDefaultModalData () { |
|
|
return { |
|
|
return { |
|
|
site: this.$store.state.user.site, |
|
|
site: this.$store.state.user.site, |
|
|
@ -514,16 +646,18 @@ export default { |
|
|
createBy2: '', |
|
|
createBy2: '', |
|
|
isReject: 'Y', |
|
|
isReject: 'Y', |
|
|
tpProcessControl: 'N', |
|
|
tpProcessControl: 'N', |
|
|
csProcessControl: 'N' |
|
|
|
|
|
|
|
|
csProcessControl: 'N', |
|
|
|
|
|
propertyItemList: [] |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
fetchNodeOptions () { |
|
|
fetchNodeOptions () { |
|
|
if (!this.searchData.site || !this.menuId) { |
|
|
|
|
|
|
|
|
if (!this.menuId) { |
|
|
this.nodeOptions = [] |
|
|
this.nodeOptions = [] |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
const siteForNode = this.searchData.site || this.$store.state.user.site |
|
|
const params = { |
|
|
const params = { |
|
|
site: this.searchData.site, |
|
|
|
|
|
|
|
|
site: siteForNode, |
|
|
menuId: this.menuId |
|
|
menuId: this.menuId |
|
|
} |
|
|
} |
|
|
api.getNodeList(params).then(({data}) => { |
|
|
api.getNodeList(params).then(({data}) => { |
|
|
@ -541,6 +675,18 @@ export default { |
|
|
this.nodeOptions = [] |
|
|
this.nodeOptions = [] |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
handleModalSiteChange (site) { |
|
|
|
|
|
if (!site || this.isEditMode) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.modalData.customerId = '' |
|
|
|
|
|
this.modalData.customerName = '' |
|
|
|
|
|
this.modalData.projectId = '' |
|
|
|
|
|
this.modalData.projectName = '' |
|
|
|
|
|
this.modalData.projectIdFlag = true |
|
|
|
|
|
this.$set(this.modalData, 'propertyItemList', []) |
|
|
|
|
|
this.searchProjectData.site = site |
|
|
|
|
|
}, |
|
|
loadNodeAuthority (site, stepId) { |
|
|
loadNodeAuthority (site, stepId) { |
|
|
if (!site || stepId === null || stepId === undefined || !this.menuId) { |
|
|
if (!site || stepId === null || stepId === undefined || !this.menuId) { |
|
|
this.plmLabAuthorityArr = [] |
|
|
this.plmLabAuthorityArr = [] |
|
|
@ -612,6 +758,175 @@ export default { |
|
|
} |
|
|
} |
|
|
return value || '' |
|
|
return value || '' |
|
|
}, |
|
|
}, |
|
|
|
|
|
resolvePropertyDefaultValue (item) { |
|
|
|
|
|
if (item && item.defaultValue !== null && item.defaultValue !== undefined && String(item.defaultValue).trim() !== '') { |
|
|
|
|
|
return String(item.defaultValue).trim() |
|
|
|
|
|
} |
|
|
|
|
|
if (item && item.valueChooseFlag === 'Y' && Array.isArray(item.availableValueList) && item.availableValueList.length > 0) { |
|
|
|
|
|
const firstValue = item.availableValueList[0].availableValue |
|
|
|
|
|
return firstValue === null || firstValue === undefined ? '' : String(firstValue) |
|
|
|
|
|
} |
|
|
|
|
|
return '' |
|
|
|
|
|
}, |
|
|
|
|
|
normalizePropertyItem (item) { |
|
|
|
|
|
const raw = item || {} |
|
|
|
|
|
const availableValueList = Array.isArray(raw.availableValueList) ? raw.availableValueList.map(option => ({ |
|
|
|
|
|
itemNo: raw.itemNo || '', |
|
|
|
|
|
availableValue: option && option.availableValue !== undefined && option.availableValue !== null ? String(option.availableValue) : '' |
|
|
|
|
|
})).filter(option => option.availableValue !== '') : [] |
|
|
|
|
|
const defaultValue = raw.defaultValue === null || raw.defaultValue === undefined ? '' : String(raw.defaultValue) |
|
|
|
|
|
if (defaultValue && !availableValueList.some(option => option.availableValue === defaultValue)) { |
|
|
|
|
|
availableValueList.unshift({ |
|
|
|
|
|
itemNo: raw.itemNo || '', |
|
|
|
|
|
availableValue: defaultValue |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
const itemValueSource = raw.itemValue !== undefined && raw.itemValue !== null ? raw.itemValue : raw.chooseValue |
|
|
|
|
|
const itemValue = itemValueSource === undefined || itemValueSource === null || String(itemValueSource).trim() === '' |
|
|
|
|
|
? this.resolvePropertyDefaultValue({ ...raw, defaultValue, availableValueList }) |
|
|
|
|
|
: String(itemValueSource) |
|
|
|
|
|
return { |
|
|
|
|
|
site: raw.site || this.modalData.site || this.$store.state.user.site, |
|
|
|
|
|
referenceNo: raw.referenceNo || this.modalData.referenceNo || '', |
|
|
|
|
|
seqNo: raw.seqNo || 0, |
|
|
|
|
|
itemNo: raw.itemNo || '', |
|
|
|
|
|
itemDesc: raw.itemDesc || '', |
|
|
|
|
|
itemValue: itemValue, |
|
|
|
|
|
valueChooseFlag: raw.valueChooseFlag || 'N', |
|
|
|
|
|
defaultValue: defaultValue, |
|
|
|
|
|
availableValueList: availableValueList |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
loadPropertyModelList () { |
|
|
|
|
|
const params = { |
|
|
|
|
|
site: this.modalData.site, |
|
|
|
|
|
functionType: 'LAB', |
|
|
|
|
|
codeNo: '', |
|
|
|
|
|
codeDesc: '' |
|
|
|
|
|
} |
|
|
|
|
|
return api.getLabPropertyModelList(params).then(({data}) => { |
|
|
|
|
|
if (data && data.code === 0) { |
|
|
|
|
|
this.propertyModelList = data.data || [] |
|
|
|
|
|
} else { |
|
|
|
|
|
this.propertyModelList = [] |
|
|
|
|
|
this.$message.warning((data && data.msg) || '查询Lab属性模板失败') |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
this.propertyModelList = [] |
|
|
|
|
|
this.$message.error('查询Lab属性模板失败') |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
restorePropertySelection () { |
|
|
|
|
|
if (!this.$refs.propertyItemTable) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.$refs.propertyItemTable.clearSelection() |
|
|
|
|
|
const selectedNos = new Set((this.modalData.propertyItemList || []).map(item => item.itemNo)) |
|
|
|
|
|
this.propertyItemList.forEach(item => { |
|
|
|
|
|
if (selectedNos.has(item.itemNo)) { |
|
|
|
|
|
this.$refs.propertyItemTable.toggleRowSelection(item, true) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
openPropertyChooseModal () { |
|
|
|
|
|
if (!this.modalData.site) { |
|
|
|
|
|
this.$message.warning('请先选择申请工厂') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.propertyChooseData = this.buildDefaultPropertyChooseData() |
|
|
|
|
|
this.propertyChooseData.site = this.modalData.site |
|
|
|
|
|
this.propertyItemList = [] |
|
|
|
|
|
this.propertyItemSelections = [] |
|
|
|
|
|
this.loadPropertyModelList().then(() => { |
|
|
|
|
|
if (this.propertyModelList.length === 0) { |
|
|
|
|
|
this.$message.warning('请先在属性模板管理维护LAB模板') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.propertyChooseData.codeNo = this.propertyModelList[0].codeNo |
|
|
|
|
|
this.propertyChooseModalFlag = true |
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
this.searchPropertyItemList(true) |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
searchPropertyItemList (restoreSelection = false) { |
|
|
|
|
|
if (!this.propertyChooseData.codeNo) { |
|
|
|
|
|
this.propertyItemList = [] |
|
|
|
|
|
if (restoreSelection) { |
|
|
|
|
|
this.$nextTick(() => this.restorePropertySelection()) |
|
|
|
|
|
} |
|
|
|
|
|
this.$message.warning('请选择模板') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
const params = { |
|
|
|
|
|
site: this.modalData.site, |
|
|
|
|
|
functionType: 'LAB', |
|
|
|
|
|
codeNo: this.propertyChooseData.codeNo, |
|
|
|
|
|
itemNo: this.propertyChooseData.itemNo, |
|
|
|
|
|
itemDesc: this.propertyChooseData.itemDesc |
|
|
|
|
|
} |
|
|
|
|
|
api.getLabPropertyItemList(params).then(({data}) => { |
|
|
|
|
|
if (data && data.code === 0) { |
|
|
|
|
|
this.propertyItemList = (data.rows || []).map(item => this.normalizePropertyItem(item)) |
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
this.restorePropertySelection() |
|
|
|
|
|
}) |
|
|
|
|
|
} else { |
|
|
|
|
|
this.propertyItemList = [] |
|
|
|
|
|
this.$message.warning((data && data.msg) || '查询属性清单失败') |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(() => { |
|
|
|
|
|
this.propertyItemList = [] |
|
|
|
|
|
this.$message.error('查询属性清单失败') |
|
|
|
|
|
}) |
|
|
|
|
|
}, |
|
|
|
|
|
propertyItemClickRow (row) { |
|
|
|
|
|
if (!this.$refs.propertyItemTable) { |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
this.$refs.propertyItemTable.toggleRowSelection(row) |
|
|
|
|
|
}, |
|
|
|
|
|
selectionPropertyItem (val) { |
|
|
|
|
|
this.propertyItemSelections = val || [] |
|
|
|
|
|
}, |
|
|
|
|
|
confirmPropertyItem () { |
|
|
|
|
|
if (!this.propertyItemSelections || this.propertyItemSelections.length === 0) { |
|
|
|
|
|
this.$message.warning('请勾选属性') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
const currentList = Array.isArray(this.modalData.propertyItemList) ? this.modalData.propertyItemList : [] |
|
|
|
|
|
const selectedNoSet = new Set(this.propertyItemSelections.map(item => item.itemNo)) |
|
|
|
|
|
const mergedList = [] |
|
|
|
|
|
|
|
|
|
|
|
currentList.forEach(item => { |
|
|
|
|
|
if (selectedNoSet.has(item.itemNo)) { |
|
|
|
|
|
mergedList.push(this.normalizePropertyItem(item)) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
this.propertyItemSelections.forEach(selected => { |
|
|
|
|
|
if (!mergedList.some(item => item.itemNo === selected.itemNo)) { |
|
|
|
|
|
const normalized = this.normalizePropertyItem(selected) |
|
|
|
|
|
normalized.itemValue = this.resolvePropertyDefaultValue(normalized) |
|
|
|
|
|
mergedList.push(normalized) |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
this.$set(this.modalData, 'propertyItemList', mergedList.map((item, index) => ({ |
|
|
|
|
|
...this.normalizePropertyItem(item), |
|
|
|
|
|
seqNo: index + 1 |
|
|
|
|
|
}))) |
|
|
|
|
|
this.propertyChooseModalFlag = false |
|
|
|
|
|
}, |
|
|
|
|
|
syncPropertyItemList () { |
|
|
|
|
|
const list = Array.isArray(this.modalData.propertyItemList) ? this.modalData.propertyItemList : [] |
|
|
|
|
|
this.$set(this.modalData, 'propertyItemList', list.map((item, index) => ({ |
|
|
|
|
|
...this.normalizePropertyItem(item), |
|
|
|
|
|
site: this.modalData.site, |
|
|
|
|
|
referenceNo: this.modalData.referenceNo, |
|
|
|
|
|
seqNo: index + 1 |
|
|
|
|
|
}))) |
|
|
|
|
|
}, |
|
|
getLabSubmitFieldValue (fieldId) { |
|
|
getLabSubmitFieldValue (fieldId) { |
|
|
if (fieldId === 'tester') { |
|
|
if (fieldId === 'tester') { |
|
|
return this.modalData.testerList |
|
|
return this.modalData.testerList |
|
|
@ -740,7 +1055,7 @@ export default { |
|
|
const params = { |
|
|
const params = { |
|
|
page: this.pageIndex, |
|
|
page: this.pageIndex, |
|
|
limit: this.pageSize, |
|
|
limit: this.pageSize, |
|
|
site: this.$store.state.user.site, |
|
|
|
|
|
|
|
|
site: this.searchData.site || '', |
|
|
menuId: this.menuId, |
|
|
menuId: this.menuId, |
|
|
referenceNo: this.searchData.referenceNo, |
|
|
referenceNo: this.searchData.referenceNo, |
|
|
status: this.searchData.status, |
|
|
status: this.searchData.status, |
|
|
@ -809,7 +1124,7 @@ export default { |
|
|
async createExportData () { |
|
|
async createExportData () { |
|
|
const params = { |
|
|
const params = { |
|
|
...this.searchData, |
|
|
...this.searchData, |
|
|
site: this.$store.state.user.site, |
|
|
|
|
|
|
|
|
site: this.searchData.site || '', |
|
|
menuId: this.menuId, |
|
|
menuId: this.menuId, |
|
|
page: 1, |
|
|
page: 1, |
|
|
limit: -1 |
|
|
limit: -1 |
|
|
@ -894,6 +1209,7 @@ export default { |
|
|
...detail |
|
|
...detail |
|
|
} |
|
|
} |
|
|
this.fillDisplayFields(this.modalData, row || {}) |
|
|
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, 'testerList', this.normalizeTesterList(this.modalData.tester)) |
|
|
this.$set(this.modalData, 'customerIdFlag', true) |
|
|
this.$set(this.modalData, 'customerIdFlag', true) |
|
|
this.$set(this.modalData, 'projectIdFlag', true) |
|
|
this.$set(this.modalData, 'projectIdFlag', true) |
|
|
@ -910,10 +1226,13 @@ export default { |
|
|
} else { |
|
|
} else { |
|
|
this.modalTitle = 'Lab 新增' |
|
|
this.modalTitle = 'Lab 新增' |
|
|
this.showModalFlag = false |
|
|
this.showModalFlag = false |
|
|
|
|
|
this.loadSiteOptions() |
|
|
const tempReferenceNo = 'TEMP-' + new Date().getTime() + '-' + Math.floor(Math.random() * 1000) |
|
|
const tempReferenceNo = 'TEMP-' + new Date().getTime() + '-' + Math.floor(Math.random() * 1000) |
|
|
const defaultData = this.buildDefaultModalData() |
|
|
const defaultData = this.buildDefaultModalData() |
|
|
|
|
|
const defaultSite = this.getDefaultSiteValue() |
|
|
this.modalData = { |
|
|
this.modalData = { |
|
|
...defaultData, |
|
|
...defaultData, |
|
|
|
|
|
site: defaultSite, |
|
|
referenceNo: tempReferenceNo, |
|
|
referenceNo: tempReferenceNo, |
|
|
applicant: this.$store.state.user.name || '', |
|
|
applicant: this.$store.state.user.name || '', |
|
|
applicantName: this.$store.state.user.userDisplay || this.$store.state.user.user_display || '', |
|
|
applicantName: this.$store.state.user.userDisplay || this.$store.state.user.user_display || '', |
|
|
@ -924,7 +1243,9 @@ export default { |
|
|
stepId: 10, |
|
|
stepId: 10, |
|
|
rejectFlag: 'N' |
|
|
rejectFlag: 'N' |
|
|
} |
|
|
} |
|
|
|
|
|
this.$set(this.modalData, 'propertyItemList', []) |
|
|
this.$set(this.modalData, 'testerList', []) |
|
|
this.$set(this.modalData, 'testerList', []) |
|
|
|
|
|
this.searchProjectData.site = defaultSite |
|
|
this.nodeAuthorityLoaded = true |
|
|
this.nodeAuthorityLoaded = true |
|
|
this.loadNodeAuthority(this.modalData.site, 10) |
|
|
this.loadNodeAuthority(this.modalData.site, 10) |
|
|
} |
|
|
} |
|
|
@ -960,7 +1281,7 @@ export default { |
|
|
'projectId', 'customerId', 'sampleName', 'sampleModel', 'sampleQty', 'testPurpose', |
|
|
'projectId', 'customerId', 'sampleName', 'sampleModel', 'sampleQty', 'testPurpose', |
|
|
'productStage', 'testType', 'reportDocument', 'returnSample', 'applicationSurface', 'testLab', |
|
|
'productStage', 'testType', 'reportDocument', 'returnSample', 'applicationSurface', 'testLab', |
|
|
'attention', 'testStartDate', 'completedDate', 'unnormalSymptomAndDescription', 'testNumber', |
|
|
'attention', 'testStartDate', 'completedDate', 'unnormalSymptomAndDescription', 'testNumber', |
|
|
'testerComments', 'departmentManagerComments', 'labComments', 'tester', 'status', 'stepId', |
|
|
|
|
|
|
|
|
'testerComments', 'departmentManagerComments', 'labComments', 'tester', 'propertyItemList', 'status', 'stepId', |
|
|
'rejectFlag', 'rejectStepId', 'createDate', 'createBy', 'updateDate', 'updateBy' |
|
|
'rejectFlag', 'rejectStepId', 'createDate', 'createBy', 'updateDate', 'updateBy' |
|
|
] |
|
|
] |
|
|
const payload = {} |
|
|
const payload = {} |
|
|
@ -975,6 +1296,7 @@ export default { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
this.syncTesterField() |
|
|
this.syncTesterField() |
|
|
|
|
|
this.syncPropertyItemList() |
|
|
const payload = this.buildLabPayload(this.modalData) |
|
|
const payload = this.buildLabPayload(this.modalData) |
|
|
const submitMethod = this.modalTitle === 'Lab 新增' ? api.saveLab : api.updateLab |
|
|
const submitMethod = this.modalTitle === 'Lab 新增' ? api.saveLab : api.updateLab |
|
|
submitMethod(payload).then(({data}) => { |
|
|
submitMethod(payload).then(({data}) => { |
|
|
@ -1029,6 +1351,7 @@ export default { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
this.syncTesterField() |
|
|
this.syncTesterField() |
|
|
|
|
|
this.syncPropertyItemList() |
|
|
if (!this.nodeAuthorityLoaded) { |
|
|
if (!this.nodeAuthorityLoaded) { |
|
|
this.$message.warning('节点权限加载中,请稍后重试') |
|
|
this.$message.warning('节点权限加载中,请稍后重试') |
|
|
return |
|
|
return |
|
|
@ -1104,7 +1427,7 @@ export default { |
|
|
if (type === 1) { |
|
|
if (type === 1) { |
|
|
strVal = this.modalData.applicant |
|
|
strVal = this.modalData.applicant |
|
|
} |
|
|
} |
|
|
conSql = " and b.site = '" + this.$store.state.user.site + "'" |
|
|
|
|
|
|
|
|
conSql = " and b.site = '" + this.modalData.site + "'" |
|
|
} |
|
|
} |
|
|
this.$refs.baseList.init(val, strVal, conSql) |
|
|
this.$refs.baseList.init(val, strVal, conSql) |
|
|
}) |
|
|
}) |
|
|
@ -1136,7 +1459,7 @@ export default { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
const params = { |
|
|
const params = { |
|
|
site: this.$store.state.user.site, |
|
|
|
|
|
|
|
|
site: this.modalData.site, |
|
|
customerNo: this.modalData.customerId |
|
|
customerNo: this.modalData.customerId |
|
|
} |
|
|
} |
|
|
queryCustomer(params).then(({data}) => { |
|
|
queryCustomer(params).then(({data}) => { |
|
|
@ -1163,7 +1486,7 @@ export default { |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
const params = { |
|
|
const params = { |
|
|
site: this.$store.state.user.site, |
|
|
|
|
|
|
|
|
site: this.modalData.site, |
|
|
projectId: this.modalData.projectId |
|
|
projectId: this.modalData.projectId |
|
|
} |
|
|
} |
|
|
if (this.modalData.customerId) { |
|
|
if (this.modalData.customerId) { |
|
|
@ -1196,7 +1519,7 @@ export default { |
|
|
} else { |
|
|
} else { |
|
|
this.searchProjectData.customerId = undefined |
|
|
this.searchProjectData.customerId = undefined |
|
|
} |
|
|
} |
|
|
this.searchProjectData.site = this.$store.state.user.site |
|
|
|
|
|
|
|
|
this.searchProjectData.site = this.modalData.site |
|
|
searchProjectInfoList(this.searchProjectData).then(({data}) => { |
|
|
searchProjectInfoList(this.searchProjectData).then(({data}) => { |
|
|
if (data && data.code === 0) { |
|
|
if (data && data.code === 0) { |
|
|
this.projectList = data.rows || [] |
|
|
this.projectList = data.rows || [] |
|
|
@ -1212,7 +1535,7 @@ export default { |
|
|
this.$refs.closeProjectInfoForm.resetFields() |
|
|
this.$refs.closeProjectInfoForm.resetFields() |
|
|
} |
|
|
} |
|
|
this.searchProjectData = { |
|
|
this.searchProjectData = { |
|
|
site: this.$store.state.user.site, |
|
|
|
|
|
|
|
|
site: this.modalData.site || this.$store.state.user.site, |
|
|
projectId: undefined, |
|
|
projectId: undefined, |
|
|
projectName: undefined, |
|
|
projectName: undefined, |
|
|
customerId: undefined |
|
|
customerId: undefined |
|
|
@ -1222,7 +1545,7 @@ export default { |
|
|
if (this.modalData.applicant != null && this.modalData.applicant !== '') { |
|
|
if (this.modalData.applicant != null && this.modalData.applicant !== '') { |
|
|
const tempData = { |
|
|
const tempData = { |
|
|
tagno: tagNo, |
|
|
tagno: tagNo, |
|
|
conditionSql: " and a.username = '" + this.modalData.applicant + "'" + " and b.site = '" + this.$store.state.user.site + "'" |
|
|
|
|
|
|
|
|
conditionSql: " and a.username = '" + this.modalData.applicant + "'" + " and b.site = '" + this.modalData.site + "'" |
|
|
} |
|
|
} |
|
|
verifyData(tempData).then(({data}) => { |
|
|
verifyData(tempData).then(({data}) => { |
|
|
if (data && data.code === 0 && data.baseListData.length > 0) { |
|
|
if (data && data.code === 0 && data.baseListData.length > 0) { |
|
|
|