|
@@ -27,7 +27,7 @@
|
|
|
:options="bomTreeList"
|
|
:options="bomTreeList"
|
|
|
@getValue="getTreeValue"
|
|
@getValue="getTreeValue"
|
|
|
:props="{
|
|
:props="{
|
|
|
- value: 'bomId',
|
|
|
|
|
|
|
+ value: 'id',
|
|
|
label: 'name',
|
|
label: 'name',
|
|
|
children: 'children'
|
|
children: 'children'
|
|
|
}"
|
|
}"
|
|
@@ -58,11 +58,14 @@
|
|
|
|
|
|
|
|
<el-col :span="12" label-width="100px">
|
|
<el-col :span="12" label-width="100px">
|
|
|
<el-form-item label="编码" prop="code">
|
|
<el-form-item label="编码" prop="code">
|
|
|
- <el-input placeholder="" v-model="attributeData.code"></el-input>
|
|
|
|
|
|
|
+ <el-input
|
|
|
|
|
+ placeholder=""
|
|
|
|
|
+ @click.native="handleProduct()"
|
|
|
|
|
+ v-model="attributeData.code"
|
|
|
|
|
+ ></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
|
|
-
|
|
|
|
|
<el-col :span="12" label-width="100px">
|
|
<el-col :span="12" label-width="100px">
|
|
|
<el-form-item label="名称" prop="name">
|
|
<el-form-item label="名称" prop="name">
|
|
|
<el-input placeholder="" v-model="attributeData.name"></el-input>
|
|
<el-input placeholder="" v-model="attributeData.name"></el-input>
|
|
@@ -96,10 +99,6 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
<el-col :span="12" label-width="100px">
|
|
<el-col :span="12" label-width="100px">
|
|
|
<el-form-item label="用量" prop="dosage">
|
|
<el-form-item label="用量" prop="dosage">
|
|
|
<el-input placeholder="" v-model="attributeData.dosage"></el-input>
|
|
<el-input placeholder="" v-model="attributeData.dosage"></el-input>
|
|
@@ -162,88 +161,6 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
|
-
|
|
|
|
|
- <el-row style="margin-top: 18px">
|
|
|
|
|
- <el-divider>产品信息</el-divider>
|
|
|
|
|
-
|
|
|
|
|
- <el-col style="margin-top: 18px" :span="12" label-width="100px">
|
|
|
|
|
- <el-form-item label="产品:" prop="category.name">
|
|
|
|
|
- <el-input
|
|
|
|
|
- placeholder="请选择产品"
|
|
|
|
|
- @click.native="handleProduct()"
|
|
|
|
|
- v-model="category.name"
|
|
|
|
|
- ></el-input>
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
-
|
|
|
|
|
- <div v-if="category.name">
|
|
|
|
|
- <el-col style="margin-top: 18px" :span="12" label-width="100px">
|
|
|
|
|
- <el-form-item label="编码:" prop="code">
|
|
|
|
|
- {{ category.code }}
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
-
|
|
|
|
|
- <el-col :span="12" label-width="100px">
|
|
|
|
|
- <el-form-item label="牌号:" prop="brandNum">
|
|
|
|
|
- {{ category.brandNum }}
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
-
|
|
|
|
|
- <el-col :span="12" label-width="100px">
|
|
|
|
|
- <el-form-item label="型号:" prop="modelType">
|
|
|
|
|
- {{ category.modelType }}
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
-
|
|
|
|
|
- <el-col :span="12" label-width="100px">
|
|
|
|
|
- <el-form-item label="规格:" prop="specification">
|
|
|
|
|
- {{ category.specification }}
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
-
|
|
|
|
|
- <el-col :span="12" label-width="100px">
|
|
|
|
|
- <el-form-item label="计量单位:" prop="measuringUnit">
|
|
|
|
|
- {{ category.measuringUnit }}
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
-
|
|
|
|
|
- <el-col :span="12" label-width="100px">
|
|
|
|
|
- <el-form-item label="重量单位:" prop="weightUnit">
|
|
|
|
|
- {{ category.weightUnit }}
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
-
|
|
|
|
|
- <el-col :span="12" label-width="100px">
|
|
|
|
|
- <el-form-item label="包装单位:" prop="packingUnit">
|
|
|
|
|
- {{ category.packingUnit }}
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
-
|
|
|
|
|
- <el-col :span="12" label-width="100px">
|
|
|
|
|
- <el-form-item label="毛重:" prop="roughWeight">
|
|
|
|
|
- {{ category.roughWeight }}
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
-
|
|
|
|
|
- <el-col :span="12" label-width="100px">
|
|
|
|
|
- <el-form-item label="净重:" prop="netWeight">
|
|
|
|
|
- {{ category.netWeight }}
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
-
|
|
|
|
|
- <el-col :span="12" label-width="100px">
|
|
|
|
|
- <el-form-item
|
|
|
|
|
- label="加工类型:"
|
|
|
|
|
- prop="isConsumable"
|
|
|
|
|
- v-if="
|
|
|
|
|
- [1, 23, 9, 28].includes(Number(category.categoryLevelPathId))
|
|
|
|
|
- "
|
|
|
|
|
- >
|
|
|
|
|
- {{ category.isConsumable == 1 ? '批量' : '单件' }}
|
|
|
|
|
- </el-form-item>
|
|
|
|
|
- </el-col>
|
|
|
|
|
- </div>
|
|
|
|
|
- </el-row>
|
|
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<div class="btns">
|
|
<div class="btns">
|
|
|
<el-button type="primary" size="small" @click="save">保存</el-button>
|
|
<el-button type="primary" size="small" @click="save">保存</el-button>
|
|
@@ -260,7 +177,7 @@
|
|
|
<script>
|
|
<script>
|
|
|
import { getBomTreeList, saveBomTreeList } from '@/api/material/BOM.js';
|
|
import { getBomTreeList, saveBomTreeList } from '@/api/material/BOM.js';
|
|
|
import selectTree from '@/components/selectTree';
|
|
import selectTree from '@/components/selectTree';
|
|
|
- import producetask from '@/api/technology/production';
|
|
|
|
|
|
|
+
|
|
|
import userSearch from './user-search.vue';
|
|
import userSearch from './user-search.vue';
|
|
|
import standardOutput from './standardOutput.vue';
|
|
import standardOutput from './standardOutput.vue';
|
|
|
export default {
|
|
export default {
|
|
@@ -283,9 +200,6 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
rules: {
|
|
rules: {
|
|
|
- parentId: [
|
|
|
|
|
- { required: true, message: '请选择父级节点', trigger: 'change' }
|
|
|
|
|
- ],
|
|
|
|
|
code: [{ required: true, message: '请选择编码', trigger: 'change' }],
|
|
code: [{ required: true, message: '请选择编码', trigger: 'change' }],
|
|
|
|
|
|
|
|
name: [{ required: true, message: '请选择名称', trigger: 'change' }]
|
|
name: [{ required: true, message: '请选择名称', trigger: 'change' }]
|
|
@@ -304,24 +218,33 @@
|
|
|
bomTypeOptions: [
|
|
bomTypeOptions: [
|
|
|
{
|
|
{
|
|
|
label: 'PBOM',
|
|
label: 'PBOM',
|
|
|
- value: "1"
|
|
|
|
|
|
|
+ value: '1'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: 'MBOM',
|
|
label: 'MBOM',
|
|
|
- value: "2"
|
|
|
|
|
|
|
+ value: '2'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: 'ABOM',
|
|
label: 'ABOM',
|
|
|
- value: "3"
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ value: '3'
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
]
|
|
]
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
getTreeValue(data) {
|
|
getTreeValue(data) {
|
|
|
- this.attributeData.parentId = data.id;
|
|
|
|
|
- this.attributeData.level = +data.level + 1;
|
|
|
|
|
|
|
+ this.category = {};
|
|
|
|
|
+ this.$set(this.attributeData, 'code', null);
|
|
|
|
|
+ this.$set(this.attributeData, 'name', null);
|
|
|
|
|
+ if (data) {
|
|
|
|
|
+ this.attributeData.parentId = data.id;
|
|
|
|
|
+ this.attributeData.level = +data.level + 1;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ this.attributeData.parentId = null;
|
|
|
|
|
+ this.attributeData.level = null;
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
save() {
|
|
save() {
|
|
|
this.$refs.form.validate((valid) => {
|
|
this.$refs.form.validate((valid) => {
|
|
@@ -348,21 +271,25 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
handleProduct() {
|
|
handleProduct() {
|
|
|
- this.$refs.standardOutputRefs.open(9);
|
|
|
|
|
|
|
+ this.$refs.standardOutputRefs.open(this.attributeData.parentId ? 1 : 9);
|
|
|
},
|
|
},
|
|
|
chooseStandardList(type, data) {
|
|
chooseStandardList(type, data) {
|
|
|
- if (type == 9) {
|
|
|
|
|
|
|
+ if (type == 9 || type == 1) {
|
|
|
this.category = data[0];
|
|
this.category = data[0];
|
|
|
|
|
+ this.$set(this.attributeData, 'code', data[0].code);
|
|
|
|
|
+ this.$set(this.attributeData, 'name', data[0].name);
|
|
|
this.$forceUpdate();
|
|
this.$forceUpdate();
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- async open(type, versions, categoryId) {
|
|
|
|
|
|
|
+ async open(type, versions, categoryId, treeId) {
|
|
|
this.attributeData = {};
|
|
this.attributeData = {};
|
|
|
this.attributeData.bomType = type;
|
|
this.attributeData.bomType = type;
|
|
|
this.attributeData.categoryId = categoryId;
|
|
this.attributeData.categoryId = categoryId;
|
|
|
this.attributeData.versions = versions;
|
|
this.attributeData.versions = versions;
|
|
|
this.versions = versions;
|
|
this.versions = versions;
|
|
|
|
|
+
|
|
|
|
|
+ console.log(treeId);
|
|
|
const res = await getBomTreeList({
|
|
const res = await getBomTreeList({
|
|
|
categoryId,
|
|
categoryId,
|
|
|
versions,
|
|
versions,
|
|
@@ -370,6 +297,8 @@
|
|
|
});
|
|
});
|
|
|
console.log(this.attributeData);
|
|
console.log(this.attributeData);
|
|
|
this.bomTreeList = res.data;
|
|
this.bomTreeList = res.data;
|
|
|
|
|
+ this.attributeData.parentId = treeId;
|
|
|
|
|
+ this.$forceUpdate();
|
|
|
this.visible = true;
|
|
this.visible = true;
|
|
|
},
|
|
},
|
|
|
handleClose() {
|
|
handleClose() {
|