shj
2022-04-01 323f6a0697eac1c76e42cbc9eab9fba394286e1f
检查清单
已修改2个文件
25 ■■■■■ 文件已修改
src/views/safetyproduction/checklistself.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/safetyproduction/new.vue 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/safetyproduction/checklistself.vue
@@ -12,7 +12,7 @@
            <el-date-picker
              v-model="listQuery.filter.inspectionStartTime"
              type="date"
              format="yyyy 年 MM 月 dd 日"
              format="yyyy-MM-dd"
              placeholder="选择日期"
            >
            </el-date-picker>
src/views/safetyproduction/new.vue
@@ -203,6 +203,11 @@
  },
  created() {
    this.TreeA();
      safetyInspectionItemName().then((res) => {
        if (res.data.code == 200) {
          this.nameList = res.data.result;
        }
      });
    this.id = this.$route.query.name;
    this.itemId = this.$route.query.id;
    this.itemInfo(this.$route.query.id);
@@ -220,12 +225,12 @@
          this.treeList = Array.from(new Set(trees));
          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++){
            var capB = {
                safetySelfInspectionId: "",
                safetyInspectionItemId: "",
              }
              var cser=[]
              for(var j=0;j<arr[i].child.length;j++){
              capB.safetySelfInspectionId=arr[i].child[j].safetySelfInspectionId
              capB.safetyInspectionItemId=arr[i].child[j].safetyInspectionItemId
              cser.push(capB)
@@ -246,7 +251,7 @@
    },
    TreeB(id) {
      safetyInspectionItemTreeB({ id: id }).then((res) => {
        this.list = [];
        // this.list = [];
        if (this.id == "添加") {
          if (res.data.code == 200) {
            this.list = res.data.result;
@@ -281,6 +286,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 = {
@@ -363,28 +369,24 @@
    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;
        // this.lists[i].id;
        for (var j = 0; j < this.lists[i].id.length; j++) {
          arr.push(this.lists[i].id[j]);
        }
      }
      this.form.itemList = arr;
      safetyInspectionItemName().then((res) => {
        if (res.data.code == 200) {
          this.nameList = res.data.result;
        }
      });
    },
      closeDialog(){
        this.dialogVisible = false
          console.log(123,this.form)
      },
    addC() {
       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;
@@ -400,6 +402,7 @@
          }
        });
      } else if (this.id == "编辑") {
        console.log('编辑',this.form)
        safetySelfInspectionMod(this.form).then((res) => {
          this.dialogVisible = false;
          this.$notify({