zuozhengqing
2024-04-11 dd4a1597a35e19078aa580f596418902df0f8c5f
src/views/productManage/productRegisterForm/components/addProductDialog.vue
@@ -4,7 +4,6 @@
    :close-on-click-modal="false"
    :visible.sync="editDialogVisible"
    width="533px"
    append-to-body
    custom-class="add-event-dialog"
    @close="handleClose"
  >
@@ -119,7 +118,7 @@
              <span slot="label">
                <span class="formLabel">净重</span>
              </span>
              <el-input v-model="proForm.netWeight"    @blur="changeTableInput" size="small"></el-input>
              <el-input v-model="proForm.netWeight" @blur="changeTableInput" size="small"></el-input>
            </el-form-item>
          </el-col>
          <el-col :span="20">
@@ -149,15 +148,16 @@
        </el-row>
      </el-form>
    </div>
    <div slot="footer" class="dialog-footer">
    <!-- <div slot="footer" class="dialog-footer"> -->
      <!-- <el-button @click="handleClose" size="mini">取消</el-button>
      <el-button type="primary" @click="onSubmit('form')" size="mini">确定</el-button> -->
    </div>
    <!-- </div> -->
  </el-dialog>
</template>
<script>
import {
  getWorkshopManageGroup,
  changeYieldRegister,
} from "@/api/productManage/productRegisterForm.js";
export default {
  props: { 
@@ -232,28 +232,6 @@
      deep: true,
      immediate:true,
    },
    "form.carNumber": {
      handler() {
        debugger
        this.$set(this.proForm,'carNumber',this.form.carNumber)
      },
      deep: true,
      immediate:true,
    },
    "form.pieceNumber": {
      handler() {
        this.$set(this.proForm,'pieceNumber',this.form.pieceNumber)
      },
      deep: true,
      immediate:true,
    },
    "form.pieces": {
      handler() {
        this.$set(this.proForm,'pieces',this.form.pieces)
      },
      deep: true,
      immediate:true,
    },
    'form.workshopId': function () {
      this.getGroupNumber()
    }
@@ -296,10 +274,30 @@
      }
    },
    changeForm(val){
      this.$emit('changeForm',this.proForm,val)
      if(this.proForm.createTime&&this.proForm.groupNumber&&this.proForm.marketId&&this.proForm.spec&&this.proForm.workshopId){
        changeYieldRegister({
          createTime: this.proForm.createTime,
          groupNumber: this.proForm.groupNumber,
          marketId: this.proForm.marketId,
          spec: this.proForm.spec,
          workshopId: this.proForm.workshopId,
        }).then((res) => {
          if (res.code == 200) {
            if(res.data){
              if(Object.keys(res.data).length>0){
                this.$emit('changeForm',this.proForm,val,res.data)
              }
            }
          }
        });
      }else{
        this.$emit('changeForm',this.proForm,val,{})
      }
    },
    changeTableInput(){
      this.$emit('changeTableInput',this.proForm)
      if(this.proForm.pieces&&this.proForm.carNumber&&this.proForm.pieceNumber){
        this.$emit('changeTableInput',this.proForm)
      }
    },
    handleClose() {
      this.editDialogVisible = false;
@@ -312,6 +310,7 @@
};
</script>
<style lang="scss" scoped>
.add-event-dialog {
  .formLabel {
    font-size: 18px;
@@ -320,6 +319,9 @@
  }
  .dialog-footer {
    background-color: #fff;
  }
  .dialog-content-box{
    margin-top:30px;
  }
}
::v-deep {
@@ -334,7 +336,7 @@
    color: #333;
    // font-weight: 700;
  }
  .add-event-dialog .el-dialog {
  .add-event-dialog.el-dialog {
    position: absolute;
    right: 40px;
    top: 40px;