Selaa lähdekoodia

Merge remote-tracking branch 'origin/knowledgePlat'

zhouna 4 vuotta sitten
vanhempi
commit
aef03bb964

+ 10 - 1
src/api/config.js

@@ -51,7 +51,16 @@ export default {
     'importDrugRecord': '/tran/drugConfig/importExcel',   //药品-数据导入
     'exportDrugModule': '/tran/drugConfig/exportExcelModule',   //科室-数据导入模板导出
 
-    'getOperationPage': '/tran/operationConfig/getPage',   //手术/操作列表
+      'getScalePageCDSS': '/tran/scaleConfig/getPage',   //量表列表
+      'scaleIsExistRecordCDSS': '/tran/scaleConfig/isExistRecord',   //量表-映射关系是否已存在
+      'saveOrUpdateScaleRecordCDSS': '/tran/scaleConfig/saveOrUpdateRecord',   //量表-保存或修改映射关系
+      'deleteScaleRecordCDSS': '/tran/scaleConfig/deleteRecord',   //量表-删除映射关系
+      'exportScaleRecordCDSS': '/tran/scaleConfig/exportExcel',   //量表-数据导出
+      'importScaleRecordCDSS': '/tran/scaleConfig/importExcel',   //量表-数据导入
+      'exportScaleModuleCDSS': '/tran/scaleConfig/exportExcelModule',
+
+
+      'getOperationPage': '/tran/operationConfig/getPage',   //手术/操作列表
     'operationIsExistRecord': '/tran/operationConfig/isExistRecord',   //手术/操作-映射关系是否已存在
     'saveOrUpdateOperationRecord': '/tran/operationConfig/saveOrUpdateRecord',   //手术/操作-保存或修改映射关系
     'deleteOperationRecord': '/tran/operationConfig/deleteRecord',   //手术/操作-删除映射关系

+ 29 - 0
src/api/icss.js

@@ -137,6 +137,35 @@ export default {
   importDrugRecord(param) {
     return axios.post(urls.importDrugRecord, param);
   },
+
+
+    getScalePage(param) {
+        //量表列表-列表
+        return axios.post(urls.getScalePageCDSS, param);
+    },
+    scaleIsExistRecord(param) {
+        return axios.post(urls.scaleIsExistRecordCDSS, param);
+    },
+    saveOrUpdateScaleRecord(param) {
+        return axios.post(urls.saveOrUpdateScaleRecordCDSS, param);
+    },
+    deleteScaleRecord(param) {
+        return axios.post(urls.deleteScaleRecordCDSS, param);
+    },
+    exportScaleRecord(param) {
+        return axios.post(urls.exportScaleRecordCDSS, param, {
+            responseType: 'blob',
+        });
+    },
+    importScaleRecord(param) {
+        return axios.post(urls.importScaleRecordCDSS, param);
+    },
+    exportScaleModule(param) {
+        return axios.post(urls.exportScaleModuleCDSS, param, {
+            responseType: 'blob',
+        });
+    },
+
   getOperationPage(param) {
     //手术/操作列表-列表
     return axios.post(urls.getOperationPage, param);

+ 1 - 1
src/components/icss/AddMedicinePrompt.vue

@@ -179,7 +179,7 @@ export default {
       showConfirm: true,
       isSuccessUpload: 0, //是否上传成功  0: 不在上传  1: 上传过程中  2: 上传成功
       isShowTip: false,
-      showType: -1, // 1 诊断  2  药品   3检验套餐 4检验细项  5检查  6检查子 7手术和操作
+      showType: -1, // 1 诊断  2  药品   3检验套餐 4检验细项  5检查  6检查子 7手术和操作 8量表
       editCount: -1, // 页面会否被编辑 >0被编辑   =0 未编辑
       startCount: -1,
       isSaveSuccess: false // 是否保存成功

+ 13 - 1
src/components/icss/MedicineInfoPg.vue

@@ -158,6 +158,9 @@ export default {
         ]
       };
     }
+      setTimeout(()=>{
+          this.filterHiddenPosition();
+      },200)
   },
   mounted() {},
   methods: {
@@ -170,6 +173,15 @@ export default {
     delEmit() {
       this.$emit('del', this.index);
     },
+      filterHiddenPosition(){
+          const pos = this.data.position;
+          const pArr = this.positions.map((it)=>{return it.key});
+          const pStr = pArr.join(",");
+          const arr=pos.filter((it)=>{
+              return pStr.indexOf(it)>-1;
+          });
+          this.data.position=arr;
+      },
     // 渲染内容类型
     renderPositions() {
       //显示位置枚举列表
@@ -189,7 +201,7 @@ export default {
         this.positions = positions.filter(item => {
           return item.key <= 2;
         });
-      } else if (this.showType == 2 || this.showType == 7) {
+      } else if (this.showType == 2 || this.showType == 7|| this.showType == 8) {
         // 药品/手术
         this.positions = positions.filter(item => item.key === 1);
       } else {

+ 3 - 6
src/components/icss/MedicinePrompt.vue

@@ -232,7 +232,7 @@ export default {
           if (res.data.code == '0') {
             const data = res.data.data;
             // 类型:1-诊断、2-药品、3-检验套餐、4-检验细项、5-检查、6-手术和操作
-            let temp = [
+            /*let temp = [
               '',
               '诊断',
               '药品',
@@ -241,11 +241,8 @@ export default {
               '检查',
               '检查子项',
               '手术和操作',
-            ];
-            this.list = data.records = data.records.filter(item => {
-              item.typeName = temp[item.type];
-              return item;
-            });
+            ];*/
+            this.list = data.records;
             this.cacheData[param.current] = data.records;
             this.total = data.total;
             if (this.inCurrentPage !== undefined) {

+ 423 - 0
src/components/icss/scale/AddScale.vue

@@ -0,0 +1,423 @@
+<template>
+    <div class="AddChemicalAndCommonMappingWrapper clearfix">
+        <crumbs
+                :title="isEdit ? '量表关联维护--修改关联' : '量表关联维护--添加关联'"
+                class="topBack"
+                :param="$route.params"
+                linkTo="ScaleManage"
+        ></crumbs>
+        <el-form
+                :model="form"
+                :rules="rules"
+                label-position="right"
+                label-width="120px"
+                ref="relationForm"
+        >
+            <div class="AddChemicalAndCommonMappingBox clearfix">
+                <div class="titleBox clearfix">
+                    <p class="title">医院术语</p>
+                    <p class="title">标准术语</p>
+                </div>
+                <div class="leftBox clearfix">
+                    <el-row>
+                        <el-col :span="16">
+                            <el-form-item label="量表名称:" prop="hisName">
+                                <el-input v-model="form.hisName" clearable style="minWidth: 240px"></el-input>
+                            </el-form-item>
+                            <el-form-item label="量表名称预览:">
+                                <span class="previewInfo" style="minWidth: 240px">{{form.hisName}}</span>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                </div>
+                <div class="midBox">
+                    <img class="midLogo" src="../../../images/relation.png" alt />
+                    <p class="midTitle">相互关联</p>
+                </div>
+                <div class="rightBox">
+                    <el-row>
+                        <el-col :span="16">
+                            <el-form-item label="量表名称:" prop="searchText">
+                                <el-select
+                                        style="width:100%;minWidth: 240px"
+                                        v-model="form.searchText"
+                                        filterable
+                                        remote
+                                        clearable
+                                        :loading="showDrop"
+                                        loading-text="加载中..."
+                                        @change="changeWord"
+                                        @focus="handleFocus"
+                                        @visible-change="handleVisible"
+                                        placeholder="搜索"
+                                        :remote-method="searchTerms"
+                                        reserve-keyword
+                                >
+                                    <el-option
+                                            v-for="(item,idx) in uniqueNameList"
+                                            :key="idx"
+                                            :label="item.name"
+                                            :value="item.name"
+                                            :title="item.name"
+                                    ></el-option>
+                                </el-select>
+                            </el-form-item>
+                            <el-form-item label="量表名称预览:">
+                                <span class="previewInfo" style="minWidth: 240px">{{form.searchText}}</span>
+                            </el-form-item>
+                        </el-col>
+                    </el-row>
+                </div>
+            </div>
+            <div class="btn">
+                <el-form-item>
+                    <el-button type="primary" :disabled="saveDisable" @click="submitForm">确定</el-button>
+                </el-form-item>
+            </div>
+        </el-form>
+    </div>
+</template>
+<script>
+    import api from '@api/icss.js';
+    import config from '@api/config';
+    export default {
+        name: 'AddScale',
+        data() {
+            return {
+                isEdit: false,
+                editId: '',
+                uniqueNameList: [],
+                form: {
+                    searchText: '', //搜索字段
+                    hisName: '',
+                    form: ''
+                },
+                rules: {
+                    hisName: [
+                        { required: true, message: '请输入量表名称', trigger: 'change' },
+                        { max: 80, message: '量表名称最多80字', trigger: 'change' }
+                    ],
+                    searchText: [
+                        { required: true, message: '请选择量表名称', trigger: 'change' }
+                    ]
+                },
+                saveDisable: false, //保存按钮禁止点击
+                showDrop: false, //下拉框显示文字
+                drugList: []
+            };
+        },
+        created() {
+            //修改
+            const { isEdit, data } = this.$route.params;
+            this.getDicList();
+            if (isEdit) {
+                this.isEdit = isEdit;
+                this.editId = data.id;
+                this.form.hisName = data.hisName;
+                this.form.searchText = data.uniqueName;
+                this.form.form = data.form;
+            }
+        },
+        methods: {
+            getDicList() {
+                api.getDicList().then(res => {
+                    if (res.data.code === '0') {
+                        let dragData = [];
+                        res.data.data &&
+                        res.data.data['9'].forEach(item => {
+                            if (item.val !== '0') {
+                                dragData.push(item);
+                            }
+                        });
+                        this.drugList = dragData;
+                    }
+                });
+            },
+
+            // 搜索列表
+            searchTerms(query) {
+                if (!query) {
+                    this.uniqueNameList = [];
+                    return;
+                }
+                this.showDrop = true;
+                let params = {
+                    type: 10, //量表
+                    inputStr: query,
+                    sex: 3,
+                    age: 0
+                };
+                api.retrievalSearch(params).then(res => {
+                    this.showDrop = false;
+                    if (res.data.code === '0') {
+                        this.uniqueNameList = res.data.data.scalenames;
+                    }
+                });
+            },
+            changeWord() {},
+            // 获取焦点
+            handleFocus() {},
+
+            handleVisible(flag) {
+                if (!flag) {
+                    this.uniqueNameList = [];
+                }
+            },
+
+            // 初始化表单数据
+            initForm() {
+                this.form.hisName = '';
+                this.form.searchText = '';
+            },
+
+            // 建立关联-参数处理
+            submitForm() {
+                this.$refs.relationForm.validate(valid => {
+                    if (valid) {
+                        const { searchText, hisName, form } = this.form;
+                        let params = {
+                            hisName: hisName,
+                            uniqueName: searchText,
+                            form: form
+                        };
+                        this.showSaveDialog(params);
+                    } else {
+                        console.log('error submit!!');
+                        return false;
+                    }
+                });
+            },
+            // 建立关联-映射关系是否已存在
+            showSaveDialog(params) {
+                this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+                api
+                    .scaleIsExistRecord(params)
+                    .then(res => {
+                        if (!res.data.data) {
+                            // 不存在,创建新的关联
+                            // 如果是编辑时,需要携带id
+                            if (this.isEdit) {
+                                params = { ...params, id: this.editId };
+                            }
+                            this.saveLisMapping(params, '保存成功', 'success');
+                        } else {
+                            // 已存在,提示修改
+                            this.warning('该条关联已存在,无法添加');
+                            this.saveDisable = false;
+                        }
+                    })
+                    .catch(err => {
+                        if (err.code === '900010001') {
+                            return false;
+                        }
+                        this.warning(err);
+                    });
+            },
+
+            // 映射关系不存在-建立关联
+            saveLisMapping(params, msg, type) {
+                api.saveOrUpdateScaleRecord(params).then(res => {
+                    if (res.data.code === '0') {
+                        this.warning(res.data.msg || msg, type);
+                        this.initForm();
+                        this.$router.push({
+                            name: 'ScaleManage',
+                            params: Object.assign({}, this.$route.params, {
+                                currentPage: 1
+                            })
+                        });
+                    } else {
+                        this.warning(res.data.msg);
+                    }
+                    this.saveDisable = false;
+                });
+            },
+            // 关联已存在模态框
+            showConfirmDialog(msg, resolve) {
+                this.$confirm(msg, '提示', {
+                    customClass: 'confirmRealation',
+                    confirmButtonText: '是',
+                    cancelButtonText: '否',
+                    cancelButtonClass: 'cancelButton',
+                    type: 'warning'
+                })
+                    .then(() => {
+                        resolve();
+                    })
+                    .catch(() => {
+                        this.saveDisable = false;
+                        this.warning('建立失败', 'error');
+                    });
+            },
+            warning(msg, type) {
+                this.$message({
+                    showClose: true,
+                    message: msg,
+                    type: type || 'warning'
+                });
+            }
+        }
+    };
+</script>
+<style lang="less">
+    .AddChemicalAndCommonMappingWrapper {
+        .AddChemicalAndCommonMappingBox {
+            min-width: 940px;
+        }
+        color: #606266;
+        .topBack {
+            top: 0;
+        }
+        .titleBox {
+            padding: 0 0 10px 0px;
+        }
+        .title {
+            width: 50%;
+            float: left;
+            font-size: 14px;
+        }
+        .AddChemicalAndCommonMappingBox {
+            padding: 20px 30px 20px 30px;
+            margin: 70px 20px 0 20px;
+            background: #fff;
+        }
+        .leftBox,
+        .midBox,
+        .rightBox {
+            width: 40%;
+            float: left;
+            min-height: 200px;
+            font-size: 14px;
+        }
+        .midBox {
+            width: 6%;
+            padding: 50px 0 0 0;
+            text-align: center;
+        }
+        .midTitle {
+            width: 40px;
+            margin: 0 auto;
+        }
+        .midLogo {
+            margin: 0 auto;
+        }
+        .leftBox,
+        .rightBox {
+            border: 1px solid #dcdfe6;
+            padding: 20px 20px;
+        }
+        .itemLabel {
+            width: 100%;
+            min-height: 50px;
+            line-height: 50px;
+            position: relative;
+        }
+        .itemLabelName,
+        .searchInput,
+        .searchName {
+            float: left;
+            color: #606266;
+        }
+        .itemLabelName {
+            width: 150px;
+        }
+        .isRequired::before {
+            content: '*';
+            color: red;
+        }
+        .searchInput,
+        .mealNameItem {
+            padding: 0 5px;
+        }
+        .searchInput,
+        .searchName {
+            display: inline-block;
+            height: 32px;
+            line-height: 32px;
+            border: 1px solid #a9a9a9;
+            margin: 8px 0 0 0;
+        }
+
+        .searchName {
+            text-align: center;
+            border-left: none;
+            cursor: pointer;
+            padding: 0 12px;
+            font-size: 16px;
+        }
+        .itemList {
+            position: absolute;
+            background: #fff;
+            width: 162px;
+            max-height: 150px;
+            border: 1px solid #a9a9a9;
+            left: 150px;
+            top: 42px;
+            z-index: 2;
+            overflow-y: auto;
+        }
+        .itemList {
+            width: calc(100% - 131px);
+        }
+        .mealNameItem {
+            height: 30px;
+            line-height: 30px;
+            font-size: 14px;
+            cursor: pointer;
+        }
+        .mealNameItem:hover {
+            background: #f5f7fa;
+        }
+        // .selectItemName {
+        //   padding-left: 4px;
+        //   display: inline-block;
+        //   margin-top: 8px;
+        //   // width: calc(100% - 160px);s
+        //   line-height: 24px;
+        //   overflow: hidden;
+        //   word-wrap: break-word;
+        //   word-break: break-all;
+        // }
+        .previewInfo {
+            padding-left: 4px;
+            display: inline-block;
+            margin-top: 8px;
+            // width: calc(100% - 160px);s
+            line-height: 24px;
+            overflow: hidden;
+            word-wrap: break-word;
+            word-break: break-all;
+        }
+        .btn {
+            position: relative;
+            background-color: #fff;
+            margin: 0px 20px;
+            padding: 20px;
+            min-width: 960px;
+            height: 80px;
+            .el-button {
+                position: absolute;
+                right: 80px;
+                top: 20px;
+            }
+        }
+        .sumbit {
+            position: absolute;
+            display: inline-block;
+            width: 80px;
+            height: 30px;
+            line-height: 30px;
+            border: 1px solid #a9a9a9;
+            text-align: center;
+            right: 100px;
+        }
+    }
+    .confirmRealation {
+        .cancelButton {
+            border: 1px solid #a9a9a9;
+            span {
+                color: #606266;
+            }
+        }
+    }
+</style>

+ 437 - 0
src/components/icss/scale/ScaleManage.vue

@@ -0,0 +1,437 @@
+<template>
+    <div>
+        <crumbs title="量表关联维护" style="min-width: 980px">
+            <el-form :inline="true" class="demo-form-inline">
+                <el-form-item>
+                    <el-button type="text" class="downTemplate" @click="exportModule">导入模板下载</el-button>
+                    <input
+                            type="file"
+                            name="uploadfile "
+                            id="upFile"
+                            @change="uploadFile($event)"
+                    />
+                    <el-button size="mini" @click="importPage">{{uploadInfo}}</el-button>
+                    <el-button size="mini" @click="exportData">导出</el-button>
+                </el-form-item>
+                <el-form-item label="医院量表名称:">
+                    <el-input size="mini" v-model="filter.hisName" placeholder="请输入" clearable></el-input>
+                </el-form-item>
+                <el-form-item label="标准量表名称:">
+                    <el-input size="mini" v-model="filter.uniqueName" placeholder="请输入" clearable></el-input>
+                </el-form-item>
+                <el-form-item class="dododo">
+                    <el-button size="mini" @click="filterDatas">检索</el-button>
+                    <el-button size="mini" type="warning" @click="addRelation">添加关联</el-button>
+                </el-form-item>
+            </el-form>
+        </crumbs>
+        <div class="contents">
+            <el-table :data="list" border style="width: 100%">
+                <el-table-column :resizable="false" type="index" :index="indexMethod" label="编号" width="60"></el-table-column>
+                <el-table-column :resizable="false" prop="gmtModified" label="操作时间" width="180"></el-table-column>
+                <el-table-column :resizable="false" prop="hisName" label="医院量表名称" show-overflow-tooltip></el-table-column>
+                <el-table-column :resizable="false" prop="uniqueName" label="标准量表名称" show-overflow-tooltip></el-table-column>
+                <el-table-column :resizable="false" prop="operate" label="操作">
+                    <template slot-scope="scope">
+                        <el-button @click="modifyRelation(scope.row)" type="text" size="small">修改</el-button>
+                        <span style="margin:0 3px;">|</span>
+                        <el-button
+                                @click="showDelDialog(scope.row.id)"
+                                class="delete"
+                                type="text"
+                                size="small"
+                        >删除</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+            <div class="pagination pagepage">
+                <el-pagination
+                        :current-page.sync="currentPage"
+                        @current-change="currentChange"
+                        background
+                        :page-size="pageSize"
+                        :page-sizes="pageSizeArr"
+                        @size-change="handleSizeChange"
+                        :layout="pageLayout"
+                        :total="total"
+                ></el-pagination>
+            </div>
+        </div>
+    </div>
+</template>
+
+<script>
+    import api from '@api/icss.js';
+    import config from '@api/config.js';
+    import utils from '@api/utils.js';
+
+    export default {
+        name: 'ScaleManage', //化验大小项和公表维护
+        data: function() {
+            return {
+                list: [],
+                searched: false,
+                filter: {
+                    hisName: '', // 医院诊断名称
+                    uniqueName: '' //标准诊断名称
+                },
+                currentPage: 1,
+                pageSize: config.pageSize,
+                pageSizeArr: config.pageSizeArr,
+                pageLayout: config.pageLayout,
+                total: 0,
+                uploadInfo: '导入'
+            };
+        },
+        created() {
+            const that = this;
+            //返回时避免参数未赋值就获取列表
+            setTimeout(function() {
+                that.clearFilter();
+                that.getDataList();
+
+            });
+            // 非首页 编辑页返回 设置 this.currentPage
+            if (Object.keys(this.$route.params).length !== 0) {
+                this.currentPage = this.$route.params.currentPage;
+            }
+        },
+        watch: {
+            filter: {
+                handler: function() {
+                    this.searched = false;
+                },
+                deep: true
+            }
+        },
+        beforeRouteEnter(to, from, next) {
+            next(vm => {
+                //const pm = to.param;
+                Object.assign(vm, to.params);
+                vm.inCurrentPage = to.params.currentPage;
+            });
+        },
+        methods: {
+            handleSizeChange(val) {
+                this.pageSize = val;
+                this.currentPage = utils.getCurrentPage(
+                    this.currentPage,
+                    this.total,
+                    this.pageSize
+                );
+                this.getDataList();
+            },
+
+            // 获取列表数据
+            getDataList(isTurnPage) {
+                const params = this.getFilterItems(isTurnPage);
+                this.searched = true;
+                const loading = this.$loading({
+                    lock: true,
+                    text: 'Loading',
+                    spinner: 'el-icon-loading',
+                    background: 'rgba(0, 0, 0, 0.7)'
+                });
+                api.getScalePage(params).then(res => {
+                    loading.close();
+                    if (res.data.code === '0') {
+                        this.list = res.data.data && res.data.data.records;
+                    }
+                    this.total = res.data.data && res.data.data.total;
+                    if (this.inCurrentPage !== undefined) {
+                        this.currentPage = this.inCurrentPage;
+                        this.inCurrentPage = undefined;
+                    }
+                });
+            },
+
+            // 处理列表请求数据参数
+            getFilterItems(isTurnPage) {
+                //翻页时筛选条件没点确定则清空
+                if (isTurnPage && !this.searched) {
+                    this.clearFilter();
+                }
+                const param = {
+                    current: this.inCurrentPage || this.currentPage,
+                    size: this.pageSize,
+                    hisName: this.filter.hisName.trim(),
+                    uniqueName: this.filter.uniqueName.trim(),
+                    uniqueCode: ''
+                };
+                return param;
+            },
+
+            filterDatas() {
+                this.currentPage = 1;
+                this.getDataList();
+            },
+            addRelation() {
+                const pam = this.searched
+                    ? {
+                        currentPage: this.currentPage,
+                        pageSize: this.pageSize,
+                        filter: this.filter
+                    }
+                    : { currentPage: this.currentPage, pageSize: this.pageSize };
+                this.$router.push({ name: 'AddScale', params: pam });
+            },
+            // 修改诊断关联-跳转至编辑页面
+            modifyRelation(row) {
+                const item = Object.assign({}, row);
+                const pam = this.searched
+                    ? {
+                        currentPage: this.currentPage,
+                        pageSize: this.pageSize,
+                        filter: this.filter
+                    }
+                    : { currentPage: this.currentPage, pageSize: this.pageSize };
+                this.$router.push({
+                    name: 'AddScale',
+                    params: Object.assign(pam, { isEdit: true, data: item })
+                });
+            },
+            currentChange(next) {
+                this.currentPage = next;
+                this.getDataList(true);
+                // if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+                //     this.list = this.cacheData[next];
+                // } else {
+                //     this.getDataList();
+                // }
+            },
+            // 清空搜索参数
+            clearFilter() {
+                this.filter = {
+                    hisName: '',
+                    uniqueName: ''
+                };
+            },
+
+            indexMethod(index) {
+                return (this.currentPage - 1) * this.pageSize + index + 1;
+            },
+            getTagType(val) {
+                return val;
+            },
+            warning(msg, type) {
+                this.$message({
+                    showClose: true,
+                    message: msg,
+                    type: type || 'warning'
+                });
+            },
+            showConfirmDialog(msg, resolve) {
+                this.$confirm(msg, '提示', {
+                    confirmButtonText: '删除',
+                    cancelButtonText: '取消',
+                    cancelButtonClass: 'cancelBtn',
+                    confirmButtonClass: 'confirmC',
+                    type: 'warning'
+                })
+                    .then(() => {
+                        resolve();
+                    })
+                    .catch(() => {});
+            },
+            // 删除关联
+            showDelDialog(id) {
+                this.showConfirmDialog('是否删除该关联?', () => {
+                    api
+                        .deleteScaleRecord({ id: id })
+                        .then(res => {
+                            if (res.data.code == '0') {
+                                if (!this.searched) {
+                                    //未点确认时清空搜索条件
+                                    this.clearFilter();
+                                }
+                                if (this.list.length == 1) {
+                                    //当前在最后一页且只有一条数据时,删除后跳到前一页
+                                    this.currentPage =
+                                        this.currentPage === 1 ? 1 : this.currentPage - 1;
+                                }
+                                this.getDataList();
+                                this.warning(res.data.msg || '操作成功', 'success');
+                            } else {
+                                this.warning(res.data.msg);
+                            }
+                        })
+                        .catch(error => {
+                            if (error.code === '900010001') {
+                                return false;
+                            }
+                            this.warning(error);
+                        });
+                });
+            },
+
+            // 导出数据
+            exportData() {
+                this.$confirm('确定要导出全部量表关联数据吗?', '', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    cancelButtonClass: 'leftbtn',
+                    customClass: 'exportBox6',
+                    title: '提示',
+                    type: 'warning'
+                    // beforeClose: (action, instance, done) => {
+                    //   if (action === 'confirm') {
+                    //     // instance.confirmButtonLoading = true;
+                    //     instance.confirmButtonText = '导出中...';
+                    //     api.exportScaleRecord().then(res => {
+                    //       if (res.status === 200) {
+                    //         setTimeout(() => {
+                    //           utils.downloadExportedData(res.data, '量表关联数据.xls');
+                    //           done();
+                    //         }, 1500);
+                    //       }
+                    //     });
+                    //   } else {
+                    //     done();
+                    //   }
+                    // }
+                })
+                    .then(() => {
+                        api.exportScaleRecord().then(res => {
+                            if (res.status === 200) {
+                                this.$message({ message: '导出成功', type: 'success' });
+                                utils.downloadExportedData(res.data, '量表关联数据.xls');
+                            }
+                        });
+                    })
+                    .catch(() => {
+                        // this.$message({ message: '导出失败', type: 'waring' });
+                    });
+            },
+
+            // 导入模板
+            exportModule() {
+                api.exportScaleModule().then(res => {
+                    if (res.status === 200) {
+                        setTimeout(() => {
+                            utils.downloadExportedData(res.data, '量表导入模板.xls');
+                        }, 1500);
+                    }
+                });
+            },
+
+            // 点击导入
+            importPage() {
+                let inp = document.getElementById('upFile');
+                inp.click();
+            },
+            // 导入数据
+            uploadFile(e) {
+                let fileInfo = e.target.files[0];
+                e.preventDefault();
+                let formData = new FormData();
+                formData.append('file', fileInfo);
+                const header = {
+                    headers: {
+                        'Content-Type': 'multipart/form-data'
+                    }
+                };
+                this.uploadInfo = '导入中...';
+                api.importScaleRecord(formData, header).then(res => {
+                    // console.log(res, '======================res导入结果');
+                    if (res.data.code === '00000001') {
+                        this.$confirm(`数据存在异常,导入失败,请修改后再试`, '提示', {
+                            confirmButtonText: '确定',
+                            // cancelButtonText: '取消',
+                            cancelButtonClass: 'cancelSure',
+                            confirmButtonClass: 'sure',
+                            customClass: 'exportConfirm',
+                            type: 'warning'
+                        })
+                            .then(() => {})
+                            .catch(() => {});
+                        this.getDataList(); // 重新获取列表
+                        setTimeout(() => {
+                            this.uploadInfo = '导入';
+                        }, 300);
+                    } else if (res.data === '' && res.status === 200) {
+                        this.$confirm(`导入成功`, '提示', {
+                            confirmButtonText: '确定',
+                            // cancelButtonText: '取消',
+                            cancelButtonClass: 'cancelSure',
+                            confirmButtonClass: 'sure',
+                            customClass: 'exportConfirm',
+                            type: 'warning'
+                        })
+                            .then(() => {})
+                            .catch(() => {});
+                        this.getDataList(); // 重新获取列表
+                        setTimeout(() => {
+                            this.uploadInfo = '导入';
+                        }, 300);
+                    } else {
+                        this.$confirm(`${res.data.msg}`, '提示', {
+                            confirmButtonText: '确定',
+                            // cancelButtonText: '取消',
+                            cancelButtonClass: 'cancelSure',
+                            confirmButtonClass: 'sure',
+                            customClass: 'exportConfirm',
+                            type: 'warning'
+                        })
+                            .then(() => {})
+                            .catch(() => {});
+
+                        setTimeout(() => {
+                            this.uploadInfo = '导入';
+                        }, 300);
+                    }
+                });
+                //解决上传相同文件不触发change
+                let inp = document.getElementById('upFile');
+                inp.value = '';
+            }
+        }
+    };
+</script>
+
+
+<style lang="less">
+    @import '../../../less/admin.less';
+    .delete {
+        color: red;
+    }
+    .delete:hover {
+        color: red;
+    }
+    .pagination {
+        min-width: 1010px;
+    }
+    .downTemplate {
+        margin-right: 8px;
+        span {
+            color: #02a7f0;
+        }
+    }
+    #upFile {
+        display: none !important;
+    }
+    .el-message-box {
+        /deep/.cancelBtn {
+            background-color: #d7d7d7;
+            border-color: transparent;
+        }
+        /deep/.confirmC {
+            background-color: #ff545b !important;
+            border-color: transparent !important;
+        }
+    }
+    .exportBox6 {
+        /deep/ .el-message-box__btns {
+            margin-top: 20px;
+        }
+        /deep/ .el-message-box__message {
+            // text-align: center;
+        }
+        /deep/.leftbtn {
+            background-color: #d7d7d7;
+            border-color: transparent !important;
+        }
+        /deep/ .el-message-box__header {
+            border-bottom: 1px solid #dcdfe6;
+        }
+    }
+</style>

+ 4 - 0
src/routes.js

@@ -10,6 +10,8 @@ import Pacs from '@components/icss/pacs/Pacs.vue'; //检查关联维护
 import AddPacs from '@components/icss/pacs/AddPacs.vue';  //检查关联维护--添加关联
 import DrugManage from '@components/icss/drug/DrugManage.vue'; //药品关联维护
 import AddDrug from '@components/icss/drug/AddDrug.vue';  //药品关联维护--添加关联
+import ScaleManage from '@components/icss/scale/ScaleManage.vue'; //量表关联维护
+import AddScale from '@components/icss/scale/AddScale.vue';  //量表关联维护--添加关联
 import Operation from '@components/icss/operation/Operation.vue'; //手术/操作关联维护
 import AddOperation from '@components/icss/operation/AddOperation.vue';  //手术/操作关联维护--添加关联
 import Fusion from '@components/icss/fusion/Fusion.vue'; //输血关联维护
@@ -48,6 +50,8 @@ export default [
       { path: 'LT-JCGLWH-TJHYDXXYGBXDY', component: AddPacs, name: 'AddPacs' }, //检查关联维护--添加关联
       { path: 'YXSYK-YPGLWH', component: DrugManage, name: 'DrugManage' }, //药品关联维护
       { path: 'LT-YPGLWH-TJHYDXXYGBXDY', component: AddDrug, name: 'AddDrug' }, //药品关联维护--添加关联
+        { path: 'YXSYK-LBGLWH', component: ScaleManage, name: 'ScaleManage' }, //量表关联维护
+        { path: 'LT-YPLBWH-TJHYDXXYGBXDY', component: AddScale, name: 'AddScale' }, //量表关联维护--添加关联
       { path: 'YXSYK-SSCZGLWH', component: Operation, name: 'Operation' }, //手术/操作关联维护
       { path: 'LT-SSCZGLWH-TJHYDXXYGBXDY', component: AddOperation, name: 'AddOperation' }, //手术/操作关联维护--添加关联
       { path: 'YXSYK-SXGLWH', component: Fusion, name: 'Fusion' }, //输血关联维护