This commit is contained in:
liushiwei
2023-11-08 13:39:21 +08:00
parent 66c89f71e1
commit 0e9d59b1eb
18 changed files with 939 additions and 443 deletions

View File

@@ -6,6 +6,8 @@
</span>
<el-dropdown-menu slot="dropdown">
<el-dropdown-item v-if="isShowDetail" :command="beforeGoDetail(params.goodsId)">查看详情</el-dropdown-item>
<el-dropdown-item v-if="isShowAddFavorite" :command="beforeAddFavorite(params.goodsId, params.monitorId)">加入收藏</el-dropdown-item>
<el-dropdown-item v-if="isShowDelFavorite" :command="beforeDelFavorite(params.id)">取消收藏</el-dropdown-item>
<el-dropdown-item divided :command="beforeCopy(params.url)">商品采集</el-dropdown-item>
<el-dropdown-item divided :command="beforeGoWeb(params.url)">访问商品</el-dropdown-item>
<el-dropdown-item :command="beforeGoMal(params.mallId)">访问店铺</el-dropdown-item>
@@ -26,10 +28,12 @@
</template>
<script>
import AiCopyFromTemu from "./AiCopyFromTemu.vue";
import { Message } from 'element-ui'
export default {
name: "AiProductDropDown",
components: {AiCopyFromTemu},
props: ['params', 'isShowDetail'],
props: ['params', 'isShowDetail', 'isShowAddFavorite', 'isShowDelFavorite'],
data() {
return {
info: {},
@@ -52,6 +56,19 @@ export default {
this.temuParams = {url: 'https://www.temu.com/' + e.url}
}
this.copyFromDlgShow = true
} else if (e.type == 'addFavorite') {
this.$http.post('/api/monitorFavorite/add',{goodsId: e.goodsId, monitorId: e.monitorId}).then(res => {
if (res.code == 0) {
Message.success('收藏成功')
}
})
} else if (e.type == 'delFavorite') {
this.$http.post('/api/monitorFavorite/del?id=' + e.id).then(res => {
if (res.code == 0) {
Message.success('删除收藏成功')
this.$emit('onDelFavoriteSuccess')
}
})
} else if (e.type == 'goMall') {
window.open('https://www.temu.com/mall.html?mall_id=' + e.mallId, '_blank');
} else if (e.type == 'goWeb') {
@@ -65,6 +82,12 @@ export default {
beforeGoDetail(goodsId) {
return {type: 'detail', goodsId: goodsId}
},
beforeAddFavorite(goodsId, monitorId) {
return {type: 'addFavorite', goodsId: goodsId, monitorId: monitorId}
},
beforeDelFavorite(id) {
return {type: 'delFavorite', id: id}
},
beforeCopy(url) {
return {type: 'copy', url: url}
},

View File

@@ -2,7 +2,7 @@
"manifest_version": 3,
"name": "TEMU助手",
"description": "TEMU助手 - 自动化提高生产效率",
"version": "3.0.6",
"version": "3.0.7",
"background": {
"service_worker": "/background.js"
},

View File

@@ -51,16 +51,22 @@ const router = new VueRouter({
component: () => import('../view/shipping/WaitShippingList.vue')
},
{
path: 'returnPackage',
name: 'returnPackage',
component: () => import('../view/stock/ReturnPackage.vue')
},
{
path: 'returnDetail',
name: 'returnDetail',
component: () => import('../view/stock/ReturnDetail.vue')
},
{
path: 'copyProduct',
name: 'copyProduct',
component: () => import('../view/product/CopyProduct.vue')
},
{
path: 'reducePrice',
name: 'reducePrice',
component: () => import('../view/product/ReducePrice.vue')
},
{
path: 'niubiCopy',
@@ -77,6 +83,11 @@ const router = new VueRouter({
name: 'keywordTrack',
component: () => import('../view/selection/keywordtrack/Index.vue')
},
{
path: 'favoriteTrack',
name: 'favoriteTrack',
component: () => import('../view/selection/favoritetrack/Index.vue')
},
{
path: 'indexTrack',
name: 'indexTrack',

View File

@@ -1,4 +1,5 @@
export function timestampToTime(timestamp) {
if (!timestamp) return ''
// 时间戳为10位需*1000时间戳为13位不需乘1000
let date = new Date(timestamp);
let Y = date.getFullYear() + "-";

View File

@@ -177,9 +177,6 @@ import { Message } from 'element-ui'
skuIds: [],
jsonFields: {
"商品名称": "productName",
"店铺名称": "mallName",
"评分": "mark",
"是否热销": 'hotTag',
"SPU": "productId",
"SKC": "productSkcId",
"SKU ID": "productSkuId",
@@ -225,6 +222,9 @@ import { Message } from 'element-ui'
"非VMI备货单数 - 到货延迟": "notVmiOrderInfo.arrivalDelayNum",
"备货逻辑": "purchaseConfig",
"库存货值(CNY)": "productTotalPrice",
"店铺名称": "mallName",
"评分": "mark",
"是否热销": 'hotTag'
}
}
},

View File

@@ -67,6 +67,14 @@
</template>
<el-menu-item index="/copyProduct">商品复制</el-menu-item>
</el-submenu>
<el-submenu index="/stock">
<template slot="title">
<i class="el-icon-house"></i>
<span slot="title">库存管理</span>
</template>
<el-menu-item index="/returnPackage">退货包裹管理</el-menu-item>
<el-menu-item index="/returnDetail">退货明细</el-menu-item>
</el-submenu>
<el-submenu index="/niubiCopy">
<template slot="title">
<i class="el-icon-magic-stick"></i>
@@ -75,6 +83,7 @@
<el-menu-item index="/niubiCopy">商品采集</el-menu-item>
<el-menu-item index="/storeTrack">店铺跟踪</el-menu-item>
<el-menu-item index="/keywordTrack">关键字跟踪</el-menu-item>
<el-menu-item index="/favoriteTrack">我的收藏</el-menu-item>
<el-menu-item index="/indexTrack">首页商品跟踪</el-menu-item>
</el-submenu>

View File

@@ -82,6 +82,7 @@
this.getNoticeList()
this.getChangelog()
this.getMyNewestNotice()
this.checkBindWx()
},
methods: {
@@ -112,7 +113,21 @@
link.click()
document.body.removeChild(link)
},
checkBindWx() {
this.$http.post(`/api/malluser/bindWxCount`).then(res => {
if (res.code == 0) {
if (res.data == 0) {
this.$confirm('您尚未绑定微信消息推送,将不会收到消息通知,影响体验, 请前往绑定?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$router.push('message')
})
}
}
})
},
read () {
if (this.isImportant) {
this.$http.post('/api/notice/read').then(res => {

View File

@@ -1,395 +0,0 @@
<template>
<div>
<ai-list class="list">
<ai-title
slot="title"
title="商品模板"
tips="请先在当前浏览器登录“拼多多跨境卖家中心”,期间保持登录状态"
isShowBottomBorder>
</ai-title>
<template slot="content">
<div class="content">
<ai-search-bar>
<template #left>
<el-button type="button" :icon="'el-icon-delete'" :class="'el-button el-button--primary'" @click="remove()">删除</el-button>
<el-button v-if="$store.state.mallName" type="button" :class="'el-button el-button--primary'" @click="toAddTemplate()">添加商品模板</el-button>
<el-button v-if="$store.state.mallName" type="button" :class="'el-button el-button--primary'" @click="beforeAddToDraft">添加到草稿箱</el-button>
</template>
<template #right>
<el-button size="small" circle icon="el-icon-refresh-right" @click="getList()"></el-button>
</template>
</ai-search-bar>
<ai-table
:tableData="tableData"
:col-configs="colConfigs"
:total="total"
style="margin-top: 8px;"
:current.sync="search.current" :size.sync="search.size"
@selection-change="handleSelectionChange"
@getList="getList">
</ai-table>
</div>
</template>
</ai-list>
<el-dialog
title="商品列表"
:visible.sync="dlgShow"
:close-on-click-modal="false"
width="80%"
:before-close="handleClose">
<ai-list class="list">
<template slot="content">
<div class="content">
<ai-search-bar>
<template #left>
<div class="search-item">
<label style="width:90px">店铺</label>
<el-select v-model="productPage.mallId" @change="productTableData = [], productPage.total = 0, productPage.page =1, getProductList()" placeholder="请选择">
<el-option
v-for="item in $store.state.mallList"
:key="item.mallId"
:label="item.mallName"
:value="item.mallId">
</el-option>
</el-select>
</div>
<div class="search-item">
<label style="width:90px">SKC</label>
<el-input size="small" placeholder="请输入SKC多个用,隔开" v-model="productPage.productSkcIds" @keyup.enter.native="productPage.page =1, getProductList()"></el-input>
</div>
<div class="search-item">
<label style="width:90px">商品名称</label>
<el-input size="small" placeholder="请输入商品名称" v-model="productPage.productName" @keyup.enter.native="productPage.page =1, getProductList()"></el-input>
</div>
</template>
<template #right>
<el-button @click="productPage= {
page: 1,
pageSize: 10,
productName: '',
productSkcIds: ''
}, getProductList()">重置</el-button>
<el-button type="primary" @click="search.page =1, getProductList()">查询</el-button>
</template>
</ai-search-bar>
<ai-table
:tableData="productTableData"
:col-configs="productColConfigs"
:total="productPage.total"
:current.sync="productPage.page" :size.sync="productPage.pageSize"
style="margin-top: 8px;"
@selection-change="productHandleSelectionChange"
@getList="getProductList">
</ai-table>
</div>
</template>
</ai-list>
<span slot="footer" class="dialog-footer">
<el-button @click="dlgShow = false"> </el-button>
<el-button type="primary" @click="saveProduct">添加到模板</el-button>
</span>
</el-dialog>
<ai-dialog
title="请选择店铺"
:visible.sync="mallDlgShow"
:close-on-click-modal="false"
width="790px"
customFooter
@close="handleClose">
<el-form class="ai-form" :model="form" label-width="120px" ref="form">
<el-form-item label="店铺" style="width: 100%;" prop="targetMallId" :rules="[{ required: true, message: '请选择店铺', trigger: 'blur' }]">
<el-select style="width: 380px" v-model="form.targetMallId" placeholder="请选择">
<el-option
v-for="item in $store.state.mallList"
:key="item.mallId"
:label="item.mallName"
:value="item.mallId">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="商品分类" style="width: 100%;" prop="targetCatId" :rules="[{ required: true, message: '请选择商品分类', trigger: 'blur' }]">
<el-cascader style="width: 380px" v-model="form.targetCatId" :props="props"></el-cascader>
</el-form-item>
</el-form>
<div class="dialog-footer" slot="footer">
<el-button @click="mallDlgShow = false"> </el-button>
<el-button type="primary" @click="addToDraft">确定</el-button>
</div>
</ai-dialog>
</div>
</template>
<script>
import {sendChromeAPIMessage} from '@/api/chromeApi'
import {timestampToTime} from '@/utils/date'
import {transform} from '@/utils/product'
import { Message } from 'element-ui'
export default {
name: 'ReducePrice',
data () {
return {
search: {
current: 1,
size: 10,
productName: '',
mallName: '',
startDate: '',
endDate: ''
},
props: {
value: 'catId',
label: 'catName',
lazy: true,
lazyLoad (node, resolve) {
sendChromeAPIMessage({
url: 'bg-anniston-mms/category/children/list',
needMallId: true,
data: {
parentCatId: node.value || ''
}
}).then(res => {
if (res.errorCode === 1000000) {
resolve(res.result.categoryNodeVOS.map(v => {
return {
...v,
leaf: v.isLeaf
}
}))
}
})
}
},
colConfigs: [
{ type: "selection", width: '70px', align: 'left', fixed: 'left'},
{ prop: 'productSpu', label: 'SPU', align: 'left' },
{ prop: 'productName', label: '商品名称', align: 'left' },
{ prop: 'mallName', label: '来源店铺', align: 'left'},
{ prop: 'createTime', label: '添加时间', width: '180px', fixed: 'right'}
],
tableData: [],
total: 0,
ids: [],
dlgShow: false,
productTableData: [],
productPage: {page: 1, pageSize: 10, mallId: '', productName: '', productSkcIds: '', total: 0},
productColConfigs: [
{ type: "selection", width: '70px', align: 'left', fixed: 'left'},
{ prop: 'productSpu', label: 'SPU ID', align: 'left' },
{ prop: 'productSkc', label: 'SKC ID', align: 'left' },
{ prop: 'productName', label: '商品名称', align: 'left' },
{ prop: 'createTime', label: '创建时间', align: 'left' }
],
mallDlgShow: false,
productIds: [],
form: {
targetMallId: '',
targetCatId: []
}
}
},
created () {
this.getList()
if (this.$store.state.mallList.length > 0) {
this.productPage.mallId = this.$store.state.mallList[0].mallId
}
},
methods: {
getList () {
this.$http.post('/api/product/myPage',null,{
params: {
...this.search
}
}).then(res => {
this.tableData = res.data.records
this.total = res.data.total
})
},
remove () {
if (this.ids.length <= 0) {
alert('请选择要删除的商品');
return;
}
this.$confirm('确定要删除?', '温馨提示', {
type: 'warning'
}).then(() => {
this.$http.post('/api/product/delByIds',this.ids
).then(res => {
if (res.code == 0) {
this.$message.success('删除成功!')
this.getList()
}
})
})
},
handleSelectionChange(val) {
this.ids = [];
val.forEach(e => {
this.ids.push(e.id);
});
},
// 添加模板
handleClose() {
this.productTableData = []
this.productPage = {page: 1, pageSize: 10, total: 0}
this.dlgShow = false
},
toAddTemplate() {
this.$http.post('/api/malluser/info').then(res => {
if (res.code == 0) {
this.$store.commit('setUserInfo', res.data)
if (res.data.flag != 1) {
Message.error('您的账号未激活或已失效,请激活后使用')
this.$store.commit('setActiveDlgShow', true)
return;
}
this.dlgShow = true
this.getProductList()
}
})
},
getProductList() {
let params = {};
params.page = this.productPage.page;
params.pageSize = this.productPage.pageSize;
if (this.productPage.productName) {
params.productName = this.productPage.productName
}
if (this.productPage.productSkcIds) {
params.productSkcIds = this.productPage.productSkcIds.split(',')
}
sendChromeAPIMessage({
url: 'bg-visage-mms/product/skc/pageQuery',
needMallId: true,
mallId: this.productPage.mallId,
data: {
...params
}}).then((res) => {
if (res.errorCode == 1000000) {
this.productPage.total = res.result.total
this.productTableData = res.result.pageItems.map((item) => {
return {
productSpu: item.productId,
productSkc: item.productSkcId,
productName: item.productName,
createTime: timestampToTime(item.createdAt)
};
})
} else {
Message.error("【拼多多】" + res.errorMsg)
}
});
},
productHandleSelectionChange(val) {
this.productIds = [];
val.forEach(e => {
this.productIds.push(e.productSpu);
});
},
saveProduct() {
if (this.productIds.length <= 0) {
Message.error('请选择商品');
return;
}
this.productIds.map((productSpu, index) => {
setTimeout(() => {
sendChromeAPIMessage({
url: 'bg-visage-mms/product/query',
needMallId: true,
mallId: this.productPage.mallId,
data: {
productEditTaskUid: '',
productId: productSpu
}}).then((res) => {
if (res.errorCode == 1000000) {
let content = transform(res.result)
let mallInfo = this.$store.state.mallList.filter(item => {
return item.mallId == this.productPage.mallId
})
this.$http.post('/api/product/add', {
mallId: mallInfo[0].mallId,
mallName: mallInfo[0].mallName,
productSpu: res.result.productId,
productName: res.result.productName,
content: content
}).then(res1 => {
if (res1.code == 0) {
Message.success("商品【" + res.result.productName + "】成功添加为商品模板")
if (index == this.productIds.length - 1) {
this.getList()
}
}
})
}
})
}, 200 * index)
})
},
beforeAddToDraft() {
if (this.ids.length <= 0) {
Message.error('请选择商品模板');
return;
}
this.mallDlgShow = true
},
addToDraft() {
this.$refs.form.validate((valid) => {
if (valid) {
this.ids.map((id, index) => {
let product = this.tableData.filter((item) => {
return item.id == id
})
setTimeout(() => {
sendChromeAPIMessage({
url: 'bg-visage-mms/product/draft/add',
needMallId: true,
mallId: this.form.targetMallId,
data: {
catId: this.form.targetCatId[this.form.targetCatId.length - 1]
}}).then((res) => {
if (res.errorCode == 1000000) {
let draftId = res.result.productDraftId
let content = JSON.parse(product[0].content)
let i = 0
for (; i < this.form.targetCatId.length; i++) {
content['cat' + (i+1) + 'Id'] = this.form.targetCatId[i]
}
for (; i < 10; i++) {
content['cat' + (i+1) + 'Id'] = ''
}
content.productDraftId = draftId
sendChromeAPIMessage({
url: 'bg-visage-mms/product/draft/save',
needMallId: true,
mallId: this.form.targetMallId,
data: {
...content
}}).then((res) => {
if (res.errorCode == 1000000) {
Message.success("商品【" + product[0].productName + "】成功添加到草稿箱")
}
})
} else {
Message.error("【拼多多】" + res.errorMsg)
}
})
}, 1000*index)
})
this.mallDlgShow = false
}
})
}
}
}
</script>
<style scoped lang="scss">
</style>

View File

@@ -0,0 +1,42 @@
<template>
<div style="height: 100%;">
<transition name="fade-transform" mode="out-in">
<keep-alive :include="['Detail']">
<component ref="component" :is="component" @change="onChange" :params="params"></component>
</keep-alive>
</transition>
</div>
</template>
<script>
import Detail from './components/Detail.vue'
export default {
name: 'FavoriteTrack',
label: '我的跟踪收藏',
components: {
Detail
},
data () {
return {
component: 'Detail',
params: {}
}
},
methods: {
onChange (data) {
if (data.type === 'Detail') {
this.component = 'Detail'
this.params = data.params
}
}
}
}
</script>
<style lang="scss" scoped>
</style>

View File

@@ -0,0 +1,221 @@
<template>
<div>
<ai-list class="list">
<ai-title
slot="title"
title="收藏列表"
isShowBottomBorder>
</ai-title>
<template slot="content">
<ai-search-bar>
<template #left>
<label style="width:80px">排序方式</label>
<el-select v-model="search.orderBy" :clearable="true" @change="search.current =1, getList()" placeholder="请选择排序方式" size="small">
<el-option
v-for="item in orderBys"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
<label style="width:80px">价格区间</label>
<el-input :clearable="true" size="small" style="width: 80px" v-model="search.priceBegin" ></el-input>
~
<el-input :clearable="true" size="small" style="width: 80px" v-model="search.priceEnd" ></el-input>
<label style="width:80px">销量区间</label>
<el-input :clearable="true" size="small" style="width: 80px" v-model="search.saleBegin" ></el-input>
~
<el-input :clearable="true" size="small" style="width: 80px" v-model="search.saleEnd" ></el-input>
</template>
<template #right>
<el-button type="primary" @click="search.current =1, getList()">查询</el-button>
</template>
</ai-search-bar>
<div style="display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr; gap: 16px;">
<el-card v-for="item in tableData" :key="item.id" :body-style="{ padding: '0px', margin: '5px' }">
<el-image :src="item.imgUrl" class="image" :preview-src-list="[item.imgUrl]" />
<div style="padding: 14px;">
<div class="bottom clearfix">
<div style="margin-bottom: 5px;">
<div style="display: inline; margin-left: 5px;">${{ item.price }}<sub style="margin-left: 2px;" v-html="getPricePercent(item.priceChange)"></sub></div>
<div style="display: inline; margin-right: 5px; float: right;">{{ item.saleTotal }}<sub style="margin-left: 2px;" v-html="getSalePercent(item.saleChange)"></sub></div>
</div>
<div>
<div style="display: inline">日均销量: <span style="color: red; font-weight: bold">{{ item.averageSale }}</span></div>
<ai-product-drop-down :params="item" :isShowDetail="true" :isShowAddFavorite="false" :isShowDelFavorite="true"
@onDelFavoriteSuccess="deleteFavoriteSuccess()"
@onGoDetail="goDetail(item.goodsId, item.monitorId)"
style="float: right;"></ai-product-drop-down>
</div>
</div>
</div>
</el-card>
<el-pagination
layout="prev, pager, next"
style="position: absolute; bottom: 0px; right: 40px;"
:total="total"
:page-size.sync="search.size"
:current-page.sync="search.current"
@current-change="getList">
<div class="paginationPre-total"><label class="color-primary">{{ total }}</label>条记录
</div>
</el-pagination>
</div>
</template>
</ai-list>
<div class="productDetail">
<el-dialog
title="商品详情"
:visible="isShowDetailDlg"
:close-on-click-modal="false"
width="80%"
:before-close="handleClose">
<ai-product-detail v-if="isShowDetailDlg" :params="detailParams"/>
</el-dialog>
</div>
</div>
</template>
<script>
import AiProductDetail from "@/components/AiProductDetail.vue";
import AiProductDropDown from '@/components/AiProductDropDown.vue';
export default {
name: 'DetailPage',
props: ['params'],
components: {AiProductDetail, AiProductDropDown},
data () {
return {
monitorId: '',
search: {
current: 1,
type: '1',
size: 120,
orderBy: '',
priceBegin: '',
priceEnd: '',
saleBegin: '',
saleEnd: ''
},
orderBys: [{
value: '0',
label: '按销量涨辐排序'
},{
value: '1',
label: '按价格涨辐排序'
},{
value: '2',
label: '按销量排序'
},{
value: '3',
label: '按价格排序'
},{
value: '4',
label: '按日均销量排序'
}],
tableData: [],
total: 0,
isShowDetailDlg: false,
detailParams: {}
}
},
created () {
this.monitorId = this.params.id
this.getList()
},
methods: {
getList () {
this.$http.post('/api/monitorFavorite/myPage',null,{
params: {
...this.search
}
}).then(res => {
this.tableData = res.data.records
this.total = res.data.total
})
},
deleteFavoriteSuccess() {
this.getList()
},
cancel (isRefresh) {
this.$emit('change', {
type: 'List',
isRefresh: !!isRefresh
})
},
getPricePercent(data) {
if (data < 0) {
return '<div style="display: inline; color: green">↓' + data + '%</div>'
} else if (data > 0) {
return '<div style="display: inline; color: red">↑' + data + '%</div>'
}
return ''
},
getSalePercent(data) {
if (data < 0) {
return '<div style="display: inline; color: green">↓' + data + '%</div>'
} else if (data > 0) {
return '<div style="display: inline; color: red">↑' + data + '%</div>'
}
return ''
},
handleClose() {
this.isShowDetailDlg = false
},
goDetail (goodsId, monitorId) {
this.detailParams = {goodsId: goodsId, monitorId: monitorId}
this.isShowDetailDlg = true
}
}
}
</script>
<style scoped lang="scss">
.productDetail {
:deep(.el-dialog) {
height: 78vh;
overflow: auto;
}
}
.time {
font-size: 13px;
color: #999;
}
.bottom {
margin-top: 13px;
line-height: 12px;
}
.button {
padding: 0;
float: right;
}
.image {
width: 100%;
display: block;
}
.clearfix:before,
.clearfix:after {
display: table;
content: "";
}
.clearfix:after {
clear: both
}
.el-dropdown-link {
cursor: pointer;
color: #409EFF;
}
.el-icon-arrow-down {
font-size: 12px;
}
</style>

View File

@@ -38,14 +38,14 @@
</div>
<div style="display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr; gap: 16px;">
<el-card v-for="item in tableData" :key="item.id" :body-style="{ padding: '0px', margin: '5px' }">
<img :src="item.imgUrl" class="image">
<el-image :src="item.imgUrl" class="image" :preview-src-list="[item.imgUrl]" />
<div style="padding: 14px;">
<div class="bottom clearfix">
<div style="margin-bottom: 5px;">
<div style="display: inline; margin-left: 5px;">${{ item.price }}<sub style="margin-left: 2px;" v-html="getPricePercent(item.priceChange)"></sub></div>
<div style="display: inline; margin-right: 5px; float: right;">{{ item.saleTotal }}<sub style="margin-left: 2px;" v-html="getSalePercent(item.saleChange)"></sub></div>
</div>
<ai-product-drop-down :params="item" :isShowDetail="true" @onGoDetail="goDetail(item.goodsId, item.categoryId)" style="float: right;"></ai-product-drop-down>
<ai-product-drop-down :params="item" :isShowDetail="true" :isShowAddFavorite="false" :isShowDelFavorite="false" @onGoDetail="goDetail(item.goodsId, item.categoryId)" style="float: right;"></ai-product-drop-down>
</div>
</div>
</el-card>

View File

@@ -34,14 +34,17 @@
</ai-search-bar>
<div style="display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr; gap: 16px;">
<el-card v-for="item in tableData" :key="item.id" :body-style="{ padding: '0px', margin: '5px' }">
<img :src="item.imgUrl" class="image">
<el-image :src="item.imgUrl" class="image" :preview-src-list="[item.imgUrl]" />
<div style="padding: 14px;">
<div class="bottom clearfix">
<div style="margin-bottom: 5px;">
<div style="display: inline; margin-left: 5px;">${{ item.price }}<sub style="margin-left: 2px;" v-html="getPricePercent(item.priceChange)"></sub></div>
<div style="display: inline; margin-right: 5px; float: right;">{{ item.saleTotal }}<sub style="margin-left: 2px;" v-html="getSalePercent(item.saleChange)"></sub></div>
</div>
<ai-product-drop-down :params="item" :isShowDetail="true" @onGoDetail="goDetail(item.goodsId, item.monitorId)" style="float: right;"></ai-product-drop-down>
<div>
<div style="display: inline">日均销量: <span style="color: red; font-weight: bold">{{ item.averageSale }}</span></div>
<ai-product-drop-down :params="item" :isShowDetail="true" :isShowAddFavorite="true" :isShowDelFavorite="false" @onGoDetail="goDetail(item.goodsId, item.monitorId)" style="float: right;"></ai-product-drop-down>
</div>
</div>
</div>
</el-card>
@@ -105,6 +108,9 @@ import AiProductDropDown from '@/components/AiProductDropDown.vue';
},{
value: '3',
label: '按价格排序'
},{
value: '4',
label: '按日均销量排序'
}],
tableData: [],
total: 0,

View File

@@ -332,7 +332,7 @@ import { Message } from 'element-ui'
} else {
this.isLoading = false
}
if (res.indexOf("rawData") == -1) {
if (res.indexOf("window.rawData") == -1) {
Message.error("采集失败请检查https://www.temu.com是否能正常访问")
return
}

View File

@@ -38,14 +38,17 @@
</div>
<div style="display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr; gap: 16px;">
<el-card v-for="item in tableData" :key="item.id" :body-style="{ padding: '0px', margin: '5px' }">
<img :src="item.imgUrl" class="image">
<el-image :src="item.imgUrl" class="image" :preview-src-list="[item.imgUrl]" />
<div style="padding: 14px;">
<div class="bottom clearfix">
<div style="margin-bottom: 5px;">
<div style="display: inline; margin-left: 5px;">${{ item.price }}<sub style="margin-left: 2px;" v-html="getPricePercent(item.priceChange)"></sub></div>
<div style="display: inline; margin-right: 5px; float: right;">{{ item.saleTotal }}<sub style="margin-left: 2px;" v-html="getSalePercent(item.saleChange)"></sub></div>
</div>
<ai-product-drop-down :params="item" :isShowDetail="true" @onGoDetail="goDetail(item.goodsId, item.monitorId)" style="float: right;"></ai-product-drop-down>
<div>
<div style="display: inline">日均销量: <span style="color: red; font-weight: bold">{{ item.averageSale }}</span></div>
<ai-product-drop-down :params="item" :isShowDetail="true" :isShowAddFavorite="true" :isShowDelFavorite="false" @onGoDetail="goDetail(item.goodsId, item.monitorId)" style="float: right;"></ai-product-drop-down>
</div>
</div>
</div>
</el-card>
@@ -107,6 +110,9 @@ import AiProductDropDown from '@/components/AiProductDropDown.vue';
},{
value: '3',
label: '按价格排序'
},{
value: '4',
label: '按日均销量排序'
}],
tableData: [],
total: 0,

View File

@@ -346,7 +346,7 @@
},
activated () {
this.addressList = []
this.getAddressInfo();
this.toGetAddressInfo();
},
methods: {
@@ -370,25 +370,39 @@
console.log(err)
})
},
getAddressInfo() {
this.mallList.map(item => {
sendChromeAPIMessage({
url: 'bgSongbird-api/supplier/address/queryDeliveryAddressInfo',
needMallId: true,
mallId: item.mallId,
data: {}}).then((res) => {
if (res.errorCode == 1000000) {
let addressArr = res.result.deliveryAddressInfoList.filter(i => {
return i.isDefault
})
toGetAddressInfo() {
this.addressList = []
this.getAddressInfo(0)
},
getAddressInfo(index) {
if (!this.mallList) {
Message.error('获取默认发货地址失败,请刷新重试')
return
}
if (index == this.mallList.length) return
let mallInfo = this.mallList[index]
sendChromeAPIMessage({
url: 'bgSongbird-api/supplier/address/queryDeliveryAddressInfo',
needMallId: true,
mallId: mallInfo.mallId,
data: {}}).then((res) => {
if (res.errorCode == 1000000) {
let addressArr = res.result.deliveryAddressInfoList.filter(i => {
return i.isDefault
})
if (addressArr.length > 0) {
this.addressList.push({
mallId: item.mallId,
mallId: mallInfo.mallId,
addressId: addressArr[0].id
})
} else {
Message.error("店铺【" + mallInfo.name + "】未设置默认发货地址,将无法自动创建发货单")
}
})
this.getAddressInfo(index + 1)
} else {
this.getAddressInfo(index)
}
})
},
onConfirm () {
if (this.arr.length == 0) {

View File

@@ -235,7 +235,7 @@
...mapState(['mallList'])
},
created () {
this.getAddressInfo();
this.toGetAddressInfo();
},
methods: {
@@ -259,25 +259,39 @@
console.log(err)
})
},
getAddressInfo() {
this.mallList.map(item => {
sendChromeAPIMessage({
url: 'bgSongbird-api/supplier/address/queryDeliveryAddressInfo',
needMallId: true,
mallId: item.mallId,
data: {}}).then((res) => {
if (res.errorCode == 1000000) {
let addressArr = res.result.deliveryAddressInfoList.filter(i => {
return i.isDefault
})
toGetAddressInfo() {
this.addressList = []
this.getAddressInfo(0)
},
getAddressInfo(index) {
if (!this.mallList) {
Message.error('获取默认发货地址失败,请刷新重试')
return
}
if (index == this.mallList.length) return
let mallInfo = this.mallList[index]
sendChromeAPIMessage({
url: 'bgSongbird-api/supplier/address/queryDeliveryAddressInfo',
needMallId: true,
mallId: mallInfo.mallId,
data: {}}).then((res) => {
if (res.errorCode == 1000000) {
let addressArr = res.result.deliveryAddressInfoList.filter(i => {
return i.isDefault
})
if (addressArr.length > 0) {
this.addressList.push({
mallId: item.mallId,
mallId: mallInfo.mallId,
addressId: addressArr[0].id
})
} else {
Message.error("店铺【" + mallInfo.name + "】未设置默认发货地址,将无法自动创建发货单")
}
})
this.getAddressInfo(index + 1)
} else {
this.getAddressInfo(index)
}
})
},
onConfirm () {
if (this.arr.length == 0) {

View File

@@ -0,0 +1,277 @@
<template>
<ai-list class="list" v-loading="isLoading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading">
<ai-title
slot="title"
title="退货明细"
isShowBottomBorder>
<template #rightBtn>
<div class="title-right">
<div>
<label style="width:90px">店铺</label>
<el-select v-model="form.mallId" @change="beforeGetList" placeholder="请选择" size="small">
<el-option
v-for="item in $store.state.mallList"
:key="item.mallId"
:label="item.mallName"
:value="item.mallId">
</el-option>
</el-select>
</div>
</div>
</template>
</ai-title>
<template slot="content">
<div class="content">
<ai-search-bar>
<template #left>
<div class="search-item">
<label style="width:120px">出库时间</label>
<el-date-picker
v-model="form.date"
type="daterange"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</div>
</template>
<template #right>
<el-button type="primary" @click="toLoad">查询</el-button>
</template>
</ai-search-bar>
<ai-card title="数据明细" style="padding-bottom: 40px;">
<template #right>
<json-excel
:data="tableData"
:fields="jsonFields"
:before-generate = "startDownload"
name="退货明细.xls"
worksheet="退货明细">
<el-button type="primary">导出数据</el-button>
</json-excel>
</template>
<ai-table
:tableData="tableData"
:col-configs="colConfigs"
:total="total"
height="500"
style="margin-top: 8px;"
@getList="getList">
<el-table-column slot="productName" width="280px" label="商品信息" align="center">
<template slot-scope="scope">
<div class="product">
<img :src="scope.row.thumbUrl">
<div class="right">
<div>SKC: {{ scope.row.productSkcId }}</div>
<div>属性集: {{ scope.row.secondarySaleSpec }}</div>
</div>
</div>
</template>
</el-table-column>
</ai-table>
</ai-card>
</div>
</template>
</ai-list>
</template>
<script>
import {sendChromeAPIMessage} from '@/api/chromeApi'
import JsonExcel from 'vue-json-excel'
import {timestampToTime} from '@/utils/date'
import { Message } from 'element-ui'
export default {
name: 'ReturnDetail',
data () {
return {
isLoading: false,
colConfigs: [
{ prop: 'productSpuId', label: 'SPU', width: '120px', align: 'left', fixed: 'left' },
{ prop: 'productSkcId', label: 'SKC', width: '120px', align: 'left', fixed: 'left' },
{ prop: 'productSkuId', label: 'SKU', width: '120px', align: 'left', fixed: 'left' },
{ slot: 'productName', label: '商品信息' },
{ prop: 'purchaseSubOrderSn', label: '备货单号',width: '180px', align: 'left' },
{ prop: 'orderTypeDesc', label: '退货原因',width: '220px', align: 'left' },
{ prop: 'packageSn', label: '退货包裹号', width: '200px',align: 'left' },
{ prop: 'quantity', label: 'SKU件数',width: '100px', },
{ prop: 'outboundTime', label: '出库时间', width: '160px'}
],
jsonFields: {
"SPU": "productSpuId",
"SKC": "productSkcId",
"SKU": "productSkuId",
"图片地址": "thumbUrl",
"属性集": "secondarySaleSpec",
"备货单号": "purchaseSubOrderSn",
"退货原因": "orderTypeDesc",
"退货包裹号": "packageSn",
"SKU件数": "quantity",
"出库时间": "outboundTime"
},
form: {
mallId: '',
date: ''
},
currentPage: 1,
pageSize: 100,
tableData: [],
total: 0,
search: {
current: 1,
size: 10,
mallId: ''
}
}
},
computed: {
},
components: {
JsonExcel
},
created () {
},
methods: {
changeDataType() {
},
beforeGetList() {
this.$userCheck(this.form.mallId).then(() => {
}).catch((err) => {
this.form.mallId = ''
})
},
toLoad() {
if (!this.form.mallId) {
Message.error("请先选择店铺")
return
}
if (!this.form.date) {
Message.error("请选择时间范围")
return
}
this.currentPage = 1
this.tableData = []
let startTime = this.form.date[1].getTime() - 30 * 24 * 60 * 60 * 1000
if (startTime < this.form.date[0].getTime()) {
startTime = this.form.date[0].getTime()
}
this.getList(startTime, this.form.date[1].getTime() - 1)
},
getList (startTime, endTime) {
sendChromeAPIMessage({
url: 'dunland/api/gmp/returnSupplier/package/pageReturnPackageSkuDetailList',
needMallId: true,
mallId: this.form.mallId,
data: {
pageNo: this.currentPage,
pageSize: 100,
outboundTimeEnd: endTime,
outboundTimeStart: startTime
}}).then((res) => {
if (res.errorCode == 1000000) {
for(let i = 0;i < res.result.packageDetailDTOList.length; i++) {
let item = res.result.packageDetailDTOList[i];
let data = {};
data.productSpuId = item.productSpuId
data.productSkcId = item.productSkcId
data.productSkuId = item.productSkuId
data.secondarySaleSpec = item.secondarySaleSpec
data.thumbUrl = item.thumbUrl
data.purchaseSubOrderSn = item.purchaseSubOrderSn
data.orderTypeDesc = item.orderTypeDesc + '-' + item.reasonDesc.join(',') + ',备注:' + (item.remark ? item.remark: '--')
data.packageSn = item.packageSn
data.quantity = item.quantity
data.outboundTime = timestampToTime(item.outboundTime)
this.tableData.push(data)
}
if (100 == res.result.packageDetailDTOList.length) {
this.currentPage ++
setTimeout(() => {
this.getList(startTime, endTime)
}, 1500)
} else {
if (startTime > this.form.date[0].getTime()) {
let startTimeTemp = startTime - 30 * 24 * 60 * 60 * 1000
if (startTimeTemp < this.form.date[0].getTime()) {
startTimeTemp = this.form.date[0].getTime()
}
let endTimeTemp = endTime - 30 * 24 * 60 * 60 * 1000
this.currentPage = 1
this.getList(startTimeTemp, endTimeTemp)
} else {
this.isLoading = false
}
}
} else {
setTimeout(() => {
this.getList(startTime, endTime)
}, 1500)
}
}).catch(() => {
this.isLoading = false
})
},
startDownload() {
this.$http.post('/api/malluser/info').then(res => {
if (res.code == 0) {
this.$store.commit('setUserInfo', res.data)
if (res.data.flag != 1) {
Message.error('您的账号未激活或已失效,请激活后使用')
this.$store.commit('setActiveDlgShow', true)
return;
}
}
})
}
}
}
</script>
<style scoped lang="scss">
.product {
display: flex;
align-items: center;
justify-content: center;
.right {
flex: 1;
text-align: left;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
img {
width: 60px;
margin-right: 10px;
}
}
.list {
.title-right {
display: flex;
align-items: center;
& > div:first-child {
margin-right: 20px;
}
}
::v-deep.ai-list {
.ai-list__content--right-wrapper {
background: transparent;
box-shadow: none;
padding: 0!important;
}
}
}
</style>

View File

@@ -0,0 +1,252 @@
<template>
<ai-list class="list" v-loading="isLoading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading">
<ai-title
slot="title"
title="退货包裹管理"
isShowBottomBorder>
<template #rightBtn>
<div class="title-right">
<div>
<label style="width:90px">店铺</label>
<el-select v-model="form.mallId" @change="beforeGetList" placeholder="请选择" size="small">
<el-option
v-for="item in $store.state.mallList"
:key="item.mallId"
:label="item.mallName"
:value="item.mallId">
</el-option>
</el-select>
</div>
</div>
</template>
</ai-title>
<template slot="content">
<div class="content">
<ai-search-bar>
<template #left>
<div class="search-item">
<label style="width:120px">打包完成时间</label>
<el-date-picker
v-model="form.date"
type="daterange"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期">
</el-date-picker>
</div>
</template>
<template #right>
<el-button type="primary" @click="toLoad">查询</el-button>
</template>
</ai-search-bar>
<ai-card title="数据明细" style="padding-bottom: 40px;">
<template #right>
<json-excel
:data="tableData"
:fields="jsonFields"
:before-generate = "startDownload"
name="退货包裹.xls"
worksheet="退货包裹">
<el-button type="primary">导出数据</el-button>
</json-excel>
</template>
<ai-table
:tableData="tableData"
:col-configs="colConfigs"
:total="total"
height="500"
style="margin-top: 8px;"
@getList="getList">
</ai-table>
</ai-card>
</div>
</template>
</ai-list>
</template>
<script>
import {sendChromeAPIMessage} from '@/api/chromeApi'
import JsonExcel from 'vue-json-excel'
import {timestampToTime} from '@/utils/date'
import { Message } from 'element-ui'
export default {
name: 'ReturnPackage',
data () {
return {
isLoading: false,
colConfigs: [
{ prop: 'returnSupplierPackageNo', label: '退货包裹号', width: '220px', align: 'left', fixed: 'left' },
{ prop: 'expressDeLiverySn', label: '运单号', width: '160px', align: 'left', fixed: 'left' },
{ prop: 'returnSubWarehouseName', label: '退货子仓', width: '160px', align: 'left' },
{ prop: 'returnSubWarehouseAddress', label: '退货子仓地址',width: '250px', align: 'left' },
{ prop: 'contactName', label: '退货子仓联系人',width: '160px', align: 'left' },
{ prop: 'contactPhone', label: '手机号', width: '160px',align: 'left' },
{ prop: 'packageStatusDesc', label: '状态',width: '100px', },
{ prop: 'returnSupplierReasonDesc', label: '退货原因', width: '120px'},
{ prop: 'reason', label: '退货原因备注', width: '120px'},
{ prop: 'returnSupplierQuantity', label: '退货数量(件)', width: '120px'},
{ prop: 'returnHandOverTypeDesc', label: '退货方式', width: '100px'},
{ prop: 'payMethodDesc', label: '快递支付方式', width: '120px'},
{ prop: 'logisticsTypeDesc', label: '物流商', width: '100px'},
{ prop: 'packageFinishTime', label: '打包完成时间', width: '160px'},
{ prop: 'latestSelfTakeTime', label: '最晚自提时间', width: '160px'},
{ prop: 'outboundTime', label: '出库时间', width: '160px'}
],
jsonFields: {
"退货包裹号": "returnSupplierPackageNo",
"运单号": "expressDeLiverySn",
"退货子仓": "returnSubWarehouseName",
"退货子仓地址": "returnSubWarehouseAddress",
"退货子仓联系人": "contactName",
"手机号": "contactPhone",
"状态": "packageStatusDesc",
"退货原因": "returnSupplierReasonDesc",
"退货原因备注": "reason",
"退货数量(件)": "returnSupplierQuantity",
"退货方式": "returnHandOverTypeDesc",
"快递支付方式": "payMethodDesc",
"物流商": "logisticsTypeDesc",
"打包完成时间": "packageFinishTime",
"最晚自提时间": "latestSelfTakeTime",
"出库时间": "outboundTime"
},
form: {
mallId: '',
date: ''
},
currentPage: 1,
pageSize: 100,
tableData: [],
total: 0,
search: {
current: 1,
size: 10,
mallId: ''
}
}
},
computed: {
},
components: {
JsonExcel
},
created () {
},
methods: {
changeDataType() {
},
beforeGetList() {
this.$userCheck(this.form.mallId).then(() => {
}).catch((err) => {
this.form.mallId = ''
})
},
toLoad() {
if (!this.form.mallId) {
Message.error("请先选择店铺")
return
}
if (!this.form.date) {
Message.error("请选择时间范围")
return
}
this.currentPage = 1
this.tableData = []
this.getList()
},
getList () {
sendChromeAPIMessage({
url: 'dunland/api/gmp/returnSupplier/package/pageQueryReturnSupplierPackage',
needMallId: true,
mallId: this.form.mallId,
data: {
pageNo: this.currentPage,
pageSize: 100,
packageTimeEnd: this.form.date[1].getTime() - 1,
packageTimeStart: this.form.date[0].getTime()
}}).then((res) => {
if (res.errorCode == 1000000) {
for(let i = 0;i < res.result.items.length; i++) {
let item = res.result.items[i];
let data = {};
data.returnSupplierPackageNo = item.returnSupplierPackageNo
data.expressDeLiverySn = item.expressDeLiverySn
data.returnSubWarehouseName = item.returnSubWarehouseName
data.returnSubWarehouseAddress = item.returnSubWarehouseAddress
data.contactName = item.contactName
data.contactPhone = item.contactPhone
data.packageStatusDesc = item.packageStatusDesc
data.returnSupplierReasonDesc = JSON.parse(item.returnSupplierReasonDesc).join('')
data.reason = item.reason
data.returnSupplierQuantity = item.returnSupplierQuantity
data.returnHandOverTypeDesc = item.returnHandOverTypeDesc
data.payMethodDesc = item.payMethodDesc
data.logisticsTypeDesc = item.logisticsTypeDesc
data.packageFinishTime = timestampToTime(item.packageFinishTime)
data.latestSelfTakeTime = timestampToTime(item.latestSelfTakeTime)
data.outboundTime = timestampToTime(item.outboundTime)
this.tableData.push(data)
}
if (100 == res.result.items.length) {
this.currentPage ++
setTimeout(() => {
this.getList()
}, 1500)
} else {
this.isLoading = false
}
} else {
setTimeout(() => {
this.getList()
}, 1500)
}
}).catch(() => {
this.isLoading = false
})
},
startDownload() {
this.$http.post('/api/malluser/info').then(res => {
if (res.code == 0) {
this.$store.commit('setUserInfo', res.data)
if (res.data.flag != 1) {
Message.error('您的账号未激活或已失效,请激活后使用')
this.$store.commit('setActiveDlgShow', true)
return;
}
}
})
}
}
}
</script>
<style scoped lang="scss">
.list {
.title-right {
display: flex;
align-items: center;
& > div:first-child {
margin-right: 20px;
}
}
::v-deep.ai-list {
.ai-list__content--right-wrapper {
background: transparent;
box-shadow: none;
padding: 0!important;
}
}
}
</style>