Explorar el Código

门诊给药方式维护

lighter hace 1 mes
padre
commit
911f611675

+ 110 - 1
src/api/orderZdMaintain/index.ts

@@ -122,6 +122,58 @@ export interface YzSupplyTypeDTO {
   classsName?: string;
 }
 
+export interface MzZdSupplyType {
+  /**
+   * supplyCode
+   */
+  supplyCode?: string;
+
+  /**
+   * supplyName
+   */
+  supplyName?: string;
+
+  /**
+   * supplyOcc
+   */
+  supplyOcc?: string;
+
+  /**
+   * delFlag
+   */
+  delFlag?: boolean;
+
+  /**
+   * sortCode
+   */
+  sortCode?: number;
+
+  classCode?: string;
+
+  /**
+   * printName
+   */
+  printName?: string;
+
+  /**
+   * pyCode
+   */
+  pyCode?: string;
+
+  /**
+   * dCode
+   */
+  dCode?: string;
+
+  childCode?: string;
+
+  tryFlag?: string;
+
+  childName?: string;
+
+  className?: string;
+}
+
 export function getChangeItemType() {
   return requestV2({
     url: "/orderZdMaintain/getChangeItemType",
@@ -233,10 +285,11 @@ export function deleteOrderFrequency(code, delFlag) {
   });
 }
 
-export function getSupplyClass() {
+export function getSupplyClass(desc) {
   return requestV2({
     url: "/orderZdMaintain/getSupplyClass",
     method: "get",
+    params: { desc },
   });
 }
 
@@ -247,6 +300,14 @@ export function selectAllSupplyType() {
   });
 }
 
+export function selectAllMzSupplyType() {
+  return requestV2<MzZdSupplyType[]>({
+    url: "/orderZdMaintain/selectAllMzSupplyType",
+    method: "get",
+  });
+}
+
+
 export function insertSupplyType(data) {
   return requestV2({
     url: "/orderZdMaintain/insertSupplyType",
@@ -255,6 +316,14 @@ export function insertSupplyType(data) {
   });
 }
 
+export function insertMzSupplyType(data) {
+  return requestV2({
+    url: "/orderZdMaintain/insertMzSupplyType",
+    method: "post",
+    data: data,
+  });
+}
+
 export function updateSupplyType(data) {
   return requestV2({
     url: "/orderZdMaintain/updateSupplyType",
@@ -263,6 +332,14 @@ export function updateSupplyType(data) {
   });
 }
 
+export function updateMzSupplyType(data) {
+  return requestV2({
+    url: "/orderZdMaintain/updateMzSupplyType",
+    method: "post",
+    data: data,
+  });
+}
+
 export function deleteSupplyType(code, delFlag) {
   return requestV2({
     url: "/orderZdMaintain/deleteSupplyType",
@@ -271,6 +348,14 @@ export function deleteSupplyType(code, delFlag) {
   });
 }
 
+export function deleteMzSupplyType(code, delFlag) {
+  return requestV2({
+    url: "/orderZdMaintain/deleteMzSupplyType",
+    method: "get",
+    params: { code, delFlag },
+  });
+}
+
 export function getSupplyCharge(code) {
   return requestV2({
     url: "/orderZdMaintain/getSupplyCharge",
@@ -279,6 +364,14 @@ export function getSupplyCharge(code) {
   });
 }
 
+export function getMzSupplyCharges(code) {
+  return requestV2({
+    url: "/orderZdMaintain/getMzSupplyCharges",
+    method: "get",
+    params: { code },
+  });
+}
+
 export function saveSupplyCharge(data) {
   return requestV2({
     url: "/orderZdMaintain/saveSupplyCharge",
@@ -287,6 +380,14 @@ export function saveSupplyCharge(data) {
   });
 }
 
+export function saveMzSupplyCharge(data) {
+  return requestV2({
+    url: "/orderZdMaintain/saveMzSupplyCharge",
+    method: "post",
+    data,
+  });
+}
+
 export function delSupplyCharge(code, chargeCode) {
   return requestV2({
     url: "/orderZdMaintain/deleteSupplyCharge",
@@ -294,3 +395,11 @@ export function delSupplyCharge(code, chargeCode) {
     params: { code, chargeCode },
   });
 }
+
+export function delMzSupplyCharge(code, chargeCode) {
+  return requestV2({
+    url: "/orderZdMaintain/delMzSupplyCharge",
+    method: "get",
+    params: { code, chargeCode },
+  });
+}

+ 1 - 1
src/auto-imports.d.ts

@@ -65,6 +65,6 @@ declare global {
 // for type re-export
 declare global {
   // @ts-ignore
-  export type { Component, ComponentPublicInstance, ComputedRef, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, VNode, WritableComputedRef } from 'vue'
+  export type { Component, ComponentPublicInstance, ComputedRef, DirectiveBinding, ExtractDefaultPropTypes, ExtractPropTypes, ExtractPublicPropTypes, InjectionKey, PropType, Ref, MaybeRef, MaybeRefOrGetter, VNode, WritableComputedRef } from 'vue'
   import('vue')
 }

+ 0 - 2
src/layout/fillet-layout/index.vue

@@ -28,11 +28,9 @@
 import {computed} from 'vue'
 import HeaderV2 from "@/layout/fillet-layout/HeaderV2.vue";
 import {useSystemStore} from "@/pinia/system-store";
-import {useUserStore} from "@/pinia/user-store";
 import FilletAside from "@/layout/fillet-layout/FilletAside.vue";
 
 const systemStore = useSystemStore()
-const userStore = useUserStore()
 const isCollapse = computed(() => systemStore.userConfig.isCollapse)
 
 const hideMenu = () => {

+ 97 - 0
src/views/dictionary/orderZdMaintain/components/mz-supply-type/BindChargeDialog.vue

@@ -0,0 +1,97 @@
+<script setup lang="ts">
+import {
+  delMzSupplyCharge,
+  getMzSupplyCharges,
+  saveMzSupplyCharge,
+  searchChangeItem,
+} from "@/api/orderZdMaintain";
+import CyComboGrid from "@/components/cy/combo-grid/src/CyComboGrid.vue";
+import { UseDialogType } from "@/components/cy/CyDialog/index";
+
+const props = defineProps<{
+  code: string;
+}>();
+
+const data = ref([]);
+const searchChangeData = ref([]);
+
+function handleDel(row, index) {
+  delMzSupplyCharge(props.code, row.chargeCode).then(res => {
+    data.value.splice(index, 1);
+  });
+}
+
+function handleAdd() {
+  data.value.push({
+    chargeName: "",
+    chargeCode: "",
+    chargeAmount: 1,
+  });
+}
+
+onMounted(() => {
+  getMzSupplyCharges(props.code).then(res => {
+    data.value = res;
+  });
+});
+
+defineExpose<UseDialogType.Expose>({
+  async confirm() {
+    await saveMzSupplyCharge({
+      supplyCode: props.code,
+      list: data.value,
+    });
+  },
+});
+</script>
+
+<template>
+  <el-table :data="data" stripe border>
+    <el-table-column label="编码" width="400">
+      <template #default="scope">
+        <CyComboGrid
+          style="width: 100%"
+          v-model="scope.row"
+          value="chargeCode"
+          label="chargeName"
+          :data="searchChangeData"
+          :remote-method="
+            val => {
+              searchChangeItem(val).then(res => {
+                searchChangeData = res;
+              });
+            }
+          "
+          :table-header="[
+            { name: '项目编码', code: 'code', width: '90px' },
+            { name: '名字', code: 'name', width: '250px' },
+            { name: '单价', code: 'price', width: '120px' },
+            { name: '执行科室', code: 'execDeptName', width: '90px' },
+          ]"
+        />
+      </template>
+    </el-table-column>
+    <el-table-column label="数量">
+      <template #default="scope">
+        <el-input-number
+          v-model="scope.row.chargeAmount"
+          :precision="2"
+          :max="99"
+          :min="1"
+        />
+      </template>
+    </el-table-column>
+    <el-table-column label="操作">
+      <template #header>
+        <el-button @click="handleAdd">添加</el-button>
+      </template>
+      <template #default="{ row, $index }">
+        <el-button type="danger" @click="handleDel(row, $index)"
+          >删除
+        </el-button>
+      </template>
+    </el-table-column>
+  </el-table>
+</template>
+
+<style lang="scss"></style>

+ 282 - 0
src/views/dictionary/orderZdMaintain/components/mz-supply-type/index.vue

@@ -0,0 +1,282 @@
+<script setup lang="ts">
+import {
+  deleteMzSupplyType,
+  getSupplyClass,
+  insertMzSupplyType,
+  selectAllMzSupplyType,
+  updateMzSupplyType,
+  MzZdSupplyType,
+} from "@/api/orderZdMaintain";
+import XcElOption from "@/components/xiao-chan/xc-el-option/XcElOption.vue";
+import XEUtils from "xe-utils";
+import { VxeTablePropTypes } from "vxe-table";
+import { useVxeTableRef } from "@/utils/useCompRef";
+import { xcMessage } from "@/utils/xiaochan-element-plus";
+import { getPyCode } from "@/api/inpatient/xiang-mu-lu-ru";
+import { useDialog } from "@/components/cy/CyDialog/index";
+import BindChargeDialog from "./BindChargeDialog.vue";
+
+const store = reactive({
+  supplyClass: [],
+  data: [],
+  search: "",
+  supplyChild: [],
+});
+
+const tryFlags = [
+  { code: "1", name: "皮试" },
+  { code: "2", name: "免试" },
+];
+
+const tableRef = useVxeTableRef<MzZdSupplyType>();
+
+function rulesContent(value, maxLength, empty = false) {
+  if (XEUtils.charLength(value, maxLength, empty)) {
+    return;
+  }
+  return new Error(`共${maxLength}个字符,中文算两个`);
+}
+
+const validRules: VxeTablePropTypes.EditRules<MzZdSupplyType> = {
+  supplyName: [
+    {
+      required: true,
+      content: "必须填写",
+    },
+    {
+      validator: ({ row }) => {
+        return rulesContent(row.supplyName, 40);
+      },
+    },
+  ],
+  printName: [
+    {
+      validator: ({ row }) => {
+        return rulesContent(row.printName, 40, true);
+      },
+    },
+  ],
+  pyCode: [
+    {
+      validator: ({ row }) => {
+        return rulesContent(row.pyCode, 8, true);
+      },
+    },
+  ],
+  dcode: [
+    {
+      validator: ({ row }) => {
+        return rulesContent(row.dcode, 8, true);
+      },
+    },
+  ],
+};
+
+async function handleGetData() {
+  store.data = await selectAllMzSupplyType().catch(() => []);
+  store.supplyChild = store.data.map(item => {
+    item.tryFlagName = findSelectName(item.tryFlag, tryFlags);
+    return {
+      code: item.supplyCode,
+      name: item.supplyName,
+    };
+  });
+}
+
+function findSelectName(value, data) {
+  const find = XEUtils.find(data, i => {
+    return i.code === value;
+  });
+
+  if (find) {
+    return find.name;
+  }
+
+  return "";
+}
+
+async function handleAdd() {
+  const { row } = await tableRef.value.insertAt({
+    supplyName: "",
+    classCode: 1,
+  } as MzZdSupplyType);
+  await tableRef.value.setEditRow(row, "supplyName");
+  await tableRef.value.scrollToRow(row, "supplyName");
+}
+
+async function handleSave() {
+  const errMap = await tableRef.value.validate(false);
+  if (errMap) {
+    xcMessage.error("请检查错误位置");
+  }
+
+  const insert = tableRef.value.getInsertRecords();
+  const update = tableRef.value.getUpdateRecords();
+
+  insert.forEach(item => {
+    insertMzSupplyType(item).catch(res => {});
+  });
+
+  update.forEach(item => {
+    updateMzSupplyType(item).catch(res => {});
+  });
+}
+
+function handleGetPyDode(row) {
+  getPyCode(row.supplyName).then(res => {
+    row.pyCode = res.pyCode;
+    row.dcode = res.wbCode;
+  });
+  row.printName = row.supplyName;
+}
+
+function handleDel(row, value) {
+  let del = "0";
+  if (value) {
+    del = "1";
+  }
+  deleteMzSupplyType(row.supplyCode, del).then(() => {
+    row.delFlag = del;
+  });
+}
+
+function handleOpenCharge(code) {
+  useDialog(BindChargeDialog, {
+    params: {
+      code,
+    },
+    dialogProps: {
+      title: "绑定费用",
+    },
+  });
+}
+
+onMounted(() => {
+  getSupplyClass('mz').then(res => {
+    store.supplyClass = res;
+  });
+  handleGetData();
+});
+</script>
+
+<template>
+  <div class="layout_container">
+    <header>
+      <el-input v-model="store.search" style="width: 220px" clearable />
+      <el-button @click="handleAdd">新增</el-button>
+      <el-button @click="handleSave">保存</el-button>
+      <el-divider direction="vertical" />
+      <el-button @click="handleGetData">重置</el-button>
+    </header>
+    <div class="layout_main">
+      <vxe-table
+        ref="tableRef"
+        keep-source
+        height="100%"
+        :data="store.data"
+        :edit-rules="validRules"
+        :edit-config="{
+          mode: 'row',
+          trigger: 'click',
+          autoClear: false,
+          showStatus: true,
+        }"
+      >
+        <vxe-column field="delFlag" title="停用" width="50">
+          <template #default="{ row }">
+            <el-checkbox
+              :model-value="row.delFlag === '1'"
+              @update:modelValue="
+                value => {
+                  handleDel(row, value);
+                }
+              "
+            />
+          </template>
+        </vxe-column>
+        <vxe-column field="supplyCode" title="编码" width="100" />
+        <vxe-column
+          field="supplyName"
+          title="名称"
+          width="200"
+          :edit-render="{}"
+        >
+          <template #edit="{ row }">
+            <el-input v-model="row.supplyName" @blur="handleGetPyDode(row)" />
+          </template>
+        </vxe-column>
+        <vxe-column
+          field="className"
+          title="分类"
+          width="100"
+          :edit-render="{}"
+        >
+          <template #edit="{ row }">
+            <el-select v-model="row.classCode">
+              <xc-el-option :data="store.supplyClass" />
+            </el-select>
+          </template>
+        </vxe-column>
+
+        <vxe-column field="printName" title="打印名" :edit-render="{}">
+          <template #edit="{ row }">
+            <el-input v-model="row.printName" />
+          </template>
+        </vxe-column>
+
+        <vxe-column
+          field="childName"
+          title="子给药方式"
+          :edit-render="{}"
+        >
+          <template #edit="{ row }">
+            <el-select v-model="row.supplyChild">
+              <xc-el-option :data="store.supplyChild" />
+            </el-select>
+          </template>
+        </vxe-column>
+
+        <vxe-column field="tryFlagName" title="皮试标志" :edit-render="{}">
+          <template #edit="{ row }">
+            <el-select
+              clearable
+              @clear="
+                () => {
+                  row.tryFlag = null;
+                }
+              "
+              :model-value="row.tryFlag"
+              @update:model-value="
+                val => {
+                  row.tryFlag = val;
+                }
+              "
+            >
+              <xc-el-option :data="tryFlags" />
+            </el-select>
+          </template>
+        </vxe-column>
+
+        <vxe-column field="pyCode" title="拼音" :edit-render="{}">
+          <template #edit="{ row }">
+            <el-input v-model="row.pyCode" />
+          </template>
+        </vxe-column>
+        <vxe-column field="dcode" title="五笔" :edit-render="{}">
+          <template #edit="{ row }">
+            <el-input v-model="row.dcode" />
+          </template>
+        </vxe-column>
+        <vxe-column title="绑定费用" fixed="right">
+          <template #default="{ row }">
+            <el-button @click="handleOpenCharge(row.supplyCode)"
+              >绑定
+            </el-button>
+          </template>
+        </vxe-column>
+      </vxe-table>
+    </div>
+  </div>
+</template>
+
+<style lang="scss"></style>

+ 0 - 0
src/views/dictionary/orderZdMaintain/compoents/order-frequency/EditorDialog.vue → src/views/dictionary/orderZdMaintain/components/order-frequency/EditorDialog.vue


+ 0 - 0
src/views/dictionary/orderZdMaintain/compoents/order-frequency/index.vue → src/views/dictionary/orderZdMaintain/components/order-frequency/index.vue


+ 0 - 0
src/views/dictionary/orderZdMaintain/compoents/order-item-confirm/AddDialog.vue → src/views/dictionary/orderZdMaintain/components/order-item-confirm/AddDialog.vue


+ 0 - 0
src/views/dictionary/orderZdMaintain/compoents/order-item-confirm/index.vue → src/views/dictionary/orderZdMaintain/components/order-item-confirm/index.vue


+ 0 - 0
src/views/dictionary/orderZdMaintain/compoents/orderitem/EditorDialog.vue → src/views/dictionary/orderZdMaintain/components/orderitem/EditorDialog.vue


+ 0 - 0
src/views/dictionary/orderZdMaintain/compoents/orderitem/OrderIten.vue → src/views/dictionary/orderZdMaintain/components/orderitem/OrderIten.vue


+ 0 - 0
src/views/dictionary/orderZdMaintain/compoents/supply-type/BindChargeDialog.vue → src/views/dictionary/orderZdMaintain/components/supply-type/BindChargeDialog.vue


+ 1 - 1
src/views/dictionary/orderZdMaintain/compoents/supply-type/index.vue → src/views/dictionary/orderZdMaintain/components/supply-type/index.vue

@@ -154,7 +154,7 @@ function handleOpenCharge(code) {
 }
 
 onMounted(() => {
-  getSupplyClass().then(res => {
+  getSupplyClass('zy').then(res => {
     store.supplyClass = res;
   });
   handleGetData();

+ 11 - 5
src/views/dictionary/orderZdMaintain/index.ts

@@ -1,21 +1,23 @@
 import XEUtils from "xe-utils";
 
 const OrderItem = defineAsyncComponent(
-  () => import("./compoents/orderitem/OrderIten.vue")
+  () => import("./components/orderitem/OrderIten.vue")
 );
 
 const OrderItemConfirm = defineAsyncComponent(
-  () => import("./compoents/order-item-confirm/index.vue")
+  () => import("./components/order-item-confirm/index.vue")
 );
 
 const OrderFrequency = defineAsyncComponent(
-  () => import("./compoents/order-frequency/index.vue")
+  () => import("./components/order-frequency/index.vue")
 );
 
 const SupplyType = defineAsyncComponent(
-  () => import("./compoents/supply-type/index.vue")
+  () => import("./components/supply-type/index.vue")
 );
 
+const MzSupplyType = defineAsyncComponent(() => import("./components/mz-supply-type/index.vue"));
+
 export const frequencySort = [
   "早上",
   "day600",
@@ -106,7 +108,11 @@ export const tabsList = [
     component: OrderFrequency,
   },
   {
-    name: "给药方式",
+    name: "住院给药方式",
     component: SupplyType,
   },
+  {
+    name: "门诊给药方式",
+    component: MzSupplyType,
+  },
 ];