Bladeren bron

后勤管理

zengfanwei 1 maand geleden
bovenliggende
commit
f0b72615e8

+ 229 - 0
src/components/searchArea/index.vue

@@ -0,0 +1,229 @@
+<template>
+    <div class="search-container" :style="{ paddingBottom }">
+        <div class="search-form-area">
+            <el-form ref="searchForm" :model="form" label-position="right" label-width="auto" class="search-form">
+                <el-row class="center-row" align="middle">
+                    <el-col v-for="(item, index) in searchData" :key="index" :span="item.span || 6" class="center-col">
+                        <el-form-item :label="item.label" :prop="item.key">
+                            <!-- 输入框 -->
+                            <el-input v-if="item.type === 'input'" v-model="form[item.key]"
+                                :placeholder="'请输入' + item.label" size="small" :clearable="item.clearable !== false" />
+
+                            <!-- 下拉选择 -->
+                            <el-select v-if="item.type === 'select'" v-model="form[item.key]"
+                                :placeholder="'请选择' + item.label" size="small" :clearable="item.clearable !== false"
+                                filterable>
+                                <el-option v-for="(option, i) in item.optionsData" :key="i"
+                                    :label="getOptionLabel(option, item)" :value="getOptionValue(option, item)" />
+                            </el-select>
+
+                            <!-- 多选下拉 -->
+                            <el-select v-if="item.type === 'selectMultiple'" v-model="form[item.key]"
+                                :placeholder="'请选择' + item.label" size="small" multiple
+                                :multiple-limit="item.multipleLimit || 0" collapse-tags
+                                :clearable="item.clearable !== false" filterable>
+                                <el-option v-for="(option, i) in item.optionsData" :key="i"
+                                    :label="getOptionLabel(option, item)" :value="getOptionValue(option, item)" />
+                            </el-select>
+
+                            <!-- 级联选择 -->
+                            <el-cascader v-if="item.type === 'cascader'" v-model="form[item.key]"
+                                :options="item.optionsData" :props="item.props || {}" :placeholder="'请选择' + item.label"
+                                size="small" :show-all-levels="false" filterable
+                                :clearable="item.clearable !== false" />
+
+                            <!-- 日期选择器 -->
+                            <el-date-picker v-if="item.type === 'dataPickerSingle'" v-model="form[item.key]" type="date"
+                                size="small" :placeholder="'选择日期'" value-format="timestamp"
+                                :clearable="item.clearable !== false" />
+
+                            <!-- 日期范围 -->
+                            <el-date-picker v-if="item.type === 'dataPicker'" v-model="form[item.key]" type="daterange"
+                                size="small" :placeholder="['开始日期', '结束日期']" range-separator="至"
+                                start-placeholder="开始日期" end-placeholder="结束日期" value-format="timestamp"
+                                :default-time="['00:00:00', '23:59:59']" :clearable="item.clearable !== false"
+                                @change="(v) => handleDateChange(v, item.key)" />
+
+                            <!-- 日期时间范围 -->
+                            <el-date-picker v-if="item.type === 'dataTimePicker'" v-model="form[item.key]"
+                                type="datetimerange" size="small" range-separator="至" start-placeholder="开始日期"
+                                end-placeholder="结束日期" value-format="timestamp" :default-time="['00:00:00', '23:59:59']"
+                                :clearable="item.clearable !== false" />
+
+                            <!-- 周选择器 -->
+                            <el-date-picker v-if="item.type === 'weekDataPicker'" v-model="form[item.key]" type="week"
+                                size="small" format="yyyy 第 WW 周" :placeholder="'选择周'" :picker-options="pickerOptions"
+                                :clearable="item.clearable !== false" @change="handleChange(index)" />
+
+                            <!-- 月选择器 -->
+                            <el-date-picker v-if="item.type === 'monthDataPicker'" v-model="form[item.key]" type="month"
+                                size="small" format="yyyy 年 MM 月" :placeholder="'选择月份'" :picker-options="pickerOptions"
+                                :clearable="item.clearable !== false" @change="handleChange(index)" />
+
+                            <!-- 月份范围 -->
+                            <el-date-picker v-if="item.type === 'monthrange'" v-model="form[item.key]" type="monthrange"
+                                size="small" range-separator="至" start-placeholder="开始月份" end-placeholder="结束月份"
+                                value-format="timestamp" :clearable="item.clearable !== false" />
+                        </el-form-item>
+                    </el-col>
+                </el-row>
+            </el-form>
+        </div>
+        <div class="form-actions">
+            <el-button type="primary" icon="Search" size="small" @click="handleSubmit">
+                查询
+            </el-button>
+            <el-button size="small" icon="Refresh" @click="handleReset">
+                重置
+            </el-button>
+        </div>
+    </div>
+</template>
+
+<script setup>
+import { ref, watch, reactive } from 'vue'
+import { debounce } from '@/utils/debounce'
+
+onMounted(() => {
+    console.log("searchData", props.searchData);
+})
+
+const props = defineProps({
+    searchData: {
+        type: Array,
+        default: () => [
+            {
+                label: '键1',
+                key: 'key1',
+                type: 'input',
+                value: '',
+                span: 6 // 默认每项占6列(24栅格)
+            },
+            {
+                label: '键2',
+                key: 'key2',
+                type: 'input',
+                value: '',
+                span: 6
+            }
+        ]
+    },
+    paddingBottom: {
+        type: String,
+        default: '0'
+    }
+})
+
+const emit = defineEmits(['submit', 'type-change', 'linkage'])
+
+const form = reactive({})
+const searchForm = ref({})
+const pickerOptions = reactive({})
+
+// 获取选项标签
+const getOptionLabel = (option, item) => {
+    return item.optionsConfig ? option[item.optionsConfig.labelKey] : option.label
+}
+
+// 获取选项值
+const getOptionValue = (option, item) => {
+    return item.optionsConfig ? option[item.optionsConfig.valueKey] : option.value
+}
+
+// 处理日期变化
+const handleDateChange = (value, key) => {
+    if (value && value.length > 1) {
+        value[1] = new Date(value[1]).setHours(23, 59, 59)
+        form[key] = value
+    }
+}
+
+// 处理变化事件
+const handleChange = (index) => {
+    const item = props.searchData[index]
+    if (item.key === 'type') {
+        emit('type-change', form.type)
+    }
+    if (item.linkage) {
+        emit('linkage', form)
+    }
+}
+
+// 提交表单
+const handleSubmit = debounce(() => {
+    emit('submit', form)
+}, 200, true)
+
+// 重置表单
+const handleReset = debounce(() => {
+    Object.keys(form).forEach(key => {
+        form[key] = undefined
+    })
+    emit('submit', {}, 'reset')
+}, 200, true)
+
+// 监听searchData变化初始化表单
+watch(
+    () => props.searchData,
+    (val) => {
+        val.forEach(item => {
+            form[item.key] = item.value
+        })
+    },
+    { deep: true, immediate: true }
+)
+</script>
+
+<style lang="scss" scoped>
+.search-container {
+    padding: 10px 16px 0 16px;
+    background-color: #fff;
+    border-radius: 4px;
+    // margin-bottom: 16px;
+    display: flex;
+    justify-content: center;
+    align-items: center;
+
+    .search-form-area {
+        flex: 6;
+    }
+
+    .search-form {
+        :deep(.el-form-item) {
+            // margin-bottom: 16px;
+            .el-input,
+            .el-select,
+            .el-cascader,
+            .el-date-editor {
+                width: 100%;
+            }
+
+            .el-date-editor--daterange,
+            .el-date-editor--datetimerange {
+                width: 100%;
+            }
+        }
+    }
+
+    .form-actions {
+        display: flex;
+        justify-content: flex-end;
+        flex: 1;
+        // padding-top: 8px;
+    }
+}
+
+.center-row {
+    display: flex;
+    // justify-content: center;
+    // align-items: center;
+    // height: 50px;
+}
+
+.center-col {
+    // display: flex;
+    // justify-content: center;
+    // align-items: center;
+    padding: 2px 5px;
+}
+</style>

+ 1490 - 0
src/views/logisticsMaterials/logisticsBasicData/enterpriseInformation.vue

@@ -0,0 +1,1490 @@
+<template>
+    <div class="layout_display_flex_y">
+        <div class="obviousBox">
+            <searchArea :searchData="searchData" @submit="searchByForm"></searchArea>
+        </div>
+        <div class="layout_display_flex_y">
+            <el-tabs class="el-tabs__fill" v-model="editableTabsValue" type="border-card" @tab-click="handleClick">
+                <div style="padding: 6px; background-color: #fff;">
+                    <el-button type="primary" icon="Plus" @click="onAddItem" style="margin-left: 5px">新增</el-button>
+                </div>
+                <el-tab-pane key="ypClass" label="供应商字典" name="ypClass" style="height: 90%;">
+                    <div class="layout_display_flex_y">
+                        <div class="layout_flex_1-y">
+                            <el-table
+                                :data="ypClassData.slice(pageSizeClass * (currentPageClass - 1), pageSizeClass * currentPageClass)"
+                                border style="width: 100%" height="100%" stripe highlight-current-row
+                                class="ypClassTable normal-size">
+                                <el-table-column prop="code" label="供应商编码" width="80">
+                                    <template v-slot="scope">
+                                        <el-input v-if="scope.row.isEdit" size="small"
+                                            v-model="scope.row.code"></el-input>
+                                        <span v-else>{{ scope.row.code }}</span>
+                                    </template>
+                                </el-table-column>
+                                <el-table-column prop="name" label="供应商名称" width="200">
+                                    <template v-slot="scope">
+                                        <el-input v-if="scope.row.isEdit" size="small"
+                                            v-model="scope.row.name"></el-input>
+                                        <span v-else>{{ scope.row.name }}</span>
+                                    </template>
+                                </el-table-column>
+                                <el-table-column prop="pyCode" label="拼音码" width="140" />
+                                <el-table-column prop="dcode" label="五笔码" width="140" />
+                                <el-table-column prop="name" label="厂商类型" width="200">
+                                    <template v-slot="scope">
+                                        <el-input v-if="scope.row.isEdit" size="small"
+                                            v-model="scope.row.name"></el-input>
+                                        <span v-else>{{ scope.row.name }}</span>
+                                    </template>
+                                </el-table-column>
+                                <el-table-column prop="name" label="地址" width="200">
+                                    <template v-slot="scope">
+                                        <el-input v-if="scope.row.isEdit" size="small"
+                                            v-model="scope.row.name"></el-input>
+                                        <span v-else>{{ scope.row.name }}</span>
+                                    </template>
+                                </el-table-column>
+                                <el-table-column prop="name" label="电话" width="140">
+                                    <template v-slot="scope">
+                                        <el-input v-if="scope.row.isEdit" size="small"
+                                            v-model="scope.row.name"></el-input>
+                                        <span v-else>{{ scope.row.name }}</span>
+                                    </template>
+                                </el-table-column>
+                                =<el-table-column prop="name" label="账号" width="140">
+                                    <template v-slot="scope">
+                                        <el-input v-if="scope.row.isEdit" size="small"
+                                            v-model="scope.row.name"></el-input>
+                                        <span v-else>{{ scope.row.name }}</span>
+                                    </template>
+                                </el-table-column>
+                                <el-table-column prop="name" label="开户银行" width="140">
+                                    <template v-slot="scope">
+                                        <el-input v-if="scope.row.isEdit" size="small"
+                                            v-model="scope.row.name"></el-input>
+                                        <span v-else>{{ scope.row.name }}</span>
+                                    </template>
+                                </el-table-column>
+                                <el-table-column prop="delFlag" label="是否停用" width="100">
+                                    <template v-slot="scope">
+                                        <div v-if="scope.row.isEdit">
+                                            <el-select v-model="scope.row.delFlag" clearable placeholder="请选择是否停用">
+                                                <el-option v-for="option in delFlagOptions" :key="option.code"
+                                                    :label="option.name" :value="option.code"></el-option>
+                                            </el-select>
+                                        </div>
+                                        <div v-else>
+                                            <el-select v-model="scope.row.delFlag" disabled placeholder="请选择是否无效">
+                                                <el-option v-for="option in delFlagOptions" :key="option.code"
+                                                    :label="option.name" :value="option.code"></el-option>
+                                            </el-select>
+                                        </div>
+                                    </template>
+                                </el-table-column>
+                                <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="editYpClass(scope.row)">编辑</el-button>
+                                        <el-button type="primary" size="small" v-if="scope.row.isEdit"
+                                            @click="updateYpClass(scope.row)">保存</el-button>
+                                        <el-button type="primary" size="small" v-if="scope.row.isEdit"
+                                            @click="cancelYpClass(scope.row)">取消
+                                        </el-button>
+                                        <el-button type="danger" size="small"
+                                            @click.prevent="deleteYpClass(scope.$index, scope.row)">
+                                            删除
+                                        </el-button>
+                                        <el-button type="success" size="small"
+                                            v-if="!scope.row.isEdit && scope.row.delFlag === '1'"
+                                            @click.prevent="deleteYpClass(scope.$index, scope.row)">
+                                            启用
+                                        </el-button>
+                                        <el-button type="info" size="small"
+                                            v-if="!scope.row.isEdit && scope.row.delFlag === '0'"
+                                            @click.prevent="deleteYpClass(scope.$index, scope.row)">
+                                            停用
+                                        </el-button>
+                                    </template>
+                                </el-table-column>
+                            </el-table>
+                        </div>
+                        <div>
+                            <el-pagination :current-page="currentPageClass" :page-size="pageSizeClass"
+                                :page-sizes="[10, 15, 20, 25]" :total="ypClassData.length"
+                                layout="total, sizes, prev, pager, next, jumper" style="margin-top: 5px"
+                                @size-change="handleSizeChangeClass" @current-change="handleCurrentChangeClass">
+                            </el-pagination>
+                        </div>
+                    </div>
+                </el-tab-pane>
+                <el-tab-pane key="drugKind" label="生产厂家字典" name="drugKind" style="height: 90%;">
+                    <div class="layout_display_flex_y">
+                        <div class="layout_flex_1-y">
+                            <el-table
+                                :data="drugKindData.slice(pageSizeKind * (currentPageKind - 1), pageSizeKind * currentPageKind)"
+                                border style="width: 100%" height="100%" stripe highlight-current-row
+                                class="drugKindTable normal-size">
+                                <el-table-column prop="code" label="厂家编码" width="80">
+                                    <template v-slot="scope">
+                                        <el-input v-if="scope.row.isEdit" size="small"
+                                            v-model="scope.row.code"></el-input>
+                                        <span v-else>{{ scope.row.code }}</span>
+                                    </template>
+                                </el-table-column>
+                                <el-table-column prop="name" label="厂家名称" width="200">
+                                    <template v-slot="scope">
+                                        <el-input v-if="scope.row.isEdit" size="small"
+                                            v-model="scope.row.name"></el-input>
+                                        <span v-else>{{ scope.row.name }}</span>
+                                    </template>
+                                </el-table-column>
+                                <el-table-column prop="pyCode" label="拼音码" width="140" />
+                                <el-table-column prop="dcode" label="五笔码" width="140" />
+                                <el-table-column prop="name" label="厂商类型" width="200">
+                                    <template v-slot="scope">
+                                        <el-input v-if="scope.row.isEdit" size="small"
+                                            v-model="scope.row.name"></el-input>
+                                        <span v-else>{{ scope.row.name }}</span>
+                                    </template>
+                                </el-table-column>
+                                <el-table-column prop="name" label="地址" width="200">
+                                    <template v-slot="scope">
+                                        <el-input v-if="scope.row.isEdit" size="small"
+                                            v-model="scope.row.name"></el-input>
+                                        <span v-else>{{ scope.row.name }}</span>
+                                    </template>
+                                </el-table-column>
+                                <el-table-column prop="name" label="电话" width="140">
+                                    <template v-slot="scope">
+                                        <el-input v-if="scope.row.isEdit" size="small"
+                                            v-model="scope.row.name"></el-input>
+                                        <span v-else>{{ scope.row.name }}</span>
+                                    </template>
+                                </el-table-column>
+                                =<el-table-column prop="name" label="账号" width="140">
+                                    <template v-slot="scope">
+                                        <el-input v-if="scope.row.isEdit" size="small"
+                                            v-model="scope.row.name"></el-input>
+                                        <span v-else>{{ scope.row.name }}</span>
+                                    </template>
+                                </el-table-column>
+                                <el-table-column prop="name" label="开户银行" width="140">
+                                    <template v-slot="scope">
+                                        <el-input v-if="scope.row.isEdit" size="small"
+                                            v-model="scope.row.name"></el-input>
+                                        <span v-else>{{ scope.row.name }}</span>
+                                    </template>
+                                </el-table-column>
+                                <el-table-column prop="delFlag" label="是否停用" width="100">
+                                    <template v-slot="scope">
+                                        <div v-if="scope.row.isEdit">
+                                            <el-select v-model="scope.row.delFlag" clearable placeholder="请选择是否停用">
+                                                <el-option v-for="option in delFlagOptions" :key="option.code"
+                                                    :label="option.name" :value="option.code"></el-option>
+                                            </el-select>
+                                        </div>
+                                        <div v-else>
+                                            <el-select v-model="scope.row.delFlag" disabled placeholder="请选择是否无效">
+                                                <el-option v-for="option in delFlagOptions" :key="option.code"
+                                                    :label="option.name" :value="option.code"></el-option>
+                                            </el-select>
+                                        </div>
+                                    </template>
+                                </el-table-column>
+                                <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="editYpClass(scope.row)">编辑</el-button>
+                                        <el-button type="primary" size="small" v-if="scope.row.isEdit"
+                                            @click="updateYpClass(scope.row)">保存</el-button>
+                                        <el-button type="primary" size="small" v-if="scope.row.isEdit"
+                                            @click="cancelYpClass(scope.row)">取消
+                                        </el-button>
+                                        <el-button type="danger" size="small"
+                                            @click.prevent="deleteYpClass(scope.$index, scope.row)">
+                                            删除
+                                        </el-button>
+                                        <el-button type="success" size="small"
+                                            v-if="!scope.row.isEdit && scope.row.delFlag === '1'"
+                                            @click.prevent="deleteYpClass(scope.$index, scope.row)">
+                                            启用
+                                        </el-button>
+                                        <el-button type="info" size="small"
+                                            v-if="!scope.row.isEdit && scope.row.delFlag === '0'"
+                                            @click.prevent="deleteYpClass(scope.$index, scope.row)">
+                                            停用
+                                        </el-button>
+                                    </template>
+                                </el-table-column>
+                            </el-table>
+                        </div>
+                        <div>
+                            <el-pagination :current-page="currentPageKind" :page-size="pageSizeKind"
+                                :page-sizes="[10, 15, 20, 25]" :total="drugKindData.length"
+                                layout="total, sizes, prev, pager, next, jumper" style="margin-top: 5px"
+                                @size-change="handleSizeChangeKind" @current-change="handleCurrentChangeKind">
+                            </el-pagination>
+                        </div>
+                    </div>
+                </el-tab-pane>
+            </el-tabs>
+        </div>
+
+        <el-dialog v-model="centerDialogVisible" :title="'新增' + currentTabLabel" width="500" center>
+            <template #footer>
+                <el-form :model="addItemForm" label-width="auto" style="max-width: 600px">
+                    <el-row type="flex" justify="center" :gutter="0">
+                        <el-col :span="colSize">
+                            <el-form-item label="供应商名称">
+                                <el-input v-model="addItemForm.name" />
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="colSize">
+                            <el-form-item label="厂商类型">
+                                <el-select v-model="addItemForm.region" placeholder="please select your zone">
+                                    <el-option label="Zone one" value="shanghai" />
+                                    <el-option label="Zone two" value="beijing" />
+                                </el-select>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+
+                    <el-row type="flex" justify="center" :gutter="0">
+                        <el-col :span="colSize">
+                            <el-form-item label="地址">
+                                <el-input v-model="addItemForm.name" />
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="colSize">
+                            <el-form-item label="电话">
+                                <el-input v-model="addItemForm.name" />
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+
+                    <el-row type="flex" justify="center" :gutter="0">
+                        <el-col :span="colSize">
+                            <el-form-item label="账号">
+                                <el-input v-model="addItemForm.name" />
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="colSize">
+                            <el-form-item label="开户银行">
+                                <el-input v-model="addItemForm.name" />
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+
+                    <el-row type="flex" justify="center" :gutter="0">
+                        <el-col :span="colSize">
+                            <el-form-item label="是否停用">
+                                <el-select v-model="addItemForm.region" placeholder="please select your zone">
+                                    <el-option label="停用" value="1" />
+                                    <el-option label="启用" value="0" />
+                                </el-select>
+                            </el-form-item>
+                        </el-col>
+                        <el-col :span="colSize">
+                        </el-col>
+                    </el-row>
+                </el-form>
+                <div class="dialog-footer">
+                    <el-button @click="centerDialogVisible = false">Cancel</el-button>
+                    <el-button type="primary" @click="centerDialogVisible = false">
+                        Confirm
+                    </el-button>
+                </div>
+            </template>
+        </el-dialog>
+    </div>
+</template>
+<script setup name="YpDict">
+import { ref, onMounted, nextTick } from 'vue'
+import { ElMessage, ElMessageBox } from 'element-plus'
+import {
+    selectYpClass, saveYpClass, delYpClassByCode,
+    selectDrugKind, saveDrugKind, delDrugKindByCode,
+    selectYpDosage, saveYpDosage, delYpDosageByCode,
+    selectYpUnit, saveYpUnit, delYpUnitByCode,
+    selectYpChargeGroup, saveYpChargeGroup, delYpChargeGroupByCode,
+    selectYpVisibleFlag, updateYpVisibleFlag,
+    selectYpSupply, saveYpSupply, delYpSupplyByCode,
+    selectYpManuFactory, saveYpManuFactory, delYpManuFactoryByCode
+} from '@/api/yp-dict/yp-dict-base.js'
+import searchArea from '@/components/searchArea/index.vue';
+
+const editableTabsValue = ref('ypClass')
+const msgTip = '分类编码(code)有变更,原始字典记录存在关联,请谨慎做更改,是否确认!!!'
+const delFlagOptions = [{ code: '0', name: '启用' }, { code: '1', name: '停用' }]
+
+const searchData = ref([
+    {
+        label: '企业名称',
+        key: 'vehicleName',
+        type: 'input',
+        value: '',
+        clearable: true,
+    },
+])
+
+let addItemForm = reactive({})
+
+let centerDialogVisible = ref(false)
+
+let currentTabLabel = ref('供应商')
+
+const colSize = ref(12)
+
+const pageSizeClass = ref(20)
+const currentPageClass = ref(1)
+const handleSizeChangeClass = (val) => {
+    pageSizeClass.value = val
+}
+const handleCurrentChangeClass = (val) => {
+    currentPageClass.value = val
+}
+
+const pageSizeKind = ref(20)
+const currentPageKind = ref(1)
+const handleSizeChangeKind = (val) => {
+    pageSizeKind.value = val
+}
+const handleCurrentChangeKind = (val) => {
+    currentPageKind.value = val
+}
+
+const pageSizeDosage = ref(20)
+const currentPageDosage = ref(1)
+
+const pageSizeUnit = ref(20)
+const currentPageUnit = ref(1)
+
+const pageSize = ref(20)
+const currentPage = ref(1)
+
+const pageSizeSupply = ref(20)
+const currentPageSupply = ref(1)
+
+const pageSizeManuFactory = ref(20)
+const currentPageManuFactory = ref(1)
+
+const ypClassData = ref([])
+const drugKindData = ref([])
+const ypDosageData = ref([])
+const ypUnitData = ref([])
+const ypChargeGroupData = ref([])
+const visibleFlagData = ref([])
+const ypSupplyData = ref([])
+const ypManuFactoryData = ref([])
+
+const text = ref('')
+onMounted(() => {
+    nextTick(() => {
+        queryYpClass()
+    })
+})
+
+//搜索表单方法
+const searchByForm = (form) => {
+    console.log("search", form)
+}
+
+
+// 查询药品字典-药性字典
+const queryYpClass = () => {
+    selectYpClass(text.value)
+        .then((res) => {
+            res.forEach(row => {
+                // 是否标记
+                row['isEdit'] = false
+                // 是否新增
+                row['isAdd'] = false
+            })
+            ypClassData.value = res
+        })
+        .catch(() => {
+            ypClassData.value = []
+        })
+}
+
+// 查询药品字典-药品分类字典
+const queryDrugKind = () => {
+    selectDrugKind(text.value)
+        .then((res) => {
+            res.forEach(row => {
+                // 是否标记
+                row['isEdit'] = false
+                // 是否新增
+                row['isAdd'] = false
+            })
+            drugKindData.value = res
+        })
+        .catch(() => {
+            drugKindData.value = []
+        })
+}
+
+// 查询药房药品停用情况
+const flagFilter = ref('')
+const queryVisibleFlag = () => {
+    selectYpVisibleFlag(text.value, flagFilter.value)
+        .then((res) => {
+            res.forEach(row => {
+                // 是否标记
+                row['isEdit'] = false
+                // 是否新增
+                row['isAdd'] = false
+            })
+            visibleFlagData.value = res
+        })
+        .catch(() => {
+            visibleFlagData.value = []
+        })
+}
+
+// 查询
+const queryItem = () => {
+    if (editableTabsValue.value === 'ypClass') {
+        queryYpClass()
+    } else if (editableTabsValue.value === 'drugKind') {
+        queryDrugKind()
+    }
+}
+
+// 新增行
+const onAddItem = () => {
+    console.log('onAddItem')
+    centerDialogVisible.value = true
+    return
+    if (editableTabsValue.value === 'ypClass') {
+        let count
+        if (ypClassData.value.length % pageSizeClass.value === 0) {
+            count = Math.ceil(ypClassData.value.length / pageSizeClass.value) + 1
+        } else {
+            count = Math.ceil(ypClassData.value.length / pageSizeClass.value)
+        }
+        currentPageClass.value = count
+        ypClassData.value.push({
+            code: '',
+            name: '',
+            pyCode: '',
+            dcode: '',
+            delFlag: '',
+            isEdit: true,
+            isAdd: true,
+        })
+        const el = document.querySelector('.ypClassTable .el-scrollbar__wrap')
+        const el2 = document.querySelector('.ypClassTable .el-table__body tbody')
+        setTimeout(() => {
+            const height = el2.clientHeight - el.clientHeight
+            if (height > 0) {
+                el.scrollTop = height
+            }
+        }, 100)
+    } else if (editableTabsValue.value === 'drugKind') {
+        let count
+        if (drugKindData.value.length % pageSizeKind.value === 0) {
+            count = Math.ceil(drugKindData.value.length / pageSizeKind.value) + 1
+        } else {
+            count = Math.ceil(drugKindData.value.length / pageSizeKind.value)
+        }
+        currentPageKind.value = count
+        drugKindData.value.push({
+            code: '',
+            name: '',
+            pyCode: '',
+            dcode: '',
+            ypType: '',
+            mzBillCode: '',
+            zyBillCode: '',
+            isEdit: true,
+            isAdd: true,
+        })
+        const el = document.querySelector('.drugKindTable .el-scrollbar__wrap')
+        const el2 = document.querySelector('.drugKindTable .el-table__body tbody')
+        setTimeout(() => {
+            const height = el2.clientHeight - el.clientHeight
+            if (height > 0) {
+                el.scrollTop = height
+            }
+        }, 100)
+    }
+}
+
+// 药品字典-药性字典增删改存开始
+// 编辑
+const editYpClass = (row) => {
+    // 备份原始数据
+    row['oldRow'] = JSON.parse(JSON.stringify(row))
+    row.isEdit = true
+}
+// 取消
+const cancelYpClass = (row) => {
+    // 如果是新增的数据
+    if (row.isAdd) {
+        ypClassData.value.splice(ypClassData.value.length - 1, 1)
+    } else {
+        // 不是新增的数据  还原数据
+        for (const i in row.oldRow) {
+            row[i] = row.oldRow[i]
+        }
+    }
+}
+// 保存
+const updateYpClass = (row) => {
+    if (!row.code || !row.name) {
+        ElMessage({
+            type: "warning",
+            message: "药性字典编码或名称不存在,请检查!",
+            duration: 2500,
+            showClose: true,
+        });
+        return
+    }
+
+    if (row.isAdd) {
+        let fe = 0
+        for (let num in ypClassData.value) {
+            if (ypClassData.value[num].code === row.code) {
+                fe++
+            }
+        }
+        if (fe === 2) {
+            ElMessage({
+                type: "warning",
+                message: "存在重复的药性字典,请核对!",
+                duration: 2500,
+                showClose: true,
+            });
+        } else {
+            callSaveYpClass(row, null)
+        }
+
+    } else {
+        let oldCode = row.oldRow.code
+        if (oldCode !== row.code) {
+            ElMessageBox.confirm(msgTip, {
+                cancelButtonText: '取消',
+                confirmButtonText: '确定',
+                type: 'warning',
+                distinguishCancelAndClose: true,
+                dangerouslyUseHTMLString: true
+            }).then(() => {
+                callSaveYpClass(row, oldCode)
+            }).catch((action) => {
+                if (action === 'cancel') {
+                    queryYpClass()
+                }
+            })
+        } else {
+            callSaveYpClass(row, oldCode)
+        }
+    }
+}
+
+const callSaveYpClass = (row, oldCode) => {
+    let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        saveYpClass(row).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            if (oldCode !== null && oldCode !== row.code) {
+                // 删除原始数据
+                delYpClassByCode(oldCode).then((res) => {
+                    queryYpClass()
+                })
+            } else {
+                queryYpClass()
+            }
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryYpClass()
+        }
+    })
+}
+
+const deleteYpClass = (index, row) => {
+    let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        delYpClassByCode(row.code).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            queryYpClass()
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryYpClass()
+        }
+    })
+}
+
+const callSaveDrugKind = (row, oldCode) => {
+    let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        saveDrugKind(row).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            if (oldCode !== null && oldCode !== row.code) {
+                // 删除原始数据
+                delDrugKindByCode(oldCode).then((res) => {
+                    queryDrugKind()
+                })
+            } else {
+                queryDrugKind()
+            }
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryDrugKind()
+        }
+    })
+}
+
+const deleteDrugKind = (index, row) => {
+    let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        delDrugKindByCode(row.code).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            queryDrugKind()
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryDrugKind()
+        }
+    })
+}
+// 药品字典-药品分类字典增删改存结束
+
+// 药品字典-药品剂型字典增删改存开始
+// 编辑
+const editYpDosage = (row) => {
+    // 备份原始数据
+    row['oldRow'] = JSON.parse(JSON.stringify(row))
+    row.isEdit = true
+}
+// 取消
+const cancelYpDosage = (row) => {
+    // 如果是新增的数据
+    if (row.isAdd) {
+        ypDosageData.value.splice(ypDosageData.value.length - 1, 1)
+    } else {
+        // 不是新增的数据  还原数据
+        for (const i in row.oldRow) {
+            row[i] = row.oldRow[i]
+        }
+    }
+}
+// 保存
+const updateYpDosage = (row) => {
+    if (!row.code || !row.name) {
+        ElMessage({
+            type: "warning",
+            message: "药品剂型字典编码或名称不存在,请检查!",
+            duration: 2500,
+            showClose: true,
+        });
+        return
+    }
+
+    if (row.isAdd) {
+        let fe = 0
+        for (let num in ypDosageData.value) {
+            if (ypDosageData.value[num].code === row.code) {
+                fe++
+            }
+        }
+        if (fe === 2) {
+            ElMessage({
+                type: "warning",
+                message: "存在重复的药品剂型字典,请核对!",
+                duration: 2500,
+                showClose: true,
+            });
+        } else {
+            callSaveYpDosage(row, null)
+        }
+
+    } else {
+        let oldCode = row.oldRow.code
+        if (oldCode !== row.code) {
+            ElMessageBox.confirm(msgTip, {
+                cancelButtonText: '取消',
+                confirmButtonText: '确定',
+                type: 'warning',
+                distinguishCancelAndClose: true,
+                dangerouslyUseHTMLString: true
+            }).then(() => {
+                callSaveYpDosage(row, oldCode)
+            }).catch((action) => {
+                if (action === 'cancel') {
+                    queryYpDosage()
+                }
+            })
+        } else {
+            callSaveYpDosage(row, oldCode)
+        }
+    }
+}
+
+const callSaveYpDosage = (row, oldCode) => {
+    let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        saveYpDosage(row).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            if (oldCode !== null && oldCode !== row.code) {
+                // 删除原始数据
+                delYpDosageByCode(oldCode).then((res) => {
+                    queryYpDosage()
+                })
+            } else {
+                queryYpDosage()
+            }
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryYpDosage()
+        }
+    })
+}
+
+const deleteYpDosage = (index, row) => {
+    let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        delYpDosageByCode(row.code).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            queryYpDosage()
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryYpDosage()
+        }
+    })
+}
+// 药品字典-药品剂型字典增删改存结束
+
+// 药品字典-药品单位字典增删改存开始
+// 编辑
+const editYpUnit = (row) => {
+    // 备份原始数据
+    row['oldRow'] = JSON.parse(JSON.stringify(row))
+    row.isEdit = true
+}
+// 取消
+const cancelYpUnit = (row) => {
+    // 如果是新增的数据
+    if (row.isAdd) {
+        ypUnitData.value.splice(ypUnitData.value.length - 1, 1)
+    } else {
+        // 不是新增的数据  还原数据
+        for (const i in row.oldRow) {
+            row[i] = row.oldRow[i]
+        }
+    }
+}
+// 保存
+const updateYpUnit = (row) => {
+    if (!row.code || !row.name) {
+        ElMessage({
+            type: "warning",
+            message: "药品单位字典编码或名称不存在,请检查!",
+            duration: 2500,
+            showClose: true,
+        });
+        return
+    }
+
+    if (row.isAdd) {
+        let fe = 0
+        for (let num in ypUnitData.value) {
+            if (ypUnitData.value[num].code === row.code) {
+                fe++
+            }
+        }
+        if (fe === 2) {
+            ElMessage({
+                type: "warning",
+                message: "存在重复的药品单位字典,请核对!",
+                duration: 2500,
+                showClose: true,
+            });
+        } else {
+            callSaveYpUnit(row, null)
+        }
+    } else {
+        let oldCode = row.oldRow.code
+        if (oldCode !== row.code) {
+            ElMessageBox.confirm(msgTip, {
+                cancelButtonText: '取消',
+                confirmButtonText: '确定',
+                type: 'warning',
+                distinguishCancelAndClose: true,
+                dangerouslyUseHTMLString: true
+            }).then(() => {
+                callSaveYpUnit(row, oldCode)
+            }).catch((action) => {
+                if (action === 'cancel') {
+                    queryYpUnit()
+                }
+            })
+        } else {
+            callSaveYpUnit(row, oldCode)
+        }
+    }
+}
+
+const callSaveYpUnit = (row, oldCode) => {
+    let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        saveYpUnit(row).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            // 若修改了主键code,则需要删除原来的记录
+            if (oldCode !== null && oldCode !== row.code) {
+                // 删除原始数据
+                delYpUnitByCode(oldCode).then((res) => {
+                    queryYpUnit()
+                })
+            } else {
+                queryYpUnit()
+            }
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryYpUnit()
+        }
+    })
+}
+
+const deleteYpUnit = (index, row) => {
+    let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        delYpUnitByCode(row.code).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            queryYpUnit()
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryYpUnit()
+        }
+    })
+}
+// 药品字典-药品单位字典增删改存结束
+
+// 药品字典-药品费别字典增删改存开始
+// 编辑
+const editYpChargeGroup = (row) => {
+    // 备份原始数据
+    row['oldRow'] = JSON.parse(JSON.stringify(row))
+    row.isEdit = true
+}
+// 取消
+const cancelYpChargeGroup = (row, index) => {
+    // 如果是新增的数据
+    if (row.isAdd) {
+        ypChargeGroupData.value.splice(index, 1)
+    } else {
+        // 不是新增的数据  还原数据
+        for (const i in row.oldRow) {
+            row[i] = row.oldRow[i]
+        }
+    }
+}
+// 保存
+const updateYpChargeGroup = (row) => {
+    if (!row.code || !row.name) {
+        ElMessage({
+            type: "warning",
+            message: "药品费别字典编码或名称不存在,请检查!",
+            duration: 2500,
+            showClose: true,
+        });
+        return
+    }
+
+    if (row.isAdd) {
+        let fe = 0
+        for (let num in ypChargeGroupData.value) {
+            if (ypChargeGroupData.value[num].code === row.code) {
+                fe++
+            }
+        }
+        if (fe === 2) {
+            ElMessage({
+                type: "warning",
+                message: "存在重复的药品费别字典,请核对!",
+                duration: 2500,
+                showClose: true,
+            });
+        } else {
+            callSaveYpChargeGroup(row, null)
+        }
+
+    } else {
+        let oldCode = row.oldRow.code
+        if (oldCode !== row.code) {
+            ElMessageBox.confirm(msgTip, {
+                cancelButtonText: '取消',
+                confirmButtonText: '确定',
+                type: 'warning',
+                distinguishCancelAndClose: true,
+                dangerouslyUseHTMLString: true
+            }).then(() => {
+                callSaveYpChargeGroup(row, oldCode)
+            }).catch((action) => {
+                if (action === 'cancel') {
+                    queryYpChargeGroup()
+                }
+            })
+        } else {
+            callSaveYpChargeGroup(row, oldCode)
+        }
+    }
+}
+
+const callSaveYpChargeGroup = (row, oldCode) => {
+    let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        saveYpChargeGroup(row).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            if (oldCode !== null && oldCode !== row.code) {
+                // 删除原始数据
+                delYpChargeGroupByCode(oldCode).then((res) => {
+                    queryYpChargeGroup()
+                })
+            } else {
+                queryYpChargeGroup()
+            }
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryYpChargeGroup()
+        }
+    })
+}
+
+const deleteYpChargeGroup = (index, row) => {
+    let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        delYpChargeGroupByCode(row.code).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            queryYpChargeGroup()
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryYpChargeGroup()
+        }
+    })
+}
+// 药品字典-药品费别字典增删改存结束
+
+// 药房药品住院停用增删改存开始
+// 编辑
+const editVisibleFlag = (row) => {
+    // 备份原始数据
+    row['oldRow'] = JSON.parse(JSON.stringify(row))
+    row.isEdit = true
+}
+// 取消
+const cancelVisibleFlag = (row, index) => {
+    // 如果是新增的数据
+    if (row.isAdd) {
+        visibleFlagData.value.splice(index, 1)
+    } else {
+        // 不是新增的数据  还原数据
+        for (const i in row.oldRow) {
+            row[i] = row.oldRow[i]
+        }
+    }
+}
+// 保存
+const updateVisibleFlag = (row) => {
+    if (!row.chargeCode || !row.groupNo) {
+        ElMessage({
+            type: "warning",
+            message: "药房药品停用的药品编码或药房编码不存在,请检查!",
+            duration: 2500,
+            showClose: true,
+        });
+        return
+    }
+
+    if (row.isAdd) {
+        ElMessage({
+            type: "warning",
+            message: "不能新增药房药品停用,需先维护药品信息!",
+            duration: 2500,
+            showClose: true,
+        });
+    } else {
+        callSaveVisibleFlag(row)
+    }
+}
+
+const callSaveVisibleFlag = (row) => {
+    let title = '请确认是否保存<span style="color:#d12020;">' + row.drug + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        updateYpVisibleFlag(row).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            queryVisibleFlag()
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryVisibleFlag()
+        }
+    })
+}
+// 药房药品住院停用增删改存结束
+
+// 药品字典-药品供应商字典增删改存开始
+// 编辑
+const editYpSupply = (row) => {
+    // 备份原始数据
+    row['oldRow'] = JSON.parse(JSON.stringify(row))
+    row.isEdit = true
+}
+
+// 取消
+const cancelYpSupply = (row, index) => {
+    // 如果是新增的数据
+    if (row.isAdd) {
+        ypSupplyData.value.splice(ypSupplyData.value.length - 1, 1)
+    } else {
+        // 不是新增的数据  还原数据
+        for (const i in row.oldRow) {
+            row[i] = row.oldRow[i]
+        }
+    }
+}
+// 保存
+const updateYpSupply = (row) => {
+    if (!row.code || !row.name) {
+        ElMessage({
+            type: "warning",
+            message: "药品供应商字典编码或名称不存在,请检查!",
+            duration: 2500,
+            showClose: true,
+        });
+        return
+    }
+
+    if (row.isAdd) {
+        let fe = 0
+        for (let num in ypSupplyData.value) {
+            if (ypSupplyData.value[num].code === row.code) {
+                fe++
+            }
+        }
+        if (fe === 2) {
+            ElMessage({
+                type: "warning",
+                message: "存在重复的药品供应商字典,请核对!",
+                duration: 2500,
+                showClose: true,
+            });
+        } else {
+            callSaveYpSupply(row, null)
+        }
+
+    } else {
+        let oldCode = row.oldRow.code
+        if (oldCode !== row.code) {
+            ElMessageBox.confirm(msgTip, {
+                cancelButtonText: '取消',
+                confirmButtonText: '确定',
+                type: 'warning',
+                distinguishCancelAndClose: true,
+                dangerouslyUseHTMLString: true
+            }).then(() => {
+                callSaveYpSupply(row, oldCode)
+            }).catch((action) => {
+                if (action === 'cancel') {
+                    queryYpSupply()
+                }
+            })
+        } else {
+            callSaveYpSupply(row, oldCode)
+        }
+    }
+}
+
+const callSaveYpSupply = (row, oldCode) => {
+    let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        saveYpSupply(row).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            if (oldCode !== null && oldCode !== row.code) {
+                // 删除原始数据
+                delYpSupplyByCode(oldCode).then((res) => {
+                    queryYpSupply()
+                })
+            } else {
+                queryYpSupply()
+            }
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryYpSupply()
+        }
+    })
+}
+
+const deleteYpSupply = (index, row) => {
+    let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        delYpSupplyByCode(row.code).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            queryYpSupply()
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryYpSupply()
+        }
+    })
+}
+// 药品字典-药品供应商字典增删改存结束
+
+// 药品字典-生产厂家字典增删改存开始
+// 编辑
+const editYpManuFactory = (row) => {
+    // 备份原始数据
+    row['oldRow'] = JSON.parse(JSON.stringify(row))
+    row.isEdit = true
+}
+
+// 取消
+const cancelYpManuFactory = (row) => {
+    // 如果是新增的数据
+    if (row.isAdd) {
+        ypManuFactoryData.value.splice(ypManuFactoryData.value.length - 1, 1)
+    } else {
+        // 不是新增的数据  还原数据
+        for (const i in row.oldRow) {
+            row[i] = row.oldRow[i]
+        }
+    }
+}
+// 保存
+const updateYpManuFactory = (row) => {
+    if (!row.code || !row.name) {
+        ElMessage({
+            type: "warning",
+            message: "生产厂家字典编码或名称不存在,请检查!",
+            duration: 2500,
+            showClose: true,
+        });
+        return
+    }
+
+    if (row.isAdd) {
+        let fe = 0
+        for (let num in ypManuFactoryData.value) {
+            if (ypManuFactoryData.value[num].code === row.code) {
+                fe++
+            }
+        }
+        if (fe === 2) {
+            ElMessage({
+                type: "warning",
+                message: "存在重复的生产厂家字典,请核对!",
+                duration: 2500,
+                showClose: true,
+            });
+        } else {
+            callSaveYpManuFactory(row, null)
+        }
+
+    } else {
+        let oldCode = row.oldRow.code
+        if (oldCode !== row.code) {
+            ElMessageBox.confirm(msgTip, {
+                cancelButtonText: '取消',
+                confirmButtonText: '确定',
+                type: 'warning',
+                distinguishCancelAndClose: true,
+                dangerouslyUseHTMLString: true
+            }).then(() => {
+                callSaveYpManuFactory(row, oldCode)
+            }).catch((action) => {
+                if (action === 'cancel') {
+                    queryYpManuFactory()
+                }
+            })
+        } else {
+            callSaveYpManuFactory(row, oldCode)
+        }
+    }
+}
+
+const callSaveYpManuFactory = (row, oldCode) => {
+    let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        saveYpManuFactory(row).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            if (oldCode !== null && oldCode !== row.code) {
+                // 删除原始数据
+                delYpManuFactoryByCode(oldCode).then((res) => {
+                    queryYpManuFactory()
+                })
+            } else {
+                queryYpManuFactory()
+            }
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryYpManuFactory()
+        }
+    })
+}
+
+const deleteYpManuFactory = (index, row) => {
+    let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        delYpManuFactoryByCode(row.code).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            queryYpManuFactory()
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryYpManuFactory()
+        }
+    })
+}
+// 药品字典-生产厂家字典增删改存结束
+
+const exportData = () => {
+    alert("功能建设中。。。")
+}
+
+const handleClick = (tab, event) => {
+    // 查询哪个tab页面
+    editableTabsValue.value = tab.props.name
+    if (editableTabsValue.value === 'ypClass') {
+        currentTabLabel.value = '供应商'
+        queryYpClass()
+        currentPageClass.value = 1
+    } else if (editableTabsValue.value === 'drugKind') {
+        currentTabLabel.value = '生产厂家'
+        queryDrugKind()
+        currentPageKind.value = 1
+    } else if (editableTabsValue.value === 'ypDosage') {
+        queryYpDosage()
+        currentPageDosage.value = 1
+    } else if (editableTabsValue.value === 'ypUnit') {
+        queryYpUnit()
+        currentPageUnit.value = 1
+    } else if (editableTabsValue.value === 'ypChargeGroup') {
+        queryYpChargeGroup()
+    } else if (editableTabsValue.value === 'visibleFlag') {
+        queryVisibleFlag()
+        currentPage.value = 1
+    } else if (editableTabsValue.value === 'ypSupply') {
+        queryYpSupply()
+        currentPageSupply.value = 1
+    } else if (editableTabsValue.value === 'ypManuFactory') {
+        queryYpManuFactory()
+        currentPageManuFactory.value = 1
+    }
+}
+
+const tableRowClassName = ({
+    row,
+    rowIndex,
+}) => {
+    if (row.delFlag === '1') {
+        return 'warning-row'
+    }
+}
+
+</script>
+<style lang="scss" deep>
+.el-dialog__body {
+    padding: 0 16px;
+    height: calc(100% - 25px);
+}
+
+.el-tabs {
+    height: calc(100% - 27px);
+
+    .el-tabs__content {
+        padding: 5px;
+        height: calc(100% - 27px);
+    }
+
+    .el-tab-pane {
+        height: calc(100% - 27px);
+        overflow: auto;
+    }
+
+    .el-table__inner-wrapper {
+        height: calc(100% - 10px) !important;
+    }
+
+}
+
+.el-table .warning-row {
+    --el-table-tr-bg-color: #dd7694;
+}
+</style>

+ 1671 - 0
src/views/logisticsMaterials/logisticsBasicData/projectInformation.vue

@@ -0,0 +1,1671 @@
+<template>
+    <div class="layout_display_flex_y">
+        <div class="obviousBox" style="margin-bottom: 6px;">
+            <searchArea :searchData="searchData" @submit="searchByForm"></searchArea>
+        </div>
+
+        <div class="layout_display_flex_y">
+            <div style="background-color: #fff;padding: 8px">
+                <!-- <el-button type="primary" icon="Search" @click="queryItem" style="margin-left: 5px">查询</el-button> -->
+                <el-button type="primary" icon="Plus" @click="onAddItem" style="margin-left: 5px">新增</el-button>
+                <!-- <el-button type="primary" icon="Download" @click="exportData" style="margin-left: 5px">导出</el-button> -->
+            </div>
+            <el-table
+                :data="ypClassData.slice(pageSizeClass * (currentPageClass - 1), pageSizeClass * currentPageClass)"
+                border style="width: 100%" height="100%" stripe highlight-current-row class="ypClassTable normal-size">
+                <el-table-column prop="code" label="供应商编码" width="80">
+                    <template v-slot="scope">
+                        <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.code"></el-input>
+                        <span v-else>{{ scope.row.code }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="name" label="供应商名称" width="200">
+                    <template v-slot="scope">
+                        <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.name"></el-input>
+                        <span v-else>{{ scope.row.name }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="pyCode" label="拼音码" width="140" />
+                <el-table-column prop="dcode" label="五笔码" width="140" />
+                <el-table-column prop="name" label="厂商类型" width="200">
+                    <template v-slot="scope">
+                        <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.name"></el-input>
+                        <span v-else>{{ scope.row.name }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="name" label="地址" width="200">
+                    <template v-slot="scope">
+                        <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.name"></el-input>
+                        <span v-else>{{ scope.row.name }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="name" label="电话" width="140">
+                    <template v-slot="scope">
+                        <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.name"></el-input>
+                        <span v-else>{{ scope.row.name }}</span>
+                    </template>
+                </el-table-column>
+                =<el-table-column prop="name" label="账号" width="140">
+                    <template v-slot="scope">
+                        <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.name"></el-input>
+                        <span v-else>{{ scope.row.name }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="name" label="开户银行" width="140">
+                    <template v-slot="scope">
+                        <el-input v-if="scope.row.isEdit" size="small" v-model="scope.row.name"></el-input>
+                        <span v-else>{{ scope.row.name }}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column prop="delFlag" label="是否停用" width="100">
+                    <template v-slot="scope">
+                        <div v-if="scope.row.isEdit">
+                            <el-select v-model="scope.row.delFlag" clearable placeholder="请选择是否停用">
+                                <el-option v-for="option in delFlagOptions" :key="option.code" :label="option.name"
+                                    :value="option.code"></el-option>
+                            </el-select>
+                        </div>
+                        <div v-else>
+                            <el-select v-model="scope.row.delFlag" disabled placeholder="请选择是否无效">
+                                <el-option v-for="option in delFlagOptions" :key="option.code" :label="option.name"
+                                    :value="option.code"></el-option>
+                            </el-select>
+                        </div>
+                    </template>
+                </el-table-column>
+                <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="editYpClass(scope.row)">编辑</el-button>
+                        <el-button type="primary" size="small" v-if="scope.row.isEdit"
+                            @click="updateYpClass(scope.row)">保存</el-button>
+                        <el-button type="primary" size="small" v-if="scope.row.isEdit"
+                            @click="cancelYpClass(scope.row)">取消
+                        </el-button>
+                        <el-button type="danger" size="small" @click.prevent="deleteYpClass(scope.$index, scope.row)">
+                            删除
+                        </el-button>
+                        <el-button type="success" size="small" v-if="!scope.row.isEdit && scope.row.delFlag === '1'"
+                            @click.prevent="deleteYpClass(scope.$index, scope.row)">
+                            启用
+                        </el-button>
+                        <el-button type="info" size="small" v-if="!scope.row.isEdit && scope.row.delFlag === '0'"
+                            @click.prevent="deleteYpClass(scope.$index, scope.row)">
+                            停用
+                        </el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+        </div>
+        <div>
+            <el-pagination :current-page="currentPageClass" :page-size="pageSizeClass" :page-sizes="[10, 15, 20, 25]"
+                :total="ypClassData.length" layout="total, sizes, prev, pager, next, jumper" style="margin-top: 5px"
+                @size-change="handleSizeChangeClass" @current-change="handleCurrentChangeClass">
+            </el-pagination>
+        </div>
+    </div>
+</template>
+<script setup name="YpDict">
+import { ref, onMounted, nextTick } from 'vue'
+import { ElMessage, ElMessageBox } from 'element-plus'
+import {
+    selectYpClass, saveYpClass, delYpClassByCode,
+    selectDrugKind, saveDrugKind, delDrugKindByCode,
+    selectYpDosage, saveYpDosage, delYpDosageByCode,
+    selectYpUnit, saveYpUnit, delYpUnitByCode,
+    selectYpChargeGroup, saveYpChargeGroup, delYpChargeGroupByCode,
+    selectYpVisibleFlag, updateYpVisibleFlag,
+    selectYpSupply, saveYpSupply, delYpSupplyByCode,
+    selectYpManuFactory, saveYpManuFactory, delYpManuFactoryByCode
+} from '@/api/yp-dict/yp-dict-base.js'
+import searchArea from '@/components/searchArea/index.vue';
+
+const editableTabsValue = ref('ypClass')
+const msgTip = '分类编码(code)有变更,原始字典记录存在关联,请谨慎做更改,是否确认!!!'
+const delFlagOptions = [{ code: '0', name: '启用' }, { code: '1', name: '停用' }]
+const ypTypeOptions = [{ code: '1', name: '西药' }, { code: '2', name: '成药' }, { code: '3', name: '草药' }, { code: '4', name: '卫生材料' }]
+const refundableFeesOptions = [{ code: '0', name: '否' }, { code: '1', name: '是' }]
+const visibleFlagOptions = [{ code: '0', name: '正常' }, { code: '1', name: '停用' }]
+const yesOptions = [{ code: '0', name: '否' }, { code: '1', name: '是' }]
+
+const searchData = ref([
+    {
+        label: '项目编码',
+        key: 'vehicleName',
+        type: 'input',
+        value: '',
+        clearable: true,
+    },
+    {
+        label: '项目名称',
+        key: 'licensePlate',
+        type: 'input',
+        value: '',
+        clearable: true
+    },
+    {
+        label: '项目类型',
+        key: 'vehicleType',
+        type: 'select',
+        value: '',
+        optionsData: [ //(0:轿车,1:面包车,2:越野车,3:吉普车,4:巴士,5:卡车)
+            {
+                label: '轿车',
+                value: '0',
+            },
+            {
+                label: '面包车',
+                value: '1',
+            },
+        ],
+    },
+    {
+        label: '是否停用',
+        key: 'vehicleType',
+        type: 'select',
+        value: '',
+        optionsData: [ //(0:轿车,1:面包车,2:越野车,3:吉普车,4:巴士,5:卡车)
+            {
+                label: '轿车',
+                value: '0',
+            },
+            {
+                label: '面包车',
+                value: '1',
+            },
+        ],
+    },
+])
+const pageSizeClass = ref(20)
+const currentPageClass = ref(1)
+const handleSizeChangeClass = (val) => {
+    pageSizeClass.value = val
+}
+const handleCurrentChangeClass = (val) => {
+    currentPageClass.value = val
+}
+
+const pageSizeKind = ref(20)
+const currentPageKind = ref(1)
+const handleSizeChangeKind = (val) => {
+    pageSizeKind.value = val
+}
+const handleCurrentChangeKind = (val) => {
+    currentPageKind.value = val
+}
+
+const pageSizeDosage = ref(20)
+const currentPageDosage = ref(1)
+const handleSizeChangeDosage = (val) => {
+    pageSizeDosage.value = val
+}
+const handleCurrentChangeDosage = (val) => {
+    currentPageDosage.value = val
+}
+
+const pageSizeUnit = ref(20)
+const currentPageUnit = ref(1)
+const handleSizeChangeUnit = (val) => {
+    pageSizeUnit.value = val
+}
+const handleCurrentChangeUnit = (val) => {
+    currentPageUnit.value = val
+}
+
+const pageSize = ref(20)
+const currentPage = ref(1)
+const handleSizeChange = (val) => {
+    pageSize.value = val
+}
+const handleCurrentChange = (val) => {
+    currentPage.value = val
+}
+
+const pageSizeSupply = ref(20)
+const currentPageSupply = ref(1)
+const handleSizeChangeSupply = (val) => {
+    pageSizeSupply.value = val
+}
+const handleCurrentChangeSupply = (val) => {
+    currentPageSupply.value = val
+}
+
+const pageSizeManuFactory = ref(20)
+const currentPageManuFactory = ref(1)
+const handleSizeChangeManuFactory = (val) => {
+    pageSizeManuFactory.value = val
+}
+const handleCurrentChangeManuFactory = (val) => {
+    currentPageManuFactory.value = val
+}
+
+const ypClassData = ref([])
+const drugKindData = ref([])
+const ypDosageData = ref([])
+const ypUnitData = ref([])
+const ypChargeGroupData = ref([])
+const visibleFlagData = ref([])
+const ypSupplyData = ref([])
+const ypManuFactoryData = ref([])
+
+const text = ref('')
+onMounted(() => {
+    nextTick(() => {
+        queryYpClass()
+    })
+})
+
+//搜索表单方法
+const searchByForm = (form) => {
+    console.log("search", form)
+}
+
+// 查询药品字典-药性字典
+const queryYpClass = () => {
+    selectYpClass(text.value)
+        .then((res) => {
+            res.forEach(row => {
+                // 是否标记
+                row['isEdit'] = false
+                // 是否新增
+                row['isAdd'] = false
+            })
+            ypClassData.value = res
+        })
+        .catch(() => {
+            ypClassData.value = []
+        })
+}
+
+// 查询药品字典-药品分类字典
+const queryDrugKind = () => {
+    selectDrugKind(text.value)
+        .then((res) => {
+            res.forEach(row => {
+                // 是否标记
+                row['isEdit'] = false
+                // 是否新增
+                row['isAdd'] = false
+            })
+            drugKindData.value = res
+        })
+        .catch(() => {
+            drugKindData.value = []
+        })
+}
+
+// 查询药品字典-药品剂型字典
+const queryYpDosage = () => {
+    selectYpDosage(text.value)
+        .then((res) => {
+            res.forEach(row => {
+                // 是否标记
+                row['isEdit'] = false
+                // 是否新增
+                row['isAdd'] = false
+            })
+            ypDosageData.value = res
+        })
+        .catch(() => {
+            ypDosageData.value = []
+        })
+}
+
+// 查询药品字典-药品单位字典
+const queryYpUnit = () => {
+    selectYpUnit(text.value)
+        .then((res) => {
+            res.forEach(row => {
+                // 是否标记
+                row['isEdit'] = false
+                // 是否新增
+                row['isAdd'] = false
+            })
+            ypUnitData.value = res
+        })
+        .catch(() => {
+            ypUnitData.value = []
+        })
+}
+
+// 查询药品字典-药品费别字典
+const queryYpChargeGroup = () => {
+    selectYpChargeGroup(text.value)
+        .then((res) => {
+            res.forEach(row => {
+                // 是否标记
+                row['isEdit'] = false
+                // 是否新增
+                row['isAdd'] = false
+            })
+            ypChargeGroupData.value = res
+        })
+        .catch(() => {
+            ypChargeGroupData.value = []
+        })
+}
+
+// 查询药房药品停用情况
+const flagFilter = ref('')
+const queryVisibleFlag = () => {
+    selectYpVisibleFlag(text.value, flagFilter.value)
+        .then((res) => {
+            res.forEach(row => {
+                // 是否标记
+                row['isEdit'] = false
+                // 是否新增
+                row['isAdd'] = false
+            })
+            visibleFlagData.value = res
+        })
+        .catch(() => {
+            visibleFlagData.value = []
+        })
+}
+
+// 查询药品字典-药品厂家字典
+const queryYpSupply = () => {
+    selectYpSupply(text.value)
+        .then((res) => {
+            res.forEach(row => {
+                // 是否标记
+                row['isEdit'] = false
+                // 是否新增
+                row['isAdd'] = false
+            })
+            ypSupplyData.value = res
+        })
+        .catch(() => {
+            ypSupplyData.value = []
+        })
+}
+
+// 查询药品字典-药品供应商字典
+const queryYpManuFactory = () => {
+    selectYpManuFactory(text.value)
+        .then((res) => {
+            res.forEach(row => {
+                // 是否标记
+                row['isEdit'] = false
+                // 是否新增
+                row['isAdd'] = false
+            })
+            ypManuFactoryData.value = res
+        })
+        .catch(() => {
+            ypManuFactoryData.value = []
+        })
+}
+
+// 查询
+const queryItem = () => {
+    if (editableTabsValue.value === 'ypClass') {
+        queryYpClass()
+    } else if (editableTabsValue.value === 'drugKind') {
+        queryDrugKind()
+    } else if (editableTabsValue.value === 'ypDosage') {
+        queryYpDosage()
+    } else if (editableTabsValue.value === 'ypUnit') {
+        queryYpUnit()
+    } else if (editableTabsValue.value === 'ypChargeGroup') {
+        queryYpChargeGroup()
+    } else if (editableTabsValue.value === 'visibleFlag') {
+        queryVisibleFlag()
+    } else if (editableTabsValue.value === 'ypSupply') {
+        queryYpSupply()
+    } else if (editableTabsValue.value === 'ypManuFactory') {
+        queryYpManuFactory()
+    }
+}
+
+// 新增行
+const onAddItem = () => {
+    if (editableTabsValue.value === 'ypClass') {
+        let count
+        if (ypClassData.value.length % pageSizeClass.value === 0) {
+            count = Math.ceil(ypClassData.value.length / pageSizeClass.value) + 1
+        } else {
+            count = Math.ceil(ypClassData.value.length / pageSizeClass.value)
+        }
+        currentPageClass.value = count
+        ypClassData.value.push({
+            code: '',
+            name: '',
+            pyCode: '',
+            dcode: '',
+            delFlag: '',
+            isEdit: true,
+            isAdd: true,
+        })
+        const el = document.querySelector('.ypClassTable .el-scrollbar__wrap')
+        const el2 = document.querySelector('.ypClassTable .el-table__body tbody')
+        setTimeout(() => {
+            const height = el2.clientHeight - el.clientHeight
+            if (height > 0) {
+                el.scrollTop = height
+            }
+        }, 100)
+    } else if (editableTabsValue.value === 'drugKind') {
+        let count
+        if (drugKindData.value.length % pageSizeKind.value === 0) {
+            count = Math.ceil(drugKindData.value.length / pageSizeKind.value) + 1
+        } else {
+            count = Math.ceil(drugKindData.value.length / pageSizeKind.value)
+        }
+        currentPageKind.value = count
+        drugKindData.value.push({
+            code: '',
+            name: '',
+            pyCode: '',
+            dcode: '',
+            ypType: '',
+            mzBillCode: '',
+            zyBillCode: '',
+            isEdit: true,
+            isAdd: true,
+        })
+        const el = document.querySelector('.drugKindTable .el-scrollbar__wrap')
+        const el2 = document.querySelector('.drugKindTable .el-table__body tbody')
+        setTimeout(() => {
+            const height = el2.clientHeight - el.clientHeight
+            if (height > 0) {
+                el.scrollTop = height
+            }
+        }, 100)
+    } else if (editableTabsValue.value === 'ypDosage') {
+        let count
+        if (ypDosageData.value.length % pageSizeDosage.value === 0) {
+            count = Math.ceil(ypDosageData.value.length / pageSizeDosage.value) + 1
+        } else {
+            count = Math.ceil(ypDosageData.value.length / pageSizeDosage.value)
+        }
+        currentPageDosage.value = count
+        ypDosageData.value.push({
+            code: '',
+            name: '',
+            pyCode: '',
+            dcode: '',
+            dosaType: '',
+            dosaRemark: '',
+            orderNo: '',
+            delFlag: '',
+            ybCode: '',
+            hnsybCode: '',
+            isEdit: true,
+            isAdd: true,
+        })
+        const el = document.querySelector('.ypDosageTable .el-scrollbar__wrap')
+        const el2 = document.querySelector('.ypDosageTable .el-table__body tbody')
+        setTimeout(() => {
+            const height = el2.clientHeight - el.clientHeight
+            if (height > 0) {
+                el.scrollTop = height
+            }
+        }, 100)
+    } else if (editableTabsValue.value === 'ypUnit') {
+        let count
+        if (ypUnitData.value.length % pageSizeUnit.value === 0) {
+            count = Math.ceil(ypUnitData.value.length / pageSizeUnit.value) + 1
+        } else {
+            count = Math.ceil(ypUnitData.value.length / pageSizeUnit.value)
+        }
+        currentPageUnit.value = count
+        ypUnitData.value.push({
+            code: '',
+            name: '',
+            pyCode: '',
+            dcode: '',
+            orderNo: '',
+            delFlag: '',
+            refundableFees: '',
+            isEdit: true,
+            isAdd: true,
+        })
+        const el = document.querySelector('.ypUnitTable .el-scrollbar__wrap')
+        const el2 = document.querySelector('.ypUnitTable .el-table__body tbody')
+        setTimeout(() => {
+            const height = el2.clientHeight - el.clientHeight
+            if (height > 0) {
+                el.scrollTop = height
+            }
+        }, 100)
+    } else if (editableTabsValue.value === 'ypChargeGroup') {
+        ypChargeGroupData.value.push({
+            code: '',
+            name: '',
+            pyCode: '',
+            dcode: '',
+            delFlag: '',
+            isEdit: true,
+            isAdd: true,
+        })
+    } else if (editableTabsValue.value === 'visibleFlag') {
+        ElMessage({
+            type: "warning",
+            message: "不能新增药房药品停用,需先维护药品信息!",
+            duration: 2500,
+            showClose: true,
+        });
+    } else if (editableTabsValue.value === 'ypSupply') {
+        let count
+        if (ypSupplyData.value.length % pageSizeSupply.value === 0) {
+            count = Math.ceil(ypSupplyData.value.length / pageSizeSupply.value) + 1
+        } else {
+            count = Math.ceil(ypSupplyData.value.length / pageSizeSupply.value)
+        }
+        currentPageSupply.value = count
+        ypSupplyData.value.push({
+            code: '',
+            name: '',
+            abbrName: '',
+            address: '',
+            zipCode: '',
+            telNo: '',
+            relName: '',
+            busiRange: '',
+            comment: '',
+            useFlag: '',
+            pyCode: '',
+            dcode: '',
+            delFlag: '',
+            isEdit: true,
+            isAdd: true,
+        })
+        const el = document.querySelector('.ypSupplyTable .el-scrollbar__wrap')
+        const el2 = document.querySelector('.ypSupplyTable .el-table__body tbody')
+        setTimeout(() => {
+            const height = el2.clientHeight - el.clientHeight
+            if (height > 0) {
+                el.scrollTop = height
+            }
+        }, 100)
+    } else if (editableTabsValue.value === 'ypManuFactory') {
+        let count
+        if (ypManuFactoryData.value.length % pageSizeManuFactory.value === 0) {
+            count = Math.ceil(ypManuFactoryData.value.length / pageSizeManuFactory.value) + 1
+        } else {
+            count = Math.ceil(ypManuFactoryData.value.length / pageSizeManuFactory.value)
+        }
+        currentPageManuFactory.value = count
+        ypManuFactoryData.value.push({
+            code: '',
+            name: '',
+            abbrName: '',
+            address: '',
+            zipCode: '',
+            telNo: '',
+            relName: '',
+            productRange: '',
+            comment: '',
+            useFlag: '',
+            pyCode: '',
+            dcode: '',
+            delFlag: '',
+            isEdit: true,
+            isAdd: true,
+        })
+        const el = document.querySelector('.ypManuFactoryTable .el-scrollbar__wrap')
+        const el2 = document.querySelector('.ypManuFactoryTable .el-table__body tbody')
+        setTimeout(() => {
+            const height = el2.clientHeight - el.clientHeight
+            if (height > 0) {
+                el.scrollTop = height
+            }
+        }, 100)
+    }
+}
+
+// 药品字典-药性字典增删改存开始
+// 编辑
+const editYpClass = (row) => {
+    // 备份原始数据
+    row['oldRow'] = JSON.parse(JSON.stringify(row))
+    row.isEdit = true
+}
+// 取消
+const cancelYpClass = (row) => {
+    // 如果是新增的数据
+    if (row.isAdd) {
+        ypClassData.value.splice(ypClassData.value.length - 1, 1)
+    } else {
+        // 不是新增的数据  还原数据
+        for (const i in row.oldRow) {
+            row[i] = row.oldRow[i]
+        }
+    }
+}
+// 保存
+const updateYpClass = (row) => {
+    if (!row.code || !row.name) {
+        ElMessage({
+            type: "warning",
+            message: "药性字典编码或名称不存在,请检查!",
+            duration: 2500,
+            showClose: true,
+        });
+        return
+    }
+
+    if (row.isAdd) {
+        let fe = 0
+        for (let num in ypClassData.value) {
+            if (ypClassData.value[num].code === row.code) {
+                fe++
+            }
+        }
+        if (fe === 2) {
+            ElMessage({
+                type: "warning",
+                message: "存在重复的药性字典,请核对!",
+                duration: 2500,
+                showClose: true,
+            });
+        } else {
+            callSaveYpClass(row, null)
+        }
+
+    } else {
+        let oldCode = row.oldRow.code
+        if (oldCode !== row.code) {
+            ElMessageBox.confirm(msgTip, {
+                cancelButtonText: '取消',
+                confirmButtonText: '确定',
+                type: 'warning',
+                distinguishCancelAndClose: true,
+                dangerouslyUseHTMLString: true
+            }).then(() => {
+                callSaveYpClass(row, oldCode)
+            }).catch((action) => {
+                if (action === 'cancel') {
+                    queryYpClass()
+                }
+            })
+        } else {
+            callSaveYpClass(row, oldCode)
+        }
+    }
+}
+
+const callSaveYpClass = (row, oldCode) => {
+    let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        saveYpClass(row).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            if (oldCode !== null && oldCode !== row.code) {
+                // 删除原始数据
+                delYpClassByCode(oldCode).then((res) => {
+                    queryYpClass()
+                })
+            } else {
+                queryYpClass()
+            }
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryYpClass()
+        }
+    })
+}
+
+const deleteYpClass = (index, row) => {
+    let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        delYpClassByCode(row.code).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            queryYpClass()
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryYpClass()
+        }
+    })
+}
+// 药品字典-药性字典增删改存结束
+
+// 药品字典-药品分类字典增删改存开始
+// 编辑
+const editDrugKind = (row) => {
+    // 备份原始数据
+    row['oldRow'] = JSON.parse(JSON.stringify(row))
+    row.isEdit = true
+}
+// 取消
+const cancelDrugKind = (row) => {
+    // 如果是新增的数据
+    if (row.isAdd) {
+        drugKindData.value.splice(drugKindData.value.length - 1, 1)
+    } else {
+        // 不是新增的数据  还原数据
+        for (const i in row.oldRow) {
+            row[i] = row.oldRow[i]
+        }
+    }
+}
+// 保存
+const updateDrugKind = (row) => {
+    if (!row.code || !row.name) {
+        ElMessage({
+            type: "warning",
+            message: "药品分类字典编码或名称不存在,请检查!",
+            duration: 2500,
+            showClose: true,
+        });
+        return
+    }
+
+    if (row.isAdd) {
+        let fe = 0
+        for (let num in drugKindData.value) {
+            if (drugKindData.value[num].code === row.code) {
+                fe++
+            }
+        }
+        if (fe === 2) {
+            ElMessage({
+                type: "warning",
+                message: "存在重复的药品分类字典,请核对!",
+                duration: 2500,
+                showClose: true,
+            });
+        } else {
+            callSaveDrugKind(row, null)
+        }
+
+    } else {
+        let oldCode = row.oldRow.code
+        if (oldCode !== row.code) {
+            ElMessageBox.confirm(msgTip, {
+                cancelButtonText: '取消',
+                confirmButtonText: '确定',
+                type: 'warning',
+                distinguishCancelAndClose: true,
+                dangerouslyUseHTMLString: true
+            }).then(() => {
+                callSaveDrugKind(row, oldCode)
+            }).catch((action) => {
+                if (action === 'cancel') {
+                    queryDrugKind()
+                }
+            })
+        } else {
+            callSaveDrugKind(row, oldCode)
+        }
+    }
+}
+
+const callSaveDrugKind = (row, oldCode) => {
+    let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        saveDrugKind(row).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            if (oldCode !== null && oldCode !== row.code) {
+                // 删除原始数据
+                delDrugKindByCode(oldCode).then((res) => {
+                    queryDrugKind()
+                })
+            } else {
+                queryDrugKind()
+            }
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryDrugKind()
+        }
+    })
+}
+
+const deleteDrugKind = (index, row) => {
+    let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        delDrugKindByCode(row.code).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            queryDrugKind()
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryDrugKind()
+        }
+    })
+}
+// 药品字典-药品分类字典增删改存结束
+
+// 药品字典-药品剂型字典增删改存开始
+// 编辑
+const editYpDosage = (row) => {
+    // 备份原始数据
+    row['oldRow'] = JSON.parse(JSON.stringify(row))
+    row.isEdit = true
+}
+// 取消
+const cancelYpDosage = (row) => {
+    // 如果是新增的数据
+    if (row.isAdd) {
+        ypDosageData.value.splice(ypDosageData.value.length - 1, 1)
+    } else {
+        // 不是新增的数据  还原数据
+        for (const i in row.oldRow) {
+            row[i] = row.oldRow[i]
+        }
+    }
+}
+// 保存
+const updateYpDosage = (row) => {
+    if (!row.code || !row.name) {
+        ElMessage({
+            type: "warning",
+            message: "药品剂型字典编码或名称不存在,请检查!",
+            duration: 2500,
+            showClose: true,
+        });
+        return
+    }
+
+    if (row.isAdd) {
+        let fe = 0
+        for (let num in ypDosageData.value) {
+            if (ypDosageData.value[num].code === row.code) {
+                fe++
+            }
+        }
+        if (fe === 2) {
+            ElMessage({
+                type: "warning",
+                message: "存在重复的药品剂型字典,请核对!",
+                duration: 2500,
+                showClose: true,
+            });
+        } else {
+            callSaveYpDosage(row, null)
+        }
+
+    } else {
+        let oldCode = row.oldRow.code
+        if (oldCode !== row.code) {
+            ElMessageBox.confirm(msgTip, {
+                cancelButtonText: '取消',
+                confirmButtonText: '确定',
+                type: 'warning',
+                distinguishCancelAndClose: true,
+                dangerouslyUseHTMLString: true
+            }).then(() => {
+                callSaveYpDosage(row, oldCode)
+            }).catch((action) => {
+                if (action === 'cancel') {
+                    queryYpDosage()
+                }
+            })
+        } else {
+            callSaveYpDosage(row, oldCode)
+        }
+    }
+}
+
+const callSaveYpDosage = (row, oldCode) => {
+    let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        saveYpDosage(row).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            if (oldCode !== null && oldCode !== row.code) {
+                // 删除原始数据
+                delYpDosageByCode(oldCode).then((res) => {
+                    queryYpDosage()
+                })
+            } else {
+                queryYpDosage()
+            }
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryYpDosage()
+        }
+    })
+}
+
+const deleteYpDosage = (index, row) => {
+    let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        delYpDosageByCode(row.code).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            queryYpDosage()
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryYpDosage()
+        }
+    })
+}
+// 药品字典-药品剂型字典增删改存结束
+
+// 药品字典-药品单位字典增删改存开始
+// 编辑
+const editYpUnit = (row) => {
+    // 备份原始数据
+    row['oldRow'] = JSON.parse(JSON.stringify(row))
+    row.isEdit = true
+}
+// 取消
+const cancelYpUnit = (row) => {
+    // 如果是新增的数据
+    if (row.isAdd) {
+        ypUnitData.value.splice(ypUnitData.value.length - 1, 1)
+    } else {
+        // 不是新增的数据  还原数据
+        for (const i in row.oldRow) {
+            row[i] = row.oldRow[i]
+        }
+    }
+}
+// 保存
+const updateYpUnit = (row) => {
+    if (!row.code || !row.name) {
+        ElMessage({
+            type: "warning",
+            message: "药品单位字典编码或名称不存在,请检查!",
+            duration: 2500,
+            showClose: true,
+        });
+        return
+    }
+
+    if (row.isAdd) {
+        let fe = 0
+        for (let num in ypUnitData.value) {
+            if (ypUnitData.value[num].code === row.code) {
+                fe++
+            }
+        }
+        if (fe === 2) {
+            ElMessage({
+                type: "warning",
+                message: "存在重复的药品单位字典,请核对!",
+                duration: 2500,
+                showClose: true,
+            });
+        } else {
+            callSaveYpUnit(row, null)
+        }
+    } else {
+        let oldCode = row.oldRow.code
+        if (oldCode !== row.code) {
+            ElMessageBox.confirm(msgTip, {
+                cancelButtonText: '取消',
+                confirmButtonText: '确定',
+                type: 'warning',
+                distinguishCancelAndClose: true,
+                dangerouslyUseHTMLString: true
+            }).then(() => {
+                callSaveYpUnit(row, oldCode)
+            }).catch((action) => {
+                if (action === 'cancel') {
+                    queryYpUnit()
+                }
+            })
+        } else {
+            callSaveYpUnit(row, oldCode)
+        }
+    }
+}
+
+const callSaveYpUnit = (row, oldCode) => {
+    let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        saveYpUnit(row).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            // 若修改了主键code,则需要删除原来的记录
+            if (oldCode !== null && oldCode !== row.code) {
+                // 删除原始数据
+                delYpUnitByCode(oldCode).then((res) => {
+                    queryYpUnit()
+                })
+            } else {
+                queryYpUnit()
+            }
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryYpUnit()
+        }
+    })
+}
+
+const deleteYpUnit = (index, row) => {
+    let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        delYpUnitByCode(row.code).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            queryYpUnit()
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryYpUnit()
+        }
+    })
+}
+// 药品字典-药品单位字典增删改存结束
+
+// 药品字典-药品费别字典增删改存开始
+// 编辑
+const editYpChargeGroup = (row) => {
+    // 备份原始数据
+    row['oldRow'] = JSON.parse(JSON.stringify(row))
+    row.isEdit = true
+}
+// 取消
+const cancelYpChargeGroup = (row, index) => {
+    // 如果是新增的数据
+    if (row.isAdd) {
+        ypChargeGroupData.value.splice(index, 1)
+    } else {
+        // 不是新增的数据  还原数据
+        for (const i in row.oldRow) {
+            row[i] = row.oldRow[i]
+        }
+    }
+}
+// 保存
+const updateYpChargeGroup = (row) => {
+    if (!row.code || !row.name) {
+        ElMessage({
+            type: "warning",
+            message: "药品费别字典编码或名称不存在,请检查!",
+            duration: 2500,
+            showClose: true,
+        });
+        return
+    }
+
+    if (row.isAdd) {
+        let fe = 0
+        for (let num in ypChargeGroupData.value) {
+            if (ypChargeGroupData.value[num].code === row.code) {
+                fe++
+            }
+        }
+        if (fe === 2) {
+            ElMessage({
+                type: "warning",
+                message: "存在重复的药品费别字典,请核对!",
+                duration: 2500,
+                showClose: true,
+            });
+        } else {
+            callSaveYpChargeGroup(row, null)
+        }
+
+    } else {
+        let oldCode = row.oldRow.code
+        if (oldCode !== row.code) {
+            ElMessageBox.confirm(msgTip, {
+                cancelButtonText: '取消',
+                confirmButtonText: '确定',
+                type: 'warning',
+                distinguishCancelAndClose: true,
+                dangerouslyUseHTMLString: true
+            }).then(() => {
+                callSaveYpChargeGroup(row, oldCode)
+            }).catch((action) => {
+                if (action === 'cancel') {
+                    queryYpChargeGroup()
+                }
+            })
+        } else {
+            callSaveYpChargeGroup(row, oldCode)
+        }
+    }
+}
+
+const callSaveYpChargeGroup = (row, oldCode) => {
+    let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        saveYpChargeGroup(row).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            if (oldCode !== null && oldCode !== row.code) {
+                // 删除原始数据
+                delYpChargeGroupByCode(oldCode).then((res) => {
+                    queryYpChargeGroup()
+                })
+            } else {
+                queryYpChargeGroup()
+            }
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryYpChargeGroup()
+        }
+    })
+}
+
+const deleteYpChargeGroup = (index, row) => {
+    let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        delYpChargeGroupByCode(row.code).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            queryYpChargeGroup()
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryYpChargeGroup()
+        }
+    })
+}
+// 药品字典-药品费别字典增删改存结束
+
+// 药房药品住院停用增删改存开始
+// 编辑
+const editVisibleFlag = (row) => {
+    // 备份原始数据
+    row['oldRow'] = JSON.parse(JSON.stringify(row))
+    row.isEdit = true
+}
+// 取消
+const cancelVisibleFlag = (row, index) => {
+    // 如果是新增的数据
+    if (row.isAdd) {
+        visibleFlagData.value.splice(index, 1)
+    } else {
+        // 不是新增的数据  还原数据
+        for (const i in row.oldRow) {
+            row[i] = row.oldRow[i]
+        }
+    }
+}
+// 保存
+const updateVisibleFlag = (row) => {
+    if (!row.chargeCode || !row.groupNo) {
+        ElMessage({
+            type: "warning",
+            message: "药房药品停用的药品编码或药房编码不存在,请检查!",
+            duration: 2500,
+            showClose: true,
+        });
+        return
+    }
+
+    if (row.isAdd) {
+        ElMessage({
+            type: "warning",
+            message: "不能新增药房药品停用,需先维护药品信息!",
+            duration: 2500,
+            showClose: true,
+        });
+    } else {
+        callSaveVisibleFlag(row)
+    }
+}
+
+const callSaveVisibleFlag = (row) => {
+    let title = '请确认是否保存<span style="color:#d12020;">' + row.drug + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        updateYpVisibleFlag(row).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            queryVisibleFlag()
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryVisibleFlag()
+        }
+    })
+}
+// 药房药品住院停用增删改存结束
+
+// 药品字典-药品供应商字典增删改存开始
+// 编辑
+const editYpSupply = (row) => {
+    // 备份原始数据
+    row['oldRow'] = JSON.parse(JSON.stringify(row))
+    row.isEdit = true
+}
+
+// 取消
+const cancelYpSupply = (row, index) => {
+    // 如果是新增的数据
+    if (row.isAdd) {
+        ypSupplyData.value.splice(ypSupplyData.value.length - 1, 1)
+    } else {
+        // 不是新增的数据  还原数据
+        for (const i in row.oldRow) {
+            row[i] = row.oldRow[i]
+        }
+    }
+}
+// 保存
+const updateYpSupply = (row) => {
+    if (!row.code || !row.name) {
+        ElMessage({
+            type: "warning",
+            message: "药品供应商字典编码或名称不存在,请检查!",
+            duration: 2500,
+            showClose: true,
+        });
+        return
+    }
+
+    if (row.isAdd) {
+        let fe = 0
+        for (let num in ypSupplyData.value) {
+            if (ypSupplyData.value[num].code === row.code) {
+                fe++
+            }
+        }
+        if (fe === 2) {
+            ElMessage({
+                type: "warning",
+                message: "存在重复的药品供应商字典,请核对!",
+                duration: 2500,
+                showClose: true,
+            });
+        } else {
+            callSaveYpSupply(row, null)
+        }
+
+    } else {
+        let oldCode = row.oldRow.code
+        if (oldCode !== row.code) {
+            ElMessageBox.confirm(msgTip, {
+                cancelButtonText: '取消',
+                confirmButtonText: '确定',
+                type: 'warning',
+                distinguishCancelAndClose: true,
+                dangerouslyUseHTMLString: true
+            }).then(() => {
+                callSaveYpSupply(row, oldCode)
+            }).catch((action) => {
+                if (action === 'cancel') {
+                    queryYpSupply()
+                }
+            })
+        } else {
+            callSaveYpSupply(row, oldCode)
+        }
+    }
+}
+
+const callSaveYpSupply = (row, oldCode) => {
+    let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        saveYpSupply(row).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            if (oldCode !== null && oldCode !== row.code) {
+                // 删除原始数据
+                delYpSupplyByCode(oldCode).then((res) => {
+                    queryYpSupply()
+                })
+            } else {
+                queryYpSupply()
+            }
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryYpSupply()
+        }
+    })
+}
+
+const deleteYpSupply = (index, row) => {
+    let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        delYpSupplyByCode(row.code).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            queryYpSupply()
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryYpSupply()
+        }
+    })
+}
+// 药品字典-药品供应商字典增删改存结束
+
+// 药品字典-生产厂家字典增删改存开始
+// 编辑
+const editYpManuFactory = (row) => {
+    // 备份原始数据
+    row['oldRow'] = JSON.parse(JSON.stringify(row))
+    row.isEdit = true
+}
+
+// 取消
+const cancelYpManuFactory = (row) => {
+    // 如果是新增的数据
+    if (row.isAdd) {
+        ypManuFactoryData.value.splice(ypManuFactoryData.value.length - 1, 1)
+    } else {
+        // 不是新增的数据  还原数据
+        for (const i in row.oldRow) {
+            row[i] = row.oldRow[i]
+        }
+    }
+}
+// 保存
+const updateYpManuFactory = (row) => {
+    if (!row.code || !row.name) {
+        ElMessage({
+            type: "warning",
+            message: "生产厂家字典编码或名称不存在,请检查!",
+            duration: 2500,
+            showClose: true,
+        });
+        return
+    }
+
+    if (row.isAdd) {
+        let fe = 0
+        for (let num in ypManuFactoryData.value) {
+            if (ypManuFactoryData.value[num].code === row.code) {
+                fe++
+            }
+        }
+        if (fe === 2) {
+            ElMessage({
+                type: "warning",
+                message: "存在重复的生产厂家字典,请核对!",
+                duration: 2500,
+                showClose: true,
+            });
+        } else {
+            callSaveYpManuFactory(row, null)
+        }
+
+    } else {
+        let oldCode = row.oldRow.code
+        if (oldCode !== row.code) {
+            ElMessageBox.confirm(msgTip, {
+                cancelButtonText: '取消',
+                confirmButtonText: '确定',
+                type: 'warning',
+                distinguishCancelAndClose: true,
+                dangerouslyUseHTMLString: true
+            }).then(() => {
+                callSaveYpManuFactory(row, oldCode)
+            }).catch((action) => {
+                if (action === 'cancel') {
+                    queryYpManuFactory()
+                }
+            })
+        } else {
+            callSaveYpManuFactory(row, oldCode)
+        }
+    }
+}
+
+const callSaveYpManuFactory = (row, oldCode) => {
+    let title = '请确认是否保存<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        saveYpManuFactory(row).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            if (oldCode !== null && oldCode !== row.code) {
+                // 删除原始数据
+                delYpManuFactoryByCode(oldCode).then((res) => {
+                    queryYpManuFactory()
+                })
+            } else {
+                queryYpManuFactory()
+            }
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryYpManuFactory()
+        }
+    })
+}
+
+const deleteYpManuFactory = (index, row) => {
+    let title = '请确认是否删除<span style="color:#d12020;">' + row.name + '</span>?'
+    ElMessageBox.confirm(title, {
+        cancelButtonText: '取消',
+        confirmButtonText: '确定',
+        type: 'warning',
+        distinguishCancelAndClose: true,
+        dangerouslyUseHTMLString: true
+    }).then(() => {
+        delYpManuFactoryByCode(row.code).then((res) => {
+            ElMessage({
+                type: "success",
+                message: res.cg,
+                duration: 2500,
+                showClose: true,
+            });
+            queryYpManuFactory()
+        })
+    }).catch((action) => {
+        if (action === 'cancel') {
+            queryYpManuFactory()
+        }
+    })
+}
+// 药品字典-生产厂家字典增删改存结束
+
+const exportData = () => {
+    alert("功能建设中。。。")
+}
+
+const handleClick = (tab, event) => {
+    // 查询哪个tab页面
+    editableTabsValue.value = tab.props.name
+    if (editableTabsValue.value === 'ypClass') {
+        queryYpClass()
+        currentPageClass.value = 1
+    } else if (editableTabsValue.value === 'drugKind') {
+        queryDrugKind()
+        currentPageKind.value = 1
+    } else if (editableTabsValue.value === 'ypDosage') {
+        queryYpDosage()
+        currentPageDosage.value = 1
+    } else if (editableTabsValue.value === 'ypUnit') {
+        queryYpUnit()
+        currentPageUnit.value = 1
+    } else if (editableTabsValue.value === 'ypChargeGroup') {
+        queryYpChargeGroup()
+    } else if (editableTabsValue.value === 'visibleFlag') {
+        queryVisibleFlag()
+        currentPage.value = 1
+    } else if (editableTabsValue.value === 'ypSupply') {
+        queryYpSupply()
+        currentPageSupply.value = 1
+    } else if (editableTabsValue.value === 'ypManuFactory') {
+        queryYpManuFactory()
+        currentPageManuFactory.value = 1
+    }
+}
+
+const tableRowClassName = ({
+    row,
+    rowIndex,
+}) => {
+    if (row.delFlag === '1') {
+        return 'warning-row'
+    }
+}
+
+</script>
+<style lang="scss" deep>
+.el-dialog__body {
+    padding: 0 16px;
+    height: calc(100% - 25px);
+}
+
+.el-tabs {
+    height: calc(100% - 27px);
+
+    .el-tabs__content {
+        padding: 5px;
+        height: calc(100% - 27px);
+    }
+
+    .el-tab-pane {
+        height: calc(100% - 27px);
+        overflow: auto;
+    }
+
+    .el-table__inner-wrapper {
+        height: calc(100% - 10px) !important;
+    }
+
+}
+
+.el-table .warning-row {
+    --el-table-tr-bg-color: #dd7694;
+}
+
+.search-select-pre {
+    padding: 0 12px;
+    color: var(--el-text-color-regular);
+    background: var(--el-fill-color-light);
+    border-right: 1px solid var(--el-border-color);
+    --el-select-input-padding-left: '0'
+}
+</style>