zouyu
2025-03-18 bc44c8e3c9d85691ce3fa73ef1300a6fae46e365
src/views/business/inspectionOrder/add.vue
@@ -1,9 +1,6 @@
<template>
  <div class="bg-1">
    <div
      v-show="!configShow && !equipConfigShow && !cableConfigShow"
      style="margin: 5px 15px"
    >
    <div style="margin: 5px 15px" v-show="!configShow && !equipConfigShow">
      <el-row class="title">
        <el-col :span="6"
          >委托单信息&nbsp;&nbsp;&nbsp;总价:<span style="color: #3a7bfa"
@@ -80,17 +77,14 @@
            v-show="active == 3 && addObj.companyId"
            >通过</el-button
          >
          <el-button size="medium" @click="$router.go(-1)">
          <el-button size="medium" @click="goBack">
            <span style="color: #3a7bfa">返回</span>
          </el-button>
        </el-col>
      </el-row>
    </div>
    <basic-container>
      <div
        class="search"
        v-show="!configShow && !equipConfigShow && !cableConfigShow"
      >
    <basic-container v-show="!configShow && !equipConfigShow">
      <div class="search">
        <el-form
          :model="addObj"
          :rules="formRule"
@@ -395,7 +389,7 @@
    </basic-container>
    <div
      class="search"
      v-if="active == 1"
      v-if="active == 1 && !configShow && !equipConfigShow"
      style="display: flex; background: transparent"
    >
      <div style="display: flex; align-items: center">
@@ -443,7 +437,7 @@
        </div>
      </div>
    </div>
    <basic-container>
    <basic-container v-show="!configShow && !equipConfigShow">
      <div style="height: auto">
        <el-table
          class="el-table sampleTable"
@@ -909,104 +903,103 @@
    <el-dialog
      title="检验下发"
      :visible.sync="issuedDialogVisible"
      width="400px"
      width="450px"
      :close-on-click-modal="false"
      :close-on-press-escape="false"
      :show-close="false"
    >
      <div class="body" style="max-height: 60vh">
        <el-row>
          <el-col class="search_thing" :span="22">
            <div class="search_label">
              <span class="required-span">* </span>约定时间:
            </div>
            <div class="search_input">
              <el-date-picker
                size="small"
                v-model="distributeData.appointed"
                :picker-options="pickerOptions"
                type="date"
                placeholder="选择日期"
                value-format="yyyy-MM-dd"
                style="width: 100%"
                format="yyyy-MM-dd"
              >
              </el-date-picker>
            </div>
        <el-row style="margin-bottom: 20px">
          <el-col :span="8" style="text-align: right">
            <div><span class="required-span">* </span>约定时间:</div>
          </el-col>
          <el-col class="search_thing" :span="22">
            <div class="search_label">
          <el-col :span="16">
            <el-date-picker
              size="small"
              v-model="distributeData.appointed"
              :picker-options="{ disabledDate: this.disabledDate }"
              type="date"
              placeholder="选择日期"
              value-format="yyyy-MM-dd"
              style="width: 100%"
              format="yyyy-MM-dd"
            >
            </el-date-picker>
          </el-col>
        </el-row>
        <el-row style="margin-bottom: 20px">
          <el-col :span="8" style="text-align: right">
            <div>
              <span class="required-span" v-if="addObj.type == 2">* </span
              >指派人员:
            </div>
            <div class="search_input">
              <el-select
                multiple
                v-model="distributeData.userId"
                placeholder="请选择"
                size="small"
                filterable
                style="width: 100%"
                @change="changeUser"
              >
                <el-option-group
                  v-for="(item, index) in Object.keys(personList)"
                  :key="index"
                  :label="item"
                >
                  <el-option
                    v-for="op in personList[item]"
                    :key="op.id"
                    :label="op.name"
                    :value="op.id"
                  >
                  </el-option>
                </el-option-group>
              </el-select>
            </div>
          </el-col>
          <el-col
            class="search_thing"
            :span="22"
            v-if="distributeData.userId.length > 0"
          >
            <div class="search_label">
              <span class="required-span">* </span>试验室:
            </div>
            <div class="search_input">
              <el-select
                v-model="distributeData.sonLaboratory"
                placeholder="请选择"
                size="small"
                filterable
                style="width: 100%"
          <el-col :span="16">
            <el-select
              multiple
              v-model="distributeData.userId"
              placeholder="请选择"
              size="small"
              filterable
              style="width: 100%"
              @change="changeUser"
            >
              <el-option-group
                v-for="(item, index) in Object.keys(personList)"
                :key="index"
                :label="item"
              >
                <el-option
                  v-for="item in sonLaboratoryList"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value"
                  v-for="op in personList[item]"
                  :key="op.id"
                  :label="op.name"
                  :value="op.id"
                >
                </el-option>
              </el-select>
            </div>
              </el-option-group>
            </el-select>
          </el-col>
          <el-col class="search_thing" :span="22">
            <div class="search_label">
              <span class="required-span">* </span>创建委托单:
            </div>
            <div class="search_input">
              <el-select
                v-model="distributeData.isCreate"
                placeholder="请选择"
                size="small"
                filterable
                style="width: 100%"
        </el-row>
        <el-row
          v-if="distributeData.userId.length > 0"
          style="margin-bottom: 20px"
        >
          <el-col :span="8" style="text-align: right">
            <div><span class="required-span">* </span>试验室:</div>
          </el-col>
          <el-col :span="16">
            <el-select
              v-model="distributeData.sonLaboratory"
              placeholder="请选择"
              size="small"
              filterable
              style="width: 100%"
            >
              <el-option
                v-for="item in sonLaboratoryList"
                :key="item.value"
                :label="item.label"
                :value="item.value"
              >
                <el-option label="是" :value="true"></el-option>
                <el-option label="否" :value="false"></el-option>
              </el-select>
            </div>
              </el-option>
            </el-select>
          </el-col>
        </el-row>
        <el-row style="margin-bottom: 20px">
          <el-col :span="8" style="text-align: right">
            <div><span class="required-span">* </span>创建委托单:</div>
          </el-col>
          <el-col :span="16">
            <el-select
              v-model="distributeData.isCreate"
              placeholder="请选择"
              size="small"
              filterable
              style="width: 100%"
            >
              <el-option label="是" :value="true"></el-option>
              <el-option label="否" :value="false"></el-option>
            </el-select>
          </el-col>
        </el-row>
      </div>
@@ -1022,17 +1015,15 @@
    <el-dialog title="不通过原因" :visible.sync="noDialogVisible" width="400px">
      <div class="body" style="max-height: 60vh">
        <el-row>
          <el-col class="search_thing" :span="22">
            <div class="search_label">
              <span class="required-span">* </span>不通过原因:
            </div>
            <div class="search_input">
              <el-input
                v-model="tell"
                size="small"
                placeholder="请输入不通过原因"
              ></el-input>
            </div>
          <el-col :span="8" style="text-align: right">
            <div><span class="required-span">* </span>不通过原因:</div>
          </el-col>
          <el-col :span="16">
            <el-input
              v-model="tell"
              size="small"
              placeholder="请输入不通过原因"
            ></el-input>
          </el-col>
        </el-row>
      </div>
@@ -1055,7 +1046,7 @@
      :active="active"
      :inspectionItemST="inspectionItemST"
    />
    <fiberOpticConfigTwo
    <fiberOpticConfigReadOnly
      :currentId="currentId"
      v-if="configShow && examine == 1"
      :active="active"
@@ -1065,7 +1056,6 @@
      v-if="equipConfigShow"
      :active="active"
    />
    <cableConfig v-if="cableConfigShow" :active="active" />
    <!--    单选特殊值处理框-->
    <el-dialog
      title="检测到特殊项,请作出以下选择"
@@ -1572,16 +1562,15 @@
import fiberOpticConfig from "./fiberoptic-config.vue";
import fiberOpticConfigReadOnly from "./fiberoptic-config-readonly.vue";
import equipConfig from "./equip-config.vue";
import cableConfig from "./cable-config.vue";
import getLodop from "@/utils/lodop";
import { bigEval } from "@/utils/bigEval";
import { getDicts } from "@/api/system/dict/data";
import Big from "big.js";
export default {
  components: {
    fiberOpticConfig,
    fiberOpticConfigReadOnly,
    equipConfig,
    cableConfig,
  },
  computed: {
    ...mapGetters(["nickName", "loginUserInfo"]),
@@ -1593,14 +1582,6 @@
      examine: 0,
      active: 0,
      currentId: 0,
      pickerOptions: {
        disabledDate(time) {
          // 当前时间加上三天的时间戳
          const threeDaysLater = Date.now() + 24 * 60 * 60 * 1000;
          // 禁用三天后之前的所有日期
          return time.getTime() < threeDaysLater;
        },
      },
      fiberLoss: [],
      qrDataList: [],
      isFocus: false,
@@ -1769,7 +1750,6 @@
      bsm1Dia: false,
      bsm1DiaAll: false,
      equipConfigShow: false,
      cableConfigShow: false,
      bsm2: false,
      bsm2Val: null,
      bsm2Dia: false,
@@ -1887,7 +1867,7 @@
    },
  },
  created() {
    this.active = this.$route.query.active;
    this.active = Number(this.$route.query.active);
    this.currentId = this.$route.query.currentId;
    this.examine = this.$route.query.examine;
    this.isReview = this.$route.query.isReview;
@@ -1934,6 +1914,21 @@
    }
  },
  methods: {
    goBack() {
      let path = this.$route.query.isPlan
        ? "/business/inspectionTask"
        : "/business/inspectionOrder";
      this.$router.push(path);
    },
    //下次核查日期:禁用在核查日期前的日期
    disabledDate(time) {
      if (time) {
        let now = new Date();
        now.setHours(0, 0, 0, 0);
        return time < now.getTime();
      }
      return false;
    },
    changeType(type) {
      this.hasSendUrgentOrder(type)
        .then((res) => {
@@ -2458,10 +2453,9 @@
          let arr1 = [];
          arr0.forEach((m) => {
            let index = code.findIndex((b) => m.includes(b));
            // console.log("index--》", index);
            if (index > -1) {
              let arr = m.split(code[index]).filter((b) => !!b);
              let calcNum = this.$Big(
              let calcNum = new Big(
                bigEval(this.replaceAll(arr[0], symbolItem, value))
              );
              let num = calcNum.toFixed(
@@ -2480,7 +2474,7 @@
          if (index > -1) {
            let arr = ask.split(code[index]).filter((b) => !!b);
            console.log("特殊值替换--》", arr);
            let calcNum = this.$Big(
            let calcNum = new Big(
              bigEval(this.replaceAll(arr[0], symbolItem, value))
            );
            let num = calcNum.toFixed(
@@ -3324,6 +3318,20 @@
          b.id = null;
          delete b.bsmRow;
        });
        if (a.bushing && a.bushing.length > 0) {
          a.bushing.forEach((b) => {
            b.fiber.forEach((c) => {
              c.productList.forEach((d) => {
                d.id = null;
              });
            });
            b.fibers.forEach((c) => {
              c.productList.forEach((d) => {
                d.id = null;
              });
            });
          });
        }
      });
      this.editTable.forEach((item) => {
        sampleList.forEach((a) => {
@@ -3358,7 +3366,7 @@
          if (res.code === 200) {
            this.$message.success("已提交");
            this.bsm3Dia = false;
            this.$router.go(-1);
            this.goBack();
          }
          this.saveLoad = false;
        })
@@ -3369,7 +3377,6 @@
    },
    upInsOrderOfState(state) {
      if (state == 1) {
        //this.saveLoad = true
        this.issuedDialogVisible = true;
        selectOrderManDay({
          id: this.currentId,
@@ -3378,7 +3385,6 @@
            if (res.code === 200) {
              this.distributeData.orderId = this.currentId;
              this.distributeData.appointed = res.data;
              console.log("约定时间", this.distributeData.appointed);
            }
          })
          .catch((error) => {
@@ -3530,7 +3536,7 @@
                this.$message.success("提交成功");
                this.issuedDialogVisible = false;
                this.upLoad = false;
                this.$router.go(-1);
                this.goBack();
                //审核通过后,自动打印二维码
                //TODO: 电力试验室暂时不用标签打印
                if (
@@ -3808,7 +3814,6 @@
      val.forEach((a) => {
        this.productIds.push(a.id);
      });
      console.log("selectChange", this.sampleList);
    },
    rowClick(row, column, event) {
      this.currentMethod = row;
@@ -4622,7 +4627,7 @@
            this.tell = "";
            this.$message.success("提交成功");
            this.issuedDialogVisible = false;
            this.$router.go(-1);
            this.goBack();
          }
        })
        .catch((error) => {
@@ -4695,20 +4700,6 @@
          return;
        }
        this.equipConfigShow = true;
      } else {
        if (this.sampleId === null) {
          this.$message.error("未选中样品");
          return;
        }
      }
    },
    openCableConfig() {
      if (this.active === 1) {
        if (this.sampleIds.length === 0) {
          this.$message.error("未选择样品");
          return;
        }
        this.cableConfigShow = true;
      } else {
        if (this.sampleId === null) {
          this.$message.error("未选中样品");