Browse Source

commit 二次业务需求 业务代码

bzd_wsp 2 months ago
parent
commit
8011b10cec
62 changed files with 10734 additions and 1152 deletions
  1. 38 0
      health-admin/pom.xml
  2. 51 0
      health-admin/src/main/java/com/bzd/web/controller/bbfx/EncryptUtils.java
  3. 62 0
      health-admin/src/main/java/com/bzd/web/controller/bbfx/SM3Example.java
  4. 36 14
      health-admin/src/main/java/com/bzd/web/controller/common/CommonController.java
  5. 209 11
      health-admin/src/main/java/com/bzd/web/controller/dtp/PharmaceuticalServiceController.java
  6. 66 2
      health-admin/src/main/java/com/bzd/web/controller/dtp/RecipeRegisterController.java
  7. 254 0
      health-admin/src/main/java/com/bzd/web/controller/gxhpz/DrugConfigController.java
  8. 245 0
      health-admin/src/main/java/com/bzd/web/controller/gxhpz/DvalueConfigController.java
  9. 18 1
      health-admin/src/main/resources/static/health/css/input-styles.css
  10. 78 0
      health-admin/src/main/resources/static/health/js/common.js
  11. 40 0
      health-admin/src/main/resources/static/health/js/ry-ui.js
  12. 1036 67
      health-admin/src/main/resources/templates/dtp/SDtpYypzFollowUpSopAdd.html
  13. 8 7
      health-admin/src/main/resources/templates/dtp/SDtpYypzFollowUpSopList.html
  14. 372 71
      health-admin/src/main/resources/templates/dtp/SDtpYypzFollowUpSopPageEdit.html
  15. 68 26
      health-admin/src/main/resources/templates/dtp/archives/archivesAdd.html
  16. 118 88
      health-admin/src/main/resources/templates/dtp/archives/archivesEdit.html
  17. 16 6
      health-admin/src/main/resources/templates/dtp/archives/archivesList.html
  18. 1631 143
      health-admin/src/main/resources/templates/dtp/followUp/followUpEdit.html
  19. 179 54
      health-admin/src/main/resources/templates/dtp/followUp/followUpList.html
  20. 297 56
      health-admin/src/main/resources/templates/dtp/followUpAssign/followUpAssignList.html
  21. 98 0
      health-admin/src/main/resources/templates/dtp/patientCounseling/patientCounselingAdd.html
  22. 97 110
      health-admin/src/main/resources/templates/dtp/patientCounseling/patientCounselingEdit.html
  23. 41 44
      health-admin/src/main/resources/templates/dtp/patientCounseling/patientCounselingList.html
  24. 152 101
      health-admin/src/main/resources/templates/dtp/recipe/add.html
  25. 34 37
      health-admin/src/main/resources/templates/dtp/recipe/drugInfo.html
  26. 22 11
      health-admin/src/main/resources/templates/dtp/recipe/edit.html
  27. 156 0
      health-admin/src/main/resources/templates/dtp/recipe/huanzheBanding.html
  28. 118 7
      health-admin/src/main/resources/templates/dtp/recipe/recipe.html
  29. 520 0
      health-admin/src/main/resources/templates/gxhpz/addRepurchasedGoods.html
  30. 366 0
      health-admin/src/main/resources/templates/gxhpz/allDrugsInfo.html
  31. 125 0
      health-admin/src/main/resources/templates/gxhpz/drugconfigAdd.html
  32. 126 0
      health-admin/src/main/resources/templates/gxhpz/drugconfigDetail.html
  33. 127 0
      health-admin/src/main/resources/templates/gxhpz/drugconfigEdit.html
  34. 436 0
      health-admin/src/main/resources/templates/gxhpz/drugconfigList.html
  35. 119 0
      health-admin/src/main/resources/templates/gxhpz/dvalueconfigAdd.html
  36. 120 0
      health-admin/src/main/resources/templates/gxhpz/dvalueconfigDetail.html
  37. 121 0
      health-admin/src/main/resources/templates/gxhpz/dvalueconfigEdit.html
  38. 231 0
      health-admin/src/main/resources/templates/gxhpz/dvalueconfigList.html
  39. 90 0
      health-admin/src/main/resources/templates/jggl/test.html
  40. 12 12
      health-admin/src/main/resources/templates/monitor/server/server.html
  41. 62 17
      health-admin/src/main/resources/templates/spgl/SSpglJfspProductinfoAdd.html
  42. 62 17
      health-admin/src/main/resources/templates/spgl/SSpglJfspProductinfoEdit.html
  43. 137 37
      health-admin/src/main/resources/templates/spgl/SSpglJfspProductinfoList.html
  44. 67 26
      health-admin/src/main/resources/templates/system/dept/add.html
  45. 70 25
      health-admin/src/main/resources/templates/system/dept/edit.html
  46. 2 0
      health-common/pom.xml
  47. 122 4
      health-common/src/main/java/com/bzd/common/core/domain/entity/SysDept.java
  48. 9 1
      health-common/src/main/java/com/bzd/common/utils/uuid/IdUtils.java
  49. 89 0
      health-common/src/main/java/com/bzd/common/utils/uuid/SnowflakeIdGenerator.java
  50. 18 1
      health-common/src/main/java/com/bzd/common/utils/uuid/UUID.java
  51. 13 4
      health-system/src/main/java/com/bzd/system/service/DTPService.java
  52. 83 6
      health-system/src/main/java/com/bzd/system/service/PharmaceuticalService.java
  53. 121 3
      health-system/src/main/java/com/bzd/system/service/dtp/SDtpYypzFollowUpSopService.java
  54. 118 0
      health-system/src/main/java/com/bzd/system/service/gxhpz/DrugConfigService.java
  55. 174 0
      health-system/src/main/java/com/bzd/system/service/gxhpz/DvalueConfigService.java
  56. 326 1
      health-system/src/main/resources/mapper/dtp/SDtpYypzFollowUpSopMapper.xml
  57. 444 0
      health-system/src/main/resources/mapper/gxhpz/drugConfigMapper.xml
  58. 332 0
      health-system/src/main/resources/mapper/gxhpz/dvalueConfigMapper.xml
  59. 265 36
      health-system/src/main/resources/mapper/pmServiceMapper/PharmaceuticalServiceMapper.xml
  60. 188 100
      health-system/src/main/resources/mapper/system/DTPMapper.xml
  61. 86 5
      health-system/src/main/resources/mapper/system/SysDeptMapper.xml
  62. 13 1
      pom.xml

+ 38 - 0
health-admin/pom.xml

@@ -54,18 +54,56 @@
             <groupId>com.bzd</groupId>
             <artifactId>health-framework</artifactId>
         </dependency>
+        <!-- 其他依赖 -->
 
+<!--        <dependency>-->
+<!--            <groupId>com.bzd</groupId>-->
+<!--            <artifactId>aip-java-sdk-4.16.19.jar</artifactId>-->
+<!--            <version>4.16.19</version>-->
+<!--            <scope>compile</scope>-->
+<!--            <systemPath>${project.basedir}/lib/aip-java-sdk-4.16.19.jar</systemPath>-->
+<!--        </dependency>-->
+<!--        <dependency>-->
+<!--            <groupId>com.bzd</groupId>-->
+<!--            <artifactId>json-20160810.jar</artifactId>-->
+<!--            <version>20160810</version>-->
+<!--            <scope>compile</scope>-->
+<!--            <systemPath>${project.basedir}/lib/json-20160810.jar</systemPath>-->
+<!--        </dependency>-->
+        <!-- 百度 AI 平台 Java SDK -->
+        <dependency>
+            <groupId>com.baidu.aip</groupId>
+            <artifactId>java-sdk</artifactId>
+            <version>4.16.19</version> <!-- 请替换为实际的最新版本号 -->
+        </dependency>
+
+        <!-- JSON 库 -->
+        <dependency>
+            <groupId>org.json</groupId>
+            <artifactId>json</artifactId>
+            <version>20160810</version>
+        </dependency>
         <!-- 定时任务-->
         <dependency>
             <groupId>com.bzd</groupId>
             <artifactId>health-quartz</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.bouncycastle</groupId>
+            <artifactId>bcprov-jdk15on</artifactId>
+            <version>1.68</version> <!-- 请使用最新版本 -->
+        </dependency>
 
         <!-- 代码生成-->
         <dependency>
             <groupId>com.bzd</groupId>
             <artifactId>health-generator</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.bouncycastle</groupId>
+            <artifactId>bcprov-jdk18on</artifactId>
+            <version>1.73</version>
+        </dependency>
 
     </dependencies>
 

+ 51 - 0
health-admin/src/main/java/com/bzd/web/controller/bbfx/EncryptUtils.java

@@ -0,0 +1,51 @@
+package com.bzd.web.controller.bbfx;
+
+import org.bouncycastle.crypto.digests.SM3Digest;
+import org.bouncycastle.jce.provider.BouncyCastleProvider;
+
+import java.nio.charset.StandardCharsets;
+import java.security.Security;
+
+
+public class EncryptUtils {
+    static {
+        // 添加安全提供者(SM2,SM3,SM4等加密算法,CBC、CFB等加密模式,PKCS7Padding等填充方式,不在Java标准库中,由BouncyCastleProvider实现)
+        Security.addProvider(new BouncyCastleProvider());
+    }
+
+    /**
+     * SM3,国家商用密码(Shang Mi3)也称国密3,是中华人民共和国政府采用的一种密码散列函数标准,由国家密码管理局于2010年12月17日发布。
+     * <p>
+     * 输入:待加密的字符串
+     * 输出:256位(16字节)或64个16进制字符(常用)
+     * 应用:密码管理、数字签名、文件完整性校验
+     * 安全性:★★☆☆☆
+     *
+     * @param plainString 明文
+     * @return cipherString 密文
+     */
+    public static String sm3(String plainString) {
+        String cipherString = null;
+        try {
+            // 创建SM3Digest对象
+            SM3Digest sm3Digest = new SM3Digest();
+            // 初始化SM3计算
+            sm3Digest.update(plainString.getBytes(StandardCharsets.UTF_8), 0, plainString.length());
+            // 创建输出缓冲区
+            byte[] cipherBytes = new byte[sm3Digest.getDigestSize()];
+            // 计算SM3摘要
+            sm3Digest.doFinal(cipherBytes, 0);
+            // 输出16进制字符串
+            StringBuilder sb = new StringBuilder();
+            for (byte b : cipherBytes) {
+                sb.append(String.format("%02x", b));
+            }
+            cipherString = sb.toString();
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        return cipherString;
+    }
+
+
+}

+ 62 - 0
health-admin/src/main/java/com/bzd/web/controller/bbfx/SM3Example.java

@@ -0,0 +1,62 @@
+package com.bzd.web.controller.bbfx;
+
+import com.bzd.common.utils.DateUtils;
+import org.bouncycastle.crypto.digests.SM3Digest;
+
+import java.time.LocalDateTime;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
+import java.time.format.DateTimeFormatter;
+
+public class SM3Example {
+
+    public static void main(String[] args) {
+        // 定义日期时间格式
+        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
+
+        // 指定的时间字符串
+        String dateStr = DateUtils.getTime();
+        System.out.println("dateStr: " + dateStr);
+        // 将字符串解析为LocalDateTime
+        LocalDateTime localDateTime = LocalDateTime.parse(dateStr, formatter);
+
+        // 转换为ZonedDateTime,这里假设时区为系统默认时区
+        ZonedDateTime zonedDateTime = localDateTime.atZone(ZoneId.systemDefault());
+
+        // 获取时间戳
+        long timestamp = zonedDateTime.toInstant().toEpochMilli();
+        System.out.println("timestamp: " + timestamp);
+        // 示例消息
+        String message = "宝智达_"+timestamp+"_8DEE0C919D045B43DE17080181D30";
+
+        // 计算SM3哈希值
+        //byte[] hash = sm3Hash(message);
+       String hash= EncryptUtils.sm3(message);
+        // 将哈希值转换为十六进制字符串
+        //String hexString = new String(Hex.encode(hash));
+        // 将十六进制字符串中的字母转为大写
+        String upperCaseHexString = hash.toUpperCase();
+        System.out.println("Message: " + message);
+        System.out.println("SM3 upperCaseHexString: " + upperCaseHexString);
+    }
+
+    /**
+     * 计算SM3哈希值
+     *
+     * @param input 输入的消息
+     * @return SM3哈希值
+     */
+    public static byte[] sm3Hash(String input) {
+        SM3Digest digest = new SM3Digest();
+        byte[] bytes = input.getBytes();
+
+        // 更新摘要
+        digest.update(bytes, 0, bytes.length);
+
+        // 计算哈希值
+        byte[] hash = new byte[digest.getDigestSize()];
+        digest.doFinal(hash, 0);
+
+        return hash;
+    }
+}

+ 36 - 14
health-admin/src/main/java/com/bzd/web/controller/common/CommonController.java

@@ -1,19 +1,6 @@
 package com.bzd.web.controller.common;
 
-import java.util.ArrayList;
-import java.util.List;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.http.MediaType;
-import org.springframework.stereotype.Controller;
-import org.springframework.web.bind.annotation.GetMapping;
-import org.springframework.web.bind.annotation.PostMapping;
-import org.springframework.web.bind.annotation.RequestMapping;
-import org.springframework.web.bind.annotation.ResponseBody;
-import org.springframework.web.multipart.MultipartFile;
+import com.baidu.aip.ocr.AipOcr;
 import com.bzd.common.config.HealthConfig;
 import com.bzd.common.config.ServerConfig;
 import com.bzd.common.constant.Constants;
@@ -21,7 +8,20 @@ import com.bzd.common.core.domain.AjaxResult;
 import com.bzd.common.utils.StringUtils;
 import com.bzd.common.utils.file.FileUploadUtils;
 import com.bzd.common.utils.file.FileUtils;
+import org.json.JSONObject;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.MediaType;
+import org.springframework.stereotype.Controller;
+import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
 /**
  * 通用请求处理
  *
@@ -38,6 +38,28 @@ public class CommonController
 
     private static final String FILE_DELIMETER = ",";
 
+
+    private final AipOcr client;
+
+    public CommonController() {
+        this.client = new AipOcr("116175151", "kCf9zQbSFkHmqKlo2bewI7Fe", "IHaSX3X76k0vLBTcOT3Z8SKJ1q6SF07i");
+    }
+
+    @PostMapping("/idCard")
+    public AjaxResult recognizeIdCard(@RequestParam("image") MultipartFile file) {
+        try {
+            byte[] imageBytes = file.getBytes();
+            HashMap<String, String> options = new HashMap<>();
+            options.put("detect_direction", "true");
+            options.put("detect_risk", "false");
+            String idCardSide = "front";
+            JSONObject res = client.idcard(imageBytes, idCardSide, options);
+            return AjaxResult.success(res);
+        } catch (Exception e) {
+            e.printStackTrace();
+            return AjaxResult.error();
+        }
+    }
     /**
      * 通用下载请求
      *

+ 209 - 11
health-admin/src/main/java/com/bzd/web/controller/dtp/PharmaceuticalServiceController.java

@@ -1,23 +1,31 @@
 package com.bzd.web.controller.dtp;
 
+import com.baidu.aip.ocr.AipOcr;
 import com.bzd.common.annotation.Log;
+import com.bzd.common.config.HealthConfig;
 import com.bzd.common.config.dao.PageData;
 import com.bzd.common.core.controller.BaseController;
 import com.bzd.common.core.domain.AjaxResult;
 import com.bzd.common.core.page.TableDataInfo;
 import com.bzd.common.enums.BusinessType;
-import com.bzd.common.utils.DateUtils;
 import com.bzd.common.utils.ServletUtils;
 import com.bzd.common.utils.StringUtils;
+import com.bzd.common.utils.file.FileUploadUtils;
+import com.bzd.common.utils.file.MimeTypeUtils;
 import com.bzd.system.service.PharmaceuticalService;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.json.JSONObject;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
+import java.util.HashMap;
 import java.util.List;
 
+import static com.bzd.common.config.datasource.DynamicDataSourceContextHolder.log;
+
 /**
  * 药事服务管理
  * creator wsp
@@ -44,6 +52,7 @@ public class PharmaceuticalServiceController extends BaseController {
     @Autowired
     private PharmaceuticalService pharmaceuticalService;
 
+    private final AipOcr client;
     /**
      * 档案管理页
      *
@@ -70,6 +79,21 @@ public class PharmaceuticalServiceController extends BaseController {
         List<PageData> pageData = pharmaceuticalService.findArchivesList(pd);
         return getDataTable(pageData);
     }
+    /**
+     * 档案管理数据查询
+     *
+     * @return
+     * @throws Exception
+     */
+    @RequiresPermissions("dtp:pmService:archivesList")
+    @PostMapping("/slectPatientByNameOrPhone")
+    @ResponseBody
+    public TableDataInfo slectPatientByNameOrPhone() throws Exception {
+        PageData pd = this.getPageData();
+        startPage();
+        List<PageData> pageData = pharmaceuticalService.slectPatientByNameOrPhone(pd);
+        return getDataTable(pageData);
+    }
 
     /**
      * 档案管理数据删除 根据id
@@ -114,6 +138,8 @@ public class PharmaceuticalServiceController extends BaseController {
         mmap.putAll(pageData);
         return prefix_archives + "/archivesEdit";
     }
+
+
     /**
      * 档案管理数据编辑2
      *
@@ -132,7 +158,8 @@ public class PharmaceuticalServiceController extends BaseController {
      * @return
      * @throws Exception
      */
-    @RequiresPermissions("dtp:pmService:add")
+
+
     @GetMapping("/archivesAdd")
     public String archivesAdd(ModelMap mmap) {
         mmap.put("posts", 1);
@@ -140,6 +167,49 @@ public class PharmaceuticalServiceController extends BaseController {
     }
 
     /**
+     * 保存处方照片
+     */
+    @Log(title = "处方信息", businessType = BusinessType.UPDATE)
+    @PostMapping("/updateIdcardImg")
+    @ResponseBody
+    public AjaxResult updatePrescriptionImg(@RequestParam("idcardImgfile") MultipartFile file)
+    {
+        try
+        {
+            if (!file.isEmpty())
+            {
+                String idCardImg = FileUploadUtils.upload(HealthConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION);
+                return success(idCardImg);
+            }
+            return error();
+        }
+        catch (Exception e)
+        {
+            log.error("修改处方信息失败!", e);
+            return error(e.getMessage());
+        }
+    }
+    public PharmaceuticalServiceController() {
+        this.client = new AipOcr("116175151", "kCf9zQbSFkHmqKlo2bewI7Fe", "IHaSX3X76k0vLBTcOT3Z8SKJ1q6SF07i");
+    }
+    @RequiresPermissions("dtp:pmService:add")
+    @PostMapping("/idCard")
+    @ResponseBody
+    public AjaxResult recognizeIdCard(@RequestParam("image") MultipartFile file) {
+        try {
+            byte[] imageBytes = file.getBytes();
+            HashMap<String, String> options = new HashMap<>();
+            options.put("detect_direction", "true");
+            options.put("detect_risk", "false");
+            String idCardSide = "front";
+            JSONObject res = client.idcard(imageBytes, idCardSide, options);
+            return AjaxResult.success(res.toMap());
+        } catch (Exception e) {
+            e.printStackTrace();
+            return AjaxResult.error();
+        }
+    }
+    /**
      * 患者建档新增保存
      */
     @Log(title = "患者建档新增保存", businessType = BusinessType.INSERT)
@@ -148,9 +218,9 @@ public class PharmaceuticalServiceController extends BaseController {
     public AjaxResult addSave() throws Exception {
         PageData pd = new PageData();
         pd = this.getPageData();
-       String dateBirth= pd.get("dateBirth").toString();
-       if(!dateBirth.isEmpty()){
-          Integer age = ServletUtils.calculateAge(dateBirth);//根据出生日期字符串计算年龄
+       Object dateBirth= pd.get("dateBirth");
+       if(StringUtils.isNotNull(dateBirth)){
+          Integer age = ServletUtils.calculateAge(dateBirth.toString());//根据出生日期字符串计算年龄
            pd.put("age",age);
        }
         if (!pharmaceuticalService.checkPatientIsExist(pd))
@@ -161,6 +231,74 @@ public class PharmaceuticalServiceController extends BaseController {
         return toAjax(integer);
     }
 
+    /**
+     * 扫码上翻
+     */
+    @RequiresPermissions("dtp:pmService:edit")
+    @Log(title = "档案管理修改", businessType = BusinessType.UPDATE)
+    @PostMapping("/ShaoMaShangFan")
+    @ResponseBody
+    public AjaxResult ShaoMaShangFan() throws Exception {
+        PageData pd = this.getPageData();
+        pd.put("up", "up");
+        try {
+            Object openId = pd.get("openId");
+            Object patientId = pd.get("patientId");
+            if(patientId != null && !pd.get("patientId").toString().isEmpty()){
+                pd.put("id", patientId);
+            }
+            if(openId != null && !pd.get("openId").toString().isEmpty()){
+                Integer updateResult = pharmaceuticalService.ShaoMaShangFan(pd);
+                if (updateResult == 1) {
+                    // 成功更新
+                    return AjaxResult.success("上翻成功");
+                } else {
+                    // 更新失败
+                    logger.error("Failed to update archives with ID: {}", pd.get("id"));
+                    return AjaxResult.error("上翻失败");
+                }
+            }else{
+                logger.error("Failed to update archives with openId: {}", pd.get("openId"));
+                return AjaxResult.error("上翻失败");
+            }
+
+        } catch (Exception e) {
+            // 异常处理
+            logger.error("Error occurred while updating archives with ID: {}, Exception: {}", pd.get("id"), e.getMessage(), e);
+            return AjaxResult.error("系统异常:" + e.getMessage());
+        }
+    }
+    /**
+     * 解绑
+     */
+    @RequiresPermissions("dtp:pmService:edit")
+    @Log(title = "解绑", businessType = BusinessType.UPDATE)
+    @PostMapping("/unbound")
+    @ResponseBody
+    public AjaxResult unbound() throws Exception {
+        PageData pd = this.getPageData();
+        pd.put("up", "up");
+            try {
+                Object id = pd.get("id");
+                if(StringUtils.isNull(id)){
+                    return AjaxResult.error("未获取患者id 无法解绑");
+                }
+                    pd.put("noFlipCause", "患者已解绑");//未扫码原因之一
+                    Integer updateResult = pharmaceuticalService.unbound(pd);
+                    if (updateResult == 1) {
+                        // 成功更新
+                        return AjaxResult.success("解绑成功");
+                    } else {
+                        // 更新失败
+                        logger.error("解绑 操作 Failed to update archives with ID: {}", pd.get("id"));
+                        return AjaxResult.error("解绑失败");
+                    }
+            } catch (Exception e) {
+                // 异常处理
+                logger.error("Error occurred while updating archives with ID: {}, Exception: {}", pd.get("id"), e.getMessage(), e);
+                return AjaxResult.error("系统异常:" + e.getMessage());
+            }
+      }
 
     /**
      * 保存档案管理数据修改
@@ -209,6 +347,21 @@ public class PharmaceuticalServiceController extends BaseController {
             return AjaxResult.error("系统异常:" + e.getMessage());
         }
     }
+    /**
+     * 获取对应患者的用药购药信息
+     *
+     * @return
+     * @throws Exception
+     */
+    @RequiresPermissions("dtp:pmService:archivesList")
+    @PostMapping("/getDrugPurchaseList")
+    @ResponseBody
+    public TableDataInfo getDrugPurchaseList() throws Exception {
+        PageData pd = this.getPageData();
+        startPage();
+        List<PageData> pageData = pharmaceuticalService.getDrugPurchaseList(pd);
+        return getDataTable(pageData);
+    }
 
     /**
      * 随访任务页
@@ -465,17 +618,62 @@ public class PharmaceuticalServiceController extends BaseController {
      * @throws Exception
      */
     @RequiresPermissions("dtp:pmService:edit")
-    @GetMapping("/patientCounselingEdit/{patientCounselingId}")
-    public String patientCounselingView(@PathVariable("patientCounselingId") Long patientCounselingId, ModelMap mmap) throws Exception {
+    @GetMapping("/patientCounselingEdit/{id}")
+    public String patientCounselingView(@PathVariable("id") Long id, ModelMap mmap) throws Exception {
         PageData pd = this.getPageData();
-        pd.put("id", patientCounselingId);
-        PageData pageData = pharmaceuticalService.findPatientCounselingList(pd).get(0);
-        mmap.putAll(pageData);
+        if (id != null && id != 0) {
+            pd.put("id", id);
+            PageData pageData = pharmaceuticalService.findPatientCounselingById(pd).get(0);
+            mmap.putAll(pageData);
+        }else {
+            mmap.put("null","暂无数据");
+        }
         return prefix_patient_counseling + "/patientCounselingEdit";
     }
 
     /**
-     * 保存患者咨询数据修改
+     * 患者咨询添加跳转页面
+     */
+    @RequiresPermissions("dtp:pmService:add")
+    @GetMapping("/patientCounselingAdd")
+    public String patientCounselingAdd(ModelMap mmap) throws Exception {
+        mmap.put("userid", getSysUser().getUserId());
+
+        PageData pd = new PageData();
+        pd.put("DeptId", getSysUser().getDeptId());
+        List<PageData> patients = pharmaceuticalService.getAllPatients(pd);
+        mmap.addAttribute("patients", patients);
+        mmap.put("patients", patients);
+        return prefix_patient_counseling + "/patientCounselingAdd";
+    }
+
+
+    /**
+     * 患者咨询信息保存
+     */
+    @RequiresPermissions("dtp:pmService:add")
+    @Log(title = "患者咨询信息新增", businessType = BusinessType.INSERT)
+    @PostMapping("/patientCounselingAdd")
+    @ResponseBody
+    public AjaxResult patientCounselingSave() throws Exception {
+        PageData pd = new PageData();
+        pd = this.getPageData();
+        try {
+
+            Integer result= pharmaceuticalService.insertPatientConsultation(pd);
+            if(result>0){
+                return AjaxResult.success("添加成功:");
+            }else {
+                return AjaxResult.error("添加失败");
+            }
+        }catch (Exception e) {
+            return AjaxResult.error("添加失败" + e.getMessage());
+        }
+    }
+
+
+    /**
+     * 患者咨询数据修改
      */
     @RequiresPermissions("dtp:pmService:edit")
     @Log(title = "档案管理修改", businessType = BusinessType.UPDATE)

+ 66 - 2
health-admin/src/main/java/com/bzd/web/controller/dtp/RecipeRegisterController.java

@@ -1,24 +1,29 @@
 package com.bzd.web.controller.dtp;
 
 import com.bzd.common.annotation.Log;
+import com.bzd.common.config.HealthConfig;
 import com.bzd.common.config.dao.PageData;
 import com.bzd.common.core.controller.BaseController;
 import com.bzd.common.core.domain.AjaxResult;
 import com.bzd.common.core.page.TableDataInfo;
 import com.bzd.common.enums.BusinessType;
 import com.bzd.common.utils.StringUtils;
+import com.bzd.common.utils.file.FileUploadUtils;
+import com.bzd.common.utils.file.MimeTypeUtils;
 import com.bzd.common.utils.poi.ExcelUtil;
 import com.bzd.system.service.DTPService;
-import com.bzd.system.service.PharmaceuticalService;
 import org.apache.shiro.authz.annotation.RequiresPermissions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
 
 import java.util.Arrays;
 import java.util.List;
 
+import static com.bzd.common.config.datasource.DynamicDataSourceContextHolder.log;
+
 /**
  * 处方登记管理
  * creator wsp
@@ -73,6 +78,18 @@ public class RecipeRegisterController extends BaseController {
         mmap.put("posts", 1);
         return prefix + "/drugInfo";
     }
+    /**
+     * 绑定患者页面弹框
+     */
+    @RequiresPermissions("dtp:recipe:view")
+    @GetMapping("/huanzheBanding")
+    public String huanzheBanding(ModelMap mmap)
+    {
+        mmap.put("posts", 1);
+        return prefix + "/huanzheBanding";
+    }
+
+
 
     /**
      * 处方登记新增保存
@@ -88,6 +105,32 @@ public class RecipeRegisterController extends BaseController {
         return AjaxResult.success(object.get("result").toString(),object);
     }
 
+
+    /**
+     * 保存处方照片
+     */
+    @Log(title = "处方信息", businessType = BusinessType.UPDATE)
+    @PostMapping("/updatePrescriptionImg")
+    @ResponseBody
+    public AjaxResult updatePrescriptionImg(@RequestParam("prescriptionfile") MultipartFile file)
+    {
+        try
+        {
+            if (!file.isEmpty())
+            {
+                String prescriptionImg = FileUploadUtils.upload(HealthConfig.getAvatarPath(), file, MimeTypeUtils.IMAGE_EXTENSION);
+                    return success(prescriptionImg);
+            }
+            return error();
+        }
+        catch (Exception e)
+        {
+            log.error("修改处方信息失败!", e);
+            return error(e.getMessage());
+        }
+    }
+
+
     @Log(title = "处方登记删除", businessType = BusinessType.DELETE)
     @PostMapping("/remove")
     @ResponseBody
@@ -116,7 +159,28 @@ public class RecipeRegisterController extends BaseController {
         mmap.putAll(pageData);
         return prefix + "/edit";
     }
-
+    /**
+     * 绑定患者
+     */
+    @RequiresPermissions("dtp:recipe:edit")
+    @Log(title = "档案管理修改", businessType = BusinessType.UPDATE)
+    @PostMapping("/BandingRecipe")
+    @ResponseBody
+    public AjaxResult BandingRecipe() throws Exception {
+        PageData pd = this.getPageData();
+        try {
+            Integer integer = dtpService.BandingRecipe(pd);
+            if (integer == 1) {
+                return AjaxResult.success("绑定成功");
+            } else {
+                return AjaxResult.error("绑定失败");
+            }
+        } catch (Exception e) {
+            // 异常处理
+            logger.error("Error occurred while updating archives with ID: {}, Exception: {}", pd.get("id"), e.getMessage(), e);
+            return AjaxResult.error("系统异常:" + e.getMessage());
+        }
+    }
     @RequiresPermissions("dtp:recipe:edit")
     @GetMapping("/BandingPatient/{id}")
     public String Banding(@PathVariable("id") String id, ModelMap mmap)throws Exception

+ 254 - 0
health-admin/src/main/java/com/bzd/web/controller/gxhpz/DrugConfigController.java

@@ -0,0 +1,254 @@
+package com.bzd.web.controller.gxhpz;
+
+import com.bzd.common.annotation.Log;
+import com.bzd.common.config.dao.PageData;
+import com.bzd.common.core.controller.BaseController;
+import com.bzd.common.core.domain.AjaxResult;
+import com.bzd.common.core.page.TableDataInfo;
+import com.bzd.common.enums.BusinessType;
+import com.bzd.common.utils.StringUtils;
+import com.bzd.system.service.gxhpz.DrugConfigService;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * 药品配置管理
+ * creator wsp
+ */
+@Controller
+@RequestMapping("/yppz/drugConfig")
+public class DrugConfigController extends BaseController {
+    private String prefix = "gxhpz";
+    @Autowired
+    private DrugConfigService drugConfigService;
+    @RequiresPermissions("gxhpz:yppz:view")
+    @GetMapping("index")
+    public String recipe()
+    {
+        return prefix + "/drugconfigList";
+    }
+    /**
+     *
+     * 查询
+     */
+    @RequiresPermissions("gxhpz:yppz:list")
+    @PostMapping("/drugconfigList")
+    @ResponseBody
+    public TableDataInfo list() throws Exception {
+        PageData pd = this.getPageData();
+        startPage();
+        List<PageData> pageData = drugConfigService.findForList(pd);
+        return  getDataTable(pageData);
+    }
+    /**
+     * 新增页面
+     */
+    @GetMapping("/add")
+    public String add(ModelMap mmap)
+    {
+        mmap.put("posts", 1);
+        return prefix + "/drugconfigAdd";
+    }
+    /**
+     * 详情
+     */
+    @RequiresPermissions("dtp:yppz:view")
+    @GetMapping("/drugConfigDetail/{id}")
+    public String drugConfigDetail(@PathVariable("id") Long id, ModelMap mmap) throws Exception {
+        PageData pd = this.getPageData();
+        pd.put("id",id);
+        PageData pageData = drugConfigService.findForList(pd).get(0);
+        mmap.putAll(pageData);
+        return prefix + "/drugconfigDetail";
+    }
+    /**
+     * 药品新增保存
+     */
+    @RequiresPermissions("gxhpz:yppz:add")
+    @Log(title = "药品新增", businessType = BusinessType.INSERT)
+    @PostMapping("/savedrugConfig")
+    @ResponseBody
+    public AjaxResult savedrugConfig() throws Exception {
+        PageData pd = new PageData();
+        pd = this.getPageData();
+        PageData object = drugConfigService.save(pd);
+        return AjaxResult.success(object.get("result").toString(),object);
+    }
+    @Log(title = "删除", businessType = BusinessType.DELETE)
+    @RequiresPermissions("gxhpz:yppz:remove")
+    @PostMapping("/remove")
+    @ResponseBody
+    public AjaxResult remove() throws Exception
+    {
+        PageData pd = new PageData();
+        pd = this.getPageData();
+        Object id = pd.get("ids");
+        if(StringUtils.isNotNull(id)){
+            String[] split = id.toString().split(",");
+            List<String> ids = Arrays.asList(split);
+            Integer integer = drugConfigService.del(ids);
+            return toAjax(integer);
+
+        }
+        return AjaxResult.success("请选择要删除的数据");
+    }
+
+    /**
+     * 跳转到修改界面
+     * @param id
+     * @param mmap
+     * @return
+     * @throws Exception
+     */
+    @RequiresPermissions("gxhpz:yppz:edit")
+    @GetMapping("/edit/{id}")
+    public String view(@PathVariable("id") String id, ModelMap mmap)throws Exception
+    {
+        PageData pd = this.getPageData();
+        pd.put("id",id);
+        PageData pageData = drugConfigService.findForList(pd).get(0);
+        mmap.putAll(pageData);
+        return prefix + "/drugconfigEdit";
+    }
+
+    /**
+     * 保存修改信息
+     */
+    @RequiresPermissions("gxhpz:yppz:edit")
+    @Log(title = "药品管理", businessType = BusinessType.UPDATE)
+    @PostMapping("/editDrugConfig")
+    @ResponseBody
+    public AjaxResult editSave() throws Exception
+    {
+        PageData pd = this.getPageData();
+        Integer update = drugConfigService.update(pd);
+        if(update!=1){
+            return error("修改失败");
+        }
+        return toAjax(update);
+    }
+    /**
+     * 药品配置-启用停用
+     */
+    @RequiresPermissions("gxhpz:yppz:edit")
+    @Log(title = "药品配置-启用停用", businessType = BusinessType.UPDATE)
+    @PostMapping("/changeStatus")
+    @ResponseBody
+    public AjaxResult changeStatus() throws Exception
+    {
+        String str="";
+        PageData pd = this.getPageData();
+        String status = (String) pd.get("status");
+       if(status.equals("0")){
+            str = "停用";
+
+       }else {
+            str = "启用";
+       }
+        Integer update = drugConfigService.changeStatus(pd);
+        if(update!=1){
+            return AjaxResult.error(str+"失败");
+        }else {
+            return AjaxResult.success(str+"成功");
+        }
+
+    }
+
+    /**
+     * 药品配置-启用停用
+     */
+    @RequiresPermissions("gxhpz:yppz:edit")
+    @Log(title = "药品配置-启用停用", businessType = BusinessType.UPDATE)
+    @PostMapping("/changedvalueStatus")
+    @ResponseBody
+    public AjaxResult changedvalueStatus() throws Exception
+    {
+        String str="";
+        PageData pd = this.getPageData();
+        String status = (String) pd.get("dvalueStatus");
+        if(status.equals("0")){
+            str = "停用";
+
+        }else {
+            str = "启用";
+        }
+        Integer update = drugConfigService.changedvalueStatus(pd);
+        if(update!=1){
+            return AjaxResult.error(str+"失败");
+        }else {
+            return AjaxResult.success(str+"成功");
+        }
+
+    }
+
+
+    /**
+     * 跳转到关联D值界面
+     * @param id
+     * @param mmap
+     * @return
+     * @throws Exception
+     */
+    @RequiresPermissions("gxhpz:yppz:edit")
+    @GetMapping("/toCorrelation/{id}")
+    public String toCorrelation(@PathVariable("id") String id, ModelMap mmap)throws Exception
+    {
+        PageData pd = this.getPageData();
+        pd.put("id",id);
+        PageData pageData = drugConfigService.findForList(pd).get(0);
+        mmap.put("drugData",pageData);
+        mmap.putAll(pageData);
+        System.out.println("drugData"+pageData);
+        return prefix + "/addRepurchasedGoods";
+    }
+    @RequiresPermissions("gxhpz:yppz:edit")
+    @GetMapping("/toCorrelationAdd")
+    public String toCorrelationAdd(ModelMap mmap)throws Exception
+    {
+        mmap.put("add",1);
+        return prefix + "/addRepurchasedGoods";
+    }
+
+    /**
+     * 保存D值关联信息
+     */
+    @RequiresPermissions("gxhpz:yppz:edit")
+    @Log(title = "D值关联信息", businessType = BusinessType.UPDATE)
+    @PostMapping("/toCorrelationSave")
+    @ResponseBody
+    public AjaxResult toCorrelationSave() throws Exception
+    {
+        PageData pd = this.getPageData();
+        Integer update = drugConfigService.update(pd);
+        if(update!=1){
+            return error("修改失败");
+        }
+        return toAjax(update);
+    }
+    /**
+     * 药品信息页面
+     */
+    @RequiresPermissions("dtp:yppz:view")
+    @GetMapping("/allDrugsInfo")
+    public String allDrugsInfo(ModelMap mmap)
+    {
+        mmap.put("posts", 1);
+        return prefix + "/allDrugsInfo";
+    }
+    /**配置药**/
+    @RequiresPermissions("gxhpz:yppz:list")
+    @PostMapping("/getAllDrugs")
+    @ResponseBody
+    public TableDataInfo storeTagList() throws Exception {
+        PageData pd = this.getPageData();
+        startPage();
+        List<PageData> pageData = drugConfigService.getAllDrugs(pd);
+        return  getDataTable(pageData);
+    }
+}

+ 245 - 0
health-admin/src/main/java/com/bzd/web/controller/gxhpz/DvalueConfigController.java

@@ -0,0 +1,245 @@
+package com.bzd.web.controller.gxhpz;
+
+import com.bzd.common.annotation.Log;
+import com.bzd.common.config.dao.PageData;
+import com.bzd.common.core.controller.BaseController;
+import com.bzd.common.core.domain.AjaxResult;
+import com.bzd.common.core.page.TableDataInfo;
+import com.bzd.common.enums.BusinessType;
+import com.bzd.common.utils.DateUtils;
+import com.bzd.common.utils.StringUtils;
+import com.bzd.common.utils.uuid.IdUtils;
+import com.bzd.system.service.gxhpz.DvalueConfigService;
+import org.apache.shiro.authz.annotation.RequiresPermissions;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Controller;
+import org.springframework.ui.ModelMap;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.Arrays;
+import java.util.List;
+
+/**
+ * D值配置管理
+ * creator wsp
+ */
+@Controller
+@RequestMapping("/dzpz/dvalueConfig")
+public class DvalueConfigController extends BaseController {
+    private String prefix = "gxhpz";
+    @Autowired
+    private DvalueConfigService dvalueConfigService;
+    @RequiresPermissions("gxhpz:dzpz:view")
+    @GetMapping("/index")
+    public String recipe()
+    {
+        return prefix + "/dvalueconfigList";
+    }
+    /**
+     *
+     * D值查询
+     */
+    @RequiresPermissions("gxhpz:dzpz:list")
+    @PostMapping("/dvalueconfigList")
+    @ResponseBody
+    public TableDataInfo list() throws Exception {
+        PageData pd = this.getPageData();
+        startPage();
+        List<PageData> pageData = dvalueConfigService.findForList(pd);
+        return  getDataTable(pageData);
+    }
+    /**
+     * 新增页面
+     */
+    @GetMapping("/add")
+    public String add(ModelMap mmap)
+    {
+        mmap.put("posts", 1);
+        return prefix + "/dvalueconfigAdd";
+    }
+    /**
+     * D值详情
+     */
+    @RequiresPermissions("gxhpz:dzpz:view")
+    @GetMapping("/dvalueconfigDetail/{id}")
+    public String drugInfo(@PathVariable("id") Long id, ModelMap mmap) throws Exception {
+        PageData pd = this.getPageData();
+        pd.put("id",id);
+        PageData pageData = dvalueConfigService.findForList(pd).get(0);
+        mmap.putAll(pageData);
+        return prefix + "/dvalueconfigDetail";
+    }
+    /**
+     * D值新增保存
+     */
+    //@RequiresPermissions("server:serv:add")
+    @Log(title = "D值新增", businessType = BusinessType.INSERT)
+    @PostMapping("/savedvalueconfig")
+    @ResponseBody
+    public AjaxResult savedvalueconfig() throws Exception {
+        PageData pd = this.getPageData();
+        int result = dvalueConfigService.save(pd);
+        if(result>0){
+            return AjaxResult.success("成功");
+        }else {
+            return AjaxResult.error("失败");
+        }
+
+    }
+    @Log(title = "D值删除", businessType = BusinessType.DELETE)
+    @PostMapping("/remove")
+    @ResponseBody
+    public AjaxResult remove() throws Exception
+    {
+        PageData pd = new PageData();
+        pd = this.getPageData();
+       Object id = pd.get("ids");
+       if(StringUtils.isNotNull(id)){
+           String[] split = id.toString().split(",");
+           List<String> ids = Arrays.asList(split);
+           Integer integer = dvalueConfigService.del(ids);
+           return toAjax(integer);
+
+       }
+        return AjaxResult.success("请选择要删除的数据");
+    }
+
+    /**
+     * 跳转到修改界面
+     * @param id
+     * @param mmap
+     * @return
+     * @throws Exception
+     */
+    @RequiresPermissions("gxhpz:dzpz:edit")
+    @GetMapping("/edit/{id}")
+    public String view(@PathVariable("id") String id, ModelMap mmap)throws Exception
+    {
+        PageData pd = this.getPageData();
+        pd.put("id",id);
+        PageData pageData = dvalueConfigService.findForList(pd).get(0);
+        mmap.putAll(pageData);
+        return prefix + "/dvalueconfigEdit";
+    }
+
+    /**
+     * 保存D值修改信息
+     */
+    @RequiresPermissions("gxhpz:dzpz:edit")
+    @Log(title = "D值管理", businessType = BusinessType.UPDATE)
+    @PostMapping("/dvalueconfigEdit")
+    @ResponseBody
+    public AjaxResult editSave() throws Exception
+    {
+        PageData pd = this.getPageData();
+        Integer update = dvalueConfigService.update(pd);
+        if(update!=1){
+            return error("修改失败");
+        }
+        return toAjax(update);
+    }
+    /**
+     * 药品D值配置-启用停用
+     */
+    @RequiresPermissions("gxhpz:dzpz:edit")
+    @Log(title = "药品配置-启用停用", businessType = BusinessType.UPDATE)
+    @PostMapping("/changeStatus")
+    @ResponseBody
+    public AjaxResult changeStatus() throws Exception
+    {
+        String str="";
+        PageData pd = this.getPageData();
+        String status = (String) pd.get("status");
+        if(status.equals("0")){
+            str = "停用";
+
+        }else {
+            str = "启用";
+        }
+        Integer update = dvalueConfigService.changeStatus(pd);
+        if(update!=1){
+            return AjaxResult.error(str+"失败");
+        }else {
+            return AjaxResult.success(str+"成功");
+        }
+
+    }
+    /**
+     * D值关联-启用停用
+     */
+    @RequiresPermissions("gxhpz:dzpz:edit")
+    @Log(title = "D值关联-启用停用", businessType = BusinessType.UPDATE)
+    @PostMapping("/changedvalueStatus")
+    @ResponseBody
+    public AjaxResult changedvalueStatus() throws Exception
+    {
+        String str="";
+        PageData pd = this.getPageData();
+        String dvalueStatus = (String) pd.get("dvalueStatus");
+        if(dvalueStatus.equals("0")){
+            str = "停止";
+
+        }else {
+            str = "启用";
+        }
+        Integer update = dvalueConfigService.changedvalueStatus(pd);
+        if(update!=1){
+            return AjaxResult.error(str+"失败");
+        }else {
+            return AjaxResult.success(str+"成功");
+        }
+
+    }
+
+
+    @PostMapping("/searchDvalue")
+    @ResponseBody
+    public AjaxResult searchDvalue() throws Exception
+    {
+        PageData pd = this.getPageData();
+        String query = (String) pd.get("query");
+        System.out.println(query);
+        // 根据业务逻辑决定先尝试匹配 dValueCode 还是 dValueName
+        pd.put("query", query);
+        pd.put("dValueCode", query);
+        pd.put("dValueName", query);
+        try {
+            Object result = dvalueConfigService.findOne(pd);
+            if (result != null) {
+                return AjaxResult.success(result);
+            } else {
+                return AjaxResult.warn("无数据");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            return AjaxResult.error("查询出错");
+        }
+    }
+    @PostMapping("/createDVauleId")
+    @ResponseBody
+    public AjaxResult createDVauleId( ModelMap mmap) throws Exception
+    {
+        PageData pd = this.getPageData();
+        String nameValue = (String) pd.get("nameValue");
+        System.out.println("nameValue="+nameValue);
+        int s5id= IdUtils.get5randomNumber();
+        pd.put("createdBy",getLoginName());
+        pd.put("createdTime", DateUtils.getTime());
+        pd.put("dValueCode",s5id);
+        pd.put("dValueName",nameValue);
+        try {
+            Object result = dvalueConfigService.save(pd);
+            if (result != null) {
+                mmap.put("dvauleid",s5id);
+                mmap.put("dValueName",nameValue);
+                return AjaxResult.success(mmap);
+            } else {
+                return AjaxResult.warn("无数据");
+            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            return AjaxResult.error("查询出错");
+        }
+    }
+
+}

+ 18 - 1
health-admin/src/main/resources/static/health/css/input-styles.css

@@ -17,7 +17,19 @@
 	outline: none; /* 移除轮廓 */
 	transition: all 0.3s ease; /* 过渡动画 */
 }
-
+.select-input {
+	/*display: block; /* 使其独占一行 */
+	width: 200px; /* 宽度为容器宽度 */
+	height: 30px;
+	padding: 6px; /* 内边距 */
+	font-size: 14px; /* 字体大小 */
+	color: #333; /* 字体颜色 */
+	/*background-color: #fff; !* 背景颜色 *!*/
+	border: 1px solid #ccc; /* 边框 */
+	border-radius: 4px; /* 圆角边框 */
+	outline: none; /* 移除轮廓 */
+	transition: all 0.3s ease; /* 过渡动画 */
+}
 /*证件类型前面的小input*/
 .styled-input.short {
 	/*display: block; /* 使其独占一行 */
@@ -232,6 +244,11 @@ li {
 	border: 1px solid #ccc; /* 输入框的边框 */
 	border-radius: 4px; /* 输入框的圆角 */
 }
+.customize-form-group .select-input {
+	padding: 0.5em; /* 输入框内部的填充 */
+	border: 1px solid #ccc; /* 输入框的边框 */
+	border-radius: 4px; /* 输入框的圆角 */
+}
 
 .customize-form-group-container .select-time {
 	flex-basis: calc(5% - 0.5em); /* 时间选择框的基础宽度,计算后减去一定的间隔 */

+ 78 - 0
health-admin/src/main/resources/static/health/js/common.js

@@ -723,4 +723,82 @@ function calculateBMI(heightInCm, weightInKg) {
     return bmi;
 }
 
+(function ($) {
+    $.fn.timePicker = function (options) {
+        // 默认选项
+        var defaults = {
+            format: 'HH:mm:ss',
+            minTime: '00:00:00',
+            maxTime: '23:59:59'
+        };
+
+        // 合并默认选项和用户自定义选项
+        var settings = $.extend({}, defaults, options);
+
+        return this.each(function () {
+            var $this = $(this);
+            var timeFormat = settings.format;
+            var minTime = settings.minTime.split(':');
+            var maxTime = settings.maxTime.split(':');
+
+            // 初始化时间输入框
+            $this.val(minTime.join(':'));
+
+            // 点击事件
+            $this.on('click', function () {
+                var currentTime = $this.val().split(':');
+                var hours = parseInt(currentTime[0]);
+                var minutes = parseInt(currentTime[1]);
+                var seconds = parseInt(currentTime[2]);
+
+                // 显示弹出窗口
+                showPopup(hours, minutes, seconds);
+            });
+
+            // 显示弹出窗口函数
+            function showPopup(hours, minutes, seconds) {
+                // 创建弹出窗口元素
+                var popup = $('<div class="time-popup">');
+                var hourSelect = createSelect('小时', hours, minTime[0], maxTime[0]);
+                var minuteSelect = createSelect('分钟', minutes, minTime[1], maxTime[1]);
+                var secondSelect = createSelect('秒', seconds, minTime[2], maxTime[2]);
+                var confirmButton = $('<button>确认</button>');
+
+                // 添加到弹出窗口
+                popup.append(hourSelect).append(minuteSelect).append(secondSelect).append(confirmButton);
+
+                // 将弹出窗口添加到页面上
+                $('body').append(popup);
+
+                // 确认按钮点击事件
+                confirmButton.click(function () {
+                    var selectedHours = hourSelect.val();
+                    var selectedMinutes = minuteSelect.val();
+                    var selectedSeconds = secondSelect.val();
+
+                    // 更新时间输入框值
+                    $this.val(selectedHours + ':' + selectedMinutes + ':' + selectedSeconds);
+
+                    // 移除弹出窗口
+                    popup.remove();
+                });
+            }
+
+            // 创建下拉选择框函数
+            function createSelect(label, currentValue, minValue, maxValue) {
+                var select = $('<select>');
+                for (var i = parseInt(minValue); i <= parseInt(maxValue); i++) {
+                    var option = $('<option>', { value: i.toString(), text: i.toString() });
+                    if (i === currentValue) {
+                        option.attr('selected', true);
+                    }
+                    select.append(option);
+                }
+                select.prepend($('<label>').text(label));
+                return select;
+            }
+        });
+    };
+})(jQuery);
+
 

+ 40 - 0
health-admin/src/main/resources/static/health/js/ry-ui.js

@@ -1185,6 +1185,10 @@ var table = {
                 table.set();
                 $.modal.open("添加" + table.options.modalName, $.operate.addUrl(id));
             },
+            add2: function(id) {
+                table.set();
+                $.modal.open( table.options.modalName, $.operate.addUrl2(id));
+            },
             // 添加信息,以tab页展现
             addTab: function (id) {
                 table.set();
@@ -1200,6 +1204,12 @@ var table = {
                 var url = $.common.isEmpty(id) ? table.options.createUrl.replace("{id}", "") : table.options.createUrl.replace("{id}", id);
                 return url;
             },
+
+            // 添加访问地址
+            addUrl2: function(id) {
+                var url = $.common.isEmpty(id) ? table.options.createUrl2.replace("{id}", "") : table.options.createUrl2.replace("{id}", id);
+                return url;
+            },
             // 修改信息
             edit: function(id) {
                 table.set();
@@ -1215,6 +1225,21 @@ var table = {
                     $.modal.open("修改" + table.options.modalName, $.operate.editUrl(id));
                 }
             },
+            // 修改信息
+            edit2: function(id) {
+                table.set();
+                if ($.common.isEmpty(id) && table.options.type == table_type.bootstrapTreeTable) {
+                    var row = $("#" + table.options.id).bootstrapTreeTable('getSelections')[0];
+                    if ($.common.isEmpty(row)) {
+                        $.modal.alertWarning("请至少选择一条记录");
+                        return;
+                    }
+                    var url = table.options.updateUrl2.replace("{id}", row[table.options.uniqueId]);
+                    $.modal.open("编辑" + table.options.modalName2, url);
+                } else {
+                    $.modal.open("编辑" + table.options.modalName2, $.operate.editUrl2(id));
+                }
+            },
             // 修改信息,以tab页展现
             editTab: function(id) {
                 table.set();
@@ -1256,6 +1281,21 @@ var table = {
                 }
                 return url;
             },
+            // 修改访问地址
+            editUrl2: function(id) {
+                var url = "/404.html";
+                if ($.common.isNotEmpty(id)) {
+                    url = table.options.updateUrl2.replace("{id}", id);
+                } else {
+                    var id = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
+                    if (id.length == 0) {
+                        $.modal.alertWarning("请至少选择一条记录");
+                        return;
+                    }
+                    url = table.options.updateUrl2.replace("{id}", id);
+                }
+                return url;
+            },
             // 右侧弹出详情
             view: function(id){
                 table.set();

+ 1036 - 67
health-admin/src/main/resources/templates/dtp/SDtpYypzFollowUpSopAdd.html

@@ -1,83 +1,1052 @@
 <!DOCTYPE html>
-<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
 <head>
-    <th:block th:include="include :: header('随访SOP表新增')" />
-    <th:block th:include="include :: ztree-css" />
+    <th:block th:include="include :: header('随访SOP新增')" />
+    <th:block th:include="include :: datetimepicker-css" />
+
 </head>
-<body class="white-bg">
-<div class="wrapper wrapper-content animated fadeInRight ibox-content">
-    <form id="form-SDtpYypzFollowUpSop-add" class="customize-search-form">
-        <div class="customize-form-group-container">
-            <div class="customize-form-group">
-                <label>药品:</label>
-                <input name="drug" placeholder="药品"  id="drug" class="styled-input" type="text" required>
-            </div>
-            <div class="customize-form-group">
-                <label>业务归属:</label>
-                <input name="businessBelonging" placeholder="业务归属"  id="businessBelonging" class="styled-input" type="text">
-            </div>
-            <div class="customize-form-group">
-                <label>模板名称:</label>
-                <input name="templateName" placeholder="模板名称"  id="templateName" class="styled-input" type="text" required>
-            </div>
-            <div class="customize-form-group">
-                <label>模版ID:</label>
-                <input name="templateId" placeholder="模版ID"  id="templateId" class="styled-input" type="number">
-            </div>
-            <div class="customize-form-group">
-                <label>创建人:</label>
-                <input name="createdBy" placeholder="创建人"  id="createdBy" class="styled-input" type="text">
+<body>
+<div class="ui-layout-center">
+    <div class="col-sm-12">
+        <div class="float-e-margins">
+            <div class="ibox-title">
+                <h5>随访SOP</h5>
             </div>
-            <div class="customize-form-group">
-                <label>状态:</label>
-                <select name="status"  class="styled-input">
-                    <option value="">全部</option>
-                    <option value="已启用">已启用</option>
-                    <option value="已停用">已停用</option>
-                    <option value="已创建">已创建</option>
-                </select>
+            <div class="ibox-content">
+            <form id="form-SDtpYypzFollowUpSop-edit">
+                    <div class="customize-form-group-row">
+                        <label class="control-label is-required">SOP名称:</label>
+                        <input name="templateName" id="templateName" placeholder="请输入SOP名称" class="styled-input input-field" type="text"  required>
+                    </div>
+                        <div class="customize-form-group-row">
+                            <label class="control-label is-required">&nbsp;业务归属:&nbsp;&nbsp;</label>
+                            <select name="businessBelonging" id="businessBelonging" class="styled-input input-field"   th:with="type=${@dict.getType('sys_select_dtp_ywgs')}">
+                                <option disabled selected>请选择业务归属</option>
+                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
+                            </select>
+                        </div>
+            </form>
+            <form id="form-syyp-durg">
+                    <div class="customize-form-group-row">
+                        <label class="control-label is-required">适用药品:</label>
+                        已选择2种药品 <button type="button"  onclick="selectUsersToParentCallBack2()" class="btn-primary">添加药品</button>
+                        <div class="form-horizontal">
+                            <p class="pull-right">
+                            <div class="customize-form-group select-time">
+                                <div class="panel-body">
+                                    <strong>药品信息</strong>
+                                    <div class="form-group" id="formGroup">
+                                        <div class="col-sm-12">
+                                            <div class="col-sm-11" id="carGroup">
+                                                <div id="iboxContainer">
+                                                    <ul class="list-group list-group-striped" id="inputList">
+                                                        <!-- 输入框将在这里动态添加 -->
+                                                    </ul>
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
+                            </p>
+                        </div>
+                    </div>
+             </form>
+                <form id="form-jdpz-nodes" >
+                    <div class="customize-form-group-row">
+                        <label class="control-label is-required">节点配置:</label>
+                        <div class="col-sm-6">
+                            <div class="tabs-container">
+                                <button type="button"  onclick="addNode()" class="btn btn-outline btn-primary">新增节点</button>
+                                <ul class="nav nav-tabs" id="addNodeSelect">
+                                    <!--动态添加表单数据-->
+                                </ul>
+                                <div class="tab-content" id="addNode">
+                                    <!--动态添加表单数据-->
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                </form>
             </div>
-            <div class="customize-form-group select-time">
-                <label>创建时间:</label>
-                <input name="createdTime" placeholder="创建时间"  id="createdTime" class="time-input time-input2" type="text">
-            </div>
-<!--            <div class="customize-form-group select-time">-->
-<!--                <label>更新时间:</label>-->
-<!--                <input name="updatedTime" placeholder="更新时间"  id="updatedTime" class="time-input time-input2" type="text">-->
-<!--            </div>-->
-<!--            <div class="customize-form-group">-->
-<!--                <label>更新人:</label>-->
-<!--                <input name="updatedBy" placeholder="更新人"  id="updatedBy" class="styled-input" type="text">-->
-<!--            </div>-->
         </div>
-    </form>
+    </div>
+
+</div>
+<div class="main-content">
+    <div class="col-sm-offset-5 col-sm-10">
+        <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
+        <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
+    </div>
 </div>
 <th:block th:include="include :: footer" />
-<th:block th:include="include :: ztree-js" />
-<script type="text/javascript">
-
+<th:block th:include="include :: datetimepicker-js" />
+</body>
+</html>
+<script>
+    var prefix = ctx + "dtp/recipe";
+    var count = 0;
+    let carNum=1;//选项卡id
+    var index=0;
+    // 存储已添加的过滤条件数量
+    var selectedOption = []; // 这里存储当前选中的选项
+    var selectCount=0;
+    var applicableDrug=[];
     function submitHandler() {
-        if ($.validate.form()) {
-            add();
+        var businessBelonging=$("#businessBelonging").val();
+        var templateName=$("#templateName").val();
+        if(templateName=="" || templateName==undefined){
+            $.modal.alertWarning("请输入SOP名称");
+            return;
+        }
+        if(businessBelonging=="" || businessBelonging==undefined){
+            $.modal.alertWarning("请选择业务归属");
+            return;
+        }
+        if(applicableDrug.length==0){
+            $.modal.alertWarning("请添加药品");
+            return;
         }
+        var prefix = ctx + "dtp/sdtpyypzfollowupsop";
+        var data = $("#form-SDtpYypzFollowUpSop-edit").serializeArray();
+        data.push({name:"nodesData",value:JSON.stringify(collectNodesData())});
+        data.push({name:"applicableDrug",value:JSON.stringify(applicableDrug)});
+        console.log("data="+data)
+        $.operate.saveTab(prefix + "/sDtpYypzFollowUpSopAdd", data);
+    }
+    function collectNodesData() {
+        // 获取所有节点
+        const nodes = document.querySelectorAll('.tabs-container .tab-pane');
+        // 创建一个空数组来保存所有节点的数据
+        const nodesData = [];
+
+        // 遍历每个节点
+        nodes.forEach(node => {
+            // 创建一个空对象来保存当前节点的数据
+            const nodeData = {};
+            var nodeIdStr=node.id;
+            var nodeId=  nodeIdStr.substring(4);
+            console.log("nodeId="+nodeId);
+            // 获取节点内的所有输入字段
+            const inputs = node.querySelectorAll('input, select');
+
+            // 遍历每个输入字段并收集其值
+            inputs.forEach(input => {
+                // 忽略没有 name 属性的字段
+                if (!input.name) {
+                    return;
+                }
+                // 对于复选框和单选按钮,只收集选中的值
+                if (input.type === 'checkbox' || input.type === 'radio') {
+                    if (!input.checked) {
+                        return;
+                    }
+                }
+                // 将值添加到当前节点的数据对象中
+                nodeData[input.name] = input.value;
+            });
+            // 将当前节点的数据对象添加到数组中
+            nodeData.filtersData=  collectFiltersData(nodeId);
+            nodesData.push(nodeData);
+        });
+        // 返回所有节点的数据
+        return nodesData;
     }
+    function collectFiltersData(nodeId) {
+           var filtersContainer = document.getElementById('filtersContainer'+nodeId);
+             if(filtersContainer){
+                 // 获取所有过滤条件行
+                 var filterRows = filtersContainer.getElementsByClassName('filter-row');
+                 // 创建一个数组来存储所有行的数据
+                 var allFilterData = [];
+                 // 遍历每一行
+                 Array.from(filterRows).forEach(function(filterRow, rowIndex) {
+                     // 获取每一行内各个选择器的值
+                     var traits = filterRow.querySelector('[name^="trait"]');
+                     var traitValue = filterRow.querySelector('[name^="traitValue"]');
+                     var judgingCondition = filterRow.querySelector('[name^="judgingCondition"]');
+                     var judgmentSelectValue = filterRow.querySelector('[name^="judgmentSelectValue"]');
+                     var judgmentInputValue =filterRow.querySelector('[name^="judgmentInputValue"]');
+                     // 创建一个对象来存储这一行的数据
+                     var rowFilterData = {};
+                     if (traits) {
+                         rowFilterData['traits'] = traits.value;
+                     }
+                     if (traitValue) {
+                         rowFilterData['traitValue'] = traitValue.value;
+                     }
+                     if (judgingCondition) {
+                         rowFilterData['judgingCondition'] = judgingCondition.value;
+                     }
+                     if (judgmentSelectValue) {
+                         rowFilterData['judgmentValue'] = judgmentSelectValue.value;
+                     }
 
-    function add() {
-        var data = $("#form-SDtpYypzFollowUpSop-add").serializeArray();
-        $.ajax({
-            cache : true,
-            type : "POST",
-            url : ctx + "dtp/sdtpyypzfollowupsop/sDtpYypzFollowUpSopAdd",
-            data : data,
-            async : false,
-            error : function(request) {
-                $.modal.alertError("系统错误");
-            },
-            success : function(data) {
-                $.operate.successCallback(data);
+                     if (judgmentInputValue) {
+                         rowFilterData['judgmentValue'] = judgmentInputValue.value;
+                     }
+                     // 添加一个属性来标识这一行的位置
+                     rowFilterData['rowIndex'] = rowIndex + 1; // 行号从 1 开始
+                     // 创建一个对象来存储这一行的数据
+                     var filterData = {
+                         traits: traits,
+                         traitValue: traitValue,
+                         judgingCondition: judgingCondition,
+                         judgmentValue: judgmentSelectValue,
+                         judgmentValueInput: judgmentInputValue
+                     };
+
+                     // 将这一行的数据添加到总数据数组中
+                     allFilterData.push(rowFilterData);
+                 });
+                 // 将总数据数组转换为 JSON 字符串
+                 return allFilterData;
+             } else {
+                 return null;
+             }
+    }
+    function selectUsersToParentCallBack2(){
+        var options = {
+            title: '药品信息',
+            url: prefix + "/drugInfo",
+            callBack: doSubmit2
+        };
+        $.modal.openOptions(options);
+    }
+    function  toTask(){
+        selectCount++;
+        // 使用 includes 方法检查 carNum 是否已在 carNumFlag2 数组中
+        // 创建并设置 div 的内容
+        var filtersContainer = document.getElementById('filtersContainer'+carNum);
+        var filterRow = document.createElement('div');
+        filterRow.className = 'filter-row';
+
+        // 创建并初始化一级下拉列表 特征
+        var levelOneSelect = document.createElement('select');
+        levelOneSelect.id = 'level-one'+selectCount;
+        levelOneSelect.name = 'trait';
+        levelOneSelect.className = 'styled-input';
+        levelOneSelect.innerHTML = `
+        <option value="" disabled selected>请选择一级分类</option>
+        <option value="patient-feature">患者特征</option>
+        <option value="patient-did-feature">患者Did特征</option>
+    `;
+        filterRow.appendChild(levelOneSelect);
+        // 创建二级、三级、四级的容器和相关元素,但初始时不显示它们 特征值
+        var levelTwoContainer = document.createElement('div');
+        levelTwoContainer.id = 'level-two-container'+selectCount;
+        levelTwoContainer.className = 'styled-input';
+        // 创建并初始化二级下拉列表
+        var levelTwoSelect = document.createElement('select');
+        levelTwoSelect.id = 'level-two'+selectCount;
+        levelTwoSelect.name = 'traitValue';
+        levelTwoSelect.className = 'styled-input';
+        levelTwoContainer.style.display = 'none';
+        filterRow.appendChild(levelTwoSelect);
+        var levelThreeContainer = document.createElement('div');
+        levelThreeContainer.id = 'level-three-container'+selectCount;
+        levelThreeContainer.className = 'styled-input';
+        // 创建并初始化三级下拉列表
+        var levelThreeSelect = document.createElement('select');
+        levelThreeSelect.id = 'level-three'+selectCount;
+        levelThreeSelect.name = 'judgingCondition';
+        levelThreeSelect.className = 'styled-input';
+        levelThreeContainer.style.display = 'none';
+        filterRow.appendChild(levelThreeSelect);
+        var levelFourContainer = document.createElement('div');
+        levelFourContainer.id = 'level-four-container'+selectCount;
+        levelFourContainer.className = 'styled-input';
+        levelFourContainer.style.display = 'none';
+        // 创建并初始化四级输入框下拉是否
+        var levelFourInput = document.createElement('select');
+        levelFourInput.id = 'level-four-input'+selectCount;
+        levelFourInput.name = 'judgmentSelectValue';
+        levelFourInput.className = 'styled-input';
+        levelFourInput.style.display = 'none';
+        filterRow.appendChild(levelFourInput);
+        // 创建并初始化四级输入框只输入数字
+        var levelFourNumber = document.createElement('input');
+        levelFourNumber.id = 'level-four-inputNumber'+selectCount;
+        levelFourNumber.name = 'judgmentInputValue';
+        levelFourNumber.className = 'styled-input';
+        levelFourNumber.type = 'number';
+        levelFourNumber.style.display = 'none';
+        filterRow.appendChild(levelFourNumber);
+        // 创建移除按钮
+        var removeButton = document.createElement('button');
+        removeButton.textContent = '删除';
+        removeButton.className = 'remove-buttonx';
+        removeButton.onclick = () => {
+            filtersContainer.removeChild(filterRow);
+
+        };
+        filterRow.innerHTML+= "<p class='grey-text'>如满足左侧设定逻辑,则不会执行任务动作</p>";
+        filterRow.appendChild(removeButton);
+        // 将新创建的 filterRow 添加到 filtersContainer 中
+        filtersContainer.appendChild(filterRow);
+    }
+    function bindSelectEvents(id) {
+        var levelOneSelect = document.getElementById('level-one'+id);
+        var levelTwoSelect = document.getElementById('level-two'+id);//这里的值拿不到为啥
+        var levelThreeSelect = document.getElementById('level-three'+id);
+        var  levelFourSelect= document.getElementById('level-four-input'+id);
+        var levelFourInput = document.getElementById('level-four-inputNumber'+id);
+        // 初始化一级下拉菜单的事件监听器
+        $(document).on('change', '#level-one'+id, function(e) {
+            var selectedValue = this.value;
+            if (levelTwoSelect) {//这里的值拿不到
+                // 清空二级下拉菜单
+                while (levelTwoSelect.firstChild) {
+                    levelTwoSelect.removeChild(levelTwoSelect.firstChild);
+                }
+                // 根据一级选择加载二级选项
+                if (selectedValue === 'patient-feature') {
+                    // 加载患者特征的二级选项
+                    loadLevelTwoOptionsForPatientFeature();
+                } else if (selectedValue === 'patient-did-feature') {
+                    // 加载患者Did特征的二级选项
+                    loadLevelTwoOptionsForPatientDidFeature();
+                }
+            } else {
+                console.error("levelTwoSelect element is not found");
+            }
+
+            // 隐藏三级和四级容器
+            hideLevelThreeAndFourContainers();
+        });
+
+        // 初始化二级下拉菜单的事件监听器
+        $(document).on('change', '#level-two'+id, function(e) {
+            var selectedValue = this.value;
+            // 清空三级下拉菜单
+            while (levelThreeSelect.firstChild) {
+                levelThreeSelect.removeChild(levelThreeSelect.firstChild);
+            }
+            // 根据二级选择加载三级选项
+            if (selectedValue === '最近待执行随访距今天数' ||
+                selectedValue === '最近已完成随访距今天数' ||
+                selectedValue === '最近订单距今天数') {
+                // 加载数值比较类型的三级选项
+                loadLevelThreeOptionsForNumericComparison();
+            } else {
+                // 加载字符串比较类型的三级选项
+                loadLevelThreeOptionsForStringComparison();
+            }
+            // 隐藏四级容器
+            hideLevelFourContainer();
+        });
+
+        // 初始化三级下拉菜单的事件监听器
+        $(document).on('change', '#level-three'+id, function(e) {
+            var selectedValue = this.value;
+
+            // 清空四级下拉菜单
+            while (levelFourSelect.firstChild) {
+                levelFourSelect.removeChild(levelFourSelect.firstChild);
+            }
+            // 根据三级选择加载四级选项
+            if (selectedValue === '大于等于' ||
+                selectedValue === '小于等于' ||
+                selectedValue === '大于' ||
+                selectedValue === '小于' ||
+                selectedValue === '等于' ||
+                selectedValue === '不等于') {
+                // 显示输数字
+                showLevelFourInput();
+            } else if (selectedValue === '--等于--' || selectedValue === '--不等于--') {
+                // 显示选择器
+                loadLevelThreeOptionsForSelection();
+                showLevelFourSelect();
+            }else {
+                // 显示输数字
+                showLevelFourInput();
+            }
+        });
+        // 初始化三级下拉菜单的事件监听器
+        $(document).on('change', '#level-four'+id, function(e) {
+            var selectedValue = this.value;
+            // 根据三级选择加载四级选项
+            if (selectedValue === '是' ||
+                selectedValue === '否'
+               ) {
+                // 显示输择器
+                showLevelFourSelect();
+            } else {
+                // 显示选数字
+                showLevelFourInput();
             }
         });
+        // 加载患者特征的二级选项
+        function loadLevelTwoOptionsForPatientFeature() {
+
+            var options = [
+                '请选择二级分类',
+                '默认触达手机号',
+                '永久停止随访(脱落召回)',
+                '永久停止随访(常规随访)',
+                '永久停止随访(全部)',
+                '最近待执行随访距今天数',
+                '最近已完成随访距今天数'
+            ];
+            options.forEach((option, index) => {
+                var newOption = document.createElement('option');
+                if (newOption === '请选择二级分类') {
+                    newOption.setAttribute('value', '');
+                    newOption.disabled = true; // 设置为禁用状态
+                    newOption.selected = true; // 设置为预选中状态
+                } else {
+                    newOption.value = option;
+                    newOption.textContent = option;
+                }
+                levelTwoSelect.appendChild(newOption);
+            });
+            // 显示二级容器
+            showLevelTwoContainer();
+        }
+
+        // 加载患者Did特征的二级选项
+        function loadLevelTwoOptionsForPatientDidFeature() {
+            var options = [
+                '请选择二级分类',
+                '最近订单距今天数',
+                '永久停止随访(脱落召回)',
+                '永久停止随访(常规随访)',
+                '永久停止随访(全部)',
+                '用药状态'
+            ];
+            options.forEach((option, index) => {
+                var newOption = document.createElement('option');
+                if (newOption === '请选择二级分类') {
+                    newOption.setAttribute('value', '');
+                    newOption.disabled = true; // 设置为禁用状态
+                    newOption.selected = true; // 设置为预选中状态
+                } else {
+                    newOption.value = option;
+                    newOption.textContent = option;
+                }
+                levelTwoSelect.appendChild(newOption);
+            });
+
+            // 显示二级容器
+            showLevelTwoContainer();
+        }
+        // 加载数值比较类型的三级选项
+        function loadLevelThreeOptionsForNumericComparison() {
+            var options = [
+                '请选择三级分类',
+                '大于等于',
+                '小于等于',
+                '大于',
+                '小于',
+                '等于',
+                '不等于'
+            ];
+            options.forEach((option, index) => {
+                var newOption = document.createElement('option');
+                if (newOption === '请选择二级分类') {
+                    newOption.setAttribute('value', '');
+                    newOption.disabled = true; // 设置为禁用状态
+                    newOption.selected = true; // 设置为预选中状态
+                } else {
+                    newOption.value = option;
+                    newOption.textContent = option;
+                }
+                levelThreeSelect.appendChild(newOption);
+            });
+            // 显示三级容器
+            showLevelThreeContainer();
+        }
+
+        // 加载字符串比较类型的三级选项
+        function loadLevelThreeOptionsForStringComparison() {
+            var options = [
+                '请选择三级分类',
+                '--等于--',
+                '--不等于--'
+            ];
+
+            options.forEach((option, index) => {
+                var newOption = document.createElement('option');
+                if (newOption === '请选择二级分类') {
+                    newOption.setAttribute('value', '');
+                    newOption.disabled = true; // 设置为禁用状态
+                    newOption.selected = true; // 设置为预选中状态
+                }
+                if (newOption === '--等于--') {
+                    newOption.setAttribute('value', '等于');
+                    newOption.value='等于';
+                    newOption.textContent = '等于';
+                } if (newOption === '--不等于--') {
+                    newOption.setAttribute('value', '不等于');
+                    newOption.value='不等于';
+                    newOption.textContent = '不等于';
+                }
+                levelThreeSelect.appendChild(newOption);
+            });
+
+            // 显示三级容器
+            showLevelThreeContainer();
+        }
+        // 加载字符串比较类型的三级选项
+        function loadLevelThreeOptionsForSelection() {
+            var options = [
+                '请选择',
+                '是',
+                '否'
+            ];
+
+            options.forEach(option => {
+                var newOption = document.createElement('option');
+                if (newOption === '请选择') {
+                    newOption.setAttribute('value', '');
+                    newOption.disabled = true; // 设置为禁用状态
+                    newOption.selected = true; // 设置为预选中状态
+                }
+                newOption.value=option;
+                newOption.textContent = option;
+                levelFourSelect.appendChild(newOption);
+            });
+
+        }
+        // 显示输入框
+        function showLevelFourInput() {
+            levelFourInput.style.display = 'block';
+            levelFourSelect.style.display = 'none';
+        }
+
+        // 显示选择器
+        function showLevelFourSelect() {
+            levelFourInput.style.display = 'none';
+            levelFourSelect.style.display = 'block';
+        }
+
+        // 隐藏三级和四级容器
+        function hideLevelThreeAndFourContainers() {
+            if (levelThreeSelect) {
+                levelThreeSelect.style.display = 'none';
+            }
+            if (levelFourInput) {
+                levelFourInput.style.display = 'none';
+            }
+            if (levelFourSelect) {
+                levelFourSelect.style.display = 'none';
+            }
+        }
+
+        // 隐藏四级容器
+        function hideLevelFourContainer() {
+            if (levelFourInput) {
+                levelFourInput.style.display = 'none';
+            }
+            if (levelFourSelect) {
+                levelFourSelect.style.display = 'none';
+            }
+
+        }
+
+        // 显示二级容器
+        function showLevelTwoContainer() {
+            document.getElementById('level-two'+id).style.display = 'block';
+        }
+
+        // 显示三级容器
+        function showLevelThreeContainer() {
+            document.getElementById('level-three'+id).style.display = 'block';
+        }
+    }
+    function bindTabEvents(carNum) {
+        console.log("carNum"+carNum);
+        var flag = true ;
+        var TJ = '';
+
+        var  renwdongz='';//任务动作
+        $('#filtersContainer'+carNum).on('change', '.styled-input', function(e) {
+            // 获取当前选中的值
+            var selectedValue = e.target.value;
+
+            bindSelectEvents(this.id.substring(9)); // 调用 bindSelectEvents 函数
+        });
+        // 绑定 change 事件
+        $(document).on('change', '#ts'+carNum, function(e) {
+            var selectedValue = $(this).val();
+            if (selectedValue === "周期节点" && flag) {
+                flag = false;
+                $('#span'+carNum).remove();
+                var addNodeOne ='<span id="span'+carNum+'"> 每 '+
+                    '<input type="number" name="createTaskEvery" placeholder="请输入" class="styled-input" value="">' +
+                    "  天生成任务,共执行  " +
+                    '<input type="number" name="createTaskExecutionTimes" placeholder="请输入" class="styled-input" value="">次</span>'
+
+                $('#scrw'+carNum).after(addNodeOne);
+            }if (selectedValue === "单次节点" && TJ=='时间条件') {
+                flag = true;
+                $('#span'+carNum).remove();
+                var addNodeOne ="  <span id=\"span"+carNum+"\">第  " +
+                    '<input type="number" id="rwday'+carNum+'" name="createTaskDi" placeholder="请输入" class="styled-input" value="">' +
+                    "  天生成任务 </span>" ;
+                $('#scrw'+carNum).after(addNodeOne);
+            }
+            if (selectedValue === "单次节点" && TJ=='事件条件') {
+                flag = true;
+                $('#span'+carNum).remove();
+                var addNodeOne ='<span id="span'+carNum+'"> 当 '+
+                    '<select name="createTaskWhen" id="scrw-t'+carNum+'" class="styled-input">' +
+                    '<option value="">请选择</option>' +
+                    ' <option value="最近订单D值">最近订单D值(剩余用药天数)</option>' +
+                    '<option value="其他值">其他值</option>' +
+                    '</select>' +
+                    "  为" +
+                    '<input type="number" name="createTaskTriggerValue" placeholder="请输入" class="styled-input" value="">触发动作'
+                $('#scrw'+carNum).after(addNodeOne);
+            }
+            if (selectedValue === "单次节点" && TJ=='' ) {
+                flag = true;
+                $('#span'+carNum).remove();
+                var addNodeOne ="  <span id=\"span"+carNum+"\">第  " +
+                    '<input type="number" id="scrw-t'+carNum+'" name="createTaskDi" placeholder="请输入" class="styled-input" value="">' +
+                    "  天生成任务 </span>" ;
+                $('#scrw'+carNum).after(addNodeOne);
+            }
+        });
+        // 绑定 change 事件
+        $(document).on('change', '#scrw'+carNum, function(e) {
+            var selectedValue = $(this).val();
+            if (selectedValue === "事件条件" && flag===false) {
+                TJ='事件条件';
+                $('#span'+carNum).remove();
+                var addNodeOne ='<span id="span'+carNum+'"> 当 '+
+                    '<select name="createTaskWhen" id="scew-t'+carNum+'" class="styled-input">' +
+                    '<option value="">请选择</option>' +
+                    ' <option value="最近订单D值">最近订单D值(剩余用药天数)</option>' +
+                    '<option value="其他值">其他值</option>' +
+                    '</select>' +
+                    "  为" +
+                    '<input type="number" name="createTaskTriggerValue" placeholder="请输入" class="styled-input" value="">触发动作'+
+                    " 共执行  " +
+                    '<input type="number" name="createTaskExecutionTimes" placeholder="请输入" class="styled-input" value="">次</span>'
+                $('#scrw'+carNum).after(addNodeOne);
+            } if (selectedValue === "事件条件" && flag===true) {
+                TJ='事件条件';
+                $('#span'+carNum).remove();
+                var addNodeOne ='<span id="span'+carNum+'"> 当 '+
+                    '<select name="createTaskWhen" id="scrw-t'+carNum+'" class="styled-input">' +
+                    '<option value="">请选择</option>' +
+                    ' <option value="最近订单D值">最近订单D值(剩余用药天数)</option>' +
+                    '<option value="其他值">其他值</option>' +
+                    '</select>' +
+                    "  为" +
+                    '<input type="number" name="createTaskTriggerValue" placeholder="请输入" class="styled-input" value="">触发动作'
+                $('#scrw'+carNum).after(addNodeOne);
+            }if (selectedValue === "时间条件" && flag===false) {
+                TJ='时间条件';
+                $('#span'+carNum).remove();
+                var addNodeOne ='<span id="span'+carNum+'"> 每 '+
+                    '<input type="number" name="createTaskEvery" placeholder="请输入" class="styled-input" value="">' +
+                    "  天生成任务,共执行  " +
+                    '<input type="number" name="createTaskExecutionTimes" placeholder="请输入" class="styled-input" value="">次</span>'
+                $('#scrw'+carNum).after(addNodeOne);
+            }if (selectedValue === "时间条件" && flag===true) {
+                TJ='时间条件';
+                $('#span'+carNum).remove();
+                var addNodeOne ="  <span id=\"span"+carNum+"\">第  " +
+                    '<input type="number" id="scrw-t'+carNum+'" name="createTaskDi" placeholder="请输入" class="styled-input" value="">' +
+                    "  天生成任务 </span>" ;
+                $('#scrw'+carNum).after(addNodeOne);
+            }
+        });
+
+        // 绑定 change 事件
+        $(document).on('change', '#rwdz'+carNum, function(e) {
+            var chudaSelect = $(this).val();
+            var roleSelect = document.getElementById("js"+carNum);
+
+            // 清空当前的所有选项
+            while (roleSelect.firstChild) {
+                roleSelect.removeChild(roleSelect.firstChild);
+            }
+            // 根据 chudaSelect 的值添加合适的选项
+            if (chudaSelect=== '表单任务') {
+
+                var divElement = document.getElementById("rwdzID"+carNum); // 获取 div 引用
+                divElement.style.display = "none";
+                var divElementform = document.getElementById("rwdzform"+carNum); // 获取 div 引用
+                divElementform.style.display = "block";
+                renwdongz='表单任务';
+                var option = document.createElement("option");
+                option.value = "药师";
+                option.text = "药师";
+                roleSelect.appendChild(option);
+                selectedOption.push("yaoshigzt" + carNum);
+                // 选中药师工作台
+                document.getElementById("yaoshigzt" + carNum).checked = true;
+            } else if (chudaSelect === '触达任务') {
+                var divElement = document.getElementById("rwdzform"+carNum); // 获取 div 引用
+                divElement.style.display = "none";
+                var divElementID = document.getElementById("rwdzID"+carNum); // 获取 div 引用
+                divElementID.style.display = "block";
+                renwdongz='触达任务';
+                var option = document.createElement("option");
+                option.value = "系统";
+                option.text = "系统";
+                roleSelect.appendChild(option);
+                selectedOption.push("duanxiqudan" + carNum);
+                // 选中短信
+                document.getElementById("duanxiqudan" + carNum).checked = true;
+            }else if (chudaSelect === '') {
+                var elementsToDelete = [];
+                elementsToDelete.push('duanxiqudan' + carNum);
+                elementsToDelete.push('yaoshigzt' + carNum);
+                var filteredArray = selectedOption.filter(item => !elementsToDelete.includes(item));
+                console.log("filteredArray="+filteredArray);
+                // 取消选中
+                document.getElementById("duanxiqudan" + carNum).checked = false;
+                document.getElementById("yaoshigzt" + carNum).checked = false;
+            }
+
+        });
+    }
+
+
+    $(function(){
+    $("#datetimepicker-demo-3").datetimepicker({
+        format: 'HH:mm:ss',
+        autoclose: true
+    });
+    });
+    document.addEventListener("DOMContentLoaded", function() {
+
+        addNode()
+        // 监听点击事件,激活指定的选项卡
+        $('#addNodeSelect').click(function(e) {
+            // 阻止默认行为
+            //e.preventDefault();
+            // 获取当前点击的选项卡链接
+            var $this = $(this);
+            //获取被点击的 tab标签id
+            var clickedA = $(e.target);
+            var new_id = clickedA[0].id
+            carNum=new_id.substring(2);
+            var Select = document.getElementById("rwdz"+carNum);
+            if (Select) { // 确保元素存在
+                var selectedOption = Select.options[Select.selectedIndex];
+                console.log(selectedOption.text); // 输出选中文本
+                if(selectedOption.text =='请选择'){
+                    document.getElementById("duanxiqudan" + carNum).checked = false;
+                }else {
+                    document.getElementById("duanxiqudan" + carNum).checked = true;
+                }
+            }
+            var Select = document.getElementById("rwdz" + carNum);
+            if (Select) { // 确保元素存在
+                var selectedOption = Select.options[Select.selectedIndex];
+                console.log(selectedOption.text); // 输出选中文本
+                if(selectedOption.text =='请选择'){
+                    document.getElementById("yaoshigzt" + carNum).checked = false;
+                }else {
+                    document.getElementById("yaoshigzt" + carNum).checked = true;
+                }
+
+            }
+            // 将目标内容区滚动到视口中央
+            $('html, body').animate({
+                scrollTop: $(target).offset().top - ($(window).height() / 2)
+            }, 500); // 500毫秒动画时间
+        });
+        // 初始绑定
+        bindTabEvents(carNum);
+
+    });
+
+    /* 添加节点配置 */
+    function addNode(){
+        count++;
+
+        // 生成 ibox 容器
+        if(count===1){
+            c = "active";
+            t = "true"
+        }else{
+            c="";
+            t="false"
+        }
+        var addNode = '<div id="tab-' + count + '" class="tab-pane '+c+'">' +
+            '<div class="panel-body">'+
+            '<strong>激活节点:</strong>'+
+            "  按  " +
+            '<select name="activateStructures" id="jhjd' + count + '" class="styled-input">' +
+            '<option value="">请选择</option>' +
+            '<option value="创建计划">创建计划</option>' +
+            '</select>' +
+            "  第  " +
+            '<input type="number" name="activateWhichDay" placeholder="规格" class="styled-input" value="">' +
+            "  天激活  "+
+            '<select name="activateNodeRule" id="ts' + count + '" class="styled-input">' +
+            '<option value="单次节点">单次节点</option>' +
+            '<option value="周期节点">周期节点</option>' +
+            '</select>' +
+            '<p>'+
+            '</p id="sctask">'+
+            '<strong>生成任务:</strong>'+
+            "  按  " +
+            '<select name="createTaskStructures" id="scrw' + count + '" class="styled-input">' +
+            '<option value="">请选择</option>' +
+            '<option value="时间条件">时间条件</option>' +
+            '<option value="事件条件">事件条件</option>' +
+            '</select>' +
+            "  <span id=\"span" + count + "\">第  " +
+            '<input type="number" id="createTaskDi' + count + '" name="createTaskDi" placeholder="请输入" class="styled-input" value="">' +
+            "  天生成任务 </span>"+' &nbsp;<a href="#" onclick="toTask()" id=toTask"">添加过滤条件</a>' +
+            "<div id=\"filtersContainer" + count + "\" name=\"filtersContainer\"></div>" +
+            '<p>'+
+            '</p>'+
+            '<strong>任务动作:  &emsp;&nbsp;</strong>'+
+            '<select name="taskActionMode" id="cj' + count + '" class="styled-input">' +
+            '<option value="创建">创建</option>' +
+            '</select>' +
+            '&emsp;&nbsp;&nbsp;' +
+            '<select name="taskActionTaskType" id="rwdz' + count + '" class="styled-input">' +
+            '<option value="">请选择</option>' +
+            '<option value="表单任务">表单任务</option>' +
+            '<option value="触达任务">触达任务</option>' +
+            '</select>' +
+            "  类型,由角色  " +
+            '<select name="taskActionRole" id="js' + count + '" class="styled-input">' +
+            '<option value=""></option>' +
+            '<option value="药师">药师</option>' +
+            '<option value="系统">系统</option>' +
+            '</select>' +
+            '  执行  '+
+            '<p>'+
+            '</p>'+
+            '<strong>执行任务: </strong>生成后第&nbsp;'+
+            '<input type="number" name="generationDaysAfter" placeholder="请输入" class="styled-input" value="">' +
+            '  天  ' +
+            '<input type="text" name="generationHMS" placeholder="请输入时间(时分秒)" id="datetimepicker-demo-3"  class="styled-input" value="">' +
+            '  执行任务  ' +
+            '<p>'+
+            '</p>'+
+            '<strong>&emsp;&emsp;&emsp;&emsp;&nbsp;&nbsp;</strong>随访主题&nbsp;'+
+            '<select name="followUpSubject" id="sfzt' + count + '" class="styled-input">' +
+            '<option value="">请选择</option>' +
+            '<option value="用药指导">用药指导</option>' +
+            '<option value="脱落召回">脱落召回</option>' +
+            '</select>' +
+            '<p>'+
+            '</p>'+
+            '<strong>&emsp;&emsp;&emsp;&nbsp;&nbsp;</strong>任务有效期&nbsp;'+
+            '<input type="number" name="taskValidity" placeholder="请输入" class="styled-input" value="">&emsp;天' +
+            '<p>'+
+            '</p>'+
+            '<strong>&emsp;&emsp;&emsp;&emsp;&nbsp;&nbsp;</strong>任务素材&nbsp;'+
+            '<select name="taskMaterial" id="1-' + count + '" class="styled-input">' +
+            '<option value="表单">表单</option>' +
+            '<option value="表单2">表单2</option>' +
+            '</select>' +
+            '<p>'+
+            '</p><div id="rwdzform' + count + '" class="myDivrwdz">'+
+            '<strong>&emsp;&emsp;&emsp;&emsp;&nbsp;&nbsp;</strong>使用表单&nbsp;'+
+            '<select name="useForm" id="2-' + count + '" class="styled-input">' +
+            '<option value="">请选择</option>' +
+            '<option value="单任务表单">单任务表单</option>' +
+            '<option value="随访任务表单">随访任务表单</option>' +
+            '<option value="脱落召回随访表单">脱落召回随访表单</option>' +
+            '</select>' +
+            '</div><p>'+
+            '</p><div id="rwdzID' + count + '" class="myDivrwdz">'+
+            '<strong>&emsp;&emsp;&emsp;&emsp;&nbsp;&nbsp;</strong>短信ID&emsp;&nbsp;'+
+            '<input type="text" name="smsId" class="styled-input" placeholder="请输入短信ID" value="">' +
+            '</div><p>'+
+            '</p>'+
+            '<strong>&emsp;&emsp;&emsp;&emsp;&nbsp;</strong>下发渠道&nbsp;'+
+            '<input type="radio" id="duanxiqudan' + count + '" name="deliveryChannel" class="form-check-radio" value="短信"> 短信 ' +
+            '<input type="radio" id="yaoshigzt' + count + '" name="deliveryChannel" class="form-check-radio" value="药师工作台"> 药师工作台 ' +
+            '</div>'+
+            '</div>';
+        // 添加到容器
+        var  NodeSelect =  '<li id="li-' + count + '" class="'+c+'"><a data-toggle="tab" href="#tab-' + count + '" aria-expanded="'+t+'">  <span class="your-class-for-nodes" id="jd' + count + '">' +
+            '节点' + count +'</span><span class="close-tab" onclick="deleteNode(\'' + count + '\')"><i class="fa fa-times"></i></span></a></li>';
+        $('#addNode').append(addNode);
+        $('#addNodeSelect').append(NodeSelect);
+// 主动重新绑定事件
+        bindTabEvents(count);
+    }
+    function doSubmit2(index, layero){
+        var rows = layero.find("iframe")[0].contentWindow.selectColumns2();
+        if (rows.length == 0) {
+            $.modal.alertWarning("请至少选择一条记录");
+            return;
+        }
+        rows.forEach(function(item, index) {
+            // 生成 ibox 容器
+            var ibox = '<div class="ibox" id="ibox-' + item.productId + '">' +
+                '<div class="ibox-title">' +
+                '<h5>' + item.mdmCode + ' - ' + item.productName + '</h5>' +
+                '<input name="isFlipItem" placeholder="是否为上翻品" id="isFlipItem-' + item.isFlipItem + '"  class="styled-input3" type="hidden" value="' + item.isFlipItem + '">' +
+                '<input name="productId" placeholder="商品id" id="productId-' + item.productId + '"  class="styled-input3" type="hidden" value="' + item.productId + '">' +
+                '<input name="genericName" placeholder="商品通用名" id="genericName-' + item.genericName + '"  class="styled-input3" type="hidden" value="' + item.genericName + '">' +
+                '<input name="productName" placeholder="商品名" id="productName-' + item.productName + '"  class="styled-input3" type="hidden" value="' + item.productName + '">' +
+                '<input name="mdmCode" placeholder="MD编码" id="mdmCode-' + item.mdmCode + '"  class="styled-input3" type="hidden" value="' + item.mdmCode + '">' +
+                '<input name="specification" placeholder="规格" id="specification-' + item.specification + '"  class="styled-input3" type="hidden" value="' + item.specification + '">' +
+                '</div>' +
+                '<div class="ibox-content">' +
+                '<table class="table table-bordered">' +
+                '<tbody>' +
+                '<tr>' +
+                '<td>MD编码:' + item.mdmCode + '</td>' +
+                '<td>商品名:' + item.productName + '</td>' +
+                '<td>通用名:' + item.genericName + '</td>' +
+                '<td>厂家:没有数据</td>' +
+                '<td><button onclick="deleteRow(\'' + item.productId + '\')" class="btn btn-danger">删除</button></td>' +
+                /*'<td>规格:' + item.specification[0] + '</td>' +*/
+                '</tr>' +
+                '</tbody>' +
+                '</table>' +
+                '</div>' +
+                '</div>';
+
+            // 添加到容器
+            $('#iboxContainer').append(ibox);
+            // 提取隐藏输入字段的值并推送到 applicableDrug 数组
+            applicableDrug.push({
+                mdmCode: item.mdmCode,
+                productName: item.productName,
+                specification: item.specification,
+                productId: item.productId,
+                genericName: item.genericName,
+                isFlipItem: item.isFlipItem
+            });
+        });
+        console.log("applicableDrug"+applicableDrug)
+        $.modal.close(index);
+    }
+    function deleteRow(productId) {
+        // 删除 ibox 容器
+        $('#ibox-' + productId).remove();
+        // 更新 productId 显示
+        $('#productId').html('');
+    }
+    function deleteNode(id) {
+        if(count===0){
+            return false
+        }
+        count--;
+        // 删除 ibox 容器
+        $('#li-' + id).remove();
+        $('#tab-' + id).remove();
+        // 遍历所有剩余的节点,更新它们的编号
+        $('.your-class-for-nodes').each(function() {
+
+            // 获取当前节点的 id
+            let currentId = parseInt(this.id.replace('jd', '')); // 提取数字部分
+            // 如果当前节点的 id 大于被删除的节点的 id,更新编号
+            if (currentId > id) {
+                // 创建一个新的 id
+                let newId = 'jd' + (currentId - 1);
+                // 更新节点的 id 和文本内容
+                $(this).attr('id', newId).text('节点' + (currentId - 1));
+                let closeTabElement = $(this).closest('li').find('.close-tab');
+                if (closeTabElement.length > 0) {
+                    // 更新 onclick 属性中的参数
+                    let onclickAttr = closeTabElement.attr('onclick');
+                    let updatedOnclickAttr = onclickAttr.replace(/\d+/g, newId.substring(2));
+                    closeTabElement.attr('onclick', updatedOnclickAttr);
+                }
+                $(this).closest('li').attr('id', 'li-' + newId.substring(2));
+
+                // 更新 a 标签的 href 属性
+                let aTag = $(this).closest('li').find('a');
+                if (aTag.length > 0) {
+                    let hrefAttr = aTag.attr('href');
+                    let updatedHrefAttr = hrefAttr.replace(/\d+/g, newId.substring(2));
+                    aTag.attr('href', updatedHrefAttr);
+                }
+            }
+
+        });
+
     }
 </script>
-</body>
-</html>
+<style>
+
+
+
+    .myDivrwdz {
+        display: none; /* 初始状态为不显示 */
+    }
+
+    .grey-text {
+        padding-right: 5px;
+        padding-top: 10px;
+        color: gray;
+        font-family: "楷体", KaiTi, serif;
+        font-size: 11px;
+    }
+    .filter-row {
+        display: flex;
+        align-items: center;
+        margin-bottom: 10px;
+    }
+    .filter-row input,
+    .filter-row select {
+        margin-right: 10px;
+    }
+
+    .ibox {
+        width: 700px;
+        margin-bottom: 20px;
+        border: 1px solid #e7eaec;
+        border-radius: 4px;
+    }
+    .ibox-title {
+        background-color: #f3f3f4;
+        border-bottom: 1px solid #e7eaec;
+        padding: 10px 15px;
+        font-size: 16px;
+    }
+    .ibox-content {
+        padding: 15px;
+    }
+    .ibox-content h4 {
+        margin-top: 0;
+    }
+
+
+    .styled-input3 {
+        display: inline-block;
+        padding: 5px;
+        border: 1px solid #ccc;
+        border-radius: 4px;
+        width: 100px;
+    }
+
+    .col-sm-6 {
+        width: 125%;
+    }
+    .form-horizontal .form-group {
+        margin-right: 384px;
+        margin-left: 3px;
+    }
+    input[type=file] {
+        display: none;
+    }
+    .form-group {
+        margin-bottom: -1px;
+    }
+    /* 添加一些基础样式 */
+    body {
+        font-family: Arial, sans-serif;
+    }
+    table {
+        width: 400px;
+        border-collapse: collapse;
+    }
+    th, td {
+        text-align: left;
+        padding: 8px;
+        border-bottom: 1px solid #ddd;
+    }
+    tr:nth-child(even) {
+        width: 15px;
+        background-color: #f2f2f2;
+    }
+</style>

+ 8 - 7
health-admin/src/main/resources/templates/dtp/SDtpYypzFollowUpSopList.html

@@ -21,7 +21,7 @@
                     </div>
                 </div>
                 <form id="SDtpYypzFollowUpSop-form" class="customize-search-form">
-<div class="customize-form-group-container">
+       <div class="customize-form-group-container">
                         <div class="customize-form-group">
                             <label>业务归属:</label>
                                 <select name="businessBelonging"  class="styled-input">
@@ -39,8 +39,7 @@
                             <input type="text" class="styled-input" placeholder="请输入模板名称" name="templateName" autocomplete="off"/>
                         </div>
                         <div class="customize-form-group">
-                            <label>模版ID:</label>
-                            <input type="text" class="styled-input" placeholder="请输入模版ID" name="templateId" autocomplete="off"/>
+
                         </div>
                         <div class="customize-form-group select-time">
                             <label>创建时间:</label>
@@ -57,17 +56,19 @@
                                     <option value="已创建">已创建</option>
                                 </select>
                         </div>
+                       <div class="customize-form-group">
+                           <label>模版ID:</label>
+                           <input type="text" class="styled-input" placeholder="请输入模版ID" name="templateId" autocomplete="off"/>
+                       </div>
                     </div>
                 </form>
             </div>
 
             <div class="btn-group-sm" id="toolbar" role="group">
-                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:user:add">
+                <a class="btn btn-success" onclick="$.operate.addTab()" shiro:hasPermission="system:user:add">
                     <i class="fa fa-plus"></i> 新增
                 </a>
-                 <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:user:edit">
-                    <i class="fa fa-edit"></i> 修改
-                </a>
+
                 <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:user:remove">
                     <i class="fa fa-remove"></i> 删除
                 </a>

+ 372 - 71
health-admin/src/main/resources/templates/dtp/SDtpYypzFollowUpSopPageEdit.html

@@ -9,24 +9,19 @@
         <div class="float-e-margins">
             <div class="ibox-title">
                 <h5>随访SOP</h5>
-                <div class="ibox-tools">
-                    <a class="collapse-link">
-                        <i class="fa fa-chevron-up"></i>
-                    </a>
-                    <a class="dropdown-toggle" data-toggle="dropdown" href="javascript:;">
-                        <i class="fa fa-wrench"></i>
-                    </a>
-                    <ul class="dropdown-menu dropdown-user">
-                        <li><a href="javascript:;">选项1</a>
-                        </li>
-                        <li><a href="javascript:;">选项2</a>
-                        </li>
-                    </ul>
-                    <a class="close-link">
-                        <i class="fa fa-times"></i>
-                    </a>
+                <div class="ibox-tools" style="margin-top: -10px;">
+                    <label class="control-label">最后更新时间:</label>
+                    <input name="lastUpdateTime"  class="styled-input input-field" type="text" style="border: none" value="2024-09-18 22:68"  readonly>
+                    <span> <input type="text" style="border: none;font-size: 13px;width: 60px;color: orangered;" class="styled-input" value="已创建" id="switchFlag" readonly></span>
+                    <div class="toggle-switch">
+                        <label>
+                            <input type="checkbox" class="toggle-switch" value="" id="switchFlag2">
+                            <span class="toggle-switch"></span>
+                        </label>
+                    </div>
                 </div>
             </div>
+
             <div class="ibox-content">
 
                 <form id="form-SDtpYypzFollowUpSop-edit">
@@ -34,11 +29,14 @@
                         <label class="control-label is-required">随访SOP:</label>
                         <input name="phoneNumber" placeholder="随访SOP" class="styled-input input-field"
                                type="text" maxlength="30" th:value="${phoneNumber}" required>
+
                     </div>
                     <div class="customize-form-group-row">
-                        <label class="control-label is-required">业务归属:</label>
-                        <input name="phoneNumber" placeholder="业务归属" class="styled-input input-field"
-                               type="text" maxlength="30" th:value="${phoneNumber}" readonly required>
+                            <label class="control-label is-required">业务归属:&nbsp;&nbsp;:</label>
+                            <select name="businessBelonging" class="styled-input input-field"  th:with="type=${@dict.getType('sys_select_dtp_ywgs')}" disabled>
+                                <option value="">业务归属</option>
+                                <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
+                            </select>
                     </div>
                     <div class="customize-form-group-row">
                         <label class="control-label is-required">适用药品:</label>
@@ -69,7 +67,7 @@
                         <label class="control-label is-required">节点配置:</label>
                         <div class="col-sm-6">
                             <div class="tabs-container">
-                                <button type="button"  onclick="addNode()" class="btn btn-outline btn-primary dim">添加节点</button>
+                                <button type="button"  onclick="addNode()" class="btn btn-outline btn-primary">新增节点</button>
                                 <ul class="nav nav-tabs" id="addNodeSelect">
                                     <!--动态添加表单数据-->
                                 </ul>
@@ -96,6 +94,8 @@
 </html>
 <script>
     var prefix = ctx + "dtp/recipe";
+    var count = 0;
+    var carNum=1;//选项卡id
     function submitHandler() {
         var prefix = ctx + "dtp/sdtpyypzfollowupsop";
         if ($.validate.form()) {
@@ -111,35 +111,258 @@
         };
         $.modal.openOptions(options);
     }
-    var flag = true ;
-    $(document).ready(function() {
+
+    var index=0;
+    var carNumFlag2=[];
+    // 存储已添加的过滤条件数量
+    let addedFiltersCount= 0;
+    var selectedOption = []; // 这里存储当前选中的选项
+    function  toTask(){
+        debugger
+        // 使用 includes 方法检查 carNum 是否已在 carNumFlag2 数组中
+        if(carNum==""){
+            $.modal.msg("请选重新点击节点名称", "warning");
+            return;
+        }
+        // 创建并设置 div 的内容
+        var filtersContainer = document.getElementById('filtersContainer'+carNum);
+        const filterRow = document.createElement('div');
+        filterRow.className = 'filter-row';
+        const selectFeature = document.createElement('select');
+        selectFeature.className = 'styled-input'; // 添加类名
+        selectFeature.innerHTML = '<option value="">请选择特征</option>';
+        for (let i = 1; i <= 10; i++) {
+            selectFeature.innerHTML += `<option value="${i}">特征${i}</option>`;
+        }
+        const selectCondition = document.createElement('select');
+        selectCondition.className = 'styled-input'; // 添加类名
+        selectCondition.innerHTML = '<option value="">判断条件</option>';
+        for (let i = 1; i <= 10; i++) {
+            selectCondition.innerHTML += `<option value="${i}">条件${i}</option>`;
+        }
+        const removeButton = document.createElement('span');
+        removeButton.textContent = '删除';
+        removeButton.className = 'remove-buttonx';
+        removeButton.onclick = () => {
+            filtersContainer.removeChild(filterRow);
+        };
+        filterRow.appendChild(selectFeature);
+        filterRow.appendChild(selectCondition);
+        filterRow.innerHTML+= "<p class='grey-text'>如满足左侧设定逻辑,则不会执行任务动作</p>";
+        filterRow.appendChild(removeButton);
+        // 将新创建的 filterRow 添加到 filtersContainer 中
+        filtersContainer.appendChild(filterRow);
+    }
+
+    function bindTabEvents(carNum) {
+        console.log("carNum"+carNum);
+        var flag = true ;
+        var TJ = '';
+
+        var  renwdongz='';//任务动作
+
         // 绑定 change 事件
-        $(document).on('change', '#s2', function(e) {
+        $(document).on('change', '#ts'+carNum, function(e) {
             var selectedValue = $(this).val();
-            debugger
             if (selectedValue === "周期节点" && flag) {
                 flag = false;
-                $('#span').remove();
-                var addNodeOne ='<span id="span"> 每 '+
-                '<input type="number" name="specification" placeholder="请输入" class="styled-input" value="">' +
-                "  天生成任务,共执行  " +
-                '<input type="number" name="specification" placeholder="请输入" class="styled-input" value=""></span>'+
-                " 次 ";
-                $('#s3').after(addNodeOne);
-            }else {
+                $('#span'+carNum).remove();
+                var addNodeOne ='<span id="span'+carNum+'"> 每 '+
+                    '<input type="number" name="specification" placeholder="请输入" class="styled-input" value="">' +
+                    "  天生成任务,共执行  " +
+                    '<input type="number" name="specification" placeholder="请输入" class="styled-input" value="">次</span>'
+
+                $('#scrw'+carNum).after(addNodeOne);
+            }if (selectedValue === "单次节点" && TJ=='时间条件') {
+                flag = true;
+                $('#span'+carNum).remove();
+                var addNodeOne ="  <span id=\"span"+carNum+"\">第  " +
+                    '<input type="number" id="rwday'+carNum+'" name="specification" placeholder="请输入" class="styled-input" value="">' +
+                    "  天生成任务 </span>" ;
+                $('#scrw'+carNum).after(addNodeOne);
+            }
+            if (selectedValue === "单次节点" && TJ=='事件条件') {
                 flag = true;
-                $('#span').remove();
-                var addNodeOne ="  <span id=\"span\">第  " +
-                    '<input type="number" id="aa" name="specification" placeholder="请输入" class="styled-input" value="">' +
+                $('#span'+carNum).remove();
+                var addNodeOne ='<span id="span'+carNum+'"> 当 '+
+                    '<select name="zjddd" id="scrw-t'+carNum+'" class="styled-input">' +
+                    '<option value="">请选择</option>' +
+                    ' <option value="最近订单D值">最近订单D值(剩余用药天数)</option>' +
+                    '<option value="其他值">其他值</option>' +
+                    '</select>' +
+                    "  为" +
+                    '<input type="number" name="dnumber" placeholder="请输入" class="styled-input" value="">触发动作'
+                $('#scrw'+carNum).after(addNodeOne);
+            }
+            if (selectedValue === "单次节点" && TJ=='' ) {
+                flag = true;
+                $('#span'+carNum).remove();
+                var addNodeOne ="  <span id=\"span"+carNum+"\">第  " +
+                    '<input type="number" id="scrw-t'+carNum+'" name="specification" placeholder="请输入" class="styled-input" value="">' +
                     "  天生成任务 </span>" ;
-                $('#s3').after(addNodeOne);
+                $('#scrw'+carNum).after(addNodeOne);
             }
         });
+        // 绑定 change 事件
+        $(document).on('change', '#scrw'+carNum, function(e) {
+            var selectedValue = $(this).val();
+            if (selectedValue === "事件条件" && flag===false) {
+                TJ='事件条件';
+                $('#span'+carNum).remove();
+                var addNodeOne ='<span id="span'+carNum+'"> 当 '+
+                    '<select name="zjddd" id="scew-t'+carNum+'" class="styled-input">' +
+                    '<option value="">请选择</option>' +
+                    ' <option value="最近订单D值">最近订单D值(剩余用药天数)</option>' +
+                    '<option value="其他值">其他值</option>' +
+                    '</select>' +
+                    "  为" +
+                    '<input type="number" name="dnumber" placeholder="请输入" class="styled-input" value="">触发动作'+
+                    " 共执行  " +
+                    '<input type="number" name="specification" placeholder="请输入" class="styled-input" value="">次</span>'
+                $('#scrw'+carNum).after(addNodeOne);
+            } if (selectedValue === "事件条件" && flag===true) {
+                TJ='事件条件';
+                $('#span'+carNum).remove();
+                var addNodeOne ='<span id="span'+carNum+'"> 当 '+
+                    '<select name="zjddd" id="scrw-t'+carNum+'" class="styled-input">' +
+                    '<option value="">请选择</option>' +
+                    ' <option value="最近订单D值">最近订单D值(剩余用药天数)</option>' +
+                    '<option value="其他值">其他值</option>' +
+                    '</select>' +
+                    "  为" +
+                    '<input type="number" name="dnumber" placeholder="请输入" class="styled-input" value="">触发动作'
+                $('#scrw'+carNum).after(addNodeOne);
+            }if (selectedValue === "时间条件" && flag===false) {
+                TJ='时间条件';
+                $('#span'+carNum).remove();
+                var addNodeOne ='<span id="span'+carNum+'"> 每 '+
+                    '<input type="number" name="specification" placeholder="请输入" class="styled-input" value="">' +
+                    "  天生成任务,共执行  " +
+                    '<input type="number" name="specification" placeholder="请输入" class="styled-input" value="">次</span>'
+                $('#scrw'+carNum).after(addNodeOne);
+            }if (selectedValue === "时间条件" && flag===true) {
+                TJ='时间条件';
+                $('#span'+carNum).remove();
+                var addNodeOne ="  <span id=\"span"+carNum+"\">第  " +
+                    '<input type="number" id="scrw-t'+carNum+'" name="specification" placeholder="请输入" class="styled-input" value="">' +
+                    "  天生成任务 </span>" ;
+                $('#scrw'+carNum).after(addNodeOne);
+            }
+        });
+
+        // 绑定 change 事件
+        $(document).on('change', '#rwdz'+carNum, function(e) {
+            var chudaSelect = $(this).val();
+            var roleSelect = document.getElementById("js"+carNum);
+
+            // 清空当前的所有选项
+            while (roleSelect.firstChild) {
+                roleSelect.removeChild(roleSelect.firstChild);
+            }
+            // 根据 chudaSelect 的值添加合适的选项
+            if (chudaSelect=== '表单任务') {
+
+                var divElement = document.getElementById("rwdzID"+carNum); // 获取 div 引用
+                divElement.style.display = "none";
+                var divElementform = document.getElementById("rwdzform"+carNum); // 获取 div 引用
+                divElementform.style.display = "block";
+                renwdongz='表单任务';
+                var option = document.createElement("option");
+                option.value = "药师";
+                option.text = "药师";
+                roleSelect.appendChild(option);
+                selectedOption.push("yaoshigzt" + carNum);
+                // 选中药师工作台
+                document.getElementById("yaoshigzt" + carNum).checked = true;
+            } else if (chudaSelect === '触达任务') {
+                var divElement = document.getElementById("rwdzform"+carNum); // 获取 div 引用
+                divElement.style.display = "none";
+                var divElementID = document.getElementById("rwdzID"+carNum); // 获取 div 引用
+                divElementID.style.display = "block";
+                renwdongz='触达任务';
+                var option = document.createElement("option");
+                option.value = "系统";
+                option.text = "系统";
+                roleSelect.appendChild(option);
+                selectedOption.push("duanxiqudan" + carNum);
+                // 选中短信
+                document.getElementById("duanxiqudan" + carNum).checked = true;
+            }else if (chudaSelect === '') {
+                var elementsToDelete = [];
+                elementsToDelete.push('duanxiqudan' + carNum);
+                elementsToDelete.push('yaoshigzt' + carNum);
+                var filteredArray = selectedOption.filter(item => !elementsToDelete.includes(item));
+                console.log("filteredArray="+filteredArray);
+                // 取消选中
+                document.getElementById("duanxiqudan" + carNum).checked = false;
+                document.getElementById("yaoshigzt" + carNum).checked = false;
+            }
+
+        });
+    }
+    document.querySelector('.toggle-switch input').addEventListener('change', function () {
+        if (this.checked) {
+            $('#switchFlag').val('已启用');
+            // 开启功能
+            console.log('已创建');
+        } else {
+            $('#switchFlag').val('已停用');
+            // 关闭功能
+            console.log('已取消创建');
+        }
     });
 
-    var count = 1;
+    // 在添加新选项卡的地方调用事件绑定函数
+    // function addNewTab(newCarNum) {
+    //     // 新选项卡相关的DOM操作...
+    //
+    //     // 主动重新绑定事件
+    //     bindTabEvents(newCarNum);
+    // }
+    document.addEventListener("DOMContentLoaded", function() {
+            addNode()
+            // 监听点击事件,激活指定的选项卡
+        $('#addNodeSelect').click(function(e) {
+            // 阻止默认行为
+            e.preventDefault();
+            // 获取当前点击的选项卡链接
+            var $this = $(this);
+            // 获取被点击的 tab标签id
+            var clickedA = $(e.target);
+            var new_id = clickedA[0].id
+            carNum=new_id.substring(2);
+
+                var Select = document.getElementById("rwdz"+carNum);
+                if (Select) { // 确保元素存在
+                    var selectedOption = Select.options[Select.selectedIndex];
+                    console.log(selectedOption.text); // 输出选中文本
+                    if(selectedOption.text =='请选择'){
+                        document.getElementById("duanxiqudan" + carNum).checked = false;
+                    }else {
+                        document.getElementById("duanxiqudan" + carNum).checked = true;
+                    }
+                }
+
+                var Select = document.getElementById("rwdz" + carNum);
+                if (Select) { // 确保元素存在
+                    var selectedOption = Select.options[Select.selectedIndex];
+                    console.log(selectedOption.text); // 输出选中文本
+                    if(selectedOption.text =='请选择'){
+                        document.getElementById("yaoshigzt" + carNum).checked = false;
+                    }else {
+                        document.getElementById("yaoshigzt" + carNum).checked = true;
+                    }
+
+                }
+
+        });
+
+        // 初始绑定
+        bindTabEvents(carNum);
+    });
     /* 添加节点配置 */
     function addNode(){
+        count++;
         // 生成 ibox 容器
         if(count===1){
             c = "active";
@@ -152,56 +375,60 @@
                         '<div class="panel-body">'+
                                 '<strong>激活节点:</strong>'+
                                 "  按  " +
-                                '<select name="usageMethod" id="s1" class="styled-input">' +
+                                '<select name="createplan' + count + '" id="jhjd' + count + '" class="styled-input">' +
                                 '<option value="">请选择</option>' +
                                 '<option value="创建计划">创建计划</option>' +
                                 '</select>' +
                                 "  第  " +
-                                '<input type="number" name="specification" placeholder="规格" class="styled-input" value="">' +
+                                '<input type="number" name="specification' + count + '" placeholder="规格" class="styled-input" value="">' +
                                 "  天激活  "+
-                                '<select name="usageMethod" id="s2" class="styled-input">' +
+                                '<select name="usageMethod' + count + '" id="ts' + count + '" class="styled-input">' +
                                 '<option value="单次节点">单次节点</option>' +
                                 '<option value="周期节点">周期节点</option>' +
                                 '</select>' +
                             '<p>'+
-                            '</p>'+
+                            '</p id="sctask">'+
                                 '<strong>生成任务:</strong>'+
                                 "  按  " +
-                                '<select name="usageMethod" id="s3" class="styled-input">' +
+                                '<select name="createTask' + count + '" id="scrw' + count + '" class="styled-input">' +
                                 '<option value="">请选择</option>' +
-                                '<option value="创建计划">时间条件</option>' +
-                                '<option value="创建计划2">事件条件</option>' +
+                                '<option value="时间条件">时间条件</option>' +
+                                '<option value="事件条件">事件条件</option>' +
                                 '</select>' +
-                                "  <span id=\"span\">第  " +
-                                '<input type="number" id="aa" name="specification" placeholder="请输入" class="styled-input" value="">' +
-                                "  天生成任务 </span>"+' &nbsp;<a href="#" >添加过滤条件</a>' +
+                                "  <span id=\"span" + count + "\">第  " +
+                                '<input type="number" id="numberDays' + count + '" name="numberDays' + count + '" placeholder="请输入" class="styled-input" value="">' +
+                                "  天生成任务 </span>"+' &nbsp;<a href="#" onclick="toTask()">添加过滤条件</a>' +
+                                 "<div id=\"filtersContainer" + count + "\"></div>" +
                             '<p>'+
                             '</p>'+
                                 '<strong>任务动作:  &emsp;&nbsp;</strong>'+
-                                '<select name="usageMethod" id="s4" class="styled-input">' +
+                                '<select name="creater' + count + '" id="cj' + count + '" class="styled-input">' +
                                 '<option value="创建">创建</option>' +
                                 '</select>' +
                                 '&emsp;&nbsp;&nbsp;' +
-                                '<select name="usageMethod" id="s5" class="styled-input">' +
+                                '<select name="chuda' + count + '" id="rwdz' + count + '" class="styled-input">' +
+                                '<option value="">请选择</option>' +
                                 '<option value="表单任务">表单任务</option>' +
                                 '<option value="触达任务">触达任务</option>' +
                                 '</select>' +
                                 "  类型,由角色  " +
-                                '<select name="usageMethod" id="s6" class="styled-input">' +
+                                '<select name="roleType' + count + '" id="js' + count + '" class="styled-input">' +
+                                '<option value=""></option>' +
                                 '<option value="药师">药师</option>' +
+                                '<option value="系统">系统</option>' +
                                 '</select>' +
                                 '  执行  '+
                             '<p>'+
                             '</p>'+
                                 '<strong>执行任务: </strong>生成后第&nbsp;'+
-                                '<input type="number" name="specification" placeholder="请输入" class="styled-input" value="">' +
+                                '<input type="number" name="specification' + count + '" placeholder="请输入" class="styled-input" value="">' +
                                 '  天  ' +
-                                '<input type="number" name="specification" placeholder="请输入" class="styled-input" value="">' +
+                                '<input type="number" name="specification' + count + '" placeholder="请输入" class="styled-input" value="">' +
                                 '  执行任务  ' +
                             '<p>'+
                             '</p>'+
                                 '<strong>&emsp;&emsp;&emsp;&emsp;&nbsp;&nbsp;</strong>随访主题&nbsp;'+
-                                '<select name="usageMethod" id="s7" class="styled-input">' +
+                                '<select name="followUupSubject' + count + '" id="sfzt' + count + '" class="styled-input">' +
                                 '<option value="">请选择</option>' +
                                 '<option value="用药指导">用药指导</option>' +
                                 '<option value="脱落召回">脱落召回</option>' +
@@ -209,34 +436,41 @@
                             '<p>'+
                             '</p>'+
                                 '<strong>&emsp;&emsp;&emsp;&nbsp;&nbsp;</strong>任务有效期&nbsp;'+
-                                '<input type="number" name="specification" placeholder="请输入" class="styled-input" value="">' +
+                                '<input type="number" name="TaskValidity' + count + '" placeholder="请输入" class="styled-input" value="">' +
                             '<p>'+
                             '</p>'+
                                 '<strong>&emsp;&emsp;&emsp;&emsp;&nbsp;&nbsp;</strong>任务素材&nbsp;'+
-                                '<select name="usageMethod" id="1-" class="styled-input">' +
+                                '<select name="taskMaterial' + count + '" id="1-' + count + '" class="styled-input">' +
                                 '<option value="表单">表单</option>' +
+                                 '<option value="表单2">表单2</option>' +
                                 '</select>' +
                             '<p>'+
-                            '</p>'+
+                            '</p><div id="rwdzform' + count + '" class="myDivrwdz">'+
                                 '<strong>&emsp;&emsp;&emsp;&emsp;&nbsp;&nbsp;</strong>使用表单&nbsp;'+
-                                '<select name="usageMethod" id="1-" class="styled-input">' +
+                                '<select name="useForm' + count + '" id="2-' + count + '" class="styled-input">' +
                                 '<option value="">请选择</option>' +
-                                '<option value="用药指导">用药指导</option>' +
-                                '<option value="脱落召回">脱落召回</option>' +
+                                '<option value="单任务表单">单任务表单</option>' +
+                                '<option value="随访任务表单">随访任务表单</option>' +
+                                '<option value="脱落召回随访表单">脱落召回随访表单</option>' +
                                 '</select>' +
-                            '<p>'+
+                            '</div><p>'+
+                            '</p><div id="rwdzID' + count + '" class="myDivrwdz">'+
+                            '<strong>&emsp;&emsp;&emsp;&emsp;&nbsp;&nbsp;</strong>短信ID&emsp;&nbsp;'+
+                            '<input type="text" name="duanxinID' + count + '" class="styled-input" placeholder="请输入短信ID" value="">' +
+                            '</div><p>'+
                             '</p>'+
                             '<strong>&emsp;&emsp;&emsp;&emsp;&nbsp;</strong>下发渠道&nbsp;'+
-                            '<input type="radio" name="specification" class="form-check-radio" value="短信"> 短信 ' +
-                            '<input type="radio" name="specification" class="form-check-radio" value="药师工作台"> 药师工作台 ' +
+                            '<input type="radio" id="duanxiqudan' + count + '" name="deliveryChannel" class="form-check-radio" value="短信"> 短信 ' +
+                            '<input type="radio" id="yaoshigzt' + count + '" name="deliveryChannel" class="form-check-radio" value="药师工作台"> 药师工作台 ' +
                         '</div>'+
                     '</div>';
         // 添加到容器
-        var  NodeSelect = '<li id="li-' + count + '" class="'+c+'"><a data-toggle="tab" href="#tab-' + count + '" aria-expanded="'+t+'"> ' +
-            '第' + count + '个选项卡<span class="close-tab" onclick="deleteNode(\'' + count + '\')"><i class="fa fa-times"></i></span></a></li>';
+        var  NodeSelect =  '<li id="li-' + count + '" class="'+c+'"><a data-toggle="tab" href="#tab-' + count + '" aria-expanded="'+t+'">  <span class="your-class-for-nodes" id="jd' + count + '">' +
+           '节点' + count +'</span>&emsp;&nbsp;&nbsp;<span class="close-tab" onclick="deleteNode(\'' + count + '\')"><i class="fa fa-times"></i></span></a></li>';
         $('#addNode').append(addNode);
         $('#addNodeSelect').append(NodeSelect);
-        count=count+1;
+// 主动重新绑定事件
+        bindTabEvents(count);
     }
     function doSubmit2(index, layero){
         var rows = layero.find("iframe")[0].contentWindow.selectColumns2();
@@ -280,20 +514,87 @@
     function deleteRow(productId) {
         // 删除 ibox 容器
         $('#ibox-' + productId).remove();
-
-        // 更新 productId 显示
-        $('#productId').html('');
     }
     function deleteNode(id) {
+        if(count===0){
+            return false
+        }
+        count--;
         // 删除 ibox 容器
         $('#li-' + id).remove();
         $('#tab-' + id).remove();
-        count==id;
-        // 更新 productId 显示
-        $('#productId').html('');
+        // 遍历所有剩余的节点,更新它们的编号
+        $('.your-class-for-nodes').each(function() {
+
+            // 获取当前节点的 id
+            let currentId = parseInt(this.id.replace('jd', '')); // 提取数字部分
+
+            // 如果当前节点的 id 大于被删除的节点的 id,更新编号
+            if (currentId > id) {
+                // 创建一个新的 id
+                let newId = 'jd' + (currentId - 1);
+                // 更新节点的 id 和文本内容
+                $(this).attr('id', newId).text('节点' + (currentId - 1));
+                let closeTabElement = $(this).closest('li').find('.close-tab');
+                if (closeTabElement.length > 0) {
+                    // 更新 onclick 属性中的参数
+                    let onclickAttr = closeTabElement.attr('onclick');
+                    let updatedOnclickAttr = onclickAttr.replace(/\d+/g, newId.substring(2));
+                    closeTabElement.attr('onclick', updatedOnclickAttr);
+                }
+                $(this).closest('li').attr('id', 'li-' + newId.substring(2));
+
+                // 更新 a 标签的 href 属性
+                let aTag = $(this).closest('li').find('a');
+                if (aTag.length > 0) {
+                    let hrefAttr = aTag.attr('href');
+                    let updatedHrefAttr = hrefAttr.replace(/\d+/g, newId.substring(2));
+                    aTag.attr('href', updatedHrefAttr);
+                }
+            }
+
+        });
+
     }
 </script>
 <style>
+
+    .container-right {
+        display: flex;
+        justify-content: right;
+    }
+
+
+    .myDivrwdz {
+        display: none; /* 初始状态为不显示 */
+    }
+    .remove-buttonx { /* 删除按钮样式 */
+        cursor: pointer;
+        color: red;
+        text-decoration: underline;
+        font-weight: bold;
+    }
+    .grey-text {
+        padding-right: 5px;
+        padding-top: 10px;
+        color: gray;
+        font-family: "楷体", KaiTi, serif;
+        font-size: 11px;
+    }
+    .filter-row {
+        display: flex;
+        align-items: center;
+        margin-bottom: 10px;
+    }
+    .filter-row input,
+    .filter-row select {
+        margin-right: 10px;
+    }
+    .remove-button {
+        cursor: pointer;
+    }
+
+
     .hidden {
         display: none;
     }

+ 68 - 26
health-admin/src/main/resources/templates/dtp/archives/archivesAdd.html

@@ -46,16 +46,15 @@
                     <img id="uploadedImage" src="" alt="上传的图片" style="max-width: 100%; display: block;">
                 </div>
             </div>
-
-
             <div class="customize-form-group">
                 <label class="col-sm-1 control-label">姓名:</label>
-                <input name="name" placeholder="请输入姓名" class="styled-input" type="text" maxlength="30" required>
+                <input name="name" id="name" placeholder="请输入姓名" class="styled-input" type="text" maxlength="30" required>
+                <input type="hidden" name="idCardImg" id="idCardImg" value="">
             </div>
             <div class="customize-form-group">
                 <label class="col-sm-1 control-label">性别:</label>
-                <select name="gender" class="styled-input" th:with="type=${@dict.getType('sys_user_sex')}" required>
-                    <!--<option>所有</option>-->
+                <select name="gender" id="gender" class="styled-input" th:with="type=${@dict.getType('sys_user_sex')}" required>
+                    <option>请选择</option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
                     ></option>
                 </select>
@@ -73,6 +72,7 @@
             <div class="customize-form-group">
             <label class="col-sm-1 control-label">证件类型:</label>
             <select name="documentType" id="documentType"  class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_ysfw_zjlx')}" required>
+                <option>请选择</option>
                 <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
                 ></option>
             </select>
@@ -84,6 +84,7 @@
             <div class="customize-form-group">
                 <label class="col-sm-1 control-label">联系人与患者关系:</label>
                 <select name="contactRelation" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_ysfw_lxryhzgx')}">
+                    <option>请选择</option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
                     ></option>
                 </select>
@@ -106,19 +107,24 @@
 
             <div class="customize-form-group">
                 <label class="col-sm-1 control-label">建档门店:</label>
-                <select name="storeName" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_ysfw_lxryhzgx')}">
+                <select name="storeName" class="styled-input" th:with="type=${@dict.getType('sys_dtp_store')}">
+                    <option>请选择</option>
                     <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
                     ></option>
                 </select>
             </div>
-
             <div class="customize-form-group">
-                <label class="col-sm-1 control-label">建档人:</label>
-                <select name="creator" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_ysfw_lxryhzgx')}">
-                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
+                <label class="col-sm-1 control-label">是否接受随访:</label>
+                <select name="acceptFollowUp" class="styled-input" th:with="type=${@dict.getType('sys_select_yes_no')}">
+                    <option>请选择</option>
+                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
                     ></option>
                 </select>
             </div>
+            <div class="customize-form-group">
+                <label class="col-sm-1 control-label">建档人:</label>
+                    <input name="creator" placeholder="建档人"  id="creator" class="styled-input" type="text">
+            </div>
         </div>
     </form>
 </div>
@@ -129,9 +135,9 @@
 </html>
 
 <script>
+    var prefix = ctx + "dtp/pmService";
     // 示例使用
     function submitHandler() {
-        var prefix = ctx + "dtp/pmService";
         if ($.validate.form()) {
             debugger
             var documentType= $("#documentType").val()
@@ -168,29 +174,65 @@
             var reader = new FileReader();
             reader.onload = function(e) {
                 $('#uploadedImage').attr('src', e.target.result).show();
-                sendImageToServer(e.target.result);
+                // 调用 OCR 识别
+                recognizeIdCard(input.files[0]);
             };
             reader.readAsDataURL(input.files[0]);
+            // 直接将文件对象传递给 sendImageToServer
+            sendImageToServer(input.files[0]);
         }
     }
-
-    function sendImageToServer(imageData) {
+    function sendImageToServer(file) {
+        debugger;
+        var formdata = new FormData();
+        formdata.append("idcardImgfile", file);
         $.ajax({
-            url: '/upload-and-recognize',
-            type: 'POST',
-            contentType: 'application/json',
-            data: JSON.stringify({ imageData: imageData }),
-            success: function(response) {
-                $('#hospital').val(response.hospital);
-                $('#prescriptionDate').val(response.prescriptionDate);
-                $('#prescriptionDoctor').val(response.prescriptionDoctor);
-                $('#clinicalDiagnosis').val(response.clinicalDiagnosis);
-                $('#department').val(response.department);
+            url: prefix + "/updateIdcardImg",
+            data: formdata,
+            type: "post",
+            processData: false,
+            contentType: false,
+            success: function(result) {
+                $("#idCardImg").val(result.msg)
+                console.log($("#idCardImg").val())
             },
-            error: function(error) {
-                console.error('Error:', error);
+            error: function(xhr, status, error) {
+                console.error("Error uploading image:", error);
             }
         });
     }
 
+    function recognizeIdCard(file) {
+        console.log("file="+file)
+        const formData = new FormData();
+        formData.append('image', file);
+        $.ajax({
+            url: prefix + "/idCard",
+            data: formData,
+            type: 'post',
+            processData: false,
+            contentType: false,
+            success: function(result) {
+                console.log("result="+result)
+                if (result.data.words_result) {
+                    const name =result.data.words_result.姓名.words;
+                    const idNumber = result.data.words_result.公民身份号码.words;
+                    const gender = result.data.words_result.性别.words;
+                    const address = result.data.words_result.住址.words;
+                    const dateBirth = result.data.words_result.出生.words;
+                    const nation = result.data.words_result.名族.words;
+
+                    // 将提取的信息填充到表单中
+                    document.getElementById('name').value = name;
+                    document.getElementById('documentNumber').value = idNumber;
+                    document.getElementById('gender').value = gender;
+                } else {
+                    console.error('OCR 识别失败:', result);
+                }
+            },
+            error: function(xhr, status, error) {
+                console.error('OCR 识别错误:', error);
+            }
+        });
+    }
 </script>

+ 118 - 88
health-admin/src/main/resources/templates/dtp/archives/archivesEdit.html

@@ -33,8 +33,9 @@
                                         <input type="hidden" id="id" name="id" th:value="${id}">
                                         <div class="customize-form-group edit">
                                             <label class="control-label is-required">姓名:</label>
-                                            <input name="name" placeholder="请输入姓名" class="styled-input edit_inputs"  type="text" maxlength="30" th:value="${name}" disabled="true">
+                                            <input name="name" id="name"  placeholder="请输入姓名" class="styled-input edit_inputs"  type="text" maxlength="30" th:value="${name}" disabled="true">
                                             &nbsp; <i class="fa" th:class="${realNameStatus == 1 ? 'fa fa-check' : 'fa fa-close'}" id="checkName"  ></i>
+                                            &nbsp;
                                             <input name="realNameStatus" id="realNameStatus" class="status" type="text"   th:value="${realNameStatus == 1 ? '已实名' : (realNameStatus == 0 ? '未实名' : '')}" readonly>
                                         </div>
                                         <div class="customize-form-group edit">
@@ -55,7 +56,7 @@
                                         </div>
                                         <div class="customize-form-group edit">
                                             <label class="control-label is-required">手机号:</label>
-                                            <input name="phoneNumber" placeholder="请输入手机号" class="styled-input edit_inputs" type="text" maxlength="30" th:value="${phoneNumber}" required>
+                                            <input name="phoneNumber" id="phoneNumber" placeholder="请输入手机号" class="styled-input edit_inputs" type="text" maxlength="30" th:value="${phoneNumber}" required>
                                             <span class="span_line" readonly></span>
                                         </div>
 
@@ -160,7 +161,7 @@
                                             <label >上翻状态:</label>
                                             <input name="flipStatus" class="styled-input edit_inputs" id="flipStatus" style="border: none" type="text"
                                                    th:value="${flipStatus == 1 ? '已上翻' : (flipStatus == 2 ? '未上翻' : '')}" disabled readonly>
-                                            <a href="#" onclick="" style="width: 66px;">&nbsp;&nbsp;解绑</a>
+                                            <a href="#" onclick="unbound()" style="width: 66px;" id="unboundflipStatus">&nbsp;&nbsp;解绑</a>
                                         </div>
                                     </form>
                             </div>
@@ -775,13 +776,39 @@
 <th:block th:include="include :: bootstrap-select-js" />
 </html>
 <script th:inline="javascript">
-    // 初始化数据
-    var contacts = [
-        { id: 1, phoneNumber: '18709869299', name: '', relation: '本人' },
-    ];
     var prefix = ctx + "dtp/pmService";
     var prefix2 = ctx + "demo/table";
     var formSubmitted = true;
+    function unbound() {
+        $.modal.confirm("请确认是否解除当前患者档案与患者小程序账号的绑定关系?解绑后无法撤销,请谨慎操作", function() {
+            var id = $("#id").val();
+            var data=[];
+                data.push({name:'id',value:id});
+                console.log("data==="+data)
+            $.ajax({
+                cache: true,
+                type: "POST",
+                url: ctx + "dtp/pmService/unbound",
+                data: data,
+                async: false,
+                error: function (data) {
+                    $.modal.alertError(data.msg);
+                },
+                success: function (data) {
+                   $.modal.alertSuccess(data.msg);
+                    // 重新加载整个页面
+                    location.reload();
+                }
+            });
+        });
+    }
+    var flipStatus = $("#flipStatus").val();
+    var unboundLink = $("#unboundflipStatus");
+    if (flipStatus === '已上翻') {
+        unboundLink.show();
+    } else {
+        unboundLink.hide();
+    }
     function submitHandler() {
         if(formSubmitted===true){
             //表单 基本信息
@@ -992,6 +1019,7 @@
             $('#BMI2').val(result);
         });
     $(document).ready(function() {
+
         // 监听点击事件,激活指定的选项卡
         $('#myTabs3 li a').click(function(e) {
             // 阻止默认行为
@@ -1116,53 +1144,58 @@
          /*<![CDATA[*/
          var contactsData  = /*[[${contactsData}]]*/ '';
          /*]]>*/
-         // 遍历数据并动态生成表格行
-         contactsData.forEach(function(item, index) {
-             var row = '<tr>' +
-                 '<td>' + (index + 1) + '</td>' +
-                 '<td>' + item.contactPhone + '</td>' +
-                 '<td>' + item.contactName + '</td>' +
-                 '<td>' + item.contactRelationship + '</td>' +
-                 '<td><button class="btn-danger" onclick="deleteRow(this)">删除</button></td>' +
-                 '</tr>';
-             $('#relationTableBody').append(row);
-         });
+         if(contactsData!==null) {
+             // 遍历数据并动态生成表格行
+             contactsData.forEach(function (item, index) {
+                 var row = '<tr>' +
+                     '<td>' + (index + 1) + '</td>' +
+                     '<td>' + item.contactPhone + '</td>' +
+                     '<td>' + item.contactName + '</td>' +
+                     '<td>' + item.contactRelationship + '</td>' +
+                     '<td><button class="btn-danger" onclick="deleteRow(this)">删除</button></td>' +
+                     '</tr>';
+                 $('#relationTableBody').append(row);
+             });
+         }
          /*<![CDATA[*/
          var recordsData  = /*[[${recordsData}]]*/ '';
          /*]]>*/
          // 遍历数据并动态生成表格行
-         recordsData.forEach(function(item, index) {
-             var row = '<tr>' +
-                 '<td>' + (index + 1) + '</td>' +
-                 '<td>' + item.medicationDescription + '</td>' +
-                 '<td>' + item.medicationType + '</td>' +
-                 '<td><button class="btn-danger" onclick="deleteRow(this)">删除</button></td>' +
-                 '</tr>';
-             $('#yyqkTableBody').append(row);
-         });
+         if(recordsData!==null) {
+             recordsData.forEach(function (item, index) {
+                 var row = '<tr>' +
+                     '<td>' + (index + 1) + '</td>' +
+                     '<td>' + item.medicationDescription + '</td>' +
+                     '<td>' + item.medicationType + '</td>' +
+                     '<td><button class="btn-danger" onclick="deleteRow(this)">删除</button></td>' +
+                     '</tr>';
+                 $('#yyqkTableBody').append(row);
+             });
+         }
          /*<![CDATA[*/
          var historyData  = /*[[${historyData}]]*/ '';
          /*]]>*/
          // 遍历数据并动态生成表格行
-         historyData.forEach(function(item, index) {
-             var row = '<tr>' +
-                 '<td>' + (index + 1) + '</td>' +
-                 '<td>' + item.disease + '</td>' +
-                 '<td>' + item.member + '</td>' +
-                 '<td><button class="btn-danger" onclick="deleteRow(this)">删除</button></td>' +
-                 '</tr>';
-             $('#familyHistoryTableBody').append(row);
-         });
+         if(historyData!==null) {
+             historyData.forEach(function (item, index) {
+                 var row = '<tr>' +
+                     '<td>' + (index + 1) + '</td>' +
+                     '<td>' + item.disease + '</td>' +
+                     '<td>' + item.member + '</td>' +
+                     '<td><button class="btn-danger" onclick="deleteRow(this)">删除</button></td>' +
+                     '</tr>';
+                 $('#familyHistoryTableBody').append(row);
+             });
+         }
      }
     // 绑定事件监听,当复选框状态改变时更新错误提示
-    $('input[name="insurance2"]').on('change', function() {
+     $('input[name="insurance2"]').on('change', function() {
         if ($('input[name="insurance2"]:checked').length > 0) {
             $('#insurance-error').hide();
         }
     });
-
         // 监听点击事件,激活指定的选项卡
-        $('#myTabs li a').click(function(e) {
+     $('#myTabs li a').click(function(e) {
             // 阻止默认行为
              e.preventDefault();
             // 获取当前点击的选项卡链接
@@ -1202,22 +1235,59 @@
         initializeTableForTab('tab-5');
     }
     function initializeTableForTab(tabId) {
+        var datas=[];
+        debugger
         var tableId = 'bootstrap-table-' + tabId.substring(4);
         var tableElement = $('#' + tableId);
-        // 初始化表格
+        var data = {
+            "patientPhone": $('#phoneNumber').val(),
+            "patientName": $('#name').val(),
+        };
+        console.log("patientPhone="+$('#phoneNumber').val());
+        // 初始化表格 getDrugPurchaseList
+        $.ajax({
+            cache : true,
+            type : "POST",
+            url : ctx + "dtp/pmService/getDrugPurchaseList",
+            data : data,
+            async : false,
+            error : function(request) {
+                $.modal.alertError("系统错误");
+            },
+            success : function(data) {
+                datas=data.rows;
+                $.operate.successCallback(data);
+            }
+        });
         tableElement.bootstrapTable({
             // 配置表格的相关属性
             // 例如数据源、列定义等
             // 示例配置
-            data: [
-                { id: 1, name: 'Row 1' },
-                { id: 2, name: 'Row 2' },
-                { id: 3, name: 'Row 3' }
-            ],
-            columns: [
+            data: datas,
+            columns : [
                 [
-                    { field: 'id', title: 'ID' },
-                    { field: 'name', title: 'Name' }
+                    { field: 'id', title: '序号' },
+                    { field: 'orderId', title: '订单编号' },
+                    { field: 'prescriptionSource', title: '处方来源' },
+                    { field: 'prescriptionDate', title: '处方日期' },
+                    { field: 'hospital', title: '医院' },
+                    { field: 'doctor', title: '医生' },
+                    { field: 'department', title: '科室' },
+                    { field: 'diseaseType', title: '疾病类型' },
+                    { field: 'clinicalDiagnosis', title: '临床诊断' },
+                    { field: 'genericName', title: '药品通用名' },
+                    { field: 'productName', title: '商品名' },
+                    { field: 'specification', title: '规格' },
+                    { field: 'quantity', title: '数量' },
+                    { field: 'manufacturer', title: '厂家' },
+                    { field: 'mdmCode', title: 'MDM编码' },
+                    { field: 'usageMethod', title: '用药途径' },
+                    { field: 'frequency', title: '用药频次' },
+                    { field: 'wordUsage', title: '单次剂量' },
+                    { field: 'medicationCycle', title: '用药周期' },
+                    { field: 'registrar', title: '登记人' },
+                    { field: 'orderTime', title: '下单时间' },
+                    { field: 'drugSource', title: '药品来源' }
                 ]
             ]
         });
@@ -1520,49 +1590,9 @@
         }
 
     }
-    function cancelEdit(button) {
-        const row = button.parentNode.parentNode;
-        row.remove();
-    }
     // 编辑模式标志
     let isEditMode = false;
     let currentRow = null;
-    function editRow(button) {
-        // 设置编辑模式标志
-        isEditMode = true;
-        // 阻止事件冒泡
-        // 获取当前按钮所在的行
-        currentRow = button.closest('tr');
-        // 获取行中的数据单元格
-        const illnessCell = currentRow.querySelector('td:nth-child(2)');
-        const familyMemberCell = currentRow.querySelector('td:nth-child(3)');
-        // 获取当前数据
-        const illness = illnessCell.textContent;
-        const familyMember = familyMemberCell.textContent;
-        // 将数据填充到表单中
-        document.getElementById('illnessInput').value = illness;
-        document.getElementById('familyMemberSelect').value = familyMember;
-        // 显示模态框
-        $('#myModal').modal('show');
-    }
-    function saveChanges() {
-        // 获取表单数据
-        const illness = document.getElementById('illnessInput').value;
-        const familyMember = document.getElementById('familyMemberSelect').value;
-        // 更新表格中的数据
-        const illnessCell = currentRow.querySelector('td:nth-child(2)');
-        const familyMemberCell = currentRow.querySelector('td:nth-child(3)');
-        illnessCell.textContent = illness;
-        familyMemberCell.textContent = familyMember;
-        // 清除编辑标志
-        isEditMode = false;
-        // 关闭模态框
-        $('#myModal').modal('hide');
-    }
-    function copyRow(button) {
-        const row = button.parentNode.parentNode.cloneNode(true);
-        document.getElementById("familyHistoryTable").getElementsByTagName("tbody")[0].appendChild(row);
-    }
     function deleteRow(button) {
         const row = button.parentNode.parentNode;
         row.remove();

+ 16 - 6
health-admin/src/main/resources/templates/dtp/archives/archivesList.html

@@ -17,6 +17,7 @@
 							<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>
 					<form id="archives-form" class="customize-search-form">
 						<div class="customize-form-group">
@@ -57,13 +58,9 @@
 		        <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:user:add">
 		                <i class="fa fa-plus"></i> 患者建档(APP)
 		            </a>
-		             <a class="btn btn-primary single disabled" onclick="$.operate.editTab()" shiro:hasPermission="system:user:edit">
-			            <i class="fa fa-edit"></i> 完善档案
-			        </a>
 		            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:user:remove">
 		                <i class="fa fa-remove"></i> 删除
 		            </a>
-
 		        </div>
 
 				<div class="col-sm-12 select-table table-striped" style="width: 100%; overflow-x: auto;">
@@ -125,8 +122,21 @@
 					{
 						checkbox: true
 					},
-				{field: 'name', title: '姓名', align: 'center'},
-				{field: 'gender', title: '性别', align: 'center'},
+					{field: 'id', title: 'id', align: 'center',visible: false},
+					{field: 'name', title: '姓名', align: 'center'},
+					{field: 'gender', title: '性别', align: 'center',
+					formatter: function(value, row, index) {
+						switch (value) {
+							case 0:
+								return "男";
+								break;
+							case 1:
+								return "女";
+								break;
+							default:
+								return "未知";
+						}
+					}},
 				{field: 'age', title: '年龄', align: 'center'},
 				{field: 'phoneNumber', title: '手机号', align: 'center'},
 				{field: 'documentType', title: '证件类型', align: 'center'},

+ 1631 - 143
health-admin/src/main/resources/templates/dtp/followUp/followUpEdit.html

@@ -1,206 +1,1694 @@
  <!DOCTYPE html>
 <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
 <head>
-    <th:block th:include="include :: header('随访任务')" />
+    <th:block th:include="include :: header('随访任务详情')" />
+    <th:block th:include="include :: layout-latest-css" />
+    <th:block th:include="include :: ztree-css" />
 </head>
 <style>
+    .styled-input5 {
+        /*display: block; /* 使其独占一行 */
+        width: 150px; /* 宽度为容器宽度 */
+        height: 26px;
+        padding: 6px; /* 内边距 */
+        font-size: 14px; /* 字体大小 */
+        color: #333; /* 字体颜色 */
+        /*background-color: #fff; !* 背景颜色 *!*/
+        border: 1px solid #ccc; /* 边框 */
+        border-radius: 4px; /* 圆角边框 */
+        outline: none; /* 移除轮廓 */
+        transition: all 0.3s ease; /* 过渡动画 */
+    }
+    .btn {
+        background-color: #f2f2f2;
+        border: none;
+        color: black;
+        padding: 5px 10px;
+        text-align: center;
+        text-decoration: none;
+        display: inline-block;
+        font-size: 16px;
+        margin: 4px 2px;
+        cursor: pointer;
+    }
+
+    .btn-primary {
+        background-color: #1a7bb9;
+        color: white;
+    }
+
+    .btn-w-m {
+        width: max-content;
+    }
+
+    .btn-default {
+        background-color: #f2f2f2;
+        color: black;
+    }
+    .btn:hover {
+        opacity: 0.8;
+    }
+    .tab-1a {
+        padding-left: 50px;
+        width: 100px;
+        font-size: 15px
+    }
+    .tab-1b {
+        width: 100px;
+        color: blue;
+        font-size:15px;
+    }
+    .task-follow-up {
+        display: flex;
+        align-items: center;
+    }
+
+    .follow-up-person, .plan-buttons {
+        flex: 1;
+    }
+
+    .plan-buttons {
+        text-align: right;
+    }
+    .ibox-title2 {
+        display: flex;
+        align-items: center;
+        justify-content: start;
+        padding: 10px;
+        border-bottom: 1px solid #ddd;
+    }
+    .right-aligned-link {
+        float: right;
+        margin-left: 20px; /* 增加左侧边距 */
+    }
+
+    .right-aligned-link::after {
+        content: ">";
+        color: blue;
+    }
+    .task-info {
+        flex: 1;
+    }
+
+    .task-details {
+        flex: 2;
+        display: flex;
+        align-items: center;
+        gap: 20px;
+    }
+
+    .task-buttons {
+        flex: 1;
+        display: flex;
+        align-items: center;
+        justify-content: flex-end;
+        gap: 10px;
+    }
+
+    .task-buttons span {
+        margin-left: 10px;
+    }
+
+    .task-details span {
+        display: flex;
+        align-items: center;
+        gap: 5px;
+    }
+    .custom-file-upload {
+        position: relative;
+        overflow: hidden;
+        cursor: pointer;
+        display: flex;
+        justify-content: center;
+        align-items: center;
+    }
+
+    .custom-file-upload input[type=file] {
+        opacity: 0;
+        width: 100%;
+        height: 100%;
+        top: 0;
+        left: 0;
+        position: absolute;
+    }
+
+    .custom-file-upload label {
+        background-color: white;
+        border: 2px dashed #007bff;
+        color: #007bff;
+        padding: 20px;
+        text-align: center;
+        display: block;
+        min-height: 150px;
+    }
+    #hbyyjlTable {
+        width: 100%;
+        border-collapse: collapse;
+    }
+
+     th,
+     td {
+        padding: 10px;
+        text-align: center;
+        border-bottom: 1px solid #ddd;
+    }
+
+     thead th {
+        background-color: #f2f2f2;
+        font-weight: bold;
+    }
+
+     tbody tr:hover {
+        background-color: #f5f5f5;
+    }
+
+     .no-data {
+        text-align: center;
+        padding: 0px;
+    }
+
+    .btn-primarys {
+        margin-left: 10px;
+        color: green;
+    }
 
 </style>
 <script>
 
 </script>
 <body>
+<div class="">
+    <div class="ibox">
+        <div class="ibox-title">
+
+            <h5>李华 <span style="font-size: 1.5rem;" class="label-primary">已实名</span></h5>
+            <button type="button" class="btn btn-sm btn-danger pull-right" onclick="closeItem()"><i class="fa fa-remove"></i>关 闭 页 面</button>
+            <button class="btn btn-w-m btn-primary pull-right">编辑档案</button>
+        </div>
+        <div class="ibox-content">
+            <p>
+                <span style="font-size: 1.5rem;">性别: </span><code style="font-size: 1.5rem;">男</code>
+                <span style="font-size: 1.5rem;">年龄:</span><code style="font-size: 1.5rem;">62</code><span style="font-size: 1.5rem;">岁</span>
+                <code style="font-size: 1.5rem;">肿瘤</code>
+                <code style="font-size: 1.5rem;">脱落</code>
+                <code style="font-size: 1.5rem;">乐卫马</code>
+                <span style="font-size: 1.5rem;">用药天数</span>
+                <code style="font-size: 1.5rem;">12 </code>
+                <span style="font-size: 1.5rem;">天</span>
+                <code style="font-size: 1.5rem;">持续购药</code>
+            </p>
+            <div>
+                <span>信息完整度:已完善---></span>
+                <div class="stat-percent">90%</div>
+                <div class="progress progress-mini">
+                    <div style="width: 90%;" class="progress-bar">cscsac</div>
+                </div>
+            </div>
+        </div>
+    </div>
     <div class="ui-layout-center">
-        <form class="form-horizontal" id="form-followUp-edit" th:object="${user}">
-            <h4 class="form-header h4">基本信息</h4>
-            <input type="hidden" id="id" name="id" th:value="${id}">
-            <div class="row">
+        <div class="row">
+            <div class="col-sm-12">
+                <div class="tabs-container">
+                    <ul class="nav nav-tabs" id="myUlTabs">
+                        <li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true"> 基本信息</a>
+                        </li>
+                        <li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">用药购药</a>
+                        </li>
+                        <li class=""><a data-toggle="tab" href="#tab-3" aria-expanded="false">随访小结</a>
+                        </li>
+                        <li class=""><a data-toggle="tab" href="#tab-4" aria-expanded="false">随访计划</a>
+                        </li>
+                    </ul>
+                    <div class="tab-content">
+                        <div id="tab-1" class="tab-pane active">
+                                <form class="customize-search-form" id="form-hz-info" >
+                                    <input type="hidden" id="id" name="id" th:value="${id}">
+                                    <div class="customize-form-group">
+                                        <span class="tab-1a" style="font-size:15px;">手机号:</span> <span class="tab-1b" style="color: #2E2D3C;font-size:15px;">13899845568</span>
+                                        <span style="width: 50px;font-size:15px;">疾病:</span> <span style="width: 100px;color: #2E2D3C;font-size:15px;">慢病</span>
+                                        <span style="width: 100px;font-size:15px;">患者是否知情:</span> <span style="width: 50px;color: #2E2D3C;font-size:15px;">是</span>
+                                        <span style="width: 80px;font-size:15px;">病理分期:</span> <span style="width: 100px;color: #2E2D3C;font-size:15px;">慢务处病</span>
+                                        <span style="width: 80px;font-size:15px;">治疗分期:</span> <span style="width: 100px;color: #2E2D3C;font-size:15px;">带无强大</span>
+                                        <span style="width: 80px;font-size:15px;">营养评分:</span> <span style="width: 30px;color: #2E2D3C;font-size:15px;">66</span>
+                                        <span style="width: 80px;font-size:15px;">病程天数:</span> <span style="width: 30px;color: #2E2D3C;font-size:15px;">6</span>
+                                        <span style="width: 80px;font-size:15px;">购药天数:</span> <span style="width: 30px;color: #2E2D3C;font-size:15px;">5</span>
+<!--                                        <input name="phoneNumber" id="phoneNumber"   class="styled-input" th:value="${phoneNumber}" readonly>-->
+<!--                                        <label>疾病:</label>-->
+<!--                                        <input name="diseaseTyp1" id="diseaseType"   class="styled-input" th:value="${diseaseType}" readonly>-->
+<!--                                        <label>患者是否知情:</label>-->
+<!--                                        <input name="patientAwareness" id="patientAwareness"   class="styled-input" th:value="${patientAwareness}" readonly>-->
+<!--                                        <label>病理分期:</label>-->
+<!--                                        <input name="pathologicalStage" id="pathologicalStage"   class="styled-input" th:value="${pathologicalStage}" readonly>-->
 
-                <div class="col-sm-12">
-                    <div class="form-group">
-                        <!--is-required 增加星号 显示为必填-->
-                        <label class="col-sm-1 control-label">预约日期:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input type="text" class="styled-input time-input-new" id="appointmentDate" placeholder="预约日期" name="appointmentDate" th:value="${appointmentDate}" required/>
-                            </div>
-                        </div>
-                        <label class="col-sm-1 control-label">业务归属:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <select name="businessBelonging" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_ywgs')}" >
-                                    <option>所有</option>
-                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
-                                            th:selected="${dict.dictLabel} == ${businessBelonging}" ></option>
-                                </select>
-                                <!--<input name="gender" placeholder="请输入性别" class="styled-input" type="text" maxlength="30" th:value="${gender}" required>-->
-                            </div>
+<!--                                        <label>治疗分期:</label>-->
+<!--                                        <input name="treatmentStage" id="treatmentStage"   class="styled-input" th:value="${treatmentStage}" readonly>-->
+<!--                                        <label>营养评分:</label>-->
+<!--                                        <input name="NutritionalScore" id="NutritionalScore"   class="styled-input" th:value="${NutritionalScore}" readonly>-->
+<!--                                        <label>病程天数:</label>-->
+<!--                                        <input name="PurchaseDays" id="PurchaseDays"   class="styled-input" th:value="${PurchaseDays}" readonly>-->
+<!--                                        <label>购药天数:</label>-->
+<!--                                        <input name="DurationDisease" id="DurationDisease"   class="styled-input" th:value="${DurationDisease}" readonly>-->
+
+                                        <span><button class="btn btn-w-m btn-primary pull-right" onclick="showAllUserInfo()">查看全部</button></span>
+                                    </div>
+                                </form>
                         </div>
-                        <label class="col-sm-1 control-label">任务名称:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input name="taskName" placeholder="请输入任务名称" class="styled-input" type="text" maxlength="30" th:value="${taskName}" required>
-                            </div>
+                        <div id="tab-2" class="tab-pane">
+                                    <div class="panel-body">
+                                            <div class="row">
+                                                <div class="col-sm-12 select-table table-striped">
+                                                    <table id="bootstrap-table-2"></table>
+                                                </div>
+                                            </div>
+                                    </div>
                         </div>
-                        <label class="col-sm-1 control-label">任务主题:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <select name="taskTheme" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_sfrw_rwzt')}">
-                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
-                                            th:selected="${dict.dictLabel} == ${taskTheme}"></option>
-                                </select>
+                        <div id="tab-3" class="tab-pane active">
+                            <div class="panel-body">
+                                <div class="row">
+                                    <div class="col-sm-12 select-table table-striped">
+                                        <table id="bootstrap-table-3"></table>
+                                    </div>
+                                </div>
                             </div>
                         </div>
-                    </div>
-                </div>
+                        <div id="tab-4" class="tab-pane">
+                            <div class="task-follow-up">
+                                <div class="follow-up-person">
+                                    <label for="followUpPerson" style="padding-left: 50px;">任务跟进人:</label>
+                                    <input type="text" id="followUpPerson" value="蒋娟" style="border: none; width: 40px; color: red;" />
+                                    <a href="#" onclick="editGenJinRen()">修改<i class="glyphicon glyphicon-pencil"></i></a>
+                                </div>
+                                <div class="plan-buttons">
+                                     <button class="btn btn-w-m btn-primary" onclick="createPlan()">创建计划</button>
+                                    <button class="btn btn-w-m btn-primary" onclick="showAllPlan()">查看全部计划</button>
+                                </div>
+                            </div>
+
+                            <div class="row">
+                                <div class="ibox-content">
+                                    <div class="ibox-title2">
+                                             <code style="font-size: 1.5rem;padding-right: 30px;">
+                                                 甲磺酸仑伐替尼胶囊
+                                                 <a onclick="editGenJinRen()"><i class="glyphicon glyphicon-pencil"></i></a>
+                                             </code>
+                                        <code style="font-size: 1.5rem;color: #00B83F;padding-right: 30px;"><i class="glyphicon glyphicon-ice-lolly">常规随访</i></code>
+                                            <button style="color: #00B83F;padding-right: 30px;" >进行中</button>
+                                        <code style="font-size: 1.5rem;padding-right: 30px;">甲磺酸仑伐替尼胶囊</code>
+                                        <code style="font-size: 1.5rem;padding-right: 30px;">(乐卫玛)甲磺酸仑伐替尼胶囊(13%)</code>
+                                        <code style="font-size: 1.5rem;padding-right: 30px;">4mgx10粒x3板,Eisai Co</code>
+                                        <code style="font-size: 1.5rem;padding-right: 30px;"> Ltd</code>
+                                        <a onclick="closePlane()" href="javascript:void(0)" class="right-aligned-link">关闭计划</a>
+                                    </div>
+
+                                    </div>
 
-                <div class="col-sm-12">
-                    <div class="form-group">
-                        <!--is-required 增加星号 显示为必填-->
-                        <label class="col-sm-1 control-label">患者姓名:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input name="patientName" placeholder="请输入姓名" class="styled-input" type="text" maxlength="30" th:value="${patientName}" required>
-                            </div>
-                        </div>
-                        <label class="col-sm-1 control-label">性别:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <select name="gender" class="styled-input" th:with="type=${@dict.getType('sys_user_sex')}" >
-                                    <!--<option>所有</option>-->
-                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
-                                            th:selected="${dict.dictLabel} == ${gender}" ></option>
-                                </select>
-                                <!--<input name="gender" placeholder="请输入性别" class="styled-input" type="text" maxlength="30" th:value="${gender}" required>-->
                             </div>
-                        </div>
-                        <label class="col-sm-1 control-label">年龄:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input name="age" placeholder="请输入年龄" class="styled-input" type="text" maxlength="30" th:value="${age}">
+                            <div class="row">
+                                <div class="ibox-content">
+                                    <div class="ibox-title2">
+                                        <span style="padding-left: 10px;font-size:15px;">创建人:</span>
+                                        <span style="width: 120px;color: #2E2D3C;font-size:15px;padding-right: 40px;">系统订单</span>
+                                        <span style="font-size:15px;">开始时间:</span> <span style="width: 120px;color: #2E2D3C;font-size:15px;padding-right: 40px;">2024-08-19</span>
+                                        <span style="font-size:15px;">更新人:</span> <span style="width: 100px;color: #2E2D3C;font-size:15px;">宝智达</span>
+                                        <span style="font-size:15px;">更新时间:</span> <span style="width: 100px;color: #2E2D3C;font-size:15px;">2024-08-19</span>
+                                        <a href="javascript:void(0)" onclick="ViewOperationLog()" class="right-aligned-link">查看操作记录</a>
+                                    </div>
+
+                                </div>
+
                             </div>
-                        </div>
-                        <label class="col-sm-1 control-label">随访小结:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input name="followUpSummary" placeholder="随访小结" class="styled-input" type="text" maxlength="30" th:value="${followUpSummary}">
+                            <div class="row">
+                                <div class="col-sm-12 select-table table-striped">
+                                    <table id="bootstrap-table-4"></table>
+                                </div>
+                            </div>
+
+                            <div class="row">
+                                <div class="ibox-content">
+                                    <div class="ibox-title2">
+                                        <code style="font-size: 1.5rem; padding-right: 30px;">
+                                            甲磺酸仑伐替尼胶囊
+                                            <a onclick="editGenJinRen()"><i class="glyphicon glyphicon-pencil"></i> </a>
+                                        </code>
+
+                                        <code style="font-size: 1.5rem; color:#ec971f;padding-right: 30px;"><i class="glyphicon glyphicon-ice-lolly-tasted">脱落召回</i></code>
+                                        <button style="color: #00B83F;padding-right: 30px;" >进行中</button>
+                                        <a onclick="closePlane()" href="javascript:void(0)" class="right-aligned-link">关闭计划</a>
+                                    </div>
+
+                                </div>
+
+                            </div>
+                            <div class="row">
+                                <div class="ibox-content">
+                                    <div class="ibox-title2">
+                                        <span style="padding-left: 10px;font-size:15px;">创建人:</span>
+                                        <span style="width: 120px;color: #2E2D3C;font-size:15px;padding-right: 40px;">系统订单</span>
+                                        <span style="font-size:15px;">开始时间:</span> <span style="width: 120px;color: #2E2D3C;font-size:15px;padding-right: 40px;">2024-08-19</span>
+                                        <span style="font-size:15px;">更新人:</span> <span style="width: 100px;color: #2E2D3C;font-size:15px;">宝智达</span>
+                                        <span style="font-size:15px;">更新时间:</span> <span style="width: 100px;color: #2E2D3C;font-size:15px;">2024-08-19</span>
+                                        <a href="javascript:void(0)" onclick="ViewOperationLog()" class="right-aligned-link">查看操作记录</a>
+                                    </div>
+
+                                </div>
+
+                            </div>
+                            <div class="row">
+                                <div class="col-sm-12 select-table table-striped">
+                                    <table id="bootstrap-table-5"></table>
+                                </div>
                             </div>
+
                         </div>
                     </div>
                 </div>
+            </div>
+        </div>
+        <div class="ibox-content">
+            <div class="ibox-title2">
+                <div class="task-info">
+                    <h4>本次任务 <code style="font-size: 1.5rem;">待执行</code></h4>
+                </div>
+                <div class="task-details">
+                    <span style="font-size:15px;">任务名称:
+                        <span style="font-size:15px;">随访</span>
+                    </span>
+                        <span style="font-size:15px;">任务主题:
+                            <span>
+                                <select name="taskTheme" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_sfrw_rwzt')}">
+                                    <option value="">请选择</option>
+                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
+                                </select>
+                           </span>
+                       </span>
+                    <span style="font-size:15px;">任务跟进人:
+                        <span style="color: #2E2D3C;font-size:15px;"><code style="font-size: 1.4rem;font-size:15px;">蒋娟</code>
+                       <a onclick="editGenJinRen()" style="font-size:15px;"> 修改 <i class="glyphicon glyphicon-pencil"></i></a>
+                       </span>
+                    </span>
+                </div>
+                <div class="task-buttons">
+                    <span style="font-size:15px;">营养测评<a  data-toggle="modal" data-target="#myModalDpg" style="font-size:15px;"> 待评估 <i class="glyphicon glyphicon-edit"></i></a></span>
+                    <button class="btn btn-w-m btn-primary" onclick="showDetailHistory()">查看历史随访</button>
+                </div>
+            </div>
+        </div>
+            <div class="row">
                 <div class="col-sm-12">
-                    <div class="form-group">
-                        <!--is-required 增加星号 显示为必填-->
-                        <label class="col-sm-1 control-label">疾病:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input name="disease" placeholder="请输入证件类型" class="styled-input" type="text" maxlength="30" th:value="${disease}">
-                            </div>
+                <div class="panel blank-panel">
+                    <div class="panel-heading" style="width: 1100px;">
+                        <div class="panel-options">
+                            <ul class="nav nav-tabs" id="myTabs2">
+                                <li class="active"><a data-toggle="tab" href="#tab-5" aria-expanded="true">本次任务</a>
+                                </li>
+                                <li class=""><a data-toggle="tab" href="#tab-6">用药依从性</a>
+                                </li>
+                                <li class=""><a data-toggle="tab" href="#tab-7" >药物安全性</a>
+                                </li>
+                                <li class=""><a data-toggle="tab" href="#tab-8">药物有效性</i></a>
+                                </li>
+                                <li class=""><a data-toggle="tab" href="#tab-9">治疗方案</a>
+                                </li>
+                                <li class=""><a data-toggle="tab" href="#tab-10">适宜性评估</a>
+                                </li>
+                                <li class=""><a data-toggle="tab" href="#tab-11">用药记录</a>
+                                </li>
+                                <li class=""><a data-toggle="tab" href="#tab-12">量表测评</a>
+                                </li>
+                                <li class=""><a data-toggle="tab" href="#tab-13">患者咨询</a>
+                                </li>
+                                <li class=""><a data-toggle="tab" href="#tab-14">其他</a>
+                                </li>
+                            </ul>
                         </div>
-                        <label class="col-sm-1 control-label">门店:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input name="storeName" placeholder="请输入证件号码" class="styled-input" type="text" maxlength="30" th:value="${storeName}" required>
+                    </div>
+
+                    <div class="panel-body">
+                        <div class="tab-content">
+                            <div id="tab-5" class="tab-pane active">
+                                <div class="customize-form-group edit">
+                                    <label class="is-required">回访方式:</label>
+                                    <div class="input-groups" th:with="type=${@dict.getType('sys_select_dtp_ysfw_huifangfangshi')}">
+                                        <input type="radio" class="form-check-radio"  th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"   th:checked="${dict.dictLabel}==${currentEconomicSituation}" name="currentEconomicSituation" >
+                                    </div>
+                                    <span class="status"></span>
+                                </div>
+                                <div id="weixin">
+                                    <div class="customize-form-group edit">
+                                        <label class="is-required" for="adverseReactionImage">回访图片:</label>
+                                        <div class="custom-file-upload">
+                                            <input type="file" id="adverseReactionImage" accept=".jpg,.jpeg,.png,.gif">
+                                            <label for="adverseReactionImage"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#007bff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-plus-circle"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="16"></line><line x1="8" y1="12" x2="16" y2="12"></line></svg></label>
+                                        </div>
+                                    </div>
+
+                                </div>
+                                <div id="mianfang">
+                                    <div class="customize-form-group edit">
+                                        <label>面访记录:</label>
+                                        <div class="input-groups">
+                                            <input name="weight" id="mfjilu" placeholder="请输入面访记录" class="styled-input edit_inputs" type="text"  th:value="${weight}">
+                                        </div>
+                                        <span class="status"></span>
+                                    </div>
+                                </div>
+                                <div class="customize-form-group edit">
+                                    <label class="is-required">是否配合:</label>
+                                    <div class="input-groups" th:with="type=${@dict.getType('sys_yes_no')}">
+                                        <input type="radio" class="form-check-radio" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"  th:checked="${dict.dictLabel}==${followUpFeedbackDoctor}"  name="followUpFeedbackDoctor" >
+                                    </div>
+                                    <span class="status"></span>
+                                </div>
+                                <div class="customize-form-group">
+                                    <label>回访对象:</label>
+                                    <select name="bloodPressureStatus" class="select-input" th:with="type=${@dict.getType('sys_select_dtp_ysfw_huifangduixaing')}">
+                                        <option value="">请选择</option>
+                                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
+                                                th:selected="${dict.dictLabel}==${bloodPressureStatus}"></option>
+                                    </select>
+                                    <span class="status"></span>
+                                </div>
                             </div>
-                        </div>
-                        <label class="col-sm-1 control-label">药品通用名:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input name="genericName" placeholder="请输入证件号码" class="styled-input" type="text" maxlength="30" th:value="${genericName}" required>
+                            <div id="tab-6" class="tab-pane active">
+                                <div class="customize-form-group edit">
+                                    <label  >是否持续用药(用药状态):</label>
+                                    <div class="input-groups" th:with="type=${@dict.getType('sys_select_dtp_ysfw_huifangduixaing')}">
+                                        <input type="radio" class="form-check-radio"  th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"   th:checked="${dict.dictLabel}==${currentEconomicSituation}" name="currentEconomicSituation" >
+                                    </div>
+                                    <span class="status"></span>
+                                </div>
+                                <div class="customize-form-group edit">
+                                    <label class="is-required">确诊后首次用药日期:</label>
+                                    <div class="input-groups select-time">
+                                        <input name="timeFirstDiagnosis" placeholder="确诊后首次用药日期" class="time-input-new styled-input" type="text"  th:value="${timeFirstDiagnosis}" required>
+                                    </div>
+                                    <span class="status"></span>
+                                </div>
+                                <div class="customize-form-group edit">
+                                    <label>慈善援助用药:</label>
+                                    <div class="input-groups" th:with="type=${@dict.getType('sys_yes_no')}">
+                                        <input type="radio" class="form-check-radio" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"  th:checked="${dict.dictLabel}==${followUpFeedbackDoctor}"  name="followUpFeedbackDoctor" >
+                                    </div>
+                                    <span class="status"></span>
+                                </div>
+                                <div class="customize-form-group edit">
+                                    <label>永久停药时间:</label>
+                                    <div class="input-groups" th:with="type=${@dict.getType('sys_yes_no')}">
+                                        <input name="timeFirstDiagnosis" placeholder="永久停药时间" class="time-input-new styled-input" type="text"  th:value="${timeFirstDiagnosis}" required>
+                                    </div>
+                                    <span class="status"></span>
+                                </div>
+                                <div class="customize-form-group edit">
+                                    <label>永久停药原因:</label>
+                                    <div class="input-groups" th:with="type=${@dict.getType('sys_yes_no')}">
+                                        <input type="radio" class="form-check-radio" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"  th:checked="${dict.dictLabel}==${followUpFeedbackDoctor}"  name="followUpFeedbackDoctor" >
+                                    </div>
+                                    <span class="status"></span>
+                                </div>
+                                <div class="customize-form-group edit">
+                                    <label>永久停药:</label>
+                                    <div class="input-groups" th:with="type=${@dict.getType('sys_yes_no')}">
+                                        <input type="radio" class="form-check-radio" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"  th:checked="${dict.dictLabel}==${followUpFeedbackDoctor}"  name="followUpFeedbackDoctor" >
+                                    </div>
+                                    <span class="status"></span>
+                                </div>
+                                <div class="customize-form-group edit">
+                                    <label>其他渠道购药:</label>
+                                    <div class="input-groups" th:with="type=${@dict.getType('sys_yes_no')}">
+                                        <input type="radio" class="form-check-radio" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"  th:checked="${dict.dictLabel}==${followUpFeedbackDoctor}"  name="followUpFeedbackDoctor" >
+                                    </div>
+                                    <span class="status"></span>
+                                </div>
+                                <div class="customize-form-group edit">
+                                    <label>延迟购药(医嘱建议):</label>
+                                    <div class="input-groups" th:with="type=${@dict.getType('sys_yes_no')}">
+                                        <input type="radio" class="form-check-radio" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"  th:checked="${dict.dictLabel}==${followUpFeedbackDoctor}"  name="followUpFeedbackDoctor" >
+                                    </div>
+                                    <span class="status"></span>
+                                </div>
+                                <div class="customize-form-group edit">
+                                    <label>延迟购药(患者用药不规范:</label>
+                                    <div class="input-groups" th:with="type=${@dict.getType('sys_yes_no')}">
+                                        <input type="radio" class="form-check-radio" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"  th:checked="${dict.dictLabel}==${followUpFeedbackDoctor}"  name="followUpFeedbackDoctor" >
+                                    </div>
+                                    <span class="status"></span>
+                                </div>
+                                <div class="customize-form-group edit">
+                                    <label>更换治疗用药药品名称:</label>
+                                    <div class="input-groups" th:with="type=${@dict.getType('sys_yes_no')}">
+                                        <input type="text" class="styled-input" name="followUpFeedbackDoctor" th:value="${followUpFeedbackDoctor}">
+                                    </div>
+                                    <span class="status"></span>
+                                </div>
+
+                             </div>
+                            <div id="tab-7" class="tab-pane active">
+                                <div class="customize-form-group edit">
+                                    <label  >是否出现不良反应:</label>
+                                    <div class="input-groups" th:with="type=${@dict.getType('sys_yes_no')}">
+                                        <input type="radio" class="form-check-radio"  th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"   th:checked="${dict.dictLabel}==${currentEconomicSituation}" name="currentEconomicSituation" >
+                                    </div>
+                                    <span class="status"></span>
+                                </div>
+                                <div id="bulfyyes">
+                                    <div class="customize-form-group edit">
+                                        <label>不良反应时间:</label>
+                                        <div class="input-groups" th:with="type=${@dict.getType('sys_yes_no')}">
+                                            <input name="nyfysj" placeholder="永久停药时间" class="time-input-new styled-input" type="text"  th:value="${timeFirstDiagnosis}" required>
+                                        </div>
+                                        <span class="status"></span>
+                                    </div>
+                                    <div class="customize-form-group edit">
+                                        <label>不良反应:</label>
+                                    <div class="input-groups">
+                                        <input name="weight" id="blfy" placeholder="请输入不良反应" class="styled-input edit_inputs" type="text"  th:value="${weight}">
+                                    </div>
+                                    <span class="status"></span>
+                                    </div>
+                                    <div class="customize-form-group edit">
+                                        <label>不良反应处理方式:</label>
+                                        <div class="input-groups">
+                                            <input name="weight" id="blfyclfs" placeholder="不良反应处理方式" class="styled-input edit_inputs" type="text"  th:value="${weight}">
+                                        </div>
+                                        <span class="status"></span>
+                                    </div>
+                                </div>
+                                <div id="hbyyqtblfydiv">
+                                    <div class="customize-form-group edit">
+                                        <label>合并用药其他不良反应:</label>
+                                        <div class="input-groups">
+                                            <input name="weight" id="hbyyqtblfy" placeholder="合并用药其他不良反应" class="styled-input edit_inputs" type="text"  th:value="${weight}">
+                                        </div>
+                                        <span class="status"></span>
+                                    </div>
+                                    <div class="customize-form-group edit">
+                                        <label  for="blfyclfsImage">合并用药其他不良反应图片:</label>
+                                        <div class="custom-file-upload">
+                                            <input type="file" id="blfyclfsImage" name="blfyclfsImage" accept=".jpg,.jpeg,.png,.gif">
+                                            <label for="blfyclfsImage"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#007bff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-plus-circle"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="16"></line><line x1="8" y1="12" x2="16" y2="12"></line></svg></label>
+                                        </div>
+                                        <span class="status"></span>
+                                    </div>
+                                    <div class="customize-form-group edit">
+                                        <label>合并用药其他不良反应处理:</label>
+                                             <textarea id="hbyyqtqtblfy" name="hbyyqtqtblfy" class="styled-input edit_inputs textareas"
+                                                       style="width: auto;height: auto ;border: 1px solid ;"
+                                                       th:text="${accompanyingSymptoms}" placeholder="合并用药其他不良反应处理..." rows="4" cols="112" ></textarea>
+                                        <span class="status"></span>
+                                    </div>
+
+                                </div>
                             </div>
-                        </div>
-                        <label class="col-sm-1 control-label">商品名:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input name="productName" placeholder="请输入证件号码" class="styled-input" type="text" maxlength="30" th:value="${productName}" required>
+                            <div id="tab-8" class="tab-pane active">
+                                <div class="customize-form-group edit">
+                                    <label class="is-required">是否复查:</label>
+                                    <select name="patientAwareness" class="select-input" th:with="type=${@dict.getType('sys_yes_no')}" required>
+                                        <option value="">请选择</option>
+                                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
+                                                th:selected="${dict.dictLabel}==${patientAwareness}"></option>
+                                    </select>
+                                    <span class="status"></span>
+                                </div>
+                                <div id="sffcyes">
+                                    <div class="customize-form-group edit">
+                                        <label class="is-required">影像学检查:</label>
+                                        <div class="input-groups" th:with="type=${@dict.getType('sys_select_dtp_ysfw_bxlx')}" id="targetInsuranceDiv">
+                                            <input type="checkbox" class="form-check-radio" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"   name="insurance2">
+                                        </div>
+                                        <span class="status"></span>
+                                    </div>
+                                    <div id="ctradio">
+                                        <div class="customize-form-group edit" >
+                                            <label>CT:</label>
+                                            <div class="input-groups" th:with="type=${@dict.getType('sys_select_dtp_ysfw_mqjjzt')}">
+                                                <input type="radio" class="form-check-radio" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"  th:checked="${dict.dictLabel}==${followUpFeedbackDoctor}"  name="followUpFeedbackDoctor" >
+                                            </div>
+                                            <span class="status"></span>
+                                        </div>
+
+                                        <div class="customize-form-group edit">
+                                            <label>CT文本:</label>
+                                            <div class="input-groups">
+                                                <input name="weight" id="CTtext" placeholder="请输入CT文本" class="styled-input edit_inputs" type="text"  th:value="${weight}">
+                                            </div>
+                                            <span class="status"></span>
+                                        </div>
+                                    </div>
+                                    <div id="bcradio">
+                                        <div class="customize-form-group edit">
+                                            <label>B超:</label>
+                                            <div class="input-groups" th:with="type=${@dict.getType('sys_select_dtp_ysfw_mqjjzt')}">
+                                                <input type="radio" class="form-check-radio" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"  th:checked="${dict.dictLabel}==${followUpFeedbackDoctor}"  name="followUpFeedbackDoctor" >
+                                            </div>
+                                            <span class="status"></span>
+                                        </div>
+
+                                        <div class="customize-form-group edit">
+                                            <label>B超文本:</label>
+                                            <div class="input-groups">
+                                                <input name="weight" id="BCtext" placeholder="请输入B超文本" class="styled-input edit_inputs" type="text"  th:value="${weight}">
+                                            </div>
+                                            <span class="status"></span>
+                                        </div>
+                                    </div>
+                                    <div id="HCradio">
+                                        <div class="customize-form-group edit">
+                                            <label>核磁:</label>
+                                            <div class="input-groups" th:with="type=${@dict.getType('sys_select_dtp_ysfw_mqjjzt')}">
+                                                <input type="radio" class="form-check-radio" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"  th:checked="${dict.dictLabel}==${followUpFeedbackDoctor}"  name="followUpFeedbackDoctor" >
+                                            </div>
+                                            <span class="status"></span>
+                                        </div>
+
+                                        <div class="customize-form-group edit">
+                                            <label>核磁文本:</label>
+                                            <div class="input-groups">
+                                                <input name="weight" id="HCtext" placeholder="请输入核磁文本它" class="styled-input edit_inputs" type="text"  th:value="${weight}">
+                                            </div>
+                                            <span class="status"></span>
+                                        </div>
+                                    </div>
+                                    <div id="QTradio">
+                                        <div class="customize-form-group edit">
+                                            <label>影像学检查其它:</label>
+                                            <div class="input-groups">
+                                                <input name="weight" id="yxxqtjc" placeholder="请输入影像学检查其它" class="styled-input edit_inputs" type="text"  th:value="${weight}">
+                                            </div>
+                                            <span class="status"></span>
+                                        </div>
+                                    </div>
+                                    <div class="customize-form-group edit">
+                                        <label  for="yxxjctpImage">影像学检查图片:</label>
+                                        <div class="custom-file-upload">
+                                            <input type="file" id="yxxjctpImage" name="blfyclfsImage" accept=".jpg,.jpeg,.png,.gif">
+                                            <label for="yxxjctpImage"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#007bff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-plus-circle"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="16"></line><line x1="8" y1="12" x2="16" y2="12"></line></svg></label>
+                                        </div>
+                                        <span class="status"></span>
+                                    </div>
+                                    <div class="customize-form-group edit">
+                                        <label  for="zlbjwjcImage">肿瘤物标记检查图片:</label>
+                                        <div class="custom-file-upload">
+                                            <input type="file" id="zlbjwjcImage" name="zlbjwjcImage" accept=".jpg,.jpeg,.png,.gif">
+                                            <label for="zlbjwjcImage"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#007bff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-plus-circle"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="16"></line><line x1="8" y1="12" x2="16" y2="12"></line></svg></label>
+                                        </div>
+                                        <span class="status"></span>
+                                    </div>
+                                    <div class="customize-form-group edit">
+                                        <label class="is-required">肿瘤标记物检查:</label>
+                                        <div class="input-groups" th:with="type=${@dict.getType('sys_select_dtp_ysfw_bxlx')}" id="zlbjwjc">
+                                            <input type="checkbox" class="form-check-radio" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"   name="zlbjwjc">
+                                        </div>
+                                        <span class="status"></span>
+                                    </div>
+
+                                    <div id="zlbjwjcfuji">
+                                        <div class="customize-form-group edit">
+                                            <label>CEA:</label>
+                                            <div class="input-groups">
+                                                <input name="CEA" id="CEA" placeholder="请输入CEA" class="styled-input edit_inputs" type="text"  th:value="${weight}">
+                                            </div>
+                                            <span class="status"></span>
+                                        </div>
+                                    </div>
+
+                                    <div class="customize-form-group edit">
+                                        <label>实验室检查指标:</label>
+                                        <textarea id="sysjczb" name="sysjczb" class="styled-input edit_inputs textareas"
+                                                  style="width: auto;height: 140px ;border: 1px solid ;"
+                                                  th:text="${accompanyingSymptoms}" placeholder="实验室检查指标..." rows="1.9" cols="112" ></textarea>
+
+                                        <span class="status"></span>
+                                    </div>
+                                    <div class="customize-form-group edit">
+                                        <label>提示</label>
+                                        <input name="tishi" id="tishi" placeholder="可填写中性粒细胞(NEUT)、血小板(PLT)、白蛋白(AIB)、谷丙转氨酶(ALT)、谷草转氨酶(AST)、肌酐(Crea)、总胆红素(T-BIL)" class="styled-input"
+                                               style="border: none" type="text"  value="可填写中性粒细胞(NEUT)、血小板(PLT)、白蛋白(AIB)、谷丙转氨酶(ALT)、谷草转氨酶(AST)、肌酐(Crea)、总胆红素(T-BIL)" readonly>
+                                        <span class="status"></span>
+                                    </div>
+                                    <div class="customize-form-group edit">
+                                        <label  for="sysjctbtp">实验室检查指标图片:</label>
+                                        <div class="custom-file-upload">
+                                            <input type="file" id="sysjctbtp" name="sysjctbtp" accept=".jpg,.jpeg,.png,.gif">
+                                            <label for="sysjctbtp"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#007bff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-plus-circle"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="16"></line><line x1="8" y1="12" x2="16" y2="12"></line></svg></label>
+                                        </div>
+                                        <span class="status"></span>
+                                    </div>
+
+                                </div>
+
+                            </div>
+                            <div id="tab-9" class="tab-pane active">
+                                <div class="customize-search-form">
+                                <div class="customize-form-group edit">
+                                    <label class="is-required">治疗类型:</label>
+                                    <div class="input-groups" th:with="type=${@dict.getType('sys_select_dtp_ysfw_phr')}" id="zhiliaolxDiv">
+                                        <input type="checkbox" class="form-check-radio" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}" name="zhiliaolx">
+                                    </div>
+                                    <span class="status"></span>
+                                </div>
+                                </div>
+                                <div class="customize-form-group edit">
+                                    <div style="display: flex;">
+                                        <label style="width: 100px;">用药前治疗方案:</label>
+                                        <button type="button"  data-toggle="modal" data-target="#myModal1" class="btn-primarys">+新增</button>
+                                        <table id="yyqzlfaTable" style="width: 500px;">
+                                            <thead>
+                                            <tr>
+                                                <th>序号</th>
+                                                <th>治疗方案</th>
+                                                <th>治疗时间</th>
+                                                <th>操作</th>
+                                            </tr>
+                                            </thead>
+                                            <tbody id="yyqzlfaTableBody">
+                                            <!-- 表格行将在这里动态添加 -->
+                                            <tr class="no-data" style="display: none;">
+                                                <td colspan="7">
+                                                    <img th:src="@{/img/locked.png}" alt="暂无数据" style="max-width: 100%;">
+                                                    <p>暂无数据</p>
+                                                </td>
+                                            </tr>
+                                            </tbody>
+                                        </table>
+                                    </div>
+                                    <div class="modal inmodal" id="myModal1" tabindex="-1" role="dialog" aria-hidden="true">
+                                        <div class="modal-dialog">
+                                            <form class="form-horizontal" id="form-yyqzlfa-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>
+                                                    </div>
+                                                    <div class="modal-body">
+                                                        <div class="customize-search-form">
+                                                            <div class="customize-form-group edit">
+                                                                <label >治疗时间</label>
+                                                                <input type="text" name="yyqzltime" placeholder="治疗时间" class="time-input time-input2"  style="width: 200px;" id="yyqzltime">
+                                                            </div>
+                                                        </div>
+                                                        <div class="customize-search-form">
+                                                            <div class="customize-form-group edit">
+                                                                <label>治疗方案</label>
+                                                                <select name="zlfangan" class="styled-input edit_inputs"  style="width: 200px;" th:with="type=${@dict.getType('sys_select_dtp_ysfw_lxryhzgx')}" id="zlfangan">
+                                                                    <option value="">请选择治疗方案</option>
+                                                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
+                                                                            th:selected="${dict.dictLabel}==${member}"></option>
+                                                                </select>
+                                                            </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="saveRow(1)">保存</button>
+                                                    </div>
+                                                </div>
+                                            </form>
+                                        </div>
+                                    </div>
+                                </div>
+
+                                <div class="customize-form-group edit">
+                                    <div style="display: flex;">
+                                        <label style="width: 100px;">目前治疗方案:</label>
+                                        <button type="button"  data-toggle="modal" data-target="#myModal1" class="btn-primarys">+新增</button>
+                                        <table id="mqzlfaTable" style="width: 500px;">
+                                            <thead>
+                                            <tr>
+                                                <th>序号</th>
+                                                <th>治疗方案</th>
+                                                <th>治疗时间</th>
+                                                <th>操作</th>
+                                            </tr>
+                                            </thead>
+                                            <tbody id="mqzlfaTableBody">
+                                            <!-- 表格行将在这里动态添加 -->
+                                            <tr class="no-data" style="display: none;">
+                                                <td colspan="7">
+                                                    <img th:src="@{/img/locked.png}" alt="暂无数据" style="max-width: 100%;">
+                                                    <p>暂无数据</p>
+                                                </td>
+                                            </tr>
+                                            </tbody>
+                                        </table>
+                                    </div>
+                                    <div class="modal inmodal" id="myModal2" tabindex="-1" role="dialog" aria-hidden="true">
+                                        <div class="modal-dialog">
+                                            <form class="form-horizontal" id="form-mqzlfa-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>
+                                                    </div>
+                                                    <div class="modal-body">
+                                                        <div class="customize-search-form">
+                                                            <div class="customize-form-group edit">
+                                                                <label >治疗时间</label>
+                                                                <input type="text" name="mqzltime" placeholder="治疗时间" class="time-input time-input2"  style="width: 200px;" id="mqzltime">
+                                                            </div>
+                                                        </div>
+                                                        <div class="customize-search-form">
+                                                            <div class="customize-form-group edit">
+                                                                <label>治疗方案</label>
+                                                                <select name="muqzlfa" class="styled-input edit_inputs"  style="width: 200px;" th:with="type=${@dict.getType('sys_select_dtp_ysfw_lxryhzgx')}" id="muqzlfa">
+                                                                    <option value="">请选择治疗方案</option>
+                                                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
+                                                                            th:selected="${dict.dictLabel}==${member}"></option>
+                                                                </select>
+                                                            </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="saveRow(2)">保存</button>
+                                                    </div>
+                                                </div>
+                                            </form>
+                                        </div>
+                                    </div>
+                                </div>
+                                <div class="customize-form-group edit">
+                                    <div style="display: flex;">
+                                        <label style="width: 100px;">进展后治疗方案:</label>
+                                        <button type="button"  data-toggle="modal" data-target="#myModal3" class="btn-primarys">+新增</button>
+                                        <table id="jzhzlfaTable" style="width: 500px;">
+                                            <thead>
+                                            <tr>
+                                                <th>序号</th>
+                                                <th>治疗方案</th>
+                                                <th>治疗时间</th>
+                                                <th>操作</th>
+                                            </tr>
+                                            </thead>
+                                            <tbody id="jzhzlfaTableBody">
+                                            <!-- 表格行将在这里动态添加 -->
+                                            <tr class="no-data" style="display: none;">
+                                                <td colspan="7">
+                                                    <img th:src="@{/img/locked.png}" alt="暂无数据" style="max-width: 100%;">
+                                                    <p>暂无数据</p>
+                                                </td>
+                                            </tr>
+                                            </tbody>
+                                        </table>
+                                    </div>
+                                    <div class="modal inmodal" id="myModal3" tabindex="-1" role="dialog" aria-hidden="true">
+                                        <div class="modal-dialog">
+                                            <form class="form-horizontal" id="form-jzhzlfa-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>
+                                                    </div>
+                                                    <div class="modal-body">
+                                                        <div class="customize-search-form">
+                                                            <div class="customize-form-group edit">
+                                                                <label >治疗时间</label>
+                                                                <input type="text" name="jzhzltime" placeholder="治疗时间" class="time-input time-input2"  style="width: 200px;" id="jzhzltime">
+                                                            </div>
+                                                        </div>
+                                                        <div class="customize-search-form">
+                                                            <div class="customize-form-group edit">
+                                                                <label>治疗方案</label>
+                                                                <select name="jzhzlfa" class="styled-input edit_inputs"  style="width: 200px;" th:with="type=${@dict.getType('sys_select_dtp_ysfw_lxryhzgx')}" id="jzhzlfa">
+                                                                    <option value="">请选择治疗方案</option>
+                                                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
+                                                                            th:selected="${dict.dictLabel}==${member}"></option>
+                                                                </select>
+                                                            </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="saveRow(3)">保存</button>
+                                                    </div>
+                                                </div>
+                                            </form>
+                                        </div>
+                                    </div>
+                                </div>
+
+                            </div>
+                            <div id="tab-10" class="tab-pane active">
+                                <div class="customize-form-group edit">
+                                    <label class="is-required">有无药品适应症:</label>
+                                    <select name="patientAwareness" class="select-input" th:with="type=${@dict.getType('sys_yes_no')}" required>
+                                        <option value="">请选择</option>
+                                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
+                                                th:selected="${dict.dictLabel}==${patientAwareness}"></option>
+                                    </select>
+                                    <span class="status"></span>
+                                </div>
+                                <div class="customize-form-group edit">
+                                    <label  >药物对该疾病是否有效:</label>
+                                    <div class="input-groups" th:with="type=${@dict.getType('sys_select_dtp_ysfw_mqjjzt')}">
+                                        <input type="radio" class="form-check-radio"  th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"   th:checked="${dict.dictLabel}==${currentEconomicSituation}" name="currentEconomicSituation" >
+                                    </div>
+                                    <span class="status"></span>
+                                </div>
+                                <div class="customize-form-group edit">
+                                    <label class="is-required">药物间是否存在临床相互作用:</label>
+                                    <select name="patientAwareness" class="select-input" th:with="type=${@dict.getType('sys_yes_no')}" required>
+                                        <option value="">请选择</option>
+                                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
+                                                th:selected="${dict.dictLabel}==${patientAwareness}"></option>
+                                    </select>
+                                    <span class="status"></span>
+                                </div>
+                                <div id="lcxhzydiv">
+                                    <div class="customize-form-group edit">
+                                        <label class="is-required">请描述临床相互作用:</label>
+                                        <textarea id="ms" name="lcxhzy" class="styled-input edit_inputs textareas"
+                                                  style="width: auto;height: 140px ;border: 1px solid ;"
+                                                  th:text="${accompanyingSymptoms}" placeholder="请描述临床相互作用..." rows="1.9" cols="112" ></textarea>
+
+                                        <span class="status"></span>
+                                    </div>
+                                </div>
+                                <div class="customize-form-group edit">
+                                    <label>是否有不必要重复用药:</label>
+                                    <div class="input-groups" th:with="type=${@dict.getType('sys_yes_no')}">
+                                        <input type="radio" class="form-check-radio" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"  th:checked="${dict.dictLabel}==${followUpFeedbackDoctor}"  name="bbycfyyis" >
+                                    </div>
+                                    <span class="status"></span>
+                                </div>
+                                <div id="sfybycfyyyes">
+                                    <div class="customize-form-group edit">
+                                        <label class="is-required">重复用药首次使用日期:</label>
+                                        <div class="input-groups select-time">
+                                            <input name="sfybycfyytime" placeholder="确诊后首次用药日期" class="time-input-new styled-input" type="text"  th:value="${timeFirstDiagnosis}">
+                                        </div>
+                                        <span class="status"></span>
+                                    </div>
+                                    <div class="customize-form-group edit">
+                                        <label class="is-required">请描述不必要重复用药:</label>
+                                        <textarea id="bbycfyy" name="bbycfyy" class="styled-input edit_inputs textareas"
+                                                  style="width: auto;height: 140px ;border: 1px solid ;"
+                                                  th:text="${accompanyingSymptoms}" placeholder="请描述不必要重复用药..." rows="1.9" cols="112" ></textarea>
+
+                                        <span class="status"></span>
+                                    </div>
+                                </div>
+
+                                <div class="customize-form-group edit">
+                                    <label>是否出现用药错误:</label>
+                                    <div class="input-groups" th:with="type=${@dict.getType('sys_yes_no')}">
+                                        <input type="radio" class="form-check-radio" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"  th:checked="${dict.dictLabel}==${followUpFeedbackDoctor}"  name="yycwis" >
+                                    </div>
+                                    <span class="status"></span>
+                                </div>
+                                <div id="yycfyes">
+                                    <div class="customize-form-group edit">
+                                        <label class="is-required">用药错误出现时间:</label>
+                                        <div class="input-groups select-time">
+                                            <input name="yycwsj" placeholder="用药错误出现时间" class="time-input-new styled-input" type="text"  th:value="${timeFirstDiagnosis}">
+                                        </div>
+                                        <span class="status"></span>
+                                    </div>
+                                    <div class="customize-form-group edit">
+                                        <label class="is-required">请描述用药错误:</label>
+                                        <textarea id="yycwms" name="yycwms" class="styled-input edit_inputs textareas"
+                                                  style="width: auto;height: 140px ;border: 1px solid ;"
+                                                  th:text="${accompanyingSymptoms}" placeholder="请描述用药错误..." rows="1.9" cols="112" ></textarea>
+                                        <span class="status"></span>
+                                    </div>
+                                </div>
+                            </div>
+                            <div id="tab-11" class="tab-pane active">
+                                <div class="customize-form-group edit">
+                                    <div style="display: flex;">
+                                        <label style="width: 100px;">用药记录:</label>
+                                        <button type="button"  data-toggle="modal" data-target="#myModal4" class="btn-primarys">+新增</button>
+                                        <table id="yyjlTable" style="width: 800px;">
+                                            <thead>
+                                            <tr>
+                                                <th>序号</th>
+                                                <th>要命剂量</th>
+                                                <th>用药频率</th>
+                                                <th>开始用药时间</th>
+                                                <th>停药时间</th>
+                                                <th>最后一次用药时间</th>
+                                                <th>注意事项</th>
+                                                <th>操作</th>
+                                            </tr>
+                                            </thead>
+                                            <tbody id="jyyjlTableTableBody">
+                                            <!-- 表格行将在这里动态添加 -->
+                                            <tr class="no-data" style="display: none;">
+                                                <td colspan="7">
+                                                    <img th:src="@{/img/locked.png}" alt="暂无数据" style="max-width: 100%;">
+                                                    <p>暂无数据</p>
+                                                </td>
+                                            </tr>
+                                            </tbody>
+                                        </table>
+                                    </div>
+                                    <div class="modal inmodal" id="myModal4" tabindex="-1" role="dialog" aria-hidden="true">
+                                        <div class="modal-dialog">
+                                            <form class="form-horizontal" id="form-yyjl-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>
+                                                    </div>
+                                                    <div class="modal-body">
+                                                        <div class="customize-search-form">
+                                                            <div class="customize-form-group edit">
+                                                                <label >名称</label>
+                                                                <input type="text" name="durgName" placeholder="请输入药品名称" class="styled-input edit_inputs"  style="width: 200px;" id="durgName">
+                                                            </div>
+                                                        </div>
+                                                        <div class="customize-search-form">
+                                                            <div class="customize-form-group edit">
+                                                                <label >剂量</label>
+                                                                <input type="text" name="jiliang" placeholder="请输入剂量" class="styled-input edit_inputs"  style="width: 200px;" id="jiliang">
+                                                            </div>
+                                                        </div>
+
+                                                        <div class="customize-search-form">
+                                                            <div class="customize-form-group edit">
+                                                                <label >开始用药时间</label>
+                                                                <input type="text" name="startyyTime" placeholder="请选择开始用药时间" class="time-input time-input2"  style="width: 200px;" id="startyyTime">
+                                                            </div>
+                                                        </div>
+                                                        <div class="customize-search-form">
+                                                            <div class="customize-form-group edit">
+                                                                <label >停药药时间</label>
+                                                                <input type="text" name="tyTime" placeholder="请选择停药药时间" class="time-input time-input2"  style="width: 200px;" id="tyTime">
+                                                            </div>
+                                                        </div>
+                                                        <div class="customize-search-form">
+                                                            <div class="customize-form-group edit">
+                                                                <label >最后一次用药时间</label>
+                                                                <input type="text" name="lastsyTime" placeholder="请选择最后一次用药时间" class="time-input time-input2"  style="width: 200px;" id="lastsyTime">
+                                                            </div>
+                                                        </div>
+                                                        <div class="customize-search-form">
+                                                            <div class="customize-form-group edit">
+                                                                <label >使用频率</label>
+                                                                <input type="text" name="shiypv" placeholder="请输入使用频率" class="styled-input edit_inputs"  style="width: 200px;" id="shiypv">
+                                                            </div>
+                                                        </div>
+                                                        <div class="customize-search-form">
+                                                            <div class="customize-form-group edit">
+                                                                <label >注意事项</label>
+                                                                <input type="text" name="zhuyishix" placeholder="请输入注意事项" class="styled-input edit_inputs"  style="width: 200px;" id="zhuyishix">
+                                                            </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="saveRow(4)">保存</button>
+                                                    </div>
+                                                </div>
+                                            </form>
+                                        </div>
+                                    </div>
+                                </div>
+                                <div class="customize-form-group edit">
+                                    <div style="display: flex;">
+                                        <label style="width: 100px;">合并用药记录:</label>
+                                        <button type="button"  data-toggle="modal" data-target="#myModal5" class="btn-primarys">+新增</button>
+                                        <table id="hbyyjlTable" style="width: 800px;">
+                                            <thead>
+                                            <tr>
+                                                <th>序号</th>
+                                                <th>要命剂量</th>
+                                                <th>用药频率</th>
+                                                <th>开始用药时间</th>
+                                                <th>停药时间</th>
+                                                <th>最后一次用药时间</th>
+                                                <th>注意事项</th>
+                                                <th>操作</th>
+                                            </tr>
+                                            </thead>
+                                            <tbody id="hbyyjlTableTableBody">
+                                            <!-- 表格行将在这里动态添加 -->
+                                            <!-- 表格行将在这里动态添加 -->
+                                            
+                                            <tr class="no-data" style="display: none;">
+                                                <td colspan="7">
+                                                    <img th:src="@{/img/locked.png}" alt="暂无数据" style="max-width: 100%;">
+                                                    <p>暂无数据</p>
+                                                </td>
+                                            </tr>
+                                            </tbody>
+                                        </table>
+                                    </div>
+                                    <div class="modal inmodal" id="myModal5" tabindex="-1" role="dialog" aria-hidden="true">
+                                        <div class="modal-dialog">
+                                            <form class="form-horizontal" id="form-hbyyjl-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>
+                                                    </div>
+                                                    <div class="modal-body">
+                                                        <div class="customize-search-form">
+                                                            <div class="customize-form-group edit">
+                                                                <label >名称</label>
+                                                                <input type="text" name="hbdurgName" placeholder="请输入药品名称" class="styled-input edit_inputs"  style="width: 200px;" id="hbdurgName">
+                                                            </div>
+                                                        </div>
+                                                        <div class="customize-search-form">
+                                                            <div class="customize-form-group edit">
+                                                                <label >剂量</label>
+                                                                <input type="text" name="hbjiliang" placeholder="请输入剂量" class="styled-input edit_inputs"  style="width: 200px;" id="hbjiliang">
+                                                            </div>
+                                                        </div>
+
+                                                        <div class="customize-search-form">
+                                                            <div class="customize-form-group edit">
+                                                                <label >开始用药时间</label>
+                                                                <input type="text" name="hbstartyyTime" placeholder="请选择开始用药时间" class="time-input time-input2"  style="width: 200px;" id="hbstartyyTime">
+                                                            </div>
+                                                        </div>
+                                                        <div class="customize-search-form">
+                                                            <div class="customize-form-group edit">
+                                                                <label >停药药时间</label>
+                                                                <input type="text" name="hbtyTime" placeholder="请选择停药药时间" class="time-input time-input2"  style="width: 200px;" id="hbtyTime">
+                                                            </div>
+                                                        </div>
+                                                        <div class="customize-search-form">
+                                                            <div class="customize-form-group edit">
+                                                                <label >最后一次用药时间</label>
+                                                                <input type="text" name="hblastsyTime" placeholder="请选择最后一次用药时间" class="time-input time-input2"  style="width: 200px;" id="hblastsyTime">
+                                                            </div>
+                                                        </div>
+                                                        <div class="customize-search-form">
+                                                            <div class="customize-form-group edit">
+                                                                <label >使用频率</label>
+                                                                <input type="text" name="hbshiypv" placeholder="请输入使用频率" class="styled-input edit_inputs"  style="width: 200px;" id="hbshiypv">
+                                                            </div>
+                                                        </div>
+                                                        <div class="customize-search-form">
+                                                            <div class="customize-form-group edit">
+                                                                <label >注意事项</label>
+                                                                <input type="text" name="hbzhuyishix" placeholder="请输入注意事项" class="styled-input edit_inputs"  style="width: 200px;" id="hbzhuyishix">
+                                                            </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="saveRow(5)">保存</button>
+                                                    </div>
+                                                </div>
+                                            </form>
+                                        </div>
+                                    </div>
+                                </div>
+                            </div>
+                            <div id="tab-12" class="tab-pane active">
+                                <div class="customize-form-group edit">
+                                    <label>疼痛标准评分NRS:</label>
+                                    <div class="input-groups" th:with="type=${@dict.getType('sys_select_dtp_ysfw_mqjjzt')}">
+                                        <input type="radio" class="form-check-radio" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"  th:checked="${dict.dictLabel}==${followUpFeedbackDoctor}"  name="NRS" >
+                                    </div>
+                                    <span class="status"></span>
+                                </div>
+
+                                <div class="customize-form-group edit">
+                                    <label>体力状况评分:</label>
+                                    <div class="input-groups" th:with="type=${@dict.getType('sys_select_dtp_ysfw_ysph')}">
+                                        <input type="radio" class="form-check-radio" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"  th:checked="${dict.dictLabel}==${followUpFeedbackDoctor}"  name="tlzkpf" >
+                                    </div>
+                                    <span class="status"></span>
+                                </div>
+
+                            </div>
+                            <div id="tab-13" class="tab-pane active">
+                                <div class="customize-form-group edit">
+                                    <label>本次回访是否咨询:</label>
+                                    <div class="input-groups" th:with="type=${@dict.getType('sys_yes_no')}">
+                                        <input type="radio" class="form-check-radio" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"  th:checked="${dict.dictLabel}==${followUpFeedbackDoctor}"  name="bchfsfzx" >
+                                    </div>
+                                    <span class="status"></span>
+                                </div>
+                                <div id="bchfsfzxyes">
+                                    <div class="customize-form-group edit">
+                                        <label class="is-required">咨询问题类型:</label>
+                                        <select name="zxwtlx" class="select-input" th:with="type=${@dict.getType('sys_yes_no')}">
+                                            <option value="">请选择</option>
+                                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
+                                                    th:selected="${dict.dictLabel}==${patientAwareness}"></option>
+                                        </select>
+                                        <span class="status"></span>
+                                    </div>
+                                    <div class="customize-form-group edit">
+                                        <label>具体问题:</label>
+                                        <textarea id="jtwt" name="jtwt" class="styled-input edit_inputs textareas"
+                                                  style="width: auto;height: 140px ;border: 1px solid ;"
+                                                  th:text="${accompanyingSymptoms}" placeholder="具体问题..." rows="1.9" cols="112" ></textarea>
+                                        <span class="status"></span>
+                                    </div>
+                                    <div class="customize-form-group edit">
+                                        <label>药师解答:</label>
+                                        <textarea id="ysjd" name="ysjd" class="styled-input edit_inputs textareas"
+                                                  style="width: auto;height: 140px ;border: 1px solid ;"
+                                                  th:text="${accompanyingSymptoms}" placeholder="1-未按随访进度联系上 2-未按时取药 3-减量或停药 4-不良反应不能耐受 5-医生说要调整治疗方案 6-挂不到医生床位/转院 7-医保不够,经济压力 8-情绪不好,生活压力 9-其他" rows="1.9" cols="112" ></textarea>
+                                        <span class="status"></span>
+                                    </div>
+                                </div>
+                            </div>
+                            <div id="tab-14" class="tab-pane active">
+                                <div class="customize-form-group edit">
+                                    <label class="is-required">患者病情评估:</label>
+                                    <select name="zxwtlx" class="select-input" th:with="type=${@dict.getType('sys_yes_no')}">
+                                        <option value="">请选择</option>
+                                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
+                                                th:selected="${dict.dictLabel}==${patientAwareness}"></option>
+                                    </select>
+                                    <span class="status"></span>
+                                </div>
+                                <div class="customize-form-group edit">
+                                    <label>共建项目描述:</label>
+                                    <textarea id="gjxmu" name="ysjd" class="styled-input edit_inputs textareas"
+                                              style="width: auto;height: 140px ;border: 1px solid ;"
+                                              th:text="${accompanyingSymptoms}" placeholder="请输入共建项目描述" rows="1.9" cols="112" ></textarea>
+                                    <span class="status"></span>
+                                </div>
                             </div>
                         </div>
                     </div>
                 </div>
-                <div class="col-sm-12">
-                    <div class="form-group">
-                        <!--is-required 增加星号 显示为必填-->
-                        <label class="col-sm-1 control-label">任务跟进人:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input name="taskFollower" placeholder="请输入疾病" class="styled-input" type="text" maxlength="30" th:value="${taskFollower}" required>
+            </div>
+        </div>
+
+    </div>
+    <div class="modal inmodal fade" id="myModalDpg" tabindex="-1" role="dialog" aria-hidden="true">
+        <div class="modal-dialog modal-lg">
+            <div class="modal-content">
+                <div class="modal-header">
+                    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
+                    </button>
+                    <span class="modal-title">营养风险筛查NRS-2024评估表</span>
+                </div>
+                <div class="modal-body">
+                    <div class="panel panel-warning">
+                        <div class="panel-heading">
+                            <i class="fa fa-info-circle"></i> 评分信息
+                        </div>
+                        <div class="panel-body">
+                            <code style="font-size: 20px;">5<small>分</small></code>
+                            <p>分数 ≥ 3.0:患者有营养不良的风险,需营养支持治疗</p>
+                        </div>
+
+                    </div>
+                    <form id="yyzk-form"  class="customize-search-form">
+                        <div class="customize-form-group edit">
+                            <label class="is-required">营养状况初评:</label>
+                            <div class="input-groups" th:with="type=${@dict.getType('sys_yes_no')}">
+                                <input type="radio" class="form-check-radio" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"  th:checked="${dict.dictLabel}==${followUpFeedbackDoctor}"  name="yyztcp" >
                             </div>
+                            <span class="status"></span>
                         </div>
-                        <label class="col-sm-1 control-label">实际随访时间:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input type="text" class="styled-input time-input-new" id="actualFollowUpTime" placeholder="实际随访时间" name="actualFollowUpTime" th:value="${actualFollowUpTime}" required/>
+                        <div class="customize-form-group edit">
+                            <label>出生年月:</label>
+                            <div class="input-groups" th:with="type=${@dict.getType('sys_yes_no')}">
+                                <input name="scny" placeholder="出生年月" class="time-input styled-input" type="text">
+                                <input name="sui"  class="styled-input5" type="text" value="58" style="border: none; width: 30px;" readonly>
+                                <label style="margin-top: 3px;">岁&nbsp;&nbsp;年龄≥70岁 1分</label>
                             </div>
                         </div>
-                        <label class="col-sm-1 control-label">接通次数:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input name="callConnectedCount" placeholder="接通次数" class="styled-input" type="text" maxlength="30" th:value="${callConnectedCount}" required>
+                        <div class="customize-form-group edit">
+                            <label>身高:</label>
+                            <div class="input-groups">
+                                <input name="height" id="height" placeholder="身高" class="styled-input edit_inputs" type="number">
                             </div>
+                            <span class="status"></span>
                         </div>
-                        <label class="col-sm-1 control-label">外呼次数:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input name="outboundCallCount" placeholder="外呼次数" class="styled-input" type="text" maxlength="30" th:value="${outboundCallCount}" required>
+                        <div class="customize-form-group edit">
+                            <label>体重:</label>
+                            <div class="input-groups">
+                                <input name="weight" id="weight" placeholder="体重" class="styled-input edit_inputs" type="number" >
                             </div>
+                            <span class="status"></span>
                         </div>
-                    </div>
-                </div>
-
-                <div class="col-sm-12">
-                    <div class="form-group">
-                        <!--is-required 增加星号 显示为必填-->
-                        <label class="col-sm-1 control-label">下次外呼次数:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input name="nextOutboundCallCount" placeholder="下次外呼次数" class="styled-input" type="text" maxlength="30" th:value="${nextOutboundCallCount}" required>
-                            </div>
-                        </div>
-                        <label class="col-sm-1 control-label">任务状态:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <select name="taskStatus" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_sfrwzt')}" >
-                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}" th:selected="${dict.dictLabel} == ${taskStatus}"></option>
-                                </select>
+                        <div class="customize-form-group edit">
+                            <label>BMI:</label>
+                            <div class="input-groups">
+                                <input name="bmi" id="bmi"  class="styled-input5 edit_inputs" type="text">
+                                <label style="padding-left: 20px;margin-top: 3px;">BMI<18.5 伴一般情况差 3分</label>
                             </div>
                         </div>
-                        <label class="col-sm-1 control-label">最后外呼状态:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <select name="lastOutboundStatus" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_sfrw_zhwhzt')}">
-                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}" th:selected="${dict.dictLabel} == ${lastOutboundStatus}"></option>
-                                </select>
+                        <div class="customize-form-group edit">
+                            <label class="is-required">体重变化:</label>
+                            <div class="input-groups" th:with="type=${@dict.getType('sys_select_dtp_ysfw_huifangfangshi')}">
+                                <input type="radio" class="form-check-radio"  th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"   th:checked="${dict.dictLabel}==${currentEconomicSituation}" name="tzbh" >
                             </div>
+                            <span class="status"></span>
                         </div>
-                        <label class="col-sm-1 control-label">更新时间:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <input type="text" class="styled-input time-input-new" id="updatedAt" placeholder="更新时间" name="updatedAt" th:value="${updateTime2}" required/>
+                        <div class="customize-form-group edit">
+                            <label class="is-required">进食量:</label>
+                            <div class="input-groups" th:with="type=${@dict.getType('sys_select_dtp_ysfw_huifangfangshi')}">
+                                <input type="radio" class="form-check-radio"  th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"   th:checked="${dict.dictLabel}==${currentEconomicSituation}" name="jsl" >
                             </div>
+                            <span class="status"></span>
                         </div>
+                        <div class="customize-form-group edit">
+                            <label class="is-required">疾病状态:</label>
+                            <div class="input-groups" th:with="type=${@dict.getType('sys_select_dtp_ysfw_huifangfangshi')}">
+                                <input type="radio" class="form-check-radio"  th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"   th:checked="${dict.dictLabel}==${currentEconomicSituation}" name="jbzt" >
+                            </div>
+                            <span class="status"></span>
+                        </div>
+                        </form>
+                    <div class="modal-footer">
+                        <button type="button" class="btn btn-white" data-dismiss="modal">关闭</button>
+                        <button type="button" class="btn btn-primary">提交</button>
                     </div>
                 </div>
-
-
             </div>
-        </form>
+
+        </div>
+      </div>
     </div>
-    <div class="main-content">
-        <div class="col-sm-offset-5 col-sm-10">
-            <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
-            <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
+</div>
+<form style="background-color: #f5f3f3;text-align: center;width: auto;" id="form-followUpTaskDetails">
+    <div class="ibox-content" style="background-color: #f5f3f3;">
+        <div class="ibox-title2">
+            <div class="task-info">
+                <h4>下次随访时间
+                    <input name="nextTime" placeholder="下次随访时间" class="time-input-new styled-input" type="text"  th:value="${timeFirstDiagnosis}" required>
+                </h4>
+            </div>
+            <div class="task-details">
+                <h4> <span>间隔本次任务:<span style="color: #1a7bb9;">2</span>天</span></h4>
+                <h4> <span>下次任务主题:<span style="color: #1a7bb9;">
+                                    <select name="taskTheme" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_sfrw_rwzt')}">
+                                      <option value="">请选择</option>
+                                      <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
+                                    </select>
+                                </span>
+                                </span></h4>
+            </div>
+            <div class="task-buttons">
+                <button type="button" class="btn btn-primary" onclick="submitHandler()">保 存</button>
+            </div>
         </div>
     </div>
-	<th:block th:include="include :: footer" />
+</form>
+<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" />
 </body>
 </html>
 
 <script>
+    var formSubmitted = true;
+    var prefix = ctx + "dtp/pmService";
     function submitHandler() {
-        var prefix = ctx + "dtp/pmService";
         if ($.validate.form()) {
             var data = $("#form-followUp-edit").serializeArray();
             $.operate.saveTab(prefix + "/followUpEdit", data);
         }
     }
+    //初始化加载
+    $(document).ready(function() {
+        // 获取表格体元素
+        var tableBody = document.getElementById('yyqzlfaTableBody');
+        // 检查表格体是否有子节点(即是否有数据)
+        if (tableBody.childElementCount === 0) {
+            // 如果没有数据,显示“暂无数据”
+            $("#yyqzlfaTableBody .no-data").show();
+        } else {
+            // 如果有数据,隐藏“暂无数据”
+            $("#yyqzlfaTableBody .no-data").hide();
+        }
+        // 监听点击事件,激活指定的选项卡
+        $('#myUlTabs li a').click(function(e) {
+            // 阻止默认行为
+            //e.preventDefault();
+            // 获取当前点击的选项卡链接
+            var $this = $(this);
+            if($this.attr('href') === '#tab-1'){
+                formSubmitted=true;
+            }
+            if($this.attr('href') === '#tab-2'){
+                formSubmitted=false;
+                // 添加 active 类到当前点击的选项卡
+                $(this).addClass('active');
+                $this.attr('aria-expanded', 'true');
+
+            }
+            // 检查是否为“用药购药”选项卡
+            if ($this.attr('href') === '#tab-2') {
+                // 初始化表格
+                initializeTableForTab('tab-2');
+            }
+            if ($this.attr('href') === '#tab-3') {
+                // 初始化表格
+                initializeTableForTab('tab-3');
+            }
+            if ( $this.attr('href') === '#tab-4') {
+                // 初始化表格
+                initializeTableForTab('tab-4');
+                // 初始化表格
+                initializeTableForTab('tab-5');
+            }
+
+        });
+
+        $('#myTabs2 li a').click(function(e) {
+            // 阻止默认行为
+            e.preventDefault();
+            // 获取当前点击的选项卡链接
+            var $this = $(this);
+            // 移除所有选项卡的 active 类
+            //$('#myTabs li').removeClass('active');
+            //$('.tab-pane').removeClass('active in');
+            $('#myTabs2 li a').addClass('active');
+            // 添加 active 类到当前点击的选项卡
+            $this.parent().addClass('active');
+            // 获取目标选项卡面板的 ID
+            var target = $this.attr('href');
+            // 展示对应的选项卡面板,并更新 aria-expanded
+            $(target).addClass('active in');
+            $this.attr('aria-expanded', 'true');
+            // 执行点击链接对应的动作
+            $this.tab('show');
+            // 移除所有选项卡的激活类
+            //$('.active').removeClass('active');
+            $(this).addClass('active');
+            // 滚动到目标选项卡位置
+            // 将目标内容区滚动到视口中央
+            $('html, body').animate({
+                scrollTop: $(target).offset().top - ($(window).height() / 2)
+            }, 500); // 500毫秒动画时间
+            // scrollToTab($this);
+            // 重新初始化当前选项卡内的表格
+            var tableId = target.replace('#', '');
+           // initializeTableForTab(tableId);
+        });
+
+    });
+
+
+
+    function initializeTableForTab(tabId) {
+        debugger
+        var datas=[];
+        var tableId = 'bootstrap-table-' + tabId.substring(4);
+        var tableElement = $('#' + tableId);
+        var data = {
+            "flag": tabId.substring(4),
+        };
+        console.log("tabId="+tabId.substring(4));
+        // 初始化表格 getDrugPurchaseList
+        $.ajax({
+            cache : true,
+            type : "POST",
+            url : ctx + "dtp/pmService/followUpAssignList",
+            data : data,
+            async : false,
+            error : function(request) {
+                $.modal.alertError("系统错误");
+            },
+            success : function(data) {
+                datas=data.rows;
+                $.operate.successCallback(data);
+            }
+        });
+        if(tabId==='tab-2'){
+            tableElement.bootstrapTable({
+                // 配置表格的相关属性
+                // 例如数据源、列定义等
+                // 示例配置
+                data: datas,
+                fitColumns: true,
+                striped: true,
+                autoRowHeight: true,
+                rowNumbers: true,
+                showFooter:true,  //是否显示表格底部区域。
+                clickToSelect: true, //是否启用点击行时选中整行的功能。
+                singleSelect: false, //是否仅允许选择一行
+                fixedColumns: true,
+                //fixedNumber: 3,
+                fixedRightNumber: 1,
+                columns : [
+                    [
+                        { field: 'id', title: '序号' },
+                        { field: 'orderId', title: '订单编号' },
+                        { field: 'prescriptionSource', title: '处方来源' },
+                        { field: 'prescriptionDate', title: '处方日期' },
+                        { field: 'hospital', title: '医院' },
+                        { field: 'doctor', title: '医生' },
+                        { field: 'department', title: '科室' },
+                        { field: 'diseaseType', title: '疾病类型' },
+                        { field: 'clinicalDiagnosis', title: '临床诊断' },
+                        { field: 'genericName', title: '药品通用名' },
+                        { field: 'productName', title: '商品名' },
+                        { field: 'specification', title: '规格' },
+                        { field: 'quantity', title: '数量' },
+                        { field: 'manufacturer', title: '厂家' },
+                        { field: 'mdmCode', title: 'MDM编码' },
+                        { field: 'usageMethod', title: '用药途径' },
+                        { field: 'frequency', title: '用药频次' },
+                        { field: 'wordUsage', title: '单次剂量' },
+                        { field: 'medicationCycle', title: '用药周期' },
+                        { field: 'registrar', title: '登记人' },
+                        { field: 'orderTime', title: '下单时间' },
+                        { field: 'drugSource', title: '药品来源' }
+                    ]
+                ]
+            });
+            tableElement.bootstrapTable(options);
+        }
+        if(tabId==='tab-3'){
+            var options = {
+                data: datas,
+                escape: true,
+                fitColumns: true,
+                striped: true,
+                autoRowHeight: true,
+                rowNumbers: true,
+                showFooter:true,  //是否显示表格底部区域。
+                clickToSelect: true, //是否启用点击行时选中整行的功能。
+                singleSelect: false, //是否仅允许选择一行
+                fixedColumns: true,
+                //fixedNumber: 3,
+                fixedRightNumber: 1,
+                columns: [
+                    {field: 'id',title: '序号'},
+                    {field: 'taskName',title: '任务名称'},
+                    {field: 'filingDate',title: '任务完成时间'},
+                    {field: 'taskStatus',title: '随访小结状态'},
+                    {field: 'lastOutboundFlag',title: '发送状态'},
+                    {field: 'NextCallTime',title: '发送时间'},  {
+                        title: '操作',
+                        align: 'center',
+                        width: '100px',
+                        formatter: function(value, row, index) {
+                            if (row.id) {
+                                var actions = [];
+                                actions.push('<a class="btn-info btn-xs" href="javascript:void(0)" onclick="edit(\'' + row.id + '\')">查看</a> ');
+                                return actions.join('');
+                            } else {
+                                return "";
+                            }
+                        }
+                    }
+                ]
+            }
+            tableElement.bootstrapTable(options);
+        }
+
+        if(tabId==='tab-4'){
+            tableElement.bootstrapTable({
+                // 配置表格的相关属性
+                // 例如数据源、列定义等
+                // 示例配置
+                data: datas,
+                fitColumns: true,
+                striped: true,
+                autoRowHeight: true,
+                rowNumbers: true,
+                showFooter:true,  //是否显示表格底部区域。
+                clickToSelect: true, //是否启用点击行时选中整行的功能。
+                singleSelect: false, //是否仅允许选择一行
+                fixedColumns: true,
+                //fixedNumber: 3,
+                fixedRightNumber: 1,
+                columns : [
+                    [
+                        { field: 'id', title: '序号' },
+                        { field: 'followUpPersonName', title: '任务名称' },
+                        { field: 'disease', title: '任务类型'},
+                        { field: 'filingDate', title: '预约时间' },
+                        { field: 'lastPurchaseDate', title: '完成时间' },
+                        { field: 'patientName', title: '任务跟进人' },
+                        { field: 'patientAssignmentStatus', title: '任务状态' },
+                        {
+                            title: '操作',
+                            align: 'center',
+                            width: '180px',
+                            formatter: function(value, row, index) {
+                                if (row.id) {
+                                    var actions = [];
+                                    actions.push('<a class="btn-xs" href="javascript:void(0)" onclick="edit(\'' + row.id + '\')">查看</a> ');
+                                    actions.push('<a class="btn-xs" href="javascript:void(0)" onclick="edit(\'' + row.id + '\')">关闭任务</a> ');
+                                    return actions.join('');
+                                } else {
+                                    return "";
+                                }
+                            }
+                        }
+                    ]
+                ]
+            });
+            tableElement.bootstrapTable(options);
+        }
+        if(tabId==='tab-5'){
+            tableElement.bootstrapTable({
+                // 配置表格的相关属性
+                // 例如数据源、列定义等
+                // 示例配置
+                data: datas,
+                fitColumns: true,
+                striped: true,
+                autoRowHeight: true,
+                rowNumbers: true,
+                showFooter:true,  //是否显示表格底部区域。
+                clickToSelect: true, //是否启用点击行时选中整行的功能。
+                singleSelect: false, //是否仅允许选择一行
+                fixedColumns: true,
+                //fixedNumber: 3,
+                fixedRightNumber: 1,
+                columns : [
+                    [
+                        { field: 'id', title: '序号' },
+                        { field: 'followUpPersonName', title: '任务名称' },
+                        { field: 'disease', title: '任务类型'},
+                        { field: 'filingDate', title: '预约时间' },
+                        { field: 'lastPurchaseDate', title: '完成时间' },
+                        { field: 'patientName', title: '任务跟进人' },
+                        { field: 'patientAssignmentStatus', title: '任务状态' },
+                        {
+                            title: '操作',
+                            align: 'center',
+                            width: '180px',
+                            formatter: function(value, row, index) {
+                                if (row.id) {
+                                    var actions = [];
+                                    actions.push('<a class="btn-xs" href="javascript:void(0)" onclick="edit(\'' + row.id + '\')">查看</a> ');
+                                    actions.push('<a class="btn-xs" href="javascript:void(0)" onclick="edit(\'' + row.id + '\')">关闭任务</a> ');
+                                    return actions.join('');
+                                } else {
+                                    return "";
+                                }
+                            }
+                        }
+                    ]
+                ]
+            });
+        }
+        tableElement.bootstrapTable(options);
+    }
 </script>

+ 179 - 54
health-admin/src/main/resources/templates/dtp/followUp/followUpList.html

@@ -15,56 +15,59 @@
 						<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>
+							<span>&nbsp;&nbsp;&nbsp;</span>
+							<button type="button"  data-toggle="modal" data-target="#myModal" class="btn btn-danger">意见与反馈</button>
 						</div>
+
 					</div>
+
 					<form id="followUp-form" class="customize-search-form">
 						<input type="hidden" id="deptId" name="deptId">
 		                <input type="hidden" id="parentId" name="parentId">
 						<div class="customize-form-group-container">
 							<div class="customize-form-group">
 								<label>患者信息:</label>
-								<input type="text" class="styled-input" name="patientName"/>
+								<input type="text" class="styled-input"  placeholder="请输入患者姓名或手机号" name="query"/>
 							</div>
 							<div class="customize-form-group">
 								<label>药品:</label>
-								<input type="text"  class="styled-input" name="genericName"/>
+								<input type="text"  class="styled-input" placeholder="商品名,通用名或MDM编码"  name="product"/>
 							</div>
 							<div class="customize-form-group">
 								<label>预约日期:</label>
-								<input type="text" class="styled-input time-input" id="t" placeholder="预约日期" name="appointmentDate"/>
+								<input type="text" class="time-input time-input2" id="subscribebeginTime" placeholder="开始时间" name="subscribeBeginTime">
+								<span>-</span>
+								<input type="text" class="time-input time-input2" id="subscribeendTime" placeholder="结束时间" name="subscribeEndTime">
 							</div>
 							<div class="customize-form-group">
 								<label>任务跟进人:</label>
-								<input type="text"  class="styled-input" name="taskFollower"/>
+								<select name="taskFollower" class="styled-input" >
+									<option value="">全部</option>
+<!--									<option th:each="salesclerk : ${clerk}" th:text="${salesclerk.name}" th:value="${salesclerk.id}"></option>-->
+								</select>
 							</div>
 
 							<div class="customize-form-group">
 								<label>门店:</label>
-								<input type="text"  class="styled-input" name="storeName"/>
-							</div>
-							<div class="customize-form-group">
-								<label>任务状态:</label>
-								<select name="taskStatus" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_sfrwzt')}" >
-									<option value="">所有</option>
-									<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
+								<select name="storeId" class="styled-input">
+									<option value="">全部</option>
+<!--									<option th:each="store : ${stores}" th:text="${store.name}" th:value="${store.id}"></option>-->
 								</select>
 							</div>
 							<div class="customize-form-group">
-								<label>最后外呼状态:</label>
-								<select name="lastOutboundStatus" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_sfrw_zhwhzt')}">
-									<option value="">所有</option>
-									<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
-								</select>
+								<label>下次外呼时间:</label>
+								<input type="text" class="time-input time-input2" id="beginTime" placeholder="开始时间" name="NextBeginTime">
+								<span>-</span>
+								<input type="text" class="time-input time-input2" id="endTime" placeholder="结束时间" name="NextEndTime">
 							</div>
-
 							<div class="customize-form-group">
 								<label>疾病:</label>
-								<input type="text"  class="styled-input" name="disease"/>
+								<input type="text"  class="styled-input" placeholder="请输入疾病" name="disease"/>
 							</div>
 							<div class="customize-form-group">
 								<label>随访小结:</label>
 								<select name="followUpSummary" class="styled-input">
-									<option value="">所有</option>
+									<option value="">请选择</option>
 									<option value="待处理" >待处理</option>
 									<option value="已完成" >已完成</option>
 									<option value="已过期" >已过期</option>
@@ -72,56 +75,103 @@
 							</div>
 							<div class="customize-form-group">
 								<label>完成日期:</label>
-								<input type="text"   class="styled-input time-input" id="a" placeholder="更新时间" name="updateTime" th:value="${updateTime}"/>
+								<input type="text" class="time-input time-input2" id="completeBeginTime" placeholder="开始时间" name="completeBeginTime">
+								<span>-</span>
+								<input type="text" class="time-input time-input2" id="completeEndTime" placeholder="结束时间" name="completeEndTime">
 							</div>
 							<div class="customize-form-group">
 								<label>任务主题:</label>
 								<select name="taskTheme" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_sfrw_rwzt')}">
-									<option value="">所有</option>
+									<option value="">请选择</option>
 									<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}" ></option>
 								</select>
 							</div>
 							<div class="customize-form-group">
 								<label>任务名称:</label>
-								<input type="text"  class="styled-input" name="taskName"/>
+								<input type="text"  class="styled-input" placeholder="请输入任务名称" name="taskName"/>
 							</div>
 							<div class="customize-form-group">
+								<label>任务状态:</label>
+								<select name="taskStatus" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_sfrwzt')}" >
+									<option value="">请选择</option>
+									<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
+								</select>
+							</div>
+						</div>
+							<div class="customize-form-group-container">
+							<div class="customize-form-group">
 								<label>业务归属:</label>
 								<select name="businessBelonging" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_ywgs')}" >
-									<option value="">所有</option>
+									<option value="">请选择</option>
 									<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
-											></option>
+									></option>
+								</select>
+							</div>
+							<div class="customize-form-group">
+								<label>最后外呼标记:</label>
+								<select name="lastOutboundFlag" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_sfrw_zhwhbj')}">
+									<option value="">请选择</option>
+									<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
+								</select>
+							</div>
+							<div class="customize-form-group">
+								<label>最后外呼状态:</label>
+								<select name="lastOutboundStatus" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_sfrw_zhwhzt')}">
+									<option value="">请选择</option>
+									<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
 								</select>
 							</div>
 						</div>
+
+
 					</form>
 				</div>
 
-		        <div class="btn-group-sm" id="toolbar" role="group">
-		        	<!--<a class="btn btn-success" onclick="$.operate.addTab()" shiro:hasPermission="system:user:add">
-		                <i class="fa fa-plus"></i> 新增
-		            </a>
-		             <a class="btn btn-primary single disabled" onclick="$.operate.editTab()" shiro:hasPermission="system:user:edit">
-			            <i class="fa fa-edit"></i> 修改
-			        </a>
-		            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:user:remove">
-		                <i class="fa fa-remove"></i> 删除
-		            </a>
-		            <a class="btn btn-info" onclick="$.table.importExcel()" shiro:hasPermission="system:user:import">
-			            <i class="fa fa-upload"></i> 导入
-			        </a>
-		            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:user:export">
-			            <i class="fa fa-download"></i> 导出
-			        </a>-->
-		        </div>
+
 
 				<div class="col-sm-12 select-table table-striped" style="width: 100%; overflow-x: auto;">
 					<table id="bootstrap-table" class="fixed-layout-table"></table>
 				</div>
+
 			</div>
+
 		</div>
+
 	</div>
+	<div class="modal inmodal" id="myModal" tabindex="-1" role="dialog" aria-hidden="true">
+		<div class="modal-dialog">
+			<form class="form-horizontal" id="form-yijianyufankui-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>
+					</div>
+					<div class="modal-body">
+						<div class="customize-form-group edit">
+							<label>反馈内容:</label>
+							<textarea id="FeedbackContent" name="FeedbackContent" class="styled-input edit_inputs textareas"
+									  style="width: auto;height: 140px ;border: 1px solid ;"
+									  placeholder="请输入反馈内容" rows="1.9" cols="120" ></textarea>
+							<span class="status"></span>
+						</div>
+						<div class="customize-form-group edit">
+							<label class="is-required" for="uploadImage">图片上传:</label>
+							<div class="custom-file-upload">
+								<input type="file" id="uploadImage" accept=".jpg,.jpeg,.png,.gif">
+								<label for="uploadImage"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#007bff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-plus-circle"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="8" x2="12" y2="16"></line><line x1="8" y1="12" x2="16" y2="12"></line></svg></label>
+							</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="saveRow()">提交</button>
+					</div>
+				</div>
+			</form>
+		</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" />
@@ -159,7 +209,7 @@
 		        importTemplateUrl: prefix + "/importTemplate",*/
 		        sortName: "id",
 		        sortOrder: "asc",
-		        modalName: "档案",
+		        modalName: "随访任务",
 				fitColumns: true,
 				striped: true,
 				autoRowHeight: true,
@@ -170,9 +220,7 @@
             fixedColumns: true,
             //fixedNumber: 3,
             fixedRightNumber: 1,
-		        columns: [{
-		            checkbox: true
-		        },
+		        columns: [
 				{ field: 'appointmentDate', title: '预约日期', align: 'center' },
 				{ field: 'businessBelonging', title: '业务归属', align: 'center' },
 				{ field: 'taskName', title: '任务名称', align: 'center' },
@@ -186,26 +234,59 @@
 				{ field: 'genericName', title: '药品通用名', align: 'center' },
 				{ field: 'productName', title: '商品名', align: 'center' },
 				{ field: 'taskFollower', title: '任务跟进人', align: 'center' },
+					{ field: 'taskStatus', title: '任务状态', align: 'center' ,
+						formatter: function(value, row, index) {
+							switch (value) {
+								case '待执行':
+									return '<span class=\"btn-danger">'+value+'</span>';
+									break;
+								case '已完成':
+									return '<span class=\"btn-primary">'+value+'</span>';
+									break;
+								default:
+									return '<span class=\"btn-warning">'+value+'</span>';
+							}
+						}},
+					{ field: 'lastOutboundStatus', title: '最后外呼状态', align: 'center',
+						formatter: function(value, row, index) {
+							switch (value) {
+								case '未外呼':
+									return '<span class=\"btn-danger">'+value+'</span>';
+									break;
+								case '外呼中':
+									return '<span class=\"btn-primary">'+value+'</span>';
+									break;
+								case '未接通':
+									return '<span class=\"btn-danger">'+value+'</span>';
+									break;
+								case '未完成':
+									return '<span class=\"btn-danger">'+value+'</span>';
+									break;
+								case '已完成':
+									return '<span class=\"btn-primary">'+value+'</span>';
+									break;
+								case '接通后本人拒绝':
+									return '<span class=\"btn-warning">'+value+'</span>';
+									break;
+								default:
+									return '<span class=\"btn-primary">'+value+'</span>';
+							}
+						}},
 				{ field: 'actualFollowUpTime', title: '实际随访时间', align: 'center' },
 				{ field: 'callConnectedCount', title: '接通次数', align: 'center' },
 				{ field: 'outboundCallCount', title: '外呼次数', align: 'center' },
 				{ field: 'nextOutboundCallCount', title: '下次外呼次数', align: 'center' },
-				{ field: 'taskStatus', title: '任务状态', align: 'center' },
-				{ field: 'lastOutboundStatus', title: '最后外呼状态', align: 'center' },
-				{ field: 'updateTime2', title: '更新时间', align: 'center' },
 
+				{ field: 'updateTime2', title: '更新时间', align: 'center' },
 		        {
 		            title: '操作',
 		            align: 'center',
+					width: '180px',
 		            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-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
-			                var more = [];
-			                /*more.push("<a class='btn btn-default btn-xs " + resetPwdFlag + "' href='javascript:void(0)' onclick='resetPwd(" + row.userId + ")'><i class='fa fa-key'></i>重置密码</a> ");
-			                more.push("<a class='btn btn-default btn-xs " + editFlag + "' href='javascript:void(0)' onclick='authRole(" + row.userId + ")'><i class='fa fa-check-square-o'></i>分配角色</a>");
-			                actions.push('<a tabindex="0" class="btn btn-info btn-xs" role="button" data-container="body" data-placement="left" data-toggle="popover" data-html="true" data-trigger="hover" data-content="' + more.join('') + '"><i class="fa fa-chevron-circle-right"></i>更多操作</a>');*/
+			                actions.push('<a class="btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editTab(\'' + row.id + '\')">去随访</a> ');
+			                actions.push('<a class="btn-info btn-xs' + editFlag + '" href="javascript:void(0)" onclick="$.operate.editTab(\'' + row.id + '\')">查看全部</a> ');
 			                return actions.join('');
 		            	} else {
 		                    return "";
@@ -250,8 +331,52 @@
     			return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.userId + '\')"></i> ';
     		}
 		}
+		function saveRow() {
 
+			// 获取表单数据
+			var uploadImage = document.getElementById('uploadImage').value;
+			var FeedbackContent = document.getElementById('FeedbackContent').value;
+			// 检查数据是否为空
+			if (!FeedbackContent || !uploadImage) {
+				$.modal.alert('请填写意见内容和或上传图片!');
+				return;
+			}
+			$.modal.alert('意见内容=='+FeedbackContent+'传图片==='+uploadImage);
+			// 关闭模态框
+			$('#myModal').modal('hide');
+		}
 	</script>
 </body>
+<style>
+	.custom-file-upload {
+		position: relative;
+		overflow: hidden;
+		cursor: pointer;
+		display: flex;
+		justify-content: center;
+		align-items: center;
+	}
+
+	.custom-file-upload input[type=file] {
+		opacity: 0;
+		width: 100%;
+		height: 100%;
+		top: 0;
+		left: 0;
+		position: absolute;
+	}
+
+	.custom-file-upload label {
+		background-color: white;
+		border: 2px dashed #007bff;
+		color: #007bff;
+		padding: 20px;
+		text-align: center;
+		display: block;
+		min-height: 150px;
+	}
+
+
 
+</style>
 </html>

+ 297 - 56
health-admin/src/main/resources/templates/dtp/followUpAssign/followUpAssignList.html

@@ -9,7 +9,6 @@
 </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">
@@ -17,6 +16,7 @@
 					<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>
+						<a class="btn btn-w-m btn-dark" onclick="defultConfig"><i class="glyphicon glyphicon-cog" style="top: 2px;"></i><span style="font-size: 15px;">默认分配--->请设置</span></a>
 					</div>
 				</div>
 					<form id="followUpAssign-form"  class="customize-search-form">
@@ -26,48 +26,77 @@
 								<input type="text" class="styled-input" placeholder="请输入患者姓名或手机号" name="query"/>
 							</div>
 							<div class="customize-form-group">
-								<label>患者信息:</label>
-								<input type="text" class="styled-input" name="patientName" autocomplete="off"/>
-							</div>
-							<div class="customize-form-group">
 								<label>门店:</label>
-								<input type="text" class="styled-input" name="storeName"/>
+								<select name="storeId" class="styled-input">
+									<option value="">全部</option>
+									<!--									<option th:each="store : ${stores}" th:text="${store.name}" th:value="${store.id}"></option>-->
+								</select>
 							</div>
 							<div class="customize-form-group">
 								<label>药品:</label>
-								<input type="text"  class="styled-input" name="medicineName"/>
+								<input type="text"  class="styled-input" placeholder="商品名,通用名或MDM编码"  name="product"/>
 							</div>
 							<div class="customize-form-group">
 								<label>随访跟进人:</label>
-								<input type="text"  class="styled-input" name="followUpPersonName"/>
+								<input type="text"  class="styled-input" placeholder="随访跟进人姓名" name="followUpPersonName"/>
 							</div>
 						</div>
 					</form>
 				</div>
 
-		        <div class="btn-group-sm" id="toolbar" role="group">
-		        	<!--<a class="btn btn-success" onclick="$.operate.addTab()" shiro:hasPermission="system:user:add">
-		                <i class="fa fa-plus"></i> 新增
-		            </a>
-		             <a class="btn btn-primary single disabled" onclick="$.operate.editTab()" shiro:hasPermission="system:user:edit">
-			            <i class="fa fa-edit"></i> 修改
-			        </a>
-		            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:user:remove">
-		                <i class="fa fa-remove"></i> 删除
-		            </a>
-		            <a class="btn btn-info" onclick="$.table.importExcel()" shiro:hasPermission="system:user:import">
-			            <i class="fa fa-upload"></i> 导入
-			        </a>
-		            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:user:export">
-			            <i class="fa fa-download"></i> 导出
-			        </a>-->
-		        </div>
-
-				<div class="col-sm-12 select-table table-striped" style="width: 100%; overflow-x: auto;">
-					<table id="bootstrap-table" class="fixed-layout-table"></table>
-				</div>
 			</div>
-		</div>
+			<button id="myButtonhzfp"  type="button" onclick="huanzhefp()">患者分配</button>
+			<button id="myButtonyglzjj"  type="button" onclick="yuanogngLZJJ()">员工离职交接</button>
+			<div class="rows" id="tabsDiv">
+				<ul class="nav nav-tabs" id="myTabs">
+					<li class="active"><a data-toggle="tab" href="#tab-1" aria-expanded="true">全部</a>
+					</li>
+					<li class=""><a data-toggle="tab" href="#tab-2" aria-expanded="false">待分配</a>
+					</li>
+					<li class=""><a data-toggle="tab" href="#tab-3" aria-expanded="false">已分配</a>
+					</li>
+					<li class=""><a data-toggle="tab" href="#tab-4" aria-expanded="false">无效跟进人</a>
+					</li>
+				</ul>
+					<div class="tab-content">
+						<div id="tab-1" class="tab-pane active">
+							<div class="panel-body">
+								<div class="col-sm-12 select-table table-striped" style="width: 100%; overflow-x: auto;">
+									<table id="bootstrap-table" class="fixed-layout-table"></table>
+								</div>
+							</div>
+						</div>
+						<div id="tab-2" class="tab-pane">
+							<div class="panel-body">
+								<div class="panel-body">
+									<div class="col-sm-12 select-table table-striped" style="width: 100%; overflow-x: auto;">
+										<table id="bootstrap-table-2" class="fixed-layout-table"></table>
+									</div>
+								</div>
+							</div>
+						</div>
+						<div id="tab-3" class="tab-pane">
+							<div class="panel-body">
+								<div class="col-sm-12 select-table table-striped" style="width: 100%; overflow-x: auto;">
+									<table id="bootstrap-table-3" class="fixed-layout-table"></table>
+								</div>
+							</div>
+						</div>
+						<div id="tab-4" class="tab-pane">
+							<div class="panel-body">
+								<div class="col-sm-12 select-table table-striped" style="width: 100%; overflow-x: auto;">
+									<table id="bootstrap-table-4" class="fixed-layout-table"></table>
+								</div>
+							</div>
+						</div>
+					</div>
+
+			</div>
+		<div class="lizhi" id="content-main-lz" >
+			<div class="col-sm-12 select-table table-striped" style="width: 100%; overflow-x: auto;">
+				<table id="bootstrap-table-5" class="fixed-layout-table"></table>
+			</div>
+	    </div>
 	</div>
 
 	<th:block th:include="include :: footer" />
@@ -78,6 +107,7 @@
 		var editFlag = [[${@permission.hasPermi('dtp:pmService:edit')}]];
 		var removeFlag = [[${@permission.hasPermi('dtp:pmService:remove')}]];
 		var prefix = ctx + "dtp/pmService";
+		var patientId='';
 		$(function() {
 		    var panehHidden = false;
 		    if ($(this).width() < 1590) {
@@ -94,8 +124,7 @@
 	    	}
 			queryArchivesList();
 		});
-
-		function queryArchivesList() {
+		 function queryArchivesList() {
 		    var options = {
 		        url: prefix + "/followUpAssignList",
 		        viewUrl: prefix + "/followUpAssignView/{id}",
@@ -107,7 +136,7 @@
 		        importTemplateUrl: prefix + "/importTemplate",*/
 		        sortName: "id",
 		        sortOrder: "asc",
-		        modalName: "档案",
+		        modalName: "随访跟进人分配",
 				fitColumns: true,
 				striped: true,
 				autoRowHeight: true,
@@ -128,37 +157,20 @@
 				{ field: 'disease', title: '疾病', align: 'center' },
 				{ field: 'clinicalDiagnosis', title: '临床诊断', align: 'center' },
 				{ field: 'medicineName', title: '药品名称', align: 'center' },
-				{ field: 'lastPurchaseDate', title: '最后一次购药', align: 'center' },
+				{ field: 'status', title: '跟进人状态', align: 'center' },
 				{ field: 'followUpPersonName', title: '随访跟进人姓名', align: 'center' },
+				{ field: 'lastPurchaseDate', title: '最后一次购药', align: 'center' },
 				{ field: 'followUpPersonPhone', title: '跟进人手机号', align: 'center' },
-				{ field: 'followUpPersonRole', title: '跟进人角色', align: 'center' },
-				{ field: 'storeName', title: '门店', align: 'center' },
-				{ field: 'patientAssignmentStatus', title: '患者分配状态', align: 'center' },
-				{ field: 'terminatedEmployeeName', title: '离职员工', align: 'center' },
-				{ field: 'terminatedEmployeePhone', title: '离职员工手机号', align: 'center' },
-				{ field: 'terminatedEmployeeStore', title: '离职员工门店', align: 'center' },
-				{ field: 'createdAt', title: '创建时间', align: 'center' },
-				{ field: 'updatedAt', title: '更新时间', align: 'center' },
-				/*{
-		        	formatter: function (value, row, index) {
-						console.log(value+"-------v");
-						console.log(row+"-------r");
-		        		return statusTools(row);
-		        	}
-		        },*/
-
+				{ field: 'filingDate', title: '建档日期', align: 'center' },
 		        {
 		            title: '操作',
 		            align: 'center',
+					width: 150,
 		            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-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
-			                var more = [];
-			                /*more.push("<a class='btn btn-default btn-xs " + resetPwdFlag + "' href='javascript:void(0)' onclick='resetPwd(" + row.userId + ")'><i class='fa fa-key'></i>重置密码</a> ");
-			                more.push("<a class='btn btn-default btn-xs " + editFlag + "' href='javascript:void(0)' onclick='authRole(" + row.userId + ")'><i class='fa fa-check-square-o'></i>分配角色</a>");
-			                actions.push('<a tabindex="0" class="btn btn-info btn-xs" role="button" data-container="body" data-placement="left" data-toggle="popover" data-html="true" data-trigger="hover" data-content="' + more.join('') + '"><i class="fa fa-chevron-circle-right"></i>更多操作</a>');*/
+			                actions.push('<a class="btn-xs' + editFlag + '" href="javascript:void(0)" onclick="selectUsersToParentCallBack2(\'' + row.id + '\')">修改跟进人</a> ');
+			                actions.push('<a class="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 "";
@@ -180,6 +192,69 @@
 			_refresh();
 		}
 
+		var HZFPButton = document.getElementById('myButtonhzfp');
+		var myButtonyglzjj = document.getElementById('myButtonyglzjj');
+		// 定义要添加的class名称
+		var className = 'btn btn-primary';
+		var classWhiteName = 'btn btn-white';
+		//初始化加载
+		$(document).ready(function() {
+			var HZFPButton = document.getElementById('myButtonhzfp');
+			var myButtonyglzjj = document.getElementById('myButtonyglzjj');
+			HZFPButton.className=className;
+			myButtonyglzjj.className=classWhiteName;
+			// 监听点击事件,激活指定的选项卡
+			$('#myTabs li a').click(function(e) {
+				// 阻止默认行为
+				//e.preventDefault();
+				// 获取当前点击的选项卡链接
+				var $this = $(this);
+				if($this.attr('href') === '#tab-1'){
+					formSubmitted=true;
+				}
+				if($this.attr('href') === '#tab-2'){
+					formSubmitted=false;
+					// 添加 active 类到当前点击的选项卡
+					$(this).addClass('active');
+					$this.attr('aria-expanded', 'true');
+				}
+				// 检查是否为“用药购药”选项卡
+				if ($this.attr('href') === '#tab-2') {
+					// 初始化表格
+					initializeTableForTab('tab-2');
+				}
+				if ($this.attr('href') === '#tab-3') {
+					// 初始化表格
+					initializeTableForTab('tab-3');
+				}
+				if ( $this.attr('href') === '#tab-4') {
+					// 初始化表格
+					initializeTableForTab('tab-4');
+				}
+
+			});
+		});
+
+		// 分别给每个按钮添加class
+		HZFPButton.onclick = function() {
+			debugger
+			HZFPButton.className=className;
+			myButtonyglzjj.className=classWhiteName;
+			var x = document.getElementById("tabsDiv");
+			var L = document.getElementById("content-main-lz");
+			x.style.display = "block";
+			L.style.display = "none";
+			queryArchivesList();
+		};
+		myButtonyglzjj.onclick = function() {
+			HZFPButton.className=classWhiteName ;
+			myButtonyglzjj.className=className;
+			var x = document.getElementById("tabsDiv");
+			var L = document.getElementById("content-main-lz");
+			x.style.display = "none";
+			L.style.display = "block";
+			initForLZYGJJTab();
+		};
 		/* 用户状态显示 */
 		function statusTools(row) {
 		    if (row.status == 1) {
@@ -188,7 +263,173 @@
     			return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.userId + '\')"></i> ';
     		}
 		}
+		/*员工离职交接初始化*/
+		function initForLZYGJJTab() {
+			var datas=[];
+			var tableId = 'bootstrap-table-5';
+			var tableElement = $('#' + tableId);
+			var data = $("#followUpAssign-form").serializeArray();
+			data.push({name: 'flag', value: 5});
+			$.ajax({
+				cache : true,
+				type : "POST",
+				url: prefix + "/followUpAssignList",
+				data : data,
+				async : false,
+				error : function(request) {
+					$.modal.alertError("系统错误");
+				},
+				success : function(data) {
+					datas=data.rows;
+					$.operate.successCallback(data);
+				}
+			});
+			tableElement.bootstrapTable({
+				// 配置表格的相关属性
+				// 例如数据源、列定义等
+				// 示例配置
+				modalName: "员工离职交接",
+				fitColumns: true,
+				striped: true,
+				autoRowHeight: true,
+				rowNumbers: true,
+				showFooter:true,  //是否显示表格底部区域。
+				clickToSelect: true, //是否启用点击行时选中整行的功能。
+				singleSelect: false, //是否仅允许选择一行
+				fixedColumns: true,
+				//fixedNumber: 3,
+				fixedRightNumber: 1,
+				data: datas,
+				columns: [
+					{ field: 'patientName', title: '患者姓名', align: 'center' },
+					{ field: 'name', title: '离职员工', align: 'center' },
+					{ field: 'phone', title: '手机号', align: 'center'},
+					{ field: 'storeName', title: '门店', align: 'center'},
+					{
+						title: '操作',
+						align: 'center',
+						width: 150,
+						formatter: function(value, row, index) {
+							if (row.id) {
+								var actions = [];
+								actions.push('<a class="tn-xs ' + editFlag + '" href="javascript:void(0)" onclick="selectUsersToParentCallBack2(\'' + row.id + '\')">一键分配</a> ');
+								return actions.join('');
+							} else {
+								return "";
+							}
+						}
+					}]
+
+			});
+
+		}
+		function initializeTableForTab(tabId) {
+			var datas=[];
+			debugger
+			var tableId = 'bootstrap-table-' + tabId.substring(4);
+			var tableElement = $('#' + tableId);
+			var data = $("#followUpAssign-form").serializeArray();
+			data.push({name: 'flag', value: tabId.substring(4)});
+			console.log("tableId="+tabId.substring(4));
+			$.ajax({
+				cache : true,
+				type : "POST",
+				url: prefix + "/followUpAssignList",
+				data : data,
+				async : false,
+				error : function(request) {
+					$.modal.alertError("系统错误");
+				},
+				success : function(data) {
+					datas=data.rows;
+					$.operate.successCallback(data);
+				}
+			});
+			tableElement.bootstrapTable({
+				// 配置表格的相关属性
+				// 例如数据源、列定义等
+				// 示例配置
+				modalName: "随访跟进人分配",
+				fitColumns: true,
+				striped: true,
+				autoRowHeight: true,
+				rowNumbers: true,
+				showFooter:true,  //是否显示表格底部区域。
+				clickToSelect: true, //是否启用点击行时选中整行的功能。
+				singleSelect: false, //是否仅允许选择一行
+				fixedColumns: true,
+				//fixedNumber: 3,
+				fixedRightNumber: 1,
+				data: datas,
+				columns: [{
+					checkbox: true
+				},
+					{ field: 'patientName', title: '患者姓名', align: 'center' },
+					{ field: 'gender', title: '性别', align: 'center',width: 30 },
+					{ field: 'age', title: '年龄', align: 'center',width: 30, },
+					{ field: 'disease', title: '疾病', align: 'center' },
+					{ field: 'clinicalDiagnosis', title: '临床诊断', align: 'center' },
+					{ field: 'medicineName', title: '药品名称', align: 'center' },
+					{ field: 'status', title: '跟进人状态', align: 'center',width: 50, },
+					{ field: 'followUpPersonName', title: '随访跟进人姓名', align: 'center' },
+					{ field: 'lastPurchaseDate', title: '最后一次购药', align: 'center' },
+					{ field: 'filingDate', title: '建档日期', align: 'center' },
+					{
+						title: '操作',
+						align: 'center',
+						width: 150,
+						formatter: function(value, row, index) {
+							if (row.id) {
+								var actions = [];
+								actions.push('<a class="btn-xs' + editFlag + '" href="javascript:void(0)" onclick="selectUsersToParentCallBack2(\'' + row.id + '\')">修改跟进人</a> ');
+								actions.push('<a class="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 "";
+							}
+						}
+					}]
+
+			});
+		}
+		function selectUsersToParentCallBack2(rowid){
+			console.log("rowid=="+rowid)
+			patientId=rowid;
+			var prefix_s = ctx + "dtp/recipe";
+			//l: prefix + "/updateFollowUpPerson?id="+rowid,
+			var options = {
+				title: '修改随访跟进人',
+				url: prefix_s + "/drugInfo",
+				callBack: doSubmit2
+			};
+			$.modal.openOptions(options);
+		}
+
+		function doSubmit2(index, layero){
+			console.log("id=="+index)
+			var rows = layero.find("iframe")[0].contentWindow.selectColumns2();
+			if (rows.length == 0) {
+				$.modal.alertWarning("请至少选择一条记录");
+				return;
+			}
+			rows.forEach(function(item, index) {
+				var id =item.productId;
+				var name = item.productName;
+
+
+			});
+			// 做修改操作 修改跟进人
+			$.modal.close(index);
+		}
+
+
 	</script>
+<style>
+	.lizhi {
+	display: none;
+	}
+
+</style>
 </body>
 
 </html>

+ 98 - 0
health-admin/src/main/resources/templates/dtp/patientCounseling/patientCounselingAdd.html

@@ -0,0 +1,98 @@
+ <!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('新建患者咨询')" />
+</head>
+<style>
+
+</style>
+<script>
+
+</script>
+<body>
+    <div class="ui-layout-center">
+        <form id="form-patientCounseling-add" class="customize-search-form">
+            <div class="customize-form-group-container">
+                <div class="customize-form-group">
+                    <label class="col-sm-1 control-label">咨询日期:</label>
+                    <div class="customize-form-group select-time">
+                        <input name="consultationTime" placeholder="咨询日期"  id="consultationTime" class="time-input time-input2" type="text">
+                    </div>
+                </div>
+                <div class="customize-form-group">
+                    <label class="col-sm-1 control-label">问题类型:</label>
+                    <select name="questionType" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_hzzx_wtlx')}" >
+                        <option>请选择</option>
+                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"></option>
+                    </select>
+                </div>
+                <div class="customize-form-group">
+                    <label class="col-sm-1 control-label">咨询问题:</label>
+                    <textarea id="consultationQuestion" name="consultationQuestion" class="styled-input edit_inputs textareas"
+                     style="width: auto;height: 140px ;border: 1px solid ;" placeholder="咨询问题..." rows="1" cols="65" ></textarea>
+                </div>
+
+                <div class="customize-form-group">
+                    <label class="col-sm-1 control-label">药师解答:</label>
+                    <textarea id="pharmacistAnswer" name="pharmacistAnswer" class="styled-input edit_inputs textareas"
+                              style="width: auto;height: 140px ;border: 1px solid ;" placeholder="药师解答..." rows="1" cols="65" ></textarea>
+                </div>
+                <div class="customize-form-group">
+                    <label class="col-sm-1 control-label">知识链接:</label>
+                    <div class="input-groups" th:with="type=${@dict.getType('sys_select_dtp_ysfw_zslj')}" id="KnowledgeLinkDiv">
+                        <input type="checkbox" class="form-check-radio" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" name="KnowledgeLink">
+                    </div>
+                </div>
+                <div class="customize-form-group">
+                    <label class="col-sm-1 control-label is-required" >关联患者:</label>
+                    <select name="patientId" class="styled-input" >
+                        <option>请选择</option>
+                        <option th:each="patient : ${patients}" th:text="${patient.name}" th:value="${patient.id}"></option>
+                    </select>
+                </div>
+                <div class="customize-form-group">
+                    <label class="col-sm-1 control-label">联系人与患者关系:</label>
+                    <select name="contactRelation" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_ysfw_lxryhzgx')}">
+                        <option>请选择</option>
+                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
+                        ></option>
+                    </select>
+                </div>
+            </div>
+        </form>
+    </div>
+	<th:block th:include="include :: footer" />
+</body>
+</html>
+
+<script>
+    var prefix = ctx + "dtp/pmService";
+    function submitHandler() {
+        var KnowledgeLinks = []; //睡眠状况
+        $('input[name="KnowledgeLink"]:checked').each(function() {
+            KnowledgeLinks.push($(this).val());
+        });
+        if ($.validate.form()) {
+            var data = $("#form-patientCounseling-add").serializeArray();
+            var consultationQuestion = document.getElementById('consultationQuestion').value;
+            var pharmacistAnswer = document.getElementById('pharmacistAnswer').value;
+            data.push({name:"consultationQuestion",value:consultationQuestion})
+            data.push({name:"pharmacistAnswer",value:pharmacistAnswer})
+            data.push({name:"KnowledgeLinksValue",value:KnowledgeLinks.join(',')})
+            $.ajax({
+                cache : true,
+                type : "POST",
+                url : prefix + "/patientCounselingAdd",
+                data : data,
+                async : false,
+                error : function(data) {
+                    $.modal.alertError(data.msg);
+                },
+                success : function(data) {
+                    //$.table.refresh()
+                    $.operate.successCallback(data);
+                }
+            });
+        }
+    }
+</script>

+ 97 - 110
health-admin/src/main/resources/templates/dtp/patientCounseling/patientCounselingEdit.html

@@ -1,7 +1,7 @@
- <!DOCTYPE html>
+<!DOCTYPE html>
 <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
 <head>
-    <th:block th:include="include :: header('随访跟进人分配')" />
+    <th:block th:include="include :: header('新建患者咨询')" />
 </head>
 <style>
 
@@ -10,124 +10,111 @@
 
 </script>
 <body>
-    <div class="ui-layout-center">
-        <form class="form-horizontal" id="form-patientCounseling-edit" th:object="${user}">
-            <h4 class="form-header h4">基本信息</h4>
-            <input type="hidden" id="id" name="id" th:value="${id}">
-            <div class="row">
-
-                <div class="col-sm-12">
-                    <div class="form-group">
-                        <!--is-required 增加星号 显示为必填-->
-                            <label class="col-sm-1 control-label">患者姓名:</label>
-                            <div class="col-sm-2">
-                                <div class="input-group">
-                                    <input name="patientName" placeholder="患者姓名" th:value="${patientName}" class="styled-input" type="text" maxlength="255" required>
-                                </div>
-                            </div>
-                            <label class="col-sm-1 control-label">患者手机号:</label>
-                            <div class="col-sm-2">
-                                <div class="input-group">
-                                    <input name="patientPhone" placeholder="患者手机号" th:value="${patientPhone}" class="styled-input" type="number" maxlength="11" required>
-                                </div>
-                            </div>
-                        <label class="col-sm-1 control-label">性别:</label>
-                        <div class="col-sm-2" >
-                            <div class="input-group">
-                                <select name="gender" class="styled-input" th:with="type=${@dict.getType('sys_user_sex')}" >
-                                    <!--<option>所有</option>-->
-                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
-                                            th:selected="${dict.dictLabel} == ${gender}" ></option>
-                                </select>
-                            </div>
-                        </div>
-                        <label class="col-sm-1 control-label">年龄:</label>
-                        <div class="col-sm-2">
-                            <div class="input-group">
-                                <input name="age" placeholder="年龄" th:value="${age}" class="styled-input" type="number" required>
-                            </div>
-                        </div>
-                    </div>
-                </div>
-                <div class="col-sm-12">
-                    <div class="form-group">
-                        <label class="col-sm-1 control-label">问题类型:</label>
-                        <div class="col-sm-2">
-                            <div class="input-group">
-                                <select name="questionType" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_hzzx_wtlx')}" >
-                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}" th:selected="${dict.dictLabel} == ${questionType}"></option>
-                                </select>
-                            </div>
-                        </div>
-                        <label class="col-sm-1 control-label">咨询问题:</label>
-                        <div class="col-sm-2">
-                            <div class="input-group">
-                                <input name="consultationQuestion" placeholder="咨询问题" th:value="${consultationQuestion}" class="styled-input" required>
-                            </div>
-                        </div>
-                        <label class="col-sm-1 control-label">药师解答:</label>
-                        <div class="col-sm-2">
-                            <div class="input-group">
-                                <input name="pharmacistAnswer" placeholder="药师解答" th:value="${pharmacistAnswer}" class="styled-input" ></input>
-                            </div>
-                        </div>
-                        <label class="col-sm-1 control-label">咨询时间:</label>
-                        <div class="col-sm-2">
-                            <div class="input-group">
-                                <input name="consultationTime" placeholder="咨询时间" th:value="${updateTime2}" class="styled-input time-input-new" type="text" required>
-                            </div>
-                        </div>
-                    </div>
+<div class="ui-layout-center">
+    <form id="form-patientCounseling-edit" class="customize-search-form">
+        <input type="hidden" id="id" name="id" th:value="${id}">
+        <div class="customize-search-form">
+            <div class="customize-form-group edit">
+                <label>咨询日期:</label>
+                <div class="customize-form-group select-time">
+                    <input name="consultationTime" placeholder="咨询日期" th:value="${consultationTime}"  id="consultationTime" class="time-input time-input2" type="text">
                 </div>
+            </div>
+            <div class="customize-form-group edit">
+                <label>问题类型:</label>
+                <select name="questionType" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_hzzx_wtlx')}" >
+                    <option>请选择</option>
+                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
+                            th:selected="${dict.dictLabel}==${questionType}"></option>
+                </select>
+            </div>
+            <div class="customize-form-group edit">
+                <label>咨询问题:</label>
+                <textarea id="consultationQuestion" name="consultationQuestion" class="styled-input edit_inputs textareas"
+                          style="width: auto;height: 140px ;border: 1px solid ;" placeholder="咨询问题..." rows="1" cols="65" th:text="${consultationQuestion}" ></textarea>
+            </div>
 
-                <div class="col-sm-12">
-                    <div class="form-group">
-                        <label class="col-sm-1 control-label">疾病:</label>
-                        <div class="col-sm-2">
-                            <div class="input-group">
-                                <input name="disease" placeholder="疾病" th:value="${disease}" class="styled-input" type="text" maxlength="255" required>
-                            </div>
-                        </div>
-                        <label class="col-sm-1 control-label">药品通用名:</label>
-                        <div class="col-sm-2">
-                            <div class="input-group">
-                                <input name="genericName" placeholder="药品通用名" th:value="${genericName}" class="styled-input" type="text" maxlength="255" required>
-                            </div>
-                        </div>
-                        <label class="col-sm-1 control-label">商品名:</label>
-                        <div class="col-sm-2">
-                            <div class="input-group">
-                                <input name="productName" placeholder="商品名" th:value="${productName}" class="styled-input" type="text" maxlength="255" required>
-                            </div>
-                        </div>
-                    </div>
+            <div class="customize-form-group edit">
+                <label>药师解答:</label>
+                <textarea id="pharmacistAnswer" name="pharmacistAnswer" class="styled-input edit_inputs textareas"
+                          style="width: auto;height: 140px ;border: 1px solid ;" placeholder="药师解答..." rows="1" cols="65" th:text="${pharmacistAnswer}"></textarea>
+            </div>
+            <div class="customize-form-group edit">
+                <label>知识链接:</label>
+                <div class="input-groups" th:with="type=${@dict.getType('sys_select_dtp_ysfw_zslj')}" id="KnowledgeLinkDiv">
+                    <input type="checkbox" class="form-check-radio" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" name="KnowledgeLink">
                 </div>
-
             </div>
-        </form>
-    </div>
-    <div class="main-content">
-        <div class="col-sm-offset-5 col-sm-10">
-            <button type="button" class="btn btn-sm btn-primary" onclick="submitHandler()"><i class="fa fa-check"></i>保 存</button>&nbsp;
-            <button type="button" class="btn btn-sm btn-danger" onclick="closeItem()"><i class="fa fa-reply-all"></i>关 闭 </button>
+            <div class="customize-form-group edit">
+                <label class="is-required" >关联患者:</label>
+                <input name="patientName" placeholder="咨询日期" th:value="${patientName}"  id="patientName" class="styled-input" type="text" disabled="true">
+            </div>
+            <div class="customize-form-group edit">
+                <label>联系人与患者关系:</label>
+                <select name="contactRelation" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_ysfw_lxryhzgx')}">
+                    <option>请选择</option>
+                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"
+                            th:selected="${dict.dictLabel}==${contactRelation}"></option>
+                </select>
+            </div>
         </div>
-    </div>
-	<th:block th:include="include :: footer" />
+    </form>
+</div>
+<th:block th:include="include :: footer" />
+<th:block th:include="include :: bootstrap-select-css" />
+</body>   <th:block th:include="include :: select2-js" />
+<th:block th:include="include :: bootstrap-select-js" />
 </body>
 </html>
 
-<script>
+<script th:inline="javascript">
+    var prefix = ctx + "dtp/pmService";
     function submitHandler() {
-        var prefix = ctx + "dtp/pmService";
+        var KnowledgeLinks = []; //睡眠状况
+        $('input[name="KnowledgeLink"]:checked').each(function() {
+            KnowledgeLinks.push($(this).val());
+        });
+
         if ($.validate.form()) {
             var data = $("#form-patientCounseling-edit").serializeArray();
-            /*var status = $("input[id='status']").is(':checked') == true ? 0 : 1;
-            var roleIds = $.form.selectCheckeds("role");
-            var postIds = $.form.selectSelects("post");
-            data.push({"name": "status", "value": status});
-            data.push({"name": "roleIds", "value": roleIds});
-            data.push({"name": "postIds", "value": postIds});*/
-            $.operate.saveTab(prefix + "/patientCounselingEdit", data);
+            data.push({name:"KnowledgeLinksValue",value:KnowledgeLinks.join(',')})
+            var consultationQuestion = document.getElementById('consultationQuestion').value;
+            var pharmacistAnswer = document.getElementById('pharmacistAnswer').value;
+            data.push({name:"consultationQuestion",value:consultationQuestion})
+            data.push({name:"pharmacistAnswer",value:pharmacistAnswer})
+            $.ajax({
+                cache : true,
+                type : "POST",
+                url : prefix + "/patientCounselingEdit",
+                data : data,
+                async : false,
+                error : function(data) {
+                    $.modal.alertError(data.msg);
+                },
+                success : function(data) {
+                    //$.table.refresh()
+                    $.operate.successCallback(data);
+                }
+            });
         }
     }
-</script>
+    $(document).ready(function() {
+        debugger
+    function checkKnowledgeLink(KnowledgeLinkList) {
+        debugger
+        var KnowledgeLink = KnowledgeLinkList.split(',');
+        $.each(KnowledgeLink, function(index, value) {
+            var trimmedValue = value.trim();
+            var checkbox = $('input[name="KnowledgeLink"][value="'+value.trim()+'"]');
+            checkbox.prop('checked', true);
+        });
+    }
+    /*<![CDATA[*/
+    var KnowledgeLinkList = /*[[${KnowledgeLink}]]*/ '';
+    /*]]>*/
+    if(KnowledgeLinkList){
+        checkKnowledgeLink(KnowledgeLinkList);
+    }
+    });
+
+</script>

+ 41 - 44
health-admin/src/main/resources/templates/dtp/patientCounseling/patientCounselingList.html

@@ -23,15 +23,15 @@
 						<div class="customize-form-group-container">
 							<div class="customize-form-group">
 								<label>患者信息:</label>
-								<input type="text" class="styled-input" name="patientName" autocomplete="off"/>
+								<input type="text" class="styled-input" placeholder="请输入患者姓名或手机号" name="query"/>
 							</div>
 							<div class="customize-form-group">
 								<label>疾病:</label>
-								<input type="text" class="styled-input" name="disease"/>
+								<input type="text" class="styled-input" placeholder="请输入疾病" name="disease"/>
 							</div>
 							<div class="customize-form-group">
 								<label>咨询问题:</label>
-								<input type="text"  class="styled-input" name="consultationQuestion"/>
+								<input type="text"  class="styled-input"  style="width: 410px;" placeholder="请输入咨询问题" name="consultationQuestion"/>
 							</div>
 							<div class="customize-form-group">
 								<label>问题类型:</label>
@@ -42,28 +42,28 @@
 							</div>
 							<div class="customize-form-group">
 								<label>药品:</label>
-								<input type="text"  class="styled-input" name="followUpPersonName"/>
+								<input type="text"  placeholder="商品名,通用名或MDM编码" class="styled-input"  name="product"/>
+							</div>
+							<div class="customize-form-group select-time">
+								<label>咨询时间:</label>
+								<input type="text" class="time-input time-input2" id="beginTime" placeholder="开始时间" name="beginTime">
+								<span>-</span>
+								<input type="text" class="time-input time-input2" id="endTime" placeholder="结束时间" name="endTime">
 							</div>
 						</div>
 					</form>
 				</div>
 
 		        <div class="btn-group-sm" id="toolbar" role="group">
-		        	<!--<a class="btn btn-success" onclick="$.operate.addTab()" shiro:hasPermission="system:user:add">
-		                <i class="fa fa-plus"></i> 新
+		        	<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="system:user:add">
+		                <i class="fa fa-plus"></i> 新建咨询
 		            </a>
-		             <a class="btn btn-primary single disabled" onclick="$.operate.editTab()" shiro:hasPermission="system:user:edit">
-			            <i class="fa fa-edit"></i> 修改
-			        </a>
 		            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:user:remove">
 		                <i class="fa fa-remove"></i> 删除
 		            </a>
-		            <a class="btn btn-info" onclick="$.table.importExcel()" shiro:hasPermission="system:user:import">
-			            <i class="fa fa-upload"></i> 导入
-			        </a>
-		            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:user:export">
-			            <i class="fa fa-download"></i> 导出
-			        </a>-->
+					<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="system:user:export">
+						<i class="fa fa-download"></i> 导出
+					</a>
 		        </div>
 
 				<div class="col-sm-12 select-table table-striped" style="width: 100%; overflow-x: auto;">
@@ -80,6 +80,7 @@
 	<script th:inline="javascript">
 		var editFlag = [[${@permission.hasPermi('dtp:pmService:edit')}]];
 		var removeFlag = [[${@permission.hasPermi('dtp:pmService:remove')}]];
+		var detailFlag = [[${@permission.hasPermi('dtp:print:view')}]];
 		var prefix = ctx + "dtp/pmService";
 		$(function() {
 		    var panehHidden = false;
@@ -105,53 +106,57 @@
 		        createUrl: prefix + "/patientCounselingAdd",
 		        updateUrl: prefix + "/patientCounselingEdit/{id}",
 		        removeUrl: prefix + "/patientCounselingRemove",
-		        /*exportUrl: prefix + "/export",
+		        exportUrl: prefix + "/export",
 		        importUrl: prefix + "/importData",
-		        importTemplateUrl: prefix + "/importTemplate",*/
-		        sortName: "id",
-		        sortOrder: "asc",
-		        modalName: "档案",
+		        importTemplateUrl: prefix + "/importTemplate",
+		        modalName: "患者咨询",
 				fitColumns: true,
 				striped: true,
 				autoRowHeight: true,
 				rowNumbers: true,
 				showFooter:true,  //是否显示表格底部区域。
 				clickToSelect: true, //是否启用点击行时选中整行的功能。
-				singleSelect: false, //是否仅允许选择一行
+				singleSelect: true, //是否仅允许选择一行
             fixedColumns: true,
             //fixedNumber: 3,
             fixedRightNumber: 1,
 		        columns: [{
 		            checkbox: true
 		        },
-				/*{ field: 'createdBy', title: '创建人', align: 'center' },
-				{ field: 'createdDate', title: '创建日期', align: 'center' },*/
-				{ field: 'patientName', title: '患者姓名', align: 'center' },
+				{ field: 'id', title: '主键', align: 'center' ,visible:false},
+				{field: 'patientName', title: '患者姓名', align: 'center' },
 				{ field: 'patientPhone', title: '患者手机号', align: 'center' },
-				{ field: 'gender', title: '性别', align: 'center' },
+				{ field: 'gender', title: '性别', align: 'center',
+					formatter: function(value, row, index) {
+						switch (value) {
+							case 0:
+								return "男";
+								break;
+							case 1:
+								return "女";
+								break;
+							default:
+								return "未知";
+						}
+					} },
 				{ field: 'age', title: '年龄', align: 'center' },
 				{ field: 'questionType', title: '问题类型', align: 'center' },
 				{ field: 'consultationQuestion', title: '咨询问题', align: 'center' },
 				{ field: 'pharmacistAnswer', title: '药师解答', align: 'center' },
 				{ field: 'consultationTime', title: '咨询时间', align: 'center' },
 				{ field: 'disease', title: '疾病', align: 'center' },
-				{ field: 'genericName', title: '药品通用名', align: 'center' },
-				{ field: 'productName', title: '商品名', align: 'center' },
-
+				{ field: 'prescriptionGenericName', title: '药品通用名', align: 'center' },
+				{ field: 'prescriptionProductName', title: '商品名', align: 'center' },
 		        {
 		            title: '操作',
 		            align: 'center',
 		            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-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
-			                var more = [];
-			                /*more.push("<a class='btn btn-default btn-xs " + resetPwdFlag + "' href='javascript:void(0)' onclick='resetPwd(" + row.userId + ")'><i class='fa fa-key'></i>重置密码</a> ");
-			                more.push("<a class='btn btn-default btn-xs " + editFlag + "' href='javascript:void(0)' onclick='authRole(" + row.userId + ")'><i class='fa fa-check-square-o'></i>分配角色</a>");
-			                actions.push('<a tabindex="0" class="btn btn-info btn-xs" role="button" data-container="body" data-placement="left" data-toggle="popover" data-html="true" data-trigger="hover" data-content="' + more.join('') + '"><i class="fa fa-chevron-circle-right"></i>更多操作</a>');*/
-			                return actions.join('');
-		            	} else {
+			                actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a>');
+							actions.push('<a class="btn btn-warning btn-xs ' + detailFlag + '" href="javascript:void(0)" onclick="$.operate.detail(\'' + row.id + '\')"><i class="fa fa-search"></i>查看记录</a>');
+							return actions.join('');
+						} else {
 		                    return "";
 		                }
 		            }
@@ -171,14 +176,6 @@
 			_refresh();
 		}
 
-		/* 用户状态显示 */
-		function statusTools(row) {
-		    if (row.status == 1) {
-    			return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.userId + '\')"></i> ';
-    		} else {
-    			return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.userId + '\')"></i> ';
-    		}
-		}
 	</script>
 </body>
 

+ 152 - 101
health-admin/src/main/resources/templates/dtp/recipe/add.html

@@ -8,21 +8,22 @@
 <body>
 <div class="main-content">
     <form id="form-prescription-add" class="form-horizontal">
-            <div class="ibox float-e-margins">
-                <label class="font-noraml">处方上传</label>
-                <div class="new-contentarea tc">
-                    <a href="javascript:void(0)" class="upload-img"><label for="inputImage" >上传图像</label> </a>
-                    <input type="file" name="avatar" id="inputImage" onchange="uploadImage(this)" accept="image/*"/>
-                </div>
+        <div class="ibox float-e-margins">
+            <label class="font-noraml">处方上传</label>
+            <div class="new-contentarea tc">
+                <a href="javascript:void(0)" class="upload-img"><label for="inputImage">上传图像</label></a>
+                <input type="file" name="avatar" id="inputImage" onchange="uploadImage(this)" accept="image/*"/>
 
             </div>
-            <div class="ibox">
-                <div class="ibox-title">
+        </div>
+        <div class="ibox">
+            <div class="ibox-title">
                 <img id="uploadedImage" src="" alt="上传的图片" style="max-width: 100%; display: block;">
-                </div>
             </div>
+        </div>
                     <ul class="list-group list-group-striped">
                         <li class="list-group-item hidden"  id="prescriptionNumberItem"><i class="fa fa-user"></i>
+                            <input type="hidden" name="prescriptionImg" id="prescriptionImg" value="">
                             <b  class="font-noraml">处方单号:</b>
                             <p class="pull-right">
                             <div class="customize-form-group select-time">
@@ -136,9 +137,39 @@
             </div>
         </div>
         </p>
+        <div class="customize-form-group" style="justify-content: center;">
+        <button type="button"  onclick="bangding()" class="btn-primary">绑定患者</button>
+        </div>
     </div>
 
+    <div class="modal inmodal" id="myModal" tabindex="-1" role="dialog" aria-hidden="true">
+        <div class="modal-dialog">
+            <form class="form-horizontal" id="form-relation-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>
+                    </div>
+                    <div class="modal-body">
+                        <div class="customize-search-form">
+                            <div class="customize-form-group edit">
+                                <label>微信绑定</label>
+                                <div class="input-group">
+                                    <input type="text" placeholder="请输入openId" class="styled-input edit_inputs"  style="width: 200px;" id="openId" name="openId">
+                                </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="saveRow()">绑定保存</button>
+                    </div>
+                </div>
+            </form>
+        </div>
+    </div>
 </div>
 
 <th:block th:include="include :: footer" />
@@ -146,41 +177,45 @@
 <th:block th:include="include :: bootstrap-fileinput-js" />
 <script>
     var prefix = ctx + "dtp/recipe";
+    var prefix_bd = ctx + "dtp/recipe";
     var jbtype='';
+    var saveData;
+    var hzparam =[];
+    var openId='';
+    var data;
     function uploadImage(input) {
         if (input.files && input.files[0]) {
             var reader = new FileReader();
             reader.onload = function(e) {
                 $('#uploadedImage').attr('src', e.target.result).show();
-                sendImageToServer(e.target.result);
             };
             reader.readAsDataURL(input.files[0]);
+            // 直接将文件对象传递给 sendImageToServer
+            sendImageToServer(input.files[0]);
         }
     }
-
-    function sendImageToServer(imageData) {
+    function sendImageToServer(file) {
+        debugger;
+        var formdata = new FormData();
+        formdata.append("prescriptionfile", file);
         $.ajax({
-            url: '/upload-and-recognize',
-            type: 'POST',
-            contentType: 'application/json',
-            data: JSON.stringify({ imageData: imageData }),
-            success: function(response) {
-                $('#hospital').val(response.hospital);
-                $('#prescriptionDate').val(response.prescriptionDate);
-                $('#prescriptionDoctor').val(response.prescriptionDoctor);
-                $('#clinicalDiagnosis').val(response.clinicalDiagnosis);
-                $('#department').val(response.department);
+            url: prefix + "/updatePrescriptionImg",
+            data: formdata,
+            type: "post",
+            processData: false,
+            contentType: false,
+            success: function(result) {
+                $("#prescriptionImg").val(result.msg)
+                console.log($("#prescriptionImg").val())
             },
-            error: function(error) {
-                console.error('Error:', error);
+            error: function(xhr, status, error) {
+                console.error("Error uploading image:", error);
             }
         });
     }
 
-
     document.getElementById('diseaseType').addEventListener('change', function() {
         jbtype = this.value;
-
             if(jbtype=='慢病'){
                 specificDiseaseDiv1
                 $('#specificDiseaseDiv1').show();
@@ -196,35 +231,16 @@
                 $('#specificDiseaseDiv2').hide();
                 $('#specificDiseaseDiv1').hide();
             }
-
         console.log('Selected value:', this.value);
     });
-    $(document).ready(function () {
-
-        //$('#prescriptionSourceItem').hide();//控制是第三方存入后 登记处方时的信息显示字段
-        //$('#prescriptionNumberItem').hide();//控制是第三方存入后 登记处方时的信息显示字段
-        // 单图上传
-        $("#singleFile").fileinput({
-            uploadUrl: ctx + 'common/upload',
-            maxFileCount: 1,
-            autoReplace: true
-        }).on('fileuploaded', function (event, data, previewId, index) {
-            var rsp = data.response;
-            log.info("return url:" + rsp.url)
-            log.info("reutrn fileName:" + rsp.fileName)
-            log.info("reutrn newFileName:" + rsp.newFileName)
-            log.info("return originalFilename:" + rsp.originalFilename)
-        }).on('fileremoved', function (event, id, index) {
-            $("input[name='" + event.currentTarget.id + "']").val('')
-        })
-    });
-
     function submitHandler() {
             add();
     }
     function add() {
-        debugger
+        //$('#prescriptionSourceItem').hide();//控制是第三方存入后 登记处方时的信息显示字段
+        //$('#prescriptionNumberItem').hide();//控制是第三方存入后 登记处方时的信息显示字段
         var formData = [];
+        var flag = false;
         $('.ibox').each(function() {
             var productId = $(this).find('input[name="productId"]').val();
             var mdmCode = $(this).find('input[name="mdmCode"]').val();
@@ -252,36 +268,108 @@
                     medicationCycle: medicationCycle
                 });
             }
+            if(isFlipItem==="是"){
+                flag = true;
+            }
         });
         if ($.validate.form()) {
-            var data = $("#form-prescription-add").serializeArray();
+             data = $("#form-prescription-add").serializeArray();
             data.push({name:'drugList',value:JSON.stringify(formData)});
+            data.push.apply(data,hzparam);
+            console.log("hzparam"+hzparam)
+
         }
 
-        log.info(data);
+            debugger
+            log.info(data);
+            $.ajax({
+                cache: true,
+                type: "POST",
+                url: ctx + "dtp/recipe/SaveRecipe",
+                data: data,
+                async: false,
+                error: function (request) {
+                    $.modal.alertError("系统错误");
+                },
+                success: function (data) {
+                    debugger
+                        if(flag){
+                            $('#myModal').modal('show');
+                        }else{
+                            $.modal.alertSuccess("新增成功");
+                            $.modal.close();
+                        }
+                }
+            });
+    }
+    function saveRow() {
+        // 获取表单数据 form-relation-add relationTable 联系人电话 lxrdh 联系人姓名 lxrxm 联系人关系 lxrgx
+           openId = document.getElementById('openId').value;
+        // 检查数据是否为空
+        if (!openId) {
+            $.modal.alert('请填写openId');
+            return;
+        }
+        hzparam.push({name:"openId",value:openId});//模拟微信扫码获取微信openId
+        console.log("hzparam========"+hzparam)
+        console.log("openId="+openId)
         $.ajax({
-            cache : true,
-            type : "POST",
-            url : ctx + "dtp/recipe/SaveRecipe",
-            data : data,
-            async : false,
-            error : function(request) {
+            cache: true,
+            type: "POST",
+            url: ctx + "dtp/pmService/ShaoMaShangFan",
+            data: hzparam,
+            async: false,
+            error: function (request) {
                 $.modal.alertError("系统错误");
             },
-            success : function(data) {
-                if (data.result == "200") {
-                    $.modal.msg("保存成功,正在刷新数据请稍后……有个问题同事添加相同药品", modal_status.SUCCESS);
-                } else if (data.code == web_status.WARNING) {
-                    $.modal.alertWarning(data.msg)
-                } else {
+            success: function (data) {
+                if(data.code==0){
+                    $.modal.alertSuccess("新增并上翻成功");
+                    flag = false;
+                    // 关闭模态框
+                    $('#myModal').modal('hide');
+                    $.modal.close();
+                }else{
                     $.modal.alertError(data.msg);
                 }
 
-                $.operate.successCallback(data);
-
             }
         });
+
+    }
+
+    function bangding(){
+        huanzheBanding();
+    }
+    function huanzheBanding(data){
+        var options = {
+            title: '患者绑定',
+            url: prefix + "/huanzheBanding",
+            width:1000,
+            callBack: doSubmithz
+        };
+        $.modal.openOptions(options);
+    }
+
+    function doSubmithz(index, layero){
+        debugger
+    var rows = layero.find("iframe")[0].contentWindow.selectTableObject();
+    if (rows.length == 0) {
+        $.modal.alertWarning("请至少选择一条记录");
+        return;
     }
+
+      var id = rows[0].id[0];
+      var name= rows[0].name[0];
+      var phoneNumber=  rows[0].phoneNumber[0];
+      var documentNumber=  rows[0].documentNumber[0];
+      var gender=  rows[0].gender[0];
+      var age=  rows[0].age[0];
+        $.modal.close(index);
+        hzparam.push({name:"patientId",value:id},{name:"patientName",value:name},{name:"patientPhone",value:phoneNumber},{name:"documentNumber",value:documentNumber},{name:"gender",value:gender},{name:"age",value:age});
+        console.log("hzparam="+hzparam)
+    }
+
     // callBack获取父窗口方法(方式二)
     function selectUsersToParentCallBack2(){
         var options = {
@@ -374,43 +462,6 @@
         // 更新 productId 显示
         $('#productId').html('');
     }
-    $('#inputImage').on('change', function() {
-        var reader = new FileReader();
-        var file = $('#inputImage')[0].files[0];
-        if (/^image\/\w+$/.test(file.type)) {
-            reader.onload = function(e) {
-                if(croppable){
-                    cropper.replace(e.target.result)
-                }
-            }
-            reader.readAsDataURL(this.files[0]);
-        } else {
-            $.modal.alertWarning('请选择一个图片文件。');
-        }
-    });
-    function avatar() {
-        var url = ctx + 'system/user/profile/avatar';
-        top.layer.open({
-            type: 2,
-            area: [$(window).width() + 'px', $(window).height() + 'px'],
-            fix: false,
-            //不固定
-            maxmin: true,
-            shade: 0.3,
-            title: "身份证信息",
-            content: url,
-            btn: ['确定', '关闭'],
-            // 弹层外区域关闭
-            shadeClose: true,
-            yes: function(index, layero) {
-                var iframeWin = layero.find('iframe')[0];
-                iframeWin.contentWindow.submitHandler(index, layero);
-            },
-            cancel: function(index) {
-                return true;
-            }
-        });
-    }
 
     /* 用户管理-新增-选择门店树 */
     function selectDeptTree() {

+ 34 - 37
health-admin/src/main/resources/templates/dtp/recipe/drugInfo.html

@@ -2,45 +2,42 @@
 <html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
 <head>
 	<meta charset="UTF-8">
-	<meta name="format-detection" content="telephone=no">
 	<th:block th:include="include :: header('药品信息')" />
 	<th:block th:include="include :: layout-latest-css" />
 	<th:block th:include="include :: ztree-css" />
 </head>
 
-<body class="gray-bg">
-<div class="ui-layout-center">
-<input type="hidden" id="rowIds">
-	<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>
+<body><div class="main-content">
+
+
+				<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>
+						<form id="tag-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="请输入MDM编码或药品商品名" name="query" style="width: 350px;"/>
+								</div>
+							</div>
+						</form>
+					</div>
+
 				</div>
-			</div>
-			<form id="tag-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="请输入MDM编码或药品商品名" name="query" style="width: 300px;"/>
+				<div class="row">
+					<div class="col-sm-12 select-table table-striped">
+						<table id="bootstrap-table"></table>
 					</div>
 				</div>
-			</form>
-		</div>
-
-	</div>
-	<div class="row">
-		<div class="col-sm-12 select-table table-striped">
-			<table id="bootstrap-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 viewFlag = [[${@permission.hasPermi('dtp:configInfo:list')}]];
 	var prefix = ctx + "dtp/configInfo";
@@ -50,15 +47,15 @@
 		if ($(this).width() < 1590) {
 			panehHidden = true;
 		}
-		$('body').layout({ initClosed: panehHidden, west__size: 185, resizeWithWindow: false });
+		//$('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);
-		}
+		// if ($.fn.toTop !== undefined) {
+		// 	var opt = {
+		// 		win:$('.ui-layout-center'),
+		// 		doc:$('.ui-layout-center')
+		// 	};
+		// 	$('#scroll-up').toTop(opt);
+		// }
 		queryUserList();
 	});
 

+ 22 - 11
health-admin/src/main/resources/templates/dtp/recipe/edit.html

@@ -11,6 +11,27 @@
                 <div class="row">
                     <div class="col-sm-4">
                         <div class="form-group">
+                            <label class="col-sm-4 control-label">处方类型:</label>
+                            <div class="col-sm-8">
+                                <select name="prescriptionType" class="form-control" th:with="type=${@dict.getType('sys_select_prescription_ype')}">
+                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
+                                            th:selected="${dict.dictValue}==${prescriptionType}"></option>
+                                </select>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="col-sm-4">
+                        <div class="form-group">
+                            <label class="col-sm-4 control-label is-required">处方单号:</label>
+                            <div class="col-sm-8">
+                                <div class="input-group">
+                                    <input id="prescriptionNumber" name="prescriptionNumber" placeholder="请输入处方单号" class="form-control" type="text"  th:value="${prescriptionNumber}">
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+                    <div class="col-sm-4">
+                        <div class="form-group">
                             <label class="col-sm-4 control-label is-required">患者姓名:</label>
                             <div class="col-sm-8">
                                 <input name="patientName" placeholder="请输入患者姓名" class="form-control" type="text" maxlength="30" th:value="${patientName}" >
@@ -101,17 +122,7 @@
                 </div>
 
                 <div class="row">
-                    <div class="col-sm-4">
-                        <div class="form-group">
-                            <label class="col-sm-4 control-label">处方类型:</label>
-                            <div class="col-sm-8">
-                                <select name="prescriptionType" class="form-control" th:with="type=${@dict.getType('sys_select_prescription_ype')}">
-                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"
-                                            th:selected="${dict.dictValue}==${prescriptionType}"></option>
-                                </select>
-                            </div>
-                        </div>
-                    </div>
+
 
                     <div class="col-sm-4">
                         <div class="form-group">

+ 156 - 0
health-admin/src/main/resources/templates/dtp/recipe/huanzheBanding.html

@@ -0,0 +1,156 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+<head>
+	<meta charset="UTF-8">
+	<meta name="format-detection" content="telephone=no">
+	<th:block th:include="include :: header('绑定患者')" />
+	<th:block th:include="include :: layout-latest-css" />
+	<th:block th:include="include :: ztree-css" />
+</head>
+
+<body class="gray-bg">
+<div class="ui-layout-center">
+<input type="hidden" id="rowIds">
+	<div class="row">
+		<div class="col-sm-12 search-collapse">
+			<form id="tag-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" style="width: 300px;"/>
+						<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()">搜索</a>
+						<a class="btn btn-warning btn-rounded btn-sm" onclick="resetPre()">重置</a>
+					</div>
+				</div>
+
+			</form>
+		</div>
+
+	</div>
+	<div class="row">
+		<div class="col-sm-12 select-table table-striped">
+			<table id="bootstrap-table"></table>
+		</div>
+	</div>
+	<div class="row">
+	<div class="customize-form-group" style="justify-content: center;">
+		<button type="button"  onclick="addHuanZhe()" class="btn-primary">新建患者</button>
+	</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 viewFlag = [[${@permission.hasPermi('dtp:pmService:archivesList')}]];
+	var prefix = ctx + "dtp/pmService";
+	$(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 + "/slectPatientByNameOrPhone",
+			viewUrl: prefix + "/view/{id}",
+			modalName: "患者信息",
+			showFooter:true,  //是否显示表格底部区域。
+			clickToSelect: true, //是否启用点击行时选中整行的功能。
+			singleSelect: true, //是否仅允许选择一行
+			fixedColumns: true,
+			//fixedNumber: 3,
+			//fixedRightNumber: 1,
+			columns: [
+				{checkbox: true},
+				{field: "id",title: "id",visible: true,},
+				{field: 'name', title: '姓名', align: 'center'},
+				{field: 'gender', title: '性别', align: 'center'},
+				{field: 'age', title: '年龄', align: 'center'},
+				{field: 'phoneNumber', title: '手机号', align: 'center'},
+				{field: 'documentNumber', title: '证件号码', align: 'center'},
+				{field: 'storeName', title: '门店', align: 'center'},
+				]
+		};
+		$.table.init(options);
+	}
+
+	/* 自定义重置-表单重置/隐藏框/树节点选择色/搜索 */
+	function resetPre() {
+		resetDate();
+		$("#tag-form")[0].reset();
+		$("#deptId").val("");
+		$("#parentId").val("");
+		$(".curSelectedNode").removeClass("curSelectedNode");
+		$.table.search();
+	}
+	/* 添加用户-选择用户-提交(子页面调用父页面形式) */
+	function submitHandler(index, layero) {
+		debugger
+		var rows = $.table.selectFirstColumns();
+
+		if (rows.length == 0) {
+			$.modal.alertWarning("请至少选择一条记录");
+			return;
+		}
+		$.modal.close(index);
+		// 父页面的方法
+		// activeWindow().selectUsers();
+		// 父页面的变量
+		activeWindow().$('#userids').html('我是通过方式一来的:' + rows.join());
+
+	}
+
+	/* 添加用户-选择用户-提交(回调形式-父页面调用子页面) */
+	function getSelections() {
+		return $.table.selectFirstColumns();
+	}
+	// 获取 URL 中的查询参数
+	// var urlParams = new URLSearchParams(window.location.search);
+	// var returnedData = JSON.parse(decodeURIComponent(urlParams.get('data')));
+	// console.log("returnedData"+returnedData)
+	function selectTableObject() {
+		var id = $.table.selectColumns('id');
+		var name = $.table.selectColumns('name');
+		var phoneNumber = $.table.selectColumns('phoneNumber');
+		var documentNumber = $.table.selectColumns('documentNumber');
+		var gender = $.table.selectColumns('gender');
+		var age = $.table.selectColumns('age');
+		var column = [{id:id,name:name,phoneNumber:phoneNumber,documentNumber:documentNumber,gender:gender,age:age}];
+		return column;
+	}
+	$("#bootstrap-table").on("check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table", function (e, rowsAfter, rowsBefore) {
+		var rows = $.common.equals("uncheck-all", e.type) ? rowsBefore : rowsAfter;
+		var rowIds = $.table.affectedRowIds(rows);
+		$("#rowIds").val(rowIds);
+	});
+
+	function addHuanZhe(){
+		addNewHuanZhe();
+	}
+	function addNewHuanZhe(data){
+		var options = {
+			title: '新建患者',
+			url: prefix + "/archivesAdd",
+			width:1000,
+			//callBack: submitHandler
+		};
+		$.modal.openOptions(options);
+	}
+
+</script>
+</body>
+
+</html>

+ 118 - 7
health-admin/src/main/resources/templates/dtp/recipe/recipe.html

@@ -17,6 +17,7 @@
 							<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>
 					<form id="user-form" class="customize-search-form">
 						<div class="customize-form-group-container">
@@ -78,15 +79,13 @@
 		        	<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-primary single disabled" onclick="$.operate.editTab()" shiro:hasPermission="dtp:recipe:edit">
-			            <i class="fa fa-edit"></i> 修改
-			        </a>
 		            <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="sdtp:recipe:remove">
 		                <i class="fa fa-remove"></i> 删除
 		            </a>
-		            <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="dtp:recipe:export">
-			            <i class="fa fa-download"></i> 导出
-			        </a>
+<!--					<a class="btn btn-success" onclick="budan()">-->
+<!--						<i class="fa btn-primary"></i> 补单-->
+<!--					</a>-->
+						<button type="button"  onclick="budan()" class="btn-primary">补单</button>
 		        </div>
 
 				<div class="col-sm-12 select-table table-striped" style="width: 100%; overflow-x: auto;">
@@ -95,8 +94,52 @@
 
 			</div>
 		</div>
+
+	</div>
+	<div class="modal inmodal" id="myModal" tabindex="-1" role="dialog" aria-hidden="true">
+		<div class="modal-dialog">
+			<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>
+					</div>
+					<div class="modal-body">
+						<div class="customize-search-form">
+							<div class="rows">
+								<div class="input-group">
+									一次仅补录一个处方单,多个销售单号请分别依次补录
+								</div>
+							</div>
+							<div class="rows">
+								<div class="input-group">
+									<input type="text" placeholder="请输入订单号编号"  class="styled-input" style="width: 400px; height: 40px;"  id="saleOrderNumber" name="saleOrderNumber">
+								</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="saveBudDan()">补单</button>
+					</div>
+
+				</div>
+			</form>
+		</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" />
@@ -362,7 +405,75 @@
 			$(".curSelectedNode").removeClass("curSelectedNode");
 			$.table.search();
 		}
+		function budan(){
+			$('#myModal').modal('show');
+		}
+		function saveBudDan(){
+			if ($.validate.form("form-budan-add")) {
+				var data = $("#form-budan-add").serializeArray();
+				var saleOrderNumber= $("#saleOrderNumber").val();
+				console.log("saleOrderNumber="+saleOrderNumber);
+				console.log("data="+data);
+				// $.ajax({
+				// 	cache: true,
+				// 	type: "POST",
+				// 	url: prefix + "/budanSelect",
+				// 	data: data,
+				// 	async: false,
+				// 	error: function (data) {
+				// 		$.modal.alertError(data.msg);
+				// 	},
+				// 	success: function (data) {
+				// 		if(data.code==0){
+				// 			$('#budanshibai').hide();
+				// 		}else{
+				// 			$('#budanshibai').show();
+				// 		}
+				// 	}
+				// });
+			}
+			$('#budanshibai').show();
+		}
+
 	</script>
 </body>
-
+	<style>
+		.modal {
+		display: none;
+		position: fixed;
+		z-index: 1;
+		left: 0;
+		top: 0;
+		width: 100%;
+		height: 100%;
+		overflow: auto;
+		background-color: rgba(0,0,0,0.4);
+		}
+		.modalbudan{
+			display: none;
+		}
+		.modal-content {
+		background-color: #fefefe;
+		margin: 15% auto;
+		padding: 20px;
+		border: 1px solid #888;
+		width: 90%;
+		}
+		.close {
+		color: #aaa;
+		float: right;
+		font-size: 28px;
+		font-weight: bold;
+		}
+		.close:hover,
+		.close:focus {
+		color: black;
+		text-decoration: none;
+		cursor: pointer;
+		}
+		.error-message {
+			color: red;
+			display: none;
+		}
+</style>
 </html>

+ 520 - 0
health-admin/src/main/resources/templates/gxhpz/addRepurchasedGoods.html

@@ -0,0 +1,520 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('新增复购品')" />
+    <th:block th:include="include :: select2-css" />
+    <th:block th:include="include :: bootstrap-fileinput-css" />
+</head>
+<body>
+<div class="main-content">
+
+    <div class="form-horizontal">
+        <input type="hidden" id="id" name="id" th:value="${id}">
+        <div class="customize-form-group">
+            <label style="color:olive;font-size: 15px;">复购配置->关联D值品:</label>
+            <input name="dValueKey" placeholder="输入D值品名称或D值id查询" class="styled-input" type="text" id="dValueKeyInput">
+            <input name="dValueId" placeholder="D值品id" class="styled-input" type="text" readonly id="dValueIdInput">
+            <input name="dValueName" placeholder="D值品名称" class="styled-input" type="hidden" id="dValueName">
+            <button type="button" data-toggle="modal" data-target="#myModal" class="styled-input" style="width: 70px; color: #1E9FFF" id="addDvalueButton">新增D值</button>
+        </div>
+        <p class="pull-right">
+        <div class="customize-form-group">
+            <div class="panel-body">
+                <div class="form-group" id="formGroup">
+                    <div class="col-sm-12">
+                        <div class="col-sm-11" id="carGroup">
+                            <!-- 假设这是你的 HTML 结构 -->
+                            <div id="iboxContainer">
+                                <div class="ibox" id="data-ibox">
+                                    <div class="ibox-title">复购药品</div>
+                                    <div class="ibox-content">
+                                        <table class="table table-bordered" id="drugInfoTable">
+
+
+                                            <thead>
+                                            <tr>
+                                                <th>药品编码</th>
+                                                <th>药品名</th>
+                                                <th>通用名</th>
+                                                <th>规格</th>
+                                                <th>包装</th>
+                                                <th>厂家简称</th>
+                                                <th class="hidden-column">是否随访管理品</th>
+                                                <th class="hidden-column">是否冷链管理品</th>
+                                                <th class="hidden-column">是否登记管理品</th>
+                                                <th class="hidden-column">是否慈善援助管理品</th>
+                                                <th class="hidden-column">给药方式</th>
+                                                <th class="hidden-column">说明书适应症</th>
+                                                <th class="hidden-column">用法用量</th>
+                                                <th>操作+<a type="button"  onclick="selectUsersToParentCallBack2()">添加药品</a></th>
+                                            </tr>
+                                            </thead>
+                                            <tbody>
+                                            <!-- 数据行将被插入到这里 -->
+                                            </tbody>
+                                        </table>
+
+                                    </div>
+                                </div>
+                            </div>
+                        </div>
+
+                    </div>
+                </div>
+            </div>
+        </div>
+        </p>
+        <div class="center-block ibox-title" >
+            <label class="is-required">请选择提交方式:</label>
+<!--            th:checked="${dict.dictValue}==${status}"-->
+            <div class="input-groups" th:with="type=${@dict.getType('gxhpz_yppz_dzpztjfs')}">
+                <input type="radio" class="form-check-radio" th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}"  name="saveStatus" id="saveStatus">
+            </div>
+        </div>
+    </div>
+
+    <div class="modal inmodal" id="myModal" tabindex="-1" role="dialog" aria-hidden="true">
+        <div class="modal-dialog">
+            <form class="form-horizontal" id="form-relation-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">新增D值</h4>
+                    </div>
+                    <div class="modal-body">
+                        <div class="customize-search-form">
+                            <div class="customize-form-group edit">
+                                <label>D值品id</label>
+                                <div class="input-group">
+                                    <input type="text" placeholder="系统自动赋值" class="styled-input edit_inputs"  style="width: 350px;height: 50px;" id="dvauleId" name="dvauleid" disabled>
+                                </div>
+                            </div>
+                            <div class="customize-form-group edit">
+                                <label>D值品名称</label>
+                                <div class="input-group">
+                                    <input type="text" placeholder="=商品名&通用名&生产厂家简称" class="styled-input edit_inputs"  style="width: 350px; height: 50px;" id="dname" name="dname">
+                                </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="saveRow()">确定</button>
+                    </div>
+                </div>
+
+            </form>
+
+        </div>
+    </div>
+</div>
+
+<th:block th:include="include :: footer" />
+<th:block th:include="include :: select2-js" />
+<th:block th:include="include :: bootstrap-fileinput-js" />
+<script th:inline="javascript">
+    var prefix = ctx + "yppz/drugConfig";
+    var prefix_yp = ctx + "dtp/recipe";
+    var prefix_dzpz = ctx + "dzpz/dvalueConfig";
+    var data;
+    var hzparam =[];
+    var hzparam2 =[];
+    var dvauleid='';
+    var dname='';
+
+    // 定义一个函数来更新按钮的可见性
+    function updateButtonVisibility() {
+        var dValueId = $('#dValueIdInput').val().trim();
+        if (dValueId) {
+            $('#addDvalueButton').hide();
+        } else {
+            $('#addDvalueButton').show();
+        }
+    }
+    $(document).ready(function() {
+        // 假设pageData中有drugCode, productName等属性
+        var drugCode = /*[[${drugCode}]]*/ '';
+        var productName = /*[[${productName}]]*/ '';
+
+        console.log("Drug Code: " + drugCode);
+        console.log("Product Name: " + productName);
+
+        // 使用Thymeleaf的语法来获取后端传来的值
+        var drugData = /*[[${drugData}]]*/ {};
+if(drugData != null || drugData != undefined){
+    console.log("data===" + JSON.stringify(drugData));
+    var tableBody = $('#drugInfoTable tbody');
+    var row = `
+            <tr data-product-id="` + drugData.id + `">
+                <td>` + drugData.mdmCode + `</td>
+                <td>` + drugData.productName + `</td>
+                <td>` + drugData.genericName + `</td>
+                <td>` + drugData.specification + `</td>
+                <td>` + drugData.packaging + `</td>
+                <td>` + drugData.manufacturerShortName + `</td>
+
+                <td class="hidden-column">` + drugData.isFollowUpManaged + `</td>
+                <td class="hidden-column">` + drugData.isColdChainManaged + `</td>
+                <td class="hidden-column">` + drugData.isRegisteredManaged + `</td>
+                <td class="hidden-column">` + drugData.isCharityAidManaged + `</td>
+                <td class="hidden-column">` + drugData.administrationMethod + `</td>
+                <td class="hidden-column">` + drugData.indicationDescription + `</td>
+                <td class="hidden-column">` + drugData.dosageAndAdministration + `</td>
+                <td><button onclick="deleteRow('` + drugData.id + `')" class="btn btn-danger">删除</button></td>
+             </tr>`;
+
+    tableBody.append(row);
+}
+
+        let timeout;
+
+        // 监听 dValueKey 输入框的 input 事件
+        $('#dValueKeyInput').on('input', function() {
+            clearTimeout(timeout);
+            var query = $('#dValueKeyInput').val().trim();
+            console.log("query===="+query);
+            // 如果输入为空,清空 dValueId 输入框并停止进一步操作
+            if (!query) {
+                $('#dValueIdInput').val('');
+                $('#dValueName').val('');
+
+                updateButtonVisibility(); // 更新按钮可见性
+                return;
+            }
+
+            // 使用防抖机制延迟发送请求
+            timeout = setTimeout(() => {
+                // 发送 AJAX 请求到服务器查询数据
+                hzparam={query:query};//模拟微信扫码获取微信openId
+                console.log("hzparam===="+hzparam);
+                var tableBody = $('#drugInfoTable tbody');
+                // 清空表格中的所有数据行
+               // $('#drugInfoTable tbody').empty();
+                $.ajax({
+                    cache: true,
+                    type: "POST",
+                    url: prefix_dzpz+'/searchDvalue', // 替换为实际的搜索 URL
+                    data: hzparam,
+                    async: false,
+                    success: function (data) {
+                        console.log("data===="+data);
+                        if(data.code==0){
+
+                            // 如果找到匹配的数据,更新 dValueId 输入框
+                            $('#dValueIdInput').val(data.data.dValueCode);
+                            $('#dValueKeyInput').val(data.data.dValueCode);
+
+                            updateButtonVisibility(); // 更新按钮可见性
+            //                 var row = `
+            //     <tr data-product-id="${data.data.id}">
+            //         <td>${data.data.mdmCode}</td>
+            //         <td>${data.data.productName}</td>
+            //         <td>${data.data.genericName}</td>
+            //         <td>${data.data.specification}</td>
+            //          <td>${data.data.packaging}</td>
+            //         <td>${data.data.manufacturerShortName}</td>
+            //          <td class="hidden-column">${data.isFollowUpManaged}</td>
+            //         <td class="hidden-column">${data.isColdChainManaged}</td>
+            //         <td class="hidden-column">${data.isRegisteredManaged}</td>
+            //         <td class="hidden-column">${data.isCharityAidManaged}</td>
+            //         <td class="hidden-column">${data.administrationMethod}</td>
+            //         <td class="hidden-column">${data.indicationDescription}</td>
+            //         <td class="hidden-column">${data.dosageAndAdministration}</td>
+            //         <td><button onclick="deleteRow('${data.data.id}')" class="btn btn-danger">删除</button></td>
+            //     </tr>
+            // `;
+            //                 tableBody.append(row);
+                        }else{
+                            // 清空表格中的所有数据行
+                           // $('#drugInfoTable tbody').empty();
+                            // 如果没有找到匹配的数据,清空 dValueId 输入框
+                            $('#dValueIdInput').val('');
+                            updateButtonVisibility(); // 更新按钮可见性
+                        }
+
+                    },
+                    error: function(error) {
+                        // 清空 dValueId 输入框
+                        $('#dValueIdInput').val('');
+                    }
+                });
+
+            }, 360); // 300ms 的延迟
+        });
+        // 页面加载时检查 dValueIdInput 的初始状态
+        updateButtonVisibility();
+    });
+
+    function submitHandler() {
+        submitDrugInfo();
+    }
+    // callBack获取父窗口方法(方式二) $('#myModal').modal('show');  $('#myModal').modal('hide');  $.modal.close(); openId = document.getElementById('openId').value;
+    function selectUsersToParentCallBack2(){
+        var options = {
+            title: '药品信息',
+            width: 1000,
+            height: 600,
+            url: prefix + '/allDrugsInfo',
+            callBack: doSubmit2
+        };
+        $.modal.openOptions(options);
+    }
+
+    function doSubmit2(index, layero){
+        var rows = layero.find("iframe")[0].contentWindow.selectTableObject();
+        if (rows.length == 0) {
+            $.modal.alertWarning("请至少选择一条记录");
+            return;
+        }
+
+        var tableBody = $('#drugInfoTable tbody');
+
+        rows.forEach(function(item) {
+            // 检查是否已经存在该药品
+            if (!isProductExist(item.productId)) {
+                // 向表格中添加一行
+                var row = `
+                <tr data-product-id="${item.productId}">
+                    <td>${item.mdmCode}</td>
+                    <td>${item.productName}</td>
+                    <td>${item.genericName}</td>
+                    <td>${item.specification}</td>
+                     <td>${item.packaging}</td>
+                    <td>${item.manufacturerShortName}</td>
+                    <td class="hidden-column">${item.isFollowUpManaged}</td>
+                    <td class="hidden-column">${item.isColdChainManaged}</td>
+                    <td class="hidden-column">${item.isRegisteredManaged}</td>
+                    <td class="hidden-column">${item.isCharityAidManaged}</td>
+                    <td class="hidden-column">${item.administrationMethod}</td>
+                    <td class="hidden-column">${item.indicationDescription}</td>
+                    <td class="hidden-column">${item.dosageAndAdministration}</td>
+
+                    <td><button onclick="deleteRow('${item.productId}')" class="btn btn-danger">删除</button></td>
+                </tr>
+            `;
+
+                tableBody.append(row);
+            } else {
+                $.modal.alertWarning(`药品 ${item.productName} 已经添加了`);
+            }
+        });
+
+        $.modal.close(index);
+    }
+
+    function deleteRow(productId) {
+        // 删除对应行
+        $('#drugInfoTable tbody tr[data-product-id="' + productId + '"]').remove();
+    }
+
+    function isProductExist(productId) {
+        // 检查表格中是否已经存在该药品
+        return $('#drugInfoTable tbody tr[data-product-id="' + productId + '"]').length > 0;
+    }
+
+    function submitDrugInfo() {
+        debugger
+       // $('#dValueIdInput').val('');
+        var dValueId = $('#dValueIdInput').val().trim();
+        if (!dValueId) {
+            $.modal.alertWarning("请输入有效的D值id");
+            return;
+        }
+        var flag = false;
+        var submitMethod1="/savedvalueconfig";
+        var submitMethod2="/dvalueconfigEdit";
+       var saveStatus = $('#saveStatus').val()
+        console.log("saveStatus===="+saveStatus);
+        if(saveStatus =='' || saveStatus ==undefined){
+            $.modal.alertWarning("请选择提交方式");
+            return false;
+        }
+
+        // 收集表格中的所有数据
+        var drugData = [];
+        $('#drugInfoTable tbody tr').each(function() {
+            var row = $(this);
+            drugData.push({
+                mdmCode: row.find('td').eq(0).text().trim(),
+                productName: row.find('td').eq(1).text().trim(),
+                genericName: row.find('td').eq(2).text().trim(),
+                specification: row.find('td').eq(3).text().trim(),
+                manufacturerShortName: row.find('td').eq(4).text().trim(),
+
+                isFollowUpManaged: row.find('td').eq(5).text().trim(),
+                isColdChainManaged: row.find('td').eq(6).text().trim(),
+                isRegisteredManaged: row.find('td').eq(7).text().trim() ,
+                isCharityAidManaged: row.find('td').eq(8).text().trim(),
+                administrationMethod: row.find('td').eq(9).text().trim(),
+                indicationDescription: row.find('td').eq(10).text().trim(),
+                dosageAndAdministration: row.find('td').eq(11).text().trim(),
+                productId: row.data('product-id')
+            });
+        });
+
+        // 创建一个 FormData 对象用于提交表单数据
+        var formData = new FormData();
+        formData.append('saveStatus', $('#saveStatus').val());
+        formData.append('dValueId', dValueId);
+        // 将药物数据序列化为 JSON 字符串并添加到 FormData 中
+        if(drugData.length>=2){
+            $.modal.alertWarning("单次只能添加一个药品");
+            return false;
+        }
+        formData.append('drugData', JSON.stringify(drugData));
+
+        // 发送 AJAX 请求或构建表单进行提交
+        $.ajax({
+            url: prefix_dzpz + "/savedvalueconfig",
+            method: 'POST',
+            data: formData,
+            processData: false,  // 不处理数据,因为 data 已经是字符串
+            contentType: false,  // 不设置内容类型,让浏览器自动设置
+            success: function(response) {
+                console.log('提交成功ok:', response);
+                $.modal.msgSuccess(response.msg);
+                $.modal.close();
+                $.operate.successCallback(response);
+                // 处理成功响应...
+            },
+            error: function(error) {
+                $.modal.alertError("失败");
+                console.error('提交失败:', error);
+                // 处理错误响应...
+            }
+        });
+    }
+    function saveRow() {
+        // 获取表单数据 form-relation-add relationTable 联系人电话 lxrdh 联系人姓名 lxrxm 联系人关系 lxrgx
+        dname = document.getElementById('dname').value;
+        //dvauleid = document.getElementById('dvauleid').value;
+        // 检查数据是否为空
+        if (!dname) {
+            $.modal.alert('请填写D值名称');
+            return;
+        }
+        hzparam2={nameValue:dname};
+        console.log("hzparam========"+hzparam)
+        $.ajax({
+            cache: true,
+            type: "POST",
+            url: prefix_dzpz + "/createDVauleId",
+            data: hzparam2,
+            async: false,
+            success: function (data) {
+                if(data.code==0){
+                    dvauleid = data.data.dvauleid;
+                    // 如果找到匹配的数据,更新 dValueId 输入框
+                    $('#dValueIdInput').val(data.data.dvauleid);
+                    $('#dValueKeyInput').val(data.data.dValueName);
+                    flag = true;
+                    // 关闭模态框
+                    $('#myModal').modal('hide');
+                    //$.modal.close();
+                }else{
+                    $('#dValueIdInput').val("");
+                    $('#dValueKeyInput').val("");
+                    $.modal.alertError(data.msg);
+                }
+
+            } ,error: function (request) {
+                $.modal.alertError("提交失败");
+            },
+        });
+
+    }
+
+</script>
+<style>
+    .center-block {
+        display: block;
+        margin-left: auto;
+        margin-right: auto;
+        width: fit-content;
+    }
+    .hidden {
+        display: none;
+    }
+    .ibox {
+        width: 700px;
+        margin-bottom: 20px;
+        border: 1px solid #e7eaec;
+        border-radius: 4px;
+    }
+    .ibox-title {
+        background-color: #f3f3f4;
+        border-bottom: 1px solid #e7eaec;
+        padding: 10px 15px;
+        font-size: 16px;
+    }
+    .ibox-content {
+        padding: 15px;
+    }
+    .ibox-content h4 {
+        margin-top: 0;
+    }
+    .customize-form-group2 {
+        display: inline-block;
+    }
+    .styled-input2 {
+        padding: 5px;
+        border: 1px solid #ccc;
+        border-radius: 4px;
+        width: 200px;
+    }
+    .styled-input3 {
+        display: inline-block;
+        padding: 5px;
+        border: 1px solid #ccc;
+        border-radius: 4px;
+        width: 100px;
+    }
+    .styled-input4 {
+        display: inline-block;
+        padding: 5px;
+        border: 1px solid #ccc;
+        border-radius: 4px;
+        width: 100px;
+    }
+    .col-sm-6 {
+        width: 125%;
+    }
+    .form-horizontal .form-group {
+        margin-right: 384px;
+        margin-left: 3px;
+    }
+    input[type=file] {
+        display: none;
+    }
+    .form-group {
+        margin-bottom: -1px;
+    }
+    /* 添加一些基础样式 */
+    body {
+        font-family: Arial, sans-serif;
+    }
+    table {
+        width: 400px;
+        border-collapse: collapse;
+    }
+    th, td {
+        text-align: left;
+        padding: 8px;
+        border-bottom: 1px solid #ddd;
+    }
+    tr:nth-child(even) {
+        width: 15px;
+        background-color: #f2f2f2;
+    }
+    .hidden-column {
+        display: none;
+    }
+</style>
+</body>
+</html>
+
+
+
+

+ 366 - 0
health-admin/src/main/resources/templates/gxhpz/allDrugsInfo.html

@@ -0,0 +1,366 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+<head>
+	<meta charset="UTF-8">
+	<th:block th:include="include :: header('药品库信息')" />
+	<th:block th:include="include :: layout-latest-css" />
+	<th:block th:include="include :: ztree-css" />
+</head>
+
+<body><div class="main-content">
+
+
+				<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>
+						<form id="tag-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="请输入MDM编码或药品商品名/通用名" name="query" style="width: 350px;"/>
+								</div>
+
+								<div class="customize-form-group">
+									<label>厂家简称:</label>
+									<input type="text" class="styled-input" placeholder="请输入厂家简称" name="manufacturerShortName" style="width: 350px;"/>
+								</div>
+							</div>
+						</form>
+					</div>
+
+				</div>
+				<div class="row">
+					<div class="col-sm-12 select-table table-striped">
+						<table id="bootstrap-table"></table>
+					</div>
+				</div>
+</div>
+
+<th:block th:include="include :: footer" />
+<script th:inline="javascript">
+	var viewFlag = [[${@permission.hasPermi('dtp:configInfo:list')}]];
+	var prefix = ctx + "yppz/drugConfig";
+
+	$(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 + "/getAllDrugs",
+			viewUrl: prefix + "/view/{id}",
+			exportUrl: prefix + "/export",
+			//sortName: "createTime",
+			//sortOrder: "desc",
+			modalName: "药品信息",
+			showFooter:true,  //是否显示表格底部区域。
+			clickToSelect: true, //是否启用点击行时选中整行的功能。
+			singleSelect: true, //是否仅允许选择一行
+			fixedColumns: true,
+			//fixedNumber: 3,
+			//fixedRightNumber: 1,
+			columns: [{
+				checkbox: true
+			},
+				{
+					field: "id",
+					title: "id",
+					align: 'center', visible: false
+				},
+				{
+					"field": "mdmCode",
+					"title": "MDM编码"
+				},{
+					"field": "productName",
+					"title": "药品商品名"
+				},{
+					"field": "genericName",
+					"title": "药品通用名"
+				},{
+					"field": "specification",
+					"title": "规格"
+				},{
+					"field": "manufacturerShortName",
+					"title": "厂家简称"
+				},
+				{
+					"field": "manufacturer",
+					"title": "生产厂家"
+				},
+				{
+					"field": "packaging",
+					"title": "包装"
+				},
+				{
+					"field": "isFollowUpManaged",
+					"title": "是否随访管理品 (1: 是, 0: 否)",
+					align: 'center', visible: false
+				},
+				{
+					"field": "isColdChainManaged",
+					"title": "是否冷链管理品 (1: 是, 0: 否)",
+					align: 'center', visible: false
+				},
+				{
+					"field": "isRegisteredManaged",
+					"title": "是否登记管理品 (1: 是, 0: 否)",
+					align: 'center', visible: false
+				},
+				{
+					"field": "isCharityAidManaged",
+					"title": "是否慈善援助管理品 (1: 是, 0: 否)",
+					align: 'center', visible: false
+				},
+				{
+					"field": "administrationMethod",
+					"title": "给药方式",
+					align: 'center', visible: false
+				},
+				{
+					"field": "enterpriseFlowManagement",
+					"title": "企业流向管理方式",
+					align: 'center', visible: false
+				},
+				{
+					"field": "indicationDescription",
+					"title": "说明书适应症",
+					align: 'center', visible: false
+				},
+				{
+					"field": "dosageAndAdministration",
+					"title": "用法用量",
+					align: 'center', visible: false
+				},
+				// {
+				// 	"field": "isColdChainDrug",
+				// 	"title": "是否冷链药品(1: 是, 0: 否)"
+				// },
+				// {
+				// 	"field": "dtpProduct",
+				// 	"title": "DTP商品(D)(1: 是, 0: 否)"
+				// },
+				// {
+				// 	"field": "usageMethod",
+				// 	"title": "用药方法"
+				// },
+				{
+					"field": "creator",
+					"title": "创建人",
+					align: 'center', visible: false
+				},
+				{
+					"field": "createTime",
+					"title": "创建时间",
+					align: 'center', visible: false
+				},
+				{
+					"field": "updater",
+					"title": "更新人",
+					align: 'center', visible: false
+				},
+				{
+					"field": "updatedTime",
+					"title": "更新时间"
+				},
+				// {
+				// 	"field": "marketingAuthorizationHolder",
+				// 	"title": "上市许可证持有人"
+				// },
+				// {
+				// 	"field": "entrustedManufacturer",
+				// 	"title": "委托厂家"
+				// },
+				// {
+				// 	"field": "productionLicenseNumber",
+				// 	"title": "生产许可证号/备案"
+				// },
+				// {
+				// 	"field": "formulationSpecification",
+				// 	"title": "制剂规格"
+				// },
+
+				// {
+				// 	"field": "dosageFormCode",
+				// 	"title": "剂型代码"
+				// },
+				// {
+				// 	"field": "approvalNumber",
+				// 	"title": "批准文号1"
+				// },
+				// {
+				// 	"field": "approvalNumberExpiryDate",
+				// 	"title": "批准文号1有效期"
+				// },
+				// {
+				// 	"field": "storageConditions",
+				// 	"title": "存储条件"
+				// },
+
+				// {
+				// 	"field": "targetPopulation",
+				// 	"title": "用药人群"
+				// },
+				// {
+				// 	"field": "genderRestrictions",
+				// 	"title": "用药性别"
+				// },
+				// {
+				// 	"field": "dosageAndAdministration",
+				// 	"title": "用法用量"
+				// },
+				// {
+				// 	"field": "indications",
+				// 	"title": "适应症"
+				// },
+				// {
+				// 	"field": "drugInteractions",
+				// 	"title": "药物相互作用"
+				// },
+				// {
+				// 	"field": "adverseReactions",
+				// 	"title": "不良反应"
+				// },
+				// {
+				// 	"field": "contraindications",
+				// 	"title": "禁忌症"
+				// },
+				// {
+				// 	"field": "precautions",
+				// 	"title": "注意事项"
+				// },
+				// {
+				// 	"field": "pregnancyAndLactation",
+				// 	"title": "孕妇及哺乳期妇女用药"
+				// },
+				// {
+				// 	"field": "pediatricUsage",
+				// 	"title": "儿童用药"
+				// },
+				// {
+				// 	"field": "geriatricUsage",
+				// 	"title": "老年患者用药"
+				// },
+				// {
+				// 	"field": "drugOverdose",
+				// 	"title": "药物过量"
+				// },
+				// {
+				// 	"field": "clinicalTrials",
+				// 	"title": "临床试验"
+				// },
+				// {
+				// 	"field": "pharmacologyToxicology",
+				// 	"title": "药理毒理"
+				// },
+				// {
+				// 	"field": "pharmacokinetics",
+				// 	"title": "药代动力学"
+				// },
+
+				{
+					"field": "status",
+					"title": "状态",
+				formatter: function(value, row, index) {
+			    switch (value) {
+					case 0:
+						return '停用';
+						break;
+					case 1:
+						return '启用';
+						break;
+					default:
+						return '-';
+			}
+		}
+				}]
+		};
+		$.table.init(options);
+	}
+
+	/* 自定义重置-表单重置/隐藏框/树节点选择色/搜索 */
+	function resetPre() {
+		resetDate();
+		$("#tag-form")[0].reset();
+		$("#deptId").val("");
+		$("#parentId").val("");
+		$(".curSelectedNode").removeClass("curSelectedNode");
+		$.table.search();
+	}
+	/* 添加用户-选择用户-提交(子页面调用父页面形式) */
+	function submitHandler(index, layero) {
+		debugger
+		var rows = $.table.selectFirstColumns();
+
+		if (rows.length == 0) {
+			$.modal.alertWarning("请至少选择一条记录");
+			return;
+		}
+		$.modal.close();
+		// 父页面的方法
+		// activeWindow().selectUsers();
+		// 父页面的变量
+		activeWindow().$('#userids').html('我是通过方式一来的:' + rows.join());
+	}
+
+	/* 添加用户-选择用户-提交(回调形式-父页面调用子页面) */
+	function getSelections() {
+		return $.table.selectFirstColumns();
+	}
+
+	function selectTableObject() {
+		var productName = $.table.selectColumns('productName');
+		var mdmCode = $.table.selectColumns('mdmCode');
+		var genericName = $.table.selectColumns('genericName');
+		var specification = $.table.selectColumns('specification');
+		var packaging = $.table.selectColumns('packaging');
+		var manufacturerShortName = $.table.selectColumns('manufacturerShortName');
+		var isFollowUpManaged = $.table.selectColumns('isFollowUpManaged');
+		var isColdChainManaged = $.table.selectColumns('isColdChainManaged');
+		var isRegisteredManaged = $.table.selectColumns('isRegisteredManaged');
+		var isCharityAidManaged = $.table.selectColumns('isCharityAidManaged');
+		var administrationMethod = $.table.selectColumns('administrationMethod');
+		var dosageAndAdministration = $.table.selectColumns('dosageAndAdministration');
+		var indicationDescription = $.table.selectColumns('indicationDescription');
+		var productId = $.table.selectColumns('id');
+		var column = [{productName:productName,genericName:genericName,
+			mdmCode:mdmCode,specification:specification,
+			packaging:packaging,manufacturerShortName:manufacturerShortName,
+			isFollowUpManaged:isFollowUpManaged,isColdChainManaged:isColdChainManaged,
+			isRegisteredManaged:isRegisteredManaged,isCharityAidManaged:isCharityAidManaged,
+			administrationMethod:administrationMethod,indicationDescription:indicationDescription,
+			dosageAndAdministration:dosageAndAdministration,
+			productId:productId}];
+		return column;
+	}
+	/*回调返回所有的选中行数据*/
+	function selectColumns2() {
+		return $.table.selectColumns2();
+	}
+	$("#bootstrap-table").on("check.bs.table check-all.bs.table uncheck.bs.table uncheck-all.bs.table", function (e, rowsAfter, rowsBefore) {
+		var rows = $.common.equals("uncheck-all", e.type) ? rowsBefore : rowsAfter;
+		var rowIds = $.table.affectedRowIds(rows);
+		$("#rowIds").val(rowIds);
+	});
+</script>
+</body>
+
+</html>

+ 125 - 0
health-admin/src/main/resources/templates/gxhpz/drugconfigAdd.html

@@ -0,0 +1,125 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('门店积分商品列表新增')" />
+    <th:block th:include="include :: ztree-css" />
+</head>
+<body class="white-bg">
+<div class="wrapper wrapper-content animated fadeInRight ibox-content">
+    <form id="form-SSpglJfspProductinfo-add" class="customize-search-form">
+        <div class="customize-form-group-container">
+            <div class="customize-form-group">
+                <label class="is-required">药品编码:</label>
+                <input name="mdmCode" placeholder="请输入药品编码" id="mdmCode" class="styled-input" type="text" required>
+            </div>
+            <div class="customize-form-group">
+                <label>D值品编码:</label>
+                <input name="dValueCode" placeholder="请输入D值品编码" id="dValueCode" class="styled-input" type="text">
+            </div>
+            <div class="customize-form-group">
+                <label>D值品名称:</label>
+                <input name="dValueName" placeholder="请输入D值品名称" id="dValueName" class="styled-input" type="text">
+            </div>
+            <div class="customize-form-group">
+                <label>规格:</label>
+                <input name="specification" placeholder="请输入规格" id="specification" class="styled-input" type="text">
+            </div>
+            <div class="customize-form-group">
+                <label>包装:</label>
+                <input name="packaging" placeholder="请输入包装" id="packaging" class="styled-input" type="text">
+            </div>
+            <div class="customize-form-group">
+                <label class="is-required">通用名:</label>
+                <input name="genericName" placeholder="请输入通用名" id="genericName" class="styled-input" type="text" required>
+            </div>
+            <div class="customize-form-group">
+                <label class="is-required">商品名:</label>
+                <input name="productName" placeholder="请输入商品名" id="productName" class="styled-input" type="text" required>
+            </div>
+
+
+            <div class="customize-form-group">
+                <label>厂家简称:</label>
+                <input name="manufacturerShortName" placeholder="请输入厂家简称" id="manufacturerShortName" class="styled-input" type="text">
+            </div>
+            <div class="customize-form-group">
+                <label>是否随访管理品:</label>
+                <select name="isFollowUpManaged" id="isFollowUpManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
+                    <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>
+                <select name="isColdChainManaged" id="isColdChainManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
+                    <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>
+                <select name="isRegisteredManaged" id="isRegisteredManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
+                    <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>
+                <select name="isCharityAidManaged" id="isCharityAidManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
+                    <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>
+                <select name="administrationMethod" id="administrationMethod" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_yyff')}">
+                    <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>
+                <select name="enterpriseFlowManagement" id="enterpriseFlowManagement" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yppz_qylxglfs')}">
+                    <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>
+                <select name="status" id="status" class="styled-input" th:with="type=${@dict.getType('sys_hzgl_qyty_status')}">
+                    <option value="">请选择</option>
+                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
+                </select>
+            </div>
+        </div>
+    </form>
+</div>
+<th:block th:include="include :: footer" />
+<th:block th:include="include :: ztree-js" />
+<script type="text/javascript">
+
+    function submitHandler() {
+        if ($.validate.form()) {
+            add();
+        }
+    }
+
+    function add() {
+        var data = $("#form-SSpglJfspProductinfo-add").serializeArray();
+        $.ajax({
+            cache : true,
+            type : "POST",
+            url : ctx + "yppz/drugConfig/savedrugConfig",
+            data : data,
+            async : false,
+            error : function(request) {
+                $.modal.alertError("失败");
+            },
+            success : function(data) {
+                $.operate.successCallback(data);
+            }
+        });
+    }
+</script>
+</body>
+</html>

+ 126 - 0
health-admin/src/main/resources/templates/gxhpz/drugconfigDetail.html

@@ -0,0 +1,126 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+	<th:block th:include="include :: header('药品配置详情')" />
+	<th:block th:include="include :: jsonview-css" />
+</head>
+<body class="white-bg">
+	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
+	<form class="form-horizontal m-t" id="signupForm" th:object="${detail}" style="font-family: SimSun;font-size: 16px;">
+		<div class="row">
+			<!-- 第一列 -->
+			<div class="col-sm-6">
+				<div class="form-group">
+					<label class="col-sm-4 control-label">商品名:</label>
+					<div class="col-sm-8 form-control-static" th:text="${productName}"></div>
+				</div>
+				<div class="form-group">
+					<label class="col-sm-4 control-label">通用名:</label>
+					<div class="col-sm-8 form-control-static" th:text="${genericName}"></div>
+				</div>
+
+				<div class="form-group">
+					<label class="col-sm-4 control-label">药品编码:</label>
+					<div class="col-sm-8 form-control-static" th:text="${mdmCode}"></div>
+				</div>
+				<div class="form-group">
+					<label class="col-sm-4 control-label">D值品编码:</label>
+					<div class="col-sm-8 form-control-static" th:text="${dValueCode}"></div>
+				</div>
+				<div class="form-group">
+					<label class="col-sm-4 control-label">D值品名称:</label>
+					<div class="col-sm-8 form-control-static" th:text="${dValueName}"></div>
+				</div>
+
+				<div class="form-group">
+					<label class="col-sm-4 control-label">说明书适应症:</label>
+					<div class="col-sm-8 form-control-static" th:text="${indicationDescription}"></div>
+				</div>
+				<div class="form-group">
+					<label class="col-sm-4 control-label">厂家:</label>
+					<div class="col-sm-8 form-control-static" th:text="${manufacturer}"></div>
+				</div>
+
+				<div class="form-group">
+					<label class="col-sm-4 control-label">包装:</label>
+					<div class="col-sm-8 form-control-static" th:text="${packaging}"></div>
+				</div>
+			</div>
+
+			<!-- 第二列 -->
+			<div class="col-sm-6">
+				<div class="form-group">
+					<label class="col-sm-4 control-label">规格:</label>
+					<div class="col-sm-8 form-control-static" th:text="${specification}"></div>
+				</div>
+
+				<div class="form-group">
+					<label class="col-sm-4 control-label">是否随访管理品:</label>
+					<div class="col-sm-8 form-control-static" th:text="${isFollowUpManaged == 1 ? '是' : '否'}"></div>
+				</div>
+				<div class="form-group">
+					<label class="col-sm-4 control-label">是否冷链管理品:</label>
+					<div class="col-sm-8 form-control-static" th:text="${isColdChainManaged == 1 ? '是' : '否'}"></div>
+				</div>
+				<div class="form-group">
+					<label class="col-sm-4 control-label">是否登记管理品:</label>
+					<div class="col-sm-8 form-control-static" th:text="${isRegisteredManaged == 1 ? '是' : '否'}"></div>
+				</div>
+				<div class="form-group">
+					<label class="col-sm-4 control-label">是否慈善援助管理品:</label>
+					<div class="col-sm-8 form-control-static" th:text="${isCharityAidManaged == 1 ? '是' : '否'}"></div>
+				</div>
+				<div class="form-group">
+					<label class="col-sm-4 control-label">企业流向管理方式:</label>
+					<div class="col-sm-8 form-control-static" th:text="${enterpriseFlowManagement}"></div>
+				</div>
+				<div class="form-group">
+					<label class="col-sm-4 control-label">厂家简称:</label>
+					<div class="col-sm-8 form-control-static" th:text="${manufacturerShortName}"></div>
+				</div>
+
+
+<!--				<div class="form-group">-->
+<!--					<label class="col-sm-4 control-label">给药方式:</label>-->
+<!--					<div class="col-sm-8 form-control-static" th:text="${administrationMethod}"></div>-->
+<!--				</div>-->
+<!--				<div class="form-group">-->
+<!--					<label class="col-sm-4 control-label">创建人:</label>-->
+<!--					<div class="col-sm-8 form-control-static" th:text="${createdBy}"></div>-->
+<!--				</div>-->
+<!--				<div class="form-group">-->
+<!--					<label class="col-sm-4 control-label">创建时间:</label>-->
+<!--					<div class="col-sm-8 form-control-static" th:text="${#temporals.format(createdTime, 'yyyy-MM-dd HH:mm:ss')}"></div>-->
+<!--				</div>-->
+<!--				<div class="form-group">-->
+<!--					<label class="col-sm-4 control-label">更新人:</label>-->
+<!--					<div class="col-sm-8 form-control-static" th:text="${updatedBy}"></div>-->
+<!--				</div>-->
+				<div class="form-group">
+					<label class="col-sm-4 control-label">更新时间:</label>
+					<div class="col-sm-8 form-control-static" th:text="${#temporals.format(updatedTime, 'yyyy-MM-dd HH:mm:ss')}"></div>
+				</div>
+<!--				<div class="form-group">-->
+<!--					<label class="col-sm-4 control-label">状态:</label>-->
+<!--					<div class="col-sm-8 form-control-static" th:text="${status == 1 ? '启用' : '停用'}"></div>-->
+<!--				</div>-->
+			</div>
+		</div>
+	</form>
+    </div>
+    <th:block th:include="include :: footer" />
+    <th:block th:include="include :: jsonview-js" />
+    <script th:inline="javascript">
+		$(function() {
+			debugger
+			// var operParam = [[${oorderData}]];
+			// if ($.common.isNotEmpty(operParam) && operParam.length < 2000) {
+			// 	$("#operParam").JSONView(operParam);
+			// } else {
+			// 	$("#operParam").text(operParam);
+			// }
+
+		});
+    </script>
+</body>
+</html>

+ 127 - 0
health-admin/src/main/resources/templates/gxhpz/drugconfigEdit.html

@@ -0,0 +1,127 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('门店积分商品列表修改')" />
+</head>
+<body>
+<div class="ui-layout-center">
+    <form id="form-SSpglJfspProductinfo-edit" class="customize-search-form">
+
+        <div class="customize-form-group-container">
+            <input type="hidden" id="id" name="id" th:value="${id}">
+            <div class="customize-form-group">
+                <label class="is-required">药品编码:</label>
+                <input name="mdmCode" placeholder="药品编码" th:value="${mdmCode}" class="styled-input" type="text" disabled>
+            </div>
+            <div class="customize-form-group">
+                <label>D值品编码:</label>
+                <input name="dValueCode" placeholder="D值品编码" th:value="${dValueCode}" class="styled-input" type="text" disabled>
+            </div>
+            <div class="customize-form-group">
+                <label>D值品名称:</label>
+                <input name="dValueName" placeholder="D值品名称" th:value="${dValueName}" class="styled-input" type="text" disabled>
+            </div>
+            <div class="customize-form-group">
+                <label>规格:</label>
+                <input name="specification" placeholder="规格" th:value="${specification}" class="styled-input" type="text" disabled>
+            </div>
+            <div class="customize-form-group">
+                <label>包装:</label>
+                <input name="packaging" placeholder="包装" th:value="${packaging}" class="styled-input" type="text" disabled>
+            </div>
+
+            <div class="customize-form-group">
+                <label class="is-required">通用名:</label>
+                <input name="genericName" placeholder="通用名" th:value="${genericName}" class="styled-input" type="text" disabled>
+            </div>
+            <div class="customize-form-group">
+                <label class="is-required">商品名:</label>
+                <input name="productName" placeholder="请输入商品名" th:value="${productName}" class="styled-input" type="text" required>
+            </div>
+            <div class="customize-form-group">
+                <label>厂家简称:</label>
+                <input name="manufacturerShortName" placeholder="请输入厂家简称" th:value="${manufacturerShortName}" class="styled-input" type="text">
+            </div>
+            <div class="customize-form-group">
+                <label>是否随访管理品:</label>
+                <select name="isFollowUpManaged" id="isFollowUpManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}" th:value="${isFollowUpManaged}" disabled>
+                    <option value="">请选择</option>
+                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"  th:selected="${dict.dictValue}==${isFollowUpManaged}"></option>
+                </select>
+            </div>
+            <div class="customize-form-group">
+                <label>是否冷链管理品:</label>
+                <select name="isColdChainManaged" id="isColdChainManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}" th:value="${isColdChainManaged}" disabled>
+                    <option value="">请选择</option>
+                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${dict.dictValue}==${isColdChainManaged}"></option>
+                </select>
+            </div>
+            <div class="customize-form-group">
+                <label>是否登记管理品:</label>
+                <select name="isRegisteredManaged" id="isRegisteredManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}" th:value="${isRegisteredManaged}" required>
+                    <option value="">请选择</option>
+                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${dict.dictValue}==${isRegisteredManaged}"></option>
+                </select>
+            </div>
+            <div class="customize-form-group">
+                <label>是否慈善援助管理品:</label>
+                <select name="isCharityAidManaged" id="isCharityAidManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}" th:value="${isCharityAidManaged}" disabled>
+                    <option value="">请选择</option>
+                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${dict.dictValue}==${isCharityAidManaged}"></option>
+                </select>
+            </div>
+            <div class="customize-form-group">
+                <label>给药方式:</label>
+                <select name="administrationMethod" id="administrationMethod" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_yyff')}" th:value="${administrationMethod}" disabled>
+                    <option value="">请选择</option>
+                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${dict.dictLabel}==${administrationMethod}"></option>
+                </select>
+            </div>
+            <div class="customize-form-group">
+                <label>企业流向管理方式:</label>
+                <select name="enterpriseFlowManagement" id="enterpriseFlowManagement" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yppz_qylxglfs')}" th:value="${enterpriseFlowManagement}" disabled>
+                    <option value="">请选择</option>
+                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${dict.dictValue}==${enterpriseFlowManagement}"></option>
+                </select>
+            </div>
+            <div class="customize-form-group">
+                <label>状态:</label>
+                <select name="status" id="status" class="styled-input" th:with="type=${@dict.getType('sys_hzgl_qyty_status')}" th:value="${status}" disabled>
+                    <option value="">请选择</option>
+                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${dict.dictValue}==${status}"></option>
+                </select>
+            </div>
+        </div>
+    </form>
+</div>
+<div class="main-content">
+    <div class="col-sm-offset-5 col-sm-10">
+    </div>
+</div>
+<th:block th:include="include :: footer" />
+</body>
+</html>
+<script>
+    function edit() {
+        var data = $("#form-SSpglJfspProductinfo-edit").serializeArray();
+        $.ajax({
+            cache : true,
+            type : "POST",
+            url : ctx + "yppz/drugConfig/editDrugConfig",
+            data : data,
+            async : false,
+            error : function(request) {
+                $.modal.alertError("系统错误");
+            },
+            success : function(data) {
+                $.operate.successCallback(data);
+            }
+        });
+    }
+
+    function submitHandler() {
+        if ($.validate.form()) {
+            edit();
+        }
+    }
+</script>

+ 436 - 0
health-admin/src/main/resources/templates/gxhpz/drugconfigList.html

@@ -0,0 +1,436 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+<head>
+    <meta charset="UTF-8">
+    <meta name="format-detection" content="telephone=no">
+    <th:block th:include="include :: header('药品配置')" />
+    <th:block th:include="include :: layout-latest-css" />
+    <th:block th:include="include :: ztree-css" />
+</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>
+                <form id="SSpglJfspProductinfo-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="mdmCode"/>
+                </div>
+
+                <!-- D值品编码 -->
+                <div class="customize-form-group">
+                    <label>D值品编码:</label>
+                    <input type="text" class="styled-input" placeholder="请输入D值品编码" name="dValueCode"/>
+                </div>
+
+                <!-- D值品名称 -->
+                <div class="customize-form-group">
+                    <label>D值品名称:</label>
+                    <input type="text" class="styled-input" placeholder="请输入D值品名称" name="dValueName"/>
+                </div>
+
+                <!-- 规格 -->
+                <div class="customize-form-group">
+                    <label>规格:</label>
+                    <input type="text" class="styled-input" placeholder="请输入规格" name="specification"/>
+                </div>
+
+                <!-- 通用名 -->
+                <div class="customize-form-group">
+                    <label>通用名:</label>
+                    <input type="text" class="styled-input" placeholder="请输入通用名" name="genericName"/>
+                </div>
+
+                <!-- 商品名 -->
+                <div class="customize-form-group">
+                    <label>商品名:</label>
+                    <input type="text" class="styled-input" placeholder="请输入商品名" name="productName"/>
+                </div>
+
+                <!-- 厂家简称 -->
+                <div class="customize-form-group">
+                    <label>厂家简称:</label>
+                    <input type="text" class="styled-input" placeholder="请输入厂家简称" name="manufacturerShortName"/>
+                </div>
+
+                <!-- 是否随访管理品 -->
+                <div class="customize-form-group">
+                    <label>是否随访管理品:</label>
+                    <select name="isFollowUpManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
+                        <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>
+                    <select name="isColdChainManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
+                        <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>
+                    <select name="isRegisteredManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
+                        <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>
+                    <select name="isCharityAidManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
+                        <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>
+                    <select name="administrationMethod" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_yyff')}">
+                        <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>
+                    <select name="enterpriseFlowManagement" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yppz_qylxglfs')}">
+                        <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>
+                    <select name="status" class="styled-input" th:with="type=${@dict.getType('sys_hzgl_qyty_status')}">
+                        <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="system:user:add">
+                    <i class="fa fa-plus"></i> 新增患者管理品
+                </a>
+                 <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:user:edit">
+                    <i class="fa fa-edit"></i> 修改
+                </a>
+                <a class="btn btn-success" onclick="$.operate.add2()" shiro:hasPermission="system:user:add">
+                    <i class="fa fa-plus"></i> 新增复购配置
+                </a>
+<!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:user:remove">-->
+<!--                    <i class="fa fa-remove"></i> 删除-->
+<!--                </a>-->
+
+            </div>
+
+            <div class="col-sm-12 select-table table-striped" style="width: 100%; overflow-x: auto;">
+                <table id="bootstrap-table" class="fixed-layout-table"></table>
+            </div>
+        </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('gxhpz:yppz:edit')}]];
+    var removeFlag = [[${@permission.hasPermi('gxhpz:yppz:remove')}]];
+    var detailFlag = [[${@permission.hasPermi('gxhpz:yppz:view')}]];
+    var prefix = ctx + "yppz/drugConfig";
+    $(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);
+        }
+        queryArchivesList();
+    });
+
+    function queryArchivesList() {
+        var options = {
+            url: prefix + "/drugconfigList",
+            viewUrl: prefix + "/drugConfigDetail/{id}",
+            detailUrl: prefix + "/drugConfigDetail/{id}",
+            createUrl: prefix + "/add",
+            createUrl2: prefix + "/toCorrelationAdd",
+            updateUrl: prefix + "/edit/{id}",
+            removeUrl: prefix + "/remove",
+            updateUrl2: prefix + "/toCorrelation/{id}",
+            /*exportUrl: prefix + "/export",
+            importUrl: prefix + "/importData",
+            importTemplateUrl: prefix + "/importTemplate",*/
+            sortName: "id",
+            sortOrder: "asc",
+            modalName: "药品配置",
+            modalName2: "复购配置",
+            fitColumns: true,
+            striped: true,
+            autoRowHeight: true,
+            rowNumbers: true,
+            showFooter:true,  //是否显示表格底部区域。
+            clickToSelect: true, //是否启用点击行时选中整行的功能。
+            singleSelect: false, //是否仅允许选择一行
+            fixedColumns: true,
+            //fixedNumber: 3,
+            fixedRightNumber: 1,
+            columns: [{
+                checkbox: true
+            },
+                { field: 'id', title: '主键', align: 'center', visible: false },
+                { field: 'mdmCode', title: '药品编码', align: 'center' },
+                { field: 'dValueCode', title: 'D值品编码', align: 'center' },
+                {
+                    visible: editFlag == 'hidden' ? false : true,
+                    title: 'D值关联状态',
+                    align: 'center',
+                    formatter: function (value, row, index) {
+                        return statusTools2(row);
+                    }
+                },
+
+                { field: 'dValueCode', title: 'D值品编码', align: 'center' },
+                { field: 'dValueName', title: 'D值品名称', align: 'center' },
+                { field: 'genericName', title: '通用名', align: 'center' },
+                { field: 'productName', title: '商品名', align: 'center' },
+                {
+                    visible: editFlag == 'hidden' ? false : true,
+                    title: '配置状态',
+                    align: 'center',
+                    formatter: function (value, row, index) {
+                        return statusTools(row);
+                    }
+                },
+                { field: 'specification', title: '规格', align: 'center' },
+                { field: 'packaging', title: '包装', align: 'center' },
+                // { field: 'status', title: '状态', align: 'center'  ,
+                //     formatter: function(value, row, index) {
+                //         switch (value) {
+                //             case 0:
+                //                 return '<span class=\"btn-danger">已停用</span>';
+                //                 break;
+                //             case 1:
+                //                 return '<span class=\"btn-primary">已启用</span>';
+                //                 break;
+                //             default:
+                //                 return '<span class=\"btn-warning">-</span>';
+                //         }
+                //     }},
+                { field: 'manufacturerShortName', title: '厂家简称', align: 'center' },
+                { field: 'isFollowUpManaged', title: '是否随访管理品', align: 'center',
+                    formatter: function(value, row, index) {
+                        switch (value) {
+                            case 0:
+                                return '否';
+                                break;
+                            case 1:
+                                return '是';
+                                break;
+                            default:
+                                return '-';
+                        }
+                    }},
+                { field: 'isColdChainManaged', title: '是否冷链管理品', align: 'center',
+                    formatter: function(value, row, index) {
+                        switch (value) {
+                            case 0:
+                                return '否';
+                                break;
+                            case 1:
+                                return '是';
+                                break;
+                            default:
+                                return '-';
+                        }
+                    } },
+                { field: 'isRegisteredManaged', title: '是否登记管理品', align: 'center',
+                    formatter: function(value, row, index) {
+                        switch (value) {
+                            case 0:
+                                return '否';
+                                break;
+                            case 1:
+                                return '是';
+                                break;
+                            default:
+                                return '-';
+                        }
+                    } },
+                { field: 'isCharityAidManaged', title: '是否慈善援助管理品', align: 'center',
+                    formatter: function(value, row, index) {
+                        switch (value) {
+                            case 0:
+                                return '否';
+                                break;
+                            case 1:
+                                return '是';
+                                break;
+                            default:
+                                return '-';
+                        }
+                    } },
+                { field: 'administrationMethod', title: '给药方式', align: 'center' },
+                { field: 'enterpriseFlowManagement', title: '企业流向管理方式', align: 'center' },
+                { field: 'updatedTime', title: '更新日期', align: 'center' },
+                { field: 'indicationDescription', title: '说明书适应症', align: 'center' },
+                { field: 'dosageAndAdministration', title: '用法用量', align: 'center' },
+                { field: 'saleStatus', title: '销售状态', align: 'center' ,
+                    formatter: function(value, row, index) {
+                        switch (value) {
+                            case 0:
+                                return '停售';
+                                break;
+                            case 1:
+                                return '可售';
+                                break;
+                            default:
+                                return '-';
+                        }
+                    }},
+                { field: 'createdBy', title: '创建人', align: 'center' },
+                { field: 'createdTime', title: '创建时间', align: 'center' },
+                { field: 'updatedBy', title: '更新人', align: 'center' },
+                { field: 'manufacturer', title: '厂家', align: 'center' },
+                { field: 'productImagePath', title: '商品图片路径', align: 'center' },
+                {
+                    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.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>修改</a> ');
+                            actions.push('<a class="btn btn-warning btn-xs ' + detailFlag + '" 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);
+    }
+
+    /* 自定义重置-表单重置/隐藏框/树节点选择色/搜索 */
+    function resetPre() {
+        resetDate();
+        $("#SSpglJfspProductinfo-form")[0].reset();
+        $.table.search();
+        _refresh();
+    }
+    function edit_page(id){
+        table.set();
+        var url = "/404.html";
+        if ($.common.isNotEmpty(id)) {
+            url = table.options.updateUrl.replace("{id}", id);
+        } else {
+            var id = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
+            if (id.length == 0) {
+                $.modal.alertWarning("请至少选择一条记录");
+                return;
+            }
+            url = table.options.updateUrl.replace("{id}", id);
+        }
+        $.modal.openTab("修改" + table.options.modalName, url + "?editTage=1" );
+    }
+
+    /* 用户状态显示 */
+    function statusTools(row) {
+        if (row.status == 0) {
+            return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.id + '\')" style="color: red;"></i> ';
+        } else {
+            return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.id + '\')" style="color: green;"></i>  ';
+        }
+    }
+    /* D值关联和停用*/
+    function statusTools2(row) {
+        if (row.dvalueStatus == '2') {
+            '<a  class="btn btn-success btn-xs ' + editFlag + '" onclick="$.operate.edit2(\'' + row.id + '\')">去关联</a>&nbsp;|状态:未关联 ';
+        }else if (row.dvalueStatus == 1){
+            return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="stoped(\'' + row.id + '\')" style="color: green;"></i>启用';
+        }else if (row.dvalueStatus == 0){
+            return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="start(\'' + row.id + '\')" style="color: red;"></i>停止';
+        } else{
+            return '<a  class="btn btn-success btn-xs ' + editFlag + '" onclick="$.operate.edit2(\'' + row.id + '\')">去关联</a>&nbsp;|状态:未关联 ';
+        }
+            }
+    /* 停用 */
+    function disable(id) {
+        $.modal.confirm("确认要停用用户吗?", function() {
+            $.operate.post(prefix + "/changeStatus", { "id": id, "status": 0 });
+        })
+    }
+    /* 启用 */
+    function enable(id) {
+        $.modal.confirm("确认要启用用户吗?", function() {
+            $.operate.post(prefix + "/changeStatus", { "id": id, "status": 1 });
+        })
+    }
+    /* 去关联 */
+    function correlation(id) {
+        //弹框做操作
+        // $.modal.confirm("确认要启用用户吗?", function() {
+        //     $.operate.post(prefix + "/toCorrelation", { "id": id, "status": 1 });
+        // })
+        onclick="$.operate.edit(\'' + row.id + '\')"
+        var options = {
+            title: '添加复购品',
+            url: prefix + "/toCorrelation"+id,
+            callBack: doSubmit2
+        };
+        $.modal.openOptions(options);
+    }
+    /* 启用关联 */
+    function start(id) {
+        $.modal.confirm("确认要启用D值关联吗?", function() {
+            $.operate.post(prefix + "/changedvalueStatus", { "id": id, "dvalueStatus": 1 });
+        })
+    }
+    /* 停止关联 */
+    function stoped(id) {
+        $.modal.confirm("确认要停用D值关联吗?", function() {
+            $.operate.post(prefix + "/changedvalueStatus", { "id": id, "dvalueStatus": 0 });
+        })
+    }
+
+</script>
+<style>
+    .fa-2x {
+        font-size: 2em;
+    }
+
+</style>
+</body>
+
+</html>

+ 119 - 0
health-admin/src/main/resources/templates/gxhpz/dvalueconfigAdd.html

@@ -0,0 +1,119 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('门店积分商品列表新增')" />
+    <th:block th:include="include :: ztree-css" />
+</head>
+<body class="white-bg">
+<div class="wrapper wrapper-content animated fadeInRight ibox-content">
+    <form id="form-SSpglJfspProductinfo-add" class="customize-search-form">
+
+            <div class="customize-form-group-container"> <div class="customize-form-group">
+                <label>D值品编码:</label>
+                <input name="dValueCode" placeholder="请输入D值品编码" id="dValueCode" class="styled-input" type="text">
+            </div>
+            <div class="customize-form-group">
+                <label class="is-required">药品编码:</label>
+                <input name="mdmCode" placeholder="请输入药品编码" id="mdmCode" class="styled-input" type="text" required>
+            </div>
+            <div class="customize-form-group">
+                <label>D值品名称:</label>
+                <input name="dValueName" placeholder="请输入D值品名称" id="dValueName" class="styled-input" type="text">
+            </div>
+            <div class="customize-form-group">
+                <label>规格:</label>
+                <input name="specification" placeholder="请输入规格" id="specification" class="styled-input" type="text">
+            </div>
+            <div class="customize-form-group">
+                <label class="is-required">通用名:</label>
+                <input name="genericName" placeholder="请输入通用名" id="genericName" class="styled-input" type="text" required>
+            </div>
+            <div class="customize-form-group">
+                <label class="is-required">商品名:</label>
+                <input name="productName" placeholder="请输入商品名" id="productName" class="styled-input" type="text" required>
+            </div>
+            <div class="customize-form-group">
+                <label>配置状态:</label>
+                <select name="status" id="status" class="styled-input" th:with="type=${@dict.getType('sys_hzgl_qyty_status')}">
+                    <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>ICD适应症:</label>
+                <select name="icdIndication" id="icdIndication" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
+                    <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>
+                <select name="indicationCode" id="indicationCode" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
+                    <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>
+                <select name="unit" id="unit" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
+                    <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>
+                <select name="dosage" id="dosage" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
+                    <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>
+                <select name="administrationMethod" id="administrationMethod" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_yyff')}">
+                    <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>
+                <select name="frequency" id="frequency" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yppz_qylxglfs')}">
+                    <option value="">请选择</option>
+                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
+                </select>
+            </div>
+
+        </div>
+    </form>
+</div>
+<th:block th:include="include :: footer" />
+<th:block th:include="include :: ztree-js" />
+<script type="text/javascript">
+
+    function submitHandler() {
+        if ($.validate.form()) {
+            add();
+        }
+    }
+
+    function add() {
+        var data = $("#form-SSpglJfspProductinfo-add").serializeArray();
+        $.ajax({
+            cache : true,
+            type : "POST",
+            url : ctx + "/dzpz/dvalueConfig/savedvalueconfig",
+            data : data,
+            async : false,
+            error : function(request) {
+                $.modal.alertError("系统错误");
+            },
+            success : function(data) {
+                $.operate.successCallback(data);
+            }
+        });
+    }
+</script>
+</body>
+</html>

+ 120 - 0
health-admin/src/main/resources/templates/gxhpz/dvalueconfigDetail.html

@@ -0,0 +1,120 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+	<th:block th:include="include :: header('药品详情')" />
+	<th:block th:include="include :: jsonview-css" />
+</head>
+<body class="white-bg">
+	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
+	<form class="form-horizontal m-t" id="signupForm" th:object="${detail}" style="font-family: SimSun;font-size: 16px;">
+		<div class="row">
+			<!-- 第一列 -->
+			<div class="col-sm-6">
+				<div class="form-group">
+					<label class="col-sm-2 control-label">药品编码:</label>
+					<div class="form-control-static" th:text="${mdmCode}">
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="col-sm-2 control-label">D值品编码:</label>
+					<div class="form-control-static" th:text="${dValueCode}">
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="col-sm-2 control-label">D值品名称:</label>
+					<div class="form-control-static" th:text="${dValueName}">
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="col-sm-2 control-label">规格:</label>
+					<div class="form-control-static" th:text="${specification}">
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="col-sm-2 control-label">通用名:</label>
+					<div class="form-control-static" th:text="${genericName}">
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="col-sm-2 control-label">商品名:</label>
+					<div class="form-control-static" th:text="${productName}">
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="col-sm-2 control-label">ICD适应症:</label>
+					<div class="form-control-static" th:text="${icdIndication}">
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="col-sm-2 control-label">适应症编码:</label>
+					<div class="form-control-static" th:text="${indicationCode}">
+					</div>
+				</div>
+				<div class="form-group">
+					<label class="col-sm-2 control-label">给药方式:</label>
+					<div class="form-control-static" th:text="${administrationMethod}">
+					</div>
+				</div>
+
+		</div>
+		<div class="col-sm-6">
+			<div class="form-group">
+				<label class="col-sm-2 control-label">用量:</label>
+				<div class="form-control-static" th:text="${dosage}">
+				</div>
+			</div>
+			<div class="form-group">
+				<label class="col-sm-2 control-label">单位:</label>
+				<div class="form-control-static" th:text="${unit}">
+				</div>
+			</div>
+			<div class="form-group">
+				<label class="col-sm-2 control-label">频次:</label>
+				<div class="form-control-static" th:text="${frequency}">
+				</div>
+			</div>
+			<div class="form-group">
+				<label class="col-sm-2 control-label">创建人:</label>
+				<div class="form-control-static" th:text="${createdBy}">
+				</div>
+			</div>
+			<div class="form-group">
+				<label class="col-sm-2 control-label">创建时间:</label>
+				<div class="form-control-static" th:text="${#temporals.format(createdTime, 'yyyy-MM-dd HH:mm:ss')}">
+				</div>
+			</div>
+			<div class="form-group">
+				<label class="col-sm-2 control-label">更新人:</label>
+				<div class="form-control-static" th:text="${updatedBy}">
+				</div>
+			</div>
+			<div class="form-group">
+				<label class="col-sm-2 control-label">更新时间:</label>
+				<div class="form-control-static" th:text="${#temporals.format(updatedTime, 'yyyy-MM-dd HH:mm:ss')}">
+				</div>
+			</div>
+			<div class="form-group">
+				<label class="col-sm-2 control-label">配置状态:</label>
+				<div class="form-control-static" th:text="${status == 1 ? '启用' : '停用'}">
+				</div>
+			</div>
+	  </div>
+	</div>
+	</form>
+    </div>
+    <th:block th:include="include :: footer" />
+    <th:block th:include="include :: jsonview-js" />
+    <script th:inline="javascript">
+		$(function() {
+			debugger
+			// var operParam = [[${oorderData}]];
+			// if ($.common.isNotEmpty(operParam) && operParam.length < 2000) {
+			// 	$("#operParam").JSONView(operParam);
+			// } else {
+			// 	$("#operParam").text(operParam);
+			// }
+
+		});
+    </script>
+</body>
+</html>

+ 121 - 0
health-admin/src/main/resources/templates/gxhpz/dvalueconfigEdit.html

@@ -0,0 +1,121 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('门店积分商品列表修改')" />
+</head>
+<body>
+<div class="ui-layout-center">
+    <form id="form-SSpglJfspProductinfo-edit" class="customize-search-form">
+
+        <div class="customize-form-group-container">
+            <input type="hidden" id="id" name="id" th:value="${id}">
+            <div class="customize-form-group-container"> <div class="customize-form-group">
+                <label>D值品编码:</label>
+                <input name="dValueCode" placeholder="请输入D值品编码" id="dValueCode"  th:value="${dValueCode}" class="styled-input" type="text">
+            </div>
+                <div class="customize-form-group">
+                    <label class="is-required">药品编码:</label>
+                    <input name="mdmCode" placeholder="请输入药品编码" id="mdmCode"  th:value="${mdmCode}" class="styled-input" type="text" required>
+                </div>
+                <div class="customize-form-group">
+                    <label>D值品名称:</label>
+                    <input name="dValueName" placeholder="请输入D值品名称" id="dValueName" th:value="${dValueName}" class="styled-input" type="text">
+                </div>
+                <div class="customize-form-group">
+                    <label>规格:</label>
+                    <input name="specification" placeholder="请输入规格" id="specification" th:value="${specification}" class="styled-input" type="text">
+                </div>
+                <div class="customize-form-group">
+                    <label class="is-required">通用名:</label>
+                    <input name="genericName" placeholder="请输入通用名" id="genericName" th:value="${genericName}" class="styled-input" type="text" required>
+                </div>
+                <div class="customize-form-group">
+                    <label class="is-required">商品名:</label>
+                    <input name="productName" placeholder="请输入商品名" id="productName" th:value="${productName}" class="styled-input" type="text" required>
+                </div>
+                <div class="customize-form-group">
+                    <label>配置状态:</label>
+                    <select name="status" id="status" class="styled-input" th:with="type=${@dict.getType('sys_hzgl_qyty_status')}" th:value="${status}">
+                        <option value="">请选择</option>
+                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${dict.dictValue}==${status}"></option>
+                    </select>
+                </div>
+
+                <!-- 以下可能不要 -->
+
+                <div class="customize-form-group">
+                    <label>ICD适应症:</label>
+                    <select name="icdIndication" id="icdIndication" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}" th:value="${icdIndication}">
+                        <option value="">请选择</option>
+                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}" th:selected="${dict.dictLabel}==${icdIndication}"></option>
+                    </select>
+                </div>
+                <div class="customize-form-group">
+                    <label>适应症编码:</label>
+                    <select name="indicationCode" id="indicationCode" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}" th:value="${indicationCode}">
+                        <option value="">请选择</option>
+                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}" th:selected="${dict.dictLabel}==${indicationCode}"></option>
+                    </select>
+                </div>
+                <div class="customize-form-group">
+                    <label>单位:</label>
+                    <select name="unit" id="unit" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}" th:value="${unit}">
+                        <option value="">请选择</option>
+                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}" th:selected="${dict.dictLabel}==${unit}"></option>
+                    </select>
+                </div>
+                <div class="customize-form-group">
+                    <label>用量:</label>
+                    <select name="dosage" id="dosage" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}" th:value="${dosage}">
+                        <option value="">请选择</option>
+                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictLabel}" th:selected="${dict.dictLabel}==${dosage}"></option>
+                    </select>
+                </div>
+                <div class="customize-form-group">
+                    <label>给药方式:</label>
+                    <select name="administrationMethod" id="administrationMethod" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_yyff')}" th:value="${administrationMethod}">
+                        <option value="">请选择</option>
+                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${dict.dictLabel}==${administrationMethod}"></option>
+                    </select>
+                </div>
+                <div class="customize-form-group">
+                    <label>频次:</label>
+                    <select name="frequency" id="frequency" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yppz_qylxglfs')}" th:value="${frequency}">
+                        <option value="">请选择</option>
+                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:selected="${dict.dictLabel}==${frequency}"></option>
+                    </select>
+                </div>
+        </div>
+    </form>
+</div>
+<div class="main-content">
+    <div class="col-sm-offset-5 col-sm-10">
+    </div>
+</div>
+<th:block th:include="include :: footer" />
+</body>
+</html>
+<script>
+    function edit() {
+        var data = $("#form-SSpglJfspProductinfo-edit").serializeArray();
+        $.ajax({
+            cache : true,
+            type : "POST",
+            url : ctx + "dzpz/dvalueConfig/dvalueconfigEdit",
+            data : data,
+            async : false,
+            error : function(request) {
+                $.modal.alertError("系统错误");
+            },
+            success : function(data) {
+                $.operate.successCallback(data);
+            }
+        });
+    }
+
+    function submitHandler() {
+        if ($.validate.form()) {
+            edit();
+        }
+    }
+</script>

+ 231 - 0
health-admin/src/main/resources/templates/gxhpz/dvalueconfigList.html

@@ -0,0 +1,231 @@
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
+<head>
+    <meta charset="UTF-8">
+    <meta name="format-detection" content="telephone=no">
+    <th:block th:include="include :: header('D值配置')" />
+    <th:block th:include="include :: layout-latest-css" />
+    <th:block th:include="include :: ztree-css" />
+</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>
+                <form id="SSpglJfspProductinfo-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="mdmCode"/>
+                </div>
+                <!-- D值品编码 -->
+                <div class="customize-form-group">
+                    <label>D值品编码:</label>
+                    <input type="text" class="styled-input" placeholder="请输入D值品编码" name="dValueCode"/>
+                </div>
+                <!-- D值品名称 -->
+                <div class="customize-form-group">
+                    <label>D值品名称:</label>
+                    <input type="text" class="styled-input" placeholder="请输入D值品名称" name="dValueName"/>
+                </div>
+                <!-- 通用名 -->
+                <div class="customize-form-group">
+                    <label>通用名:</label>
+                    <input type="text" class="styled-input" placeholder="请输入通用名" name="genericName"/>
+                </div>
+                <!-- 商品名 -->
+                <div class="customize-form-group">
+                    <label>商品名:</label>
+                    <input type="text" class="styled-input" placeholder="请输入商品名" name="productName"/>
+                </div>
+                <!-- 状态 -->
+                <div class="customize-form-group">
+                    <label>状态:</label>
+                    <select name="status" class="styled-input" th:with="type=${@dict.getType('sys_hzgl_qyty_status')}">
+                        <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="system:user:add">
+                    <i class="fa fa-plus"></i> 新增
+                </a>
+<!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:user:remove">-->
+<!--                    <i class="fa fa-remove"></i> 删除-->
+<!--                </a>-->
+
+            </div>
+
+            <div class="col-sm-12 select-table table-striped" style="width: 100%; overflow-x: auto;">
+                <table id="bootstrap-table" class="fixed-layout-table"></table>
+            </div>
+        </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('dtp:pmService:edit')}]];
+    var removeFlag = [[${@permission.hasPermi('dtp:pmService:remove')}]];
+    var prefix = ctx + "dzpz/dvalueConfig";
+    $(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);
+        }
+        queryArchivesList();
+    });
+
+    function queryArchivesList() {
+        var options = {
+            url: prefix + "/dvalueconfigList",
+            viewUrl: prefix + "/dvalueconfigDetail/{id}",
+            createUrl: prefix + "/add",
+            updateUrl: prefix + "/edit/{id}",
+            removeUrl: prefix + "/remove",
+            /*exportUrl: prefix + "/export",
+            importUrl: prefix + "/importData",
+            importTemplateUrl: prefix + "/importTemplate",*/
+            sortName: "id",
+            sortOrder: "asc",
+            modalName: "药品",
+            fitColumns: true,
+            striped: true,
+            autoRowHeight: true,
+            rowNumbers: true,
+            showFooter:true,  //是否显示表格底部区域。
+            clickToSelect: true, //是否启用点击行时选中整行的功能。
+            singleSelect: false, //是否仅允许选择一行
+            fixedColumns: true,
+            //fixedNumber: 3,
+            fixedRightNumber: 1,
+            columns: [
+                { field: 'id', title: '主键', align: 'center', visible: false },
+                { field: 'mdmCode', title: '药品编码', align: 'center' },
+                { field: 'dValueCode', title: 'D值品编码', align: 'center' },
+                { field: 'dValueName', title: 'D值品名称', align: 'center' },
+                { field: 'specification', title: '规格', align: 'center' },
+                { field: 'genericName', title: '通用名', align: 'center' },
+                { field: 'productName', title: '商品名', align: 'center' },
+                {
+                    visible: editFlag == 'hidden' ? false : true,
+                    title: '配置状态',
+                    align: 'center',
+                    formatter: function (value, row, index) {
+                        return statusTools(row);
+                    }
+                },
+                // { field: 'status', title: '配置状态', align: 'center'  ,
+                //     formatter: function(value, row, index) {
+                //         switch (value) {
+                //             case 0:
+                //                 return '<span class=\"btn-danger">已停用</span>';
+                //                 break;
+                //             case 1:
+                //                 return '<span class=\"btn-primary">已启用</span>';
+                //                 break;
+                //             default:
+                //                 return '<span class=\"btn-warning">-</span>';
+                //         }
+                //     } },
+                { field: 'administrationMethod', title: '给药方式', align: 'center' },
+                { field: 'icdIndication', title: 'ICD适应症', align: 'center' },
+                { field: 'indicationCode', title: '适应症编码', align: 'center' },
+                { field: 'dosage', title: '用量', align: 'center' },
+                { field: 'unit', title: '单位', align: 'center' },
+                { field: 'frequency', title: '频次', align: 'center' },
+                { field: 'updatedTime', title: '更新日期', align: 'center' },
+                {
+                    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.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>修改</a> ');
+                            actions.push('<a class="btn btn-info btn-xs" 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);
+    }
+
+    /* 自定义重置-表单重置/隐藏框/树节点选择色/搜索 */
+    function resetPre() {
+        resetDate();
+        $("#SSpglJfspProductinfo-form")[0].reset();
+        $.table.search();
+        _refresh();
+    }
+    function edit_page(id){
+        table.set();
+        var url = "/404.html";
+        if ($.common.isNotEmpty(id)) {
+            url = table.options.updateUrl.replace("{id}", id);
+        } else {
+            var id = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
+            if (id.length == 0) {
+                $.modal.alertWarning("请至少选择一条记录");
+                return;
+            }
+            url = table.options.updateUrl.replace("{id}", id);
+        }
+        $.modal.openTab("修改" + table.options.modalName, url + "?editTage=1" );
+    }
+
+    /* 用户状态显示 */
+    function statusTools(row) {
+        if (row.status == 0) {
+            return '<i class=\"fa fa-toggle-off text-info fa-2x\" onclick="enable(\'' + row.id + '\')" style="color: red;"></i> ';
+        } else {
+            return '<i class=\"fa fa-toggle-on text-info fa-2x\" onclick="disable(\'' + row.id + '\')" style="color: green;"></i>  ';
+        }
+    }
+
+    /* 用户管理-停用 */
+    function disable(id) {
+        $.modal.confirm("确认要停用配置吗?", function() {
+            $.operate.post(prefix + "/changeStatus", { "id": id, "status": 0 });
+        })
+    }
+
+    /* 用户管理启用 */
+    function enable(id) {
+        $.modal.confirm("确认要启用配置吗?", function() {
+            $.operate.post(prefix + "/changeStatus", { "id": id, "status": 1 });
+        })
+    }
+</script>
+</body>
+
+</html>

+ 90 - 0
health-admin/src/main/resources/templates/jggl/test.html

@@ -0,0 +1,90 @@
+
+<!DOCTYPE html>
+<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
+<head>
+    <th:block th:include="include :: header('临时记事本')" />
+</head>
+<body>
+<div class="ui-layout-center">
+        门店管理
+            门店名称
+            门店简称
+            门店类型
+            行政区域
+            行政区域编码
+            门二维码
+            电话
+            营业时间
+            地址
+            经度
+            纬度
+            门店编码
+            地图
+            所在片区
+            参考门店编码
+            门店属性
+            门店内码
+            助记码
+            采购组织
+            销售组织
+            分销渠道
+            部门
+            租赁面积
+            外租面积
+            经营面积
+            传真
+            联系人
+            开业日期
+            交割日期
+            关店日期
+            最近翻新改造日期
+            门店租金
+            门店状态
+            社区及商住店
+            编制人数
+            日历
+            门店使用的系统
+            详细地址
+            大区
+            选址商圈店型
+            特殊业态店型
+            营业面积分类
+            月销售额等级
+            医保政策分类
+            顾客年龄层
+
+
+         门店资质表
+            企业名称
+            长江东路店二店
+            法定代表人/营业者
+            营业执照注册号
+            地址
+            营业范围
+            营业执照有效期
+            营业执照
+            互联网药品信息服务资格证书
+            互联网药品交易服务资格证书
+            药品经营许可证
+            食品经营许可证
+            医疗器械经营许可证
+            第二类医疗器械经营备案凭证
+            药品经营质量管理规范认证证书
+            医疗器械网络销售备案凭证
+            执业药师注册证
+            入驻药急送平台协议
+
+
+         账号管理表
+            账号名
+            姓名
+            手机号码
+            二维码
+    根据以上属性 生成对应的3个表 字段名驼峰命名 字段加上注释id自动生成,并且三个表之间具有一定的关联关系
+
+
+</div>
+
+<th:block th:include="include :: footer" />
+</body>
+</html>

+ 12 - 12
health-admin/src/main/resources/templates/monitor/server/server.html

@@ -30,18 +30,18 @@
                                         <td>核心数</td>
                                         <td th:text="${server.cpu.cpuNum}">0个</td>
                                     </tr>
-                                    <tr>
-                                        <td>用户使用率</td>
-                                        <td th:text="${server.cpu.used + '%'}">0%</td>
-                                    </tr>
-                                    <tr>
-                                        <td>系统使用率</td>
-                                        <td th:text="${server.cpu.sys + '%'}">0%</td>
-                                    </tr>
-                                    <tr>
-                                        <td>当前空闲率</td>
-                                        <td th:text="${server.cpu.free + '%'}">0%</td>
-                                    </tr>
+<!--                                    <tr>-->
+<!--                                        <td>用户使用率</td>-->
+<!--                                        <td th:text="${server.cpu.used + '%'}">0%</td>-->
+<!--                                    </tr>-->
+<!--                                    <tr>-->
+<!--                                        <td>系统使用率</td>-->
+<!--                                        <td th:text="${server.cpu.sys + '%'}">0%</td>-->
+<!--                                    </tr>-->
+<!--                                    <tr>-->
+<!--                                        <td>当前空闲率</td>-->
+<!--                                        <td th:text="${server.cpu.free + '%'}">0%</td>-->
+<!--                                    </tr>-->
                                 </tbody>
                             </table>
                         </div>

+ 62 - 17
health-admin/src/main/resources/templates/spgl/SSpglJfspProductinfoAdd.html

@@ -9,36 +9,81 @@
     <form id="form-SSpglJfspProductinfo-add" class="customize-search-form">
         <div class="customize-form-group-container">
             <div class="customize-form-group">
-                <label>商品名称:</label>
-                <input name="productName" placeholder="商品名称"  id="productName" class="styled-input" type="text" required>
+                <label class="is-required">药品编码:</label>
+                <input name="drugCode" placeholder="请输入药品编码" id="drugCode" class="styled-input" type="text" required>
             </div>
             <div class="customize-form-group">
-                <label>商品图片:</label>
-                <input name="productImage" placeholder="商品图片"  id="productImage" class="styled-input" type="text">
+                <label>D值品编码:</label>
+                <input name="dValueCode" placeholder="请输入D值品编码" id="dValueCode" class="styled-input" type="text">
             </div>
             <div class="customize-form-group">
-                <label>销售价:</label>
-                <input name="salesPrice" placeholder="销售价"  id="salesPrice" class="styled-input" type="number">
+                <label>D值品名称:</label>
+                <input name="dValueName" placeholder="请输入D值品名称" id="dValueName" class="styled-input" type="text">
             </div>
             <div class="customize-form-group">
-                <label>兑换价格:</label>
-                <input name="exchangePrice" placeholder="兑换价格"  id="exchangePrice" class="styled-input" type="number">
+                <label>格:</label>
+                <input name="specification" placeholder="请输入规格" id="specification" class="styled-input" type="text">
             </div>
             <div class="customize-form-group">
-                <label>库存:</label>
-                <input name="stock" placeholder="库存"  id="stock" class="styled-input" type="number">
+                <label class="is-required">通用名:</label>
+                <input name="genericName" placeholder="请输入通用名" id="genericName" class="styled-input" type="text" required>
             </div>
-            <div class="customize-form-group select-time">
-                <label>创建时间:</label>
-                <input name="createTime" placeholder="创建时间"  id="createTime" class="time-input time-input2" type="text">
+            <div class="customize-form-group">
+                <label class="is-required">商品名:</label>
+                <input name="productName" placeholder="请输入商品名" id="productName" class="styled-input" type="text" required>
+            </div>
+            <div class="customize-form-group">
+                <label>厂家简称:</label>
+                <input name="manufacturerShortName" placeholder="请输入厂家简称" id="manufacturerShortName" class="styled-input" type="text">
+            </div>
+            <div class="customize-form-group">
+                <label>是否随访管理品:</label>
+                <select name="isFollowUpManaged" id="isFollowUpManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
+                    <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>
+                <select name="isColdChainManaged" id="isColdChainManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
+                    <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>
+                <select name="isRegisteredManaged" id="isRegisteredManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
+                    <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>
+                <select name="isCharityAidManaged" id="isCharityAidManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
+                    <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>
+                <select name="administrationMethod" id="administrationMethod" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_yyff')}">
+                    <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 name="productType" placeholder="商品类型"  id="productType" class="styled-input" type="text">
+                <label>企业流向管理方式:</label>
+                <select name="enterpriseFlowManagement" id="enterpriseFlowManagement" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yppz_qylxglfs')}">
+                    <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 name="salesStatus" placeholder="销售状态"  id="salesStatus" class="styled-input" type="text">
+                <label>状态:</label>
+                <select name="status" id="status" class="styled-input" th:with="type=${@dict.getType('sys_hzgl_qyty_status')}">
+                    <option value="">请选择</option>
+                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
+                </select>
             </div>
         </div>
     </form>

+ 62 - 17
health-admin/src/main/resources/templates/spgl/SSpglJfspProductinfoEdit.html

@@ -10,36 +10,81 @@
         <div class="customize-form-group-container">
             <input type="hidden" id="id" name="id" th:value="${id}">
             <div class="customize-form-group">
-                <label>商品名称:</label>
-                <input name="productName" placeholder="商品名称" th:value="${productName}" class="styled-input" type="text" required>
+                <label class="is-required">药品编码:</label>
+                <input name="drugCode" placeholder="请输入药品编码" th:value="${drugCode}" class="styled-input" type="text" required>
             </div>
             <div class="customize-form-group">
-                <label>商品图片:</label>
-                <input name="productImage" placeholder="商品图片" th:value="${productImage}" class="styled-input" type="text">
+                <label>D值品编码:</label>
+                <input name="dValueCode" placeholder="请输入D值品编码" th:value="${dValueCode}" class="styled-input" type="text">
             </div>
             <div class="customize-form-group">
-                <label>销售价:</label>
-                <input name="salesPrice" placeholder="销售价" th:value="${salesPrice}" class="styled-input" type="number">
+                <label>D值品名称:</label>
+                <input name="dValueName" placeholder="请输入D值品名称" th:value="${dValueName}" class="styled-input" type="text">
             </div>
             <div class="customize-form-group">
-                <label>兑换价格:</label>
-                <input name="exchangePrice" placeholder="兑换价格" th:value="${exchangePrice}" class="styled-input" type="number">
+                <label>格:</label>
+                <input name="specification" placeholder="请输入规格" th:value="${specification}" class="styled-input" type="text">
             </div>
             <div class="customize-form-group">
-                <label>库存:</label>
-                <input name="stock" placeholder="库存" th:value="${stock}" class="styled-input" type="number">
+                <label class="is-required">通用名:</label>
+                <input name="genericName" placeholder="请输入通用名" th:value="${genericName}" class="styled-input" type="text" required>
             </div>
-            <div class="customize-form-group select-time">
-                <label>创建时间:</label>
-                <input name="createTime" placeholder="创建时间" th:value="${createTime}" class="time-input time-input2" type="text">
+            <div class="customize-form-group">
+                <label class="is-required">商品名:</label>
+                <input name="productName" placeholder="请输入商品名" th:value="${productName}" class="styled-input" type="text" required>
+            </div>
+            <div class="customize-form-group">
+                <label>厂家简称:</label>
+                <input name="manufacturerShortName" placeholder="请输入厂家简称" th:value="${manufacturerShortName}" class="styled-input" type="text">
+            </div>
+            <div class="customize-form-group">
+                <label>是否随访管理品:</label>
+                <select name="isFollowUpManaged" id="isFollowUpManaged" class="styled-input" th:with="type=${@dict.getType('sys_yes_no')}" th:value="${isFollowUpManaged}">
+                    <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>
+                <select name="isColdChainManaged" id="isColdChainManaged" class="styled-input" th:with="type=${@dict.getType('sys_yes_no')}" th:value="${isColdChainManaged}">
+                    <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>
+                <select name="isRegisteredManaged" id="isRegisteredManaged" class="styled-input" th:with="type=${@dict.getType('sys_yes_no')}" th:value="${isRegisteredManaged}">
+                    <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>
+                <select name="isCharityAidManaged" id="isCharityAidManaged" class="styled-input" th:with="type=${@dict.getType('sys_yes_no')}" th:value="${isCharityAidManaged}">
+                    <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>
+                <select name="administrationMethod" id="administrationMethod" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_yyff')}" th:value="${administrationMethod}">
+                    <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 name="productType" placeholder="商品类型" th:value="${productType}" class="styled-input" type="text">
+                <label>企业流向管理方式:</label>
+                <select name="enterpriseFlowManagement" id="enterpriseFlowManagement" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yppz_qylxglfs')}" th:value="${enterpriseFlowManagement}">
+                    <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 name="salesStatus" placeholder="销售状态" th:value="${salesStatus}" class="styled-input" type="text">
+                <label>状态:</label>
+                <select name="status" id="status" class="styled-input" th:with="type=${@dict.getType('sys_hzgl_status')}" th:value="${status}">
+                    <option value="">请选择</option>
+                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
+                </select>
             </div>
         </div>
     </form>

+ 137 - 37
health-admin/src/main/resources/templates/spgl/SSpglJfspProductinfoList.html

@@ -3,7 +3,7 @@
 <head>
     <meta charset="UTF-8">
     <meta name="format-detection" content="telephone=no">
-    <th:block th:include="include :: header('门店积分商品列表')" />
+    <th:block th:include="include :: header('药品配置')" />
     <th:block th:include="include :: layout-latest-css" />
     <th:block th:include="include :: ztree-css" />
 </head>
@@ -21,23 +21,111 @@
                     </div>
                 </div>
                 <form id="SSpglJfspProductinfo-form" class="customize-search-form">
-<div class="customize-form-group-container">
-                        <div class="customize-form-group">
-                            <label>商品名称:</label>
-                            <input type="text" class="styled-input" name="productName" autocomplete="off"/>
-                        </div>
-                        <div class="customize-form-group">
-                                <label>前台类目</label>
-                                <select name="productType"  class="styled-input">
-                                    <option value="">全部</option>
-                                    <option value="感冒藥">感冒药</option>
-                                    <option value="胃药">胃药</option>
-                                    <option value="神经科">神经科</option>
-                                    <option value="其他">其他</option>
-                                </select>
-                        </div>
-                    </div>
-                </form>
+                <div class="customize-form-group-container">
+                <!-- 药品编码 -->
+                <div class="customize-form-group">
+                    <label>药品编码:</label>
+                    <input type="text" class="styled-input" placeholder="请输入药品编码" name="drugCode"/>
+                </div>
+
+                <!-- D值品编码 -->
+                <div class="customize-form-group">
+                    <label>D值品编码:</label>
+                    <input type="text" class="styled-input" placeholder="请输入D值品编码" name="dValueCode"/>
+                </div>
+
+                <!-- D值品名称 -->
+                <div class="customize-form-group">
+                    <label>D值品名称:</label>
+                    <input type="text" class="styled-input" placeholder="请输入D值品名称" name="dValueName"/>
+                </div>
+
+                <!-- 规格 -->
+                <div class="customize-form-group">
+                    <label>规格:</label>
+                    <input type="text" class="styled-input" placeholder="请输入规格" name="specification"/>
+                </div>
+
+                <!-- 通用名 -->
+                <div class="customize-form-group">
+                    <label>通用名:</label>
+                    <input type="text" class="styled-input" placeholder="请输入通用名" name="genericName"/>
+                </div>
+
+                <!-- 商品名 -->
+                <div class="customize-form-group">
+                    <label>商品名:</label>
+                    <input type="text" class="styled-input" placeholder="请输入商品名" name="productName"/>
+                </div>
+
+                <!-- 厂家简称 -->
+                <div class="customize-form-group">
+                    <label>厂家简称:</label>
+                    <input type="text" class="styled-input" placeholder="请输入厂家简称" name="manufacturerShortName"/>
+                </div>
+
+                <!-- 是否随访管理品 -->
+                <div class="customize-form-group">
+                    <label>是否随访管理品:</label>
+                    <select name="isFollowUpManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
+                        <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>
+                    <select name="isColdChainManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
+                        <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>
+                    <select name="isRegisteredManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
+                        <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>
+                    <select name="isCharityAidManaged" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yes_no')}">
+                        <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>
+                    <select name="administrationMethod" class="styled-input" th:with="type=${@dict.getType('sys_select_dtp_yyff')}">
+                        <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>
+                    <select name="enterpriseFlowManagement" class="styled-input" th:with="type=${@dict.getType('sys_gxhpz_yppz_qylxglfs')}">
+                        <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>
+                    <select name="status" class="styled-input" th:with="type=${@dict.getType('sys_hzgl_qyty_status')}">
+                        <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">
@@ -47,9 +135,9 @@
                  <a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="system:user:edit">
                     <i class="fa fa-edit"></i> 修改
                 </a>
-                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:user:remove">
-                    <i class="fa fa-remove"></i> 删除
-                </a>
+<!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="system:user:remove">-->
+<!--                    <i class="fa fa-remove"></i> 删除-->
+<!--                </a>-->
 
             </div>
 
@@ -97,7 +185,7 @@
             importTemplateUrl: prefix + "/importTemplate",*/
             sortName: "id",
             sortOrder: "asc",
-            modalName: "门店积分商品列表",
+            modalName: "药品",
             fitColumns: true,
             striped: true,
             autoRowHeight: true,
@@ -111,28 +199,40 @@
             columns: [{
                 checkbox: true
             },
-                { field: 'id', title: '主键', align: 'center' ,visible:false},
-                    { field: 'productName', title: '商品名称', align: 'center' },
-                    { field: 'productImage', title: '商品图片', align: 'center' },
-                    { field: 'salesPrice', title: '销售价', align: 'center' },
-                    { field: 'exchangePrice', title: '兑换价格', align: 'center' },
-                    { field: 'stock', title: '库存', align: 'center' },
-                    { field: 'createTime', title: '创建时间', align: 'center' },
-                    { field: 'productType', title: '商品类型', align: 'center' },
-                    { field: 'salesStatus', title: '销售状态', align: 'center' },
-
+                { field: 'id', title: '主键', align: 'center', visible: false },
+                { field: 'drugCode', title: '药品编码', align: 'center' },
+                { field: 'dValueCode', title: 'D值品编码', align: 'center' },
+                { field: 'dValueName', title: 'D值品名称', align: 'center' },
+                { field: 'specification', title: '规格', align: 'center' },
+                { field: 'genericName', title: '通用名', align: 'center' },
+                { field: 'productName', title: '商品名', align: 'center' },
+                { field: 'manufacturerShortName', title: '厂家简称', align: 'center' },
+                { field: 'isFollowUpManaged', title: '是否随访管理品', align: 'center' },
+                { field: 'isColdChainManaged', title: '是否冷链管理品', align: 'center' },
+                { field: 'isRegisteredManaged', title: '是否登记管理品', align: 'center' },
+                { field: 'isCharityAidManaged', title: '是否慈善援助管理品', align: 'center' },
+                { field: 'administrationMethod', title: '给药方式', align: 'center' },
+                { field: 'enterpriseFlowManagement', title: '企业流向管理方式', align: 'center' },
+                { field: 'status', title: '状态', align: 'center' },
+                { field: 'updatedTime', title: '更新日期', align: 'center' },
+                { field: 'indicationDescription', title: '说明书适应症', align: 'center' },
+                { field: 'dosageAndAdministration', title: '用法用量', align: 'center' },
+                { field: 'saleStatus', title: '销售状态', align: 'center' },
+                { field: 'createdBy', title: '创建人', align: 'center' },
+                { field: 'createdTime', title: '创建时间', align: 'center' },
+                { field: 'updatedBy', title: '更新人', align: 'center' },
+                { field: 'manufacturer', title: '厂家', align: 'center' },
+                { field: 'productImagePath', title: '商品图片路径', align: 'center' },
                 {
                     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="edit_page(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
+                            actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>修改</a> ');
+                            actions.push('<a class="btn btn-info btn-xs" 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> ');
-                            var more = [];
-                            /*more.push("<a class='btn btn-default btn-xs " + resetPwdFlag + "' href='javascript:void(0)' onclick='resetPwd(" + row.userId + ")'><i class='fa fa-key'></i>重置密码</a> ");
-                            more.push("<a class='btn btn-default btn-xs " + editFlag + "' href='javascript:void(0)' onclick='authRole(" + row.userId + ")'><i class='fa fa-check-square-o'></i>分配角色</a>");
-                            actions.push('<a tabindex="0" class="btn btn-info btn-xs" role="button" data-container="body" data-placement="left" data-toggle="popover" data-html="true" data-trigger="hover" data-content="' + more.join('') + '"><i class="fa fa-chevron-circle-right"></i>更多操作</a>');*/
                             return actions.join('');
                         } else {
                             return "";

+ 67 - 26
health-admin/src/main/resources/templates/system/dept/add.html

@@ -16,45 +16,86 @@
 				    </div>
 				</div>
 			</div>
-			<div class="form-group">
-				<label class="col-sm-3 control-label is-required">门店名称:</label>
-				<div class="col-sm-8">
-					<input class="form-control" type="text" name="deptName" id="deptName" required>
-				</div>
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label is-required">门店名称:</label>
+				<input name="deptName" id="deptName" placeholder="请输入门店名称" class="styled-input" type="text" required>
 			</div>
-			<div class="form-group">
-				<label class="col-sm-3 control-label is-required">显示排序:</label>
-				<div class="col-sm-8">
-					<input class="form-control" type="text" name="orderNum" required>
-				</div>
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label is-required">门店地址:</label>
+				<input name="address" id="address" placeholder="请输入门店地址" class="styled-input" type="text" required>
 			</div>
-			<div class="form-group">
-				<label class="col-sm-3 control-label">负责人:</label>
-				<div class="col-sm-8">
-					<input class="form-control" type="text" name="leader">
-				</div>
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label">门店编码:</label>
+				<input name="storeCode" id="storeCode" placeholder="请输入门店编码" class="styled-input" type="text">
 			</div>
-			<div class="form-group">
-				<label class="col-sm-3 control-label">联系电话:</label>
-				<div class="col-sm-8">
-					<input class="form-control" type="text" name="phone">
-				</div>
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label is-required">显示排序:</label>
+				<input name="orderNum" id="orderNum" placeholder="显示排序" class="styled-input"  required>
 			</div>
-			<div class="form-group">
-				<label class="col-sm-3 control-label">邮箱:</label>
-				<div class="col-sm-8">
-					<input class="form-control" type="text" name="email">
-				</div>
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label">负责人:</label>
+				<input name="leader" id="leader" placeholder="请输入负责人" class="styled-input" type="text">
+			</div>
+
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label">联系电话:</label>
+				<input name="phone" placeholder="请输入联系电话" class="styled-input" type="text">
+			</div>
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label">邮箱:</label>
+				<input name="email" id="email" placeholder="请输入邮箱" class="styled-input" type="text">
 			</div>
 			<div class="form-group">
 				<label class="col-sm-3 control-label">门店状态:</label>
 				<div class="col-sm-8">
-				    <div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
+					<div class="radio-box" th:each="dict : ${@dict.getType('sys_normal_disable')}">
 						<input type="radio" th:id="${dict.dictCode}" name="status" th:value="${dict.dictValue}" th:checked="${dict.default}">
 						<label th:for="${dict.dictCode}" th:text="${dict.dictLabel}"></label>
 					</div>
 				</div>
 			</div>
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label">所在城市:</label>
+				<input name="city" id="city" placeholder="请输入所在城市" class="styled-input" type="text">
+			</div>
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label">所在省份或州:</label>
+				<input name="province" id="province" placeholder="请输入所在省份或州" class="styled-input" type="text">
+			</div>
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label">纬度坐标:</label>
+				<input name="latitude" id="latitude" placeholder="请输入纬度坐标" class="styled-input" type="text">
+			</div>
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label">经度坐标:</label>
+				<input name="longitude" id="longitude" placeholder="请输入经度坐标" class="styled-input" type="text">
+			</div>
+
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label">营业执照编号:</label>
+				<input name="licenseNumber" id="licenseNumber" placeholder="请输入营业执照编号" class="styled-input" type="text">
+			</div>
+
+			<div class="customize-form-group select-time">
+				<label class="col-sm-1 control-label">许可证有效期截止:</label>
+				<div class="input-group select-time">
+					<input name="pharmacyLicenseExpiryDate" id="pharmacyLicenseExpiryDate" placeholder="许可证有效期截止日期" class="time-input time-input2" type="text">
+				</div>
+			</div>
+
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label">注册资本:</label>
+				<input name="registeredCapital" id="registeredCapital" placeholder="请输入注册资本" class="styled-input" type="text">
+			</div>
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label">经营范围描述:</label>
+				<input name="businessScope" id="businessScope" placeholder="请输入经营范围描述" class="styled-input" type="text">
+			</div>
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label">备注:</label>
+				<input name="remark" id="remark" placeholder="备注" class="styled-input" type="text">
+			</div>
+
 		</form>
 	</div>
 	<th:block th:include="include :: footer" />

+ 70 - 25
health-admin/src/main/resources/templates/system/dept/edit.html

@@ -17,35 +17,35 @@
 				    </div>
 				</div>
 			</div>
-			<div class="form-group">
-				<label class="col-sm-3 control-label is-required">门店名称:</label>
-				<div class="col-sm-8">
-					<input class="form-control" type="text" name="deptName" th:field="*{deptName}" id="deptName" required>
-				</div>
+
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label is-required">门店名称:</label>
+				<input name="deptName" id="deptName" placeholder="请输入门店名称" class="styled-input" type="text" th:field="*{deptName}" required>
 			</div>
-			<div class="form-group">
-				<label class="col-sm-3 control-label is-required">显示排序:</label>
-				<div class="col-sm-8">
-					<input class="form-control" type="text" name="orderNum" th:field="*{orderNum}" required>
-				</div>
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label is-required">门店地址:</label>
+				<input name="address" id="address" placeholder="请输入门店地址" class="styled-input" type="text" th:field="*{address}" required>
 			</div>
-			<div class="form-group">
-				<label class="col-sm-3 control-label">负责人:</label>
-				<div class="col-sm-8">
-					<input class="form-control" type="text" name="leader" th:field="*{leader}">
-				</div>
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label">门店编码:</label>
+				<input name="storeCode" id="storeCode" placeholder="请输入门店编码" class="styled-input" th:field="*{storeCode}" type="text">
 			</div>
-			<div class="form-group">
-				<label class="col-sm-3 control-label">联系电话:</label>
-				<div class="col-sm-8">
-					<input class="form-control" type="text" name="phone" th:field="*{phone}">
-				</div>
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label is-required">显示排序:</label>
+				<input name="orderNum" id="orderNum" placeholder="显示排序" class="styled-input"  th:field="*{orderNum}" required>
 			</div>
-			<div class="form-group">
-				<label class="col-sm-3 control-label">邮箱:</label>
-				<div class="col-sm-8">
-					<input class="form-control" type="text" name="email" th:field="*{email}">
-				</div>
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label">负责人:</label>
+				<input name="leader" id="leader" placeholder="请输入负责人" class="styled-input" th:field="*{leader}" type="text">
+			</div>
+
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label">联系电话:</label>
+				<input name="phone" placeholder="请输入联系电话" class="styled-input" th:field="*{phone}" type="text">
+			</div>
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label">邮箱:</label>
+				<input name="email" id="email" placeholder="请输入邮箱" class="styled-input" th:field="*{email}" type="text">
 			</div>
 			<div class="form-group">
 				<label class="col-sm-3 control-label">门店状态:</label>
@@ -56,6 +56,51 @@
 					</div>
 				</div>
 			</div>
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label">所在城市:</label>
+				<input name="city" id="city" placeholder="请输入所在城市" class="styled-input" th:field="*{city}" type="text">
+			</div>
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label">所在省份或州:</label>
+				<input name="province" id="province" placeholder="请输入所在省份或州" class="styled-input" th:field="*{province}" type="text">
+			</div>
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label">纬度坐标:</label>
+				<input name="latitude" id="latitude" placeholder="请输入纬度坐标" class="styled-input" th:field="*{latitude}" type="text">
+			</div>
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label">经度坐标:</label>
+				<input name="longitude" id="longitude" placeholder="请输入经度坐标" class="styled-input" th:field="*{longitude}" type="text">
+			</div>
+
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label">营业执照编号:</label>
+				<input name="licenseNumber" id="licenseNumber" placeholder="请输入营业执照编号" class="styled-input" th:field="*{licenseNumber}" type="text">
+			</div>
+
+			<div class="customize-form-group select-time">
+				<label class="col-sm-1 control-label">许可证有效期截止:</label>
+				<div class="input-group select-time">
+					<input name="pharmacyLicenseExpiryDate" id="pharmacyLicenseExpiryDate" placeholder="许可证有效期截止日期" class="time-input time-input2" th:field="*{pharmacyLicenseExpiryDate}"  type="text">
+				</div>
+			</div>
+
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label">注册资本:</label>
+				<input name="registeredCapital" id="registeredCapital" placeholder="请输入注册资本" class="styled-input" th:field="*{registeredCapital}" type="text">
+			</div>
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label">经营范围描述:</label>
+				<input name="businessScope" id="businessScope" placeholder="请输入经营范围描述" class="styled-input" th:field="*{businessScope}" type="text">
+			</div>
+			<div class="customize-form-group">
+				<label class="col-sm-1 control-label">备注:</label>
+				<input name="remark" id="remark" placeholder="备注" class="styled-input" th:field="*{remark}" type="text">
+			</div>
+
+
+
+
 		</form>
 	</div>
 	<th:block th:include="include :: footer" />

+ 2 - 0
health-common/pom.xml

@@ -100,6 +100,8 @@
             <artifactId>lombok</artifactId>
         </dependency>
 
+
+
         <dependency>
             <groupId>log4j</groupId>
             <artifactId>log4j</artifactId>

+ 122 - 4
health-common/src/main/java/com/bzd/common/core/domain/entity/SysDept.java

@@ -1,13 +1,16 @@
 package com.bzd.common.core.domain.entity;
 
+import com.bzd.common.core.domain.BaseEntity;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+
 import javax.validation.constraints.Email;
 import javax.validation.constraints.NotBlank;
 import javax.validation.constraints.NotNull;
 import javax.validation.constraints.Size;
-import org.apache.commons.lang3.builder.ToStringBuilder;
-import org.apache.commons.lang3.builder.ToStringStyle;
-import com.fasterxml.jackson.annotation.JsonIgnore;
-import com.bzd.common.core.domain.BaseEntity;
+import java.math.BigDecimal;
 
 /**
  * 门店表 sys_dept
@@ -54,6 +57,121 @@ public class SysDept extends BaseEntity
     /** 排除编号 */
     private Long excludeId;
 
+    /** 门店地址 */
+    private String address;
+    /** '门店编码' */
+    private String storeCode;
+    /** '所在城市' */
+    private String city;
+    /** '所在省份或州' */
+    private String province;
+    /** '纬度坐标' */
+    private BigDecimal latitude;
+    /** '经度坐标' */
+    private BigDecimal  longitude;
+    /** '营业执照编号' */
+    private String licenseNumber;
+    /** '药店经营许可证有效期截止日期' */
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
+    private String pharmacyLicenseExpiryDate;
+    /** '注册资本' */
+    private BigDecimal  registeredCapital;
+
+    /** '经营范围描述' */
+    private String businessScope;
+    /** 备注 */
+    private String remark;
+    @NotNull(message = "门店地址不能为空")
+    public String getAddress() {
+        return address;
+    }
+
+    public void setAddress(String address) {
+        this.address = address;
+    }
+
+    public String getStoreCode() {
+        return storeCode;
+    }
+
+    public void setStoreCode(String storeCode) {
+        this.storeCode = storeCode;
+    }
+
+    public String getCity() {
+        return city;
+    }
+
+    public void setCity(String city) {
+        this.city = city;
+    }
+
+    public String getProvince() {
+        return province;
+    }
+
+    public void setProvince(String province) {
+        this.province = province;
+    }
+
+    public BigDecimal getLatitude() {
+        return latitude;
+    }
+
+    public void setLatitude(BigDecimal latitude) {
+        this.latitude = latitude;
+    }
+
+    public BigDecimal getLongitude() {
+        return longitude;
+    }
+
+    public void setLongitude(BigDecimal longitude) {
+        this.longitude = longitude;
+    }
+
+    public String getLicenseNumber() {
+        return licenseNumber;
+    }
+
+    public void setLicenseNumber(String licenseNumber) {
+        this.licenseNumber = licenseNumber;
+    }
+
+    public String getPharmacyLicenseExpiryDate() {
+        return pharmacyLicenseExpiryDate;
+    }
+
+    public void setPharmacyLicenseExpiryDate(String pharmacyLicenseExpiryDate) {
+        this.pharmacyLicenseExpiryDate = pharmacyLicenseExpiryDate;
+    }
+
+    public BigDecimal getRegisteredCapital() {
+        return registeredCapital;
+    }
+
+    public void setRegisteredCapital(BigDecimal registeredCapital) {
+        this.registeredCapital = registeredCapital;
+    }
+
+    public String getBusinessScope() {
+        return businessScope;
+    }
+
+    public void setBusinessScope(String businessScope) {
+        this.businessScope = businessScope;
+    }
+
+    @Override
+    public String getRemark() {
+        return remark;
+    }
+
+    @Override
+    public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
     public Long getDeptId()
     {
         return deptId;

+ 9 - 1
health-common/src/main/java/com/bzd/common/utils/uuid/IdUtils.java

@@ -26,7 +26,15 @@ public class IdUtils
     {
         return UUID.randomUUID().toString(true);
     }
-
+    /**
+     * 简化的UUID,去掉了横线
+     *
+     * @return 简化的UUID,去掉了横线
+     */
+    public static int get5randomNumber()
+    {
+        return UUID.getrandomNumber();
+    }
     /**
      * 获取随机UUID,使用性能更好的ThreadLocalRandom生成UUID
      *

+ 89 - 0
health-common/src/main/java/com/bzd/common/utils/uuid/SnowflakeIdGenerator.java

@@ -0,0 +1,89 @@
+package com.bzd.common.utils.uuid;
+
+public class SnowflakeIdGenerator {
+    /**
+     * 开始时间:2020-01-01 00:00:00
+     */
+    private final long beginTs = 1577808000000L;
+    private final long workerIdBits = 10;
+    /**
+     * 2^10 - 1 = 1023
+     */
+    private final long maxWorkerId = -1L ^ (-1L << workerIdBits);
+    private final long sequenceBits = 12;
+    /**
+     * 2^12 - 1 = 4095
+     */
+    private final long maxSequence = -1L ^ (-1L << sequenceBits);
+    /**
+     * 时间戳左移22位
+     */
+    private final long timestampLeftOffset = workerIdBits + sequenceBits;
+    /**
+     * 业务ID左移12位
+     */
+    private final long workerIdLeftOffset = sequenceBits;
+    /**
+     * 合并了机器ID和数据标示ID,统称业务ID,10位
+     */
+    private long workerId;
+    /**
+     * 毫秒内序列,12位,2^12 = 4096个数字
+     */
+    private long sequence = 0L;
+    /**
+     * 上一次生成的ID的时间戳,同一个worker中
+     */
+    private long lastTimestamp = -1L;
+    /**
+     *
+     * 雪花算法工具类的构造方法,需要传入实例id和集群id,在构造函数内首先判断是否超过最大的实例id并且实例id是否小于0,
+     * 同样的去判断数据中心id,如果不符合要求,则抛出参数异常
+     */
+    private SnowflakeIdGenerator(long workerId) {
+        if (workerId > maxWorkerId || workerId < 0) {
+            throw new IllegalArgumentException(String.format("WorkerId必须大于或等于0且小于或等于%d", maxWorkerId));
+        }
+
+        this.workerId = workerId;
+    }
+    public synchronized long nextId() {
+        long ts = System.currentTimeMillis();
+        if (ts < lastTimestamp) {
+            throw new RuntimeException(String.format("系统时钟回退了%d毫秒", (lastTimestamp - ts)));
+        }
+        // 同一时间内,则计算序列号
+        if (ts == lastTimestamp) {
+            // 序列号溢出
+            if (++sequence > maxSequence) {
+                ts = tilNextMillis(lastTimestamp);
+                sequence = 0L;
+            }
+        } else {
+            // 时间戳改变,重置序列号
+            sequence = 0L;
+        }
+        lastTimestamp = ts;
+        // 左移后,低位补0,进行按位或运算相当于二进制拼接
+        // 本来高位还有个0<<63,0与任何数字按位或都是本身,所以写不写效果一样
+        return (ts - beginTs) << timestampLeftOffset | workerId << workerIdLeftOffset | sequence;
+    }
+    /**
+     * 阻塞到下一个毫秒
+     */
+    private long tilNextMillis(long lastTimestamp) {
+        long ts = System.currentTimeMillis();
+        while (ts <= lastTimestamp) {
+            ts = System.currentTimeMillis();
+        }
+
+        return ts;
+    }
+    //单例模式
+    private static final SnowflakeIdGenerator instance = new SnowflakeIdGenerator(1);
+    public static long newId(){
+        return instance.nextId();
+    }
+
+
+}

+ 18 - 1
health-common/src/main/java/com/bzd/common/utils/uuid/UUID.java

@@ -1,11 +1,12 @@
 package com.bzd.common.utils.uuid;
 
+import com.bzd.common.exception.UtilException;
+
 import java.security.MessageDigest;
 import java.security.NoSuchAlgorithmException;
 import java.security.SecureRandom;
 import java.util.Random;
 import java.util.concurrent.ThreadLocalRandom;
-import com.bzd.common.exception.UtilException;
 
 /**
  * 提供通用唯一识别码(universally unique identifier)(UUID)实现
@@ -481,4 +482,20 @@ public final class UUID implements java.io.Serializable, Comparable<UUID>
     {
         return ThreadLocalRandom.current();
     }
+    /**
+     * 获取随机数生成器对象<br>
+     * ThreadLocalRandom是JDK 7之后提供并发产生随机数,能够解决多个线程发生的竞争争夺。
+     *
+     * @return {@link ThreadLocalRandom}
+     */
+    public static int getrandomNumber()
+    { // 创建一个SecureRandom对象
+        SecureRandom secureRandom = new SecureRandom();
+
+        // 生成一个5位数的随机数
+        int randomNumber = 10000 + secureRandom.nextInt(90000);
+
+        return randomNumber;
+    }
+
 }

+ 13 - 4
health-system/src/main/java/com/bzd/system/service/DTPService.java

@@ -52,7 +52,10 @@ public class DTPService {
     public Object findOne(final PageData pd) throws Exception {
         return daoSupport.findForObject("DTPMapper.selectOne", pd);
     }
-
+    @Transactional(rollbackFor = Exception.class)
+    public Integer BandingRecipe(PageData pd)throws Exception {
+        return daoSupport.update("DTPMapper.BangdingRecipe", pd);
+    }
     /**
      * 处方登记 添加
      *
@@ -66,12 +69,15 @@ public class DTPService {
         Object prescriptionNumber = pd.get("prescriptionNumber");
         Object prescriptionImg = pd.get("prescriptionImg");
         Object prescriptionDate =pd.get("prescriptionDate");
-        if (StringUtils.isNull(prescriptionNumber)) {
+        if (StringUtils.isEmpty(prescriptionNumber.toString())) {
             pd.put("prescriptionNumber", IdUtils.fastSimpleUUID());//处方表 处方单号 如果没有就自动生成
-            if( StringUtils.isNull(prescriptionImg)){
+            if( StringUtils.isEmpty(prescriptionImg.toString())){
                 pd.put("status",5);//待上传处方
             }
-            if( StringUtils.isNull(prescriptionDate)){
+            if( StringUtils.isNotEmpty(prescriptionImg.toString())){
+                pd.put("status",6);//待绑定患者6
+            }
+            if( StringUtils.isEmpty(prescriptionDate.toString())){
                 pd.put("prescriptionDate", DateUtils.getTime());
             }
 
@@ -81,6 +87,7 @@ public class DTPService {
         String Id = IdUtils.fastSimpleUUID();
         List<PageData> addList = new ArrayList<>();
         Object drugList = pd.get("drugList");//获取药品信息列表
+
         if (StringUtils.isNotNull(drugList)) {
             try {
                 // 将 JSON 字符串转换为 List<Map<String, Object>>
@@ -95,6 +102,7 @@ public class DTPService {
                         pageData.put("productName", lxr.get("productName"));
                         pageData.put("genericName", lxr.get("genericName"));
                         pageData.put("prescriptionNumber", Id);//处方药品信息表d的处方单号是处方表的主键id
+                        pageData.put("patientId", pd.get("patientId"));
                         pageData.put("specification", lxr.get("specification"));
                         pageData.put("usageMethod", lxr.get("usageMethod"));
                         pageData.put("quantity", lxr.get("quantity"));
@@ -123,6 +131,7 @@ public class DTPService {
         }
         pd.put("id", Id);//处方单表id主键
         pd.put("isFlipItem", isFlipItemStr);//是否包含有上翻品
+        pd.put("storeId", getSysUser().getDeptId());
        int result = daoSupport.save("DTPMapper.insertRecipe", pd);
         PageData resultpageData = new PageData();
        if(result>0){

+ 83 - 6
health-system/src/main/java/com/bzd/system/service/PharmaceuticalService.java

@@ -3,9 +3,11 @@ package com.bzd.system.service;
 import com.bzd.common.config.dao.DaoBase;
 import com.bzd.common.config.dao.DaoSupport;
 import com.bzd.common.config.dao.PageData;
+import com.bzd.common.core.domain.entity.SysUser;
 import com.bzd.common.utils.DateUtils;
 import com.bzd.common.utils.StringUtils;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import com.github.pagehelper.util.StringUtil;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
@@ -32,12 +34,22 @@ public class PharmaceuticalService {
 
     public List<PageData> findArchivesList(PageData pd) throws Exception{
         return (List<PageData>) daoSupport.findForList("PharmaceuticalServiceMapper.selectArchivesList", pd);
-//        pd.put("archiveId", pd.get("id"));
-//        List<PageData> listBasicInfomation= (List<PageData>) daoSupport.findForList("PharmaceuticalServiceMapper.selectPatientBasicInfo", pd);
-//        list.addAll(listBasicInfomation);
-//        return list;
+    }
+    public List<PageData> getDrugPurchaseList(PageData pd) throws Exception{
+        return (List<PageData>) daoSupport.findForList("PharmaceuticalServiceMapper.getDrugPurchaseList", pd);
+    }
+
+    public List<PageData> slectPatientByNameOrPhone(PageData pd) throws Exception{
+       Object query= pd.get("query");
+       if(StringUtil.isNotEmpty(query.toString())){
+           return (List<PageData>) daoSupport.findForList("PharmaceuticalServiceMapper.slectPatientByNameOrPhone", pd);
+       }else {
+           List<PageData> list=new ArrayList();
+           return list;
+       }
 
     }
+
     public List<PageData> findBasicInfomation(PageData pd) throws Exception{
         pd.put("archiveId", pd.get("id"));
         List<PageData> listBasicInfomation= (List<PageData>) daoSupport.findForList("PharmaceuticalServiceMapper.selectPatientBasicInfo", pd);
@@ -179,6 +191,20 @@ public class PharmaceuticalService {
         pd.put("updateTime", DateUtils.getTime());//更新时间
         return daoSupport.update("PharmaceuticalServiceMapper.updateArchives", pd);
     }
+    public Integer ShaoMaShangFan(PageData pd)throws Exception {
+        //微信扫码绑定为会员 状态改为 上翻 flipStatus=1
+        pd.put("flipStatus",1);
+        pd.put("updateTime",DateUtils.getTime());
+        pd.put("archiveCreator", getSysUser().getLoginName());
+        return daoSupport.update("PharmaceuticalServiceMapper.ShaoMaShangFan", pd);
+    }
+    public Integer unbound(PageData pd)throws Exception {
+        //解除绑定会员 状态改为 未上翻 flipStatus=2
+        pd.put("flipStatus",2);
+        pd.put("updateTime",DateUtils.getTime());
+        pd.put("archiveCreator", getSysUser().getLoginName());
+        return daoSupport.update("PharmaceuticalServiceMapper.unbound", pd);
+    }
 
     public List<PageData> findrecordsByarchiveId(PageData pd) throws Exception{
         return (List<PageData>) daoSupport.findForList("PharmaceuticalServiceMapper.findrecordsByarchiveId", pd);
@@ -224,7 +250,40 @@ public class PharmaceuticalService {
     }
 
     public List<PageData> findPatientCounselingList(PageData pd) throws Exception{
-        return (List<PageData>) daoSupport.findForList("PharmaceuticalServiceMapper.selectPatientCounselingList", pd);
+        pd.put("storeId",getSysUser().getDeptId());
+        return (List<PageData>) daoSupport.findForList("PharmaceuticalServiceMapper.selectConsultationAndDrug", pd);
+
+    }
+    public List<PageData> findPatientCounselingById(PageData pd) throws Exception{
+        return (List<PageData>) daoSupport.findForList("PharmaceuticalServiceMapper.findPatientCounselingById", pd);
+
+    }
+    public List<PageData> getAllPatients(PageData pd) throws Exception{
+        return (List<PageData>) daoSupport.findForList("PharmaceuticalServiceMapper.getAllPatients", pd);
+
+    }
+
+    public Integer insertPatientConsultation(PageData pd) throws Exception{
+        Object patientIdObj = pd.get("patientId");
+        Object KnowledgeLinksValue = pd.get("KnowledgeLinksValue");
+        if (StringUtils.isNotNull(KnowledgeLinksValue)) {
+            pd.put("KnowledgeLink", KnowledgeLinksValue);
+        }
+
+        if (StringUtils.isNotNull(patientIdObj)) {
+            List<PageData> patientList = (List<PageData>) daoSupport.findForList("PharmaceuticalServiceMapper.selectPatientById", pd);
+            if (patientList != null && !patientList.isEmpty()) {
+                PageData patientData = patientList.get(0);
+                pd.put("gender", patientData.get("gender"));
+                pd.put("age", patientData.get("age"));
+                pd.put("patientName", patientData.get("name"));
+                pd.put("patientPhone", patientData.get("phoneNumber"));
+                pd.put("disease", patientData.get("diseaseType"));
+            }
+        }
+        pd.put("storeId", getSysUser().getDeptId());
+        pd.put("storeName", getSysUser().getDept().getDeptName());
+        return daoSupport.update("PharmaceuticalServiceMapper.insertPatientConsultation", pd);
 
     }
 
@@ -234,6 +293,12 @@ public class PharmaceuticalService {
 
 
     public Integer updatePatientCounseling(PageData pd)throws Exception {
+        Object KnowledgeLinksValue = pd.get("KnowledgeLinksValue");
+        if (StringUtils.isNotNull(KnowledgeLinksValue)) {
+            pd.put("KnowledgeLink", KnowledgeLinksValue);
+        }
+        pd.put("updateDate", DateUtils.getTime());
+        pd.put("regenerator", getSysUser().getLoginName());
         return daoSupport.update("PharmaceuticalServiceMapper.updatePatientCounseling", pd);
     }
 
@@ -253,19 +318,31 @@ public class PharmaceuticalService {
     }
 
     public boolean checkPatientIsExist(PageData pd) throws Exception{
-        Object PageData =daoSupport.findForObject("PharmaceuticalServiceMapper.checkPatientIsExist", pd);
+        Object PageData =daoSupport.findForList("PharmaceuticalServiceMapper.checkPatientIsExist", pd);
         return StringUtils.isNull(PageData);
 
     }
+    public Object selectPatientById(PageData pd) throws Exception{
+        Object PageData =daoSupport.findForList("PharmaceuticalServiceMapper.selectPatientById", pd);
+        return PageData;
+
+    }
+
     /**
      * 新建患者档案
      */
     public Integer addArchives(PageData pd)throws Exception {
+        Object storeName = pd.get("storeName");
+        if (StringUtils.isNull(storeName)) {
+            pd.put("storeName", getSysUser().getDept().getDeptName());
+        }
+        pd.put("storeId", getSysUser().getDeptId());//这里系统先自动获取系统所登录的门店
         pd.put("creator", getSysUser().getLoginName());//创建人
         pd.put("createTime", DateUtils.getTime());//创建时间
         pd.put("archiveCreator", getSysUser().getLoginName());//档案创建人
         pd.put("archiveCompleteStatus", 0);//档案是否完善 1已完善 0未完善
         pd.put("realNameStatus", 0);//是否实名 1已经实名 0未实名 待对接服务校验
+
         return daoSupport.update("PharmaceuticalServiceMapper.insertArchiveRecord", pd);
     }
 }

+ 121 - 3
health-system/src/main/java/com/bzd/system/service/dtp/SDtpYypzFollowUpSopService.java

@@ -3,18 +3,27 @@ package com.bzd.system.service.dtp;
 import com.bzd.common.config.dao.DaoBase;
 import com.bzd.common.config.dao.DaoSupport;
 import com.bzd.common.config.dao.PageData;
+import com.bzd.common.utils.DateUtils;
+import com.bzd.common.utils.StringUtils;
+import com.bzd.common.utils.uuid.SnowflakeIdGenerator;
+import com.fasterxml.jackson.databind.ObjectMapper;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import javax.annotation.Resource;
+import java.util.ArrayList;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
+
+import static com.bzd.common.utils.ShiroUtils.getSysUser;
 
 
 /**
 *
 * 随访SOP表 service
-* @author LiXiangFei
+* @author wsp
 * @since 2024-10-15
 */
 
@@ -26,9 +35,118 @@ public class SDtpYypzFollowUpSopService {
 
     @Resource(name = "daoSupport")
     private DaoSupport daoSupport;
+    @Transactional(rollbackFor = Exception.class)
+    public Integer addSDtpYypzFollowUpSop(PageData pd) throws Exception {
+        Long templateId = SnowflakeIdGenerator.newId();
+        Object nodesDataList = pd.get("nodesData");
+        List<PageData> nodeList = new ArrayList<>();
+        List<PageData> addList = new ArrayList<>();
+        Object drugList = pd.get("applicableDrug");//获取药品信息列表
+
+        if (StringUtils.isNotNull(drugList)) {
+            try {
+                // 将 JSON 字符串转换为 List<Map<String, Object>>
+                ObjectMapper objectMapper = new ObjectMapper();
+                List<Map<String, Object>> rowsdrugList = objectMapper.readValue(drugList.toString(), List.class);
+                // 遍历列表并调用插入数据接口
+                if (rowsdrugList.size() > 0) {
+                    for (Map<String, Object> lxr : rowsdrugList) {
+                        PageData pageData = new PageData();
+                        pageData.put("creator", getSysUser().getLoginName());
+                        pageData.put("createTime", DateUtils.getTime());
+                        pageData.put("productName", lxr.get("productName"));
+                        pageData.put("genericName", lxr.get("genericName"));
+                        pageData.put("mdmCode", lxr.get("mdmCode"));
+                        pageData.put("specification", lxr.get("specification"));
+                        pageData.put("isFlipItem", lxr.get("isFlipItem"));
+                        pageData.put("soptemplateId", templateId);
+                        addList.add(pageData);
+                    }
+                    final HashMap<String, Object> addMap = new HashMap<String, Object>();
+                    addMap.put("dataList", addList);
+                    int resultDrug= dao.executeBatch("DTPMapper.batchAddPrescriptionDrug", addMap);
+                    if (resultDrug <= 0) {
+                        throw new RuntimeException("药品信息插入失败");
+                    }
+                }
+
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+
+        }
+       if (StringUtils.isNotNull(nodesDataList)) {
+        try {
+            // 将 JSON 字符串转换为 List<Map<String, Object>>
+            ObjectMapper objectMapper = new ObjectMapper();
+            List<Map<String, Object>> nodesList = objectMapper.readValue(nodesDataList.toString(), List.class);
+            // 遍历列表并调用插入数据接口
+            if (nodesList.size() > 0) {
+            for (Map<String, Object> lxr : nodesList) {
+                    PageData pageData = new PageData();
+                    pageData.put("creator", getSysUser().getLoginName());
+                    pageData.put("createTime", DateUtils.getTime());
+                    pageData.put("sopTemplateId", templateId);
+                    pageData.put("nodeName", lxr.get("nodeName"));
+                    pageData.put("activateStructures", lxr.get("activateStructures"));
+                    pageData.put("activateWhichDay", lxr.get("activateWhichDay"));
+                    pageData.put("activateNodeRule", lxr.get("activateNodeRule"));
+                    pageData.put("createTaskStructures", lxr.get("createTaskStructures"));
+                    pageData.put("createTaskWhen", lxr.get("createTaskWhen"));
+                    pageData.put("createTaskEvery", lxr.get("createTaskEvery"));
+                    pageData.put("createTaskDi", lxr.get("createTaskDi"));
+                    pageData.put("createTaskTriggerValue", lxr.get("createTaskTriggerValue"));
+                    pageData.put("createTaskExecutionTimes", lxr.get("createTaskExecutionTimes"));
+                    pageData.put("taskActionMode", lxr.get("taskActionMode"));
+                    pageData.put("taskActionTaskType", lxr.get("taskActionTaskType"));
+                    pageData.put("taskActionRole", lxr.get("taskActionRole"));
+                    pageData.put("generationDaysAfter", lxr.get("generationDaysAfter"));
+                    pageData.put("generationHMS", lxr.get("generationHMS"));
+                    pageData.put("followUpSubject", lxr.get("followUpSubject"));
+                    pageData.put("taskValidity", lxr.get("taskValidity"));
+                    pageData.put("taskMaterial", lxr.get("taskMaterial"));
+                    pageData.put("deliveryChannel", lxr.get("deliveryChannel"));
+                    pageData.put("smsId",lxr.get("smsId"));
+                    pageData.put("useForm",lxr.get("useForm"));
+                    pageData.put("creator",getSysUser().getLoginName());
+                    pageData.put("createTime",DateUtils.getTime());
+                    pageData.put("status",0);//0已创建 1启用,2禁用
+                    pageData.put("deliveryChannel",lxr.get("createTaskStructures"));
+                    // 处理 过滤条件 filtersData
+                    @SuppressWarnings("unchecked")
+                    List<Map<String, Object>> filtersData = (List<Map<String, Object>>) lxr.get("filtersData");
+                    if (filtersData != null && !filtersData.isEmpty()) {
+                        String filtersDataJson = objectMapper.writeValueAsString(filtersData);
+                        pageData.put("filterCondition", filtersDataJson);
+                    }
 
-    public Integer addSDtpYypzFollowUpSop(PageData pd)throws Exception {
-        return daoSupport.update("SDtpYypzFollowUpSopMapper.addSDtpYypzFollowUpSop", pd);
+                    nodeList.add(pageData);
+                }
+                final HashMap<String, Object> addMap = new HashMap<String, Object>();
+                addMap.put("dataList", nodeList);
+                int node= dao.executeBatch("SDtpYypzFollowUpSopMapper.batchAddNodeConfig", addMap);
+                if (node <= 0) {
+                    throw new RuntimeException("节点配置插入失败");
+                }
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+    }
+        System.out.println("getSysUser().getDeptId():"+getSysUser().getDeptId());
+        pd.put("createdTime", DateUtils.getTime());//创建时间
+        pd.put("createdBy", getSysUser().getLoginName());//'创建人
+        pd.put("storeId",getSysUser().getDeptId().toString());//门店id
+        pd.put("storeName",getSysUser().getDept().getDeptName());//门店名称
+        pd.put("status","已创建");//状态: 0已创建 1启用,2禁用
+        pd.put("templateId", templateId);
+        int result =  daoSupport.update("SDtpYypzFollowUpSopMapper.addSDtpYypzFollowUpSop", pd);
+        if (result <= 0) {
+            throw new RuntimeException("主记录插入失败");
+        }
+        return result;
     }
 
     public List<PageData> findSDtpYypzFollowUpSopList(PageData pd) throws Exception{

+ 118 - 0
health-system/src/main/java/com/bzd/system/service/gxhpz/DrugConfigService.java

@@ -0,0 +1,118 @@
+package com.bzd.system.service.gxhpz;
+
+import com.bzd.common.config.dao.DaoBase;
+import com.bzd.common.config.dao.DaoSupport;
+import com.bzd.common.config.dao.PageData;
+import com.bzd.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import javax.annotation.Resource;
+import java.util.List;
+import static com.bzd.common.utils.ShiroUtils.getSysUser;
+
+@Service
+public class DrugConfigService {
+    @Autowired
+    private DaoBase dao;
+
+    @Resource(name = "daoSupport")
+    private DaoSupport daoSupport;
+
+    /**
+     * 查询列表
+     * @param pd
+     * @return
+     * @throws Exception
+     */
+    public List<PageData> findForList(final PageData pd) throws Exception {
+        return (List<PageData>) daoSupport.findForList("drugConfigMapper.selectDrugConfig", pd);
+    }
+
+    /**
+     * 查询单个
+     * @param pd
+     * @return
+     * @throws Exception
+     */
+    public Object findOne(final PageData pd) throws Exception {
+        return daoSupport.findForObject("drugConfigMapper.selectOne", pd);
+    }
+
+    /**
+     * 添加
+     * @param pd
+     * @return
+     * @throws Exception
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public PageData save(final PageData pd) throws Exception {
+        pd.put("createTime", DateUtils.getTime());//处方表 处方单号时间
+        pd.put("id", "Id");//处方单表id主键
+        pd.put("storeId", getSysUser().getDeptId());
+        int result = daoSupport.save("drugConfigMapper.addDrugConfig", pd);
+        PageData resultpageData = new PageData();
+        if(result>0){
+            resultpageData.put("id", "Id");//处方单表id主键
+            Object prescription =  daoSupport.findForObject("drugConfigMapper.selectOne", resultpageData);
+            resultpageData.put("result", "200");
+            resultpageData.put("prescription", prescription);
+            return resultpageData;
+        }else{
+            resultpageData.put("id", "Id");//处方单表id主键
+            resultpageData.put("result","300");
+            return resultpageData;
+        }
+    }
+
+    /**
+     * 删除
+     * @param ids
+     * @return
+     * @throws Exception
+     */
+    public Integer del(List<String> ids) throws Exception {
+        return daoSupport.delete("drugConfigMapper.deleteDrugConfigsByIds", ids);
+    }
+
+    /**
+     * 修改
+     * @param pd
+     * @return
+     * @throws Exception
+     */
+    public Integer update(PageData pd) throws Exception {
+        return daoSupport.update("drugConfigMapper.updateDrugConfig", pd);
+    }
+
+    /**
+     * 启用停用配置
+     * @param pd
+     * @return
+     * @throws Exception
+     */
+    public Integer changeStatus(PageData pd) throws Exception {
+        pd.put("updatedTime", DateUtils.getTime());
+        pd.put("updatedBy", getSysUser().getUserId());
+        return daoSupport.update("drugConfigMapper.changeStatus", pd);
+    }
+
+    /**
+     * 启用停用配置
+     * @param pd
+     * @return
+     * @throws Exception
+     */
+    public Integer changedvalueStatus(PageData pd) throws Exception {
+        pd.put("updatedTime", DateUtils.getTime());
+        pd.put("updatedBy", getSysUser().getUserId());
+        return daoSupport.update("drugConfigMapper.changedvalueStatus", pd);
+    }
+    /**配置药查询**/
+    public List<PageData> getAllDrugs(final PageData pd) throws Exception {
+        return (List<PageData>) daoSupport.findForList("drugConfigMapper.getAllDrugConfig", pd);
+    }
+
+
+}

+ 174 - 0
health-system/src/main/java/com/bzd/system/service/gxhpz/DvalueConfigService.java

@@ -0,0 +1,174 @@
+package com.bzd.system.service.gxhpz;
+
+import com.bzd.common.config.dao.DaoBase;
+import com.bzd.common.config.dao.DaoSupport;
+import com.bzd.common.config.dao.PageData;
+import com.bzd.common.utils.DateUtils;
+import com.bzd.common.utils.StringUtils;
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import javax.annotation.Resource;
+import java.util.List;
+import java.util.Map;
+
+import static com.bzd.common.utils.ShiroUtils.getSysUser;
+
+@Service
+public class DvalueConfigService {
+    @Autowired
+    private DaoBase dao;
+    @Resource(name = "daoSupport")
+    private DaoSupport daoSupport;
+
+    /**
+     * 查询列表
+     * @param pd
+     * @return
+     * @throws Exception
+     */
+    public List<PageData> findForList(final PageData pd) throws Exception {
+        return (List<PageData>) daoSupport.findForList("dvalueConfigMapper.selectDValueConfig", pd);
+    }
+
+    /**
+     * 查询单个
+     * @param pd
+     * @return
+     * @throws Exception
+     */
+    public Object findOne(final PageData pd) throws Exception {
+        return daoSupport.findForObject("dvalueConfigMapper.selectOne", pd);
+    }
+
+    /**
+     * 添加
+     * @param pd
+     * @return
+     * @throws Exception
+     */
+    @Transactional(rollbackFor = Exception.class)
+    public int save(final PageData pd) throws Exception {
+        Integer  saveStatusIn=null;
+        int result1=0;
+        int result2=0;
+        pd.put("createdBy", getSysUser().getUserId());
+        pd.put("updatedBy", getSysUser().getUserId());
+        pd.put("updatedTime", DateUtils.getTime());
+        pd.put("createdTime", DateUtils.getTime());
+        String saveStatus = (String) pd.get("saveStatus");
+        String dValueId = (String) pd.get("dValueId");
+        Object drugData =pd.get("drugData");
+        if(!dValueId.equals("") && drugData!=null){
+            pd.put("dValueCode", dValueId);
+        }
+        if(saveStatus.equals("保存")){
+            saveStatusIn=0;
+        }
+        if(saveStatus.equals("保存并启用")){
+            saveStatusIn= 1;
+        }
+        daoSupport.save("dvalueConfigMapper.updateDValue", pd);
+        PageData pd2=new PageData();
+        pd2.put("dValueCode",dValueId);
+        pd2= (PageData) daoSupport.findForObject("dvalueConfigMapper.selectOne", pd);
+        if(pd2!=null){
+            pd.put("dValueName", pd2.get("dValueName"));
+        }
+        if(StringUtils.isNotNull(drugData)){
+            try {
+                // 将 JSON 字符串转换为 List<Map<String, Object>>
+                ObjectMapper objectMapper = new ObjectMapper();
+                List<Map<String, Object>> rowsList = objectMapper.readValue(drugData.toString(), List.class);
+
+                // 遍历列表并调用插入数据接口
+                for (Map<String, Object> hbs : rowsList) {
+                    PageData pd3=new PageData();
+                    PageData pd4=new PageData();
+                    pd4.put("dValueCode", pd.get("dValueCode"));
+                    pd4.put("dValueName", pd2.get("dValueName"));
+                    pd4.put("mdmCode", hbs.get("mdmCode"));
+                    pd4.put("updatedBy", pd.get("updatedBy"));
+                    pd4.put("updatedTime", pd.get("updatedTime"));
+                    pd4.put("dvalueStatus", saveStatusIn);
+
+                    pd3.put("dValueCode", pd.get("dValueCode"));
+                    pd3.put("dValueName", pd2.get("dValueName"));
+                    pd3.put("mdmCode", hbs.get("mdmCode"));
+                    pd3.put("specification", hbs.get("specification"));
+                    pd3.put("genericName", hbs.get("genericName"));
+                    pd3.put("icdIndication", hbs.get("icdIndication"));
+                    pd3.put("indicationCode", hbs.get("indicationCode"));
+                    pd3.put("administrationMethod", hbs.get("administrationMethod"));
+                    pd3.put("unit", hbs.get("unit"));
+                    pd3.put("dosage", hbs.get("dosage"));
+                    pd3.put("frequency", hbs.get("frequency"));
+                   // pd3.put("createdBy", pd.get("createdBy"));
+                    //pd3.put("createdTime", pd.get("createdTime"));
+                    pd3.put("updatedBy", pd.get("updatedBy"));
+                    pd3.put("updatedTime", pd.get("updatedTime"));
+                    pd3.put("status",  saveStatusIn);
+                    pd3.put("remarks", pd.get("remarks"));
+                     result1 =  daoSupport.save("dvalueConfigMapper.updateDValue", pd3);
+                     result2 = daoSupport.save("drugConfigMapper.updateDrugConfigByDrugCode", pd4);
+                    //daoSupport.save("dvalueConfigMapper.insertDValueConfig", pd3);
+
+                }
+            } catch (Exception e) {
+                e.printStackTrace();
+            }
+        }
+        if(result1>0 && result2>0){
+            return 1;
+        }else{
+            return 0;
+        }
+
+
+    }
+
+    /**
+     * 删除
+     * @param ids
+     * @return
+     * @throws Exception
+     */
+    public Integer del(List<String> ids) throws Exception {
+        return daoSupport.delete("dvalueConfigMapper.deleteDvalueConfigByIds", ids);
+    }
+
+    /**
+     * 修改配置
+     * @param pd
+     * @return
+     * @throws Exception
+     */
+    public Integer update(PageData pd) throws Exception {
+        return daoSupport.update("dvalueConfigMapper.updateDValueConfig", pd);
+    }
+
+    /**
+     * 启用停用D值配置
+     * @param pd
+     * @return
+     * @throws Exception
+     */
+    public Integer changeStatus(PageData pd) throws Exception {
+        pd.put("updatedTime", DateUtils.getTime());
+        pd.put("updatedBy", getSysUser().getUserId());
+        return daoSupport.update("dvalueConfigMapper.changeStatus", pd);
+    }
+    /**
+     * 启用停用D值配关联
+     * @param pd
+     * @return
+     * @throws Exception
+     */
+    public Integer changedvalueStatus(PageData pd) throws Exception {
+        pd.put("updatedTime", DateUtils.getTime());
+        pd.put("updatedBy", getSysUser().getUserId());
+        return daoSupport.update("dvalueConfigMapper.changedvalueStatus", pd);
+    }
+
+}

+ 326 - 1
health-system/src/main/resources/mapper/dtp/SDtpYypzFollowUpSopMapper.xml

@@ -20,6 +20,12 @@
         <if test="templateId !=null and templateId !='' ">
             and templateId = #{templateId}
         </if>
+        <if test="storeName !=null and storeName !='' ">
+            and storeName= #{storeName}
+        </if>
+        <if test="storeId !=null and storeId !='' ">
+            and storeId=  #{storeId}
+        </if>
         <if test="createdBy !=null and createdBy !='' ">
             and createdBy = #{createdBy}
         </if>
@@ -50,6 +56,12 @@
         <if test="templateName !=null and templateName !='' ">
             templateName = #{templateName},
         </if>
+        <if test="storeName !=null and storeName !='' ">
+            storeName= #{storeName},
+        </if>
+        <if test="storeId !=null and storeId !='' ">
+            storeId=  #{storeId},
+        </if>
         <if test="templateId !=null and templateId !='' ">
             templateId = #{templateId},
         </if>
@@ -99,6 +111,12 @@
         <if test="templateName !=null and templateName !='' ">
             templateName,
         </if>
+        <if test="storeName !=null and storeName !='' ">
+            storeName,
+        </if>
+        <if test="storeId !=null and storeId !=''">
+            storeId,
+        </if>
         <if test="templateId !=null and templateId !='' ">
             templateId,
         </if>
@@ -128,8 +146,15 @@
         <if test="templateName !=null and templateName !='' ">
              #{templateName},
         </if>
+
+        <if test="storeName !=null and storeName !='' ">
+             #{storeName},
+        </if>
+        <if test="storeId !=null and storeId !=''">
+            #{storeId},
+        </if>
         <if test="templateId !=null and templateId !='' ">
-             #{templateId},
+            #{templateId},
         </if>
         <if test="createdBy !=null and createdBy !='' ">
              #{createdBy},
@@ -150,4 +175,304 @@
 
     </insert>
 
+
+    <insert id="insertNodeConfig" parameterType="pd">
+        INSERT INTO s_dtp_yypz_nodeconfig
+        <trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
+            <if test="sopTemplateId != null and sopTemplateId != ''">sopTemplateId,</if>
+            <if test="nodeName != null and nodeName != ''">nodeName,</if>
+            <if test="nodeCode != null and nodeCode != ''">nodeCode,</if>
+            <if test="activateStructures != null and activateStructures != ''">activateStructures,</if>
+            <if test="activateWhichDay != null and activateWhichDay != ''">activateWhichDay,</if>
+            <if test="activateNodeRule != null and activateNodeRule != ''">activateNodeRule,</if>
+            <if test="createTaskStructures != null and createTaskStructures != ''">createTaskStructures,</if>
+            <if test="createTaskWhen != null and createTaskWhen != ''">createTaskWhen,</if>
+            <if test="createTaskEvery != null and createTaskEvery != ''">createTaskEvery,</if>
+            <if test="createTaskDi != null and createTaskDi != ''">createTaskDi,</if>
+            <if test="createTaskTriggerValue != null and createTaskTriggerValue != ''">createTaskTriggerValue,</if>
+            <if test="createTaskExecutionTimes != null and createTaskExecutionTimes != ''">createTaskExecutionTimes,</if>
+            <if test="filterCondition != null">filterCondition,</if>
+            <if test="trait != null and trait != ''">trait,</if>
+            <if test="traitValue != null and traitValue != ''">traitValue,</if>
+            <if test="judgingCondition != null and judgingCondition != ''">judgingCondition,</if>
+            <if test="judgmentValue != null and judgmentValue != ''">judgmentValue,</if>
+            <if test="taskActionMode != null and taskActionMode != ''">taskActionMode,</if>
+            <if test="taskActionTaskType != null and taskActionTaskType != ''">taskActionTaskType,</if>
+            <if test="taskActionRole != null and taskActionRole != ''">taskActionRole,</if>
+            <if test="generationDaysAfter != null and generationDaysAfter != ''">generationDaysAfter,</if>
+            <if test="generationHMS != null and generationHMS != ''">generationHMS,</if>
+            <if test="followUpSubject != null and followUpSubject != ''">followUpSubject,</if>
+            <if test="taskValidity != null">taskValidity,</if>
+            <if test="taskMaterial != null and taskMaterial != ''">taskMaterial,</if>
+            <if test="deliveryChannel != null and deliveryChannel != ''">deliveryChannel,</if>
+            <if test="smsId != null and smsId != ''">smsId,</if>
+            <if test="useForm != null and useForm != ''">useForm,</if>
+            <if test="creator != null and creator != ''">creator,</if>
+            <if test="createTime != null and createTime != ''">createTime,</if>
+            <if test="status != null and status != ''">status</if>
+        </trim>
+        <trim prefix="VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
+            <if test="sopTemplateId != null and sopTemplateId != ''">#{sopTemplateId},</if>
+            <if test="nodeName != null and nodeName != ''">#{nodeName},</if>
+            <if test="nodeCode != null and nodeCode != ''">#{nodeCode},</if>
+            <if test="activateStructures != null and activateStructures != ''">#{activateStructures},</if>
+            <if test="activateWhichDay != null and activateWhichDay != ''">#{activateWhichDay},</if>
+            <if test="activateNodeRule != null and activateNodeRule != ''">#{activateNodeRule},</if>
+            <if test="createTaskStructures != null and createTaskStructures != ''">#{createTaskStructures},</if>
+            <if test="createTaskWhen != null and createTaskWhen != ''">#{createTaskWhen},</if>
+            <if test="createTaskEvery != null and createTaskEvery != ''">#{createTaskEvery},</if>
+            <if test="createTaskDi != null and createTaskDi != ''">#{createTaskDi},</if>
+            <if test="createTaskTriggerValue != null and createTaskTriggerValue != ''">#{createTaskTriggerValue},</if>
+            <if test="createTaskExecutionTimes != null and createTaskExecutionTimes != ''">#{createTaskExecutionTimes},</if>
+            <if test="filterCondition != null">#{filterCondition},</if>
+            <if test="trait != null and trait != ''">#{trait},</if>
+            <if test="traitValue != null and traitValue != ''">#{traitValue},</if>
+            <if test="judgingCondition != null and judgingCondition != ''">#{judgingCondition},</if>
+            <if test="judgmentValue != null and judgmentValue != ''">#{judgmentValue},</if>
+            <if test="taskActionMode != null and taskActionMode != ''">#{taskActionMode},</if>
+            <if test="taskActionTaskType != null and taskActionTaskType != ''">#{taskActionTaskType},</if>
+            <if test="taskActionRole != null and taskActionRole != ''">#{taskActionRole},</if>
+            <if test="generationDaysAfter != null and generationDaysAfter != ''">#{generationDaysAfter},</if>
+            <if test="generationHMS != null and generationHMS != ''">#{generationHMS},</if>
+            <if test="followUpSubject != null and followUpSubject != ''">#{followUpSubject},</if>
+            <if test="taskValidity != null">#{taskValidity},</if>
+            <if test="taskMaterial != null and taskMaterial != ''">#{taskMaterial},</if>
+            <if test="deliveryChannel != null and deliveryChannel != ''">#{deliveryChannel},</if>
+            <if test="smsId != null and smsId != ''">#{smsId},</if>
+            <if test="useForm != null and useForm != ''">#{useForm},</if>
+            <if test="creator != null and creator != ''">#{creator},</if>
+            <if test="createTime != null and createTime != ''">#{createTime},</if>
+            <if test="status != null and status != ''">#{status}</if>
+        </trim>
+    </insert>
+    <update id="updateNodeConfig" parameterType="pd">
+        UPDATE s_dtp_yypz_nodeconfig
+        <set>
+            <if test="sopTemplateId != null and sopTemplateId != ''">sopTemplateId = #{sopTemplateId},</if>
+            <if test="nodeName != null and nodeName != ''">nodeName = #{nodeName},</if>
+            <if test="nodeCode != null and nodeCode != ''">nodeCode = #{nodeCode},</if>
+            <if test="activateStructures != null and activateStructures != ''">activateStructures = #{activateStructures},</if>
+            <if test="activateWhichDay != null and activateWhichDay != ''">activateWhichDay = #{activateWhichDay},</if>
+            <if test="activateNodeRule != null and activateNodeRule != ''">activateNodeRule = #{activateNodeRule},</if>
+            <if test="createTaskStructures != null and createTaskStructures != ''">createTaskStructures = #{createTaskStructures},</if>
+            <if test="createTaskWhen != null and createTaskWhen != ''">createTaskWhen = #{createTaskWhen},</if>
+            <if test="createTaskEvery != null and createTaskEvery != ''">createTaskEvery = #{createTaskEvery},</if>
+            <if test="createTaskDi != null and createTaskDi != ''">createTaskDi = #{createTaskDi},</if>
+            <if test="createTaskTriggerValue != null and createTaskTriggerValue != ''">createTaskTriggerValue = #{createTaskTriggerValue},</if>
+            <if test="createTaskExecutionTimes != null and createTaskExecutionTimes != ''">createTaskExecutionTimes = #{createTaskExecutionTimes},</if>
+            <if test="filterCondition != null">filterCondition = #{filterCondition},</if>
+            <if test="trait != null and trait != ''">trait = #{trait},</if>
+            <if test="traitValue != null and traitValue != ''">traitValue = #{traitValue},</if>
+            <if test="judgingCondition != null and judgingCondition != ''">judgingCondition = #{judgingCondition},</if>
+            <if test="judgmentValue != null and judgmentValue != ''">judgmentValue = #{judgmentValue},</if>
+            <if test="taskActionMode != null and taskActionMode != ''">taskActionMode = #{taskActionMode},</if>
+            <if test="taskActionTaskType != null and taskActionTaskType != ''">taskActionTaskType = #{taskActionTaskType},</if>
+            <if test="taskActionRole != null and taskActionRole != ''">taskActionRole = #{taskActionRole},</if>
+            <if test="generationDaysAfter != null">generationDaysAfter = #{generationDaysAfter},</if>
+            <if test="generationHMS != null and generationHMS != ''">generationHMS = #{generationHMS},</if>
+            <if test="followUpSubject != null and followUpSubject != ''">followUpSubject = #{followUpSubject},</if>
+            <if test="taskValidity != null">taskValidity = #{taskValidity},</if>
+            <if test="taskMaterial != null and taskMaterial != ''">taskMaterial = #{taskMaterial},</if>
+            <if test="deliveryChannel != null and deliveryChannel != ''">deliveryChannel = #{deliveryChannel},</if>
+            <if test="smsId != null and smsId != ''">smsId = #{smsId},</if>
+            <if test="useForm != null and useForm != ''">useForm = #{useForm},</if>
+            <if test="creator != null and creator != ''">creator = #{creator},</if>
+            <if test="createTime != null and createTime != ''">createTime = #{createTime},</if>
+            <if test="status != null and status != ''">status = #{status}</if>
+        </set>
+        WHERE id = #{id}
+    </update>
+    <delete id="deleteNodeConfigByIds" parameterType="pd">
+        delete from s_dtp_yypz_nodeconfig where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+    <select id="selectNodeConfigById" parameterType="pd" resultType="pd">
+        SELECT * FROM s_dtp_yypz_nodeconfig WHERE id = #{id}
+    </select>
+
+    <select id="selectAllNodeConfigs" resultType="pd">
+        SELECT * FROM s_dtp_yypz_nodeconfig
+    </select>
+
+
+
+    <!-- 批量插入节点信息 -->
+    <insert id="batchAddNodeConfig" parameterType="java.util.List" useGeneratedKeys="false">
+        INSERT INTO s_dtp_yypz_nodeconfig
+        <trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
+            <if test="dataList[0].sopTemplateId != null and dataList[0].sopTemplateId != ''">sopTemplateId,</if>
+            <if test="dataList[0].nodeName != null and dataList[0].nodeName != ''">nodeName,</if>
+            <if test="dataList[0].nodeCode != null and dataList[0].nodeCode != ''">nodeCode,</if>
+            <if test="dataList[0].activateStructures != null and dataList[0].activateStructures != ''">activateStructures,</if>
+            <if test="dataList[0].activateWhichDay != null and dataList[0].activateWhichDay != ''">activateWhichDay,</if>
+            <if test="dataList[0].activateNodeRule != null and dataList[0].activateNodeRule != ''">activateNodeRule,</if>
+            <if test="dataList[0].createTaskStructures != null and dataList[0].createTaskStructures != ''">createTaskStructures,</if>
+            <if test="dataList[0].createTaskWhen != null and dataList[0].createTaskWhen != ''">createTaskWhen,</if>
+            <if test="dataList[0].createTaskEvery != null and dataList[0].createTaskEvery != ''">createTaskEvery,</if>
+            <if test="dataList[0].createTaskDi != null and dataList[0].createTaskDi != ''">createTaskDi,</if>
+            <if test="dataList[0].createTaskTriggerValue != null and dataList[0].createTaskTriggerValue != ''">createTaskTriggerValue,</if>
+            <if test="dataList[0].createTaskExecutionTimes != null and dataList[0].createTaskExecutionTimes != ''">createTaskExecutionTimes,</if>
+            <if test="dataList[0].filterCondition != null">filterCondition,</if>
+            <if test="dataList[0].trait != null and dataList[0].trait != ''">trait,</if>
+            <if test="dataList[0].traitValue != null and dataList[0].traitValue != ''">traitValue,</if>
+            <if test="dataList[0].judgingCondition != null and dataList[0].judgingCondition != ''">judgingCondition,</if>
+            <if test="dataList[0].judgmentValue != null and dataList[0].judgmentValue != ''">judgmentValue,</if>
+            <if test="dataList[0].taskActionMode != null and dataList[0].taskActionMode != ''">taskActionMode,</if>
+            <if test="dataList[0].taskActionTaskType != null and dataList[0].taskActionTaskType != ''">taskActionTaskType,</if>
+            <if test="dataList[0].taskActionRole != null and dataList[0].taskActionRole != ''">taskActionRole,</if>
+            <if test="dataList[0].generationDaysAfter != null and dataList[0].generationDaysAfter != ''">generationDaysAfter,</if>
+            <if test="dataList[0].generationHMS != null and dataList[0].generationHMS != ''">generationHMS,</if>
+            <if test="dataList[0].followUpSubject != null and dataList[0].followUpSubject != ''">followUpSubject,</if>
+            <if test="dataList[0].taskValidity != null and dataList[0].taskValidity != ''">taskValidity,</if>
+            <if test="dataList[0].taskMaterial != null and dataList[0].taskMaterial != ''">taskMaterial,</if>
+            <if test="dataList[0].deliveryChannel != null and dataList[0].deliveryChannel != ''">deliveryChannel,</if>
+            <if test="dataList[0].smsId != null and dataList[0].smsId != ''">smsId,</if>
+            <if test="dataList[0].useForm != null and dataList[0].useForm != ''">useForm,</if>
+            <if test="dataList[0].creator != null and dataList[0].creator != ''">creator,</if>
+            <if test="dataList[0].createTime != null and dataList[0].createTime != ''">createTime,</if>
+            <if test="dataList[0].status != null">status</if>
+        </trim>
+        VALUES
+        <foreach item="item" index="index" collection="dataList" separator=",">
+            <trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
+                <if test="item.sopTemplateId != null and item.sopTemplateId != ''">#{item.sopTemplateId},</if>
+                <if test="item.nodeName != null and item.nodeName != ''">#{item.nodeName},</if>
+                <if test="item.nodeCode != null and item.nodeCode != ''">#{item.nodeCode},</if>
+                <if test="item.activateStructures != null and item.activateStructures != ''">#{item.activateStructures},</if>
+                <if test="item.activateWhichDay != null and item.activateWhichDay != ''">#{item.activateWhichDay},</if>
+                <if test="item.activateNodeRule != null and item.activateNodeRule != ''">#{item.activateNodeRule},</if>
+                <if test="item.createTaskStructures != null and item.createTaskStructures != ''">#{item.createTaskStructures},</if>
+                <if test="item.createTaskWhen != null and item.createTaskWhen != ''">#{item.createTaskWhen},</if>
+                <if test="item.createTaskEvery != null and item.createTaskEvery != ''">#{item.createTaskEvery},</if>
+                <if test="item.createTaskDi != null and item.createTaskDi != ''">#{item.createTaskDi},</if>
+                <if test="item.createTaskTriggerValue != null and item.createTaskTriggerValue != ''">#{item.createTaskTriggerValue},</if>
+                <if test="item.createTaskExecutionTimes != null and item.createTaskExecutionTimes != ''">#{item.createTaskExecutionTimes},</if>
+                <if test="item.filterCondition != null">#{item.filterCondition},</if>
+                <if test="item.trait != null and item.trait != ''">#{item.trait},</if>
+                <if test="item.traitValue != null and item.traitValue != ''">#{item.traitValue},</if>
+                <if test="item.judgingCondition != null and item.judgingCondition != ''">#{item.judgingCondition},</if>
+                <if test="item.judgmentValue != null and item.judgmentValue != ''">#{item.judgmentValue},</if>
+                <if test="item.taskActionMode != null and item.taskActionMode != ''">#{item.taskActionMode},</if>
+                <if test="item.taskActionTaskType != null and item.taskActionTaskType != ''">#{item.taskActionTaskType},</if>
+                <if test="item.taskActionRole != null and item.taskActionRole != ''">#{item.taskActionRole},</if>
+                <if test="item.generationDaysAfter != null and item.generationDaysAfter != ''">#{item.generationDaysAfter},</if>
+                <if test="item.generationHMS != null and item.generationHMS != ''">#{item.generationHMS},</if>
+                <if test="item.followUpSubject != null and item.followUpSubject != ''">#{item.followUpSubject},</if>
+                <if test="item.taskValidity != null and item.taskValidity != ''">#{item.taskValidity},</if>
+                <if test="item.taskMaterial != null and item.taskMaterial != ''">#{item.taskMaterial},</if>
+                <if test="item.deliveryChannel != null and item.deliveryChannel != ''">#{item.deliveryChannel},</if>
+                <if test="item.smsId != null and item.smsId != ''">#{item.smsId},</if>
+                <if test="item.useForm != null and item.useForm != ''">#{item.useForm},</if>
+                <if test="item.creator != null and item.creator != ''">#{item.creator},</if>
+                <if test="item.createTime != null and item.createTime != ''">#{item.createTime},</if>
+                <if test="item.status != null">#{item.status}</if>
+            </trim>
+        </foreach>
+    </insert>
+    <!-- 批量修改节点信息 -->
+    <update id="batchUpdateNodeConfig" parameterType="java.util.List">
+        <foreach item="item" index="index" collection="list" separator=";">
+            UPDATE s_dtp_yypz_nodeconfig
+            SET
+            <trim prefix="" suffixOverrides=",">
+                <if test="item.sopTemplateId != null and item.sopTemplateId != ''">
+                    sopTemplateId = #{item.sopTemplateId},
+                </if>
+                <if test="item.nodeName != null and item.nodeName != ''">
+                    nodeName = #{item.nodeName},
+                </if>
+                <if test="item.nodeCode != null and item.nodeCode != ''">
+                    nodeCode = #{item.nodeCode},
+                </if>
+                <if test="item.activateStructures != null and item.activateStructures != ''">
+                    activateStructures = #{item.activateStructures},
+                </if>
+                <if test="item.activateWhichDay != null  and item.activateWhichDay != ''">
+                    activateWhichDay = #{item.activateWhichDay},
+                </if>
+                <if test="item.activateNodeRule != null and item.activateNodeRule != ''">
+                    activateNodeRule = #{item.activateNodeRule},
+                </if>
+                <if test="item.createTaskStructures != null and item.createTaskStructures != ''">
+                    createTaskStructures = #{item.createTaskStructures},
+                </if>
+                <if test="item.createTaskWhen != null and item.createTaskWhen != ''">
+                    createTaskWhen = #{item.createTaskWhen},
+                </if>
+                <if test="item.createTaskEvery != null and item.createTaskEvery != ''">
+                    createTaskEvery = #{item.createTaskEvery},
+                </if>
+                <if test="item.createTaskDi != null and item.createTaskDi != ''">
+                    createTaskDi = #{item.createTaskDi},
+                </if>
+                <if test="item.createTaskTriggerValue != null and item.createTaskTriggerValue != ''">
+                    createTaskTriggerValue = #{item.createTaskTriggerValue},
+                </if>
+                <if test="item.createTaskExecutionTimes != null and item.createTaskExecutionTimes != ''">
+                    createTaskExecutionTimes = #{item.createTaskExecutionTimes},
+                </if>
+                <if test="item.filterCondition != null">
+                    filterCondition = #{item.filterCondition},
+                </if>
+                <if test="item.trait != null and item.trait != ''">
+                    trait = #{item.trait},
+                </if>
+                <if test="item.traitValue != null and item.traitValue != ''">
+                    traitValue = #{item.traitValue},
+                </if>
+                <if test="item.judgingCondition != null and item.judgingCondition != ''">
+                    judgingCondition = #{item.judgingCondition},
+                </if>
+                <if test="item.judgmentValue != null and item.judgmentValue != ''">
+                    judgmentValue = #{item.judgmentValue},
+                </if>
+                <if test="item.taskActionMode != null and item.taskActionMode != ''">
+                    taskActionMode = #{item.taskActionMode},
+                </if>
+                <if test="item.taskActionTaskType != null and item.taskActionTaskType != ''">
+                    taskActionTaskType = #{item.taskActionTaskType},
+                </if>
+                <if test="item.taskActionRole != null and item.taskActionRole != ''">
+                    taskActionRole = #{item.taskActionRole},
+                </if>
+                <if test="item.generationDaysAfter != null and item.generationDaysAfter != ''">
+                    generationDaysAfter = #{item.generationDaysAfter},
+                </if>
+                <if test="item.generationHMS != null and item.generationHMS != ''">
+                    generationHMS = #{item.generationHMS},
+                </if>
+                <if test="item.followUpSubject != null and item.followUpSubject != ''">
+                    followUpSubject = #{item.followUpSubject},
+                </if>
+                <if test="item.taskValidity != null and item.taskValidity != ''">
+                    taskValidity = #{item.taskValidity},
+                </if>
+                <if test="item.taskMaterial != null and item.taskMaterial != ''">
+                    taskMaterial = #{item.taskMaterial},
+                </if>
+                <if test="item.deliveryChannel != null and item.deliveryChannel != ''">
+                    deliveryChannel = #{item.deliveryChannel},
+                </if>
+                <if test="item.smsId != null and item.smsId != ''">
+                    smsId = #{item.smsId},
+                </if>
+                <if test="item.useForm != null and item.useForm != ''">
+                    useForm = #{item.useForm},
+                </if>
+                <if test="item.creator != null and item.creator != ''">
+                    creator = #{item.creator},
+                </if>
+                <if test="item.createTime != null and item.createTime != ''">
+                    createTime = #{item.createTime},
+                </if>
+                <if test="item.status != null and item.status != ''">
+                    status = #{item.status},
+                </if>
+            </trim>
+            WHERE id = #{item.id}
+        </foreach>
+    </update>
+
 </mapper>

+ 444 - 0
health-system/src/main/resources/mapper/gxhpz/drugConfigMapper.xml

@@ -0,0 +1,444 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="drugConfigMapper">
+
+    <select id="selectDrugConfig" parameterType="pd" resultType="pd">
+        select * from s_gxhpz_drugconfig where 1=1
+        <if test="mdmCode != null and mdmCode != ''">
+            and mdmCode = #{mdmCode}
+        </if>
+        <if test="dValueCode != null and dValueCode != ''">
+            and dValueCode = #{dValueCode}
+        </if>
+        <if test="dValueName != null and dValueName != ''">
+            and dValueName = #{dValueName}
+        </if>
+        <if test="specification != null and specification != ''">
+            and specification = #{specification}
+        </if>
+        <if test="genericName != null and genericName != ''">
+            and genericName = #{genericName}
+        </if>
+        <if test="productName != null and productName != ''">
+            and productName = #{productName}
+        </if>
+        <if test="productImagePath != null and productImagePath != ''">
+            and productImagePath = #{productImagePath}
+        </if>
+        <if test="manufacturer != null and manufacturer != ''">
+            and manufacturer = #{manufacturer}
+        </if>
+        <if test="manufacturerShortName != null and manufacturerShortName != ''">
+            and manufacturerShortName = #{manufacturerShortName}
+        </if>
+        <if test="isFollowUpManaged != null and isFollowUpManaged != ''">
+            and isFollowUpManaged = #{isFollowUpManaged}
+        </if>
+        <if test="isColdChainManaged != null and isColdChainManaged != ''">
+            and isColdChainManaged = #{isColdChainManaged}
+        </if>
+        <if test="isRegisteredManaged != null and isRegisteredManaged != ''">
+            and isRegisteredManaged = #{isRegisteredManaged}
+        </if>
+        <if test="isCharityAidManaged != null and isCharityAidManaged != ''">
+            and isCharityAidManaged = #{isCharityAidManaged}
+        </if>
+        <if test="administrationMethod != null and administrationMethod != ''">
+            and administrationMethod = #{administrationMethod}
+        </if>
+        <if test="enterpriseFlowManagement != null and enterpriseFlowManagement != ''">
+            and enterpriseFlowManagement = #{enterpriseFlowManagement}
+        </if>
+        <if test="indicationDescription != null and indicationDescription != ''">
+            and indicationDescription = #{indicationDescription}
+        </if>
+        <if test="dosageAndAdministration != null and dosageAndAdministration != ''">
+            and dosageAndAdministration = #{dosageAndAdministration}
+        </if>
+        <if test="saleStatus != null and saleStatus != ''">
+            and saleStatus = #{saleStatus}
+        </if>
+        <if test="packaging != null and packaging != ''">
+            and packaging = #{packaging}
+        </if>
+        <if test="dvalueStatus != null and dvalueStatus != ''">
+            and  dvalueStatus= #{dvalueStatus},
+        </if>
+        <if test="status != null and status != ''">
+            and status = #{status}
+        </if>
+        <if test="createdBy != null and createdBy != ''">
+            and createdBy = #{createdBy}
+        </if>
+        <if test="createdTime != null">
+            and createdTime = #{createdTime}
+        </if>
+        <if test="updatedBy != null and updatedBy != ''">
+            and updatedBy = #{updatedBy}
+        </if>
+        <if test="updatedTime != null">
+            and updatedTime = #{updatedTime}
+        </if>
+        <if test="remarks != null and remarks != ''">
+            and remarks = #{remarks}
+        </if>
+        <if test="id != null and id != ''">
+            and id = #{id}
+        </if>
+    </select>
+
+    <update id="updateDrugConfig" parameterType="map">
+        update s_gxhpz_drugconfig
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="mdmCode != null and mdmCode !='' ">
+                mdmCode = #{mdmCode},
+            </if>
+            <if test="dValueCode != null">
+                dValueCode = #{dValueCode},
+            </if>
+            <if test="dValueName != null and dValueName != ''">
+                dValueName = #{dValueName},
+            </if>
+            <if test="specification != null and specification != ''">
+                specification = #{specification},
+            </if>
+            <if test="genericName != null and genericName != ''">
+                genericName = #{genericName},
+            </if>
+            <if test="productName != null and productName != ''">
+                productName = #{productName},
+            </if>
+            <if test="packaging != null and packaging != ''">
+                packaging = #{packaging},
+            </if>
+            <if test="productImagePath != null and productImagePath != ''">
+                productImagePath = #{productImagePath},
+            </if>
+            <if test="manufacturer != null and manufacturer != ''">
+                manufacturer = #{manufacturer},
+            </if>
+            <if test="manufacturerShortName != null and manufacturerShortName != ''">
+                manufacturerShortName = #{manufacturerShortName},
+            </if>
+            <if test="isFollowUpManaged != null and isFollowUpManaged != ''">
+                isFollowUpManaged = #{isFollowUpManaged},
+            </if>
+            <if test="isColdChainManaged != null and isColdChainManaged != ''">
+                isColdChainManaged = #{isColdChainManaged},
+            </if>
+            <if test="isRegisteredManaged != null and isRegisteredManaged != ''">
+                isRegisteredManaged = #{isRegisteredManaged},
+            </if>
+            <if test="isCharityAidManaged != null and isCharityAidManaged != ''">
+                isCharityAidManaged = #{isCharityAidManaged},
+            </if>
+            <if test="administrationMethod != null and administrationMethod != ''">
+                administrationMethod = #{administrationMethod},
+            </if>
+            <if test="enterpriseFlowManagement != null and enterpriseFlowManagement != ''">
+                enterpriseFlowManagement = #{enterpriseFlowManagement},
+            </if>
+            <if test="indicationDescription != null and indicationDescription != ''">
+                indicationDescription = #{indicationDescription},
+            </if>
+            <if test="dosageAndAdministration != null and dosageAndAdministration != ''">
+                dosageAndAdministration = #{dosageAndAdministration},
+            </if>
+            <if test="saleStatus != null  and saleStatus != ''">
+                saleStatus = #{saleStatus},
+            </if>
+            <if test="dvalueStatus != null and dvalueStatus != ''">
+                dvalueStatus= #{dvalueStatus},
+            </if>
+            <if test="status != null  and status != ''">
+                status = #{status},
+            </if>
+            <if test="createdBy != null and createdBy != ''">
+                createdBy = #{createdBy},
+            </if>
+            <if test="createdTime != null">
+                createdTime = #{createdTime},
+            </if>
+            <if test="updatedBy != null and updatedBy != ''">
+                updatedBy = #{updatedBy},
+            </if>
+            <if test="updatedTime != null">
+                updatedTime = #{updatedTime},
+            </if>
+            <if test="remarks != null and remarks != ''">
+                remarks = #{remarks},
+            </if>
+        </trim>
+        <where>
+            <if test="id != null">
+                id = #{id}
+            </if>
+        </where>
+    </update>
+    <update id="updateDrugConfigByDrugCode" parameterType="map">
+        update s_gxhpz_drugconfig
+        <trim prefix="SET" suffixOverrides=",">
+
+            <if test="dValueCode != null">
+                dValueCode = #{dValueCode},
+            </if>
+            <if test="dValueName != null and dValueName != ''">
+                dValueName = #{dValueName},
+            </if>
+            <if test="dvalueStatus != null">
+                dvalueStatus= #{dvalueStatus},
+            </if>
+            <if test="status != null  and status != ''">
+                status = #{status},
+            </if>
+
+            <if test="createdTime != null">
+                createdTime = #{createdTime},
+            </if>
+            <if test="updatedBy != null and updatedBy != ''">
+                updatedBy = #{updatedBy},
+            </if>
+            <if test="updatedTime != null">
+                updatedTime = #{updatedTime},
+            </if>
+        </trim>
+        <where>
+            <if test="mdmCode != null and mdmCode != ''">
+                mdmCode = #{mdmCode}
+            </if>
+        </where>
+    </update>
+
+    <update id="changeStatus" parameterType="pd">
+        update s_gxhpz_drugconfig set  status = #{status}, updatedBy = #{updatedBy},updatedTime = #{updatedTime} where   id = #{id}
+    </update>
+    <update id="changedvalueStatus" parameterType="pd">
+        update s_gxhpz_drugconfig set  dvalueStatus = #{dvalueStatus}, updatedBy = #{updatedBy},updatedTime = #{updatedTime} where   id = #{id}
+    </update>
+
+    <insert id="addDrugConfig" parameterType="map">
+        insert into s_gxhpz_drugconfig
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="mdmCode != null and mdmCode != ''">
+                mdmCode,
+            </if>
+            <if test="dValueCode != null">
+                dValueCode,
+            </if>
+            <if test="dValueName != null and dValueName != ''">
+                dValueName,
+            </if>
+            <if test="specification != null and specification != ''">
+                specification,
+            </if>
+            <if test="packaging != null and packaging != ''">
+                packaging,
+            </if>
+            <if test="genericName != null and genericName != ''">
+                genericName,
+            </if>
+            <if test="productName != null and productName != ''">
+                productName,
+            </if>
+            <if test="productImagePath != null and productImagePath != ''">
+                productImagePath,
+            </if>
+            <if test="manufacturer != null and manufacturer != ''">
+                manufacturer,
+            </if>
+            <if test="manufacturerShortName != null and manufacturerShortName != ''">
+                manufacturerShortName,
+            </if>
+            <if test="isFollowUpManaged != null">
+                isFollowUpManaged,
+            </if>
+            <if test="isColdChainManaged != null">
+                isColdChainManaged,
+            </if>
+            <if test="isRegisteredManaged != null">
+                isRegisteredManaged,
+            </if>
+            <if test="isCharityAidManaged != null">
+                isCharityAidManaged,
+            </if>
+            <if test="administrationMethod != null and administrationMethod != ''">
+                administrationMethod,
+            </if>
+            <if test="enterpriseFlowManagement != null and enterpriseFlowManagement != ''">
+                enterpriseFlowManagement,
+            </if>
+            <if test="indicationDescription != null and indicationDescription != ''">
+                indicationDescription,
+            </if>
+            <if test="dosageAndAdministration != null and dosageAndAdministration != ''">
+                dosageAndAdministration,
+            </if>
+            <if test="saleStatus != null and saleStatus != ''">
+                saleStatus,
+            </if>
+            <if test="dvalueStatus != null and dvalueStatus != ''">
+                dvalueStatus,
+            </if>
+            <if test="status != null and status != ''">
+                status,
+            </if>
+            <if test="createdBy != null and createdBy != ''">
+                createdBy,
+            </if>
+            <if test="createdTime != null">
+                createdTime,
+            </if>
+            <if test="updatedBy != null and updatedBy != ''">
+                updatedBy,
+            </if>
+            <if test="updatedTime != null">
+                updatedTime,
+            </if>
+            <if test="remarks != null and remarks != ''">
+                remarks,
+            </if>
+        </trim>
+        <trim prefix="VALUES (" suffix=")" suffixOverrides=",">
+            <if test="mdmCode != null and mdmCode != ''">
+                #{mdmCode},
+            </if>
+            <if test="dValueCode != null">
+                #{dValueCode},
+            </if>
+            <if test="dValueName != null and dValueName != ''">
+                #{dValueName},
+            </if>
+            <if test="specification != null and specification != ''">
+                #{specification},
+            </if>
+            <if test="packaging != null and packaging != ''">
+                #{packaging},
+            </if>
+            <if test="genericName != null and genericName != ''">
+                #{genericName},
+            </if>
+            <if test="productName != null and productName != ''">
+                #{productName},
+            </if>
+            <if test="productImagePath != null and productImagePath != ''">
+                #{productImagePath},
+            </if>
+            <if test="manufacturer != null and manufacturer != ''">
+                #{manufacturer},
+            </if>
+            <if test="manufacturerShortName != null and manufacturerShortName != ''">
+                #{manufacturerShortName},
+            </if>
+            <if test="isFollowUpManaged != null">
+                #{isFollowUpManaged},
+            </if>
+            <if test="isColdChainManaged != null">
+                #{isColdChainManaged},
+            </if>
+            <if test="isRegisteredManaged != null">
+                #{isRegisteredManaged},
+            </if>
+            <if test="isCharityAidManaged != null">
+                #{isCharityAidManaged},
+            </if>
+            <if test="administrationMethod != null and administrationMethod != ''">
+                #{administrationMethod},
+            </if>
+            <if test="enterpriseFlowManagement != null and enterpriseFlowManagement != ''">
+                #{enterpriseFlowManagement},
+            </if>
+            <if test="indicationDescription != null and indicationDescription != ''">
+                #{indicationDescription},
+            </if>
+            <if test="dosageAndAdministration != null and dosageAndAdministration != ''">
+                #{dosageAndAdministration},
+            </if>
+            <if test="saleStatus != null and saleStatus != ''">
+                #{saleStatus},
+            </if>
+            <if test="dvalueStatus != null and dvalueStatus != ''">
+                #{dvalueStatus},
+            </if>
+
+            <if test="status != null and status != ''">
+                #{status},
+            </if>
+            <if test="createdBy != null and createdBy != ''">
+                #{createdBy},
+            </if>
+            <if test="createdTime != null">
+                #{createdTime},
+            </if>
+            <if test="updatedBy != null and updatedBy != ''">
+                #{updatedBy},
+            </if>
+            <if test="updatedTime != null">
+                #{updatedTime},
+            </if>
+            <if test="remarks != null and remarks != ''">
+                #{remarks},
+            </if>
+        </trim>
+    </insert>
+    <delete id="deleteDrugConfigsByIds" parameterType="java.util.List">
+        <if test="list != null and list.size() > 0">
+            delete from s_gxhpz_drugconfig
+            where id in
+            <foreach item="id" index="index" collection="list" open="(" separator="," close=")">
+                #{id}
+            </foreach>
+        </if>
+    </delete>
+
+<!--    <delete id="deleteDrugConfigsByIds" parameterType="pd">-->
+<!--        delete from s_gxhpz_drugconfig-->
+<!--        <if test="ids != null">-->
+<!--            where id in (${ids})-->
+<!--        </if>-->
+<!--    </delete>-->
+
+
+
+
+
+    <!--药品库查询-->
+    <select id="getAllDrugs" parameterType="pd" resultType="pd">
+        select *
+        from s_gxhpz_drugs
+        <where>
+            <if test="id != null">
+            AND id = #{id}
+            </if>
+            <if test="query != null and query != ''">
+                AND (genericName LIKE CONCAT('%', #{query}, '%') OR productName LIKE CONCAT('%', #{query}, '%') OR mdmCode LIKE CONCAT('%', #{query}, '%'))
+            </if>
+            <if test="manufacturerShortName != null and manufacturerShortName != ''">
+                AND manufacturerShortName = #{manufacturerShortName}
+            </if>
+            AND status = '1'
+        </where>
+        order by createTime desc
+    </select>
+
+    <!--配置过的药品查询-->
+    <select id="getAllDrugConfig" parameterType="pd" resultType="pd">
+        select *
+        from s_gxhpz_drugconfig
+        <where>
+            <if test="id != null">
+                AND id = #{id}
+            </if>
+            <if test="query != null and query != ''">
+                AND (genericName LIKE CONCAT('%', #{query}, '%') OR productName LIKE CONCAT('%', #{query}, '%') OR mdmCode LIKE CONCAT('%', #{query}, '%'))
+            </if>
+            <if test="manufacturerShortName != null and manufacturerShortName != ''">
+                AND manufacturerShortName = #{manufacturerShortName}
+            </if>
+            and delFlag =1
+        </where>
+
+    </select>
+
+</mapper>

+ 332 - 0
health-system/src/main/resources/mapper/gxhpz/dvalueConfigMapper.xml

@@ -0,0 +1,332 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="dvalueConfigMapper">
+
+    <select id="selectDValueConfig" parameterType="pd" resultType="pd">
+        select * from s_gxhpz_dvalueconfig where 1=1
+        <if test="dValueCode != null and dValueCode != ''">
+            and dValueCode = #{dValueCode}
+        </if>
+        <if test="mdmCode != null and mdmCode != ''">
+            and mdmCode = #{mdmCode}
+        </if>
+        <if test="dValueName != null and dValueName != ''">
+            and dValueName = #{dValueName}
+        </if>
+        <if test="specification != null and specification != ''">
+            and specification = #{specification}
+        </if>
+        <if test="genericName != null and genericName != ''">
+            and genericName = #{genericName}
+        </if>
+        <if test="productName != null and productName != ''">
+            and productName = #{productName}
+        </if>
+        <if test="icdIndication != null and icdIndication != ''">
+            and icdIndication = #{icdIndication}
+        </if>
+        <if test="indicationCode != null and indicationCode != ''">
+            and indicationCode = #{indicationCode}
+        </if>
+        <if test="administrationMethod != null and administrationMethod != ''">
+            and administrationMethod = #{administrationMethod}
+        </if>
+        <if test="dosage != null and dosage != ''">
+            and dosage = #{dosage}
+        </if>
+        <if test="unit != null and unit != ''">
+            and unit = #{unit}
+        </if>
+        <if test="frequency != null and frequency != ''">
+            and frequency = #{frequency}
+        </if>
+        <if test="createdBy != null and createdBy != ''">
+            and createdBy = #{createdBy}
+        </if>
+        <if test="createdTime != null">
+            and createdTime = #{createdTime}
+        </if>
+        <if test="updatedBy != null and updatedBy != ''">
+            and updatedBy = #{updatedBy}
+        </if>
+        <if test="updatedTime != null">
+            and updatedTime = #{updatedTime}
+        </if>
+        <if test="status != null and status != ''">
+            and status = #{status}
+        </if>
+        <if test="remarks != null and remarks != ''">
+            and remarks = #{remarks}
+        </if>
+        <if test="id != null and id != ''">
+            and id = #{id}
+        </if>
+    </select>
+
+    <select id="selectOne" parameterType="pd" resultType="pd">
+        select v.* ,d.packaging,d.manufacturerShortName,d.isFollowUpManaged,
+               d.isColdChainManaged,d.isRegisteredManaged,d.isCharityAidManaged,
+               d.enterpriseFlowManagement,
+               d.indicationDescription,d.dosageAndAdministration
+        from s_gxhpz_dvalueconfig  v
+        left join s_gxhpz_drugconfig d on d.mdmCode = v.mdmCode
+        where 1=1
+        <if test="query != null and query != ''">
+            AND (v.dValueName LIKE CONCAT('%', #{query}, '%')
+            OR v.dValueCode = #{query})
+        </if>
+
+        LIMIT 1
+    </select>
+    <update id="updateDValueConfig" parameterType="pd">
+        update s_gxhpz_dvalueconfig
+        <trim prefix="SET " suffix="" prefixOverrides="," suffixOverrides=",">
+            <if test="dValueCode != null and dValueCode != ''">
+                dValueCode = #{dValueCode},
+            </if>
+            <if test="mdmCode != null and mdmCode != ''">
+                mdmCode = #{mdmCode},
+            </if>
+            <if test="dValueName != null and dValueName != ''">
+                dValueName = #{dValueName},
+            </if>
+            <if test="specification != null and specification != ''">
+                specification = #{specification},
+            </if>
+            <if test="genericName != null and genericName != ''">
+                genericName = #{genericName},
+            </if>
+            <if test="productName != null and productName != ''">
+                productName = #{productName},
+            </if>
+            <if test="icdIndication != null and icdIndication != ''">
+                icdIndication = #{icdIndication},
+            </if>
+            <if test="indicationCode != null and indicationCode != ''">
+                indicationCode = #{indicationCode},
+            </if>
+            <if test="administrationMethod != null and administrationMethod != ''">
+                administrationMethod = #{administrationMethod},
+            </if>
+            <if test="dosage != null and dosage != ''">
+                dosage = #{dosage},
+            </if>
+            <if test="unit != null and unit != ''">
+                unit = #{unit},
+            </if>
+            <if test="frequency != null and frequency != ''">
+                frequency = #{frequency},
+            </if>
+            <if test="createdBy != null and createdBy != ''">
+                createdBy = #{createdBy},
+            </if>
+            <if test="createdTime != null">
+                createdTime = #{createdTime},
+            </if>
+            <if test="updatedBy != null and updatedBy != ''">
+                updatedBy = #{updatedBy},
+            </if>
+            <if test="updatedTime != null">
+                updatedTime = #{updatedTime},
+            </if>
+            <if test="status != null and status != ''">
+                status = #{status},
+            </if>
+            <if test="remarks != null and remarks != ''">
+                remarks = #{remarks},
+            </if>
+        </trim>
+        <if test="id != null">
+            where id = #{id}
+        </if>
+    </update>
+    <update id="updateDValue" parameterType="pd">
+        update s_gxhpz_dvalueconfig
+        <trim prefix="SET " suffix="" prefixOverrides="," suffixOverrides=",">
+            <if test="mdmCode != null and mdmCode != ''">
+                mdmCode = #{mdmCode},
+            </if>
+            <if test="dValueName != null and dValueName != ''">
+                dValueName = #{dValueName},
+            </if>
+            <if test="specification != null and specification != ''">
+                specification = #{specification},
+            </if>
+            <if test="genericName != null and genericName != ''">
+                genericName = #{genericName},
+            </if>
+            <if test="productName != null and productName != ''">
+                productName = #{productName},
+            </if>
+            <if test="icdIndication != null and icdIndication != ''">
+                icdIndication = #{icdIndication},
+            </if>
+            <if test="indicationCode != null and indicationCode != ''">
+                indicationCode = #{indicationCode},
+            </if>
+            <if test="administrationMethod != null and administrationMethod != ''">
+                administrationMethod = #{administrationMethod},
+            </if>
+            <if test="dosage != null and dosage != ''">
+                dosage = #{dosage},
+            </if>
+            <if test="unit != null and unit != ''">
+                unit = #{unit},
+            </if>
+            <if test="frequency != null and frequency != ''">
+                frequency = #{frequency},
+            </if>
+
+            <if test="updatedBy != null and updatedBy != ''">
+                updatedBy = #{updatedBy},
+            </if>
+            <if test="updatedTime != null">
+                updatedTime = #{updatedTime},
+            </if>
+            <if test="status != null and status != ''">
+                status = #{status},
+            </if>
+
+        </trim>
+        <if test="dValueCode != null and dValueCode != ''">
+            where dValueCode = #{dValueCode}
+        </if>
+    </update>
+    <delete id="deleteDvalueConfigByIds" parameterType="java.util.List">
+        <if test="list != null and list.size() > 0">
+            delete from s_gxhpz_dvalueconfig
+            where id in
+            <foreach item="id" index="index" collection="list" open="(" separator="," close=")">
+                #{id}
+            </foreach>
+        </if>
+    </delete>
+<!--    <delete id="deleteDvalueConfigByIds" parameterType="pd">-->
+<!--        delete from s_gxhpz_dvalueconfig-->
+<!--        <if test="ids != null">-->
+<!--            where id in (${ids})-->
+<!--        </if>-->
+<!--    </delete>-->
+
+    <insert id="insertDValueConfig" parameterType="pd">
+        insert into s_gxhpz_dvalueconfig
+        <trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
+            <if test="dValueCode != null and dValueCode != ''">
+                dValueCode,
+            </if>
+            <if test="mdmCode != null and mdmCode != ''">
+                mdmCode,
+            </if>
+            <if test="dValueName != null and dValueName != ''">
+                dValueName,
+            </if>
+            <if test="specification != null and specification != ''">
+                specification,
+            </if>
+            <if test="genericName != null and genericName != ''">
+                genericName,
+            </if>
+            <if test="productName != null and productName != ''">
+                productName,
+            </if>
+            <if test="icdIndication != null and icdIndication != ''">
+                icdIndication,
+            </if>
+            <if test="indicationCode != null and indicationCode != ''">
+                indicationCode,
+            </if>
+            <if test="administrationMethod != null and administrationMethod != ''">
+                administrationMethod,
+            </if>
+            <if test="dosage != null and dosage != ''">
+                dosage,
+            </if>
+            <if test="unit != null and unit != ''">
+                unit,
+            </if>
+            <if test="frequency != null and frequency != ''">
+                frequency,
+            </if>
+            <if test="createdBy != null and createdBy != ''">
+                createdBy,
+            </if>
+            <if test="createdTime != null">
+                createdTime,
+            </if>
+            <if test="updatedBy != null and updatedBy != ''">
+                updatedBy,
+            </if>
+            <if test="updatedTime != null">
+                updatedTime,
+            </if>
+            <if test="status != null and status !=''">
+                status,
+            </if>
+            <if test="remarks != null and remarks != ''">
+                remarks,
+            </if>
+        </trim>
+        <trim prefix="VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
+            <if test="dValueCode != null and dValueCode != ''">
+                #{dValueCode},
+            </if>
+            <if test="mdmCode != null and mdmCode != ''">
+                #{mdmCode},
+            </if>
+            <if test="dValueName != null and dValueName != ''">
+                #{dValueName},
+            </if>
+            <if test="specification != null and specification != ''">
+                #{specification},
+            </if>
+            <if test="genericName != null and genericName != ''">
+                #{genericName},
+            </if>
+            <if test="productName != null and productName != ''">
+                #{productName},
+            </if>
+            <if test="icdIndication != null and icdIndication != ''">
+                #{icdIndication},
+            </if>
+            <if test="indicationCode != null and indicationCode != ''">
+                #{indicationCode},
+            </if>
+            <if test="administrationMethod != null and administrationMethod != ''">
+                #{administrationMethod},
+            </if>
+            <if test="dosage != null and dosage != ''">
+                #{dosage},
+            </if>
+            <if test="unit != null and unit != ''">
+                #{unit},
+            </if>
+            <if test="frequency != null and frequency != ''">
+                #{frequency},
+            </if>
+            <if test="createdBy != null and createdBy != ''">
+                #{createdBy},
+            </if>
+            <if test="createdTime != null">
+                #{createdTime},
+            </if>
+            <if test="updatedBy != null and updatedBy != ''">
+                #{updatedBy},
+            </if>
+            <if test="updatedTime != null">
+                #{updatedTime},
+            </if>
+            <if test="status != null and status !=''">
+                #{status},
+            </if>
+            <if test="remarks != null and remarks != ''">
+                #{remarks},
+            </if>
+        </trim>
+    </insert>
+
+    <update id="changeStatus" parameterType="pd">
+        update s_gxhpz_dvalueconfig set  status = #{status}, updatedBy = #{updatedBy},updatedTime = #{updatedTime} where   id = #{id}
+    </update>
+</mapper>

+ 265 - 36
health-system/src/main/resources/mapper/pmServiceMapper/PharmaceuticalServiceMapper.xml

@@ -70,6 +70,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			and phoneNumber=#{phoneNumber}
 		</if>
 	</select>
+	<select id="slectPatientByNameOrPhone" parameterType="pd" resultType="pd">
+	select * from s_dtp_ysfw_archive_management where  1=1  AND  name LIKE CONCAT('%', #{query}, '%') or phoneNumber=#{query}
+	</select>
+	<select id="selectPatientById" parameterType="pd" resultType="pd">
+		select * from s_dtp_ysfw_archive_management where  1=1 and id=#{patientId}
+	</select>
+
 	<!-- 插入新的档案记录 -->
 	<insert id="insertArchiveRecord" parameterType="pd">
 		INSERT INTO s_dtp_ysfw_archive_management
@@ -81,6 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="dateBirth != null">dateBirth,</if>
 			<if test="phoneNumber != null and phoneNumber != ''">phoneNumber,</if>
 			<if test="documentNumber != null and documentNumber != ''">documentNumber,</if>
+			<if test="idCardImg != null and idCardImg != ''">idCardImg,</if>
 			<if test="landlineNumber != null and landlineNumber != ''">landlineNumber,</if>
 			<if test="documentType != null and documentType != ''">documentType,</if>
 			<if test="createTime != null">createTime,</if>
@@ -97,6 +105,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="height != null">height,</if>
 			<if test="weight != null">weight,</if>
 			<if test="BMI != null and BMI != ''">BMI,</if>
+			<if test="storeId != null and storeId != ''">storeId,</if>
 			<if test="insurance != null and insurance != ''">insurance,</if>
 			<if test="socialSecurityCard != null and socialSecurityCard != ''">socialSecurityCard,</if>
 			<if test="timeFirstDiagnosis != null">timeFirstDiagnosis,</if>
@@ -114,6 +123,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="productName != null and productName != ''">productName,</if>
 			<if test="storeName != null and storeName != ''">storeName,</if>
 			<if test="followUpStatus != null">followUpStatus,</if>
+		    <if test="noFlipCause != null and noFlipCause != ''">noFlipCause,</if>
 			<if test="genericName != null and genericName != ''">genericName,</if>
 			<if test="updateTime != null and updateTime != ''">updateTime</if>
 		</trim>
@@ -126,6 +136,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="dateBirth != null">#{dateBirth},</if>
 			<if test="phoneNumber != null and phoneNumber != ''">#{phoneNumber},</if>
 			<if test="documentNumber != null and documentNumber != ''">#{documentNumber},</if>
+			<if test="idCardImg != null and idCardImg != ''">#{idCardImg},</if>
 			<if test="landlineNumber != null and landlineNumber != ''">#{landlineNumber},</if>
 			<if test="documentType != null and documentType != ''">#{documentType},</if>
 			<if test="createTime != null">#{createTime},</if>
@@ -142,6 +153,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="height != null">#{height},</if>
 			<if test="weight != null">#{weight},</if>
 			<if test="BMI != null and BMI != ''">#{BMI},</if>
+			<if test="storeId != null and storeId != ''">#{storeId},</if>
 			<if test="insurance != null and insurance != ''">#{insurance},</if>
 			<if test="socialSecurityCard != null and socialSecurityCard != ''">#{socialSecurityCard},</if>
 			<if test="timeFirstDiagnosis != null">#{timeFirstDiagnosis},</if>
@@ -159,6 +171,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="productName != null and productName != ''">#{productName},</if>
 			<if test="storeName != null and storeName != ''">#{storeName},</if>
 			<if test="followUpStatus != null">#{followUpStatus},</if>
+		    <if test="noFlipCause != null and noFlipCause != ''">#{noFlipCause},</if>
 			<if test="genericName != null and genericName != ''">#{genericName},</if>
 			<if test="updateTime != null and updateTime != ''">#{updateTime}</if>
 		</trim>
@@ -173,6 +186,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<if test="gender != null  and gender != ''">gender = #{gender},</if>
 		<if test="age != null and age != ''" >age = #{age},</if>
 		<if test="dateBirth != null and dateBirth != ''">dateBirth = #{dateBirth},</if>
+		<if test="phoneNumber != null and phoneNumber != ''">phoneNumber = #{phoneNumber},</if>
+		<if test="documentNumber != null and documentNumber != ''">documentNumber=#{documentNumber},</if>
+		<if test="idCardImg != null and idCardImg != ''">idCardImg=#{idCardImg},</if>
 		<if test="landlineNumber != null and landlineNumber != ''">landlineNumber = #{landlineNumber},</if>
 		<if test="archiveCompleteStatus != null">archiveCompleteStatus = #{archiveCompleteStatus},</if>
 		<if test="contactRelation != null and contactRelation != ''">contactRelation = #{contactRelation},</if>
@@ -201,11 +217,59 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<if test="mdmCode != null and mdmCode != ''">mdmCode = #{mdmCode},</if>
 		<if test="productName != null and productName != ''">productName = #{productName},</if>
 		<if test="storeName != null and storeName != ''">storeName = #{storeName},</if>
+		<if test="storeId != null and storeId != ''">storeId = #{storeId},</if>
+		<if test="noFlipCause != null and noFlipCause != ''">noFlipCause = #{noFlipCause},</if>
 		<if test="followUpStatus != null and followUpStatus != ''">followUpStatus = #{followUpStatus},</if>
 		<if test="genericName != null and genericName != ''">genericName = #{genericName},</if>
 		updateTime = #{updateTime}
 		WHERE id = #{id}
 	</update>
+
+	<!--患者绑定微信上翻-->
+	<update id="ShaoMaShangFan" parameterType="pd">
+		update s_dtp_ysfw_archive_management
+		<trim prefix="SET" suffixOverrides="," prefixOverrides=",">
+
+			<if test="openId != null and openId != ''">
+				openId = #{openId},
+			</if>
+			<if test="flipStatus != null and flipStatus != ''">
+				flipStatus = #{flipStatus},
+			</if>
+			<if test="updateTime != null and updateTime != ''">
+				updateTime = #{updateTime},
+			</if>
+			<if test="archiveCreator != null and archiveCreator != ''">
+				archiveCreator = #{archiveCreator},
+			</if>
+		</trim>
+		     where id = #{id}
+	</update>
+	<!--患者解除绑定-->
+	<update id="unbound" parameterType="pd">
+		update s_dtp_ysfw_archive_management
+		<trim prefix="SET" suffixOverrides="," prefixOverrides=",">
+
+			<if test="openId != null and openId != ''">
+				openId = #{openId},
+			</if>
+			<if test="flipStatus != null and flipStatus != ''">
+				flipStatus = #{flipStatus},
+			</if>
+			<if test="noFlipCause != null and noFlipCause != ''">
+				noFlipCause = #{noFlipCause},
+			</if>
+			<if test="updateTime != null and updateTime != ''">
+				updateTime = #{updateTime},
+			</if>
+			<if test="archiveCreator != null and archiveCreator != ''">
+				archiveCreator = #{archiveCreator},
+			</if>
+
+		</trim>
+		where id = #{id}
+	</update>
+
 	<!--档案管理修改-->
 	<update id="updateArchives" parameterType="pd">
 		update s_dtp_ysfw_archive_management
@@ -231,6 +295,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="documentNumber != null and documentNumber != ''">
 				documentNumber = #{documentNumber},
 			</if>
+		    <if test="idCardImg != null and idCardImg != ''">
+				idCardImg = #{idCardImg},
+			</if>
 			<if test="landlineNumber != null and landlineNumber != ''">
 				landlineNumber = #{landlineNumber},
 			</if>
@@ -258,6 +325,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="flipStatus != null and flipStatus != ''">
 				flipStatus = #{flipStatus},
 			</if>
+		    <if test="noFlipCause != null and noFlipCause != ''">
+				noFlipCause = #{noFlipCause},
+			</if>
 			<if test="chronicTumorType != null and chronicTumorType != ''">
 				chronicTumorType = #{chronicTumorType},
 			</if>
@@ -324,6 +394,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="storeName != null and storeName != ''">
 				storeName = #{storeName},
 			</if>
+			<if test="storeId != null and storeId != ''">
+				storeId = #{storeId},
+			</if>
 			<if test="followUpStatus != null and followUpStatus != ''">
 				followUpStatus = #{followUpStatus},
 			</if>
@@ -535,9 +608,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<if test="lastPurchaseDate != null">
 			and lastPurchaseDate=#{lastPurchaseDate}
 		</if>
-		<!--<if test="建档日期 != null">
-			and `建档日期`=#{建档日期}
-		</if>-->
+		<if test="filingDate != null">
+			and filingDate=#{filingDate}
+		</if>
 		<if test="followUpPersonName != null and followUpPersonName != ''">
 			and followUpPersonName=#{followUpPersonName}
 		</if>
@@ -601,6 +674,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="lastPurchaseDate != null">
 				lastPurchaseDate=#{lastPurchaseDate},
 			</if>
+			<if test="filingDate != null">
+				filingDate=#{filingDate},
+			</if>
+
 			<if test="followUpPersonName != null and followUpPersonName != ''">
 				followUpPersonName=#{followUpPersonName},
 			</if>
@@ -648,8 +725,77 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			</if>
 		</if>
 	</delete>
+	<!--根据所属们id查询患者信息-->
+	<select id="getAllPatients" parameterType="pd" resultType="pd">
+		select id ,name ,storeName ,storeId from s_dtp_ysfw_archive_management where 1=1 and storeId=#{DeptId}
+	</select>
+
+	<select id="selectConsultationAndDrug" parameterType="pd" resultType="pd">
+		SELECT
+			pc.id AS id,
+			pc.storeName,
+			pc.storeId,
+			pc.patientId,
+			pc.createdBy,
+			pc.createdDate,
+			pc.patientName,
+			pc.patientPhone,
+			pc.gender,
+			pc.age,
+			pc.KnowledgeLink,
+			pc.questionType,
+			pc.consultationQuestion,
+			pc.pharmacistAnswer,
+			pc.consultationTime,
+			pc.disease,
+			pc.genericName,
+			pc.productName,
+			pd.id AS prescriptionDrugId,
+			pd.productName AS prescriptionProductName,
+			pd.genericName AS prescriptionGenericName,
+			pd.mdmCode AS prescriptionmdmCode,
+		    pd.prescriptionNumber
+		FROM
+			s_dtp_ysfw_patient_consultation pc
+				LEFT JOIN
+			s_dtp_cfdj_prescription_drug pd ON pc.patientId = pd.patientId
+		WHERE
+			pc.storeId = #{storeId}
+		<if test="createdDate != null">
+			AND pc.createdDate=#{createdDate}
+		</if>
+		<if test="query != null and query != ''">
+			AND (pc.patientName LIKE CONCAT('%', #{query}, '%')
+			OR pc.patientPhone = #{query})
+		</if>
+		<if test="questionType != null and questionType != ''">
+			AND pc.questionType=#{questionType}
+		</if>
+		<if test="consultationQuestion != null and consultationQuestion != ''">
+			AND pc.consultationQuestion=#{consultationQuestion}
+		</if>
+		<if test="pharmacistAnswer != null and pharmacistAnswer != ''">
+			AND pc.pharmacistAnswer=#{pharmacistAnswer}
+		</if>
 
-	<!--患者咨询 查询-->
+		<if test="beginTime != null and beginTime!='' and endTime != null and endTime!=''">
+			and pc.consultationTime between #{beginTime} and #{endTime}
+		</if>
+		<if test="disease != null and disease != ''">
+			AND pc.disease=#{disease}
+		</if>
+		<if test="product != null and product != ''">
+			AND pd.genericName =#{product} OR pd.productName = #{product} OR pd.mdmCode = #{product}
+		</if>
+		ORDER BY
+		pc.id ASC
+
+	</select>
+	<!--患者咨询根据id-->
+	<select id="findPatientCounselingById" parameterType="pd" resultType="pd">
+		select * from s_dtp_ysfw_patient_consultation where 1=1 and id=#{id}
+	</select>
+	<!--患者咨询 查询所有-->
 	<select id="selectPatientCounselingList" parameterType="pd" resultType="pd">
 		select *,DATE_FORMAT(consultationTime, '%Y-%m-%d %H:%i:%s') AS updateTime2 from s_dtp_ysfw_patient_consultation where 1=1
 		<if test="id != null and id != ''">
@@ -667,12 +813,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<if test="patientPhone != null and patientPhone != ''">
 			AND patientPhone=#{patientPhone}
 		</if>
-		<if test="gender != null and gender != ''">
-			AND gender=#{gender}
-		</if>
-		<if test="age != null">
-			AND age=#{age}
-		</if>
 		<if test="questionType != null and questionType != ''">
 			AND questionType=#{questionType}
 		</if>
@@ -696,34 +836,70 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		</if>
 
 	</select>
-
+	<insert id="insertPatientConsultation" parameterType="pd">
+		INSERT INTO s_dtp_ysfw_patient_consultation
+		<trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
+			<if test="createdBy != null and createdBy !=''">createdBy,</if>
+			<if test="createdDate != null and createdDate !=''">createdDate,</if>
+			<if test="patientName != null and patientName != ''">patientName,</if>
+			<if test="patientPhone != null and patientPhone != ''">patientPhone,</if>
+			<if test="gender != null">gender,</if>
+			<if test="age != null">age,</if>
+			<if test="KnowledgeLink != null and KnowledgeLink != ''">KnowledgeLink,</if>
+			<if test="questionType != null and questionType != ''">questionType,</if>
+			<if test="consultationQuestion != null and consultationQuestion != ''">consultationQuestion,</if>
+			<if test="pharmacistAnswer != null and pharmacistAnswer != ''">pharmacistAnswer,</if>
+			<if test="consultationTime != null">consultationTime,</if>
+			<if test="contactRelation != null and contactRelation != ''">contactRelation,</if>
+			<if test="disease != null and disease != ''">disease,</if>
+			<if test="genericName != null and genericName != ''">genericName,</if>
+			<if test="productName != null and productName != ''">productName,</if>
+			<if test="storeId != null">storeId,</if>
+			<if test="storeName != null and storeName != ''">storeName,</if>
+			<if test="patientId != null">patientId,</if>
+		</trim>
+		<trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
+			<if test="createdBy != null and createdBy !=''">#{createdBy},</if>
+			<if test="createdDate != null and createdDate !=''">#{createdDate},</if>
+			<if test="patientName != null and patientName != ''">#{patientName},</if>
+			<if test="patientPhone != null and patientPhone != ''">#{patientPhone},</if>
+			<if test="gender != null">#{gender},</if>
+			<if test="age != null">#{age},</if>
+			<if test="KnowledgeLink != null and KnowledgeLink != ''">#{KnowledgeLink},</if>
+			<if test="questionType != null and questionType != ''">#{questionType},</if>
+			<if test="consultationQuestion != null and consultationQuestion != ''">#{consultationQuestion},</if>
+			<if test="pharmacistAnswer != null and pharmacistAnswer != ''">#{pharmacistAnswer},</if>
+			<if test="consultationTime != null and consultationTime != ''">#{consultationTime},</if>
+			<if test="contactRelation != null and contactRelation != ''">#{contactRelation},</if>
+			<if test="disease != null and disease != ''">#{disease},</if>
+			<if test="genericName != null and genericName != ''">#{genericName},</if>
+			<if test="productName != null and productName != ''">#{productName},</if>
+			<if test="storeId != null">#{storeId},</if>
+			<if test="storeName != null and storeName != ''">#{storeName},</if>
+			<if test="patientId != null and patientId != ''">#{patientId},</if>
+		</trim>
+	</insert>
 	<!--患者咨询 修改-->
 	<update id="updatePatientCounseling" parameterType="pd" >
 		<if test="up != null and up!=''">
 			update s_dtp_ysfw_patient_consultation
 		</if>
 		<trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
-			<if test="createdBy != null and createdBy != ''">
-				createdBy=#{createdBy},
+			<if test="regenerator != null and regenerator != ''">
+				regenerator=#{regenerator},
 			</if>
-			<if test="createdDate != null">
-				createdDate=#{createdDate},
-			</if>
-			<if test="patientName != null and patientName != ''">
-				patientName=#{patientName},
-			</if>
-			<if test="patientPhone != null and patientPhone != ''">
-				patientPhone=#{patientPhone},
-			</if>
-			<if test="gender != null and gender != ''">
-				gender=#{gender},
-			</if>
-			<if test="age != null">
-				age=#{age},
+			<if test="updateDate != null and updateDate !=''">
+				updateDate=#{updateDate},
 			</if>
 			<if test="questionType != null and questionType != ''">
 				questionType=#{questionType},
 			</if>
+			<if test="KnowledgeLink != null and KnowledgeLink != ''">
+				KnowledgeLink=#{KnowledgeLink},
+			</if>
+			<if test="contactRelation != null and contactRelation != ''">
+				contactRelation=#{contactRelation},
+			</if>
 			<if test="consultationQuestion != null and consultationQuestion != ''">
 				consultationQuestion=#{consultationQuestion},
 			</if>
@@ -733,15 +909,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			<if test="consultationTime != null">
 				consultationTime=#{consultationTime},
 			</if>
-			<if test="disease != null and disease != ''">
-				disease=#{disease},
-			</if>
-			<if test="genericName != null and genericName != ''">
-				genericName=#{genericName},
-			</if>
-			<if test="productName != null and productName != ''">
-				productName=#{productName},
-			</if>
+
 		</trim>
 		<if test="up != null and up!=''">
 			<if test="id!= null and id!=''">
@@ -1430,4 +1598,65 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	<update id="DeleteMedicationRecord" parameterType="pd">
 		DELETE FROM s_dtp_ysfw_medication_records WHERE archiveId = #{archiveId}
 	</update>
+
+	<!--查询对应患者的用药购药信息-->
+	<select id="getDrugPurchaseList" parameterType="pd" resultType="pd">
+		SELECT
+		p.orderId AS orderId,
+		p.prescriptionSource AS prescriptionSource,
+		p.prescriptionDate AS prescriptionDate,
+		p.hospital AS hospital,
+		p.doctor AS doctor,
+		p.department AS department,
+		p.diseaseType AS diseaseType,
+		p.clinicalDiagnosis AS clinicalDiagnosis,
+		pd.genericName AS genericName,
+		pd.productName AS productName,
+		pd.specification AS specification,
+		pd.quantity AS quantity,
+		pd.manufacturer AS manufacturer,
+		pd.mdmCode AS mdmCode,
+		pd.usageMethod AS usageMethod,
+		pd.frequency AS frequency,
+		pd.wordUsage AS wordUsage,
+		pd.medicationCycle AS medicationCycle,
+		p.registrar AS registrar,
+		p.orderTime AS orderTime,
+		pd.drugSource AS drugSource
+		FROM
+		s_dtp_ysfw_archive_management am
+		JOIN
+		s_dtp_cfdj_prescription p ON am.phoneNumber = p.patientPhone and am.name = p.patientName
+		JOIN
+		s_dtp_cfdj_prescription_drug pd ON p.id = pd.prescriptionNumber
+		WHERE
+		1 = 1
+		<if test="patientPhone != null and patientPhone !=''">
+			AND p.patientPhone = #{patientPhone}
+		</if>
+		<if test="patientName != null and patientName !=''">
+			AND p.patientName = #{patientName}
+		</if>
+		<if test="prescriptionDate != null and prescriptionDate !=''">
+			AND p.prescriptionDate = #{prescriptionDate}
+		</if>
+		<if test="genericName != null and genericName !=''">
+			AND pd.genericName = #{genericName}
+		</if>
+		<if test="productName != null and productName !=''">
+			AND pd.productName = #{productName}
+		</if>
+		<if test="mdmCode != null and mdmCode !=''">
+			AND pd.mdmCode = #{mdmCode}
+		</if>
+		<if test="usageMethod != null and usageMethod !=''">
+			AND pd.usageMethod = #{usageMethod}
+		</if>
+		<if test="orderTime != null and orderTime !=''">
+			AND p.orderTime = #{orderTime}
+		</if>
+		GROUP BY
+		p.orderId, p.prescriptionSource, p.prescriptionDate, p.hospital, p.doctor, p.department, p.diseaseType, p.clinicalDiagnosis, pd.genericName, pd.productName, pd.specification, pd.quantity, pd.manufacturer, pd.mdmCode, pd.usageMethod, pd.frequency, pd.wordUsage, pd.medicationCycle, p.registrar, p.orderTime, pd.drugSource
+	</select>
+
 </mapper>

+ 188 - 100
health-system/src/main/resources/mapper/system/DTPMapper.xml

@@ -34,7 +34,7 @@
             </if>
             <if test="storeName != null and storeName!=''">AND storeName = #{storeName}</if>
             <if test="registrar != null and registrar!=''">AND registrar = #{registrar}</if>
-            <if test="completionTime != null and completionTime!=''">AND completionTime = #{completionTime}</if>
+            <if test="completionTime != null and completionTime != ''">AND completionTime = #{completionTime}</if>
             <if test="deliveryMethod != null and deliveryMethod!=''">AND deliveryMethod=#{deliveryMethod}</if>
             <if test="paymentCode != null and paymentCode!=''">AND paymentCode = #{paymentCode}</if>
             <if test="paymentMethod != null and paymentMethod!=''">AND paymentMethod = #{paymentMethod}</if>
@@ -50,71 +50,100 @@
     <insert id="insertRecipe" parameterType="pd">
         insert into s_dtp_cfdj_prescription
         <trim prefix="(" suffix=")" prefixOverrides="," suffixOverrides=",">
-            <if test="id != null and id!=''">id,</if>
-            <if test="orderId != null and orderId!=''">orderId,</if>
-            <if test="saleOrderNumber != null and saleOrderNumber!=''">saleOrderNumber,</if>
-            <if test="genericName != null and genericName!=''">genericName,</if>
-            <if test="productName != null and productName!=''">productName,</if>
-            <if test="specification != null and specification!=''">specification,</if>
-            <if test="quantity != null and quantity!=''">quantity,</if>
-            <if test="manufacturer != null and manufacturer!=''">manufacturer,</if>
-            <if test="mdmCode != null and mdmCode!=''">mdmCode,</if>
-            <if test="posMemberName != null and posMemberName!=''">posMemberName,</if>
-            <if test="posMemberPhone != null and posMemberPhone!=''">posMemberPhone,</if>
-            <if test="prescriptionType != null and prescriptionType!=''">prescriptionType,</if>
-            <if test="prescriptionNumber != null and prescriptionNumber!=''">prescriptionNumber,</if>
-            <if test="hospital != null and hospital!=''">hospital,</if>
-            <if test="department != null and department!=''">department,</if>
-            <if test="doctor != null and doctor!=''">doctor,</if>
-            <if test="patientName != null and patientName!=''">patientName,</if>
-            <if test="patientPhone != null and patientPhone!=''">patientPhone,</if>
-            <if test="storeName != null and storeName!=''">storeName,</if>
-            <if test="registrar != null and registrar!=''">registrar,</if>
-            <if test="completionTime != null and completionTime!=''">completionTime,</if>
-            <if test="deliveryMethod != null and deliveryMethod!=''">deliveryMethod,</if>
-            <if test="paymentCode != null and paymentCode!=''">paymentCode,</if>
-            <if test="paymentMethod != null and paymentMethod!=''">paymentMethod,</if>
-            <if test="status != null and status!=''">status,</if>
-            <if test="isFlipItem != null and isFlipItem!=''">isFlipItem,</if>
-            <if test="lastUpdated != null and lastUpdated!=''">lastUpdated,</if>
-            <if test="createTime != null and createTime!=''">createTime,</if>
-            <if test="orderTime != null and orderTime!=''">orderTime,</if>
-            <if test="saleOrderTime != null and saleOrderTime!=''">saleOrderTime,</if>
-
-
+            <if test="id != null and id != ''">id,</if>
+            <if test="orderId != null and orderId != ''">orderId,</if>
+            <if test="prescriptionDate != null and prescriptionDate != ''">prescriptionDate,</if>
+            <if test="saleOrderNumber != null and saleOrderNumber != ''">saleOrderNumber,</if>
+            <if test="prescriptionNumber != null and prescriptionNumber != ''">prescriptionNumber,</if>
+            <if test="prescription_drug_id != null and prescription_drug_id != ''">prescription_drug_id,</if>
+            <if test="prescriptionDrug != null and prescriptionDrug != ''">prescriptionDrug,</if>
+            <if test="dosage != null and dosage != ''">dosage,</if>
+            <if test="drugRoute != null and drugRoute != ''">drugRoute,</if>
+            <if test="medicationCycle != null and medicationCycle != ''">medicationCycle,</if>
+            <if test="singleDose != null and singleDose != ''">singleDose,</if>
+            <if test="diseaseType != null and diseaseType != ''">diseaseType,</if>
+            <if test="clinicalDiagnosis != null and clinicalDiagnosis != ''">clinicalDiagnosis,</if>
+            <if test="prescriptionImg != null and prescriptionImg != ''">prescriptionImg,</if>
+            <if test="prescriptionSource != null and prescriptionSource != ''">prescriptionSource,</if>
+            <if test="genericName != null and genericName != ''">genericName,</if>
+            <if test="specification != null and specification != ''">specification,</if>
+            <if test="quantity != null and quantity != ''">quantity,</if>
+            <if test="frequency != null and frequency != ''">frequency,</if>
+            <if test="usage != null and usage != ''">usage,</if>
+            <if test="wordUsage != null and wordUsage != ''">wordUsage,</if>
+            <if test="manufacturer != null and manufacturer != ''">manufacturer,</if>
+            <if test="createTime != null and createTime != ''">createTime,</if>
+            <if test="saleOrderTime != null and saleOrderTime != ''">saleOrderTime,</if>
+            <if test="orderTime != null and orderTime != ''">orderTime,</if>
+            <if test="hospital != null and hospital != ''">hospital,</if>
+            <if test="department != null and department != ''">department,</if>
+            <if test="doctor != null and doctor != ''">doctor,</if>
+            <if test="patientName != null and patientName != ''">patientName,</if>
+            <if test="patientPhone != null and patientPhone != ''">patientPhone,</if>
+            <if test="storeName != null and storeName != ''">storeName,</if>
+            <if test="isFlipItem != null and isFlipItem != ''">isFlipItem,</if>
+            <if test="noFlipCause != null and noFlipCause !=''">noFlipCause,</if>
+            <if test="registrar != null and registrar != ''">registrar,</if>
+            <if test="completionTime != null and completionTime != ''">completionTime,</if>
+            <if test="lastUpdated != null and lastUpdated != ''">lastUpdated,</if>
+            <if test="deliveryMethod != null and deliveryMethod != ''">deliveryMethod,</if>
+            <if test="paymentCode != null and paymentCode != ''">paymentCode,</if>
+            <if test="paymentMethod != null and paymentMethod != ''">paymentMethod,</if>
+            <if test="status != null and status != ''">status,</if>
+            <if test="del_flag != null and del_flag != ''">del_flag,</if>
+            <if test="posMemberName != null and posMemberName != ''">posMemberName,</if>
+            <if test="productName != null and productName != ''">productName,</if>
+            <if test="mdmCode != null and mdmCode != ''">mdmCode,</if>
+            <if test="posMemberPhone != null and posMemberPhone != ''">posMemberPhone,</if>
+            <if test="prescriptionType != null and prescriptionType !=''">prescriptionType,</if>
         </trim>
         <trim prefix=" VALUES (" suffix=")" prefixOverrides="," suffixOverrides=",">
-            <if test="id != null and id!=''">#{id},</if>
-            <if test="orderId != null and orderId!=''">#{orderId},</if>
-            <if test="saleOrderNumber != null and saleOrderNumber!=''">#{saleOrderNumber},</if>
-            <if test="genericName != null and genericName!=''">#{genericName},</if>
-            <if test="productName != null and productName!=''">#{productName},</if>
-            <if test="specification != null and specification!=''">#{specification},</if>
-            <if test="quantity != null and quantity!=''">#{quantity},</if>
-            <if test="manufacturer != null and manufacturer!=''">#{manufacturer},</if>
-            <if test="mdmCode != null and mdmCode!=''">#{mdmCode},</if>
-            <if test="posMemberName != null and posMemberName!=''">#{posMemberName},</if>
-            <if test="posMemberPhone != null and posMemberPhone!=''">#{posMemberPhone},</if>
-            <if test="prescriptionType != null and prescriptionType!=''">#{prescriptionType},</if>
-            <if test="prescriptionNumber != null and prescriptionNumber!=''">#{prescriptionNumber},</if>
-            <if test="hospital != null and hospital!=''">#{hospital},</if>
-            <if test="department != null and department!=''">#{department},</if>
-            <if test="doctor != null and doctor!=''">#{doctor},</if>
-            <if test="patientName != null and patientName!=''">#{patientName},</if>
-            <if test="patientPhone != null and patientPhone!=''">#{patientPhone},</if>
-            <if test="storeName != null and storeName!=''">#{storeName},</if>
-            <if test="registrar != null and registrar!=''">#{registrar},</if>
-            <if test="completionTime != null and completionTime!=''">#{completionTime},</if>
-            <if test="deliveryMethod != null and deliveryMethod!=''">#{deliveryMethod},</if>
-            <if test="paymentCode != null and paymentCode!=''">#{paymentCode},</if>
-            <if test="paymentMethod != null and paymentMethod!=''">#{paymentMethod},</if>
-            <if test="status != null and status!=''">#{status},</if>
-            <if test="isFlipItem != null and isFlipItem!=''">#{isFlipItem},</if>
-            <if test="lastUpdated != null and lastUpdated!=''">#{lastUpdated},</if>
-            <if test="createTime != null and createTime!=''">#{createTime},</if>
-            <if test="orderTime != null and orderTime!=''">#{orderTime},</if>
-            <if test="saleOrderTime != null and saleOrderTime!=''">#{saleOrderTime},</if>
-
+            <if test="id != null and id != ''">#{id},</if>
+            <if test="orderId != null and orderId != ''">#{orderId},</if>
+            <if test="prescriptionDate != null and prescriptionDate != ''">#{prescriptionDate},</if>
+            <if test="saleOrderNumber != null and saleOrderNumber != ''">#{saleOrderNumber},</if>
+            <if test="prescriptionNumber != null and prescriptionNumber != ''">#{prescriptionNumber},</if>
+            <if test="prescription_drug_id != null and prescription_drug_id !=''">#{prescription_drug_id},</if>
+            <if test="prescriptionDrug != null and prescriptionDrug != ''">#{prescriptionDrug},</if>
+            <if test="dosage != null and dosage !=''">#{dosage},</if>
+            <if test="drugRoute != null and drugRoute != ''">#{drugRoute},</if>
+            <if test="medicationCycle != null and medicationCycle != ''">#{medicationCycle},</if>
+            <if test="singleDose != null and singleDose != ''">#{singleDose},</if>
+            <if test="diseaseType != null and diseaseType != ''">#{diseaseType},</if>
+            <if test="clinicalDiagnosis != null and clinicalDiagnosis != ''">#{clinicalDiagnosis},</if>
+            <if test="prescriptionImg != null and prescriptionImg != ''">#{prescriptionImg},</if>
+            <if test="prescriptionSource != null and prescriptionSource != ''">#{prescriptionSource},</if>
+            <if test="genericName != null and genericName != ''">#{genericName},</if>
+            <if test="specification != null and specification != ''">#{specification},</if>
+            <if test="quantity != null and quantity != ''">#{quantity},</if>
+            <if test="frequency != null and frequency != ''">#{frequency},</if>
+            <if test="usage != null and usage != ''">#{usage},</if>
+            <if test="wordUsage != null and wordUsage != ''">#{wordUsage},</if>
+            <if test="manufacturer != null and manufacturer != ''">#{manufacturer},</if>
+            <if test="createTime != null and createTime != ''">#{createTime},</if>
+            <if test="saleOrderTime != null and saleOrderTime != ''">#{saleOrderTime},</if>
+            <if test="orderTime != null and orderTime != ''">#{orderTime},</if>
+            <if test="hospital != null and hospital != ''">#{hospital},</if>
+            <if test="department != null and department != ''">#{department},</if>
+            <if test="doctor != null and doctor != ''">#{doctor},</if>
+            <if test="patientName != null and patientName != ''">#{patientName},</if>
+            <if test="patientPhone != null and patientPhone != ''">#{patientPhone},</if>
+            <if test="storeName != null and storeName != ''">#{storeName},</if>
+            <if test="isFlipItem != null and isFlipItem != ''">#{isFlipItem},</if>
+            <if test="noFlipCause != null and noFlipCause !=''">#{noFlipCause},</if>
+            <if test="registrar != null and registrar != ''">#{registrar},</if>
+            <if test="completionTime != null and completionTime != ''">#{completionTime},</if>
+            <if test="lastUpdated != null and lastUpdated != ''">#{lastUpdated},</if>
+            <if test="deliveryMethod != null and deliveryMethod != ''">#{deliveryMethod},</if>
+            <if test="paymentCode != null and paymentCode != ''">#{paymentCode},</if>
+            <if test="paymentMethod != null and paymentMethod != ''">#{paymentMethod},</if>
+            <if test="status != null and status != ''">#{status},</if>
+            <if test="del_flag != null and del_flag != ''">#{del_flag},</if>
+            <if test="posMemberName != null and posMemberName != ''">#{posMemberName},</if>
+            <if test="productName != null and productName != ''">#{productName},</if>
+            <if test="mdmCode != null and mdmCode != ''">#{mdmCode},</if>
+            <if test="posMemberPhone != null and posMemberPhone != ''">#{posMemberPhone},</if>
+            <if test="prescriptionType != null and prescriptionType != ''">#{prescriptionType}</if>
         </trim>
     </insert>
 
@@ -127,42 +156,67 @@
             </foreach>
         </if>
     </delete>
-
+    <update id="BangdingRecipe" parameterType="pd">
+    update s_dtp_cfdj_prescription
+        <set>
+            <if test="name != null and name != ''">patientName = #{name},</if>
+            <if test="phoneNumber != null and phoneNumber != ''">patientPhone = #{phoneNumber}</if>
+        </set>
+        where id = #{prescriptionId}
+    </update>
     <update id="updateRecipe" parameterType="pd">
         update s_dtp_cfdj_prescription
-        <trim prefix=" SET " suffix="" prefixOverrides="," suffixOverrides=",">
-            <if test="orderId != null and orderId!=''">orderId=#{orderId},</if>
-            <if test="saleOrderNumber != null and saleOrderNumber!=''">saleOrderNumber=#{saleOrderNumber},</if>
-            <if test="genericName != null and genericName!=''">genericName=#{genericName},</if>
-            <if test="productName != null and productName!=''">productName=#{productName},</if>
-            <if test="specification != null">specification=#{specification},</if>
-            <if test="quantity != null">quantity=#{quantity},</if>
-            <if test="manufacturer != null">manufacturer=#{manufacturer},</if>
-            <if test="mdmCode != null">mdmCode=#{mdmCode},</if>
-            <if test="posMemberName != null and posMemberName!=''">posMemberName=#{posMemberName},</if>
-            <if test="posMemberPhone != null and posMemberPhone!=''">posMemberPhone=#{posMemberPhone},</if>
-            <if test="prescriptionType != null and prescriptionType!=''">prescriptionType=#{prescriptionType},</if>
-            <if test="prescriptionNumber != null and prescriptionNumber!=''">prescriptionNumber=#{prescriptionNumber},</if>
-            <if test="hospital != null">hospital=#{hospital},</if>
-            <if test="department != null">department=#{department},</if>
-            <if test="doctor != null">doctor=#{doctor},</if>
-            <if test="patientName != null and patientName!=''">patientName=#{patientName},</if>
-            <if test="patientPhone != null and patientPhone!=''">patientPhone=#{patientPhone},</if>
-            <if test="storeName != null">storeName=#{storeName},</if>
-            <if test="registrar != null">registrar=#{registrar},</if>
-            <if test="completionTime != null and completionTime!=''">completionTime=#{completionTime},</if>
-            <if test="deliveryMethod != null and deliveryMethod!=''">deliveryMethod=#{deliveryMethod},</if>
-            <if test="paymentCode != null and paymentCode!=''">paymentCode=#{paymentCode},</if>
-            <if test="paymentMethod != null and paymentMethod!=''">paymentMethod=#{paymentMethod},</if>
-            <if test="status != null and status!=''">status=#{status},</if>
-            <if test="isFlipItem != null and isFlipItem!=''">isFlipItem=#{isFlipItem},</if>
-            <if test="lastUpdated != null and lastUpdated!=''">lastUpdated=#{lastUpdated},</if>
-            <if test="createTime != null and createTime!=''">createTime=#{createTime},</if>
-            <if test="orderTime != null and orderTime!=''">orderTime=#{orderTime},</if>
-            <if test="saleOrderTime != null and saleOrderTime!=''">saleOrderTime=#{saleOrderTime},</if>
-        </trim>
-        where id=#{id}
+        <set>
+            <if test="orderId != null and orderId != ''">orderId = #{orderId},</if>
+            <if test="prescriptionDate != null and prescriptionDate != ''">prescriptionDate = #{prescriptionDate},</if>
+            <if test="saleOrderNumber != null and saleOrderNumber != ''">saleOrderNumber = #{saleOrderNumber},</if>
+            <if test="prescriptionNumber != null and prescriptionNumber != ''">prescriptionNumber = #{prescriptionNumber},</if>
+            <if test="prescription_drug_id != null and prescription_drug_id != ''">prescription_drug_id = #{prescription_drug_id},</if>
+            <if test="prescriptionDrug != null and prescriptionDrug != ''">prescriptionDrug = #{prescriptionDrug},</if>
+            <if test="dosage != null and dosage != ''">dosage = #{dosage},</if>
+            <if test="drugRoute != null and drugRoute != ''">drugRoute = #{drugRoute},</if>
+            <if test="medicationCycle != null and medicationCycle != ''">medicationCycle = #{medicationCycle},</if>
+            <if test="singleDose != null and singleDose != ''">singleDose = #{singleDose},</if>
+            <if test="diseaseType != null and diseaseType != ''">diseaseType = #{diseaseType},</if>
+            <if test="clinicalDiagnosis != null and clinicalDiagnosis != ''">clinicalDiagnosis = #{clinicalDiagnosis},</if>
+            <if test="prescriptionImg != null and prescriptionImg != ''">prescriptionImg = #{prescriptionImg},</if>
+            <if test="prescriptionSource != null and prescriptionSource != ''">prescriptionSource = #{prescriptionSource},</if>
+            <if test="genericName != null and genericName != ''">genericName = #{genericName},</if>
+            <if test="specification != null and specification != ''">specification = #{specification},</if>
+            <if test="quantity != null and quantity != ''">quantity = #{quantity},</if>
+            <if test="frequency != null and frequency != ''">frequency = #{frequency},</if>
+            <if test="usage != null and usage != ''">usage = #{usage},</if>
+            <if test="wordUsage != null and wordUsage != ''">wordUsage = #{wordUsage},</if>
+            <if test="manufacturer != null and manufacturer != ''">manufacturer = #{manufacturer},</if>
+            <if test="createTime != null and createTime != ''">createTime = #{createTime},</if>
+            <if test="saleOrderTime != null and saleOrderTime != ''">saleOrderTime = #{saleOrderTime},</if>
+            <if test="orderTime != null and orderTime != ''">orderTime = #{orderTime},</if>
+            <if test="hospital != null and hospital != ''">hospital = #{hospital},</if>
+            <if test="department != null and department != ''">department = #{department},</if>
+            <if test="doctor != null and doctor != ''">doctor = #{doctor},</if>
+            <if test="patientName != null and patientName != ''">patientName = #{patientName},</if>
+            <if test="patientPhone != null and patientPhone != ''">patientPhone = #{patientPhone},</if>
+            <if test="storeName != null and storeName != ''">storeName = #{storeName},</if>
+            <if test="isFlipItem != null and isFlipItem != ''">isFlipItem = #{isFlipItem},</if>
+            <if test="noFlipCause != null and noFlipCause != ''">noFlipCause = #{noFlipCause},</if>
+            <if test="registrar != null and registrar != ''">registrar = #{registrar},</if>
+            <if test="completionTime != null and completionTime != ''">completionTime = #{completionTime},</if>
+            <if test="lastUpdated != null and lastUpdated != ''">lastUpdated = #{lastUpdated},</if>
+            <if test="deliveryMethod != null and deliveryMethod != ''">deliveryMethod = #{deliveryMethod},</if>
+            <if test="paymentCode != null and paymentCode != ''">paymentCode = #{paymentCode},</if>
+            <if test="paymentMethod != null and paymentMethod != ''">paymentMethod = #{paymentMethod},</if>
+            <if test="status != null and status != ''">status = #{status},</if>
+            <if test="del_flag != null and del_flag != ''">del_flag = #{del_flag},</if>
+            <if test="posMemberName != null and posMemberName != ''">posMemberName = #{posMemberName},</if>
+            <if test="productName != null and productName != ''">productName = #{productName},</if>
+            <if test="mdmCode != null and mdmCode != ''">mdmCode = #{mdmCode},</if>
+            <if test="posMemberPhone != null and posMemberPhone != ''">posMemberPhone = #{posMemberPhone},</if>
+            <if test="prescriptionType != null and prescriptionType != ''">prescriptionType = #{prescriptionType},</if>
+            <if test="storeId != null and storeId != ''">storeId = #{storeId},</if>
+        </set>
+        where id = #{id}
     </update>
+
     <select id="checkPatientNameAndPhoneUnique" parameterType="pd" resultType="pd">
         select name, phoneNumber from s_dtp_ysfw_archive_management where name=#{name} and phoneNumber=#{phoneNumber} and del_flag = '0' limit 1
     </select>
@@ -569,6 +623,9 @@
         <if test="sideEffects != null and sideEffects != ''">
             AND sideEffects =#{sideEffects}
         </if>
+        <if test="drugSource != null and drugSource != ''">
+            AND drugSource = #{drugSource}
+        </if>
         <if test="creator != null and creator != ''">
             AND creator = #{creator}
         </if>
@@ -592,6 +649,7 @@
             <if test="specification != null and specification != ''">specification,</if>
             <if test="usageMethod != null and usageMethod != ''">usageMethod,</if>
             <if test="quantity != null">quantity,</if>
+            <if test="manufacturer != null and manufacturer != ''">manufacturer,</if>
             <if test="frequency != null and frequency != ''">frequency,</if>
             <if test="wordUsage != null and wordUsage != ''">wordUsage,</if>
             <if test="medicationCycle != null and medicationCycle != ''">medicationCycle,</if>
@@ -599,10 +657,12 @@
             <if test="dosage != null and dosage != ''">dosage,</if>
             <if test="indication != null and indication != ''">indication,</if>
             <if test="sideEffects != null and sideEffects != ''">sideEffects,</if>
+            <if test="drugSource != null and drugSource != ''">drugSource,</if>
             <if test="creator != null and creator != ''">creator,</if>
             <if test="createTime != null">createTime,</if>
             <if test="status != null">status,</if>
-            <if test="isFlipItem != null">isFlipItem,</if>
+            <if test="isFlipItem != null and isFlipItem !=''">isFlipItem,</if>
+            <if test="patientId != null and patientId !=''">patientId,</if>
             <if test="remarks != null and remarks != ''">remarks</if>
         </trim>
         VALUES
@@ -614,6 +674,7 @@
             <if test="specification != null and specification != ''">#{specification},</if>
             <if test="usageMethod != null and usageMethod != ''">#{usageMethod},</if>
             <if test="quantity != null">#{quantity},</if>
+            <if test="manufacturer != null and manufacturer != ''">#{manufacturer},</if>
             <if test="frequency != null and frequency != ''">#{frequency},</if>
             <if test="wordUsage != null and wordUsage != ''">#{wordUsage},</if>
             <if test="medicationCycle != null and medicationCycle != ''">#{medicationCycle},</if>
@@ -621,11 +682,12 @@
             <if test="dosage != null and dosage != ''">#{dosage},</if>
             <if test="indication != null and indication != ''">#{indication},</if>
             <if test="sideEffects != null and sideEffects != ''">#{sideEffects},</if>
+            <if test="drugSource != null and drugSource != ''">#{drugSource},</if>
             <if test="creator != null and creator != ''">#{creator},</if>
             <if test="createTime != null">#{createTime},</if>
             <if test="status != null">#{status},</if>
             <if test="isFlipItem != null">#{isFlipItem},</if>
-
+            <if test="patientId != null and patientId !=''">#{patientId},</if>
             <if test="remarks != null and remarks != ''">#{remarks}</if>
         </trim>
     </insert>
@@ -636,10 +698,12 @@
             <if test="dataList[0].productName != null and dataList[0].productName != ''">productName,</if>
             <if test="dataList[0].genericName != null and dataList[0].genericName != ''">genericName,</if>
             <if test="dataList[0].prescriptionNumber != null and dataList[0].prescriptionNumber != ''">prescriptionNumber,</if>
+            <if test="dataList[0].soptemplateId != null">soptemplateId,</if>
             <if test="dataList[0].drugCode != null and dataList[0].drugCode != ''">drugCode,</if>
             <if test="dataList[0].specification != null and dataList[0].specification != ''">specification,</if>
             <if test="dataList[0].usageMethod != null and dataList[0].usageMethod != ''">usageMethod,</if>
             <if test="dataList[0].quantity != null">quantity,</if>
+            <if test="manufacturer != null and manufacturer != ''">manufacturer,</if>
             <if test="dataList[0].frequency != null and dataList[0].frequency != ''">frequency,</if>
             <if test="dataList[0].wordUsage != null and dataList[0].wordUsage != ''">wordUsage,</if>
             <if test="dataList[0].medicationCycle != null and dataList[0].medicationCycle != ''">medicationCycle,</if>
@@ -647,10 +711,12 @@
             <if test="dataList[0].dosage != null and dataList[0].dosage != ''">dosage,</if>
             <if test="dataList[0].indication != null and dataList[0].indication != ''">indication,</if>
             <if test="dataList[0].sideEffects != null and dataList[0].sideEffects != ''">sideEffects,</if>
+            <if test="dataList[0].drugSource != null and dataList[0].drugSource != ''">drugSource,</if>
             <if test="dataList[0].creator != null and dataList[0].creator != ''">creator,</if>
             <if test="dataList[0].createTime != null">createTime,</if>
             <if test="dataList[0].status != null">status,</if>
             <if test="dataList[0].isFlipItem != null and dataList[0].isFlipItem != ''">isFlipItem,</if>
+            <if test="dataList[0].patientId != null and dataList[0].patientId != ''">patientId,</if>
             <if test="dataList[0].remarks != null and dataList[0].remarks != ''">remarks</if>
         </trim>
         VALUES
@@ -659,10 +725,12 @@
                 <if test="item.productName != null and item.productName != ''">#{item.productName},</if>
                 <if test="item.genericName != null and item.genericName != ''">#{item.genericName},</if>
                 <if test="item.prescriptionNumber != null and item.prescriptionNumber != ''">#{item.prescriptionNumber},</if>
+                <if test="item.soptemplateId != null">#{item.soptemplateId},</if>
                 <if test="item.drugCode != null and item.drugCode != ''">#{item.drugCode},</if>
                 <if test="item.specification != null and item.specification != ''">#{item.specification},</if>
                 <if test="item.usageMethod != null and item.usageMethod != ''">#{item.usageMethod},</if>
                 <if test="item.quantity != null">#{item.quantity},</if>
+                <if test="item.manufacturer != null and item.manufacturer != ''">{item.manufacturer},</if>
                 <if test="item.frequency != null and item.frequency != ''">#{item.frequency},</if>
                 <if test="item.wordUsage != null and item.wordUsage != ''">#{item.wordUsage},</if>
                 <if test="item.medicationCycle != null and item.medicationCycle != ''">#{item.medicationCycle},</if>
@@ -670,10 +738,12 @@
                 <if test="item.dosage != null and item.dosage != ''">#{item.dosage},</if>
                 <if test="item.indication != null and item.indication != ''">#{item.indication},</if>
                 <if test="item.sideEffects != null and item.sideEffects != ''">#{item.sideEffects},</if>
+                <if test="item.drugSource != null and item.drugSource != ''">#{item.drugSource},</if>
                 <if test="item.creator != null and item.creator != ''">#{item.creator},</if>
                 <if test="item.createTime != null">#{item.createTime},</if>
                 <if test="item.status != null">#{item.status},</if>
                 <if test="item.isFlipItem != null and item.isFlipItem != ''">#{item.isFlipItem},</if>
+                <if test="item.patientId != null and item.patientId != ''">#{item.patientId},</if>
                 <if test="item.remarks != null and item.remarks != ''">#{item.remarks}</if>
             </trim>
         </foreach>
@@ -702,6 +772,10 @@
                 <if test="item.quantity != null">
                     quantity = #{item.quantity},
                 </if>
+                <if test="item.manufacturer != null and item.manufacturer != ''">
+                    manufacturer = #{item.manufacturer},
+                </if>
+
                 <if test="item.frequency != null and item.frequency != ''">
                     frequency = #{item.frequency},
                 </if>
@@ -723,6 +797,9 @@
                 <if test="item.sideEffects != null and item.sideEffects != ''">
                     sideEffects = #{item.sideEffects},
                 </if>
+                    <if test="item.drugSource != null and item.drugSource != ''">
+                    drugSource = #{item.drugSource},
+                </if>
                 <if test="item.creator != null and item.creator != ''">
                     creator = #{item.creator},
                 </if>
@@ -735,7 +812,9 @@
                 <if test="item.isFlipItem != null and item.isFlipItem != ''">
                     isFlipItem = #{item.isFlipItem},
                 </if>
-
+                <if test="item.patientId != null and item.patientId != ''">
+                    item.patientId = #{item.patientId},
+                </if>
                 <if test="item.remarks != null and item.remarks != ''">
                     remarks = #{item.remarks}
                 </if>
@@ -769,6 +848,9 @@
             <if test="quantity != null">
                 quantity = #{quantity},
             </if>
+            <if test="manufacturer != null and manufacturer != ''">
+                manufacturer = #{manufacturer},
+            </if>
             <if test="frequency != null and frequency != ''">
                 frequency = #{frequency},
             </if>
@@ -790,6 +872,9 @@
             <if test="sideEffects != null and sideEffects != ''">
                 sideEffects = #{sideEffects},
             </if>
+            <if test="drugSource != null and drugSource != ''">
+                drugSource = #{drugSource},
+            </if>
             <if test="creator != null and creator != ''">
                 creator = #{creator},
             </if>
@@ -802,6 +887,9 @@
             <if test="isFlipItem != null and isFlipItem != ''">
                 isFlipItem = #{isFlipItem},
             </if>
+            <if test="patientId != null and patientId != ''">
+                patientId = #{patientId},
+            </if>
             <if test="remarks != null and remarks != ''">
                 remarks = #{remarks}
             </if>

+ 86 - 5
health-system/src/main/resources/mapper/system/SysDeptMapper.xml

@@ -23,7 +23,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	</resultMap>
 
 	<sql id="selectDeptVo">
-        select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status, d.del_flag, d.create_by, d.create_time
+        select  d.dept_id,
+				d.parent_id,
+				d.ancestors,
+				d.dept_name,
+				d.order_num,
+				d.leader,
+				d.phone,
+				d.email,
+				d.status,
+				d.del_flag,
+				d.create_by,
+				d.create_time,
+				d.address,
+				d.storeCode,
+				d.city,
+				d.province,
+				d.latitude,
+				d.longitude,
+				d.licenseNumber,
+				d.pharmacyLicenseExpiryDate,
+				d.registeredCapital,
+				d.businessScope,
+				d.remark
         from sys_dept d
     </sql>
 
@@ -72,7 +94,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	</select>
 
 	<select id="selectDeptById" parameterType="Long" resultMap="SysDeptResult">
-		select d.dept_id, d.parent_id, d.ancestors, d.dept_name, d.order_num, d.leader, d.phone, d.email, d.status,
+
+		select
+			d.dept_id,
+			d.parent_id,
+			d.ancestors,
+			d.dept_name,
+			d.order_num,
+			d.leader,
+			d.phone,
+			d.email,
+			d.status,
+			d.del_flag,
+			d.create_by,
+			d.create_time,
+			d.address,
+			d.storeCode,
+			d.city,
+			d.province,
+			d.latitude,
+			d.longitude,
+			d.licenseNumber,
+			d.pharmacyLicenseExpiryDate,
+			d.registeredCapital,
+			d.businessScope,
+			d.remark,
 			(select dept_name from sys_dept where dept_id = d.parent_id) parent_name
 		from sys_dept d
 		where d.dept_id = #{deptId}
@@ -98,7 +144,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="email != null and email != ''">email,</if>
  			<if test="status != null">status,</if>
  			<if test="createBy != null and createBy != ''">create_by,</if>
- 			create_time
+ 			create_time,
+		<if test="address != null and address != ''">address,</if>
+		<if test="storeCode != null and storeCode != ''">storeCode,</if>
+		<if test="city != null and city != ''">city,</if>
+		<if test="province != null and province != ''">province,</if>
+		<if test="latitude != null and latitude != ''">latitude,</if>
+		<if test="longitude != null and longitude != ''">longitude,</if>
+		<if test="licenseNumber != null and licenseNumber != ''">licenseNumber,</if>
+		<if test="pharmacyLicenseExpiryDate != null">pharmacyLicenseExpiryDate,</if>
+		<if test="registeredCapital != null and registeredCapital != ''">registeredCapital,</if>
+		<if test="businessScope != null and businessScope != ''">businessScope,</if>
+		<if test="remark != null and remark != ''">remark</if>
  		)values(
  			<if test="deptId != null and deptId != 0">#{deptId},</if>
  			<if test="parentId != null and parentId != 0">#{parentId},</if>
@@ -110,7 +167,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="email != null and email != ''">#{email},</if>
  			<if test="status != null">#{status},</if>
  			<if test="createBy != null and createBy != ''">#{createBy},</if>
- 			sysdate()
+ 			sysdate(),
+		<!-- 新增字段 -->
+		<if test="address != null and address != ''">#{address},</if>
+		<if test="storeCode != null and storeCode != ''">#{storeCode},</if>
+		<if test="city != null and city != ''">#{city},</if>
+		<if test="province != null and province != ''">#{province},</if>
+		<if test="latitude != null and latitude != ''">#{latitude},</if>
+		<if test="longitude != null and longitude != ''">#{longitude},</if>
+		<if test="licenseNumber != null and licenseNumber != ''">#{licenseNumber},</if>
+		<if test="pharmacyLicenseExpiryDate != null">#{pharmacyLicenseExpiryDate},</if>
+		<if test="registeredCapital != null and registeredCapital != ''">#{registeredCapital},</if>
+		<if test="businessScope != null and businessScope != ''">#{businessScope},</if>
+		<if test="remark != null and remark != ''">#{remark}</if>
  		)
 	</insert>
 
@@ -126,7 +195,19 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  			<if test="email != null">email = #{email},</if>
  			<if test="status != null and status != ''">status = #{status},</if>
  			<if test="updateBy != null and updateBy != ''">update_by = #{updateBy},</if>
- 			update_time = sysdate()
+ 			update_time = sysdate(),
+			<!-- 新增字段 -->
+			<if test="address != null and address != ''">address = #{address},</if>
+			<if test="storeCode != null and storeCode != ''">storeCode = #{storeCode},</if>
+			<if test="city != null and city != ''">city = #{city},</if>
+			<if test="province != null and province != ''">province = #{province},</if>
+			<if test="latitude != null and latitude != ''">latitude = #{latitude},</if>
+			<if test="longitude != null and longitude != ''">longitude = #{longitude},</if>
+			<if test="licenseNumber != null and licenseNumber != ''">licenseNumber= #{licenseNumber},</if>
+			<if test="pharmacyLicenseExpiryDate != null">pharmacyLicenseExpiryDate= #{pharmacyLicenseExpiryDate},</if>
+			<if test="registeredCapital != null and registeredCapital != ''">registeredCapital= #{registeredCapital},</if>
+			<if test="businessScope != null and businessScope != ''">businessScope= #{businessScope},</if>
+			<if test="remark != null and remark != ''">remark= #{remark}</if>
  		</set>
  		where dept_id = #{deptId}
 	</update>

+ 13 - 1
pom.xml

@@ -31,6 +31,9 @@
         <velocity.version>2.3</velocity.version>
         <lombok.version>1.18.24</lombok.version>
         <log.version>1.2.17</log.version>
+        <gson.version>2.8.8</gson.version>
+        <bcprov.version>1.68</bcprov.version>
+
     </properties>
 
     <!-- 依赖声明 -->
@@ -69,6 +72,11 @@
                 <version>${kaptcha.version}</version>
             </dependency>
 
+            <dependency>
+                <groupId>com.google.code.gson</groupId>
+                <artifactId>gson</artifactId>
+                <version>${gson.version}</version>
+            </dependency>
             <!-- Shiro核心框架 -->
             <dependency>
                 <groupId>org.apache.shiro</groupId>
@@ -151,7 +159,11 @@
                 <artifactId>velocity-engine-core</artifactId>
                 <version>${velocity.version}</version>
             </dependency>
-
+            <dependency>
+                <groupId>org.bouncycastle</groupId>
+                <artifactId>bcprov-jdk15on</artifactId>
+                <version>${bcprov.version}</version> <!-- 请使用最新版本 -->
+            </dependency>
             <!-- 阿里JSON解析器 -->
             <dependency>
                 <groupId>com.alibaba</groupId>