Files
8357WMS/HHWMS.Web/Areas/XWMS/Views/ReceiptHeader2/Index.cshtml
T
zgf cec65caa32 铁芯打印
入库单明细拆分,打印拆分
出库对账(仓库建使用)
2024-01-14 13:48:13 +08:00

190 lines
6.2 KiB
Plaintext

@model HHWMS.Web.xwms.ViewModels.ReceiptHeader2VMs.ReceiptHeader2ListVM
@inject IStringLocalizer<Program> Localizer;
<wt:searchpanel vm="@Model" reset-btn="true">
<wt:row items-per-row="ItemsPerRowEnum.Three" grid-id="ReceiptHeader2">
<wt:textbox field="Searcher.Code" />
<wt:textbox field="Searcher.Type" />
<wt:textbox field="Searcher.SourceCode" />
<wt:textbox field="Searcher.SupplierName" />
<wt:textbox field="Searcher.UserDef5" />
</wt:row>
</wt:searchpanel>
<wt:grid vm="@Model" id="ReceiptHeader2" url="/xwms/ReceiptHeader2/Search" limit="6" />
<wt:grid vm="@Model.ReceiptDetails" id="ReceiptDetail2" url="/xwms/ReceiptDetail2/Search2" height="400" />
<script>
var headerId = 0;
function details(id) {
headerId = id;
layui.table.reload('ReceiptDetail2', { where: { "Searcher.ReceiptId": id } });
}
function CreateDetail() {
if (headerId == 0) {
layui.layer.alert('请选择一个单据');
}
else {
ff.OpenDialog('/xwms/ReceiptDetail2/Create/' + headerId, '@Guid.NewGuid()', '添加明细', 600);
}
}
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",
"fontFamily": "Microsoft YaHei", "fontSize": 8, "fontWeight": "bold"
},
"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",
"testData": "1324123412341234123",
"textAlign": "center",
"textContentVerticalAlign": "middle",
"fontFamily": "Microsoft YaHei", "fontSize": 12, "fontWeight": "bold"
},
"printElementType": {
"type": "text"
}
}, {
"options": {
"left": 150,
"top": 49.5,
"height": 48,
"width": 51,
"textType": "qrcode",
"field": "qrcode",
"testData": "1234123413234132"
},
"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",
"testData": "5555",
"textAlign": "center",
"textContentVerticalAlign": "middle",
"fontFamily": "Microsoft YaHei", "fontSize": 12, "fontWeight": "bold"
},
"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",
"testData": "HYB2202030003",
"textAlign": "center",
"textContentVerticalAlign": "middle",
"fontFamily": "Microsoft YaHei", "fontSize": 12, "fontWeight": "bold"
},
"printElementType": {
"type": "text"
}
}],
"paperNumberLeft": 196.5,
"paperNumberTop": 118.5,
"paperNumberDisabled": true
}]
};
let printData = [];
function print(ids, datas) {
datas.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>