调整
This commit is contained in:
24
public/rules_10.json
Normal file
24
public/rules_10.json
Normal file
@@ -0,0 +1,24 @@
|
||||
[
|
||||
{
|
||||
"id": 21,
|
||||
"priority": 1,
|
||||
"action": {
|
||||
"type": "modifyHeaders",
|
||||
"requestHeaders": [
|
||||
{
|
||||
"header": "Origin",
|
||||
"operation": "set",
|
||||
"value": "https://oms.goodcang.com/"
|
||||
},
|
||||
{
|
||||
"header": "Referer",
|
||||
"operation": "set",
|
||||
"value": "https://oms.goodcang.com/"
|
||||
}
|
||||
]
|
||||
},
|
||||
"condition": {
|
||||
"urlFilter": "||oms.goodcang.com"
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -138,3 +138,17 @@ export function sendAliexpressAPIMessage(message) {
|
||||
chrome.runtime.sendMessage(message, resolve)
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 向Chrome发送消息
|
||||
* @param message 消息
|
||||
*/
|
||||
export function sendGoodcangAPIMessage(message) {
|
||||
message.type = 'goodcangApi'
|
||||
if (!message.url.startsWith('http')) {
|
||||
message.url = "https://oms.goodcang.com/" + message.url;
|
||||
}
|
||||
return new Promise((resolve) => {
|
||||
chrome.runtime.sendMessage(message, resolve)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -186,6 +186,18 @@ chrome.runtime.onMessage.addListener((request, sender, sendResponse) => {
|
||||
resolve({success: false, errorCode: -1})
|
||||
});
|
||||
}).then(sendResponse);
|
||||
} else if (request.type == 'goodcangApi') {
|
||||
new Promise((resolve) => {
|
||||
let headers = {};
|
||||
headers['Content-Type'] = 'application/json';
|
||||
Promise.resolve().then(() => fetch(request.url, {
|
||||
'headers': headers, 'method': request.method, 'referrerPolicy': 'no-referrer', 'credentials': 'include', 'body': JSON.stringify(request.data), 'mode': 'cors'
|
||||
})).then((res) => {
|
||||
resolve(res.json());
|
||||
}).catch(() => {
|
||||
resolve({success: false, errorCode: -1})
|
||||
});
|
||||
}).then(sendResponse);
|
||||
} else if (request.type == 'notify') {
|
||||
chrome.notifications.create("" + Math.random(), {
|
||||
type: "basic", title: "TEMU助手", message: "您店铺【" + request.mallName + "】的商品【" + request.productName + "】成功加入发货台,请尽快处理", iconUrl: "./icons/48.png"
|
||||
|
||||
@@ -22,7 +22,8 @@
|
||||
"*://*.amazon.com/",
|
||||
"*://*.shein.com/",
|
||||
"*://*.geiwohuo.com/",
|
||||
"*://*.ltwebstatic.com/"
|
||||
"*://*.ltwebstatic.com/",
|
||||
"*://*.goodcang.com/"
|
||||
],
|
||||
"permissions": [
|
||||
"cookies",
|
||||
@@ -64,6 +65,10 @@
|
||||
"id": "9",
|
||||
"enabled": true,
|
||||
"path": "rules_9.json"
|
||||
},{
|
||||
"id": "10",
|
||||
"enabled": true,
|
||||
"path": "rules_10.json"
|
||||
}]
|
||||
},
|
||||
"content_scripts": [
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"manifest_version": 3,
|
||||
"name": "TEMU助手",
|
||||
"description": "TEMU助手 - 自动化提高生产效率",
|
||||
"version": "3.2.11",
|
||||
"version": "3.2.12",
|
||||
"background": {
|
||||
"service_worker": "/background.js"
|
||||
},
|
||||
|
||||
@@ -252,6 +252,16 @@ const router = new VueRouter({
|
||||
name: 'returnRecordShein',
|
||||
component: () => import('../view/shein/ReturnRecordShein.vue')
|
||||
},
|
||||
{
|
||||
path: 'labelInfoShein',
|
||||
name: 'labelInfoShein',
|
||||
component: () => import('../view/shein/LabelInfoShein.vue')
|
||||
},
|
||||
{
|
||||
path: 'purchaseOrderListShein',
|
||||
name: 'purchaseOrderListShein',
|
||||
component: () => import('../view/shein/PurchaseOrderListShein.vue')
|
||||
},
|
||||
|
||||
// {
|
||||
// path: 'statistics',
|
||||
|
||||
@@ -149,6 +149,12 @@
|
||||
<el-menu-item index="/copyProductShein">商品复制</el-menu-item>
|
||||
<el-menu-item index="/orderListShein">发货订单</el-menu-item>
|
||||
<el-menu-item index="/returnRecordShein">退货与报废单列表</el-menu-item>
|
||||
<el-menu-item v-if="$store.state.userInfo.phone == '18571466720' || $store.state.userInfo.phone == '17607119772'" index="/labelInfoShein">
|
||||
标签管理
|
||||
</el-menu-item>
|
||||
<el-menu-item v-if="$store.state.userInfo.phone == '18571466720' || $store.state.userInfo.phone == '17607119772'" index="/purchaseOrderListShein">
|
||||
发货单列表
|
||||
</el-menu-item>
|
||||
<el-menu-item index="/saleStatShein">商家账单统计</el-menu-item>
|
||||
</el-submenu>
|
||||
<el-menu-item index="/info">
|
||||
@@ -216,7 +222,7 @@
|
||||
<script>
|
||||
import {mapMutations, mapState} from 'vuex'
|
||||
import AiPayment from "@/components/AiPayment.vue";
|
||||
import {sendAliexpressAPIMessage, sendTemuSellerAgentMessage} from "@/api/chromeApi";
|
||||
import {sendAliexpressAPIMessage, sendTemuSellerAgentMessage, sendGoodcangAPIMessage} from "@/api/chromeApi";
|
||||
|
||||
export default {
|
||||
components: {AiPayment},
|
||||
@@ -264,7 +270,7 @@ export default {
|
||||
const prodVersion = require('../manifest.production.json').version
|
||||
this.version = process.env.NODE_ENV === 'production' ? prodVersion : devVersion
|
||||
this.activePath = this.$route.fullPath
|
||||
//this.getAfterSalesList()
|
||||
// this.testGoodcang()
|
||||
},
|
||||
|
||||
methods: {
|
||||
@@ -371,6 +377,19 @@ export default {
|
||||
}).then(res => {
|
||||
//console.log(res)
|
||||
})
|
||||
},
|
||||
testGoodcang() {
|
||||
sendGoodcangAPIMessage({
|
||||
url: "/api/v1/product/list",
|
||||
method: 'POST',
|
||||
data: {
|
||||
"page_index": 1,
|
||||
"page_size": 20,
|
||||
"product_status": 1
|
||||
}
|
||||
}).then(res => {
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
318
src/view/shein/LabelInfoShein.vue
Normal file
318
src/view/shein/LabelInfoShein.vue
Normal file
@@ -0,0 +1,318 @@
|
||||
<template>
|
||||
<ai-list class="list" v-loading="isLoading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading">
|
||||
<ai-title
|
||||
slot="title"
|
||||
title="希音标签信息"
|
||||
isShowBottomBorder>
|
||||
</ai-title>
|
||||
<template slot="content">
|
||||
<ai-search-bar>
|
||||
<template #left>
|
||||
<div class="search-item">
|
||||
<el-checkbox v-model="search.unSet">只显示未填写</el-checkbox>
|
||||
</div>
|
||||
<div class="search-item">
|
||||
<label>SKC ID:</label>
|
||||
<el-input size="small" clearable placeholder="请输入SKC ID" v-model="search.skc"></el-input>
|
||||
</div>
|
||||
</template>
|
||||
<template #right>
|
||||
<!--<el-button type="primary" @click="toLoad">加载</el-button>-->
|
||||
</template>
|
||||
</ai-search-bar>
|
||||
<ai-card title="SKC明细" style="padding-bottom: 40px;">
|
||||
<template #right>
|
||||
<el-button type="primary" @click="exportToExcel">导出</el-button>
|
||||
<el-button type="primary" @click="toUpload">导入</el-button>
|
||||
</template>
|
||||
<ai-table
|
||||
:isShowPagination="false"
|
||||
:tableData="filteredData"
|
||||
:col-configs="colConfigs"
|
||||
height="600"
|
||||
style="margin-top: 8px;"
|
||||
@getList="() => {}">
|
||||
<el-table-column slot="options" label="操作" width="80px" show-overflow-tooltip align="center" fixed="right">
|
||||
<template slot-scope="{ row }">
|
||||
<el-button
|
||||
size="small"
|
||||
type="success"
|
||||
icon="el-icon-circle-check"
|
||||
@click="edit(row)"
|
||||
></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
</ai-card>
|
||||
|
||||
<AiDialog
|
||||
title="标签信息导入"
|
||||
:visible.sync="sheinLabelDlgShow"
|
||||
:close-on-click-modal="false"
|
||||
customFooter
|
||||
width="1290px">
|
||||
<el-form :model="sheinLabelForm" ref="sheinLabelForm" label-width="180px" class="form">
|
||||
<el-form-item label="上传excel" prop="file" :rules="[{ required: true, message: '请上传文件', trigger: 'blur' }]" style="width: 100%;">
|
||||
<ai-uploader isImport v-model="sheinLabelForm.file" fileType="file" :limit="1"
|
||||
acceptType=".xlsx," :clearable="false">
|
||||
<template #trigger>
|
||||
<el-button icon="iconfont iconfangda">选择文件</el-button>
|
||||
</template>
|
||||
<template #tips>最多上传1个文件,单个文件最大10MB,仅支持Excel格式</template>
|
||||
</ai-uploader>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="sheinLabelDlgShow = false">关 闭</el-button>
|
||||
<el-button type="primary" @click="importConfirm">确 定</el-button>
|
||||
</span>
|
||||
</AiDialog>
|
||||
</template>
|
||||
</ai-list>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {sendGeiwohuoAPIMessage} from '@/api/chromeApi'
|
||||
import { Message } from 'element-ui'
|
||||
import * as XLSX from 'xlsx'
|
||||
import { saveAs } from 'file-saver'
|
||||
|
||||
export default {
|
||||
name: 'LabelInfoShein',
|
||||
|
||||
data () {
|
||||
return {
|
||||
isLoading: false,
|
||||
list: [],
|
||||
mallId: '',
|
||||
colConfigs: [
|
||||
{ prop: 'skc', label: 'SKC ID', align: 'left' },
|
||||
{ prop: 'supplierCode', label: 'SKC货号', align: 'left' },
|
||||
{ prop: 'model', label: '型号', align: 'left' },
|
||||
{ prop: 'ratedVoltage', label: '额定电压', align: 'left' },
|
||||
{ prop: 'ratedCurrent', label: '额定电流', align: 'left' },
|
||||
{ prop: 'productDate', label: '生产日期', align: 'left' },
|
||||
{ prop: 'warranty', label: '保质期', align: 'left' },
|
||||
{ prop: 'templateName', label: '模板名称', align: 'left' }
|
||||
],
|
||||
search: {
|
||||
unSet: false,
|
||||
skc: ''
|
||||
},
|
||||
|
||||
tableData: [],
|
||||
currentPage: 1,
|
||||
|
||||
sheinLabelList: [],
|
||||
|
||||
sheinLabelDlgShow: false,
|
||||
sheinLabelForm: {
|
||||
file: null
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
filteredData() {
|
||||
const filteredData = this.list.filter(item => {
|
||||
let flag1 = true, flag2 = true
|
||||
if (this.search.unSet) {
|
||||
if (item.templateName) flag1 = false
|
||||
}
|
||||
if (this.search.skc) {
|
||||
if (!item.skc.toLowerCase().includes(this.search.skc.toLowerCase())) {
|
||||
flag2 = false
|
||||
}
|
||||
}
|
||||
|
||||
return flag1 && flag2
|
||||
})
|
||||
|
||||
return filteredData
|
||||
}
|
||||
},
|
||||
|
||||
mounted () {
|
||||
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.getUserInfo()
|
||||
this.isLoading = true
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
async getUserInfo() {
|
||||
let res = await sendGeiwohuoAPIMessage({
|
||||
url: 'sso-prefix/auth/getUser?uuid=' + Date.now(),
|
||||
method: 'GET'
|
||||
})
|
||||
if (res.code == '0' && res.msg == "OK") {
|
||||
this.mallId = res.info.merchantCode
|
||||
} else if (res.code == 100004 || res.code == 20302) {
|
||||
this.isLoading = false
|
||||
this.$store.commit("setSheinAlertShow", true)
|
||||
}
|
||||
},
|
||||
async getList () {
|
||||
let res = await sendGeiwohuoAPIMessage({
|
||||
url: `spmp-api-prefix/spmp/product/list?page_num=${this.currentPage}&page_size=100`,
|
||||
method: 'POST',
|
||||
data: {
|
||||
language: "zh-cn",
|
||||
search_abandon_product: false,
|
||||
sort_type: 1
|
||||
}})
|
||||
if (res.code == '0') {
|
||||
for(let i = 0;i < res.info.data.length; i++) {
|
||||
let item = res.info.data[i];
|
||||
let data = {}
|
||||
|
||||
for (let j = 0; j < item.skc_info_list.length; j++) {
|
||||
let skc = item.skc_info_list[j]
|
||||
data = {skc: skc.skc_name,
|
||||
supplierCode: skc.supplier_code,
|
||||
model: null,
|
||||
ratedVoltage: null,
|
||||
ratedCurrent: null,
|
||||
productDate: null,
|
||||
warranty: null,
|
||||
templateName: null
|
||||
}
|
||||
|
||||
this.list.push(data)
|
||||
}
|
||||
}
|
||||
if (res.info.data.length == 100 && (res.meta.count > 100*this.currentPage)) {
|
||||
this.currentPage++
|
||||
await this.sleepSync(200)
|
||||
await this.getList()
|
||||
} else {
|
||||
this.getSkcLabelInfoList()
|
||||
}
|
||||
} else if (res.code == 100004 || res.code == 20302) {
|
||||
this.isLoading = false
|
||||
this.$store.commit("setSheinAlertShow", true)
|
||||
}
|
||||
},
|
||||
sleepSync(milliseconds) {
|
||||
return new Promise(resolve => setTimeout(resolve, milliseconds));
|
||||
},
|
||||
getSkcLabelInfoList() {
|
||||
this.$http.post(`/api/sheinLabel/listAll`, null, {
|
||||
params: {
|
||||
mallId: this.mallId
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.sheinLabelList = res.data
|
||||
for (let i = 0; i < this.sheinLabelList.length; i++) {
|
||||
for (let j = 0; j < this.list.length; j++) {
|
||||
if (this.sheinLabelList[i].skc == this.list[j].skc) {
|
||||
this.list[j].model = this.sheinLabelList[i].model
|
||||
this.list[j].ratedVoltage = this.sheinLabelList[i].ratedVoltage
|
||||
this.list[j].ratedCurrent = this.sheinLabelList[i].ratedCurrent
|
||||
this.list[j].productDate = this.sheinLabelList[i].productDate
|
||||
this.list[j].warranty = this.sheinLabelList[i].warranty
|
||||
this.list[j].templateName = this.sheinLabelList[i].templateName
|
||||
}
|
||||
}
|
||||
}
|
||||
this.isLoading = false
|
||||
}
|
||||
})
|
||||
},
|
||||
handleSave(row) {
|
||||
this.$http.post(`/api/sheinLabel/addOrUpdate`, [{
|
||||
mallId: this.mallId,
|
||||
costPrice: row.editValue,
|
||||
skc: row.skc,
|
||||
sku: row.sku
|
||||
}]).then((res) => {
|
||||
if (res.code == 0) {
|
||||
row.edit = false
|
||||
row.costPrice = row.editValue
|
||||
row.profitPercent = Math.round((row.price - row.costPrice) / row.price * 10000) / 100
|
||||
Message.success("修改成功")
|
||||
}
|
||||
})
|
||||
},
|
||||
toUpload() {
|
||||
this.sheinLabelDlgShow = true
|
||||
},
|
||||
importConfirm() {
|
||||
this.$refs.sheinLabelForm.validate((valid) => {
|
||||
const data = new FormData()
|
||||
data.append('file', this.sheinLabelForm.file[0].raw);
|
||||
this.$http.post(`/api/sheinLabel/import`, data).then(res => {
|
||||
if (res.code === 0) {
|
||||
this.sheinLabelDlgShow = false
|
||||
this.$message.success('导入成功')
|
||||
this.currentPage = 1
|
||||
this.list = []
|
||||
this.isLoading = true
|
||||
this.getList()
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
exportToExcel() {
|
||||
// 假设你有一个表格数据的数组
|
||||
const data = [
|
||||
["店铺ID", "SKC ID", "SKC货号", "型号", "额定电压", "额定电流", "生产日期", "保质期", "模板名称"]
|
||||
]
|
||||
|
||||
this.filteredData.map(item => {
|
||||
data.push([this.mallId, item.skc, item.supplierCode, item.model, item.ratedVoltage, item.ratedCurrent, item.productDate, item.warranty, item.templateName])
|
||||
})
|
||||
|
||||
// 将数据转换为工作表
|
||||
const worksheet = XLSX.utils.aoa_to_sheet(data);
|
||||
|
||||
// 创建工作簿并添加工作表
|
||||
const workbook = XLSX.utils.book_new();
|
||||
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
||||
|
||||
// 生成Excel文件
|
||||
const excelBuffer = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
|
||||
|
||||
// 使用blob和FileReader创建一个Blob URL
|
||||
const dataBlob = new Blob([excelBuffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8' });
|
||||
const blobUrl = window.URL.createObjectURL(dataBlob);
|
||||
|
||||
// 使用saveAs下载文件
|
||||
saveAs(dataBlob, 'SKC标签信息列表.xlsx');
|
||||
|
||||
// 清理
|
||||
window.URL.revokeObjectURL(blobUrl);
|
||||
}
|
||||
}
|
||||
}
|
||||
</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>
|
||||
255
src/view/shein/PurchaseOrderListShein.vue
Normal file
255
src/view/shein/PurchaseOrderListShein.vue
Normal file
@@ -0,0 +1,255 @@
|
||||
<template>
|
||||
<ai-list class="list" v-loading="isLoading" element-loading-text="拼命加载中" element-loading-spinner="el-icon-loading">
|
||||
<ai-title
|
||||
slot="title"
|
||||
title="发货单列表"
|
||||
isShowBottomBorder>
|
||||
</ai-title>
|
||||
<template slot="content">
|
||||
<ai-card title="发货单列表" style="padding-bottom: 40px;">
|
||||
<ai-table
|
||||
:isShowPagination="false"
|
||||
:tableData="orderList"
|
||||
:col-configs="colConfigs"
|
||||
height="700"
|
||||
style="margin-top: 8px;"
|
||||
@getList="() => {}">
|
||||
<el-table-column slot="options" label="操作" width="120px" show-overflow-tooltip align="center" fixed="right">
|
||||
<template slot-scope="{ row }">
|
||||
<div class="table-options">
|
||||
<el-button type="text" @click="downloadLabelInfo(row)">下载标签信息</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</ai-table>
|
||||
</ai-card>
|
||||
</template>
|
||||
</ai-list>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {sendGeiwohuoAPIMessage} from '@/api/chromeApi'
|
||||
import { Message } from 'element-ui'
|
||||
import * as XLSX from 'xlsx'
|
||||
import { saveAs } from 'file-saver'
|
||||
|
||||
export default {
|
||||
name: 'ReturnRecordShein',
|
||||
|
||||
data () {
|
||||
return {
|
||||
isLoading: false,
|
||||
storeCode: '',
|
||||
colConfigs: [
|
||||
{ prop: 'sellerDeliveryNo', label: '发货单号', align: 'left' },
|
||||
{ prop: 'orderTypeName', label: '类型', align: 'left' },
|
||||
{ prop: 'deliveryAmountAll', label: '送货总数', align: 'left' },
|
||||
{ prop: 'expressName', label: '物流公司名称', align: 'left' },
|
||||
{ prop: 'takeParcelStatusName', label: '状态' },
|
||||
{ prop: 'deliveryTime', label: '发货时间' }
|
||||
],
|
||||
reqData: {
|
||||
"page": 1,
|
||||
"billStatusList": [],
|
||||
"deliveryTimeEnd": null,
|
||||
"deliveryTimeStart": null,
|
||||
"deliveryTypeList": [],
|
||||
"exportIds": [],
|
||||
"expressCodeList": [],
|
||||
"expressStatusList": [],
|
||||
"orderTypeList": [],
|
||||
"sellerDeliveryNoList": [],
|
||||
"sellerOrderNoList": [],
|
||||
"perPage": 10
|
||||
},
|
||||
labelInfoList: [],
|
||||
orderList: [],
|
||||
sellerDeliveryNo: null
|
||||
}
|
||||
},
|
||||
|
||||
mounted () {
|
||||
this.getStoreCode()
|
||||
this.getList()
|
||||
},
|
||||
|
||||
methods: {
|
||||
async getList () {
|
||||
this.isLoading = true
|
||||
this.reqData.page = 1
|
||||
this.tableData = []
|
||||
this.orderList = []
|
||||
await this.getOrderList()
|
||||
this.isLoading = false
|
||||
},
|
||||
async getOrderList() {
|
||||
|
||||
let res = await sendGeiwohuoAPIMessage({
|
||||
url: `pfmp/delivery/list`,
|
||||
method: 'POST',
|
||||
data: this.reqData})
|
||||
if (res.code == '0') {
|
||||
for(let i = 0;i < res.info.data.length; i++) {
|
||||
let item = res.info.data[i];
|
||||
let data = {
|
||||
id: item.id,
|
||||
sellerDeliveryNo: item.sellerDeliveryNo,
|
||||
orderTypeName: item.orderTypeName,
|
||||
deliveryAmountAll: item.deliveryAmountAll,
|
||||
expressName: item.expressName,
|
||||
takeParcelStatusName: item.takeParcelStatusName,
|
||||
deliveryTime: item.deliveryTime
|
||||
}
|
||||
this.orderList.push(data)
|
||||
}
|
||||
} else if (res.code == 100004 || res.code == 20302) {
|
||||
this.$store.commit("setSheinAlertShow", true)
|
||||
}
|
||||
},
|
||||
async getStoreCode() {
|
||||
let res = await sendGeiwohuoAPIMessage({
|
||||
url: 'sso-prefix/auth/getUser?uuid=' + Date.now(),
|
||||
method: 'GET'
|
||||
})
|
||||
if (res.code == '0' && res.msg == "OK") {
|
||||
this.storeCode = res.info.merchantCode
|
||||
this.getSheinLabelList()
|
||||
} else if (res.code == 100004 || res.code == 20302) {
|
||||
this.isLoading = false
|
||||
this.$store.commit("setSheinAlertShow", true)
|
||||
}
|
||||
},
|
||||
getSheinLabelList() {
|
||||
this.$http.post(`/api/sheinLabel/listAll`, null, {
|
||||
params: {
|
||||
mallId: this.storeCode
|
||||
}
|
||||
}).then(res => {
|
||||
if (res.code == 0) {
|
||||
this.labelInfoList = res.data
|
||||
}
|
||||
})
|
||||
},
|
||||
async downloadLabelInfo(row) {
|
||||
this.sellerDeliveryNo = row.sellerDeliveryNo
|
||||
let res = await sendGeiwohuoAPIMessage({
|
||||
url: `pfmp/delivery/detail?id=${row.id}`,
|
||||
method: 'GET'
|
||||
})
|
||||
if (res.code == '0' && res.msg == "OK") {
|
||||
let params = []
|
||||
for(let i = 0;i < res.info.orderList.length; i++) {
|
||||
let item = res.info.orderList[i]
|
||||
|
||||
for (let j = 0; j < item.detail.length; j++) {
|
||||
params.push({
|
||||
orderNo: item.sellerOrderNo,
|
||||
printNumber: item.detail[j].orderQuantity,
|
||||
skuCode: item.detail[j].skuCode,
|
||||
supplierId: res.info.sellerId,
|
||||
supplierCode: item.supplierCode,
|
||||
subSuffixZh: item.detail[j].subSuffixZh,
|
||||
skc: item.skcName
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
let reqParams = []
|
||||
params.map(item => {
|
||||
reqParams.push({
|
||||
orderNo: item.orderNo,
|
||||
printNumber: item.printNumber,
|
||||
skuCode: item.skuCode,
|
||||
supplierId: item.supplierId
|
||||
})
|
||||
})
|
||||
|
||||
let res1 = await sendGeiwohuoAPIMessage({
|
||||
url: `pfmp/order/printOrderBarCode`,
|
||||
method: 'POST',
|
||||
data: {
|
||||
printList: reqParams,
|
||||
type: 3
|
||||
}
|
||||
})
|
||||
|
||||
if (res1.code == '0' && res1.msg == "OK") {
|
||||
let successList = res1.info.sucessList
|
||||
for (let i = 0; i < successList.length; i++) {
|
||||
for (let j = 0; j < params.length; j++) {
|
||||
if (successList[i].skuCode == params[j].skuCode) {
|
||||
successList[i].skc = params[j].skc
|
||||
successList[i].printNumber = params[j].printNumber
|
||||
successList[i].subSuffixZh = params[j].subSuffixZh
|
||||
successList[i].supplierCode = params[j].supplierCode
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
const data = [
|
||||
["文件名", "数量", "SKC", "SKU", "型号", "额定电压", "额定电流", "生产日期", "保质期", "SKC货号", "产品编码", "订单号", "属性集", "模板名称"]
|
||||
]
|
||||
for (let i = 0; i < successList.length; i++) {
|
||||
for (let j = 0; j < this.labelInfoList.length; j++) {
|
||||
if (successList[i].skc == this.labelInfoList[j].skc) {
|
||||
successList[i].model = this.labelInfoList[j].model
|
||||
successList[i].ratedVoltage = this.labelInfoList[j].ratedVoltage
|
||||
successList[i].ratedCurrent = this.labelInfoList[j].ratedCurrent
|
||||
successList[i].productDate = this.labelInfoList[j].productDate
|
||||
successList[i].warranty = this.labelInfoList[j].warranty
|
||||
successList[i].templateName = this.labelInfoList[j].templateName
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
successList.map(item => {
|
||||
data.push([item.skc+"_"+item.orderNo+"_"+item.skuCode, item.printNumber, item.skc, item.skuCode, item.model, item.ratedVoltage, item.ratedCurrent, item.productDate, item.warranty, item.supplierCode, item.barcode, item.orderNo, item.subSuffixZh, item.templateName])
|
||||
})
|
||||
|
||||
// 将数据转换为工作表
|
||||
const worksheet = XLSX.utils.aoa_to_sheet(data);
|
||||
|
||||
// 创建工作簿并添加工作表
|
||||
const workbook = XLSX.utils.book_new();
|
||||
XLSX.utils.book_append_sheet(workbook, worksheet, 'Sheet1');
|
||||
|
||||
// 生成Excel文件
|
||||
const excelBuffer = XLSX.write(workbook, { bookType: 'xlsx', type: 'array' });
|
||||
|
||||
// 使用blob和FileReader创建一个Blob URL
|
||||
const dataBlob = new Blob([excelBuffer], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;charset=UTF-8' });
|
||||
const blobUrl = window.URL.createObjectURL(dataBlob);
|
||||
|
||||
// 使用saveAs下载文件
|
||||
saveAs(dataBlob, this.sellerDeliveryNo + '.xlsx');
|
||||
|
||||
// 清理
|
||||
window.URL.revokeObjectURL(blobUrl);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</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>
|
||||
@@ -537,8 +537,9 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
getList (data, mallId, mallName, currentPage) {
|
||||
sendChromeAPIMessage({
|
||||
async getList (data, mallId, mallName, currentPage) {
|
||||
await this.sleepSync(300 + Math.floor(Math.random() * 100))
|
||||
let res = await sendChromeAPIMessage({
|
||||
url: 'oms/bg/venom/api/supplier/purchase/manager/querySubOrderList',
|
||||
needMallId: true,
|
||||
mallId: mallId,
|
||||
@@ -552,56 +553,55 @@
|
||||
],
|
||||
productSkcIdList: this.skc? this.skc.split(','): null,
|
||||
subPurchaseOrderSnList: this.searchSns? this.searchSns.split(','): null
|
||||
}}).then((res) => {
|
||||
if (res.errorCode == 1000000) {
|
||||
let length = res.result.subOrderForSupplierList.length
|
||||
res.result.subOrderForSupplierList = res.result.subOrderForSupplierList.filter((item) => {
|
||||
return item.isCanJoinDeliverPlatform;
|
||||
})
|
||||
res.result.subOrderForSupplierList.map((item) => {
|
||||
let temp = data.filter(i => {
|
||||
return i.subPurchaseOrderSn == item.subPurchaseOrderSn
|
||||
})
|
||||
if (temp.length == 0) {
|
||||
data.push({
|
||||
robTotal: 0,
|
||||
subPurchaseOrderSn: item.subPurchaseOrderSn,
|
||||
originalPurchaseOrderSn: item.originalPurchaseOrderSn,
|
||||
productName: item.productName,
|
||||
productSn: item.productSn,
|
||||
productSkcId: item.productSkcId,
|
||||
productSkcPicture: item.productSkcPicture,
|
||||
status: item.status,
|
||||
detailList: item.skuQuantityDetailList,
|
||||
category: item.category,
|
||||
mallId: mallId,
|
||||
mallName: mallName
|
||||
})
|
||||
}
|
||||
}})
|
||||
if (res.errorCode == 1000000) {
|
||||
let length = res.result.subOrderForSupplierList.length
|
||||
res.result.subOrderForSupplierList = res.result.subOrderForSupplierList.filter((item) => {
|
||||
return item.isCanJoinDeliverPlatform;
|
||||
})
|
||||
res.result.subOrderForSupplierList.map((item) => {
|
||||
let temp = data.filter(i => {
|
||||
return i.subPurchaseOrderSn == item.subPurchaseOrderSn
|
||||
})
|
||||
if (temp.length == 0) {
|
||||
data.push({
|
||||
robTotal: 0,
|
||||
subPurchaseOrderSn: item.subPurchaseOrderSn,
|
||||
originalPurchaseOrderSn: item.originalPurchaseOrderSn,
|
||||
productName: item.productName,
|
||||
productSn: item.productSn,
|
||||
productSkcId: item.productSkcId,
|
||||
productSkcPicture: item.productSkcPicture,
|
||||
status: item.status,
|
||||
detailList: item.skuQuantityDetailList,
|
||||
category: item.category,
|
||||
mallId: mallId,
|
||||
mallName: mallName
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
if (this.pageSize == length) {
|
||||
currentPage ++
|
||||
this.getList(data, mallId, mallName, currentPage)
|
||||
if (this.pageSize == length) {
|
||||
currentPage ++
|
||||
this.getList(data, mallId, mallName, currentPage)
|
||||
} else {
|
||||
if (this.loadMode == 1) {
|
||||
this.loadMallIndex ++
|
||||
if (this.loadMallIndex < this.mallList.length) {
|
||||
this.getList(data, this.mallList[this.loadMallIndex].mallId, this.mallList[this.loadMallIndex].mallName, 1)
|
||||
} else {
|
||||
if (this.loadMode == 1) {
|
||||
this.loadMallIndex ++
|
||||
if (this.loadMallIndex < this.mallList.length) {
|
||||
this.getList(data, this.mallList[this.loadMallIndex].mallId, this.mallList[this.loadMallIndex].mallName, 1)
|
||||
} else {
|
||||
this.isLoading = false
|
||||
this.isDlgLoading = false
|
||||
Message.success("所有店铺备货单已加载完成")
|
||||
}
|
||||
} else {
|
||||
this.isLoading = false
|
||||
this.isDlgLoading = false
|
||||
}
|
||||
this.isLoading = false
|
||||
this.isDlgLoading = false
|
||||
Message.success("所有店铺备货单已加载完成")
|
||||
}
|
||||
} else {
|
||||
this.getList(data, mallId, mallName, currentPage)
|
||||
this.isLoading = false
|
||||
this.isDlgLoading = false
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.getList(data, mallId, mallName, currentPage)
|
||||
}
|
||||
},
|
||||
remove(sn) {
|
||||
for (let i = 0; i < this.choosedList.length; i++) {
|
||||
@@ -851,7 +851,10 @@
|
||||
},
|
||||
sendNotification(obj) {
|
||||
sendChromeNotification({productName: obj.productName, mallName: obj.mallName})
|
||||
}
|
||||
},
|
||||
sleepSync(milliseconds) {
|
||||
return new Promise(resolve => setTimeout(resolve, milliseconds));
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user