spring
2025-04-10 7a24356ca37e364a1f2474aabb9b3ac2aa0e3831
检验任务-联调起始时间、终止时间
已修改1个文件
94 ■■■■■ 文件已修改
src/views/business/inspectionTask/inspection.vue 94 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/business/inspectionTask/inspection.vue
@@ -323,14 +323,14 @@
                    ">
                      <span v-if="state > 1 || (n.u != userId && n.u != undefined && n.u != '')">{{ n.v.v }}</span>
                      <el-date-picker v-else v-model="n.v.v" type="datetime" placeholder="" format="yyyy-MM-dd HH:mm:ss"
                        value-format="yyyy-MM-dd HH:mm:ss" @change="m => saveInsContext(n.i)">
                        value-format="yyyy-MM-dd HH:mm:ss" @change="(val) => changeTestTime(val, n, 'testStartTime')">
                      </el-date-picker>
                    </template>
                    <template v-else-if="n.v.ps != undefined && n.v.ps.value === '终止时间'
                    ">
                      <span v-if="state > 1 || (n.u != userId && n.u != undefined && n.u != '')">{{ n.v.v }}</span>
                      <el-date-picker v-else v-model="n.v.v" type="datetime" placeholder="" format="yyyy-MM-dd HH:mm:ss"
                        value-format="yyyy-MM-dd HH:mm:ss" @change="m => saveInsContext(n.i)">
                        value-format="yyyy-MM-dd HH:mm:ss" @change="(val) => changeTestTime(val, n, 'testEndTime')">
                      </el-date-picker>
                    </template>
                    <span v-else :style="`font-family:${n.v.ff} !important;`" v-html="getValue(n.v)"></span>
@@ -837,8 +837,8 @@
                equipValue: [],
                equipName: [],
                insResult: null,
                testEndTime: null,
                testStartTime: null,
                testEndTime: [],
                testStartTime: [],
              };
            });
            // 去重模板,返回有几个模板
@@ -993,8 +993,8 @@
            equipValue: [],
            equipName: [],
            insResult: null,
            testEndTime: null,
            testStartTime: null,
            testEndTime: [],
            testStartTime: [],
          };
        });
        if (this.currentSample.index == undefined)
@@ -1562,8 +1562,8 @@
          equipValue: [],
          equipName: [],
          insResult: null,
          testEndTime: null,
          testStartTime: null,
          testEndTime: [],
          testStartTime: [],
        };
      });
      // 处理页面列表数据
@@ -1609,8 +1609,8 @@
              equipValue: [],
              equipName: [],
              insResult: null,
              testEndTime: null,
              testStartTime: null,
              testEndTime: [],
              testStartTime: [],
            };
          });
          this.getTableLists0(list);
@@ -2016,6 +2016,7 @@
          (n) => n.v.ps != undefined && n.v.ps.value === "最终值"
        ); //最终值列表
        a.template.forEach((b) => {
          // console.log(444444, b)
          if (
            b.v.ps != undefined &&
            b.v.ps.value === "序号" &&
@@ -2065,24 +2066,22 @@
            b.i && this.param[b.i] && this.param[b.i].equipName.push(b);
          }
          if (b.v.ps != undefined && b.v.ps.value === "起始时间") {
            this.$set(b.v, "v", "");
            b.u = "";
            this.$set(b.v, "v", '');
            let obj = this.currentSample.insProduct.find(m => m.id == b.i)
            if (obj) {
              this.$set(b, "u", obj.checkUserId);
            }
            // b.v.v = ''
            b.i && this.param[b.i] && (this.param[b.i].testStartTime = b);
            this.param[b.i].testStartTime = []
            b.i && this.param[b.i] && this.param[b.i].testStartTime.push(b);
          }
          if (b.v.ps != undefined && b.v.ps.value === "终止时间") {
            this.$set(b.v, "v", "");
            b.u = "";
            let obj = this.currentSample.insProduct.find(m => m.id == b.i)
            if (obj) {
              this.$set(b, "u", obj.checkUserId);
            }
            // b.v.v = ''
            b.i && this.param[b.i] && (this.param[b.i].testEndTime = b);
            this.param[b.i].testEndTime = []
            b.i && this.param[b.i] && this.param[b.i].testEndTime.push(b);
          }
          if (b.v.ps != undefined && b.v.ps.value === "最终值") {
            // b.v.v = ''
@@ -2225,17 +2224,13 @@
        }
        try {
          // 起始时间赋值
          let testStartTime = JSON.parse(a.insProductResult.testStartTime);
          for (let i = 0; i < testStartTime.length; i++) {
            this.param[a.id].testStartTime.v.v = testStartTime.v;
          }
        } catch (e) { }
          this.$set(this.param[a.id].testStartTime[0].v, 'v', a.insProductResult.testStartTime[0])
        } catch (e) {
        }
        try {
          // 终止时间赋值
          let testEndTime = JSON.parse(a.insProductResult.testEndTime);
          for (let i = 0; i < testEndTime.length; i++) {
            this.param[a.id].testEndTime.v.v = testEndTime.v;
          }
          this.$set(this.param[a.id].testEndTime[0].v, 'v', a.insProductResult.testEndTime[0])
        } catch (e) { }
        try {
          // 最终值赋值
@@ -2436,11 +2431,43 @@
            break;
          // 赋值起始时间
          case "testEndTime":
            this.tableList[0][m] = value ? value.v.v : "";
            if (value && value.length > 0) {
              this.tableList[0].insProductResult[m] = [];
              value.forEach((a, i) => {
                let obj = {
                  v: a.v.v,
                };
                this.tableList[0].insProductResult[m].push(obj);
              });
              try {
                this.tableList[0].insProductResult[m] = JSON.stringify(
                  this.tableList[0].insProductResult[m]
                );
              } catch (error) {
                console.log(888, error);
              }
            }
            // this.tableList[0].insProductResult[m] = value ? value.v.v : "";
            break;
          // 赋值终止时间
          case "testStartTime":
            this.tableList[0][m] = value ? value.v.v : "";
            if (value && value.length > 0) {
              this.tableList[0].insProductResult[m] = [];
              value.forEach((a, i) => {
                let obj = {
                  v: a.v.v,
                };
                this.tableList[0].insProductResult[m].push(obj);
              });
              try {
                this.tableList[0].insProductResult[m] = JSON.stringify(
                  this.tableList[0].insProductResult[m]
                );
              } catch (error) {
                console.log(888, error);
              }
            }
            // this.tableList[0].insProductResult[m] = value ? value.v.v : "";
            break;
          // 赋值最终值
          case "resValue":
@@ -2824,6 +2851,13 @@
        console.log("changeEquip----", e);
      }
    },
    // 起始时间/终止时间保存
    changeTestTime(val, n, type) {
      // this.param[n.i][type]
      // console.log(22222, val, n, type, this.param)
      this.$set(this.param[n.i][type][0].v, 'v', val)
      this.saveInsContext(n.i);
    },
    getAuthorizedPerson() {
      selectUserCondition({ type: 1 }).then((res) => {
        let data = [];
@@ -2890,8 +2924,8 @@
          equipValue: [],
          equipName: [],
          insResult: null,
          testEndTime: null,
          testStartTime: null,
          testEndTime: [],
          testStartTime: [],
        };
      });
      // 页面数据处理