| | |
| | | > |
| | | <el-row :gutter="20"> |
| | | <el-col :span="8"> |
| | | <el-form-item :label="$t('plan.query.statistical')" :style="{ width: '100%' }"> |
| | | <el-form-item :label="$t('plan.query.statistical')" > |
| | | <el-select |
| | | v-model="queryParams.searchType" |
| | | placeholder="Select" |
| | | @change="handleChangeSelectType" |
| | | :style="{ width: '270px' }" |
| | | > |
| | | <el-option |
| | | v-for="item in options" |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8"> |
| | | <el-form-item :label="$t('plan.query.selectDateRange')" :style="{ width: '100%' }"> |
| | | <el-form-item :label="!dayCom?$t('plan.query.selectDateRange'):$t('plan.query.selectDateMonth')"> |
| | | <div v-if="!dayCom"> |
| | | <el-date-picker |
| | | :style="{ width: '240px' }" |
| | | v-model="queryParams.monthRange" |
| | | type="monthrange" |
| | | :range-separator="$t('plan.placeholder.to')" |
| | |
| | | </div> |
| | | <div v-else> |
| | | <el-date-picker |
| | | :style="{ width: '200px' }" |
| | | v-model="queryParams.monthDays" |
| | | type="month" |
| | | :placeholder="$t('plan.placeholder.selectMonth')" |
| | |
| | | </div> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="8" style="text-align:right;"> |
| | | <el-col :span="8" v-if="!dayCom"> |
| | | <el-form-item |
| | | :label="$t('basic.table.applicableFactories')" |
| | | prop="plant" |
| | | > |
| | | <el-select |
| | | :style="{ width: '300px' }" |
| | | clearable |
| | | v-model="queryParams.applicableFactory" |
| | | :placeholder="$t('basic.table.applicableFactories')" |
| | | > |
| | | <el-option |
| | | v-for="item in aps_factory" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <!-- <el-col :span="8" style="text-align:right;"> |
| | | <el-form-item class="column-with-margin"> |
| | | <el-button type="primary" icon="Search" @click="handleQuery">{{ |
| | | $t("common.common.query") |
| | |
| | | $t("common.common.reset") |
| | | }}</el-button> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-col> --> |
| | | </el-row> |
| | | </el-form> |
| | | <el-row :gutter="10" class="mb8"> |
| | |
| | | >{{ $t("common.common.update") }}</el-button |
| | | > |
| | | </el-col> |
| | | <right-toolbar @queryTable="handleQuery" :search="false"></right-toolbar> |
| | | <right-toolbar @queryTable="handleQuery"></right-toolbar> |
| | | </el-row> |
| | | <vxe-grid ref="gridRef" v-bind="gridOptions" :loading="loading"></vxe-grid> |
| | | </div> |
| | |
| | | import { useI18n } from "vue-i18n"; //要在js中使用国际化 |
| | | const { t, locale } = useI18n(); |
| | | const { proxy } = getCurrentInstance(); |
| | | |
| | | const { aps_factory } = proxy.useDict("aps_factory"); |
| | | const loading = ref(false); |
| | | const gridRef = ref(); |
| | | const height = ref(document.documentElement.clientHeight - 180 + "px;"); |
| | | const headers = ref([]); |
| | | const exportData = ref([]); |
| | | // const exportData = ref([]); |
| | | const showSearch = ref(true); |
| | | const data = reactive({ |
| | | queryParams: { |
| | |
| | | const dayCom = ref(false); |
| | | let tableColumn = []; |
| | | let tableData = []; |
| | | let merges = []; |
| | | // let merges = []; |
| | | watch( |
| | | locale, |
| | | (newLocale) => { |
| | |
| | | eYearMonth: `${eYear}-${eMonth.toString().padStart(2, "0")}`, |
| | | }; |
| | | } |
| | | const formatTypeLabelPlant = (list) => { |
| | | if (list) { |
| | | return list |
| | | .map((type) => { |
| | | const item = aps_factory.value.find( |
| | | (item) => item.value === type |
| | | ); |
| | | return item ? item.label : type; |
| | | }) |
| | | .join(""); |
| | | } |
| | | return ""; |
| | | }; |
| | | function getGasList() { |
| | | let rowKey = 0; |
| | | let colKey = 0; |
| | | headers.value = []; |
| | | exportData.value = []; |
| | | // exportData.value = []; |
| | | tableColumn = []; |
| | | tableData = []; |
| | | loading.value = true; |
| | |
| | | loading.value = false; |
| | | return; |
| | | } |
| | | headersOne.push(t("plan.table.dateYearMonth")); |
| | | headersTwo.push(t("plan.table.processName")); |
| | | // headersOne.push("");//t("plan.table.dateYearMonth") |
| | | // headersOne.push(""); |
| | | // headersTwo.push(t("plan.table.processName")); |
| | | // headersTwo.push(t("plan.table.applicableFactories")); |
| | | colList.push({ |
| | | field: "dateCol", |
| | | title: t("plan.table.dateYearMonth"), |
| | |
| | | width: 250, |
| | | type: "html", |
| | | }, |
| | | { |
| | | field: `resourceGroupName`, |
| | | title: t("plan.table.applicableFactories"), |
| | | width: 250, |
| | | type: "html", |
| | | }, |
| | | ], |
| | | width: 160, |
| | | }); |
| | | response.data.planTitle.forEach((item) => { |
| | | headersOne.push(item); |
| | | headersOne.push(""); |
| | | headersOne.push(""); |
| | | headersTwo.push(t("plan.table.designWorkingHours")); |
| | | headersTwo.push(t("plan.table.requiredWorkingHours")); |
| | | headersTwo.push(t("plan.table.capacityLoad")); |
| | | // headersOne.push(item); |
| | | // headersOne.push(""); |
| | | // headersOne.push(""); |
| | | // headersTwo.push(t("plan.table.designWorkingHours")); |
| | | // headersTwo.push(t("plan.table.requiredWorkingHours")); |
| | | // headersTwo.push(t("plan.table.capacityLoad")); |
| | | colKey++; |
| | | colList.push({ |
| | | field: `dateColTime${colKey}`, |
| | |
| | | }); |
| | | }); |
| | | |
| | | headers.value.push(headersOne); |
| | | headers.value.push(headersTwo); |
| | | // headers.value.push(headersOne); |
| | | // headers.value.push(headersTwo); |
| | | |
| | | const columnList = [...tableColumn, ...colList]; |
| | | const dataList = []; |
| | | let startCol = 1; |
| | | // let startCol = 1; |
| | | |
| | | //获取map |
| | | response.data.planTable.map((mapItem) => { |
| | | rowKey++; |
| | | let lastCol = startCol + 2; |
| | | merges.push({ s: { r: 0, c: startCol }, e: { r: 0, c: lastCol } }); |
| | | startCol = lastCol + 1; |
| | | // let lastCol = startCol + 2; |
| | | // merges.push({ s: { r: 0, c: startCol }, e: { r: 0, c: lastCol } }); |
| | | // startCol = lastCol + 1; |
| | | let data = []; |
| | | const item = { |
| | | id: `${rowKey}`, |
| | | }; |
| | | for (const [key, listValue] of Object.entries(mapItem)) { |
| | | data.push(key); |
| | | // data.push(key); |
| | | |
| | | let tableKey = 0; |
| | | let flag = false; |
| | |
| | | listItem.requireTimes, |
| | | listItem.capacityLoad |
| | | ); |
| | | data.push(listItem.designTimes); |
| | | data.push(listItem.requireTimes); |
| | | data.push(listItem.capacityLoad + "%"); |
| | | // data.push(listItem.designTimes); |
| | | // data.push(listItem.requireTimes); |
| | | // data.push(listItem.capacityLoad + "%"); |
| | | // if (listItem.capacityLoad > 100) { |
| | | // flag = true; |
| | | // } |
| | |
| | | // item[`resourceName`] = flag |
| | | // ? `<div class='el-badge'><sup class="el-badge__content is-fixed is-dot"></sup>${key}</div>` |
| | | // : key; |
| | | item[`resourceName`] = key; |
| | | item[`resourceName`] = key.split("_")[0]; |
| | | item[`resourceGroupName`] = formatTypeLabelPlant([key.split("_")[1]]); |
| | | } |
| | | exportData.value.push(data); |
| | | // exportData.value.push(data); |
| | | dataList.push(item); |
| | | }); |
| | | |