|
@@ -17,6 +17,7 @@
|
|
|
<el-row>
|
|
<el-row>
|
|
|
<el-col :span="12" label-width="100px">
|
|
<el-col :span="12" label-width="100px">
|
|
|
<el-form-item label="父级节点" prop="parentId">
|
|
<el-form-item label="父级节点" prop="parentId">
|
|
|
|
|
+
|
|
|
<selectTree
|
|
<selectTree
|
|
|
ref="tree"
|
|
ref="tree"
|
|
|
class="form-ipt"
|
|
class="form-ipt"
|
|
@@ -27,7 +28,7 @@
|
|
|
:options="bomTreeList"
|
|
:options="bomTreeList"
|
|
|
@getValue="getTreeValue"
|
|
@getValue="getTreeValue"
|
|
|
:props="{
|
|
:props="{
|
|
|
- value: 'bomId',
|
|
|
|
|
|
|
+ value: 'id',
|
|
|
label: 'name',
|
|
label: 'name',
|
|
|
children: 'children'
|
|
children: 'children'
|
|
|
}"
|
|
}"
|
|
@@ -57,15 +58,14 @@
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
|
|
<el-col :span="12" label-width="100px">
|
|
<el-col :span="12" label-width="100px">
|
|
|
- <el-form-item label="编码" prop="code">
|
|
|
|
|
- <el-input placeholder="" v-model="attributeData.code"></el-input>
|
|
|
|
|
|
|
+ <el-form-item label="编码" prop="category.code">
|
|
|
|
|
+ <el-input placeholder="" @click.native="handleProduct()" v-model="category.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-input placeholder="" v-model="attributeData.name"></el-input>
|
|
|
|
|
|
|
+ <el-form-item label="名称" prop="category.name">
|
|
|
|
|
+ <el-input placeholder="" v-model="category.name"></el-input>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
|
|
|
|
@@ -96,10 +96,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>
|
|
@@ -163,87 +159,6 @@
|
|
|
</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 +175,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 {
|
|
@@ -279,16 +194,13 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
category: {
|
|
category: {
|
|
|
- name: ''
|
|
|
|
|
|
|
+ name: '',
|
|
|
|
|
+ code: ''
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
rules: {
|
|
rules: {
|
|
|
- parentId: [
|
|
|
|
|
- { required: true, message: '请选择父级节点', trigger: 'change' }
|
|
|
|
|
- ],
|
|
|
|
|
- code: [{ required: true, message: '请选择编码', trigger: 'change' }],
|
|
|
|
|
-
|
|
|
|
|
- name: [{ required: true, message: '请选择名称', trigger: 'change' }]
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
},
|
|
},
|
|
|
bomTreeList: [],
|
|
bomTreeList: [],
|
|
|
statusOptions: [
|
|
statusOptions: [
|
|
@@ -304,15 +216,15 @@
|
|
|
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'
|
|
|
}
|
|
}
|
|
|
]
|
|
]
|
|
|
};
|
|
};
|
|
@@ -320,14 +232,27 @@
|
|
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
getTreeValue(data) {
|
|
getTreeValue(data) {
|
|
|
- this.attributeData.parentId = data.id;
|
|
|
|
|
- this.attributeData.level = +data.level + 1;
|
|
|
|
|
|
|
+ this.category = {
|
|
|
|
|
+ name: '',
|
|
|
|
|
+ code: ''
|
|
|
|
|
+ }
|
|
|
|
|
+ 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) => {
|
|
|
|
|
- if (!valid) {
|
|
|
|
|
- return false;
|
|
|
|
|
|
|
+ if(!this.category.code) {
|
|
|
|
|
+ this.$message.error('编码不能为空');
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
if (!this.attributeData.parentId) {
|
|
if (!this.attributeData.parentId) {
|
|
|
this.attributeData.parentId = 0;
|
|
this.attributeData.parentId = 0;
|
|
|
this.attributeData.level = 1;
|
|
this.attributeData.level = 1;
|
|
@@ -339,7 +264,7 @@
|
|
|
this.$emit('reload', this.attributeData.versions);
|
|
this.$emit('reload', this.attributeData.versions);
|
|
|
this.handleClose();
|
|
this.handleClose();
|
|
|
}
|
|
}
|
|
|
- });
|
|
|
|
|
|
|
+
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
versionsChange(versions) {
|
|
versionsChange(versions) {
|
|
@@ -348,21 +273,23 @@
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
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.$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() {
|