瀏覽代碼

Merge branch 'master' into 'master'

新增药品账页维护

See merge request lighter/vue-intergration-platform!76
huangshuhua 1 年之前
父節點
當前提交
804e3ee1f1
共有 4 個文件被更改,包括 231 次插入0 次删除
  1. 25 0
      src/api/yp-dict/yp-dict-info.js
  2. 5 0
      src/router/modules/dashboard.js
  3. 156 0
      src/views/yp-dict/YpDictInfo.vue
  4. 45 0
      src/views/yp-dict/YpZdDict.vue

+ 25 - 0
src/api/yp-dict/yp-dict-info.js

@@ -0,0 +1,25 @@
+import request from '@/utils/request'
+
+/**
+ * 查询药品账页字典--相关
+ * @returns 
+ */
+export function selectYpDict(text) {
+    return request({
+        url: '/ypDict/selectYpDict',
+        method: 'get',
+        params: { text },
+    })
+}
+
+/**
+ * 是否停用药品
+ * @returns 
+ */
+export function updateYpStopOrUsed(code, delFlag) {
+    return request({
+        url: '/ypDict/updateYpStopOrUsed',
+        method: 'get',
+        params: { code, delFlag },
+    })
+}

+ 5 - 0
src/router/modules/dashboard.js

@@ -863,6 +863,11 @@ const route = [
                 component: createNameComponent(() => import('@/views/yp-dict/YpDictBase.vue')),
                 meta: {title: '药品基础字典'},
             },
+            {
+                path: 'ypDict/ypDictInfo',
+                component: createNameComponent(() => import('@/views/yp-dict/YpDictInfo.vue')),
+                meta: {title: '药品账页维护'},
+            },
         ],
     },
     {

+ 156 - 0
src/views/yp-dict/YpDictInfo.vue

@@ -0,0 +1,156 @@
+<template>
+    <page-layer>
+        <template #header>
+            <el-input v-model="text" class="w-50 m-2" style="width: 320px" placeholder="请输入编码/名称/首拼/五笔" clearable>
+                <template #prepend>编码/名称/首拼/五笔 </template>
+            </el-input>
+            <el-button type="primary" icon="Search" @click="queryYpDict" style="margin-left: 5px">查询</el-button>
+            <el-button type="primary" icon="Plus" @click="addYpDic" style="margin-left: 5px">新增</el-button>
+        </template>
+        <template #main>
+            <el-table :data="drugDictData.slice(pageSize * (currentPage - 1), pageSize * currentPage)" border
+                style="width: 100%" :height="tableHeight" stripe highlight-current-row>
+                <el-table-column type="index" label="序号" width="60" />
+                <el-table-column prop="code" label="药品编码" width="90" />
+                <el-table-column prop="serial" label="药品包装" width="70" />
+                <el-table-column prop="name" label="药品名称" width="300" />
+                <el-table-column prop="specification" label="药品规格" width="200" />
+                <el-table-column prop="packRetprice" label="药品零售价" width="120" />
+                <el-table-column prop="delFlag" label="状态" width="80">
+                    <template #default="scope">
+                        <span v-if="scope.row.delFlag === '1'" style="color:#d12020;">停用</span>
+                        <span v-else></span>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="pyCode" label="拼音码" width="160" />
+                <el-table-column prop="dcode" label="五笔码" width="160" />
+                <el-table-column fixed="right" label="操作" min-width="180" width="180" center>
+                    <template #default="scope">
+                        <el-button type="primary" size="small" v-if="!scope.row.isEdit"
+                            @click="editYpDict(scope.row)">编辑</el-button>
+                        <el-button type="primary" size="small" v-if="!scope.row.isEdit"
+                            @click="editYpDictName(scope.row)">别名</el-button>
+                        <el-button :type="scope.row.delFlag === '1' ? 'primary' : 'warning'" size="small"
+                            @click.prevent="stopYpDict(scope.row)">
+                            <span v-if="scope.row.delFlag === '1'">启用</span>
+                            <span v-else>停用</span>
+                        </el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+            <el-pagination :current-page="currentPage" :page-size="pageSize" :page-sizes="[15, 30, 45, 60]"
+                :total="drugDictData.length" layout="total, sizes, prev, pager, next, jumper" style="margin-top: 5px"
+                @size-change="handleSizeChange" @current-change="handleCurrentChange">
+            </el-pagination>
+        </template>
+    </page-layer>
+    <el-dialog v-model="showYpEdit" :close-on-click-modal="false" :close-on-press-escape="false" :title="ypTitle"
+        width="70%" destroy-on-close>
+        <YpZdDict :ypDetail="ypDetail" @closeYpEditFor="closeYpEditAdd" />
+    </el-dialog>
+</template>
+<script setup name="YpDictInfo">
+import { ref, onMounted, nextTick } from 'vue'
+import PageLayer from '@/layout/PageLayer.vue'
+import store from '@/store'
+import { ElMessage, ElMessageBox } from 'element-plus'
+import { selectYpDict, updateYpStopOrUsed } from '@/api/yp-dict/yp-dict-info.js'
+import YpZdDict from '@/views/yp-dict/YpZdDict.vue'
+
+const windowSize = store.state.app.windowSize;
+const tableHeight = windowSize.h / 1.07;
+const text = ref('')
+const drugDictData = ref([])
+const ypTitle = ref('')
+const showYpEdit = ref(false)
+const ypDetail = ref({})
+
+const pageSize = ref(30)
+const currentPage = ref(1)
+const handleSizeChange = (val) => {
+    pageSize.value = val
+}
+const handleCurrentChange = (val) => {
+    currentPage.value = val
+}
+
+
+onMounted(() => {
+    nextTick(() => {
+        queryYpDict()
+    })
+})
+
+// 查询
+const queryYpDict = () => {
+    selectYpDict(text.value)
+        .then((res) => {
+            res.forEach(row => {
+                // 是否标记
+                row['isEdit'] = false
+                // 是否新增
+                row['isAdd'] = false
+            })
+            drugDictData.value = res
+        })
+        .catch(() => {
+            drugDictData.value = []
+        })
+}
+
+// 新增
+const addYpDic = () => {
+    alert('功能开发中。。。')
+}
+
+const closeYpEditAdd = () => {
+    showYpEdit.value = false
+    queryYpDict()
+}
+
+// 编辑
+const editYpDict = () => {
+    alert('功能开发中。。。')
+}
+
+// 编辑别名
+const editYpDictName = () => {
+    alert('功能开发中。。。')
+}
+
+const stopYpDict = (row) => {
+    let delFlag
+    let title
+    if ('1' === row.delFlag) {
+        delFlag = '0'
+        title = '请确认是否启用<span style="color:#d12020;">' + row.name + '</span>?'
+    } else {
+        delFlag = '1'
+        title = '请确认是否停用<span style="color:#d12020;">' + row.name + '</span>?'
+    }
+
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        updateYpStopOrUsed(row.code, delFlag).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            queryYpDict()
+            return
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryYpDic()
+        }
+    })
+}
+
+</script>

+ 45 - 0
src/views/yp-dict/YpZdDict.vue

@@ -0,0 +1,45 @@
+<template>
+    <PageLayer>
+        <template #header class="hd-cl">
+            <el-button type="primary" icon="Check" @click="submitForm(ruleFormRef)" style="margin-left: 10px">保存</el-button>
+            <el-button type="primary" icon="Refresh" @click="resetForm(ruleFormRef)"
+                style="margin-left: 10px">重置</el-button>
+        </template>
+        <template #mainMaxContentHeight>
+            <el-form ref="ruleFormRef" label-width="127px" :model="ypForm" class="demo-ruleForm" :size="formSize">
+            </el-form>
+        </template>
+    </PageLayer>
+</template>
+<script setup name="YpZdDict">
+import { ref, onMounted, nextTick } from 'vue'
+import PageLayer from '@/layout/PageLayer.vue'
+
+const formSize = ref('default')
+const ruleFormRef = ref()
+const props = defineProps({
+    deptDetail: {
+        type: Object,
+        default: {}
+    }
+})
+const emit = defineEmits(['closeDeptEditFor'])
+let deptForm = ref({
+    code: '', // 科室编码
+    name: '', // 科室名称
+    classCode: '', // 分类
+    parentCode: '', // 父科室(code)
+    ncode: '', // 院内码
+    delFlag: '', // 停用
+    xnhDeptCode: '', // 新农合科室编码
+    xnhDeptName: '', // 新农合科室名称
+    mzFlag: '', // 门诊开放
+    yjFlag: '', // 医技上线
+    ghChargeFlag: '', // 收取挂号费
+    ghjzFlag: '', // 门诊挂号就诊
+    supplyFlag: '', // 用药方式执行科室
+    officePos: '', // 就诊地点
+})
+
+
+</script>