<template>
  <el-dialog title="调整库存" :visible.sync="dialogVisible" width="500px" @close="cancelSubmit()">
    <div v-loading="loading">
      <el-select v-model="stockType" style="width:100px;display:inline-block;margin-right:10px">
        <el-option label="增加" :value="1"></el-option>
        <el-option label="减少" :value="2"></el-option>
      </el-select>
      <el-input-number v-model="stockData.remainedStock" precision="2" :min="0" :max="999999"  style="width:300px"></el-input-number>
    </div>
    <div slot="footer" class="dialog-footer">
      <el-button @click="cancelSubmit()">取消</el-button>
      <el-button type="primary" @click="submitProNanme()">确认</el-button>
    </div>
  </el-dialog>
</template>

<script>
// import request from '../service/request.js';
export default {
  props: {
    stockData: {
      type: Object,
      default() {
        return {};
      }
    }
  },
  data() {
    return {
      dialogVisible: false,
      loading: false,
      stockType: 1
    };
  },
  mounted() {
    this.dialogVisible = true;
    console.log(this.stockData);
  },
  methods: {
    submitProNanme() {
      this.dialogVisible = false;
      setInterval(() => {
        this.$emit('closeUpdateStock');
      }, 10);
    },
    // 取消修改
    cancelSubmit() {
      this.dialogVisible = false;
      setInterval(() => {
        this.$emit('closeUpdateStock');
      }, 10);
    }
  }
};
</script>
<style scoped></style>
