Browse Source

设备统计

devlop
mo-bai 4 years ago
parent
commit
d020108d73
3 changed files with 25 additions and 11 deletions
  1. 4
      apis/mineApi.js
  2. 18
      pages/mine/index.vue
  3. 14
      pages/paper-details/index.vue

4
apis/mineApi.js

@ -6,9 +6,9 @@ import http from '../utils/http/index.js'
* @returns 订单统计
* swagger:http://api-ops-uec-test.qniao.cn/uec/swagger-ui/index.html?urls.primaryName=CustomerApi#/%E7%99%BB%E5%BD%95%E8%AE%A4%E8%AF%81/authorizeByCaptchaUsingPOST
*/
export const getOrderStatistics = (data) => {
export const getDeviceStatistics = (data) => {
return http.get({
url: '/base-paper-trading/get/supplier/income-statistics',
url: '/base-paper-trading/get/my/mechanical-equipment/statistics',
data
})
}

18
pages/mine/index.vue

@ -38,15 +38,15 @@
</view>
<view class="flex-row justify-between equal-division_1">
<view class="flex-col items-center equal-division-item">
<text class="text_13">20</text>
<text class="text_13">{{ deviceInfo.totalNum }}</text>
<text class="text_14">设备总数()</text>
</view>
<view class="flex-col items-center equal-division-item">
<text class="text_13">14</text>
<text class="text_13">{{ deviceInfo.workingNum }}</text>
<text class="text_14">工作中()</text>
</view>
<view class="flex-col items-center equal-division-item">
<text class="text_13">6</text>
<text class="text_13">{{ deviceInfo.freeNum }}</text>
<text class="text_14">空闲()</text>
</view>
</view>
@ -113,6 +113,7 @@
import { exit, go2, loginGo2 } from '@/utils/hook.js'
import { fddEnterpriseStatus, fsAuditStatus, orderStatusEnum, enterpriseType } from '@/enums/index.js'
import { getVerifyUrl, getFsCredit, getBaseInfo, getFeisuanUrl, cancelAccount } from '@/apis/commonApi.js'
import { getDeviceStatistics } from '@/apis/mineApi'
export default {
data() {
@ -124,6 +125,11 @@ export default {
usedCreditLine: 0,
creditLine: 0
},
deviceInfo: {
totalNum: 0,
workingNum: 0,
freeNum: 0
},
fsAuditStatus: Object.freeze(fsAuditStatus),
orderStatusEnum: Object.freeze(orderStatusEnum)
}
@ -254,6 +260,12 @@ export default {
})
this.hasLogin && getBaseInfo({}, true)
!this.hasLogin && (this.fsInfo.status = -1)
this.hasLogin &&
getDeviceStatistics().then((res) => {
if (res) {
this.deviceInfo = res
}
})
}
}
</script>

14
pages/paper-details/index.vue

@ -230,12 +230,6 @@ export default {
this.params.productId = option.paperId
if (this.hasLogin) {
this.queryData()
//
getCompanyInfoById({ enterpriseId: this.$store.state.companyInfo.id }).then((res) => {
if (res) {
this.companyInfo = res
}
})
} else {
this.$store.commit('setNextPage', { name: 'paper-details', data: { paperId: option.paperId } })
go2('login', {}, true)
@ -250,6 +244,14 @@ export default {
})
}
},
onShow() {
//
getCompanyInfoById({ enterpriseId: this.$store.state.companyInfo.id }).then((res) => {
if (res) {
this.companyInfo = res
}
})
},
computed: {
buyTon() {
let num = 0

Loading…
Cancel
Save