value
2023-08-31 a750f21d3be0da35b3a1ef47905b4bbbeac117e8
src/views/experiment/planAssignments/plan.vue
@@ -44,23 +44,27 @@
<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
            :tree-props="{children: 'children', hasChildren: 'hasChildren'}" :key="upIndex">
            <el-table-column type="index" width="50" label="序号">
            </el-table-column>
            <el-table-column prop="code" label="申请单号" width="200px">
            <el-table-column prop="code" label="申请单号" width="250px">
               <template slot-scope="scope">
                  <div style="display: flex;">
                     <div v-if="scope.row.orderNum=='01'" style="color: #3caaff;background-color: #eff5ff;" class="order_num">
@@ -76,7 +80,7 @@
                  </div>
               </template>
            </el-table-column>
            <el-table-column prop="name" label="名称">
            <el-table-column prop="name" label="名称" width="200px">
            </el-table-column>
            <el-table-column prop="unit" label="单位">
            </el-table-column>
@@ -88,9 +92,9 @@
            </el-table-column>
            <el-table-column prop="checker" label="执行人">
            </el-table-column>
            <el-table-column prop="instrumentname" label="检验日期">
            <el-table-column prop="instrumentname" label="检验设备">
            </el-table-column>
            <el-table-column prop="testState" label="检验状态">
            <el-table-column prop="testState" label="检验状态" width="100px">
               <template slot-scope="scope">
                  <el-tag type="success" v-if="scope.row.testState==1">合格</el-tag>
                  <el-tag type="danger" v-else-if="scope.row.testState==0">不合格</el-tag>
@@ -135,7 +139,7 @@
            <el-button @click="upDia = false">取 消</el-button>
         </span>
      </el-dialog>
      <el-dialog title="检验" :visible.sync="upInsDia" width="500px">
      <el-dialog title="检验" :visible.sync="upInsDia" width="600px">
         <div class="body" style="max-height: 50vh;overflow-y: auto;">
            <el-row style="line-height: 46px;">
               <el-col :span="5" style="font-size: 14px;text-align: right;">申请单编码:</el-col>
@@ -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,16 +344,33 @@
         submitUpData2() {
            var data = []
            this.upData.testValue.forEach(a => {
               data.push(a.number)
               if (a.number != '' && a.number != null) {
                  data.push(a.number)
               }
            })
            wpost(this.$url.check, {
               id: this.upData.code,
               value: data.toString()
            }).then(res => {
               this.$message.success('提交成功')
               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(() => {})
            })
         },
         cleanBtn(){
            this.search = {
               code: null,
               date: [],
               testValue: null,
            }
            this.selectDataList()
         }
      }
   }