licp
2024-10-28 3845f43c43252185a134566a63670de9d1c2d253
src/components/do/b1-report-preparation/order.vue
@@ -34,20 +34,60 @@
    <el-dialog
      title="生成报告"
      :visible.sync="dialogVisible"
      width="30%"
      width="60%"
      :append-to-body="true"
      :modal="!dialogVisible0"
      >
      <span>请选择委托编号为 {{currentInfo.entrustCode}} 要生成的数据</span>
      <el-card class="box-card" style="margin-top: 16px;" v-for="(item,index) in historyList" :key="index">
        <div slot="header" style="display: flex;justify-content: space-between;">
          <span>{{ item.laboratory }}</span>
          <!-- <el-checkbox v-model="item.checked"></el-checkbox> -->
        </div>
        <el-radio-group v-model="item.numValue" ref="radio">
          <el-radio :label="m.value" v-for="(m,i) in item.arr" :key="i"><el-link type="primary" @click="lookDetail(item,m.value)">{{ m.label }}</el-link></el-radio>
        </el-radio-group>
      </el-card>
      <span>请选择委托编号为 <span style="color: #3A7BFA">{{currentInfo.entrustCode}}</span> 要生成的数据</span>
      <div style="max-height: 75vh;overflow-y: auto;">
        <el-card class="box-card" style="margin-top: 16px;" v-for="(item,index) in historyList" :key="index">
          <div slot="header" style="display: flex;justify-content: space-between;">
            <span>{{ item.laboratory }}</span>
          </div>
          <el-table
            :data="item.insOrderUserList"
            border
            style="width: 100%" @selection-change="list=>handleSelectionChange(list,item.insOrderUserList)">
            <el-table-column
              type="selection"
              width="55">
            </el-table-column>
            <el-table-column
              prop="submitTime"
              label="提交日期"
              min-width="150">
            </el-table-column>
            <el-table-column
              prop="submitUserName"
              label="提交人"
              min-width="90">
            </el-table-column>
            <el-table-column
              prop="term"
              label="实验阶段"
              min-width="120">
            </el-table-column>
            <el-table-column
              prop="note"
              label="实验操作"
              min-width="120">
            </el-table-column>
            <el-table-column
              prop="tell"
              label="再次检验原因"
              min-width="120">
            </el-table-column>
            <el-table-column
              fixed="right"
              label="操作"
              min-width="100">
              <template slot-scope="scope">
                <el-button @click="lookDetail(item,scope.row.num)" type="text" size="small">查看</el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-card>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button :loading="loading0" @click="handleNoCreate">不生成</el-button>
        <el-button type="primary" @click="handleCreate" :loading="loading1">生 成</el-button>
@@ -221,16 +261,27 @@
    },
    // 生成报告
    handleCreate(){
      let arr = []
      this.historyList.forEach(item => {
        item.insOrderUserList.forEach(item1 => {
          if(item1.state==1){
            arr.push({
              laboratory:item.laboratory,
              num:item1.num,
              insOrderUsersId:item1.id
            })
          }
        })
      })
      if(arr.length==0){
        this.$message.error("请先选择需要生成的记录!")
        return
      }
      this.loading1 = true
      this.$axios.post(this.$api.insReport.isReport, {
        id:this.currentInfo.id,
        state:1,
        insReportDto1s:this.historyList.map(item => {
          return{
            laboratory:item.laboratory,
            num:item.numValue
          }
        })
        insReportDto1s:arr
      },{
        headers: {
          'Content-Type': 'application/json'
@@ -279,6 +330,16 @@
        inspectorList:inspectorList,
        ...row
      }
    },
    handleSelectionChange(list,list0){
      list0.forEach(item => {
        let obj = list.find(item0 => item0.id == item.id)
        if(obj){
          item.state = 1
        }else{
          item.state = 0
        }
      })
    }
  }
}