Browse Source

添加版本信息

liucf 6 năm trước cách đây
mục cha
commit
d2a3f96686

+ 3 - 0
src/api/config.js

@@ -113,9 +113,12 @@ export default {
     'closeInformation': 'api/icssman/disclaimerInformation/endDisclaimerInformations', //免责声明-停用
     'openInformation': 'api/icssman/disclaimerInformation/startDisclaimerInformations', //免责声明-启用
     'versionInfo': 'api/icssman/versionInfo/getVersionInfoAlls', //版本信息
+    'addVersInfo': 'api/icssman/versionInfo/saveVersionInfoAlls', //版本信息-添加
+    'updateVersInfo': 'api/icssman/versionInfo/updateVersionInfoAlls', //版本信息-修改
     'delVersionInfo': 'api/icssman/versionDetail/cancelVersionDetails', //版本信息-删除版本说明
     'addVersionInfo': 'api/icssman/versionDetail/addVersionDetails', //版本信息-添加版本说明
     'modiVersionInfo': 'api/icssman/versionDetail/updateVersionDetails', //版本信息-修改版本说明
+    'getVersionDetlInfo': 'api/icssman/versionDetail/getDetailById', //版本信息-版本说明列表获取
 	},
 	menuIconList: { //菜单对应图标
 		'YH-KZT': 'el-icon-menu',

+ 9 - 0
src/api/icss.js

@@ -114,6 +114,12 @@ export default {
     versionInfo(param) {//版本信息
         return axios.post(urls.versionInfo, param)
     },
+    addVersInfo(param) {//版本信息-添加
+        return axios.post(urls.addVersInfo, param)
+    },
+    updateVersInfo(param) {//版本信息-修改
+        return axios.post(urls.updateVersInfo, param)
+    },
     delVersionInfo(param) {//版本信息-删除说明
         return axios.post(urls.delVersionInfo, param)
     },
@@ -123,4 +129,7 @@ export default {
     modiVersionInfo(param) {//版本信息-修改说明
         return axios.post(urls.modiVersionInfo, param)
     },
+    getVersionDetlInfo(param) {//版本信息-版本说明列表
+        return axios.post(urls.getVersionDetlInfo, param)
+    },
 }

+ 137 - 0
src/components/icss/AddVersion.vue

@@ -0,0 +1,137 @@
+<template>
+  <div>
+    <crumbs :title="title" linkTo="/admin/LT-YXSJWH-BBXXWH"></crumbs>
+    <div class="contents">
+      <div class="content">
+        <el-form ref="form" :label-position="labelPosition" label-width="95px" class="add-admin-form" :model="form" :rules="rules">
+          <el-form-item label="版本号:" prop="name">
+              <el-input v-model="form.name" placeholder="请输入版本号" maxlength="120"></el-input>
+          </el-form-item>
+          <el-form-item label="版本时间:" prop="refreshTime">
+            <el-date-picker
+              v-model="form.refreshTime"
+              type="date"
+              placeholder="选择日期"
+              :picker-options="pickerOptions1"
+              value-format="yyyy-MM-dd"
+              :clearable='false'>
+            </el-date-picker>
+          </el-form-item>
+          <el-form-item label="版本备注:" prop="remark" class="discDesc">
+              <el-input type="textarea" :rows="3" placeholder="请输入版本备注" v-model="form.remark" maxlength="120"></el-input>
+          </el-form-item>
+          <el-form-item label="版本说明:" v-if="list.length>0">
+          </el-form-item>
+        </el-form>
+        <VersionDesc v-if="id" :detail="list" :versionId="id" :isFirst="isFirst"/>
+        <el-button class="disclButn" size="small" type="primary" @click="comfirn">确定</el-button>
+      </div>    
+    </div>
+  </div>
+</template>
+<script type="text/javascript">
+  import api from '@api/icss.js';
+  import VersionDesc from './VersionDesc.vue';
+  export default {
+    name:'AddVersion',
+    data(){
+      return{
+        // data:{},
+        list:[],
+        labelPosition:'left',
+        isFirst:false,
+        title:'版本信息维护-添加版本信息',
+        form:{
+          name:'',
+          refreshTime:'',
+          remark:''
+        },
+        id:null,
+        rules:{
+          name:{ required: true, message: '请输入版本号', trigger: ['blur', 'change'] },
+          refreshTime:{ required: true, message: '请选择时间', trigger: ['blur', 'change'] }
+        },
+        pickerOptions1:{
+          disabledDate(time) {
+            return time.getTime() < Date.now();
+          },
+        }
+      }
+    },
+    created(){
+      let info = this.$route.params.info;
+      if(info){
+        this.id = info.id;
+        this.form.name = info.name;
+        this.form.refreshTime = info.refreshTime;
+        this.form.remark = info.remark;
+        this.title = "版本信息维护-修改版本信息";
+        this.isFirst = true;
+        this.getList();
+      }
+    },
+    methods:{
+      getList(){
+        api.getVersionDetlInfo({id:this.id}).then((res)=>{
+          const result = res.data;
+          if(result.code==0){
+            this.list = result.data;
+          }else{
+            this.$message.error(result.msg);
+          }
+        })
+      },
+      comfirn(){
+        if(this.id){//修改
+          const param = Object.assign({},this.form,{id:this.id})
+          api.updateVersInfo(param).then((res)=>{
+            if(res.data.code==0){
+              this.$message({
+                message:"修改成功",
+                type:'success'
+              })
+              this.$router.push({path: 'LT-YXSJWH-BBXXWH'});
+            }else{
+              this.$message.error(res.data.msg);
+            }
+          })
+        }else{//添加
+          api.addVersInfo(this.form).then((res)=>{
+            if(res.data.code==0){
+              this.$message({
+                message:"添加成功",
+                type:'success'
+              })
+              this.$router.push({path: 'LT-YXSJWH-BBXXWH'});
+            }else{
+              this.$message.error(res.data.msg);
+            }
+          })
+        }
+      },
+    },
+    components:{
+      VersionDesc
+    }
+  }
+</script>
+<style lang="less" scoped>
+  @import "../../less/admin.less";
+  .content{
+    background: #fff;
+    // padding: 20px 20px 30px;
+    padding: 20px 20px 50px;
+    color: #545455;
+    min-width: 980px;
+    position: relative;
+    .discDesc{
+      margin-bottom: 20px;
+    }
+    .disclButn{
+      position: absolute;
+      right: 80px;
+      bottom: 0px;
+    }
+  }
+
+</style>

+ 212 - 0
src/components/icss/MedicalName.vue

@@ -0,0 +1,212 @@
+<template>
+    <div>
+        <crumbs title="医学术语命名维护">
+            <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>
+                    <el-button size="mini" @click="uploadClick">导入</el-button>
+                    <input type="file" name="uploadfile " id="upFile" @change="uploadFile($event)" accept=".csv, application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
+                    <router-link to="/admin/LT-YXSJWH-TJBM" 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="gmtOperate"
+                        label="操作时间"
+                        :show-overflow-tooltip="true">
+                </el-table-column>
+                <el-table-column
+                        prop="questionName"
+                        label="医学标准术语"
+                        show-overflow-tooltip>
+                </el-table-column>
+                <el-table-column
+                        prop="retrievalSelfName"
+                        label="其他术语"
+                        show-overflow-tooltip>
+                </el-table-column>
+                <el-table-column
+                        prop="operatorName"
+                        label="操作人">
+                </el-table-column>
+                
+                <el-table-column
+                        label="操作" width="160">
+                    <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" class="delete" @click="showDelDialog(scope.row.questionId)">删除</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';
+  export default {
+    name: 'MedicalName',
+    data: function () {
+      return {
+        list: [],
+        cacheData: {},
+        currentPage: 1,
+        pageSize: 10,
+        total: 0,
+        filter: {
+          proName: ''
+        }
+      }
+    },
+    created() {
+      this.getDataList();
+    },
+    methods: {
+      toEditProduct(row){
+        this.$router.push({
+          name:'AddSimilarName',
+          params: {id:row.questionId,name:row.questionName}
+        })
+      },
+      filterDatas(){
+        this.currentPage = 1;
+        this.getDataList();
+      },
+      getDataList() {
+        const param = this.getFilterItems();
+        /*api.similarName(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}})
+      },
+      getFilterItems() {
+        const param = {
+          questionName: 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.delSimilarName({questionId: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);
+          })
+        });
+      },
+      uploadClick(){
+        let inp = document.getElementById("upFile");
+        inp.click();
+      },
+      uploadFile(e){
+        let fileInfo = e.target.files[0];
+        e.preventDefault();
+        let formData = new FormData();
+        formData.append('uploadfile', fileInfo);
+        console.log(123,fileInfo,formData);
+        const header = {
+          headers:{
+            'Content-Type': 'multipart/form-data'
+          }
+        }
+        api.uploadFile(formData,header).then((res)=>{
+          if(res.data.code==0){
+            this.$message({
+              message: '上传成功',
+              type: 'success',
+            });
+          }else{
+            this.$message.error(res.data.msg);
+          }
+        })
+        this.getDataList();
+        /*//解决上传相同文件不触发change
+        let inp = document.getElementById("upFile");
+        inp.value = "";
+        */
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+    @import "../../less/admin.less";
+    .delete{
+        color: red;
+    }
+    .el-table .cell{
+      overflow: hidden;
+      white-space: nowrap;
+    }
+    #upFile{
+      display: none !important;
+    }
+</style>

+ 0 - 2
src/components/icss/SimilarName.vue

@@ -85,8 +85,6 @@
 
 <script>
   import api from '@api/icss.js';
-  import utils from '@api/utils.js';
-  import axios from 'axios';
   export default {
     name: 'SimilarName',
     data: function () {

+ 36 - 10
src/components/icss/VersionDesc.vue

@@ -1,7 +1,7 @@
 <template>
-  <div>
-    <el-table v-if="detail.length>0" 
-              :data="detail"
+  <div class="version-desc">
+    <el-table v-if="list.length>0" 
+              :data="list"
               border
               style="width: 100%">
         <el-table-column
@@ -19,7 +19,7 @@
                 prop="modifierid"
                 label="操作人">
         </el-table-column>
-        <el-table-column
+        <el-table-column v-if="isFirst"
                 label="操作">
             <template slot-scope="scope">
                 <el-button type="text" size="small" @click="toEditDesc(scope.row)">修改</el-button>
@@ -34,7 +34,7 @@
             </template>
         </el-table-column>
     </el-table>
-    <el-button class="disclButn" size="small" type="primary" @click="addDesc">+ 添加说明</el-button>
+    <el-button v-if="isFirst" class="disclButn" size="small" type="primary" @click="addDesc">+ 添加说明</el-button>
     <div class="boxMark" v-if="showBox">
         <el-form ref="form" :model="form" :rules="showDesc?{}:rules" label-width="65px" class="add-desc-form">
           <p class="top">
@@ -46,7 +46,7 @@
             <el-input v-else v-model="form.title" placeholder="请输入标题" maxlength="30"></el-input>
           </el-form-item>
           <el-form-item label="内容:" prop="description" class="discDesc">
-            <p v-if="showDesc" class="cont">{{form.description}}</p>
+            <p v-if="showDesc" v-html="form.description" class="cont">{{form.description}}</p>
             <el-input v-else type="textarea" :rows="3" placeholder="请输入内容" v-model="form.description" maxlength="1024"></el-input>
           </el-form-item>
           <el-button class="disclButn" size="small" type="primary" @click="comfirn">确定</el-button>
@@ -95,8 +95,23 @@
         showDesc:false
       }
     },
-    props:['detail','versionId'],
+    created(){
+      if(this.versionId){
+        this.getList();
+      }
+    },
+    props:['detail','versionId','isFirst'],
     methods:{
+      getList(){
+        api.getVersionDetlInfo({id:this.versionId}).then((res)=>{
+          const result = res.data;
+          if(result.code==0){
+            this.list = result.data;
+          }else{
+            this.$message.error(result.msg);
+          }
+        })
+      },
       indexMethod(index) {
         // return ((1 - 1) * 10) + index + 1;
         return index + 1;
@@ -126,6 +141,7 @@
                 message:"添加成功",
                 type:'success'
               })
+              this.getList();
             }else{
               this.$message.error(res.data.msg);
             }
@@ -148,6 +164,7 @@
                 message:"添加成功",
                 type:'success'
               })
+              this.getList();
             }else{
               this.$message.error(res.data.msg);
             }
@@ -193,7 +210,7 @@
           api.delVersionInfo({id}).then((res)=>{
             if(res.data.code=='0'){
               this.warning(res.data.msg||'操作成功','success');
-              // this.getDataList();
+              this.getList();
             }else{
               this.warning(res.data.msg);
             }
@@ -225,12 +242,14 @@
   .add-desc-form{
     width: 680px;
     position: absolute;
-    top: 50%;
+    top: 15%;
     left: 50%;
-    margin-top: -143px;
+    // margin-top: -143px;
     margin-left: -340px;
     background: #fff;
     padding: 20px;
+    max-height: 660px;
+    overflow-y: auto;
   }
   .top{
     font-size: 15px;
@@ -253,4 +272,11 @@
   .cont{
     text-align: left;
   }
+  .version-desc .el-table__body-wrapper{
+    max-height: 340px;
+    overflow-y: auto;
+  }
+  .version-desc .el-table th{
+    padding: 0px;
+  }
 </style>

+ 6 - 2
src/components/icss/VersionDetail.vue

@@ -17,7 +17,8 @@
               <!-- <p>{{data.remark}}</p> -->
           </el-form-item>
         </el-form>
-        <VersionDesc :detail="list" :versionId="data.id"/>
+        <!-- 只有第一条可修改,内部的说明也是 -->
+        <VersionDesc :detail="list" :versionId="data.id" :isFirst="isFirst"/>
       </div>    
     </div>
   </div>
@@ -31,13 +32,15 @@
       return{
         data:{},
         list:[],
-        labelPosition:'left'
+        labelPosition:'left',
+        isFirst:null
       }
     },
     created(){
       const info = this.$route.params.info;
       this.data = info;
       this.list = info.detail?info.detail:[];
+      this.isFirst = this.$route.params.isFirst;
     },
     components:{
       VersionDesc
@@ -50,5 +53,6 @@
     background: #fff;
     padding: 20px 20px 30px;
     color: #545455;
+    min-width: 980px;
   }
 </style>

+ 8 - 10
src/components/icss/VersionInfo.vue

@@ -43,7 +43,7 @@
                 <el-table-column
                         label="操作">
                     <template slot-scope="scope">
-                        <el-button type="text" size="small" :class="{forbid:scope.row.id !=list[0].id}" @click="scope.row.id ==list[0].id?toEditDiscl(scope.row):''">修改</el-button>
+                        <el-button type="text" size="small" :class="{forbid:scope.row.id !=list[0].id}" @click="scope.row.id ==list[0].id?toEditVersion(scope.row):''">修改</el-button>
                     </template>
                 </el-table-column>
                 <el-table-column
@@ -68,7 +68,6 @@
 
 <script>
   import api from '@api/icss.js';
-  import utils from '@api/utils.js';
 
   export default {
     name: 'VersionInfo',
@@ -79,8 +78,6 @@
         currentPage: 1,
         pageSize: 10,
         total: 0,
-        linkIn:[],
-        pays:[],
         filter: {
           name: ''
         }
@@ -90,11 +87,11 @@
       this.getDataList();
     },
     methods: {
-      toEditDiscl(row){console.log(111,row);
-        // this.$router.push({
-        //   name:'AddDisclInfo',
-        //   params: {info:row}
-        // })
+      toEditVersion(row){
+        this.$router.push({
+          name:'AddVersion',
+          params: {info:row}
+        })
       },
       filterDatas(){
         this.currentPage = 1;
@@ -114,7 +111,8 @@
         });
       },
       getDetail(item) {
-        this.$router.push({name:'VersionDetail', params:{info: item}})
+        let isFirst = item.id==this.list[0].id?true:false;
+        this.$router.push({name:'VersionDetail', params:{info:item,isFirst}});
       },
       getFilterItems() {
         const param = {

+ 2 - 0
src/routes.js

@@ -45,6 +45,7 @@ import DiscInfoDetail from '@components/icss/DiscInfoDetail.vue'//免责声明-
 import AddDisclInfo from '@components/icss/AddDisclInfo.vue'//免责声明-添加
 import VersionInfo from '@components/icss/VersionInfo.vue'//版本信息
 import VersionDetail from '@components/icss/VersionDetail.vue'//版本信息-详情
+import AddVersion from '@components/icss/AddVersion.vue'//版本信息-添加/修改
 export default [
   {
     path: '/',
@@ -158,6 +159,7 @@ export default [
       {path:'LT-YXSJWH-TJMZSM',component:AddDisclInfo,name:'AddDisclInfo'},     //免责声明-添加/修改
       {path:'LT-YXSJWH-BBXXWH',component:VersionInfo,name:'VersionInfo'},     //版本信息
       {path:'LT-YXSJWH-BBXXXQ',component:VersionDetail,name:'VersionDetail'},     //版本信息-详情
+      {path:'LT-YXSJWH-TJBBXX',component:AddVersion,name:'AddVersion'},     //版本信息-添加/修改
     ]
   }
 ]