haoxuan
2024-04-12 db53a1ad9668d7bbada1217c8fa5531fc541d386
产量登记表保存使用车间编码
1个文件已修改
41 ■■■■■ 已修改文件
src/views/productManage/productRegisterForm/addProductRegisterPage.vue 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/productManage/productRegisterForm/addProductRegisterPage.vue
@@ -91,9 +91,9 @@
                </el-form-item>
              </el-col>
              <el-col :span="3">
                <el-form-item label="车间" prop="workshopId">
                <el-form-item label="车间" prop="workshopNumber">
                  <el-select
                    v-model="ruleForm.workshopId"
                    v-model="ruleForm.workshopNumber"
                    placeholder="请选择"
                    class="select-width"
                    @change='getGroupNumber'
@@ -639,7 +639,7 @@
        circle: "",
        marketId: "",
        fallingSilkCocoonNumber: "",
        workshopId: "",
        workshopNumber: "",
        bucketCocoonNumber: "",
        groupNumber: "",
        vehicleSpeed: "",
@@ -672,7 +672,7 @@
        marketId:  [
          { required: true, message: "请选择", trigger:  ["change", "blur"] },
        ],
        workshopId:  [
        workshopNumber:  [
          { required: true, message: "请选择", trigger:  ["change", "blur"] },
        ],
        groupNumber:  [
@@ -710,7 +710,7 @@
        circle: "",
        marketId: "",
        fallingSilkCocoonNumber: "",
        workshopId: "",
        workshopNumber: "",
        bucketCocoonNumber: "",
        groupNumber: "",
        vehicleSpeed: "",
@@ -743,7 +743,7 @@
                  JSON.stringify(response.data ? response.data : {})
                );
                this.ruleForm = config;
                this.$set(this.ruleForm,'workshopId',this.ruleForm.workshopId+'')
                this.$set(this.ruleForm,'workshopNumber',this.ruleForm.workshopNumber+'')
                this.tableDataItems=config.items
                  ? config.items
                  : [];
@@ -792,7 +792,6 @@
          }
        }
      }
      console.log(this.tableData,'==this.tableData')
      this.ruleForm.carNumber=this.tableData.length>0?this.tableData[0].carNumber:''
    },
    // 表格的计算问题
@@ -887,7 +886,7 @@
                  JSON.stringify(data ? data : {})
                );
                this.ruleForm = config;
                this.$set(this.ruleForm,'workshopId',this.ruleForm.workshopId+'')
                this.$set(this.ruleForm,'workshopNumber',this.ruleForm.workshopNumber+'')
                this.tableDataItems=config.items
                  ? config.items
                  : [];
@@ -971,7 +970,7 @@
      }).then((res) => {
        if (res.code == 200) {
          this.nameList = res.data || [];
          this.$set(this.ruleForm,'workshopId',this.ruleForm.workshopId+'')
          this.$set(this.ruleForm,'workshopNumber',this.ruleForm.workshopNumber+'')
        }
      });
      //规格
@@ -992,24 +991,31 @@
      });
    },
    getGroupNumber(val){
      if(this.ruleForm.workshopId){
      if(this.ruleForm.workshopNumber){
        //组别
        getWorkshopManageGroup({number:this.ruleForm.workshopId}).then((res) => {
        getWorkshopManageGroup({number:this.ruleForm.workshopNumber}).then((res) => {
           if (res.code == 200) {
              this.workshopGroupList=[]
              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])
                }
               this.$set(this.ruleForm,'groupNumber',this.ruleForm.groupNumber)
                // 编辑
                if(val){
                  this.$set(this.ruleForm,'groupNumber',this.ruleForm.groupNumber)
                }
              }
            }else{
              this.workshopGroupList=[]
              this.ruleForm.groupNumber=''
            }
          });
          if(this.ruleForm.groupNumber&&this.ruleForm.marketId){
            let workshopName=''
            for(let i in this.nameList){
              if( this.nameList[i].number==this.ruleForm.workshopId){
              if( this.nameList[i].number==this.ruleForm.workshopNumber){
                workshopName= this.nameList[i].name
                break;
              }
@@ -1044,6 +1050,10 @@
               if(val){
                this.getTableEdit()
               }
              }else{
                this.tableData=[]
                this.ruleForm.level=''
                this.ruleForm.carNumber=''
              }
            });
          }
@@ -1079,7 +1089,7 @@
        circle: "",
        marketId: "",
        fallingSilkCocoonNumber: "",
        workshopId: "",
        workshopNumber: "",
        bucketCocoonNumber: "",
        groupNumber: "",
        vehicleSpeed: "",
@@ -1133,7 +1143,6 @@
          form.theorySilkAmount=Number(form.theorySilkAmount)
          form.total=Number(form.total)
          form.vehicleSpeed=Number(form.vehicleSpeed)
          form.workshopId    =Number(form.workshopId)
          for(let i in tableData){
            let listItems1={
              allYield:Number(tableData[i].allYield1)||0, //产量