cuilei
2025-06-24 a22a69946912221dab4d32987dda6c4c8ba3c5d8
src/views/mdc/base/GroupUtilizationRateChart.vue
@@ -5,7 +5,7 @@
        <a-row :gutter="24">
          <a-col :md="3" :sm="3">
            <a-form-item label="中心">
              <a-select v-model="queryParam.productionId" placeholder="请选择中心">
              <a-select v-model="queryParam.productionId" placeholder="请选择中心" @change="handleCenterSelectChange">
                <a-select-option v-for="item in centerList" :key="item.key">
                  {{ item.title }}
                </a-select-option>
@@ -44,21 +44,9 @@
            </a-form-item>
          </a-col>
          <!--          <a-col :md="5" :sm="5">-->
          <!--            <a-form-item label="班次">-->
          <!--              <a-select v-model="queryParam.workTime" placeholder="请选择班次" mode="multiple" :maxTagCount="2">-->
          <!--                <a-select-option key="123">一班</a-select-option>-->
          <!--                <a-select-option key="234">二班</a-select-option>-->
          <!--                <a-select-option key="345">三班</a-select-option>-->
          <!--              </a-select>-->
          <!--            </a-form-item>-->
          <!--          </a-col>-->
          <a-col :md="2" :sm="2">
            <a-space>
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <!--              <a-button type="primary" @click="searchReset" icon="reload">重置</a-button>-->
            </a-space>
          </a-col>
        </a-row>
@@ -228,13 +216,14 @@
    // 获取中心列表
    getCenterListByApi() {
        this.centerList = []
      const that = this
      mdcApi.getCenterOrGroupListApi()
        .then(res => {
          if (res.success) {
            that.centerList = res.result
            that.queryParam.productionId = res.result[0].value
            that.getGroupListByApi(res.result[0].value)
              that.handleCenterSelectChange(res.result[0].value, { isInitLoad: true })
          }
        })
    },
@@ -243,19 +232,30 @@
     * 获取班组列表
     * @param productionId 中心Id
     */
    getGroupListByApi(productionId) {
      getGroupListByApi(productionId, isInitLoad) {
        this.groupList = []
      const that = this
      mdcApi.getCenterOrGroupListApi(productionId)
        .then(res => {
          if (res.success) {
            that.groupList = res.result
            that.handleGroupSelectChange([res.result[0].value])
              that.handleGroupSelectChange(res.result && res.result.length > 0 && isInitLoad ? [res.result[0].value] : [])
              if (!isInitLoad) return
            that.loadData()
          }
        })
    },
    /**
       * 中心发生改变时触发
       * @param value 改变后的值
       * @param isInitLoad 是否为初始化加载
       */
      handleCenterSelectChange(value, { isInitLoad }) {
        this.getGroupListByApi(value, isInitLoad)
      },
      /**
     * 班组发生改变时触发
     * @param value 改变后的值
     */