haoxuan
2024-04-12 8c70602bf7417b48e53464c8c101ece25c40d5b0
src/views/productManage/productRegisterForm/addProductRegisterPage.vue
@@ -124,7 +124,7 @@
                    placeholder="请先选择车间"
                    no-data-text='请先选择车间'
                    class="select-width"
                    @change='getGroupNumber'
                    @change="getGroupNumber(false,'groupNumber')"
                  >
                    <el-option
                      v-for="item in workshopGroupList"
@@ -990,21 +990,25 @@
        }
      });
    },
    getGroupNumber(val){
    getGroupNumber(val,prop){
      if(this.ruleForm.workshopNumber){
        //组别
        getWorkshopManageGroup({number:this.ruleForm.workshopNumber}).then((res) => {
           if (res.code == 200) {
              let workshopGroupList = res.data || {};
              this.workshopGroupList=[]
              this.ruleForm.groupNumber=''
              if(Object.keys(workshopGroupList).length>0){
                for(let i in workshopGroupList){
                  this.workshopGroupList.push(workshopGroupList[i])
                }
                if(prop&&prop!='groupNumber'){
                  this.ruleForm.groupNumber=''
                }
                // 编辑
                if(val){
                  this.$set(this.ruleForm,'groupNumber',this.ruleForm.groupNumber)
                  setTimeout(()=>{
                    this.$set(this.ruleForm,'groupNumber',this.ruleForm.groupNumber)
                  },200)
                }
              }
            }else{