<template>
  <el-dialog :title="comIsEntityMaterials ?  '推送到物资用量' : '推送工程量'" :visible.sync="pushProjectUseDialog" width="480px" class="push-project-use-dialog"
    @close="dialogClose">
    <div class="dialog-body-content">
      <el-form :model="pushForm" ref="pushForm" :rules="rules">
        <el-form-item label="分包项目名称">
          <el-input v-model="form.projectName"></el-input>
        </el-form-item>
      </el-form>
    </div>
  </el-dialog>
</template>
<script>
export default {
  name: "pushProjectUseDialog",
  model: {
    prop: "pushProjectUseDialog",
    event: "close"
  },
  props: {
    pushProjectUseDialog: {
      type: Boolean,
      default: false
    },
    isEntityMaterials: {
      type: Boolean,
      default: false
    },
    rowData: {
      type: Object,
      default: () => ({})
    }
  },
  watch: {
    pushProjectUseDialog: {
      handler(newValue, oldValue) {
        this.comPushProjectUseDialog = newValue;
      }
    },
    comIsEntityMaterials: {
      handler(newValue, oldValue) {
        this.comIsEntityMaterials = newValue;
      }
    },
    rowData: {
      handler(newValue, oldValue) {
        const _temp = newValue ? newValue : {};
        this.pushForm = { ...this.pushForm, ..._temp };
      }
    }
  },
  data() {
    return {
      comIsEntityMaterials: this.isEntityMaterials,
      comPushProjectUseDialog: this.pushProjectUseDialog,
      pushForm: {
        id: "",
        pushQuantities: "",
        ipmProjectCode: "",
        ipmContractCode: "",
        ipmBizCode: ""
      },
      rules: {

      }
    };
  },
  //可访问data属性
  created() {

  },
  //计算集
  computed: {

  },
  //方法集
  methods: {
    dialogClose() {
      this.$emit("close", false);
    }
  },
}
</script>
<style lang="scss" scoped>
.push-project-use-dialog {
  ::v-deep .el-dialog {
    margin-top: 0px !important;
    margin: 0px;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);

    .el-dialog__header {
      height: 56px;
      padding: 0px 20px;
      display: flex;
      align-items: center;
      justify-content: space-between;
      border-bottom: 1px solid #eeeeee;
      border-top-left-radius: 4px;
      border-top-right-radius: 4px;

      .el-dialog__title {
        color: #232323;
        font-size: 16px;
        font-weight: bold;
      }

      .el-dialog__headerbtn {
        position: static;
        width: 16px;
        height: 16px;
      }
    }

    .el-dialog__body {
      padding: 0px;

      .dialog-body-content {
        padding: 24px 20px;
        box-sizing: border-box;
      }
    }
  }
}
</style>
