You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

87 lines
2.4 KiB

  1. <template>
  2. <div class="customer-css">
  3. <el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners"
  4. width="220px" style="height: 300px;" class="customer-dialog">
  5. <el-form :inline="true" label-position="top" style="height: 100px;"
  6. label-width="80px">
  7. <!-- 菜单信息 -->
  8. <el-row>
  9. <el-col :span="24" >
  10. <el-form-item :label="'排产数量:'">
  11. <el-input ref="scheduleQty" controls-position="right" v-model="pageData.scheduleQty" min="0"></el-input>
  12. </el-form-item>
  13. </el-col>
  14. </el-row>
  15. </el-form>
  16. <span slot="footer" class="dialog-footer" style="margin-top: -20px;">
  17. <el-button type="primary" @click="addSplitSchedule"> </el-button>
  18. <el-button type="primary" @click="closeDialog">关闭</el-button>
  19. </span>
  20. </el-dialog>
  21. </div>
  22. </template>
  23. <script>
  24. export default {
  25. name: "com_split_schedule",
  26. data() {
  27. return {
  28. titleCon: '分批排产',
  29. pageData: {
  30. site: this.$store.state.user.site,
  31. userName: this.$store.state.user.name,
  32. scheduleQty: 0,
  33. maxScheduleQty: 0
  34. },
  35. }
  36. },
  37. methods: {
  38. /*初始化页面参数*/
  39. init(scheduleRow) {
  40. this.titleCon = '分批排产';
  41. //初始化页面的数据
  42. this.pageData.scheduleQty = scheduleRow.qtyToSchedule;
  43. this.pageData.maxScheduleQty = scheduleRow.qtyToSchedule;
  44. //自动获取焦点
  45. this.$nextTick(() => {
  46. this.$refs.scheduleQty.focus();
  47. });
  48. //什么都不做
  49. },
  50. /*关闭modal*/
  51. closeDialog(){
  52. this.$emit('update:visible', false);
  53. },
  54. /*添加分批排产数据*/
  55. addSplitSchedule(){
  56. //判断排产的数量是否满足条件
  57. let scheduleQty = this.pageData.scheduleQty;
  58. if(scheduleQty <= 0){
  59. this.$message.error('排产数量必须大于0!');
  60. return false;
  61. }
  62. /*判断是否超过最大可排产的数量*/
  63. if(this.pageData.maxScheduleQty < parseFloat(scheduleQty)){
  64. this.$message.error('该订单累计排产数量超过订单数量!');
  65. return false;
  66. }
  67. //关闭当前的组件
  68. this.closeDialog();
  69. //处理结束卷组件的方法
  70. this.$emit('initAddSplitSchedule', this.pageData.scheduleQty);
  71. },
  72. },
  73. created() {
  74. //
  75. }
  76. }
  77. </script>
  78. <style scoped lang="scss">
  79. </style>