采购订单
This commit is contained in:
1 parent
612c69fa1a
commit
6aeb151982
21 files changed
+881
-65
No files matched your search
@@ -196,6 +196,8 @@
|
||||
height="650" stripe border
|
||||
style="width: 100%"
|
||||
size="small"
|
||||
ref="tableData"
|
||||
v-loading="loading"
|
||||
@@cell-mouse-enter="handleCellEnter"
|
||||
@@cell-mouse-leave="handleCellLeave"
|
||||
@@selection-change="handleSelectionChange">
|
||||
@@ -293,6 +295,7 @@
|
||||
value: 'R',
|
||||
label: 'R'
|
||||
}],
|
||||
loading: false,
|
||||
tableData: [],
|
||||
currentPage: 1, // 当前页码
|
||||
total: 20, // 总条数
|
||||
@@ -340,6 +343,26 @@
|
||||
cell.querySelector('.item__input').style.display = 'none'
|
||||
cell.querySelector('.item__txt').style.display = 'block'
|
||||
}
|
||||
if (property == "THISQTYSTU") {
|
||||
// 库存单位除以系数
|
||||
if (row.THISQTYSTU > row.QTYSTU_0) {
|
||||
row.THISQTYSTU = row.QTYSTU_0;
|
||||
this.$message.error("不能超出单据数量");
|
||||
}
|
||||
else {
|
||||
row.THISQTYUOM = row.THISQTYSTU / row.UOMSTUCOE_0;
|
||||
}
|
||||
}
|
||||
if (property == "THISQTYUOM") {
|
||||
// 采购单位 乘 系数
|
||||
if (row.THISQTYUOM > row.QTYUOM_0) {
|
||||
row.THISQTYUOM = row.QTYUOM_0;
|
||||
this.$message.error("不能超出单据数量");
|
||||
}
|
||||
else {
|
||||
row.THISQTYSTU = row.THISQTYUOM * row.UOMSTUCOE_0;
|
||||
}
|
||||
}
|
||||
},
|
||||
//每页条数改变时触发 选择一页显示多少行
|
||||
handleSizeChange(val) {
|
||||
@@ -354,7 +377,8 @@
|
||||
this.multipleSelection = val;
|
||||
},
|
||||
search() {
|
||||
var _this = this;
|
||||
var _this = this;
|
||||
_this.loading = true;
|
||||
$.ajax({
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
@@ -366,34 +390,60 @@
|
||||
},
|
||||
url: "/xwms/XWMSPOH/Search",
|
||||
success: function (json) {
|
||||
app.tableData = json.Data;
|
||||
_this.tableData = json.Data;
|
||||
_this.loading = false;
|
||||
},
|
||||
error: function (json) {
|
||||
alert("加载失败");
|
||||
this.$message.error("加载失败");
|
||||
}
|
||||
});
|
||||
},
|
||||
create() {
|
||||
var _this = this;
|
||||
$.ajax({
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {
|
||||
data: _this.multipleSelection
|
||||
},
|
||||
url: "/xwms/XWMSPOH/Create",
|
||||
success: function (json) {
|
||||
if (json.Code == 200) {
|
||||
_this.$message({
|
||||
message: "创建成功!"
|
||||
});
|
||||
_this.$refs.multipleTable.clearSelection();
|
||||
_this.$confirm('注意:您确认要对此单据进行创建采购入库吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
//加校验
|
||||
if (_this.verify(_this.multipleSelection)) {
|
||||
_this.$message.error("请选择同一张采购单!");
|
||||
} else {
|
||||
|
||||
|
||||
$.ajax({
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
data: {
|
||||
data: _this.multipleSelection
|
||||
},
|
||||
url: "/xwms/XWMSPOH/Create",
|
||||
success: function (json) {
|
||||
if (json.Code == 200) {
|
||||
_this.$message("创建成功!");
|
||||
_this.$refs.tableData.clearSelection();
|
||||
}
|
||||
else{
|
||||
_this.$message.error("创建失败!" + json.Msg);
|
||||
}
|
||||
},
|
||||
error: function (json) {
|
||||
_this.$message.error("创建失败!");
|
||||
}
|
||||
},
|
||||
error: function (json) {
|
||||
alert("加载失败");
|
||||
});
|
||||
}
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消!'
|
||||
});
|
||||
});
|
||||
|
||||
},
|
||||
verify(array) {
|
||||
const tmp = new Set();
|
||||
array.forEach(x => tmp.add(x.POHNUM_0));
|
||||
return tmp.size > 1 ? true : false;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user