licp
2024-09-14 a28a7e0dc8992c39004ad0b34d2624390024f3af
src/components/do/b1-report-preparation/order.vue
@@ -34,7 +34,7 @@
    <el-dialog
      title="生成报告"
      :visible.sync="dialogVisible"
      width="30%"
      width="60%"
      :append-to-body="true"
      :modal="!dialogVisible0"
      >
@@ -44,9 +44,51 @@
          <span>{{ item.laboratory }}</span>
          <!-- <el-checkbox v-model="item.checked"></el-checkbox> -->
        </div>
        <el-radio-group v-model="item.numValue" ref="radio">
        <!-- <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-radio-group> -->
        <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="提交日期"
            width="150">
          </el-table-column>
          <el-table-column
            prop="submitUserName"
            label="提交人"
            width="90">
          </el-table-column>
          <el-table-column
            prop="term"
            label="实验阶段"
            width="120">
          </el-table-column>
          <el-table-column
            prop="note"
            label="实验操作"
            width="120">
          </el-table-column>
          <el-table-column
            prop="tell"
            label="再次检验原因"
            width="120">
          </el-table-column>
          <el-table-column
            fixed="right"
            label="操作"
            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>
      <span slot="footer" class="dialog-footer">
        <el-button :loading="loading0" @click="handleNoCreate">不生成</el-button>
@@ -221,16 +263,26 @@
    },
    // 生成报告
    handleCreate(){
      let arr = []
      this.historyList.forEach(item => {
        item.insOrderUserList.forEach(item1 => {
          if(item1.state==1){
            arr.push({
              laboratory:item.laboratory,
              num:item1.num
            })
          }
        })
      })
      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 +331,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
        }
      })
    }
  }
}