优化生产数据表格显示
This commit is contained in:
parent
87188cb3f9
commit
f7adf50bb3
@ -18,7 +18,7 @@ export default defineManifestConfig({
|
|||||||
appid: VITE_UNI_APPID,
|
appid: VITE_UNI_APPID,
|
||||||
description: '',
|
description: '',
|
||||||
versionName: '2.0.0',
|
versionName: '2.0.0',
|
||||||
versionCode: '20250604',
|
versionCode: '20250605',
|
||||||
transformPx: false,
|
transformPx: false,
|
||||||
locale: VITE_FALLBACK_LOCALE, // 'zh-Hans'
|
locale: VITE_FALLBACK_LOCALE, // 'zh-Hans'
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
"appid": "__UNI__9F097F0",
|
"appid": "__UNI__9F097F0",
|
||||||
"description": "",
|
"description": "",
|
||||||
"versionName": "2.0.0",
|
"versionName": "2.0.0",
|
||||||
"versionCode": "20250604",
|
"versionCode": "20250605",
|
||||||
"transformPx": false,
|
"transformPx": false,
|
||||||
"app-plus": {
|
"app-plus": {
|
||||||
"usingComponents": true,
|
"usingComponents": true,
|
||||||
|
@ -168,7 +168,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/production/ribaoshuju/rbsjLsxq",
|
"path": "pages/production/ribaoshuju/rbsjLsxq",
|
||||||
"type": "page"
|
"type": "page",
|
||||||
|
"layout": "default",
|
||||||
|
"style": {
|
||||||
|
"navigationStyle": "custom",
|
||||||
|
"navigationBarTitleText": "历史数据"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"path": "pages/production/ribaoshuju/trqRbsj",
|
"path": "pages/production/ribaoshuju/trqRbsj",
|
||||||
|
@ -99,7 +99,6 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
onHide(()=>{ //切换首页后,将生产切换为日本数据以清楚定时 by闵
|
onHide(()=>{ //切换首页后,将生产切换为日本数据以清楚定时 by闵
|
||||||
console.log(555555)
|
|
||||||
current.value = 0;
|
current.value = 0;
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
|
<route lang="json5" type="page">
|
||||||
|
{
|
||||||
|
layout: 'default',
|
||||||
|
style: {
|
||||||
|
navigationStyle: 'custom',
|
||||||
|
navigationBarTitleText: '历史数据',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
</route>
|
||||||
<template>
|
<template>
|
||||||
<PageLayout :navbarShow="false">
|
<PageLayout navTitle="历史数据">
|
||||||
<view class="stats-container">
|
<view class="stats-container">
|
||||||
<uni-title v-if="type === 'trq'" :title="name.unit + '天然气---单位(万方)'" color="blue" type="h2"></uni-title>
|
<uni-title v-if="type === 'trq'" :title="name.unit + '天然气---单位(万方)'" color="blue" type="h2"></uni-title>
|
||||||
<uni-title v-if="type === 'yy'" :title="name.dw + '原油---单位(吨)'" color="blue" type="h2"></uni-title>
|
<uni-title v-if="type === 'yy'" :title="name.dw + '原油---单位(吨)'" color="blue" type="h2"></uni-title>
|
||||||
@ -18,54 +27,19 @@
|
|||||||
<view class="stats-item">最小值: {{ dataStats.min }}</view>
|
<view class="stats-item">最小值: {{ dataStats.min }}</view>
|
||||||
<view class="stats-item">平均值: {{ dataStats.average }}</view>
|
<view class="stats-item">平均值: {{ dataStats.average }}</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
|
<wd-table :data="dataList" :height="800" v-if="type === 'trq'" :index="true">
|
||||||
|
<wd-table-col prop="unit" label="名称" :width="screenWidth / 3" align="center"></wd-table-col>
|
||||||
|
<wd-table-col prop="rqDate" label="日期" :width="screenWidth / 4" align="center"></wd-table-col>
|
||||||
|
<wd-table-col prop="rq" label="日气量" :width="screenWidth / 5" align="center"></wd-table-col>
|
||||||
|
</wd-table>
|
||||||
|
|
||||||
<view v-if="type === 'trq'" class="table-container">
|
<wd-table :data="dataList" :height="800" v-if="type === 'yy'" :index="true">
|
||||||
<!-- 表头 -->
|
<wd-table-col prop="dw" label="名称" :width="screenWidth / 3" align="center"></wd-table-col>
|
||||||
<view class="tr header">
|
<wd-table-col prop="scrq" label="日期" :width="screenWidth / 4" align="center"></wd-table-col>
|
||||||
<view class="th1">序号</view>
|
<wd-table-col prop="rcwy" label="日油量" :width="screenWidth / 5" align="center"></wd-table-col>
|
||||||
<view class="th">名称</view>
|
</wd-table>
|
||||||
<view class="th">日期</view>
|
|
||||||
<view class="th">日气量</view>
|
|
||||||
</view>
|
|
||||||
<scroll-view scroll-Y="true" class="scroll-wrapper">
|
|
||||||
<!-- 表格内容 -->
|
|
||||||
<view class="tr" v-for="(item, index) in dataList" :key="index" :class="{ even: index % 2 === 0 }">
|
|
||||||
<view class="td1">{{ index + 1 }}</view>
|
|
||||||
<view class="td">{{ item.unit }}</view>
|
|
||||||
<view class="td">{{ item.rqDate }}</view>
|
|
||||||
<view class="td" :class="{ negative: item.rq < 0 }">
|
|
||||||
{{ item.rq }}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 空数据提示 -->
|
|
||||||
<view v-if="!dataList.length" class="empty">暂无相关数据</view>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<view v-if="type === 'yy'" class="table-container">
|
|
||||||
<!-- 表头 -->
|
|
||||||
<view class="tr header">
|
|
||||||
<view class="th1">序号</view>
|
|
||||||
<view class="th">名称</view>
|
|
||||||
<view class="th">日期</view>
|
|
||||||
<view class="th">日油量</view>
|
|
||||||
</view>
|
|
||||||
<scroll-view scroll-Y="true" class="scroll-wrapper">
|
|
||||||
<!-- 表格内容 -->
|
|
||||||
<view class="tr" v-for="(item, index) in dataList" :key="index" :class="{ even: index % 2 === 0 }">
|
|
||||||
<view class="td1">{{ index + 1 }}</view>
|
|
||||||
<view class="td">{{ item.dw }}</view>
|
|
||||||
<view class="td">{{ item.scrq }}</view>
|
|
||||||
<view class="td" :class="{ negative: item.rcwy < 0 }">
|
|
||||||
{{ item.rcwy }}
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 空数据提示 -->
|
|
||||||
<view v-if="!dataList.length" class="empty">暂无相关数据</view>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
|
||||||
</view>
|
</view>
|
||||||
</PageLayout>
|
</PageLayout>
|
||||||
</template>
|
</template>
|
||||||
@ -91,6 +65,11 @@
|
|||||||
max: 0,
|
max: 0,
|
||||||
avg: 0
|
avg: 0
|
||||||
});
|
});
|
||||||
|
const screenWidth = ref(0)
|
||||||
|
const calculateTableHeight = () => {
|
||||||
|
const systemInfo = uni.getSystemInfoSync();
|
||||||
|
screenWidth.value = systemInfo.screenWidth;
|
||||||
|
}
|
||||||
const getJinriShengchansj = (tempDateRange) => {
|
const getJinriShengchansj = (tempDateRange) => {
|
||||||
// console.log(tempDateRange);
|
// console.log(tempDateRange);
|
||||||
// 添加日期有效性检查
|
// 添加日期有效性检查
|
||||||
@ -232,6 +211,11 @@
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
// nextTick();
|
// nextTick();
|
||||||
// getJinriShengchansj(dateRange.value);
|
// getJinriShengchansj(dateRange.value);
|
||||||
|
calculateTableHeight();
|
||||||
|
// 监听屏幕旋转变化
|
||||||
|
uni.onWindowResize(() => {
|
||||||
|
calculateTableHeight();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
onLoad((options) => {
|
onLoad((options) => {
|
||||||
@ -253,70 +237,6 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
.table-container {
|
|
||||||
width: 100%;
|
|
||||||
height: 40vh;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.scroll-wrapper {
|
|
||||||
width: 100%;
|
|
||||||
height: 35vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
.tr {
|
|
||||||
display: flex;
|
|
||||||
min-height: 14px;
|
|
||||||
font-size: 12px;
|
|
||||||
border-bottom: 1px solid #e8e8e8;
|
|
||||||
}
|
|
||||||
|
|
||||||
.th,
|
|
||||||
.td {
|
|
||||||
flex: 1;
|
|
||||||
min-width: 80px;
|
|
||||||
padding: 10px;
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #333;
|
|
||||||
text-align: center;
|
|
||||||
white-space: nowrap;
|
|
||||||
height: 18px;
|
|
||||||
vertical-align: middle;
|
|
||||||
overflow: hidden;
|
|
||||||
text-overflow: ellipsis;
|
|
||||||
}
|
|
||||||
|
|
||||||
.th1,
|
|
||||||
.td1 {
|
|
||||||
flex: 1;
|
|
||||||
max-width: 40px;
|
|
||||||
padding: 10px;
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #333;
|
|
||||||
text-align: center;
|
|
||||||
white-space: nowrap;
|
|
||||||
height: 14px;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
.th {
|
|
||||||
background-color: #f0f0f0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.td.negative {
|
|
||||||
color: #ff4444;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
|
|
||||||
.empty {
|
|
||||||
padding: 40px;
|
|
||||||
text-align: center;
|
|
||||||
color: #888;
|
|
||||||
font-size: 16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.stats-container {
|
.stats-container {
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-around;
|
justify-content: space-around;
|
||||||
|
@ -48,42 +48,19 @@
|
|||||||
</view>
|
</view>
|
||||||
</wd-popup>
|
</wd-popup>
|
||||||
<!-- 数据弹窗 -->
|
<!-- 数据弹窗 -->
|
||||||
<wd-popup v-model="popup" position="bottom" background-color="#fff">
|
<wd-popup v-model="popup" position="bottom" closable custom-style="height: 400px;" @close="handleClose">
|
||||||
<view class="popup-content">
|
<wd-cell-group :title="tableTitle">
|
||||||
<view class="popup-header">
|
<wd-table :data="filteredData" :height="800">
|
||||||
<text class="title">{{ selectedGas }}数据详情 单位(万立方米)</text>
|
<wd-table-col prop="unit" label="名称" :width="screenWidth * 57 / 140 " align="center"></wd-table-col>
|
||||||
<uni-icons type="closeempty" size="24" color="#666" @click="closePopup"></uni-icons>
|
<wd-table-col prop="rq" label="日气量" :width="screenWidth / 5" align="center"></wd-table-col>
|
||||||
</view>
|
<wd-table-col prop="yearVolume" label="年累计" :width="screenWidth / 4" align="center"></wd-table-col>
|
||||||
|
<wd-table-col prop="" label="操作" :width="screenWidth / 7" align="center">
|
||||||
<view class="table">
|
<template #value="{row}">
|
||||||
<!-- 表头 -->
|
<text style="color: red;" @click="goHistory(row)">历史</text>
|
||||||
<view class="tr header">
|
</template>
|
||||||
<view class="th1">序号</view>
|
</wd-table-col>
|
||||||
<view class="th">名称</view>
|
</wd-table>
|
||||||
<view class="th">日气量</view>
|
</wd-cell-group>
|
||||||
<view class="th">年累计</view>
|
|
||||||
<view class="th1">操作</view>
|
|
||||||
</view>
|
|
||||||
<scroll-view scroll-X="true" scroll-Y="true" class="table-container">
|
|
||||||
<!-- 表格内容 -->
|
|
||||||
<view class="tr" v-for="(item, index) in filteredData" :key="index"
|
|
||||||
:class="{ even: index % 2 === 0 }">
|
|
||||||
<view class="td1">{{ index + 1 }}</view>
|
|
||||||
<view class="td">{{ item.unit }}</view>
|
|
||||||
<view class="td" :class="{ negative: item.rq < 0 }">
|
|
||||||
{{ formatNumber(item.rq) }}
|
|
||||||
</view>
|
|
||||||
<view class="td" :class="{ negative: item.yearVolume < 0 }">
|
|
||||||
{{ formatNumber(item.yearVolume) }}
|
|
||||||
</view>
|
|
||||||
<view class="td1" style="color: red" @click="goHistory(item)">历史</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 空数据提示 -->
|
|
||||||
<view v-if="!filteredData.length" class="empty">暂无相关数据</view>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
|
||||||
</view>
|
|
||||||
</wd-popup>
|
</wd-popup>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -102,7 +79,7 @@
|
|||||||
const shishiArrSelect = ref([]);
|
const shishiArrSelect = ref([]);
|
||||||
const shishiArrDisplay = ref(['气井气', '商品量', '站线综合输差']);
|
const shishiArrDisplay = ref(['气井气', '商品量', '站线综合输差']);
|
||||||
const dataJinriUnit = ref([]);
|
const dataJinriUnit = ref([]);
|
||||||
const selectedGas = ref('');
|
const tableTitle = ref('')
|
||||||
const filteredData = ref([]);
|
const filteredData = ref([]);
|
||||||
const popup = ref(false);
|
const popup = ref(false);
|
||||||
const popupSelect = ref(false);
|
const popupSelect = ref(false);
|
||||||
@ -117,12 +94,13 @@
|
|||||||
const splNdjs = ref(7220);
|
const splNdjs = ref(7220);
|
||||||
const zhqNdjs = ref(300);
|
const zhqNdjs = ref(300);
|
||||||
const zhscNdjs = ref(50);
|
const zhscNdjs = ref(50);
|
||||||
|
const screenWidth = ref(0)
|
||||||
|
const handleClose = () => {
|
||||||
|
popup.value = false
|
||||||
|
}
|
||||||
|
|
||||||
// 点击卡片处理
|
// 点击卡片处理
|
||||||
// const handleCardClick = (gas) => {
|
// const handleCardClick = (gas) => {
|
||||||
// selectedGas.value = gas;
|
|
||||||
// let queryParms = {};
|
// let queryParms = {};
|
||||||
// filteredData.value = [];
|
// filteredData.value = [];
|
||||||
// queryParms.day = strDate.value;
|
// queryParms.day = strDate.value;
|
||||||
@ -173,19 +151,37 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleCardClick = (gas) => {
|
const handleCardClick = (gas) => {
|
||||||
selectedGas.value = gas;
|
tableTitle.value = gas + '数据详情 单位(万立方米)'
|
||||||
filteredData.value = dataJinriSumUnit.value.filter((item) => item.gas === gas);
|
filteredData.value = dataJinriSumUnit.value.filter((item) => item.gas === gas);
|
||||||
|
filteredData.value = filteredData.value.map(item => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
rq: formatNumber(item.rq),
|
||||||
|
yearVolume: formatNumber(item.yearVolume)
|
||||||
|
}
|
||||||
|
})
|
||||||
popup.value = true;
|
popup.value = true;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// 关闭弹窗
|
// 关闭弹窗
|
||||||
const closePopup = () => {
|
const closePopup = () => {
|
||||||
popup.value = false;
|
popup.value = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const calculateTableHeight = () => {
|
||||||
|
const systemInfo = uni.getSystemInfoSync();
|
||||||
|
screenWidth.value = systemInfo.screenWidth;
|
||||||
|
}
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getJinriTrqShengchansj();
|
getJinriTrqShengchansj();
|
||||||
|
|
||||||
getJinriShengchansj();
|
getJinriShengchansj();
|
||||||
|
|
||||||
|
calculateTableHeight();
|
||||||
|
// 监听屏幕旋转变化
|
||||||
|
uni.onWindowResize(() => {
|
||||||
|
calculateTableHeight();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
// 数字格式化
|
// 数字格式化
|
||||||
@ -202,7 +198,6 @@
|
|||||||
|
|
||||||
// 自动计算综合输差
|
// 自动计算综合输差
|
||||||
function calcZhsc(tempArray) {
|
function calcZhsc(tempArray) {
|
||||||
console.log(tempArray)
|
|
||||||
let totalJinqi = {
|
let totalJinqi = {
|
||||||
gas: '总进气',
|
gas: '总进气',
|
||||||
dailyVolume: 0,
|
dailyVolume: 0,
|
||||||
@ -274,8 +269,6 @@
|
|||||||
tempArray.push(trqSpl);
|
tempArray.push(trqSpl);
|
||||||
|
|
||||||
return tempArray;
|
return tempArray;
|
||||||
|
|
||||||
// console.log(composite);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const getJinriTrqShengchansj = () => {
|
const getJinriTrqShengchansj = () => {
|
||||||
@ -287,9 +280,7 @@
|
|||||||
}
|
}
|
||||||
let queryParms = {};
|
let queryParms = {};
|
||||||
shishiArr.value = [];
|
shishiArr.value = [];
|
||||||
|
|
||||||
queryParms.day = strDate.value;
|
queryParms.day = strDate.value;
|
||||||
// // console.log(queryParms);
|
|
||||||
queryJinriTrqShengchansj(queryParms).then((res) => {
|
queryJinriTrqShengchansj(queryParms).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
console.log(1, res);
|
console.log(1, res);
|
||||||
@ -301,13 +292,9 @@
|
|||||||
item.yearPerCent = calcPercent(item.yearPlan, item.yearVolume);
|
item.yearPerCent = calcPercent(item.yearPlan, item.yearVolume);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log(2, temp);
|
|
||||||
console.log(calcZhsc(temp))
|
|
||||||
shishiArr.value = calcZhsc(temp);
|
shishiArr.value = calcZhsc(temp);
|
||||||
nextTick();
|
nextTick();
|
||||||
onselectionchange();
|
onselectionchange();
|
||||||
console.log(3, shishiArr.value);
|
|
||||||
console.log(4, shishiArrSelect.value);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@ -345,13 +332,10 @@
|
|||||||
dataJinriSumUnit.value = [];
|
dataJinriSumUnit.value = [];
|
||||||
queryParms.rqDate = strDate.value;
|
queryParms.rqDate = strDate.value;
|
||||||
queryParms.pageSize = 100;
|
queryParms.pageSize = 100;
|
||||||
// console.log(queryParms);
|
|
||||||
queryJinriShengchansj(queryParms).then((res) => {
|
queryJinriShengchansj(queryParms).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
console.log(res);
|
|
||||||
dataJinri.value = res.result.records;
|
dataJinri.value = res.result.records;
|
||||||
dataJinriSumUnit.value = sumByUnit(dataJinri.value); //包含gas unit rq cq totalGas
|
dataJinriSumUnit.value = sumByUnit(dataJinri.value); //包含gas unit rq cq totalGas
|
||||||
console.log(dataJinriSumUnit.value);
|
|
||||||
// // 使用 nextTick 等待 DOM 更新
|
// // 使用 nextTick 等待 DOM 更新
|
||||||
nextTick();
|
nextTick();
|
||||||
getYearShengchansj(); //再获取今年以来的数据
|
getYearShengchansj(); //再获取今年以来的数据
|
||||||
@ -364,15 +348,10 @@
|
|||||||
let queryParms = {};
|
let queryParms = {};
|
||||||
queryParms.yearStart = year;
|
queryParms.yearStart = year;
|
||||||
queryParms.yearEnd = year;
|
queryParms.yearEnd = year;
|
||||||
|
|
||||||
// // console.log(2, queryParms.value);
|
|
||||||
queryYearShengchansj(queryParms).then((res) => {
|
queryYearShengchansj(queryParms).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
try {
|
try {
|
||||||
// // console.log(res.result);
|
|
||||||
let yearData = res.result[year];
|
let yearData = res.result[year];
|
||||||
// console.log(dataJinriSumUnit.value.length, dataJinriSumUnit.value, yearData.length,
|
|
||||||
// yearData);
|
|
||||||
dataJinriSumUnit.value.forEach((item) => {
|
dataJinriSumUnit.value.forEach((item) => {
|
||||||
yearData.forEach((itemYear) => {
|
yearData.forEach((itemYear) => {
|
||||||
// // console.log(item, itemYear);
|
// // console.log(item, itemYear);
|
||||||
@ -382,7 +361,6 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
dataJinriSum.value = sumByGas(dataJinriSumUnit.value);
|
dataJinriSum.value = sumByGas(dataJinriSumUnit.value);
|
||||||
// console.log(dataJinriSum.value);
|
|
||||||
shishiArr.value.forEach((item) => {
|
shishiArr.value.forEach((item) => {
|
||||||
dataJinriSum.value.forEach((itemjinri) => {
|
dataJinriSum.value.forEach((itemjinri) => {
|
||||||
if (item.gas === itemjinri.gas) {
|
if (item.gas === itemjinri.gas) {
|
||||||
@ -399,7 +377,6 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
function sumByGas(records) {
|
function sumByGas(records) {
|
||||||
// console.log(records);
|
|
||||||
const summaryMap = {};
|
const summaryMap = {};
|
||||||
try {
|
try {
|
||||||
records.forEach((record) => {
|
records.forEach((record) => {
|
||||||
@ -574,88 +551,6 @@
|
|||||||
gap: 20rpx;
|
gap: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup-content {
|
|
||||||
padding: 30rpx;
|
|
||||||
max-height: 40vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
.popup-header {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 30rpx;
|
|
||||||
padding-bottom: 20rpx;
|
|
||||||
border-bottom: 2rpx solid #eee;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.table-container {
|
|
||||||
width: 100%;
|
|
||||||
height: 30vh;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table {
|
|
||||||
min-width: 100%;
|
|
||||||
border: 2rpx solid #e8e8e8;
|
|
||||||
|
|
||||||
.tr {
|
|
||||||
display: flex;
|
|
||||||
border-bottom: 2rpx solid #e8e8e8;
|
|
||||||
|
|
||||||
&.header {
|
|
||||||
background-color: #fafafa;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.even {
|
|
||||||
background-color: #f8f8f8;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.th,
|
|
||||||
.td {
|
|
||||||
flex: 1;
|
|
||||||
min-width: 80rpx;
|
|
||||||
padding: 10rpx;
|
|
||||||
font-size: 22rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #333;
|
|
||||||
text-align: center;
|
|
||||||
white-space: nowrap;
|
|
||||||
height: 30rpx;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
.th1,
|
|
||||||
.td1 {
|
|
||||||
flex: 1;
|
|
||||||
max-width: 40rpx;
|
|
||||||
padding: 10rpx;
|
|
||||||
font-size: 22rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #333;
|
|
||||||
text-align: center;
|
|
||||||
white-space: nowrap;
|
|
||||||
height: 30rpx;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
.th {
|
|
||||||
background-color: #f0f0f0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.td.negative {
|
|
||||||
color: #ff4444;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.empty {
|
.empty {
|
||||||
padding: 40rpx;
|
padding: 40rpx;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
@ -664,7 +559,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.card-item {
|
.card-item {
|
||||||
flex: 1 1 200rpx; // 基础宽度300rpx,自动伸缩 selectedGas formatNumber
|
flex: 1 1 200rpx; // 基础宽度300rpx,自动伸缩 formatNumber
|
||||||
min-width: 240rpx;
|
min-width: 240rpx;
|
||||||
max-width: calc(50% - 10rpx); // 最大不超过容器一半(考虑间距)
|
max-width: calc(50% - 10rpx); // 最大不超过容器一半(考虑间距)
|
||||||
|
|
||||||
@ -710,10 +605,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.progress-item {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.progress-bar {
|
.progress-bar {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
|
@ -39,44 +39,20 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 数据弹窗 -->
|
<!-- 数据弹窗 -->
|
||||||
<wd-popup v-model="popup" position="bottom" background-color="#fff">
|
<wd-popup v-model="popup" position="bottom" closable custom-style="height: 400px;" @close="handleClose">
|
||||||
<view class="popup-content">
|
<wd-cell-group title="原油数据详情 单位(吨)">
|
||||||
<view class="popup-header">
|
<wd-table :data="dataJinri" :height="800">
|
||||||
<text class="title">原油数据详情 单位(吨)</text>
|
<wd-table-col prop="dw" label="名称" :width="screenWidth * 29 / 140" align="center"></wd-table-col>
|
||||||
<wd-icon name="closeempty" size="24" @click="closePopup"></wd-icon>
|
<wd-table-col prop="rcwy" label="日油量" :width="screenWidth / 5" align="center"></wd-table-col>
|
||||||
</view>
|
<wd-table-col prop="yl" label="月累计" :width="screenWidth / 5" align="center"></wd-table-col>
|
||||||
|
<wd-table-col prop="nl" label="年累计" :width="screenWidth / 4" align="center"></wd-table-col>
|
||||||
<scroll-view scroll-X="true" scroll-Y="true" class="table-container">
|
<wd-table-col prop="" label="操作" :width="screenWidth / 7" align="center">
|
||||||
<view class="table">
|
<template #value="{row}">
|
||||||
<!-- 表头 -->
|
<text style="color: red;" @click="goHistory(row)">历史</text>
|
||||||
<view class="tr header">
|
</template>
|
||||||
<view class="th1">序号</view>
|
</wd-table-col>
|
||||||
<view class="th">名称</view>
|
</wd-table>
|
||||||
<view class="th">日油量</view>
|
</wd-cell-group>
|
||||||
<view class="th">月累计</view>
|
|
||||||
<view class="th">年累计</view>
|
|
||||||
<view class="th1">操作</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 表格内容 -->
|
|
||||||
<view class="tr" v-for="(item, index) in dataJinri" :key="index" :class="{ even: index % 2 === 0 }">
|
|
||||||
<view class="td1">{{ index }}</view>
|
|
||||||
<view class="td">{{ item.dw }}</view>
|
|
||||||
<view class="td">
|
|
||||||
{{ formatNumber(item.rcwy) }}
|
|
||||||
</view>
|
|
||||||
<view class="td">{{ formatNumber(item.yl) }}</view>
|
|
||||||
<view class="td">
|
|
||||||
{{ formatNumber(item.nl) }}
|
|
||||||
</view>
|
|
||||||
<view class="td1" style="color: red" @click="goHistory(item)">历史</view>
|
|
||||||
</view>
|
|
||||||
|
|
||||||
<!-- 空数据提示 -->
|
|
||||||
<view v-if="!dataJinri.length" class="empty">暂无相关数据</view>
|
|
||||||
</view>
|
|
||||||
</scroll-view>
|
|
||||||
</view>
|
|
||||||
</wd-popup>
|
</wd-popup>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@ -96,7 +72,7 @@
|
|||||||
yearPlan: '1500',
|
yearPlan: '1500',
|
||||||
yearPerCent: ''
|
yearPerCent: ''
|
||||||
}]);
|
}]);
|
||||||
|
const screenWidth = ref(0)
|
||||||
const dataJinri = ref([]);
|
const dataJinri = ref([]);
|
||||||
const dataJinriSum = ref([]);
|
const dataJinriSum = ref([]);
|
||||||
const popup = ref(false);
|
const popup = ref(false);
|
||||||
@ -112,6 +88,11 @@
|
|||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
getJinriYuanyouShengchansj();
|
getJinriYuanyouShengchansj();
|
||||||
// getYearShengchansj();
|
// getYearShengchansj();
|
||||||
|
calculateTableHeight();
|
||||||
|
// 监听屏幕旋转变化
|
||||||
|
uni.onWindowResize(() => {
|
||||||
|
calculateTableHeight();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
const strDate = ref('');
|
const strDate = ref('');
|
||||||
@ -120,12 +101,19 @@
|
|||||||
if (typeof num !== 'number') return '-';
|
if (typeof num !== 'number') return '-';
|
||||||
return num.toFixed(4).replace(/\.?0+$/, '');
|
return num.toFixed(4).replace(/\.?0+$/, '');
|
||||||
};
|
};
|
||||||
|
const handleClose = () => {
|
||||||
|
popup.value = false
|
||||||
|
}
|
||||||
|
|
||||||
function goHistory(val) {
|
function goHistory(val) {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: '/pages/production/ribaoshuju/rbsjLsxq?data=' + JSON.stringify(val) + '&type=yy'
|
url: '/pages/production/ribaoshuju/rbsjLsxq?data=' + JSON.stringify(val) + '&type=yy'
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
const calculateTableHeight = () => {
|
||||||
|
const systemInfo = uni.getSystemInfoSync();
|
||||||
|
screenWidth.value = systemInfo.screenWidth;
|
||||||
|
}
|
||||||
const getJinriYuanyouShengchansj = () => {
|
const getJinriYuanyouShengchansj = () => {
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
if (now.getHours() < 11) {
|
if (now.getHours() < 11) {
|
||||||
@ -138,10 +126,8 @@
|
|||||||
dataJinriSum.value = [];
|
dataJinriSum.value = [];
|
||||||
queryParms.scrq = strDate.value;
|
queryParms.scrq = strDate.value;
|
||||||
queryParms.pageSize = 100;
|
queryParms.pageSize = 100;
|
||||||
// // console.log(queryParms);
|
|
||||||
queryJinriYuanyouShengchansj(queryParms).then((res) => {
|
queryJinriYuanyouShengchansj(queryParms).then((res) => {
|
||||||
if (res.success) {
|
if (res.success) {
|
||||||
// // console.log(res);
|
|
||||||
dataJinri.value = res.result.records;
|
dataJinri.value = res.result.records;
|
||||||
dataJinriSum.value = sumByOil(dataJinri.value); //包含gas unit rq cq totalGas
|
dataJinriSum.value = sumByOil(dataJinri.value); //包含gas unit rq cq totalGas
|
||||||
// // console.log(dataJinriSum.value);
|
// // console.log(dataJinriSum.value);
|
||||||
@ -154,6 +140,15 @@
|
|||||||
item.yearPerCent = calcPercent(item.yearPlan, item.nl);
|
item.yearPerCent = calcPercent(item.yearPlan, item.nl);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
dataJinri.value = dataJinri.value.map(item => {
|
||||||
|
return {
|
||||||
|
...item,
|
||||||
|
rcwy: formatNumber(item.rcwy),
|
||||||
|
yl: formatNumber(item.yl),
|
||||||
|
nl: formatNumber(item.nl)
|
||||||
|
}
|
||||||
|
})
|
||||||
// getYearShengchansj(); //再获取今年以来的数据
|
// getYearShengchansj(); //再获取今年以来的数据
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -247,93 +242,6 @@
|
|||||||
gap: 20rpx;
|
gap: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.popup-content {
|
|
||||||
padding: 30rpx;
|
|
||||||
max-height: 70vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
.popup-header {
|
|
||||||
display: flex;
|
|
||||||
justify-content: space-between;
|
|
||||||
align-items: center;
|
|
||||||
margin-bottom: 30rpx;
|
|
||||||
padding-bottom: 20rpx;
|
|
||||||
border-bottom: 2rpx solid #eee;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
font-size: 32rpx;
|
|
||||||
font-weight: 600;
|
|
||||||
color: #333;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.table-container {
|
|
||||||
width: 100%;
|
|
||||||
height: 30vh;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table {
|
|
||||||
min-width: 100%;
|
|
||||||
border: 2rpx solid #e8e8e8;
|
|
||||||
|
|
||||||
.tr {
|
|
||||||
display: flex;
|
|
||||||
border-bottom: 2rpx solid #e8e8e8;
|
|
||||||
|
|
||||||
&.header {
|
|
||||||
background-color: #fafafa;
|
|
||||||
font-weight: 600;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.even {
|
|
||||||
background-color: #f8f8f8;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.th,
|
|
||||||
.td {
|
|
||||||
flex: 1;
|
|
||||||
min-width: 80rpx;
|
|
||||||
padding: 10rpx;
|
|
||||||
font-size: 20rpx;
|
|
||||||
font-weight: 500;
|
|
||||||
color: #333;
|
|
||||||
text-align: center;
|
|
||||||
white-space: nowrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.th1,
|
|
||||||
.td1 {
|
|
||||||
flex: 1;
|
|
||||||
max-width: 40rpx;
|
|
||||||
padding: 10rpx;
|
|
||||||
font-size: 22rpx;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #333;
|
|
||||||
text-align: center;
|
|
||||||
white-space: nowrap;
|
|
||||||
height: 30rpx;
|
|
||||||
vertical-align: middle;
|
|
||||||
}
|
|
||||||
|
|
||||||
.th {
|
|
||||||
background-color: #f0f0f0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.td.negative {
|
|
||||||
color: #ff4444;
|
|
||||||
font-weight: 500;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.empty {
|
|
||||||
padding: 40rpx;
|
|
||||||
text-align: center;
|
|
||||||
color: #888;
|
|
||||||
font-size: 16rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-item {
|
.card-item {
|
||||||
flex: 1 1 200rpx; // 基础宽度300rpx,自动伸缩 selectedGas formatNumber
|
flex: 1 1 200rpx; // 基础宽度300rpx,自动伸缩 selectedGas formatNumber
|
||||||
min-width: 200rpx;
|
min-width: 200rpx;
|
||||||
@ -381,10 +289,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.progress-item {
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.progress-bar {
|
.progress-bar {
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
|
@ -3,18 +3,5 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
import {
|
|
||||||
queryJinriShengchansj,
|
|
||||||
queryYearShengchansj,
|
|
||||||
queryJinriTrqShengchansj
|
|
||||||
} from '@/api/production';
|
|
||||||
import {
|
|
||||||
formatDate,
|
|
||||||
getDateAfterDays
|
|
||||||
} from '@/utils/dateTime';
|
|
||||||
import trqSssjVue from './trqSssj';
|
import trqSssjVue from './trqSssj';
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
|
||||||
|
|
||||||
</style>
|
|
Loading…
Reference in New Issue
Block a user