|
|
|
@ -1,10 +1,10 @@
|
|
|
|
|
<template>
|
|
|
|
|
<div class="app-container">
|
|
|
|
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
|
|
<el-form-item label="物料ID" prop="materialId">
|
|
|
|
|
<el-form-item label="物料编码" prop="materialCode">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.materialId"
|
|
|
|
|
placeholder="请输入物料ID"
|
|
|
|
|
v-model="queryParams.materialCode"
|
|
|
|
|
placeholder="请输入物料编码"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
@ -17,6 +17,14 @@
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="物料规格" prop="materialSpec">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.materialSpec"
|
|
|
|
|
placeholder="请输入物料规格"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="顶级标识" prop="topFlag">
|
|
|
|
|
<el-select v-model="queryParams.topFlag" placeholder="请选择顶级标识" clearable>
|
|
|
|
|
<el-option
|
|
|
|
@ -37,14 +45,7 @@
|
|
|
|
|
/>
|
|
|
|
|
</el-select>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="项目ID" prop="projectId">
|
|
|
|
|
<el-input
|
|
|
|
|
v-model="queryParams.projectId"
|
|
|
|
|
placeholder="请输入项目ID"
|
|
|
|
|
clearable
|
|
|
|
|
@keyup.enter.native="handleQuery"
|
|
|
|
|
/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
|
|
|
|
|
<!-- <el-form-item label="激活标识" prop="activeFlag">-->
|
|
|
|
|
<!-- <el-select v-model="queryParams.activeFlag" placeholder="请选择激活标识" clearable>-->
|
|
|
|
|
<!-- <el-option-->
|
|
|
|
@ -75,7 +76,7 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="info"
|
|
|
|
|
type="primary"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-sort"
|
|
|
|
|
size="mini"
|
|
|
|
@ -85,7 +86,7 @@
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="1.5">
|
|
|
|
|
<el-button
|
|
|
|
|
type="info"
|
|
|
|
|
type="primary"
|
|
|
|
|
plain
|
|
|
|
|
icon="el-icon-upload2"
|
|
|
|
|
size="mini"
|
|
|
|
@ -93,7 +94,7 @@
|
|
|
|
|
>BOM导入
|
|
|
|
|
</el-button>
|
|
|
|
|
</el-col>
|
|
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
|
|
|
|
<!--right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar-->
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
<el-table
|
|
|
|
@ -107,7 +108,9 @@
|
|
|
|
|
<el-table-column label="父级标识" prop="parentId" v-if="columns[1].visible"/>
|
|
|
|
|
<el-table-column label="祖级列表" align="center" prop="ancestors" v-if="columns[2].visible"/>
|
|
|
|
|
<el-table-column label="物料ID" align="center" prop="materialId" v-if="columns[3].visible"/>
|
|
|
|
|
<el-table-column label="物料编码" align="center" prop="materialCode"/>
|
|
|
|
|
<el-table-column label="物料名称" align="left" prop="materialName" v-if="columns[4].visible"/>
|
|
|
|
|
<el-table-column label="物料规格" align="center" prop="materialSpec"/>
|
|
|
|
|
<el-table-column label="BOM说明" align="center" prop="materialBomDesc" v-if="columns[15].visible"/>
|
|
|
|
|
<el-table-column label="标准数量" align="center" prop="standardAmount" v-if="columns[5].visible"/>
|
|
|
|
|
<el-table-column label="安装时长" align="center" prop="assembleTime" v-if="columns[16].visible">
|
|
|
|
@ -166,7 +169,8 @@
|
|
|
|
|
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
|
|
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
|
|
|
|
|
<el-form-item label="父级BOM" prop="parentId" v-if="topBomVisible">
|
|
|
|
|
<treeselect v-model="form.parentId" :options="materialBomOptions" :normalizer="normalizer" v-if="topBomVisible" disabled/>
|
|
|
|
|
<treeselect v-model="form.parentId" :options="materialBomOptions" :normalizer="normalizer"
|
|
|
|
|
v-if="topBomVisible" disabled/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<!-- <el-form-item label="物料ID" prop="materialId">-->
|
|
|
|
|
<!-- <el-input v-model="form.materialId" placeholder="请输入物料ID" />-->
|
|
|
|
@ -191,7 +195,8 @@
|
|
|
|
|
分钟
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="标准数量" prop="standardAmount">
|
|
|
|
|
<el-input-number v-model="form.standardAmount" :min="1" placeholder="请输入标准数量" :disabled="amountDisabled"/>
|
|
|
|
|
<el-input-number v-model="form.standardAmount" :min="1" placeholder="请输入标准数量"
|
|
|
|
|
:disabled="amountDisabled"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<!-- <el-form-item label="顶级标识" prop="topFlag">-->
|
|
|
|
|
<!-- <el-radio-group v-model="form.topFlag">-->
|
|
|
|
@ -202,7 +207,7 @@
|
|
|
|
|
<!-- >{{dict.label}}</el-radio>-->
|
|
|
|
|
<!-- </el-radio-group>-->
|
|
|
|
|
<!-- </el-form-item>-->
|
|
|
|
|
<el-form-item label="校验类型" prop="checkType" v-if="form.topFlag === 0">
|
|
|
|
|
<el-form-item label="校验类型" prop="checkType" v-if="form.topFlag !== TOP_FLAG.YES">
|
|
|
|
|
<el-radio-group v-model="form.checkType">
|
|
|
|
|
<el-radio
|
|
|
|
|
v-for="dict in dict.type.check_type"
|
|
|
|
@ -234,7 +239,7 @@
|
|
|
|
|
|
|
|
|
|
<!-- 添加物料信息对话框 -->
|
|
|
|
|
<el-dialog title="选择物料信息" :visible.sync="materialOpen" append-to-body>
|
|
|
|
|
<add-bom @selection="handleSelection" ref="materialRef"></add-bom>
|
|
|
|
|
<select-material @selection="handleSelection" ref="materialRef" v-if="materialOpen"></select-material>
|
|
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
|
|
<el-button type="primary" @click="submitMaterialForm">确 定</el-button>
|
|
|
|
|
<el-button @click="materialOpen = false">取 消</el-button>
|
|
|
|
@ -283,7 +288,7 @@ import {
|
|
|
|
|
} from "@/api/mes/materialBom";
|
|
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
|
|
import addBom from '@//views/mes/materialBom/addBom.vue';
|
|
|
|
|
import selectMaterial from '@//views/mes/materialinfo/selectMaterial.vue';
|
|
|
|
|
import {verifyBOMIsProduction} from "@//api/mes/productOrder";
|
|
|
|
|
import {getToken} from "@/utils/auth";
|
|
|
|
|
|
|
|
|
@ -292,7 +297,7 @@ export default {
|
|
|
|
|
dicts: ['active_flag', 'check_type'],
|
|
|
|
|
components: {
|
|
|
|
|
Treeselect,
|
|
|
|
|
'add-bom': addBom
|
|
|
|
|
'select-material': selectMaterial
|
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
@ -342,6 +347,9 @@ export default {
|
|
|
|
|
materialId: [
|
|
|
|
|
{required: true, message: "物料ID不能为空", trigger: "blur"}
|
|
|
|
|
],
|
|
|
|
|
materialName: [
|
|
|
|
|
{required: true, message: "请选择BOM信息", trigger: "blur"}
|
|
|
|
|
],
|
|
|
|
|
materialBomDesc: [
|
|
|
|
|
{required: true, message: "BOM说明不能为空", trigger: "blur"}
|
|
|
|
|
],
|
|
|
|
@ -362,7 +370,7 @@ export default {
|
|
|
|
|
// 是否更新已经存在的用户数据
|
|
|
|
|
updateSupport: 0,
|
|
|
|
|
// 设置上传的请求头部
|
|
|
|
|
headers: { Authorization: "Bearer " + getToken() },
|
|
|
|
|
headers: {Authorization: "Bearer " + getToken()},
|
|
|
|
|
// 上传的地址
|
|
|
|
|
url: process.env.VUE_APP_BASE_API + "/mes/import/BOMImportData"
|
|
|
|
|
},
|
|
|
|
@ -385,10 +393,16 @@ export default {
|
|
|
|
|
{key: 15, label: `BOM说明`, visible: true},
|
|
|
|
|
{key: 16, label: `安装时长`, visible: true},
|
|
|
|
|
],
|
|
|
|
|
|
|
|
|
|
//顶级标识
|
|
|
|
|
TOP_FLAG: {
|
|
|
|
|
YES: 1,
|
|
|
|
|
NO: 0
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
'form.parentId': function(newValue, oldValue) {
|
|
|
|
|
'form.parentId': function (newValue, oldValue) {
|
|
|
|
|
if (newValue === 0) {
|
|
|
|
|
this.topBomVisible = false;
|
|
|
|
|
this.amountDisabled = true;
|
|
|
|
@ -487,6 +501,7 @@ export default {
|
|
|
|
|
this.reset();
|
|
|
|
|
// this.getTreeselect();
|
|
|
|
|
if (row != null && row.materialBomId) {
|
|
|
|
|
this.form.topFlag = this.TOP_FLAG.NO;
|
|
|
|
|
this.form.parentId = row.materialBomId;
|
|
|
|
|
verifyBOMIsProduction(row.materialBomId).then(res => {
|
|
|
|
|
if (res.data) {
|
|
|
|
@ -495,9 +510,8 @@ export default {
|
|
|
|
|
getMaterialBom(row.materialBomId).then(e => {
|
|
|
|
|
//BOM说明,顶级不能为空,在选择bom时可以用此字段区分
|
|
|
|
|
this.rules.materialBomDesc[0].required = this.form.parentId === 0;
|
|
|
|
|
if (row.parentId === 0){
|
|
|
|
|
this.assembleTimeVisible = false;
|
|
|
|
|
}
|
|
|
|
|
this.assembleTimeVisible = true;
|
|
|
|
|
|
|
|
|
|
this.form.checkType = e.data.checkType;
|
|
|
|
|
this.getBomTreeselect(e.data);
|
|
|
|
|
this.open = true;
|
|
|
|
@ -508,6 +522,7 @@ export default {
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.form.parentId = 0;
|
|
|
|
|
this.form.topFlag = this.TOP_FLAG.YES;
|
|
|
|
|
this.assembleTimeVisible = false;
|
|
|
|
|
this.open = true;
|
|
|
|
|
this.title = "添加物料BOM信息";
|
|
|
|
@ -539,7 +554,7 @@ export default {
|
|
|
|
|
getMaterialBom(row.materialBomId).then(response => {
|
|
|
|
|
this.form = response.data;
|
|
|
|
|
this.convertToTime();
|
|
|
|
|
if (this.form.parentId === 0){
|
|
|
|
|
if (this.form.parentId === 0) {
|
|
|
|
|
this.assembleTimeVisible = false;
|
|
|
|
|
}
|
|
|
|
|
//BOM说明,顶级不能为空,在选择bom时可以用此字段区分
|
|
|
|
@ -604,8 +619,8 @@ export default {
|
|
|
|
|
/** 提交物料信息按钮 */
|
|
|
|
|
submitMaterialForm() {
|
|
|
|
|
let selectedRow = this.$refs.materialRef.selectedRow;
|
|
|
|
|
this.form.materialId = selectedRow.materialId;
|
|
|
|
|
this.form.materialName = selectedRow.materialName;
|
|
|
|
|
this.$set(this.form, "materialId", selectedRow.materialId);
|
|
|
|
|
this.$set(this.form, "materialName", selectedRow.materialName);
|
|
|
|
|
this.materialOpen = false;
|
|
|
|
|
},
|
|
|
|
|
/** 导入按钮操作 */
|
|
|
|
@ -622,7 +637,7 @@ export default {
|
|
|
|
|
this.upload.open = false;
|
|
|
|
|
this.upload.isUploading = false;
|
|
|
|
|
this.$refs.upload.clearFiles();
|
|
|
|
|
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", { dangerouslyUseHTMLString: true });
|
|
|
|
|
this.$alert("<div style='overflow: auto;overflow-x: hidden;max-height: 70vh;padding: 10px 20px 0;'>" + response.msg + "</div>", "导入结果", {dangerouslyUseHTMLString: true});
|
|
|
|
|
this.getList();
|
|
|
|
|
},
|
|
|
|
|
// 提交上传文件
|
|
|
|
|