Commit 55b58f83 by lichengming

修改了登录页面和首页

parent 4af81ac8
......@@ -212,6 +212,230 @@
<!--<a @click="_goto">跳转</a>-->
</div>
</template>
<script>
import { drugStatistics } from '../api'
import {
test,
waveImg,
histogram,
saleImg,
salesTrendImg,
visitImg
} from '../api/homePage'
export default {
data() {
return {
value: '',
dateValue: '',
value2: '',
range: '本月',
activeName: 'first',
queryRange: {
day: undefined,
week: undefined,
month: 'month',
year: undefined,
beginDate: undefined,
endDate: undefined
},
date: ['今天', '本周', '本月', '本年'],
clickName: [
'_rangeDayChange',
'_rangeWeekChange',
'_rangeMonthChange',
'_rangeYearChange'
],
pitch: '_rangeDayChange',
personalData: [],
itemNotOk: [],
sampleItemNum: {},
sampleList: [
// { name: '胖大海', number: 700 },
// { name: '39感冒灵', number: 670 },
// { name: '三七', number: 410 },
// { name: '丁香', number: 400 },
// { name: '人血白蛋白成品', number: 300 },
// { name: '人血白蛋白原液', number: 296 }
]
}
},
mounted() {
this._getData()
this._getSampleRank()
this._getItemFail()
this._getSampleItemNum()
test()
},
beforeDestroy() {
// this.myChart.clear()
},
methods: {
dateChange() {
console.log('时间组件被点击')
if (this.dateValue === null) {
this._rangeMonthChange()
} else {
this.beginDate = this.dateValue[0]
this.endDate = this.dateValue[1]
console.log((this.range = this.beginDate + '至' + this.endDate))
}
},
Gather(index) {
this.pitch = index
},
_getData: async function() {
const result = await drugStatistics.getPersonalData({})
if (result) {
this.personalData = result
if (result.listSeven) {
waveImg(result.listSeven)
}
if (result.listSevenReceive) {
histogram(result.listSevenReceive)
}
}
},
_getSampleRank: async function() {
const result = await drugStatistics.getSampleRank(this.queryRange)
if (result) {
console.log('_getSampleRank', result)
this.sampleList = result
salesTrendImg(result)
}
},
_getItemFail: async function() {
const result = await drugStatistics.getItemFail(this.queryRange)
if (result) {
console.log('getItemFail', result)
this.itemNotOk = result
saleImg(result)
}
},
_getSampleItemNum: async function() {
const result = await drugStatistics.getSampleItemNum(this.queryRange)
if (result) {
this.sampleItemNum = result
visitImg(result)
}
},
_rangeDayChange(data) {
this.pitch = '_rangeDayChange'
this.dateValue = ''
this.range = '今日'
this.queryRange = {
day: 'day',
week: undefined,
month: undefined,
year: undefined,
beginDate: undefined,
endDate: undefined
}
this._getItemFail()
this._getSampleRank()
},
_rangeWeekChange(data) {
this.pitch = '_rangeWeekChange'
this.dateValue = ''
this.range = '本周'
this.queryRange = {
day: undefined,
week: 'week',
month: undefined,
year: undefined,
beginDate: undefined,
endDate: undefined
}
this._getItemFail()
this._getSampleRank()
},
_rangeMonthChange(data) {
this.pitch = '_rangeMonthChange'
this.dateValue = ''
this.range = '本月'
this.queryRange = {
day: undefined,
week: undefined,
month: 'month',
year: undefined,
beginDate: undefined,
endDate: undefined
}
this._getItemFail()
this._getSampleRank()
},
_rangeYearChange(data) {
this.pitch = '_rangeYearChange'
this.dateValue = ''
this.range = '本年'
this.queryRange = {
day: undefined,
week: undefined,
month: undefined,
year: 'year',
beginDate: undefined,
endDate: undefined
}
this._getItemFail()
this._getSampleRank()
}
}
}
</script>
<style scoped>
.actived {
color: red !important;
}
.serial {
display: inline-block;
width: 30px;
height: 30px;
background-color: #f5f5f5;
line-height: 30px;
border: 0px solid black;
border-radius: 48px;
margin-right: 3px;
color: white;
}
.databox {
margin-left: 20px;
}
.el-date-editor .el-range-separator {
width: 100px !important;
}
.shopNameList li:nth-child(-n + 3) .serial {
background-color: #3398db;
}
/*.el-row {*/
/* margin-bottom: 20px;*/
/*}*/
/*.el-col {*/
/* border-radius: 4px;*/
/*}*/
/*.bg-purple-dark {*/
/* background: #99a9bf;*/
/*}*/
.bg-purple {
background: #d3dce6;
}
/*.bg-purple-light {*/
/* background: #e5e9f2;*/
/*}*/
.grid-content {
border-radius: 4px;
min-height: 36px;
background-color: #f5f7f9;
}
/*.row-bg {*/
/* padding: 10px 0;*/
/* background-color: #f9fafc;*/
/*}*/
</style>
<style>
.databox .el-range-separator {
padding: 0px;
}
</style>
<!--<script>-->
<!--import global from '../api/config'-->
<!--export default {-->
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment