Files
WMS/HHWMS.Web/Areas/Configs/Views/Container/Index.cshtml
T
zhougf d89f6ffb3e feat(PrintConfig): 添加打印模板设计功能并优化相关视图
- 移除TestData字段的Required验证
- 将Template字段从textbox改为textarea以支持多行输入
- 添加打印模板设计界面,支持拖拽元素和自定义纸张
- 新增GetTemplateByName接口用于获取模板
- 优化视图布局,统一使用单列显示
2025-09-27 23:51:10 +08:00

56 lines
2.1 KiB
Plaintext

@model HHWMS.Web.ContainerListVM
@inject IStringLocalizer<Program> Localizer;
<wt:searchpanel vm="@Model" reset-btn="true">
<wt:row items-per-row="ItemsPerRowEnum.Three">
<wt:combobox field="Searcher.ZoneId" items="Searcher.AllZones" empty-text="@Localizer["Sys.All"]" />
<wt:textbox field="Searcher.Code"/>
<wt:combobox field="Searcher.Type" items="ContainerType"/>
<wt:combobox field="Searcher.IsLock"/>
<wt:combobox field="Searcher.Status" items="ContainerStatus"/>
<wt:textbox field="Searcher.LocationCode"/>
<wt:textbox field="Searcher.Length"/>
<wt:textbox field="Searcher.Width"/>
<wt:textbox field="Searcher.Height"/>
</wt:row>
</wt:searchpanel>
<wt:grid vm="@Model" url="/configs/Container/Search"/>
<script>
let template =
{"panels":[{"index":0,"height":30,"width":60,"paperHeader":0,"paperFooter":85.03937007874016,"printElements":[{"options":{"left":10,"top":9,"height":55,"width":145,"title":"code","testData":"C0006","field":"code","fontSize":12,"textAlign":"center","lineHeight":12,"textType":"barcode"},"printElementType":{"type":"text"}}],"paperNumberLeft":140,"paperNumberTop":63,"paperNumberDisabled":true}]}
@*let template = ""
$.ajax({
type: "post",
dataType: "json",
url: "/configs/PrintConfig/GetTemplateByName/",
data:{name:"container"},
success: (json) => {
if (json.Code == 200) {
template = JSON.parse(json.Data.replace(/&quot;/g, '"'))
} else {
layui.layer.msg(json.Msg || '获取模板失败');
}
},
error: (xhr, status, error) => {
layui.layer.msg('获取模板失败:' + error);
}
});*@
let printData = [];
function print(ids, datas) {
datas.forEach(function (value, index, arr) {
printData.push({code: value.Code})
});
hiprint.init();
var hiprintTemplate = new hiprint.PrintTemplate({
template: template
});
hiprintTemplate.print(printData);
printData = [];
}
</script>