Commit 19fb4a72 authored by wanglianghe's avatar wanglianghe

产品类型,产品列表

parent 49e48606
...@@ -174,6 +174,19 @@ export const constantRoutes = [ ...@@ -174,6 +174,19 @@ export const constantRoutes = [
meta: {title: '网点仓库', activeMenu: '/config/node'} meta: {title: '网点仓库', activeMenu: '/config/node'}
} }
] ]
},
{
path: '/producttype',
component: Layout,
hidden: true,
redirect: 'noredirect',
children: [{
path: 'productlist',
component: (resolve) => require(['@/views/ecw/product/index'], resolve),
name: 'product',
meta: {title: '产品列表', activeMenu: '/product/product-type'}
}
]
} }
] ]
......
...@@ -91,7 +91,7 @@ ...@@ -91,7 +91,7 @@
<!-- 对话框(添加 / 修改) --> <!-- 对话框(添加 / 修改) -->
<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="110px">
<el-form-item label="产品类型" prop="typeId"> <el-form-item label="产品类型" prop="typeId">
<el-select v-model="form.typeId" placeholder="选择产品类型" clearable> <el-select v-model="form.typeId" placeholder="选择产品类型" clearable>
<el-option v-for="type in typeList" :key="type.id" :label="type.titleZh" :value="type.id"/> <el-option v-for="type in typeList" :key="type.id" :label="type.titleZh" :value="type.id"/>
...@@ -110,6 +110,17 @@ ...@@ -110,6 +110,17 @@
<el-option v-for="attr in attrList" :key="attr.id" :label="attr.attrName" :value="attr.id"/> <el-option v-for="attr in attrList" :key="attr.id" :label="attr.attrName" :value="attr.id"/>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="需要预约入仓" prop="needBook">
<el-radio v-model.number="form.needBook" :label="1"></el-radio>
<el-radio v-model.number="form.needBook" :label="0"></el-radio>
</el-form-item>
<el-form-item label="每日入仓上限" prop="dayLimit">
<el-input v-model.number="form.dayLimit" type="number">
<template slot="append">立方米</template>
</el-input>
</el-form-item>
</el-form> </el-form>
...@@ -171,6 +182,7 @@ export default { ...@@ -171,6 +182,7 @@ export default {
attrId: [{ required: true, message: "产品属性不能为空", trigger: "change" }], attrId: [{ required: true, message: "产品属性不能为空", trigger: "change" }],
titleZh: [{ required: true, message: "中文标题不能为空", trigger: "blur" }], titleZh: [{ required: true, message: "中文标题不能为空", trigger: "blur" }],
titleEn: [{ required: true, message: "英文标题不能为空", trigger: "blur" }], titleEn: [{ required: true, message: "英文标题不能为空", trigger: "blur" }],
needBook:[{ required: true, message: "预约入仓不能为空", trigger: "blur" }],
}, },
CommonStatusEnum: CommonStatusEnum, CommonStatusEnum: CommonStatusEnum,
...@@ -205,6 +217,11 @@ export default { ...@@ -205,6 +217,11 @@ export default {
}, },
created() { created() {
let typeId = this.$route.query.typeId;
if(typeId) {
this.queryParams.typeId = parseInt(typeId);
}
this.getAttrList(); this.getAttrList();
this.getTypeList(); this.getTypeList();
this.getList(); this.getList();
...@@ -284,6 +301,9 @@ export default { ...@@ -284,6 +301,9 @@ export default {
this.reset(); this.reset();
this.open = true; this.open = true;
this.title = "添加产品"; this.title = "添加产品";
if(this.queryParams.typeId) {
this.form.typeId = this.queryParams.typeId;
}
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdate(row) { handleUpdate(row) {
......
...@@ -40,6 +40,9 @@ ...@@ -40,6 +40,9 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button size="mini" type="text" @click="typeProductList(scope.row)"
v-hasPermi="['ecw:product:query']">产品列表</el-button>
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)" <el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)"
v-hasPermi="['ecw:product-type:update']">修改</el-button> v-hasPermi="['ecw:product-type:update']">修改</el-button>
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)" <el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)"
...@@ -175,6 +178,17 @@ export default { ...@@ -175,6 +178,17 @@ export default {
this.title = "修改产品类型"; this.title = "修改产品类型";
}); });
}, },
/**跳转到产品列表 */
typeProductList(row) {
this.$router.push({
path:'/producttype/productlist',
query: {
typeId:row.id
}
})
},
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.$refs["form"].validate(valid => { this.$refs["form"].validate(valid => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment