<template>
|
<ContentWrap>
|
<div class="mod-quality-quick">
|
<el-form :inline="true" :model="queryParams">
|
<el-form-item>
|
<el-date-picker
|
v-model="queryParams.ny"
|
type="month"
|
value-format="yyyy-MM"
|
placeholder="年月"/>
|
</el-form-item>
|
<el-form-item>
|
<el-button @click="getDataList()">{{ $t("query") }}</el-button>
|
</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>
|
<a href="/template/乌达煤炭加工有限公司生产煤样快速检查.xlsx" style="text-decoration:none;color: inherit"
|
download="乌达煤炭加工有限公司生产煤样快速检查.xlsx">下载模版</a>
|
</el-button>
|
</el-form-item>
|
<el-form-item>
|
<el-upload
|
class="upload-demo"
|
:limit="1"
|
:file-list="fileList"
|
:before-upload="beforeUpload"
|
:on-success="uploadModelSuccess"
|
:on-error="uploadModelError"
|
:action="uploadModelUrl"
|
/>
|
<el-button type="primary">导入</el-button>
|
</el-form-item>
|
</el-form>
|
<el-table
|
ref="myTable"
|
v-loading="dataListLoading"
|
:data="dataList"
|
border
|
height="400"
|
highlight-current-row
|
@current-change="currentChange"
|
@selection-change="dataListSelectionChangeHandle"
|
@sort-change="dataListSortChangeHandle"
|
style="width: 100%">
|
<el-table-column
|
prop="lsh"
|
label="流水号"
|
header-align="center"
|
align="center"
|
min-width="120"
|
/>
|
<el-table-column
|
prop="datetime"
|
label="采样时间"
|
header-align="center"
|
align="center"
|
min-width="120"
|
/>
|
<el-table-column
|
prop="mz"
|
label="煤种"
|
header-align="center"
|
align="center"
|
min-width="120"
|
/>
|
<el-table-column
|
:label="$t('handle')"
|
fixed="right"
|
header-align="center"
|
align="center"
|
min-width="100"
|
>
|
<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>
|
</ContentWrap>
|
<ContentWrap>
|
<QuickItem ref="quickItemRef"/>
|
</ContentWrap>
|
<QuickForm ref="quickFormRef" />
|
</template>
|
|
<script lang="ts" setup>
|
import * as AnalysisApi from '@/api/xmcpms/coal-quality/detection/quick/index'
|
import QuickForm from './QuickForm.vue'
|
import QuickItem from './QuickItem.vue'
|
import * as AnalysisFullApi from "@/api/xmcpms/coal-quality/analysis/full";
|
|
const message = useMessage() // 消息弹窗
|
const { t } = useI18n() // 国际化
|
defineOptions({ name: 'Analysis' })
|
const loading = ref(true) // 列表的加载中
|
const total = ref(0) // 列表的总页数
|
const dataList = ref([]) // 字典表格数据
|
const queryParams = reactive({
|
pageNo: 1,
|
pageSize: 10,
|
ny: undefined
|
})
|
|
const queryFormRef = ref() // 搜索的表单
|
const exportLoading = ref(false) // 导出的加载中
|
|
const getList = async () => {
|
loading.value = true
|
try {
|
const data = await AnalysisFullApi.getAnalysisFullPage(queryParams)
|
dataList.value = data.list
|
total.value = data.total
|
} finally {
|
loading.value = false
|
}
|
}
|
|
/** 搜索按钮操作 */
|
const handleQuery = () => {
|
queryParams.pageNo = 1
|
getList()
|
}
|
|
/** 重置按钮操作 */
|
const resetQuery = () => {
|
queryFormRef.value.resetFields()
|
handleQuery()
|
}
|
|
const quickItemRef = ref()
|
const currentChange = (currentRow) => {
|
quickItemRef.value.open(currentRow)
|
}
|
|
const quickFormRef = ref()
|
const openForm = (type: string) => {
|
quickFormRef.value.open(type)
|
}
|
|
</script>
|