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