Browse Source

诊断维护基本样式依据添加删除辅助

wyq 4 years ago
parent
commit
35f5e56fef

+ 30 - 11
package-lock.json

@@ -4836,7 +4836,8 @@
         "ansi-regex": {
           "version": "2.1.1",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "aproba": {
           "version": "1.2.0",
@@ -4857,12 +4858,14 @@
         "balanced-match": {
           "version": "1.0.0",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "brace-expansion": {
           "version": "1.1.11",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "balanced-match": "^1.0.0",
             "concat-map": "0.0.1"
@@ -4877,17 +4880,20 @@
         "code-point-at": {
           "version": "1.1.0",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "concat-map": {
           "version": "0.0.1",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "console-control-strings": {
           "version": "1.1.0",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "core-util-is": {
           "version": "1.0.2",
@@ -5004,7 +5010,8 @@
         "inherits": {
           "version": "2.0.4",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "ini": {
           "version": "1.3.5",
@@ -5016,6 +5023,7 @@
           "version": "1.0.0",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "number-is-nan": "^1.0.0"
           }
@@ -5030,6 +5038,7 @@
           "version": "3.0.4",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "brace-expansion": "^1.1.7"
           }
@@ -5037,12 +5046,14 @@
         "minimist": {
           "version": "0.0.8",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "minipass": {
           "version": "2.9.0",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "safe-buffer": "^5.1.2",
             "yallist": "^3.0.0"
@@ -5061,6 +5072,7 @@
           "version": "0.5.1",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "minimist": "0.0.8"
           }
@@ -5150,7 +5162,8 @@
         "number-is-nan": {
           "version": "1.0.1",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "object-assign": {
           "version": "4.1.1",
@@ -5162,6 +5175,7 @@
           "version": "1.4.0",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "wrappy": "1"
           }
@@ -5247,7 +5261,8 @@
         "safe-buffer": {
           "version": "5.1.2",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "safer-buffer": {
           "version": "2.1.2",
@@ -5283,6 +5298,7 @@
           "version": "1.0.2",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "code-point-at": "^1.0.0",
             "is-fullwidth-code-point": "^1.0.0",
@@ -5302,6 +5318,7 @@
           "version": "3.0.1",
           "bundled": true,
           "dev": true,
+          "optional": true,
           "requires": {
             "ansi-regex": "^2.0.0"
           }
@@ -5345,12 +5362,14 @@
         "wrappy": {
           "version": "1.0.2",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         },
         "yallist": {
           "version": "3.1.1",
           "bundled": true,
-          "dev": true
+          "dev": true,
+          "optional": true
         }
       }
     },

File diff suppressed because it is too large
+ 966 - 386
src/components/knowledgeExtra/AddDiagBase.vue


+ 426 - 382
src/components/knowledgeExtra/DiagBase.vue

@@ -1,398 +1,442 @@
 <template>
-    <div>
-        <crumbs title="诊断依据维护" :minWidth="titleWidth" class="knowledgeTitle">
-            <el-form :inline="true" class="demo-form-inline">
-                <el-form-item label="疾病名称:">
-                    <el-input size="mini" v-model="filter.conceptName" placeholder="输入疾病名称" clearable></el-input>
-                </el-form-item>
-                <el-form-item label="描述:">
-                    <el-input size="mini" v-model="filter.description" placeholder="输入描述" clearable></el-input>
-                </el-form-item>
-                <el-form-item label="状态:">
-                    <el-select v-model="filter.status" clearable placeholder="请选择" size="mini">
-                        <el-option
-                                v-for="item in stateSelect"
-                                :key="item.id"
-                                :label="item.name"
-                                :value="item.id">
-                        </el-option>
-                    </el-select>
-                </el-form-item>
-                <el-form-item>
-                    <el-button size="mini" @click="filterDatas">确认</el-button>
-                </el-form-item>
-                <el-form class="secLine">
-                    <el-form-item>
-                        <el-button size="mini" @click="addRule" type="warning" style="margin:0 10px">+ 新增诊断依据</el-button>
-                        <el-button size="mini" @click="update">更新数据</el-button>
-                    </el-form-item>
-                </el-form>
-            </el-form>
-        </crumbs>
-        <div class="contents knowledgeContents">
-            <el-table :data="list"
-                      border
-                      style="width: 100%">
-                <el-table-column
-                        type="index"
-                        :index="indexMethod"
-                        label="编号"
-                        width="60">
-                </el-table-column>
-                <el-table-column
-                        prop="conceptName"
-                        label="疾病名称"
-                        width="160">
-                    <template slot-scope="scope">
-                        <el-tooltip v-if="scope.row.conceptName.length>8" class="item" effect="dark" :content="scope.row.conceptName" placement="top">
-                            <span>{{scope.row.conceptName.slice(0,8)+'...'}}</span>
-                        </el-tooltip>
-                        <span v-if="scope.row.conceptName.length<9">{{scope.row.conceptName}}</span>
-                    </template>
-                </el-table-column>
-                <el-table-column
-                        prop="description"
-                        label="描述"
-                        width="160">
-                    <template slot-scope="scope">
-                        <el-tooltip v-if="scope.row.description.length>8" class="item" effect="dark" :content="scope.row.description" placement="top">
-                            <span>{{scope.row.description.slice(0,8)+'...'}}</span>
-                        </el-tooltip>
-                        <span v-if="scope.row.description.length<9">{{scope.row.description}}</span>
-                    </template>
-                </el-table-column>
-                <el-table-column
-                        label="状态">
-                    <template slot-scope="scope">
-                          <span>
-                            {{scope.row.status === 0?'禁用':'启用'}}
-                          </span>
-                    </template>
-                </el-table-column>
-                <el-table-column
-                        prop="modifierName"
-                        label="操作人">
-                </el-table-column>
-                <el-table-column
-                        prop="gmtModified"
-                        label="操作时间"
-                        width="180">
-                </el-table-column>
-                <el-table-column
-                        label="操作"
-                        width="180" fixed="right">
-                    <template slot-scope="scope">
-                        <el-button type="text" size="small" @click="editData(scope.row)">修改</el-button>
-                        <span style="margin:0 3px;">|</span>
-                        <el-button type="text" size="small" @click="editData(scope.row,true)">复制</el-button>
-                        <span style="margin:0 3px;">|</span>
-                        <el-button type="text" size="small" :class="scope.row.status === 0?'':'unvailable'" @click="showDelDialog(scope.row)">{{scope.row.status === 0?'启用':'禁用'}}</el-button>
-                        <span style="margin:0 3px;">|</span>
-                        <el-button type="text" size="small" class="delete" @click="showDelDialog(scope.row,1)">删除</el-button>
-                    </template>
-                </el-table-column>
-            </el-table>
-            <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>
+    <crumbs title="诊断依据维护" :minWidth="titleWidth" class="knowledgeTitle">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item label="疾病名称:">
+          <el-input size="mini" v-model="filter.conceptName" placeholder="输入疾病名称" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="描述:">
+          <el-input size="mini" v-model="filter.description" placeholder="输入描述" clearable></el-input>
+        </el-form-item>
+        <el-form-item label="状态:">
+          <el-select v-model="filter.status" clearable placeholder="请选择" size="mini">
+            <el-option
+              v-for="item in stateSelect"
+              :key="item.id"
+              :label="item.name"
+              :value="item.id"
+            ></el-option>
+          </el-select>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">确认</el-button>
+        </el-form-item>
+        <el-form class="secLine">
+          <el-form-item>
+            <el-button size="mini" @click="addRule" type="warning" style="margin:0 10px">+ 新增诊断依据</el-button>
+            <el-button size="mini" @click="update">更新数据</el-button>
+          </el-form-item>
+        </el-form>
+      </el-form>
+    </crumbs>
+    <div class="contents knowledgeContents">
+      <el-table :data="list" border style="width: 100%">
+        <el-table-column type="index" :index="indexMethod" label="编号" width="60"></el-table-column>
+        <el-table-column prop="conceptName" label="疾病名称" width="160">
+          <template slot-scope="scope">
+            <el-tooltip
+              v-if="scope.row.conceptName.length>8"
+              class="item"
+              effect="dark"
+              :content="scope.row.conceptName"
+              placement="top"
+            >
+              <span>{{scope.row.conceptName.slice(0,8)+'...'}}</span>
+            </el-tooltip>
+            <span v-if="scope.row.conceptName.length<9">{{scope.row.conceptName}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="description" label="描述" width="160">
+          <template slot-scope="scope">
+            <el-tooltip
+              v-if="scope.row.description.length>8"
+              class="item"
+              effect="dark"
+              :content="scope.row.description"
+              placement="top"
+            >
+              <span>{{scope.row.description.slice(0,8)+'...'}}</span>
+            </el-tooltip>
+            <span v-if="scope.row.description.length<9">{{scope.row.description}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="状态">
+          <template slot-scope="scope">
+            <span>{{scope.row.status === 0?'禁用':'启用'}}</span>
+          </template>
+        </el-table-column>
+        <el-table-column prop="modifierName" label="操作人"></el-table-column>
+        <el-table-column prop="gmtModified" label="操作时间" width="180"></el-table-column>
+        <el-table-column label="操作" width="180" fixed="right">
+          <template slot-scope="scope">
+            <el-button type="text" size="small" @click="editData(scope.row)">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button type="text" size="small" @click="editData(scope.row,true)">复制</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              type="text"
+              size="small"
+              :class="scope.row.status === 0?'':'unvailable'"
+              @click="showDelDialog(scope.row)"
+            >{{scope.row.status === 0?'启用':'禁用'}}</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              type="text"
+              size="small"
+              class="delete"
+              @click="showDelDialog(scope.row,1)"
+            >删除</el-button>
+          </template>
+        </el-table-column>
+      </el-table>
+      <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>
 </template>
 
 <script>
-    import api from '@api/zskDiagBase.js';
-    import config from '@api/config.js';
-    import utils from '@api/utils.js';
+import api from '@api/zskDiagBase.js';
+import config from '@api/config.js';
+import utils from '@api/utils.js';
 
-    export default {
-        name: 'ZskDiagBase',
-        data: function () {
-            return {
-                list: [],
-                stateSelect:[
-                    {id:1,name:'启用'},
-                    {id:0,name:'禁用'},
-                ],
-                ruleTypeList:[],
-                searched: false,
-                filter:{
-                    conceptName:'',
-                    description:'',
-                    status:''
-                },
-                cacheData: {},
-                currentPage: 1,
-                pageSize: config.pageSize,
-                pageSizeArr:config.pageSizeArr,
-                pageLayout:config.pageLayout,
-                total: 0,
-                titleWidth:'1070px' //头部最小宽度
+export default {
+  name: 'ZskDiagBase',
+  data: function() {
+    return {
+      list: [],
+      stateSelect: [
+        { id: 1, name: '启用' },
+        { id: 0, name: '禁用' }
+      ],
+      ruleTypeList: [],
+      searched: false,
+      filter: {
+        conceptName: '',
+        description: '',
+        status: ''
+      },
+      cacheData: {},
+      currentPage: 1,
+      pageSize: config.pageSize,
+      pageSizeArr: config.pageSizeArr,
+      pageLayout: config.pageLayout,
+      total: 0,
+      titleWidth: '1070px' //头部最小宽度
+    };
+  },
+  created() {
+    const param = this.$route.params;
+    if (param.currentPage) {
+      this.inCurrentPage = param.currentPage;
+      this.filter = param.filter;
+    }
+    this.getTypeList();
+    const that = this;
+    //返回时避免参数未赋值就获取列表
+    setTimeout(function() {
+      that.getDataList();
+    });
+  },
+  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: {
+    getDict() {
+      api
+        .zskgetDict()
+        .then(res => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            localStorage.setItem(
+              'zskDiagDicts',
+              `{"onlyNum":"${data['24'][0].val}","onlyTxt":"${data['25'][0].val}"}`
+            );
+          }
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+    getTypeList() {
+      this.getDict();
+      api
+        .getTypesList({ planCode: 'dis' })
+        .then(res => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            localStorage.setItem('zskDiagList', JSON.stringify(data));
+          }
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+    handleSizeChange(val) {
+      this.pageSize = val;
+      this.currentPage = utils.getCurrentPage(
+        this.currentPage,
+        this.total,
+        this.pageSize
+      );
+      this.getDataList();
+    },
+    addRule() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      this.$router.push({ name: 'AddZskDiagBase', params: pam });
+    },
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList(1);
+    },
+    getDataList(flag, 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
+        .diagBasePage(params)
+        .then(res => {
+          loading.close();
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            for (let j = 0; j < data.records.length; j++) {
+              data.records[j].condition =
+                data.records[j].parStatus == '1' ? '启用' : '禁用';
             }
-        },
-        created() {
-            const param = this.$route.params;
-            if(param.currentPage){
-                this.inCurrentPage = param.currentPage;
-                this.filter = param.filter
+            this.list = data.records;
+            if (!flag) {
+              //搜索时不缓存
+              this.cacheData[params.current] = data.records;
+            } else {
+              this.cacheData = {};
             }
-            this.getTypeList();
-            const that = this;
-            //返回时避免参数未赋值就获取列表
-            setTimeout(function(){
-                that.getDataList();
-            });
-        },
-        watch: {
-            'filter': {
-                handler: function () {
-                    this.searched = false;
-                },
-                deep: true
+            this.total = data.total;
+            if (this.inCurrentPage !== undefined) {
+              this.currentPage = this.inCurrentPage;
+              this.inCurrentPage = undefined;
             }
-        },
-        // beforeRouteEnter(to, from, next) {
-        //     next(vm => {
-        //         //const pm = to.param;
-        //         Object.assign(vm, to.params);
-        //         vm.inCurrentPage=to.params.currentPage;
-        //     })
-        // },
-        methods: {
-            getDict(){
-                api.zskgetDict().then((res) => {
-                    if (res.data.code == '0') {
-                        const data = res.data.data;
-                        localStorage.setItem("zskDiagDicts",`{"onlyNum":"${data['24'][0].val}","onlyTxt":"${data['25'][0].val}"}`);
-                    }
-                }).catch((error) => {
-                    console.log(error);
-                });
-            },
-            getTypeList(){
-                this.getDict();
-                api.getTypesList({planCode:'dis'}).then((res) => {
-                    if (res.data.code == '0') {
-                        const data = res.data.data;
-                        localStorage.setItem("zskDiagList",JSON.stringify(data));
-                    }
-                }).catch((error) => {
-                    console.log(error);
-                });
-            },
-            handleSizeChange(val){
-                this.pageSize = val;
-                this.currentPage = utils.getCurrentPage(this.currentPage, this.total, this.pageSize);
-                this.getDataList();
-            },
-            addRule(){
-                const pam = this.searched ? {
-                    currentPage: this.currentPage,
-                    pageSize:this.pageSize,
-                    filter: this.filter
-                } : {currentPage: this.currentPage,
-                    pageSize:this.pageSize};
-                this.$router.push({name: 'AddZskDiagBase', params: pam});
-            },
-            filterDatas(){
-                this.currentPage = 1;
-                this.getDataList(1);
-            },
-            getDataList(flag,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.diagBasePage(params).then((res) => {
-                    loading.close();
-                    if (res.data.code == '0') {
-                        const data = res.data.data;
-                        for(let j = 0;j < data.records.length;j++){
-                            data.records[j].condition = (data.records[j].parStatus == '1'?'启用':'禁用')
-                        }
-                        this.list = data.records;
-                        if(!flag){//搜索时不缓存
-                            this.cacheData[params.current] = data.records;
-                        }else{
-                            this.cacheData = {}
-                        }
-                        this.total = data.total;
-                        if(this.inCurrentPage!==undefined){
-                            this.currentPage=this.inCurrentPage;
-                            this.inCurrentPage = undefined;
-                        }
-                    }else{
-                        this.warning(res.data.msg||'获取列表数据失败');
-                    }
-                }).catch((error) => {
-                    loading.close();
-                    console.log(error);
-                });
-            },
-            getFilterItems(isTurnPage) {
-                //翻页时筛选条件没点确定则清空
-                if(isTurnPage&&!this.searched){
-                    this.clearFilter();
-                };
-                const param = {
-                    current: this.inCurrentPage||this.currentPage,
-                    size: this.pageSize,
-                    conceptName: this.filter.conceptName,
-                    description: this.filter.description,
-                    status:this.filter.status
-                };
-                return param;
-            },
-            indexMethod(index) {
-                return ((this.currentPage - 1) * this.pageSize) + index + 1;
-            },
-            currentChange(next) {
-                this.currentPage = next;
-                /*if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
+          } else {
+            this.warning(res.data.msg || '获取列表数据失败');
+          }
+        })
+        .catch(error => {
+          loading.close();
+          console.log(error);
+        });
+    },
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.clearFilter();
+      }
+      const param = {
+        current: this.inCurrentPage || this.currentPage,
+        size: this.pageSize,
+        conceptName: this.filter.conceptName,
+        description: this.filter.description,
+        status: this.filter.status
+      };
+      return param;
+    },
+    indexMethod(index) {
+      return (this.currentPage - 1) * this.pageSize + index + 1;
+    },
+    currentChange(next) {
+      this.currentPage = next;
+      /*if (this.cacheData[next]) {       //如果已请求过该页数据,则使用缓存不重复请求
                   this.list = this.cacheData[next];
                 } else {*/
-                this.getDataList(1,true);
-                //}
-            },
-            warning(msg,type){
-                this.$message({
-                    showClose: true,
-                    message:msg,
-                    type:type||'warning'
-                })
-            },
-            showConfirmDialog(msg,resolve){
-                this.$alert(msg, '提示', {
-                    confirmButtonText: '确定',
-                    type: 'warning'
-                }).then(() => {
-                    resolve();
-                }).catch(() => {});
-            },
-            editData(row,isCopy){
-                const pam = this.searched ? {
-                    currentPage: this.currentPage,
-                    pageSize:this.pageSize,
-                    filter: this.filter
-                } : {currentPage: this.currentPage,
-                    pageSize:this.pageSize};
-                api.diagBaseGetDetail({id:row.id}).then((res) => {
-                    if (res.data.code == '0') {
-                        const data = res.data.data;
-                        this.$router.push({name:'AddZskDiagBase',params:{...pam,data:{...row,klDiagnoseTypeVO:data},copy:isCopy}});
-                    }
-                }).catch((error) => {
-                    this.warning('获取详情失败,请重试')
-                });
-            },
-            showDelDialog(row,isDelete){
-                const params = {
-                    id:row.id
-                };
-                const txt=row.status===0?'重新启用':'禁用';
-                const warningTxt = isDelete?'是否删除该诊断依据?可能对现有系统造成影响':'是否'+txt+'该诊断依据?';
-                const handleFn = isDelete?api.diagBaseDelete:(row.status===0?api.diagBaseApply:api.diagBaseStop);
-                this.showConfirmDialog(warningTxt,()=>{
-                    handleFn(params).then((res)=>{
-                        if(res.data.code=='0'){
-                            if(!this.searched){
-                                //未点确认时清空搜索条件
-                                this.clearFilter();
-                            }
-                            if(isDelete){       //恢复成功后跳转到筛选条件的首页
-                                this.currentPage = 1;
-                            } else {
-                                if (this.filter.status!==''&&this.list.length === 1){
-                                    //有启用状态筛选条件且当前页只有最后一条数据删除时,删除成功后跳转到前一页
-                                    this.currentPage = this.currentPage===1?1:this.currentPage-1;
-                                }
-                            }
-                            this.warning(res.data.msg||'操作成功','success');
-                            this.getDataList();
-                        }else{
-                            this.warning(res.data.msg);
-                        }
-                    }).catch((error)=>{
-                        this.warning(error);
-                    })
-                });
-            },
-            clearFilter(){
-                this.filter={
-                    conceptName:'',
-                    description:'',
-                    status:''
-                };
-            },
-            update(){
-                const loading = this.$loading({
-                    lock: true,
-                    text: 'Loading',
-                    spinner: 'el-icon-loading',
-                    background: 'rgba(0, 0, 0, 0.7)'
-                });
-                api.updateDiagBase().then((res) => {
-                    loading.close();
-                    if (res.data.code == '0') {
-                        this.warning('更新成功','success');
-                        this.getDataList();
-                    }else{
-                        this.warning(res.data.msg||'更新失败,请重试');
-                    }
-                }).catch((error) => {
-                    loading.close();
-                    this.warning('更新失败,请重试')
-                });
-            },
-        }
+      this.getDataList(1, true);
+      //}
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$alert(msg, '提示', {
+        confirmButtonText: '确定',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
+    },
+    editData(row, isCopy) {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            pageSize: this.pageSize,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage, pageSize: this.pageSize };
+      api
+        .diagBaseGetDetail({ id: row.id })
+        .then(res => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            this.$router.push({
+              name: 'AddZskDiagBase',
+              params: {
+                ...pam,
+                data: { ...row, klDiagnoseTypeVO: data },
+                copy: isCopy
+              }
+            });
+          }
+        })
+        .catch(error => {
+          this.warning('获取详情失败,请重试');
+        });
+    },
+    showDelDialog(row, isDelete) {
+      const params = {
+        id: row.id
+      };
+      const txt = row.status === 0 ? '重新启用' : '禁用';
+      const warningTxt = isDelete
+        ? '是否删除该诊断依据?可能对现有系统造成影响'
+        : '是否' + txt + '该诊断依据?';
+      const handleFn = isDelete
+        ? api.diagBaseDelete
+        : row.status === 0
+        ? api.diagBaseApply
+        : api.diagBaseStop;
+      this.showConfirmDialog(warningTxt, () => {
+        handleFn(params)
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.clearFilter();
+              }
+              if (isDelete) {
+                //恢复成功后跳转到筛选条件的首页
+                this.currentPage = 1;
+              } else {
+                if (this.filter.status !== '' && this.list.length === 1) {
+                  //有启用状态筛选条件且当前页只有最后一条数据删除时,删除成功后跳转到前一页
+                  this.currentPage =
+                    this.currentPage === 1 ? 1 : this.currentPage - 1;
+                }
+              }
+              this.warning(res.data.msg || '操作成功', 'success');
+              this.getDataList();
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch(error => {
+            this.warning(error);
+          });
+      });
+    },
+    clearFilter() {
+      this.filter = {
+        conceptName: '',
+        description: '',
+        status: ''
+      };
+    },
+    update() {
+      const loading = this.$loading({
+        lock: true,
+        text: 'Loading',
+        spinner: 'el-icon-loading',
+        background: 'rgba(0, 0, 0, 0.7)'
+      });
+      api
+        .updateDiagBase()
+        .then(res => {
+          loading.close();
+          if (res.data.code == '0') {
+            this.warning('更新成功', 'success');
+            this.getDataList();
+          } else {
+            this.warning(res.data.msg || '更新失败,请重试');
+          }
+        })
+        .catch(error => {
+          loading.close();
+          this.warning('更新失败,请重试');
+        });
     }
+  }
+};
 </script>
 
 <style lang="less" scoped>
-    @import "../../less/admin.less";
-    /deep/ .container.knowledgeTitle {
-        height: 40px;
-        min-width: 970px!important;
-    }
-    .demo-form-inline{
-        margin: 0 20px 0 0;
-    }
-    /deep/ .contents.knowledgeContents {
-        padding: 64px 20px 0;
-    }
-    /deep/ .secLine.el-form {
-        float: right;
-        display: block;
-        position: relative;
-        top: -1px;
-    }
-    .delete{
-        color: red;
-    }
-    .review{
-        color: #22ccc8;
-    }
-    .el-table .cell{
-        overflow: hidden;
-        white-space: nowrap;
-    }
-    #upFile{
-        display: none !important;
-    }
-    .unvailable{
-        color: #FE7D3D;
-        &:hover,&:active,&:focus{
-            color: #f19061;
-        }
-    }
+@import '../../less/admin.less';
+/deep/ .container.knowledgeTitle {
+  height: 40px;
+  min-width: 970px !important;
+}
+.demo-form-inline {
+  margin: 0 20px 0 0;
+}
+/deep/ .contents.knowledgeContents {
+  padding: 64px 20px 0;
+}
+/deep/ .secLine.el-form {
+  float: right;
+  display: block;
+  position: relative;
+  top: -1px;
+}
+.delete {
+  color: red;
+}
+.review {
+  color: #22ccc8;
+}
+.el-table .cell {
+  overflow: hidden;
+  white-space: nowrap;
+}
+#upFile {
+  display: none !important;
+}
+.unvailable {
+  color: #fe7d3d;
+  &:hover,
+  &:active,
+  &:focus {
+    color: #f19061;
+  }
+}
 </style>

+ 3 - 0
src/components/knowledgeExtra/DiagBaseGroup.vue

@@ -47,6 +47,9 @@
             return {
             }
         },
+        mounted(){
+            console.log(this.data)
+        },
         computed:{
             len:function(){
                 return util.delNullObj(this.data.klDiagnoseDetail).length;

+ 433 - 366
src/components/knowledgeExtra/DiagBaseItem.vue

@@ -1,385 +1,452 @@
 <template>
-    <div class="groups-cont" v-if="groupData">
-        <!--<el-form ref="groupData" label-width="150px" class="sub-condition-form" :model="groupData" :rules="rules">-->
-        <div class="sub-condition-form">
-        <span v-if="!hideDel" class="del-btn"  @click="delRule">删除</span><!--:class="isLast?'disable del-btn':'del-btn'"-->
-            <el-form-item label="基础依据名称:" :key="0" :prop="ruleLine+ind+'.basDescription'">
-                <el-input v-model.trim = "groupData.basDescription" clearable></el-input>
+  <div class="groups-cont" v-if="groupData">
+    <!--<el-form ref="groupData" label-width="150px" class="sub-condition-form" :model="groupData" :rules="rules">-->
+    <div class="sub-condition-form">
+      <span v-if="!hideDel" class="del-btn" @click="delRule">删除</span>
+      <!--:class="isLast?'disable del-btn':'del-btn'"-->
+      <el-form-item label="基础依据名称:" :key="0" :prop="ruleLine+ind+'.basDescription'">
+        <el-input v-model.trim="groupData.basDescription" clearable></el-input>
+      </el-form-item>
+      <el-form-item label="基础依据类型:" :key="1" :prop="ruleLine+ind+'.basType'">
+        <el-select
+          v-model="groupData.basType"
+          id="basTypeRef"
+          placeholder="请选择"
+          size="small"
+          @change="basTypeChange"
+        >
+          <el-option v-for="item in baseTypes" :key="item.id" :label="item.name" :value="item.type"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item v-if="!showRegx" :key="2" label="基础依据术语类型:" :prop="ruleLine+ind+'.basLibType'">
+        <el-select
+          v-model="groupData.basLibType"
+          placeholder="请选择"
+          size="small"
+          :disabled="showRegx"
+          @change="basLibTypeChange"
+        >
+          <el-option
+            v-for="item in baseTermTypeList"
+            :key="item.id"
+            :label="item.name"
+            :value="Number(item.code)"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item v-if="showRegx" :key="3" label="基础依据术语类型:" class="is-required">
+        <el-input disabled v-model="basTypeName"></el-input>
+      </el-form-item>
+      <el-form-item
+        v-if="!showRegx"
+        :key="4"
+        class="addDepartFormItem"
+        label="医学标准术语:"
+        :prop="ruleLine+ind+'.basConceptId'"
+      >
+        <el-select
+          clearable
+          remote
+          filterable
+          :remote-method="searchConcept"
+          v-model.trim="groupData.basConceptId"
+          @change="conceptChange"
+        >
+          <el-option
+            v-for="item in conceptList"
+            :key="item.conceptId"
+            :label="item.conceptName"
+            :value="item.conceptId"
+          ></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        :key="5"
+        v-if="groupData.basType===2&&!onlyNum&&!onlyTxt"
+        label="选择类型:"
+        :prop="ruleLine+ind+'.dataType'"
+      >
+        <el-select
+          v-model="groupData.dataType"
+          placeholder="请选择"
+          size="small"
+          @change="dataTypeChange"
+        >
+          <el-option v-for="item in dataTypes" :key="item.id" :label="item.name" :value="item.id"></el-option>
+        </el-select>
+      </el-form-item>
+      <el-form-item
+        class="min-margin"
+        :key="6"
+        v-if="(!showRegx&&groupData.dataType==='1')||onlyNum"
+        label="最大值:"
+      >
+        <div class="select-item clearfix">
+          <el-col :span="3">
+            <el-form-item :prop="ruleLine+ind+'.maxOperator'">
+              <el-select v-model="groupData.maxOperator" placeholder="请选择" size="small" clearable>
+                <el-option
+                  v-for="item in operMaxList"
+                  :key="item.key"
+                  :label="item.name"
+                  :value="item.key"
+                ></el-option>
+              </el-select>
             </el-form-item>
-            <el-form-item label="基础依据类型:" :key="1" :prop="ruleLine+ind+'.basType'">
-                <el-select v-model="groupData.basType"
-                           id="basTypeRef"
-                           placeholder="请选择"
-                           size="small"
-                           @change="basTypeChange">
-                    <el-option
-                            v-for="item in baseTypes"
-                            :key="item.id"
-                            :label="item.name"
-                            :value="item.type">
-                    </el-option>
-                </el-select>
+          </el-col>
+          <el-col :span="3">
+            <el-form-item :prop="ruleLine+ind+'.maxVal'">
+              <el-input type="text" v-model="groupData.maxVal" placeholder="填写数值" />
             </el-form-item>
-            <el-form-item v-if="!showRegx" :key="2" label="基础依据术语类型:" :prop="ruleLine+ind+'.basLibType'">
-                <el-select v-model="groupData.basLibType"
-                           placeholder="请选择"
-                           size="small"
-                           :disabled="showRegx" @change="basLibTypeChange">
-                    <el-option
-                            v-for="item in baseTermTypeList"
-                            :key="item.id"
-                            :label="item.name"
-                            :value="Number(item.code)">
-                    </el-option>
-                </el-select>
+          </el-col>
+          <el-col :span="3">
+            <el-form-item prop="maxUnit">
+              <el-input type="text" v-model.trim="groupData.maxUnit" placeholder="填写单位" />
             </el-form-item>
-            <el-form-item v-if="showRegx" :key="3" label="基础依据术语类型:" class="is-required">
-                <el-input disabled v-model="basTypeName"></el-input>
-            </el-form-item>
-            <el-form-item v-if="!showRegx" :key="4" class="addDepartFormItem" label="医学标准术语:" :prop="ruleLine+ind+'.basConceptId'">
-                <el-select clearable remote filterable :remote-method="searchConcept" v-model.trim="groupData.basConceptId" @change="conceptChange">
-                    <el-option
-                            v-for="item in conceptList"
-                            :key="item.conceptId"
-                            :label="item.conceptName"
-                            :value="item.conceptId">
-                    </el-option>
-                </el-select>
-            </el-form-item>
-            <el-form-item :key="5" v-if="groupData.basType===2&&!onlyNum&&!onlyTxt" label="选择类型:" :prop="ruleLine+ind+'.dataType'">
-                <el-select v-model="groupData.dataType"
-                           placeholder="请选择"
-                           size="small" @change="dataTypeChange">
-                    <el-option
-                            v-for="item in dataTypes"
-                            :key="item.id"
-                            :label="item.name"
-                            :value="item.id">
-                    </el-option>
-                </el-select>
-            </el-form-item>
-            <el-form-item class="min-margin" :key="6" v-if="(!showRegx&&groupData.dataType==='1')||onlyNum" label="最大值:">
-                <div class="select-item clearfix">
-                    <el-col :span="3">
-                        <el-form-item :prop="ruleLine+ind+'.maxOperator'">
-                            <el-select v-model="groupData.maxOperator"
-                                       placeholder="请选择"
-                                       size="small" clearable>
-                                <el-option
-                                        v-for="item in operMaxList"
-                                        :key="item.key"
-                                        :label="item.name"
-                                        :value="item.key">
-                                </el-option>
-                            </el-select>
-                        </el-form-item>
-                    </el-col>
-                    <el-col :span="3">
-                        <el-form-item :prop="ruleLine+ind+'.maxVal'">
-                            <el-input type="text" v-model="groupData.maxVal" placeholder="填写数值"/>
-                        </el-form-item>
-                    </el-col>
-                    <el-col :span="3">
-                        <el-form-item prop="maxUnit">
-                            <el-input  type="text" v-model.trim="groupData.maxUnit" placeholder="填写单位"/>
-                        </el-form-item>
-                    </el-col>
-                </div>
-            </el-form-item>
-            <el-form-item class="min-margin" v-if="(!showRegx&&groupData.dataType==='1')||onlyNum" label="最小值:">
-                <div class="select-item clearfix">
-                    <el-col :span="3">
-                        <el-form-item :prop="ruleLine+ind+'.minOperator'">
-                            <el-select v-model="groupData.minOperator"
-                                       placeholder="请选择"
-                                       size="small" clearable>
-                                <el-option
-                                        v-for="item in operMinList"
-                                        :key="item.name"
-                                        :label="item.name"
-                                        :value="item.name">
-                                </el-option>
-                            </el-select>
-                        </el-form-item>
-                    </el-col>
-                    <el-col :span="3">
-                        <el-form-item :prop="ruleLine+ind+'.minVal'">
-                            <el-input type="text" v-model="groupData.minVal" placeholder="填写数值"/>
-                        </el-form-item>
-                    </el-col>
-                    <el-col :span="3">
-                        <el-form-item prop="minUnit">
-                            <el-input  type="text" v-model.trim="groupData.minUnit" placeholder="填写单位"/>
-                        </el-form-item>
-                    </el-col>
-                </div>
+          </el-col>
+        </div>
+      </el-form-item>
+      <el-form-item
+        class="min-margin"
+        v-if="(!showRegx&&groupData.dataType==='1')||onlyNum"
+        label="最小值:"
+      >
+        <div class="select-item clearfix">
+          <el-col :span="3">
+            <el-form-item :prop="ruleLine+ind+'.minOperator'">
+              <el-select v-model="groupData.minOperator" placeholder="请选择" size="small" clearable>
+                <el-option
+                  v-for="item in operMinList"
+                  :key="item.name"
+                  :label="item.name"
+                  :value="item.name"
+                ></el-option>
+              </el-select>
             </el-form-item>
-            <el-form-item v-if="showRegx" key="v11" label="正则表达式:" :prop="ruleLine+ind+'.eqValue'" class="discDesc">
-                <el-input type="textarea" rows="3" placeholder="请输入正则表达式" v-model.trim="groupData.eqValue"></el-input>
+          </el-col>
+          <el-col :span="3">
+            <el-form-item :prop="ruleLine+ind+'.minVal'">
+              <el-input type="text" v-model="groupData.minVal" placeholder="填写数值" />
             </el-form-item>
-            <el-form-item key="v13" v-if="(!onlyNum&&!showRegx&&groupData.basType===2&&groupData.dataType==='2')||onlyTxt" label="医学内容:" :prop="ruleLine+ind+'.eqValue'" class="discDesc">
-                <el-input placeholder="请输入医学内容" v-model.trim="groupData.eqValue"></el-input>
-                <span class="tip-text">注:可输入升高、降低、阴性、阳性等~</span>
+          </el-col>
+          <el-col :span="3">
+            <el-form-item prop="minUnit">
+              <el-input type="text" v-model.trim="groupData.minUnit" placeholder="填写单位" />
             </el-form-item>
+          </el-col>
         </div>
-        <!--</el-form>-->
+      </el-form-item>
+      <el-form-item
+        v-if="showRegx"
+        key="v11"
+        label="正则表达式:"
+        :prop="ruleLine+ind+'.eqValue'"
+        class="discDesc"
+      >
+        <el-input type="textarea" rows="3" placeholder="请输入正则表达式" v-model.trim="groupData.eqValue"></el-input>
+      </el-form-item>
+      <el-form-item
+        key="v13"
+        v-if="(!onlyNum&&!showRegx&&groupData.basType===2&&groupData.dataType==='2')||onlyTxt"
+        label="医学内容:"
+        :prop="ruleLine+ind+'.eqValue'"
+        class="discDesc"
+      >
+        <el-input placeholder="请输入医学内容" v-model.trim="groupData.eqValue"></el-input>
+        <span class="tip-text">注:可输入升高、降低、阴性、阳性等~</span>
+      </el-form-item>
     </div>
+    <!--</el-form>-->
+  </div>
 </template>
 <script>
-    import api from '@api/zskDiagBase.js';
-    export default {
-        name:'DiagBaseItem',
-        props:['groupData','ind','baseTypes','parInx','inx','hideDel'],
-        data(){
-            return {
-                dicts:{},
-                baseTermTypeList:[],
-                typeList:[],
-                numTypes:'',    //只有数值类型的类型id
-                //basTypeName:'',
-                operMaxList:[
-                    {name:'<=',key:'<='},
-                    {name:'<',key:'<'},
-                ],
-                operMinList:[{name:'>',key:'>'},
-                    {name:'>=',key:'>='},
-                ],
-                dataTypes:[{id:'1',name:'数值类型'},{id:'2',name:'文本类型'}],
-                conceptList:[],
-            }
-        },
-        created(){
-            this.dicts=JSON.parse(localStorage.getItem("zskDiagDicts")||'{}');
-            if(this.groupData){
-                if(this.groupData.maxOperator||this.groupData.minOperator){
-                    this.groupData.dataType='1';
-                }else if(this.groupData.eqValue){
-                    this.groupData.dataType='2';
-                }
-            }
-            this.conceptList=[{conceptName:this.groupData.basLibName,conceptId:this.groupData.basConceptId}];
-            if(this.groupData.basType){
-                const obj = this.baseTypes.find((it)=>it.type===this.groupData.basType);
-                this.baseTermTypeList = obj.subMenuList;
-            }
-        },
-        computed:{
-            basTypeName:function(){
-                return (this.baseTypes.find((it)=>it.type===this.groupData.basType)||{}).name;
-            },
-            onlyNum:function(){
-                const onlyNum =this.dicts['onlyNum']||'&';
-                const codes=onlyNum+',';
-                const type=this.groupData.basLibType;
-                return type&&codes.indexOf(this.groupData.basLibType+',')>-1;
-            },
-            onlyTxt:function(){
-                const onlyTxt =this.dicts['onlyTxt']||'&';
-                const codes=onlyTxt+',';
-                const type=this.groupData.basLibType;
-                return type&&codes.indexOf(this.groupData.basLibType+',')>-1;
-            },
-            ruleLine:function(){
-              return 'klDiagnoseTypeVO.'+this.parInx+'.groupVO.'+this.inx+'.klDiagnoseDetail.';
-            },
-            showRegx:function(){
-              return this.groupData.basType===3||this.groupData.basType===4;
-            },
-        },
-        methods:{
-            dataTypeChange(val){
-                this.groupData.eqOperator=(val==='2'?'=':'');
-                this.clearNumText();
-                delete this.groupData.dataType;     //触发更新
-                this.$set(this.groupData,'dataType',val);
-            },
-            basTypeChange(val){        //基础依据类型修改
-                if(!val){
-                    this.baseTermTypeList =[];
-                    return;
-                }
-                this.groupData.basLibType='';
-                this.groupData.dataType='';
-                this.clearConcept();    //清空医学标准术语
-                this.clearNumText();    //清空数值、医学内容
-                const obj = this.baseTypes.find((it)=>it.type===val);
-                this.baseTermTypeList = obj.subMenuList;
-            },
-            basLibTypeChange(val){        //基础依据术语类型修改
-                this.groupData.basLibType=val;
-                if((this.numTypes+',').indexOf(val+',')>-1){
-                    this.groupData.dataType='1';
-                }else{
-                    this.groupData.dataType='';
-                }
-                this.clearConcept();
-                this.clearNumText();
-            },
-            conceptChange(val){
-                this.groupData.basConceptId=val;
-                if(val){
-                    this.groupData.basLibName=this.conceptList.find((it)=>it.conceptId===val).conceptName;
-                }else{
-                    this.groupData.basLibName='';
-                }
-            },
-            clearConcept(){
-                this.groupData.basConceptId='';
-                this.groupData.basLibName='';
-                this.conceptList=[];
-            },
-            clearNumText(){
-                this.groupData.maxOperator='';
-                this.groupData.maxVal='';
-                this.groupData.maxUnit='';
-                this.groupData.minOperator='';
-                this.groupData.minVal='';
-                this.groupData.minUnit='';
-                this.groupData.eqValue='';
-                this.groupData.eqOperator='';
-            },
-            searchConcept(val){
-                const param = {
-                    excludedConceptIds:[this.groupData.basType],
-                    libType:this.groupData.basLibType,
-                    name:val,
-                };
-                api.searchConcept(param).then((res) => {
-                    if (res.data.code == '0') {
-                        const data = res.data.data;
-                        this.conceptList = data;
-                    }
-                }).catch((error) => {
-                    console.log(error);
-                });
-            },
-            /*addRule(){
+import api from '@api/zskDiagBase.js';
+export default {
+  name: 'DiagBaseItem',
+  props: ['groupData', 'ind', 'baseTypes', 'parInx', 'inx', 'hideDel'],
+  data() {
+    return {
+      dicts: {},
+      baseTermTypeList: [],
+      typeList: [],
+      numTypes: '', //只有数值类型的类型id
+      //basTypeName:'',
+      operMaxList: [
+        { name: '<=', key: '<=' },
+        { name: '<', key: '<' }
+      ],
+      operMinList: [
+        { name: '>', key: '>' },
+        { name: '>=', key: '>=' }
+      ],
+      dataTypes: [
+        { id: '1', name: '数值类型' },
+        { id: '2', name: '文本类型' }
+      ],
+      conceptList: []
+    };
+  },
+  created() {
+    this.dicts = JSON.parse(localStorage.getItem('zskDiagDicts') || '{}');
+    if (this.groupData) {
+      if (this.groupData.maxOperator || this.groupData.minOperator) {
+        this.groupData.dataType = '1';
+      } else if (this.groupData.eqValue) {
+        this.groupData.dataType = '2';
+      }
+    }
+    this.conceptList = [
+      {
+        conceptName: this.groupData.basLibName,
+        conceptId: this.groupData.basConceptId
+      }
+    ];
+    if (this.groupData.basType) {
+      const obj = this.baseTypes.find(it => it.type === this.groupData.basType);
+      this.baseTermTypeList = obj.subMenuList;
+    }
+  },
+  computed: {
+    basTypeName: function() {
+      return (
+        this.baseTypes.find(it => it.type === this.groupData.basType) || {}
+      ).name;
+    },
+    onlyNum: function() {
+      const onlyNum = this.dicts['onlyNum'] || '&';
+      const codes = onlyNum + ',';
+      const type = this.groupData.basLibType;
+      return type && codes.indexOf(this.groupData.basLibType + ',') > -1;
+    },
+    onlyTxt: function() {
+      const onlyTxt = this.dicts['onlyTxt'] || '&';
+      const codes = onlyTxt + ',';
+      const type = this.groupData.basLibType;
+      return type && codes.indexOf(this.groupData.basLibType + ',') > -1;
+    },
+    ruleLine: function() {
+      return (
+        'klDiagnoseTypeVO.' +
+        this.parInx +
+        '.groupVO.' +
+        this.inx +
+        '.klDiagnoseDetail.'
+      );
+    },
+    showRegx: function() {
+      return this.groupData.basType === 3 || this.groupData.basType === 4;
+    }
+  },
+  methods: {
+    dataTypeChange(val) {
+      this.groupData.eqOperator = val === '2' ? '=' : '';
+      this.clearNumText();
+      delete this.groupData.dataType; //触发更新
+      this.$set(this.groupData, 'dataType', val);
+    },
+    basTypeChange(val) {
+      //基础依据类型修改
+      if (!val) {
+        this.baseTermTypeList = [];
+        return;
+      }
+      this.groupData.basLibType = '';
+      this.groupData.dataType = '';
+      this.clearConcept(); //清空医学标准术语
+      this.clearNumText(); //清空数值、医学内容
+      const obj = this.baseTypes.find(it => it.type === val);
+      this.baseTermTypeList = obj.subMenuList;
+      console.log(this.groupData)
+    },
+    basLibTypeChange(val) {
+      console.log(val)
+      //基础依据术语类型修改
+      this.groupData.basLibType = val;
+      if ((this.numTypes + ',').indexOf(val + ',') > -1) {
+        this.groupData.dataType = '1';
+      } else {
+        this.groupData.dataType = '';
+      }
+      this.clearConcept();
+      this.clearNumText();
+      console.log(this.groupData)
+    },
+    conceptChange(val) {
+      console.log(this.groupData.basType)
+      console.log(this.groupData.basLibType)
+      this.groupData.basConceptId = val;
+      if (val) {
+        this.groupData.basLibName = this.conceptList.find(
+          it => it.conceptId === val
+        ).conceptName;
+      } else {
+        this.groupData.basLibName = '';
+      }
+    },
+    clearConcept() {
+      this.groupData.basConceptId = '';
+      this.groupData.basLibName = '';
+      this.conceptList = [];
+    },
+    clearNumText() {
+      this.groupData.maxOperator = '';
+      this.groupData.maxVal = '';
+      this.groupData.maxUnit = '';
+      this.groupData.minOperator = '';
+      this.groupData.minVal = '';
+      this.groupData.minUnit = '';
+      this.groupData.eqValue = '';
+      this.groupData.eqOperator = '';
+    },
+    searchConcept(val) {
+      const param = {
+        excludedConceptIds: [this.groupData.basType],
+        libType: this.groupData.basLibType,
+        name: val
+      };
+      api
+        .searchConcept(param)
+        .then(res => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            this.conceptList = data;
+          }
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+    /*addRule(){
                 this.$emit("addRule");
                 this.$emit('setRules');
             },*/
-            delRule(){
-                this.$emit("delRule",this.ind);
-                this.$emit('setRules');
-            },
-            warning(msg,type){
-                this.$message({
-                    showClose: true,
-                    message:msg,
-                    type:type||'warning'
-                })
-            },
-            showConfirmDialog(msg,resolve){
-                this.$alert(msg, '提示', {
-                    confirmButtonText: '确定',
-                    type: 'warning'
-                }).then(() => {
-                    resolve();
-                }).catch(() => {});
-            },
-        }
+    delRule() {
+      this.$emit('delRule', this.ind);
+      this.$emit('setRules');
+    },
+    warning(msg, type) {
+      this.$message({
+        showClose: true,
+        message: msg,
+        type: type || 'warning'
+      });
+    },
+    showConfirmDialog(msg, resolve) {
+      this.$alert(msg, '提示', {
+        confirmButtonText: '确定',
+        type: 'warning'
+      })
+        .then(() => {
+          resolve();
+        })
+        .catch(() => {});
     }
+  }
+};
 </script>
 <style lang="less">
-    .groups-cont{
-        background: #fff;
-        border-bottom:2px solid #F5F5F5;
-        .conceptItem{
-            padding: 0 10px;
-            cursor: pointer;
-            height: 32px;
-            line-height: 32px;
-            &:hover{
-                background: #ebedf1;
-            }
-        }
-        .sub-condition-form{
-            padding:10px 20px 9px;
-            position: relative;
-            border-bottom:1px solid #F5F5F5;
-            .del-btn{
-                color: #FF5B5B;
-                cursor: pointer;
-                position: absolute;
-                right: 20px;
-                top:20px;
-                z-index: 1;
-                &.disable{
-                    color: #B8B8B8;
-                }
-            }
-        }
-        .el-input__icon{
-            line-height: 32px;
-        }
-        .select-item{
-            &>div{
-                float: left;
-                margin-right: 10px;
-            }
-            .el-input{
-                width: auto;
-            }
-            input{
-                width: 95px;
-                line-height: 32px;
-                height: 32px;
-            }
-        }
-        .el-input,.el-input__inner{
-            width: 190px;
-            line-height: 32px;
-            height: 32px;
-        }
-        .el-button--danger.is-plain{
-            background: none;
-        }
-        .itemList {
-            position: absolute;
-            // display: none;
-            background: #fff;
-            width: 188px;
-            max-height: 160px;
-            border: 1px solid #DCDFE6;
-            left: 0;
-            top: 37px;
-            z-index: 2;
-            overflow-y: auto;
-        }
-        .el-form-item{
-            margin-bottom: 6px;
-            &.min-margin{
-                margin-bottom: 0;
-                position: relative;
-                .el-form-item__content{
-                    position: unset;
-                }
-                .el-form-item__error{
-                    top:10px;
-                    left: 460px;
-                    white-space: normal;
-                    width: 260px;
-                }
-            }
-            .el-textarea + .el-form-item__error{
-                top:80px;
-                left: 0;
-            }
-            .tip-text + .el-form-item__error{
-                top:40px;
-                left: 0;
-            }
-        }
-
-        .el-input-number{
-            width: 95px;
-        }
-        .el-input-number.is-controls-right .el-input-number__decrease, .el-input-number.is-controls-right .el-input-number__increase{
-            width: 25px;
-            height: 15px;
-            line-height: 16px;
-        }
-        .el-col-3 {
-            width: 94px;
-        }
+.groups-cont {
+  background: #fff;
+  border-bottom: 2px solid #f5f5f5;
+  .conceptItem {
+    padding: 0 10px;
+    cursor: pointer;
+    height: 32px;
+    line-height: 32px;
+    &:hover {
+      background: #ebedf1;
+    }
+  }
+  .sub-condition-form {
+    padding: 10px 20px 9px;
+    position: relative;
+    border-bottom: 1px solid #f5f5f5;
+    .del-btn {
+      color: #ff5b5b;
+      cursor: pointer;
+      position: absolute;
+      right: 20px;
+      top: 20px;
+      z-index: 1;
+      &.disable {
+        color: #b8b8b8;
+      }
+    }
+  }
+  .el-input__icon {
+    line-height: 32px;
+  }
+  .select-item {
+    & > div {
+      float: left;
+      margin-right: 10px;
+    }
+    .el-input {
+      width: auto;
+    }
+    input {
+      width: 95px;
+      line-height: 32px;
+      height: 32px;
     }
+  }
+  .el-input,
+  .el-input__inner {
+    width: 190px;
+    line-height: 32px;
+    height: 32px;
+  }
+  .el-button--danger.is-plain {
+    background: none;
+  }
+  .itemList {
+    position: absolute;
+    // display: none;
+    background: #fff;
+    width: 188px;
+    max-height: 160px;
+    border: 1px solid #dcdfe6;
+    left: 0;
+    top: 37px;
+    z-index: 2;
+    overflow-y: auto;
+  }
+  .el-form-item {
+    margin-bottom: 6px;
+    &.min-margin {
+      margin-bottom: 0;
+      position: relative;
+      .el-form-item__content {
+        position: unset;
+      }
+      .el-form-item__error {
+        top: 10px;
+        left: 460px;
+        white-space: normal;
+        width: 260px;
+      }
+    }
+    .el-textarea + .el-form-item__error {
+      top: 80px;
+      left: 0;
+    }
+    .tip-text + .el-form-item__error {
+      top: 40px;
+      left: 0;
+    }
+  }
+
+  .el-input-number {
+    width: 95px;
+  }
+  .el-input-number.is-controls-right .el-input-number__decrease,
+  .el-input-number.is-controls-right .el-input-number__increase {
+    width: 25px;
+    height: 15px;
+    line-height: 16px;
+  }
+  .el-col-3 {
+    width: 94px;
+  }
+}
 </style>

+ 149 - 140
src/components/knowledgeExtra/DiagBaseType.vue

@@ -1,148 +1,157 @@
 <template>
-    <!--<el-form ref="form" class="add-new-form" label-width="130px" :model="data">-->
-   <div class="add-new-form">
-        <el-form-item label="诊断依据类型:" :prop="'klDiagnoseTypeVO.'+inx+'.conditionType'" class="diag-type">
-            <el-select v-model="data.conditionType"
-                       placeholder="请选择"
-                       size="small">
-                <el-option
-                        v-for="item in typeList"
-                        :key="item.ruleType"
-                        :label="item.name"
-                        :value="item.ruleType">
-                </el-option>
-            </el-select>
-            <span class="tip-text">注:选择诊断依据类型后才能展示基础依据类型~</span>
-        </el-form-item>
-        <DiagBaseGroup v-for="(group,i) in data.groupVO"
-                   ref="groups"
-                   :data="group"
-                   :diagTypeList="baseTypeList"
-                   :inx="i"
-                   :parInx="inx"
-                   :isLast="isLast&&data.groupVO.length===1"
-                   @setRules="setRules"
-                   @addGroup="addGroup"
-                   @delGroup="delGroup"></DiagBaseGroup>
+  <!--<el-form ref="form" class="add-new-form" label-width="130px" :model="data">-->
+  <div class="add-new-form">
+    <el-form-item
+      label="诊断依据类型:"
+      :prop="'klDiagnoseTypeVO.'+inx+'.conditionType'"
+      class="diag-type"
+    >
+      <el-select v-model="data.conditionType" placeholder="请选择" size="small">
+        <el-option
+          v-for="item in typeList"
+          :key="item.ruleType"
+          :label="item.name"
+          :value="item.ruleType"
+        ></el-option>
+      </el-select>
+      <span class="tip-text">注:选择诊断依据类型后才能展示基础依据类型~</span>
+    </el-form-item>
+    <DiagBaseGroup
+      v-for="(group,i) in data.groupVO"
+      ref="groups"
+      :data="group"
+      :diagTypeList="baseTypeList"
+      :inx="i"
+      :parInx="inx"
+      :isLast="isLast&&data.groupVO.length===1"
+      @setRules="setRules"
+      @addGroup="addGroup"
+      @delGroup="delGroup"
+    ></DiagBaseGroup>
     <div class="group-oper">
-        <el-button size="small" @click="addDiag">+新增依据</el-button>
-        <el-button size="small" class="copy-btn" @click="copyDiag"><img src="../../images/copy.png" alt="">复制依据</el-button>
-        <el-button :disabled="isLast" size="small" type="danger" plain @click="delDiag">-删除依据</el-button>
+      <el-button size="small" @click="addDiag">+新增依据</el-button>
+      <el-button size="small" class="copy-btn" @click="copyDiag">
+        <img src="../../images/copy.png" alt />复制依据
+      </el-button>
+      <el-button :disabled="isLast" size="small" type="danger" plain @click="delDiag">-删除依据</el-button>
     </div>
-          </div>
-       <!-- </el-form>-->
-      </template>
+  </div>
+  <!-- </el-form>-->
+</template>
       <script>
-          import DiagBaseGroup from './DiagBaseGroup';
-          import util from '../../api/utils.js'
-          export default {
-              name:'DiagBaseType',
-              props:['data','isLast','inx'],
-              data(){
-                  return {
-                      form:{},
-                      conditionType:'',
-                      typeObj:{},
-                      typeList:[],
-                      /*rules:{
+import DiagBaseGroup from './DiagBaseGroup';
+import util from '../../api/utils.js';
+export default {
+  name: 'DiagBaseType',
+  props: ['data', 'isLast', 'inx'],
+  data() {
+    return {
+      form: {},
+      conditionType: '',
+      typeObj: {},
+      typeList: []
+      /*rules:{
                           conditionType:[]
                       }*/
-                  }
-              },
-              computed:{
-                baseTypeList:function(){
-                    return this.typeObj[this.data.conditionType];
-                }
-              },
-              created(){
-                  this.getTypeList();
-              },
-              methods:{
-                  setRules(){
-                      this.$emit('setRules');
-                  },
-                  getTypeList(){
-                      const typeListData = JSON.parse(localStorage.getItem("zskDiagList"));
-                      this.typeObj=util.formatObj(typeListData,'ruleType');
-                      this.typeList = typeListData;
-                  },
-                  addDiag(){
-                      this.$emit("addDiag",this.inx);
-                  },
-                  delDiag(){
-                      this.$emit("delDiag",this.inx);
-                  },
-                  copyDiag(){
-                      this.$emit("copyDiag",this.inx);
-                  },
-                  addGroup(i){
-                      const temp={
-                          "baseGroup": '',
-                          "conditionGroup": '',
-                          "fitNo": '',
-                          "klDiagnoseDetail": [{
-                              "basConceptId": '',
-                              "basDescription": "",
-                              "basLename": "",
-                              "basLibName": "",
-                              "basLibType": null,
-                              "basType": '',
-                              "eqOperator": "",
-                              "eqUnit": "",
-                              "eqValue": "",
-                              "maxOperator": "",
-                              "maxUnit": "",
-                              "maxVal": "",
-                              "minOperator": "",
-                              "minUnit": "",
-                              "minVal": ""
-                          }]
-                      };
-                      this.data.groupVO.splice(i+1,0,temp);
-                      this.$emit('setRules');
-                  },
-                  delGroup(i){
-                      if(i===0&&this.data.groupVO.length===1){
-                          this.$emit("delDiag",this.inx);
-                          return;
-                      }
-                      this.data.groupVO.splice(i,1);
-                  }
-              },
-              components:{
-                  DiagBaseGroup
-              }
+    };
+  },
+  computed: {
+    baseTypeList: function() {
+      return this.typeObj[this.data.conditionType];
+    }
+  },
+  created() {
+    console.log(this.data)
+    this.getTypeList();
+  },
+  methods: {
+    setRules() {
+      this.$emit('setRules');
+    },
+    getTypeList() {
+      const typeListData = JSON.parse(localStorage.getItem('zskDiagList'));
+      this.typeObj = util.formatObj(typeListData, 'ruleType');
+      this.typeList = typeListData;
+    },
+    addDiag() {
+      this.$emit('addDiag', this.inx);
+    },
+    delDiag() {
+      this.$emit('delDiag', this.inx);
+    },
+    copyDiag() {
+      this.$emit('copyDiag', this.inx);
+    },
+    addGroup(i) {
+      const temp = {
+        baseGroup: '',
+        conditionGroup: '',
+        fitNo: '',
+        klDiagnoseDetail: [
+          {
+            basConceptId: '',
+            basDescription: '',
+            basLename: '',
+            basLibName: '',
+            basLibType: null,
+            basType: '',
+            eqOperator: '',
+            eqUnit: '',
+            eqValue: '',
+            maxOperator: '',
+            maxUnit: '',
+            maxVal: '',
+            minOperator: '',
+            minUnit: '',
+            minVal: ''
           }
-      </script>
+        ]
+      };
+      this.data.groupVO.splice(i + 1, 0, temp);
+      this.$emit('setRules');
+    },
+    delGroup(i) {
+      if (i === 0 && this.data.groupVO.length === 1) {
+        this.$emit('delDiag', this.inx);
+        return;
+      }
+      this.data.groupVO.splice(i, 1);
+    }
+  },
+  components: {
+    DiagBaseGroup
+  }
+};
+</script>
       <style lang="less" scoped>
-          .add-new-form{
-              background: #E3EAF4;
-              padding: 20px 0;
-          }
-          /deep/ .diag-type .el-form-item__error{
-              top: 35px!important;
-              left: 0!important;
-              background: none!important;
-          }
-          .diag-type{
-              background: #fff;
-              margin: 0 20px;
-              padding: 8px 0 15px;
-          }
-          .group-oper{
-              margin: 20px 20px 0 20px;
-              background: #fff;
-              padding: 8px 0 8px 205px;;
-              /*text-align: center;*/
-              .el-button{
-                  margin-right: 60px;
-              }
-              .copy-btn{
-                  border-color:#666;
-                  color: #666;
-                  img{
-                      margin-right: 5px;
-                  }
-              }
-          }
-      </style>
+.add-new-form {
+  background: #e3eaf4;
+  padding: 20px 0;
+}
+/deep/ .diag-type .el-form-item__error {
+  top: 35px !important;
+  left: 0 !important;
+  background: none !important;
+}
+.diag-type {
+  background: #fff;
+  margin: 0 20px;
+  padding: 8px 0 15px;
+}
+.group-oper {
+  margin: 20px 20px 0 20px;
+  background: #fff;
+  padding: 8px 0 8px 205px;
+  /*text-align: center;*/
+  .el-button {
+    margin-right: 60px;
+  }
+  .copy-btn {
+    border-color: #666;
+    color: #666;
+    img {
+      margin-right: 5px;
+    }
+  }
+}
+</style>

BIN
src/images/icon-add.png


BIN
src/images/icon-copy.png


BIN
src/images/icon-delete.png