|
@@ -68,7 +68,7 @@
|
|
|
<div style="display:flex;text-align:center;background:#fff;height: 170px;">
|
|
|
<div style="width:48%;margin:auto;font-size:30px; line-height: 60px;">
|
|
|
<div>仓库总数</div>
|
|
|
- <div style="font-size:24px;">{{ topData.storeNums}}</div>
|
|
|
+ <div style="font-size:24px;">{{ topData.storeNums }}</div>
|
|
|
</div>
|
|
|
<div style="width: 1px;height: 70px;background: #999999;margin:auto;"></div>
|
|
|
<div style="width:48%;margin:auto; font-size:30px;line-height: 60px;">
|
|
@@ -180,7 +180,7 @@
|
|
|
|
|
|
<script>
|
|
|
import { STable } from '@/components'
|
|
|
-import { getWorkplaceBacklogUserPage, getWorkplaceBacklogTopData, getWorkplaceBacklogWeekData, getWorkplaceBacklogPie} from '@/api/workplace/backlog'
|
|
|
+import { getWorkplaceBacklogUserPage, getWorkplaceBacklogTopData, getWorkplaceBacklogWeekData, getWorkplaceBacklogPie } from '@/api/workplace/backlog'
|
|
|
import { Chart } from '@antv/g2'
|
|
|
export default {
|
|
|
name: 'NewWorkplaceBacklog',
|
|
@@ -211,7 +211,6 @@ export default {
|
|
|
chartPie: null,
|
|
|
chartLine: null,
|
|
|
topData: null,
|
|
|
- type: this.$route.query.type,
|
|
|
queryParam: {
|
|
|
status: 1
|
|
|
},
|
|
@@ -316,8 +315,20 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ role () {
|
|
|
+ if (this.$store.state.user.roles.join().includes('manage')) {
|
|
|
+ return 'workplace_store_manage'
|
|
|
+ } else if (this.$store.state.user.roles.join().includes('normal')) {
|
|
|
+ return 'workplace_store_normal'
|
|
|
+ } else {
|
|
|
+ return ''
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
created () {
|
|
|
this.getDict()
|
|
|
+ console.log(this.role)
|
|
|
// this.getInfo()
|
|
|
},
|
|
|
mounted () {
|
|
@@ -329,12 +340,12 @@ export default {
|
|
|
getDict () {
|
|
|
this.typeDict = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.WORKPLACE_BACKLOG_TYPE)
|
|
|
this.typeDetailDict = this.DictCache.getLabelByValueMapByType(this.DictCache.TYPE.WORKPLACE_BACKLOG_DETAIL_TYPE)
|
|
|
- getWorkplaceBacklogTopData('workplace_store_manage').then(res => {
|
|
|
+ getWorkplaceBacklogTopData(this.role).then(res => {
|
|
|
this.topData = res.data
|
|
|
})
|
|
|
},
|
|
|
getInfo () {
|
|
|
- Promise.all([getWorkplaceBacklogWeekData('workplace_store_manage'), getWorkplaceBacklogPie('workplace_store_manage')]).then(res => {
|
|
|
+ Promise.all([getWorkplaceBacklogWeekData(this.role), getWorkplaceBacklogPie(this.role)]).then(res => {
|
|
|
console.log(res)
|
|
|
this.lineData = res[0].data.inStoreDetailVOS.reduce((pre, item) => {
|
|
|
pre.push({
|
|
@@ -427,9 +438,7 @@ export default {
|
|
|
|
|
|
this.chartLine.data(data)
|
|
|
this.chartLine.scale({
|
|
|
- week: {
|
|
|
- range: [0, 1]
|
|
|
- },
|
|
|
+
|
|
|
value: {
|
|
|
min: 0,
|
|
|
nice: true
|
|
@@ -449,8 +458,14 @@ export default {
|
|
|
}
|
|
|
})
|
|
|
|
|
|
- this.chartLine.area().position('week*value').color('name').shape('smooth')
|
|
|
- this.chartLine.line().position('week*value').color('name').shape('smooth')
|
|
|
+ this.chartLine.interval().position('week*value').color('name').adjust([
|
|
|
+ {
|
|
|
+ type: 'dodge',
|
|
|
+ marginRatio: 0
|
|
|
+ }
|
|
|
+ ])
|
|
|
+
|
|
|
+ this.chartLine.interaction('active-region')
|
|
|
|
|
|
this.chartLine.render()
|
|
|
}
|