Browse Source

2025-01-20

BOM多级查询
设备维修确认
java8
fengyuan_yang 12 months ago
parent
commit
dc38fed957
  1. 2
      src/api/eam/eam.js
  2. 26
      src/api/part/bomSearch3.js
  3. 2
      src/views/common/home.vue
  4. 3
      src/views/modules/eam/eamFeedBack.vue
  5. 68
      src/views/modules/eam/eamWorkOrderForDefect.vue
  6. 5
      src/views/modules/part/bomManagement.vue
  7. 906
      src/views/modules/part/bomSearch3.vue
  8. 2
      src/views/modules/part/quicklyCreateBom.vue

2
src/api/eam/eam.js

@ -233,3 +233,5 @@ export const getInventoryStockList= data => createAPI(`/pms/eam/getInventoryStoc
export const saveTrans= data => createAPI(`/pms/eam/saveTrans`,'post',data)
export const saveCoreComponent= data => createAPI(`/pms/eam/saveCoreComponent`,'post',data)
export const confirmDefectOrder= data => createAPI(`/pms/eam/confirmDefectOrder`,'post',data)

26
src/api/part/bomSearch3.js

@ -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)

2
src/views/common/home.vue

@ -19,7 +19,7 @@
return {
// url:"http://xujiesoft.vicp.net:9191/bi/Show?uid=be15368c-bceb-11ef-9785-000c29f2c2b8",
//url:"http://192.168.1.90:9191/chart/reportShow?uid=3c800188-b04b-11ef-abf0-000c2947c1cd",
url:"http://172.26.68.17:9191/bi/Show?uid=eefa66f1-b058-11ef-a145-3868dd5b136a",
url:"http://172.26.68.20:9191/bi/Show?uid=eefa66f1-b058-11ef-a145-3868dd5b136a",
}
},
methods: {

3
src/views/modules/eam/eamFeedBack.vue

@ -36,7 +36,8 @@
</el-form-item>
<el-form-item :label="'状态'">
<el-select filterable v-model="searchData.status" clearable style="width: 130px">
<el-option label="已录入" value="已录入"></el-option>
<el-option label="已下达" value="已下达"></el-option>
<el-option label="维修确认" value="维修确认"></el-option>
<el-option label="维修完成" value="维修完成"></el-option>
<el-option label="维修失败" value="维修失败"></el-option>
<el-option label="已取消" value="已取消"></el-option>

68
src/views/modules/eam/eamWorkOrderForDefect.vue

@ -170,6 +170,7 @@
<template slot-scope="scope">
<!-- <a type="text" size="small" v-if="scope.row.status === '待审核'" @click="checkModal(scope.row)">审核</a>-->
<a type="text" size="small" v-if="(scope.row.status === '待审核' || scope.row.status === '已完工') && !authDetail" @click="reportModal(scope.row)">详情</a>
<a type="text" size="small" v-if="scope.row.status === '待确认' && !authDetail" @click="confirmResult(scope.row)">确认</a>
<a type="text" size="small" v-if="scope.row.status === '未开工' && !authCancel" @click="cancelOrder(scope.row)">取消工单</a>
</template>
</el-table-column>
@ -310,6 +311,7 @@
<el-button type="primary" @click="detailModelFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog title="核心配件" :close-on-click-modal="false" v-drag :visible.sync="coreComponentFlag" width="460px">
<el-form :inline="true" label-position="top">
<el-form-item label="备件编码">
@ -331,6 +333,7 @@
<el-button type="primary" @click="coreComponentFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<!-- 部门 -->
<el-dialog title="部门清单" :close-on-click-modal="false" v-drag :visible.sync="departmentModelFlag" width="520px">
<div class="rq">
@ -394,6 +397,21 @@
</el-footer>
</el-dialog>
<el-dialog title="维修确认" top="22vh" :close-on-click-modal="false" v-drag :visible.sync="confirmDefectModal" width="320px">
<el-form :inline="true" label-position="top">
<el-form-item style="margin-left: 83px" :label="'确认结果'">
<el-select filterable v-model="confirmData.confirmResult" style="width: 120px">
<el-option label="成功" value="Y"></el-option>
<el-option label="失败" value="N"></el-option>
</el-select>
</el-form-item>
</el-form>
<el-footer style="height:35px;margin-top: 20px;text-align:center">
<el-button style="margin-left: -12px" type="primary" @click="confirmDefectOrder()">保存</el-button>
<el-button type="primary" @click="confirmDefectModal = false">关闭</el-button>
</el-footer>
</el-dialog>
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
</div>
@ -409,7 +427,8 @@
getEmpyDeptList,
getDeptList,
updateReportResult, //
getSiteAndBuByUserName
getSiteAndBuByUserName,
confirmDefectOrder, //
} from "@/api/eam/eam.js"
import {
getTableDefaultListLanguage,
@ -1153,6 +1172,15 @@
authDetail: false,
authCancel: false,
menuId: this.$route.meta.menuId,
confirmData: {
site: '',
buNo: '',
orderNo: '',
functionType: '',
confirmResult: '',
confirmBy: ''
},
confirmDefectModal: false
}
},
@ -1556,6 +1584,44 @@
})
},
//
confirmResult (row) {
this.confirmData = {
site: row.site,
buNo: row.buNo,
orderNo: row.orderNo,
planID: row.planID,
functionType: row.functionType,
confirmResult: 'Y',
confirmBy: this.$store.state.user.name
}
this.confirmDefectModal = true
},
//
confirmDefectOrder () {
if (this.confirmData.confirmResult === '' || this.confirmData.confirmResult == null) {
this.$message.warning('请选择维修结果!')
return
}
confirmDefectOrder(this.confirmData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.confirmDefectModal = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
},
/**
* 查看故障图片
*/

5
src/views/modules/part/bomManagement.vue

@ -27,7 +27,7 @@
</el-select>
</el-form-item>
<el-form-item :label="'BOM版本号'">
<el-input v-model="searchData.engChgLevel" clearable style="width: 90px"></el-input>
<el-input v-model="searchData.engChgLevel" clearable style="width: 70px"></el-input>
</el-form-item>
<el-form-item :label="'BOM状态'">
<el-select v-model="searchData.status" clearable style="width: 120px">
@ -1100,6 +1100,7 @@ export default {
//
searchData: {
site: '',
buNo: '',
userName: this.$store.state.user.name,
partNo: '',
partDesc: '',
@ -1732,7 +1733,7 @@ export default {
{
userId: this.$store.state.user.name,
functionId: 601002,
serialNumber: '601002Table2PrintUnit',
serialNumber: '601002Table2PrintUnitName',
tableId: '601002Table2',
tableName: 'BOM子物料表',
columnProp: 'printUnitName',

906
src/views/modules/part/bomSearch3.vue

@ -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>

2
src/views/modules/part/quicklyCreateBom.vue

@ -5,7 +5,7 @@
<el-col :span="7" :style="{height: this.height + 54 + 'px'}" style="display: block;overflow-y: scroll">
<el-card style="width: 99%">
<div slot="header" style="height: 20px;margin-top: -10px">
<el-button size="mini" type="primary" round style="margin-left: -5px" @click="addTree">添加</el-button>
<el-button type="primary" style="margin-left: -5px" @click="addTree">添加</el-button>
<el-button size="mini" type="info" round @click="getNodeTree">刷新</el-button>
<el-button size="mini" type="primary" round :loading="buildAllLoading" @click="batchBuild">批量Build</el-button>
<el-button size="mini" type="primary" round :loading="resetAllLoading" @click="resetNodePart">重置物料</el-button>

Loading…
Cancel
Save