Răsfoiți Sursa

设施环境配置

shenqilong 7 luni în urmă
părinte
comite
4ba9d8cfa3

+ 270 - 0
src/views/component/fascGuidang/fascGuidang.vue

@@ -0,0 +1,270 @@
+<template>
+  <!-- src\views\system\fasc\guidang.vue -->
+  <div>
+    <div class="reagentChange">
+      <el-row type="flex">
+        <div class="title">实验室环境温湿度要求一览表</div>
+      </el-row>
+      <el-row type="flex">
+        <el-col>
+          <el-table
+            ref="reagent"
+            :data="fascDataFilter"
+            :span-method="spanMethod"
+            border
+            style="border: 1px solid #c0c0c0"
+            :cell-style="{ borderColor: '#C0C0C0' }"
+            :header-cell-style="{
+              background: '#F5F5F5 !important',
+              borderColor: '#C0C0C0'
+            }"
+          >
+            <!-- <el-table-column  type="selection" width="55" /> -->
+            <el-table-column
+              align="center"
+              label="序号"
+              prop="xuHao"
+              width="30"
+            />
+            <el-table-column
+              align="center"
+              label="部门"
+              prop="buMen"
+              width="100"
+            >
+              <template slot-scope="{ row }">
+                <ibps-user-selector
+                  :value="row.buMen"
+                  type="position"
+                  readonly-text="text"
+                  :disabled="true"
+                  :multiple="false"
+                  size="mini"
+                />
+              </template>
+            </el-table-column>
+            <el-table-column
+              align="center"
+              label="区域/监控房间"
+              prop="fangJian"
+              width="100"
+            />
+            <el-table-column
+              align="center"
+              label="控制标准"
+              prop="kongZhiBiaoZhun"
+              width="150"
+            >
+              <template slot-scope="{ row }">
+                <el-input
+                  v-if="!disabled && !nodeIdReadOnly"
+                  v-model="row.kongZhiBiaoZhun"
+                  :autosize="{ minRows: 2, maxRows: 4 }"
+                  type="textarea"
+                  placeholder="请输入"
+                />
+                <span v-else>{{ row.kongZhiBiaoZhun || '/' }}</span>
+              </template></el-table-column
+            >
+            <el-table-column label="试剂/设备" prop="shiJiSheBei" width="150" />
+            <el-table-column
+              label="控制条件"
+              prop="kongZhiTiaoJian"
+              width="150"
+            >
+            </el-table-column>
+            <el-table-column
+              label="监控设备"
+              prop="jianKongSheBei"
+              width="150"
+            />
+            <el-table-column
+              v-if="false"
+              label="房间id"
+              prop="fangJianId"
+              width="150"
+            />
+          </el-table>
+          <el-pagination
+            layout="total,sizes,prev, pager, next,jumper"
+            :current-page="requestPage.pageNo"
+            :page-size="requestPage.limit"
+            :page-sizes="[10, 15, 20, 30, 50, 100]"
+            :total="fascData.length"
+            @size-change="handleSizeChange"
+            @current-change="handleCurrentChange"
+          />
+        </el-col>
+      </el-row>
+    </div>
+  </div>
+</template>
+<script>
+import ibpsUserSelector from '@/business/platform/org/selector'
+export default {
+  components: {
+    ibpsUserSelector
+  },
+  props: {
+    formData: {
+      type: Object,
+      default: () => {}
+    },
+    readonly: {
+      type: Boolean,
+      default: false
+    },
+    params: {
+      type: Object,
+      default: () => {}
+    }
+  },
+  data() {
+    return {
+      fascData: [],
+      disabled: false,
+      nodeIdReadOnly: this.params.nodeId === 'Activity_1itl31w',
+      requestPage: {
+        limit: 20,
+        pageNo: 1
+      },
+      spanArr: {
+        fangJianId: [],
+        buMen: [],
+        kongZhiBiaoZhun: []
+      },
+      pos: {
+        fangJianId: 0,
+        buMen: 0,
+        kongZhiBiaoZhun: 0
+      }
+    }
+  },
+  computed: {
+    fascDataFilter() {
+      const list = this.fascData.slice(
+        (this.requestPage.pageNo - 1) * this.requestPage.limit,
+        (this.requestPage.pageNo - 1) * this.requestPage.limit +
+          this.requestPage.limit
+      )
+      this.getSpanArr(list)
+      return list
+    }
+  },
+  watch: {
+    'formData.syshjwsdyqylb': {
+      handler(value, old) {
+        if (value && value.length) {
+          this.fascData = value
+        }
+        // else {
+        //   this.fascData = []
+        // }
+      },
+      immediate: true
+    },
+    fascData: {
+      handler(value, old) {
+        this.$emit('change-data', 'syshjwsdyqylb', value)
+      },
+      deep: true
+    }
+  },
+  mounted() {},
+  methods: {
+    // 当前页码改变
+    handleCurrentChange(val) {
+      this.requestPage.pageNo = val
+    },
+    // 页码选择器改变
+    handleSizeChange(val) {
+      this.requestPage.limit = val
+      this.requestPage.pageNo = 1
+    },
+    getSpanArr(data) {
+      this.spanArr.fangJianId = []
+      this.spanArr.buMen = []
+      // this.spanArr.kongZhiBiaoZhun = []
+      for (var i = 0; i < data.length; i++) {
+        if (i === 0) {
+          this.spanArr.fangJianId.push(1)
+          this.spanArr.buMen.push(1)
+          this.spanArr.kongZhiBiaoZhun.push(1)
+          this.pos.fangJianId = 0
+          this.pos.buMen = 0
+          // this.pos.kongZhiBiaoZhun = 0
+        } else {
+          // 判断当前元素与上一个元素是否相同
+          if (data[i].fangJianId === data[i - 1].fangJianId) {
+            this.spanArr.fangJianId[this.pos.fangJianId] += 1
+            this.spanArr.fangJianId.push(0)
+          } else {
+            this.spanArr.fangJianId.push(1)
+            this.pos.fangJianId = i
+          }
+
+          if (
+            data[i].buMen === data[i - 1].buMen &&
+            data[i].fangJianId === data[i - 1].fangJianId
+          ) {
+            this.spanArr.buMen[this.pos.buMen] += 1
+            this.spanArr.buMen.push(0)
+          } else {
+            this.spanArr.buMen.push(1)
+            this.pos.buMen = i
+          }
+          // if (data[i].kongZhiBiaoZhun === data[i - 1].kongZhiBiaoZhun) {
+          //   this.spanArr.kongZhiBiaoZhun[this.pos.kongZhiBiaoZhun] += 1
+          //   this.spanArr.kongZhiBiaoZhun.push(0)
+          // } else {
+          //   this.spanArr.kongZhiBiaoZhun.push(1)
+          //   this.pos.kongZhiBiaoZhun = i
+          // }
+        }
+      }
+    },
+    spanMethod({ row, column, rowIndex, columnIndex }) {
+      if (columnIndex === 2) {
+        const _row = this.spanArr.fangJianId[rowIndex]
+        const _col = _row > 0 ? 1 : 0
+        return {
+          rowspan: _row,
+          colspan: _col
+        }
+      }
+      if (columnIndex === 1) {
+        const _row = this.spanArr.buMen[rowIndex]
+        const _col = _row > 0 ? 1 : 0
+        return {
+          rowspan: _row,
+          colspan: _col
+        }
+      }
+      if (columnIndex === 3) {
+        const _row = this.spanArr.fangJianId[rowIndex]
+        const _col = _row > 0 ? 1 : 0
+        return {
+          rowspan: _row,
+          colspan: _col
+        }
+      }
+    }
+  }
+}
+</script>
+<style lang="scss" scoped>
+.reagentChange {
+  margin-bottom: 20px;
+
+  .title {
+    color: #999;
+    font-size: 12px;
+    font-weight: bold;
+    margin-bottom: 0;
+  }
+
+  .exporttable {
+    border: solid 1px #c0c0c0;
+  }
+}
+</style>

+ 12 - 8
src/views/system/fasc/fecDialog.vue

@@ -33,7 +33,7 @@
                 />
               </el-form-item>
             </el-col>
-            <el-col :span="12">
+            <el-col :span="12" v-if="!this.shouldShowColumn('deviceno3_')">
               <el-form-item label="监测岗位:">
                 <template slot="label">
                   <span class="required">监测岗位:</span>
@@ -202,9 +202,9 @@
           </el-row>
           <el-row v-if="shouldShowColumn('deviceno3_')">
             <el-col :span="12">
-              <el-form-item label="被控试剂/耗材编号:" label-width="140">
+              <el-form-item label="被控试剂/耗材:" label-width="140">
                 <template slot="label">
-                  <span class="required">被控试剂/耗材编号:</span>
+                  <span class="required">被控试剂/耗材:</span>
                 </template>
                 <ibps-custom-dialog
                   v-model="form.deviceno1_"
@@ -222,9 +222,9 @@
               </el-form-item>
             </el-col>
             <el-col v-show="form.deviceno1_" :span="12">
-              <el-form-item label="被控试剂/耗材名称:" label-width="140">
+              <el-form-item label="试剂/耗材名称:" label-width="140">
                 <template slot="label">
-                  <span>被控试剂/耗材名称</span>
+                  <span>试剂/耗材名称</span>
                   <el-tooltip
                     effect="dark"
                     content="选择试剂/耗材后自动带出名称"
@@ -237,7 +237,7 @@
               </el-form-item>
             </el-col>
           </el-row>
-          <el-row>
+          <el-row v-if="!shouldShowColumn('deviceno3_')">
             <el-col :span="12">
               <el-form-item label="监测周期:">
                 <template slot="label">
@@ -818,11 +818,15 @@ export default {
       }
       if (
         this.form.jian_ce_ri_qi_ === '' &&
-        this.form.jian_ce_zhou_qi_ !== '按需'
+        this.form.jian_ce_zhou_qi_ !== '按需' &&
+        !this.shouldShowColumn('deviceno3_')
       ) {
         throw new Error('监测日期信息缺失!')
       }
-      if (this.form.jian_ce_gang_wei_ === '') {
+      if (
+        this.form.jian_ce_gang_wei_ === '' &&
+        !this.shouldShowColumn('deviceno3_')
+      ) {
         throw new Error('监测岗位信息缺失!')
       }
       if (this.shouldRequired('deviceno1_') && this.form.deviceno1_ === '') {