mirror of
https://gitee.com/hzchunfen/erp.git
synced 2025-12-01 06:30:49 +00:00
商品列表添加汇总数据
平台订单检索bug
This commit is contained in:
parent
274ed2f1c1
commit
10b606e18a
@ -64,8 +64,11 @@
|
||||
<el-card>
|
||||
<div>
|
||||
<!-- 表格头部操作 -->
|
||||
<div>
|
||||
<span>全部商品(共{{ total }}条)</span>
|
||||
<div style="display: flex;align-items: center;justify-content: space-between;">
|
||||
<div style="display: flex;flex-wrap: wrap;">
|
||||
<span style="margin-right: 20px;">全部商品(共{{ total }}条)</span>
|
||||
<div v-if="sum" style="color: #f00;">销量{{ sum.goods_number }},实际库存{{ sum.real_stock }},剩余库存{{ sum.stock }}</div>
|
||||
</div>
|
||||
<div class="btn">
|
||||
<el-button @click="resetOrderCount" icon="el-icon-refresh">订单重置</el-button>
|
||||
<el-button type="primary" @click="petchEditStock" icon="el-icon-edit" :disabled="!chooseList.length">批量更新在售库存</el-button>
|
||||
@ -120,7 +123,7 @@
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column prop="yesterday_num" label="实际库存" align="center"></el-table-column>
|
||||
<el-table-column prop="sale_stock" label="可售库存" sortable="custom">
|
||||
<el-table-column prop="sale_stock" label="可售库存" sortable="custom" width="160">
|
||||
<template slot-scope="scope">
|
||||
<div class="titBox" v-if="scope.row.edit">
|
||||
<el-input v-model="scope.row.sale_stock" placeholder="可售库存" size="mini" style="width: 100%;"></el-input>
|
||||
@ -408,6 +411,7 @@
|
||||
filterTime: [],
|
||||
sort_field: '',
|
||||
sort_value: '',
|
||||
sum: null
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -456,6 +460,7 @@
|
||||
sku_code: this.shopsData
|
||||
}
|
||||
this.is_admin = res.data.manage && res.data.manage.is_admin
|
||||
this.sum = params.goods_title ? res.data.sum : null
|
||||
this.loading = false
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
|
||||
@ -1,16 +1,16 @@
|
||||
<template>
|
||||
<div class="conent">
|
||||
<el-card>
|
||||
<el-form ref="form" :inline="true" :model="form">
|
||||
<el-form ref="form" :inline="true" label-width="90px">
|
||||
<el-form-item label="所属店铺:">
|
||||
<el-select v-model="form.shop_id" placeholder="店铺" @change="handleChoose()">
|
||||
<el-option v-for="item in shops" :key="item.id" :label="item.name" :value="item.id">
|
||||
<el-select v-model="filter.shop_id" placeholder="店铺" @change="handleChoose()">
|
||||
<el-option v-for="item in shopsList" :key="item.id" :label="item.name" :value="item.id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="发货状态:">
|
||||
<el-select v-model="form.shipping_status" placeholder="发货状态" @change="handleChoose()">
|
||||
<el-select v-model="filter.shipping_status" placeholder="发货状态" @change="handleChoose()">
|
||||
<el-option value="" label="全部"></el-option>
|
||||
<el-option value="0" label="未发货"></el-option>
|
||||
<el-option value="2" label="部分发货"></el-option>
|
||||
@ -19,48 +19,40 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="订单类型:">
|
||||
<el-select v-model="form.is_supplier" placeholder="订单类型" @change="handleChoose()">
|
||||
<el-select v-model="filter.is_supplier" placeholder="订单类型" @change="handleChoose()">
|
||||
<el-option value="" label="全部订单"></el-option>
|
||||
<el-option value="1" label="自卖团订单"></el-option>
|
||||
<el-option value="0" label="帮卖团订单"></el-option>
|
||||
<el-option :value="1" label="自卖团订单"></el-option>
|
||||
<el-option :value="0" label="帮卖团订单"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="订单状态:">
|
||||
<el-select v-model="form.cancel_status" placeholder="订单状态" @change="handleChoose()">
|
||||
<el-select v-model="filter.cancel_status" placeholder="订单状态" @change="handleChoose()">
|
||||
<el-option value="" label="全部"></el-option>
|
||||
<el-option value="0" label="未取消"></el-option>
|
||||
<el-option value="1" label="已取消"></el-option>
|
||||
<el-option :value="0" label="未取消"></el-option>
|
||||
<el-option :value="1" label="已取消"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="售后状态:">
|
||||
<el-select v-model="form.after_sales_status" placeholder="售后状态" @change="handleChoose()">
|
||||
<el-select v-model="filter.after_sales_status" placeholder="售后状态" @change="handleChoose()">
|
||||
<el-option value="" label="全部"></el-option>
|
||||
<el-option value="0" label="未售后"></el-option>
|
||||
<el-option value="1" label="有售后"></el-option>
|
||||
<el-option :value="0" label="未售后"></el-option>
|
||||
<el-option :value="1" label="有售后"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="商品数量:">
|
||||
<el-select v-model="form.goods_sku_num" placeholder="商品数量" @change="handleChoose()">
|
||||
<el-select v-model="filter.goods_sku_num" placeholder="商品数量" @change="handleChoose()">
|
||||
<el-option value="" label="全部"></el-option>
|
||||
<el-option value="1" label="1个商品"></el-option>
|
||||
<el-option value="2" label="2-5个商品"></el-option>
|
||||
<el-option value="6" label="6个以上商品"></el-option>
|
||||
<el-option :value="1" label="1个商品"></el-option>
|
||||
<el-option :value="2" label="2-5个商品"></el-option>
|
||||
<el-option :value="6" label="6个以上商品"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<!-- <el-form-item label="打印状态:">
|
||||
<el-select v-model="form.print_status" placeholder="打印状态">
|
||||
<el-option value="" label="全部"></el-option>
|
||||
<el-option value="0" label="未打印"></el-option>
|
||||
<el-option value="1" label="已打印"></el-option>
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
|
||||
<el-form-item label="订单商品:">
|
||||
<el-select v-model="form.external_sku_ids" multiple filterable remote reserve-keyword placeholder="订单商品"
|
||||
<el-select v-model="filter.external_sku_ids" multiple filterable remote reserve-keyword placeholder="订单商品"
|
||||
:remote-method="remoteMethod" :loading="searchLoading">
|
||||
<el-option v-for="item in options" :key="item.external_sku_id" :label="item.title"
|
||||
:value="item.external_sku_id">
|
||||
@ -75,31 +67,24 @@
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="跟团号:">
|
||||
<el-input v-model="form.pno" placeholder="跟团号" @keyup.enter.native="handleChoose">
|
||||
</el-input>
|
||||
<el-input v-model="filter.pno" placeholder="跟团号" @keyup.enter.native="handleChoose"></el-input>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="handleChoose">筛选</el-button>
|
||||
<el-button plain @click="handleReChoose">重置筛选</el-button>
|
||||
<el-button type="primary" @click="print">打印</el-button>
|
||||
<el-button v-if="form.goods_sku_num === 2" type="primary">配货单导出</el-button>
|
||||
<!-- <el-button v-if="form.goods_sku_num === 2" type="primary">配货单导出</el-button> -->
|
||||
<el-button type="warning" :loading="exportLoading" @click="handleExport" icon="el-icon-download">数据导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
<el-card style="margin-top: 10px">
|
||||
<el-table v-loading="loading" ref="multipleTable" :data="tableData" style="width: 100%" border
|
||||
<el-table v-loading="loading" ref="multipleTable" :data="orderList" style="width: 100%" border
|
||||
@selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column label="店铺名称">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.shop.name }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="店铺名称" prop="shop.name" />
|
||||
<el-table-column label="跟团号" align="center">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.is_supplier ? '自卖团: ' : '帮卖团: ' }}
|
||||
@ -127,14 +112,17 @@
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="confirm_at" label="下单时间" width="150" align="center"></el-table-column>
|
||||
<!-- <el-table-column prop="print_status" label="打印次数"></el-table-column> -->
|
||||
</el-table>
|
||||
|
||||
<!-- 分页功能 -->
|
||||
<div class="block">
|
||||
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange"
|
||||
:current-page="current_page" :page-sizes="[15, 50, 100]" :page-size="per_page"
|
||||
layout="total, sizes, prev, pager, next, jumper" :total="Paginationdata.total">
|
||||
<div class="page-pagination">
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="page"
|
||||
:page-sizes="[10, 50, 100]"
|
||||
:page-size="per_page"
|
||||
layout="prev, pager, next, sizes, jumper, total"
|
||||
:total="total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</el-card>
|
||||
@ -145,51 +133,29 @@
|
||||
import { platOrderList, printOrders, printSuccess, exportOrder } from "@/api/plat";
|
||||
import { storeList } from "@/api/shop"
|
||||
import { goodsSkusList } from "@/api/goods"
|
||||
import dayjs from 'dayjs'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
shop_id: "",
|
||||
// activity_no: "",
|
||||
shipping_status: "",
|
||||
// is_supplier: "",
|
||||
cancel_status: "0",
|
||||
after_sales_status: "0",
|
||||
// supply_participate_no: "",
|
||||
// participate_no: "",
|
||||
goods_sku_num: "",
|
||||
// print_status: "0",
|
||||
external_sku_ids: [],
|
||||
ids: [],
|
||||
pno: '',
|
||||
filter: {
|
||||
shop_id: '',
|
||||
shipping_status: '',
|
||||
is_supplier: '',
|
||||
cancel_status: 0,
|
||||
after_sales_status: 0,
|
||||
goods_sku_num: '',
|
||||
external_sku_ids: '',
|
||||
pno: ''
|
||||
},
|
||||
dialogVisible: false,
|
||||
loading: true,
|
||||
loading: false,
|
||||
searchLoading: false,
|
||||
options: [],
|
||||
tableData: [],
|
||||
Paginationdata: {}, //分页相关数据
|
||||
current_page: 1, //当前页
|
||||
orderList: [],
|
||||
total: 0,
|
||||
page: 1, //当前页
|
||||
per_page: 10, //每页显示数量
|
||||
shops: [],
|
||||
groupActivity: [],
|
||||
exportForm: {
|
||||
shop_id: "",
|
||||
start_no: "",
|
||||
end_no: "",
|
||||
is_supplier: 1,
|
||||
},
|
||||
exportFormRules: {
|
||||
shop_id: [
|
||||
{ required: true, trigger: 'blur' }
|
||||
],
|
||||
start_no: [
|
||||
{ required: true, trigger: 'blur' }
|
||||
],
|
||||
end_no: [
|
||||
{ required: true, trigger: 'blur' }
|
||||
],
|
||||
},
|
||||
shopsList: [],
|
||||
confirmAt: [],
|
||||
print_order_ids: '',
|
||||
print_documents: [],
|
||||
@ -203,101 +169,68 @@ export default {
|
||||
taskIDArray: [],
|
||||
requestIDGetGlobalConfig: '',
|
||||
exportLoading: false
|
||||
};
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.initConfirmAt();
|
||||
this.handleChoose();
|
||||
// this.initWebSocket();
|
||||
},
|
||||
mounted() {
|
||||
// 展示店铺列表
|
||||
this.getShopsList();
|
||||
},
|
||||
beforeDestroy() {
|
||||
// 订阅事件记得要取消
|
||||
},
|
||||
destroyed() {
|
||||
let start = dayjs().format('YYYY-MM-DD') + ' 00:00:00'
|
||||
let end = dayjs().format('YYYY-MM-DD') + ' 23:59:59'
|
||||
this.confirmAt = [start, end]
|
||||
this.getOrderList()
|
||||
this.getShopsList()
|
||||
},
|
||||
methods: {
|
||||
initConfirmAt() {
|
||||
const nowTimeDate = new Date();
|
||||
nowTimeDate.setHours(0, 0, 0, 0);
|
||||
let start = nowTimeDate.toLocaleString('zh', { hour12: false }).replaceAll('/', '-');
|
||||
nowTimeDate.setHours(23, 59, 59, 999);
|
||||
let end = nowTimeDate.toLocaleString('zh', { hour12: false }).replaceAll('/', '-');
|
||||
this.confirmAt = [start, end]
|
||||
},
|
||||
// 店铺列表
|
||||
getPlatOrderList(params = {}) {
|
||||
params.page = this.current_page;
|
||||
params.per_page = this.per_page;
|
||||
|
||||
platOrderList(params).then((res) => {
|
||||
this.tableData = res.data.data;
|
||||
this.Paginationdata = res.data.meta;
|
||||
});
|
||||
},
|
||||
getShopsList() {
|
||||
let page = {
|
||||
page: 0,
|
||||
per_page: 99,
|
||||
};
|
||||
storeList(page).then((res) => {
|
||||
this.shops = res.data.data;
|
||||
});
|
||||
this.loading = false;
|
||||
},
|
||||
//分页功能
|
||||
handleSizeChange(val) {
|
||||
//当前条数
|
||||
this.current_page = 1;
|
||||
this.per_page = val;
|
||||
this.getPlatOrderList();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
//当前页
|
||||
this.current_page = val;
|
||||
this.getPlatOrderList();
|
||||
},
|
||||
// 筛选
|
||||
handleChoose() {
|
||||
getOrderList() {
|
||||
this.loading = true
|
||||
let params = {
|
||||
...this.form,
|
||||
page: 1,
|
||||
...this.filter,
|
||||
page: this.page,
|
||||
per_page: this.per_page,
|
||||
confirm_at_start: this.confirmAt ? this.confirmAt[0] : '',
|
||||
confirm_at_end: this.confirmAt ? this.confirmAt[1] : ''
|
||||
};
|
||||
this.getPlatOrderList(params)
|
||||
},
|
||||
// 重置筛选
|
||||
handleReChoose() {
|
||||
this.form = {
|
||||
shop_id: "",
|
||||
// activity_no: "",
|
||||
shipping_status: "",
|
||||
// is_supplier: "",
|
||||
cancel_status: "0",
|
||||
after_sales_status: "0",
|
||||
// supply_participate_no: "",
|
||||
// participate_no: "",
|
||||
goods_sku_num: '',
|
||||
// print_status: 0,
|
||||
external_sku_ids: [],
|
||||
ids: [],
|
||||
pno: ''
|
||||
};
|
||||
this.getPlatOrderList();
|
||||
},
|
||||
derivation(formName) {
|
||||
this.$refs[formName].validate((valid) => {
|
||||
if (valid) {
|
||||
window.open("/plat_orders/export?shop_id=" + this.exportForm.shop_id + '&start_no=' + this.exportForm.start_no + '&end_no=' + this.exportForm.end_no + '&is_supplier=' + this.exportForm.is_supplier);
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
platOrderList(params).then((res) => {
|
||||
this.orderList = res.data.data
|
||||
this.total = res.data.meta.total
|
||||
this.loading = false
|
||||
}).catch(() => {
|
||||
this.loading = false
|
||||
})
|
||||
},
|
||||
getShopsList() {
|
||||
let params = {
|
||||
page: 0,
|
||||
per_page: 99
|
||||
}
|
||||
storeList(params).then((res) => {
|
||||
this.shopsList = res.data.data
|
||||
})
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.page = 1
|
||||
this.per_page = val
|
||||
this.getOrderList()
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.page = val
|
||||
this.getOrderList()
|
||||
},
|
||||
handleChoose() {
|
||||
this.page = 1
|
||||
this.getOrderList()
|
||||
},
|
||||
handleReChoose() {
|
||||
this.filter = {
|
||||
shop_id: '',
|
||||
shipping_status: '',
|
||||
is_supplier: '',
|
||||
cancel_status: 0,
|
||||
after_sales_status: 0,
|
||||
goods_sku_num: '',
|
||||
external_sku_ids: '',
|
||||
pno: ''
|
||||
}
|
||||
this.page = 1
|
||||
this.getOrderList()
|
||||
},
|
||||
remoteMethod(query) {
|
||||
if (query !== '') {
|
||||
@ -321,7 +254,7 @@ export default {
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
});
|
||||
printOrders(this.form).then((res) => {
|
||||
printOrders(this.filter).then((res) => {
|
||||
this.print_documents = res.data.documents;
|
||||
this.print_order_ids = res.data.order_ids;
|
||||
print_loading.close();
|
||||
@ -329,11 +262,11 @@ export default {
|
||||
})
|
||||
},
|
||||
handleSelectionChange(val) {
|
||||
let ids = [];
|
||||
let ids = []
|
||||
val.forEach((item) => {
|
||||
ids.push(item.id);
|
||||
ids.push(item.id)
|
||||
})
|
||||
this.form.ids = ids;
|
||||
this.filter.ids = ids
|
||||
},
|
||||
initWebSocket() {
|
||||
//初始化weosocket
|
||||
@ -549,7 +482,5 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.block {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@ -102,6 +102,7 @@
|
||||
import { getDailyStock, batchAddDailyStock } from "@/api/supplyChain"
|
||||
import axios from "axios"
|
||||
import { goodsSkusList } from "@/api/goods"
|
||||
import dayjs from 'dayjs'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -240,6 +241,9 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
let start = dayjs().subtract(7, 'day').format('YYYY-MM-DD') + ' 00:00:00'
|
||||
let end = dayjs().format('YYYY-MM-DD hh:mm:ss')
|
||||
this.addTime = [start, end]
|
||||
this.fetchList()
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
<el-table-column prop="cost" label="采购成本" />
|
||||
<el-table-column prop="buyer_name" label="采购人名称" />
|
||||
<!-- <el-table-column prop="status" label="状态" /> -->
|
||||
<el-table-column prop="expire_time" label="到货时间" />
|
||||
<el-table-column prop="arrived_time" label="到货时间" />
|
||||
<el-table-column prop="supplier_name" label="供应商">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.supplier_name">{{ scope.row.supplier_name }}({{scope.row.supplier_id}})</span>
|
||||
|
||||
@ -48,7 +48,7 @@
|
||||
<el-table-column prop="cost" label="采购成本" />
|
||||
<el-table-column prop="buyer_name" label="采购人名称" />
|
||||
<!-- <el-table-column prop="status" label="状态" /> -->
|
||||
<el-table-column prop="expire_time" label="到货时间" />
|
||||
<el-table-column prop="arrived_time" label="到货时间" />
|
||||
<el-table-column prop="supplier_name" label="供应商">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.supplier_name">{{ scope.row.supplier_name }}({{scope.row.supplier_id}})</span>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user