130 lines
4.4 KiB
Plaintext
130 lines
4.4 KiB
Plaintext
<el-row id="opapp">
|
|
<el-card class="box-card" :span="16">
|
|
<el-table :data="tableData" ref="multipleTable" border style="width: 100%" @@selection-change="handleSelectionChange">
|
|
>
|
|
<el-table-column type="selection"
|
|
width="55">
|
|
</el-table-column>
|
|
<el-table-column prop="boxName" label="周转箱" align="center">
|
|
</el-table-column>
|
|
|
|
<el-table-column label="工位" align="center" prop="station">
|
|
<template slot-scope="scope">
|
|
<el-select v-model="scope.row.station" size="medium" style="width:100%">
|
|
<el-option v-for="item in station" :key="item.label" :label="item.label" :value="item.value">
|
|
</el-option>
|
|
</el-select>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table>
|
|
<div style="margin-top: 20px">
|
|
<el-button type="primary" @@click="inOperation()">启动入库</el-button>
|
|
</div>
|
|
</el-card>
|
|
</el-row>
|
|
|
|
<script>
|
|
var app = new Vue({
|
|
el: "#opapp",
|
|
data() {
|
|
return {
|
|
station: [
|
|
{
|
|
label: 'left',
|
|
value: 1,
|
|
},
|
|
{
|
|
label: 'right',
|
|
value: 3,
|
|
},
|
|
|
|
],
|
|
// 表格数据
|
|
tableData: [
|
|
{
|
|
boxName: 'M00000001',
|
|
station: '',
|
|
},
|
|
{
|
|
boxName: 'E00000001',
|
|
station: '',
|
|
},
|
|
],
|
|
selectData: []
|
|
};
|
|
},
|
|
mounted: function () {
|
|
// 获取所有单据编码
|
|
// $.ajax({
|
|
// type: "post",
|
|
// dataType: "json",
|
|
// data:{},
|
|
// url: "/receipt/ReceiptIn/SelectReceiptCode",
|
|
// success: function (json) {
|
|
// app.options = json.Data;
|
|
// },
|
|
// error: function (json) {
|
|
// alert("加载失败");
|
|
// }
|
|
// });
|
|
},
|
|
methods: {
|
|
handleSelectionChange(val) {
|
|
val.forEach(row => {
|
|
if (row.station == '') {
|
|
this.$refs.multipleTable.toggleRowSelection(row);
|
|
this.$message({
|
|
message: "此周转箱没有选择站台!",
|
|
type: "warning",
|
|
duration: "5000",
|
|
});
|
|
}
|
|
});
|
|
this.selectData = val;
|
|
let names = this.selectData.map(item => item["station"]);
|
|
let nameSet = new Set(names);
|
|
|
|
if (nameSet.size != names.length) {
|
|
this.$message({
|
|
message: "站台不能重复!",
|
|
type: "warning",
|
|
duration: "5000",
|
|
});
|
|
this.$refs.multipleTable.clearSelection();
|
|
this.selectData = [];
|
|
}
|
|
console.log(this.selectData);
|
|
},
|
|
// 启动入库
|
|
inOperation() {
|
|
var _this = this;
|
|
if (_this.selectData = []) {
|
|
this.$message({
|
|
message: "必须一行!",
|
|
type: "warning",
|
|
duration: "5000",
|
|
});
|
|
return;
|
|
}
|
|
$.ajax({
|
|
type: "post",
|
|
dataType: "json",
|
|
data: { data: _this.selectData },
|
|
url: "/receipt/ReceiptInOperation/InOperation",
|
|
success: function (json) {
|
|
if (json.Code == 200) {
|
|
_this.$message({
|
|
message: "启动成功!",
|
|
type: "success",
|
|
});
|
|
}
|
|
},
|
|
error: function (json) {
|
|
alert("加载失败");
|
|
}
|
|
});
|
|
}
|
|
}
|
|
});
|
|
</script>
|