zouyu
2023-09-04 aca7c994977ecb1cc8fb3b7740a04192135a40a9
src/views/laboratory/ledger/index.vue
@@ -52,9 +52,9 @@
          </div>
        </div>
        <div class="table-box">
          <el-table ref="equipmentTable" node-key="father_name" :cell-style="{ textAlign: 'center' }"
            :header-cell-style="{ border: '0px', background: '#f5f7fa', color: '#606266', boxShadow: 'inset 0 1px 0 #ebeef5', textAlign: 'center' }"
            :data="equipmentTable" style="width: 100%">
          <el-table ref="equipmentTable" node-key="father_name" :cell-style="{ textAlign: 'left' }"
            :header-cell-style="{ border: '0px', background: '#f5f7fa', color: '#606266', boxShadow: 'inset 0 1px 0 #ebeef5', textAlign: 'left' }"
            :data="equipmentTable" style="width: 100%;">
            <el-table-column type="index" label="序号" min-width="90" />
            <el-table-column prop="equipment_code" label="仪器设备编号" min-width="200" />
            <el-table-column prop="equipment_name" label="仪器设备名称" min-width="150" />
@@ -68,7 +68,6 @@
              </template>
            </el-table-column>
            <el-table-column prop="storage_place" label="存放地" min-width="200" />
            <el-table-column label="操作" min-width="120" fixed="right">
              <template slot-scope="scope">
                <el-button type="text" size="small" @click="openDetail(scope.row)">编辑</el-button>
@@ -250,7 +249,7 @@
              <el-form-item label="所属分类:" prop="classifyId" label-width="80" :rules="[
                { required: true, message: '请选择所属分类', trigger: 'change' }
              ]">
                <el-cascader v-model="equipmentform.classifyId" :options="classTree" :show-all-levels="false" />
                <el-cascader style="width: 100%;" v-model="equipmentform.classifyId" :options="classTree" :show-all-levels="false" />
              </el-form-item>
            </el-col>
            <el-col :span="11">
@@ -686,7 +685,7 @@
    // 节点点击处理
    nodeClickHandler(data, node, element) {
      this.nodeclicked = data
      // console.log(data)
      console.log(data)
      // 只有数据中携带id才能发送查询请求
      if (data.id) {
        this.getEquipmentTable({ classifyId: data.id, pageSize: this.pageSize, pageNo: this.currentPage, whetherWhether: this.isOut })
@@ -951,15 +950,14 @@
      this.deletedialogVisible = true
    },
    async deleteInstrument() {
      let up = await deleteInstrument({ instrumentId: this.instrumentId })
      if (up.data) {
        this.$message({
          message: '操作成功!',
          type: 'success'
        });
      await deleteInstrument({ instrumentId: this.instrumentId }).then(res=>{
        this.$message.error('删除成功!');
        let d = this.nodeclicked
        console.log(d);
        this.nodeClickHandler(d);
      }
      }).catch(()=>{
        this.$message.error('删除失败!');
      });
      this.deletedialogVisible = false
    },
    async submitTreeForm(formName) {
@@ -979,12 +977,15 @@
        fatherName: null,
        sonName: null
      }
      if (_that.addTreeForm.type != null && _that.addTreeForm.type[0] != 0) {
        data.fatherName = _that.addTreeForm.type[0]
        data.fatherName = _that.addTreeFormClassTree.filter(item => {
          return item.value == _that.addTreeForm.type[0]
        })[0].label
        data.sonName = _that.addTreeForm.name
      } else {
        data.fatherName = _that.addTreeForm.name
      }
      }      // return;
      let add = await addClassify(data);
      switch (add.message.split('-$')[0]) {
        case '1':
@@ -996,13 +997,13 @@
          _that.resetTreeForm('addTreeForm')
          break;
        case '2':
        this.$message({
          message: '已存在该分类',
          type: 'warning'
        });
          this.$message({
            message: '已存在该分类',
            type: 'warning'
          });
          break;
        case '0':
        this.$message.error('添加失败!请联系管理员');
          this.$message.error('添加失败!请联系管理员');
          break;
      }
@@ -1049,7 +1050,7 @@
    background: #fff;
    display: flex;
    justify-content: space-between;
    padding: 0 24px 12px 24px;
    padding: 15px 24px 12px 24px;
    .search-bar {
      .el-radio-button.is-active {
@@ -1085,6 +1086,7 @@
    .library-bom {
      flex: 2;
      margin-right: 12px;
         height: 80vh;
      .bom-item-search {
        margin-bottom: 12px;
@@ -1116,6 +1118,7 @@
      margin-left: 12px;
      display: flex;
      flex-direction: column;
         height: 80vh;
      .table-box {
        margin-top: 30px;