<template>
|
<div class="dialog-container">
|
<el-dialog v-dialogDrag :visible.sync="currentVisible" width="1200px" title="余料回库">
|
<el-alert title="余料回库" type="success"></el-alert>
|
<el-table :data="listtableData" stripe style="width: 100%" @selection-change="handleSelectionChange">
|
<el-table-column type="selection" width="55">
|
</el-table-column>
|
<el-table-column prop="productCode" label="物料编号" width="100">
|
</el-table-column>
|
<el-table-column prop="productName" label="物料名称" width="150">
|
</el-table-column>
|
<el-table-column prop="pickUpNum" label="回拣数量" width="110">
|
<!-- <template slot-scope="{$idnex, row, col}">
|
<el-input-number v-model.number="row.pickUpNum" :max="row.validQuantity" controls-position="right" class="w-100" @change="changeEnterQuantity(row, col)"></el-input-number>
|
</template> -->
|
</el-table-column>
|
<el-table-column prop="quantityOrder" label="预出库数量" width="150">
|
</el-table-column>
|
<el-table-column prop="quantityOuted" label="已出货数量" width="150">
|
</el-table-column>
|
<el-table-column prop="weight" label="单位重量" width="150">
|
</el-table-column>
|
<el-table-column prop="totalWeight" label="单位重量" width="150">
|
</el-table-column>
|
<el-table-column prop="batchNumber" label="生产批次" width="150">
|
</el-table-column>
|
</el-table>
|
<div slot="footer" class="dialog-footer">
|
<!-- <el-switch v-model="isSorting" active-color="#13ce66" inactive-color="#ff4949" active-text="是否分拣"></el-switch> -->
|
<el-button @click="currentVisible = false">取 消</el-button>
|
<el-button type="primary" @click="saveCheck">确 定</el-button>
|
</div>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import InputSelect from "@/components/base/InputSelect";
|
export default {
|
name: "picking-reload",
|
components: { InputSelect },
|
props: {
|
// 显示对话框
|
visible: {
|
type: Boolean,
|
default: false,
|
required: true
|
}
|
},
|
data() {
|
return {
|
// 明细数据
|
listtableData: [],
|
isSorting: false,
|
show: false,
|
// 获取验证员
|
creatorlist: [],
|
// 获取货位
|
positionlist: [],
|
creator: "",
|
positionName: "",
|
// 物料属性
|
productnature: "",
|
// 物料属性
|
dropDownList_DestAttr: [
|
{
|
value: "合格",
|
label: "合格"
|
},
|
{
|
value: "冲压待返修",
|
label: "冲压待返修"
|
}
|
],
|
// 当前订单ID
|
order_Id: 0,
|
// 当前仓库ID
|
storage_Id: 0
|
};
|
},
|
computed: {
|
currentVisible: {
|
get: function() {
|
return this.visible;
|
},
|
set: function(val) {
|
this.$emit("update:visible", val);
|
}
|
}
|
},
|
mounted() {
|
this.getCreater();
|
},
|
methods: {
|
// 收货位触发的实践
|
elDropdownSelect(scope, data) {
|
scope.row.shelvePositionName = data;
|
},
|
elDropdownChange(scope, data) {
|
scope.row.shelvePositionName = data;
|
},
|
elDropdownKeyup(scope, data) {
|
try {
|
this.getVagueName(data);
|
if (!data) {
|
scope.row.choosePositionNameArray = scope.row.shelvePositionNameArray.filter(item => {
|
return true;
|
});
|
return;
|
}
|
const filterItems = scope.row.shelvePositionNameArray.filter(item => {
|
if (!item.label) return false;
|
return item.label.indexOf(data) >= 0;
|
});
|
scope.row.choosePositionNameArray = filterItems;
|
} catch (error) {
|
// console.log(error.message);
|
}
|
},
|
// 初始化数据
|
initData(order_Id) {
|
this.order_Id = order_Id;
|
const url = "/api/outbound/order/getBackOrderDetails";
|
const params = {
|
order_Id: order_Id
|
};
|
this.common.ajax(url, params, res => {
|
this.common.showMsg(res);
|
if (res.result) {
|
this.listtableData = res.data.map(row => {
|
row.pickUpNum = parseInt(row.validQuantity);
|
return row;
|
});
|
}
|
});
|
},
|
// 拣选更新提交数据
|
saveCheck() {
|
const the = this;
|
const jsonDetails = this.listtableData.filter(v => v.selected);
|
if (jsonDetails.length === 0) {
|
this.$message.error("请选中一条单据进行回库");
|
return false;
|
}
|
if (jsonDetails.filter(v => v.pickUpNum === 0 && v.selected).length !== 0) {
|
this.$message.error("选中提交的单据数量不能为0");
|
return false;
|
}
|
|
const url = "api/outbound/order/backOrderPc";
|
const params = {
|
order_Id: this.order_Id,
|
jsonDetails: jsonDetails
|
// orderList_Id: jsonDetails[0].orderList_Id
|
};
|
const ref = this.$parent.dataList;
|
var callback = res => {
|
the.common.showMsg(res);
|
if (res.result) {
|
this.listtableData = []; // 重置
|
this.currentVisible = false; // 关闭弹框
|
ref.loadData(); // 刷新
|
}
|
};
|
the.common.ajax(url, params, callback, true);
|
},
|
// 验货员获取用户管理中的用户
|
getCreater() {
|
const url = "/api/sys/user/getList";
|
const params = {};
|
var callback = res => {
|
if (res.result) {
|
this.creatorlist = res.data;
|
}
|
};
|
this.common.ajax(url, params, callback, true);
|
},
|
// 获取当前订单的收货位
|
getPositionName(storage_Id) {
|
const url = "/api/basicInfo/base/position/getPositionName";
|
const params = {
|
storage_Id: storage_Id
|
};
|
var callback = res => {
|
if (res.result) {
|
this.positionlist = res.data.map(item => {
|
item.label = item.positionName;
|
item.value = item.positionName;
|
return item;
|
});
|
}
|
};
|
this.common.ajax(url, params, callback, true);
|
},
|
// 根据仓库和货位名称模糊查询
|
getVagueName(positionName) {
|
const url = "/api/basicInfo/base/position/getVaguePositionName";
|
const params = {
|
storage_Id: this.storage_Id,
|
positionName: positionName
|
};
|
var callback = res => {
|
if (res.result) {
|
this.positionlist = [];
|
this.positionlist = res.data.map(item => {
|
item.label = item.positionName;
|
item.value = item.positionName;
|
return item;
|
});
|
}
|
};
|
this.common.ajax(url, params, callback, true);
|
},
|
handleSelectionChange(val) {
|
this.listtableData.forEach(v => {
|
v.selected = false;
|
});
|
val.forEach(v => {
|
var info = this.listtableData.find(z => z.orderList_Id === v.orderList_Id);
|
if (info) {
|
info.selected = true;
|
}
|
});
|
}
|
}
|
};
|
</script>
|