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