<template>
|
<div>
|
<el-card shadow="never" class="aui-card--fill">
|
<div class="mod-wash-curves">
|
<el-form :inline="true" :model="dataForm">
|
<el-form-item>
|
<el-date-picker
|
v-model="queryParams.startTime"
|
type="date"
|
clearable
|
value-format="YYYY-MM-DD"
|
format="YYYY-MM-DD"
|
placeholder="开始时间"/>
|
</el-form-item>
|
<el-form-item>
|
<el-date-picker
|
v-model="queryParams.endTime"
|
type="date"
|
clearable
|
value-format="YYYY-MM-DD"
|
format="YYYY-MM-DD"
|
placeholder="结束时间"/>
|
</el-form-item>
|
<el-form-item>
|
<dict-select-tag style="width: 100%" v-model="queryParams.mz" :clearable="true" placeholder="煤种" dictCode="ymmz" />
|
</el-form-item>
|
<el-form-item>
|
<dict-select-tag style="width: 100%" v-model="queryParams.fcfa" :clearable="true" placeholder="浮沉方案" dictCode="analysis-fcfa" />
|
</el-form-item>
|
<el-form-item>
|
<el-button @click="handleQuery">
|
<Icon icon="ep:search" class="mr-5px" />
|
查询
|
</el-button>
|
<el-button type="primary" plain @click="openForm('create')">
|
<Icon icon="ep:plus" class="mr-5px" />
|
新增
|
</el-button>
|
<el-button type="warning" plain @click="handleImport">
|
<Icon icon="ep:upload" /> 导出
|
</el-button>
|
<el-button @click="weighted()">加权平均</el-button>
|
</el-form-item>
|
</el-form>
|
<el-table
|
ref="table"
|
v-loading="dataListLoading"
|
:data="dataList"
|
border
|
height="400"
|
highlight-current-row
|
@current-change="currentChange"
|
@selection-change="selectionChangeHandle"
|
@sort-change="dataListSortChangeHandle"
|
style="width: 100%;">
|
<el-table-column type="selection" header-align="center" align="center"
|
width="50"/>
|
<el-table-column prop="code" label="流水号" header-align="center" align="center"
|
width="120"/>
|
<el-table-column prop="ny" label="年月" header-align="center" align="center"
|
width="100"/>
|
<el-table-column prop="syrq" label="实验日期" header-align="center" width="120"
|
align="center"/>
|
<el-table-column prop="mzName" label="煤种" header-align="center"
|
align="center"/>
|
<el-table-column prop="drl" label="调入量" header-align="center"
|
align="center"/>
|
<el-table-column prop="fcfaName" label="浮沉方案" header-align="center"
|
align="center"/>
|
<el-table-column prop="bz" label="备注" header-align="center" align="left"
|
min-width="200"/>
|
<el-table-column label="操作" fixed="right" header-align="center" align="center" width="150">
|
<template #default="scope">
|
<el-button v-hasPermi="['data:ind-item:update']" link type="primary" @click="openForm('update', scope.row.id)">
|
修改
|
</el-button>
|
<el-button v-hasPermi="['data:ind-item:delete']" link type="danger" @click="handleDelete(scope.row.id)">
|
删除
|
</el-button>
|
</template>
|
</el-table-column>
|
</el-table>
|
<Pagination
|
v-model:limit="queryParams.pageSize"
|
v-model:page="queryParams.pageNo"
|
:total="total"
|
@pagination="getList"
|
/>
|
</div>
|
</el-card>
|
<el-card shadow="never" class="aui-card--fill">
|
<div class="mod-analysis-full-det">
|
<WashCurvesDet ref="washCurvesDetRef" @drawWashCurves="drawWashCurves"/>
|
</div>
|
</el-card>
|
</div>
|
<WashCurvesForm ref="washCurvesFormRef" @success="getList" />
|
</template>
|
|
<script lang="ts" setup>
|
import * as WashCurvesApi from '@/api/xmcpms/coal-quality/analysis/wash-curves/index'
|
import WashCurvesDet from './WashCurvesDet.vue'
|
import WashCurvesForm from './WashCurvesForm.vue'
|
import { useRoute, useRouter } from 'vue-router';
|
|
const router = useRouter() // 路由
|
const message = useMessage() // 消息弹窗
|
const { t } = useI18n() // 国际化
|
defineOptions({ name: 'Analysis' })
|
const dataListLoading = ref(true) // 列表的加载中
|
const total = ref(0) // 列表的总页数
|
const dataList = ref([]) // 字典表格数据
|
const queryFormRef = ref() // 搜索的表单
|
const exportLoading = ref(false) // 导出的加载中
|
|
const handleQuery = () => {
|
queryParams.pageNo = 1
|
getList()
|
}
|
|
/** 重置按钮操作 */
|
const resetQuery = () => {
|
queryFormRef.value.resetFields()
|
handleQuery()
|
}
|
|
const getList = async () => {
|
dataListLoading.value = true
|
try {
|
const data = await WashCurvesApi.getWashCurvesPage(queryParams)
|
dataList.value = data.list
|
total.value = data.total
|
} finally {
|
dataListLoading.value = false
|
}
|
}
|
|
const queryParams = reactive({
|
pageNo: 1,
|
pageSize: 10,
|
startTime: '',
|
endTime: '',
|
mz: undefined,
|
fcfa: undefined
|
})
|
|
/** 添加/修改操作 */
|
const washCurvesFormRef = ref()
|
const openForm = (type: string, id?: string) => {
|
washCurvesFormRef.value.open(type, id)
|
}
|
|
const washCurvesDetRef = ref()
|
const currentRow = ref()
|
|
const currentChange = (row) => {
|
currentRow.value = row
|
washCurvesDetRef.value.open(row)
|
}
|
|
const route = useRoute();
|
|
function drawWashCurves() {
|
if (!currentRow.value.id) {
|
message.error('请先选择可选性曲线台账!')
|
return
|
}
|
// 动态路由
|
router.push({
|
// name: route.name + '__' + currentRow.value.id,
|
path: '/xmcpms/coal-quality/analysis/WashCurvesDraw',
|
query: {
|
curvesId : currentRow.value.id,
|
fcfa : currentRow.value.fcfa,
|
code : currentRow.value.code,
|
title : route.title + '-' + currentRow.value.code
|
}
|
})
|
}
|
|
let dataListSelections = reactive([])
|
// 多选
|
function selectionChangeHandle (val) {
|
dataListSelections = val
|
}
|
|
/** 删除按钮操作 */
|
const handleDelete = async (id: string) => {
|
let ids = dataListSelections.map(item => {
|
return item.id
|
})
|
ids.push(id)
|
try {
|
// 删除的二次确认
|
await message.delConfirm()
|
// 发起删除
|
await WashCurvesApi.deleteWashCurves(ids)
|
message.success(t('common.delSuccess'))
|
// 刷新列表
|
await getList()
|
} catch {
|
}
|
}
|
/** 初始化 **/
|
onMounted(async () => {
|
await getList()
|
})
|
</script>
|