haoxuan
2023-10-11 a1a6630f2eabfc78a379b5808b1bf7231a084d0b
工序弹框的 列表和详情的更新同步
2个文件已修改
48 ■■■■■ 已修改文件
src/components/ProcessModel.vue 13 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/ProcessModelDetails.vue 35 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/ProcessModel.vue
@@ -87,7 +87,8 @@
        ref="processDetails"
        :processObj="processObj"
        :listData="listData"
        @renew="renew"
        :activeIndex='activeIndex'
        @updateProcess="updateProcess"
      />
    </div>
    
@@ -126,6 +127,7 @@
      index:null,
      isPage:false,
      isRenew:false,
      activeIndex:'',
    };
  },
  mounted() {
@@ -209,18 +211,27 @@
    },
    updateProcess(item,index){
      this.processObj=item;
      this.activeIndex=index;
      if (this.isLoading[index]) {
        return true;
      }
      this.isLoading[index]=true;
      this.$refs.processDetails.isLoading=true;
      updateProcessParams({procedureId:this.listData.Procedure.ID}).then(res=>{
        if(res.code==200){
          this.isLoading[index]=false;
          this.$refs.processDetails.isLoading=false;
          this.$message.success('更新成功!')
          this.renew();
        }else{
          this.isLoading[index]=false;
          this.$refs.processDetails.isLoading=false;
          this.$refs.processDetails.isUpdate=1;
        }
      })
      setTimeout(()=>{
        this.isLoading[index]=false;
        this.$refs.processDetails.isLoading=false;
      },50000)
    },
    onSubmitTop() {
src/components/ProcessModelDetails.vue
@@ -110,6 +110,12 @@
        return {};
      },
    },
    activeIndex:{
      type:[String,Number],
      default: () => {
        return '';
      },
    }
  },
  data() {
    return {
@@ -132,20 +138,21 @@
      if (this.isLoading) {
        return true;
      }
      this.isLoading=true;
      updateProcessParams({procedureId:this.listData.Procedure.ID}).then(res=>{
        if(res.code==200){
          this.isLoading=false;
          this.$message.success('更新成功!')
          this.$emit('renew')
        }else{
          this.isLoading=false;
          this.isUpdate=1
        }
      })
      setTimeout(()=>{
        this.isLoading=false;
      },50000)
      this.$emit('updateProcess',this.processObj,this.activeIndex)
      // this.isLoading=true;
      // updateProcessParams({procedureId:this.listData.Procedure.ID}).then(res=>{
      //   if(res.code==200){
      //     this.isLoading=false;
      //     this.$message.success('更新成功!')
      //     this.$emit('renew')
      //   }else{
      //     this.isLoading=false;
      //     this.isUpdate=1
      //   }
      // })
      // setTimeout(()=>{
      //   this.isLoading=false;
      // },50000)
    },
    closeClick() {
      this.shutdown();