
8 changed files with 353 additions and 483 deletions
@ -1,4 +0,0 @@ |
|||
/** |
|||
* 宇信通监管项目-光伏项目-业务逻辑 |
|||
*/ |
|||
package com.yxt.supervise.dbcenter.biz; |
@ -1,476 +1,348 @@ |
|||
<template> |
|||
<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.brandName" |
|||
placeholder="请选择品牌" |
|||
style="width: 120px;margin-left: 10px;" |
|||
@change="change($event)" |
|||
> |
|||
<el-option |
|||
v-for="(item, i) in ListName" |
|||
:key="i" |
|||
:label="item.name" |
|||
:value="item.name" |
|||
/> |
|||
</el-select> |
|||
<span style="font-size: 16px;font-weight: 500;margin-left: 10px;">门店</span> |
|||
<el-select |
|||
v-model="queryParams.params.storeName" |
|||
placeholder="请选择门店" |
|||
style="width: 120px;margin-left: 10px;" |
|||
:disabled="chooseStore" |
|||
> |
|||
<el-option |
|||
v-for="(item, i) in apparatusListName" |
|||
:key="i" |
|||
:label="item.name" |
|||
:value="item.name" |
|||
/> |
|||
</el-select> |
|||
<el-form-item label="到货日期" style="margin-left: 10px;margin-top: 3px;"> |
|||
<el-date-picker |
|||
v-model="queryParams.params.fromTime" |
|||
type="date" |
|||
clearable |
|||
:picker-options="pickerOptions" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择日期" |
|||
/> |
|||
<span style="padding: 0 8px">至</span> |
|||
<el-date-picker |
|||
v-model="queryParams.params.endTime" |
|||
type="date" |
|||
clearable |
|||
:picker-options="pickerOptions" |
|||
value-format="yyyy-MM-dd" |
|||
placeholder="选择日期" |
|||
/> |
|||
</el-form-item> |
|||
<el-button |
|||
type="primary" |
|||
size="small" |
|||
icon="el-icon-search" |
|||
@click="dosearch" |
|||
>查询</el-button |
|||
> |
|||
<el-button |
|||
type="primary" |
|||
size="small" |
|||
icon="el-icon-refresh" |
|||
@click="resetSearch" |
|||
>重置</el-button |
|||
> |
|||
<el-button |
|||
type="primary" |
|||
size="small" |
|||
icon="el-icon-refresh" |
|||
style="margin-left: 108px;" |
|||
@click="captruedatas()" |
|||
>手动抓取</el-button |
|||
> |
|||
</el-form> |
|||
</div> |
|||
<div class="listconadd" style="padding: 20px;"> |
|||
<el-table v-loading="tableLoading" :default-sort = "{prop: 'date', order: 'descending'}" :data="tableData" border style="width: 100%" > |
|||
<el-table-column label="序号" width="55px" :index="indexMethod" type="index" align="center"></el-table-column> |
|||
<el-table-column prop="enpName" label="厂家" width="100px" align="center"> |
|||
</el-table-column> |
|||
<el-table-column prop="name" label="品牌" align="center" width="100px"> |
|||
</el-table-column> |
|||
<el-table-column prop="storeName" label="门店" align="center" > |
|||
</el-table-column> |
|||
<el-table-column prop="dataDate" label="日期" sortable align="center" width="150px"> |
|||
</el-table-column> |
|||
<el-table-column prop="salesAmount" label="销售额" align="center" width="100px"> |
|||
</el-table-column> |
|||
<el-table-column prop="proportion" label="成本信息" align="center" :formatter="to2" > |
|||
<template slot-scope="scope"> |
|||
<div slot="reference" class="name-wrapper" v-for="(item,index) in scope.row.proportion" :key="index"> |
|||
<div slot="reference" v-for="(item,index) in item" :key="index" > |
|||
<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.brandName" placeholder="请选择品牌" style="width: 120px;margin-left: 10px;" @change="change($event)"> |
|||
<el-option v-for="(item, i) in ListName" :key="i" :label="item.name" :value="item.name" /> |
|||
</el-select> |
|||
<span style="font-size: 16px;font-weight: 500;margin-left: 10px;">门店</span> |
|||
<el-select v-model="queryParams.params.storeName" placeholder="请选择门店" style="width: 120px;margin-left: 10px;" :disabled="chooseStore"> |
|||
<el-option v-for="(item, i) in apparatusListName" :key="i" :label="item.name" :value="item.name" /> |
|||
</el-select> |
|||
<el-form-item label="到货日期" style="margin-left: 10px;margin-top: 3px;"> |
|||
<el-date-picker v-model="queryParams.params.fromTime" type="date" clearable :picker-options="pickerOptions" value-format="yyyy-MM-dd" placeholder="选择日期" /> |
|||
<span style="padding: 0 8px">至</span> |
|||
<el-date-picker v-model="queryParams.params.endTime" type="date" clearable :picker-options="pickerOptions" value-format="yyyy-MM-dd" placeholder="选择日期" /> |
|||
</el-form-item> |
|||
<el-button type="primary" size="small" icon="el-icon-search" @click="dosearch">查询</el-button> |
|||
<el-button type="primary" size="small" icon="el-icon-refresh" @click="resetSearch">重置</el-button> |
|||
<el-button type="primary" size="small" icon="el-icon-refresh" style="margin-left: 108px;" @click="captruedatas()">手动抓取</el-button> |
|||
</el-form> |
|||
</div> |
|||
<div class="listconadd" style="padding: 20px;"> |
|||
<el-table v-loading="tableLoading" :default-sort="{prop: 'date', order: 'descending'}" :data="tableData" border style="width: 100%"> |
|||
<el-table-column label="序号" width="55px" :index="indexMethod" type="index" align="center" /> |
|||
<el-table-column prop="enpName" label="厂家" width="100px" align="center" /> |
|||
<el-table-column prop="name" label="品牌" align="center" width="100px" /> |
|||
<el-table-column prop="storeName" label="门店" align="center" /> |
|||
<el-table-column prop="dataDate" label="日期" sortable align="center" width="150px" /> |
|||
<el-table-column prop="salesAmount" label="销售额" align="center" width="100px" /> |
|||
<el-table-column prop="proportion" label="成本信息" align="center" :formatter="to2"> |
|||
<template slot-scope="scope"> |
|||
<div v-for="(item,index) in scope.row.proportion" slot="reference" :key="index" class="name-wrapper"> |
|||
<div v-for="(item,index) in item" slot="reference" :key="index"> |
|||
{{ item }} |
|||
</div> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column prop="totalCount" label="合计成本金额" align="center" width="100px" :formatter="to2" > |
|||
</el-table-column> |
|||
<el-table-column label="明细信息" align="center" width="170px"> |
|||
<template slot-scope="scope"> |
|||
<el-button |
|||
type="primary" |
|||
size="mini" |
|||
@click="purchase(scope.row)" |
|||
> |
|||
采购 |
|||
</el-button> |
|||
<el-button type="primary" size="mini" @click="market(scope.row)"> |
|||
销售 |
|||
</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
|
|||
<div class="pages"> |
|||
<div class="tit" /> |
|||
<!-- 翻页 --> |
|||
<pagination |
|||
:total="queryParams.total" |
|||
:page.sync="queryParams.current" |
|||
:limit.sync="queryParams.size" |
|||
@pagination="getPageList" |
|||
/> |
|||
</div> |
|||
<!-- 销售详细信息 --> |
|||
<el-dialog |
|||
:title="dialogTitle + '详细信息'" |
|||
:visible.sync="editDialog" |
|||
width="70%" |
|||
> |
|||
<el-table ref="datalist" @mouseover.native="mouseEnter()" @mouseout.native="mouseLeave()" :data="tableXiaoshou" height="420" border style="width: 100%"> |
|||
<el-table-column |
|||
property="dataDate" |
|||
label="数据日期" |
|||
width="100px" |
|||
align="center" |
|||
></el-table-column> |
|||
<el-table-column |
|||
property="storeName" |
|||
label="门店名称" |
|||
align="center" |
|||
></el-table-column> |
|||
<el-table-column |
|||
property="dishesName" |
|||
label="菜品名称" |
|||
align="center" |
|||
></el-table-column> |
|||
<el-table-column |
|||
property="salesCount" |
|||
label="数量" |
|||
width="100px" |
|||
align="center" |
|||
></el-table-column> |
|||
<el-table-column |
|||
property="unit" |
|||
label="规格单位" |
|||
width="100px" |
|||
align="center" |
|||
></el-table-column> |
|||
<el-table-column |
|||
property="salesPrice" |
|||
label="单价(元)" |
|||
width="100px" |
|||
align="center" |
|||
></el-table-column> |
|||
</el-table-column> |
|||
<el-table-column prop="totalCount" label="合计成本金额" align="center" width="100px" :formatter="to2" /> |
|||
<el-table-column label="明细信息" align="center" width="170px"> |
|||
<template slot-scope="scope"> |
|||
<el-button type="primary" size="mini" @click="purchase(scope.row)"> |
|||
采购 |
|||
</el-button> |
|||
<el-button type="primary" size="mini" @click="market(scope.row)"> |
|||
销售 |
|||
</el-button> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
</el-dialog> |
|||
|
|||
<div class="pages"> |
|||
<div class="tit" /> |
|||
<!-- 翻页 --> |
|||
<pagination :total="queryParams.total" :page.sync="queryParams.current" :limit.sync="queryParams.size" @pagination="getPageList" /> |
|||
</div> |
|||
<!-- 销售详细信息 --> |
|||
<el-dialog :title="dialogTitle + '详细信息'" :visible.sync="editDialog" width="70%"> |
|||
<el-table ref="datalist" :data="tableXiaoshou" height="420" border style="width: 100%" @mouseover.native="mouseEnter()" @mouseout.native="mouseLeave()"> |
|||
<el-table-column property="dataDate" label="数据日期" width="100px" align="center" /> |
|||
<el-table-column property="storeName" label="门店名称" align="center" /> |
|||
<el-table-column property="dishesName" label="菜品名称" align="center" /> |
|||
<el-table-column property="salesCount" label="数量" width="100px" align="center" /> |
|||
<el-table-column property="unit" label="规格单位" width="100px" align="center" /> |
|||
<el-table-column property="salesPrice" label="单价(元)" width="100px" align="center" /> |
|||
</el-table> |
|||
</el-dialog> |
|||
</div> |
|||
|
|||
<!-- 采购详细信息 --> |
|||
<el-dialog |
|||
:title="dialogTitle + '详细信息'" |
|||
:visible.sync="entry" |
|||
width="70%" |
|||
> |
|||
<el-table ref="datalist" @mouseover.native="mouseEnter()" @mouseout.native="mouseLeave()" :data="tableCaigou" height="420" border style="width: 100%"> |
|||
<el-table-column |
|||
property="dataDate" |
|||
width="100px" |
|||
label="数据日期" |
|||
align="center" |
|||
></el-table-column> |
|||
<el-table-column |
|||
property="storeName" |
|||
label="门店名称" |
|||
align="center" |
|||
></el-table-column> |
|||
<el-table-column |
|||
property="purchaseDate" |
|||
label="采购日期" |
|||
align="center" |
|||
width="100px" |
|||
></el-table-column> |
|||
<el-table-column |
|||
property="materialName" |
|||
label="物料名称" |
|||
align="center" |
|||
></el-table-column> |
|||
<el-dialog :title="dialogTitle + '详细信息'" :visible.sync="entry" width="70%"> |
|||
<el-table ref="datalist" :data="tableCaigou" height="420" border style="width: 100%" @mouseover.native="mouseEnter()" @mouseout.native="mouseLeave()"> |
|||
<el-table-column property="dataDate" width="100px" label="数据日期" align="center" /> |
|||
<el-table-column property="storeName" label="门店名称" align="center" /> |
|||
<el-table-column property="purchaseDate" label="采购日期" align="center" width="100px" /> |
|||
<el-table-column property="materialName" label="物料名称" align="center" /> |
|||
<!-- <el-table-column |
|||
property="unit" |
|||
label="规格单位" |
|||
></el-table-column> --> |
|||
<el-table-column |
|||
property="purchaseCount" |
|||
label="采购数量" |
|||
align="center" |
|||
width="100px" |
|||
></el-table-column> |
|||
<el-table-column |
|||
property="purchaseAmount" |
|||
label="采购金额(元)" |
|||
align="center" |
|||
width="100px" |
|||
></el-table-column> |
|||
<el-table-column |
|||
property="taxPrice" |
|||
width="100px" |
|||
align="center" |
|||
label="含税单价" |
|||
></el-table-column> |
|||
<el-table-column property="purchaseCount" label="采购数量" align="center" width="100px" /> |
|||
<el-table-column property="purchaseAmount" label="采购金额(元)" align="center" width="100px" /> |
|||
<el-table-column property="taxPrice" width="100px" align="center" label="含税单价" /> |
|||
</el-table> |
|||
</el-dialog> |
|||
|
|||
<!-- 手动抓取数据 --> |
|||
<el-dialog |
|||
:title="dialogTitle + '数据'" |
|||
:visible.sync="captrue" |
|||
width="40%"> |
|||
<el-form :model="ruleForm" ref="ruleForm" label-width="100px" class="demo-ruleForm"> |
|||
<el-form-item label="抓取时间" required> |
|||
<el-col :span="11"> |
|||
<el-form-item > |
|||
<el-date-picker type="date" placeholder="选择日期" value-format="yyyy-MM-dd" :picker-options="pickerOptions" v-model="ruleForm.time" style="width: 100%;"></el-date-picker> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-form-item> |
|||
<el-form-item label="抓取内容" required> |
|||
<el-checkbox label="抓取实时金额" v-model="ruleForm.data.salesAmount"></el-checkbox> |
|||
<el-checkbox label="抓取采购信息" v-model="ruleForm.data.purchase"></el-checkbox> |
|||
<el-checkbox label="抓取菜品销量信息" v-model="ruleForm.data.salesDishes"></el-checkbox> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" @click="submitForm()">立即抓取</el-button> |
|||
<el-button @click="resetForm()">重置</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
|
|||
<!-- 手动抓取数据 --> |
|||
<el-dialog :title="dialogTitle + '数据'" :visible.sync="captrue" width="40%"> |
|||
<el-form ref="ruleForm" :model="ruleForm" label-width="100px" class="demo-ruleForm"> |
|||
<el-form-item label="抓取时间" required> |
|||
<el-col :span="11"> |
|||
<el-form-item> |
|||
<el-date-picker v-model="ruleForm.time" type="date" placeholder="选择日期" value-format="yyyy-MM-dd" :picker-options="pickerOptions" style="width: 100%;" /> |
|||
</el-form-item> |
|||
</el-col> |
|||
</el-form-item> |
|||
<el-form-item label="抓取内容" required> |
|||
<el-checkbox v-model="ruleForm.data.salesAmount" label="抓取实时金额" /> |
|||
<el-checkbox v-model="ruleForm.data.salesDishes" label="抓取菜品销量信息" /> |
|||
<el-checkbox v-model="ruleForm.data.purchase" label="抓取采购信息" /> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" @click="submitForm()">立即抓取</el-button> |
|||
<el-button @click="resetForm()">重置</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</el-dialog> |
|||
</div> |
|||
</div> |
|||
</template> |
|||
|
|||
<script> |
|||
import {listPage,selectPurchaseList,selectSalesDishes,handCrawl,selectBrandList,selectStoreList} from '@/api/Zhj/inquireStatistics/index.js' |
|||
import Pagination from '@/components/pagination' |
|||
export default { |
|||
components: { |
|||
Pagination |
|||
}, |
|||
data() { |
|||
return { |
|||
rollPx:1, |
|||
rolltime:50, |
|||
dialogTitle: "", |
|||
editDialog: false, |
|||
entry: false, |
|||
tableLoading: false, |
|||
captrue:false, |
|||
form: {}, |
|||
rolltimmer:'', |
|||
chooseStore:true, |
|||
formBackup: Object.assign({}, this.form), |
|||
apparatusListName:{}, |
|||
ListName:{}, |
|||
tableData: [], |
|||
tableCaigou:[], |
|||
tableXiaoshou:[], |
|||
student: {}, |
|||
captrueData:{}, |
|||
ruleForm: { |
|||
|
|||
<script> |
|||
import { |
|||
listPage, |
|||
selectPurchaseList, |
|||
selectSalesDishes, |
|||
handCrawl, |
|||
selectBrandList, |
|||
selectStoreList |
|||
} from '@/api/Zhj/inquireStatistics/index.js' |
|||
import Pagination from '@/components/pagination' |
|||
export default { |
|||
components: { |
|||
Pagination |
|||
}, |
|||
data() { |
|||
return { |
|||
rollPx: 1, |
|||
rolltime: 50, |
|||
dialogTitle: '', |
|||
editDialog: false, |
|||
entry: false, |
|||
tableLoading: false, |
|||
captrue: false, |
|||
form: {}, |
|||
rolltimmer: '', |
|||
chooseStore: true, |
|||
formBackup: Object.assign({}, this.form), |
|||
apparatusListName: {}, |
|||
ListName: {}, |
|||
tableData: [], |
|||
tableCaigou: [], |
|||
tableXiaoshou: [], |
|||
student: {}, |
|||
captrueData: {}, |
|||
ruleForm: { |
|||
time: '', |
|||
data:{ |
|||
salesAmount:'', |
|||
purchase:'', |
|||
salesDishes:'' |
|||
data: { |
|||
salesAmount: '', |
|||
purchase: '', |
|||
salesDishes: '' |
|||
} |
|||
}, |
|||
queryParams: { |
|||
current: 1, |
|||
size: 10, |
|||
total: 0, |
|||
params: { |
|||
StoreName: "", |
|||
brandName: "", |
|||
fromTime: "", |
|||
endTime: "", |
|||
queryParams: { |
|||
current: 1, |
|||
size: 10, |
|||
total: 0, |
|||
params: { |
|||
StoreName: '', |
|||
brandName: '', |
|||
fromTime: '', |
|||
endTime: '' |
|||
} |
|||
}, |
|||
}, |
|||
pickerOptions:{ |
|||
disabledDate(time){ |
|||
return time.getTime()> Date.now()- 8.64e7;// 如果没有后面的-8.64e7就是不可以选择今天的 |
|||
pickerOptions: { |
|||
disabledDate(time) { |
|||
return time.getTime() > Date.now() - 8.64e7 // 如果没有后面的-8.64e7就是不可以选择今天的 |
|||
} |
|||
} |
|||
} |
|||
}; |
|||
}, |
|||
mounted() { |
|||
selectBrandList().then((res)=>{ |
|||
this.ListName = res.data |
|||
}) |
|||
}, |
|||
created() { |
|||
this.getPageList() |
|||
}, |
|||
methods: { |
|||
resetSearch() { |
|||
// 重置 |
|||
this.queryParams = { |
|||
total: 0, // 默认数据总数 |
|||
current: 1, // 默认开始页面 |
|||
size: 10, // 每页的数据条数 |
|||
params: { |
|||
StoreName: "", |
|||
brandName:'', |
|||
fromTime: "", |
|||
endTime: "", |
|||
}, |
|||
}; |
|||
this.chooseStore=true |
|||
this.getPageList(); |
|||
}, |
|||
to2(row,col,val){ |
|||
return parseFloat(val).toFixed(2) |
|||
}, |
|||
getPageList() { |
|||
this.tableLoading = true |
|||
const _this=this |
|||
listPage(this.queryParams).then((res) => { |
|||
this.tableLoading = false |
|||
if (res.success) { |
|||
this.queryParams.total = res.data.total |
|||
_this.tableData=res.data.records |
|||
console.log(res.data.records[0].proportion[0]); |
|||
} else { |
|||
// 根据resp.code进行异常情况处理 |
|||
_this.tableData = [] |
|||
this.queryParams.total = 0 |
|||
} |
|||
}).catch(() => { |
|||
this.tableLoading = false |
|||
mounted() { |
|||
selectBrandList().then((res) => { |
|||
this.ListName = res.data |
|||
}) |
|||
}, |
|||
// 序号 |
|||
indexMethod(index) { |
|||
created() { |
|||
this.getPageList() |
|||
}, |
|||
methods: { |
|||
resetSearch() { |
|||
// 重置 |
|||
this.queryParams = { |
|||
total: 0, // 默认数据总数 |
|||
current: 1, // 默认开始页面 |
|||
size: 10, // 每页的数据条数 |
|||
params: { |
|||
StoreName: '', |
|||
brandName: '', |
|||
fromTime: '', |
|||
endTime: '' |
|||
} |
|||
} |
|||
this.chooseStore = true |
|||
this.getPageList() |
|||
}, |
|||
to2(row, col, val) { |
|||
return parseFloat(val).toFixed(2) |
|||
}, |
|||
getPageList() { |
|||
this.tableLoading = true |
|||
const _this = this |
|||
listPage(this.queryParams).then((res) => { |
|||
this.tableLoading = false |
|||
if (res.success) { |
|||
this.queryParams.total = res.data.total |
|||
_this.tableData = res.data.records |
|||
console.log(res.data.records[0].proportion[0]) |
|||
} else { |
|||
// 根据resp.code进行异常情况处理 |
|||
_this.tableData = [] |
|||
this.queryParams.total = 0 |
|||
} |
|||
}).catch(() => { |
|||
this.tableLoading = false |
|||
}) |
|||
}, |
|||
// 序号 |
|||
indexMethod(index) { |
|||
var pagestart = (this.queryParams.current - 1) * this.queryParams.size |
|||
var pageindex = index + 1 + pagestart |
|||
return pageindex |
|||
}, |
|||
// 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)); |
|||
// }, |
|||
reset() { |
|||
this.form = {}; |
|||
}, |
|||
// 获取品牌门店 |
|||
change(e){ |
|||
if(e){ |
|||
this.chooseStore=false |
|||
selectStoreList({ brandName: e}).then((res)=>{ |
|||
this.apparatusListName=res.data |
|||
}) |
|||
} |
|||
}, |
|||
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; |
|||
selectSalesDishes(row).then((res)=>{ |
|||
this.tableXiaoshou=res.data |
|||
}) |
|||
}, |
|||
// 查询某天的数据 |
|||
dosearch() { |
|||
this.getPageList(); |
|||
}, |
|||
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(); |
|||
}, |
|||
// 手动抓取数据 |
|||
captruedatas(){ |
|||
this.dialogTitle = "抓取"; |
|||
this.captrue=true |
|||
}, |
|||
submitForm() { |
|||
if(this.ruleForm.time===''){ |
|||
this.$message({ |
|||
showClose: true, |
|||
message: '请选择时间', |
|||
type: 'warning' |
|||
}); |
|||
}else if(this.ruleForm.data.salesAmount || this.ruleForm.data.purchase || this.ruleForm.data.salesDishes){ |
|||
this.captrue=false |
|||
handCrawl(this.ruleForm).then((res)=>{ |
|||
if(res.code==200){ |
|||
this.$message({ |
|||
message: '抓取成功', |
|||
type: 'success' |
|||
}); |
|||
this.resetForm() |
|||
this.getPageList(); |
|||
} |
|||
// 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)); |
|||
// }, |
|||
reset() { |
|||
this.form = {} |
|||
}, |
|||
// 获取品牌门店 |
|||
change(e) { |
|||
if (e) { |
|||
this.chooseStore = false |
|||
selectStoreList({ |
|||
brandName: e |
|||
}).then((res) => { |
|||
this.apparatusListName = res.data |
|||
}) |
|||
} |
|||
}, |
|||
store() { |
|||
console.log(777777777) |
|||
}, |
|||
purchase(row) { |
|||
this.dialogTitle = '采购' |
|||
this.entry = true |
|||
selectPurchaseList(row).then((res) => { |
|||
this.tableCaigou = res.data |
|||
}) |
|||
}else{ |
|||
this.$message({ |
|||
showClose: true, |
|||
message: '请至少选择一条数据', |
|||
type: 'warning' |
|||
}); |
|||
} |
|||
}, |
|||
resetForm() { |
|||
this.ruleForm= { |
|||
}, |
|||
market(row) { |
|||
this.dialogTitle = '销售' |
|||
this.editDialog = true |
|||
selectSalesDishes(row).then((res) => { |
|||
this.tableXiaoshou = res.data |
|||
}) |
|||
}, |
|||
// 查询某天的数据 |
|||
dosearch() { |
|||
this.getPageList() |
|||
}, |
|||
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() |
|||
}, |
|||
// 手动抓取数据 |
|||
captruedatas() { |
|||
this.dialogTitle = '抓取' |
|||
this.captrue = true |
|||
}, |
|||
submitForm() { |
|||
if (this.ruleForm.time === '') { |
|||
this.$message({ |
|||
showClose: true, |
|||
message: '请选择时间', |
|||
type: 'warning' |
|||
}) |
|||
} else if (this.ruleForm.data.salesAmount || this.ruleForm.data.purchase || this.ruleForm.data.salesDishes) { |
|||
console.log('KKKKK ', this.ruleForm) |
|||
handCrawl(this.ruleForm).then((res) => { |
|||
console.log('handCrawl--res', res) |
|||
if (res.success) { |
|||
this.$message({ |
|||
message: '抓取成功', |
|||
type: 'success' |
|||
}) |
|||
this.captrue = false |
|||
this.resetForm() |
|||
this.getPageList() |
|||
} |
|||
}).catch(e => { |
|||
console.log('handCrawl--eee', e) |
|||
}) |
|||
} else { |
|||
this.$message({ |
|||
showClose: true, |
|||
message: '请至少选择一条数据', |
|||
type: 'warning' |
|||
}) |
|||
} |
|||
}, |
|||
resetForm() { |
|||
this.ruleForm = { |
|||
time: '', |
|||
data:{ |
|||
salesAmount:'', |
|||
purchase:'', |
|||
salesDishes:'' |
|||
data: { |
|||
salesAmount: '', |
|||
purchase: '', |
|||
salesDishes: '' |
|||
} |
|||
} |
|||
} |
|||
} |
|||
}, |
|||
}; |
|||
} |
|||
</script> |
|||
|
|||
<style scoped="scoped" > |
|||
|
|||
/deep/ .el-dialog__title{ |
|||
|
|||
<style scoped="scoped"> |
|||
/deep/ .el-dialog__title { |
|||
color: #000; |
|||
font-size: 24px; |
|||
} |
|||
.my-tabs { |
|||
margin-top: 10px; |
|||
} |
|||
</style> |
|||
|
|||
|
|||
.my-tabs { |
|||
margin-top: 10px; |
|||
} |
|||
</style> |
|||
|
Loading…
Reference in new issue