From e070925cf80477620d62a3acb7c55ad30c5669b8 Mon Sep 17 00:00:00 2001 From: bibi <541660090@qq.com> Date: Fri, 25 Feb 2022 16:26:29 +0800 Subject: [PATCH] 1 --- src/api/shop/goods/index.js | 54 +++++ .../GoodsManage/_goodsList/depend/config.js | 29 +-- .../GoodsManage/_goodsList/depend/form.js | 29 +++ .../GoodsManage/_goodsList/depend/form.vue | 189 +++++++++++++++ .../Shop/GoodsManage/_goodsList/index.vue | 70 ++++-- .../GoodsManage/_jcookList/depend/config.js | 11 +- .../GoodsManage/_jcookList/depend/form.js | 41 ++-- .../GoodsManage/_jcookList/depend/form.vue | 227 ++++++++---------- .../Shop/GoodsManage/_jcookList/index.vue | 20 +- 9 files changed, 491 insertions(+), 179 deletions(-) create mode 100644 src/views/Shop/GoodsManage/_goodsList/depend/form.js create mode 100644 src/views/Shop/GoodsManage/_goodsList/depend/form.vue diff --git a/src/api/shop/goods/index.js b/src/api/shop/goods/index.js index 97cad0f..34db36b 100644 --- a/src/api/shop/goods/index.js +++ b/src/api/shop/goods/index.js @@ -36,4 +36,58 @@ export function jcookGoodsBatchPush(params) { method: 'post', data: params, }) +} +export function jcookGoodsPush(params) { + return httpService({ + url: `/user/shop/jcookGoodsPush`, + method: 'post', + data: params, + }) +} +export function goodsEdit(params) { + return httpService({ + url: `/user/shop/update`, + method: 'post', + data: params, + }) +} +export function goodsInfo(params) { + return httpService({ + url: `/user/shop/findById`, + method: 'get', + params: params, + }) +} + +// 分类 +export function cateSelect(params) { + return httpService({ + url: `/user/shopCategory/listAll`, + method: 'get', + params: params, + }) +} +// 店铺 +export function shopSelect(params) { + return httpService({ + url: `/user/shop/?`, + method: 'get', + params: params, + }) +} +// 供应商 +export function vendorSelect(params) { + return httpService({ + url: `/user/shop/?`, + method: 'get', + params: params, + }) +} +// 品牌 +export function brandSelect(params) { + return httpService({ + url: `/user/shop/?`, + method: 'get', + params: params, + }) } \ No newline at end of file diff --git a/src/views/Shop/GoodsManage/_goodsList/depend/config.js b/src/views/Shop/GoodsManage/_goodsList/depend/config.js index 9b07a44..197f858 100644 --- a/src/views/Shop/GoodsManage/_goodsList/depend/config.js +++ b/src/views/Shop/GoodsManage/_goodsList/depend/config.js @@ -4,14 +4,20 @@ export const columns = [ width: "12%", dataIndex: "skuName", }, + { + title: "主图url", + width: "4%", + dataIndex: "mainPhoto", + scopedSlots: { customRender: "mainPhoto"} + }, { title: "sku编码", - width: "12%", + width: "10%", dataIndex: "skuId", }, { title: "商品类型", - width: "7%", + width: "4%", dataIndex: "mallType", customRender: function (mallType) { switch (mallType) { @@ -40,44 +46,39 @@ export const columns = [ }, { title: "一级分类名称", - width: "8%", + width: "6%", dataIndex: "categoryFirstName", }, { title: "二级分类名称", - width: "8%", + width: "6%", dataIndex: "categorySecondName", }, { title: "三级分类名称", - width: "8%", + width: "6%", dataIndex: "categoryThirdName", }, - { - title: "主图url", - width: "8%", - dataIndex: "mainPhoto", - }, { title: "售卖价", - width: "8%", + width: "4%", dataIndex: "sellPrice", }, { title: "折扣价", - width: "8%", + width: "4%", dataIndex: "discountPrice", }, { title: "浏览量", - width: "8%", + width: "5%", dataIndex: "viewsNum", }, { title: "操作", dataIndex: "action", key: "action", - width: "180", + width: "250", fixed: "right", scopedSlots: { customRender: "action" }, }, diff --git a/src/views/Shop/GoodsManage/_goodsList/depend/form.js b/src/views/Shop/GoodsManage/_goodsList/depend/form.js new file mode 100644 index 0000000..8d52dc5 --- /dev/null +++ b/src/views/Shop/GoodsManage/_goodsList/depend/form.js @@ -0,0 +1,29 @@ +export const form = { + id:undefined, + status:undefined, + skuName:undefined, + shopId:undefined, + vendorId:undefined, + brandId:undefined, + categoryFirstId:undefined, + categorySecondId:undefined, + categoryThirdId:undefined, + sellPrice:undefined, + discountPrice:undefined, +} +export const rules = { + skuName:[{required:true,message:'请输入',trigger:'blur'}], + shopId:[{required:true,message:'请选择',trigger:'change'}], + status:[{required:true,message:'请选择',trigger:'change'}], + vendorId:[{required:true,message:'请选择',trigger:'change'}], + brandId: [{ required: true, message: '请选择', trigger: 'change' }], + cateValue: [{ required: true, message: '请选择', trigger: 'change',type: 'array'}], + sellPrice:[{required:true,message:'请输入',trigger:'blur'}], + discountPrice:[{required:true,message:'请输入',trigger:'blur'}], +} +export const options = { + cate:[], + shop: [], + vendor: [], + brand:[], +} diff --git a/src/views/Shop/GoodsManage/_goodsList/depend/form.vue b/src/views/Shop/GoodsManage/_goodsList/depend/form.vue new file mode 100644 index 0000000..c5a946e --- /dev/null +++ b/src/views/Shop/GoodsManage/_goodsList/depend/form.vue @@ -0,0 +1,189 @@ + + + + + diff --git a/src/views/Shop/GoodsManage/_goodsList/index.vue b/src/views/Shop/GoodsManage/_goodsList/index.vue index f338c70..9acc325 100644 --- a/src/views/Shop/GoodsManage/_goodsList/index.vue +++ b/src/views/Shop/GoodsManage/_goodsList/index.vue @@ -1,14 +1,14 @@ + - + diff --git a/src/views/Shop/GoodsManage/_jcookList/depend/config.js b/src/views/Shop/GoodsManage/_jcookList/depend/config.js index 5118f53..a5458cf 100644 --- a/src/views/Shop/GoodsManage/_jcookList/depend/config.js +++ b/src/views/Shop/GoodsManage/_jcookList/depend/config.js @@ -4,6 +4,12 @@ export const columns = [ width: "8%", dataIndex: "skuName", }, + { + title: "主图url", + width: "4%", + dataIndex: "mainPhoto", + scopedSlots: { customRender: "mainPhoto"} + }, { title: "sku编码", width: "8%", @@ -71,11 +77,6 @@ export const columns = [ } } }, - { - title: "主图url", - width: "8%", - dataIndex: "mainPhoto", - }, { title: "供货价", width: "5%", diff --git a/src/views/Shop/GoodsManage/_jcookList/depend/form.js b/src/views/Shop/GoodsManage/_jcookList/depend/form.js index 1358dae..09000e8 100644 --- a/src/views/Shop/GoodsManage/_jcookList/depend/form.js +++ b/src/views/Shop/GoodsManage/_jcookList/depend/form.js @@ -1,21 +1,32 @@ export const form = { id:undefined, - title:undefined, - categoryId:undefined, - status:undefined, - content:undefined, - imgUrls:[] + defaultSkuName:true, + defaultShopName: true, + defaultVendorName:true, + defaultBrandName:true, + defaultCategoryName:true, + skuName:undefined, + shopId:undefined, + vendorId:undefined, + brandId:undefined, + categoryFirstId:undefined, + categorySecondId:undefined, + categoryThirdId:undefined, + sellPrice:undefined, + discountPrice:undefined, } export const rules = { - title:[{required:true,message:'请输入标题',trigger:'blur'}], - categoryId:[{required:true,message:'请选择分类',trigger:'change'}], - status:[{required:true,message:'请选择',trigger:'change'}], - content:[{required:true,message:'请输入',trigger:'blur'}], + skuName:[{required:true,message:'请输入',trigger:'blur'}], + shopId:[{required:true,message:'请选择',trigger:'change'}], + vendorId:[{required:true,message:'请选择',trigger:'change'}], + brandId: [{ required: true, message: '请选择', trigger: 'change' }], + cateValue: [{ required: true, message: '请选择', trigger: 'change',type: 'array'}], + sellPrice:[{required:true,message:'请输入',trigger:'blur'}], + discountPrice:[{required:true,message:'请输入',trigger:'blur'}], } export const options = { - status:[ - { id:1, name:'未发布' }, - { id:2, name:'已发布' }, - ], - categoryId:[] -} \ No newline at end of file + cate:[], + shop: [], + vendor: [], + brand:[], +} diff --git a/src/views/Shop/GoodsManage/_jcookList/depend/form.vue b/src/views/Shop/GoodsManage/_jcookList/depend/form.vue index 50729b0..bc3de34 100644 --- a/src/views/Shop/GoodsManage/_jcookList/depend/form.vue +++ b/src/views/Shop/GoodsManage/_jcookList/depend/form.vue @@ -1,10 +1,10 @@