所有erp单据视图

This commit is contained in:
zgf committed 2023-12-24 17:58:43 +08:00
1 parent f327041e9a
commit e2dead6c3f
13 files changed
+864 -77

No files matched your search

+68 -21
View File
@@ -56,6 +56,8 @@
<el-table :data="tableData.slice((currentPage-1)*pageSize,currentPage*pageSize)" 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">
@@ -86,7 +88,12 @@
<el-table-column label="库存单位" width="100" align="center" prop="STU_0"></el-table-column>
<el-table-column label="已退货库存数量" align="center" prop="RTNQTYSTU_0" show-overflow-tooltip></el-table-column>
<el-table-column label="收货单存货/采购数量系统" align="center" prop="UOMSTUCOE_0" show-overflow-tooltip></el-table-column>
<el-table-column label="本次退货量(库存单位)" width="100" align="center" prop="THISQTYSTU"></el-table-column>
<el-table-column label="本次退货量(库存单位)" width="100" align="center" prop="THISQTYSTU">
<div class="item" slot-scope="scope">
<el-input class="item__input" v-model="scope.row.THISQTYSTU" placeholder="请输入内容"></el-input>
<div class="item__txt">{{scope.row.THISQTYSTU}}</div>
</div>
</el-table-column>
<el-table-column label="退货量(采购单位)" width="100" align="center" prop="THISQTYUOM"></el-table-column>
</el-table>
<el-pagination align='center'
@@ -119,13 +126,14 @@
value: 'SBD',
label: 'SBD'
}],
loading: false,
tableData: [],
currentPage: 1, // 当前页码
total: 20, // 总条数
pageSize: 20, // 每页的数据条数
multipleSelection: [],
// 需要编辑的属性
editProp: ['POHFCY_0']
editProp: ['THISQTYSTU']
};
},
mounted: function () {
@@ -166,6 +174,16 @@
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;
}
}
},
//每页条数改变时触发 选择一页显示多少行
handleSizeChange(val) {
@@ -181,6 +199,7 @@
},
search() {
var _this = this;
_this.loading = true;
$.ajax({
type: "post",
dataType: "json",
@@ -193,34 +212,62 @@
},
url: "/xwms/XWMSPTH/Search",
success: function (json) {
app.tableData = json.Data;
_this.tableData = json.Data;
_this.loading = false;
},
error: function (json) {
alert("加载失败");
_this.$message.error("加载失败");
_this.loading = false;
}
});
},
create() {
var _this = this;
$.ajax({
type: "post",
dataType: "json",
data: {
data: _this.multipleSelection
},
url: "/xwms/XWMSPTH/Create",
success: function (json) {
if (json.Code == 200) {
_this.$message({
message: "创建成功!"
});
_this.$refs.multipleTable.clearSelection();
}
},
error: function (json) {
alert("加载失败");
_this.$confirm('注意:您确认要对此单据进行创建采购退货吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
//加校验
if (_this.multipleSelection.length == 0) {
_this.$message.error("至少选择一张单据!");
return;
}
if (_this.verify(_this.multipleSelection)) {
_this.$message.error("请选择同一张单据!");
return;
}
$.ajax({
type: "post",
dataType: "json",
data: {
data: _this.multipleSelection
},
url: "/xwms/XWMSPTH/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("创建失败!");
}
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消!'
});
});
},
verify(array) {
const tmp = new Set();
array.forEach(x => tmp.add(x.PTHNUM_0));
return tmp.size > 1 ? true : false;
}
},
});