Commit 8cbcafd5 by lixiaomin

修改代码

parent 3963e692
...@@ -36,9 +36,10 @@ export function updateMaterial(data) { ...@@ -36,9 +36,10 @@ export function updateMaterial(data) {
} }
// 删除 // 删除
export function delMaterial(id) { export function delMaterial(parm) {
return request({ return request({
url: "/system/material/" + id, url: "/system/material/remove",
method: "delete", method: "get",
params: parm,
}); });
} }
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
style="width: 100%" style="width: 100%"
@change="change" @change="change"
placeholder="请选择" placeholder="请选择"
clearable
> >
<el-option <el-option
v-for="item in options" v-for="item in options"
......
...@@ -55,7 +55,7 @@ export default { ...@@ -55,7 +55,7 @@ export default {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
name: null, name: null,
status: 0, state: 1,
}, },
}; };
}, },
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="分类名称" align="center" prop="name" /> <el-table-column label="分类名称" align="center" prop="name" />
<el-table-column label="备注" align="center" prop="remarks" /> <el-table-column label="备注" align="center" prop="remarks" />
<el-table-column label="商品数量" align="center" prop="goodsConunt" /> <el-table-column label="商品数量" align="center" prop="goodsCount" />
<el-table-column label="状态" align="center" prop="state"> <el-table-column label="状态" align="center" prop="state">
<template slot-scope="scope"> <template slot-scope="scope">
<span v-if="scope.row.state == 1">启用</span> <span v-if="scope.row.state == 1">启用</span>
......
...@@ -108,6 +108,12 @@ import SelectCategory from "@/components/SelectCategory"; ...@@ -108,6 +108,12 @@ import SelectCategory from "@/components/SelectCategory";
import SelectSpecs from "@/components/SelectSpecs"; import SelectSpecs from "@/components/SelectSpecs";
import { setSpec } from "./href"; import { setSpec } from "./href";
export default { export default {
props: {
getList: {
type: Function,
default: null
}
},
components: { SelectCategory, SelectSpecs }, components: { SelectCategory, SelectSpecs },
data() { data() {
return { return {
......
...@@ -4,10 +4,19 @@ ...@@ -4,10 +4,19 @@
<el-form-item label="商品名称" prop="spuName"> <el-form-item label="商品名称" prop="spuName">
<el-input v-model="queryParams.spuName" placeholder="请输入商品名称" clearable @keyup.enter.native="handleQuery" /> <el-input v-model="queryParams.spuName" placeholder="请输入商品名称" clearable @keyup.enter.native="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="状态" prop="state">
<el-input v-model="queryParams.status" placeholder="状态" clearable @keyup.enter.native="handleQuery" /> <el-select v-model="queryParams.state" placeholder="请选择状态" clearable @keyup.enter.native="handleQuery">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="商品分类" prop="category">
<SelectCategory v-model="queryParams.category" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button> <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-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
...@@ -34,11 +43,13 @@ ...@@ -34,11 +43,13 @@
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="商品名称" align="center" prop="name" width="150" /> <el-table-column label="商品名称" align="center" prop="name" width="150" />
<el-table-column label="编码" align="center" prop="code" width="150" /> <el-table-column label="编码" align="center" prop="code" width="150" />
<el-table-column label="折扣价" align="center" prop="discount" width="150" /> <el-table-column label="缩略图" align="center" prop="" width="150" />
<el-table-column label="原价" align="center" prop="price" width="150" /> <el-table-column label="商品分类" align="center" prop="category" width="100" />
<el-table-column label="销售总量" align="center" prop="salesVolume" width="150" /> <el-table-column label="简介" align="center" prop="desc" width="150" />
<el-table-column label="简介" align="center" prop="desc" /> <el-table-column label="售价" align="center" prop="price" />
<el-table-column label="备注" align="center" prop="remarks" width="150" /> <el-table-column label="总销量" align="center" prop="salesVolume" width="150" />
<el-table-column label="创建时间" align="center" prop="createdAt" width="150" />
<el-table-column label="上架时间" align="center" prop="shelfat" width="150" />
<!-- <el-table-column <!-- <el-table-column
label="上架时间" label="上架时间"
align="center" align="center"
...@@ -76,7 +87,7 @@ ...@@ -76,7 +87,7 @@
</el-table> </el-table>
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize" <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
@pagination="getList" /> @pagination="getList" />
<Form ref="Form" /> <Form ref="Form" :getList="getList"/>
</div> </div>
</template> </template>
...@@ -84,9 +95,10 @@ ...@@ -84,9 +95,10 @@
import { listSpu, delSpu, updateSpu } from "@/api/system/goods"; import { listSpu, delSpu, updateSpu } from "@/api/system/goods";
import PutShopOffShop from './components/putShopOffShop.vue' import PutShopOffShop from './components/putShopOffShop.vue'
import Form from "./components/Form.vue"; import Form from "./components/Form.vue";
import SelectCategory from "@/components/SelectCategory";
export default { export default {
name: "Spu", name: "Spu",
components: { Form, PutShopOffShop }, components: { Form, PutShopOffShop ,SelectCategory},
data() { data() {
return { return {
// 遮罩层 // 遮罩层
...@@ -120,6 +132,23 @@ export default { ...@@ -120,6 +132,23 @@ export default {
shelfTime: null, shelfTime: null,
status: null, status: null,
}, },
options: [{
value: '1',
label: '已创建'
}, {
value: '2',
label: '已完成编程'
}, {
value: '3',
label: '已上架'
}, {
value: '4',
label: '已下架'
}, {
value: '5',
label: '已删除'
}],
categoryList:[]
}; };
}, },
created() { created() {
......
...@@ -202,6 +202,7 @@ export default { ...@@ -202,6 +202,7 @@ export default {
this.getList(); this.getList();
}); });
} else { } else {
this.form.state='1';
addMaterial(this.form).then((response) => { addMaterial(this.form).then((response) => {
this.$modal.msgSuccess("新增成功"); this.$modal.msgSuccess("新增成功");
this.open = false; this.open = false;
...@@ -217,7 +218,7 @@ export default { ...@@ -217,7 +218,7 @@ export default {
this.$modal this.$modal
.confirm('是否确认删除编号为"' + ids + '"的数据项?') .confirm('是否确认删除编号为"' + ids + '"的数据项?')
.then(function () { .then(function () {
return delMaterial(ids); return delMaterial({id:ids});
}) })
.then(() => { .then(() => {
this.getList(); this.getList();
......
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