Browse Source

site

master
han\hanst 5 days ago
parent
commit
7fc66e7b2f
  1. 85
      src/views/modules/eam/com_project_proof_record.vue
  2. 82
      src/views/modules/eam/eamDocumentTypeDefinition.vue
  3. 2
      src/views/modules/eam/eamProjectPartInfo.vue

85
src/views/modules/eam/com_project_proof_record.vue

@ -675,6 +675,11 @@
inModal: { inModal: {
type: Boolean, type: Boolean,
default: false default: false
},
//
selectedSite: {
type: String,
default: ''
} }
}, },
computed: { computed: {
@ -704,6 +709,14 @@
this.getProofDocument() this.getProofDocument()
} }
}, },
selectedSite: {
immediate: true,
handler (val) {
if (val) {
this.syncSiteContext(val)
}
}
}
}, },
data() { data() {
return { return {
@ -711,7 +724,7 @@
userBuList: [], userBuList: [],
dataList: [], dataList: [],
searchData: { searchData: {
site: this.$store.state.user.site,
site: this.selectedSite || this.$store.state.user.site,
username: this.$store.state.user.name, username: this.$store.state.user.name,
projectId: '', projectId: '',
projectPartId: '', projectPartId: '',
@ -719,7 +732,7 @@
limit: 1000 limit: 1000
}, },
searchProofData: { searchProofData: {
site: this.$store.state.user.site,
site: this.selectedSite || this.$store.state.user.site,
username: this.$store.state.user.name, username: this.$store.state.user.name,
projectId: '', projectId: '',
page: 1, page: 1,
@ -751,7 +764,7 @@
proofDocumenCurrentRow:{}, proofDocumenCurrentRow:{},
documentClickRow: {}, documentClickRow: {},
currentData: { currentData: {
site: this.$store.state.user.site,
site: this.selectedSite || this.$store.state.user.site,
username: this.$store.state.user.name, username: this.$store.state.user.name,
projectId: '', projectId: '',
projectNo: '', projectNo: '',
@ -762,7 +775,7 @@
limit: 1000 limit: 1000
}, },
copyModalData: { copyModalData: {
site: this.$store.state.user.site,
site: this.selectedSite || this.$store.state.user.site,
username: this.$store.state.user.name, username: this.$store.state.user.name,
projectId: '', projectId: '',
projectNo: '', projectNo: '',
@ -831,7 +844,7 @@
createBy: '' createBy: ''
}, },
searchDocumentTypeData: { searchDocumentTypeData: {
site: this.$store.state.user.site,
site: this.selectedSite || this.$store.state.user.site,
projectId: '', projectId: '',
projectNo: '', projectNo: '',
proofingId: '', proofingId: '',
@ -846,7 +859,7 @@
}, },
documentTypeData: { documentTypeData: {
// bu: this.userBuList[0].buNo, // bu: this.userBuList[0].buNo,
site: this.$store.state.user.site,
site: this.selectedSite || this.$store.state.user.site,
proofingId: '', proofingId: '',
proofingNo: '', proofingNo: '',
documentTypeId: '', documentTypeId: '',
@ -1361,6 +1374,32 @@
}, },
methods: { methods: {
resolveProofingSite (site) {
if (site !== null && site !== undefined && site !== '') {
return site
}
if (this.selectedSite !== null && this.selectedSite !== undefined && this.selectedSite !== '') {
return this.selectedSite
}
if (this.proofDocumenCurrentRow && this.proofDocumenCurrentRow.site) {
return this.proofDocumenCurrentRow.site
}
if (this.searchData && this.searchData.site) {
return this.searchData.site
}
return this.$store.state.user.site
},
syncSiteContext (site) {
const currentSite = this.resolveProofingSite(site)
this.searchData.site = currentSite
this.searchProofData.site = currentSite
this.currentData.site = currentSite
this.copyModalData.site = currentSite
this.searchDocumentTypeData.site = currentSite
this.documentTypeData.site = currentSite
this.modalData.site = currentSite
return currentSite
},
handleColumnResize(newWidth, oldWidth, column, event){ handleColumnResize(newWidth, oldWidth, column, event){
let inData= this.columnList.filter(item => item.columnProp === column.property)[0] let inData= this.columnList.filter(item => item.columnProp === column.property)[0]
inData.columnWidth=newWidth inData.columnWidth=newWidth
@ -1416,6 +1455,8 @@
// //
this.searchData = JSON.parse(JSON.stringify(inData)); this.searchData = JSON.parse(JSON.stringify(inData));
this.authUpdate = authUpdate this.authUpdate = authUpdate
const currentSite = this.syncSiteContext(inData ? inData.site : '')
this.searchData.site = currentSite
// //
proofingInformationSearch(this.searchData).then(({data}) => { proofingInformationSearch(this.searchData).then(({data}) => {
// //
@ -1437,8 +1478,9 @@
}); });
}, },
getProofingInformation(proofingId) { getProofingInformation(proofingId) {
const currentSite = this.syncSiteContext(this.searchData.site)
let tempData = { let tempData = {
site: this.$store.state.user.site,
site: currentSite,
username: this.$store.state.user.name, username: this.$store.state.user.name,
projectId: this.searchData.projectId, projectId: this.searchData.projectId,
projectPartId: this.searchData.projectPartId, projectPartId: this.searchData.projectPartId,
@ -1464,8 +1506,9 @@
}); });
}, },
async getProofDocument() { async getProofDocument() {
const currentSite = this.syncSiteContext(this.proofDocumenCurrentRow.site)
let tempData = { let tempData = {
site: this.$store.state.user.site,
site: currentSite,
username: this.$store.state.user.name, username: this.$store.state.user.name,
buNo: this.proofDocumenCurrentRow.buNo, buNo: this.proofDocumenCurrentRow.buNo,
proofingId: this.proofDocumenCurrentRow.proofingId, proofingId: this.proofDocumenCurrentRow.proofingId,
@ -1594,6 +1637,7 @@
} }
}, },
addDocumentList(row) { addDocumentList(row) {
this.syncSiteContext(row.site)
this.proofDocumenCurrentRow = row this.proofDocumenCurrentRow = row
this.getProofDocument() this.getProofDocument()
this.documentListVisible = true this.documentListVisible = true
@ -1607,6 +1651,7 @@
projectPartId: row.projectPartId, projectPartId: row.projectPartId,
testPartNo: row.testPartNo, testPartNo: row.testPartNo,
partDesc: row.partDesc, partDesc: row.partDesc,
site: row.site,
bu: row.bu, bu: row.bu,
cProjectTypeDb: row.cProjectTypeDb, cProjectTypeDb: row.cProjectTypeDb,
proofingId: row.proofingId, proofingId: row.proofingId,
@ -1619,6 +1664,7 @@
// proofDocumentList // proofDocumentList
}, },
updateProofingRecord(row) { updateProofingRecord(row) {
this.syncSiteContext(row.site)
this.proofingRecordVisible = true this.proofingRecordVisible = true
this.modalData = { this.modalData = {
projectId: row.projectId, projectId: row.projectId,
@ -1651,9 +1697,10 @@
} }
}, },
saveProofingRecord(row,type) { saveProofingRecord(row,type) {
const currentSite = this.syncSiteContext(this.modalData.site || (row && row.site) || this.proofDocumenCurrentRow.site)
let inData = { let inData = {
id: this.modalData.id, id: this.modalData.id,
site: this.$store.state.user.site,
site: currentSite,
username: this.$store.state.user.name, username: this.$store.state.user.name,
buNo: this.modalData.buNo, buNo: this.modalData.buNo,
cProjectTypeDb: this.modalData.cProjectTypeDb, cProjectTypeDb: this.modalData.cProjectTypeDb,
@ -1684,7 +1731,7 @@
} }
if (row.proofingStatus === '草稿' && type === 1){ if (row.proofingStatus === '草稿' && type === 1){
inData = { inData = {
site: this.$store.state.user.site,
site: currentSite,
username: this.$store.state.user.name, username: this.$store.state.user.name,
buNo: row.buNo, buNo: row.buNo,
cProjectTypeDb: row.cProjectTypeDb, cProjectTypeDb: row.cProjectTypeDb,
@ -1824,8 +1871,9 @@
}) })
}, },
proofingRecordDelete(row) { proofingRecordDelete(row) {
const currentSite = this.syncSiteContext(row.site)
let tempData = { let tempData = {
site: this.$store.state.user.site,
site: currentSite,
username: this.$store.state.user.name, username: this.$store.state.user.name,
buNo: row.buNo, buNo: row.buNo,
cProjectTypeDb: row.cProjectTypeDb, cProjectTypeDb: row.cProjectTypeDb,
@ -1927,6 +1975,7 @@
}); });
}, },
searchDocumentTypeList() { searchDocumentTypeList() {
this.searchDocumentTypeData.site = this.resolveProofingSite(this.modalData.site || this.proofDocumenCurrentRow.site)
this.searchDocumentTypeData.proofingId = this.modalData.proofingId this.searchDocumentTypeData.proofingId = this.modalData.proofingId
this.searchDocumentTypeData.projectId = this.modalData.projectId this.searchDocumentTypeData.projectId = this.modalData.projectId
getExtraDocumentList(this.searchDocumentTypeData).then(({data}) => { getExtraDocumentList(this.searchDocumentTypeData).then(({data}) => {
@ -1938,6 +1987,7 @@
}) })
}, },
saveSelectionDocumentType() { saveSelectionDocumentType() {
const currentSite = this.syncSiteContext(this.modalData.site || this.proofDocumenCurrentRow.site)
if (this.documentSelection.length === 0) { if (this.documentSelection.length === 0) {
this.$message({ this.$message({
message: '请选择文档类型', message: '请选择文档类型',
@ -1948,7 +1998,7 @@
} }
this.documentSelection.forEach((item) => { this.documentSelection.forEach((item) => {
const inData = { const inData = {
site: this.$store.state.user.site,
site: currentSite,
proofingId: this.modalData.proofingId, proofingId: this.modalData.proofingId,
proofingNo: this.modalData.proofingNo, proofingNo: this.modalData.proofingNo,
projectId: this.modalData.projectId, projectId: this.modalData.projectId,
@ -1984,8 +2034,9 @@
}, },
closeAddDocumentTypeFlag() { closeAddDocumentTypeFlag() {
this.addDocumentTypeFlag = false this.addDocumentTypeFlag = false
const currentSite = this.resolveProofingSite(this.modalData.site || this.proofDocumenCurrentRow.site)
this.searchDocumentTypeData = { this.searchDocumentTypeData = {
site: this.$store.state.user.site,
site: currentSite,
projectId: '', projectId: '',
projectNo: '', projectNo: '',
projectPartId: '', projectPartId: '',
@ -2063,8 +2114,9 @@
cancelButtonText: '取消', cancelButtonText: '取消',
type: 'warning' type: 'warning'
}).then(() => { }).then(() => {
const currentSite = this.resolveProofingSite(this.modalData.site || this.proofDocumenCurrentRow.site)
const inData = { const inData = {
site: this.$store.state.user.site,
site: currentSite,
documentDefinitionListIds: documentDefinitionListIds documentDefinitionListIds: documentDefinitionListIds
} }
batchDeleteDocumentType(inData).then(({data}) => { batchDeleteDocumentType(inData).then(({data}) => {
@ -2137,6 +2189,7 @@
this.proofDocumentList = [] this.proofDocumentList = []
} }
this.proofDocumenCurrentRow = JSON.parse(JSON.stringify(row)) this.proofDocumenCurrentRow = JSON.parse(JSON.stringify(row))
this.syncSiteContext(row ? row.site : '')
}, },
/** /**
* 当前值发生变化的时候修改 * 当前值发生变化的时候修改
@ -2150,6 +2203,7 @@
// //
if (row) { if (row) {
this.proofDocumenCurrentRow = JSON.parse(JSON.stringify(row)) this.proofDocumenCurrentRow = JSON.parse(JSON.stringify(row))
this.syncSiteContext(row.site)
// //
this.refreshCurrentTabTable() this.refreshCurrentTabTable()
} }
@ -2200,6 +2254,7 @@
}) })
}, },
saveSelectionCopyDocumentType() { saveSelectionCopyDocumentType() {
const currentSite = this.resolveProofingSite(this.copyModalData.site || this.proofDocumenCurrentRow.site)
if (this.documentCopySelection.length === 0) { if (this.documentCopySelection.length === 0) {
this.$message({ this.$message({
message: '请选择文档', message: '请选择文档',
@ -2217,7 +2272,7 @@
} }
const inDataList = this.documentCopySelection.map(item => ({ const inDataList = this.documentCopySelection.map(item => ({
ossId: item.ossId, ossId: item.ossId,
orderRef1: this.$store.state.user.site,
orderRef1: currentSite,
orderRef2: this.copyModalData.proofingId.toString(), orderRef2: this.copyModalData.proofingId.toString(),
orderRef3: this.copyModalData.documentDefinitionListId, orderRef3: this.copyModalData.documentDefinitionListId,
orderRef4: this.copyModalData.projectId.toString(), orderRef4: this.copyModalData.projectId.toString(),

82
src/views/modules/eam/eamDocumentTypeDefinition.vue

@ -126,17 +126,40 @@
<!-- </el-select>--> <!-- </el-select>-->
<!-- </el-form-item>--> <!-- </el-form-item>-->
<!-- </el-form>--> <!-- </el-form>-->
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
<el-form-item label="文档类型ID" prop="documentTypeId" :rules="rules.documentTypeIdType">
<el-input v-model="modalData.documentTypeId" :disabled="modalDisableFlag" style="width: 140px"></el-input>
</el-form-item>
<el-form-item label="文档类型" prop="documentType" style="margin-left: 15px" :rules="rules.documentTypeType">
<el-input v-model="modalData.documentType" style="width: 230px"></el-input>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: 5px;">
<el-row :gutter="16" style="margin-left: 0; margin-right: 0;">
<el-col :span="12">
<el-form-item label="工厂" prop="site" :rules="rules.siteType">
<el-select
v-model="modalData.site"
placeholder="请选择"
clearable
:disabled="modalDisableFlag"
style="width: 100%"
@change="handleModalSiteChange">
<el-option
v-for="item in authorizedSiteList"
:key="item.site"
:label="item.sitename"
:value="item.site">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="文档类型ID" prop="documentTypeId" :rules="rules.documentTypeIdType">
<el-input v-model="modalData.documentTypeId" :disabled="modalDisableFlag" style="width: 100%"></el-input>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="16" style="margin-left: 0; margin-right: 0;">
<el-col :span="12">
<el-form-item label="文档类型" prop="documentType" :rules="rules.documentTypeType">
<el-input v-model="modalData.documentType" style="width: 100%"></el-input>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="责任部门" prop="responsibleDepartment" :rules="rules.responsibleDepartmentType"> <el-form-item label="责任部门" prop="responsibleDepartment" :rules="rules.responsibleDepartmentType">
<el-select v-model="modalData.responsibleDepartment" placeholder="请选择" clearable style="width: 140px">
<el-select v-model="modalData.responsibleDepartment" placeholder="请选择" clearable style="width: 100%">
<el-option <el-option
v-for = "i in responsibleDepartmentList" v-for = "i in responsibleDepartmentList"
:key = "i.roleNo" :key = "i.roleNo"
@ -145,11 +168,15 @@
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="预计完成天数" prop="estimatedCompletionDays" style="margin-left: 15px" :rules="rules.estimatedCompletionDaysType">
<el-input v-model="modalData.estimatedCompletionDays" style="width: 230px"></el-input>
</el-col>
</el-row>
<el-row :gutter="16" style="margin-left: 0; margin-right: 0;">
<el-col :span="12">
<el-form-item label="预计完成天数" prop="estimatedCompletionDays" :rules="rules.estimatedCompletionDaysType">
<el-input v-model="modalData.estimatedCompletionDays" style="width: 100%"></el-input>
</el-form-item> </el-form-item>
</el-form>
</el-col>
</el-row>
</el-form> </el-form>
<el-footer style="height:40px;margin-top: 15px;text-align:center"> <el-footer style="height:40px;margin-top: 15px;text-align:center">
<el-button type="primary" @click="saveData()">保存</el-button> <el-button type="primary" @click="saveData()">保存</el-button>
@ -404,6 +431,13 @@
], ],
levelList: [], levelList: [],
rules:{ rules:{
siteType:[
{
required: true,
message: ' ',
trigger: ['blur','change']
}
],
documentTypeIdType:[ documentTypeIdType:[
{ {
required: true, required: true,
@ -644,7 +678,7 @@
this.modalData = { this.modalData = {
flag: '1', flag: '1',
// bu: this.userBuList[0].buNo, // bu: this.userBuList[0].buNo,
site: this.$store.state.user.site,
site: '',
documentTypeId: '', documentTypeId: '',
documentType: '', documentType: '',
responsibleDepartment: '', responsibleDepartment: '',
@ -657,6 +691,10 @@
this.modalDisableFlag = false this.modalDisableFlag = false
this.modalFlag = true this.modalFlag = true
}, },
handleModalSiteChange () {
this.modalData.responsibleDepartment = ''
this.getResponsibleDepartment()
},
updateModal (row) { updateModal (row) {
this.modalData = { this.modalData = {
@ -703,6 +741,10 @@
}, },
saveData () { saveData () {
if (this.modalData.site === '' || this.modalData.site == null) {
this.$message.warning('请选择工厂!')
return
}
// if (this.modalData.bu === '' || this.modalData.bu == null) { // if (this.modalData.bu === '' || this.modalData.bu == null) {
// this.$message.warning('BU') // this.$message.warning('BU')
// return // return
@ -767,9 +809,15 @@
} }
}, },
getResponsibleDepartment() { getResponsibleDepartment() {
if (this.modalData.site === '' || this.modalData.site == null) {
this.responsibleDepartmentList = []
return
}
this.responsibleDepartmentList = [] this.responsibleDepartmentList = []
this.modalData.site = this.$store.state.user.site
getResponsibleDepartment(this.modalData).then(({data}) => {
let params = {
site: this.modalData.site
}
getResponsibleDepartment(params).then(({data}) => {
if (data.code === 0) { if (data.code === 0) {
data.rows.forEach((item) => { data.rows.forEach((item) => {
// roleNoA // roleNoA

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

@ -1273,7 +1273,7 @@
<el-tabs style="margin-top: -2px; width: 100%; height: 100%;" v-model="activeModalTab" type="border-card" @tab-click="tabClick"> <el-tabs style="margin-top: -2px; width: 100%; height: 100%;" v-model="activeModalTab" type="border-card" @tab-click="tabClick">
<el-tab-pane label="打样记录" name="proofRecord"> <el-tab-pane label="打样记录" name="proofRecord">
<!-- 注意这里使用了一个新的 ref用于模态框内部的 proofRecord 组件 --> <!-- 注意这里使用了一个新的 ref用于模态框内部的 proofRecord 组件 -->
<proofRecord ref="proofRecordModal" :inModal="true"></proofRecord>
<proofRecord ref="proofRecordModal" :inModal="true" :selected-site="proofingCurrentRow.site"></proofRecord>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="转量产阶段文档" name="massProductionStage"> <el-tab-pane label="转量产阶段文档" name="massProductionStage">
<el-button type="primary" v-if="!this.authUpdate" icon="el-icon-upload" style="margin-top: -5px" @click="projectDocumentList()">文档清单定义</el-button> <el-button type="primary" v-if="!this.authUpdate" icon="el-icon-upload" style="margin-top: -5px" @click="projectDocumentList()">文档清单定义</el-button>

Loading…
Cancel
Save