liuchen864 8 months ago
parent
commit
8475ba5ea3
  1. 57
      src/api/basedata/marketplaceData/index.ts
  2. 65
      src/api/tjanalysis/index.ts
  3. 5
      src/components/Pagination/index.vue
  4. 5
      src/utils/dict.ts
  5. 231
      src/views/basedata/marketplaceData/index.vue
  6. 131
      src/views/basedata/marketplaceData/marketplaceData.data.ts
  7. 2
      src/views/lab/platscale/index.vue
  8. 259
      src/views/lab/platscaledata/index.vue
  9. 341
      src/views/lab/platscaledata/platscale.data.ts
  10. 20
      src/views/tjanalysis/electricdata/index.vue
  11. 41
      src/views/tjanalysis/electricdatatotal/index.vue
  12. 198
      src/views/tjanalysis/energyconsumption/index.vue
  13. 19
      src/views/tjanalysis/hrelongatordata/index.vue
  14. 19
      src/views/tjanalysis/hrpuncherdata/index.vue
  15. 19
      src/views/tjanalysis/hrsizingmilldata/index.vue
  16. 15
      src/views/tjanalysis/irealdata/index.vue
  17. 173
      src/views/tjanalysis/irealdatatotal/index.vue
  18. 19
      src/views/tjanalysis/natgasdatacd/index.vue
  19. 19
      src/views/tjanalysis/natgasdatahr/index.vue
  20. 19
      src/views/tjanalysis/natgasdatatotal/index.vue
  21. 12
      src/views/tjanalysis/platscale/index.vue
  22. 24
      src/views/tjanalysis/waterday/index.vue

57
src/api/basedata/marketplaceData/index.ts

@ -0,0 +1,57 @@
import request from '@/config/axios'
export interface MarketplaceDataVO {
id: number
type: string
name: string
describes: string
price: number
amountIncrease: string
field1: string
field2: string
field3: string
field4: string
available: string
concurrencyStamp: number
}
// 查询市场数据管理列表
export const getMarketplaceDataPage = async (params) => {
if (params.isSearch) {
delete params.isSearch
const data = {...params}
return await request.post({ url: '/basic/marketplace-data/senior', data })
} else {
return await request.get({ url: `/basic/marketplace-data/page`, params })
}
}
// 查询市场数据管理详情
export const getMarketplaceData = async (id: number) => {
return await request.get({ url: `/basic/marketplace-data/get?id=` + id })
}
// 新增市场数据管理
export const createMarketplaceData = async (data: MarketplaceDataVO) => {
return await request.post({ url: `/basic/marketplace-data/create`, data })
}
// 修改市场数据管理
export const updateMarketplaceData = async (data: MarketplaceDataVO) => {
return await request.put({ url: `/basic/marketplace-data/update`, data })
}
// 删除市场数据管理
export const deleteMarketplaceData = async (id: number) => {
return await request.delete({ url: `/basic/marketplace-data/delete?id=` + id })
}
// 导出市场数据管理 Excel
export const exportMarketplaceData = async (params) => {
return await request.download({ url: `/basic/marketplace-data/export-excel`, params })
}
// 下载导入模板
export const importTemplate = () => {
return request.download({ url: '/basic/marketplace-data/get-import-template' })
}

65
src/api/tjanalysis/index.ts

@ -5,11 +5,31 @@ export const queryIrealdataTj = async (params) => {
return await request.get({ url: `/tjanalysis/queryIrealdataTj`, params }) return await request.get({ url: `/tjanalysis/queryIrealdataTj`, params })
} }
// 导出一次主表日统计报表
export const exportIrealdataTj = async (params) => {
return await request.download({ url: `/tjanalysis/exportIrealdataTj`, params})
}
// 获取一次主表时间范围统计报表数据
export const queryIrealdataTimeTj = async (params) => {
return await request.get({ url: `/tjanalysis/queryIrealdataTimeTj`, params })
}
// 导出一次主表时间范围统计报表数据
export const exportIrealdataTimeTj = async (params) => {
return await request.download({ url: `/tjanalysis/exportIrealdataTimeTj`, params })
}
// 获取智能电表日统计报表数据 // 获取智能电表日统计报表数据
export const queryElectricdataTj = async (params) => { export const queryElectricdataTj = async (params) => {
return await request.get({ url: `/tjanalysis/queryElectricdataTj`, params }) return await request.get({ url: `/tjanalysis/queryElectricdataTj`, params })
} }
// 导出智能电表日统计报表数据数据
export const exportElectricdataTj = async (params) => {
return await request.download({ url: `/tjanalysis/exportElectricdataTj`, params })
}
// 获取地衡数据统计 // 获取地衡数据统计
export const queryTjPlatScales = async (params) => { export const queryTjPlatScales = async (params) => {
return await request.get({ url: `/tjanalysis/queryTjPlatScales`, params }) return await request.get({ url: `/tjanalysis/queryTjPlatScales`, params })
@ -25,6 +45,11 @@ export const queryNatgasdatatotal = async (params) => {
return await request.get({ url: `/tjanalysis/queryNatgasdatatotal`, params }) return await request.get({ url: `/tjanalysis/queryNatgasdatatotal`, params })
} }
// 导出天然气总流量日统计
export const exportNatgasDataTotal = async (params) => {
return await request.download({ url: `/tjanalysis/exportNatgasDataTotal`, params })
}
// 智能报表统计 // 智能报表统计
export const queryElectricdataAllTj = async (params) => { export const queryElectricdataAllTj = async (params) => {
return await request.get({ url: `/tjanalysis/queryElectricdataAllTj`, params }) return await request.get({ url: `/tjanalysis/queryElectricdataAllTj`, params })
@ -40,16 +65,31 @@ export const queryNatgasDatacdDay = async (params) => {
return await request.get({ url: `/tjanalysis/queryNatgasDatacdDay`, params}) return await request.get({ url: `/tjanalysis/queryNatgasDatacdDay`, params})
} }
// 导出冷拔天然气数据日统计报表
export const exportNatgasDatacdDay = async (params) => {
return await request.download({ url: `/tjanalysis/exportNatgasDatacdDay`, params})
}
// 热轧天然气数据日统计报表 // 热轧天然气数据日统计报表
export const queryNatgasdataDay = async (params) => { export const queryNatgasdataDay = async (params) => {
return await request.get({ url: `/tjanalysis/queryNatgasdataDay`, params}) return await request.get({ url: `/tjanalysis/queryNatgasdataDay`, params})
} }
// 导出热轧天然气数据日统计报表
export const exportNatgasDataDay = async (params) => {
return await request.download({ url: `/tjanalysis/exportNatgasDataDay`, params})
}
// 智能水表数据日统计表 // 智能水表数据日统计表
export const queryWaterDay = async (params) => { export const queryWaterDay = async (params) => {
return await request.get({ url: `/tjanalysis/queryWaterDay`, params}) return await request.get({ url: `/tjanalysis/queryWaterDay`, params})
} }
// 导出智能水表数据日统计表
export const exportWaterDay = async (params) => {
return await request.download({ url: `/tjanalysis/exportWaterDay`, params})
}
// 冷拔-拔机日统计报表 // 冷拔-拔机日统计报表
export const queryXcqtyDay = async (params) => { export const queryXcqtyDay = async (params) => {
return await request.get({ url: `/tjanalysis/queryXcqtyDay`, params}) return await request.get({ url: `/tjanalysis/queryXcqtyDay`, params})
@ -60,13 +100,38 @@ export const queryHrpuncherDay = async (params) => {
return await request.get({ url: `/tjanalysis/queryHrpuncherDay`, params }) return await request.get({ url: `/tjanalysis/queryHrpuncherDay`, params })
} }
// 导出热轧穿孔机日统计报表
export const exportHrpuncherDay = async (params) => {
return await request.download({ url: `/tjanalysis/exportHrpuncherDay`, params })
}
// 获取热轧延伸机日统计报表 // 获取热轧延伸机日统计报表
export const queryRzcjinfoDay = async (params) => { export const queryRzcjinfoDay = async (params) => {
return await request.get({ url: `/tjanalysis/queryRzcjinfoDay`, params }) return await request.get({ url: `/tjanalysis/queryRzcjinfoDay`, params })
} }
// 导出热轧延伸机日统计报表
export const exportRzcjinfoDay = async (params) => {
return await request.download({ url: `/tjanalysis/exportRzcjinfoDay`, params })
}
// 获取热轧定经机日统计报表 // 获取热轧定经机日统计报表
export const querySizingmillDay = async (params) => { export const querySizingmillDay = async (params) => {
return await request.get({ url: `/tjanalysis/querySizingmillDay`, params }) return await request.get({ url: `/tjanalysis/querySizingmillDay`, params })
} }
// 导出热轧定经机日统计报表
export const exportSizingmillDay = async (params) => {
return await request.download({ url: `/tjanalysis/exportSizingmillDay`, params })
}
// 获取能耗统计报表
export const queryEnergyConsumption = async (params) => {
return await request.get({ url: `/tjanalysis/queryEnergyConsumption`, params })
}
// 导出能耗统计报表
export const exportEnergyConsumption = async (params) => {
return await request.download({ url: `/tjanalysis/exportEnergyConsumption`, params })
}

5
src/components/Pagination/index.vue

@ -53,6 +53,8 @@ const props = defineProps({
} }
}) })
console.log('2323',props.total);
const emit = defineEmits(['update:page', 'update:limit', 'pagination', 'pagination']) const emit = defineEmits(['update:page', 'update:limit', 'pagination', 'pagination'])
const currentPage = computed({ const currentPage = computed({
get() { get() {
@ -73,8 +75,11 @@ const pageSize = computed({
} }
}) })
const handleSizeChange = (val) => { const handleSizeChange = (val) => {
debugger
// 1 // 1
if (currentPage.value * val > props.total) { if (currentPage.value * val > props.total) {
console.log(currentPage.value)
console.log(props.total)
currentPage.value = 1 currentPage.value = 1
} }
// pagination // pagination

5
src/utils/dict.ts

@ -203,5 +203,8 @@ export enum DICT_TYPE {
LAB_USER_TEST_TYPE = 'test_user_type', LAB_USER_TEST_TYPE = 'test_user_type',
LAB_AUDIT_STATUS = 'lab_audit_status', LAB_AUDIT_STATUS = 'lab_audit_status',
LAB_ASYNC_BUS_TYPE = 'lab_async_bus_type', LAB_ASYNC_BUS_TYPE = 'lab_async_bus_type',
LAB_OPR_TYPE = 'lab_opr_type' LAB_OPR_TYPE = 'lab_opr_type',
// ========== 统计报表能耗单位字典 ============
ENERGY_CONSUMPTION_TYPE = 'energy_consumption_type'
} }

231
src/views/basedata/marketplaceData/index.vue

@ -0,0 +1,231 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="MarketplaceData.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="MarketplaceData.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="MarketplaceDataRules"
:formAllSchemas="MarketplaceData.allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="MarketplaceDataApi.updateMarketplaceData"
:apiCreate="MarketplaceDataApi.createMarketplaceData"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<!-- 详情 -->
<!-- <Detail ref="detailRef" :isBasic="true" :allSchemas="MarketplaceData.allSchemas" /> -->
<!-- 导入 -->
<ImportForm ref="importFormRef" url="/basic/marketplace-data/import" :importTemplateData="importTemplateData" @success="importSuccess" />
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { MarketplaceData,MarketplaceDataRules } from './marketplaceData.data'
import * as MarketplaceDataApi from '@/api/basedata/marketplaceData'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
// import TableHead from '@/components/TableHead/src/TableHead.vue'
// import ImportForm from '@/components/ImportForm/src/ImportForm.vue'
// import Detail from '@/components/Detail/src/Detail.vue'
defineOptions({ name: 'marketplace' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(MarketplaceData.allSchemas.tableColumns)
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
const { tableObject, tableMethods } = useTable({
getListApi: MarketplaceDataApi.getMarketplaceDataPage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
defaultButtons.defaultAddBtn(null), //
// defaultButtons.defaultImportBtn({hasPermi:'wms:marketplaceData:import'}), //
// defaultButtons.defaultExportBtn({hasPermi:'wms:marketplaceData:export'}), //
defaultButtons.defaultFreshBtn(null), //
// defaultButtons.defaultFilterBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'filtrate') { //
} else { //
console.log('其他按钮', item)
}
}
// -
const butttondata = [
defaultButtons.mainListEditBtn(null), //
defaultButtons.mainListDeleteBtn(null), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
/** 详情操作 */
const detailRef = ref()
const openDetail = (row: any, titleName: any, titleValue: any) => {
detailRef.value.openDetail(row, titleName, titleValue, 'basicMarketplaceData')
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await MarketplaceDataApi.deleteMarketplaceData(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await MarketplaceDataApi.exportMarketplaceData(setSearchParams)
download.excel(data, '市场数据管理.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '市场数据管理导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
importTemplateData.templateUrl = await MarketplaceDataApi.importTemplate()
})
</script>

131
src/views/basedata/marketplaceData/marketplaceData.data.ts

@ -0,0 +1,131 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter } from '@/utils/formatTime'
// 表单校验
export const MarketplaceDataRules = reactive({
available: [required],
concurrencyStamp: [required],
})
export const MarketplaceData = useCrudSchemas(reactive<CrudSchema[]>([
{
label: 'id',
field: 'id',
sort: 'custom',
isTable: false,
isForm: false,
},
{
label: '品种',
field: 'type',
sort: 'custom',
form: {
component: 'Select'
},
isTable: false,
isForm: false,
},
{
label: '品种名称',
field: 'name',
sort: 'custom',
isSearch: true,
},
{
label: '描述',
field: 'describes',
sort: 'custom',
isTable: false,
isForm: false,
},
{
label: '价格',
field: 'price',
sort: 'custom',
form:{
component:'InputNumber',
componentProps: {
min: 0,
precision: 4
}
}
},
{
label: '涨幅情况',
field: 'amountIncrease',
sort: 'custom',
},
{
label: '预留字段1',
field: 'field1',
sort: 'custom',
isTable: false,
isForm: false,
},
{
label: '预留字段2',
field: 'field2',
sort: 'custom',
isTable: false,
isForm: false,
},
{
label: '预留字段3',
field: 'field3',
sort: 'custom',
isTable: false,
isForm: false,
},
{
label: '预留字段4',
field: 'field4',
sort: 'custom',
isTable: false,
isForm: false,
},
{
label: '创建时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
},
{
label: '是否可用',
field: 'available',
sort: 'custom',
isTable: false,
isForm: false,
},
{
label: '并发乐观锁',
field: 'concurrencyStamp',
sort: 'custom',
form: {
component: 'InputNumber',
value: 0
},
isTable: false,
isForm: false,
},
{
label: '操作',
field: 'action',
isForm: false,
table: {
width: 150,
fixed: 'right'
}
}
]))

2
src/views/lab/platscale/index.vue

@ -113,7 +113,7 @@ const { getList, setSearchParams } = tableMethods
// //
const HeadButttondata = [ const HeadButttondata = [
defaultButtons.defaultAddBtn(null), // defaultButtons.defaultAddBtn(null), //
defaultButtons.defaultSyncDataBtn(null), // // defaultButtons.defaultSyncDataBtn(null), //
defaultButtons.defaultFreshBtn(null), // defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultSetBtn(null), // defaultButtons.defaultSetBtn(null), //
// { // {

259
src/views/lab/platscaledata/index.vue

@ -0,0 +1,259 @@
<template>
<ContentWrap>
<!-- 搜索工作栏 -->
<Search :schema="Platscale.allSchemas.searchSchema" @search="setSearchParams" @reset="setSearchParams" />
</ContentWrap>
<!-- 列表头部 -->
<TableHead
:HeadButttondata="HeadButttondata"
@button-base-click="buttonBaseClick"
:routeName="routeName"
@updataTableColumns="updataTableColumns"
@searchFormClick="searchFormClick"
:allSchemas="Platscale.allSchemas"
/>
<!-- 列表 -->
<ContentWrap>
<Table
:columns="tableColumns"
:data="tableObject.tableList"
:loading="tableObject.loading"
:pagination="{
total: tableObject.total
}"
v-model:pageSize="tableObject.pageSize"
v-model:currentPage="tableObject.currentPage"
v-model:sort="tableObject.sort"
>
<template #code="{row}">
<el-button type="primary" link @click="openDetail(row, '代码', row.code)">
<span>{{ row.code }}</span>
</el-button>
</template>
<template #action="{ row }">
<!-- <el-button type="text" @click="auditStatus(row)">确认</el-button> -->
<ButtonBase :Butttondata="butttondata" @button-base-click="buttonTableClick($event,row)" />
</template>
</Table>
</ContentWrap>
<!-- 表单弹窗添加/修改 -->
<BasicForm
ref="basicFormRef"
@success="getList"
:rules="PlatscaleRules"
:formAllSchemas="Platscale.allSchemas"
:searchTableParams="searchTableParams"
:apiUpdate="PlatscaleApi.updatePlatscale"
:apiCreate="PlatscaleApi.createPlatscale"
@searchTableSuccess="searchTableSuccess"
:isBusiness="false"
/>
<el-dialog title="请选择同步日期" v-model="syncData.dialogVisible" width="20%">
<div class="block">
<!-- <span class="demonstration">默认</span> -->
<el-date-picker
v-model="syncData.busDate"
type="date"
value-format="YYYY-MM-DD"
placeholder="选择同步日期" style="width:100%" />
</div>
<br />
<span class="dialog-footer">
<el-button @click="syncData.dialogVisible = false"> </el-button>
<el-button type="primary" @click="toSyncData"> </el-button>
</span>
</el-dialog>
</template>
<script setup lang="ts">
import download from '@/utils/download'
import { Platscale,PlatscaleRules } from './platscale.data'
import * as PlatscaleApi from '@/api/lab/platscale'
import * as AsyncdataApi from '@/api/lab/asyncdata'
import * as defaultButtons from '@/utils/disposition/defaultButtons'
defineOptions({ name: 'platscaledata' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const tableColumns = ref(Platscale.allSchemas.tableColumns)
const syncData = reactive({dialogVisible: false , busDate: ''})
//
const updataTableColumns = (val) => {
tableColumns.value = val
}
//
const searchTableParams = ref([
//{
// formField: 'productItemCode',
// searchTableTitle: '',
// searchTableAllSchemas: Itembasic.allSchemas,
// searchTablePage: ItembasicApi.getItembasicPage
//}
])
const { tableObject, tableMethods } = useTable({
getListApi: PlatscaleApi.getPlatscalePage //
})
//
const { getList, setSearchParams } = tableMethods
//
const HeadButttondata = [
// defaultButtons.defaultAddBtn(null), //
// defaultButtons.defaultSyncDataBtn(null), //
defaultButtons.defaultFreshBtn(null), //
defaultButtons.defaultSetBtn(null), //
// {
// label: '',
// name: 'zdy',
// hide: false,
// type: 'primary',
// icon: 'Select',
// color: ''
// },
]
//
const buttonBaseClick = (val, item) => {
if (val == 'add') { //
openForm('create')
} else if (val == 'import') { //
handleImport()
} else if (val == 'export') { //
handleExport()
} else if (val == 'refresh') { //
getList()
} else if (val == 'syncData') { //
syncData.dialogVisible = true
} else { //
console.log('其他按钮', item)
}
}
function toSyncData () {
syncData.dialogVisible = false
AsyncdataApi.asyncLabData({busType: '1' , busDate: syncData.busDate}).then((data) => {
if (data) {
message.success('操作成功')
getList()
} else {
message.warning('正在执行同步操作, 5分钟之内不要重复执行 , 请等待......')
}
})
}
// -
const butttondata = [
// defaultButtons.mainListEditBtn(null), //
// defaultButtons.mainListDeleteBtn(null), //
]
// -
const buttonTableClick = async (val, row) => {
if (val == 'edit') { //
openForm('update', row)
} else if (val == 'delete') { //
handleDelete(row.id)
}
}
//
const auditStatus = async (row) => {
let data = {id: row.id , auditStatus: '1'}
//
await message.confirm('确认?')
//
await PlatscaleApi.updatePlatscale(data)
message.success('操作成功')
//
await getList()
}
/** 添加/修改操作 */
const basicFormRef = ref()
const openForm = (type: string, row?: any) => {
basicFormRef.value.open(type, row)
}
//
const searchTableSuccess = (formField, searchField, val, formRef) => {
nextTick(() => {
const setV = {}
setV[formField] = val[0][searchField]
formRef.setValues(setV)
})
}
/** 删除按钮操作 */
const handleDelete = async (id: number) => {
try {
//
await message.delConfirm()
//
await PlatscaleApi.deletePlatscale(id)
message.success(t('common.delSuccess'))
//
await getList()
} catch {}
}
/** 导出按钮操作 */
const exportLoading = ref(false) //
const handleExport = async () => {
try {
//
await message.exportConfirm()
//
exportLoading.value = true
const data = await PlatscaleApi.exportPlatscale(setSearchParams)
download.excel(data, '实验室-地衡.xls')
} catch {
} finally {
exportLoading.value = false
}
}
/** 导入 */
const importFormRef = ref()
const handleImport = () => {
importFormRef.value.open()
}
//
const importTemplateData = reactive({
templateUrl: '',
templateTitle: '实验室-地衡导入模版.xls'
})
//
const importSuccess = () => {
getList()
}
//
const searchFormClick = (searchData) => {
tableObject.params = {
isSearch: true,
filters: searchData.filters
}
getList() //
}
/** 初始化 **/
onMounted(async () => {
getList()
// importTemplateData.templateUrl = await PlatscaleApi.importTemplate()
})
</script>

341
src/views/lab/platscaledata/platscale.data.ts

@ -0,0 +1,341 @@
import type { CrudSchema } from '@/hooks/web/useCrudSchemas'
import { dateFormatter , dateFormatter2 } from '@/utils/formatTime'
// 表单校验
export const PlatscaleRules = reactive({
})
export const Platscale = useCrudSchemas(reactive<CrudSchema[]>([
// {
// label: '主键、自增',
// field: 'id',
// sort: 'custom',
// isForm: false,
// },
// {
// label: '批号',
// field: 'batchNo',
// sort: 'custom',
// isSearch: true,
// table: {
// width: 150
// }
// },
// {
// label: '送样单位',
// field: 'sydw',
// sort: 'custom',
// isSearch: false,
// table: {
// width: 150
// }
// },
// {
// label: '标准',
// field: 'standard',
// sort: 'custom',
// isSearch: false,
// table: {
// width: 150
// }
// },
// {
// label: '材质',
// field: 'cz',
// sort: 'custom',
// isSearch: false,
// table: {
// width: 150
// }
// },
// {
// label: '规格',
// field: 'guig',
// sort: 'custom',
// isSearch: false,
// table: {
// width: 150
// }
// },
// {
// label: '实验人',
// field: 'testUser',
// sort: 'custom',
// isSearch: true,
// table: {
// width: 150
// },
// dictType: DICT_TYPE.LAB_USER_TEST_TYPE,
// dictClass: 'number'
// },
{
label: '车号',
field: 'ch',
sort: 'custom',
isSearch: true,
table: {
width: 150
}
},
{
label: '车型',
field: 'cx',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '品种',
field: 'pz',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '供货单位',
field: 'ghdw',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '运输单位',
field: 'ysdw',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '出入库',
field: 'crk',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '毛重',
field: 'mz',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '皮重',
field: 'pzh',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '净重',
field: 'jz',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '检斤员',
field: 'jjy',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '日期',
field: 'rq',
sort: 'custom',
isSearch: false,
formatter: dateFormatter2,
form: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD',
type: 'date'
}
},
table: {
width: 200
}
},
{
label: '一次计量时间',
field: 'jlsjOne',
sort: 'custom',
isSearch: false,
form: {
component: 'TimePicker',
componentProps: {
valueFormat: 'HH:mm:ss',
type: 'time'
}
},
table: {
width: 200
}
},
{
label: '二次计量时间',
field: 'jlsjTwo',
sort: 'custom',
isSearch: false,
form: {
component: 'TimePicker',
componentProps: {
valueFormat: 'HH:mm:ss',
type: 'time'
}
},
table: {
width: 200
}
},
{
label: '编号',
field: 'bh',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '送货单位',
field: 'shdw',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '性质',
field: 'xz',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '防伪码',
field: 'fwm',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '抽样时间',
field: 'cysj',
sort: 'custom',
isSearch: false,
table: {
width: 200
}
},
{
label: '抽样编号',
field: 'cybh',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '抽样结果',
field: 'cyjg',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '报告单编号',
field: 'bgdbh',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '是否抽检',
field: 'sfcj',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
{
label: '数据源',
field: 'dataSource',
sort: 'custom',
isSearch: false,
table: {
width: 150
}
},
// {
// label: '审核状态',
// field: 'auditStatus',
// sort: 'custom',
// isSearch: true,
// table: {
// width: 120,
// fixed: 'right'
// },
// dictType: DICT_TYPE.LAB_AUDIT_STATUS,
// dictClass: 'number'
// },
{
label: '采集时间',
field: 'createTime',
sort: 'custom',
formatter: dateFormatter,
isSearch: true,
search: {
component: 'DatePicker',
componentProps: {
valueFormat: 'YYYY-MM-DD HH:mm:ss',
type: 'daterange',
defaultTime: [new Date('1 00:00:00'), new Date('1 23:59:59')]
}
},
isForm: false,
table: {
width: 200,
fixed: 'right'
}
},
// {
// label: '操作',
// field: 'action',
// isForm: false,
// table: {
// width: 180,
// fixed: 'right'
// }
// }
]))

20
src/views/tjanalysis/electricdata/index.vue

@ -1,6 +1,6 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 智能电表日统计搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" :inline="true"> <el-form :model="queryParams" ref="queryForm" :inline="true">
<el-form-item label="日期" prop="date"> <el-form-item label="日期" prop="date">
<el-date-picker <el-date-picker
@ -23,6 +23,7 @@
<el-form-item> <el-form-item>
<el-button type="primary" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" size="mini" @click="handleQuery">搜索</el-button>
<el-button size="mini" @click="resetQuery">重置</el-button> <el-button size="mini" @click="resetQuery">重置</el-button>
<el-button type="success" @click="exportElecTotal" size="mini">导出</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</ContentWrap> </ContentWrap>
@ -76,7 +77,8 @@ const dataList = reactive({dList: [] , days: 0})
const queryParams = reactive({ const queryParams = reactive({
date: formatDate(new Date() , 'YYYY-MM-DD'), date: formatDate(new Date() , 'YYYY-MM-DD'),
flag: '2' flag: '2',
iname:''
}) })
const handleQuery = async () => { const handleQuery = async () => {
@ -98,6 +100,8 @@ const getDbTypes = async () => {
} }
const getList = async () => { const getList = async () => {
const ll = dbTypes.typeList.find(map=>map.mcode == queryParams.mcode);
queryParams.iname = ll?.mname
const res = await TjanalysisApi.queryElectricdataTj(queryParams) const res = await TjanalysisApi.queryElectricdataTj(queryParams)
if (res != null && res.trList != null) { if (res != null && res.trList != null) {
dataList.days = res.days dataList.days = res.days
@ -106,6 +110,18 @@ const getList = async () => {
loading.value = false loading.value = false
} }
const exportElecTotal = async () => {
const res = await TjanalysisApi.exportElectricdataTj(queryParams)
if (res != null) {
let url = window.URL.createObjectURL(new Blob([res]));
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download", "智能电表日统计数据.xlsx");
document.body.appendChild(link);
link.click();
}
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {

41
src/views/tjanalysis/electricdatatotal/index.vue

@ -23,8 +23,7 @@
<!-- 列表 --> <!-- 列表 -->
<ContentWrap> <ContentWrap>
<el-table <el-table
v-loading="loading" :data="dataList.dList" border="true" v-loading="loading" :data="dataList.dList" border="true" highlight-current-row="true">
highlight-current-row="true">
<el-table-column label="线路名称(智能电表)" prop="mname" align="center" :show-overflow-tooltip="true" /> <el-table-column label="线路名称(智能电表)" prop="mname" align="center" :show-overflow-tooltip="true" />
<el-table-column label="总" prop="idescTotal" align="center" :show-overflow-tooltip="true" /> <el-table-column label="总" prop="idescTotal" align="center" :show-overflow-tooltip="true" />
<el-table-column label="峰" prop="idescF" align="center" :show-overflow-tooltip="true" /> <el-table-column label="峰" prop="idescF" align="center" :show-overflow-tooltip="true" />
@ -33,6 +32,8 @@
<el-table-column label="谷值比例" prop="idescGt" align="center" :show-overflow-tooltip="true" /> <el-table-column label="谷值比例" prop="idescGt" align="center" :show-overflow-tooltip="true" />
<el-table-column label="平" prop="idescP" align="center" :show-overflow-tooltip="true" /> <el-table-column label="平" prop="idescP" align="center" :show-overflow-tooltip="true" />
<el-table-column label="平值比例" prop="idescPt" align="center" :show-overflow-tooltip="true" /> <el-table-column label="平值比例" prop="idescPt" align="center" :show-overflow-tooltip="true" />
<el-table-column label="尖峰" prop="idescJ" align="center" :show-overflow-tooltip="true" />
<el-table-column label="平值比例" prop="idescJt" align="center" :show-overflow-tooltip="true" />
</el-table> </el-table>
</ContentWrap> </ContentWrap>
@ -62,7 +63,23 @@ const handleQuery = async () => {
} }
const resetQuery = async () => { const resetQuery = async () => {
queryParams.dateRange = [] //
let today = new Date();
//
today.setDate(today.getDate() - 1);
// "yyyy-MM-dd"
let year = today.getFullYear();
let month = String(today.getMonth() + 1).padStart(2, '0'); // 0+1
let date = String(today.getDate()).padStart(2, '0'); //
let yesterdayAsString = `${year}-${month}-${date}`;
console.log(yesterdayAsString);
queryParams.dateRange=[yesterdayAsString,yesterdayAsString]
getList() getList()
} }
@ -119,7 +136,25 @@ function getSummaries(param) {
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
//
let today = new Date();
//
today.setDate(today.getDate() - 1);
// "yyyy-MM-dd"
let year = today.getFullYear();
let month = String(today.getMonth() + 1).padStart(2, '0'); // 0+1
let date = String(today.getDate()).padStart(2, '0'); //
let yesterdayAsString = `${year}-${month}-${date}`;
console.log(yesterdayAsString);
queryParams.dateRange=[yesterdayAsString,yesterdayAsString]
getList() getList()
}) })
</script> </script>

198
src/views/tjanalysis/energyconsumption/index.vue

@ -0,0 +1,198 @@
<template>
<ContentWrap>
<!-- 能耗搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" :inline="true">
<el-form-item label="日期" prop="dateRange">
<el-date-picker
v-model="queryParams.dateRange"
style="width: 240px; height: 30px"
value-format="YYYY-MM-DD"
end-placeholder="结束日期"
start-placeholder="开始日期"
type="daterange"
/>
</el-form-item>
<el-form-item label="位置" prop="flag">
<el-select v-model="queryParams.flag" placeholder="请选择">
<el-option
v-for="item in flagList"
:key="item.value"
:label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" size="mini" @click="handleQuery">搜索</el-button>
<el-button size="mini" @click="resetQuery">重置</el-button>
<el-button type="success" @click="exportElecTotal" size="mini">导出</el-button>
</el-form-item>
</el-form>
</ContentWrap>
<!-- 列表 -->
<ContentWrap>
<el-divider content-position="left"><div style="font-size:16px; float: left"><b>{{names}}</b></div></el-divider>
<el-table
v-loading="loading" :data="dataList" border="true" highlight-current-row="true"
header-row-style="height: 50px; text-align: center" :span-method="arraySpanMethod"
:row-class-name="tableRowClassName" :cell-class-name="tableCellClassName">
<el-table-column label="生产单位" prop="name" align="right" :show-overflow-tooltip="true" width="150" />
<el-table-column label="班组" prop="tiemFrame" align="center" :show-overflow-tooltip="true" />
<el-table-column label="生产水耗1" prop="fields" align="center" :show-overflow-tooltip="true" />
<el-table-column label="生产水耗2" prop="fields1" align="center" :show-overflow-tooltip="true" />
<el-table-column label="循环水" prop="fields2" align="center" :show-overflow-tooltip="true" />
<el-table-column label="煤量" prop="fields3" align="center" :show-overflow-tooltip="true" />
<el-table-column label="天然气" prop="fields4" align="center" :show-overflow-tooltip="true" />
<!-- <el-table-column label="班组用电量" prop="fields5" align="center" :show-overflow-tooltip="true" /> -->
<el-table-column label="峰期电量" prop="fields6" align="center" :show-overflow-tooltip="true" />
<el-table-column label="谷期电量" prop="fields7" align="center" :show-overflow-tooltip="true" />
<el-table-column label="平期电量" prop="fields8" align="center" :show-overflow-tooltip="true" />
<el-table-column label="尖峰电量" prop="fields8" align="center" :show-overflow-tooltip="true" />
<el-table-column label="合计电量" prop="fields5" align="center" :show-overflow-tooltip="true" />
</el-table>
</ContentWrap>
</template>
<script setup lang="ts">
import * as TjanalysisApi from '@/api/tjanalysis'
import { formatDate } from '@/utils/formatTime'
import * as DictApi from '@/utils/dict'
defineOptions({ name: 'energyconsumption' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const loading = ref(true)
const dataList = ref([])
const names = ref('');
const queryParams = reactive({
dateRange: [],
flag: '0',
iname:''
})
const flagList =ref([])
const handleQuery = async () => {
const ll = flagList.value.find(map=>map.value == queryParams.flag);
names.value = ll?.label
queryParams.iname= ll?.label
dataList.value = [];
getList()
}
const resetQuery = async () => {
let today = new Date();
//
today.setDate(today.getDate() - 1);
// "yyyy-MM-dd"
let year = today.getFullYear();
let month = String(today.getMonth() + 1).padStart(2, '0'); // 0+1
let date = String(today.getDate()).padStart(2, '0'); //
let yesterdayAsString = `${year}-${month}-${date}`;
console.log(yesterdayAsString);
queryParams.dateRange=[yesterdayAsString,yesterdayAsString]
getList()
}
const getList = async () => {
const res = await TjanalysisApi.queryEnergyConsumption(queryParams)
dataList.value = res
loading.value = false
}
function arraySpanMethod ({ row, column, rowIndex, columnIndex }) {
if (rowIndex == 6) {
if (columnIndex == 0) {
return {
rowspan: 1,
colspan: 10
}
} else if (columnIndex == 10) {
return {
rowspan: 1,
colspan: 2
}
} else {
return {
rowspan: 0,
colspan: 0
}
}
}
}
function tableRowClassName({row, rowIndex}) {
if (rowIndex === 7) {
return 'success-row'
}
return ''
}
function tableCellClassName({row, column, rowIndex, columnIndex}) {
if (columnIndex == 0) {
return 'success-cols'
}
}
const exportElecTotal = async () => {
const res = await TjanalysisApi.exportEnergyConsumption(queryParams)
if (res != null) {
let url = window.URL.createObjectURL(new Blob([res]));
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download", "能耗日统计.xlsx");
document.body.appendChild(link);
link.click();
}
}
/** 初始化 **/
onMounted(async () => {
//
let today = new Date();
//
today.setDate(today.getDate() - 1);
// "yyyy-MM-dd"
let year = today.getFullYear();
let month = String(today.getMonth() + 1).padStart(2, '0'); // 0+1
let date = String(today.getDate()).padStart(2, '0'); //
let yesterdayAsString = `${year}-${month}-${date}`;
console.log(yesterdayAsString);
queryParams.dateRange=[yesterdayAsString,yesterdayAsString]
const res =await DictApi.getStrDictOptions(DICT_TYPE.ENERGY_CONSUMPTION_TYPE);
if (res != null && res.length>0) {
flagList.value = res
queryParams.flag= flagList.value[0].value;
queryParams.iname= flagList.value[0].label;
const ll = flagList.value.find(map=>map.value == queryParams.flag);
names.value = ll?.label
}
getList()
})
</script>
<style>
.el-table .success-row {
background: #f0f9eb;
}
.el-table .success-cols {
font-weight: bold;
}
</style>

19
src/views/tjanalysis/hrelongatordata/index.vue

@ -23,6 +23,7 @@
<el-form-item> <el-form-item>
<el-button type="primary" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" size="mini" @click="handleQuery">搜索</el-button>
<el-button size="mini" @click="resetQuery">重置</el-button> <el-button size="mini" @click="resetQuery">重置</el-button>
<el-button type="success" @click="exportElecTotal" size="mini">导出</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</ContentWrap> </ContentWrap>
@ -64,7 +65,8 @@ const dataList = ref([])
const names = ref("热轧108延伸"); const names = ref("热轧108延伸");
const queryParams = reactive({ const queryParams = reactive({
date: formatDate(new Date() , 'YYYY-MM-DD'), date: formatDate(new Date() , 'YYYY-MM-DD'),
flag: '1' flag: '1',
iname:''
}) })
const flagList = ref([]) const flagList = ref([])
@ -82,6 +84,8 @@ const resetQuery = async () => {
} }
const getList = async () => { const getList = async () => {
const ll = flagList.value.find(map=>map.value == queryParams.flag);
queryParams.iname = ll?.label
const res = await TjanalysisApi.queryRzcjinfoDay(queryParams) const res = await TjanalysisApi.queryRzcjinfoDay(queryParams)
dataList.value = res.dataList dataList.value = res.dataList
loading.value = false loading.value = false
@ -121,6 +125,19 @@ function tableCellClassName({row, column, rowIndex, columnIndex}) {
} }
} }
const exportElecTotal = async () => {
const res = await TjanalysisApi.exportRzcjinfoDay(queryParams)
if (res != null) {
let url = window.URL.createObjectURL(new Blob([res]));
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download", "热轧延伸机日统计.xlsx");
document.body.appendChild(link);
link.click();
}
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
const res =await DictApi.getStrDictOptions(DICT_TYPE.hrelongatordata); const res =await DictApi.getStrDictOptions(DICT_TYPE.hrelongatordata);

19
src/views/tjanalysis/hrpuncherdata/index.vue

@ -23,6 +23,7 @@
<el-form-item> <el-form-item>
<el-button type="primary" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" size="mini" @click="handleQuery">搜索</el-button>
<el-button size="mini" @click="resetQuery">重置</el-button> <el-button size="mini" @click="resetQuery">重置</el-button>
<el-button type="success" @click="exportElecTotal" size="mini">导出</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</ContentWrap> </ContentWrap>
@ -64,7 +65,8 @@ const dataList = ref([])
const names = ref(''); const names = ref('');
const queryParams = reactive({ const queryParams = reactive({
date: formatDate(new Date() , 'YYYY-MM-DD'), date: formatDate(new Date() , 'YYYY-MM-DD'),
flag: '1' flag: '1',
iname:''
}) })
const flagList =ref([]) const flagList =ref([])
@ -81,6 +83,8 @@ const resetQuery = async () => {
} }
const getList = async () => { const getList = async () => {
const ll = flagList.value.find(map=>map.value == queryParams.flag);
queryParams.iname = ll?.label
const res = await TjanalysisApi.queryHrpuncherDay(queryParams) const res = await TjanalysisApi.queryHrpuncherDay(queryParams)
dataList.value = res.dataList dataList.value = res.dataList
loading.value = false loading.value = false
@ -120,6 +124,19 @@ function tableCellClassName({row, column, rowIndex, columnIndex}) {
} }
} }
const exportElecTotal = async () => {
const res = await TjanalysisApi.exportHrpuncherDay(queryParams)
if (res != null) {
let url = window.URL.createObjectURL(new Blob([res]));
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download", "热轧穿孔机日统计.xlsx");
document.body.appendChild(link);
link.click();
}
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
const res =await DictApi.getStrDictOptions(DICT_TYPE.hrpuncherdata); const res =await DictApi.getStrDictOptions(DICT_TYPE.hrpuncherdata);

19
src/views/tjanalysis/hrsizingmilldata/index.vue

@ -24,6 +24,7 @@
<el-form-item> <el-form-item>
<el-button type="primary" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" size="mini" @click="handleQuery">搜索</el-button>
<el-button size="mini" @click="resetQuery">重置</el-button> <el-button size="mini" @click="resetQuery">重置</el-button>
<el-button type="success" @click="exportElecTotal" size="mini">导出</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</ContentWrap> </ContentWrap>
@ -65,7 +66,8 @@ const dataList = ref([])
const names = ref(''); const names = ref('');
const queryParams = reactive({ const queryParams = reactive({
date: formatDate(new Date() , 'YYYY-MM-DD'), date: formatDate(new Date() , 'YYYY-MM-DD'),
flag: '1' flag: '1',
iname:''
}) })
const flagList = ref([]) const flagList = ref([])
@ -83,6 +85,8 @@ const resetQuery = async () => {
} }
const getList = async () => { const getList = async () => {
const ll = flagList.value.find(map=>map.value == queryParams.flag);
queryParams.iname = ll?.label
const res = await TjanalysisApi.querySizingmillDay(queryParams) const res = await TjanalysisApi.querySizingmillDay(queryParams)
dataList.value = res.dataList dataList.value = res.dataList
loading.value = false loading.value = false
@ -122,6 +126,19 @@ function tableCellClassName({row, column, rowIndex, columnIndex}) {
} }
} }
const exportElecTotal = async () => {
const res = await TjanalysisApi.exportSizingmillDay(queryParams)
if (res != null) {
let url = window.URL.createObjectURL(new Blob([res]));
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download", "热轧定经机日统计.xlsx");
document.body.appendChild(link);
link.click();
}
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
const res =await DictApi.getStrDictOptions(DICT_TYPE.hrsizingmilldata); const res =await DictApi.getStrDictOptions(DICT_TYPE.hrsizingmilldata);

15
src/views/tjanalysis/irealdata/index.vue

@ -14,6 +14,7 @@
<el-form-item> <el-form-item>
<el-button type="primary" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" size="mini" @click="handleQuery">搜索</el-button>
<el-button size="mini" @click="resetQuery">重置</el-button> <el-button size="mini" @click="resetQuery">重置</el-button>
<el-button type="success" @click="exportElecTotal" size="mini">导出</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</ContentWrap> </ContentWrap>
@ -73,6 +74,7 @@ const resetQuery = async () => {
const getList = async () => { const getList = async () => {
const res = await TjanalysisApi.queryIrealdataTj(queryParams) const res = await TjanalysisApi.queryIrealdataTj(queryParams)
dataList.dList = []
if (res != null && res.trList != null) { if (res != null && res.trList != null) {
dataList.days = res.days dataList.days = res.days
dataList.dList = [] dataList.dList = []
@ -114,6 +116,19 @@ function tableCellClassName({row, column, rowIndex, columnIndex}) {
return 'success-cols' return 'success-cols'
} }
} }
//
const exportElecTotal = async () => {
const res = await TjanalysisApi.exportIrealdataTj(queryParams)
if (res != null) {
let url = window.URL.createObjectURL(new Blob([res]));
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download", "一次主表日统计数据.xlsx");
document.body.appendChild(link);
link.click();
}
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {

173
src/views/tjanalysis/irealdatatotal/index.vue

@ -0,0 +1,173 @@
<template>
<ContentWrap>
<!-- 一次主表统计搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" :inline="true">
<el-form-item label="日期" prop="dateRange">
<el-date-picker
v-model="queryParams.dateRange"
style="width: 240px; height: 30px"
value-format="YYYY-MM-DD"
end-placeholder="结束日期"
start-placeholder="开始日期"
type="daterange"
/>
</el-form-item>
<el-form-item label="仪表的描述总用电表" prop="mcode">
<el-select v-model="queryParams.flag" placeholder="请选择">
<el-option
v-for="item in typeList"
:key="item.flag"
:label="item.mname"
:value="item.flag" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" size="mini" @click="handleQuery">搜索</el-button>
<el-button size="mini" @click="resetQuery">重置</el-button>
<el-button type="success" @click="exportElecTotal" size="mini">导出</el-button>
</el-form-item>
</el-form>
</ContentWrap>
<!-- 列表 -->
<ContentWrap>
<el-table
v-loading="loading" :data="dataList.dList" border="true" >
highlight-current-row="无功" prop="wugong" align="center" :show-overflow-tooltip="true" />
<el-table-column label="无功" prop="wugong" align="center" :show-overflow-tooltip="true" />
<el-table-column label="总" prop="idescTotal" align="center" :show-overflow-tooltip="true" />
<el-table-column label="峰" prop="idescF" align="center" :show-overflow-tooltip="true" />
<el-table-column label="谷" prop="idescG" align="center" :show-overflow-tooltip="true" />
<el-table-column label="平" prop="idescP" align="center" :show-overflow-tooltip="true" />
<el-table-column label="尖峰" prop="idescPt" align="center" :show-overflow-tooltip="true" />
<el-table-column label="功率因数" prop="gy" align="center" :show-overflow-tooltip="true" />
</el-table>
</ContentWrap>
</template>
<script setup lang="ts">
import * as TjanalysisApi from '@/api/tjanalysis'
import { formatDate } from '@/utils/formatTime'
defineOptions({ name: 'PlatscaleAnalysis' })
const message = useMessage() //
const { t } = useI18n() //
const route = useRoute() //
const routeName = ref()
routeName.value = route.name
const loading = ref(true)
const dataList = reactive({dList: [] , total: 0})
const queryParams = reactive({
dateRange: [],
flag:'0',
iname:''
})
const typeList= ref([{"flag":"0","mname":"主变1号"},{"flag":"1","mname":"主变2号"}]);
const handleQuery = async () => {
getList()
}
const resetQuery = async () => {
//
let today = new Date();
//
today.setDate(today.getDate() - 1);
// "yyyy-MM-dd"
let year = today.getFullYear();
let month = String(today.getMonth() + 1).padStart(2, '0'); // 0+1
let date = String(today.getDate()).padStart(2, '0'); //
let yesterdayAsString = `${year}-${month}-${date}`;
console.log(yesterdayAsString);
queryParams.dateRange=[yesterdayAsString,yesterdayAsString]
getList()
}
const getList = async () => {
const ll = typeList.value.find(map=>map.flag == queryParams.flag);
queryParams.iname = ll?.mname
const res = await TjanalysisApi.queryIrealdataTimeTj(queryParams)
console.log(res)
if (res != null && res.dataList != null) {
dataList.dList = res.dataList
}
loading.value = false
}
const exportElecTotal = async () => {
const res = await TjanalysisApi.exportIrealdataTimeTj(queryParams)
if (res != null) {
let url = window.URL.createObjectURL(new Blob([res]));
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download", "一次主表统计数据.xlsx");
document.body.appendChild(link);
link.click();
}
}
function getSummaries(param) {
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
// console.log(column)
if (index === 0) {
sums[index] = '总';
// return;
}
const values = data.map(item => Number(item[column.property]));
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
// sums[index] += ' ';
} else {
// sums[index] = 'N/A';
}
});
return sums;
}
/** 初始化 **/
onMounted(async () => {
//
let today = new Date();
//
today.setDate(today.getDate() - 1);
// "yyyy-MM-dd"
let year = today.getFullYear();
let month = String(today.getMonth() + 1).padStart(2, '0'); // 0+1
let date = String(today.getDate()).padStart(2, '0'); //
let yesterdayAsString = `${year}-${month}-${date}`;
console.log(yesterdayAsString);
queryParams.dateRange=[yesterdayAsString,yesterdayAsString]
getList()
})
</script>

19
src/views/tjanalysis/natgasdatacd/index.vue

@ -23,6 +23,7 @@
<el-form-item> <el-form-item>
<el-button type="primary" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" size="mini" @click="handleQuery">搜索</el-button>
<el-button size="mini" @click="resetQuery">重置</el-button> <el-button size="mini" @click="resetQuery">重置</el-button>
<el-button type="success" @click="exportElecTotal" size="mini">导出</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</ContentWrap> </ContentWrap>
@ -78,6 +79,7 @@ const dataList = reactive({dList: [] , days: 0})
const queryParams = reactive({ const queryParams = reactive({
date: formatDate(new Date() , 'YYYY-MM-DD'), date: formatDate(new Date() , 'YYYY-MM-DD'),
flag:'0', flag:'0',
iname:''
}) })
const handleQuery = async () => { const handleQuery = async () => {
@ -96,6 +98,10 @@ const resetQuery = async () => {
} }
const getList = async () => { const getList = async () => {
const ll = flagList.value.find(map=>map.value == queryParams.flag);
queryParams.iname = ll?.label
const res = await TjanalysisApi.queryNatgasDatacdDay(queryParams) const res = await TjanalysisApi.queryNatgasDatacdDay(queryParams)
if (res != null && res.dataList != null) { if (res != null && res.dataList != null) {
dataList.dList = res.dataList dataList.dList = res.dataList
@ -103,6 +109,19 @@ const getList = async () => {
loading.value = false loading.value = false
} }
const exportElecTotal = async () => {
const res = await TjanalysisApi.exportNatgasDatacdDay(queryParams)
if (res != null) {
let url = window.URL.createObjectURL(new Blob([res]));
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download", "冷拔天然气数据日统计.xlsx");
document.body.appendChild(link);
link.click();
}
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {

19
src/views/tjanalysis/natgasdatahr/index.vue

@ -23,6 +23,7 @@
<el-form-item> <el-form-item>
<el-button type="primary" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" size="mini" @click="handleQuery">搜索</el-button>
<el-button size="mini" @click="resetQuery">重置</el-button> <el-button size="mini" @click="resetQuery">重置</el-button>
<el-button type="success" @click="exportElecTotal" size="mini">导出</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</ContentWrap> </ContentWrap>
@ -77,7 +78,8 @@ const icode = 'Gas_Data_008'
const queryParams = reactive({ const queryParams = reactive({
date: formatDate(new Date() , 'YYYY-MM-DD'), date: formatDate(new Date() , 'YYYY-MM-DD'),
mcode:'', mcode:'',
icode: icode// icode: icode,//
iname:''
}) })
const handleQuery = async () => { const handleQuery = async () => {
@ -92,13 +94,26 @@ const resetQuery = async () => {
} }
const getList = async () => { const getList = async () => {
const ll = mcodeList.value.find(map=>map.code == queryParams.mcode);
queryParams.iname = ll?.label
const res = await TjanalysisApi.queryNatgasdataDay(queryParams) const res = await TjanalysisApi.queryNatgasdataDay(queryParams)
if (res != null && res.dataList != null) { if (res != null && res.dataList != null) {
dataList.dList = res.dataList dataList.dList = res.dataList
} }
loading.value = false loading.value = false
} }
const exportElecTotal = async () => {
const res = await TjanalysisApi.exportNatgasDataDay(queryParams)
if (res != null) {
let url = window.URL.createObjectURL(new Blob([res]));
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download", "热轧天然气数据日统计.xlsx");
document.body.appendChild(link);
link.click();
}
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {

19
src/views/tjanalysis/natgasdatatotal/index.vue

@ -23,6 +23,7 @@
<el-form-item> <el-form-item>
<el-button type="primary" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" size="mini" @click="handleQuery">搜索</el-button>
<el-button size="mini" @click="resetQuery">重置</el-button> <el-button size="mini" @click="resetQuery">重置</el-button>
<el-button type="success" @click="exportElecTotal" size="mini">导出</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</ContentWrap> </ContentWrap>
@ -79,7 +80,8 @@ const name = ref("");
const queryParams = reactive({ const queryParams = reactive({
date: formatDate(new Date() , 'YYYY-MM-DD'), date: formatDate(new Date() , 'YYYY-MM-DD'),
flag: 1 flag: 1,
iname:''
}) })
const handleQuery = async () => { const handleQuery = async () => {
let aa = flagList.value.find(map=>map.value==queryParams.flag); let aa = flagList.value.find(map=>map.value==queryParams.flag);
@ -95,13 +97,26 @@ const resetQuery = async () => {
} }
const getList = async () => { const getList = async () => {
const ll = flagList.value.find(map=>map.value == queryParams.flag);
queryParams.iname = ll?.label
const res = await TjanalysisApi.queryNatgasdatatotal(queryParams) const res = await TjanalysisApi.queryNatgasdatatotal(queryParams)
if (res != null && res.trList != null) { if (res != null && res.trList != null) {
dataList.dList = res.trList dataList.dList = res.trList
} }
loading.value = false loading.value = false
} }
const exportElecTotal = async () => {
const res = await TjanalysisApi.exportNatgasDataTotal(queryParams)
if (res != null) {
let url = window.URL.createObjectURL(new Blob([res]));
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download", "天然气总量日统计.xlsx");
document.body.appendChild(link);
link.click();
}
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {

12
src/views/tjanalysis/platscale/index.vue

@ -1,6 +1,6 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 地衡数据统计搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" :inline="true"> <el-form :model="queryParams" ref="queryForm" :inline="true">
<el-form-item label="使用单位" prop="ghdw"> <el-form-item label="使用单位" prop="ghdw">
<el-input <el-input
@ -32,11 +32,12 @@
<el-table v-loading="loading" :data="dataList.dList" border="true" highlight-current-row="true"> <el-table v-loading="loading" :data="dataList.dList" border="true" highlight-current-row="true">
<el-table-column label="序号" type="index" width="80" align="center" /> <el-table-column label="序号" type="index" width="80" align="center" />
<el-table-column label="供货单位(使用单位)" prop="ghdw" align="center" :show-overflow-tooltip="true" /> <el-table-column label="供货单位(使用单位)" prop="ghdw" align="center" :show-overflow-tooltip="true" />
<el-table-column label="运输单位" prop="ysdw" align="center" :show-overflow-tooltip="true" />
<el-table-column label="品种" prop="pz" align="center" :show-overflow-tooltip="true" /> <el-table-column label="品种" prop="pz" align="center" :show-overflow-tooltip="true" />
<el-table-column label="总净重(t)" prop="jz" align="center" :show-overflow-tooltip="true" /> <el-table-column label="总净重(t)" prop="jz" align="center" :show-overflow-tooltip="true" />
</el-table> </el-table>
<pagination <pagination
v-show="dataList.total>0" v-if="dataList.total>0"
:total="dataList.total" :total="dataList.total"
:page="queryParams.pageNo" :page="queryParams.pageNo"
:limit="queryParams.pageSize" :limit="queryParams.pageSize"
@ -78,12 +79,17 @@ const resetQuery = async () => {
getList() getList()
} }
const getList = async () => { const getList = async (page) => {
if(page){
    queryParams.pageNo = page.page
    queryParams.pageSize = page.limit
  }
const res = await TjanalysisApi.queryTjPlatScales(queryParams) const res = await TjanalysisApi.queryTjPlatScales(queryParams)
if (res != null && res.list != null) { if (res != null && res.list != null) {
dataList.dList = res.list dataList.dList = res.list
dataList.total = res.total dataList.total = res.total
} }
console.log('23',dataList.total);
loading.value = false loading.value = false
} }

24
src/views/tjanalysis/waterday/index.vue

@ -1,6 +1,6 @@
<template> <template>
<ContentWrap> <ContentWrap>
<!-- 搜索工作栏 --> <!-- 智能水表数据日统计表搜索工作栏 -->
<el-form :model="queryParams" ref="queryForm" :inline="true"> <el-form :model="queryParams" ref="queryForm" :inline="true">
<el-form-item label="日期" prop="date"> <el-form-item label="日期" prop="date">
<el-date-picker <el-date-picker
@ -38,6 +38,7 @@
<el-form-item> <el-form-item>
<el-button type="primary" size="mini" @click="handleQuery">搜索</el-button> <el-button type="primary" size="mini" @click="handleQuery">搜索</el-button>
<el-button size="mini" @click="resetQuery">重置</el-button> <el-button size="mini" @click="resetQuery">重置</el-button>
<el-button type="success" @click="exportElecTotal" size="mini">导出</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</ContentWrap> </ContentWrap>
@ -94,7 +95,9 @@ const dataList = reactive({dList: [] })
const queryParams = reactive({ const queryParams = reactive({
date: formatDate(new Date() , 'YYYY-MM-DD'), date: formatDate(new Date() , 'YYYY-MM-DD'),
mcode: 'Gas_hr_001', mcode: 'Gas_hr_001',
flag: '0' flag: '0',
iname:'',
mname:''
}) })
const handleQuery = async () => { const handleQuery = async () => {
@ -109,6 +112,10 @@ const resetQuery = async () => {
} }
const getList = async () => { const getList = async () => {
const l1 = flagList.value.find(map=>map.value == queryParams.flag);
queryParams.mname = l1?.label
const ll = mcodeList.value.find(map=>map.code == queryParams.mcode);
queryParams.iname = ll?.label
const res = await TjanalysisApi.queryWaterDay(queryParams) const res = await TjanalysisApi.queryWaterDay(queryParams)
if (res != null && res.dataList != null) { if (res != null && res.dataList != null) {
dataList.dList = res.dataList dataList.dList = res.dataList
@ -132,6 +139,19 @@ const flagChange=async()=>{
} }
} }
const exportElecTotal = async () => {
const res = await TjanalysisApi.exportWaterDay(queryParams)
if (res != null) {
let url = window.URL.createObjectURL(new Blob([res]));
let link = document.createElement("a");
link.style.display = "none";
link.href = url;
link.setAttribute("download", "智能水表日统计.xlsx");
document.body.appendChild(link);
link.click();
}
}
/** 初始化 **/ /** 初始化 **/
onMounted(async () => { onMounted(async () => {
flagList.value = DictApi.getStrDictOptions(DICT_TYPE.Water_Module); flagList.value = DictApi.getStrDictOptions(DICT_TYPE.Water_Module);

Loading…
Cancel
Save