spring
2025-03-19 07a41ade45c962e93a9d449ce1be0eec52e66a6a
src/components/view/a7-sample-registration.vue
@@ -3,9 +3,9 @@
    <el-row class="title">
      <el-col :span="20" style="padding-left: 20px;text-align: left;">样品接收</el-col>
    </el-row>
    <el-tabs type="border-card" v-model="activeName" style="height: 100%;" @tab-click="componentData0.entity.totalSampleId=''">
    <el-tabs type="border-card" v-model="activeName" style="height: 100%;" @tab-click="tabClick">
      <el-tab-pane label="填写" name="填写" style="height: 100%;" :key="1">
        <el-button size="small" type="primary" @click="handleAdd0" style="margin-left: 20px;" v-if="addPower">新增</el-button>
        <el-button size="small" type="primary" @click="handleAdd0" style="margin-left: 20px;" v-if="addPower&&currentInfo.submitState!='已提交'">新增</el-button>
        <div class="table" style="height: calc(100% - 200px)" v-if="activeName=='填写'">
          <ValueTable ref="ValueTable0" :url="$api.processSample.pageProcessSample"
      :componentData="componentData0" :key="upIndex0" :delUrl="$api.processSample.delProcessSample" />
@@ -29,7 +29,7 @@
            <el-button size="small" type="primary" @click="refreshTable()">查 询</el-button>
          </div>
        </div>
        <div class="table">
        <div class="table" v-if="activeName=='历史记录'">
          <ValueTable ref="ValueTable" :url="$api.processSample.pageProcessTotalSample"
            :componentData="componentData" :key="upIndex"/>
        </div>
@@ -232,7 +232,7 @@
  name: "SampleDisposal",
  data() {
    return {
      activeName:'填写',
      activeName:'历史记录',
      title:'新增',
      addDialogVisible:false,
      addLoading:false,
@@ -291,7 +291,7 @@
            type: 'text',
            method: 'handleCheck',
            disabFun: (row, index) => {
                  return row.examineState=='通过'||row.submitState=='待提交'
                  return row.examineState=='通过'||row.submitState=='待提交'||!row.submitState
            }
          }, {
            id: 'handleApproval',
@@ -299,7 +299,7 @@
            type: 'text',
            method: 'handleApproval',
            disabFun: (row, index) => {
                  return row.ratifyState=='通过'||row.submitState=='待提交'
                  return row.ratifyState=='通过'||row.submitState=='待提交'||!row.submitState
            }
          }],
          tagField: {},
@@ -325,12 +325,12 @@
            id: 'handleAdd0',
            font: '修改',
            type: 'text',
            method: 'handleAdd0'
            method: 'handleAdd0',
          },{
            id: 'delete',
            font: '删除',
            type: 'text',
            method: 'doDiy'
            method: 'doDiy',
          }],
          tagField: {},
          selectField: {},
@@ -350,6 +350,17 @@
      outPower:true,
      addPower:true,
    };
  },
  watch: {
    'activeName' (val1, val2) {
      if(val1=='填写'){
        this.componentData0.do.forEach((item)=>{
          item.disabFun = (row, index) => {
            return !this.addPower||this.currentInfo.submitState=='已提交'
          }
        })
      }
    }
  },
  mounted() {
    this.entityCopy = this.HaveJson(this.componentData.entity);
@@ -416,7 +427,7 @@
      }).catch(err=>{});
    },
    refreshTable() {
      this.$refs['ValueTable'].selectList()
      this.$refs['ValueTable']&&this.$refs['ValueTable'].selectList()
    },
    refresh() {
      this.componentData.entity = this.HaveJson(this.entityCopy)
@@ -503,9 +514,12 @@
      // console.log(row)
      // this.title0 = '查看'
      // this.commonFun(row)
      this.currentInfo = row
      this.activeName = '填写'
      this.componentData0.entity.totalSampleId = row.id
      this.$refs['ValueTable0'].selectList()
      this.$nextTick(()=>{
        this.$refs['ValueTable0'].selectList()
      })
    },
    commonFun(row,callbanck){
      this.currentInfo = row
@@ -598,6 +612,13 @@
      link.href = url;
      link.download = row.month+' 样品接收表';
      link.click();
    },
    tabClick(e){
      console.log(e)
      if(e.index==0){
        this.currentInfo = this.$refs['ValueTable'].tableData[0]
        this.componentData0.entity.totalSampleId=''
      }
    }
  },
}