lighter 2 years ago
parent
commit
6bed3dbe19

+ 1 - 1
src/views/medical-insurance/outpatient/MzRegister.vue

@@ -855,7 +855,7 @@ const highlightYbCode = (hisCode, ybCode) => {
 }
 
 const handleAdmdvsChange = (val) => {
-  admdvs.value = val[1]
+  admdvs.value = val ? val[1] : null;
 }
 
 onMounted(() => {

+ 19 - 1
src/views/medical-insurance/outpatient/MzSpltryRcrd.vue

@@ -2,9 +2,12 @@
   <page-layer>
     <template #header>
       <el-input v-model="patNo" style="width: 120px; margin-left: 2px" clearable placeholder="门诊id"></el-input>
-      <el-select v-model="medType" style="width: 120px" placeholder="医疗类别">
+      <el-select v-model="medType" style="width: 120px" placeholder="医疗类别" @change="handleMedTypeChange">
         <el-option v-for="item in medTypes" :key="item.code" :value="item.code" :label="item.name"></el-option>
       </el-select>
+      <el-cascader v-model="admdvsCascader" clearable filterable placeholder="参保地区"
+                   :options="allAdmdvses" @change="handleAdmdvsChange"
+                   style="width: 160px" :disabled="injuryMode === true"></el-cascader>
       <el-date-picker
           style="width: 200px"
           v-model="dateRange"
@@ -211,6 +214,7 @@ import ReadCard from '@/components/medical-insurance/readcard/Index.vue'
 import OutpatientDiagnoseSupply from '@/components/medical-insurance/outpatient-diagnose-supply/Index.vue'
 import mzSettled from '@/assets/mz-settled.png'
 import PageLayer from "@/layout/PageLayer";
+import {allAdmdvses} from "@/data/admdvs";
 
 const windowSize = store.state.app.windowSize
 const receiptBoxStyle = {
@@ -236,6 +240,19 @@ const colorStatus = (row) => {
 const isMztczf = (row) => {
   return row.zgmztczf === 1 ? `<span style="color: green">医保</span>` : `<span>自费</span>`
 }
+
+const admdvs = ref(null)
+const admdvsCascader = ref([])
+const handleMedTypeChange = (val) => {
+  if (val === '41') {
+    admdvsCascader.value = []
+    admdvs.value = null
+  }
+}
+const handleAdmdvsChange = (val) => {
+  admdvs.value = val ? val[1] : null;
+}
+
 const nullPatNo = () => {
   if (patNo.value) {
     return false
@@ -328,6 +345,7 @@ const register = (command) => {
     patNo: patNo.value,
     medType: medType.value,
     times: currentRow.value.times,
+    admdvs: admdvs.value,
     legderSn: 0,
     needSaving: 1,
   }

+ 101 - 121
src/views/utilities/ParseJson.vue

@@ -32,143 +32,123 @@
   </el-container>
 </template>
 
-<script>
+<script setup>
 import {computed, ref} from 'vue'
 import {useStore} from 'vuex'
 
-export default {
-  setup() {
-    const store = useStore()
-    const windowSize = store.state.app.windowSize
+const store = useStore()
+const windowSize = store.state.app.windowSize
 
-    const clearWhenChangeType = ref(false)
-    const type = ref('JSON')
+const clearWhenChangeType = ref(false)
+const type = ref('JSON')
 
-    const placeholder = computed(() => {
-      return `把要格式化的${type.value}字符串放在这里...`
-    })
+const placeholder = computed(() => {
+  return `把要格式化的${type.value}字符串放在这里...`
+})
 
-    const preStyle = {
-      width: '92%',
-      height: windowSize.h - 50 + 'px',
-      overflowY: 'auto',
-    }
+const preStyle = {
+  width: '92%',
+  height: windowSize.h - 50 + 'px',
+  overflowY: 'auto',
+}
 
-    const onTypeChange = () => {
-      if (clearWhenChangeType.value) {
-        originContent.value = null
-        formattedResult.value = null
-      } else {
-        executeFormat()
-      }
-    }
+const onTypeChange = () => {
+  if (clearWhenChangeType.value) {
+    originContent.value = null
+    formattedResult.value = null
+  } else {
+    executeFormat()
+  }
+}
 
-    const originContent = ref(null)
-    const formattedResult = ref(null)
-    const trueJson = ref(true)
-    const resultBackGround = computed(() => {
-      return {
-        background: trueJson.value ? '#90da6b7a' : '#f3818186',
-      }
-    })
+const originContent = ref(null)
+const formattedResult = ref(null)
+const trueJson = ref(true)
+const resultBackGround = computed(() => {
+  return {
+    background: trueJson.value ? '#90da6b7a' : '#f3818186',
+  }
+})
 
-    const formatXml = () => {
-      let text = originContent.value
-      text =
-          '\n' +
-          text
-              .replace(/(<\w+)(\s.*?>)/g, function ($0, name, props) {
-                return name + ' ' + props.replace(/\s+(\w+=)/g, ' $1')
-              })
-              .replace(/>\s*?</g, '>\n<')
-      //   text = text
-      //     .replace(/\n/g, '\r')
-      //     .replace(/<!--(.+?)-->/g, '<!--' + escape(text) + '-->')
-      //     .replace(/\r/g, '\n')
-      var rgx = /\n(<(([^\?]).+?)(?:\s|\s*?>|\s*?(\/)>)(?:.*?(?:(?:(\/)>)|(?:<(\/)\2>)))?)/gm
-      var nodeStack = []
-      var output = text.replace(rgx, function ($0, all, name, isBegin, isCloseFull1, isCloseFull2, isFull1, isFull2) {
-        var isClosed = isCloseFull1 == '/' || isCloseFull2 == '/' || isFull1 == '/' || isFull2 == '/'
-        var prefix = ''
-        if (isBegin == '!') {
-          //!开头
-          prefix = setPrefix(nodeStack.length)
-        } else {
-          if (isBegin != '/') {
-            ///开头
-            prefix = setPrefix(nodeStack.length)
-            if (!isClosed) {
-              //非关闭标签
-              nodeStack.push(name)
-            }
-          } else {
-            nodeStack.pop() //弹栈
-            prefix = setPrefix(nodeStack.length)
-          }
+const formatXml = () => {
+  let text = originContent.value
+  text =
+      '\n' +
+      text
+          .replace(/(<\w+)(\s.*?>)/g, function ($0, name, props) {
+            return name + ' ' + props.replace(/\s+(\w+=)/g, ' $1')
+          })
+          .replace(/>\s*?</g, '>\n<')
+  var rgx = /\n(<(([^\?]).+?)(?:\s|\s*?>|\s*?(\/)>)(?:.*?(?:(?:(\/)>)|(?:<(\/)\2>)))?)/gm
+  var nodeStack = []
+  var output = text.replace(rgx, function ($0, all, name, isBegin, isCloseFull1, isCloseFull2, isFull1, isFull2) {
+    var isClosed = isCloseFull1 == '/' || isCloseFull2 == '/' || isFull1 == '/' || isFull2 == '/'
+    var prefix = ''
+    if (isBegin == '!') {
+      //!开头
+      prefix = setPrefix(nodeStack.length)
+    } else {
+      if (isBegin != '/') {
+        ///开头
+        prefix = setPrefix(nodeStack.length)
+        if (!isClosed) {
+          //非关闭标签
+          nodeStack.push(name)
         }
-        var ret = '\n' + prefix + all
-        return ret
-      })
-      var outputText = output.substring(1)
-      //还原注释内容
-      outputText = outputText.replace(/\n/g, '\r').replace(/(\s*)<!--(.+?)-->/g, function ($0, prefix, text) {
-        if (prefix.charAt(0) == '\r') prefix = prefix.substring(1)
-        text = unescape(text).replace(/\r/g, '\n')
-        var ret = '\n' + prefix + '<!--' + text.replace(/^\s*/gm, prefix) + '-->'
-        return ret
-      })
-      outputText = outputText.replace(/\s+$/g, '').replace(/\r/g, '\r\n')
-      return outputText
-    }
-
-    //计算头函数 用来缩进
-    const setPrefix = (prefixIndex) => {
-      var result = ''
-      var span = '   ' //缩进长度
-      var output = []
-      for (var i = 0; i < prefixIndex; ++i) {
-        output.push(span)
+      } else {
+        nodeStack.pop() //弹栈
+        prefix = setPrefix(nodeStack.length)
       }
-      result = output.join('')
-      return result
     }
+    var ret = '\n' + prefix + all
+    return ret
+  })
+  var outputText = output.substring(1)
+  //还原注释内容
+  outputText = outputText.replace(/\n/g, '\r').replace(/(\s*)<!--(.+?)-->/g, function ($0, prefix, text) {
+    if (prefix.charAt(0) == '\r') prefix = prefix.substring(1)
+    text = unescape(text).replace(/\r/g, '\n')
+    var ret = '\n' + prefix + '<!--' + text.replace(/^\s*/gm, prefix) + '-->'
+    return ret
+  })
+  outputText = outputText.replace(/\s+$/g, '').replace(/\r/g, '\r\n')
+  return outputText
+}
 
-    const executeFormat = () => {
-      if (!originContent.value) {
-        return
-      }
-      try {
-        if (type.value === 'JSON') {
-          formattedResult.value = JSON.stringify(JSON.parse(originContent.value), null, 2)
-          console.log(formattedResult.value)
-          trueJson.value = true
-        } else {
-          if (originContent.value.indexOf('<') === -1 || originContent.value.indexOf('</') === -1 || originContent.value.indexOf('>') === -1) {
-            formattedResult.value = '不正确的XML文本'
-            trueJson.value = false
-          } else {
-            formattedResult.value = formatXml()
-            trueJson.value = true
-          }
-        }
-      } catch (error) {
-        formattedResult.value = error
+//计算头函数 用来缩进
+const setPrefix = (prefixIndex) => {
+  var result = ''
+  var span = '   ' //缩进长度
+  var output = []
+  for (var i = 0; i < prefixIndex; ++i) {
+    output.push(span)
+  }
+  result = output.join('')
+  return result
+}
+
+const executeFormat = () => {
+  if (!originContent.value) {
+    return
+  }
+  try {
+    if (type.value === 'JSON') {
+      formattedResult.value = JSON.stringify(JSON.parse(originContent.value), null, 2)
+      console.log(formattedResult.value)
+      trueJson.value = true
+    } else {
+      if (originContent.value.indexOf('<') === -1 || originContent.value.indexOf('</') === -1 || originContent.value.indexOf('>') === -1) {
+        formattedResult.value = '不正确的XML文本'
         trueJson.value = false
+      } else {
+        formattedResult.value = formatXml()
+        trueJson.value = true
       }
     }
-
-    return {
-      type,
-      preStyle,
-      placeholder,
-      clearWhenChangeType,
-      originContent,
-      formattedResult,
-      resultBackGround,
-      onTypeChange,
-      executeFormat,
-    }
-  },
+  } catch (error) {
+    formattedResult.value = error
+    trueJson.value = false
+  }
 }
 </script>