zouyu
2023-09-06 af75159618b6b090710b9515bc789fa9accdc3bd
src/views/laboratory/ledger/index.vue
@@ -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