视频号商品管理

This commit is contained in:
Richie 2024-03-24 18:33:37 +08:00
parent f686efa65e
commit a8e45e4042
2 changed files with 236 additions and 0 deletions

View File

@ -323,6 +323,8 @@ export default {
this.$router.push({path:'/shop/goods/dou_goods_list',query:{shopId:row.id}}) this.$router.push({path:'/shop/goods/dou_goods_list',query:{shopId:row.id}})
}else if(row.type === 4){ }else if(row.type === 4){
this.$router.push({path:'/shop/goods/pdd_goods_list',query:{shopId:row.id}}) this.$router.push({path:'/shop/goods/pdd_goods_list',query:{shopId:row.id}})
} else if(row.type === 5){
this.$router.push({path:'/shop/goods/wei_goods_list',query:{shopId:row.id}})
} }
}, },
handleLogistics(row) { handleLogistics(row) {

View File

@ -0,0 +1,234 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="108px">
<el-form-item label="平台SkuId" prop="skuId">
<el-input
v-model="queryParams.skuId"
placeholder="请输入平台SkuId"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="商家sku编码" prop="outerId">
<el-input
v-model="queryParams.outerId"
placeholder="请输入商家sku编码"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="ERP skuId" prop="erpSkuId">
<el-input
v-model="queryParams.erpSkuId"
placeholder="请输入ERP skuId"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<!-- <el-form-item label="店铺" prop="shopId">-->
<!-- <el-select v-model="queryParams.shopId" placeholder="请选择店铺" clearable @change="handleQuery">-->
<!-- <el-option-->
<!-- v-for="item in shopList"-->
<!-- :key="item.id"-->
<!-- :label="item.name"-->
<!-- :value="item.id">-->
<!-- </el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
<el-form-item>
<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-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-download"
size="mini"
@click="handlePull"
>API拉取商品数据</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="goodsList" @selection-change="handleSelectionChange">
<!-- <el-table-column type="selection" width="55" align="center" /> -->
<!-- <el-table-column label="ID" align="center" prop="id" />-->
<el-table-column label="商品ID" align="center" prop="wareId" />
<el-table-column label="Sku Id" align="center" prop="skuId" />
<el-table-column label="sku名称" align="center" prop="skuName" />
<el-table-column label="图片" align="center" prop="logo" width="100">
<template slot-scope="scope">
<image-preview :src="scope.row.logo" :width="50" :height="50"/>
</template>
</el-table-column>
<!-- <el-table-column label="店铺" align="center" prop="categoryId" >-->
<!-- <template slot-scope="scope">-->
<!-- <el-tag size="small">{{categoryList.find(x=>x.id === scope.row.categoryId).name}}</el-tag>-->
<!-- </template>-->
<!-- </el-table-column>-->
<el-table-column label="商家编码" align="center" prop="outerId" />
<el-table-column label="京东价" align="center" prop="jdPrice" />
<el-table-column label="ERP SKU ID" align="center" prop="erpSkuId" />
<el-table-column label="状态" align="center" prop="status" >
<template slot-scope="scope">
<el-tag size="small" v-if="scope.row.status === 1">销售中</el-tag>
<el-tag size="small" v-if="scope.row.status === 2">已下架</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleLink(scope.row)"
>关联ERP</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改商品管理对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="ERP商品SkuId" prop="erpSkuId">
<el-input v-model.number="form.erpSkuId" placeholder="请输入ERP商品SkuId" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import {listShop} from "@/api/shop/shop";
export default {
name: "Goods",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
goodsList: [],
shopList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
name: null
},
//
form: {},
supplierList: [],
categoryList: [],
categoryTree: [],
//
rules: {
id: [
{ required: true, message: "不能为空", trigger: "change" }
],
erpSkuId: [
{ required: true, message: "不能为空", trigger: "blur" }
],
}
};
},
created() {
// listShop({type:3}).then(response => {
// this.shopList = response.rows;
// });
// this.getList();
this.loading = false;
},
methods: {
/** 查询商品管理列表 */
getList() {
this.loading = true;
listGoodsSku(this.queryParams).then(response => {
this.goodsList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
erpSkuId: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
handleLink(row) {
this.reset();
const id = row.id || this.ids
getGoodsSku(id).then(response => {
console.log('=====00000000============',response)
this.form = response.data;
this.open = true;
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
linkErpGoodsSkuId(this.form).then(response => {
this.$modal.msgSuccess("关联成功");
this.open = false;
this.getList();
});
}
});
},
}
};
</script>