<template>
|
<div ref="container" class="page-list-container">
|
<!--数据Table-->
|
<yrt-data-list :ref="dataListRef" :editor-ref="editorRef" :data-options="dataOptions" :fields.sync="dataListOptions.fields" :buttons="dataListOptions.buttons" :button-click="buttonClick" :data-list-selections.sync="dataListSelections" :auth-nodes="authNodes">
|
</yrt-data-list>
|
|
<!--数据编辑器Editor-->
|
<yrt-editor :ref="editorRef" :data-list-ref="dataListRef" v-bind="editorOptions" :data-options="dataOptions" :action.sync="editorOptions.action" :visible.sync="editorOptions.config.visible" :detail-button-click="detailButtonClick" :auth-nodes="authNodes"></yrt-editor>
|
</div>
|
</template>
|
|
<script>
|
import baseLayout from "@/components/common/base-layout.vue";
|
|
export default {
|
name: "vsale-orderlist-replenishment",
|
components: {},
|
mixins: [baseLayout],
|
data() {
|
return {};
|
},
|
methods: {
|
// 列表页面按钮点击事件
|
buttonClick(authNode) {
|
switch (authNode) {
|
case "createBill":
|
// 生成补货单
|
this.createBill();
|
return true;
|
}
|
},
|
// 生成补货单
|
createBill() {
|
const the = this;
|
this.$confirm("确定要将选中数据生成补货单吗?", "生成补货单", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning"
|
})
|
.then(() => {
|
// 获得已选中的ID
|
var productModelList = [];
|
var orderIdList = "";
|
var isOK = true;
|
the.dataListSelections.forEach(row => {
|
if (orderIdList) orderIdList += ",";
|
orderIdList += row.orderList_Id;
|
productModelList.push({
|
storage_Id: row.storage_Id,
|
consignor_Id: row.consignor_Id,
|
product_Id: row.product_Id,
|
positionName: row.positionName,
|
billID: row.orderList_Id,
|
billType: "缺货补货",
|
quantity: row.lackStorage
|
});
|
});
|
|
if (!isOK) {
|
return;
|
}
|
if (!orderIdList) {
|
this.$message.error("至少选择一项!");
|
return;
|
}
|
|
const url = "/api/storage/replenishment/storageToReplenishment";
|
const params = {
|
productModelList: productModelList
|
};
|
const ref = this.dataList;
|
var callback = res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
ref.loadData();
|
}
|
};
|
this.common.ajax(url, params, callback, ref);
|
})
|
.catch(() => {
|
the.$message({
|
type: "info",
|
message: "已取消"
|
});
|
});
|
}
|
}
|
};
|
</script>
|