zouyu
10 天以前 c32f4ff056b564331a2b81f2b6981f8b27dd7aa4
src/views/business/inspectionTask/inspection.vue
@@ -406,24 +406,24 @@
        <el-button :loading="submitLoading" type="primary" @click="submit()">确 定</el-button>
      </span>
    </el-dialog>
     <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false"
    :visible.sync="dataGetDia" title="数据采集" width="80%">
    <div>
      <table border="1" cellpadding="10" class="thermal-table">
        <tr>
          <td style="width: 120px">检验项分类</td>
          <td style="width: 120px">检验项</td>
          <td style="width: 120px">检验子项</td>
          <td>数采数据</td>
        </tr>
        <template v-for="(item, index) in getData">
    <el-dialog :close-on-click-modal="false" :close-on-press-escape="false" :show-close="false"
      :visible.sync="dataGetDia" title="数据采集" width="80%">
      <div>
        <table border="1" cellpadding="10" class="thermal-table">
          <tr>
            <td :rowspan="item.child.length">{{ item.sortName }}</td>
            <td :rowspan="item.child.length">{{ item.faName }}</td>
            <td>{{ item.child[0].name }}</td>
            <td style="text-align: left">
              <!-- 添加容器 div -->
              <div class="data-collection-items">
            <td style="width: 120px">检验项分类</td>
            <td style="width: 120px">检验项</td>
            <td style="width: 120px">检验子项</td>
            <td>数采数据</td>
          </tr>
          <template v-for="(item, index) in getData">
            <tr>
              <td :rowspan="item.child.length">{{ item.sortName }}</td>
              <td :rowspan="item.child.length">{{ item.faName }}</td>
              <td>{{ item.child[0].name }}</td>
              <td style="text-align: left">
                <!-- 添加容器 div -->
                <div class="data-collection-items">
                <el-select v-if="item.child[0].isShowSelect" v-model="item.child[0].getDataIndex1"
                  :multiple-limit="item.child[0].maxNum" clearable filterable multiple placeholder="请选择"
                  @change="setData(item)">
@@ -526,7 +526,6 @@
      :purchaseDialog="purchaseDialog" @resetPurchaseDialog="resetPurchaseDialog"></purchase-verification>
    <!--查看工时弹框-->
    <viewManHourDia ref="viewManHourDia" @submit="openAddVerifyDia"></viewManHourDia>
    <button @click="sss">连接串口</button>
  </div>
</template>
@@ -667,18 +666,10 @@
            {
              name: "1285nm~1330nm",
              arr: [12, 13, 14, 15],
              // 初始化 getDataIndex1 为数组
              getDataIndex1: [],
              isShowSelect: false,
              maxNum: 5
            },
            {
              name: "1525nm~1575nm",
              arr: [12, 13, 14, 15],
              // 初始化 getDataIndex1 为数组
              getDataIndex1: [],
              isShowSelect: false,
              maxNum: 5
            },
          ],
        },
@@ -688,10 +679,6 @@
            {
              name: "截至波长",
              arr: [12, 13, 14, 15],
              // 初始化 getDataIndex1 为数组
              getDataIndex1: [],
              isShowSelect: false,
              maxNum: 5
            },
          ],
        },
@@ -824,7 +811,6 @@
    this.startWorker();
    // this.getList0() // 任务切换
    this.scrollInit();
    disconnect()
  },
  activated() {
    this.getTypeDicts(); // 获取紧急程度下拉框选项
@@ -912,7 +898,7 @@
  },
  methods: {
    sss() {
      console.log(this.$store.state.weightList) //
      console.log(this.$store.state.weightList) //
    },
    // 文件管理--开始
    getList() {
@@ -1201,41 +1187,6 @@
        });
      });
    },
    // getDataAcquisitionDevice() {
    //   if (this.isSerialConnected) {
    //     connect();
    //   }
    //   // return
    //   let itemIds = [];
    //   this.currentSample.insProduct.forEach((item) => {
    //     if (item.inspectionItemType === "1") {
    //       itemIds.push(item.id);
    //     }
    //   });
    //   const params = {
    //     entrustCode: this.insOrder.entrustCode,
    //     sampleCode: this.currentSample.sampleCode,
    //     id: this.currentSample.id,
    //     itemIds: itemIds,
    //   };
    //   this.dataAcquisitionLoading = true;
    //   dataCollection(params).then((res) => {
    //     this.dataAcquisitionLoading = false;
    //     if (res.code != 200) {
    //       return;
    //     }
    //     this.dataAcquisitionInfoNew = this.HaveJson(res.data);
    //     // 对数采回来的值进行处理
    //     this.handleDataAcquisition(res.data);
    //   }).catch(err => {
    //     this.dataAcquisitionLoading = false;
    //   });
    // },
    // 假设存在一个方法用于更新串口连接状态
    // updateSerialConnectionStatus(status) {
    //   this.isSerialConnected = status;
    // },
    objectOrder(obj) {
      let newkey = Object.keys(obj).sort();
      let newObj = {};
@@ -1245,7 +1196,6 @@
      return newObj;
    },
    handleDataAcquisition(data, noDialog) {
      console.log(data);
      // 是否可以编辑数采数据
      if (this.dataAcquisitionEidtAble) {
        this.getDataType = 1;
@@ -1298,7 +1248,6 @@
              };
            }
            let list = this.tableList[0].arr;
            console.log(this.tableList[0]);
            // 循环页面列表信息,判断数采数据对应页面列表信息的检验项是哪个,并给当前检验项绑定设备信息
            list.forEach((item, index) => {
              let num0 = 0;
@@ -1366,7 +1315,6 @@
              }
            };
            let list = this.tableList[0].arr;
            console.log(this.tableList[0]);
            let maxNum = 0;
            list.forEach((item, index) => {
              let num0 = 0;
@@ -1471,7 +1419,6 @@
      } else {
        // 如果都不存在,则,进入处理数采线程里去处理数据
        try {
          console.log(this.dataAcquisitionInfo);
          // 向 Worker 发送消息,开始处理逻辑
          this.getDataIndexLoading = false;
          this.dataGetDia = false;
@@ -3278,11 +3225,11 @@
.data-collection-items {
  display: flex;
  flex-wrap: wrap;
  flex-wrap: wrap;
}
.data-collection-items .el-select,
.data-collection-items .el-checkbox {
  flex-basis: 20% ;
  flex-basis: 20% ;
  box-sizing: border-box;
  padding: 5px 2%;
}