gaoluyang
3 天以前 6ae6ee885f0acb59f4c8b2d2439fb58a0a345701
src/views/business/inspectionTask/inspection.vue
@@ -121,9 +121,6 @@
          </el-radio-group>
        </div>
        <div style="display: flex; align-items: center">
          <el-button v-if="state == 1" size="small" type="primary" @click="openAddUnpass">新增不合格复测</el-button>
          <el-button v-if="state == 1" size="small" type="primary" @click="unpassCheck">不合格复测</el-button>
          <el-button v-if="state > 1" size="small" type="primary" @click="viewUnpassCheck">查看不合格复测</el-button>
          <span v-if="cableTagList.length > 0">&nbsp;&nbsp;电缆配置:</span>
          <el-select v-if="cableTagList.length > 0" v-model="currentTab" clearable placeholder="请选择" size="small"
            @change="(m) => handleChangeCableTag(currentSample.id, 0, 'cableTag', m)
@@ -524,6 +521,7 @@
import { mapGetters } from "@/utils/store-compat";
import viewManHourDia from "@/views/business/inspectionTask/components/viewManHourDia.vue";
import {getDicts} from "@/api/system/dict/data";
import { parseInspectionValueAnnotation, formatInspectionValue } from "@/utils/inspectionValueFormat";
export default {
  name: 'Inspection',
  components: {
@@ -688,7 +686,7 @@
      page: {
        total: 0,
        size: 10,
        current: 0,
        current: 1,
      },
      // 文件列表相关--结束
      // 任务切换列表--开始
@@ -1578,6 +1576,17 @@
    // 检验值输入后触发的函数
    changeInput(m, code, n) {
      if (n) {
        const config = parseInspectionValueAnnotation(n.v && n.v.ps && n.v.ps.value);
        if (config && !config.error && config.decimalPlaces != null && typeof n.v.v === 'string') {
          const numericPattern = config.displayMode === 'SCIENTIFIC'
            ? /^[+-]?(?:\d+\.?\d*|\.\d+)(?:[eE][+-]?\d+)?$/
            : /^[+-]?\d*\.?\d+$/;
          if (n.v.v.trim() && !numericPattern.test(n.v.v.trim())) {
            this.$message.warning('该检验值必须填写数字');
            return;
          }
          n.v.v = formatInspectionValue(n.v.v, config);
        }
        // 定义一个函数来验证分数是否有效
        if (typeof n.v.v == "string") {
          function isValidFraction(fraction) {
@@ -1708,7 +1717,7 @@
        const v = n.v.v;
        // 能力范围已废弃,检验值类型不再作为判断依据。整串只由算式字符组成时才规范化格式,
        // 出现中文等其它字符即按文本处理原样保留,否则文字会被逐字删掉
        if (typeof v !== "string" || /[^\d.^e>>≥≤<<断裂脆化\-/+]/.test(v)) {
        if (typeof v !== "string" || /[^\d.^eE>>≥≤<<断裂脆化\-/+]/.test(v)) {
          return;
        }
        n.v.v = v
@@ -2284,7 +2293,7 @@
/* 当前检验模板的检测条件与检验结论 */
.template-panel {
  background-color: #f8f9fb;
  border: 1px solid #ebeef5;
  border: 1px solid var(--el-border-color-light);
  border-radius: 3px;
  padding: 16px 16px 4px;
  margin-bottom: 12px;
@@ -2304,11 +2313,11 @@
.template-panel__unit {
  margin-left: 4px;
  color: #606266;
  color: var(--lims-text-2);
}
.template-panel__conclusion--divided {
  border-top: 1px dashed #e4e7ed;
  border-top: 1px dashed var(--el-border-color);
  padding-top: 12px;
}
@@ -2487,7 +2496,7 @@
}
.inspection .el-drawer__header {
  color: #303133;
  color: var(--lims-text);
  text-align: left;
}