value
2023-08-23 323c2e94f121ee29bee55f1d44a9247232816e1c
src/views/experiment/planAssignments/plan.vue
@@ -44,16 +44,20 @@
<template>
   <div class="plan">
      <div class="title">
         <span>项目名称:</span>
         <el-input v-model="search.name" size="medium" style="width: 200px;margin-right: 20px;"></el-input>
         <span>申请单编号:</span>
         <el-input v-model="search.code" size="medium" style="width: 200px;margin-right: 20px;"></el-input>
         <span>检验时间:</span>
         <el-date-picker v-model="search.date" type="daterange" range-separator="至" start-placeholder="开始日期"
            end-placeholder="结束日期" size="medium" style="margin-right: 20px;">
            end-placeholder="结束日期" size="medium" value-format="yyyy-MM-dd" style="margin-right: 20px;">
         </el-date-picker>
         <span>检验人:</span>
         <el-input v-model="search.userName" size="medium" style="width: 200px;margin-right: 20px;"></el-input>
         <el-button size="small" type="primary">查询</el-button>
         <el-button size="small">重置</el-button>
         <span>检验结果:</span>
         <el-select v-model="search.testValue" size="medium" style="width: 200px;margin-right: 20px;">
            <el-option label="全部" :value="null"></el-option>
            <el-option label="合格" :value="1"></el-option>
            <el-option label="不合格" :value="0"></el-option>
         </el-select>
         <el-button size="small" type="primary" @click="selectDataList">查询</el-button>
         <el-button size="small" @click="cleanBtn">重置</el-button>
      </div>
      <div class="thing">
         <el-table :data="tableData" style="width: 100%;" row-key="code" default-expand-all
@@ -207,9 +211,9 @@
      data() {
         return {
            search: {
               name: null,
               code: null,
               date: [],
               userName: null,
               testValue: null,
            },
            tableData: [],
            upDia: false,
@@ -228,7 +232,16 @@
      },
      methods: {
         selectDataList() {
            get(this.$url.selectAllPlan).then(res => {
            var str = {}
            str.code = this.search.code
            str.status = this.search.testValue
            try {
               if (this.search.date.length != 0) {
                  str.beginTime = this.search.date[0]
                  str.endTime = this.search.date[1]
               }
            } catch (e) {}
            get(this.$url.selectAllPlan, str).then(res => {
               this.tableData = JSON.parse(JSON.stringify(res.data).replaceAll('pid', 'code').replaceAll('samplename',
                  'name').replaceAll('inspectionStatus', 'testState'))
               this.tableData.forEach(a => {
@@ -331,7 +344,7 @@
         submitUpData2() {
            var data = []
            this.upData.testValue.forEach(a => {
               if(a.number!=''&&a.number!=null){
               if (a.number != '' && a.number != null) {
                  data.push(a.number)
               }
            })
@@ -341,15 +354,23 @@
            }).then(res => {
               this.upInsDia = false
               this.selectDataList()
               this.$confirm(`<p style="line-height: 80px">您的项目(${this.upData.name})检验结果为:<span class="${res.data==1?'ins_state_success':'ins_state_error'}">${res.data==1?'合格':'不合格'}</span></p>`, '提交成功', {
                  confirmButtonText: '确定',
                  cancelButtonText: '关闭',
                  dangerouslyUseHTMLString:true,
                  type: `${res.data==1?'success':'error'}`
               }).then(() => {
               }).catch(() => {
               })
               this.$confirm(
                  `<p style="line-height: 80px">您的项目(${this.upData.name})检验结果为:<span class="${res.data==1?'ins_state_success':'ins_state_error'}">${res.data==1?'合格':'不合格'}</span></p>`,
                  '提交成功', {
                     confirmButtonText: '确定',
                     cancelButtonText: '关闭',
                     dangerouslyUseHTMLString: true,
                     type: `${res.data==1?'success':'error'}`
                  }).then(() => {}).catch(() => {})
            })
         },
         cleanBtn(){
            this.search = {
               code: null,
               date: [],
               testValue: null,
            }
            this.selectDataList()
         }
      }
   }