lyfO_o
2022-07-12 c562fa2e66f4972ae23fa57ef7412da6e18991ed
src/views/safetyproduction/new.vue
@@ -17,10 +17,10 @@
      </div>
      <div class="box-right" v-if="lists == '' ? false : true">
        <div class="btns">
          <el-button type="primary" class="btn" @click="open(0)"
          <el-button type="primary" class="btn" @click="open(1)"
            >添加</el-button
          >
          <el-button type="primary" class="btn" @click="open(-1)"
          <el-button type="primary" class="btn" @click="open(0)"
            >暂存</el-button
          >
        </div>
@@ -116,6 +116,7 @@
        <el-form-item label="检查人名称" prop="inspector">
          <el-select
            v-model="form.inspector"
            filterable
            style="width: 100%"
            placeholder="请选择"
          >
@@ -225,14 +226,15 @@
            trees.push(this.list.itemList[i].elementA);
          }
          this.treeList = Array.from(new Set(trees));
          var arr = this.checkSameDataA(this.list.itemList);
          var arr = this.checkSameDataA(this.list.itemList);
          for (var i = 0; i < arr.length; i++) {
            var cser=[]
              for(var j=0;j<arr[i].child.length;j++){
              for(var j=0;j<arr[i].child.length;j++){
             var capB = {
                safetySelfInspectionId: "",
                safetyInspectionItemId: "",
              }
              arr[i].child[j].deductionList= arr[i].child[j].selfDeductionList
              capB.safetySelfInspectionId=arr[i].child[j].safetySelfInspectionId
              capB.safetyInspectionItemId=arr[i].child[j].safetyInspectionItemId
              cser.push(capB)
@@ -288,7 +290,7 @@
          if(this.list.length!=0){
          var capA = { elementAName: "", id: [], child: [] };
          var atte = [];
          capA.elementAName = this.list[0].elementAName;
          for (var i = 0; i < this.list.length; i++) {
               var capB = {
@@ -358,7 +360,7 @@
          query: {
            idX: data.safetyInspectionItemId,
            name:this.id,
            id:this.itemId
            id:this.itemId
          },
        });
      } else {
@@ -367,7 +369,7 @@
          query: {
            idX: data.id,
            name:this.id,
            id:this.itemId
            id:this.itemId
          },
        });
      }
@@ -375,7 +377,6 @@
    open(type) {
      this.dialogVisible = true;
      this.form.status = type;
      console.log("xxxxx",this.lists)
      var arr = [];
      for (var i = 0; i < this.lists.length; i++) {
        // this.lists[i].id;
@@ -392,7 +393,6 @@
       this.$refs["form"].validate((valid) => {
        if (valid) {
      if (this.id == "添加") {
        console.log("添加",this.form)
        safetySelfInspectionAdd(this.form).then((res) => {
          if (res.data.code == 200) {
            this.dialogVisible = false;
@@ -403,12 +403,11 @@
              title: "成功",
            });
            this.$router.push({
              path:"/checklistself"
              path:"/safetyproduction/safetyproduction/checklistself"
            });
          }
        });
      } else if (this.id == "编辑") {
        console.log('编辑',this.form)
        safetySelfInspectionMod(this.form).then((res) => {
          this.dialogVisible = false;
          this.$notify({
@@ -419,7 +418,7 @@
          });
        });
         this.$router.push({
              path:"/checklistself"
              path:"/safetyproduction/safetyproduction/checklistself"
            });
      }
         }