|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
<template>
|
|
|
<div class="ele-body">
|
|
<div class="ele-body">
|
|
|
<el-card shadow="never">
|
|
<el-card shadow="never">
|
|
|
- <el-form label-width="120px" ref="form" :model="form" :rules="rules">
|
|
|
|
|
|
|
+ <el-form label-width="120px" ref="manageForm" :model="form" :rules="rules">
|
|
|
<div class="body-top">
|
|
<div class="body-top">
|
|
|
<div class="top-left">
|
|
<div class="top-left">
|
|
|
<div class="ele-page-header ele-cell">
|
|
<div class="ele-page-header ele-cell">
|
|
@@ -17,7 +17,7 @@
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
<el-button @click="cancel">返回</el-button>
|
|
<el-button @click="cancel">返回</el-button>
|
|
|
- <el-button type="primary">保存</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" @click="submit">保存</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="divider">
|
|
<div class="divider">
|
|
@@ -40,7 +40,7 @@
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
|
<el-form-item label="分类" prop="categoryLevelName">
|
|
<el-form-item label="分类" prop="categoryLevelName">
|
|
|
- <el-input v-model="form.categoryLevelName"/>
|
|
|
|
|
|
|
+ <el-input v-model="form.categoryLevelName" @click.native="openCategory"/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
@@ -99,7 +99,7 @@
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
|
<el-form-item label="是否产品" prop="isProduct">
|
|
<el-form-item label="是否产品" prop="isProduct">
|
|
|
- <el-switch v-model="form.isProduct"> </el-switch>
|
|
|
|
|
|
|
+ <el-switch v-model="form.isProduct" :active-value="true" :inactive-value="false"> </el-switch>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
@@ -118,8 +118,8 @@
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="8">
|
|
<el-col :span="8">
|
|
|
- <el-form-item label="产品分类">
|
|
|
|
|
- <el-input v-model="form.categoryLevelName"/>
|
|
|
|
|
|
|
+ <el-form-item label="产品分类" :prop="form.isProduct?'productCategory':''" >
|
|
|
|
|
+ <el-input v-model="form.productCategory"/>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
</el-row>
|
|
</el-row>
|
|
@@ -128,7 +128,8 @@
|
|
|
|
|
|
|
|
<!-- 物料组弹窗 -->
|
|
<!-- 物料组弹窗 -->
|
|
|
<GroupDialog ref="groupRefs" @changeMaterial='determineChoose'/>
|
|
<GroupDialog ref="groupRefs" @changeMaterial='determineChoose'/>
|
|
|
-
|
|
|
|
|
|
|
+ <!-- 分类选择弹窗 -->
|
|
|
|
|
+ <CategoryDialog ref="categoryRefs"/>
|
|
|
<!-- 仓储配置 -->
|
|
<!-- 仓储配置 -->
|
|
|
<WarehouseInfo ref="warehouseRefs" :form="form"/>
|
|
<WarehouseInfo ref="warehouseRefs" :form="form"/>
|
|
|
<!-- 采购 -->
|
|
<!-- 采购 -->
|
|
@@ -154,6 +155,7 @@
|
|
|
|
|
|
|
|
<script>
|
|
<script>
|
|
|
import GroupDialog from './components/GroupDialog.vue';
|
|
import GroupDialog from './components/GroupDialog.vue';
|
|
|
|
|
+ import CategoryDialog from './components/CategoryDialog.vue';
|
|
|
import WarehouseInfo from './components/WarehouseInfo.vue';
|
|
import WarehouseInfo from './components/WarehouseInfo.vue';
|
|
|
import ProcureInfo from './components/ProcureInfo.vue';
|
|
import ProcureInfo from './components/ProcureInfo.vue';
|
|
|
import ProductionInfo from './components/ProductionInfo.vue';
|
|
import ProductionInfo from './components/ProductionInfo.vue';
|
|
@@ -170,7 +172,7 @@
|
|
|
name: 'ManageMaterial',
|
|
name: 'ManageMaterial',
|
|
|
components: {
|
|
components: {
|
|
|
GroupDialog , deptSelect , personSelect , WarehouseInfo , ProcureInfo ,ProductionInfo ,
|
|
GroupDialog , deptSelect , personSelect , WarehouseInfo , ProcureInfo ,ProductionInfo ,
|
|
|
- PlanInfo , SalesInfo , QualityInfo , BoatInfo , TurnoverInfo , MoldInfo , RemarkInfo
|
|
|
|
|
|
|
+ PlanInfo , SalesInfo , QualityInfo , BoatInfo , TurnoverInfo , MoldInfo , RemarkInfo , CategoryDialog
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
@@ -187,6 +189,7 @@
|
|
|
categoryLevelName:[{ required: true, message: '请选择所属分类', trigger: 'change' }],
|
|
categoryLevelName:[{ required: true, message: '请选择所属分类', trigger: 'change' }],
|
|
|
measuringUnit:[{ required: true, message: '请选择计量单位', trigger: 'change' }],
|
|
measuringUnit:[{ required: true, message: '请选择计量单位', trigger: 'change' }],
|
|
|
isProduct:[{ required: true, message: '请选择是否产品', trigger: 'change' }],
|
|
isProduct:[{ required: true, message: '请选择是否产品', trigger: 'change' }],
|
|
|
|
|
+ productCategory:[{ required: true, trigger: "change", message: "产品分类必填" }]
|
|
|
},
|
|
},
|
|
|
chooseItem:null,
|
|
chooseItem:null,
|
|
|
|
|
|
|
@@ -209,6 +212,9 @@
|
|
|
|
|
|
|
|
chooseMaterial(){
|
|
chooseMaterial(){
|
|
|
this.$refs.groupRefs.open(this.chooseItem)
|
|
this.$refs.groupRefs.open(this.chooseItem)
|
|
|
|
|
+ },
|
|
|
|
|
+ openCategory(){
|
|
|
|
|
+ this.$refs.categoryRefs.open(this.chooseItem.categoryLevelRootId)
|
|
|
},
|
|
},
|
|
|
determineChoose(row){
|
|
determineChoose(row){
|
|
|
this.chooseItem = row
|
|
this.chooseItem = row
|
|
@@ -219,6 +225,18 @@
|
|
|
this.$router.go(-1)
|
|
this.$router.go(-1)
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ // 保存
|
|
|
|
|
+ submit(){
|
|
|
|
|
+ this.$refs.manageForm.validate((valid) => {
|
|
|
|
|
+ if (!valid) {
|
|
|
|
|
+ return false;
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log('保存了')
|
|
|
|
|
+
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
</script>
|
|
</script>
|