|
|
@ -8,8 +8,54 @@ |
|
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> |
|
|
|
<title>药方列表</title> |
|
|
|
<meta name="viewport" content="width=device-width,initial-scale=1"> |
|
|
|
<link href="{$smarty.const.CSS_URL}/css/global.css?v={$smarty.const.CSS_JS_VERSION}" media="screen" rel="stylesheet" type="text/css"> |
|
|
|
<link href="{$smarty.const.CSS_URL}/css/global.css?v={$smarty.const.CSS_JS_VERSION}" media="screen" rel="stylesheet" |
|
|
|
type="text/css"> |
|
|
|
<script src="{$smarty.const.CSS_URL}/js/common.js?v={$smarty.const.CSS_JS_VERSION}"></script> |
|
|
|
{literal} |
|
|
|
<style> |
|
|
|
.formula-item { |
|
|
|
display: flex; |
|
|
|
flex-wrap: wrap; |
|
|
|
border-bottom: 1px dashed #ccc; |
|
|
|
padding-bottom: 10px; |
|
|
|
} |
|
|
|
|
|
|
|
.formula-item .item { |
|
|
|
flex-basis: auto; |
|
|
|
white-space: nowrap; |
|
|
|
border: 1px dashed #f6f5f5; |
|
|
|
padding: 0 20px 0 0; |
|
|
|
} |
|
|
|
|
|
|
|
.method { |
|
|
|
line-height: 20px; |
|
|
|
padding-top: 10px; |
|
|
|
} |
|
|
|
|
|
|
|
.disabled-row { |
|
|
|
background-color: #f2f2f2; /* 变灰 */ |
|
|
|
color: #aaa; /* 文字颜色变淡 */ |
|
|
|
cursor: not-allowed; /* 禁用手型指针 */ |
|
|
|
} |
|
|
|
|
|
|
|
.remark-txt { |
|
|
|
height: 20px; |
|
|
|
line-height: 20px; |
|
|
|
padding-top: 10px |
|
|
|
} |
|
|
|
|
|
|
|
.remark-span { |
|
|
|
color: #0069d6 !important; |
|
|
|
padding: 0 !important; |
|
|
|
} |
|
|
|
|
|
|
|
.remark-btn { |
|
|
|
position: absolute; |
|
|
|
right: 10px; |
|
|
|
bottom: 10px; |
|
|
|
} |
|
|
|
</style> |
|
|
|
{/literal} |
|
|
|
</head> |
|
|
|
<body> |
|
|
|
|
|
|
@ -101,22 +147,22 @@ |
|
|
|
<td>{$item.name}</td> |
|
|
|
<td>{$item.source}</td> |
|
|
|
<td style="padding: 10px;position: relative"> |
|
|
|
<div class="formula-item" style="display: flex;flex-wrap: wrap;border-bottom: 1px dashed #ccc;padding-bottom: 10px;"> |
|
|
|
<div class="formula-item"> |
|
|
|
{foreach from=$item.formula item=value} |
|
|
|
<span class="item" style="flex-basis: auto;white-space: nowrap;border: 1px dashed #f6f5f5;padding:0 20px 0 0">{$value.name}{if $value.desc}({$value.desc}){/if} {$value.num_str}</span> |
|
|
|
<span class="item">{$value.name}{if $value.desc}({$value.desc}){/if} {$value.num_str}</span> |
|
|
|
{/foreach} |
|
|
|
</div> |
|
|
|
<div style="line-height: 20px;padding-top: 10px">用法:{$item.method}</div> |
|
|
|
<div class="remark_txt_{$item.id}" style="line-height: 20px;padding-top: 10px;"> |
|
|
|
<div class="method">用法:{$item.method}</div> |
|
|
|
<div class="remark-txt remark_txt_{$item.id}"> |
|
|
|
{if $item.remark}备注:{/if}<span class="remark-span remark_{$item.id}">{$item.remark}</span> |
|
|
|
</div> |
|
|
|
<a style="position: absolute;right: 10px;bottom: 5px;" onclick="to_remark('{$item.id}')">修改备注</a> |
|
|
|
<a class="remark-btn remark_btn_{$item.id}" onclick="to_remark('{$item.id}')">{if $item.remark}修改备注{else}添加备注{/if}</a> |
|
|
|
</td> |
|
|
|
<td class="status_{$item.id}" data-status="{$item.is_delete}" style="{if $item.is_delete == 0}color:#57a957{/if}{if $item.is_delete == 3}color:red{/if}"> |
|
|
|
{if $item.uid==0} |
|
|
|
{if $item.is_delete == 0} 通过{/if} |
|
|
|
{if $item.is_delete == 2} 待审核{/if} |
|
|
|
{if $item.is_delete == 3} 不通过 {/if} |
|
|
|
{if $item.is_delete == 0} 通过{/if} |
|
|
|
{if $item.is_delete == 2} 待审核{/if} |
|
|
|
{if $item.is_delete == 3} 不通过 {/if} |
|
|
|
{/if} |
|
|
|
</td> |
|
|
|
<td> |
|
|
@ -124,8 +170,12 @@ |
|
|
|
<a href="javascript:;" onclick="to_check('{$item.id}')">审核</a> |
|
|
|
<a target="_blank" href="/admin/formula_add/id/{$item.id}">编辑</a> |
|
|
|
{/if} |
|
|
|
<div style="color: #ccc;white-space: nowrap;" class="user-name-{$item.id}">{if $user_list[$item.user_id]}{$user_list[$item.user_id].username}{/if}</div> |
|
|
|
<div style="color: #ccc;white-space: nowrap;" class="user-time-{$item.id}">{if $user_list[$item.user_id]}{$item.update_time}{/if}</div> |
|
|
|
<div style="color: #ccc;white-space: nowrap;" class="user-name-{$item.id}">{if |
|
|
|
$user_list[$item.user_id]}{$user_list[$item.user_id].username}{/if} |
|
|
|
</div> |
|
|
|
<div style="color: #ccc;white-space: nowrap;" class="user-time-{$item.id}">{if |
|
|
|
$user_list[$item.user_id]}{$item.update_time}{/if} |
|
|
|
</div> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
{/foreach} |
|
|
@ -168,7 +218,7 @@ |
|
|
|
<textarea cols="100" rows="5" id="remark_text"></textarea> |
|
|
|
</div> |
|
|
|
<div class="modal-footer inputs" style="padding: 30px;"> |
|
|
|
<button class="button primary" style="margin-left: 50px" onclick="saveRemark()">确定</button> |
|
|
|
<button class="button primary" style="margin-left: 50px" onclick="saveRemark()">保存</button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
@ -189,32 +239,36 @@ |
|
|
|
|
|
|
|
var url = '/admin/formula_list'; |
|
|
|
|
|
|
|
if(is_all > 0) url += '/is_all/' + is_all; |
|
|
|
if(status > 0) url += '/status/' + status; |
|
|
|
if(name) url += '/name/' + name; |
|
|
|
if (is_all > 0) url += '/is_all/' + is_all; |
|
|
|
if (status > 0) url += '/status/' + status; |
|
|
|
if (name) url += '/name/' + name; |
|
|
|
|
|
|
|
location.href = url; |
|
|
|
} |
|
|
|
function to_add(){ |
|
|
|
|
|
|
|
function to_add() { |
|
|
|
location.href = '/admin/formula_add'; |
|
|
|
} |
|
|
|
function to_check(id){ |
|
|
|
|
|
|
|
function to_check(id) { |
|
|
|
$('#check_id').val(id); |
|
|
|
let status = $('.status_'+id).data('status') |
|
|
|
if(status == 3){ |
|
|
|
let status = $('.status_' + id).data('status') |
|
|
|
if (status == 3) { |
|
|
|
$('input[name="status"][value="3"]').prop("checked", true); |
|
|
|
}else{ |
|
|
|
} else { |
|
|
|
$('input[name="status"][value="0"]').prop("checked", true); |
|
|
|
} |
|
|
|
$('#check_div').show() |
|
|
|
} |
|
|
|
function to_remark(id){ |
|
|
|
|
|
|
|
function to_remark(id) { |
|
|
|
$('#remark_id').val(id); |
|
|
|
let remark = $('.remark_'+id).html(); |
|
|
|
let remark = $('.remark_' + id).html(); |
|
|
|
$('#remark_text').val(remark); |
|
|
|
$('#remark_div').show() |
|
|
|
} |
|
|
|
$(".close").click(function(){ |
|
|
|
|
|
|
|
$(".close").click(function () { |
|
|
|
$("#check_div").hide(); |
|
|
|
$("#remark_div").hide(); |
|
|
|
}); |
|
|
@ -238,25 +292,22 @@ |
|
|
|
success: function (response) { |
|
|
|
if (response.status == true) { |
|
|
|
showAlert('操作成功') |
|
|
|
$('.status_'+id).data('status',status); |
|
|
|
if(status == 0){ |
|
|
|
$('.status_'+id).html('通过'); |
|
|
|
$('.status_'+id).css('color','#57a957'); |
|
|
|
$('.status_' + id).data('status', status); |
|
|
|
if (status == 0) { |
|
|
|
$('.status_' + id).html('通过'); |
|
|
|
$('.status_' + id).css('color', '#57a957'); |
|
|
|
} |
|
|
|
if(status == 3){ |
|
|
|
$('.status_'+id).html('不通过'); |
|
|
|
$('.status_'+id).css('color','red'); |
|
|
|
if (status == 3) { |
|
|
|
$('.status_' + id).html('不通过'); |
|
|
|
$('.status_' + id).css('color', 'red'); |
|
|
|
} |
|
|
|
$('.user-name-'+id).html('{/literal}{$_uinfo.username}{literal}') |
|
|
|
|
|
|
|
const now = new Date(); |
|
|
|
const formattedDate = `${now.getFullYear()}-${(now.getMonth() + 1).toString().padStart(2, '0')}-${now.getDate().toString().padStart(2, '0')} ${now.getHours().toString().padStart(2, '0')}:${now.getMinutes().toString().padStart(2, '0')}:${now.getSeconds().toString().padStart(2, '0')}`; |
|
|
|
$('.user-time-'+id).html(formattedDate) |
|
|
|
$('.user-name-' + id).html('{/literal}{$_uinfo.username}{literal}') |
|
|
|
$('.user-time-' + id).html(response.data.opt_time) |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
if(response.data.code == 40002){ |
|
|
|
showAlert('请登录','/admin/login') |
|
|
|
if (response.data.code == 40002) { |
|
|
|
showAlert('请登录', '/admin/login') |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
@ -269,11 +320,11 @@ |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
function saveRemark(){ |
|
|
|
function saveRemark() { |
|
|
|
$("#remark_div").hide(); |
|
|
|
|
|
|
|
let id = $('#remark_id').val() |
|
|
|
let remark = $('#remark_text').val(); |
|
|
|
let remark = $('#remark_text').val(); |
|
|
|
const data = { |
|
|
|
id: id, |
|
|
|
remark: remark, |
|
|
@ -287,13 +338,20 @@ |
|
|
|
success: function (response) { |
|
|
|
if (response.status == true) { |
|
|
|
showAlert('保存成功') |
|
|
|
$('.remark_txt_'+id).html('备注:<span class="remark-span remark_'+id+'">'+remark+'</span>'); |
|
|
|
|
|
|
|
if (remark.trim().length > 0) { |
|
|
|
$('.remark_btn_' + id).html('修改备注'); |
|
|
|
$('.remark_txt_' + id).html('备注:<span class="remark-span remark_' + id + '">' + remark + '</span>'); |
|
|
|
} else { |
|
|
|
$('.remark_btn_' + id).html('添加备注'); |
|
|
|
$('.remark_txt_' + id).html('<span class="remark-span remark_' + id + '">' + remark + '</span>'); |
|
|
|
} |
|
|
|
$('.user-name-' + id).html('{/literal}{$_uinfo.username}{literal}') |
|
|
|
$('.user-time-' + id).html(response.data.opt_time) |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
|
if(response.data.code == 40002){ |
|
|
|
showAlert('请登录','/admin/login') |
|
|
|
if (response.data.code == 40002) { |
|
|
|
showAlert('请登录', '/admin/login') |
|
|
|
return true; |
|
|
|
} |
|
|
|
|
|
|
@ -324,7 +382,7 @@ |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
window.onload = function() { |
|
|
|
window.onload = function () { |
|
|
|
const containers = document.querySelectorAll('.formula-item'); |
|
|
|
|
|
|
|
containers.forEach(container => { |
|
|
@ -340,17 +398,6 @@ |
|
|
|
}); |
|
|
|
}; |
|
|
|
</script> |
|
|
|
<style> |
|
|
|
.disabled-row{ |
|
|
|
background-color: #f2f2f2; /* 变灰 */ |
|
|
|
color: #aaa; /* 文字颜色变淡 */ |
|
|
|
cursor: not-allowed; /* 禁用手型指针 */ |
|
|
|
} |
|
|
|
.remark-span{ |
|
|
|
color: #0069d6 !important; |
|
|
|
padding: 0 !important; |
|
|
|
} |
|
|
|
</style> |
|
|
|
{/literal} |
|
|
|
|
|
|
|
</body> |
|
|
|