Quellcode durchsuchen

提交药师审核

bzd_wsp vor 6 Monaten
Ursprung
Commit
c7f4a703cb

+ 64 - 5
health-admin/src/main/java/com/bzd/web/controller/dtp/RecipeRegisterController.java

@@ -147,11 +147,11 @@ public class RecipeRegisterController extends BaseController {
     public AjaxResult saveCFDJ() throws Exception {
         PageData pd = new PageData();
         pd = this.getPageData();
-        int i = dtpService.saveCFDJ(pd);
-        if(i>0){
-            return AjaxResult.success("登记成功");
-        }else {
-            return AjaxResult.error("登记失败");
+        PageData p = dtpService.saveCFDJ(pd);
+        if(p.get("code").toString().equals("200")){
+            return AjaxResult.success(p);
+        }else{
+            return AjaxResult.error(p.get("msg").toString());
         }
 
     }
@@ -319,4 +319,63 @@ public class RecipeRegisterController extends BaseController {
         mmap.putAll(pageData);
         return prefix + "/edit";
     }
+
+    /**
+     * 验证药师密码
+     * @param
+     * @return
+     * @throws Exception
+     */
+    @RequiresPermissions("dtp:recipe:list")
+    @PostMapping("/ReviewCheckInputPassword")
+    @ResponseBody
+    public AjaxResult ReviewCheckInputPassword(ModelMap mmap) throws Exception {
+
+        PageData pd = this.getPageData();
+        System.out.println("password:"+pd.get("password"));
+        PageData pageData =dtpService.ReviewCheckInputPassword(pd);
+        if(StringUtils.isNotNull(pageData)){
+            return  AjaxResult.success(pageData);
+        }else {
+            return  AjaxResult.error("密码错误");
+        }
+
+    }
+    /**
+     * 药师审核处方
+     * @param
+     * @return
+     * @throws Exception
+     */
+    @RequiresPermissions("dtp:recipe:list")
+    @PostMapping("/review")
+    @ResponseBody
+    public AjaxResult review(ModelMap mmap) throws Exception {
+
+        PageData pd = this.getPageData();
+        PageData p =dtpService.Review(pd);
+        if(p.get("code").toString().equals("200")){
+            return AjaxResult.success(p);
+        }else{
+            return AjaxResult.error(p.get("msg").toString());
+        }
+
+    }
+
+    /**
+     * 获取所有药师
+     * @param mmap
+     * @return
+     * @throws Exception
+     */
+    @PostMapping("/findRevieForList")
+    @ResponseBody
+    public AjaxResult findRevieForList( ModelMap mmap) throws Exception {
+        PageData pd = this.getPageData();
+        startPage();
+        List<PageData> pageData =dtpService.findRevieForList(pd);
+        return  AjaxResult.success(pageData);
+    }
+
+
 }

+ 182 - 44
health-admin/src/main/resources/templates/dtp/recipe/newRecipe.html

@@ -21,7 +21,8 @@
                     <a class="btn btn-info btn-rounded btn-sm" onclick="bookbuilding()">&nbsp;快速建档</a>
                 </div>
             </div>
-        </form>
+     </form>
+
         <div id="patient-table-container">
             <table id="patient-table" class="customize-table">
                 <thead>
@@ -43,7 +44,6 @@
                 </tbody>
             </table>
         </div>
-
     </div>
 <!--    <div id="shangci">-->
 <!--    <h4 class="query-condition-title">&nbsp;&nbsp;上次登记信息</h4>-->
@@ -241,49 +241,42 @@
             <form class="form-horizontal" id="form-budan-add">
                 <div class="modal-content animated bounceInRight">
                     <div class="modal-header">
-                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span>
-                        </button>
-                        <h4 class="modal-title">药师审核</h4>
+                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">关闭</span></button>
+                        <h2 class="modal-title">药师审核</h2>
                     </div>
                     <div class="modal-body">
                         <div class="customize-search-form">
-                            <div class="rows">
-                                <div class="input-group">
-                                    请输入密码审核确认
-                                </div>
+                            <div class="customize-form-group">
+                                <label>审核药师姓名:</label>
+                                <select id="pharmacistNameSelect" name="pharmacistName" class="styled-input" style="width: 200px; height: 35px;">
+                                    <option value="" disabled selected>请选择</option>
+                                </select>
+                                <span id="pharmacistVerified" class="verified-symbol" style="display:none;">✓</span>
                             </div>
-                            <div class="rows">
-                                <div class="input-group">
-                                    <input type="text" placeholder="请输入密码"  class="styled-input" style="width: 200px; height: 25px;"  id="password" name="password">
-                                </div>
+                            <div id="passwordGroup" class="customize-form-group" style="display:none;">
+                                <label>密码:</label>
+                                <input type="password" placeholder="请输入密码" class="styled-input" style="width: 200px; height: 35px;" id="password" name="password">
+                                <button type="button" class="btn btn-success btn-sm" id="verifyPasswordBtn">确定</button>
                             </div>
-                            <div class="rows">
-                                <div class="input-group">
-                                    <input type="redio" placeholder="请选择审核结果"  class="styled-input" style="width: 200px; height: 25px;"  id="checkResult" name="checkResult">
+                            <div id="checkView" style="display:none;">
+                                <div class="customize-form-group">
+                                    <label>审核结果:</label>
+                                    <div>
+                                        <label><input type="radio" name="checkResult" value="1"> 通过</label>
+                                        <label><input type="radio" name="checkResult" value="0"> 不通过</label>
+                                    </div>
                                 </div>
-                            </div>
-                            <div class="rows">
-                                <div class="input-group">
-                                    <input type="text" placeholder="请输入说明"  class="styled-input" style="width: 200px; height: 25px;"  id="remark" name="remark">
+                                <div class="customize-form-group">
+                                    <label>审核意见:</label>
+                                    <input type="text" placeholder="请输入说明" class="styled-input" style="width: 200px; height: 35px;" id="remarks" name="remarks">
                                 </div>
                             </div>
-<!--                            <div class="modalbudan" id="budanshibai">-->
-<!--                                <div class="rows" style="text-align: center">-->
-<!--                                    审核失败!-->
-<!--                                </div>-->
-<!--                                <div class="rows">-->
-<!--                                    请核实药品-->
-<!--                                </div>-->
-<!--                            </div>-->
                         </div>
-
                     </div>
                     <div class="modal-footer">
                         <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
-                        <button type="button" class="btn btn-primary" onclick="checkpass()">审核通过</button>
-                        <button type="button" class="btn btn-primary" onclick="checknotpass()">审核不通过</button>
+                        <button type="button" class="btn btn-primary" onclick="submitReview()">提交</button>
                     </div>
-
                 </div>
             </form>
         </div>
@@ -307,14 +300,15 @@
     var prefix_yppz= ctx + "yppz/drugConfig";
     var prefix_pmService = ctx + "dtp/pmService";
     var hzparam =[];
+    var hzparam1 ={};
     var openId='';
     var data;
     var shangci=false;
     var shangcigyList=[];
     var dataList=[];
     var selectdataList=[];
-
-    $(document).ready(function() {
+    var  prescriptionNumber;
+     $(document).ready(function() {
         // 获取所有的输入元素(input, textarea, select)
         var $inputs = $('form').find('input, textarea, select').filter(':visible');
 
@@ -392,11 +386,8 @@
         var index = selectedRow.data('index');
         return dataList[index];
     }
-
     function getLastRecipe(patientId){
         var datas=[];
-        debugger
-
         var data = {
             "patientId":patientId,
         };
@@ -511,6 +502,7 @@ function initTab(datas){
         return tableRows;
     }
     function submitHandler() {
+        prescriptionNumber='';
         // 创建一个 FormData 对象用于提交表单数据
         var formData = new FormData();
         // 如果有文件上传,例如处方图片和发票图片
@@ -526,7 +518,7 @@ function initTab(datas){
         // 收集患者信息
         var patientObj = getSelectedPatient();
         if (patientObj) {
-            debugger;
+
             console.log("Selected Patient:", patientObj);
             // 添加患者信息到 FormData
             formData.append('patientId', patientObj.id);
@@ -577,22 +569,163 @@ function initTab(datas){
                 $.modal.alertError("操作失败");
             },
             success: function (data) {
-                debugger;
+
+                if(data.data.code==200){
+                    prescriptionNumber = data.data.prescriptionNumber;
                     openCheckYSJC();
 
 
-                  //  $.modal.closeTab();
+                    //  $.modal.closeTab();
+                }else{
+                    $.modal.alertError(data.msg);
+                }
+
             }
         });
     }
 
     function openCheckYSJC(){
-            //$.modal.open("药师审核", prefix_pmService+'/openCheckYSJC');
+        //初始化时加载药师信息
+        loadPharmacists();
+            //$.modal.open("药师审核", prefix_pmService+'/openCheckYSJC'); findRevieForList
         $('#myModal').modal('show');
-
-        $.modal.alertSuccess("操作成功");
         //  $.modal.closeTab();
     }
+    // 异步加载所有药师信息并填充下拉框
+    function loadPharmacists() {
+        $.ajax({
+            url: prefix_recipe+ "/findRevieForList", // 假设这是获取所有药师的API端点
+            type: 'POST',
+            cache: false, // 设置为 false 防止缓存
+            processData: false, // 告诉 jQuery 不要处理数据(非常重要)
+            contentType: false, // 告诉 jQuery 不要设置 contentType(非常重要)
+            async: true, // 异步请求更为推荐,除非有特殊原因需要同步
+            success: function (data) {
+                var select = $('#pharmacistNameSelect');
+                // 清空除了默认选项外的所有选项
+                select.find('option:not(:first)').remove();
+                data.data.forEach(function (pharmacist) {
+                    select.append(new Option(pharmacist.pharmacistName, pharmacist.id));
+                });
+            },
+            error: function () {
+                $.modal.alertError('加载药师信息失败');
+            }
+        });
+    }
+
+    // 当选择药师后显示密码输入框
+    $('#pharmacistNameSelect').change(function () {
+        var selectedValue = $(this).val();
+
+        // 如果选择了具体的药师
+        if (selectedValue) {
+            $('#passwordGroup').show();
+            $('#password').val(''); // 清空密码输入框
+            $('#checkView').hide(); // 隐藏审核结果部分
+            $('#pharmacistVerified').hide(); // 隐藏验证成功的符号
+        } else {
+            // 如果没有选择任何药师,隐藏所有相关元素
+            $('#passwordGroup').hide();
+            $('#checkView').hide(); // 确保在切换药师时隐藏审核结果和意见
+            $('#pharmacistVerified').hide(); // 隐藏验证成功的符号
+            $('#password').val(''); // 清空密码输入框
+        }
+    });
+
+    // 验证药师密码并显示审核结果部分
+    function verifyPassword() {
+        var formData = new FormData();
+
+        var pharmacistId = $('#pharmacistNameSelect').val();
+        var password = $('#password').val();
+        console.log(pharmacistId);
+        formData.append('id', pharmacistId);
+        formData.append('reviewPassword', password);
+        $.ajax({
+            url: prefix_recipe+"/ReviewCheckInputPassword", // 假设这是验证药师密码的API端点
+            type: 'POST',
+            data: formData,
+            cache: false, // 设置为 false 防止缓存
+            processData: false, // 告诉 jQuery 不要处理数据(非常重要)
+            contentType: false, // 告诉 jQuery 不要设置 contentType(非常重要)
+            async: true, // 异步请求更为推荐,除非有特殊原因需要同步
+            success: function (data) {
+                if (data.code === 0) {
+                    $('#checkView').show();
+                    $('#pharmacistVerified').show(); // 显示验证成功的符号
+                } else {
+                    $.modal.alertError('密码错误');
+                    $('#checkView').hide();
+                    $('#pharmacistVerified').hide(); // 隐藏验证成功的符号
+                }
+            },
+            error: function () {
+                $.modal.alertError('验证失败');
+            }
+        });
+    }
+    // 添加点击事件监听器到确认按钮上,用于触发密码验证
+    $('#verifyPasswordBtn').click(function () {
+        verifyPassword();
+    });
+    // 提交审核信息
+    function submitReview() {
+        if ($('#pharmacistNameSelect').val() && $('#password').is(':visible')) {
+            verifyPassword();
+        } else {
+            alert('请选择审核药师并输入密码');
+        }
+
+
+
+        // 如果 checkView 显示,则可以提交表单
+        if ($('#checkView').is(':visible')) {
+            var formData = new FormData();
+
+            // 直接从特定的输入元素中获取值
+            // 获取审核药师姓名
+            var reviewingNameOption = $('#pharmacistNameSelect option:selected');
+            var reviewingName = reviewingNameOption.text();  // 获取选中的选项文本
+            var reviewStatus = $('input[name="checkResult"]:checked').val(); // 获取选中的审核结果
+            var remarks = $('#remarks').val();
+
+            // 检查是否所有必填项都已填写
+            if (!reviewingName || !reviewStatus || !prescriptionNumber) {
+                alert('请确保所有必填项都已填写');
+                return;
+            }
+
+            // 添加到 formData 中
+            formData.append("reviewingName", reviewingName);
+            formData.append("reviewStatus", reviewStatus);
+            formData.append("prescriptionNumber", prescriptionNumber);
+            formData.append("remarks", remarks);
+
+            $.ajax({
+                cache: false,
+                type: "POST",
+                url: prefix_recipe+'/review', // 这是提交审核信息的API端点
+                data: formData,
+                processData: false,
+                contentType: false,
+                async: true,
+                error: function (request) {
+                    $.modal.alertError("操作失败");
+                },
+                success: function (data) {
+                    if (data.data.code === 200) {
+                        $('#myModal').modal('hide'); // 关闭弹窗
+                        $.modal.alertSuccess('提交成功');
+                        $.modal.closeTab();
+                    } else {
+                        $.modal.alertError(data.message || "提交失败");
+                    }
+                }
+            });
+        }
+    }
+
     // callBack获取父窗口方法(方式二)
     function selectUsersToParentCallBack2(){
         var options = {
@@ -772,7 +905,7 @@ function initTab(datas){
                         // $('#gender').val(gender === 1 ? '男' : gender === 0 ? '女' : '');
                         // $('#age').val(data.data.age);
                         // var patientId =  data.data.id;
-                        // debugger
+
                         // if(patientId !='' && patientId != null){
                         //     //查询出对应患者的上一次处方登记信息
                         //     getLastRecipe(patientId);
@@ -909,6 +1042,11 @@ function initTab(datas){
         background-color: #a9a9c5;
         color: white; /* 确保文字可见 */
     }
+    .verified-symbol {
+        color: green;
+        font-size: 16px;
+        margin-left: 5px;
+    }
 </style>
 </body>
 </html>

+ 315 - 321
health-admin/src/main/resources/templates/dtp/recipe/recipe.html

@@ -7,329 +7,323 @@
 </head>
 <body class="gray-bg">
 
-	<div class="ui-layout-center">
-		<div class="container-div">
-			<div class="row">
-				<div class="col-sm-12 search-collapse">
-					<div class="query-condition-container">
-						<h4 class="query-condition-title">查询条件</h4>
-						<div class="query-buttons">
-							<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
-							<a class="btn btn-warning btn-rounded btn-sm" onclick="resetPre()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
-						</div>
-
+<div class="ui-layout-center">
+	<div class="container-div">
+		<div class="row">
+			<div class="col-sm-12 search-collapse">
+				<div class="query-condition-container">
+					<h4 class="query-condition-title">查询条件</h4>
+					<div class="query-buttons">
+						<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
+						<a class="btn btn-warning btn-rounded btn-sm" onclick="resetPre()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
 					</div>
-					<form id="user-form" class="customize-search-form">
-						<div class="customize-form-group-container">
-							<div class="customize-form-group">
-								<label>患者信息:</label>
-								<input type="text" class="styled-input" placeholder="请输入患者姓名或手机号" name="query"/>
-							</div>
 
-							<div class="customize-form-group">
-								<label>销售单号:</label>
-								<input type="text" class="styled-input" name="saleOrderNumber"/>
-							</div>
-							<div class="customize-form-group">
-								<label>处方单号:</label>
-								<input type="text" class="styled-input" name="prescriptionNumber"/>
-							</div>
-							<div class="customize-form-group">
-								<label>处方类型</label>
-								<select name="prescriptionType"  th:with="type=${@dict.getType('sys_select_prescription_ype')}" class="styled-input">
-									<option value="">全部</option>
-									<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
-									></option>
-								</select>
-							</div>
+				</div>
+				<form id="user-form" class="customize-search-form">
+					<div class="customize-form-group-container">
+						<div class="customize-form-group">
+							<label>患者信息:</label>
+							<input type="text" class="styled-input" placeholder="请输入患者姓名或手机号" name="query"/>
+						</div>
 
-							<div class="customize-form-group select-time">
-								<label>处方登记日期:</label>
-								<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="beginTime"/>
-								<span>-</span>
-								<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="endTime"/>
-							</div>
-							<div class="customize-form-group">
-								<label>订单状态</label>
-								<select name="status" th:with="type=${@dict.getType('sys_select_order_status')}" class="styled-input">
-									<option value="">全部</option>
-									<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
-									></option>
-								</select>
-							</div>
+						<div class="customize-form-group">
+							<label>销售单号:</label>
+							<input type="text" class="styled-input" name="saleOrderNumber"/>
 						</div>
-					</form>
-				</div>
-		        <div class="btn-group-sm" id="toolbar" role="group">
-<!--		        	<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="dtp:recipe:add">-->
-<!--		                <i class="fa fa-plus"></i> 处方登记APP-->
-<!--		            </a>-->
-					<a class="btn btn-success" onclick="$.operate.addTab2()" shiro:hasPermission="dtp:recipe:add">
-						<i class="fa fa-plus"></i> 新建登记
-					</a>
-		        </div>
-				<div class="col-sm-12 select-table table-striped" style="width: 100%; overflow-x: hidden;">
-					<table id="bootstrap-table" class="fixed-layout-table"></table>
-				</div>
+						<div class="customize-form-group">
+							<label>处方单号:</label>
+							<input type="text" class="styled-input" name="prescriptionNumber"/>
+						</div>
+						<div class="customize-form-group">
+							<label>处方类型</label>
+							<select name="prescriptionType"  th:with="type=${@dict.getType('sys_select_prescription_ype')}" class="styled-input">
+								<option value="">全部</option>
+								<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
+								></option>
+							</select>
+						</div>
+
+						<div class="customize-form-group select-time">
+							<label>处方登记日期:</label>
+							<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="beginTime"/>
+							<span>-</span>
+							<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="endTime"/>
+						</div>
+						<div class="customize-form-group">
+							<label>订单状态</label>
+							<select name="status" th:with="type=${@dict.getType('sys_select_order_status')}" class="styled-input">
+								<option value="">全部</option>
+								<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
+								></option>
+							</select>
+						</div>
+					</div>
+				</form>
+			</div>
+			<div class="btn-group-sm" id="toolbar" role="group">
+				<!--		        	<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="dtp:recipe:add">-->
+				<!--		                <i class="fa fa-plus"></i> 处方登记APP-->
+				<!--		            </a>-->
+				<a class="btn btn-success" onclick="$.operate.addTab2()" shiro:hasPermission="dtp:recipe:add">
+					<i class="fa fa-plus"></i> 新建登记
+				</a>
+			</div>
+			<div class="col-sm-12 select-table table-striped" style="width: 100%; overflow-x: hidden;">
+				<table id="bootstrap-table" class="fixed-layout-table"></table>
 			</div>
 		</div>
-
 	</div>
 
-	<th:block th:include="include :: footer" />
-	<th:block th:include="include :: layout-latest-js" />
-	<th:block th:include="include :: bootstrap-table-fixed-columns-js" />
-	<th:block th:include="include :: ztree-js" />
-	<script th:inline="javascript">
-		var editFlag = [[${@permission.hasPermi('system:user:edit')}]];
-		var removeFlag = [[${@permission.hasPermi('system:user:remove')}]];
-		var prefix = ctx + "dtp/recipe";
+</div>
 
-		$(function() {
-		    var panehHidden = false;
-		    if ($(this).width() < 1590) {
-		        panehHidden = true;
-		    }
-		    $('body').layout({ initClosed: panehHidden, west__size: 185, resizeWithWindow: false });
-	     	// 回到顶部绑定
-	    	if ($.fn.toTop !== undefined) {
-	    		var opt = {
-	    			win:$('.ui-layout-center'),
-	    			doc:$('.ui-layout-center')
-	    		};
-	    		$('#scroll-up').toTop(opt);
-	    	}
-		    queryUserList();
-		});
+<th:block th:include="include :: footer" />
+<th:block th:include="include :: layout-latest-js" />
+<th:block th:include="include :: bootstrap-table-fixed-columns-js" />
+<th:block th:include="include :: ztree-js" />
+<script th:inline="javascript">
+	var editFlag = [[${@permission.hasPermi('system:user:edit')}]];
+	var removeFlag = [[${@permission.hasPermi('system:user:remove')}]];
+	var prefix = ctx + "dtp/recipe";
 
-		function queryUserList() {
-		    var options = {
-		        url: prefix + "/list",
-		        viewUrl: prefix + "/viewInfo/{id}",
-		        createUrl: prefix + "/add",
-				createUrl2: prefix + "/newRecipe",
-		        updateUrl: prefix + "/viewEditInfo/{id}",
-		        removeUrl: prefix + "/remove",
-		        exportUrl: prefix + "/export",
-		        //importUrl: prefix + "/importData",
-		        importTemplateUrl: prefix + "/importTemplate",
-		        sortName: "id",
-		        sortOrder: "desc",
-		        modalName: "处方登记信息",
-				fitColumns: true,
-				striped: true,
-				autoRowHeight: true,
-				rowNumbers: true,
-				showFooter:true,  //是否显示表格底部区域。
-				clickToSelect: true, //是否启用点击行时选中整行的功能。
-				singleSelect: true, //是否仅允许选择一行
-				fixedColumns: true,
-				//fixedNumber: 3,
-				fixedRightNumber: 1,
-				columns: [{
-					checkbox: true
-				}, {
-					field: "id",
-					title: "ID",
-					visible: false,
-				}, {
-					field: "prescriptionNumber",
-					title: "处方单号"
-				}, {
-					field: "saleOrderNumber",
-					title: "销售单号"
-				}, {
-					field: "hospital",
-					title: "医院"
-				}, {
-					field: "department",
-					title: "科室"
-				}, {
-					field: "prescribingDoctor",
-					title: "处方医生"
-				}, {
-					field: "attendingDoctor",
-					title: "主管医生"
-				}, {
-					field: "patientName",
-					title: "患者姓名"
-				}, {
-					field: "gender",
-					title: "性别"
-				}, {
-					field: "age",
-					title: "年龄"
-				} ,{
-					field: "patientPhone",
-					title: "患者手机号"
-				}, {
-					field: "storeName",
-					title: "建档门店",
-					visible: false,
-				}, {
-					field: "registrant",
-					title: "登记人"
-				}, {
-					field: "reviewingName",
-					title: "审核药师姓名"
-				}, {
-					field: "prescriptionType",
-					title: "处方类型",
-					formatter: function(value, row, index) {
-						switch (value) {
-							case 1:
-								return "电子处方";
-								break;
-							case 2:
-								return "纸质处方";
-								break;
-							default:
-								return "";
-						}
+	$(function() {
+		var panehHidden = false;
+		if ($(this).width() < 1590) {
+			panehHidden = true;
+		}
+		$('body').layout({ initClosed: panehHidden, west__size: 185, resizeWithWindow: false });
+		// 回到顶部绑定
+		if ($.fn.toTop !== undefined) {
+			var opt = {
+				win:$('.ui-layout-center'),
+				doc:$('.ui-layout-center')
+			};
+			$('#scroll-up').toTop(opt);
+		}
+		queryUserList();
+	});
+
+	function queryUserList() {
+		var options = {
+			url: prefix + "/list",
+			viewUrl: prefix + "/viewInfo/{id}",
+			createUrl: prefix + "/add",
+			createUrl2: prefix + "/newRecipe",
+			updateUrl: prefix + "/viewEditInfo/{id}",
+			removeUrl: prefix + "/remove",
+			exportUrl: prefix + "/export",
+			//importUrl: prefix + "/importData",
+			importTemplateUrl: prefix + "/importTemplate",
+			sortName: "id",
+			sortOrder: "desc",
+			modalName: "处方登记信息",
+			fitColumns: true,
+			striped: true,
+			autoRowHeight: true,
+			rowNumbers: true,
+			showFooter:true,  //是否显示表格底部区域。
+			clickToSelect: true, //是否启用点击行时选中整行的功能。
+			singleSelect: true, //是否仅允许选择一行
+			fixedColumns: true,
+			//fixedNumber: 3,
+			fixedRightNumber: 1,
+			columns: [{
+				checkbox: true
+			}, {
+				field: "id",
+				title: "ID",
+				visible: false,
+			}, {
+				field: "prescriptionNumber",
+				title: "处方单号"
+			}, {
+				field: "saleOrderNumber",
+				title: "销售单号"
+			}, {
+				field: "hospital",
+				title: "医院"
+			}, {
+				field: "department",
+				title: "科室"
+			}, {
+				field: "prescribingDoctor",
+				title: "处方医生"
+			}, {
+				field: "attendingDoctor",
+				title: "主管医生"
+			}, {
+				field: "patientName",
+				title: "患者姓名"
+			}, {
+				field: "gender",
+				title: "性别"
+			}, {
+				field: "age",
+				title: "年龄"
+			} ,{
+				field: "patientPhone",
+				title: "患者手机号"
+			}, {
+				field: "storeName",
+				title: "建档门店",
+				visible: false,
+			}, {
+				field: "registrant",
+				title: "登记人"
+			}, {
+				field: "reviewingName",
+				title: "审核药师姓名"
+			}, {
+				field: "prescriptionType",
+				title: "处方类型",
+				formatter: function(value, row, index) {
+					switch (value) {
+						case 1:
+							return "电子处方";
+							break;
+						case 2:
+							return "纸质处方";
+							break;
+						default:
+							return "";
 					}
-				}, {
-					field: "status",
-					title: "状态",
-					formatter: function(value, row, index) {
-						switch (value) {
-							case 1:
-								return "订单已完成";
-								break;
-							case 2:
-								return "待上传处方";
-								break;
-							case 3:
-								return "待确认信息";
-								break;
-							case 4:
-								return "待处方登记";
-								break;
-							case 5:
-								return "待订单销售";
-								break;
-							case 6:
-								return "待绑定患者";
-								break;
-							case 7:
-								return "处方已完成";
-								break;
-							case 8:
-								return "订单已退款";
-								break;
-							default:
-								return "待确认信息";
-						}
+				}
+			}, {
+				field: "status",
+				title: "状态",
+				formatter: function(value, row, index) {
+					switch (value) {
+						case 1:
+							return "订单已完成";
+							break;
+						case 2:
+							return "待上传处方";
+							break;
+						case 3:
+							return "待确认信息";
+							break;
+						case 4:
+							return "待处方登记";
+							break;
+						case 5:
+							return "待订单销售";
+							break;
+						case 6:
+							return "待绑定患者";
+							break;
+						case 7:
+							return "处方已完成";
+							break;
+						case 8:
+							return "订单已退款";
+							break;
+						default:
+							return "待确认信息";
 					}
-				}, {
-					field: "createdTime",
-					title: "创建时间"
-				}, {
-					field: "updatedTime",
-					title: "最后更新时间",
-					visible: false,
-				}, {
-					field: "prescriptionImageUrl",
-					title: "处方图片URL",
-					visible: false,
-				}, {
-					field: "invoiceImageUrl",
-					title: "发票图片URL",
-					visible: false,
-				}, {
-					field: "prescriptionIssueDate",
-					title: "处方开具日期"
-				}, {
-					field: "saleDate",
-					title: "销售日期"
-				}, {
-					field: "registrationDate",
-					title: "处方登记日期"
-				}, {
-					field: "drugVarietyCount",
-					title: "药品品种数",
-					visible: false,
-				}, {
-					field: "drugQuantity",
-					title: "处方取药数量"
-				}, {
-					field: "invoiceCode",
-					title: "发票编码",
-					visible: false,
-				}, {
-					field: "drugsLinkId",
-					title: "处方关联的处方购药药表ID",
-					visible: false,
-				}, {
-					field: "reviewStatus",
-					title: "处方审核状态",
-					formatter: function(value, row, index) {
-						switch (value) {
-							case 1:
-								return "审核通过";
-								break;
-							case 2:
-								return "待审核";
-								break;
-							case 3:
-								return "审核未通过";
-								break;
-							case 4:
-								return "待订单销售";
-								break;
-							default:
-								return "待确认信息";
-						}
+				}
+			}, {
+				field: "createdTime",
+				title: "创建时间"
+			}, {
+				field: "updatedTime",
+				title: "最后更新时间",
+				visible: false,
+			}, {
+				field: "prescriptionImageUrl",
+				title: "处方图片URL",
+				visible: false,
+			}, {
+				field: "invoiceImageUrl",
+				title: "发票图片URL",
+				visible: false,
+			}, {
+				field: "prescriptionIssueDate",
+				title: "处方开具日期"
+			}, {
+				field: "saleDate",
+				title: "销售日期"
+			}, {
+				field: "registrationDate",
+				title: "处方登记日期"
+			}, {
+				field: "drugVarietyCount",
+				title: "药品品种数",
+				visible: false,
+			}, {
+				field: "drugQuantity",
+				title: "处方取药数量"
+			}, {
+				field: "invoiceCode",
+				title: "发票编码",
+				visible: false,
+			}, {
+				field: "drugsLinkId",
+				title: "处方关联的处方购药药表ID",
+				visible: false,
+			}, {
+				field: "reviewStatus",
+				title: "处方审核状态",
+				formatter: function(value, row, index) {
+					switch (value) {
+						case 0:
+							return "审核不通过";
+							break;
+						case 1:
+							return "审核通过";
+							break;
+						default:
+							return "待审核";
 					}
-					}, {
-					field: "source",
-					title: "处方来源",
-					visible: false,
-				}, {
-					field: "drugRoute",
-					title: "用药途径",
-					visible: false,
-				}, {
-					field: "storeId",
-					title: "建档门店ID",
-					visible: false,
-				}, {
-					field: "remarks",
-					title: "备注",
-					visible: false,
-				}, {
-					title: '操作',
-					align: 'center',
-					width: 165,
-					formatter: function(value, row, index) {
-						if (row.id) {
-							var actions = [];
-							actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editTab(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
-							actions.push('<a class="btn btn-warning btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.view(\'' + row.id + '\')"><i class="fa fa-eye"></i>详情</a> ');
-							actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
-							return actions.join('');
-						} else {
-							return "";
-						}
+				}
+			}, {
+				field: "source",
+				title: "处方来源",
+				visible: false,
+			}, {
+				field: "drugRoute",
+				title: "用药途径",
+				visible: false,
+			}, {
+				field: "storeId",
+				title: "建档门店ID",
+				visible: false,
+			}, {
+				field: "remarks",
+				title: "备注",
+				visible: false,
+			}, {
+				title: '操作',
+				align: 'center',
+				width: 165,
+				formatter: function(value, row, index) {
+					if (row.id) {
+						var actions = [];
+						actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editTab(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
+						actions.push('<a class="btn btn-warning btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.view(\'' + row.id + '\')"><i class="fa fa-eye"></i>详情</a> ');
+						actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
+						return actions.join('');
+					} else {
+						return "";
 					}
-				}]
-		    };
-		    $.table.init(options);
-		}
+				}
+			}]
+		};
+		$.table.init(options);
+	}
 
-		/* 自定义重置-表单重置/隐藏框/树节点选择色/搜索 */
-		function resetPre() {
-			resetDate();
-			$("#user-form")[0].reset();
-			$("#deptId").val("");
-			$("#parentId").val("");
-			$(".curSelectedNode").removeClass("curSelectedNode");
-			$.table.search();
-		}
+	/* 自定义重置-表单重置/隐藏框/树节点选择色/搜索 */
+	function resetPre() {
+		resetDate();
+		$("#user-form")[0].reset();
+		$("#deptId").val("");
+		$("#parentId").val("");
+		$(".curSelectedNode").removeClass("curSelectedNode");
+		$.table.search();
+	}
 
-	</script>
+</script>
 </body>
-	<style>
-		.modal {
+<style>
+	.modal {
 		display: none;
 		position: fixed;
 		z-index: 1;
@@ -339,32 +333,32 @@
 		height: 100%;
 		overflow: auto;
 		background-color: rgba(0,0,0,0.4);
-		}
-		.modalbudan{
-			display: none;
-		}
-		.modal-content {
+	}
+	.modalbudan{
+		display: none;
+	}
+	.modal-content {
 		background-color: #fefefe;
 		margin: 15% auto;
 		padding: 20px;
 		border: 1px solid #888;
 		width: 90%;
-		}
-		.close {
+	}
+	.close {
 		color: #aaa;
 		float: right;
 		font-size: 28px;
 		font-weight: bold;
-		}
-		.close:hover,
-		.close:focus {
+	}
+	.close:hover,
+	.close:focus {
 		color: black;
 		text-decoration: none;
 		cursor: pointer;
-		}
-		.error-message {
-			color: red;
-			display: none;
-		}
+	}
+	.error-message {
+		color: red;
+		display: none;
+	}
 </style>
 </html>

+ 59 - 9
health-system/src/main/java/com/bzd/system/service/DTPService.java

@@ -181,6 +181,52 @@ public class DTPService {
            return resultpageData;
        }
     }
+
+
+    /**
+     * 药师列表
+     *
+     * @param pd
+     * @return
+     * @throws Exception
+     */
+    public List<PageData> findRevieForList(final PageData pd) throws Exception {
+        return (List<PageData>) daoSupport.findForList("reviewPharmacistsMapper.selectAllReviewPharmacists", pd);
+    }
+    /**
+     * 药师审核前输入密码
+     *
+     * @param pd
+     * @return
+     * @throws Exception
+     */
+    public PageData ReviewCheckInputPassword(final PageData pd) throws Exception {
+        PageData ob= (PageData) daoSupport.findForObject("reviewPharmacistsMapper.ReviewCheckInputPassword", pd);
+        return ob;
+    }
+    /**
+     * 药师审核处方
+     *
+     * @param pd
+     * @return
+     * @throws Exception
+     */
+    public PageData Review(final PageData pd) throws Exception {
+        PageData returnPageData= new PageData();
+        String reviewStatus = (String) pd.get("reviewStatus");
+        System.out.println("reviewStatus:"+reviewStatus);
+        int resultDrug =daoSupport.update("DTPCFDJMapper.Review", pd);
+        if(resultDrug>0){
+            returnPageData.put("code", 200);
+            returnPageData.put("msg", "审核成功");
+            return returnPageData;
+        }else {
+            returnPageData.put("msg", "审核失败");
+            returnPageData.put("code", 300);
+            return returnPageData;
+        }
+    }
+
     /**
      * 处方登记 添加
      *
@@ -189,8 +235,8 @@ public class DTPService {
      * @throws Exception
      */
     @Transactional(rollbackFor = Exception.class)
-    public int saveCFDJ(final PageData pd) throws Exception {
-
+    public PageData saveCFDJ(final PageData pd) throws Exception {
+        PageData returnPageData = new PageData();
 
         Object drugList = pd.get("drugData");//获取药品信息列表
         Integer Id = IdUtils.get10randomNumber();//生成处方单号
@@ -221,12 +267,12 @@ public class DTPService {
                         pageData.put("specification", lxr.get("specification"));
                         pageData.put("manufacturerShortName", lxr.get("manufacturerShortName"));
                         pageData.put("administrationMethod", lxr.get("administrationMethod"));
-                        pageData.put("packageQuantity", 1);
-                        pageData.put("singleDoseValue", 1);
+                        pageData.put("packageQuantity", 1);//处方取药数量(包装数)输入框的值
+                        pageData.put("singleDoseValue", 1);//处方单次剂量数值 输入框的值
                         pageData.put("singleDoseUnit", lxr.get("singleDoseUnit"));
                         pageData.put("dosageFrequency", lxr.get("dosageFrequency"));
-                        pageData.put("dosageFrequencyDays", 1);
-                        pageData.put("dvalueDays", 1);
+                        pageData.put("dosageFrequencyDays", 1);//用药频次换算使用天数 下拉带出来的 要去字典的value
+                        pageData.put("dvalueDays", 1);//待计算
 
 
                         // 添加其他可能需要的字段(如果有的话)
@@ -250,7 +296,7 @@ public class DTPService {
                     }
                     final HashMap<String, Object> addMap = new HashMap<String, Object>();
                     addMap.put("dataList", addList);
-                     resultDrug= dao.executeBatch("DTPCFDJMapper.batchAddDrugPurchaseRecord", addMap);
+                    resultDrug= dao.executeBatch("DTPCFDJMapper.batchAddDrugPurchaseRecord", addMap);
                 }
 
             } catch (Exception e) {
@@ -292,9 +338,13 @@ public class DTPService {
         pd.put("age", pd.get("age"));
         int result = daoSupport.save("DTPCFDJMapper.insertPrescriptionRegistration", pd);
         if(resultDrug>0 && result>0){
-            return 1;
+            returnPageData.put("code", 200);
+            returnPageData.put("prescriptionNumber", Id);
+            return returnPageData;
         }else {
-            return 0;
+            returnPageData.put("msg", "天添加败");
+            returnPageData.put("code", 300);
+            return returnPageData;
         }
     }
 

+ 10 - 8
health-system/src/main/resources/mapper/gxhpz/reviewPharmacistsMapper.xml

@@ -5,7 +5,7 @@
 <mapper namespace="reviewPharmacistsMapper">
 
     <!-- 查询所有审核药师 -->
-    <select id="selectAllReviewPharmacists" parameterType="map" resultType="map">
+    <select id="selectAllReviewPharmacists" parameterType="pd" resultType="pd">
         SELECT * FROM s_dtp_review_pharmacists WHERE 1=1
         <if test="pharmacistName != null and pharmacistName != ''">
             AND pharmacistName = #{pharmacistName}
@@ -28,17 +28,19 @@
     </select>
 
     <!-- 根据 ID 查询单个审核药师 -->
-    <select id="selectReviewPharmacistById" parameterType="long" resultType="map">
+    <select id="ReviewCheckInputPassword" parameterType="pd" resultType="pd">
+        SELECT * FROM s_dtp_review_pharmacists WHERE id = #{id} and reviewPassword=#{reviewPassword}
+    </select>
+    <select id="selectReviewPharmacistById" parameterType="long" resultType="pd">
         SELECT * FROM s_dtp_review_pharmacists WHERE id = #{id}
     </select>
-
     <!-- 检查是否存在特定药师 -->
-    <select id="checkPharmacistByNameAndStore" parameterType="map" resultType="map">
+    <select id="checkPharmacistByNameAndStore" parameterType="pd" resultType="pd">
         SELECT * FROM s_dtp_review_pharmacists WHERE pharmacistName = #{pharmacistName} AND storeId = #{storeId}
     </select>
 
     <!-- 更新审核药师信息 -->
-    <update id="updateReviewPharmacist" parameterType="map">
+    <update id="updateReviewPharmacist" parameterType="pd">
         UPDATE s_dtp_review_pharmacists
         <trim prefix="SET " suffix="" prefixOverrides="," suffixOverrides=",">
             <if test="pharmacistName != null and pharmacistName != ''">
@@ -66,7 +68,7 @@
     </update>
 
     <!-- 根据 d_value_code 更新审核药师信息 -->
-    <update id="updateReviewPharmacistByStoreId" parameterType="map">
+    <update id="updateReviewPharmacistByStoreId" parameterType="pd">
         UPDATE s_dtp_review_pharmacists
         <trim prefix="SET " suffix="" prefixOverrides="," suffixOverrides=",">
             <if test="pharmacistName != null and pharmacistName != ''">
@@ -102,7 +104,7 @@
     </delete>
 
     <!-- 插入新的审核药师 -->
-    <insert id="insertReviewPharmacist" parameterType="map">
+    <insert id="insertReviewPharmacist" parameterType="pd">
         INSERT INTO s_dtp_review_pharmacists
         <trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
             <if test="pharmacistName != null and pharmacistName != ''">
@@ -148,7 +150,7 @@
     </insert>
 
     <!-- 修改审核药师密码 -->
-    <update id="changeStatus" parameterType="map">
+    <update id="changeStatus" parameterType="pd">
         UPDATE s_dtp_review_pharmacists SET updatedTime = #{updatedTime}, reviewPassword = #{reviewPassword} WHERE id = #{id}
     </update>
 </mapper>

+ 18 - 1
health-system/src/main/resources/mapper/mdyy/DTPCFDJMapper.xml

@@ -599,5 +599,22 @@
     <insert id="batchDeleteDrugPurchaseRecord" parameterType="pd">
         delete from s_dtp_drug_purchase_record where prescriptionNumber = #{prescriptionNumber}
     </insert>
-
+    <!-- 更新记录 -->
+    <update id="Review" parameterType="pd">
+        update s_dtp_prescription_registration
+        <trim prefix="SET " suffix="" prefixOverrides="," suffixOverrides=",">
+            <if test="reviewingName != null and reviewingName != ''">
+                reviewingName = #{reviewingName},
+            </if>
+            <if test="reviewStatus != null and remarks != ''">
+                reviewStatus = #{reviewStatus},
+            </if>
+            <if test="remarks != null and remarks != ''">
+                remarks = #{remarks}
+            </if>
+        </trim>
+        <if test="prescriptionNumber != null and prescriptionNumber != ''">
+            where prescriptionNumber = #{prescriptionNumber}
+        </if>
+    </update>
 </mapper>