8 changed files with 7726 additions and 42 deletions
-
13src/api/part/quicklyCreateBom.js
-
2src/views/modules/part/bomManagement.vue
-
2308src/views/modules/part/bom_create.vue
-
4src/views/modules/part/partInformation.vue
-
2016src/views/modules/part/part_create.vue
-
837src/views/modules/part/quicklyCreateBom.vue
-
60src/views/modules/part/routingManagement.vue
-
2528src/views/modules/part/routing_create.vue
@ -0,0 +1,13 @@ |
|||||
|
import { createAPI } from "@/utils/httpRequest.js"; |
||||
|
|
||||
|
export const getNodeTree = data => createAPI(`/part/quicklyBom/getNodeTree`,'post',data) |
||||
|
export const nodeSave = data => createAPI(`/part/quicklyBom/nodeSave`,'post',data) |
||||
|
export const nodeDelete = data => createAPI(`/part/quicklyBom/nodeDelete`,'post',data) |
||||
|
export const nodeEdit = data => createAPI(`/part/quicklyBom/nodeEdit`,'post',data) |
||||
|
export const getBomInformationByPartNo = data => createAPI(`/part/quicklyBom/getBomInformationByPartNo`,'post',data) |
||||
|
export const savePartInfo = data => createAPI(`/part/quicklyBom/savePartInfo`,'post',data) |
||||
|
export const saveBomHeader = data => createAPI(`/part/quicklyBom/saveBomHeader`,'post',data) |
||||
|
export const getRoutingInformationByPartNo = data => createAPI(`/part/quicklyBom/getRoutingInformationByPartNo`,'post',data) |
||||
|
export const saveRoutingHeader = data => createAPI(`/part/quicklyBom/saveRoutingHeader`,'post',data) |
||||
|
export const batchBuildInfo = data => createAPI(`/part/quicklyBom/batchBuildInfo`,'post',data) |
||||
|
export const resetNodePartInfo = data => createAPI(`/part/quicklyBom/resetNodePartInfo`,'post',data) |
||||
2308
src/views/modules/part/bom_create.vue
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
2016
src/views/modules/part/part_create.vue
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,837 @@ |
|||||
|
<template> |
||||
|
<div class="white-body-view"> |
||||
|
<el-row :gutter="5"> |
||||
|
<!-- 树形结构 --> |
||||
|
<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" @click="addTree">添加</el-button> |
||||
|
<el-button size="mini" type="info" @click="getNodeTree">刷新</el-button> |
||||
|
<el-button size="mini" type="primary" :loading="buildAllLoading" @click="batchBuild">批量Build</el-button> |
||||
|
<el-button size="mini" type="primary" :loading="resetAllLoading" @click="resetNodePart">重置物料</el-button> |
||||
|
</div> |
||||
|
<div class="scroll-bar item"> |
||||
|
<el-tree |
||||
|
id="my-tree" |
||||
|
class="tree-view structure-tree scroll-bar" |
||||
|
highlight-current |
||||
|
check-strictly |
||||
|
:data="treeData" |
||||
|
:default-expand-all=true |
||||
|
:props="defaultProps" |
||||
|
:expand-on-click-node=false |
||||
|
@node-click="handleNodeClick" |
||||
|
:auto-expand-parent=false> |
||||
|
<span slot-scope="{ node, data }" class="custom-tree-node"> |
||||
|
<span class="tooltip"> |
||||
|
<span class="add-f-s-14">{{ data.nodeName }}</span> |
||||
|
</span> |
||||
|
<div class="operation-view" style="display: inline-block; padding: 0px 5px; margin-left: 5px; color: #777777;"> |
||||
|
<i style="color:#1c92e0" class="small-operation-btn el-icon-plus" @click="addTreeItem(data)"/> |
||||
|
<i style="color:#1c92e0" class="small-operation-btn el-icon-edit" @click="editTreeItem(data)"/> |
||||
|
<i style="color:#1c92e0" class="small-operation-btn el-icon-delete" @click="deleteTreeItem(data)"/> |
||||
|
<el-popover |
||||
|
placement="right" |
||||
|
width="80" |
||||
|
trigger="click"> |
||||
|
<a style="cursor: pointer" @click="queryPartList2(data)">已有料号</a> |
||||
|
<el-divider></el-divider> |
||||
|
<a style="cursor: pointer" @click="addPartModal(data)">新增料号</a> |
||||
|
<i style="color:#1c92e0" slot="reference" class="small-operation-btn el-icon-more"/> |
||||
|
</el-popover> |
||||
|
</div> |
||||
|
</span> |
||||
|
</el-tree> |
||||
|
</div> |
||||
|
</el-card> |
||||
|
</el-col> |
||||
|
<!-- 数据 --> |
||||
|
<el-col :span="17"> |
||||
|
<!-- 页签 --> |
||||
|
<el-tabs v-model="activeTable" style="width: 100%" type="border-card" @tab-click="refreshCurrentTabTable" class="customer-tab"> |
||||
|
<!-- BOM页签 --> |
||||
|
<el-tab-pane label="产品BOM管理" name="bom_info"> |
||||
|
<bom-create v-loading="bomLoading" ref="BomCreate" @refreshNode="refreshNode" @refreshBomLoading="refreshBomLoading" v-drag></bom-create> |
||||
|
</el-tab-pane> |
||||
|
<!-- Routing页签 --> |
||||
|
<el-tab-pane label="工艺路线管理" name="routing_info"> |
||||
|
<routing-create v-loading="routingLoading" ref="RoutingCreate" @refreshRoutingLoading="refreshRoutingLoading" v-drag></routing-create> |
||||
|
</el-tab-pane> |
||||
|
</el-tabs> |
||||
|
</el-col> |
||||
|
</el-row> |
||||
|
|
||||
|
<!-- 节点新增模态框 --> |
||||
|
<el-dialog title="节点" :close-on-click-modal="false" v-drag :visible.sync="nodeModalFlag" width="430px"> |
||||
|
<el-form :inline="true" label-position="top" :model="nodeData" :rules="nodeRules" style="margin-left: 7px;margin-top: -5px;"> |
||||
|
<el-form-item label="节点编码" prop="nodeId" :rules="nodeRules.nodeId"> |
||||
|
<el-input v-model="nodeData.nodeId" :disabled="nodeModalDisableFlag" style="width: 140px"></el-input> |
||||
|
</el-form-item> |
||||
|
<el-form-item label="节点名称" prop="nodeName" :rules="nodeRules.nodeName"> |
||||
|
<el-input v-model="nodeData.nodeName" style="width: 230px"></el-input> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<el-footer style="height:40px;margin-top: 10px;text-align:center"> |
||||
|
<el-button type="primary" @click="saveNodeData()">保存</el-button> |
||||
|
<el-button type="primary" @click="nodeModalFlag = false">关闭</el-button> |
||||
|
</el-footer> |
||||
|
</el-dialog> |
||||
|
|
||||
|
<!-- 物料模态框 --> |
||||
|
<el-dialog title="物料清单" :close-on-click-modal="false" v-drag :visible.sync="partModelFlag" width="900px"> |
||||
|
<div class="rq"> |
||||
|
<el-form :inline="true" label-position="top" :model="partData"> |
||||
|
<el-form-item :label="'物料编码'"> |
||||
|
<el-input v-model="partData.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-form-item> |
||||
|
<el-form-item :label="' '"> |
||||
|
<el-button type="primary" @click="queryPartList">查询</el-button> |
||||
|
</el-form-item> |
||||
|
</el-form> |
||||
|
<el-table |
||||
|
:height="300" |
||||
|
:data="partList" |
||||
|
@row-dblclick="getRowData" |
||||
|
border |
||||
|
style="width: 100%;"> |
||||
|
<el-table-column |
||||
|
v-for="(item,index) in partColumnList" :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 |
||||
|
@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> |
||||
|
</div> |
||||
|
<el-footer style="height:40px;margin-top: 20px;text-align:center"> |
||||
|
<el-button type="primary" @click="partModelFlag=false">关闭</el-button> |
||||
|
</el-footer> |
||||
|
</el-dialog> |
||||
|
|
||||
|
<!-- 新增物料 --> |
||||
|
<part-create ref="PartCreate" @refreshPageTables="getBomInfo" v-drag></part-create> |
||||
|
|
||||
|
<!-- chooseList模态框 --> |
||||
|
<ChooseList ref="baseList" @getBaseData="getBaseData"></ChooseList> |
||||
|
</div> |
||||
|
</template> |
||||
|
|
||||
|
<script> |
||||
|
import { |
||||
|
getNodeTree, |
||||
|
nodeSave, |
||||
|
nodeDelete, |
||||
|
nodeEdit, |
||||
|
batchBuildInfo, |
||||
|
resetNodePartInfo |
||||
|
} from "@/api/part/quicklyCreateBom.js" |
||||
|
import { |
||||
|
queryPartListBom, // 查出可创建BOM的物料 |
||||
|
} from "@/api/part/bomManagement.js" |
||||
|
import {userFavoriteList, saveUserFavorite, removeUserFavorite} from '@/api/userFavorite.js' |
||||
|
import ChooseList from '@/views/modules/common/Chooselist_eam' |
||||
|
import {Decimal} from "decimal.js"; |
||||
|
import BomCreate from "./bom_create.vue"; |
||||
|
import RoutingCreate from "./routing_create.vue"; |
||||
|
import PartCreate from "./part_create.vue"; |
||||
|
export default { |
||||
|
components: { |
||||
|
PartCreate, |
||||
|
BomCreate, |
||||
|
RoutingCreate, |
||||
|
ChooseList |
||||
|
}, |
||||
|
watch: { |
||||
|
nodeData: { |
||||
|
deep: true, |
||||
|
handler: function (newV, oldV) { |
||||
|
this.nodeData.nodeId = this.nodeData.nodeId.toUpperCase() |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
data () { |
||||
|
return { |
||||
|
activeTable: 'bom_info', |
||||
|
treeData: [], |
||||
|
defaultProps: { |
||||
|
children: "nodeList", |
||||
|
label: "nodeName", |
||||
|
}, |
||||
|
menuId: this.$route.meta.menuId, |
||||
|
// 是否收藏 |
||||
|
favorite: false, |
||||
|
exportData: [], |
||||
|
exportName: "节点" + this.dayjs().format('YYYYMMDDHHmmss'), |
||||
|
exportHeader: ["节点"], |
||||
|
exportFooter: [], |
||||
|
height: 200, |
||||
|
pageIndex: 1, |
||||
|
pageSize: 20, |
||||
|
totalPage: 0, |
||||
|
pageIndex2: 1, |
||||
|
pageSize2: 20, |
||||
|
totalPage2: 0, |
||||
|
partList: [], |
||||
|
nodeData: { |
||||
|
flag: '', |
||||
|
site: this.$store.state.user.site, |
||||
|
nodeId: '', |
||||
|
nodeName: '', |
||||
|
id: '', |
||||
|
pId: '', |
||||
|
createBy: this.$store.state.user.name, |
||||
|
updateBy: this.$store.state.user.name, |
||||
|
}, |
||||
|
partData: { |
||||
|
site: '', |
||||
|
partNo: '', |
||||
|
partDesc: '', |
||||
|
page: 1, |
||||
|
limit: 10 |
||||
|
}, |
||||
|
nodeRules:{ |
||||
|
nodeId:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: ['blur','change'] |
||||
|
} |
||||
|
], |
||||
|
nodeName:[ |
||||
|
{ |
||||
|
required: true, |
||||
|
message: ' ', |
||||
|
trigger: ['blur','change'] |
||||
|
} |
||||
|
], |
||||
|
}, |
||||
|
currentNode: {}, |
||||
|
partColumnList: [ |
||||
|
{ |
||||
|
columnProp: 'partNo', |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: '物料编码', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
columnSortable: false, |
||||
|
sortLv: 0, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 120 |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: 'partDesc', |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: '物料名称', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 300 |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: 'spec', |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: '规格型号', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 300 |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: 'printUnitName', |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: '计量单位', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100 |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: 'partType2', |
||||
|
headerAlign: "center", |
||||
|
align: "center", |
||||
|
columnLabel: '零件类型', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100 |
||||
|
}, |
||||
|
{ |
||||
|
columnProp: 'yieldRate', |
||||
|
headerAlign: "center", |
||||
|
align: "right", |
||||
|
columnLabel: '良品率', |
||||
|
columnHidden: false, |
||||
|
columnImage: false, |
||||
|
status: true, |
||||
|
fixed: '', |
||||
|
columnWidth: 100 |
||||
|
}, |
||||
|
], |
||||
|
// loading |
||||
|
|
||||
|
// 控制 |
||||
|
nodeModalFlag: false, |
||||
|
nodeModalDisableFlag: false, |
||||
|
partModelFlag: false, |
||||
|
buildAllLoading: false, |
||||
|
resetAllLoading: false, |
||||
|
bomLoading: false, |
||||
|
routingLoading: false |
||||
|
} |
||||
|
}, |
||||
|
created () { |
||||
|
// 按钮控制 |
||||
|
this.getButtonAuthData() |
||||
|
// 校验用户是否收藏 |
||||
|
this.favoriteIsOk() |
||||
|
// 获取树形结构 |
||||
|
this.getNodeTree() |
||||
|
}, |
||||
|
mounted () { |
||||
|
this.$nextTick(() => { |
||||
|
this.height = window.innerHeight - 151 |
||||
|
}) |
||||
|
}, |
||||
|
methods: { |
||||
|
// 每页数 |
||||
|
sizeChangeHandle2 (val) { |
||||
|
this.pageSize2 = val |
||||
|
this.pageIndex2 = 1 |
||||
|
this.queryPartList() |
||||
|
}, |
||||
|
|
||||
|
// 当前页 |
||||
|
currentChangeHandle2 (val) { |
||||
|
this.pageIndex2 = val |
||||
|
this.queryPartList() |
||||
|
}, |
||||
|
|
||||
|
// 查询下拉树结构 |
||||
|
getNodeTree () { |
||||
|
let tempData = { |
||||
|
site: this.$store.state.user.site, |
||||
|
pId: '0' |
||||
|
} |
||||
|
getNodeTree(tempData).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.treeData = data.rows |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 新增首节点 |
||||
|
addTree () { |
||||
|
this.nodeData = { |
||||
|
flag: '1', |
||||
|
site: this.$store.state.user.site, |
||||
|
nodeId: '', |
||||
|
nodeName: '', |
||||
|
pId: '0', |
||||
|
createBy: this.$store.state.user.name, |
||||
|
updateBy: this.$store.state.user.name, |
||||
|
} |
||||
|
this.nodeModalDisableFlag = false |
||||
|
this.nodeModalFlag = true |
||||
|
}, |
||||
|
|
||||
|
// 新增子节点 |
||||
|
addTreeItem (data) { |
||||
|
this.nodeData = { |
||||
|
flag: '1', |
||||
|
site: this.$store.state.user.site, |
||||
|
nodeId: '', |
||||
|
nodeName: '', |
||||
|
pId: data.id, |
||||
|
createBy: this.$store.state.user.name, |
||||
|
updateBy: this.$store.state.user.name, |
||||
|
} |
||||
|
this.nodeModalDisableFlag = false |
||||
|
this.nodeModalFlag = true |
||||
|
}, |
||||
|
|
||||
|
// 修改节点 |
||||
|
editTreeItem (data) { |
||||
|
this.nodeData = { |
||||
|
flag: '2', |
||||
|
site: data.site, |
||||
|
nodeId: data.nodeId, |
||||
|
nodeName: data.nodeName, |
||||
|
createBy: this.$store.state.user.name, |
||||
|
updateBy: this.$store.state.user.name, |
||||
|
} |
||||
|
this.nodeModalDisableFlag = true |
||||
|
this.nodeModalFlag = true |
||||
|
}, |
||||
|
|
||||
|
// 删除节点 |
||||
|
deleteTreeItem (data) { |
||||
|
this.$confirm('将删除该节点下的子节点数据!', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
nodeDelete(data).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.getNodeTree() |
||||
|
this.$message({ |
||||
|
message: '操作成功', |
||||
|
type: 'success', |
||||
|
duration: 1500, |
||||
|
onClose: () => {} |
||||
|
}) |
||||
|
} else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 分类新增/编辑方法 |
||||
|
saveNodeData () { |
||||
|
if (this.nodeData.nodeId === '' || this.nodeData.nodeId == null) { |
||||
|
this.$message.warning('请输入节点编码!') |
||||
|
return |
||||
|
} |
||||
|
if (this.nodeData.nodeName === '' || this.nodeData.nodeName == null) { |
||||
|
this.$message.warning('请输入节点名称!') |
||||
|
return |
||||
|
} |
||||
|
if(this.nodeData.flag === '1') { |
||||
|
nodeSave(this.nodeData).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.getNodeTree() |
||||
|
this.nodeModalFlag = false |
||||
|
this.$message({ |
||||
|
message: '操作成功', |
||||
|
type: 'success', |
||||
|
duration: 1500, |
||||
|
onClose: () => {} |
||||
|
}) |
||||
|
} else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} else { |
||||
|
nodeEdit(this.nodeData).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.getNodeTree() |
||||
|
this.nodeModalFlag = false |
||||
|
this.$message({ |
||||
|
message: '操作成功', |
||||
|
type: 'success', |
||||
|
duration: 1500, |
||||
|
onClose: () => {} |
||||
|
}) |
||||
|
} else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
// 批量build |
||||
|
batchBuild () { |
||||
|
let tempData = { |
||||
|
site: this.$store.state.user.site |
||||
|
} |
||||
|
this.$confirm('将所有节点的BOM和Routing状态改为Build!', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.buildAllLoading = true |
||||
|
batchBuildInfo(tempData).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.refreshCurrentTabTable() |
||||
|
this.$message({ |
||||
|
message: '操作成功', |
||||
|
type: 'success', |
||||
|
duration: 1500, |
||||
|
onClose: () => {} |
||||
|
}) |
||||
|
} else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
this.buildAllLoading = false |
||||
|
}) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 重置节点物料 |
||||
|
resetNodePart() { |
||||
|
let tempData = { |
||||
|
site: this.$store.state.user.site |
||||
|
} |
||||
|
this.$confirm('将重置所有节点的关联物料!', '提示', { |
||||
|
confirmButtonText: '确定', |
||||
|
cancelButtonText: '取消', |
||||
|
type: 'warning' |
||||
|
}).then(() => { |
||||
|
this.resetAllLoading = true |
||||
|
resetNodePartInfo(tempData).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.currentNode = {} |
||||
|
this.getNodeTree() |
||||
|
this.refreshCurrentTabTable() |
||||
|
this.$message({ |
||||
|
message: '操作成功', |
||||
|
type: 'success', |
||||
|
duration: 1500, |
||||
|
onClose: () => {} |
||||
|
}) |
||||
|
} else { |
||||
|
this.$alert(data.msg, '错误', { |
||||
|
confirmButtonText: '确定' |
||||
|
}) |
||||
|
} |
||||
|
this.resetAllLoading = false |
||||
|
}) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
/** |
||||
|
* 刷新页签的table数据 |
||||
|
*/ |
||||
|
refreshCurrentTabTable () { |
||||
|
if (this.activeTable === 'bom_info') { |
||||
|
if (this.currentNode.partNo != null && this.currentNode.partNo.length > 0) { |
||||
|
this.getBomInfo2(this.currentNode) |
||||
|
} else { |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.BomCreate.init2() |
||||
|
}) |
||||
|
} |
||||
|
} else if (this.activeTable === 'routing_info') { |
||||
|
if (this.currentNode.partNo != null && this.currentNode.partNo.length > 0) { |
||||
|
this.getRoutingInfo(this.currentNode) |
||||
|
} else { |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.RoutingCreate.init2() |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
queryPartList2(data) { |
||||
|
this.currentNode = data |
||||
|
this.queryPartList() |
||||
|
}, |
||||
|
|
||||
|
// 查询物料 |
||||
|
queryPartList () { |
||||
|
this.partData.limit = this.pageSize2 |
||||
|
this.partData.page = this.pageIndex2 |
||||
|
this.partData.site = this.nodeData.site |
||||
|
queryPartListBom(this.partData).then(({data}) => { |
||||
|
if (data && data.code === 0) { |
||||
|
this.partList = data.page.list |
||||
|
this.pageIndex2 = data.page.currPage |
||||
|
this.pageSize2 = data.page.pageSize |
||||
|
this.totalPage2 = data.page.totalCount |
||||
|
this.partModelFlag = true |
||||
|
} else { |
||||
|
this.partList = [] |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 双击选中物料 |
||||
|
getRowData (row) { |
||||
|
let tempData = { |
||||
|
site: row.site, |
||||
|
buNo: row.buNo, |
||||
|
partNo: row.partNo, |
||||
|
bomType: 'Manufacturing', |
||||
|
partDesc: row.partDesc, |
||||
|
printUnit: row.printUnit, |
||||
|
printUnitName: row.printUnitName, |
||||
|
shrinkageFactor: new Decimal(100).sub(new Decimal(row.yieldRate)).toNumber(), |
||||
|
nodeId: this.currentNode.nodeId, |
||||
|
offFlag: '1' |
||||
|
} |
||||
|
//打开组件 去做新增业务 |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.BomCreate.init(tempData) |
||||
|
}) |
||||
|
this.partModelFlag = false |
||||
|
}, |
||||
|
|
||||
|
// 新增物料 |
||||
|
addPartModal (data) { |
||||
|
this.currentNode = data |
||||
|
//打开组件 去做新增业务 |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.PartCreate.init() |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 根据物料获取BOM信息 |
||||
|
getBomInfo (row) { |
||||
|
let tempData = { |
||||
|
site: row.site, |
||||
|
buNo: row.buNo, |
||||
|
partNo: row.partNo, |
||||
|
bomType: 'Manufacturing', |
||||
|
nodeId: this.currentNode.nodeId, |
||||
|
offFlag: '1' |
||||
|
} |
||||
|
//打开组件 去做新增业务 |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.BomCreate.init(tempData) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 根据物料获取Routing信息 |
||||
|
getRoutingInfo (row) { |
||||
|
this.routingLoading = true |
||||
|
let tempData = { |
||||
|
site: row.site, |
||||
|
buNo: row.buNo, |
||||
|
partNo: row.partNo, |
||||
|
partDesc: row.partDesc, |
||||
|
printUnit: row.printUnit, |
||||
|
printUnitName: row.printUnitName, |
||||
|
routingType: 'Manufacturing', |
||||
|
} |
||||
|
//打开组件 去做新增业务 |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.RoutingCreate.init(tempData) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 树节点单机事件 |
||||
|
handleNodeClick (e, node) { |
||||
|
this.currentNode = e |
||||
|
if (e.partNo != null && e.partNo.length > 0) { |
||||
|
if (this.activeTable === 'routing_info') { |
||||
|
this.getRoutingInfo(e) |
||||
|
} else { |
||||
|
this.getBomInfo2(e) |
||||
|
} |
||||
|
} else { |
||||
|
if (this.activeTable === 'routing_info') { |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.RoutingCreate.init2() |
||||
|
}) |
||||
|
} else { |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.BomCreate.init2() |
||||
|
}) |
||||
|
} |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
// 根据物料获取BOM信息 |
||||
|
getBomInfo2 (row) { |
||||
|
this.bomLoading = true |
||||
|
let tempData = { |
||||
|
site: row.site, |
||||
|
buNo: row.buNo, |
||||
|
partNo: row.partNo, |
||||
|
bomType: 'Manufacturing', |
||||
|
nodeId: this.currentNode.nodeId, |
||||
|
offFlag: '2' |
||||
|
} |
||||
|
//打开组件 去做新增业务 |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs.BomCreate.init(tempData) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 刷新BOM的loading |
||||
|
refreshBomLoading () { |
||||
|
this.bomLoading = false |
||||
|
}, |
||||
|
|
||||
|
// 刷新Routing的loading |
||||
|
refreshRoutingLoading () { |
||||
|
this.routingLoading = false |
||||
|
}, |
||||
|
|
||||
|
// 刷新节点列表 |
||||
|
refreshNode (partNo) { |
||||
|
this.getNodeTree() |
||||
|
this.currentNode.partNo = partNo |
||||
|
}, |
||||
|
|
||||
|
// 获取基础数据列表S |
||||
|
getBaseList (val, type) { |
||||
|
this.tagNo = val |
||||
|
this.$nextTick(() => { |
||||
|
let strVal = '' |
||||
|
if (val === 215) { |
||||
|
strVal = this.componentData.issueToLoc |
||||
|
} |
||||
|
this.$refs.baseList.init(val, strVal) |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 列表方法的回调 |
||||
|
getBaseData (val) { |
||||
|
if (this.tagNo === 215) { |
||||
|
this.componentData.issueToLoc = val.location_id |
||||
|
this.componentData.issueToLocName = val.location_name |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
// 回车事件 |
||||
|
focusNextInput (index, type) { |
||||
|
let aaa = '' |
||||
|
if (this.subDetailList.length - 1 === index) { |
||||
|
aaa = `${type}0` |
||||
|
} else { |
||||
|
aaa = `${type}${index + 1}` |
||||
|
} |
||||
|
this.$nextTick(() => { |
||||
|
this.$refs[aaa].focus() |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 校验用户是否收藏 |
||||
|
favoriteIsOk () { |
||||
|
let userFavorite = { |
||||
|
userId: this.$store.state.user.id, |
||||
|
languageCode: this.$i18n.locale |
||||
|
} |
||||
|
userFavoriteList(userFavorite).then(({data}) => { |
||||
|
for (let i = 0; i < data.list.length; i++) { |
||||
|
if (this.$route.meta.menuId === data.list[i].menuId) { |
||||
|
this.favorite = true |
||||
|
} |
||||
|
} |
||||
|
}) |
||||
|
}, |
||||
|
|
||||
|
// 收藏 OR 取消收藏 |
||||
|
favoriteFunction() { |
||||
|
let userFavorite = { |
||||
|
userId: this.$store.state.user.id, |
||||
|
functionId: this.$route.meta.menuId, |
||||
|
} |
||||
|
if (this.favorite) { |
||||
|
removeUserFavorite(userFavorite).then(({data}) => { |
||||
|
this.$message.success(data.msg) |
||||
|
this.favorite = false |
||||
|
}) |
||||
|
} else { |
||||
|
// 收藏 |
||||
|
saveUserFavorite(userFavorite).then(({data}) => { |
||||
|
this.$message.success(data.msg) |
||||
|
this.favorite = true |
||||
|
}) |
||||
|
} |
||||
|
}, |
||||
|
|
||||
|
//获取按钮的权限数据 |
||||
|
getButtonAuthData () { |
||||
|
let searchFlag = this.isAuth(this.menuId+":search") |
||||
|
let saveFlag = this.isAuth(this.menuId+":save") |
||||
|
let updateFlag = this.isAuth(this.menuId+":update") |
||||
|
let deleteFlag = this.isAuth(this.menuId+":delete") |
||||
|
//处理页面的权限数据 |
||||
|
this.authSearch = !searchFlag |
||||
|
this.authSave = !saveFlag |
||||
|
this.authUpdate = !updateFlag |
||||
|
this.authDelete = !deleteFlag |
||||
|
}, |
||||
|
|
||||
|
} |
||||
|
} |
||||
|
</script> |
||||
|
|
||||
|
<style lang="scss" scoped> |
||||
|
.white-body-view { |
||||
|
width: 100%; |
||||
|
min-width: 320px; |
||||
|
} |
||||
|
.structure-tree { |
||||
|
.el-scrollbar .el-scrollbar__wrap { |
||||
|
overflow-x: hidden; |
||||
|
} |
||||
|
#my-tree .el-tree > .el-tree-node { |
||||
|
min-width: 100%; |
||||
|
display: inline-block; |
||||
|
} |
||||
|
.el-tree-node__content { |
||||
|
margin-bottom: 10px; |
||||
|
} |
||||
|
.tooltip { |
||||
|
margin-right: 5px; |
||||
|
font-size: 13px; |
||||
|
border-radius: 4px; |
||||
|
box-sizing: border-box; |
||||
|
white-space: nowrap; |
||||
|
padding: 4px; |
||||
|
} |
||||
|
.operation-view { |
||||
|
display: inline-block; |
||||
|
padding: 0px 5px; |
||||
|
margin-left: 5px; |
||||
|
color: #777777; |
||||
|
} |
||||
|
.small-operation-btn { |
||||
|
margin: 0px 3px; |
||||
|
} |
||||
|
} |
||||
|
.el-icon-plus:hover { |
||||
|
color: #1c92e0; |
||||
|
} |
||||
|
.el-icon-edit:hover { |
||||
|
color: #1c92e0; |
||||
|
} |
||||
|
.el-icon-delete:hover { |
||||
|
color: #1c92e0; |
||||
|
} |
||||
|
::v-deep .el-tree { |
||||
|
color: #333333; |
||||
|
} |
||||
|
.el-table /deep/ .cell{ |
||||
|
height: auto; |
||||
|
line-height: 1.5; |
||||
|
} |
||||
|
/deep/ .customer-tab .el-tabs__item { |
||||
|
height: 35px; |
||||
|
line-height: 38px; |
||||
|
font-size: 13px; |
||||
|
} |
||||
|
</style> |
||||
|
|
||||
|
|
||||
2528
src/views/modules/part/routing_create.vue
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
Write
Preview
Loading…
Cancel
Save
Reference in new issue