入库明细拆分

铁心库打码
This commit is contained in:
zgf committed 2024-01-11 20:32:44 +08:00
1 parent fa7b5814ba
commit d19f62e48b
21 files changed
+513 -93

No files matched your search

@@ -29,8 +29,6 @@
</wt:form>
<script>
function test(val) {
console.log($('#ReceiptDetail2VM_Entity_MaterialName').val());
console.log(val[0].Name);
$('#ReceiptDetail2VM_Entity_MaterialName').val(val[0].Name);
ReceiptDetail2VM_Entity_InventoryStatus.setValue([val[0].ClassA]);
}
@@ -0,0 +1,285 @@
@model HHWMS.Web.ReceiptDetail2VM
@inject IStringLocalizer<Program> Localizer;
<el-row id="PrintDetail">
<el-form :inline="true">
<el-form-item>
<el-input v-model.number="num" placeholder="拆分数量" @@keyup.enter.native="chai()"></el-input>
</el-form-item>
<el-form-item>
<el-input v-model="qty" placeholder="重量" @@keyup.enter.native="splitQty()"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @@click="print">打印</el-button>
</el-form-item>
<el-form-item>
<el-button type="primary" @@click="chaiBill">拆分</el-button>
</el-form-item>
</el-form>
<el-table :data="tableData"
height="600" stripe border
style="width: 100%"
ref="tableData"
v-loading="loading">
<el-table-column type="index"
width="50">
</el-table-column>
<el-table-column label="物料编码" width="150" align="center" prop="MaterialCode"></el-table-column>
<el-table-column label="物料名称" width="150" align="center" prop="MaterialName"></el-table-column>
<el-table-column label="规格" width="150" align="center" prop="Lot"></el-table-column>
<el-table-column label="批次" width="150" align="center" prop="Batch"></el-table-column>
<el-table-column label="数量" width="150" align="center" prop="Qty"></el-table-column>
</el-table>
</el-row>
<script>
var str = "";
@{
<text>str = @Model.Entity.ID</text>
}
var app = new Vue({
el: "#PrintDetail",
data() {
return {
num:'',
qty:'',
loading: false,
tableData: [],
sumQty:0
};
},
mounted: function () {
this.search();
},
methods: {
search() {
var _this = this;
_this.loading = true;
$.ajax({
type: "post",
dataType: "json",
data: {
id: str
},
url: "/xwms/ReceiptDetail2/SearchDetail",
success: function (json) {
_this.tableData = json.Data;
_this.tableData[0].Qty = parseFloat(_this.tableData[0].Qty);
_this.sumQty = json.Data[0].Qty;
_this.loading = false;
},
error: function (json) {
_this.$message.error("加载失败");
_this.loading = false;
}
});
},
splitQty() {
var _this = this;
if (this.qty != "") {
var list = this.qty.split(" ");
// var sum = 0;
// list.forEach(function(val){
// sum += parseFloat(val);
// })
// if (sum != this.sumQty) {
// layer.alert("总数不一致!!", { icon: 5, shadeClose: true, title: "错误信息" });
// }
if (list.length == this.tableData.length) {
var nn = list.length - 1;
while (nn >= 0) {
_this.tableData[nn].Qty = list[nn];
nn--;
}
} else {
layer.alert("数量与表行不一致!!", { icon: 5, shadeClose: true, title: "错误信息" });
}
}
},
chai() {
if (this.num > 1) {
this.tableData[0].Qty = this.sumQty / this.num;
while (this.num > 1) {
this.tableData.push(JSON.parse(JSON.stringify(this.tableData[0])));
this.num--;
}
}
},
chaiBill() {
var _this = this;
$.ajax({
type: "post",
dataType: "json",
data: {
data: _this.tableData
},
url: "/xwms/ReceiptDetail2/ChaiDetail",
success: function (json) {
if (json.Code == 200) {
layer.msg("拆分数据成功");
} else {
layer.alert(json.Msg, { icon: 5, shadeClose: true, title: "错误信息" });
}
},
error: function (json) {
layer.alert("失败", { icon: 5, shadeClose: true, title: "错误信息" });
}
});
}
},
});
let template = {
"panels": [{
"index": 0,
"height": 50,
"width": 80,
"paperHeader": 43.5,
"paperFooter": 141.73228346456693,
"printElements": [{
"options": {
"left": 3,
"top": 3,
"height": 40,
"width": 220,
"field": "lot",
"textAlign": "center",
"textContentVerticalAlign": "middle"
},
"printElementType": {
"type": "text"
}
}, {
"options": {
"left": 3,
"top": 3,
"height": 130,
"width": 220,
"borderWidth": "1.5",
"borderStyle": "solid"
},
"printElementType": {
"type": "rect"
}
}, {
"options": {
"left": 3,
"top": 42,
"height": 9,
"width": 219
},
"printElementType": {
"type": "hline"
}
}, {
"options": {
"left": 135,
"top": 42,
"height": 90,
"width": 9
},
"printElementType": {
"type": "vline"
}
}, {
"options": {
"left": 3,
"top": 43.5,
"height": 28.5,
"width": 132,
"field": "code",
"textAlign": "center",
"textContentVerticalAlign": "middle"
},
"printElementType": {
"type": "text"
}
}, {
"options": {
"left": 150,
"top": 49.5,
"height": 48,
"width": 51,
"textType": "qrcode",
"field": "qrcode",
},
"printElementType": {
"type": "text"
}
}, {
"options": {
"left": 3,
"top": 72,
"height": 9,
"width": 132
},
"printElementType": {
"type": "hline"
}
}, {
"options": {
"left": 3,
"top": 72,
"height": 30,
"width": 132,
"field": "qty",
"textAlign": "center",
"textContentVerticalAlign": "middle"
},
"printElementType": {
"type": "text"
}
}, {
"options": {
"left": 4.5,
"top": 102,
"height": 9,
"width": 217.5
},
"printElementType": {
"type": "hline"
}
}, {
"options": {
"left": 4.5,
"top": 102,
"height": 28.5,
"width": 132,
"field": "batch",
"textAlign": "center",
"textContentVerticalAlign": "middle"
},
"printElementType": {
"type": "text"
}
}],
"paperNumberLeft": 196.5,
"paperNumberTop": 118.5,
"paperNumberDisabled": true
}]
};
let printData = [];
function print() {
app.tableData.forEach(function (value, index, arr) {
printData.push({
lot: value.MaterialName + '|' + value.Lot,
code: value.MaterialCode,
batch: value.Batch,
qty: value.Qty,
qrcode: 'MT.' + value.MaterialCode + '@@@@LT.' + value.Batch + '@@@@QT.' + value.Qty
})
});
hiprint.init();
var hiprintTemplate = new hiprint.PrintTemplate({
template: template
});
hiprintTemplate.print(printData);
printData = [];
}
</script>
@@ -172,7 +172,7 @@
code: value.MaterialCode,
batch: value.Batch,
qty: value.Qty,
qrcode: 'MT.' + value.MaterialCode + '@@@@LT.' + value.Batch
qrcode: 'MT.' + value.MaterialCode + '@@@@LT.' + value.Batch + '@@@@QT.' + value.Qty
})
});
@@ -97,7 +97,7 @@
<el-table-column label="数量" width="150" align="center" prop="Qty" show-overflow-tooltip></el-table-column>
<el-table-column label="出库数量" width="200" align="center" prop="ThisQty">
<div class="item" slot-scope="scope">
<el-input class="item__input" v-model="scope.row.THISQTYUOM" placeholder="请输入内容"></el-input>
<el-input class="item__input" v-model="scope.row.ThisQty" placeholder="请输入内容"></el-input>
<div class="item__txt">{{scope.row.ThisQty}}</div>
</div>
</el-table-column>
@@ -231,21 +231,11 @@
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 == "ThisQty") {
// 库存单位除以系数
if (row.THISQTYSTU > row.QTY) {
row.THISQTYSTU = row.QTY;
layer.alert("不能超出单据数量!!", { icon: 5, shadeClose: true, title: "错误信息" });
if (row.ThisQty > row.QTY) {
row.ThisQty = row.QTY;
layer.alert("不能超出库存数量!!", { icon: 5, shadeClose: true, title: "错误信息" });
}
}
},
@@ -65,6 +65,8 @@
size="small"
ref="tableData"
v-loading="loading"
:highlight-current-row="true"
@@row-click="handleClickTableRow"
@@cell-mouse-enter="handleCellEnter"
@@cell-mouse-leave="handleCellLeave"
@@selection-change="handleSelectionChange">
@@ -135,11 +137,8 @@
label: '不管理'
}],
addressList: [{
value: 'QDB',
label: 'QDB'
}, {
value: 'SBD',
label: 'SBD'
value: 'HYB',
label: 'HYB'
}],
loading: false,
tableData: [],
@@ -209,6 +208,9 @@
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleClickTableRow(row) {
this.$refs.tableData.toggleRowSelection(row)
},
search() {
var _this = this;
_this.loading = true;
+30 -33
View File
@@ -187,6 +187,9 @@
<el-form-item>
<el-input v-model="form.materialcode" placeholder="物料编码"></el-input>
</el-form-item>
<el-form-item>
<el-input v-model="form.ITMDES2_0" placeholder="代号"></el-input>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" @@click="search" circle></el-button>
</el-form-item>
@@ -198,6 +201,8 @@
size="small"
ref="tableData"
v-loading="loading"
:highlight-current-row="true"
@@row-click="handleClickTableRow"
@@cell-mouse-enter="handleCellEnter"
@@cell-mouse-leave="handleCellLeave"
@@selection-change="handleSelectionChange">
@@ -207,31 +212,16 @@
<el-table-column type="selection"
width="55">
</el-table-column>
<el-table-column label="地点" align="center" prop="POHFCY_0"></el-table-column>
@* <el-table-column label="地点" align="center" prop="POHFCY_0"></el-table-column> *@
<el-table-column label="订单日期" width="100" align="center" prop="ORDDAT_0"></el-table-column>
@* <el-table-column label="供应商" align="center" prop="BPSNUM_0"></el-table-column> *@
<el-table-column label="供应商名称" width="150" align="center" prop="BPRNAM_0" show-overflow-tooltip></el-table-column>
<el-table-column label="订单号" width="180" align="center" prop="POHNUM_0"></el-table-column>
<el-table-column label="行号" width="100" align="center" prop="POPLIN_0"></el-table-column>
<el-table-column label="项目号" width="150" align="center" prop="PJT_0"></el-table-column>
<el-table-column label="项目名称" width="150" align="center" prop="PJTNAM_0" show-overflow-tooltip></el-table-column>
<el-table-column label="产品" width="150" align="center" prop="ITMREF_0"></el-table-column>
<el-table-column label="名称" width="150" align="center" prop="ITMDES1_0" show-overflow-tooltip></el-table-column>
<el-table-column label="代号" width="150" align="center" prop="ITMDES2_0" show-overflow-tooltip></el-table-column>
<el-table-column label="数量(采购)" width="100" align="center" prop="QTYUOM_0"></el-table-column>
<el-table-column label="采购单位" width="100" align="center" prop="UOM_0"></el-table-column>
<el-table-column label="采购说明" width="150" align="center" prop="POHITMDES1_0" show-overflow-tooltip></el-table-column>
<el-table-column label="数量" width="100" align="center" prop="QTYSTU_0"></el-table-column>
<el-table-column label="库存单位" width="100" align="center" prop="STU_0"></el-table-column>
<el-table-column label="未收采购数量" width="100" align="center" prop="NRCPQTYPUU_0"></el-table-column>
<el-table-column label="未收库存数量" width="100" align="center" prop="NRCPQTYSTU_0"></el-table-column>
<el-table-column label="本次收量(采购单位)" width="200" align="center" prop="THISQTYUOM">
<div class="item" slot-scope="scope">
<el-input class="item__input" v-model="scope.row.THISQTYUOM" placeholder="请输入内容"></el-input>
<div class="item__txt">{{scope.row.THISQTYUOM}}</div>
</div>
</el-table-column>
<el-table-column label="本次收量(库存单位)" width="200" align="center" prop="THISQTYSTU">
<div class="item" slot-scope="scope">
<el-input class="item__input" v-model="scope.row.THISQTYSTU" placeholder="请输入内容"></el-input>
@@ -250,7 +240,21 @@
<div class="item__txt">{{foodLabel(scope.row.STA_0)}}</div>
</div>
</el-table-column>
<el-table-column label="未收采购数量" width="100" align="center" prop="NRCPQTYPUU_0"></el-table-column>
<el-table-column label="本次收量(采购单位)" width="200" align="center" prop="THISQTYUOM">
<div class="item" slot-scope="scope">
<el-input class="item__input" v-model="scope.row.THISQTYUOM" placeholder="请输入内容"></el-input>
<div class="item__txt">{{scope.row.THISQTYUOM}}</div>
</div>
</el-table-column>
<el-table-column label="数量(采购)" width="100" align="center" prop="QTYUOM_0"></el-table-column>
<el-table-column label="采购单位" width="100" align="center" prop="UOM_0"></el-table-column>
<el-table-column label="采购说明" width="150" align="center" prop="POHITMDES1_0" show-overflow-tooltip></el-table-column>
<el-table-column label="数量" width="100" align="center" prop="QTYSTU_0"></el-table-column>
<el-table-column label="库存单位" width="100" align="center" prop="STU_0"></el-table-column>
<el-table-column label="计量单位/存货单位系数" width="100" align="center" prop="UOMSTUCOE_0" show-overflow-tooltip></el-table-column>
<el-table-column label="项目号" width="150" align="center" prop="PJT_0"></el-table-column>
<el-table-column label="项目名称" width="150" align="center" prop="PJTNAM_0" show-overflow-tooltip></el-table-column>
<el-table-column label="材料" align="center" prop="ITMDES3_0" show-overflow-tooltip></el-table-column>
<el-table-column label="备注" align="center" prop="YITMDES4_0" show-overflow-tooltip></el-table-column>
@@ -276,7 +280,8 @@
address: 'HYB',
billno: '',
supply: '',
materialcode: ''
materialcode: '',
ITMDES2_0:''
},
addressList: [{
value: 'HYB',
@@ -298,7 +303,7 @@
total: 20, // 总条数
pageSize: 20, // 每页的数据条数
// 需要编辑的属性
editProp: ['THISQTYUOM', 'THISQTYSTU', 'STA_0'],
editProp: ['THISQTYSTU', 'STA_0'],
multipleSelection: []
};
},
@@ -344,23 +349,11 @@
}
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;
}
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;
}
row.THISQTYSTU = row.THISQTYUOM * row.UOMSTUCOE_0;
}
},
//每页条数改变时触发 选择一页显示多少行
@@ -375,6 +368,9 @@
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleClickTableRow(row) {
this.$refs.tableData.toggleRowSelection(row)
},
search() {
var _this = this;
_this.loading = true;
@@ -385,7 +381,8 @@
address: _this.form.address,
billno: _this.form.billno,
supply: _this.form.supply,
materialcode: _this.form.materialcode
materialcode: _this.form.materialcode,
ITMDES2_0 : _this.form.ITMDES2_0
},
url: "/xwms/XWMSPOH/Search",
success: function (json) {
@@ -58,6 +58,8 @@
size="small"
ref="tableData"
v-loading="loading"
:highlight-current-row="true"
@@row-click="handleClickTableRow"
@@cell-mouse-enter="handleCellEnter"
@@cell-mouse-leave="handleCellLeave"
@@selection-change="handleSelectionChange">
@@ -194,6 +196,9 @@
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleClickTableRow(row) {
this.$refs.tableData.toggleRowSelection(row)
},
search() {
var _this = this;
_this.loading = true;
@@ -45,6 +45,9 @@
<el-form-item>
<el-input v-model="form.materialcode" placeholder="物料编码"></el-input>
</el-form-item>
<el-form-item>
<el-input v-model="form.ITMDES2_0" placeholder="代号"></el-input>
</el-form-item>
<el-form-item>
<el-button icon="el-icon-search" @@click="search" circle></el-button>
</el-form-item>
@@ -54,13 +57,15 @@
size="small"
ref="tableData"
v-loading="loading"
:highlight-current-row="true"
@@row-click="handleClickTableRow"
@@cell-mouse-enter="handleCellEnter"
@@cell-mouse-leave="handleCellLeave"
@@selection-change="handleSelectionChange">
<el-table-column type="selection"
width="55">
</el-table-column>
<el-table-column label="地点" align="center" prop="FCY_0"></el-table-column>
@* <el-table-column label="地点" align="center" prop="FCY_0"></el-table-column> *@
<el-table-column label="发货日期" width="100" align="center" prop="SHIDAT_0"></el-table-column>
@* <el-table-column label="内部供应商" width="150" align="center" prop="STOFCY_0" show-overflow-tooltip></el-table-column> *@
<el-table-column label="内部供应商名称" width="150" align="center" prop="BPRNAM_0" show-overflow-tooltip></el-table-column>
@@ -69,8 +74,6 @@
<el-table-column label="产品编码" width="180" align="center" prop="ITMREF_0"></el-table-column>
<el-table-column label="名称" width="150" align="center" prop="ITMDES1_0" show-overflow-tooltip></el-table-column>
<el-table-column label="代号" width="150" align="center" prop="ITMDES2_0" show-overflow-tooltip></el-table-column>
<el-table-column label="备注" width="100" align="center" prop="YITMDES4_0" show-overflow-tooltip></el-table-column>
<el-table-column label="材料" width="100" align="center" prop="ITMDES3_0" show-overflow-tooltip></el-table-column>
<el-table-column label="数量" width="100" align="center" prop="QTY_0" show-overflow-tooltip></el-table-column>
<el-table-column label="批次" width="150" align="center" prop="LOT_0"></el-table-column>
<el-table-column label="批次数量" width="100" align="center" prop="QTYSTU_0"></el-table-column>
@@ -86,6 +89,8 @@
<div class="item__txt">{{foodLabel(scope.row.STATUS)}}</div>
</div>
</el-table-column>
<el-table-column label="备注" width="100" align="center" prop="YITMDES4_0" show-overflow-tooltip></el-table-column>
<el-table-column label="材料" width="100" align="center" prop="ITMDES3_0" show-overflow-tooltip></el-table-column>
<el-table-column label="销售单位" width="100" align="center" prop="SAU_0"></el-table-column>
<el-table-column label="采购订单号" width="180" align="center" prop="POHNUM_0"></el-table-column>
<el-table-column label="订单行号" width="100" align="center" prop="POPLIN_0"></el-table-column>
@@ -111,13 +116,18 @@
address: 'HYB',
billno: '',
sbill: '',
materialcode: ''
materialcode: '',
ITMDES2_0:''
},
addressList: [{
value: 'HYB',
label: 'HYB'
}],
options: [{
options: [
{
value: '',
label: '请选择'
}, {
value: 'A',
label: 'A'
}, {
@@ -189,6 +199,9 @@
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleClickTableRow(row) {
this.$refs.tableData.toggleRowSelection(row)
},
search() {
var _this = this;
_this.loading = true;
@@ -199,7 +212,8 @@
address: _this.form.address,
billno: _this.form.billno,
sbill: _this.form.sbill,
materialcode: _this.form.materialcode
materialcode: _this.form.materialcode,
ITMDES2_0: _this.form.ITMDES2_0
},
url: "/xwms/XWMSSHIP/Search",
success: function (json) {
@@ -214,7 +228,7 @@
},
create() {
var _this = this;
_this.$confirm('注意:您确认要对此单据进行创建采购入库吗?', '提示', {
_this.$confirm('注意:您确认要对此单据进行创建内部收货吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
@@ -236,7 +250,6 @@
tmp.push(x.SDHNUM_0)
}
});
console.log(tmp, _this.multipleSelection)
if (tmp.length != _this.multipleSelection.length) {
_this.$message.error("一张收货单必须全部收完!");
return;
@@ -55,6 +55,8 @@
size="small"
ref="tableData"
v-loading="loading"
:highlight-current-row="true"
@@row-click="handleClickTableRow"
@@cell-mouse-enter="handleCellEnter"
@@cell-mouse-leave="handleCellLeave"
@@selection-change="handleSelectionChange">
@@ -177,6 +179,9 @@
handleSelectionChange(val) {
this.multipleSelection = val;
},
handleClickTableRow(row) {
this.$refs.tableData.toggleRowSelection(row)
},
search() {
var _this = this;
_this.loading = true;