chengxiangling
2025-05-16 af1c9e588f1de0240390648f9bb56aa486870aff
src/views/mainPlan/pipeProduceStatics/index.vue
@@ -8,44 +8,84 @@
      v-show="showSearch"
      label-position="left"
    >
      <el-row :gutter="20">
        <el-col :span="8">
          <el-form-item :label="$t('plan.query.statistical')" :style="{ width: '100%' }">
            <el-select
              v-model="queryParams.searchType"
              placeholder="Select"
              @change="handleChangeSelectType"
      <el-form
        class="responsive-form"
        :model="queryParams"
        ref="queryRef"
        :inline="true"
        v-show="showSearch"
        label-position="left"
      >
        <el-row :gutter="20">
          <el-col :span="6">
            <el-form-item
              :label="$t('plan.query.statistical')"
              :style="{ width: '100%' }"
            >
              <el-option
                v-for="item in options"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              />
            </el-select>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item :label="$t('plan.query.selectDateRange')" :style="{ width: '100%' }">
            <div v-if="!dayCom">
              <el-date-picker
                v-model="queryParams.monthRange"
                type="monthrange"
                :range-separator="$t('plan.placeholder.to')"
                :start-placeholder="$t('plan.placeholder.startMonth')"
                :end-placeholder="$t('plan.placeholder.endMonth')"
              />
            </div>
            <div v-else>
              <el-date-picker
                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-select
                v-model="queryParams.searchType"
                placeholder="Select"
                @change="handleChangeSelectType"
              >
                <el-option
                  v-for="item in options"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item
              :style="{ width: '100%' }"
              :label="
                !dayCom
                  ? $t('plan.query.selectDateRange')
                  : $t('plan.query.selectDateMonth')
              "
            >
              <div v-if="!dayCom">
                <el-date-picker
                  :style="{ width: '250px' }"
                  v-model="queryParams.monthRange"
                  type="monthrange"
                  :range-separator="$t('plan.placeholder.to')"
                  :start-placeholder="$t('plan.placeholder.startMonth')"
                  :end-placeholder="$t('plan.placeholder.endMonth')"
                />
              </div>
              <div v-else>
                <el-date-picker
                  :style="{ width: '100%' }"
                  v-model="queryParams.monthDays"
                  type="month"
                  :placeholder="$t('plan.placeholder.selectMonth')"
                />
              </div>
            </el-form-item>
          </el-col>
          <el-col :span="6" v-if="dayCom">
            <el-form-item
              :label="$t('basic.table.applicableFactories')"
              prop="plant"
              :style="{ width: '100%' }"
            >
              <el-select
                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="6" style="text-align:right;">
          <el-form-item class="column-with-margin">
            <el-button type="primary" icon="Search" @click="handleQuery">{{
              $t("common.common.query")
@@ -54,8 +94,9 @@
              $t("common.common.reset")
            }}</el-button>
          </el-form-item>
        </el-col>
      </el-row>
        </el-col> -->
        </el-row>
      </el-form>
    </el-form>
    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
@@ -79,7 +120,11 @@
          >{{ $t("common.common.update") }}</el-button
        >
      </el-col>
      <right-toolbar @queryTable="handleQuery" :search="false"></right-toolbar>
      <right-toolbar
        v-model:showSearch="showSearch"
        @queryTable="handleQuery"
        @resetTable="resetQuery"
      ></right-toolbar>
    </el-row>
    <!-- <div class="box_container"> -->
    <!-- <div class="title_text">管路规划产能负载统计</div> -->
@@ -204,9 +249,7 @@
  if (list) {
    return list
      .map((type) => {
        const item = aps_factory.value.find(
          (item) => item.value === type
        );
        const item = aps_factory.value.find((item) => item.value === type);
        return item ? item.label : type;
      })
      .join("");
@@ -242,26 +285,43 @@
      }
      // headersOne.push(t("plan.table.dateYearMonth"));
      // headersTwo.push(t("plan.table.processName"));
      colList.push({
        field: "dateCol",
        title: t("plan.table.dateYearMonth"),
        fixed: "left",
        children: [
          {
            field: `resourceName`,
            title: t("plan.table.processName"),
            width: 250,
            type: "html",
          },
          {
            field: `resourceGroupName`,
            title: t("plan.table.applicableFactories"),
            width: 250,
            type: "html",
          },
        ],
        width: 160,
      });
      if (!dayCom.value) {
        colList.push({
          field: "dateCol",
          title: t("plan.table.dateYearMonth"),
          fixed: "left",
          children: [
            {
              field: `resourceName`,
              title: t("plan.table.processName"),
              width: 250,
              type: "html",
            },
            {
              field: `resourceGroupName`,
              title: t("plan.table.applicableFactories"),
              width: 250,
              type: "html",
            },
          ],
          width: 160,
        });
      } else {
        colList.push({
          field: "dateCol",
          title: t("plan.table.dateYearMonth"),
          fixed: "left",
          children: [
            {
              field: `resourceName`,
              title: t("plan.table.processName"),
              width: 250,
              type: "html",
            },
          ],
          width: 160,
        });
      }
      response.data.planTitle.forEach((item) => {
        colKey++;
        colList.push({
@@ -314,8 +374,15 @@
          // item[`resourceName`] = flag
          //   ? `<div class='el-badge'><sup class="el-badge__content is-fixed is-dot"></sup>${key}</div>`
          //   : key;
          item[`resourceName`] = key.split("_")[0];
          item[`resourceGroupName`] = formatTypeLabelPlant([key.split("_")[1]]);
          if (!dayCom.value) {
            const lastIndex = key.lastIndexOf("_");
            item[`resourceName`] = key.slice(0, lastIndex);
            item[`resourceGroupName`] = formatTypeLabelPlant([
              key.slice(lastIndex + 1),
            ]);
          } else {
            item[`resourceName`] = key;
          }
        }
        dataList.push(item);
      });