|
|
@ -1,17 +1,15 @@ |
|
|
|
<template> |
|
|
|
<el-tabs class="my-tabs" type="card"> |
|
|
|
<el-tab-pane label="品牌信息"> |
|
|
|
<div class="app-container"> |
|
|
|
<div class="search"> |
|
|
|
<el-form ref="queryParams" :inline="true" :model="queryParams" class="tab-header"> |
|
|
|
<span style="font-size: 16px;font-weight: 500">品牌</span> |
|
|
|
<el-select |
|
|
|
v-model="queryParams.params.name" |
|
|
|
v-model="queryParams.params.brandName" |
|
|
|
placeholder="请选择品牌" |
|
|
|
style="width: 120px;margin-left: 10px;" |
|
|
|
@change="blur" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="(item, i) in tableData" |
|
|
|
v-for="(item, i) in ListName" |
|
|
|
:key="i" |
|
|
|
:label="item.name" |
|
|
|
:value="item.name" |
|
|
@ -22,11 +20,9 @@ |
|
|
|
v-model="queryParams.params.storeName" |
|
|
|
placeholder="请选择门店" |
|
|
|
style="width: 120px;margin-left: 10px;" |
|
|
|
:disabled="chooseStore" |
|
|
|
@change="store" |
|
|
|
> |
|
|
|
<el-option |
|
|
|
v-for="(item, i) in tableData" |
|
|
|
v-for="(item, i) in apparatusListName" |
|
|
|
:key="i" |
|
|
|
:label="item.storeName" |
|
|
|
:value="item.storeName" |
|
|
@ -66,7 +62,7 @@ |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
<div class="container"> |
|
|
|
<el-table v-loading="tableLoading" :data="tableData" border style="width: 100%"> |
|
|
|
<el-table v-loading="tableLoading" :default-sort = "{prop: 'date', order: 'descending'}" :data="tableData" border style="width: 100%" > |
|
|
|
<el-table-column label="序号" width="55px" type="index" align="center"></el-table-column> |
|
|
|
<el-table-column prop="enpName" label="厂家" width="100px" align="center"> |
|
|
|
</el-table-column> |
|
|
@ -78,13 +74,13 @@ |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="salesAmount" label="销售额" align="center" width="100px"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="oils" label="油类成本占比" align="center" width="150px"> |
|
|
|
<el-table-column prop="oils" label="油类成本占比" align="center" width="150px" :formatter="to2"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="rice" label="米类成本占比" align="center" width="150px"> |
|
|
|
<el-table-column prop="rice" label="米类成本占比" align="center" width="150px" :formatter="to2"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="face" label="面类成本占比" align="center" width="150px"> |
|
|
|
<el-table-column prop="face" label="面类成本占比" align="center" width="150px" :formatter="to2"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="totalCount" label="合计成本金额" align="center" width="150px"> |
|
|
|
<el-table-column prop="totalCount" label="合计成本金额" align="center" width="150px" :formatter="to2"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column fixed="right" width="200px" label="明细信息" align="center"> |
|
|
|
<template slot-scope="scope"> |
|
|
@ -109,79 +105,101 @@ |
|
|
|
:total="queryParams.total" |
|
|
|
:page.sync="queryParams.current" |
|
|
|
:limit.sync="queryParams.size" |
|
|
|
@pagination="loadList" |
|
|
|
@pagination="pagination" |
|
|
|
/> |
|
|
|
</div> |
|
|
|
<!-- 销售详细信息 --> |
|
|
|
<el-dialog |
|
|
|
:title="dialogTitle + '详细信息'" |
|
|
|
:visible.sync="editDialog" |
|
|
|
width="40%" |
|
|
|
width="70%" |
|
|
|
> |
|
|
|
<table class="e-table" cellspacing="0"> |
|
|
|
<tr> |
|
|
|
<td>学生姓名</td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td>学号ID</td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td>性别</td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td>所属班级</td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td>系别</td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td>专业</td> |
|
|
|
</tr> |
|
|
|
</table> |
|
|
|
<div style="margin-top: 20px; text-align: center"> |
|
|
|
<el-button type="primary" @click="save()">保存</el-button> |
|
|
|
</div> |
|
|
|
<el-table ref="datalist" @mouseover.native="mouseEnter()" @mouseout.native="mouseLeave()" :data="tableXiaoshou" height="420" border style="width: 100%"> |
|
|
|
<el-table-column |
|
|
|
property="dataDate" |
|
|
|
label="数据日期" |
|
|
|
></el-table-column> |
|
|
|
<el-table-column |
|
|
|
property="storeName" |
|
|
|
label="门店名称" |
|
|
|
></el-table-column> |
|
|
|
<el-table-column |
|
|
|
property="dishesName" |
|
|
|
label="菜品名称" |
|
|
|
></el-table-column> |
|
|
|
<el-table-column |
|
|
|
property="salesCount" |
|
|
|
label="数量" |
|
|
|
></el-table-column> |
|
|
|
<el-table-column |
|
|
|
property="unit" |
|
|
|
label="规格单位" |
|
|
|
></el-table-column> |
|
|
|
<el-table-column |
|
|
|
property="salesPrice" |
|
|
|
label="单价(元)" |
|
|
|
></el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</el-tab-pane> |
|
|
|
|
|
|
|
<!-- 采购详细信息 --> |
|
|
|
<el-dialog |
|
|
|
:title="dialogTitle + '详细信息'" |
|
|
|
:visible.sync="entry" |
|
|
|
width="40%" |
|
|
|
width="70%" |
|
|
|
> |
|
|
|
<table class="e-table" cellspacing="0"> |
|
|
|
<tr> |
|
|
|
<td>学号ID</td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td>四级(分)</td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td>六级(分)</td> |
|
|
|
</tr> |
|
|
|
<tr> |
|
|
|
<td>计算机(分)</td> |
|
|
|
</tr> |
|
|
|
</table> |
|
|
|
<div style="margin-top: 20px; text-align: center"> |
|
|
|
<el-button type="primary">保存</el-button> |
|
|
|
</div> |
|
|
|
<el-table ref="datalist" @mouseover.native="mouseEnter()" @mouseout.native="mouseLeave()" :data="tableCaigou" height="420" border style="width: 100%"> |
|
|
|
<el-table-column |
|
|
|
property="dataDate" |
|
|
|
label="数据日期" |
|
|
|
></el-table-column> |
|
|
|
<el-table-column |
|
|
|
property="storeName" |
|
|
|
label="门店名称" |
|
|
|
></el-table-column> |
|
|
|
<el-table-column |
|
|
|
property="purchaseDate" |
|
|
|
label="采购日期" |
|
|
|
></el-table-column> |
|
|
|
<el-table-column |
|
|
|
property="materialName" |
|
|
|
label="物料名称" |
|
|
|
></el-table-column> |
|
|
|
<!-- <el-table-column |
|
|
|
property="unit" |
|
|
|
label="规格单位" |
|
|
|
></el-table-column> --> |
|
|
|
<el-table-column |
|
|
|
property="purchaseCount" |
|
|
|
label="采购数量" |
|
|
|
></el-table-column> |
|
|
|
<el-table-column |
|
|
|
property="purchaseAmount" |
|
|
|
label="采购金额(元)" |
|
|
|
></el-table-column> |
|
|
|
<el-table-column |
|
|
|
property="taxPrice" |
|
|
|
label="含税单位" |
|
|
|
></el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-dialog> |
|
|
|
</el-tabs> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
|
<script> |
|
|
|
import {listPage} from '@/api/Zhj/inquireStatistics/index.js' |
|
|
|
import {listPage,selectPurchaseList,selectSalesDishes} from '@/api/Zhj/inquireStatistics/index.js' |
|
|
|
export default { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
rollPx:1, |
|
|
|
rolltime:50, |
|
|
|
dialogTitle: "", |
|
|
|
editDialog: false, |
|
|
|
entry: false, |
|
|
|
tableLoading: false, |
|
|
|
chooseStore:true, |
|
|
|
form: {}, |
|
|
|
rolltimmer:'', |
|
|
|
formBackup: Object.assign({}, this.form), |
|
|
|
page: { |
|
|
|
total: 0, // 默认数据总数 |
|
|
@ -192,7 +210,11 @@ export default { |
|
|
|
size: 10, |
|
|
|
}, |
|
|
|
}, |
|
|
|
apparatusListName:{}, |
|
|
|
ListName:{}, |
|
|
|
tableData: [], |
|
|
|
tableCaigou:[], |
|
|
|
tableXiaoshou:[], |
|
|
|
student: {}, |
|
|
|
queryParams: { |
|
|
|
current: 1, |
|
|
@ -232,11 +254,25 @@ export default { |
|
|
|
}; |
|
|
|
this.getPageList(this.queryParams); |
|
|
|
}, |
|
|
|
to2(row,col,val){ |
|
|
|
return parseFloat(val).toFixed(2) |
|
|
|
}, |
|
|
|
getPageList(data) { |
|
|
|
const _this=this |
|
|
|
listPage(data).then((res) => { |
|
|
|
this.tableData=res.data.records |
|
|
|
_this.tableData=res.data.records |
|
|
|
this.apparatusListName = this.uniqueName(_this.tableData) |
|
|
|
this.ListName = this.uniqueName1(_this.tableData) |
|
|
|
}) |
|
|
|
}, |
|
|
|
uniqueName(arr) { |
|
|
|
const res = new Map(); |
|
|
|
return arr.filter((arr) => !res.has(arr.storeName) && res.set(arr.storeName, 1)); |
|
|
|
}, |
|
|
|
uniqueName1(arr) { |
|
|
|
const res = new Map(); |
|
|
|
return arr.filter((arr) => !res.has(arr.name) && res.set(arr.name, 1)); |
|
|
|
}, |
|
|
|
loadList() { |
|
|
|
this.tableLoading = true |
|
|
|
}, |
|
|
@ -244,29 +280,33 @@ export default { |
|
|
|
this.form = {}; |
|
|
|
}, |
|
|
|
//获取品牌门店 |
|
|
|
blur(){ |
|
|
|
if(this.queryParams.params.name){ |
|
|
|
this.chooseStore=false |
|
|
|
} |
|
|
|
}, |
|
|
|
store(){ |
|
|
|
console.log(777777777); |
|
|
|
}, |
|
|
|
// blur(){ |
|
|
|
// if(this.queryParams.params.name){ |
|
|
|
// this.chooseStore=false |
|
|
|
// } |
|
|
|
// }, |
|
|
|
// store(){ |
|
|
|
// console.log(777777777); |
|
|
|
// }, |
|
|
|
purchase(row) { |
|
|
|
this.dialogTitle = "采购"; |
|
|
|
this.entry = true; |
|
|
|
selectPurchaseList(row).then((res)=>{ |
|
|
|
this.tableCaigou=res.data |
|
|
|
}) |
|
|
|
}, |
|
|
|
market(row) { |
|
|
|
this.dialogTitle = "销售"; |
|
|
|
this.editDialog = true; |
|
|
|
this.form = Object.assign({}, row); |
|
|
|
selectSalesDishes(row).then((res)=>{ |
|
|
|
this.tableXiaoshou=res.data |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 查询某天的数据 |
|
|
|
dosearch() { |
|
|
|
this.getPageList(this.queryParams); |
|
|
|
}, |
|
|
|
resetQuery() { |
|
|
|
this.getPageList(this.queryParams); |
|
|
|
this.chooseStore=true |
|
|
|
this.queryParams = { |
|
|
|
current: 1, |
|
|
@ -279,14 +319,45 @@ export default { |
|
|
|
store:'', |
|
|
|
}, |
|
|
|
}; |
|
|
|
this.getPageList(this.queryParams); |
|
|
|
}, |
|
|
|
autoRoll(stop){ |
|
|
|
if(stop){ |
|
|
|
clearInterval(this.rolltimmer); |
|
|
|
return; |
|
|
|
} |
|
|
|
const table=this.$refs.datalist; |
|
|
|
const divData=table.bodyWrapper; |
|
|
|
this.rolltimmer=setInterval(()=>{ |
|
|
|
divData.scrollTop+=this.rollPx; |
|
|
|
if(divData.clientHeight+divData.scrollTop>=divData.scrollHeight){ |
|
|
|
divData.scrollTop=0; |
|
|
|
} |
|
|
|
},this.rolltime); |
|
|
|
}, |
|
|
|
//鼠标进入 停止滚动 |
|
|
|
mouseEnter(time){ |
|
|
|
this.autoRoll(true); |
|
|
|
}, |
|
|
|
//鼠标离开 开始滚动 |
|
|
|
mouseLeave(){ |
|
|
|
this.autoRoll(); |
|
|
|
}, |
|
|
|
}, |
|
|
|
}; |
|
|
|
</script> |
|
|
|
|
|
|
|
<style scoped="scoped" lang="scss"> |
|
|
|
<style scoped="scoped" > |
|
|
|
|
|
|
|
/deep/ .el-dialog__title{ |
|
|
|
color: #000; |
|
|
|
font-size: 24px; |
|
|
|
} |
|
|
|
.my-tabs { |
|
|
|
margin-top: 10px; |
|
|
|
} |
|
|
|
.container{ |
|
|
|
padding: 10px; |
|
|
|
} |
|
|
|
</style> |
|
|
|
|