<template>
|
<div class="app-container">
|
<el-form
|
class="responsive-form"
|
:model="queryParams"
|
ref="queryRef"
|
:inline="true"
|
v-show="showSearch"
|
label-position="left"
|
>
|
<el-row type="flex" justify="left">
|
<el-col :span="locale === 'zh' ? 6 : 8">
|
<el-form-item :label-width="locale === 'zh' ? '48px' : '100px'" :label="$t('plan.query.itemNumber')" prop="itemNumber">
|
<el-input
|
:style="{ width: locale === 'zh' ? '180px' : '210px' }"
|
v-model="queryParams.itemNumber"
|
:placeholder="`${$t('common.common.placeholder')}${$t(
|
'plan.query.itemNumber'
|
)}`"
|
clearable
|
@keyup.enter="handleQuery"
|
/>
|
</el-form-item>
|
</el-col>
|
<el-col :span="locale === 'zh' ? 6 : 8">
|
<el-form-item
|
:label="$t('plan.query.workOrderNo')"
|
prop="documentNumber"
|
>
|
<el-input
|
:style="{ width: locale === 'zh' ? '180px' : '280px' }"
|
v-model="queryParams.documentNumber"
|
:placeholder="`${$t('common.common.placeholder')}${$t(
|
'plan.query.workOrderNo'
|
)}`"
|
clearable
|
@keyup.enter="handleQuery"
|
/>
|
</el-form-item>
|
</el-col>
|
<el-col :span="locale === 'zh' ? 12 : 8" style="text-align: right">
|
<el-form-item class="column-with-margin">
|
<el-button type="primary" icon="Search" @click="handleQuery">{{
|
$t("common.common.query")
|
}}</el-button>
|
<el-button icon="Refresh" @click="resetQuery">{{
|
$t("common.common.reset")
|
}}</el-button>
|
</el-form-item>
|
</el-col>
|
</el-row>
|
</el-form>
|
|
<el-row :gutter="10" class="mb8">
|
<el-col :span="1.5">
|
<el-button
|
type="warning"
|
plain
|
icon="Download"
|
@click="handleExport"
|
v-hasPermi="['Aps:apsPlatePlan:redundantOrderListExport']"
|
>{{ $t("common.common.export") }}</el-button
|
>
|
</el-col>
|
<right-toolbar
|
v-model:showSearch="showSearch"
|
@queryTable="getList"
|
></right-toolbar>
|
</el-row>
|
<HxlhTable
|
style="width: 100%"
|
:columns="columns"
|
:data="orderList"
|
:loading="loading"
|
:height="height"
|
ref="tableRef"
|
:page="page"
|
@changePageNo="changePageNo"
|
@changePageSize="changePageSize"
|
@on-checkbox="handleCheckboxChange"
|
>
|
</HxlhTable>
|
</div>
|
</template>
|
|
<script setup name="SheetMetalRedundantReport">
|
import HxlhTable from "@/components/HxlhTable";
|
import { redundantOrderList } from "@/api/basicData/sheetMetalConfig/sheetMetalConfig";
|
import { listAll_plant } from "@/api/basicData/plant";
|
import { useI18n } from "vue-i18n"; //要在js中使用国际化
|
const { t, locale } = useI18n();
|
const { proxy } = getCurrentInstance();
|
const tableRef = ref();
|
const orderList = ref([]);
|
const loading = ref(true);
|
const showSearch = ref(true);
|
const data = reactive({
|
queryParams: {
|
pageNum: 1,
|
pageSize: 10,
|
documentNumber: null,
|
itemNumber: null,
|
},
|
});
|
const { queryParams } = toRefs(data);
|
const plantList = ref([]);
|
const height = ref(document.documentElement.clientHeight - 220 + "px;");
|
// 表格配置-列表
|
const columns = ref([]);
|
// 分页属性
|
const page = ref({
|
total: 0,
|
current: 1,
|
size: 10,
|
});
|
watch(
|
locale,
|
(newLocale) => {
|
columns.value = [
|
{
|
title: t("plan.table.workOrderNo"),
|
field: "documentNumber",
|
align: "center",
|
},
|
{
|
title: t("plan.table.itemNumber"),
|
field: "itemNumber",
|
align: "center",
|
},
|
{
|
title: t("plan.table.productionQuantity"),
|
field: "productionQuantity",
|
width: "80",
|
align: "center",
|
},
|
{
|
title: t("plan.table.mismatchedProductionQuantity"),
|
field: "unmatchedQuantity",
|
width: "auto",
|
align: "center",
|
},
|
{
|
title: t("plan.table.applicableFactories"),
|
field: "plant",
|
width: "100",
|
align: "center",
|
formatter: ({ cellValue, row, column }) => {
|
if (cellValue) {
|
for (let i = 0; i < plantList.value.length; i++) {
|
if (cellValue === plantList.value[i].plantCode) {
|
return plantList.value[i].plantName;
|
}
|
}
|
}
|
},
|
},
|
{
|
title: t("plan.table.productionBase"),
|
field: "productionBase",
|
width: "100",
|
align: "center",
|
},
|
{
|
title: t("plan.table.planStartDay"),
|
field: "planStartDay",
|
width: "120",
|
align: "center",
|
},
|
{
|
title: t("plan.table.planEndDayDate"),
|
field: "planEndDay",
|
width: "120",
|
align: "center",
|
},
|
{
|
title: t("plan.table.workorderCreationTime"),
|
field: "orderCreateTime",
|
width: "150",
|
align: "center",
|
},
|
];
|
},
|
{ immediate: true, deep: true }
|
);
|
/** 查询管理列表 */
|
function getList() {
|
loading.value = true;
|
redundantOrderList(queryParams.value).then((response) => {
|
orderList.value = response.rows;
|
page.value.total = response.total;
|
loading.value = false;
|
}).catch(()=>{
|
loading.value = false;
|
});
|
}
|
/** 搜索按钮操作 */
|
function handleQuery() {
|
queryParams.value.pageNum = 1;
|
page.value.current = 1;
|
getList();
|
}
|
|
/** 重置按钮操作 */
|
function resetQuery() {
|
proxy.resetForm("queryRef");
|
handleQuery();
|
}
|
|
/** 导出按钮操作 */
|
function handleExport() {
|
proxy.download(
|
"aps/apsPlatePlan/redundantOrderListExport",
|
{
|
...queryParams.value,
|
},
|
`redundantOrderList_${new Date().getTime()}.xlsx`
|
);
|
}
|
function changePageNo(currentPage) {
|
queryParams.value.pageNum = currentPage;
|
page.value.current = currentPage;
|
getList();
|
}
|
function changePageSize(pageSize) {
|
page.value.current = 1;
|
queryParams.value.pageNum = 1;
|
queryParams.value.pageSize = pageSize;
|
getList();
|
}
|
onMounted(() => {
|
getList();
|
/** 查询工厂列表 */
|
listAll_plant({})
|
.then((response) => {
|
plantList.value = response.data;
|
})
|
.catch((error) => {
|
console.error("请求出错:", error);
|
});
|
});
|
</script>
|
<style lang="scss" scoped>
|
.column-with-margin {
|
margin-right: 0px;
|
}
|
.title_bar_line {
|
display: flex;
|
justify-content: flex-start;
|
align-items: center;
|
color: #333;
|
margin-bottom: 10px;
|
.line_short {
|
width: 5%;
|
height: 1px;
|
margin-right: 20px;
|
border-top: 1px solid #ddd;
|
}
|
.line_long {
|
width: 60%;
|
height: 1px;
|
margin-left: 20px;
|
border-top: 1px solid #ddd;
|
}
|
}
|
.week_flex {
|
display: flex;
|
justify-content: flex-start;
|
align-content: center;
|
color: #606266;
|
font-weight: 700;
|
margin-left: 20px;
|
&.mt20 {
|
margin-top: 20px;
|
margin-left: 0 !important;
|
}
|
.week_flex_item {
|
&:nth-child(1) {
|
margin-top: 5px;
|
}
|
&:nth-child(2) {
|
margin-left: 20px;
|
}
|
}
|
}
|
.factory_use_item {
|
margin-top: 10px;
|
}
|
.mart5 {
|
margin-top: 5px;
|
}
|
.custom-height {
|
height: 200px; /* 或者使用 min-height */
|
}
|
.auto-height-grid .xe-body .xe-body--row {
|
height: auto; /* 或者使用 min-height */
|
}
|
</style>
|