2024-1-12-1 基础信息-bom结构更改 第一版

master
A0010407 10 months ago
parent 431cc25140
commit 92c17c204c

@ -1,22 +1,37 @@
<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="88px"> <el-form
<el-form-item label="BOM单号" prop="bomCode"> :model="queryParams"
<el-input ref="queryForm"
v-model="queryParams.bomCode" size="small"
placeholder="请输入BOM单号" :inline="true"
clearable v-show="showSearch"
@keyup.enter.native="handleQuery" label-width="88px"
/> >
</el-form-item> <el-form-item label="BOM单号" prop="bomCode">
<el-form-item> <el-input
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery"></el-button> v-model="queryParams.bomCode"
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"></el-button> placeholder="请输入BOM单号"
</el-form-item> clearable
</el-form> @keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button
type="primary"
icon="el-icon-search"
size="mini"
@click="handleQuery"
>搜索</el-button
>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
>重置</el-button
>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button <el-button
type="primary" type="primary"
plain plain
@ -48,51 +63,175 @@
v-hasPermi="['wms:bom:remove']" v-hasPermi="['wms:bom:remove']"
>删除</el-button> >删除</el-button>
</el-col> --> </el-col> -->
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
type="warning" type="warning"
plain plain
icon="el-icon-download" icon="el-icon-download"
size="mini" size="mini"
@click="handleExport" @click="handleExport"
v-hasPermi="['wms:bom:export']" v-hasPermi="['wms:bom:export']"
>导出</el-button> >导出</el-button
</el-col> >
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> </el-col>
</el-row> <right-toolbar
:showSearch.sync="showSearch"
@queryTable="getList"
></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="bomList" @selection-change="handleSelectionChange"> <el-table
<el-table-column type="selection" width="55" align="center"/> v-loading="loading"
<!-- 序号 --> row-key="handle"
<el-table-column type="index" width="90" align="center" :index="indexMethod" label="序号" fixed/> :indent="indent"
<el-table-column label="BOM单号" align="center" prop="bomCode" width="120" fixed/> :data="bomList"
<el-table-column label="产品号" align="center" prop="productCode" width="120"/> @selection-change="handleSelectionChange"
<el-table-column label="产品名称" align="center" prop="productDescZh" width="350"/> default-expand-all
<el-table-column label="组件编码" align="center" prop="component" width="120"/> lazy
<el-table-column label="组件名称" align="center" prop="componentDescZh" width="350"/> :load="load"
<el-table-column label="组件上层编码" align="center" prop="cumc" width="120"/> :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
<el-table-column label="可选BOM" align="center" prop="optionalBom" width="120"/> >
<el-table-column label="可选BOM文本" align="center" prop="optionalBomText" width="120"/> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="生产版本" align="center" prop="productionVersion" width="120"/> <!-- 序号 -->
<el-table-column label="生产版本有效期" align="center" prop="pvvd" width="180"> <el-table-column
<template slot-scope="scope"> type="index"
<span>{{ parseTime(scope.row.pvvd, '{y}-{m}-{d}') }}</span> width="90"
</template> align="center"
</el-table-column> :index="indexMethod"
<el-table-column label="生产版本截止日期" align="center" prop="pved" width="180"> label="序号"
<template slot-scope="scope"> fixed
<span>{{ parseTime(scope.row.pved, '{y}-{m}-{d}') }}</span> />
</template> <el-table-column
</el-table-column> label="BOM单号"
<el-table-column label="BOM计算数量" align="center" prop="bomCalculateNumber" width="120"/> align="center"
<el-table-column label="BOM计算单位" align="center" prop="bomCalculateUnit" width="120"/> prop="bomCode"
<el-table-column label="BOM基本数量" align="center" prop="bomBaseNumber" width="120"/> width="200"
<el-table-column label="BOM基本单位" align="center" prop="bomBaseUnit" width="120"/> fixed
<el-table-column label="组件数量单位" align="center" prop="componentUnit" width="120"/> />
<el-table-column label="组件采购标志" align="center" prop="componentProFlag" width="120"/> <el-table-column
<el-table-column label="物料供应标识" align="center" prop="msi" width="120"/> label="BOM层次"
<el-table-column label="成本核算标识相关" align="center" prop="sanka" width="150"/> align="center"
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width"> prop="bomHierarchy"
width="100"
fixed
/>
<el-table-column
label="产品号"
align="center"
prop="productCode"
width="120"
/>
<el-table-column
label="产品名称"
align="center"
prop="productDescZh"
width="350"
/>
<el-table-column
label="组件编码"
align="center"
prop="component"
width="120"
/>
<el-table-column
label="组件名称"
align="center"
prop="componentDescZh"
width="350"
/>
<el-table-column
label="组件上层编码"
align="center"
prop="cumc"
width="120"
/>
<el-table-column
label="可选BOM"
align="center"
prop="optionalBom"
width="120"
/>
<el-table-column
label="可选BOM文本"
align="center"
prop="optionalBomText"
width="120"
/>
<el-table-column
label="生产版本"
align="center"
prop="productionVersion"
width="120"
/>
<el-table-column
label="生产版本有效期"
align="center"
prop="pvvd"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.pvvd, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column
label="生产版本截止日期"
align="center"
prop="pved"
width="180"
>
<template slot-scope="scope">
<span>{{ parseTime(scope.row.pved, "{y}-{m}-{d}") }}</span>
</template>
</el-table-column>
<el-table-column
label="BOM计算数量"
align="center"
prop="bomCalculateNumber"
width="120"
/>
<el-table-column
label="BOM计算单位"
align="center"
prop="bomCalculateUnit"
width="120"
/>
<el-table-column
label="BOM基本数量"
align="center"
prop="bomBaseNumber"
width="120"
/>
<el-table-column
label="BOM基本单位"
align="center"
prop="bomBaseUnit"
width="120"
/>
<el-table-column
label="组件数量单位"
align="center"
prop="componentUnit"
width="120"
/>
<el-table-column
label="组件采购标志"
align="center"
prop="componentProFlag"
width="120"
/>
<el-table-column
label="物料供应标识"
align="center"
prop="msi"
width="120"
/>
<el-table-column
label="成本核算标识相关"
align="center"
prop="sanka"
width="150"
/>
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
size="mini" size="mini"
@ -110,277 +249,348 @@
>删除</el-button> >删除</el-button>
</template> </template>
</el-table-column> --> </el-table-column> -->
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total > 0"
:total="total" :total="total"
:page.sync="queryParams.pageNum" :page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />
<!-- 添加或修改BOM管理 对话框 --> <!-- 添加或修改BOM管理 对话框 -->
<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="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="工厂" prop="factoryCode"> <el-form-item label="工厂" prop="factoryCode">
<el-input v-model="form.factoryCode" placeholder="请输入工厂" /> <el-input v-model="form.factoryCode" placeholder="请输入工厂" />
</el-form-item> </el-form-item>
<el-form-item label="生产版本" prop="productionVersion"> <el-form-item label="生产版本" prop="productionVersion">
<el-input v-model="form.productionVersion" placeholder="请输入生产版本" /> <el-input
</el-form-item> v-model="form.productionVersion"
<el-form-item label="BOM单号" prop="bomCode"> placeholder="请输入生产版本"
<el-input v-model="form.bomCode" placeholder="请输入BOM单号" /> />
</el-form-item> </el-form-item>
<el-form-item label="可选BOM" prop="optionalBom"> <el-form-item label="BOM单号" prop="bomCode">
<el-input v-model="form.optionalBom" placeholder="请输入可选BOM" /> <el-input v-model="form.bomCode" placeholder="请输入BOM单号" />
</el-form-item> </el-form-item>
<el-form-item label="可选BOM文本" prop="optionalBomText"> <el-form-item label="可选BOM" prop="optionalBom">
<el-input v-model="form.optionalBomText" placeholder="请输入可选BOM文本" /> <el-input v-model="form.optionalBom" placeholder="请输入可选BOM" />
</el-form-item> </el-form-item>
<el-form-item label="生产版本有效期" prop="pvvd"> <el-form-item label="可选BOM文本" prop="optionalBomText">
<el-date-picker clearable <el-input
v-model="form.pvvd" v-model="form.optionalBomText"
type="date" placeholder="请输入可选BOM文本"
value-format="yyyy-MM-dd" />
placeholder="请选择生产版本有效期"> </el-form-item>
</el-date-picker> <el-form-item label="生产版本有效期" prop="pvvd">
</el-form-item> <el-date-picker
<el-form-item label="生产版本截止日期" prop="pved"> clearable
<el-date-picker clearable v-model="form.pvvd"
v-model="form.pved" type="date"
type="date" value-format="yyyy-MM-dd"
value-format="yyyy-MM-dd" placeholder="请选择生产版本有效期"
placeholder="请选择生产版本截止日期"> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label="BOM计算数量" prop="bomCalculateNumber"> <el-form-item label="生产版本截止日期" prop="pved">
<el-input v-model="form.bomCalculateNumber" placeholder="请输入BOM计算数量" /> <el-date-picker
</el-form-item> clearable
<el-form-item label="BOM计算单位" prop="bomCalculateUnit"> v-model="form.pved"
<el-input v-model="form.bomCalculateUnit" placeholder="请输入BOM计算单位" /> type="date"
</el-form-item> value-format="yyyy-MM-dd"
<el-form-item label="BOM基本数量" prop="bomBaseNumber"> placeholder="请选择生产版本截止日期"
<el-input v-model="form.bomBaseNumber" placeholder="请输入BOM基本数量" /> >
</el-form-item> </el-date-picker>
<el-form-item label="BOM基本单位" prop="bomBaseUnit"> </el-form-item>
<el-input v-model="form.bomBaseUnit" placeholder="请输入BOM基本单位" /> <el-form-item label="BOM计算数量" prop="bomCalculateNumber">
</el-form-item> <el-input
<el-form-item label="组件数量单位" prop="componentUnit"> v-model="form.bomCalculateNumber"
<el-input v-model="form.componentUnit" placeholder="请输入组件数量单位" /> placeholder="请输入BOM计算数量"
</el-form-item> />
<el-form-item label="组件采购标志" prop="componentProFlag"> </el-form-item>
<el-input v-model="form.componentProFlag" placeholder="请输入组件采购标志" /> <el-form-item label="BOM计算单位" prop="bomCalculateUnit">
</el-form-item> <el-input
<el-form-item label="物料供应标识" prop="msi"> v-model="form.bomCalculateUnit"
<el-input v-model="form.msi" placeholder="请输入物料供应标识" /> placeholder="请输入BOM计算单位"
</el-form-item> />
<el-form-item label="成本核算标识相关" prop="sanka"> </el-form-item>
<el-input v-model="form.sanka" placeholder="请输入成本核算标识相关" /> <el-form-item label="BOM基本数量" prop="bomBaseNumber">
</el-form-item> <el-input
<el-form-item label="预留字段1" prop="attr1"> v-model="form.bomBaseNumber"
<el-input v-model="form.attr1" placeholder="请输入预留字段1" /> placeholder="请输入BOM基本数量"
</el-form-item> />
<el-form-item label="预留字段2" prop="attr2"> </el-form-item>
<el-input v-model="form.attr2" placeholder="请输入预留字段2" /> <el-form-item label="BOM基本单位" prop="bomBaseUnit">
</el-form-item> <el-input
<el-form-item label="预留字段3" prop="attr3"> v-model="form.bomBaseUnit"
<el-input v-model="form.attr3" placeholder="请输入预留字段3" /> placeholder="请输入BOM基本单位"
</el-form-item> />
<el-form-item label="是否在用" prop="currentVersion"> </el-form-item>
<el-input v-model="form.currentVersion" placeholder="请输入是否在用" /> <el-form-item label="组件数量单位" prop="componentUnit">
</el-form-item> <el-input
<el-form-item label="备注" prop="remark"> v-model="form.componentUnit"
<el-input v-model="form.remark" placeholder="请输入备注" /> placeholder="请输入组件数量单位"
</el-form-item> />
</el-form> </el-form-item>
<div slot="footer" class="dialog-footer"> <el-form-item label="组件采购标志" prop="componentProFlag">
<el-button type="primary" @click="submitForm"> </el-button> <el-input
<el-button @click="cancel"> </el-button> v-model="form.componentProFlag"
</div> placeholder="请输入组件采购标志"
</el-dialog> />
</div> </el-form-item>
<el-form-item label="物料供应标识" prop="msi">
<el-input v-model="form.msi" placeholder="请输入物料供应标识" />
</el-form-item>
<el-form-item label="成本核算标识相关" prop="sanka">
<el-input v-model="form.sanka" placeholder="请输入成本核算标识相关" />
</el-form-item>
<el-form-item label="预留字段1" prop="attr1">
<el-input v-model="form.attr1" placeholder="请输入预留字段1" />
</el-form-item>
<el-form-item label="预留字段2" prop="attr2">
<el-input v-model="form.attr2" placeholder="请输入预留字段2" />
</el-form-item>
<el-form-item label="预留字段3" prop="attr3">
<el-input v-model="form.attr3" placeholder="请输入预留字段3" />
</el-form-item>
<el-form-item label="是否在用" prop="currentVersion">
<el-input
v-model="form.currentVersion"
placeholder="请输入是否在用"
/>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template> </template>
<script> <script>
import { listBom, getBom, delBom, addBom, updateBom } from "@/api/wms/bom"; import { listBom, getBom, delBom, addBom, updateBom } from "@/api/wms/bom";
export default { export default {
name: "Bom", name: "Bom",
data() { data() {
return { return {
// //
loading: true, loading: true,
// //
ids: [], ids: [],
// //
single: true, single: true,
// //
multiple: true, multiple: true,
// //
showSearch: true, showSearch: true,
// //
total: 0, total: 0,
// BOM // BOM
bomList: [], bomList: [],
// //
title: "", title: "",
// //
open: false, open: false,
// //
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
factoryCode: null, component: null,
productionVersion: null, productCode: null,
bomCode: null, bomHierarchy: null,
optionalBom: null, handle:null,
optionalBomText: null, factoryCode: null,
pvvd: null, productionVersion: null,
pved: null, bomCode: null,
bomCalculateNumber: null, optionalBom: null,
bomCalculateUnit: null, optionalBomText: null,
bomBaseNumber: null, pvvd: null,
bomBaseUnit: null, pved: null,
componentUnit: null, bomCalculateNumber: null,
componentProFlag: null, bomCalculateUnit: null,
msi: null, bomBaseNumber: null,
sanka: null, bomBaseUnit: null,
attr1: null, componentUnit: null,
attr2: null, componentProFlag: null,
attr3: null, msi: null,
currentVersion: null, sanka: null,
}, attr1: null,
// attr2: null,
form: {}, attr3: null,
// currentVersion: null,
rules: { },
bomCode: [ //
{ required: true, message: "BOM单号不能为空", trigger: "blur" } form: {},
], //
} rules: {
}; bomCode: [
}, { required: true, message: "BOM单号不能为空", trigger: "blur" },
created() { ],
this.getList(); },
}, };
methods: { },
created() {
this.getList();
},
methods: {
// //
indexMethod(index){ indexMethod(index) {
return index+1 ; return index + 1;
},
/** 查询BOM管理 列表 */
getList() {
this.loading = true;
this.queryParams.bomHierarchy = "0";
listBom(this.queryParams).then((response) => {
this.bomList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
factoryCode: null,
productionVersion: null,
bomCode: null,
optionalBom: null,
optionalBomText: null,
pvvd: null,
pved: null,
bomCalculateNumber: null,
bomCalculateUnit: null,
bomBaseNumber: null,
bomBaseUnit: null,
componentUnit: null,
componentProFlag: null,
msi: null,
sanka: null,
attr1: null,
attr2: null,
attr3: null,
createBy: null,
createTime: null,
updateBy: null,
updateTime: null,
currentVersion: null,
remark: null,
};
this.resetForm("form");
}, },
/** 查询BOM管理 列表 */ /** 搜索按钮操作 */
getList() { handleQuery() {
this.loading = true; this.queryParams.pageNum = 1;
listBom(this.queryParams).then(response => { this.getList();
this.bomList = response.rows; },
this.total = response.total; /** 重置按钮操作 */
this.loading = false; resetQuery() {
}); this.resetForm("queryForm");
}, this.handleQuery();
// },
cancel() { //
this.open = false; handleSelectionChange(selection) {
this.reset(); this.ids = selection.map((item) => item.factoryCode);
}, this.single = selection.length !== 1;
// this.multiple = !selection.length;
reset() { },
this.form = { /** 新增按钮操作 */
factoryCode: null, handleAdd() {
productionVersion: null, this.reset();
bomCode: null, this.open = true;
optionalBom: null, this.title = "添加BOM管理 ";
optionalBomText: null, },
pvvd: null, /** 修改按钮操作 */
pved: null, handleUpdate(row) {
bomCalculateNumber: null, this.reset();
bomCalculateUnit: null, const factoryCode = row.factoryCode || this.ids;
bomBaseNumber: null, getBom(factoryCode).then((response) => {
bomBaseUnit: null, this.form = response.data;
componentUnit: null, this.open = true;
componentProFlag: null, this.title = "修改BOM管理 ";
msi: null, });
sanka: null, },
attr1: null, /** 提交按钮 */
attr2: null, submitForm() {
attr3: null, this.$refs["form"].validate((valid) => {
createBy: null, if (valid) {
createTime: null, if (this.form.factoryCode != null) {
updateBy: null, updateBom(this.form).then((response) => {
updateTime: null, this.$modal.msgSuccess("修改成功");
currentVersion: null, this.open = false;
remark: null this.getList();
}; });
this.resetForm("form"); } else {
}, addBom(this.form).then((response) => {
/** 搜索按钮操作 */ this.$modal.msgSuccess("新增成功");
handleQuery() { this.open = false;
this.queryParams.pageNum = 1; this.getList();
this.getList(); });
}, }
/** 重置按钮操作 */ }
resetQuery() { });
this.resetForm("queryForm"); },
this.handleQuery(); /** 删除按钮操作 */
}, handleDelete(row) {
// const factoryCodes = row.factoryCode || this.ids;
handleSelectionChange(selection) { this.$modal
this.ids = selection.map(item => item.factoryCode) .confirm('是否确认删除BOM管理 编号为"' + factoryCodes + '"的数据项?')
this.single = selection.length!==1 .then(function () {
this.multiple = !selection.length return delBom(factoryCodes);
}, })
/** 新增按钮操作 */ .then(() => {
handleAdd() { this.getList();
this.reset(); this.$modal.msgSuccess("删除成功");
this.open = true; })
this.title = "添加BOM管理 "; .catch(() => {});
}, },
/** 修改按钮操作 */ /** 导出按钮操作 */
handleUpdate(row) { handleExport() {
this.reset(); this.download(
const factoryCode = row.factoryCode || this.ids "wms/bom/export",
getBom(factoryCode).then(response => { {
this.form = response.data; ...this.queryParams,
this.open = true; },
this.title = "修改BOM管理 "; `bom_${new Date().getTime()}.xlsx`
}); );
}, },
/** 提交按钮 */
submitForm() { load(tree, treeNode, resolve) {
this.$refs["form"].validate(valid => { this.queryParams.pageNum = null;
if (valid) { this.queryParams.pageSize = null;
if (this.form.factoryCode != null) { if(tree.bomHierarchy == " " || tree.bomHierarchy == null){
updateBom(this.form).then(response => { this.queryParams.bomHierarchy = "1";
this.$modal.msgSuccess("修改成功"); this.queryParams.cumc = tree.cumc;
this.open = false; this.queryParams.component = tree.component;
this.getList(); this.queryParams.bomCode = tree.bomCode;
}); }else if(tree.bomHierarchy == "1"){
} else { this.queryParams.bomHierarchy = "2";
addBom(this.form).then(response => { this.queryParams.component = tree.component;
this.$modal.msgSuccess("新增成功"); this.queryParams.bomCode = tree.bomCode;
this.open = false; }else if(tree.bomHierarchy == "2"){
this.getList(); this.queryParams.bomHierarchy = "3";
}); this.queryParams.component = tree.component;
} this.queryParams.bomCode = tree.bomCode;
} }else if(tree.bomHierarchy == "3"){
}); this.queryParams.bomHierarchy = "4";
}, this.queryParams.component = tree.component;
/** 删除按钮操作 */ this.queryParams.bomCode = tree.bomCode;
handleDelete(row) { }
const factoryCodes = row.factoryCode || this.ids; listBom(this.queryParams).then(response => {
this.$modal.confirm('是否确认删除BOM管理 编号为"' + factoryCodes + '"的数据项?').then(function() { resolve(response.rows)
return delBom(factoryCodes); })
}).then(() => { },
this.getList();
this.$modal.msgSuccess("删除成功"); },
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('wms/bom/export', {
...this.queryParams
}, `bom_${new Date().getTime()}.xlsx`)
}
}
}; };
</script> </script>

Loading…
Cancel
Save