feat: 预付金模板各 Tab 弹窗标题区分,页面标题去 V2,客户多选保存改为读控件值

- 四个 Tab 的新增/编辑/复制弹窗标题带各自归属(全局/客户/自定义/绑定),
  客户预付金 tab 原与全局同为"编辑默认预付金模板"无法区分
- 列表页 ViewBag.Title 去掉 V2
- 客户多选保存取值改为 $("#ClientId").val()(与兄弟页面读 chosen 一致),
  不再依赖 v-model 同步;编辑态仍走表单对象原绑定客户
This commit is contained in:
hjhan
2026-08-28 10:48:18 +08:00
parent d5993cf024
commit 5f951d33f6
6 changed files with 18 additions and 15 deletions
@@ -51,7 +51,7 @@
@if (pageObj.isAdd)
{
@*新增:客户多选(类似适用簿记账户),保存时按选中客户逐条调用原有单条保存接口*@
<select id="ClientId" class="chosen-select" multiple data-placeholder="请选择客户" style="width:260px;" v-model="selectedClientIds">
<select id="ClientId" class="chosen-select" multiple data-placeholder="请选择客户" style="width:260px;">
<option v-for="item in clientNames" v-bind:value="item.Value">{{item.Text}}</option>
</select>
}
@@ -1,6 +1,6 @@
@using YLErp.Enums;
@{
ViewBag.Title = "预付金模板V2";
ViewBag.Title = "预付金模板";
ViewBag.Menu = "数据管理-预付金模板V2";
Layout = "~/Views/Shared/_MainLayout.cshtml";
}
@@ -70,7 +70,7 @@
function setClientMarginTemplate(id) {
var editurl = "/client_margin_template/client_margin_templateEdit/?id=" + id;
main.infopage("设置客户预付金", editurl, { area: ['1480px', '800px'] });
main.infopage(id ? "编辑客户预付金绑定" : "新增客户预付金绑定", editurl, { area: ['1480px', '800px'] });
}
function deleteClientMarginTemplate(id) {
@@ -1,5 +1,5 @@
@{
ViewBag.Title = "预付金模板V2";
ViewBag.Title = "预付金模板";
ViewBag.Menu = "数据管理-预付金模板V2";
Layout = "~/Views/Shared/_MainLayout.cshtml";
}
@@ -119,13 +119,13 @@
if (id) {
editurl = "/margin_template_v2/margin_template_v2ClientEdit/?enid=" + id;
}
main.infopage("编辑默认预付金模板", editurl, { area: ['1480px', '800px'] });
main.infopage(id ? "编辑客户预付金模板" : "新增客户预付金模板", editurl, { area: ['1480px', '800px'] });
}
function startCopymargin_template_v2(id) {
var editurl = "/margin_template_v2/margin_template_v2ClientCopy/?enid=" + id;
main.infopage("复制默认预付金模板", editurl, { area: ['1480px', '800px'] });
main.infopage("复制客户预付金模板", editurl, { area: ['1480px', '800px'] });
}
function deleteEditmargin_template_v2(id) {
@@ -1,5 +1,5 @@
@{
ViewBag.Title = "预付金模板V2";
ViewBag.Title = "预付金模板";
ViewBag.Menu = "数据管理-预付金模板V2";
Layout = "~/Views/Shared/_MainLayout.cshtml";
}
@@ -127,12 +127,12 @@
if (id) {
editurl = "/margin_template_v2/margin_template_v2DefaultEdit/?enid=" + id;
}
main.infopage("编辑默认预付金模板", editurl, { area: ['1480px', '800px'] });
main.infopage(id ? "编辑全局预付金模板" : "新增全局预付金模板", editurl, { area: ['1480px', '800px'] });
}
function startCopymargin_template_v2(id) {
editurl = "/margin_template_v2/margin_template_v2DefaultCopy/?enid=" + id;
main.infopage("复制默认预付金模板", editurl, { area: ['1480px', '800px'] });
main.infopage("复制全局预付金模板", editurl, { area: ['1480px', '800px'] });
}
function deleteEditmargin_template_v2(id) {
@@ -1,6 +1,6 @@
@using YLErp.Enums;
@{
ViewBag.Title = "预付金模板V2";
ViewBag.Title = "预付金模板";
ViewBag.Menu = "数据管理-预付金模板V2";
Layout = "~/Views/Shared/_MainLayout.cshtml";
}
@@ -134,13 +134,13 @@
if (id) {
editurl = "/margin_template_v2/margin_template_v2Edit/?enid=" + id;
}
main.infopage("编辑预付金模板", editurl, { area: ['1180px', '92%'] });
main.infopage(id ? "编辑自定义预付金模板" : "新增自定义预付金模板", editurl, { area: ['1180px', '92%'] });
}
function startCopymargin_template_v2(id) {
editurl = "/margin_template_v2/margin_template_v2Copy/?enid=" + id;
main.infopage("复制预付金模板", editurl, { area: ['1180px', '92%'] });
main.infopage("复制自定义预付金模板", editurl, { area: ['1180px', '92%'] });
}
function startDeletemargin_template_v2(id) {
@@ -25,8 +25,6 @@ const vue = new Vue({
marginTemplates: page.marginTemplates,
marginTemplate: page.marginTemplate,
clientNames: [],
//新增模式的客户多选(编辑模式仍为单条绑定,走 clientMarginTemplate.ClientId
selectedClientIds: [],
isAdd: page.isAdd
},
created: function () {
@@ -127,7 +125,12 @@ const vue = new Vue({
//当前内容上供修正重试(已成功的客户重试会因同天同结构互斥校验失败,不会重复入库)
saveMarginTemplateV2() {
var thisObj = this;
var ids = this.isAdd ? (this.selectedClientIds || []) : [this.clientMarginTemplate.ClientId];
//取值直接读控件(与兄弟页面读 chosen 的 $("#tradeTypes").val() 一致,不依赖 v-model 同步):
//新增=多选控件 val()(数组);编辑=表单对象上的原绑定客户
var chosenVal = this.isAdd ? $("#ClientId").val() : this.clientMarginTemplate.ClientId;
var ids = this.isAdd
? (Array.isArray(chosenVal) ? chosenVal : (chosenVal ? [chosenVal] : []))
: [chosenVal];
if (!ids.length) {
main.message("请至少选择一个客户");
return;