商品列表问题展示搜索字段,展示商品类型

master
Chopper 2021-06-22 14:59:20 +08:00
parent 4a6fd431bc
commit 3b922839a1
2 changed files with 67 additions and 23 deletions

View File

@ -38,6 +38,12 @@
<Option value="DOWN">下架</Option> <Option value="DOWN">下架</Option>
</Select> </Select>
</Form-item> </Form-item>
<Form-item label="商品类型" prop="status">
<Select v-model="searchForm.goodsType" placeholder="请选择" clearable style="width: 200px">
<Option value="PHYSICAL_GOODS">实物商品</Option>
<Option value="VIRTUAL_GOODS">虚拟商品</Option>
</Select>
</Form-item>
<Button @click="handleSearch" class="search-btn" type="primary" icon="ios-search" >搜索</Button> <Button @click="handleSearch" class="search-btn" type="primary" icon="ios-search" >搜索</Button>
</Form> </Form>
</Row> </Row>
@ -132,6 +138,7 @@ export default {
pageSize: 10, // pageSize: 10, //
sort: "create_time", // sort: "create_time", //
order: "desc", // order: "desc", //
goodsType: "", //
}, },
underForm: { // underForm: { //
reason: "", reason: "",
@ -174,6 +181,20 @@ export default {
); );
}, },
}, },
{
title: "商品类型",
key: "goodsType",
width: 130,
render: (h, params) => {
if (params.row.goodsType === 'PHYSICAL_GOODS') {
return h("div", "实物商品");
} else if (params.row.goodsType === 'VIRTUAL_GOODS') {
return h("div", "虚拟商品");
} else {
return h("div", "电子卡券");
}
},
},
{ {
title: "状态", title: "状态",
key: "marketEnable", key: "marketEnable",

View File

@ -4,7 +4,7 @@
<Row @keydown.enter.native="handleSearch"> <Row @keydown.enter.native="handleSearch">
<Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form"> <Form ref="searchForm" :model="searchForm" inline :label-width="70" class="search-form">
<Form-item label="商品名称" prop="goodsName"> <Form-item label="商品名称" prop="goodsName">
<Input type="text" v-model="searchForm.goodsName" placeholder="请输入商品名称" clearable style="width: 200px" /> <Input type="text" v-model="searchForm.goodsName" placeholder="请输入商品名称" clearable style="width: 200px"/>
</Form-item> </Form-item>
<Form-item label="状态" prop="status"> <Form-item label="状态" prop="status">
<Select v-model="searchForm.marketEnable" placeholder="请选择" clearable style="width: 200px"> <Select v-model="searchForm.marketEnable" placeholder="请选择" clearable style="width: 200px">
@ -12,8 +12,14 @@
<Option value="UPPER">上架</Option> <Option value="UPPER">上架</Option>
</Select> </Select>
</Form-item> </Form-item>
<Form-item label="商品类型" prop="status">
<Select v-model="searchForm.goodsType" placeholder="请选择" clearable style="width: 200px">
<Option value="PHYSICAL_GOODS">实物商品</Option>
<Option value="VIRTUAL_GOODS">虚拟商品</Option>
</Select>
</Form-item>
<Form-item label="商品编号" prop="sn"> <Form-item label="商品编号" prop="sn">
<Input type="text" v-model="searchForm.sn" placeholder="商品编号" clearable style="width: 200px" /> <Input type="text" v-model="searchForm.sn" placeholder="商品编号" clearable style="width: 200px"/>
</Form-item> </Form-item>
<Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button> <Button @click="handleSearch" type="primary" icon="ios-search" class="search-btn">搜索</Button>
<Button @click="handleReset" class="search-btn">重置</Button> <Button @click="handleReset" class="search-btn">重置</Button>
@ -45,11 +51,12 @@
<div style="margin-left: 13px;"> <div style="margin-left: 13px;">
<div class="div-zoom"> <div class="div-zoom">
<a @click="linkTo(row.id,row.skuId)">{{row.goodsName}}</a> <a @click="linkTo(row.id,row.skuId)">{{ row.goodsName }}</a>
</div> </div>
<Poptip trigger="hover" title="扫码在手机中查看" transfer> <Poptip trigger="hover" title="扫码在手机中查看" transfer>
<div slot="content"> <div slot="content">
<vue-qr :text="wapLinkTo(row.id,row.skuId)" :margin="0" colorDark="#000" colorLight="#fff" :size="150"></vue-qr> <vue-qr :text="wapLinkTo(row.id,row.skuId)" :margin="0" colorDark="#000" colorLight="#fff"
:size="150"></vue-qr>
</div> </div>
<img src="../../../assets/qrcode.svg" class="hover-pointer" width="20" height="20" alt=""> <img src="../../../assets/qrcode.svg" class="hover-pointer" width="20" height="20" alt="">
</Poptip> </Poptip>
@ -60,13 +67,14 @@
</Table> </Table>
<Row type="flex" justify="end" class="page"> <Row type="flex" justify="end" class="page">
<Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage" @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small" <Page :current="searchForm.pageNumber" :total="total" :page-size="searchForm.pageSize" @on-change="changePage"
show-total show-elevator show-sizer></Page> @on-page-size-change="changePageSize" :page-size-opts="[10, 20, 50]" size="small"
show-total show-elevator show-sizer></Page>
</Row> </Row>
</Card> </Card>
<Modal title="更新库存" v-model="updateStockModalVisible" :mask-closable="false" :width="500"> <Modal title="更新库存" v-model="updateStockModalVisible" :mask-closable="false" :width="500">
<Input type="number" v-model="stockAllUpdate" placeholder="全部修改,如不需全部修改,则不需输入" /> <Input type="number" v-model="stockAllUpdate" placeholder="全部修改,如不需全部修改,则不需输入"/>
<Table :columns="updateStockColumns" :data="stockList" border :span-method="handleSpan"></Table> <Table :columns="updateStockColumns" :data="stockList" border :span-method="handleSpan"></Table>
<div slot="footer"> <div slot="footer">
<Button type="text" @click="updateStockModalVisible = false">取消</Button> <Button type="text" @click="updateStockModalVisible = false">取消</Button>
@ -78,7 +86,8 @@
<Modal title="批量设置运费模板" v-model="shipTemplateModal" :mask-closable="false" :width="500"> <Modal title="批量设置运费模板" v-model="shipTemplateModal" :mask-closable="false" :width="500">
<Form ref="shipTemplateForm" :model="shipTemplateForm" :label-width="120"> <Form ref="shipTemplateForm" :model="shipTemplateForm" :label-width="120">
<FormItem class="form-item-view-el" label="运费" prop="freightPayer"> <FormItem class="form-item-view-el" label="运费" prop="freightPayer">
<RadioGroup type="button" button-style="solid" @on-change="logisticsTemplateUndertakerChange" v-model="shipTemplateForm.freightPayer"> <RadioGroup type="button" button-style="solid" @on-change="logisticsTemplateUndertakerChange"
v-model="shipTemplateForm.freightPayer">
<Radio label="STORE"> <Radio label="STORE">
<span>卖家承担运费</span> <span>卖家承担运费</span>
</Radio> </Radio>
@ -245,6 +254,20 @@ export default {
); );
}, },
}, },
{
title: "商品类型",
key: "goodsType",
width: 130,
render: (h, params) => {
if (params.row.goodsType === 'PHYSICAL_GOODS') {
return h("div", "实物商品");
} else if (params.row.goodsType === 'VIRTUAL_GOODS') {
return h("div", "虚拟商品");
} else {
return h("div", "电子卡券");
}
},
},
{ {
title: "商品价格", title: "商品价格",
key: "price", key: "price",
@ -432,10 +455,10 @@ export default {
this.getDataList(); this.getDataList();
}, },
addGoods() { addGoods() {
this.$router.push({ name: "goods-operation" }); this.$router.push({name: "goods-operation"});
}, },
editGoods(v) { editGoods(v) {
this.$router.push({ name: "goods-operation-edit", query: { id: v.id } }); this.$router.push({name: "goods-operation-edit", query: {id: v.id}});
}, },
// //
@ -458,7 +481,7 @@ export default {
} }
}, },
getStockDetail(id) { getStockDetail(id) {
getGoodsSkuListDataSeller({ goodsId: id, pageSize: 1000 }).then((res) => { getGoodsSkuListDataSeller({goodsId: id, pageSize: 1000}).then((res) => {
if (res.success) { if (res.success) {
this.updateStockModalVisible = true; this.updateStockModalVisible = true;
this.stockAllUpdate = undefined; this.stockAllUpdate = undefined;
@ -468,7 +491,7 @@ export default {
}, },
updateStock() { updateStock() {
let updateStockList = this.stockList.map((i) => { let updateStockList = this.stockList.map((i) => {
let j = { skuId: i.id, quantity: i.quantity }; let j = {skuId: i.id, quantity: i.quantity};
if (this.stockAllUpdate) { if (this.stockAllUpdate) {
j.quantity = this.stockAllUpdate; j.quantity = this.stockAllUpdate;
} }
@ -481,28 +504,28 @@ export default {
} }
}); });
}, },
changePage (v) { changePage(v) {
this.searchForm.pageNumber = v; this.searchForm.pageNumber = v;
this.getDataList(); this.getDataList();
this.clearSelectAll(); this.clearSelectAll();
}, },
changePageSize (v) { changePageSize(v) {
this.searchForm.pageSize = v; this.searchForm.pageSize = v;
this.getDataList(); this.getDataList();
}, },
handleSearch () { handleSearch() {
this.searchForm.pageNumber = 1; this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10; this.searchForm.pageSize = 10;
this.getDataList(); this.getDataList();
}, },
handleReset () { handleReset() {
this.searchForm = {}; this.searchForm = {};
this.searchForm.pageNumber = 1; this.searchForm.pageNumber = 1;
this.searchForm.pageSize = 10; this.searchForm.pageSize = 10;
// //
this.getDataList(); this.getDataList();
}, },
changeSort (e) { changeSort(e) {
this.searchForm.sort = e.key; this.searchForm.sort = e.key;
this.searchForm.order = e.order; this.searchForm.order = e.order;
if (e.order === "normal") { if (e.order === "normal") {
@ -510,15 +533,15 @@ export default {
} }
this.getDataList(); this.getDataList();
}, },
clearSelectAll () { clearSelectAll() {
this.$refs.table.selectAll(false); this.$refs.table.selectAll(false);
}, },
changeSelect (e) { changeSelect(e) {
this.selectList = e; this.selectList = e;
this.selectCount = e.length; this.selectCount = e.length;
}, },
// //
saveShipTemplate () { saveShipTemplate() {
if (this.shipTemplateForm.freightPayer == "STORE") { if (this.shipTemplateForm.freightPayer == "STORE") {
{ {
this.shipTemplateForm.templateId = 0; this.shipTemplateForm.templateId = 0;
@ -716,10 +739,10 @@ export default {
}); });
}, },
}, },
mounted () { mounted() {
this.init(); this.init();
}, },
activated () { activated() {
this.init(); this.init();
}, },
}; };