|
<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>
|