Browse Source

Squashed commit of the following:

commit feb4417f10171cdf2ba3633f2eb09d57a3dc638a
Author: liucf <liucf@zjlantone.com>
Date:   Fri Jan 25 13:56:49 2019 +0800

    新增icss科室维护
liucf 6 years ago
parent
commit
e9881efec2
5 changed files with 260 additions and 0 deletions
  1. 3 0
      src/api/config.js
  2. 9 0
      src/api/icss.js
  3. 197 0
      src/components/icss/DeptInfo.vue
  4. 47 0
      src/components/icss/DeptInfoDetail.vue
  5. 4 0
      src/routes.js

+ 3 - 0
src/api/config.js

@@ -87,6 +87,9 @@ export default {
     'getTagList': 'api/icssman/questionInfo/list', //标签列表
     'searchTagList': 'api/icssman/questionInfo/index', //标签池检索
     'detailsTagList': 'api/icssman/questionInfo/getByIds', //根据多个标签ID返回标签内容
+    'getDeptInfo': 'api/icssman/deptInfo/getDeptInfo', //科室维护
+    'getDeptInfoDetials': 'api/icssman/deptInfo/getDeptInfoDetials', //科室维护-详情
+    'deleteDeptInfo': 'api/icssman/deptInfo/deleteDeptInfo', //科室维护-删除
 	},
 	menuIconList: { //菜单对应图标
 		'YH-KZT': 'el-icon-menu',

+ 9 - 0
src/api/icss.js

@@ -18,4 +18,13 @@ export default {
     detailsTagList(param) {
         return axios.post(urls.detailsTagList, param)
     },
+    getDeptInfo(param) {//科室维护
+        return axios.post(urls.getDeptInfo, param)
+    },
+    getDeptInfoDetials(param) {//科室维护-详情
+        return axios.post(urls.getDeptInfoDetials, param)
+    },
+    deleteDeptInfo(param) {//科室维护-详情
+        return axios.post(urls.deleteDeptInfo, param)
+    },
 }

+ 197 - 0
src/components/icss/DeptInfo.vue

@@ -0,0 +1,197 @@
+<template>
+    <div>
+        <crumbs title="icss科室维护系统">
+            <el-form :inline="true" class="demo-form-inline">
+                <el-form-item label="科室名称:">
+                    <el-input size="mini" v-model="filter.proName" placeholder="科室名称"></el-input>
+                </el-form-item>
+                <el-form-item>
+                    <el-button size="mini" @click="filterDatas">确认</el-button>
+                    <router-link to="/admin/LT-YXSJWH-TJKS" style="margin:0 10px">
+                        <el-button size="mini" type="warning">添加科室</el-button>
+                    </router-link>
+                </el-form-item>
+            </el-form>
+        </crumbs>
+        <div class="contents">
+            <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="gmtCreate"
+                        label="操作时间"
+                        :show-overflow-tooltip="true">
+                </el-table-column>
+                <el-table-column
+                        prop="name"
+                        label="科室名称">
+                </el-table-column>
+                <el-table-column
+                        prop="userName"
+                        label="操作人"
+                        width="180">
+                </el-table-column>
+                
+                <el-table-column
+                        label="操作" width="200">
+                    <template slot-scope="scope">
+                        <el-button type="text" size="small" @click="toEditProduct(scope.row)">修改</el-button>
+                        <span style="margin:0 3px;">|</span>
+                        <el-button type="text" size="small" @click="showDelDialog(scope.row.id)">删除</el-button>
+                    </template>
+                </el-table-column>
+                <el-table-column
+                        label="详情">
+                    <template slot-scope="scope">
+                        <el-button type="text" size="small" @click="getDetailList(scope.row.id)">详情</el-button>
+                    </template>
+                </el-table-column>
+            </el-table>
+            <el-pagination v-if="total>pageSize"
+                           :current-page.sync="currentPage"
+                           @current-change="currentChange"
+                           background
+                           :page-size="pageSize"
+                           layout="total,prev, pager, next, jumper"
+                           :total="total">
+            </el-pagination>
+        </div>
+
+    </div>
+</template>
+
+<script>
+  import api from '@api/icss.js';
+  import utils from '@api/utils.js';
+
+  export default {
+    name: 'depart-info',
+    data: function () {
+      return {
+        list: [],
+        cacheData: {},
+        currentPage: 1,
+        pageSize: 10,
+        total: 0,
+        linkIn:[],
+        pays:[],
+        filter: {
+          proName: ''
+        }
+      }
+    },
+    created() {
+      this.getDataList();
+    },
+    methods: {
+      toEditProduct(row){
+        this.$router.push({
+          name:'editDeptInfo',
+          params: {info:row}
+        })
+      },
+      filterDatas(){
+        this.currentPage = 1;
+        this.getDataList();
+      },
+      getDataList() {
+        const param = this.getFilterItems();
+        // const param = {
+        //   'name':''
+        // };
+        api.getDeptInfo(param).then((res) => {
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            this.list = data.records;
+            this.cacheData[param.current] = data.records;
+            this.total = data.total;
+          }
+        }).catch((error) => {
+          console.log(error);
+        });
+      },
+      getDetailList(id) {
+        const param = {'id': id,};
+        this.$router.push({name:'DeptInfoDetail', params:{id: id}})
+        /*api.getDeptInfoDetials(param).then((res) => {
+          if (res.data.code == '0') {
+            this.$router.push({name:'DeptInfoDetail', params:{id: id}})
+            // console.log("详情接口调用成功");
+          } else {
+            this.$message({
+              showClose: true,
+              message:res.data.msg,
+              type:'warning'
+            });
+            this.getDataList()  //刷新列表
+          }
+        }).catch((error) => {
+          console.log(error);
+        });*/
+      },
+      getFilterItems() {
+        const param = {
+          name: this.filter.proName,
+          current: this.currentPage,
+          size: this.pageSize
+        };
+        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();
+        }
+      },
+      warning(msg,type){
+        this.$message({
+          showClose: true,
+          message:msg,
+          type:type||'warning'
+        })
+      },
+      showConfirmDialog(msg,resolve){
+        this.$alert(msg, '提示', {
+          confirmButtonText: '确定',
+          type: 'warning'
+        }).then(() => {
+          resolve();
+        }).catch(() => {});
+      },
+      showDelDialog(id){
+        this.showConfirmDialog('是否删除该科室?',()=>{
+          api.deleteDeptInfo({id}).then((res)=>{
+            if(res.data.code=='0'){
+              this.warning(res.data.msg||'操作成功','success');
+              this.getDataList();
+            }else{
+              this.warning(res.data.msg);
+            }
+          }).catch((error)=>{
+            this.warning(error);
+          })
+        });
+      }
+    }
+  }
+</script>
+
+<style lang="less">
+    @import "../../less/admin.less";
+    .status-span{
+        font-size: 12px;
+        margin-right:10px;
+        color: unset;
+    }
+</style>

+ 47 - 0
src/components/icss/DeptInfoDetail.vue

@@ -0,0 +1,47 @@
+<template>
+  <div>
+    <crumbs title="icss科室维护系统-详情" linkTo="/admin/LT-YXSJWH-KSWH"></crumbs>
+    <div class="contents">
+      <div>
+        <span>科室名称:{{data.name}}</span>
+        <span></span>
+      </div>
+      <div>
+        <span>描述:{{data.remark}}</span>
+        <span></span>
+      </div>
+    </div>   
+  </div>
+</template>
+<script type="text/javascript">
+  import api from '@api/icss.js';
+  export default{
+    name:'DeptInfoDetail',
+    data(){
+      return{
+        data:{},
+        id:''
+      }
+    },
+    created(){
+      this.id = this.$route.params.id;
+      this.getDetail();
+    },
+    methods:{
+      getDetail(){
+        const param = {'id':this.id}
+        api.getDeptInfoDetials(param).then((res)=>{
+          let result = res.data;
+          if(result.code==0){
+            this.data = result.data;
+          }else{
+            console.log(result.msg);
+          }
+        })
+      }
+    }
+  }
+</script>
+<style lang="less">
+  @import "../../less/admin.less";
+</style>

+ 4 - 0
src/routes.js

@@ -31,6 +31,8 @@ import ProductDetail from '@components/admin/ProductDetail.vue';
 import Console from '@components/user/Console.vue';
 import LabelGroup from '@components/icss/LabelGroup.vue'
 import NoiseTemplate from '@components/icss/NoiseTemplate.vue';
+import DeptInfo from '@components/icss/DeptInfo.vue';//科室信息
+import DeptInfoDetail from '@components/icss/DeptInfoDetail.vue';//科室信息-详情
 
 export default [
   {
@@ -131,6 +133,8 @@ export default [
       {path: 'LT-GRZX/CHANGE',component: ChangePwd}, //个人中心--修改密码
       {path: 'LT-YXSJWH-BQZWH',component: LabelGroup}, //医学数据维护--标签组维护
       {path:'LT-YXSJWH-TJBQZ',component:NoiseTemplate},     //医学数据维护--标签组维护--添加标签组
+      {path:'LT-YXSJWH-KSWH',component:DeptInfo},     //医学数据维护--科室维护
+      {path:'LT-YXSJWH-KSXQ',component:DeptInfoDetail,name:'DeptInfoDetail'},     //医学数据维护--详情
     ]
   }
 ]