163 lines
7.8 KiB
Vue
163 lines
7.8 KiB
Vue
|
|
<script setup lang="ts">
|
||
|
|
|
||
|
|
import {FormatterUtils} from "@/utils/FormatterUtils.ts";
|
||
|
|
import type {IConveyPickStandSearch} from "@/interface/page/convey/IConveyPickStandSearch.ts";
|
||
|
|
import {ref} from "vue";
|
||
|
|
import TrueFalseTagStyleFormatter from "@/plugin/formatter/TrueFalseTagStyleFormatter.ts";
|
||
|
|
import {ConveyPickStandTypeFormatter} from "@/plugin/formatter/ConveyPickStandTypeFormatter.ts";
|
||
|
|
import type {IAppConveyPickStand} from "@/model/table/IAppConveyPickStand.ts";
|
||
|
|
import MessageUtils from "@/utils/MessageUtils.ts";
|
||
|
|
import ConveyStandApi from "@/api/conveyStand.ts";
|
||
|
|
import type {PageDataResponse} from "@/interface/api/PageDataResponse.ts";
|
||
|
|
import type {AppServeDataResponse} from "@/interface/api/AppServeDataResponse.ts";
|
||
|
|
import {AppServeResponseCodeEnum} from "@/constant/enums/AppServeResponseCodeEnum.ts";
|
||
|
|
import AddPickStand from "@/components/page/conveyStand/AddPickStand.vue";
|
||
|
|
import PickStandDetail from "@/components/page/conveyStand/PickStandDetail.vue";
|
||
|
|
|
||
|
|
const searchParams = ref<IConveyPickStandSearch>({});
|
||
|
|
const trueFalseTagStyleFormatter = new TrueFalseTagStyleFormatter();
|
||
|
|
const conveyPickStandTypeFormatter = new ConveyPickStandTypeFormatter();
|
||
|
|
const tableData = ref<IAppConveyPickStand[] | undefined>([]);
|
||
|
|
const pageSize = ref<number>(100); // 分页单页数据
|
||
|
|
const pageIndex = ref<number>(1); // 分页页码
|
||
|
|
const totalPages = ref<number | undefined>(0); // 总数据数
|
||
|
|
const showAdd = ref<boolean>(false); // 是否展示添加窗口
|
||
|
|
const showDetail = ref<boolean>(false); // 是否展示详情窗口
|
||
|
|
const detailData = ref<IAppConveyPickStand>({});
|
||
|
|
|
||
|
|
// 查询
|
||
|
|
const query = () => {
|
||
|
|
const loadingInstance = MessageUtils.loading('查询中...');
|
||
|
|
ConveyStandApi.queryPickStand(searchParams.value, pageSize.value, pageIndex.value).then((res) => {
|
||
|
|
const responseString = JSON.stringify(res.data);
|
||
|
|
const response = JSON.parse(responseString) as AppServeDataResponse<PageDataResponse<IAppConveyPickStand>>;
|
||
|
|
if (response && response.code == AppServeResponseCodeEnum.SUCCESS && response.data != undefined) {
|
||
|
|
tableData.value = response.data.data;
|
||
|
|
totalPages.value = response.data.totalCount;
|
||
|
|
MessageUtils.successMessage('查询成功');
|
||
|
|
} else {
|
||
|
|
MessageUtils.warningMessageBox(response.msg);
|
||
|
|
}
|
||
|
|
}).catch(() => {}).finally(() => {
|
||
|
|
loadingInstance.close();
|
||
|
|
});
|
||
|
|
};
|
||
|
|
// 重置查询参数
|
||
|
|
const resetInput = () => {
|
||
|
|
searchParams.value = {};
|
||
|
|
};
|
||
|
|
// 添加站台
|
||
|
|
const addStand = () => {
|
||
|
|
showAdd.value = true;
|
||
|
|
};
|
||
|
|
// 查看
|
||
|
|
const handleEdit = (index: number, row: any) => {
|
||
|
|
detailData.value = {
|
||
|
|
standId: row.standId,
|
||
|
|
standName: row.standName,
|
||
|
|
plcId: row.plcId,
|
||
|
|
areaId: row.areaId,
|
||
|
|
standStatus: row.standStatus,
|
||
|
|
standType: row.standType,
|
||
|
|
router: row.router,
|
||
|
|
readArriveAddress: row.readArriveAddress,
|
||
|
|
writeTaskAddress: row.writeTaskAddress,
|
||
|
|
remark: row.remark
|
||
|
|
};
|
||
|
|
showDetail.value = true;
|
||
|
|
};
|
||
|
|
// 分页
|
||
|
|
const paginationChange = () => {
|
||
|
|
query();
|
||
|
|
};
|
||
|
|
|
||
|
|
|
||
|
|
</script>
|
||
|
|
|
||
|
|
<template>
|
||
|
|
<div style="margin-left: 10px;margin-top: 10px; width: calc(100vw - 280px);">
|
||
|
|
<h3>输送线站台管理【捡货站台】</h3>
|
||
|
|
<el-row class="searchCard">
|
||
|
|
<el-row style="width: 100%;">
|
||
|
|
<el-form class="searchForm" v-model="searchParams" label-position="top" label-width="150px" inline>
|
||
|
|
<el-form-item label="站台号:" style="width: 250px;">
|
||
|
|
<el-input v-model="searchParams.standId" placeholder="支持模糊查询" clearable></el-input>
|
||
|
|
</el-form-item>
|
||
|
|
<el-form-item label="区域号:" style="width: 250px;">
|
||
|
|
<el-input v-model="searchParams.areaId" placeholder="支持模糊查询" clearable></el-input>
|
||
|
|
</el-form-item>
|
||
|
|
<el-form-item label="站台状态:" style="width: 250px;">
|
||
|
|
<el-select v-model="searchParams.standStatus" placeholder="请选择状态" clearable>
|
||
|
|
<el-option v-for="item in trueFalseTagStyleFormatter.canUseTagStyle" :key="item.value" :label="item.label" :value="item.value">
|
||
|
|
</el-option>
|
||
|
|
</el-select>
|
||
|
|
</el-form-item>
|
||
|
|
<el-form-item label="站台类型:" style="width: 250px;">
|
||
|
|
<el-select v-model="searchParams.standType" placeholder="请选择类型" clearable>
|
||
|
|
<el-option v-for="item in conveyPickStandTypeFormatter.pickStandType" :key="item.value" :label="item.label" :value="item.value">
|
||
|
|
</el-option>
|
||
|
|
</el-select>
|
||
|
|
</el-form-item>
|
||
|
|
</el-form>
|
||
|
|
</el-row>
|
||
|
|
<el-row>
|
||
|
|
<el-button-group style="width: 100%;margin-left: 10px; margin-bottom: 10px">
|
||
|
|
<el-button type="primary" @click="query">查询/刷新</el-button>
|
||
|
|
<el-button type="warning" @click="resetInput">重置查询参数</el-button>
|
||
|
|
<el-button type="success" @click="addStand">添加站台</el-button>
|
||
|
|
</el-button-group>
|
||
|
|
</el-row>
|
||
|
|
</el-row>
|
||
|
|
<el-row class="dataTable">
|
||
|
|
<el-table :data="tableData" stripe border style="width: 100%" max-height="calc(100vh - 320px)">
|
||
|
|
<el-table-column type="index" width="80" label="序号" align="center" show-overflow-tooltip fixed="left"/>
|
||
|
|
<el-table-column prop="standId" label="站台号" width="150" align="center" show-overflow-tooltip />
|
||
|
|
<el-table-column prop="standName" label="站台名称" width="150" align="center" show-overflow-tooltip/>
|
||
|
|
<el-table-column prop="plcId" label="管辖的PLC" width="100" align="center" show-overflow-tooltip/>
|
||
|
|
<el-table-column prop="areaId" label="区域号" width="150" align="center" show-overflow-tooltip/>
|
||
|
|
<el-table-column prop="standStatus" label="站台状态" width="100" align="center" show-overflow-tooltip>
|
||
|
|
<template #default="scope">
|
||
|
|
<el-tag :type="trueFalseTagStyleFormatter.canUseTagStyleFormatter(scope.row.standStatus).type">
|
||
|
|
{{trueFalseTagStyleFormatter.canUseTagStyleFormatter(scope.row.standStatus).label }}
|
||
|
|
</el-tag>
|
||
|
|
</template>
|
||
|
|
</el-table-column>
|
||
|
|
<el-table-column prop="standType" label="站台类型" width="120" align="center" show-overflow-tooltip>
|
||
|
|
<template #default="scope">
|
||
|
|
<el-tag :type="conveyPickStandTypeFormatter.conveyPickStandTypeFormatter(scope.row.standType).type">
|
||
|
|
{{conveyPickStandTypeFormatter.conveyPickStandTypeFormatter(scope.row.standType).label }}
|
||
|
|
</el-tag>
|
||
|
|
</template>
|
||
|
|
</el-table-column>
|
||
|
|
<el-table-column prop="router" label="路向" width="100" align="center" show-overflow-tooltip/>
|
||
|
|
<el-table-column prop="readArriveAddress" label="读取到达的地址" width="150" align="center" show-overflow-tooltip/>
|
||
|
|
<el-table-column prop="writeTaskAddress" label="写入任务的地址" width="180" align="center" show-overflow-tooltip/>
|
||
|
|
<el-table-column prop="remark" label="备注" min-width="150" align="left" show-overflow-tooltip/>
|
||
|
|
<el-table-column label="操作" width="80" align="center" fixed="right">
|
||
|
|
<template #default="scope">
|
||
|
|
<el-button size="small" type="primary" @click="handleEdit(scope.$index, scope.row)">查看</el-button>
|
||
|
|
</template>
|
||
|
|
</el-table-column>
|
||
|
|
</el-table>
|
||
|
|
<el-pagination style="margin: 10px"
|
||
|
|
background
|
||
|
|
v-model:current-page="pageIndex"
|
||
|
|
v-model:page-size="pageSize"
|
||
|
|
:page-sizes="[10, 100, 200, 300]"
|
||
|
|
size="small"
|
||
|
|
layout="total, sizes, prev, pager, next, jumper"
|
||
|
|
:total="totalPages"
|
||
|
|
@size-change="paginationChange"
|
||
|
|
@current-change="paginationChange"
|
||
|
|
/>
|
||
|
|
</el-row>
|
||
|
|
</div>
|
||
|
|
<!-- 添加站台-->
|
||
|
|
<AddPickStand v-model="showAdd" @reLoadingTableData="query"/>
|
||
|
|
<!-- 查看站台-->
|
||
|
|
<PickStandDetail v-model="showDetail" @reLoadingTableData="query" :form-data="detailData"/>
|
||
|
|
</template>
|
||
|
|
|
||
|
|
<style scoped>
|
||
|
|
|
||
|
|
</style>
|