<template>
  <div class="other">
    <el-form label-width="100px" ref="form" :model="form">
      <div class="divider">
        <div class="title">
          <div class="ele-bg-primary"></div>
          <span>工装模具信息</span>
        </div>
        <div class="ele-bg-primary ele-width"></div>
      </div>
      <el-row :gutter="24">
        <el-col :span="8">
          <el-form-item label="收缩系数" prop="shrinkEffictive">
            <el-input
              v-model="form.shrinkEffictive"
              @input="handleInput1"
              placeholder="请输入"
            >
              <template #append>%</template>
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="芯杆数量" prop="coreBarNum">
            <el-input v-model="form.coreBarNum" @input="handleInput2" />
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="模孔数量" prop="dieHoleNum">
            <el-input v-model="form.dieHoleNum" @input="handleInput3">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="上冲头数量" prop="upperPunchNum">
            <el-input v-model="form.upperPunchNum" @input="handleInput4">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="下冲头数量" prop="downPunchNum">
            <el-input v-model="form.downPunchNum" @input="handleInput5">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="最大冲压次数" prop="maxCyTimes">
            <el-input v-model="form.maxCyTimes" @input="handleInput6">
            </el-input>
          </el-form-item>
        </el-col>
        <el-col :span="8">
          <el-form-item label="大模体型号" prop="maxMoldType">
            <el-input v-model="form.maxMoldType"> </el-input>
          </el-form-item>
        </el-col>

        <el-col :span="8">
          <el-form-item label="芯棒直径" prop="mandrelDiameter">
            <el-input v-model="form.mandrelDiameter" @input="handleInput7">
            </el-input>
          </el-form-item>
        </el-col>

        <el-col :span="24">
          <div class="rx-sc">
            <el-form-item label="长" prop="length">
              <el-input v-model="form.length" @input="handleInput8">
                <template slot="append">mm</template>
              </el-input>
            </el-form-item>

            <el-form-item label="宽" prop="breadth">
              <el-input v-model="form.breadth" @input="handleInput9">
                <template slot="append">mm</template>
              </el-input>
            </el-form-item>

            <el-form-item label="高" prop="altitude">
              <el-input v-model="form.altitude" @input="handleInput10">
                <template slot="append">mm</template>
              </el-input>
            </el-form-item>
            <el-form-item label="直径" prop="diameter">
              <el-input v-model="form.diameter" @input="handleInput11">
                <template slot="append">mm</template>
              </el-input>
            </el-form-item>
          </div>
        </el-col>
      </el-row>
    </el-form>
  </div>
</template>

<script>
  export default {
    props: {
      form: {
        type: Object,
        default: {}
      }
    },
    components: {},
    data() {
      return {};
    },

    methods: {
      handleInput1(val) {
        this.form.shrinkEffictive = this.$handleInputPublicHasPoint(val);
      },
      handleInput2(val) {
        this.form.coreBarNum = this.$handleInputPublic(val);
      },
      handleInput3(val) {
        this.form.dieHoleNum = this.$handleInputPublic(val);
      },
      handleInput4(val) {
        this.form.upperPunchNum = this.$handleInputPublic(val);
      },
      handleInput5(val) {
        this.form.downPunchNum = this.$handleInputPublic(val);
      },
      handleInput6(val) {
        this.form.maxCyTimes = this.$handleInputPublic(val);
      },
      handleInput7(val) {
        this.form.mandrelDiameter = this.$handleInputPublicHasPoint(val);
      },
      handleInput8(val) {
        this.form.length = this.$handleInputPublicHasPoint(val);
      },
      handleInput9(val) {
        this.form.breadth = this.$handleInputPublicHasPoint(val);
      },
      handleInput10(val) {
        this.form.altitude = this.$handleInputPublicHasPoint(val);
      },
      handleInput11(val) {
        this.form.diameter = this.$handleInputPublicHasPoint(val);
      }
    }
  };
</script>

<style lang="scss" scoped>
  .other {
    background: #fff;
    padding: 1px 17px;
  }

  .divider {
    margin: 0px 0 20px;

    .title {
      display: flex;
      align-items: center;
      margin-bottom: 10px;

      div {
        width: 8px;
        height: 20px;
        margin-right: 10px;
      }

      span {
        font-size: 20px;
      }
    }

    .ele-width {
      width: 100%;
      height: 2px;
    }
  }

  .form-line {
    display: flex;
    align-items: center;
    justify-content: space-between;

    .line-select {
      margin-left: 15px;
    }
  }

  .spanbox {
    display: inline-block;
    margin-left: 10px;
  }
</style>
