|
@@ -170,6 +170,20 @@
|
|
|
.modal-sheet { width: 100%; max-width: 400px; background: #fff; border-radius: 14px; padding: 18px 18px 20px; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,.12); animation: modalIn .2s ease-out; }
|
|
.modal-sheet { width: 100%; max-width: 400px; background: #fff; border-radius: 14px; padding: 18px 18px 20px; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,.12); animation: modalIn .2s ease-out; }
|
|
|
@keyframes modalIn { from { transform: scale(.96); opacity: .85; } to { transform: scale(1); opacity: 1; } }
|
|
@keyframes modalIn { from { transform: scale(.96); opacity: .85; } to { transform: scale(1); opacity: 1; } }
|
|
|
.modal-head { font-size: 16px; font-weight: 600; margin: 0 0 14px; color: #222; line-height: 1.4; word-break: break-all; }
|
|
.modal-head { font-size: 16px; font-weight: 600; margin: 0 0 14px; color: #222; line-height: 1.4; word-break: break-all; }
|
|
|
|
|
+ .modal-order-meta {
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ flex-wrap: wrap;
|
|
|
|
|
+ gap: 8px 16px;
|
|
|
|
|
+ margin: -4px 0 14px;
|
|
|
|
|
+ padding: 10px 12px;
|
|
|
|
|
+ background: #f7f9fb;
|
|
|
|
|
+ border-radius: 8px;
|
|
|
|
|
+ font-size: 13px;
|
|
|
|
|
+ line-height: 1.5;
|
|
|
|
|
+ }
|
|
|
|
|
+ .modal-order-meta .meta-item { flex: 1 1 40%; min-width: 120px; }
|
|
|
|
|
+ .modal-order-meta .meta-label { color: #888; margin-right: 4px; }
|
|
|
|
|
+ .modal-order-meta .meta-value { color: #222; font-weight: 600; }
|
|
|
.modal-field { margin-bottom: 14px; }
|
|
.modal-field { margin-bottom: 14px; }
|
|
|
.modal-field label,
|
|
.modal-field label,
|
|
|
.modal-field-label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
|
|
.modal-field-label { display: block; font-size: 13px; color: #666; margin-bottom: 6px; }
|
|
@@ -256,7 +270,8 @@
|
|
|
data-amount="{$r.amount|default=''|htmlentities}"
|
|
data-amount="{$r.amount|default=''|htmlentities}"
|
|
|
data-delivery="{$r.delivery|default=''|htmlentities}"
|
|
data-delivery="{$r.delivery|default=''|htmlentities}"
|
|
|
data-title="{$r.CYJMC|default=''|htmlentities}"
|
|
data-title="{$r.CYJMC|default=''|htmlentities}"
|
|
|
- data-ceiling-price="{$r.ceilingPrice|default=''|htmlentities}">
|
|
|
|
|
|
|
+ data-ceiling-price="{$r.ceilingPrice|default=''|htmlentities}"
|
|
|
|
|
+ data-this-quantity="{$r.mproc_this_quantity_display|default=''|htmlentities}">
|
|
|
<p class="title">{$r.CYJMC|default=''}</p>
|
|
<p class="title">{$r.CYJMC|default=''}</p>
|
|
|
<div class="kv">{$r.company_name|default=''|htmlentities}</div>
|
|
<div class="kv">{$r.company_name|default=''|htmlentities}</div>
|
|
|
<div class="kv"><span>订单号</span>{$r.CCYDH|default=''}</div>
|
|
<div class="kv"><span>订单号</span>{$r.CCYDH|default=''}</div>
|
|
@@ -320,6 +335,10 @@
|
|
|
<div class="modal-mask" id="edit-mask" aria-hidden="true">
|
|
<div class="modal-mask" id="edit-mask" aria-hidden="true">
|
|
|
<div class="modal-sheet" id="edit-sheet">
|
|
<div class="modal-sheet" id="edit-sheet">
|
|
|
<p class="modal-head" id="edit-sheet-title">编辑</p>
|
|
<p class="modal-head" id="edit-sheet-title">编辑</p>
|
|
|
|
|
+ <div class="modal-order-meta" id="edit-order-meta">
|
|
|
|
|
+ <div class="meta-item"><span class="meta-label">本次数量</span><span class="meta-value" id="edit-meta-qty">—</span></div>
|
|
|
|
|
+ <div class="meta-item"><span class="meta-label">最高限价</span><span class="meta-value" id="edit-meta-ceil">—</span></div>
|
|
|
|
|
+ </div>
|
|
|
<div class="modal-field">
|
|
<div class="modal-field">
|
|
|
<label for="inp-amount">单价</label>
|
|
<label for="inp-amount">单价</label>
|
|
|
<input type="text" id="inp-amount" inputmode="decimal" autocomplete="off" maxlength="24">
|
|
<input type="text" id="inp-amount" inputmode="decimal" autocomplete="off" maxlength="24">
|
|
@@ -533,7 +552,7 @@
|
|
|
var canEdit = parseInt(r.mproc_can_edit, 10) === 1;
|
|
var canEdit = parseInt(r.mproc_can_edit, 10) === 1;
|
|
|
var ccydh = pick(r, ['CCYDH', 'ccydh']);
|
|
var ccydh = pick(r, ['CCYDH', 'ccydh']);
|
|
|
var cname = pick(r, ['company_name', 'Company_name']);
|
|
var cname = pick(r, ['company_name', 'Company_name']);
|
|
|
- return '<div class="card js-card" data-id="' + eid + '" data-ccydh="' + mprocEscAttr(ccydh) + '" data-amount="' + mprocEscAttr(amtRaw) + '" data-delivery="' + mprocEscAttr(delRaw) + '" data-title="' + mprocEscAttr(tit) + '" data-ceiling-price="' + mprocEscAttr(ceilP) + '">'
|
|
|
|
|
|
|
+ return '<div class="card js-card" data-id="' + eid + '" data-ccydh="' + mprocEscAttr(ccydh) + '" data-amount="' + mprocEscAttr(amtRaw) + '" data-delivery="' + mprocEscAttr(delRaw) + '" data-title="' + mprocEscAttr(tit) + '" data-ceiling-price="' + mprocEscAttr(ceilP) + '" data-this-quantity="' + mprocEscAttr(thisQty) + '">'
|
|
|
+ '<p class="title">' + mprocEsc(tit) + '</p>'
|
|
+ '<p class="title">' + mprocEsc(tit) + '</p>'
|
|
|
+ '<div class="kv">' + mprocEsc(cname) + '</div>'
|
|
+ '<div class="kv">' + mprocEsc(cname) + '</div>'
|
|
|
+ '<div class="kv"><span>订单号</span>' + mprocEsc(pick(r, ['CCYDH', 'ccydh'])) + '</div>'
|
|
+ '<div class="kv"><span>订单号</span>' + mprocEsc(pick(r, ['CCYDH', 'ccydh'])) + '</div>'
|
|
@@ -664,6 +683,8 @@
|
|
|
var dateFieldShell = document.getElementById('date-field-shell');
|
|
var dateFieldShell = document.getElementById('date-field-shell');
|
|
|
var btnSave = document.getElementById('edit-save');
|
|
var btnSave = document.getElementById('edit-save');
|
|
|
var titleEl = document.getElementById('edit-sheet-title');
|
|
var titleEl = document.getElementById('edit-sheet-title');
|
|
|
|
|
+ var editMetaQty = document.getElementById('edit-meta-qty');
|
|
|
|
|
+ var editMetaCeil = document.getElementById('edit-meta-ceil');
|
|
|
var editCeilHint = document.getElementById('edit-ceil-hint');
|
|
var editCeilHint = document.getElementById('edit-ceil-hint');
|
|
|
var currentId = 0; // 当前编辑的 purchase_order_detail 主键
|
|
var currentId = 0; // 当前编辑的 purchase_order_detail 主键
|
|
|
var currentCeilingPrice = ''; // 最高限价(有值时金额不可超过)
|
|
var currentCeilingPrice = ''; // 最高限价(有值时金额不可超过)
|
|
@@ -871,6 +892,11 @@
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ function mprocMetaDisplayText(s) {
|
|
|
|
|
+ var t = String(s == null ? '' : s).trim();
|
|
|
|
|
+ return t !== '' ? t : '—';
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 打开弹窗,从卡片 data-* 带入金额、交期
|
|
// 打开弹窗,从卡片 data-* 带入金额、交期
|
|
|
function openEdit(card) {
|
|
function openEdit(card) {
|
|
|
if (!card) return;
|
|
if (!card) return;
|
|
@@ -878,6 +904,13 @@
|
|
|
if (!id) return;
|
|
if (!id) return;
|
|
|
currentId = id;
|
|
currentId = id;
|
|
|
currentCeilingPrice = String(card.getAttribute('data-ceiling-price') || '').trim();
|
|
currentCeilingPrice = String(card.getAttribute('data-ceiling-price') || '').trim();
|
|
|
|
|
+ var thisQty = String(card.getAttribute('data-this-quantity') || '').trim();
|
|
|
|
|
+ if (editMetaQty) {
|
|
|
|
|
+ editMetaQty.textContent = mprocMetaDisplayText(thisQty);
|
|
|
|
|
+ }
|
|
|
|
|
+ if (editMetaCeil) {
|
|
|
|
|
+ editMetaCeil.textContent = mprocMetaDisplayText(currentCeilingPrice);
|
|
|
|
|
+ }
|
|
|
inpAmount.value = mprocSanitizeAmountValue((card.getAttribute('data-amount') || '').replace(/"/g, '"'));
|
|
inpAmount.value = mprocSanitizeAmountValue((card.getAttribute('data-amount') || '').replace(/"/g, '"'));
|
|
|
inpDelivery.value = deliveryToDateVal(card.getAttribute('data-delivery') || '');
|
|
inpDelivery.value = deliveryToDateVal(card.getAttribute('data-delivery') || '');
|
|
|
mprocRefreshAmountCeilHint();
|
|
mprocRefreshAmountCeilHint();
|
|
@@ -895,6 +928,12 @@
|
|
|
mask.setAttribute('aria-hidden', 'true');
|
|
mask.setAttribute('aria-hidden', 'true');
|
|
|
currentId = 0;
|
|
currentId = 0;
|
|
|
currentCeilingPrice = '';
|
|
currentCeilingPrice = '';
|
|
|
|
|
+ if (editMetaQty) {
|
|
|
|
|
+ editMetaQty.textContent = '—';
|
|
|
|
|
+ }
|
|
|
|
|
+ if (editMetaCeil) {
|
|
|
|
|
+ editMetaCeil.textContent = '—';
|
|
|
|
|
+ }
|
|
|
mprocShowCeilHint('', false);
|
|
mprocShowCeilHint('', false);
|
|
|
}
|
|
}
|
|
|
|
|
|