|
@@ -3,7 +3,6 @@
|
|
|
<!-- 头 -->
|
|
<!-- 头 -->
|
|
|
<uni-nav-bar fixed="true" statusBar="true" right-icon="scan" title="首页" @clickLeft="back"
|
|
<uni-nav-bar fixed="true" statusBar="true" right-icon="scan" title="首页" @clickLeft="back"
|
|
|
@clickRight="HandlScanCode"></uni-nav-bar>
|
|
@clickRight="HandlScanCode"></uni-nav-bar>
|
|
|
- <!-- <uni-nav-bar fixed="true" statusBar="true" title="工作台"></uni-nav-bar> -->
|
|
|
|
|
|
|
|
|
|
<view class="container">
|
|
<view class="container">
|
|
|
<navigation :workOrder="workOrder" ref="navigationRef"></navigation>
|
|
<navigation :workOrder="workOrder" ref="navigationRef"></navigation>
|
|
@@ -18,145 +17,79 @@
|
|
|
|
|
|
|
|
<view class="data-middle">
|
|
<view class="data-middle">
|
|
|
<view class="cell">
|
|
<view class="cell">
|
|
|
- <view class="num">
|
|
|
|
|
- {{homeData.totalFinishedProducts}}
|
|
|
|
|
- </view>
|
|
|
|
|
<view class="label">
|
|
<view class="label">
|
|
|
成品库存总量
|
|
成品库存总量
|
|
|
</view>
|
|
</view>
|
|
|
|
|
+ <view class="num">
|
|
|
|
|
+ {{homeData.totalFinishedProducts}}
|
|
|
|
|
+ </view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="cell">
|
|
<view class="cell">
|
|
|
- <view class="num">
|
|
|
|
|
- {{homeData.totalRawMaterials}}
|
|
|
|
|
- </view>
|
|
|
|
|
<view class="label">
|
|
<view class="label">
|
|
|
物料库存总量
|
|
物料库存总量
|
|
|
</view>
|
|
</view>
|
|
|
- </view>
|
|
|
|
|
-
|
|
|
|
|
- <view class="cell">
|
|
|
|
|
<view class="num">
|
|
<view class="num">
|
|
|
- {{homeData.goodsCount}}
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="label">
|
|
|
|
|
- 商品列表
|
|
|
|
|
|
|
+ {{homeData.totalRawMaterials}}
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
- <view class="cell">
|
|
|
|
|
- <view class="num">
|
|
|
|
|
- {{homeData.yearAmount}}
|
|
|
|
|
- </view>
|
|
|
|
|
|
|
+ <view class="cell" @click="toDeviceDetail">
|
|
|
<view class="label">
|
|
<view class="label">
|
|
|
- 年度合同金额(万元)
|
|
|
|
|
|
|
+ 设备监测
|
|
|
</view>
|
|
</view>
|
|
|
- </view>
|
|
|
|
|
-
|
|
|
|
|
- <view class="cell">
|
|
|
|
|
<view class="num">
|
|
<view class="num">
|
|
|
- {{homeData.receivableAmount}}
|
|
|
|
|
|
|
+ <text style="font-size: 22rpx;">在线:</text>{{homeData.deviceOnLineCount}}
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="label">
|
|
|
|
|
- 应收金额(万元)
|
|
|
|
|
|
|
+ <view class="num">
|
|
|
|
|
+ <text style="font-size: 22rpx;">离线:</text><text style="color: #ff0000;">{{ homeData.deviceOffLineCount }}</text>
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="cell">
|
|
<view class="cell">
|
|
|
- <view class="num">
|
|
|
|
|
- {{homeData.payableAmount}}
|
|
|
|
|
- </view>
|
|
|
|
|
<view class="label">
|
|
<view class="label">
|
|
|
- 应付金额(万元)
|
|
|
|
|
|
|
+ 年度合同额(万元)
|
|
|
</view>
|
|
</view>
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
-
|
|
|
|
|
- <view class="data-rank">
|
|
|
|
|
- <view class="tab-top">
|
|
|
|
|
- <view class="tab-item" v-for="(item,index) in tabList" :key="index">
|
|
|
|
|
- <view :class="{active: activeIndex == item.index}" @click="handleTabChange(item)">
|
|
|
|
|
- {{item.name}}
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
- </view>
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- <!-- <uni-table class="table" ref="table" emptyText="暂无更多数据">
|
|
|
|
|
- <uni-tr class="table-title">
|
|
|
|
|
- <uni-th align="center" width="100">产品编码</uni-th>
|
|
|
|
|
- <uni-th align="center">名称</uni-th>
|
|
|
|
|
- <uni-th align="center" width="100">销量</uni-th>
|
|
|
|
|
- </uni-tr>
|
|
|
|
|
- <uni-tr v-for="(item, index) in tableData" :key="index">
|
|
|
|
|
- <uni-td>{{index+1}}.{{item.productCode}}</uni-td>
|
|
|
|
|
- <uni-td>{{item.productName}}</uni-td>
|
|
|
|
|
- <uni-td align="center">{{item.totalSaleCount}}</uni-td>
|
|
|
|
|
- </uni-tr>
|
|
|
|
|
- </uni-table> -->
|
|
|
|
|
-
|
|
|
|
|
- <view class="table-title" style="text-align: center;">
|
|
|
|
|
- <view class="code">产品编码</view>
|
|
|
|
|
- <view class="name">名称</view>
|
|
|
|
|
- <view class="total">销量</view>
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="table-content" v-for="(item,index) in tableData">
|
|
|
|
|
- <view class="code">
|
|
|
|
|
- <view class="index">{{index+1}}.</view>
|
|
|
|
|
- <view class="value">{{item.productCode}}</view>
|
|
|
|
|
-
|
|
|
|
|
|
|
+ <view class="num">
|
|
|
|
|
+ {{homeData.yearAmount}}
|
|
|
</view>
|
|
</view>
|
|
|
- <view class="name">{{item.productName}}</view>
|
|
|
|
|
- <view class="total">{{item.totalSaleCount}}</view>
|
|
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- </view>
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- <view class="data-bottom">
|
|
|
|
|
<view class="cell">
|
|
<view class="cell">
|
|
|
- <view class="num">
|
|
|
|
|
- {{this.homeData.yearProduceAmount}}
|
|
|
|
|
- </view>
|
|
|
|
|
<view class="label">
|
|
<view class="label">
|
|
|
- 年度生产总量
|
|
|
|
|
|
|
+ 年度应收款(万元)
|
|
|
</view>
|
|
</view>
|
|
|
- </view>
|
|
|
|
|
-
|
|
|
|
|
- <view class="cell">
|
|
|
|
|
<view class="num">
|
|
<view class="num">
|
|
|
- {{this.homeData.monthProduceAmount}}
|
|
|
|
|
- </view>
|
|
|
|
|
- <view class="label">
|
|
|
|
|
- 月生产总量
|
|
|
|
|
|
|
+ {{homeData.receivableAmount}}
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
<view class="cell">
|
|
<view class="cell">
|
|
|
- <view class="num">
|
|
|
|
|
- {{homeData.pendingAmount}}
|
|
|
|
|
- </view>
|
|
|
|
|
<view class="label">
|
|
<view class="label">
|
|
|
- 待生产总量
|
|
|
|
|
|
|
+ 年度应付款(万元)
|
|
|
|
|
+ </view>
|
|
|
|
|
+ <view class="num">
|
|
|
|
|
+ {{homeData.payableAmount}}
|
|
|
</view>
|
|
</view>
|
|
|
</view>
|
|
</view>
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
</view>
|
|
</view>
|
|
|
|
|
|
|
|
|
|
+ <!-- 通知公告 -->
|
|
|
|
|
+ <view class="notice-bar" v-if="noticeList.length > 0">
|
|
|
|
|
+ <u-icon name="volume" size="30rpx" color="#ff9900"></u-icon>
|
|
|
|
|
+ <swiper class="notice-swiper" vertical autoplay circular :interval="3000">
|
|
|
|
|
+ <swiper-item v-for="(item, index) in noticeList" :key="index" @click="toNoticeDetail(item)">
|
|
|
|
|
+ <view class="notice-content">
|
|
|
|
|
+ <text class="notice-text">{{ item.title }}</text>
|
|
|
|
|
+ <text class="notice-date">{{ item.date }}</text>
|
|
|
|
|
+ </view>
|
|
|
|
|
+ </swiper-item>
|
|
|
|
|
+ </swiper>
|
|
|
|
|
+ </view>
|
|
|
|
|
|
|
|
-
|
|
|
|
|
|
|
+ <manage ref="manageRef"></manage>
|
|
|
</view>
|
|
</view>
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- <!-- <ScanCode ref="ScanCode" :model="'uni'"></ScanCode> -->
|
|
|
|
|
</view>
|
|
</view>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -167,6 +100,7 @@
|
|
|
import mould from './pages/mould/mould.vue'
|
|
import mould from './pages/mould/mould.vue'
|
|
|
import sparePart from './pages/sparePart/sparePart.vue'
|
|
import sparePart from './pages/sparePart/sparePart.vue'
|
|
|
import ScanCode from '@/components/ScanCode.vue'
|
|
import ScanCode from '@/components/ScanCode.vue'
|
|
|
|
|
+ import manage from './pages/manage/manage.vue'
|
|
|
|
|
|
|
|
import {
|
|
import {
|
|
|
getDateNew
|
|
getDateNew
|
|
@@ -187,7 +121,9 @@
|
|
|
getGoodsPage,
|
|
getGoodsPage,
|
|
|
getProduceAmount,
|
|
getProduceAmount,
|
|
|
// getPendingAmount,
|
|
// getPendingAmount,
|
|
|
- getHotProduct
|
|
|
|
|
|
|
+ getHotProduct,
|
|
|
|
|
+ getDeviceCount,
|
|
|
|
|
+ getNoticeDocumentPage
|
|
|
}
|
|
}
|
|
|
from '@/api/home'
|
|
from '@/api/home'
|
|
|
export default {
|
|
export default {
|
|
@@ -197,12 +133,10 @@
|
|
|
Mocha,
|
|
Mocha,
|
|
|
mould,
|
|
mould,
|
|
|
sparePart,
|
|
sparePart,
|
|
|
- ScanCode
|
|
|
|
|
|
|
+ ScanCode,
|
|
|
|
|
+ manage
|
|
|
},
|
|
},
|
|
|
onShow() {
|
|
onShow() {
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
this.init()
|
|
this.init()
|
|
|
let _this = this
|
|
let _this = this
|
|
|
uni.$off('scancodedate') // 每次进来先 移除全局自定义事件监听器
|
|
uni.$off('scancodedate') // 每次进来先 移除全局自定义事件监听器
|
|
@@ -213,8 +147,14 @@
|
|
|
// this.getStatistics()
|
|
// this.getStatistics()
|
|
|
// this.Scancodedate()
|
|
// this.Scancodedate()
|
|
|
},
|
|
},
|
|
|
- onLoad() {
|
|
|
|
|
|
|
+ onReady() {
|
|
|
this.getHomeData()
|
|
this.getHomeData()
|
|
|
|
|
+ setTimeout(() => {
|
|
|
|
|
+ this.$refs.manageRef?.initCharts()
|
|
|
|
|
+ }, 300)
|
|
|
|
|
+ },
|
|
|
|
|
+ onLoad() {
|
|
|
|
|
+ // this.getHomeData()
|
|
|
// this.getStatistics()
|
|
// this.getStatistics()
|
|
|
},
|
|
},
|
|
|
onUnload() {
|
|
onUnload() {
|
|
@@ -225,6 +165,7 @@
|
|
|
},
|
|
},
|
|
|
data() {
|
|
data() {
|
|
|
return {
|
|
return {
|
|
|
|
|
+ noticeList: [],
|
|
|
roleId: null,
|
|
roleId: null,
|
|
|
timer: null,
|
|
timer: null,
|
|
|
qrContent: null,
|
|
qrContent: null,
|
|
@@ -258,7 +199,9 @@
|
|
|
payableAmount: '',
|
|
payableAmount: '',
|
|
|
yearProduceAmount: '',
|
|
yearProduceAmount: '',
|
|
|
monthProduceAmount: '',
|
|
monthProduceAmount: '',
|
|
|
- pendingAmount: ''
|
|
|
|
|
|
|
+ pendingAmount: '',
|
|
|
|
|
+ deviceOnLineCount: '',
|
|
|
|
|
+ deviceOffLineCount: '',
|
|
|
},
|
|
},
|
|
|
hotProductList: [],
|
|
hotProductList: [],
|
|
|
|
|
|
|
@@ -272,6 +215,7 @@
|
|
|
this.roleId = res.data.roleId[0]
|
|
this.roleId = res.data.roleId[0]
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
|
|
+ this.getNoticeDocumentList()
|
|
|
},
|
|
},
|
|
|
onHide() {
|
|
onHide() {
|
|
|
clearTimeout(this.timer);
|
|
clearTimeout(this.timer);
|
|
@@ -282,6 +226,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ toDeviceDetail() {
|
|
|
|
|
+ console.log('toDeviceDetail')
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: '/pages/home/components/DeviceDetail'
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ getNoticeDocumentList() {
|
|
|
|
|
+ getNoticeDocumentPage({
|
|
|
|
|
+ pageNum: 1,
|
|
|
|
|
+ size: 5,
|
|
|
|
|
+ approvalStatus: 2
|
|
|
|
|
+ }).then(res => {
|
|
|
|
|
+ console.log('getNoticeDocumentPage', res)
|
|
|
|
|
+ this.noticeList = res.list.map(item => ({
|
|
|
|
|
+ ...item,
|
|
|
|
|
+ title: item.title || item.content,
|
|
|
|
|
+ date: getDateNew(item.createTime)
|
|
|
|
|
+ }))
|
|
|
|
|
+ console.log(this.noticeList)
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ toNoticeDetail(item) {
|
|
|
|
|
+ console.log('toNoticeDetail', item)
|
|
|
|
|
+ this.$router.push({
|
|
|
|
|
+ path: '/pages/home/pages/manage/documentDetail',
|
|
|
|
|
+ query: {
|
|
|
|
|
+ id: item.id,
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ uni.navigateTo({
|
|
|
|
|
+ url: '/home/pages/manage/documentDetail?id=' + item.id
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
init() {
|
|
init() {
|
|
|
this.getStatistics()
|
|
this.getStatistics()
|
|
|
this.$refs.navigationRef && this.$refs.navigationRef.getCount()
|
|
this.$refs.navigationRef && this.$refs.navigationRef.getCount()
|
|
@@ -408,6 +385,41 @@
|
|
|
|
|
|
|
|
const res9 = await getHotProduct()
|
|
const res9 = await getHotProduct()
|
|
|
|
|
|
|
|
|
|
+ const res10 = await getDeviceCount({
|
|
|
|
|
+ size: 9999
|
|
|
|
|
+ })
|
|
|
|
|
+
|
|
|
|
|
+ let deviceData = res10.list.map((item) => {
|
|
|
|
|
+ let iotList = [];
|
|
|
|
|
+ if (item.iotPointDataList) {
|
|
|
|
|
+ item.iotPointDataList.forEach((element) => {
|
|
|
|
|
+ let data = item.iotModel.properties.find(
|
|
|
|
|
+ (iotModel) => iotModel.identifier == element.identifier
|
|
|
|
|
+ );
|
|
|
|
|
+ if (data) {
|
|
|
|
|
+ iotList.push({
|
|
|
|
|
+ ...element,
|
|
|
|
|
+ dataType: data.dataType
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ item['iotList'] = item.iotDashboardPoint.length
|
|
|
|
|
+ ? iotList.filter((iotListItem) =>
|
|
|
|
|
+ item.iotDashboardPoint.find(
|
|
|
|
|
+ (Point) =>
|
|
|
|
|
+ Point.identifier == iotListItem.identifier &&
|
|
|
|
|
+ Point.checked1
|
|
|
|
|
+ )
|
|
|
|
|
+ )
|
|
|
|
|
+ : iotList.filter((iotListItem, index) => index < 4);
|
|
|
|
|
+ return item;
|
|
|
|
|
+ });
|
|
|
|
|
+
|
|
|
|
|
+ this.homeData.deviceOnLineCount = deviceData.filter((item) => item.iotList.length > 0).length
|
|
|
|
|
+
|
|
|
|
|
+ this.homeData.deviceOffLineCount = deviceData.filter((item) => item.iotList.length == 0).length
|
|
|
|
|
|
|
|
this.homeData.totalFinishedProducts = res1?.totalFinishedProducts ?? 0
|
|
this.homeData.totalFinishedProducts = res1?.totalFinishedProducts ?? 0
|
|
|
this.homeData.totalRawMaterials = res1?.totalRawMaterials ?? 0
|
|
this.homeData.totalRawMaterials = res1?.totalRawMaterials ?? 0
|
|
@@ -466,27 +478,72 @@
|
|
|
|
|
|
|
|
.cell {
|
|
.cell {
|
|
|
display: flex;
|
|
display: flex;
|
|
|
- width: 30%;
|
|
|
|
|
|
|
+ width: 32%;
|
|
|
padding: 20rpx 0;
|
|
padding: 20rpx 0;
|
|
|
- margin-bottom: 20rpx;
|
|
|
|
|
|
|
+ margin-bottom: 16rpx;
|
|
|
flex-direction: column;
|
|
flex-direction: column;
|
|
|
background-color: rgb(22, 146, 50);
|
|
background-color: rgb(22, 146, 50);
|
|
|
justify-content: center;
|
|
justify-content: center;
|
|
|
align-items: center;
|
|
align-items: center;
|
|
|
- border-radius: 10rpx;
|
|
|
|
|
|
|
+ border-radius: 8rpx;
|
|
|
color: #fff;
|
|
color: #fff;
|
|
|
-
|
|
|
|
|
|
|
+ min-height: 164rpx;
|
|
|
.num {
|
|
.num {
|
|
|
font-size: 28rpx;
|
|
font-size: 28rpx;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.label {
|
|
.label {
|
|
|
- font-size: 20rpx;
|
|
|
|
|
|
|
+ font-size: 24rpx;
|
|
|
|
|
+ margin-bottom: 10rpx;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /* 通知公告 */
|
|
|
|
|
+ .notice-bar {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ padding: 18rpx 20rpx;
|
|
|
|
|
+ background: #fff;
|
|
|
|
|
+ margin-bottom: 16rpx;
|
|
|
|
|
+
|
|
|
|
|
+ .notice-swiper {
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ height: 40rpx;
|
|
|
|
|
+ margin-left: 12rpx;
|
|
|
|
|
+
|
|
|
|
|
+ swiper-item {
|
|
|
|
|
+ height: 40rpx;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .notice-content {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ width: 100%;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .notice-text {
|
|
|
|
|
+ font-size: 24rpx;
|
|
|
|
|
+ color: #333;
|
|
|
|
|
+ flex: 1;
|
|
|
|
|
+ overflow: hidden;
|
|
|
|
|
+ text-overflow: ellipsis;
|
|
|
|
|
+ white-space: nowrap;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .notice-date {
|
|
|
|
|
+ font-size: 22rpx;
|
|
|
|
|
+ color: #999;
|
|
|
|
|
+ margin-left: 16rpx;
|
|
|
|
|
+ flex-shrink: 0;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
.data-rank {
|
|
.data-rank {
|
|
|
width: 100%;
|
|
width: 100%;
|
|
|
padding: 10rpx 20rpx 0 20rpx;
|
|
padding: 10rpx 20rpx 0 20rpx;
|