xyc
2024-11-04 e48a56c2171f023f1978b0b6aec9befd43e7a9dc
web/src/views/modules/taskReliability/ReliabilityAssess.vue
@@ -19,6 +19,15 @@
          <el-button type="primary" @click="assess()">评定</el-button>
          <el-button type="primary" @click="add()">新增评定数据</el-button>
          <el-button type="primary" @click="handleExpand()">{{expandText}}</el-button>
          <el-dropdown style="margin-left: 10px" @command="download">
            <el-button type="primary">
              下载xml<i class="el-icon-arrow-down el-icon--right"></i>
            </el-button>
            <el-dropdown-menu slot="dropdown">
              <el-dropdown-item command="1">输入xml</el-dropdown-item>
              <el-dropdown-item command="2">输出xml</el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </el-form>
        <el-table ref="multipleTable" v-loading="table.dataLoading" :data="dataList" height="100px" v-adaptive="{bottomOffset:70}"
                  row-key="id"
@@ -43,6 +52,8 @@
</template>
<script>
  import AddOrUpdate from './RelisbilityAssess-AddOrUpdate'
  import qs from "qs";
  import Cookies from "js-cookie";
  export default {
    data() {
@@ -189,6 +200,21 @@
          }
        })
      },
    }
      async download(selsect) {
        if (!this.dataForm.productId || !this.dataForm.taskId || !this.dataForm.itemId ) {
          this.$tip.alert("有未填写的数据")
          return
        }
          let param = qs.stringify({
            'token': Cookies.get('token'),
            productId: this.dataForm.productId,
            taskId: this.dataForm.taskId,
            itemId: this.dataForm.itemId,
            xml:selsect
          })
          let apiURL = `/taskReliability/ReliabilityAssess/downloadXml`
          window.location.href = `${window.SITE_CONFIG['apiURL']}${apiURL}?${param}`
        }
      },
  }
</script>