|
|
|
@ -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 |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
// 改变事件 |
|
|
|
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++) { |
|
|
|
|