Browse Source

在院结算添加

wisewoods 3 years ago
parent
commit
4c5b30eaed

+ 9 - 0
ruoyi-api/ruoyi-api-ext/src/main/java/com/ruoyi/ext/api/validate/group/AddGroup.java

@@ -0,0 +1,9 @@
+package com.ruoyi.ext.api.validate.group;
+
+/**
+ * 校验分组 add
+ *
+ * @author Lion Li
+ */
+public interface AddGroup {
+}

+ 9 - 0
ruoyi-api/ruoyi-api-ext/src/main/java/com/ruoyi/ext/api/validate/group/EditGroup.java

@@ -0,0 +1,9 @@
+package com.ruoyi.ext.api.validate.group;
+
+/**
+ * 校验分组 edit
+ *
+ * @author Lion Li
+ */
+public interface EditGroup {
+}

+ 9 - 0
ruoyi-api/ruoyi-api-ext/src/main/java/com/ruoyi/ext/api/validate/group/QueryGroup.java

@@ -0,0 +1,9 @@
+package com.ruoyi.ext.api.validate.group;
+
+/**
+ * 校验分组 query
+ *
+ * @author Lion Li
+ */
+public interface QueryGroup {
+}

+ 0 - 4
ruoyi-common/ruoyi-common-security/src/main/java/com/ruoyi/common/security/config/WebMvcConfig.java

@@ -79,10 +79,6 @@ public class WebMvcConfig implements WebMvcConfigurer {
                 put("Range", "不符合范围{min}-{max}");//max min
                 put("Digits", "不符合位数上限为{integer}位,小数为{fraction}位的规范");//integer fraction
                 put("NotBlank", "不能为空");
-                put("Min", "不能小于{value}");
-                put("Max", "不能大于{value}");
-                put("DecimalMin", "不能小于{value}");
-                put("DecimalMax", "不能大于{value}");
                 put("Pattern", "不符合{regexp}规范");
             }};
 }

+ 11 - 0
ruoyi-modules/mz-organization/src/main/java/com/ruoyi/organization/controller/YljgSyglController.java

@@ -8,6 +8,7 @@ import com.ruoyi.common.log.enums.BusinessType;
 import com.ruoyi.common.security.annotation.RequiresPermissions;
 import com.ruoyi.organization.domain.YljgKhJbxx;
 import com.ruoyi.organization.domain.YljgSygl;
+import com.ruoyi.organization.domain.YljgZyjs;
 import com.ruoyi.organization.service.IYljgSyglService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
@@ -52,6 +53,16 @@ public class YljgSyglController extends BaseController
         return getDataTable(list);
     }
 
+    /**
+     * 查询养老机构_财务管理 在院结算
+     */
+    @RequiresPermissions("organization:cyjs:list")
+    @GetMapping("/listByZy")
+    public AjaxResult listByZy(YljgZyjs yljgZyjs)
+    {
+        return  yljgSyglService.listByZy(yljgZyjs);
+    }
+
     /**
      * 获取养老机构_收银管理详细信息
      */

+ 5 - 0
ruoyi-modules/mz-organization/src/main/java/com/ruoyi/organization/domain/YljgKhHtxx.java

@@ -1,6 +1,7 @@
 package com.ruoyi.organization.domain;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.ruoyi.common.core.annotation.Excel;
@@ -230,11 +231,15 @@ public class YljgKhHtxx extends BaseEntity
     @NotBlank(message = "{床位主键标识}")
     private String cwId;
 
+    @TableField(exist = false)
     private String sjhm;
 
+    @TableField(exist = false)
     private String isRz;
 
+    @TableField(exist = false)
     private String isQy;
 
+    @TableField(exist = false)
     private String age;
 }

+ 9 - 0
ruoyi-modules/mz-organization/src/main/java/com/ruoyi/organization/domain/YljgKhJbxx.java

@@ -1,6 +1,7 @@
 package com.ruoyi.organization.domain;
 
 import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableField;
 import com.baomidou.mybatisplus.annotation.TableId;
 import com.baomidou.mybatisplus.annotation.TableName;
 import com.ruoyi.common.core.annotation.Excel;
@@ -273,21 +274,29 @@ public class YljgKhJbxx extends BaseEntity
     @NotBlank(message = "{居住地行政区划ID}")
     private String xzqhId;
 
+    @TableField(exist = false)
     private String age;
 
+    @TableField(exist = false)
     private String xzqhName;
 
+    @TableField(exist = false)
     private YljgKhHtxx htxx;
 
+    @TableField(exist = false)
     private String fjh;
 
+    @TableField(exist = false)
     private String cwh;
 
+    @TableField(exist = false)
     private List<YljgKhRztzxx> rzdjxx;
 
+    @TableField(exist = false)
     @Valid
     private List<YljgKhJtxx> yljgKhJtxxList;
 
+    @TableField(exist = false)
     @Valid
     private List<YljgKhChxxx> yljgKhChxxxList;
 

+ 32 - 0
ruoyi-modules/mz-organization/src/main/java/com/ruoyi/organization/domain/YljgZyjs.java

@@ -0,0 +1,32 @@
+package com.ruoyi.organization.domain;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+@Data
+@NoArgsConstructor
+public class YljgZyjs {
+
+    private static final long serialVersionUID = 1L;
+
+    /** 客户id */
+    @ApiModelProperty(value = "客户id")
+    private String khId;
+
+    /** 结算开始月份 */
+    @ApiModelProperty(value = "结算开始月份")
+    private String start;
+
+    /** 结算结束月份 */
+    @ApiModelProperty(value = "结算结束月份")
+    private String end;
+
+    /** 日期 */
+    @ApiModelProperty(value = "日期")
+    private String date;
+
+    /** 充值小计 */
+    @ApiModelProperty(value = "充值小计")
+    private String money;
+}

+ 5 - 0
ruoyi-modules/mz-organization/src/main/java/com/ruoyi/organization/mapper/YljgSyglMapper.java

@@ -4,6 +4,9 @@ import com.ruoyi.common.datascope.handler.DataColumn;
 import com.ruoyi.common.datascope.handler.DataPermission;
 import com.ruoyi.common.datascope.utils.BaseMapperPlus;
 import com.ruoyi.organization.domain.YljgSygl;
+import com.ruoyi.organization.domain.YljgZyjs;
+
+import java.util.List;
 
 /**
  * 养老机构_收银管理Mapper接口
@@ -14,4 +17,6 @@ import com.ruoyi.organization.domain.YljgSygl;
 @DataPermission({@DataColumn(key = "userName", value = "create_user_id")})
 public interface YljgSyglMapper extends BaseMapperPlus<YljgSygl>
 {
+    List<YljgZyjs> listByZy(YljgZyjs yljgZyjs);
+
 }

+ 4 - 0
ruoyi-modules/mz-organization/src/main/java/com/ruoyi/organization/service/IYljgSyglService.java

@@ -1,7 +1,9 @@
 package com.ruoyi.organization.service;
 
+import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.organization.domain.YljgKhJbxx;
 import com.ruoyi.organization.domain.YljgSygl;
+import com.ruoyi.organization.domain.YljgZyjs;
 
 import java.util.List;
 
@@ -54,4 +56,6 @@ public interface IYljgSyglService
     public int deleteYljgSyglByIds(String[] ids);
 
     public List<YljgKhJbxx> listByQy(YljgKhJbxx yljgKhJbxx);
+
+    public AjaxResult listByZy(YljgZyjs yljgZyjs);
 }

+ 20 - 0
ruoyi-modules/mz-organization/src/main/java/com/ruoyi/organization/service/impl/YljgSyglServiceImpl.java

@@ -1,9 +1,13 @@
 package com.ruoyi.organization.service.impl;
 
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.ruoyi.common.core.web.domain.AjaxResult;
 import com.ruoyi.common.security.utils.SecurityUtils;
+import com.ruoyi.organization.domain.YljgKhHtxx;
 import com.ruoyi.organization.domain.YljgKhJbxx;
 import com.ruoyi.organization.domain.YljgSygl;
+import com.ruoyi.organization.domain.YljgZyjs;
+import com.ruoyi.organization.mapper.YljgKhHtxxMapper;
 import com.ruoyi.organization.mapper.YljgKhJbxxMapper;
 import com.ruoyi.organization.mapper.YljgSyglMapper;
 import com.ruoyi.organization.service.IYljgSyglService;
@@ -28,6 +32,9 @@ public class YljgSyglServiceImpl implements IYljgSyglService
     @Autowired
     private YljgKhJbxxMapper yljgKhJbxxMapper;
 
+    @Autowired
+    private YljgKhHtxxMapper yljgKhHtxxMapper;
+
     /**
      * 查询养老机构_收银管理
      *
@@ -94,4 +101,17 @@ public class YljgSyglServiceImpl implements IYljgSyglService
         return yljgKhJbxxMapper.selectList(new LambdaQueryWrapper<>(yljgKhJbxx));
     }
 
+    @Override
+    public AjaxResult listByZy(YljgZyjs yljgZyjs) {
+        List<YljgZyjs> syList = yljgSyglMapper.listByZy(yljgZyjs);
+
+        YljgKhHtxx query = new YljgKhHtxx();
+        query.setKhId(yljgZyjs.getKhId());
+        YljgKhHtxx yljgKhHtxx = yljgKhHtxxMapper.selectOne(new LambdaQueryWrapper<>(query));
+        return AjaxResult.success()
+                .put("htxx",yljgKhHtxx)
+                .put("syList",syList)
+                ;
+    }
+
 }

+ 19 - 0
ruoyi-modules/mz-organization/src/main/resources/mapper/organization/YljgSyglMapper.xml

@@ -27,5 +27,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="state"    column="state"    />
     </resultMap>
 
+    <resultMap type="YljgZyjs" id="YljgZyjsResult">
+        <result property="date"    column="date"    />
+        <result property="money"    column="money"    />
+    </resultMap>
+
+    <select id="listByZy" parameterType="YljgZyjs" resultMap="YljgZyjsResult" >
+        SELECT
+        SUM( (case sklx WHEN '2' THEN -je WHEN '1' THEN je ELSE 0 END)) AS money,
+        LEFT ( sksj, 6 ) AS date
+        FROM
+        yljg_sygl
+        <where>
+            kh_id = #{khId}
+            <if test="start != null  and start != ''">AND sksj &gt;= #{start}</if>
+            <if test="end != null  and end != ''">AND sksj &lt; #{end}</if>
+        </where>
+        GROUP BY date
+    </select>
+
 
 </mapper>

+ 10 - 0
ruoyi-ui/src/api/rcyy/sygl.js

@@ -17,6 +17,16 @@ export function listSygl(query) {
         params: query
     })
 }
+
+// 查询养老机构_在院结算
+export function listByZy(query) {
+  return request({
+    url: '/organization/sygl/listByZy',
+    method: 'get',
+    params: query
+  })
+}
+
 // 查询养老机构_收银管理详细
 export function getSygl(id) {
     return request({

+ 119 - 558
ruoyi-ui/src/views/rcyy/cyjs/index.vue

@@ -1,14 +1,7 @@
 <template>
   <div class="app-container">
-    <el-form
-      :model="queryParams"
-      ref="queryForm"
-      size="small"
-      :inline="true"
-      v-show="showSearch"
-      label-width="68px"
-    >
-      <el-form-item label="姓名" prop="xm">
+    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="140px">
+      <el-form-item label="客户姓名" prop="xm">
         <el-input
           v-model="queryParams.xm"
           placeholder="请输入姓名"
@@ -32,652 +25,220 @@
           @keyup.enter.native="handleQuery"
         />
       </el-form-item>
-      <!--      <el-form-item label="入住机构" prop="rzjg">-->
-      <!--        <el-input-->
-      <!--          v-model="queryParams.rzjg"-->
-      <!--          placeholder="请输入入住机构"-->
-      <!--          clearable-->
-      <!--          @keyup.enter.native="handleQuery"-->
-      <!--        />-->
-      <!--      </el-form-item>-->
-      <!--      <el-form-item label="结算开始日期" prop="jsksrq">-->
-      <!--        <el-input-->
-      <!--          v-model="queryParams.jsksrq"-->
-      <!--          placeholder="请输入结算开始日期"-->
-      <!--          clearable-->
-      <!--          @keyup.enter.native="handleQuery"-->
-      <!--        />-->
-      <!--      </el-form-item>-->
-      <!--      <el-form-item label="结算结束日期" prop="jsjsrq">-->
-      <!--        <el-date-picker clearable-->
-      <!--          v-model="queryParams.jsjsrq"-->
-      <!--          type="date"-->
-      <!--          value-format="yyyy-MM-dd"-->
-      <!--          placeholder="请选择结算结束日期">-->
-      <!--        </el-date-picker>-->
-      <!--      </el-form-item>-->
-      <!--      <el-form-item label="充值小记" prop="czxj">-->
-      <!--        <el-date-picker clearable-->
-      <!--          v-model="queryParams.czxj"-->
-      <!--          type="date"-->
-      <!--          value-format="yyyy-MM-dd"-->
-      <!--          placeholder="请选择充值小记">-->
-      <!--        </el-date-picker>-->
-      <!--      </el-form-item>-->
-      <!--      <el-form-item label="支出" prop="zc">-->
-      <!--        <el-input-->
-      <!--          v-model="queryParams.zc"-->
-      <!--          placeholder="请输入支出"-->
-      <!--          clearable-->
-      <!--          @keyup.enter.native="handleQuery"-->
-      <!--        />-->
-      <!--      </el-form-item>-->
-      <!--      <el-form-item label="收入" prop="sr">-->
-      <!--        <el-input-->
-      <!--          v-model="queryParams.sr"-->
-      <!--          placeholder="请输入收入"-->
-      <!--          clearable-->
-      <!--          @keyup.enter.native="handleQuery"-->
-      <!--        />-->
-      <!--      </el-form-item>-->
-      <!--      <el-form-item label="消费小计" prop="xfxj">-->
-      <!--        <el-input-->
-      <!--          v-model="queryParams.xfxj"-->
-      <!--          placeholder="请输入消费小计"-->
-      <!--          clearable-->
-      <!--          @keyup.enter.native="handleQuery"-->
-      <!--        />-->
-      <!--      </el-form-item>-->
-      <!--      <el-form-item label="余额" prop="ye">-->
-      <!--        <el-input-->
-      <!--          v-model="queryParams.ye"-->
-      <!--          placeholder="请输入余额"-->
-      <!--          clearable-->
-      <!--          @keyup.enter.native="handleQuery"-->
-      <!--        />-->
-      <!--      </el-form-item>-->
-      <!--      <el-form-item label="客户id" prop="khId">-->
-      <!--        <el-input-->
-      <!--          v-model="queryParams.khId"-->
-      <!--          placeholder="请输入客户id"-->
-      <!--          clearable-->
-      <!--          @keyup.enter.native="handleQuery"-->
-      <!--        />-->
-      <!--      </el-form-item>-->
       <el-form-item>
-        <el-button
-          type="primary"
-          icon="el-icon-search"
-          size="mini"
-          @click="handleQuery"
-        >搜索</el-button
-        >
-        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery"
-        >重置</el-button
-        >
+        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
+        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
       </el-form-item>
     </el-form>
 
-    <!--    <el-row :gutter="10" class="mb8">-->
-    <!--      <el-col :span="1.5">-->
-    <!--        <el-button-->
-    <!--          type="primary"-->
-    <!--          plain-->
-    <!--          icon="el-icon-plus"-->
-    <!--          size="mini"-->
-    <!--          @click="handleAdd"-->
-    <!--          v-hasPermi="['organization:cyjs:add']"-->
-    <!--        >新增</el-button>-->
-    <!--      </el-col>-->
-    <!--      <el-col :span="1.5">-->
-    <!--        <el-button-->
-    <!--          type="success"-->
-    <!--          plain-->
-    <!--          icon="el-icon-edit"-->
-    <!--          size="mini"-->
-    <!--          :disabled="single"-->
-    <!--          @click="handleUpdate"-->
-    <!--          v-hasPermi="['organization:cyjs:edit']"-->
-    <!--        >修改</el-button>-->
-    <!--      </el-col>-->
-    <!--      <el-col :span="1.5">-->
-    <!--        <el-button-->
-    <!--          type="danger"-->
-    <!--          plain-->
-    <!--          icon="el-icon-delete"-->
-    <!--          size="mini"-->
-    <!--          :disabled="multiple"-->
-    <!--          @click="handleDelete"-->
-    <!--          v-hasPermi="['organization:cyjs:remove']"-->
-    <!--        >删除</el-button>-->
-    <!--      </el-col>-->
-    <!--      <el-col :span="1.5">-->
-    <!--        <el-button-->
-    <!--          type="warning"-->
-    <!--          plain-->
-    <!--          icon="el-icon-download"-->
-    <!--          size="mini"-->
-    <!--          @click="handleExport"-->
-    <!--          v-hasPermi="['organization:cyjs:export']"-->
-    <!--        >导出</el-button>-->
-    <!--      </el-col>-->
-    <!--      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>-->
-    <!--    </el-row>-->
-
-    <el-table
-      v-loading="loading"
-      :data="cyjsList"
-      @selection-change="handleSelectionChange"
-    >
-      <!-- <el-table-column type="selection" width="55" align="center" /> -->
+    <el-table v-loading="loading" :data="khjbxxList">
       <el-table-column label="序号" align="center">
         <template slot-scope="scope">
-          {{
-            (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1
-          }}
+          {{(queryParams.pageNum-1)*queryParams.pageSize + scope.$index + 1}}
         </template>
       </el-table-column>
-      <el-table-column label="姓名" align="center" prop="xm" />
+      <el-table-column label="客户姓名" align="center" prop="xm"/>
       <el-table-column label="性别" align="center" prop="xb">
         <template slot-scope="scope">
-          <dict-tag :options="dict.type.sys_user_sex" :value="scope.row.xb" />
+          <dict-tag :options="dict.type.C0007" :value="scope.row.xb"/>
         </template>
       </el-table-column>
-      <el-table-column label="手机号码" align="center" prop="sjhm" />
-      <el-table-column label="证件号码" align="center" prop="zjhm" />
+      <el-table-column label="手机号码" align="center" prop="sjhm"/>
+      <el-table-column label="证件号码" align="center" prop="zjhm"/>
       <el-table-column label="出生日期" align="center" prop="csrq">
         <template slot-scope="scope">
           <span>{{ special(scope.row.csrq) }}</span>
         </template>
       </el-table-column>
-      <el-table-column label="入住机构" align="center" prop="jgmc" />
 
-      <!--      <el-table-column label="入住机构" align="center" prop="rzjg" />-->
-      <!--      <el-table-column label="结算开始日期" align="center" prop="jsksrq" />-->
-      <!--      <el-table-column label="结算结束日期" align="center" prop="jsjsrq" width="180">-->
-      <!--        <template slot-scope="scope">-->
-      <!--          <span>{{ parseTime(scope.row.jsjsrq, '{y}-{m}-{d}') }}</span>-->
-      <!--        </template>-->
-      <!--      </el-table-column>-->
-      <!--      <el-table-column label="充值小记" align="center" prop="czxj" width="180">-->
-      <!--        <template slot-scope="scope">-->
-      <!--          <span>{{ parseTime(scope.row.czxj, '{y}-{m}-{d}') }}</span>-->
-      <!--        </template>-->
-      <!--      </el-table-column>-->
-      <!--      <el-table-column label="支出" align="center" prop="zc" />-->
-      <!--      <el-table-column label="收入" align="center" prop="sr" />-->
-      <!--      <el-table-column label="消费小计" align="center" prop="xfxj" />-->
-      <!--      <el-table-column label="余额" align="center" prop="ye" />-->
-      <!--      <el-table-column label="客户id" align="center" prop="khId" />-->
-      <el-table-column
-        label="操作"
-        align="center"
-        class-name="small-padding fixed-width"
-      >
+      <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
             size="mini"
             type="text"
             icon="el-icon-edit"
-            @click="handleView(scope.row)"
-            v-hasPermi="['organization:cyjs:edit']"
-          >在院结算</el-button
-          >
-          <!-- <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['organization:cyjs:edit']"
-          >修改</el-button> -->
-          <!-- <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row, scope.$index)"
-            v-hasPermi="['organization:cyjs:remove']"
-            >删除</el-button
-          > -->
+            @click="getSyList(scope.row)"
+            v-hasPermi="['organization:cyjs:list']"
+          >在院结算
+          </el-button>
         </template>
       </el-table-column>
     </el-table>
 
     <pagination
-      v-show="total > 0"
-      :total="total"
+      v-show="khTotal>0"
+      :total="khTotal"
       :page.sync="queryParams.pageNum"
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />
 
-    <!-- 添加或修改出院结算对话框 -->
-    <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
-      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
-        <el-form-item label="入住机构" prop="rzjg">
-          <el-input v-model="form.rzjg" placeholder="请输入入住机构" />
-        </el-form-item>
-        <el-form-item label="结算开始日期" prop="jsksrq">
-          <el-input v-model="form.jsksrq" placeholder="请输入结算开始日期" />
-        </el-form-item>
-        <el-form-item label="结算结束日期" prop="jsjsrq">
-          <el-date-picker
-            clearable
-            v-model="form.jsjsrq"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="请选择结算结束日期"
-          >
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="充值小记" prop="czxj">
-          <el-date-picker
-            clearable
-            v-model="form.czxj"
-            type="date"
-            value-format="yyyy-MM-dd"
-            placeholder="请选择充值小记"
-          >
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item label="支出" prop="zc">
-          <el-input v-model="form.zc" placeholder="请输入支出" />
-        </el-form-item>
-        <el-form-item label="收入" prop="sr">
-          <el-input v-model="form.sr" placeholder="请输入收入" />
-        </el-form-item>
-        <el-form-item label="消费小计" prop="xfxj">
-          <el-input v-model="form.xfxj" placeholder="请输入消费小计" />
-        </el-form-item>
-        <el-form-item label="余额" prop="ye">
-          <el-input v-model="form.ye" placeholder="请输入余额" />
-        </el-form-item>
-        <el-form-item label="客户id" prop="khId">
-          <el-input v-model="form.khId" placeholder="请输入客户id" />
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="submitForm">确 定</el-button>
-        <el-button @click="cancel">取 消</el-button>
-      </div>
-    </el-dialog>
 
-    <!-- 出院结算dialog -->
-    <el-dialog
-      v-dialog-drag
-      :title="title"
-      :visible.sync="openView"
-      width="1200px"
-      append-to-body
-    >
-      <el-form
-        size="small"
-        :inline="true"
-        label-width="68px"
-      >
-        <el-form-item label="日期" prop="htqdrq">
-          <el-date-picker clearable
-                          v-model="daterangeHtqdrq"
-                          style="width: 240px"
-                          type="daterange"
-                          value-format="yyyyMMdd"
-                          range-separator="-"
-                          start-placeholder="开始日期"
-                          end-placeholder="结束日期">
-          </el-date-picker>
-        </el-form-item>
-        <el-form-item>
-          <el-button
-            type="primary"
-            icon="el-icon-search"
-            size="mini"
-            @click="handleQueryMin"
-          >搜索</el-button
-          >
-          <el-button icon="el-icon-refresh" size="mini" @click="resetQueryMin"
-          >重置</el-button
-          >
-        </el-form-item>
-      </el-form>
-      <el-table v-loading="loadingMin" :data="yljgCyjsList" row-key="id">
+    <!-- 显示收银列表对话框 -->
+    <el-dialog v-dialog-drag title="在院结算" :visible.sync="sYopen" width="1000px" append-to-body>
+      <el-table v-loading="syLoading" :data="syglList" show-summary>
         <el-table-column label="序号" align="center">
           <template slot-scope="scope">
-            {{
-              (queryParamsMin.pageNum - 1) * queryParamsMin.pageSize +
-              scope.$index +
-              1
-            }}
+            {{ scope.$index + 1 }}
           </template>
         </el-table-column>
-        <el-table-column label="日期" align="center" prop="htqdrq" >
+        <el-table-column label="日期" align="center" prop="date" />
+        <el-table-column label="充值小计(元)" align="center" prop="money" />
+        <el-table-column label="消费小计(元)" align="center" >
           <template slot-scope="scope">
-            <span>{{ special(scope.row.htqdrq) }}</span>
+            {{parseFloat(scope.row.cwf) + parseFloat(scope.row.hlf) + parseFloat(scope.row.cyf)}}
           </template>
         </el-table-column>
-        <el-table-column label="充值小计(元)" align="center" prop="czxj" />
-        <el-table-column label="支出(元)" align="center" prop="zc" />
-        <el-table-column label="收入(元)" align="center" prop="sr" />
-        <el-table-column label="房费押金(元)" align="center" prop="cwfyj" />
-        <el-table-column label="护理费押金(元)" align="center" prop="hlfyj" />
-        <el-table-column label="餐饮押金(元)" align="center" prop="cyfyj" />
-        <el-table-column label="消费小计(元)" align="center" prop="xfxj" />
         <el-table-column label="房费(元)" align="center" prop="cwf" />
         <el-table-column label="护理费(元)" align="center" prop="hlf" />
         <el-table-column label="餐饮费(元)" align="center" prop="cyf" />
-        <el-table-column label="余额(元)" align="center" prop="ye" />
+        <el-table-column label="房费押金(元)" align="center" prop="cwfyj" />
+        <el-table-column label="护理费押金((元)" align="center" prop="hlfyj" />
+        <el-table-column label="餐饮费押金((元)" align="center" prop="cyfyj" />
+        <el-table-column label="余额((元)" align="center" >
+          <template slot-scope="scope">
+            {{parseFloat(scope.row.money) - (parseFloat(scope.row.cwf) + parseFloat(scope.row.hlf) + parseFloat(scope.row.cyf))}}
+          </template>
+        </el-table-column>
       </el-table>
-
-      <pagination
-        v-show="viewTotal > 0"
-        :total="viewTotal"
-        :page.sync="queryParamsMin.pageNum"
-        :limit.sync="queryParamsMin.pageSize"
-        @pagination="getListMin"
-      />
-      <!-- <div slot="footer" class="dialog-footer">
-        <el-button type="primary" @click="cancelView">确 定</el-button>
-      </div> -->
     </el-dialog>
   </div>
 </template>
 
 <script>
-import {
-  listCyjs,
-  getCyjs,
-  delCyjs,
-  addCyjs,
-  updateCyjs,
-  selectCyjsBykhId,
-} from "@/api/rcyy/cyjs";
+import {listSygl, getSygl, delSygl, addSygl, updateSygl, listByQy, listByZy} from "@/api/rcyy/sygl";
+import { Regular,chineseOne, idCard } from '@/utils/regular'
 
 export default {
-  name: "Cyjs",
-  dicts: ["sys_user_sex"],
+  name: "Sygl",
+  dicts: ['CZ010', 'CZ011'],
   data() {
     return {
       // 遮罩层
       loading: true,
-      loadingMin: true,
+      syLoading: true,
       // 选中数组
       ids: [],
-      items: [],
       // 非单个禁用
       single: true,
       // 非多个禁用
       multiple: true,
       // 显示搜索条件
       showSearch: true,
-      // 总条数
-      total: 0,
-      viewTotal: 0,
-      // 出院结算表格数据
-      cyjsList: [],
-      //点击出院结算后表格数据
-      yljgCyjsList: [],
-      // 弹出层标题
-      parent:null,
-      syglViewList: [],
-      // 弹出层标题
-      title: "",
-      // 小类弹出层标题
-      viewTitle: "",
-      // 是否显示弹出层
-      open: false,
-      // 是否显示详细dialog
-      openView: false,
-      // 事件发生日期范围
-      daterangeHtqdrq:[],
-      // 查询参数
+      // 客户信息列表
+      khjbxxList:[],
+      // 客户信息总条数
+      khTotal: 0,
+      // 客户信息查询参数
       queryParams: {
         pageNum: 1,
         pageSize: 10,
-        rzjg: null,
-        jsksrq: null,
-        jsjsrq: null,
-        czxj: null,
-        zc: null,
-        sr: null,
-        xfxj: null,
-        ye: null,
-        khId: null,
       },
-      queryParamsMin: {
-        pageNum: 1,
-        pageSize: 10,
-      },
-      // 表单参数
-      form: {},
-      // 表单校验
-      rules: {
-        rzjg: [
-          { required: true, message: "入住机构不能为空", trigger: "blur" },
-        ],
-        jgId: [
-          { required: true, message: "养老机构id不能为空", trigger: "blur" },
-        ],
-        jsksrq: [
-          { required: true, message: "结算开始日期不能为空", trigger: "blur" },
-        ],
-        jsjsrq: [
-          { required: true, message: "结算结束日期不能为空", trigger: "blur" },
-        ],
-        czxj: [
-          { required: true, message: "充值小记不能为空", trigger: "blur" },
-        ],
-        zc: [{ required: true, message: "支出不能为空", trigger: "blur" }],
-        sr: [{ required: true, message: "收入不能为空", trigger: "blur" }],
-        xfxj: [
-          { required: true, message: "消费小计不能为空", trigger: "blur" },
-        ],
-        ye: [{ required: true, message: "余额不能为空", trigger: "blur" }],
-        state: [
-          { required: true, message: "数据状态不能为空", trigger: "blur" },
-        ],
+      clickKhName:'',
+      // 总条数
+      total: 0,
+      // 养老机构_在院结算表格数据
+      syglList: [],
+      // 查询参数
+      syQueryParams: {
+
       },
+      // 弹出层标题
+      title: "",
+      // 是否显示弹出层
+      sYopen: false,
     };
   },
   created() {
     this.getList();
   },
   methods: {
-    /** 查询出院结算列表 */
     getList() {
       this.loading = true;
-
-      listCyjs(this.queryParams).then((response) => {
-        this.cyjsList = response.rows;
-        this.total = response.total;
+      listByQy(this.queryParams).then(response => {
+        this.khjbxxList = response.rows;
+        this.khTotal = response.total;
         this.loading = false;
       });
     },
-    // { ...this.formMin, fid: this.parent }
-    getListMin() {
-      this.loadingMin = true;
-      this.queryParamsMin.params = {};
-      if (null != this.daterangeHtqdrq && '' != this.daterangeHtqdrq) {
-        this.queryParamsMin.params["beginTbrq"] = this.daterangeHtqdrq[0];
-        this.queryParamsMin.params["endTbrq"] = this.daterangeHtqdrq[1];
+    getSyList(row) {
+      this.sYopen =true;
+      this.syLoading = true;
+      if (row){
+        this.syQueryParams.khId = row.id
       }
-      this.queryParamsMin.khId = this.parent;
-      selectCyjsBykhId(this.queryParamsMin).then((response) => {
-        this.yljgCyjsList = response.rows;
-        this.viewTotal = response.total;
-        this.loadingMin = false;
+      listByZy(this.syQueryParams).then(response => {
+        this.syglList = response.syList.map((item,index)=>{
+          const sjrzsj = parseInt(response.htxx.sjrzsj.substring(0,6));
+          const date = parseInt(item.date);
+          if (sjrzsj <= date){
+            if ( sjrzsj == date){
+              item.cwfyj = response.htxx.cwfyj;
+              item.hlfyj = response.htxx.hlfyj;
+              item.cyfyj = response.htxx.cyfyj;
+              //计算当月得房费
+              const year = parseInt(response.htxx.sjrzsj.substring(0,4))
+              const month = parseInt(response.htxx.sjrzsj.substring(4,2))
+              const day = parseInt(response.htxx.sjrzsj.substring(6,2))
+              const totalDay = new Date(year, month, 0).getDate();
+              const p = day /totalDay;
+              item.cwf = response.htxx.cwf * p;
+              item.hlf = response.htxx.hlf * p;
+              item.cyf = response.htxx.cyf * p;
+            }else{
+              item.cwf = response.htxx.cwf;
+              item.hlf = response.htxx.hlf;
+              item.cyf = response.htxx.cyf;
+            }
+          }else{
+            item.cwfyj = 0;
+            item.hlfyj = 0;
+            item.cyfyj = 0;
+            item.cwf = 0;
+            item.hlf = 0;
+            item.cyf = 0;
+          }
+          return item;
+        });
+        this.total = response.total;
+        this.syLoading = false;
       });
     },
-    // 取消按钮
-    cancel() {
-      this.open = false;
-      this.reset();
-    },
     // 表单重置
     reset() {
-      this.form = {
-        id: null,
-        rzjg: null,
-        jgId: null,
-        jsksrq: null,
-        jsjsrq: null,
-        czxj: null,
-        zc: null,
-        sr: null,
-        xfxj: null,
-        ye: null,
-        khId: null,
-        createTimeStr: null,
-        createUserId: null,
-        createBy: null,
-        createUnit: null,
-        createUnitName: null,
-        updateTimeStr: null,
-        updateUserId: null,
-        updateBy: null,
-        updateUnit: null,
-        updateUnitName: null,
-        state: null,
-      };
-      this.resetForm("form");
+      this.submitFormLoading =false;
     },
     /** 搜索按钮操作 */
     handleQuery() {
       this.queryParams.pageNum = 1;
       this.getList();
     },
-    /** 弹出搜索按钮操作 */
-    handleQueryMin() {
-      this.queryParamsMin.pageNum = 1;
-      this.getListMin();
-    },
     /** 重置按钮操作 */
     resetQuery() {
       this.resetForm("queryForm");
       this.handleQuery();
     },
-    /** 弹出重置按钮操作 */
-    resetQueryMin() {
-      this.daterangeHtqdrq = null;
-      this.handleQueryMin();
-    },
-    // 多选框选中数据
-    handleSelectionChange(selection) {
-      this.ids = selection.map((item) => item.id);
-      this.items = selection.map((item) => {
-        return {
-          ...item,
-          index: this.cyjsList.map((item) => item.id).indexOf(item.id),
-        };
-      });
-      this.single = selection.length !== 1;
-      this.multiple = !selection.length;
-    },
-    /** 新增按钮操作 */
-    handleAdd() {
-      this.reset();
-      this.open = true;
-      this.title = "添加在院结算";
-    },
-    /** 修改按钮操作 */
-    handleUpdate(row) {
-      this.reset();
-      const id = row.id || this.ids;
-      getCyjs(id).then((response) => {
-        this.form = response.data;
-        this.yljgCyjsList = response.data.yljgCyjsList;
-        this.open = true;
-        this.title = "修改在院结算";
-      });
-    },
-    /** 在院结算按钮操作 */
-    handleView(row) {
-      if (row) {
-        console.log(row,'555');
-        this.parent = row.khId;
-        this.openView = true;
-        this.title = "在院结算";
-      }
-      this.getListMin();
-    },
-    cancelView() {
-      this.openView = false;
-    },
-    cancelViewAdd() {
-      this.openViewAdd = false;
-      this.resetMin();
-    },
-    submitViewForm() {
-      this.$refs["formMin"].validate((valid) => {
-        if (valid) {
-          if (this.formMin.id != null) {
-            updateGmfl({ ...this.formMin, fid: this.parent }).then(
-              (response) => {
-                this.$modal.msgSuccess("修改成功");
-                this.openViewAdd = false;
-                this.getListMin();
-              }
-            );
-          } else {
-            addGmfl({ ...this.formMin, fid: this.parent }).then((response) => {
-              this.$modal.msgSuccess("新增成功");
-              this.openViewAdd = false;
-              this.getListMin();
-            });
-          }
-        }
-      });
-    },
-    /** 提交按钮 */
-    submitForm() {
-      this.$refs["form"].validate((valid) => {
-        if (valid) {
-          if (this.form.id != null) {
-            updateCyjs(this.form).then((response) => {
-              this.$modal.msgSuccess("修改成功");
-              this.open = false;
-              this.getList();
-            });
-          } else {
-            addCyjs(this.form).then((response) => {
-              this.$modal.msgSuccess("新增成功");
-              this.open = false;
-              this.getList();
-            });
-          }
-        }
-      });
-    },
-    /** 删除按钮操作 */
-    handleDelete(row, index) {
-      const ids = row.id || this.ids;
-      let msg = "";
-      if (!row.id) {
-        msg = index;
-      } else {
-        msg = this.items
-          .map((item) => item.index + 1)
-          .sort((a, b) => a - b)
-          .join(",");
-      }
-      this.$modal
-        .confirm('是否确认删除出院结算序号为"' + msg + '"的数据项?')
-        .then(function () {
-          return delCyjs(ids);
-        })
-        .then(() => {
-          this.getList();
-          this.$modal.msgSuccess("删除成功");
-        })
-        .catch(() => {});
-    },
+
     /** 导出按钮操作 */
     handleExport() {
-      this.download(
-        "organization/cyjs/export",
-        {
-          ...this.queryParams,
-        },
-        `cyjs_${new Date().getTime()}.xlsx`
-      );
-    },
-  },
+      this.download('organization/sygl/export', {
+        ...this.queryParams
+      }, `sygl_${new Date().getTime()}.xlsx`)
+    }
+  }
 };
 </script>
+
+<style rel="stylesheet/scss" lang="scss" scoped>
+.el-select {
+  width: 100%;
+}
+
+.el-date-editor.el-input {
+  width: 100%;
+}
+
+.el-date-picker {
+  width: 100%;
+}
+</style>

+ 42 - 51
ruoyi-ui/src/views/rcyy/sygl/index.vue

@@ -43,75 +43,45 @@
           <dict-tag :options="dict.type.C0007" :value="scope.row.xb"/>
         </template>
       </el-table-column>
-      <el-table-column label="年龄" align="center" prop="age"/>
+      <el-table-column label="手机号码" align="center" prop="sjhm"/>
       <el-table-column label="证件号码" align="center" prop="zjhm"/>
 
-      <el-table-column label="身体能力等级" align="center" prop="nlpg">
-        <template slot-scope="scope">
-          <dict-tag :options="dict.type.CZ036" :value="scope.row.nlpg"/>
-        </template>
-      </el-table-column>
-      <el-table-column label="是否残疾" align="center" prop="isCj">
-        <template slot-scope="scope">
-          <dict-tag :options="dict.type.CZ035" :value="scope.row.isCj"/>
-        </template>
-      </el-table-column>
-      <el-table-column label="签约状态" align="center" prop="isQy">
-        <template slot-scope="scope">
-          <dict-tag :options="dict.type.CH065" :value="scope.row.isQy"/>
-        </template>
-      </el-table-column>
-      <el-table-column label="入住状态" align="center" prop="isRz">
-        <template slot-scope="scope">
-          <dict-tag :options="dict.type.CH063" :value="scope.row.isRz"/>
-        </template>
-      </el-table-column>
       <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
         <template slot-scope="scope">
           <el-button
             size="mini"
             type="text"
             icon="el-icon-edit"
-            @click="particulars(scope.row)"
-            v-hasPermi="['organization:khjbxx:query']"
-          >详情
+            @click="handleAdd(scope.row)"
+            v-hasPermi="['organization:khjbxx:add']"
+          >收银
           </el-button>
           <el-button
             size="mini"
             type="text"
             icon="el-icon-edit"
-            @click="handleUpdate(scope.row)"
-            v-hasPermi="['organization:khjbxx:edit']"
-          >修改
-          </el-button>
-          <el-button
-            size="mini"
-            type="text"
-            icon="el-icon-delete"
-            @click="handleDelete(scope.row,(queryParams.pageNum-1)*queryParams.pageSize + scope.$index + 1)"
-            v-hasPermi="['organization:khjbxx:remove']"
-          >删除
+            @click="getSyList(scope.row)"
+            v-hasPermi="['organization:khjbxx:list']"
+          >收银记录
           </el-button>
         </template>
       </el-table-column>
     </el-table>
 
     <pagination
-      v-show="total>0"
-      :total="total"
+      v-show="khTotal>0"
+      :total="khTotal"
       :page.sync="queryParams.pageNum"
       :limit.sync="queryParams.pageSize"
       @pagination="getList"
     />
 
-
-
     <!-- 添加或修改养老机构_收银管理对话框 -->
     <el-dialog v-dialog-drag :title="title" :visible.sync="open" width="500px" append-to-body>
       <el-form ref="form" :model="form" :rules="rules" label-width="80px">
 
-        <el-form-item label="客户id" prop="khId">
-          <el-input v-model="form.khId" placeholder="请输入客户id" />
+        <el-form-item label="客户姓名" prop="xm">
+          <el-input v-model="form.xm" disabled />
         </el-form-item>
 
         <el-form-item label="金额" prop="je">
@@ -160,15 +130,15 @@
     </el-dialog>
 
     <!-- 显示收银列表对话框 -->
-    <el-dialog v-dialog-drag :title="收银记录" :visible.sync="open" width="500px" append-to-body>
+    <el-dialog v-dialog-drag title="收银记录" :visible.sync="sYopen" width="800px" append-to-body>
       <el-table v-loading="syLoading" :data="syglList" >
         <el-table-column label="序号" align="center">
           <template slot-scope="scope">
             {{(queryParams.pageNum-1)*queryParams.pageSize + scope.$index + 1}}
           </template>
         </el-table-column>
-        <el-table-column label="客户id" align="center" prop="khId" />
-        <el-table-column label="金额" align="center" prop="je" />
+        <el-table-column label="姓名" align="center" prop="xm" />
+        <el-table-column label="金额(元)" align="center" prop="je" />
         <el-table-column label="收款方式" align="center" prop="skfs">
           <template slot-scope="scope">
             <dict-tag :options="dict.type.CZ011" :value="scope.row.skfs"/>
@@ -208,9 +178,9 @@
       <pagination
         v-show="total>0"
         :total="total"
-        :page.sync="queryParams.pageNum"
-        :limit.sync="queryParams.pageSize"
-        @pagination="getList"
+        :page.sync="syQueryParams.pageNum"
+        :limit.sync="syQueryParams.pageSize"
+        @pagination="getSyList"
       />
     </el-dialog>
   </div>
@@ -246,6 +216,7 @@ export default {
         pageNum: 1,
         pageSize: 10,
       },
+      clickKhName:'',
       // 总条数
       total: 0,
       // 养老机构_收银管理表格数据
@@ -259,6 +230,7 @@ export default {
       title: "",
       // 是否显示弹出层
       open: false,
+      sYopen: false,
       // 表单参数
       form: {},
       // 表单校验
@@ -294,6 +266,22 @@ export default {
         this.loading = false;
       });
     },
+    getSyList(row) {
+      this.sYopen =true;
+      this.syLoading = true;
+      if (row){
+        this.clickKhName = row.xm;
+        this.syQueryParams.khId = row.id
+      }
+      listSygl(this.syQueryParams).then(response => {
+        this.syglList = response.rows.map(item=>{
+          item.xm = this.clickKhName
+          return item;
+        });
+        this.total = response.total;
+        this.syLoading = false;
+      });
+    },
     // 取消按钮
     cancel() {
       this.open = false;
@@ -330,10 +318,12 @@ export default {
       this.multiple = !selection.length
     },
     /** 新增按钮操作 */
-    handleAdd() {
+    handleAdd(row) {
       this.reset();
       this.open = true;
       this.title = "添加收银管理";
+      this.form.xm = row.xm;
+      this.form.khId = row.id;
     },
     /** 修改按钮操作 */
     handleUpdate(row) {
@@ -341,6 +331,7 @@ export default {
       const id = row.id || this.ids
       getSygl(id).then(response => {
         this.form = response.data;
+        this.form.xm = row.xm;
         this.open = true;
         this.title = "修改收银管理";
       });
@@ -354,13 +345,13 @@ export default {
             updateSygl(this.form).then(response => {
               this.$modal.msgSuccess("修改成功");
               this.open = false;
-              this.getList();
+              this.getSyList();
             }).finally(()=>this.submitFormLoading =false);
           } else {
             addSygl(this.form).then(response => {
               this.$modal.msgSuccess("新增成功");
               this.open = false;
-              this.getList();
+              this.getSyList();
             }).finally(()=>this.submitFormLoading =false);
           }
         }
@@ -372,7 +363,7 @@ export default {
       this.$modal.confirm('确认删除' + this.changeDelData(row,'id','ID值',index) + '的记录?').then(function() {
         return delSygl(ids);
       }).then(() => {
-        this.getList();
+        this.getSyList();
         this.$modal.msgSuccess("删除成功");
       }).catch(() => {});
     },