|
|
@ -1,11 +1,10 @@ |
|
|
<template> |
|
|
<template> |
|
|
<div class="mod-config"> |
|
|
<div class="mod-config"> |
|
|
<el-form label-position="top" style="margin-top: 1px; margin-left: 0px;"> |
|
|
|
|
|
<el-form :inline="true" label-position="top" style="margin-top: 0px"> |
|
|
|
|
|
<el-button type="primary" @click="addModal">新增</el-button> |
|
|
|
|
|
<el-button type="primary" @click="partImportModal">料号导入</el-button> |
|
|
|
|
|
<el-button type="primary" icon="el-icon-upload" @click="projectPartUpload">Excel导入</el-button> |
|
|
|
|
|
<download-excel |
|
|
|
|
|
|
|
|
<el-form label-position="top" style="margin-left: 2px;"> |
|
|
|
|
|
<el-button type="primary" @click="addModal">新增</el-button> |
|
|
|
|
|
<el-button type="primary" @click="partImportModal">料号导入</el-button> |
|
|
|
|
|
<el-button type="primary" icon="el-icon-upload" @click="projectPartUpload">Excel导入</el-button> |
|
|
|
|
|
<download-excel |
|
|
:fields="fields()" |
|
|
:fields="fields()" |
|
|
:data="exportData" |
|
|
:data="exportData" |
|
|
type="xls" |
|
|
type="xls" |
|
|
@ -19,13 +18,12 @@ |
|
|
class="el-button el-button--primary el-button--medium"> |
|
|
class="el-button el-button--primary el-button--medium"> |
|
|
{{ '导出' }} |
|
|
{{ '导出' }} |
|
|
</download-excel> |
|
|
</download-excel> |
|
|
</el-form> |
|
|
|
|
|
</el-form> |
|
|
</el-form> |
|
|
|
|
|
|
|
|
<el-table |
|
|
<el-table |
|
|
:data="dataList" |
|
|
:data="dataList" |
|
|
height="240" |
|
|
height="240" |
|
|
border |
|
|
border |
|
|
v-loading="dataListLoading" |
|
|
|
|
|
style="width: 100%; "> |
|
|
style="width: 100%; "> |
|
|
<el-table-column |
|
|
<el-table-column |
|
|
v-for="(item,index) in columnList" :key="index" |
|
|
v-for="(item,index) in columnList" :key="index" |
|
|
@ -73,6 +71,18 @@ |
|
|
<!-- </el-table-column>--> |
|
|
<!-- </el-table-column>--> |
|
|
</el-table> |
|
|
</el-table> |
|
|
|
|
|
|
|
|
|
|
|
<!-- 分页插件 --> |
|
|
|
|
|
<el-pagination |
|
|
|
|
|
style="margin-top: 5px" |
|
|
|
|
|
@size-change="sizeChangeHandle2" |
|
|
|
|
|
@current-change="currentChangeHandle2" |
|
|
|
|
|
:current-page="pageIndex2" |
|
|
|
|
|
:page-sizes="[20, 50, 100, 200, 500]" |
|
|
|
|
|
:page-size="pageSize2" |
|
|
|
|
|
:total="totalPage2" |
|
|
|
|
|
layout="total, sizes, prev, pager, next, jumper"> |
|
|
|
|
|
</el-pagination> |
|
|
|
|
|
|
|
|
<!-- 物料新增/编辑模态框 --> |
|
|
<!-- 物料新增/编辑模态框 --> |
|
|
<el-dialog :title="modalData.title" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="1000px"> |
|
|
<el-dialog :title="modalData.title" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="1000px"> |
|
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-top: -5px;"> |
|
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-top: -5px;"> |
|
|
@ -509,7 +519,6 @@ |
|
|
:height="300" |
|
|
:height="300" |
|
|
:data="itemModalList" |
|
|
:data="itemModalList" |
|
|
border |
|
|
border |
|
|
v-loading="dataListLoading" |
|
|
|
|
|
style="width: 100%;"> |
|
|
style="width: 100%;"> |
|
|
<el-table-column |
|
|
<el-table-column |
|
|
v-for="(item,index) in columnDetailList" :key="index" |
|
|
v-for="(item,index) in columnDetailList" :key="index" |
|
|
@ -590,7 +599,7 @@ |
|
|
<el-form-item :label="'物料名称'"> |
|
|
<el-form-item :label="'物料名称'"> |
|
|
<el-input v-model="searchData.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> |
|
|
<el-form-item :label="'物料状态'"> |
|
|
|
|
|
|
|
|
<el-form-item :label="'物料来源'"> |
|
|
<el-select v-model="searchData.searchType" style="width: 120px"> |
|
|
<el-select v-model="searchData.searchType" style="width: 120px"> |
|
|
<el-option label="Project Part" value="Y"></el-option> |
|
|
<el-option label="Project Part" value="Y"></el-option> |
|
|
<el-option label="Inventory Part" value="N"></el-option> |
|
|
<el-option label="Inventory Part" value="N"></el-option> |
|
|
@ -840,13 +849,17 @@ import { |
|
|
partDesc: '', |
|
|
partDesc: '', |
|
|
partNos: '', |
|
|
partNos: '', |
|
|
page: 1, |
|
|
page: 1, |
|
|
limit: 10 |
|
|
|
|
|
|
|
|
limit: 10, |
|
|
|
|
|
page2: 1, |
|
|
|
|
|
limit2: 10 |
|
|
}, |
|
|
}, |
|
|
pageIndex: 1, |
|
|
pageIndex: 1, |
|
|
pageSize: 20, |
|
|
pageSize: 20, |
|
|
totalPage: 0, |
|
|
totalPage: 0, |
|
|
|
|
|
pageIndex2: 1, |
|
|
|
|
|
pageSize2: 20, |
|
|
|
|
|
totalPage2: 0, |
|
|
visible: false, |
|
|
visible: false, |
|
|
dataListLoading: false, |
|
|
|
|
|
currentRow: '', |
|
|
currentRow: '', |
|
|
columnList:[ |
|
|
columnList:[ |
|
|
{ |
|
|
{ |
|
|
@ -938,7 +951,7 @@ import { |
|
|
columnProp: "statusDesc", |
|
|
columnProp: "statusDesc", |
|
|
headerAlign: "center", |
|
|
headerAlign: "center", |
|
|
align: "center", |
|
|
align: "center", |
|
|
columnLabel: "物料状态", |
|
|
|
|
|
|
|
|
columnLabel: "物料来源", |
|
|
columnHidden: false, |
|
|
columnHidden: false, |
|
|
columnImage: false, |
|
|
columnImage: false, |
|
|
status: true, |
|
|
status: true, |
|
|
@ -1484,6 +1497,19 @@ import { |
|
|
this.searchTypeChange() |
|
|
this.searchTypeChange() |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 子明细每页数 |
|
|
|
|
|
sizeChangeHandle2 (val) { |
|
|
|
|
|
this.pageSize2 = val |
|
|
|
|
|
this.pageIndex2 = 1 |
|
|
|
|
|
this.searchTable() |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// 子明细当前页 |
|
|
|
|
|
currentChangeHandle2 (val) { |
|
|
|
|
|
this.pageIndex2 = val |
|
|
|
|
|
this.searchTable() |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
// 获取用户的bu |
|
|
// 获取用户的bu |
|
|
getBuBySite () { |
|
|
getBuBySite () { |
|
|
let tempData = { |
|
|
let tempData = { |
|
|
@ -1637,20 +1663,28 @@ import { |
|
|
partNo: '', |
|
|
partNo: '', |
|
|
partDesc: '', |
|
|
partDesc: '', |
|
|
partNos: '', |
|
|
partNos: '', |
|
|
|
|
|
page2: 1, |
|
|
|
|
|
limit2: 10 |
|
|
} |
|
|
} |
|
|
//刷新表格 |
|
|
//刷新表格 |
|
|
this.searchTable() |
|
|
this.searchTable() |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
searchTable(){ |
|
|
|
|
|
|
|
|
searchTable () { |
|
|
|
|
|
this.searchData.limit2 = this.pageSize2 |
|
|
|
|
|
this.searchData.page2 = this.pageIndex2 |
|
|
getProjectInfoPartList(this.searchData).then(({data}) => { |
|
|
getProjectInfoPartList(this.searchData).then(({data}) => { |
|
|
//区分请求成功和失败的状况 |
|
|
//区分请求成功和失败的状况 |
|
|
if (data && data.code === 0) { |
|
|
if (data && data.code === 0) { |
|
|
this.dataList = data.rows |
|
|
|
|
|
|
|
|
// this.dataList = data.rows |
|
|
|
|
|
this.dataList = data.page.list |
|
|
|
|
|
this.pageIndex2 = data.page.currPage |
|
|
|
|
|
this.pageSize2 = data.page.pageSize |
|
|
|
|
|
this.totalPage2 = data.page.totalCount |
|
|
} else { |
|
|
} else { |
|
|
this.dataList = [] |
|
|
this.dataList = [] |
|
|
} |
|
|
} |
|
|
}); |
|
|
|
|
|
|
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
addModal () { |
|
|
addModal () { |
|
|
@ -2092,6 +2126,7 @@ import { |
|
|
this.searchData.partNos = '' |
|
|
this.searchData.partNos = '' |
|
|
this.handleGetProjectPartList(); |
|
|
this.handleGetProjectPartList(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
handleGetProjectPartList(){ |
|
|
handleGetProjectPartList(){ |
|
|
this.searchData.limit = this.pageSize |
|
|
this.searchData.limit = this.pageSize |
|
|
this.searchData.page = this.pageIndex |
|
|
this.searchData.page = this.pageIndex |
|
|
@ -2112,7 +2147,7 @@ import { |
|
|
let partNos = this.partList2.map(part => part.partNo) |
|
|
let partNos = this.partList2.map(part => part.partNo) |
|
|
// 使用 join 将 partNo 连接成一个字符串 |
|
|
// 使用 join 将 partNo 连接成一个字符串 |
|
|
this.searchData.partNos = partNos.join(",") |
|
|
this.searchData.partNos = partNos.join(",") |
|
|
this.handleGetProjectPartList(); |
|
|
|
|
|
|
|
|
this.handleGetProjectPartList() |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
// 关闭后刷新列表 |
|
|
// 关闭后刷新列表 |
|
|
@ -2415,7 +2450,6 @@ import { |
|
|
message: '刷新成功', |
|
|
message: '刷新成功', |
|
|
type: 'success', |
|
|
type: 'success', |
|
|
duration: 1500, |
|
|
duration: 1500, |
|
|
|
|
|
|
|
|
onClose: () => { |
|
|
onClose: () => { |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
@ -2426,16 +2460,16 @@ import { |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
//导出excel |
|
|
//导出excel |
|
|
createExportData() { |
|
|
createExportData() { |
|
|
return this.dataList; |
|
|
|
|
|
|
|
|
return this.dataList |
|
|
}, |
|
|
}, |
|
|
startDownload() { |
|
|
|
|
|
// this.exportData = this.dataList |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
finishDownload() { |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
startDownload() {}, |
|
|
|
|
|
|
|
|
|
|
|
finishDownload() {}, |
|
|
|
|
|
|
|
|
fields() { |
|
|
fields() { |
|
|
let json = "{" |
|
|
let json = "{" |
|
|
this.columnList.forEach((item, index) => { |
|
|
this.columnList.forEach((item, index) => { |
|
|
@ -2447,9 +2481,9 @@ import { |
|
|
}) |
|
|
}) |
|
|
json += "}" |
|
|
json += "}" |
|
|
let s = eval("(" + json + ")") |
|
|
let s = eval("(" + json + ")") |
|
|
|
|
|
|
|
|
return s |
|
|
return s |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
closeDataFromDialog(){ |
|
|
closeDataFromDialog(){ |
|
|
this.dataForm={ |
|
|
this.dataForm={ |
|
|
id:0, |
|
|
id:0, |
|
|
|