1
This commit is contained in:
@@ -1,5 +1,22 @@
|
||||
import request from '@/utils/request'
|
||||
|
||||
// JD订单列表
|
||||
export function listJDOrders(query) {
|
||||
return request({
|
||||
url: '/jarvis/jdorder/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// JD订单详情
|
||||
export function getJDOrder(id) {
|
||||
return request({
|
||||
url: `/jarvis/jdorder/${id}`,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 一键转链
|
||||
export function generatePromotionContent(data) {
|
||||
return request({
|
||||
|
||||
@@ -131,6 +131,21 @@ export const constantRoutes = [
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/sloworder',
|
||||
component: Layout,
|
||||
redirect: 'noredirect',
|
||||
name: 'SlowOrder',
|
||||
meta: { title: '下好的慢单', icon: 'list' },
|
||||
children: [
|
||||
{
|
||||
path: 'index',
|
||||
component: () => import('@/views/system/jdorder/orderList'),
|
||||
name: 'SlowOrderIndex',
|
||||
meta: { title: '下好的慢单', icon: 'list' }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/favorite',
|
||||
component: Layout,
|
||||
|
||||
@@ -571,15 +571,17 @@ export default {
|
||||
},
|
||||
/** 快速发品 */
|
||||
handleQuickPublish(row) {
|
||||
// 先用商品链接生成完整商品信息,再打开通用发品弹窗
|
||||
const id = row.id || this.ids;
|
||||
getFavoriteProduct(id).then(async res => {
|
||||
const p = res && res.data ? res.data : (row || {});
|
||||
try {
|
||||
// 与转链保持一致:优先使用保存的商品链接,避免用名称/ID 产生歧义
|
||||
if (!p.productUrl) {
|
||||
this.$modal.msgWarning('该常用商品缺少商品链接,无法生成完整发品信息');
|
||||
}
|
||||
let detail = null;
|
||||
const inputContent = p.productUrl || p.productName || p.skuid || '';
|
||||
if (inputContent) {
|
||||
const r = await generatePromotionContent({ promotionContent: inputContent });
|
||||
if (p.productUrl) {
|
||||
const r = await generatePromotionContent({ promotionContent: p.productUrl });
|
||||
const resultStr = (r && (r.msg || r.data)) || '';
|
||||
try { const arr = typeof resultStr === 'string' ? JSON.parse(resultStr) : resultStr; if (Array.isArray(arr) && arr.length) detail = arr[0]; } catch(e) {}
|
||||
}
|
||||
@@ -592,7 +594,6 @@ export default {
|
||||
images: images,
|
||||
originalPrice: detail && detail.price ? Number(detail.price) : (p.price ? Number(p.price) : undefined),
|
||||
wenanOptions: wenanOptions,
|
||||
// 预设:同一用户经常固定账号与地区,优先从常用商品扩展字段取值(如有)
|
||||
userName: p.userName || '',
|
||||
province: p.province || null,
|
||||
city: p.city || null,
|
||||
@@ -605,7 +606,6 @@ export default {
|
||||
this.publishDialogVisible = true;
|
||||
}
|
||||
}).catch(() => {
|
||||
// 失败也尽量用行数据打开
|
||||
const images = row && row.productImage ? [row.productImage] : [];
|
||||
this.publishInitialData = { title: row.productName || '', images, content: '' };
|
||||
this.publishDialogVisible = true;
|
||||
|
||||
@@ -281,7 +281,7 @@ export default {
|
||||
skuid: product.skuid || product.skuId || product.spuid || '',
|
||||
productName: product.skuName || product.title || '',
|
||||
shopName: product.shopName || '',
|
||||
productUrl: product.url || '',
|
||||
productUrl: product.materialUrl || product.url || '',
|
||||
productImage: Array.isArray(product.images) && product.images.length ? product.images[0] : '',
|
||||
price: product.price != null ? String(product.price) : (product.lowestCouponPrice != null ? String(product.lowestCouponPrice) : ''),
|
||||
commissionInfo: product.commission != null ? String(product.commission) : '',
|
||||
|
||||
144
src/views/system/jdorder/orderList.vue
Normal file
144
src/views/system/jdorder/orderList.vue
Normal file
@@ -0,0 +1,144 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :inline="true" :model="queryParams" label-width="80px">
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="queryParams.remark" placeholder="单据备注" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="分销标记">
|
||||
<el-input v-model="queryParams.distributionMark" placeholder="分销标记" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="型号">
|
||||
<el-input v-model="queryParams.modelNumber" placeholder="型号" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="订单号">
|
||||
<el-input v-model="queryParams.orderId" placeholder="订单号" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="下单人">
|
||||
<el-input v-model="queryParams.buyer" placeholder="下单人" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
<el-input v-model="queryParams.status" placeholder="备注/状态" clearable size="small" @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="下单时间">
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
type="daterange"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
value-format="yyyy-MM-dd"
|
||||
size="small"
|
||||
range-separator="至"
|
||||
@change="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" size="small" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
<el-button size="small" icon="el-icon-refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<el-table :data="list" v-loading="loading" border>
|
||||
<el-table-column label="ID" prop="id" width="80" />
|
||||
<el-table-column label="下单时间" prop="orderTime" width="160">
|
||||
<template slot-scope="scope">{{ parseTime(scope.row.orderTime) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="订单号" prop="orderId" width="160"/>
|
||||
<el-table-column label="下单人" prop="buyer" width="140"/>
|
||||
<el-table-column label="型号" prop="modelNumber" min-width="140"/>
|
||||
<el-table-column label="付款金额" prop="paymentAmount" width="120">
|
||||
<template slot-scope="scope">{{ toYuan(scope.row.paymentAmount) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="后返金额" prop="rebateAmount" width="120">
|
||||
<template slot-scope="scope">{{ toYuan(scope.row.rebateAmount) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="备注/状态" prop="status" min-width="160"/>
|
||||
<el-table-column label="地址" prop="address" min-width="200" show-overflow-tooltip/>
|
||||
<el-table-column label="链接" prop="link" min-width="200">
|
||||
<template slot-scope="scope">
|
||||
<a v-if="scope.row.link" :href="scope.row.link" target="_blank">打开</a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="物流链接" prop="logisticsLink" min-width="160">
|
||||
<template slot-scope="scope">
|
||||
<a v-if="scope.row.logisticsLink" :href="scope.row.logisticsLink" target="_blank">查看物流</a>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" prop="createTime" width="160">
|
||||
<template slot-scope="scope">{{ parseTime(scope.row.createTime) }}</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination
|
||||
v-show="total > 0"
|
||||
:total="total"
|
||||
:page.sync="queryParams.pageNum"
|
||||
:limit.sync="queryParams.pageSize"
|
||||
@pagination="getList"
|
||||
/>
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listJDOrders } from '@/api/system/jdorder'
|
||||
export default {
|
||||
name: 'JDOrderList',
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
list: [],
|
||||
total: 0,
|
||||
dateRange: [],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
remark: undefined,
|
||||
distributionMark: undefined,
|
||||
modelNumber: undefined,
|
||||
link: undefined,
|
||||
orderId: undefined,
|
||||
buyer: undefined,
|
||||
status: undefined
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList()
|
||||
},
|
||||
methods: {
|
||||
getList() {
|
||||
this.loading = true
|
||||
const params = { ...this.queryParams }
|
||||
if (this.dateRange && this.dateRange.length === 2) {
|
||||
params.beginTime = this.dateRange[0]
|
||||
params.endTime = this.dateRange[1]
|
||||
}
|
||||
listJDOrders(params).then(res => {
|
||||
this.list = (res.rows || res.data || [])
|
||||
this.total = res.total || 0
|
||||
this.loading = false
|
||||
}).catch(() => { this.loading = false })
|
||||
},
|
||||
handleQuery() {
|
||||
this.queryParams.pageNum = 1
|
||||
this.getList()
|
||||
},
|
||||
resetQuery() {
|
||||
this.dateRange = []
|
||||
this.queryParams = { pageNum: 1, pageSize: 10 }
|
||||
this.getList()
|
||||
},
|
||||
toYuan(n) {
|
||||
if (n == null || n === '') return ''
|
||||
const num = Number(n)
|
||||
if (Number.isNaN(num)) return n
|
||||
return num.toFixed(2)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user