Browse Source

Merge pull request '药方备注修改' (#34) from wpd_rem into master

Reviewed-on: #34
pull/35/head
pengda 7 months ago
parent
commit
07cca6b061
  1. 36
      view/templates/admin/formula_list.html

36
view/templates/admin/formula_list.html

@ -107,7 +107,9 @@
{/foreach}
</div>
<div style="line-height: 20px;padding-top: 10px">用法:{$item.method}</div>
{if $item.remark}<div style="line-height: 20px;padding-top: 10px;color: #0069d6">备注:{$item.remark}</div>{/if}
<div style="line-height: 20px;padding-top: 10px">
备注:<textarea cols="80" class="remark_{$item.id}" style="color: #0069d6">{$item.remark}</textarea>&nbsp;<a onclick="saveRemark({$item.id})">保存</a>
</div>
</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}
@ -239,6 +241,38 @@
});
}
function saveRemark(id){
let remark = $('.remark_'+id).val();
const data = {
id: id,
remark: remark,
};
$.ajax({
url: '/admin/ajax_update_formula', // 替换为你的服务器端处理文件
type: 'POST',
data: data,
dataType: 'json',
success: function (response) {
if (response.status == true) {
showAlert('保存成功')
return true;
}
if(response.data.code == 40002){
showAlert('请登录','/admin/login')
return true;
}
showAlert(response.info)
},
error: function (xhr, status, error) {
console.error('错误:', response);
alert('提交失败,请重试。');
}
});
}
function adjustFlexWidth(container) {
const items = container.querySelectorAll('.item');
let maxWidth = 0;

Loading…
Cancel
Save