208 行
9.7 KiB
HTML
可执行文件
208 行
9.7 KiB
HTML
可执行文件
<!--[1.8.68]-->
|
|
<link rel="stylesheet" href="/Public/css/component-serial.css?v=1.0.0">
|
|
<div id="saleDetailsApp" v-cloak style="width: 100%">
|
|
<div class="page-tips">
|
|
<p>默认统计当月销售汇总</p>
|
|
</div>
|
|
<el-form :inline="true" size="small" style="margin-top: 10px">
|
|
<el-form-item>
|
|
<date-picker-range :date-time.sync="searchForm.time"
|
|
:start-placeholder="'交易时间(起)'"
|
|
:end-placeholder="'交易时间(止)'"></date-picker-range>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-input v-model="searchForm.search_info"
|
|
placeholder="货号/条码"
|
|
clearable
|
|
@keydown.enter.exact.native.prevent="searchData"
|
|
style="width: 220px;">
|
|
</el-input>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<select-goods-category :user-type="2" :store-id="store_id"
|
|
:category-id1.sync="searchForm.person1"
|
|
:category-id2.sync="searchForm.person2"
|
|
:category-id3.sync="searchForm.person3"></select-goods-category>
|
|
</el-form-item>
|
|
<el-form-item>
|
|
<el-button type="primary" @click="searchData">查询</el-button>
|
|
<el-button type="primary" plain @click="resetSearch">重置</el-button>
|
|
<el-button @click="exportExcel">导出</el-button>
|
|
</el-form-item>
|
|
</el-form>
|
|
<div class="table-top-card-box" style="justify-content: left">
|
|
<div class="table-top-card">
|
|
<div class="table-top-card-header">销售总额</div>
|
|
<div class="table-top-card-body">{{sumData.moneyTotal}}</div>
|
|
</div>
|
|
<div class="table-top-card">
|
|
<div class="table-top-card-header">商品总数</div>
|
|
<div class="table-top-card-body">{{sumData.numTotal}}</div>
|
|
</div>
|
|
<div class="table-top-card">
|
|
<div class="table-top-card-header">成本合计</div>
|
|
<div class="table-top-card-body">{{sumData.purchaseTotal}}</div>
|
|
</div>
|
|
<div class="table-top-card">
|
|
<div class="table-top-card-header">利润合计</div>
|
|
<div class="table-top-card-body">{{sumData.profitTotal}}</div>
|
|
</div>
|
|
</div>
|
|
<div style="width: calc(100% - 20px);" v-loading="loading" element-loading-text="数据加载中,请等待"
|
|
element-loading-spinner="el-icon-loading">
|
|
<el-table :data="sellSumList" :header-cell-style="{background:'#F5F7FA',color:'#606266'}"
|
|
:highlight-current-row="true" border size="mini" max-height="450">
|
|
<el-table-column type="index" label="序号" width="80" align="center"></el-table-column>
|
|
<el-table-column prop="goods_name" label="商品名称" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column prop="class_name" label="商品分类" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column prop="goods_number" label="货号" min-width="140"></el-table-column>
|
|
<el-table-column prop="goods_code" label="条码" min-width="140" :show-overflow-tooltip="true"></el-table-column>
|
|
<el-table-column prop="company" label="单位" min-width="60"></el-table-column>
|
|
<el-table-column label="售出数量" width="120" align="center">
|
|
<template slot-scope="scope">
|
|
<el-button type="text" size="mini" @click="detailsSerial(scope.$index)"
|
|
v-if="scope.row.serial_number_state == 1 && scope.row.sell_num > 0">
|
|
{{scope.row.sell_num}}
|
|
</el-button>
|
|
<span v-else>{{scope.row.sell_num}}</span>
|
|
</template>
|
|
</el-table-column>
|
|
<el-table-column prop="subtotal" label="售出总额" min-width="80"></el-table-column>
|
|
<el-table-column prop="purchase_price" label="成本合计" min-width="80"></el-table-column>
|
|
<el-table-column prop="profit" label="利润合计" min-width="80"></el-table-column>
|
|
</el-table>
|
|
<span style="margin:5px 3px;color: #606266;">共 {{total}} 条</span>
|
|
</div>
|
|
<component-serial :visible.sync="serialVisible" :parent-data="serialGoodsData"
|
|
get-data-type="storeGoodsSalesSummary">
|
|
</component-serial>
|
|
</div>
|
|
<script src="/Public/Retail/common/js/select-goods-category.js"></script>
|
|
<script src="/Public/js/component-serial.js?v=1.0.0"></script>
|
|
<script src="/Public/js/common.js"></script>
|
|
<script>
|
|
var saleDetailsApp = new Vue({
|
|
el: '#saleDetailsApp',
|
|
data: function () {
|
|
return {
|
|
sumData: {
|
|
moneyTotal: 0,
|
|
numTotal: 0,
|
|
purchaseTotal:0,
|
|
profitTotal:0,
|
|
},
|
|
searchForm: {
|
|
time: [],// 日期搜索
|
|
search_info: '',// 搜索货号或者条码
|
|
person1: '',// 一级分类
|
|
person2: '',// 二级分类
|
|
person3: '',// 三级分类
|
|
},//搜索内容
|
|
store_id: localStorage.store_id, //门店ID
|
|
sellSumList: [], // 销售汇总数据列表
|
|
total: 0, // 总数 int类型
|
|
page: 1,
|
|
limit: 10,
|
|
loading: false, // 加载
|
|
serialVisible: false, //串号录入窗口开关
|
|
serialGoodsData: {}, //串号录入当前商品数据对象
|
|
};
|
|
},
|
|
|
|
methods: {
|
|
// //获取汇总
|
|
getSumDta() {
|
|
this.sendRequest('Retail/Sale/getStoreSellTotal', {
|
|
data: this.searchForm,
|
|
success: (response) => {
|
|
this.loading = false;
|
|
if (response.status == 1) {
|
|
this.sumData.moneyTotal = response.data.moneyTotal
|
|
this.sumData.numTotal = response.data.numTotal
|
|
} else {
|
|
this.$message.error(response.message);
|
|
}
|
|
}
|
|
})
|
|
},
|
|
// 获取记录
|
|
getSellList() {
|
|
this.loading = true;
|
|
this.sendRequest('Retail/Sale/getSellSummary', {
|
|
data: this.searchForm,
|
|
success: (response) => {
|
|
this.loading = false;
|
|
if (response.status == 1) {
|
|
this.sellSumList = response.data.list;
|
|
this.sumData.purchaseTotal = response.data.purchaseTotal
|
|
this.sumData.profitTotal = response.data.profitTotal
|
|
this.total = response.data.list.length
|
|
} else {
|
|
this.sellSumList = []
|
|
this.total = 0
|
|
}
|
|
this.page = 1
|
|
}
|
|
})
|
|
},
|
|
|
|
// 重置表单
|
|
resetSearch() {
|
|
let date = new Date();
|
|
let y = date.getFullYear();
|
|
let m = date.getMonth() + 1;
|
|
let d = date.getDate();
|
|
let h = date.getHours();
|
|
let i = date.getMinutes();
|
|
let s = date.getSeconds();
|
|
m = m < 10 ? ('0' + m) : m;
|
|
d = d < 10 ? ('0' + d) : d;
|
|
h = h < 10 ? ('0' + h) : h;
|
|
i = i < 10 ? ('0' + i) : i;
|
|
s = s < 10 ? ('0' + s) : s;
|
|
this.searchForm = {
|
|
time: [y + '-' + m + '-01 00:00:00', y + '-' + m + '-' + d + ' ' + h + ':' + i + ':' + s],// 日期搜索
|
|
search_info: '',// 搜索货号或者条码
|
|
person1: '',// 一级分类
|
|
person2: '',// 二级分类
|
|
person3: '',// 三级分类
|
|
};
|
|
this.sellSumList = [];
|
|
this.total = 0;
|
|
this.searchData();
|
|
},
|
|
searchData() {
|
|
this.getSellList();
|
|
this.getSumDta();
|
|
},
|
|
|
|
// 导出
|
|
exportExcel() {
|
|
if (this.searchForm.time.length <= 0 && !this.searchForm.search_info && !this.searchForm.person1 && !this.searchForm.person2 && !this.searchForm.person3) {
|
|
this.$confirm('确定导出所有销售数据吗?', '提示', {
|
|
confirmButtonText: '确定',
|
|
cancelButtonText: '取消',
|
|
type: 'warning'
|
|
}).then(() => {
|
|
window.location.href = "{:U('sellSumExport')}"
|
|
}).catch(() => {
|
|
});
|
|
} else {
|
|
window.location.href = "{:U('sellSumExport')}?person1=" + this.searchForm.person1 + "&person2=" + this.searchForm.person2 + "&person3=" + this.searchForm.person3 + "&search_info=" + this.searchForm.search_info + "&time=" + (this.searchForm.time.length == 2 ? this.searchForm.time.join(',') : '');
|
|
}
|
|
},
|
|
/**
|
|
* @description: 打开串号详情窗口
|
|
* @param {Number} index: 当前商品索引
|
|
*/
|
|
detailsSerial(index) {
|
|
this.serialVisible = true;
|
|
this.serialGoodsData = this.sellSumList[index]
|
|
},
|
|
},
|
|
|
|
created() {
|
|
this.resetSearch();
|
|
},
|
|
})
|
|
</script> |