|
@@ -8,7 +8,7 @@
|
|
<router-view v-else />
|
|
<router-view v-else />
|
|
</transition>
|
|
</transition>
|
|
<!-- 通知框 -->
|
|
<!-- 通知框 -->
|
|
- <notify-box />
|
|
|
|
|
|
+ <notify-box :mes-type="mesType" @reset="handleReset" />
|
|
<zj-watermark color="rgba(200,200,200,.3)" position="absolute" :str="str" z-index="99" />
|
|
<zj-watermark color="rgba(200,200,200,.3)" position="absolute" :str="str" z-index="99" />
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</section>
|
|
@@ -17,12 +17,23 @@
|
|
<script>
|
|
<script>
|
|
import { mapGetters } from 'vuex'
|
|
import { mapGetters } from 'vuex'
|
|
import { setModuleId } from '@/utils/request'
|
|
import { setModuleId } from '@/utils/request'
|
|
|
|
+import { getListInvoiceOrder } from '@/api/dashboard'
|
|
import NotifyBox from '@/components/NotifyBox'
|
|
import NotifyBox from '@/components/NotifyBox'
|
|
export default {
|
|
export default {
|
|
name: 'AppMain',
|
|
name: 'AppMain',
|
|
components: {
|
|
components: {
|
|
NotifyBox
|
|
NotifyBox
|
|
},
|
|
},
|
|
|
|
+ data() {
|
|
|
|
+ return {
|
|
|
|
+ currentPage: 1,
|
|
|
|
+ pageSize: 10,
|
|
|
|
+ listTotal: 0,
|
|
|
|
+ invoiceOrderList: [],
|
|
|
|
+ timer: null,
|
|
|
|
+ mesType: null
|
|
|
|
+ }
|
|
|
|
+ },
|
|
computed: {
|
|
computed: {
|
|
...mapGetters(['show']),
|
|
...mapGetters(['show']),
|
|
cachedViews() {
|
|
cachedViews() {
|
|
@@ -42,6 +53,66 @@ export default {
|
|
},
|
|
},
|
|
beforeCreate() {
|
|
beforeCreate() {
|
|
setModuleId(this.$route.meta.moduleId)
|
|
setModuleId(this.$route.meta.moduleId)
|
|
|
|
+ },
|
|
|
|
+ mounted() {
|
|
|
|
+ this.handleInterVal()
|
|
|
|
+ },
|
|
|
|
+ methods: {
|
|
|
|
+ handleInterVal() {
|
|
|
|
+ this.handleClearInterVal()
|
|
|
|
+ this.timer = setInterval(() => {
|
|
|
|
+ this.getListInvoiceOrder()
|
|
|
|
+ }, 20000)
|
|
|
|
+ },
|
|
|
|
+ handleClearInterVal() {
|
|
|
|
+ clearInterval(this.timer)
|
|
|
|
+ this.timer = null
|
|
|
|
+ },
|
|
|
|
+ open() {
|
|
|
|
+ const That = this
|
|
|
|
+ this.$notify({
|
|
|
|
+ title: '通知',
|
|
|
|
+ type: 'info',
|
|
|
|
+ duration: 0,
|
|
|
|
+ position: 'bottom-right',
|
|
|
|
+ dangerouslyUseHTMLString: true,
|
|
|
|
+ message: (
|
|
|
|
+ <div>
|
|
|
|
+ 通知:您有一条新的物流通知发货单号${this.invoiceOrderList[0].id},
|
|
|
|
+ <el-link type='primary' underline={false} onClick={() => That.handleJump()}>
|
|
|
|
+ 点击查看详情
|
|
|
|
+ </el-link>
|
|
|
|
+ </div>
|
|
|
|
+ ),
|
|
|
|
+ onClose() {
|
|
|
|
+ That.handleInterVal()
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
|
|
+ // 获取物流列表
|
|
|
|
+ async getListInvoiceOrder() {
|
|
|
|
+ const data = {
|
|
|
|
+ pageSize: this.pageSize,
|
|
|
|
+ pageNum: this.currentPage
|
|
|
|
+ }
|
|
|
|
+ const res = await getListInvoiceOrder(data)
|
|
|
|
+ this.invoiceOrderList = res.data.records
|
|
|
|
+ this.listTotal = res.data.total
|
|
|
|
+ if (res.data.records.length) {
|
|
|
|
+ this.open()
|
|
|
|
+ this.handleClearInterVal()
|
|
|
|
+ } else {
|
|
|
|
+ this.handleInterVal()
|
|
|
|
+ }
|
|
|
|
+ },
|
|
|
|
+ handleJump() {
|
|
|
|
+ this.mesType = 3
|
|
|
|
+ this.$store.commit('user/showMessage', 'yes')
|
|
|
|
+ this.$notify.closeAll()
|
|
|
|
+ },
|
|
|
|
+ handleReset() {
|
|
|
|
+ this.mesType = null
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
</script>
|