|
@@ -63,29 +63,47 @@
|
|
|
}
|
|
}
|
|
|
.toolbar .btn-search { background: #3c8dbc; color: #fff; }
|
|
.toolbar .btn-search { background: #3c8dbc; color: #fff; }
|
|
|
.toolbar .btn-add { background: #27ae60; color: #fff; }
|
|
.toolbar .btn-add { background: #27ae60; color: #fff; }
|
|
|
|
|
+ .order-body {
|
|
|
|
|
+ position: relative;
|
|
|
|
|
+ display: flex; align-items: stretch;
|
|
|
|
|
+ flex: 1 1 0%; min-height: 0; overflow: hidden;
|
|
|
|
|
+ }
|
|
|
|
|
+ .rfq-side {
|
|
|
|
|
+ width: 78px; flex-shrink: 0; align-self: stretch;
|
|
|
|
|
+ background: #fff; border-right: 1px solid #e5e5e5;
|
|
|
|
|
+ padding: 6px 0 8px; overflow-y: auto; -webkit-overflow-scrolling: touch;
|
|
|
|
|
+ z-index: 1;
|
|
|
|
|
+ }
|
|
|
|
|
+ .rfq-side .rfq-cat {
|
|
|
|
|
+ display: block; width: 100%; padding: 12px 4px; border: none;
|
|
|
|
|
+ background: transparent; font-size: 13px; color: #666; cursor: pointer;
|
|
|
|
|
+ text-align: center; font-family: inherit; line-height: 1.35;
|
|
|
|
|
+ -webkit-tap-highlight-color: transparent;
|
|
|
|
|
+ }
|
|
|
|
|
+ .rfq-side .rfq-cat.active {
|
|
|
|
|
+ color: #3c8dbc; font-weight: 600; background: #f0f7fb;
|
|
|
|
|
+ box-shadow: inset 3px 0 0 #3c8dbc;
|
|
|
|
|
+ }
|
|
|
.list-wrap {
|
|
.list-wrap {
|
|
|
- flex: 1 1 0%; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
|
|
|
|
|
- padding: 10px 12px 20px;
|
|
|
|
|
|
|
+ position: absolute; top: 0; right: 0; bottom: 0; left: 78px;
|
|
|
|
|
+ overflow-y: auto; -webkit-overflow-scrolling: touch;
|
|
|
|
|
+ padding: 10px 12px 20px; background: #f5f5f5;
|
|
|
}
|
|
}
|
|
|
.card {
|
|
.card {
|
|
|
background: #fff; border-radius: 10px; padding: 12px 14px;
|
|
background: #fff; border-radius: 10px; padding: 12px 14px;
|
|
|
margin-bottom: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.06);
|
|
margin-bottom: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.06);
|
|
|
}
|
|
}
|
|
|
- .card .ord { font-size: 15px; font-weight: 700; color: #222; line-height: 1.4; word-break: break-all; }
|
|
|
|
|
|
|
+ .card .ord {
|
|
|
|
|
+ font-size: 15px; font-weight: 700; color: #222; line-height: 1.4; word-break: break-all;
|
|
|
|
|
+ }
|
|
|
.card .meta { margin-top: 8px; font-size: 13px; color: #555; line-height: 1.55; }
|
|
.card .meta { margin-top: 8px; font-size: 13px; color: #555; line-height: 1.55; }
|
|
|
.card .meta b { color: #888; font-weight: 500; }
|
|
.card .meta b { color: #888; font-weight: 500; }
|
|
|
.card .tags {
|
|
.card .tags {
|
|
|
margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px 10px;
|
|
margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px 10px;
|
|
|
- font-size: 12px; color: #666; align-items: center;
|
|
|
|
|
|
|
+ font-size: 12px; color: #666; align-items: center; justify-content: flex-end;
|
|
|
}
|
|
}
|
|
|
- .card .progress {
|
|
|
|
|
- display: inline-block; padding: 2px 8px; border-radius: 10px;
|
|
|
|
|
- background: #eef6fb; color: #3c8dbc; font-weight: 600;
|
|
|
|
|
- }
|
|
|
|
|
- .card .progress.is-done { background: #eaf7ee; color: #27ae60; }
|
|
|
|
|
- .card .time { color: #999; }
|
|
|
|
|
.card .btn-view-quote {
|
|
.card .btn-view-quote {
|
|
|
- margin-left: auto; padding: 4px 10px; border: 1px solid #3c8dbc;
|
|
|
|
|
|
|
+ padding: 4px 10px; border: 1px solid #3c8dbc;
|
|
|
border-radius: 6px; background: #fff; color: #3c8dbc;
|
|
border-radius: 6px; background: #fff; color: #3c8dbc;
|
|
|
font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer;
|
|
font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer;
|
|
|
}
|
|
}
|
|
@@ -258,7 +276,12 @@
|
|
|
<button type="button" class="btn-search" id="btnSearch">搜索</button>
|
|
<button type="button" class="btn-search" id="btnSearch">搜索</button>
|
|
|
<button type="button" class="btn-add" id="btnOpenAdd">新增询价</button>
|
|
<button type="button" class="btn-add" id="btnOpenAdd">新增询价</button>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="list-wrap" id="listMain">
|
|
|
|
|
|
|
+ <div class="order-body">
|
|
|
|
|
+ <nav class="rfq-side" id="rfqSide" aria-label="报价状态">
|
|
|
|
|
+ <button type="button" class="rfq-cat{if condition="!isset($rfqStatusTab) || $rfqStatusTab neq 'quoted'"} active{/if}" data-status="pending">待询价</button>
|
|
|
|
|
+ <button type="button" class="rfq-cat{if condition="isset($rfqStatusTab) && $rfqStatusTab eq 'quoted'"} active{/if}" data-status="quoted">已报价</button>
|
|
|
|
|
+ </nav>
|
|
|
|
|
+ <div class="list-wrap" id="listMain">
|
|
|
{if $rows}
|
|
{if $rows}
|
|
|
{volist name="rows" id="row"}
|
|
{volist name="rows" id="row"}
|
|
|
<div class="card">
|
|
<div class="card">
|
|
@@ -266,18 +289,22 @@
|
|
|
<div class="meta">
|
|
<div class="meta">
|
|
|
<div><b>需求部门:</b>{$row.CCLBMMC|default=''|htmlentities}</div>
|
|
<div><b>需求部门:</b>{$row.CCLBMMC|default=''|htmlentities}</div>
|
|
|
<div><b>工序:</b>{$row.CGYMC|default=''|htmlentities}</div>
|
|
<div><b>工序:</b>{$row.CGYMC|default=''|htmlentities}</div>
|
|
|
- <div><b>发起人:</b>{$row.cywyxm|default=''|htmlentities}</div>
|
|
|
|
|
|
|
+ <div><b>本次数量:</b>{$row.This_quantity|default=''|htmlentities}</div>
|
|
|
|
|
+ <div><b>最高限价:</b>{$row.ceilingPrice|default=''|htmlentities}</div>
|
|
|
|
|
+ <div><b>需求发起人:</b>{$row.cywyxm|default=''|htmlentities}</div>
|
|
|
|
|
+ <div><b>需求发起时间:</b>{$row.createtime|default=''|htmlentities}</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ {if condition="isset($rfqStatusTab) && $rfqStatusTab eq 'quoted'"}
|
|
|
<div class="tags">
|
|
<div class="tags">
|
|
|
- <span class="progress{if condition="$row.progress_text eq '已完结'"} is-done{/if}">{$row.progress_text|default='待询价'|htmlentities}</span>
|
|
|
|
|
- {if $row.createtime}<span class="time">{$row.createtime|htmlentities}</span>{/if}
|
|
|
|
|
<button type="button" class="btn-view-quote" data-scydgy-id="{$row.scydgy_id}">查看报价</button>
|
|
<button type="button" class="btn-view-quote" data-scydgy-id="{$row.scydgy_id}">查看报价</button>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ {/if}
|
|
|
</div>
|
|
</div>
|
|
|
{/volist}
|
|
{/volist}
|
|
|
{else/}
|
|
{else/}
|
|
|
- <div class="empty" id="emptyTip">暂无询价单,点击右上角「新增询价」</div>
|
|
|
|
|
|
|
+ <div class="empty" id="emptyTip">暂无待询价单</div>
|
|
|
{/if}
|
|
{/if}
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
@@ -410,6 +437,8 @@
|
|
|
var defaultDept = {:json_encode(isset($defaultCclbmmc) ? (string)$defaultCclbmmc : '营销中心', JSON_UNESCAPED_UNICODE)};
|
|
var defaultDept = {:json_encode(isset($defaultCclbmmc) ? (string)$defaultCclbmmc : '营销中心', JSON_UNESCAPED_UNICODE)};
|
|
|
var defaultStarter = {:json_encode(isset($adminNickname) ? (string)$adminNickname : '', JSON_UNESCAPED_UNICODE)};
|
|
var defaultStarter = {:json_encode(isset($adminNickname) ? (string)$adminNickname : '', JSON_UNESCAPED_UNICODE)};
|
|
|
var nextCcydh = {:json_encode(isset($nextOrderCcydh) ? (string)$nextOrderCcydh : '', JSON_UNESCAPED_UNICODE)};
|
|
var nextCcydh = {:json_encode(isset($nextOrderCcydh) ? (string)$nextOrderCcydh : '', JSON_UNESCAPED_UNICODE)};
|
|
|
|
|
+ var currentStatus = {:json_encode(isset($rfqStatusTab) ? (string)$rfqStatusTab : 'pending', JSON_UNESCAPED_UNICODE)};
|
|
|
|
|
+ if (currentStatus !== 'quoted') currentStatus = 'pending';
|
|
|
|
|
|
|
|
try {
|
|
try {
|
|
|
if (token) {
|
|
if (token) {
|
|
@@ -444,6 +473,10 @@
|
|
|
.replace(/"/g, '"');
|
|
.replace(/"/g, '"');
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ function emptyTipText() {
|
|
|
|
|
+ return currentStatus === 'quoted' ? '暂无已报价询价单' : '暂无待询价单';
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
function postForm(url, data) {
|
|
function postForm(url, data) {
|
|
|
var body = Object.keys(data).map(function (k) {
|
|
var body = Object.keys(data).map(function (k) {
|
|
|
return encodeURIComponent(k) + '=' + encodeURIComponent(data[k] == null ? '' : data[k]);
|
|
return encodeURIComponent(k) + '=' + encodeURIComponent(data[k] == null ? '' : data[k]);
|
|
@@ -505,7 +538,7 @@
|
|
|
if (!main) return;
|
|
if (!main) return;
|
|
|
rows = Array.isArray(rows) ? rows : [];
|
|
rows = Array.isArray(rows) ? rows : [];
|
|
|
if (!rows.length) {
|
|
if (!rows.length) {
|
|
|
- main.innerHTML = '<div class="empty" id="emptyTip">暂无询价单,点击右上角「新增询价」</div>';
|
|
|
|
|
|
|
+ main.innerHTML = '<div class="empty" id="emptyTip">' + emptyTipText() + '</div>';
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
var html = '';
|
|
var html = '';
|
|
@@ -514,26 +547,31 @@
|
|
|
var name = String(row.CYJMC || '').trim();
|
|
var name = String(row.CYJMC || '').trim();
|
|
|
if (title && name) title += ' ' + name;
|
|
if (title && name) title += ' ' + name;
|
|
|
else title = title || name || '';
|
|
else title = title || name || '';
|
|
|
- var progress = String(row.progress_text || '待询价');
|
|
|
|
|
html += '<div class="card">'
|
|
html += '<div class="card">'
|
|
|
+ '<div class="ord">' + esc(title) + '</div>'
|
|
+ '<div class="ord">' + esc(title) + '</div>'
|
|
|
+ '<div class="meta">'
|
|
+ '<div class="meta">'
|
|
|
+ '<div><b>需求部门:</b>' + esc(row.CCLBMMC || '') + '</div>'
|
|
+ '<div><b>需求部门:</b>' + esc(row.CCLBMMC || '') + '</div>'
|
|
|
+ '<div><b>工序:</b>' + esc(row.CGYMC || '') + '</div>'
|
|
+ '<div><b>工序:</b>' + esc(row.CGYMC || '') + '</div>'
|
|
|
- + '<div><b>发起人:</b>' + esc(row.cywyxm || '') + '</div>'
|
|
|
|
|
- + '</div>'
|
|
|
|
|
- + '<div class="tags">'
|
|
|
|
|
- + '<span class="progress' + (progress === '已完结' ? ' is-done' : '') + '">' + esc(progress) + '</span>'
|
|
|
|
|
- + (row.createtime ? '<span class="time">' + esc(row.createtime) + '</span>' : '')
|
|
|
|
|
- + '<button type="button" class="btn-view-quote" data-scydgy-id="' + esc(row.scydgy_id || '') + '">查看报价</button>'
|
|
|
|
|
- + '</div></div>';
|
|
|
|
|
|
|
+ + '<div><b>本次数量:</b>' + esc(row.This_quantity || '') + '</div>'
|
|
|
|
|
+ + '<div><b>最高限价:</b>' + esc(row.ceilingPrice || '') + '</div>'
|
|
|
|
|
+ + '<div><b>需求发起人:</b>' + esc(row.cywyxm || '') + '</div>'
|
|
|
|
|
+ + '<div><b>需求发起时间:</b>' + esc(row.createtime || '') + '</div>'
|
|
|
|
|
+ + '</div>';
|
|
|
|
|
+ if (currentStatus === 'quoted') {
|
|
|
|
|
+ html += '<div class="tags">'
|
|
|
|
|
+ + '<button type="button" class="btn-view-quote" data-scydgy-id="' + esc(row.scydgy_id || '') + '">查看报价</button>'
|
|
|
|
|
+ + '</div>';
|
|
|
|
|
+ }
|
|
|
|
|
+ html += '</div>';
|
|
|
});
|
|
});
|
|
|
main.innerHTML = html;
|
|
main.innerHTML = html;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function loadList() {
|
|
function loadList() {
|
|
|
var q = (document.getElementById('qInput').value || '').trim();
|
|
var q = (document.getElementById('qInput').value || '').trim();
|
|
|
- var url = listUrl + (listUrl.indexOf('?') >= 0 ? '&' : '?') + 'q=' + encodeURIComponent(q);
|
|
|
|
|
|
|
+ var url = listUrl + (listUrl.indexOf('?') >= 0 ? '&' : '?')
|
|
|
|
|
+ + 'q=' + encodeURIComponent(q)
|
|
|
|
|
+ + '&status=' + encodeURIComponent(currentStatus || 'pending');
|
|
|
getJson(url).then(function (ret) {
|
|
getJson(url).then(function (ret) {
|
|
|
if (ret && (ret.code === 1 || ret.code === '1')) {
|
|
if (ret && (ret.code === 1 || ret.code === '1')) {
|
|
|
var data = ret.data || {};
|
|
var data = ret.data || {};
|
|
@@ -549,6 +587,22 @@
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ var rfqSide = document.getElementById('rfqSide');
|
|
|
|
|
+ if (rfqSide) {
|
|
|
|
|
+ rfqSide.addEventListener('click', function (e) {
|
|
|
|
|
+ var btn = e.target && e.target.closest ? e.target.closest('.rfq-cat') : null;
|
|
|
|
|
+ if (!btn) return;
|
|
|
|
|
+ var st = btn.getAttribute('data-status') || 'pending';
|
|
|
|
|
+ if (st !== 'quoted') st = 'pending';
|
|
|
|
|
+ if (st === currentStatus) return;
|
|
|
|
|
+ currentStatus = st;
|
|
|
|
|
+ rfqSide.querySelectorAll('.rfq-cat').forEach(function (b) {
|
|
|
|
|
+ b.classList.toggle('active', b === btn);
|
|
|
|
|
+ });
|
|
|
|
|
+ loadList();
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
document.getElementById('btnSearch').addEventListener('click', loadList);
|
|
document.getElementById('btnSearch').addEventListener('click', loadList);
|
|
|
document.getElementById('qInput').addEventListener('keydown', function (e) {
|
|
document.getElementById('qInput').addEventListener('keydown', function (e) {
|
|
|
if (e.key === 'Enter') {
|
|
if (e.key === 'Enter') {
|