所有erp单据视图
This commit is contained in:
1 parent
f327041e9a
commit
e2dead6c3f
13 files changed
+864
-77
No files matched your search
@@ -53,6 +53,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">
|
||||
@@ -71,7 +73,12 @@
|
||||
<el-table-column label="材料" width="150" align="center" prop="ITMDES3_0" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="数量" width="100" align="center" prop="QTY_0"></el-table-column>
|
||||
<el-table-column label="未发数量" width="100" align="center" prop="NODLQTY_0"></el-table-column>
|
||||
<el-table-column label="本次发货量" width="100" align="center" prop="THISQTY"></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="150" align="center" prop="STU_0" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="备注" width="150" align="center" prop="YITMDES4_0" show-overflow-tooltip></el-table-column>
|
||||
<el-table-column label="发货地址" width="100" align="center" prop="BPAADD_0"></el-table-column>
|
||||
@@ -106,13 +113,14 @@
|
||||
value: 'SBD',
|
||||
label: 'SBD'
|
||||
}],
|
||||
loading: false,
|
||||
tableData: [],
|
||||
currentPage: 1, // 当前页码
|
||||
total: 20, // 总条数
|
||||
pageSize: 20, // 每页的数据条数
|
||||
multipleSelection: [],
|
||||
// 需要编辑的属性
|
||||
editProp: ['POHFCY_0']
|
||||
editProp: ['THISQTYSTU']
|
||||
};
|
||||
},
|
||||
mounted: function () {
|
||||
@@ -153,6 +161,12 @@
|
||||
cell.querySelector('.item__input').style.display = 'none'
|
||||
cell.querySelector('.item__txt').style.display = 'block'
|
||||
}
|
||||
if (property == "THISQTYSTU") {
|
||||
// 库存单位除以系数
|
||||
if (row.THISQTYSTU > row.NODLQTY_0) {
|
||||
row.THISQTYSTU = row.NODLQTY_0;
|
||||
}
|
||||
}
|
||||
},
|
||||
//每页条数改变时触发 选择一页显示多少行
|
||||
handleSizeChange(val) {
|
||||
@@ -168,6 +182,7 @@
|
||||
},
|
||||
search() {
|
||||
var _this = this;
|
||||
_this.loading = true;
|
||||
$.ajax({
|
||||
type: "post",
|
||||
dataType: "json",
|
||||
@@ -179,34 +194,62 @@
|
||||
},
|
||||
url: "/xwms/XWMSSOH/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/XWMSSOH/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/XWMSSOH/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.SOHNUM_0));
|
||||
return tmp.size > 1 ? true : false;
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user