333
schangxiang@126.com
2025-09-19 18966e02fb573c7e2bb0c6426ed792b38b910940
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
 
<template>
  <el-dialog :visible.sync="currentVisible" title="拆分单据" width="800px">
    <el-form :label-width="formLabelWidth">
      <el-form-item style="width:90%;">
        <el-alert width="90%" title="提示:下面可改变需要拆分到新订单的实际数量。注意:拆单成功后,请及时审核,否则再次同步该订单,会覆盖该订单明细,导致明细重复。" type="info">
        </el-alert>
        <el-table :data="splitDetails" style="width: 100%">
          <el-table-column prop="orderList_Id" label="明细id" width="180">
          </el-table-column>
          <el-table-column prop="productModel" label="条形码" width="180">
          </el-table-column>
          <el-table-column prop="quantity" label="预出库数量">
            <template slot-scope="scope">
              <el-form :model="scope.row">
                <el-form-item prop="login">
                  <el-input v-show="true" v-model="scope.row.quantity" placeholder="请输入拆分数量" />
                </el-form-item>
              </el-form>
            </template>
          </el-table-column>
        </el-table>
      </el-form-item>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="currentVisible=false">取 消</el-button>
      <el-button type="primary" @click="addSplitOrder()">确 定</el-button>
    </div>
  </el-dialog>
</template>
 
<script>
export default {
  props: {
    visible: {
      type: Boolean,
      default: false,
      required: true
    }
  },
  data() {
    return {
      formLabelWidth: "120px", // 弹出框显示的宽度
      // 明细拆分列表
      splitDetails: [],
      // 订单ID
      order_Id: 0
    };
  },
  computed: {
    currentVisible: {
      get: function() {
        return this.visible;
      },
      set: function(val) {
        this.$emit("update:visible", val);
      }
    }
  },
  methods: {
    // 接受预到货单主表信息
    initData(rows, order_Id) {
      this.splitDetails = rows;
      this.order_Id = order_Id;
    },
    // 确认拆分订单
    addSplitOrder() {
      const the = this;
      const productModelList = [];
      let modelInfo = {};
      this.splitDetails.forEach(a => {
        modelInfo = {
          orderList_Id: a.orderList_Id,
          productModel: a.productModel,
          quantity: a.quantity
        };
        productModelList.push(modelInfo);
      });
      this.$confirm("确定要进行拆分操作吗?", "拆分单据", {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        type: "warning"
      })
        .then(() => {
          const url = "/api/inbound/order/splitOrder";
          const params = {
            order_Id: this.order_Id,
            productModelList: productModelList
          };
          // const ref = this.dataList;
          var callback = res => {
            the.common.showMsg(res);
            if (res.result) {
              // this.dataList.reload();
              // this.dialogSplitOrder = false;
              // this.editorOptions.config.visible = false;
              // ref.loadData();
              this.currentVisible = false;
              this.reload();
            }
          };
          the.common.ajax(url, params, callback, true);
        })
        .catch(() => {
          the.$message({
            type: "info",
            message: "已取消"
          });
        });
    },
    reload() {}
  }
};
</script>
 
<style lang="scss" scoped>
.upload-demo {
  text-align: center;
  margin-top: 100px;
}
.download {
  margin: 50px 0px 0px 80px;
  text-decoration: underline;
}
</style>