Przeglądaj źródła

别名维护增加验证,新增版本信息维护

liucf 6 lat temu
rodzic
commit
d1c390d923

+ 4 - 0
src/api/config.js

@@ -112,6 +112,10 @@ export default {
     'delDiscInformation': 'api/icssman/disclaimerInformation/cancelDisclaimerInformations', //免责声明-删除
     'closeInformation': 'api/icssman/disclaimerInformation/endDisclaimerInformations', //免责声明-停用
     'openInformation': 'api/icssman/disclaimerInformation/startDisclaimerInformations', //免责声明-启用
+    'versionInfo': 'api/icssman/versionInfo/getVersionInfoAlls', //版本信息
+    'delVersionInfo': 'api/icssman/versionDetail/cancelVersionDetails', //版本信息-删除版本说明
+    'addVersionInfo': 'api/icssman/versionDetail/addVersionDetails', //版本信息-添加版本说明
+    'modiVersionInfo': 'api/icssman/versionDetail/updateVersionDetails', //版本信息-修改版本说明
 	},
 	menuIconList: { //菜单对应图标
 		'YH-KZT': 'el-icon-menu',

+ 12 - 0
src/api/icss.js

@@ -111,4 +111,16 @@ export default {
     openInformation(param) {//免责声明-停用
         return axios.post(urls.openInformation, param)
     },
+    versionInfo(param) {//版本信息
+        return axios.post(urls.versionInfo, param)
+    },
+    delVersionInfo(param) {//版本信息-删除说明
+        return axios.post(urls.delVersionInfo, param)
+    },
+    addVersionInfo(param) {//版本信息-添加说明
+        return axios.post(urls.addVersionInfo, param)
+    },
+    modiVersionInfo(param) {//版本信息-修改说明
+        return axios.post(urls.modiVersionInfo, param)
+    },
 }

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

@@ -6,7 +6,7 @@
         <div class="contents">
             <el-form ref="form" :label-position="labelPosition" :model="form" :rules="rules" label-width="100px" class="add-admin-form">
                 <el-form-item label="科室名称:" prop="name">
-                    <el-input v-model="form.name" placeholder="请输入科室名称"></el-input>
+                    <el-input v-model="form.name" placeholder="请输入科室名称" maxlength="30"></el-input>
                 </el-form-item>
                 <el-form-item label="描述:" prop="remark">
                     <el-input type="textarea" :rows="3" placeholder="请输入科室描述" v-model="form.remark" maxlength="1024"></el-input>

+ 2 - 2
src/components/icss/AddDisclInfo.vue

@@ -6,10 +6,10 @@
         <div class="contents">
             <el-form ref="form" :label-position="labelPosition" :model="form" :rules="rules" label-width="65px" class="add-discl-form">
                 <el-form-item label="标题:" prop="title">
-                    <el-input v-model="form.title" placeholder="请输入标题"></el-input>
+                    <el-input v-model="form.title" placeholder="请输入标题" maxlength="30"></el-input>
                 </el-form-item>
                 <el-form-item label="内容:" prop="description" class="discDesc">
-                    <el-input type="textarea" :rows="3" placeholder="请输入内容述" v-model="form.description" maxlength="1024"></el-input>
+                    <el-input type="textarea" :rows="3" placeholder="请输入内容述" v-model="form.description" maxlength="1024"></el-input>
                 </el-form-item>
                 <el-form-item label="归属:" prop="disclaimerCode">
                     <el-select v-model="form.disclaimerCode" clearable placeholder="请选择">

+ 18 - 12
src/components/icss/AddSimilarName.vue

@@ -23,12 +23,12 @@
           <tr v-if="flag" v-for="item in selfName">
            <!--  <td class="desc">{{item.retrievalName}}</td>
             <td>{{item.retrievalSpell}}</td> -->
-            <td><input type="text" name="" v-model="item.retrievalName"></td>
-            <td><input type="text" name="" v-model="item.retrievalSpell"></td>
+            <td><input type="text" name="" v-model="item.retrievalName" maxlength="30" @input="handleInput"></td>
+            <td><input type="text" name="" v-model="item.retrievalSpell" maxlength="30" @input="handlePinyin"></td>
           </tr>
           <tr v-if="!flag" v-for="(i,index) in selfEmpty">
-            <td><input type="text" name="" v-model="selfEmpty[index].retrievalName"></td>
-            <td><input type="text" name="" v-model="selfEmpty[index].retrievalSpell"></td>
+            <td><input type="text" name="" v-model="selfEmpty[index].retrievalName" maxlength="30" @input="handleInput"></td>
+            <td><input type="text" name="" v-model="selfEmpty[index].retrievalSpell" maxlength="30" @input="handlePinyin"></td>
           </tr>
         </table>
         <p class="subtitle">别名添加:</p>
@@ -38,12 +38,12 @@
             <td>拼音</td>
           </tr>
           <tr v-if="retrievalNames.length>0" v-for="it in retrievalNames">
-            <td><input type="text" name="" v-model="it.retrievalName"></td>
-            <td><input type="text" name="" v-model="it.retrievalSpell"></td>
+            <td><input type="text" name="" v-model="it.retrievalName" maxlength="30" @input="handleInput"></td>
+            <td><input type="text" name="" v-model="it.retrievalSpell" maxlength="30" @input="handlePinyin"></td>
           </tr>
           <tr v-for="(i,index) in retrievalEmpty">
-            <td><input type="text" name="" v-model="retrievalEmpty[index].retrievalName"></td>
-            <td><input type="text" name="" v-model="retrievalEmpty[index].retrievalSpell"></td>
+            <td><input type="text" name="" v-model="retrievalEmpty[index].retrievalName" maxlength="30" @input="handleInput"></td>
+            <td><input type="text" name="" v-model="retrievalEmpty[index].retrievalSpell" maxlength="30" @input="handlePinyin"></td>
           </tr>
           <tr @click="addSpan(2)">
             <td colspan="2" class="addSpan">+</td>
@@ -56,12 +56,12 @@
             <td>拼音</td>
           </tr>
           <tr v-if="retrievalSonNames.length>0" v-for="v in retrievalSonNames">
-            <td><input type="text" name="" v-model="v.retrievalName"></td>
-            <td><input type="text" name="" v-model="v.retrievalSpell"></td>
+            <td><input type="text" name="" v-model="v.retrievalName" maxlength="30" @input="handleInput"></td>
+            <td><input type="text" name="" v-model="v.retrievalSpell" maxlength="30" @input="handlePinyin"></td>
           </tr>
           <tr v-for="(k,index) in sonEmpty">
-            <td><input type="text" name="" v-model="sonEmpty[index].retrievalName"></td>
-            <td><input type="text" name="" v-model="sonEmpty[index].retrievalSpell"></td>
+            <td><input type="text" name="" v-model="sonEmpty[index].retrievalName" maxlength="30" @input="handleInput"></td>
+            <td><input type="text" name="" v-model="sonEmpty[index].retrievalSpell" maxlength="30" @input="handlePinyin"></td>
           </tr>
           <tr @click="addSpan(3)">
             <td colspan="2" class="addSpan">+</td>
@@ -233,6 +233,12 @@
       close(){
         this.showFlag = false;
         this.searchStr = "";
+      },
+      handleInput(e){//名字只能输入中文、英文和数字
+        e.target.value = e.target.value.replace(/[^0-9a-zA-Z\u4e00-\u9fa5]/g,'');
+      },
+      handlePinyin(e){//只能输入英文
+        e.target.value = e.target.value.replace(/[^a-zA-Z]/g,'');
       }
     },
     watch:{

+ 256 - 0
src/components/icss/VersionDesc.vue

@@ -0,0 +1,256 @@
+<template>
+  <div>
+    <el-table v-if="detail.length>0" 
+              :data="detail"
+              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="modifierid"
+                label="操作人">
+        </el-table-column>
+        <el-table-column
+                label="操作">
+            <template slot-scope="scope">
+                <el-button type="text" size="small" @click="toEditDesc(scope.row)">修改</el-button>
+                <span style="margin:0 3px;">|</span>
+                <el-button type="text" size="small" class="delete" @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="getDetail(scope.row)">明细</el-button>
+            </template>
+        </el-table-column>
+    </el-table>
+    <el-button 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">
+            {{minTitle}}
+            <img src="../../images/close.png" height="12" width="12" @click="cancel">
+          </p>
+          <el-form-item label="标题:" prop="title">
+            <p v-if="showDesc" class="cont">{{form.title}}</p>
+            <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>
+            <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>
+          <!-- <el-button class="disclButn can" size="small" type="primary" @click="cancel">取消</el-button> -->
+      </el-form>
+    </div>
+  </div>
+</template>
+<script type="text/javascript">
+  import api from '@api/icss.js';
+  export default {
+    name:'VersionDesc',
+    data(){
+      const titleVaild = (rule, value, callback) => {
+        if (!value) {
+          return callback(new Error('请输入标题'));
+        }
+        if (value.length > 30) {
+           this.form.name = value.substr(0, 120);
+           this.$message({
+             showClose: true,
+             type: 'warning',
+             message: '已超过最大字数限制'
+           })
+        }
+        callback();
+      };
+      return{
+        list:[],//版本说明列表
+        form:{
+          title:'',
+          description:''
+        },
+        rules: {
+          title:[
+            { required: true, validator: titleVaild, trigger: ['blur', 'change'] },
+            { required: true, message: '请输入标题', trigger: ['blur', 'change'] }
+          ],
+          description:[
+            { required: true, message: '请输入内容', trigger: ['blur', 'change'] }
+          ]
+        },
+        minTitle:'',
+        showBox:false,
+        modiId:null,
+        showDesc:false
+      }
+    },
+    props:['detail','versionId'],
+    methods:{
+      indexMethod(index) {
+        // return ((1 - 1) * 10) + index + 1;
+        return index + 1;
+      },
+      toEditDesc(item){//修改备注
+        console.log(124,item);
+        this.minTitle='修改说明';
+        this.showBox = true;
+        this.form.title = item.title;
+        this.form.description = item.description;
+        this.modiId = item.id;
+      },
+      addDesc(){//添加备注
+        this.minTitle='添加说明';
+        this.showBox = true;
+      },
+      comfirn(){//记得清空modiId
+        if(this.modiId){//修改
+          const param = {
+            title:this.form.title,
+            description:this.form.description,
+            detailId:this.modiId
+          }
+          api.modiVersionInfo(param).then((res)=>{
+            if(res.data.code==0){
+              this.$message({
+                message:"添加成功",
+                type:'success'
+              })
+            }else{
+              this.$message.error(res.data.msg);
+            }
+          })
+        }else if(this.showDesc){//明细
+
+        }else{//添加
+          const params = {
+            versionDetail: [
+              {
+                description: this.form.description,
+                title: this.form.title,
+              }
+            ],
+            versionInfoId: this.versionId
+          }
+          api.addVersionInfo(params).then((res)=>{
+            if(res.data.code==0){
+              this.$message({
+                message:"添加成功",
+                type:'success'
+              })
+            }else{
+              this.$message.error(res.data.msg);
+            }
+          })
+        }
+        this.reset();
+      },
+      reset(){//关闭弹窗复原数据
+        this.showBox = false;
+        this.showDesc = false;
+        this.form.title = "";
+        this.form.description = "";
+        this.modiId = null;
+        this.minTitle= "";
+      },
+      cancel(){
+        this.reset();
+      },
+      getDetail(item){//明细
+        this.minTitle='说明明细';
+        this.showDesc = true;
+        this.showBox = true;
+        this.form.title = item.title;
+        this.form.description = item.description;
+      },
+      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.delVersionInfo({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";
+  .disclButn{
+    margin: 30px 0 10px;
+  }
+  .boxMark{
+    position: fixed;
+    top: 0;
+    bottom: 0;
+    left: 0;
+    right: 0;
+    text-align: center;
+    // background: #808080;
+    background-color:rgba(0,0,0,0.3);
+    z-index: 1001;
+  }
+  // .el-form{
+  .add-desc-form{
+    width: 680px;
+    position: absolute;
+    top: 50%;
+    left: 50%;
+    margin-top: -143px;
+    margin-left: -340px;
+    background: #fff;
+    padding: 20px;
+  }
+  .top{
+    font-size: 15px;
+    font-weight: bold;
+    color: #545455;
+    text-align: left;
+    // padding-bottom: 10px;
+    margin-bottom: 15px;
+    // border-bottom: 1px solid #C9C9C9;
+    position: relative;
+    img{
+      position: absolute;
+      right: 5px;
+    }
+  }
+  .can,.can:hover{
+    background: #9B9B9B;
+    border-color: #9B9B9B;
+  }
+  .cont{
+    text-align: left;
+  }
+</style>

+ 54 - 0
src/components/icss/VersionDetail.vue

@@ -0,0 +1,54 @@
+<template>
+  <div>
+    <crumbs title="版本信息维护-明细" linkTo="/admin/LT-YXSJWH-BBXXWH"></crumbs>
+    <div class="contents">
+      <div class="content">
+        <el-form ref="form" :label-position="labelPosition" label-width="85px" class="add-admin-form">
+          <el-form-item label="版本号:">
+              <p>{{data.name}}</p>
+          </el-form-item>
+          <el-form-item label="版本时间:">
+              <p>{{data.refreshTime}}</p>
+          </el-form-item>
+          <el-form-item label="版本备注:">
+              <p>{{data.remark}}</p>
+          </el-form-item>
+          <el-form-item label="版本说明:" v-if="list.length>0">
+              <!-- <p>{{data.remark}}</p> -->
+          </el-form-item>
+        </el-form>
+        <VersionDesc :detail="list" :versionId="data.id"/>
+      </div>    
+    </div>
+  </div>
+</template>
+<script type="text/javascript">
+  import api from '@api/icss.js';
+  import VersionDesc from './VersionDesc.vue';
+  export default {
+    name:'VersionDetail',
+    data(){
+      return{
+        data:{},
+        list:[],
+        labelPosition:'left'
+      }
+    },
+    created(){
+      const info = this.$route.params.info;
+      this.data = info;
+      this.list = info.detail?info.detail:[];
+    },
+    components:{
+      VersionDesc
+    }
+  }
+</script>
+<style lang="less" scoped>
+  @import "../../less/admin.less";
+  .content{
+    background: #fff;
+    padding: 20px 20px 30px;
+    color: #545455;
+  }
+</style>

+ 150 - 0
src/components/icss/VersionInfo.vue

@@ -0,0 +1,150 @@
+<template>
+    <div>
+        <crumbs title="版本信息维护">
+            <el-form :inline="true" class="demo-form-inline">
+                <el-form-item label="查询版本号:">
+                    <el-input size="mini" v-model="filter.name" placeholder="输入版本号"></el-input>
+                </el-form-item>
+                <el-form-item>
+                    <el-button size="mini" @click="filterDatas">确认</el-button>
+                    <router-link to="/admin/LT-YXSJWH-TJBBXX" 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="refreshTime"
+                        label="版本时间">
+                </el-table-column>
+                <el-table-column
+                        prop="modifierid"
+                        label="操作人">
+                </el-table-column>
+                <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>
+                    </template>
+                </el-table-column>
+                <el-table-column
+                        label="详情">
+                    <template slot-scope="scope">
+                        <el-button type="text" size="small" @click="getDetail(scope.row)">详情</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: 'VersionInfo',
+    data: function () {
+      return {
+        list: [],
+        cacheData: {},
+        currentPage: 1,
+        pageSize: 10,
+        total: 0,
+        linkIn:[],
+        pays:[],
+        filter: {
+          name: ''
+        }
+      }
+    },
+    created() {
+      this.getDataList();
+    },
+    methods: {
+      toEditDiscl(row){console.log(111,row);
+        // this.$router.push({
+        //   name:'AddDisclInfo',
+        //   params: {info:row}
+        // })
+      },
+      filterDatas(){
+        this.currentPage = 1;
+        this.getDataList();
+      },
+      getDataList() {
+        const param = this.getFilterItems();
+        api.versionInfo(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);
+        });
+      },
+      getDetail(item) {
+        this.$router.push({name:'VersionDetail', params:{info: item}})
+      },
+      getFilterItems() {
+        const param = {
+          name: this.filter.name,
+          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();
+        }
+      }
+    }
+  }
+</script>
+
+<style lang="less" scoped>
+    @import "../../less/admin.less";
+    .delete{
+      color: red !important;
+    }
+    .forbid{
+      color: #BFBFBF !important;
+    }
+</style>

+ 4 - 0
src/routes.js

@@ -43,6 +43,8 @@ import AddSimilarName from '@components/icss/AddSimilarName.vue'//别名维护-
 import DisclaimerInformation from '@components/icss/DisclaimerInformation.vue'//免责声明
 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'//版本信息-详情
 export default [
   {
     path: '/',
@@ -154,6 +156,8 @@ export default [
       {path:'LT-YXSJWH-MZSMWH',component:DisclaimerInformation,name:'DisclaimerInformation'},     //免责声明
       {path:'LT-YXSJWH-MZSMXQ',component:DiscInfoDetail,name:'DiscInfoDetail'},     //免责声明-详情
       {path:'LT-YXSJWH-TJMZSM',component:AddDisclInfo,name:'AddDisclInfo'},     //免责声明-添加/修改
+      {path:'LT-YXSJWH-BBXXWH',component:VersionInfo,name:'VersionInfo'},     //版本信息
+      {path:'LT-YXSJWH-BBXXXQ',component:VersionDetail,name:'VersionDetail'},     //版本信息-详情
     ]
   }
 ]