Browse Source

2024-11-20

判断审阅参数
master
fengyuan_yang 1 year ago
parent
commit
66d11abe85
  1. 16
      src/views/modules/processManagement/processBindingInfo.vue
  2. 203
      src/views/modules/project/projectInfo/com_project_info_part.vue

16
src/views/modules/processManagement/processBindingInfo.vue

@ -252,8 +252,8 @@
<el-table-column prop="plmTable" header-align="center" align="center" :required="true" label="审阅" width="150">
<template slot-scope="{row}">
<el-select :ref="`${row.xh-1}` + `a`" v-model="tableData[row.xh-1].review" placeholder="请选择" clearable style="width: 130px">
<el-option label="0" value="0"></el-option>
<el-option label="8" value="8"></el-option>
<el-option label="强制" value="Y"></el-option>
<el-option label="可选" value="N"></el-option>
</el-select>
</template>
</el-table-column>
@ -1468,25 +1468,25 @@
this.modalFlag = true
},
checkDataBySubDetail (){
checkDataBySubDetail () {
for (let i = 0; i < this.tableData.length; i++) {
if(this.tableData[i].plmTable === '' || this.tableData[i].plmTable == null){
if (this.tableData[i].plmTable === '' || this.tableData[i].plmTable == null) {
this.$message.warning('序号' + (i+1) +'未选择PLM数据表,数据表为必填项!')
return
}
if(this.tableData[i].plmField === '' || this.tableData[i].plmField == null){
if (this.tableData[i].plmField === '' || this.tableData[i].plmField == null) {
this.$message.warning('序号' + (i+1) +'未选择PLM字段名,字段名为必填项!')
return
}
if(this.tableData[i].oaField === '' || this.tableData[i].oaField == null){
if (this.tableData[i].oaField === '' || this.tableData[i].oaField == null) {
this.$message.warning('序号' + (i+1) +'未填写OA字段名,字段名为必填项!')
return
}
if(this.tableData[i].fieldType === '' || this.tableData[i].fieldType == null){
if (this.tableData[i].fieldType === '' || this.tableData[i].fieldType == null) {
this.$message.warning('序号' + (i+1) +'未选择PLM字段类型,字段类型为必填项!')
return
}
if(this.tableData[i].fieldType === 'A' && (this.tableData[i].review == null || this.tableData[i].review === '')){
if (this.tableData[i].fieldType === 'A' && (this.tableData[i].review == null || this.tableData[i].review === '')) {
this.$message.warning('序号' + (i+1) +'未选择审阅!')
return
}

203
src/views/modules/project/projectInfo/com_project_info_part.vue

@ -21,7 +21,6 @@
</download-excel>
</el-form>
</el-form>
<el-table
:data="dataList"
height="240"
@ -582,23 +581,23 @@
</el-dialog>
<!-- 项目物料-> 快速新增 -->
<el-dialog title="物料导入" @close="refreshDetailList" :close-on-click-modal="false" v-drag :visible.sync="partModelFlag" width="900px">
<el-dialog title="物料导入" :close-on-click-modal="false" v-drag :visible.sync="partModelFlag" width="900px">
<div style="font-size: 12px">
<el-form :inline="true" label-position="top" :model="partData">
<el-form :inline="true" label-position="top" :model="searchData">
<el-form-item :label="'物料编码'">
<el-input v-model="partData.partNo" clearable style="width: 120px"></el-input>
<el-input v-model="searchData.partNo" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'物料名称'">
<el-input v-model="partData.partDesc" clearable style="width: 120px"></el-input>
<el-input v-model="searchData.partDesc" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'物料状态'">
<el-select v-model="searchData.searchType" @change="searchTypeChange" style="width: 120px">
<el-select v-model="searchData.searchType" style="width: 120px">
<el-option label="Project Part" value="Y"></el-option>
<el-option label="Inventory Part" value="N"></el-option>
</el-select>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="getPartList">查询</el-button>
<el-button type="primary" @click="searchTypeChange">查询</el-button>
</el-form-item>
</el-form>
</div>
@ -649,8 +648,19 @@
label=" BU Desc">
</el-table-column>
</el-table>
<!-- 分页-->
<el-pagination
style="margin-top: 5px"
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[20, 50, 100, 200, 500]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
</el-header>
<el-main style="width: 880px;height: 27px;margin-top: 50px;padding: 0 0 0 0;text-align:center">
<el-main style="width: 880px;height: 27px;margin-top: 70px;padding: 0 0 0 0;text-align:center">
<div>
<el-button type="primary" @click="addPart">添加>></el-button>
<el-button type="primary" @click="deletePart">删除<<</el-button>
@ -805,6 +815,16 @@ import {
this.modalData.partCostGroupId = this.modalData.partCostGroupId.toUpperCase()
this.modalData.planningMethod = this.modalData.planningMethod.toUpperCase()
}
},
'searchData.searchType'(newVal,oldVal){
this.searchData.partNo = ''
this.searchData.partDesc = ''
this.searchTypeChange();
},
partModelFlag(newVal,oldVal){
if (newVal === false){
this.refreshDetailList();
}
}
},
data() {
@ -815,8 +835,16 @@ import {
username: this.$store.state.user.name,
projectId: '',
customerId: '',
searchType: 'Y'
searchType: 'Y',
partNo: '',
partDesc: '',
partNos: '',
page: 1,
limit: 10
},
pageIndex: 1,
pageSize: 20,
totalPage: 0,
visible: false,
dataListLoading: false,
currentRow: '',
@ -1443,6 +1471,19 @@ import {
},
methods: {
//
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.searchTypeChange()
},
//
currentChangeHandle (val) {
this.pageIndex = val
this.searchTypeChange()
},
// bu
getBuBySite () {
let tempData = {
@ -1588,17 +1629,23 @@ import {
//
init(inData) {
//
this.searchData = JSON.parse(JSON.stringify(inData))
this.searchData.searchType = 'Y'
this.searchData = {
...JSON.parse(JSON.stringify(inData)),
searchType: 'Y',
page: 1,
limit: 10,
partNo: '',
partDesc: '',
partNos: '',
}
//
this.searchTable()
},
searchTable(){
getProjectInfoPartList(this.searchData).then(({data}) => {
//
if (data && data.code == 0) {
if (data && data.code === 0) {
this.dataList = data.rows
} else {
this.dataList = []
@ -1607,7 +1654,7 @@ import {
},
addModal () {
if (this.searchData.projectId == "" || this.searchData.projectId == null) {
if (this.searchData.projectId === "" || this.searchData.projectId == null) {
this.$alert('请选择项目!', '错误', {
confirmButtonText: '确定'
})
@ -1986,10 +2033,6 @@ import {
this.$message.warning('请选择计量单位!')
return
}
// if (this.modalData.codeNo === '' || this.modalData.codeNo == null) {
// this.$message.warning('')
// return
// }
if (this.modalData.buNo === '' || this.modalData.buNo == null) {
this.$message.warning('请选择BU!')
return
@ -2044,29 +2087,32 @@ import {
this.partList1 = []
this.partList2 = []
this.searchData.searchType = 'Y'
this.searchData.partNo = ''
this.searchData.partDesc = ''
this.searchData.partNos = ''
this.handleGetProjectPartList();
},
handleGetProjectPartList(){
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
getProjectPartList(this.searchData).then(({data}) => {
this.partListAll = data.row1
this.partList1 = this.partListAll
this.partData = {
site: this.$store.state.user.site,
partNo: '',
partDesc: ''
if (data && data.code === 0){
this.partList1 = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
this.partModelFlag = true
}
this.partModelFlag = true
})
},
//
searchTypeChange () {
getProjectPartList(this.searchData).then(({data}) => {
this.partListAll = data.row1
this.partList1 = this.partListAll
this.partData = {
site: this.$store.state.user.site,
partNo: '',
partDesc: ''
}
})
// 使 map partNo
let partNos = this.partList2.map(part => part.partNo)
// 使 join partNo
this.searchData.partNos = partNos.join(",")
this.handleGetProjectPartList();
},
//
@ -2078,43 +2124,34 @@ import {
* 选择项目物料
*/
getPartList () {
let tempList = []
if (this.partData.partNo !== '' && this.partData.partDesc === '') {
this.partList1.forEach(item => {
if (item.partNo.includes(this.partData.partNo)) {
tempList.push(item)
}
})
this.partList1 = tempList
} else if (this.partData.partDesc !== '' && this.partData.partNo === '') {
this.partList1.forEach(item => {
if (item.partDesc.includes(this.partData.partDesc)) {
tempList.push(item)
}
})
this.partList1 = tempList
} else if (this.partData.partNo !== '' && this.partData.partDesc !== '') {
this.partList1.forEach(item => {
if (item.partNo.includes(this.partData.partNo) && item.partDesc.includes(this.partData.partDesc)) {
tempList.push(item)
}
})
this.partList1 = tempList
} else {
this.partList1 = this.partListAll.filter(x => {
return this.partList2.every(y => y.partNo !== x.partNo)
})
}
// getPartListBy(this.partData).then(({data}) => {
// if (data && data.code === 0) {
// this.partList1 = data.rows
// } else {
// this.$alert(data.msg, '', {
// confirmButtonText: ''
// })
// }
// })
// let tempList = []
// if (this.partData.partNo !== '' && this.partData.partDesc === '') {
// this.partList1.forEach(item => {
// if (item.partNo.includes(this.partData.partNo)) {
// tempList.push(item)
// }
// })
// this.partList1 = tempList
// } else if (this.partData.partDesc !== '' && this.partData.partNo === '') {
// this.partList1.forEach(item => {
// if (item.partDesc.includes(this.partData.partDesc)) {
// tempList.push(item)
// }
// })
// this.partList1 = tempList
// } else if (this.partData.partNo !== '' && this.partData.partDesc !== '') {
// this.partList1.forEach(item => {
// if (item.partNo.includes(this.partData.partNo) && item.partDesc.includes(this.partData.partDesc)) {
// tempList.push(item)
// }
// })
// this.partList1 = tempList
// } else {
// this.partList1 = this.partListAll.filter(x => {
// return this.partList2.every(y => y.partNo !== x.partNo)
// })
// }
},
//
@ -2141,13 +2178,14 @@ import {
this.partSelections1.forEach(item => {
item.customerPartNo = ''
this.partList2.push(item)
let index = this.partList1.findIndex(x => {
if (x.partNo === item.partNo) {
return true;
}
})
this.partList1.splice(index, 1)
// let index = this.partList1.findIndex(x => {
// if (x.partNo === item.partNo) {
// return true;
// }
// })
// this.partList1.splice(index, 1)
})
this.searchTypeChange()
// for (let i = 0; i < this.partSelections1.length; i++) {
// this.partSelections1[i].customerPartNo = ''
@ -2187,13 +2225,14 @@ import {
}
this.partSelections2.forEach(item => {
this.partList1.push(item)
let index = this.partList2.findIndex(x => {
if (x.partNo === item.partNo) {
return true;
}
})
this.partList2.splice(index, 1)
// let index = this.partList2.findIndex(x => {
// if (x.partNo === item.partNo) {
// return true;
// }
// })
// this.partList2.splice(index, 1)
})
this.searchTypeChange()
// for (let i = 0; i < this.partSelections2.length; i++) {

Loading…
Cancel
Save