8 changed files with 1008 additions and 6 deletions
-
2src/api/eam/eam.js
-
26src/api/part/bomSearch3.js
-
2src/views/common/home.vue
-
3src/views/modules/eam/eamFeedBack.vue
-
68src/views/modules/eam/eamWorkOrderForDefect.vue
-
5src/views/modules/part/bomManagement.vue
-
906src/views/modules/part/bomSearch3.vue
-
2src/views/modules/part/quicklyCreateBom.vue
@ -0,0 +1,26 @@ |
|||
import { createAPI } from "@/utils/httpRequest.js"; |
|||
|
|||
/** |
|||
* bom列表查询 |
|||
* @param data |
|||
* @returns {*} |
|||
*/ |
|||
export const bomSearchHeader = data => createAPI(`/part/bomSearch3/bomSearchHeader`,'post',data) |
|||
|
|||
/** |
|||
* 查询bom替代树形 |
|||
* @param data |
|||
* @returns {*} |
|||
*/ |
|||
export const getAlternativeTree = data => createAPI(`/part/bomSearch3/getAlternativeTree`,'post',data) |
|||
|
|||
/** |
|||
* 查询子物料 |
|||
* @param data |
|||
* @returns {*} |
|||
*/ |
|||
export const getComponentPartList = data => createAPI(`/part/bomSearch3/getComponentPartList`,'post',data) |
|||
|
|||
|
|||
|
|||
|
|||
@ -0,0 +1,906 @@ |
|||
<template> |
|||
<div class="mod-config"> |
|||
<!-- 查询条件 --> |
|||
<el-form :inline="true" label-position="top" :model="searchData"> |
|||
<el-form-item :label="'BU'"> |
|||
<el-select v-model="searchData.buNo" placeholder="请选择" clearable style="width: 90px"> |
|||
<el-option |
|||
v-for = "i in buList" |
|||
:key = "i.buNo" |
|||
:label = "i.buDesc" |
|||
:value = "i.buNo"> |
|||
</el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item :label="'物料编码'"> |
|||
<el-input v-model="searchData.partNo" clearable style="width: 120px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'物料名称'"> |
|||
<el-input v-model="searchData.partDesc" clearable style="width: 300px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="'制造类型'"> |
|||
<el-select v-model="searchData.bomType" clearable style="width: 120px"> |
|||
<el-option label="Manufacturing" value="Manufacturing"></el-option> |
|||
<el-option label="Repair" value="Repair"></el-option> |
|||
<el-option label="Purchase" value="Purchase"></el-option> |
|||
<el-option label="Prototype" value="Prototype"></el-option> |
|||
</el-select> |
|||
</el-form-item> |
|||
<el-form-item :label="'BOM版本号'"> |
|||
<el-input v-model="searchData.engChgLevel" style="width: 70px"></el-input> |
|||
</el-form-item> |
|||
<el-form-item :label="' '"> |
|||
<el-button v-if="!authSearch" :loading="queryLoading" @click="getDataList()">查询</el-button> |
|||
<download-excel |
|||
:fields="fields()" |
|||
:data="exportData" |
|||
type="xls" |
|||
:name="exportName" |
|||
:header="exportHeader" |
|||
:footer="exportFooter" |
|||
:fetch="createExportData" |
|||
:before-generate="startDownload" |
|||
:before-finish="finishDownload" |
|||
worksheet="导出信息" |
|||
class="el-button el-button--primary el-button--medium"> |
|||
{{ "导出" }} |
|||
</download-excel> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
<!-- bom列表 --> |
|||
<el-table |
|||
:height="height" |
|||
:data="dataList" |
|||
border |
|||
ref="bomHeaderTable" |
|||
@row-click="headerClickRow" |
|||
@current-change="changeCurrentRow" |
|||
style="width: 100%"> |
|||
<el-table-column |
|||
v-for="(item,index) in columnList" :key="index" |
|||
:sortable="item.columnSortable" |
|||
:prop="item.columnProp" |
|||
:header-align="item.headerAlign" |
|||
:show-overflow-tooltip="item.showOverflowTooltip" |
|||
:align="item.align" |
|||
:fixed="item.fixed === ''?false:item.fixed" |
|||
:min-width="item.columnWidth" |
|||
:label="item.columnLabel"> |
|||
<template slot-scope="scope"> |
|||
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span> |
|||
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<!-- 分页插件 --> |
|||
<el-pagination style="margin-top: 0px" |
|||
@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-tabs v-model="activeTable" style="width: 100%" :style="{height: secondHeight + 50 + 'px'}" type="border-card" @tab-click="tabClick" class="customer-tab"> |
|||
<!-- Graphical Structure页签 --> |
|||
<el-tab-pane label="Graphical Structure" name="GraphicalStructure"> |
|||
<el-row> |
|||
<el-col :style="{width: leftWidth + 'px',height: secondHeight + 'px'}" class="down-tree"> |
|||
<el-tree |
|||
:data="treeData" |
|||
node-key="id" |
|||
:default-expand-all="true" |
|||
:expand-on-click-node="false" |
|||
@node-click="handleNodeClick" |
|||
:props="defaultProps"> |
|||
</el-tree> |
|||
</el-col> |
|||
<el-col :style="{width: rightWidth + 'px',height: secondHeight + 'px'}" style="margin-left: 10px"> |
|||
<el-table |
|||
:height="secondHeight" |
|||
:data="componentPartList" |
|||
border |
|||
style="width: 100%"> |
|||
<el-table-column |
|||
v-for="(item,index) in componentPartColumnList" :key="index" |
|||
:sortable="item.columnSortable" |
|||
:prop="item.columnProp" |
|||
:header-align="item.headerAlign" |
|||
:show-overflow-tooltip="item.showOverflowTooltip" |
|||
:align="item.align" |
|||
:fixed="item.fixed==''?false:item.fixed" |
|||
:min-width="item.columnWidth" |
|||
:label="item.columnLabel"> |
|||
<template slot-scope="scope"> |
|||
<span v-if="!item.columnHidden"> {{ scope.row[item.columnProp] }}</span> |
|||
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</el-col> |
|||
</el-row> |
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
|
|||
<!-- chooseList模态框 --> |
|||
<ChooseList ref="baseList" @getBaseData="getBaseData"></ChooseList> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import { |
|||
bomSearchHeader, // bom列表查询 |
|||
getAlternativeTree, // 查询bom替代树形 |
|||
getComponentPartList, // 查询子物料 |
|||
} from '@/api/part/bomSearch3.js' |
|||
import {getSiteAndBuByUserName2} from "@/api/qc/qc.js" |
|||
import ChooseList from '@/views/modules/common/Chooselist_eam' |
|||
import dayjs from "dayjs"; |
|||
export default { |
|||
// 组件 |
|||
components: { |
|||
ChooseList |
|||
}, |
|||
// 监听 |
|||
watch: { |
|||
searchData: { |
|||
deep: true, |
|||
handler: function (newV, oldV) { |
|||
this.searchData.partNo = this.searchData.partNo.toUpperCase() |
|||
} |
|||
} |
|||
}, |
|||
// 对象 |
|||
data () { |
|||
return { |
|||
// 导出 |
|||
exportData: [], |
|||
exportName: 'BOM多级查询' + this.dayjs().format('YYYYMMDDHHmmss'), |
|||
exportHeader: ['BOM多级查询'], |
|||
exportFooter: [], |
|||
resultList: [], |
|||
buList: [], |
|||
menuId: this.$route.meta.menuId, |
|||
// ======== 行高 ======== |
|||
height: 200, |
|||
secondHeight: 200, |
|||
leftWidth: 300, |
|||
rightWidth: '', |
|||
// ======== 分页 ======== |
|||
pageIndex: 1, |
|||
pageSize: 50, |
|||
totalPage: 0, |
|||
// 条件查询 |
|||
searchData: { |
|||
site: '', |
|||
buNo: '', |
|||
userName: this.$store.state.user.name, |
|||
partNo: '', |
|||
partDesc: '', |
|||
bomType: '', |
|||
engChgLevel: '', |
|||
page: 1, |
|||
limit: 10 |
|||
}, |
|||
// loading |
|||
queryLoading: false, |
|||
// 初始页签 |
|||
activeTable: 'GraphicalStructure', |
|||
// ======== 数据对象 ======== |
|||
alternativeData: { |
|||
site: '', |
|||
partNo: '', |
|||
partDesc: '', |
|||
bomType: '', |
|||
engChgLevel: '', |
|||
alternativeNo: '', |
|||
alternativeDescription: '', |
|||
minLotQty: '', |
|||
noteText: '', |
|||
status: '', |
|||
}, |
|||
// ======== 选中的当前行数据 ======== |
|||
headerCurrentRow: {}, |
|||
defaultProps: { |
|||
children: "informationList", |
|||
label: "id", |
|||
}, |
|||
// ======== 数据列表 ======== |
|||
dataList: [], |
|||
treeData: [], |
|||
componentPartList: [], |
|||
// ======== 列表表头 ======== |
|||
columnList: [ |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 601002002, |
|||
serialNumber: '601002002Table1PartNo', |
|||
tableId: '601002002Table1', |
|||
tableName: 'BOMHeader表', |
|||
columnProp: 'partNo', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '物料编码', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 120 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 601002002, |
|||
serialNumber: '601002002Table1PartDesc', |
|||
tableId: '601002002Table1', |
|||
tableName: 'BOMHeader表', |
|||
columnProp: 'partDesc', |
|||
headerAlign: 'center', |
|||
align: 'left', |
|||
columnLabel: '物料名称', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 300 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 601002002, |
|||
serialNumber: '601002002Table1BomType', |
|||
tableId: '601002002Table1', |
|||
tableName: 'BOMHeader表', |
|||
columnProp: 'bomType', |
|||
headerAlign: 'center', |
|||
align: 'left', |
|||
columnLabel: '制造类型', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 120 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 601002002, |
|||
serialNumber: '601002002Table1EngChgLevel', |
|||
tableId: '601002002Table1', |
|||
tableName: 'BOMHeader表', |
|||
columnProp: 'engChgLevel', |
|||
headerAlign: 'center', |
|||
align: 'right', |
|||
columnLabel: 'BOM版本号', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 100 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 601002002, |
|||
serialNumber: '601002002Table1engRevision', |
|||
tableId: '601002002Table1', |
|||
tableName: 'BOMHeader表', |
|||
columnProp: 'engRevision', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '工程版本号', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 100 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 601002002, |
|||
serialNumber: '601002002Table1NetWeight', |
|||
tableId: '601002002Table1', |
|||
tableName: 'BOMHeader表', |
|||
columnProp: 'netWeight', |
|||
headerAlign: 'center', |
|||
align: 'right', |
|||
columnLabel: '净重', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 100 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 601002002, |
|||
serialNumber: '601002002Table1EffPhaseInDate', |
|||
tableId: '601002002Table1', |
|||
tableName: 'BOMHeader表', |
|||
columnProp: 'effPhaseInDate', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '生效日期', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 130 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 601002002, |
|||
serialNumber: '601002002Table1EffPhaseOutDate', |
|||
tableId: '601002002Table1', |
|||
tableName: 'BOMHeader表', |
|||
columnProp: 'effPhaseOutDate', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '失效日期', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 130 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 601002002, |
|||
serialNumber: '601002002Table1CreateDate', |
|||
tableId: '601002002Table1', |
|||
tableName: 'BOMHeader表', |
|||
columnProp: 'createDate', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '创建时间', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 170 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 601002002, |
|||
serialNumber: '601002002Table1CreateBy', |
|||
tableId: '601002002Table1', |
|||
tableName: 'BOMHeader表', |
|||
columnProp: 'createBy', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '创建人', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 100 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 601002002, |
|||
serialNumber: '601002002Table1UpdateDate', |
|||
tableId: '601002002Table1', |
|||
tableName: 'BOMHeader表', |
|||
columnProp: 'updateDate', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '更新时间', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 170 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 601002002, |
|||
serialNumber: '601002002Table1UpdateBy', |
|||
tableId: '601002002Table1', |
|||
tableName: 'BOMHeader表', |
|||
columnProp: 'updateBy', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '更新人', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 100 |
|||
} |
|||
], |
|||
componentPartColumnList: [ |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 601002002, |
|||
serialNumber: '601002002Table2LineSequence', |
|||
tableId: '601002002Table2', |
|||
tableName: 'BOMComponent表', |
|||
columnProp: 'lineSequence', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '序号', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 50 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 601002002, |
|||
serialNumber: '601002002Table2ComponentPart', |
|||
tableId: '601002002Table2', |
|||
tableName: 'BOMComponent表', |
|||
columnProp: 'componentPart', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '物料编码', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 120 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 601002002, |
|||
serialNumber: '601002002Table2ComponentPartDesc', |
|||
tableId: '601002002Table2', |
|||
tableName: 'BOMComponent表', |
|||
columnProp: 'componentPartDesc', |
|||
headerAlign: 'center', |
|||
align: 'left', |
|||
columnLabel: '物料名称', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 300 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 601002002, |
|||
serialNumber: '601002002Table2QtyPerAssembly', |
|||
tableId: '601002002Table2', |
|||
tableName: 'BOMComponent表', |
|||
columnProp: 'qtyPerAssembly', |
|||
headerAlign: 'center', |
|||
align: 'right', |
|||
columnLabel: '单位用量', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 601002002, |
|||
serialNumber: '601002002Table2ComponentScrap', |
|||
tableId: '601002002Table2', |
|||
tableName: 'BOMComponent表', |
|||
columnProp: 'componentScrap', |
|||
headerAlign: 'center', |
|||
align: 'right', |
|||
columnLabel: '调机量', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 601002002, |
|||
serialNumber: '601002002Table2ShrinkageFactor', |
|||
tableId: '601002002Table2', |
|||
tableName: 'BOMComponent表', |
|||
columnProp: 'shrinkageFactor', |
|||
headerAlign: 'center', |
|||
align: 'right', |
|||
columnLabel: '损耗率', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 601002002, |
|||
serialNumber: '601002002Table2ConsumptionItem', |
|||
tableId: '601002002Table2', |
|||
tableName: 'BOMComponent表', |
|||
columnProp: 'consumptionItem', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '消耗项目', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 601002002, |
|||
serialNumber: '601002002Table2PrintUnitName', |
|||
tableId: '601002002Table2', |
|||
tableName: 'BOMComponent表', |
|||
columnProp: 'printUnitName', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '物料单位', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 60 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 601002002, |
|||
serialNumber: '601002002Table2IssueType', |
|||
tableId: '601002002Table2', |
|||
tableName: 'BOMComponent表', |
|||
columnProp: 'issueTypeName', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '生产属性', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 140 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 601002002, |
|||
serialNumber: '601002002Table2OperationNo', |
|||
tableId: '601002002Table2', |
|||
tableName: 'BOMComponent表', |
|||
columnProp: 'operationNo', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '工序', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 601002002, |
|||
serialNumber: '601002002Table2IssueToLoc', |
|||
tableId: '601002002Table2', |
|||
tableName: 'BOMComponent表', |
|||
columnProp: 'issueToLocName', |
|||
headerAlign: 'center', |
|||
align: 'center', |
|||
columnLabel: '发料库位', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 80 |
|||
}, |
|||
{ |
|||
userId: this.$store.state.user.name, |
|||
functionId: 601002002, |
|||
serialNumber: '601002002Table2NoteText', |
|||
tableId: '601002002Table2', |
|||
tableName: 'BOMComponent表', |
|||
columnProp: 'noteText', |
|||
headerAlign: 'center', |
|||
align: 'left', |
|||
columnLabel: '备注', |
|||
columnHidden: false, |
|||
columnImage: false, |
|||
columnSortable: false, |
|||
sortLv: 0, |
|||
status: true, |
|||
fixed: '', |
|||
columnWidth: 150 |
|||
}, |
|||
], |
|||
// ======== 必填规则 ======== |
|||
|
|||
// ======== 复选数据集 ======== |
|||
|
|||
// ======== 模态框开关控制 ======== |
|||
authSearch: false, |
|||
} |
|||
}, |
|||
|
|||
mounted () { |
|||
this.$nextTick(() => { |
|||
this.height = window.innerHeight / 2 - 140 |
|||
/*第二个表格高度的动态调整*/ |
|||
this.secondHeight = window.innerHeight - this.height - 220 |
|||
this.rightWidth = window.innerWidth - this.leftWidth - 275 |
|||
}) |
|||
}, |
|||
|
|||
created () { |
|||
// 按钮控制 |
|||
this.getButtonAuthData() |
|||
// 获取用户的 site 和 bu |
|||
this.getSiteAndBuByUserName2() |
|||
if (!this.authSearch) { |
|||
// 获取数据列表 |
|||
this.getDataList() |
|||
} |
|||
}, |
|||
// js |
|||
methods: { |
|||
// ======== 分页相关方法 ======== |
|||
/** |
|||
* 每页数 |
|||
* @param val |
|||
*/ |
|||
sizeChangeHandle (val) { |
|||
this.pageSize = val |
|||
this.pageIndex = 1 |
|||
this.getDataList() |
|||
}, |
|||
|
|||
/** |
|||
* 当前页 |
|||
* @param val |
|||
*/ |
|||
currentChangeHandle (val) { |
|||
this.pageIndex = val |
|||
this.getDataList() |
|||
}, |
|||
|
|||
// 获取用户的bu |
|||
getSiteAndBuByUserName2 () { |
|||
let tempData = { |
|||
username: this.$store.state.user.name, |
|||
} |
|||
getSiteAndBuByUserName2(tempData).then(({data}) => { |
|||
if (data.code === 0) { |
|||
this.buList = data.rows |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
// ======== 列表数据操作方法 ======== |
|||
/** |
|||
* 获取数据列表 |
|||
*/ |
|||
getDataList () { |
|||
this.searchData.limit = this.pageSize |
|||
this.searchData.page = this.pageIndex |
|||
this.queryLoading = true |
|||
bomSearchHeader(this.searchData).then(({data}) => { |
|||
if (data.code === 0) { |
|||
this.dataList = data.page.list |
|||
this.pageIndex = data.page.currPage |
|||
this.pageSize = data.page.pageSize |
|||
this.totalPage = data.page.totalCount |
|||
// 判断是否全部存在数据 |
|||
if (this.dataList.length > 0) { |
|||
// 设置选中行 |
|||
this.$refs.bomHeaderTable.setCurrentRow(this.dataList[0]) |
|||
this.headerClickRow(this.dataList[0]) |
|||
} else { |
|||
this.headerCurrentRow = {} |
|||
} |
|||
// 加载当前的页签的table |
|||
this.refreshCurrentTabTable() |
|||
} |
|||
this.queryLoading = false |
|||
}) |
|||
}, |
|||
|
|||
/** |
|||
* 单机选中信息 |
|||
* @param row |
|||
*/ |
|||
headerClickRow (row) { |
|||
this.$refs.bomHeaderTable.toggleRowSelection(row) |
|||
this.headerCurrentRow = JSON.parse(JSON.stringify(row)) |
|||
}, |
|||
|
|||
/** |
|||
* 树节点单机事件 |
|||
* @param e |
|||
* @param node |
|||
*/ |
|||
handleNodeClick (e, node) { |
|||
// 查询替代子物料 |
|||
getComponentPartList(e).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.componentPartList = data.rows |
|||
} else { |
|||
this.componentPartList = [] |
|||
} |
|||
}) |
|||
}, |
|||
// ======== 页签切换相关方法 ======== |
|||
/** |
|||
* 列表表格选择替换 |
|||
* @param tab |
|||
* @param event |
|||
*/ |
|||
tabClick (tab, event) { |
|||
// 刷新列表数据 |
|||
this.refreshCurrentTabTable() |
|||
}, |
|||
|
|||
/** |
|||
* 当前值发生变化的时候修改 |
|||
* @param row |
|||
* @param oldRow |
|||
*/ |
|||
changeCurrentRow (row, oldRow) { |
|||
// 判断是否是获取焦点的事件 |
|||
if (row) { |
|||
this.headerCurrentRow = JSON.parse(JSON.stringify(row)) |
|||
//刷新当前页表 |
|||
this.refreshCurrentTabTable() |
|||
this.componentPartList = [] |
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* 刷新页签的table数据 |
|||
*/ |
|||
refreshCurrentTabTable () { |
|||
if (this.activeTable === 'GraphicalStructure') { |
|||
// 获取bom替代树形 |
|||
this.getAlternativeTree() |
|||
} |
|||
}, |
|||
|
|||
/** |
|||
* 获取bom替代树形 |
|||
*/ |
|||
getAlternativeTree () { |
|||
getAlternativeTree(this.headerCurrentRow).then(({data}) => { |
|||
if (data && data.code === 0) { |
|||
this.treeData = data.rows |
|||
} else { |
|||
this.treeData = [] |
|||
} |
|||
}) |
|||
}, |
|||
|
|||
// ======== chooseList相关方法 ======== |
|||
/** |
|||
* 获取基础数据列表S |
|||
* @param val |
|||
* @param type |
|||
*/ |
|||
getBaseList (val, type) { |
|||
this.tagNo = val |
|||
this.$nextTick(() => { |
|||
let strVal = '' |
|||
if (val === 117) { |
|||
strVal = this.componentData.issueToLoc |
|||
} |
|||
this.$refs.baseList.init(val, strVal) |
|||
}) |
|||
}, |
|||
/** |
|||
* 列表方法的回调 |
|||
* @param val |
|||
*/ |
|||
getBaseData (val) { |
|||
if (this.tagNo === 117) { |
|||
this.componentData.issueToLoc = val.location_id |
|||
this.componentData.issueToLocName = val.location_name |
|||
} |
|||
}, |
|||
|
|||
//获取按钮的权限数据 |
|||
getButtonAuthData () { |
|||
let searchFlag = this.isAuth(this.menuId+":search") |
|||
//处理页面的权限数据 |
|||
this.authSearch = !searchFlag |
|||
}, |
|||
|
|||
// ======== 导出相关方法 ======== |
|||
/** |
|||
* 导出excel |
|||
*/ |
|||
async createExportData () { |
|||
this.searchData.limit = -1 |
|||
this.searchData.page = 1 |
|||
await bomSearchHeader(this.searchData).then(({data}) => { |
|||
this.resultList = data.page.list |
|||
}) |
|||
return this.resultList |
|||
}, |
|||
startDownload () {}, |
|||
finishDownload () {}, |
|||
fields () { |
|||
let json = '{' |
|||
this.columnList.forEach((item, index) => { |
|||
if (index == this.columnList.length - 1) { |
|||
json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"' |
|||
} else { |
|||
json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"' + ',' |
|||
} |
|||
}) |
|||
json += '}' |
|||
let s = eval('(' + json + ')') |
|||
return s |
|||
}, |
|||
} |
|||
} |
|||
</script> |
|||
|
|||
<style scoped lang="scss"> |
|||
.el-table /deep/ .cell{ |
|||
height: auto; |
|||
line-height: 1.5; |
|||
} |
|||
.down-tree{ |
|||
//height: 470px; |
|||
display: block; |
|||
overflow-y: scroll; |
|||
} |
|||
/deep/ .el-tabs--border-card>.el-tabs__content{ |
|||
padding: 5px; |
|||
} |
|||
</style> |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue