|
@@ -1,6 +1,8 @@
|
|
|
import {ref} from "vue";
|
|
|
import {maZuiFangShi} from "../../api/public-api";
|
|
|
import store from '@/store';
|
|
|
+import {listIsBlank, listNotBlank, stringIsBlank, stringNotBlank} from "../../utils/blank-utils";
|
|
|
+import {getFundPayType, getMedChrgitmType} from "../../api/medical-insurance/si-setl-upload";
|
|
|
|
|
|
const getRoles = store.state.user.info.roles
|
|
|
|
|
@@ -130,3 +132,356 @@ export function xianZhongChuQu(arr, notNode) {
|
|
|
})
|
|
|
return data
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+/* 打印结算单的一些工具类 */
|
|
|
+export function brdyName(val) {
|
|
|
+ if (stringIsBlank(val)) {
|
|
|
+ return ""
|
|
|
+ }
|
|
|
+ let name = val.split("-")
|
|
|
+ return `${name[0]}年${name[1]}月${name[2]}日`
|
|
|
+}
|
|
|
+
|
|
|
+/* 入院时间拆分 */
|
|
|
+export function getDateName(val) {
|
|
|
+ if (stringIsBlank(val)) {
|
|
|
+ return ""
|
|
|
+ }
|
|
|
+ let date = val.split(" ")[0].split("-")
|
|
|
+ let times = val.split(" ")[1].split(":")
|
|
|
+ return `${date[0]}年${date[1]}月${date[2]}日 ${times[0]}时`
|
|
|
+}
|
|
|
+
|
|
|
+// 手术时间拆分
|
|
|
+export function getShouShuShiJian(val) {
|
|
|
+ if (stringIsBlank(val)) {
|
|
|
+ return ""
|
|
|
+ }
|
|
|
+ let date = val.split(" ")[0].split("-")
|
|
|
+ let times = val.split(" ")[1].split(":")
|
|
|
+ return `${date[0]}年${date[1]}月${date[2]}日 ${times[0]}时${times[1]}分${times[2]}秒`
|
|
|
+}
|
|
|
+
|
|
|
+// 颅内时间拆分
|
|
|
+export function luNeiShiJian(val) {
|
|
|
+ if (stringIsBlank(val)) {
|
|
|
+ return ""
|
|
|
+ }
|
|
|
+ let data = val.split("/")
|
|
|
+ return ` ${data[0]}天 ${data[1]}小时 ${data[2]}分钟`
|
|
|
+}
|
|
|
+
|
|
|
+//结算时间计算
|
|
|
+export function nianYueRi(val) {
|
|
|
+ if (stringIsBlank(val)) {
|
|
|
+ return ' 年 月 日'
|
|
|
+ }
|
|
|
+ let date = val.split("-")
|
|
|
+ return `${date[0]}年${date[1]}月${date[2]}日`
|
|
|
+}
|
|
|
+
|
|
|
+export function getAge(val) {
|
|
|
+ if (stringIsBlank(val)) {
|
|
|
+ return ""
|
|
|
+ }
|
|
|
+ return val.split('.')[0];
|
|
|
+}
|
|
|
+
|
|
|
+export function getAdmissCond(val) {
|
|
|
+ switch (val) {
|
|
|
+ case 1:
|
|
|
+ return "有"
|
|
|
+ case 2:
|
|
|
+ return "临床未确定"
|
|
|
+ case 3:
|
|
|
+ return "情况不明"
|
|
|
+ case 4:
|
|
|
+ return "无"
|
|
|
+ default:
|
|
|
+ return ""
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+export function getXiYiZhenDuan(val) {
|
|
|
+ if (listIsBlank(val)) {
|
|
|
+ return []
|
|
|
+ }
|
|
|
+ let diag = []
|
|
|
+ val.forEach(item => {
|
|
|
+ if (item.siDiagType === '1' || item.siDiagType === '2') {
|
|
|
+ diag.push(item)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (listIsBlank(diag)) {
|
|
|
+ return []
|
|
|
+ }
|
|
|
+ let zhuYao = []
|
|
|
+ let ciYao = []
|
|
|
+ diag.forEach(item => {
|
|
|
+ if (item.siDiagType === '1' && zhuYao.length === 0) {
|
|
|
+ zhuYao.push(item)
|
|
|
+ } else {
|
|
|
+ ciYao.push(item)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return zhuYao.concat(ciYao)
|
|
|
+}
|
|
|
+
|
|
|
+export function getZhongYiZhenDuan(val) {
|
|
|
+ if (listIsBlank(val)) {
|
|
|
+ return []
|
|
|
+ }
|
|
|
+ let diag = []
|
|
|
+ val.forEach(item => {
|
|
|
+ if (item.siDiagType === '3' || item.siDiagType === '4') {
|
|
|
+ diag.push(item)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (listIsBlank(diag)) {
|
|
|
+ return []
|
|
|
+ }
|
|
|
+ let zhuYao = []
|
|
|
+ let ciYao = []
|
|
|
+ diag.forEach(item => {
|
|
|
+ if (item.siDiagType === '3' && zhuYao.length === 0) {
|
|
|
+ zhuYao.push(item)
|
|
|
+ } else {
|
|
|
+ ciYao.push(item)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return zhuYao.concat(ciYao)
|
|
|
+}
|
|
|
+
|
|
|
+export function zhenDuanData(val) {
|
|
|
+ let xiYiData = []
|
|
|
+ let zhongYiData = []
|
|
|
+ let obj = {disDiagComment: '我大姐可视对讲阿数据回到吉安市按实际和大家开始良好的卡时间段', disDiag: '', admissCond: ''}
|
|
|
+ // 只有当诊断全部为空的 时候才创建 9 个 空的数据
|
|
|
+ if (listIsBlank(val)) {
|
|
|
+ for (let i = 0; i < 9; i++) {
|
|
|
+ xiYiData.push(obj)
|
|
|
+ zhongYiData.push(obj)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ xiYiData = getXiYiZhenDuan(val)
|
|
|
+ zhongYiData = getZhongYiZhenDuan(val)
|
|
|
+ let maxLength = xiYiData.length > zhongYiData.length ? xiYiData.length : zhongYiData.length
|
|
|
+ let newXiYiData = []
|
|
|
+ let newZhongYiData = []
|
|
|
+ if (maxLength < 2) {
|
|
|
+ maxLength = 9
|
|
|
+ }
|
|
|
+ for (let i = 0; i < maxLength; i++) {
|
|
|
+ if (i >= xiYiData.length) {
|
|
|
+ newXiYiData.push(obj)
|
|
|
+ } else {
|
|
|
+ newXiYiData.push(xiYiData[i])
|
|
|
+ }
|
|
|
+ if (i >= zhongYiData.length) {
|
|
|
+ newZhongYiData.push(obj)
|
|
|
+ } else {
|
|
|
+ newZhongYiData.push(zhongYiData[i])
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return zhenDuanHeBing(newXiYiData, newZhongYiData)
|
|
|
+}
|
|
|
+
|
|
|
+export function zhenDuanHeBing(xiYiZhenDuan, ZhongYiZhenDuan) {
|
|
|
+ // 因为我在上面 保证了 两个诊断的长度完全一致 所以怎么循环都可以
|
|
|
+ let data = []
|
|
|
+ for (let i = 0; i < xiYiZhenDuan.length; i++) {
|
|
|
+ data.push({
|
|
|
+ xiYiDisDiag: xiYiZhenDuan[i].disDiag,
|
|
|
+ xiYiDisDiagComment: xiYiZhenDuan[i].disDiag,
|
|
|
+ xiYiAdmissCond: xiYiZhenDuan[i].disDiag,
|
|
|
+ ZhongYiDisDiag: ZhongYiZhenDuan[i].disDiag,
|
|
|
+ ZhongYiDiagComment: ZhongYiZhenDuan[i].disDiag,
|
|
|
+ ZhongYiAdmissCond: ZhongYiZhenDuan[i].disDiag,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return data
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+export function getShouShuData(val) {
|
|
|
+ if (listIsBlank(val)) {
|
|
|
+ let kong = []
|
|
|
+ for (let i = 0; i < 2; i++) {
|
|
|
+ kong.push({
|
|
|
+ ssmc: '',
|
|
|
+ ssbm: '',
|
|
|
+ mzff: '',
|
|
|
+ ssysName: '',
|
|
|
+ ssys: '',
|
|
|
+ mzysName: '',
|
|
|
+ mzys: '',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return kong
|
|
|
+ }
|
|
|
+ let zhuYaoShouShu = []
|
|
|
+ let ciYaoShouShu = []
|
|
|
+ val.forEach(item => {
|
|
|
+ if (item.ssjb === 4 && zhuYaoShouShu.length === 0) {
|
|
|
+ zhuYaoShouShu.push(item)
|
|
|
+ } else {
|
|
|
+ ciYaoShouShu.push(item)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ return zhuYaoShouShu.concat(ciYaoShouShu)
|
|
|
+}
|
|
|
+
|
|
|
+// 重症监护类型
|
|
|
+export function zhongZhenJianHu(val) {
|
|
|
+ let data = []
|
|
|
+ if (listIsBlank(val)) {
|
|
|
+ data.push({
|
|
|
+ scsCutdWardType: '',
|
|
|
+ scsCutdInpoolTime: '',
|
|
|
+ scsCutdExitTime: '',
|
|
|
+ scsCutdSumDura: '',
|
|
|
+ })
|
|
|
+ return data
|
|
|
+ }
|
|
|
+ val.forEach(item => {
|
|
|
+ item.scsCutdInpoolTime = nianYueRiShiFen(item.scsCutdInpoolTime)
|
|
|
+ item.scsCutdExitTime = nianYueRiShiFen(item.scsCutdExitTime)
|
|
|
+ item.scsCutdSumDura = zhongZhenShiFenMiao(item.scsCutdSumDura)
|
|
|
+ })
|
|
|
+ return val
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+export function nianYueRiShiFen(val) {
|
|
|
+ if (stringIsBlank(val)) {
|
|
|
+ return ""
|
|
|
+ }
|
|
|
+ let date = val.split(" ")[0].split("-")
|
|
|
+ let times = val.split(" ")[1].split(":")
|
|
|
+ return `${date[0]}年${date[1]}月${date[2]}日${times[0]}时${times[1]}分`
|
|
|
+}
|
|
|
+
|
|
|
+export function zhongZhenShiFenMiao(val) {
|
|
|
+ if (stringIsBlank(val)) {
|
|
|
+ return ""
|
|
|
+ }
|
|
|
+ let times = val.split("/")
|
|
|
+ return `${times[0]}时${times[1]}分${times[2]}秒`
|
|
|
+}
|
|
|
+
|
|
|
+// 获取费用类型
|
|
|
+export let medChrgitmType = []
|
|
|
+export let medChrgitmTypeMap = {}
|
|
|
+
|
|
|
+getMedChrgitmType().then((res) => {
|
|
|
+ medChrgitmType = res
|
|
|
+ medChrgitmType.forEach(item => {
|
|
|
+ medChrgitmTypeMap[item.code] = {name: item.name}
|
|
|
+ })
|
|
|
+})
|
|
|
+
|
|
|
+export function getMedChrgitmTypeData(val) {
|
|
|
+ let data = []
|
|
|
+ if (listIsBlank(val)) {
|
|
|
+ medChrgitmType.forEach(item => {
|
|
|
+ data.push({
|
|
|
+ medChrgitm: item.name,
|
|
|
+ amt: '',
|
|
|
+ claaSumfee: '',
|
|
|
+ clabAmt: '',
|
|
|
+ fulamtOwnpayAmt: '',
|
|
|
+ othAmt: '',
|
|
|
+ })
|
|
|
+ })
|
|
|
+ data.push({
|
|
|
+ medChrgitm: "合计",
|
|
|
+ amt: 0,
|
|
|
+ claaSumfee: 0,
|
|
|
+ clabAmt: 0,
|
|
|
+ fulamtOwnpayAmt: 0,
|
|
|
+ othAmt: 0,
|
|
|
+ })
|
|
|
+ return data
|
|
|
+ }
|
|
|
+ for (let i = 0; i < medChrgitmType.length; i++) {
|
|
|
+ if (i >= val.length) {
|
|
|
+ data.push({
|
|
|
+ medChrgitm: medChrgitmType[i].name,
|
|
|
+ amt: '',
|
|
|
+ claaSumfee: '',
|
|
|
+ clabAmt: '',
|
|
|
+ fulamtOwnpayAmt: '',
|
|
|
+ othAmt: '',
|
|
|
+ })
|
|
|
+ } else if (stringNotBlank(val[i].medChrgitm)) {
|
|
|
+ data.push({
|
|
|
+ medChrgitm: medChrgitmType[i].name,
|
|
|
+ amt: val[i].amt,
|
|
|
+ claaSumfee: val[i].claaSumfee,
|
|
|
+ clabAmt: val[i].clabAmt,
|
|
|
+ fulamtOwnpayAmt: val[i].fulamtOwnpayAmt,
|
|
|
+ othAmt: val[i].othAmt,
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ data.push({
|
|
|
+ medChrgitm: "合计",
|
|
|
+ amt: val[val.length - 1].amt,
|
|
|
+ claaSumfee: val[val.length - 1].claaSumfee,
|
|
|
+ clabAmt: val[val.length - 1].clabAmt,
|
|
|
+ fulamtOwnpayAmt: val[val.length - 1].fulamtOwnpayAmt,
|
|
|
+ othAmt: val[val.length - 1].othAmt,
|
|
|
+ })
|
|
|
+
|
|
|
+ return data
|
|
|
+}
|
|
|
+
|
|
|
+// 医保统筹支付
|
|
|
+export let fndPayTypeData = []
|
|
|
+export let fndPayTypeMap = {}
|
|
|
+
|
|
|
+getFundPayType().then(res => {
|
|
|
+ fndPayTypeData = res
|
|
|
+ fndPayTypeData.forEach(item => {
|
|
|
+ fndPayTypeMap[item.code] = {code: item.code, name: item.name}
|
|
|
+ })
|
|
|
+})
|
|
|
+
|
|
|
+export function fenLeiZhiFuLeiXing(val) {
|
|
|
+ let obj = {}
|
|
|
+ let qiTa = []
|
|
|
+ let shuShiHua = ['310100', '330100', '390200', '320100', '610100', "370100"]
|
|
|
+ for (let i = 0; i < shuShiHua.length; i++) {
|
|
|
+ obj[shuShiHua[i]] = {
|
|
|
+ fundPayType: shuShiHua[i],
|
|
|
+ fundPayamt: "",
|
|
|
+ }
|
|
|
+ }
|
|
|
+ val.forEach(item => {
|
|
|
+ let name = fndPayTypeMap.hasOwnProperty(item.fundPayType)
|
|
|
+ if (shuShiHua.indexOf(item.fundPayType) > -1) {
|
|
|
+ obj[item.fundPayType] = {
|
|
|
+ fundPayType: item.fundPayType,
|
|
|
+ fundPayamt: item.fundPayamt,
|
|
|
+ name: name ? fndPayTypeMap[item.fundPayType].name : ""
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ qiTa.push({
|
|
|
+ fundPayType: item.fundPayType,
|
|
|
+ fundPayamt: item.fundPayamt,
|
|
|
+ name: name ? fndPayTypeMap[item.fundPayType].name : ""
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (listIsBlank(qiTa)) {
|
|
|
+ qiTa.push({
|
|
|
+ fundPayType: "",
|
|
|
+ fundPayamt: "",
|
|
|
+ name: ""
|
|
|
+ })
|
|
|
+ }
|
|
|
+ return {obj, qiTa}
|
|
|
+}
|
|
|
+
|