|
@@ -2,32 +2,35 @@
|
|
|
<div class="consump-layout">
|
|
|
<div class="c-header">
|
|
|
<ul class="tab-list">
|
|
|
- <li @click="active = i" :class="{active:i===active}" v-for="(item,i) in tabList" :key="i">
|
|
|
+ <li @click="active = i" :class="{active:i===active}" v-for="(item,i) in langSpending.tabList" :key="i">
|
|
|
{{item.name}}
|
|
|
</li>
|
|
|
</ul>
|
|
|
- <div v-if="active===2" class="tab-select" ref="invoiceMenu" @click="tabActive=!tabActive" :class="{'tab-active':tabActive}">
|
|
|
+ <div v-if="active===2 && !deviceLogin" class="tab-select" ref="invoiceMenu" @click="tabActive=!tabActive" :class="{'tab-active':tabActive}">
|
|
|
{{activeType}}
|
|
|
<ul>
|
|
|
<li v-for="(item,i) in cameraList" @click="selectCamTy(item)" :key="i">{{item.name}}</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
- <div class="tab-search" v-else>
|
|
|
- <input v-model="searchKey" @keyup.enter="getList(searchKey)" type="text" placeholder="搜索设备ID">
|
|
|
- <i class="iconfont icon-sousuo" @click="getList(searchKey)"></i>
|
|
|
+ <div class="tab-search" v-else :style="{border:!deviceLogin?'1px solid #ccc':'none'}">
|
|
|
+ <template v-if="!deviceLogin">
|
|
|
+ <input v-model="searchKey" @keyup.enter="getList(searchKey)" type="text" placeholder="搜索设备ID">
|
|
|
+ <i class="iconfont icon-sousuo" @click="getList(searchKey)"></i>
|
|
|
+ </template>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="invoices" v-if="active===2">
|
|
|
<span>设备</span>
|
|
|
- <div class="tab-select" ref="deviceMenu" @click="deviceActive=!deviceActive" :class="{'tab-active':deviceActive}">
|
|
|
+ <div v-if="!deviceLogin" class="tab-select" ref="deviceMenu" @click="deviceActive=!deviceActive" :class="{'tab-active':deviceActive}">
|
|
|
{{activeDevice}}
|
|
|
<ul>
|
|
|
<li @click="selectInId({childName:'全部',id:''})">全部</li>
|
|
|
<li v-for="(item,i) in invoicedevice" @click="selectInId(item)" :key="i" >{{item.childName}}</li>
|
|
|
</ul>
|
|
|
</div>
|
|
|
+ <span v-else>{{deviceLogin}} </span>
|
|
|
<span>可开票额度(元){{max}}</span>
|
|
|
- <div class="btn parmary" @click="openInvice">开票</div>
|
|
|
+ <div class="btn default" :class="{parmary:max>0&&!deviceLogin}" @click="openInvice">开票</div>
|
|
|
</div>
|
|
|
|
|
|
<tableList :header='tabHeader' :data='data' class="table-list" >
|
|
@@ -80,6 +83,12 @@ let invoceStatusType = {
|
|
|
1: '已开票'
|
|
|
}
|
|
|
|
|
|
+let invoiceType = {
|
|
|
+ 1: '不需要发票',
|
|
|
+ 2: '增值税普通发票',
|
|
|
+ 3: '增值税专用发票'
|
|
|
+}
|
|
|
+
|
|
|
export default {
|
|
|
components: {
|
|
|
tableList,
|
|
@@ -129,12 +138,13 @@ export default {
|
|
|
activeType: '全部',
|
|
|
activeId: '',
|
|
|
activeTypeId: ''
|
|
|
-
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
...mapState({
|
|
|
token: state => state.user.token,
|
|
|
+ langSpending: state => state.language.home.manage.Spending,
|
|
|
+ deviceLogin: state => state.user.deviceLogin,
|
|
|
myexpansion: state => {
|
|
|
let type = Object.prototype.toString.call(state.user.myexpansion)
|
|
|
if (type === '[object Object]') {
|
|
@@ -190,6 +200,7 @@ export default {
|
|
|
this.tabHeader = recharge
|
|
|
break
|
|
|
case 2:
|
|
|
+ this.getInvoiceMax(0)
|
|
|
this.getAllDevice()
|
|
|
this.tabHeader = invoice
|
|
|
break
|
|
@@ -223,8 +234,8 @@ export default {
|
|
|
let params = {
|
|
|
max: this.max,
|
|
|
cameraId: this.activeId
|
|
|
- }
|
|
|
- this.$toast.showInvoice(params)
|
|
|
+ };
|
|
|
+ (this.max && !this.deviceLogin) && this.$toast.showInvoice(params)
|
|
|
},
|
|
|
async getAllDevice (searchKey = '') {
|
|
|
let params = {
|
|
@@ -232,14 +243,22 @@ export default {
|
|
|
}
|
|
|
await this.$store.dispatch('getInvoiceDevice', params)
|
|
|
},
|
|
|
+
|
|
|
+ // 扩容记录
|
|
|
async getConsumpList (searchKey = '') {
|
|
|
- let params = {
|
|
|
- childName: searchKey,
|
|
|
- pageNum: searchKey ? 1 : this.currentPage,
|
|
|
- pageSize: this.pageSize
|
|
|
+ if (this.deviceLogin) {
|
|
|
+ searchKey = this.deviceLogin
|
|
|
}
|
|
|
- await this.$store.dispatch('getUserExpansion', params)
|
|
|
- if (!this.myexpansion.total && searchKey) {
|
|
|
+ let data = {
|
|
|
+ params: {
|
|
|
+ childName: searchKey,
|
|
|
+ pageNum: searchKey ? 1 : this.currentPage,
|
|
|
+ pageSize: this.pageSize
|
|
|
+ },
|
|
|
+ url: this.deviceLogin ? '/device/virtualOrder/expansionList' : '/user/virtualOrder/expansionList'
|
|
|
+ }
|
|
|
+ await this.$store.dispatch('getUserExpansion', data)
|
|
|
+ if (!this.myexpansion.total && searchKey && !this.deviceLogin) {
|
|
|
return this.$toast.show('warn', '没有找到相应的记录', () => {
|
|
|
this.getList()
|
|
|
})
|
|
@@ -249,7 +268,7 @@ export default {
|
|
|
this.data = this.myexpansion.list
|
|
|
this.data.forEach(item => {
|
|
|
item['unitSize'] = item['unitSize'] + item['unit']
|
|
|
- item['channel'] = '扩充容量购买'
|
|
|
+ item['channel'] = '扩充容量'
|
|
|
item['payType'] = PAYSSTR[item['payType']]
|
|
|
})
|
|
|
},
|
|
@@ -269,14 +288,22 @@ export default {
|
|
|
if (data.code !== 0) return
|
|
|
this.max = data.data.maxInvoice
|
|
|
},
|
|
|
+
|
|
|
+ // 充值记录
|
|
|
async getChargeList (searchKey = '') {
|
|
|
- let params = {
|
|
|
- childName: searchKey,
|
|
|
- pageNum: searchKey ? 1 : this.currentPage,
|
|
|
- pageSize: this.pageSize
|
|
|
+ if (this.deviceLogin) {
|
|
|
+ searchKey = this.deviceLogin
|
|
|
}
|
|
|
- await this.$store.dispatch('getChargeList', params)
|
|
|
- if (!this.mycharge.total && searchKey) {
|
|
|
+ let data = {
|
|
|
+ params: {
|
|
|
+ childName: searchKey,
|
|
|
+ pageNum: searchKey ? 1 : this.currentPage,
|
|
|
+ pageSize: this.pageSize
|
|
|
+ },
|
|
|
+ url: this.deviceLogin ? '/device/virtualOrder/chargeList' : '/user/virtualOrder/chargeList'
|
|
|
+ }
|
|
|
+ await this.$store.dispatch('getChargeList', data)
|
|
|
+ if (!this.mycharge.total && searchKey && !this.deviceLogin) {
|
|
|
return this.$toast.show('warn', '没有找到相应的记录', () => {
|
|
|
this.getList()
|
|
|
})
|
|
@@ -288,20 +315,27 @@ export default {
|
|
|
item['status'] = rechargeType[item['status']]
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
+ // 发票记录
|
|
|
async getInvoiceList () {
|
|
|
- let params = {
|
|
|
- cameraId: this.activeId,
|
|
|
- pageNum: this.currentPage,
|
|
|
- pageSize: this.pageSize,
|
|
|
- type: this.activeTypeId
|
|
|
+ let data = {
|
|
|
+ params: {
|
|
|
+ cameraId: this.activeId,
|
|
|
+ pageNum: this.currentPage,
|
|
|
+ pageSize: this.pageSize,
|
|
|
+ type: this.activeTypeId
|
|
|
+ },
|
|
|
+ url: this.deviceLogin ? '/device/invoice/list' : '/user/invoice/list'
|
|
|
}
|
|
|
- await this.$store.dispatch('getInvoiceList', params)
|
|
|
+
|
|
|
+ await this.$store.dispatch('getInvoiceList', data)
|
|
|
this.pageSize = this.myinvoicelist.pageSize
|
|
|
this.total = this.myinvoicelist.total || 0
|
|
|
this.data = this.myinvoicelist.list
|
|
|
this.data.forEach(item => {
|
|
|
item['detail'] = '详细'
|
|
|
item['finish'] = invoceStatusType[item['finish']]
|
|
|
+ item['type'] = invoiceType[item['type']]
|
|
|
})
|
|
|
}
|
|
|
},
|
|
@@ -332,13 +366,19 @@ $border-color: #d9d9d9;
|
|
|
text-align: center;
|
|
|
cursor: pointer;
|
|
|
}
|
|
|
- .parmary {
|
|
|
- background-color: $theme-color;
|
|
|
- width: 88px;
|
|
|
- height: 28px;
|
|
|
- line-height: 28px;
|
|
|
- font-size: 14px;
|
|
|
- }
|
|
|
+.default {
|
|
|
+ width: 88px;
|
|
|
+ height: 28px;
|
|
|
+ line-height: 28px;
|
|
|
+ font-size: 14px;
|
|
|
+ background-color: #e7e7e7;
|
|
|
+ cursor: initial;
|
|
|
+}
|
|
|
+.parmary {
|
|
|
+ background-color: $theme-color;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+
|
|
|
.consump-layout{
|
|
|
margin: 30px 0 150px 40px;
|
|
|
padding: 38px 60px 20px 45px;
|
|
@@ -471,4 +511,16 @@ $border-color: #d9d9d9;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+@media screen and (min-width: 2000px) {
|
|
|
+ .consump-layout {
|
|
|
+ width: 75%;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+@media screen and (max-width: 1700px){
|
|
|
+ .consump-layout {
|
|
|
+ width: 92%;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
</style>
|