添加了天然气和原油的生产日数据

This commit is contained in:
ldeyun 2025-03-07 11:40:46 +08:00
commit 8593090e8a
12 changed files with 1636 additions and 609 deletions

39
api/pages.js Normal file
View File

@ -0,0 +1,39 @@
import {
https
} from '@/utils/http.js';
export function qjAddApi(config) { // 发起请假流程申请
return https({
url: '/CxcQxj/cxcQxj/add',
method: 'post',
data: config
})
}
export function queryZwmcAndExaApi(username) { // 根据username获取职位名称和审批领导列表
return https({
url: '/CxcQxj/cxcQxj/queryZwmcByUsername',
method: 'get',
data: {
username
}
})
}
export function qjQueryByIdApi(config) { // 通过id查询请假数据 流程用
return https({
url: '/CxcQxj/cxcQxj/queryById',
method: 'get',
data: config
})
}
export function queryHisDateApi(username) { // 根据username获取最新请假结束日期
return https({
url: '/CxcQxj/cxcQxj/queryHisDate',
method: 'get',
data: {
username
}
})
}

View File

@ -2,10 +2,26 @@ import {
https
} from '@/utils/http.js';
export function queryJinriShengchansj(orgCode) { // 获取今日生产数据
export function queryJinriShengchansj(params) { // 获取今日天然气生产数据
return https({
url: '/scdt.CxcScdtChart/cxcScdtChart/list',
method: 'get',
data: orgCode
data: params
})
}
export function queryYearShengchansj(params) { // 获取今年以来天然气的生产数据
return https({
url: '/scdt.CxcScdtChart/cxcScdtChart/getYearStatis',
method: 'get',
data: params
})
}
export function queryJinriYuanyouShengchansj(params) { // 获取今日原油 污油产量
return https({
url: '/scdt.cxcscdtwyrb/cxcScdtWyRb/list',
method: 'get',
data: params
})
}

View File

@ -168,11 +168,12 @@
}
},
{
"path": "pages/product/index",
"path": "pages/views/shengchan/index",
"style": {
"navigationBarTitleText": "生产数据",
"enablePullDownRefresh": false,
"navigationBarTextStyle": "white"
"navigationStyle": "custom"
// "navigationBarTitleText": "生产数据",
// "enablePullDownRefresh": false,
// "navigationBarTextStyle": "white"
}
},
{
@ -281,7 +282,7 @@
"text": "生产",
"pagePath": "pages/tab/product",
"iconPath": "/static/tab/product.png",
"selectedIconPath": "/static/tab/product1.png"
"selectedIconPath": "/static/tab/product2.png"
},
{
"text": "办公",

385
pages/leave/application.vue Normal file
View File

@ -0,0 +1,385 @@
<template>
<view :class="{'gray':store.isgray==1}">
<view class="form">
<view class="f-row aic jcb input_box">
<view class="title">
职工姓名
</view>
<input v-model="realname" disabled />
</view>
<view class="f-row aic jcb input_box">
<view class="title">
工作单位
</view>
<input v-model="depart" disabled />
</view>
<view class="f-row aic jcb input_box">
<view class="title">
联系方式
</view>
<input v-model="phone" />
</view>
<view class="f-row aic jcb input_box">
<view class="title">
请假类型
</view>
<tree-select :dataSource="dataSource" v-model="type" dataValue="name" />
</view>
<picker mode="date" fields="day" @change="chooseStart" :value="beginTime" :end="endTime">
<view class="f-row aic jcb box">
<view class="title">
开始时间
</view>
<view class="f-row aic">
<view :class="[{'choose':!beginTime},{'choosed':beginTime}]">
{{beginTime?beginTime:'请选择'}}
</view>
<uni-icons type="bottom" color="#333333"></uni-icons>
</view>
</view>
</picker>
<picker mode="date" fields="day" @change="chooseEnd" :value="endTime" :start="beginTime">
<view class="f-row aic jcb box">
<view class="title">
截止时间
</view>
<view class="f-row aic">
<view :class="[{'choose':!endTime},{'choosed':endTime}]">
{{endTime?endTime:'请选择'}}
</view>
<uni-icons type="bottom" color="#333333"></uni-icons>
</view>
</view>
</picker>
<picker @change="bindType" :value="typeIndex" :range="typeArr" range-key="realname" v-if="ifShow">
<view class="f-row aic jcb box">
<view class="title">
审批领导
</view>
<view class="f-row aic">
<view :class="[{'choose':typeIndex==null},{'choosed':typeIndex!=null}]">
{{typeIndex!=null?typeArr[typeIndex].realname:'请选择'}}
</view>
<uni-icons type="bottom" color="#333333"></uni-icons>
</view>
</view>
</picker>
<view class="f-row aic jcb input_box">
<view class="title">
出发地
</view>
<input v-model="departure" placeholder="请输入" nplaceholder-style="font-size: 28rpx;color: #999999;" />
</view>
<view class="f-row aic jcb input_box">
<view class="title">
目的地
</view>
<input v-model="destination" placeholder="请输入" nplaceholder-style="font-size: 28rpx;color: #999999;" />
</view>
<view class="f-row aic jcb input_box">
<view class="title">
请假事由
</view>
<input v-model="reason" placeholder="请输入" placeholder-style="font-size: 28rpx;color: #999999;" />
</view>
<view class="f-row aic jcb input_box">
<view class="title">
上传附件
</view>
<uni-file-picker @select="select" :image-styles="imageStyles" />
</view>
</view>
<view class="btn f-col aic">
<view @click="qjAdd">
提交
</view>
</view>
</view>
</template>
<script setup>
import {
ref,
getCurrentInstance
} from 'vue';
import {
startMutilProcessApi,
getCategoryItemsApi,
} from '@/api/api.js';
import {
qjAddApi,
queryZwmcAndExaApi,
queryHisDateApi
} from '@/api/pages.js';
import {
queryDepByCode,
queryZbDepByLdhth
} from '@/api/depart.js'
import {
onLoad
} from '@dcloudio/uni-app'
import {
useStore
} from '@/store';
import treeSelect from "@/components/treeSelect/treeSelect.vue"
const store = useStore()
const {
proxy
} = getCurrentInstance()
/**职工姓名*/
const realname = ref(store.userinfo.realname)
/**工作单位*/
const depart = ref('')
/**工作单位*/
const orgCode = ref('')
/**联系方式*/
const phone = ref(store.userinfo.phone)
/**请假类型*/
const type = ref('')
const dataSource = ref([])
/**开始时间*/
const beginTime = ref('')
const chooseStart = (e) => {
beginTime.value = e.detail.value
}
/**结束时间*/
const endTime = ref('')
const chooseEnd = (e) => {
endTime.value = e.detail.value
}
/**审批领导*/
const typeArr = ref([])
const typeIndex = ref(null)
/**判断是否显示审批领导字段*/
const ifShow = ref(true)
/**职位层级*/
const zwcj = ref('')
/**出发地*/
const departure = ref('')
/**目的地*/
const destination = ref('')
/**请假事由*/
const reason = ref('')
/**附件路径*/
const path = ref([])
const baseUrl = import.meta.env.VITE_REQUEST_BASE_URL + '/jeecg-boot/sys/common/upload/'
const imageStyles = {
width: 64,
height: 64,
border: {
color: "#dce7e1",
width: 2,
style: 'dashed',
radius: '2px'
}
}
onLoad(() => {
loadData()
// getTomorrowDate()
})
const select = (e) => {
const tempFilePaths = e.tempFilePaths
for (let i = 0; i < e.tempFilePaths.length; i++) {
let photoPath = '职工请假/' + depart.value + '/' + store.userinfo.realname
uni.uploadFile({
url: baseUrl,
filePath: e.tempFilePaths[i],
name: 'file',
formData: {
appPath: photoPath
},
success: (res) => {
path.value.push(JSON.parse(res.data).message)
}
});
}
}
const qjAdd = () => {
if (!phone.value.trim()) return proxy.$toast('请输入联系方式')
if (!type.value) return proxy.$toast('请选择请假类型')
if (!beginTime.value) return proxy.$toast('请选择开始时间')
if (!endTime.value) return proxy.$toast('请选择结束时间')
if (ifShow.value) {
if (typeIndex.value == null) { //
return proxy.$toast('请选择审批领导')
}
}
if (!departure.value.trim()) return proxy.$toast('请输入出发地')
if (!destination.value.trim()) return proxy.$toast('请输入目的地')
if (!reason.value.trim()) return proxy.$toast('请输入请假事由')
qjAddApi({
sysOrgCode: orgCode.value,
username: store.userinfo.username,
phone: phone.value,
type: type.value,
begintime: beginTime.value,
endtime: endTime.value,
examineleader: typeArr.value[typeIndex.value] ? typeArr.value[typeIndex.value].username : '',
departure: departure.value,
destination: destination.value,
reason: reason.value,
zwmc: zwcj.value,
path: path.value.toString()
}).then((res) => {
if (res.success) {
startMutilProcess(res.message)
} else {
proxy.$toast(res.message);
}
})
}
const startMutilProcess = (id) => {
startMutilProcessApi({
flowCode: "dev_cxc_qxj",
id,
formUrl: "modules/qxj/modules/CxcQxjBpmModel",
formUrlMobile: "leaveApplication" //main.jscreateApp() app.component('leaveApplication',index)
}).then((res) => {
if (res.success) {
proxy.$toast(res.message)
setTimeout(() => {
uni.navigateBack()
}, 2000)
}
}).catch((err) => {
console.log(err);
})
}
const loadData = () => {
getCategoryItemsApi('1838487445813645313').then((res) => { //
if (res.success) {
dataSource.value = res.result
}
})
queryZbDepByLdhth(store.userinfo.workNo).then((res) => { //
depart.value = res.departName
orgCode.value = res.orgCode
})
queryZwmcAndExaApi(store.userinfo.username).then((res) => { //
if (res.success) {
typeArr.value = res.result.list
zwcj.value = res.result.zwmc
if (zwcj.value == '单位专家' || zwcj.value == '基层正职' || zwcj.value == '高级主管') {
ifShow.value = false;
}
} else {
proxy.$toast(res.message);
}
})
queryHisDateApi(store.userinfo.username).then((res) => { //
if (res) {
console.log('--0', res)
getTomorrowDate(res);
} else {
console.log('--1', res)
getTomorrowDate();
}
})
}
const bindType = (e) => {
typeIndex.value = e.detail.value
}
const getTomorrowDate = (e) => {
let tomorrow;
if (e) {
// Date
const dateParts = e.split('-').map(Number);
tomorrow = new Date(dateParts[0], dateParts[1] - 1, dateParts[2]);
} else {
// 使
tomorrow = new Date();
}
//
tomorrow.setDate(tomorrow.getDate() + 1);
//
const year = tomorrow.getFullYear();
const month = (tomorrow.getMonth() + 1).toString().padStart(2, '0');
const day = tomorrow.getDate().toString().padStart(2, '0');
beginTime.value = `${year}-${month}-${day}`;
}
</script>
<style>
page {
background-color: #fff;
}
</style>
<style lang="scss" scoped>
.btn {
border-top: 1px solid #EFEFEF;
height: 120rpx;
justify-content: center;
position: fixed;
bottom: 0;
width: 100vw;
view {
width: 690rpx;
height: 88rpx;
background: #01508B;
border-radius: 16rpx;
font-size: 28rpx;
color: #FFFFFF;
text-align: center;
line-height: 88rpx;
}
}
.input_box {
height: 100rpx;
.title {
font-size: 28rpx;
color: #333333;
}
input {
flex: 1;
height: 100%;
text-align: right;
font-size: 28rpx;
color: #333333;
}
}
.form {
padding: 0 30rpx;
background-color: #fff;
.title {
font-size: 28rpx;
color: #333333;
}
.box {
height: 100rpx;
}
.box:not(:last-child) {
border-bottom: 1px solid #EFEFEF;
}
.choose {
font-size: 28rpx;
color: #999999;
}
.choosed {
font-size: 28rpx;
color: #333333;
}
}
</style>

View File

@ -1,234 +0,0 @@
<template>
<view :class="{'gray':store.isgray==1}">
<view class="container">
<uni-card class="main-card" :is-link="false">
<uni-title title="气产量" type="h3" color="blue" />
<view class="card-content">
<view v-for="(row, rowIndex) in groupedData" :key="rowIndex" class="data-row">
<uni-row>
<uni-col v-for="(item, colIndex) in row" :key="colIndex" :span="8">
<uni-title :title="item.gas" type="h5" class="data-label" />
<view class="value-group">
<text class="value">今日量{{ item.dailyVolume }}</text>
<text class="value">年累计{{ item.dailyVolume }}</text>
</view>
</uni-col>
</uni-row>
</view>
</view>
</uni-card>
</view>
</view>
</template>
<script setup>
import {
ref,
onMounted,
computed
} from 'vue';
import {
onLoad
} from '@dcloudio/uni-app';
import {
queryJinriShengchansj
} from "@/api/shengchan.js"
import {
formatDate
} from "@/utils/dateTime.js"
import {
beforeJump
} from '@/utils/index.js';
import {
useStore
} from '@/store';
const store = useStore();
import dataCom from '@/bpm/dataCom.vue';
const shishiArr = ref([{
gas: '气井气',
dailyVolume: '',
yearVolume: ''
}, {
gas: '伴生气',
dailyVolume: '',
yearVolume: ''
}, {
gas: '外部气',
dailyVolume: '',
yearVolume: ''
}, {
gas: '站输差',
dailyVolume: '',
yearVolume: ''
}, {
gas: '线输差',
dailyVolume: '',
yearVolume: ''
}, {
gas: '综合输差',
dailyVolume: '',
yearVolume: ''
}, ])
onMounted(() => {
getJinriShengchansj()
})
const dataJinri = ref([])
const dataJinriSum = ref([])
const queryParms = ref({})
//
const groupedData = computed(() => {
const groups = [];
for (let i = 0; i < shishiArr.value.length; i += 3) {
groups.push(shishiArr.value.slice(i, i + 3));
}
return groups;
});
const getJinriShengchansj = () => {
const now = new Date();
queryParms.rqDate = formatDate(now);
queryParms.pageSize = 100
queryJinriShengchansj(queryParms).then((res) => {
if (res.success) {
console.log(res.result.records)
dataJinri.value = res.result.records;
dataJinriSum.value = sumByGas(dataJinri.value)
console.log(dataJinriSum.value, shishiArr.value)
try {
shishiArr.value.forEach((item) => {
dataJinriSum.value.forEach((itemjinri) => {
if (item.gas === itemjinri.gas) {
if (item.gas.includes("输差")) {
item.dailyVolume = itemjinri.totalGas.toFixed(4);
} else {
item.dailyVolume = itemjinri.rq.toFixed(4);
}
}
})
})
} catch (error) {
console.log(error)
}
console.log(dataJinriSum.value, shishiArr.value)
}
})
}
function sumByGas(records) {
const summaryMap = {};
records.forEach(record => {
const gas = record.gas;
if (!summaryMap[gas]) {
summaryMap[gas] = {
gas: gas,
rq: 0,
sq: 0,
totalGas: 0
};
}
summaryMap[gas].rq += record.rq || 0;
summaryMap[gas].sq += record.sq || 0;
summaryMap[gas].totalGas += record.totalGas || 0;
});
return Object.values(summaryMap);
}
const res = wx.getSystemInfoSync();
const statusHeight = res.statusBarHeight; //
const cusnavbarheight = (statusHeight + 44) + "px";
const indexChartScdtData = () => {
indexChartScdtDataApi().then((res) => {
if (res.success) {
productArr.value = handleData(res.result.today)
otherArr = [{
text: '安全管理',
img: '../../static/tab/anquan.png',
path: '/pages/safe/manage'
}, {
text: '生产数据',
img: '../../static/tab/product.png',
path: `/pages/product/index?shishi=${JSON.stringify(shishiArr)}&product=${JSON.stringify(productArr.value)}`
}, {
text: '运输管理',
img: '../../static/tab/yunshu.png',
path: ''
}, {
text: '设备台账',
img: '../../static/tab/taizhang.png',
path: ''
}, {
text: '车辆派遣',
img: '../../static/tab/cheliang.png',
path: ''
}, {
text: '事项审批',
img: '../../static/tab/shenpi.png',
path: ''
}]
}
}).catch((err) => {
console.log(err);
})
}
const handleData = (arr) => {
let arrMap = new Map()
arr.forEach(el => {
if (arrMap.has(el.gas)) {
let obj = arrMap.get(el.gas)
arrMap.set(el.gas, {
...el,
dailyVolume: Number(el.dailyVolume + +obj.dailyVolume).toFixed(4)
})
} else {
arrMap.set(el.gas, el)
}
})
return [...arrMap.values()]
}
const jump = (url) => {
beforeJump(url, () => {
if (!url) return
uni.navigateTo({
url
})
})
}
</script>
<style lang="scss" scoped>
.container {
padding: 20rpx;
background-color: #f8f8f8;
min-height: 100vh;
}
.main-card {
border-radius: 20rpx;
box-shadow: 0 5rpx 15rpx rgba(0, 0, 0, 0.1);
padding: 30rpx;
}
.data-row {
margin-bottom: 20rpx;
}
.value-group {
display: flex;
flex-direction: column;
gap: 5rpx;
}
/* 覆盖uni-col默认样式 */
.uni-col {
padding: 15rpx;
background-color: #f8f8f8;
border-radius: 15rpx;
}
</style>

View File

@ -1,18 +1,32 @@
<template>
<view>
<view class="nav">生产经营数据</view>
<product-data></product-data>
</view>
</template>
<script setup>
import productData from "@/pages/product/index.vue"
const res = wx.getSystemInfoSync();
const statusHeight = res.statusBarHeight; //
const cusnavbarheight = statusHeight + 44 + 'px';
import productData from '@/pages/views/shengchan/index.vue';
</script>
<style>
page {
background-color: #F8F8F8;
}
</style>
<style lang="scss" scoped>
.nav {
width: calc(100% - 60rpx);
padding: 0 30rpx;
height: v-bind(cusnavbarheight);
font-size: 24rpx;
color: #ffffff;
position: fixed;
top: 0;
left: 0;
z-index: 99;
background-image: url('../../static/my/navbg.png');
background-repeat: no-repeat;
background-size: 750rpx 458rpx;
}
</style>

View File

@ -7,8 +7,7 @@
<uni-col :span="18"><yjly-row-cell :cellData="cellData" :rowDataCount="2"></yjly-row-cell></uni-col>
<uni-col :span="6">
<view class="img">
<image mode="aspectFit"
:src="'https://36.112.48.190/jeecg-boot/sys/common/static/' + imgUrl"></image>
<image mode="aspectFit" :src="'https://36.112.48.190/jeecg-boot/sys/common/static/' + imgUrl"></image>
</view>
</uni-col>
</uni-row>
@ -65,12 +64,12 @@
<uni-row>
<view v-for="(item, index) in gzjlList">
<uni-col :span="4">
<view class="dataStyle1">
<view class="dataStyle2">
{{ item.kssj }}
</view>
</uni-col>
<uni-col :span="4">
<view class="dataStyle1">
<view class="dataStyle2">
{{ item.jssj }}
</view>
</uni-col>
@ -240,389 +239,370 @@
</view>
</uni-row>
</view>
</view>
</scroll-view>
</view>
</template>
<script setup>
import {
onReady,
onLoad
} from '@dcloudio/uni-app';
import {
reactive,
ref,
onMounted
} from 'vue';
import {
queryGzjlByRyLdhth,
queryQzqkByRyLdhth,
queryJtzycyByRyLdhth,
queryXlxxByRyLdhth,
queryGbxxByRyLdhth,
queryZyzgdjByRyLdhth,
queryJxkhByRyLdhth
} from '@/api/renyuan.js';
import {
useStore
} from '@/store';
import { onReady, onLoad } from '@dcloudio/uni-app';
import { reactive, ref, onMounted } from 'vue';
import { queryGzjlByRyLdhth, queryQzqkByRyLdhth, queryJtzycyByRyLdhth, queryXlxxByRyLdhth, queryGbxxByRyLdhth, queryZyzgdjByRyLdhth, queryJxkhByRyLdhth } from '@/api/renyuan.js';
import { useStore } from '@/store';
const store = useStore();
const store = useStore();
const tempCellData = ref({
title: '',
value: '',
titleSpan: 4,
valueSpan: 4
});
const tempCellData = ref({
title: '',
value: '',
titleSpan: 4,
valueSpan: 4
});
const roleDetail = ref(store.userinfo.realname === '廖德云' || store.userinfo.realname === '马敬朝')
const roleDetail = ref(store.userinfo.realname === '廖德云' || store.userinfo.realname === '马敬朝');
const ldhth = ref('');
const imgUrl = ref('');
const renyuanData = ref({});
const cellData = ref([]);
const cellData1 = ref([]);
const ldhth = ref('');
const imgUrl = ref('');
const renyuanData = ref({});
const cellData = ref([]);
const cellData1 = ref([]);
const gzjlList = ref([]); // -
const zjtzList = ref([]); // -
const zyjtcyList = ref([]); // -
const xlxxList = ref([]); // -
const gbxxList = ref([]); // -
const zyzgdjList = ref([]); // -
const jxkhxxList = ref([]); // -
const gzjlList = ref([]); // -
const zjtzList = ref([]); // -
const zyjtcyList = ref([]); // -
const xlxxList = ref([]); // -
const gbxxList = ref([]); // -
const zyzgdjList = ref([]); // -
const jxkhxxList = ref([]); // -
function getChildTable() {
console.log(ldhth.value);
function getChildTable() {
console.log(ldhth.value);
queryJxkhByRyLdhth({
ldhth: ldhth.value
})
.then((res) => {
// console.log(res);
jxkhxxList.value = res.result.records;
// console.log(jxkhxxList.value)
})
.catch((err) => {
console.log(err);
});
queryJxkhByRyLdhth({
ldhth: ldhth.value
})
.then((res) => {
// console.log(res);
jxkhxxList.value = res.result.records;
// console.log(jxkhxxList.value)
})
.catch((err) => {
console.log(err);
});
queryGbxxByRyLdhth({
ldhth: ldhth.value
})
.then((res) => {
// console.log(res);
gbxxList.value = res;
// console.log(gbxxList.value)
})
.catch((err) => {
console.log(err);
});
queryZyzgdjByRyLdhth({
ldhth: ldhth.value
})
.then((res) => {
// console.log(res);
zyzgdjList.value = res;
// console.log(zyzgdjList.value)
})
.catch((err) => {
console.log(err);
});
queryGzjlByRyLdhth({
ldhth: ldhth.value
})
.then((res) => {
// console.log(res);
if (res.length > 0) {
gzjlList.value = res;
}
})
.catch((err) => {
console.log(err);
});
queryQzqkByRyLdhth({
ldhth: ldhth.value
})
.then((res) => {
// console.log(res);
if (res.length > 0) {
zjtzList.value = res;
}
})
.catch((err) => {
console.log(err);
});
queryJtzycyByRyLdhth({
ldhth: ldhth.value
})
.then((res) => {
// console.log(res);
if (res.length > 0) {
zyjtcyList.value = res;
}
})
.catch((err) => {
console.log(err);
});
queryXlxxByRyLdhth({
ldhth: ldhth.value
})
.then((res) => {
if (res.success) {
xlxxList.value = [];
if (res.result.records.length > 0) {
var rress = res.result.records;
// console.log(rress);
for (let i = 0; i < rress.length; i++) {
if ((rress[i].onexl == 1) & (rress[i].zgxl == 1)) {
rress[i].xllb = '第一学历';
xlxxList.value.push(JSON.parse(JSON.stringify(rress[i])));
// console.log(xlxxList.value)
rress[i].xllb = '最高学历';
xlxxList.value.push(JSON.parse(JSON.stringify(rress[i])));
// console.log(xlxxList.value)
}
if ((rress[i].onexl == 1) & (rress[i].zgxl != 1)) {
rress[i].xllb = '第一学历';
xlxxList.value.push(rress[i]);
}
if ((rress[i].onexl != 1) & (rress[i].zgxl == 1)) {
rress[i].xllb = '最高学历';
xlxxList.value.push(rress[i]);
}
queryGbxxByRyLdhth({
ldhth: ldhth.value
})
.then((res) => {
// console.log(res);
gbxxList.value = res;
// console.log(gbxxList.value)
})
.catch((err) => {
console.log(err);
});
queryZyzgdjByRyLdhth({
ldhth: ldhth.value
})
.then((res) => {
// console.log(res);
zyzgdjList.value = res;
// console.log(zyzgdjList.value)
})
.catch((err) => {
console.log(err);
});
queryGzjlByRyLdhth({
ldhth: ldhth.value
})
.then((res) => {
// console.log(res);
if (res.length > 0) {
gzjlList.value = res;
}
})
.catch((err) => {
console.log(err);
});
queryQzqkByRyLdhth({
ldhth: ldhth.value
})
.then((res) => {
// console.log(res);
if (res.length > 0) {
zjtzList.value = res;
}
})
.catch((err) => {
console.log(err);
});
queryJtzycyByRyLdhth({
ldhth: ldhth.value
})
.then((res) => {
// console.log(res);
if (res.length > 0) {
zyjtcyList.value = res;
}
})
.catch((err) => {
console.log(err);
});
queryXlxxByRyLdhth({
ldhth: ldhth.value
})
.then((res) => {
if (res.success) {
xlxxList.value = [];
if (res.result.records.length > 0) {
var rress = res.result.records;
// console.log(rress);
for (let i = 0; i < rress.length; i++) {
if ((rress[i].onexl == 1) & (rress[i].zgxl == 1)) {
rress[i].xllb = '第一学历';
xlxxList.value.push(JSON.parse(JSON.stringify(rress[i])));
// console.log(xlxxList.value)
rress[i].xllb = '最高学历';
xlxxList.value.push(JSON.parse(JSON.stringify(rress[i])));
// console.log(xlxxList.value)
}
if ((rress[i].onexl == 1) & (rress[i].zgxl != 1)) {
rress[i].xllb = '第一学历';
xlxxList.value.push(rress[i]);
}
if ((rress[i].onexl != 1) & (rress[i].zgxl == 1)) {
rress[i].xllb = '最高学历';
xlxxList.value.push(rress[i]);
}
}
}
}
// adjustFontSize()
})
.catch((err) => {
console.log(err);
});
}
// adjustFontSize()
})
.catch((err) => {
console.log(err);
});
}
function getJbxx() {
cellData.value.push({
title: '姓名',
value: renyuanData.value.xm,
titleSpan: 6,
valueSpan: 6,
class: 'dataStyle'
});
cellData.value.push({
title: '性别',
value: renyuanData.value.xb_dictText,
titleSpan: 6,
valueSpan: 6,
class: 'dataStyle'
});
cellData.value.push({
title: '出生年月',
value: renyuanData.value.cssj,
titleSpan: 6,
valueSpan: 6,
class: 'dataStyle'
});
cellData.value.push({
title: '民族',
value: renyuanData.value.mz,
titleSpan: 6,
valueSpan: 6,
class: 'dataStyle'
});
cellData.value.push({
title: '籍贯',
value: renyuanData.value.jg,
titleSpan: 6,
valueSpan: 6,
class: 'dataStyle'
});
cellData.value.push({
title: '出生地',
value: renyuanData.value.csd,
titleSpan: 6,
valueSpan: 6,
class: 'dataStyle'
});
cellData.value.push({
title: '工作时间',
value: renyuanData.value.cjgzsj,
titleSpan: 6,
valueSpan: 6,
class: 'dataStyle'
});
cellData.value.push({
title: '现专业',
value: '',
titleSpan: 6,
valueSpan: 6,
class: 'dataStyle1'
});
cellData.value.push({
title: '政治面貌',
value: renyuanData.value.zzmm === '群众' ? renyuanData.value.zzmm : renyuanData.value.zzmm + renyuanData
.value.jrsj,
titleSpan: 5,
valueSpan: 7,
class: 'dataStyle1'
});
cellData.value.push({
title: '用工形式',
value: renyuanData.value.rylb1_dictText,
titleSpan: 5,
valueSpan: 7,
class: 'dataStyle1'
});
cellData1.value.push({
title: '所在单位',
value: renyuanData.value.orgCode_dictText,
titleSpan: 5,
valueSpan: 7,
class: 'dataStyle1'
});
cellData1.value.push({
title: '专业技术资格',
value: gbxxList.value.zc === 0 ? '/' : gbxxList.value.zc + gbxxList.value.zcsj,
titleSpan: 5,
valueSpan: 7,
class: 'dataStyle1'
});
cellData1.value.push({
title: '',
value: '',
titleSpan: 0,
valueSpan: 0,
class: 'dataStyle'
});
cellData1.value.push({
title: '职业资格等级',
value: zyzgdjList.value.ztgz === '0' ? '/' : zyzgdjList.value.ztgz + zyzgdjList.value.ztgzdj,
titleSpan: 4,
valueSpan: 4,
class: 'dataStyle1'
});
cellData1.value.push({
title: '职务(岗位)',
value: gbxxList.value.zw,
titleSpan: 4,
valueSpan: 4,
class: 'dataStyle1'
});
cellData1.value.push({
title: '职位级别',
value: gbxxList.value.zwcj,
titleSpan: 4,
valueSpan: 4,
class: 'dataStyle'
});
}
onLoad((e) => {
console.log(store.userinfo)
renyuanData.value = JSON.parse(decodeURIComponent(e.data));
imgUrl.value = renyuanData.value.zplj;
console.log(imgUrl.value, renyuanData.value);
ldhth.value = renyuanData.value.ldhth;
getChildTable();
setTimeout(function() {
getJbxx();
}, 500);
function getJbxx() {
cellData.value.push({
title: '姓名',
value: renyuanData.value.xm,
titleSpan: 6,
valueSpan: 6,
class: 'dataStyle'
});
cellData.value.push({
title: '性别',
value: renyuanData.value.xb_dictText,
titleSpan: 6,
valueSpan: 6,
class: 'dataStyle'
});
cellData.value.push({
title: '出生年月',
value: renyuanData.value.cssj,
titleSpan: 6,
valueSpan: 6,
class: 'dataStyle'
});
cellData.value.push({
title: '民族',
value: renyuanData.value.mz,
titleSpan: 6,
valueSpan: 6,
class: 'dataStyle'
});
cellData.value.push({
title: '籍贯',
value: renyuanData.value.jg,
titleSpan: 6,
valueSpan: 6,
class: 'dataStyle'
});
cellData.value.push({
title: '出生地',
value: renyuanData.value.csd,
titleSpan: 6,
valueSpan: 6,
class: 'dataStyle'
});
cellData.value.push({
title: '工作时间',
value: renyuanData.value.cjgzsj,
titleSpan: 6,
valueSpan: 6,
class: 'dataStyle'
});
cellData.value.push({
title: '现专业',
value: '',
titleSpan: 6,
valueSpan: 6,
class: 'dataStyle1'
});
cellData.value.push({
title: '政治面貌',
value: renyuanData.value.zzmm === '群众' ? renyuanData.value.zzmm : renyuanData.value.zzmm + renyuanData.value.jrsj,
titleSpan: 5,
valueSpan: 7,
class: 'dataStyle1'
});
cellData.value.push({
title: '用工形式',
value: renyuanData.value.rylb1_dictText,
titleSpan: 5,
valueSpan: 7,
class: 'dataStyle1'
});
cellData1.value.push({
title: '所在单位',
value: renyuanData.value.orgCode_dictText,
titleSpan: 5,
valueSpan: 7,
class: 'dataStyle1'
});
cellData1.value.push({
title: '专业技术资格',
value: gbxxList.value.zc === 0 ? '/' : gbxxList.value.zc + gbxxList.value.zcsj,
titleSpan: 5,
valueSpan: 7,
class: 'dataStyle1'
});
cellData1.value.push({
title: '',
value: '',
titleSpan: 0,
valueSpan: 0,
class: 'dataStyle'
});
cellData1.value.push({
title: '职业资格等级',
value: zyzgdjList.value.ztgz === '0' ? '/' : zyzgdjList.value.ztgz + zyzgdjList.value.ztgzdj,
titleSpan: 4,
valueSpan: 4,
class: 'dataStyle1'
});
cellData1.value.push({
title: '职务(岗位)',
value: gbxxList.value.zw,
titleSpan: 4,
valueSpan: 4,
class: 'dataStyle1'
});
cellData1.value.push({
title: '职位级别',
value: gbxxList.value.zwcj,
titleSpan: 4,
valueSpan: 4,
class: 'dataStyle'
});
}
onLoad((e) => {
console.log(store.userinfo);
renyuanData.value = JSON.parse(decodeURIComponent(e.data));
imgUrl.value = renyuanData.value.zplj;
console.log(imgUrl.value, renyuanData.value);
ldhth.value = renyuanData.value.ldhth;
getChildTable();
setTimeout(function () {
getJbxx();
}, 500);
});
</script>
<style scoped>
.renyuanInfo {
position: absolute;
bottom: 0;
left: 0;
right: 0;
top: 0;
height: 98vh;
width: 900px;
background-color: rgba(0, 0, 0, 0.4);
display: flex;
flex-direction: row;
font-size: 18px;
color: #fff;
}
.renyuanInfo {
position: absolute;
bottom: 0;
left: 0;
right: 0;
top: 0;
height: 98vh;
width: 900px;
background-color: rgba(0, 0, 0, 0.4);
display: flex;
flex-direction: row;
font-size: 18px;
color: #fff;
}
.titleStyle {
font-size: 12px;
color: #747474;
line-height: 35px;
height: 35px;
background: #f2f9fc;
text-align: center;
vertical-align: middle;
border-left: 1px solid #919191;
border-bottom: 1px solid #919191;
}
.titleStyle {
font-size: 12px;
color: #747474;
line-height: 35px;
height: 35px;
background: #f2f9fc;
text-align: center;
vertical-align: middle;
border-left: 1px solid #919191;
border-bottom: 1px solid #919191;
}
/* 内容样式 */
.dataStyle {
font-size: 14px;
color: #00007f;
line-height: 25px;
height: 50px;
font-weight: 500;
text-align: center;
vertical-align: middle;
border-bottom: 1px solid #919191;
border-left: 1px solid #919191;
text-align: center;
word-wrap: break-word;
overflow-wrap: break-word;
}
/* 内容样式 */
.dataStyle {
font-size: 14px;
color: #00007f;
line-height: 25px;
height: 50px;
font-weight: 500;
text-align: center;
vertical-align: middle;
border-bottom: 1px solid #919191;
border-left: 1px solid #919191;
text-align: center;
word-wrap: break-word;
overflow-wrap: break-word;
}
/* 内容样式 */
.dataStyle1 {
font-size: 14px;
color: #00007f;
line-height: 30px;
height: 30px;
font-weight: 500;
text-align: center;
vertical-align: middle;
border-bottom: 1px solid #919191;
border-left: 1px solid #919191;
word-wrap: break-word;
overflow-wrap: break-word;
}
/* 内容样式 */
.dataStyle1 {
font-size: 14px;
color: #00007f;
line-height: 30px;
height: 30px;
font-weight: 500;
text-align: center;
vertical-align: middle;
border-bottom: 1px solid #919191;
border-left: 1px solid #919191;
word-wrap: break-word;
overflow-wrap: break-word;
}
/* 内容样式 */
.dataStyle2 {
font-size: 12px;
color: #00007f;
line-height: 15px;
height: 30px;
font-weight: 500;
text-align: center;
vertical-align: middle;
border-bottom: 1px solid #919191;
border-left: 1px solid #919191;
text-align: center;
word-wrap: break-word;
overflow-wrap: break-word;
}
/* 内容样式 */
.dataStyle2 {
font-size: 12px;
color: #00007f;
line-height: 15px;
height: 30px;
font-weight: 500;
text-align: center;
vertical-align: middle;
border-bottom: 1px solid #919191;
border-left: 1px solid #919191;
text-align: center;
word-wrap: break-word;
overflow-wrap: break-word;
}
.img {
height: 154px;
border: 1px solid #ccc;
/* 仅用于展示容器范围,可根据需要移除 */
display: flex;
justify-content: center;
/* 水平居中 */
align-items: center;
/* 垂直居中 */
overflow: hidden;
/* 防止图片溢出容器 */
}
</style>
.img {
height: 154px;
border: 1px solid #ccc;
/* 仅用于展示容器范围,可根据需要移除 */
display: flex;
justify-content: center;
/* 水平居中 */
align-items: center;
/* 垂直居中 */
overflow: hidden;
/* 防止图片溢出容器 */
}
</style>

View File

@ -0,0 +1,52 @@
<template>
<view>
<!-- <view class="nav">生产经营数据</view> -->
<view class="placeholder">生产经营数据</view>
<trq-data></trq-data>
<yy-data></yy-data>
</view>
</template>
<script setup>
import {
formatDate,
getDateAfterDays
} from '@/utils/dateTime.js';
const res = wx.getSystemInfoSync();
const statusHeight = res.statusBarHeight; //
const cusnavbarheight = statusHeight + 44 + 'px';
import trqData from './ribaoshuju/trqRbsj.vue';
import yyData from './ribaoshuju/yyRbsj.vue';
const strDate = (() => {
const now = new Date();
if (now.getHours() < 11) {
return formatDate(getDateAfterDays(now, -1)).toString(); //11
} else {
return formatDate(now).toString();
}
})
</script>
<style lang="scss" scoped>
.nav {
width: calc(100% - 60rpx);
padding: 0 30rpx;
height: v-bind(cusnavbarheight);
font-size: 24rpx;
color: #ffffff;
position: fixed;
top: 0;
left: 0;
z-index: 99;
background-image: url('../../static/my/navbg.png');
background-repeat: no-repeat;
background-size: 750rpx 458rpx;
}
.placeholder {
height: v-bind(cusnavbarheight);
}
</style>

View File

@ -0,0 +1,448 @@
<template>
<view :class="{ gray: store.isgray == 1 }">
<view style="margin-left: 20rpx;"> <uni-title :title="strDate + ':生产数据'" type="h1" color="red" />
</view>
<view class="container">
<view v-for="(item, index) in shishiArr" :key="index" class="card-item" @click="handleCardClick(item.gas)">
<view class="card">
<text class="title">{{ item.gas }}</text>
<view class="content">
<text class="label">日气量</text>
<text class="value">{{ item.dailyVolume || '-' }}</text>
</view>
<view class="content">
<text class="label">年累计</text>
<text class="value">{{ item.yearVolume || '-' }}</text>
</view>
</view>
</view>
</view>
<!-- 数据弹窗 -->
<uni-popup ref="popup" type="bottom" background-color="#fff">
<view class="popup-content">
<view class="popup-header">
<text class="title">{{ selectedGas }}数据详情 单位(万立方米)</text>
<uni-icons type="closeempty" size="24" color="#666" @click="closePopup"></uni-icons>
</view>
<scroll-view scroll-X="true" scroll-Y="true" class="table-container">
<view class="table">
<!-- 表头 -->
<view class="tr header">
<view class="th1">序号</view>
<view class="th">名称</view>
<view class="th">日气量</view>
<view class="th">总气量 </view>
<view class="th">年累计 </view>
</view>
<!-- 表格内容 -->
<view class="tr" v-for="(item, index) in filteredData" :key="index"
:class="{ even: index % 2 === 0 }">
<view class="td1">{{ index }}</view>
<view class="td">{{ item.unit }}</view>
<view class="td" :class="{ negative: item.rq < 0 }">
{{ formatNumber(item.rq) }}
</view>
<view class="td">{{ formatNumber(item.totalGas) }}</view>
<view class="td" :class="{ negative: item.yearVolume < 0 }">
{{ formatNumber(item.yearVolume) }}
</view>
</view>
<!-- 空数据提示 -->
<view v-if="!filteredData.length" class="empty">
暂无相关数据
</view>
</view>
</scroll-view>
</view>
</uni-popup>
</view>
</template>
<script setup>
import {
ref,
onMounted,
computed,
nextTick,
watchEffect
} from 'vue';
import {
onLoad
} from '@dcloudio/uni-app';
import {
queryJinriShengchansj,
queryYearShengchansj
} from '@/api/shengchan.js';
import {
formatDate,
getDateAfterDays
} from '@/utils/dateTime.js';
import {
beforeJump
} from '@/utils/index.js';
import {
useStore
} from '@/store';
const store = useStore();
const shishiArr = ref([{
gas: '气井气',
dailyVolume: '',
yearVolume: ''
},
{
gas: '伴生气',
dailyVolume: '',
yearVolume: ''
},
{
gas: '外部气',
dailyVolume: '',
yearVolume: ''
},
{
gas: '站输差',
dailyVolume: '',
yearVolume: ''
},
{
gas: '线输差',
dailyVolume: '',
yearVolume: ''
},
{
gas: '综合输差',
dailyVolume: '',
yearVolume: ''
}
]);
const dataJinri = ref([]);
const dataJinriSum = ref([]);
const dataJinriSumUnit = ref([]);
const selectedGas = ref('');
const filteredData = ref([]);
const popup = ref(null);
//
const handleCardClick = (gas) => {
selectedGas.value = gas;
filteredData.value = dataJinriSumUnit.value.filter(item => item.gas === gas);
popup.value.open();
};
//
const closePopup = () => {
popup.value.close();
};
onMounted(() => {
getJinriShengchansj();
getYearShengchansj();
});
const strDate = ref('');
//
const formatNumber = (num) => {
if (typeof num !== 'number') return '-';
return num.toFixed(4).replace(/\.?0+$/, '');
};
//
const groupedData = computed(() => {
const groups = [];
for (let i = 0; i < shishiArr.value.length; i += 3) {
groups.push(shishiArr.value.slice(i, i + 3));
}
return groups;
});
//
watchEffect(() => {
const station = shishiArr.value[3] //
const line = shishiArr.value[4] // 线
const composite = shishiArr.value[5] //
//
const dailyStation = parseFloat(station.dailyVolume) || 0
const dailyLine = parseFloat(line.dailyVolume) || 0
composite.dailyVolume = (dailyStation + dailyLine).toFixed(4)
//
const yearStation = parseFloat(station.yearVolume) || 0
const yearLine = parseFloat(line.yearVolume) || 0
composite.yearVolume = (yearStation + yearLine).toFixed(4)
})
const getJinriShengchansj = () => {
const now = new Date();
if (now.getHours() < 11) {
strDate.value = formatDate(getDateAfterDays(now, -1)).toString(); //11
} else {
strDate.value = formatDate(now).toString();
}
let queryParms = {};
dataJinri.value = [];
dataJinriSum.value = [];
dataJinriSumUnit.value = [];
queryParms.rqDate = strDate.value;
queryParms.pageSize = 100;
// console.log(queryParms);
queryJinriShengchansj(queryParms).then((res) => {
if (res.success) {
// console.log(res);
dataJinri.value = res.result.records;
dataJinriSumUnit.value = sumByUnit(dataJinri.value); //gas unit rq cq totalGas
// console.log(dataJinriSumUnit.value);
// 使 nextTick DOM
nextTick();
getYearShengchansj(); //
}
});
};
const getYearShengchansj = () => {
const now = new Date();
let year = formatDate(now).split('-')[0];
let queryParms = {};
queryParms.yearStart = year;
queryParms.yearEnd = year;
// // console.log(2, queryParms.value);
queryYearShengchansj(queryParms).then((res) => {
if (res.success) {
try {
// // console.log(res.result);
let yearData = res.result[year];
// console.log(dataJinriSumUnit.value.length, dataJinriSumUnit.value, yearData.length,
// yearData);
dataJinriSumUnit.value.forEach((item) => {
yearData.forEach((itemYear) => {
// // console.log(item, itemYear);
if (item.unit === itemYear.unit) {
item.yearVolume = itemYear.yearSum || 0;
}
});
});
dataJinriSum.value = sumByGas(dataJinriSumUnit.value);
// console.log(dataJinriSum.value);
shishiArr.value.forEach((item) => {
dataJinriSum.value.forEach((itemjinri) => {
if (item.gas === itemjinri.gas) {
item.dailyVolume = itemjinri.rq.toFixed(4);
item.yearVolume = itemjinri.yearVolume.toFixed(4);
}
});
});
} catch (error) {
// console.log(error);
}
}
});
};
function sumByGas(records) {
// console.log(records);
const summaryMap = {};
try {
records.forEach((record) => {
const gas = record.gas;
if (!summaryMap[gas]) {
// gas
summaryMap[gas] = {
gas: gas,
rq: 0,
sq: 0,
totalGas: 0,
yearVolume: 0
};
}
// gas
summaryMap[gas].rq += record.rq || 0;
summaryMap[gas].sq += record.sq || 0;
summaryMap[gas].totalGas += record.totalGas || 0;
summaryMap[gas].yearVolume += record.yearVolume || 0;
});
return Object.values(summaryMap);
} catch (error) {
//TODO handle the exception
// console.log(error);
}
}
function sumByUnit(records) {
// console.log(records);
const summaryMap = {};
try {
records.forEach((record) => {
const unit = record.unit;
if (!unit.includes('区')) {
if (!summaryMap[unit]) {
// gas
summaryMap[unit] = {
unit: unit,
gas: record.gas,
rq: 0,
sq: 0,
totalGas: 0,
yearVolume: 0
};
}
// unit
summaryMap[unit].rq += record.rq || 0;
summaryMap[unit].sq += record.sq || 0;
summaryMap[unit].totalGas += record.totalGas || 0;
summaryMap[unit].yearVolume += record.yearVolume || 0;
}
});
return Object.values(summaryMap);
} catch (error) {
//TODO handle the exception
// console.log(error);
}
}
</script>
<style lang="scss" scoped>
.container {
display: flex;
flex-wrap: wrap;
padding: 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;
color: #333;
text-align: center;
white-space: nowrap;
}
.th1,
.td1 {
flex: 1;
max-width: 40rpx;
padding: 10rpx;
font-size: 20rpx;
color: #333;
text-align: center;
white-space: nowrap;
}
.th {
background-color: #f0f0f0;
}
.td.negative {
color: #ff4444;
font-weight: 500;
}
}
.empty {
padding: 40rpx;
text-align: center;
color: #888;
font-size: 16rpx;
}
.card-item {
flex: 1 1 200rpx; // 300rpx selectedGas formatNumber
min-width: 240rpx;
max-width: calc(50% - 10rpx); //
@media (min-width: 768px) {
max-width: calc(33.33% - 14rpx); // 3
}
}
.card {
background: #ffffff;
border-radius: 16rpx;
padding: 10rpx;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
.title {
display: block;
font-size: 28rpx;
font-weight: 600;
color: #333;
margin-bottom: 16rpx;
}
.content {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10rpx;
&:last-child {
margin-bottom: 0;
}
.label {
font-size: 24rpx;
color: #666;
}
.value {
font-size: 28rpx;
color: #0000ff;
font-weight: 500;
}
}
}
</style>

View File

@ -0,0 +1,326 @@
<template>
<view :class="{ gray: store.isgray == 1 }">
<!-- <view style="margin-left: 20rpx;"> <uni-title :title="strDate + ':生产数据'" type="h1" color="red" /> -->
<!-- </view> -->
<view class="container">
<view v-for="(item, index) in shishiArr" :key="index" class="card-item" @click="handleCardClick(item.gas)">
<view class="card">
<text class="title">{{ item.gas }}</text>
<view class="content">
<text class="label">日油量</text>
<text class="value">{{ item.rcwy || '-' }}</text>
</view>
<view class="content">
<text class="label">月累计</text>
<text class="value">{{ item.yl || '-' }}</text>
</view>
<view class="content">
<text class="label">年累计</text>
<text class="value">{{ item.nl || '-' }}</text>
</view>
</view>
</view>
</view>
<!-- 数据弹窗 -->
<uni-popup ref="popup" type="bottom" background-color="#fff">
<view class="popup-content">
<view class="popup-header">
<text class="title">原油数据详情 单位()</text>
<uni-icons type="closeempty" size="24" color="#666" @click="closePopup"></uni-icons>
</view>
<scroll-view scroll-X="true" scroll-Y="true" class="table-container">
<view class="table">
<!-- 表头 -->
<view class="tr header">
<view class="th">序号</view>
<view class="th">名称</view>
<view class="th">日油量</view>
<view class="th">月累计 </view>
<view class="th">年累计 </view>
</view>
<!-- 表格内容 -->
<view class="tr" v-for="(item, index) in dataJinri" :key="index"
:class="{ even: index % 2 === 0 }">
<view class="td">{{ 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>
<!-- 空数据提示 -->
<view v-if="!dataJinri.length" class="empty">
暂无相关数据
</view>
</view>
</scroll-view>
</view>
</uni-popup>
</view>
</template>
<script setup>
import {
ref,
onMounted,
computed,
nextTick,
watchEffect
} from 'vue';
import {
onLoad
} from '@dcloudio/uni-app';
import {
queryJinriYuanyouShengchansj
} from '@/api/shengchan.js';
import {
formatDate,
getDateAfterDays
} from '@/utils/dateTime.js';
import {
beforeJump
} from '@/utils/index.js';
import {
useStore
} from '@/store';
const store = useStore();
import dataCom from '@/bpm/dataCom.vue';
const shishiArr = ref([{
gas: '原油产量',
rcwy: '',
yl: '',
nl: ''
},
]);
const dataJinri = ref([]);
const dataJinriSum = ref([]);
const popup = ref(null);
//
const handleCardClick = () => {
popup.value.open();
};
//
const closePopup = () => {
popup.value.close();
};
onMounted(() => {
getJinriYuanyouShengchansj();
// getYearShengchansj();
});
const strDate = ref('');
//
const formatNumber = (num) => {
if (typeof num !== 'number') return '-';
return num.toFixed(4).replace(/\.?0+$/, '');
};
const getJinriYuanyouShengchansj = () => {
const now = new Date();
if (now.getHours() < 11) {
strDate.value = formatDate(getDateAfterDays(now, -1)).toString(); //11
} else {
strDate.value = formatDate(now).toString();
}
let queryParms = {};
dataJinri.value = [];
dataJinriSum.value = [];
queryParms.scrq = strDate.value;
queryParms.pageSize = 100;
console.log(queryParms);
queryJinriYuanyouShengchansj(queryParms).then((res) => {
if (res.success) {
console.log(res);
dataJinri.value = res.result.records;
dataJinriSum.value = sumByOil(dataJinri.value); //gas unit rq cq totalGas
console.log(dataJinriSum.value);
nextTick();
shishiArr.value.forEach((item) => {
dataJinriSum.value.forEach((itemjinri) => {
item.rcwy = itemjinri.rcwy.toFixed(4);
item.nl = itemjinri.nl.toFixed(4);
item.yl = itemjinri.yl.toFixed(4);
});
});
// getYearShengchansj(); //
}
});
};
function sumByOil(records) {
console.log(records);
const summaryMap = {};
try {
records.forEach((record) => {
const gas = record.gas;
if (!summaryMap[gas]) {
// gas
summaryMap[gas] = {
rcwy: 0,
yl: 0,
nl: 0
};
}
// gas
summaryMap[gas].rcwy += record.rcwy || 0;
summaryMap[gas].yl += record.yl || 0;
summaryMap[gas].nl += record.nl || 0
});
return Object.values(summaryMap);
} catch (error) {
//TODO handle the exception
console.log(error);
}
}
</script>
<style lang="scss" scoped>
.container {
display: flex;
flex-wrap: wrap;
padding: 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;
}
.th {
background-color: #f0f0f0;
}
.td.negative {
color: #ff4444;
font-weight: 500;
}
}
.empty {
padding: 40rpx;
text-align: center;
color: #888;
font-size: 16rpx;
}
.card-item {
flex: 1 1 200rpx; // 300rpx selectedGas formatNumber
min-width: 200rpx;
max-width: calc(50% - 10rpx); //
@media (min-width: 768px) {
max-width: calc(33.33% - 14rpx); // 3
}
}
.card {
background: #ffffff;
border-radius: 16rpx;
padding: 10rpx;
box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
.title {
display: block;
font-size: 28rpx;
font-weight: 600;
color: #333;
margin-bottom: 16rpx;
}
.content {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10rpx;
&:last-child {
margin-bottom: 0;
}
.label {
font-size: 24rpx;
color: #666;
}
.value {
font-size: 28rpx;
color: #0000ff;
font-weight: 500;
}
}
}
</style>

BIN
static/office/absence.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

BIN
static/tab/product2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB