value
2023-09-07 523d7a54fb07fdf756fbc4faa5eb7fef7263a556
src/views/laboratory/ledger/index.vue
@@ -2,7 +2,7 @@
  <div class="ledger-main">
    <div class="page-header-search">
      <div class="serve-btn">
        <el-button type="primary" icon="el-icon-plus"
        <el-button size="small" type="primary" icon="el-icon-plus"
          @click="showAddDrawer()">新增仪器</el-button>
      </div>
    </div>
@@ -11,7 +11,7 @@
        <div class="bom-item-search">
          <el-row>
            <el-col :span="19">
              <el-input v-model="filterText" clearable placeholder="输入关键字进行过滤" />
              <el-input size="small" v-model="filterText" clearable placeholder="输入关键字进行过滤" />
            </el-col>
            <el-col :span="5">
              <el-button type="primary" size="small" @click="addClassVisible = true"><i
@@ -28,14 +28,14 @@
            <el-row :gutter="20">
              <el-col :span="8">
                <el-form ref="form" :inline="true" :model="searchData">
                  <el-form-item>
                    <el-input v-model="searchData.keyword" placeholder="请输入编号/设备名称/型号规格">
                  <el-form-item width="200">
                    <el-input size="small" v-model="searchData.keyword" placeholder="请输入编号/设备名称/型号规格">
                      <i slot="prefix" class="el-input__icon el-icon-search" />
                    </el-input>
                  </el-form-item>
                  <el-form-item>
                    <el-button type="primary" @click="filterTableData">查询</el-button>
                    <el-button type="primary" plain @click="resetBtn">重置</el-button>
                    <el-button size="small" type="primary" @click="filterTableData">查询</el-button>
                    <el-button size="small" type="primary" plain @click="resetBtn">重置</el-button>
                  </el-form-item>
                </el-form>
              </el-col>
@@ -606,7 +606,7 @@
    },
    measureFormVisible(newVal){
      if(newVal === false){
        this.resetForm("addmeasureForm");
        this.cancelAddMeasure();
      }
    }
  },
@@ -639,7 +639,6 @@
    // 获取分类数据
    async getThreeData() {
      const { data } = await getClassifyList()
      // console.log(data)
      this.classTree = data.map(item => {
        if (item.children) {
          item.children = item.children.map(childrenItem => {
@@ -672,17 +671,14 @@
      const { data } = await getInstrumentDetail({ InstrumentId: row.id })
      this.equipmentDetail = data
      this.equipmentform = data
      console.log(this.equipmentform)
      const { data: pointList } = await getEquipmentPointList({ InstrumentId: this.equipmentDetail.id })
      this.codePointsTable = pointList
      const { data: informationList } = await getMetricalInformationList({ InstrumentId: this.equipmentDetail.id })
      this.measureTable = informationList
      console.log(informationList)
    },
    // 节点点击处理
    nodeClickHandler(data, node, element) {
      this.nodeclicked = data
      console.log(data)
      // 只有数据中携带id才能发送查询请求
      if (data.id) {
        this.getEquipmentTable({ classifyId: data.id, pageSize: this.pageSize, pageNo: this.currentPage, whetherWhether: this.isOut })
@@ -690,7 +686,6 @@
    },
    // 获取仪器列表数据
    async getEquipmentTable(ages) {
      // console.log('条件对象', ages)
      const { data } = await getInstrumentList(ages)
      this.equipmentTable = data.row
      this.total = data.total
@@ -709,14 +704,8 @@
    handleCurrentChange() {
      // 当前页更改
    },
    // 显示设备码点
    addCodePoints() {
      // 添加新码点,清空原数组
      this.codePointesTableStatus = true
    },
    // 新增设备码点
    addNewCodePoints() {
      console.log(this.equipmentDetail.id);
      this.codePointesTableStatus = true;
      const newObj = {}
      newObj.isInput = true,
@@ -814,10 +803,10 @@
      this.$refs[formName].resetFields();
    },
    cancelAddMeasure() {
      this.$refs['upload'].clearFiles();
      this.measureForm.file = null;
      this.measureFormVisible = false
      this.resetForm('addmeasureForm');
      this.$refs['upload'].clearFiles();
    },
    // 添加计量信息
    async addMeasure() {
@@ -829,7 +818,6 @@
            this.measureForm.beginDate = parseTime(this.measureForm.date[0], '{y}-{m}-{d}')
            this.measureForm.endDate = parseTime(this.measureForm.date[1], '{y}-{m}-{d}')
          }
          console.log(this.measureForm)
          const formData = new FormData()
          if(this.measureForm.file == null || this.measureForm.file == ""){
            this.$message.warning("请选择要上传的文件!");
@@ -837,16 +825,11 @@
          }else{
            formData.append('file', this.measureForm.file?.raw, this.measureForm.file?.name)
          }
          console.log(this.measureForm)
          for (const key in this.measureForm) {
            console.log(key)
            // if (key === 'file') return
            formData.append(key, this.measureForm[key])
          }
          console.log(formData)
          try {
            const { data } = await addMetricalInformation(formData)
            console.log(data)
            await addMetricalInformation(formData)
            this.$message.success('添加成功')
            const { data: informationList } = await getMetricalInformationList({ InstrumentId: this.equipmentDetail.id })
            this.measureTable = informationList
@@ -857,8 +840,6 @@
          }
          this.measureForm.file = null;
          this.$refs['upload'].clearFiles();
        }else{
          console.log(32);
        }
      });
    },
@@ -868,7 +849,6 @@
      this.codePointsTable = []
      this.measureTable = []
      this.measureForm.file = null;
      this.$refs['upload'].clearFiles();
    },
    // 关闭添加修改设备抽屉
    closeAddOrChangeDrawer() {
@@ -878,7 +858,6 @@
    },
    // 文件上传
    handleUpload(file, fileList) {
      console.log(file, fileList)
      this.measureForm.file = file
    },
    // 根据输入的设备编号,设备名称或者型号规格关键字进行过滤列表
@@ -896,7 +875,6 @@
      this.equipmentTable = this.oldtableData
    },
    getConditionTable() {
      // console.log(this.radioValue)
      let filteredTable = this.oldtableData.filter(item => {
        return item.conditions === this.radioValue
      })
@@ -939,12 +917,10 @@
            let expireItem
            for (expireItem of this.expireData) {
              this.equipmentTable = this.oldtableData.filter(item => {
                console.log(this.radioValue)
                console.log('item', item)
                console.log('expireItem', expireItem)
                return item.conditions === this.radioValue && item.equipment_code === expireItem.equipment_code
              })
              console.log(this.equipmentTable)
            }
          } else {
            this.equipmentTable = this.expireData