morphone1995 4 rokov pred
rodič
commit
e3a38ae609

+ 34 - 0
src/api/cdss.js

@@ -301,4 +301,38 @@ export default {
   updateVersionInfoAllsCDSS(param) {
     return axios.post(urls.updateVersionInfoAllsCDSS, param);
   },
+  addVersionDetailsCDSS(param) {
+    return axios.post(urls.addVersionDetailsCDSS, param);
+  },
+  cancelVersionDetailsCDSS(param) {
+    return axios.post(urls.cancelVersionDetailsCDSS, param);
+  },
+  getDetailByIdCDSS(param) {
+    return axios.post(urls.getDetailByIdCDSS, param);
+  },
+  updateVersionDetailsCDSS(param) {
+    return axios.post(urls.updateVersionDetailsCDSS, param);
+  },
+
+  addDisclaimerInfosCDSS(param) {
+    return axios.post(urls.addDisclaimerInfosCDSS, param);
+  },
+  cancelDisclaimerInformationsCDSS(param) {
+    return axios.post(urls.cancelDisclaimerInformationsCDSS, param);
+  },
+  endDisclaimerInformationsCDSS(param) {
+    return axios.post(urls.endDisclaimerInformationsCDSS, param);
+  },
+  getDisclaimerPagesCDSS(param) {
+    return axios.post(urls.getDisclaimerPagesCDSS, param);
+  },
+  startDisclaimerInformationsCDSS(param) {
+    return axios.post(urls.startDisclaimerInformationsCDSS, param);
+  },
+  updateDisclaimerInformationsCDSS(param) {
+    return axios.post(urls.updateDisclaimerInformationsCDSS, param);
+  },
+  getKlmEnumsDataCDSS(param) {
+    return axios.post(urls.getKlmEnumsDataCDSS, param);
+  },
 };

+ 13 - 5
src/api/config.js

@@ -346,8 +346,6 @@ export default {
 
 
 
-
-
     // 'promptServer': '/sys/file/uploadImage',    //静态知识富文本图片上传
     // 'midifyPassword': '/sys/user/midifyPassword',    //修改密码
     'delConceptInfoCDSS': '/api/cdssman/graph/conceptInfo/changeStatus',   //静态知识启用禁用
@@ -364,8 +362,6 @@ export default {
 
     'getMappingListPageCDSS': '/api/cdssman/hospitalInfo/getMappingListPage',  //获取术语映射统计列表
 
-
-
     'retrievalSearchCDSS': '/api/cdssman/demo/retrieval/index',   //术语检索
     'getLisMappingPageCDSS': '/api/cdssman/tran/diseaseConfig/getPage', //诊断列表
     'diseaseIsExistRecordCDSS': '/api/cdssman/tran/diseaseConfig/isExistRecord',   //诊断-映射关系是否已存在
@@ -434,7 +430,6 @@ export default {
     'cancelUserRoleCDSS': '/api/cdssman/userRole/cancelUserRole',   //删除医院管理员
     'addUserRoleCDSS': '/api/cdssman/userRole/addUserRole',   //添加医院管理员
 
-
     'cancelPlanDatasCDSS': '/api/cdssman/plan/cancelPlanDatas',   //删除方案配置信息
     'getDefaultPlansCDSS': '/api/cdssman/plan/getDefaultPlans',   //获取默认方案配置
     'getPlanInfoIdsCDSS': '/api/cdssman/plan/getPlanInfoIds',   //根据方案id获取配置信息
@@ -447,6 +442,19 @@ export default {
     'saveVersionInfoAllsCDSS': '/api/cdssman/versionInfo/saveVersionInfoAlls',   //保存版本信息
     'cancelVersionInfoAllsCDSS': '/api/cdssman/versionInfo/cancelVersionInfoAlls',   //删除版本信息
     'updateVersionInfoAllsCDSS': '/api/cdssman/versionInfo/updateVersionInfoAlls',   //更新版本信息
+    'addVersionDetailsCDSS': '/api/cdssman/versionDetail/addVersionDetails',   //增加版本详情信息
+    'cancelVersionDetailsCDSS': '/api/cdssman/versionDetail/cancelVersionDetails',   //删除版本详情信息
+    'getDetailByIdCDSS': '/api/cdssman/versionDetail/getDetailById',   //根据版本id获取版本详情信息
+    'updateVersionDetailsCDSS': '/api/cdssman/versionDetail/updateVersionDetails',   //更新版本详情信息
+
+    'addDisclaimerInfosCDSS': '/api/cdssman/disclaimerInfo/addDisclaimerInfos',   //增加免责申明详情
+    'cancelDisclaimerInformationsCDSS': '/api/cdssman/disclaimerInfo/cancelDisclaimerInformations',   //删除免责申明详情
+    'endDisclaimerInformationsCDSS': '/api/cdssman/disclaimerInfo/endDisclaimerInformations',   //停用免责申明详情
+    'getDisclaimerPagesCDSS': '/api/cdssman/disclaimerInfo/getDisclaimerPages',   //分页查询获取免责申明
+    'startDisclaimerInformationsCDSS': '/api/cdssman/disclaimerInfo/startDisclaimerInformations',   //启用免责申明详情
+    'updateDisclaimerInformationsCDSS': '/api/cdssman/disclaimerInfo/updateDisclaimerInformations',   //修改免责申明详情
+
+    'getKlmEnumsDataCDSS': '/api/cdssman/getKlmEnumsData',   //枚举数据获取
 
 
   },

+ 266 - 3
src/components/cdssManage/disclaimer/AddDisclaimer.vue

@@ -1,13 +1,276 @@
+<!-- 免责声明修改 By_liucf -->
 <template>
-  <div>vue</div>
+  <div>
+    <crumbs :title="topInfo" :param="$route.params" linkTo="DisclaimerCDSS"></crumbs>
+    <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" class="discl-title">
+          <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-form-item>
+        <el-form-item label="归属:" prop="disclaimerCode">
+          <el-select v-model="form.disclaimerCode" clearable placeholder="请选择">
+            <el-option v-for="item in options" :key="item.key" :label="item.name" :value="item.key"></el-option>
+          </el-select>
+        </el-form-item>
+        <el-button
+          class="disclButn"
+          size="small"
+          :disabled="saveDisable"
+          type="primary"
+          @click="addDiscl"
+        >{{text}}</el-button>
+      </el-form>
+    </div>
+  </div>
 </template>
 
 <script>
+import api from '@api/cdss.js';
 export default {
+  name: 'AddDisclaimerCDSS',
+  data() {
+    const titleVaild = (rule, value, callback) => {
+      if (!value) {
+        return callback(new Error('请输入标题'));
+      }
+      if (value.length >= 30) {
+        this.form.name = value.substr(0, 30);
+        this.$message({
+          showClose: true,
+          type: 'warning',
+          message: '标题已超过最大字数限制'
+        });
+      }
+      callback();
+    };
+    const descVaild = (rule, value, callback) => {
+      if (!value) {
+        return callback(new Error('请输入内容'));
+      }
+      if (value.length >= 1024) {
+        this.form.name = value.substr(0, 1024);
+        this.$message({
+          showClose: true,
+          type: 'warning',
+          message: '内容已超过最大字数限制'
+        });
+      }
+      callback();
+    };
+    const disclVaild = (rule, value, callback) => {
+      if (!value) {
+        return callback(new Error('请选择归属'));
+      }
+      callback();
+    };
+    return {
+      id: null,
+      labelPosition: 'right',
+      options: [],
+      form: {
+        title: '',
+        description: '', //内容
+        disclaimerCode: '' //归属
+      },
+      rules: {
+        title: [
+          { required: true, validator: titleVaild, trigger: ['change'] },
+          { required: true, message: '请输入标题', trigger: ['blur', 'change'] }
+        ],
+        description: [
+          { required: true, validator: descVaild, trigger: ['change'] },
+          { required: true, message: '请输入内容', trigger: ['blur', 'change'] }
+        ],
+        disclaimerCode: [
+          {
+            required: true,
+            validator: disclVaild,
+            trigger: ['blur', 'change']
+          },
+          { required: true, message: '请选择归属', trigger: ['blur', 'change'] }
+        ]
+      },
+      text: '确定添加',
+      topInfo: '免责声明维护-添加免责声明',
+      toast: '添加成功',
+      saveDisable: false
+    };
+  },
+  created() {
+    // const params = JSON.parse(localStorage.getItem('knowledgeEnumsData'));
+    // this.options = params.disclaimerCodeEnum;
+    // api.getKlmEnumsDataCDSS().then(res => {
+    //   console.log(res, '===========');
+    //   if (res.data.code === '0') {
+    //     this.options = res.data.data.disclaimerCodeAllEnum;
+    //   }
+    // });
+    // 修改
+    // console.log(this.$route.params, 'this.$route.params');
+    this.options = this.$route.params.options
+    const data = this.$route.params.info;
 
-}
+    if (data) {
+      this.id = data.id;
+      this.text = '确定修改';
+      this.topInfo = '免责声明维护-修改';
+      this.toast = '修改成功';
+      this.form.title = data.title;
+      this.form.description = data.description;
+      this.form.disclaimerCode = +data.disclaimerCode;
+      
+    }
+  },
+  methods: {
+    addDiscl() {
+      this.$refs.form.validate(valid => {
+        if (valid) {
+          // 过滤空格
+          if (!this.form.title.trim() || !this.form.description.trim()) {
+            this.$message({
+              message: '必填项不能为空',
+              type: 'warning'
+            });
+            return;
+          }
+          // 有id是修改,没有id是添加
+          if (this.id) {
+            let code = this.form.disclaimerCode;
+            // 修改没有操作时 code为字符串,需转成code
+            if (typeof code == 'string') {
+              for (let i in this.options) {
+                if (this.options[i].name == code) {
+                  code = this.options[i].key;
+                }
+              }
+            }
+            let param = {
+              id: this.id,
+              title: this.form.title.trim(),
+              description: this.form.description.trim(),
+              disclaimerCode: code
+            };
+            this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+            api
+              .updateDisclaimerInformationsCDSS(param)
+              .then(res => {
+                if (res.data.code == '0') {
+                  this.$message({
+                    showClose: true,
+                    message: this.toast,
+                    type: 'success'
+                  });
+                  this.$router.push({
+                    name: 'DisclaimerCDSS',
+                    params: Object.assign({}, this.$route.params, {
+                      currentPage: 1
+                    })
+                  });
+                } else {
+                  this.$message({
+                    showClose: true,
+                    message: res.data.msg,
+                    type: 'warning'
+                  });
+                }
+                this.saveDisable = false;
+              })
+              .catch(error => {
+                this.$message({
+                  showClose: true,
+                  message: '服务器正忙...',
+                  type: 'warning'
+                });
+              });
+          } else {
+            let param = {
+              title: this.form.title.trim(),
+              description: this.form.description.trim(),
+              disclaimerCode: this.form.disclaimerCode
+            };
+            this.saveDisable = true; //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
+            api
+              .addDisclaimerInfosCDSS(param)
+              .then(res => {
+                if (res.data.code == '0') {
+                  this.$message({
+                    showClose: true,
+                    message: this.toast,
+                    type: 'success'
+                  });
+                  this.$router.push({
+                    name: 'DisclaimerCDSS',
+                    params: Object.assign({}, this.$route.params, {
+                      currentPage: 1
+                    })
+                  });
+                } else {
+                  this.$message({
+                    showClose: true,
+                    message: res.data.msg,
+                    type: 'warning'
+                  });
+                }
+                this.saveDisable = false;
+              })
+              .catch(error => {
+                this.$message({
+                  showClose: true,
+                  message: '服务器正忙...',
+                  type: 'warning'
+                });
+              });
+          }
+        }
+      });
+    },
+    back() {
+      this.$router.go(-1);
+    }
+  }
+};
 </script>
 
-<style>
+<style lang="less" >
+@import '../../../less/admin.less';
+
+.add-discl-form {
+  background: #fff;
+  padding: 20px 20px 30px;
+  .discl-title {
+    width: 500px;
+  }
+}
+
+// .el-button{
+.disclButn {
+  margin: 30px 0 0 20px;
+}
 
+.discDesc {
+  // .el-textarea{
+  //   width: 97%;
+  // }
+  margin-top: 10px;
+  margin-bottom: 25px;
+  .el-form-item__error {
+    top: 70px;
+  }
+}
 </style>

+ 315 - 4
src/components/cdssManage/disclaimer/Disclaimer.vue

@@ -1,13 +1,324 @@
 <template>
-  <div>vue</div>
+  <div>
+    <crumbs title="免责声明维护">
+      <el-form :inline="true" class="demo-form-inline">
+        <el-form-item label="标题:">
+          <el-input size="mini" v-model="filter.title" placeholder="输入标题"></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button size="mini" @click="filterDatas">确认</el-button>
+          <el-button size="mini" type="warning" @click="addDisclInfo" style="margin:0 10px">添加</el-button>
+        </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="modifier" label="操作人"></el-table-column>
+        <el-table-column prop="title" label="标题" show-overflow-tooltip></el-table-column>
+        <el-table-column prop="disclaimerCode" label="归属">
+          <template slot-scope="scope">
+            <span>{{ renderDisclaimerCode(scope.row) }}</span>
+          </template>
+        </el-table-column>
+        <el-table-column label="状态">
+          <template slot-scope="scope">
+            <el-button
+              type="text"
+              size="small"
+              :class="{forbid:scope.row.status==0}"
+              @click="toOpen(scope.row)"
+            >启用</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              type="text"
+              size="small"
+              :class="['delete',{'forbid':scope.row.status==1}]"
+              @click="toClose(scope.row)"
+            >停用</el-button>
+          </template>
+        </el-table-column>
+        <el-table-column label="操作">
+          <template slot-scope="scope">
+            <el-button type="text" size="small" @click="toEditDiscl(scope.row)">修改</el-button>
+            <span style="margin:0 3px;">|</span>
+            <el-button
+              type="text"
+              size="small"
+              :class="['delete',{'forbid':scope.row.status==1}]"
+              @click="showDelDialog(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/cdss.js';
+
 export default {
+  name: 'DisclaimerCDSS',
+  data: function() {
+    return {
+      list: [],
+      cacheData: {},
+      currentPage: 1,
+      pageSize: 10,
+      total: 0,
+      linkIn: [],
+      pays: [],
+      searched: false,
+      filter: {
+        title: ''
+      },
+      options: []
+    };
+  },
+  created() {
+    const that = this;
+    //返回时避免参数未赋值就获取列表
+    setTimeout(function() {
+      that.getDataList();
+    });
 
-}
-</script>
+    api.getKlmEnumsDataCDSS().then(res => {
+      // console.log(res, '===========');
+      if (res.data.code === '0') {
+        this.options = res.data.data.disclaimerCodeAllEnum;
+      }
+    });
+  },
+  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: {
+    renderDisclaimerCode(row) {
+      let showInfo = '';
+      this.options &&
+        this.options.forEach(item => {
+          if (item.key == row.disclaimerCode) {
+            showInfo = item.name;
+          }
+        });
 
-<style>
+      return showInfo;
+    },
 
+    addDisclInfo() {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage };
+      // this.$router.push({ name: 'AddDisclaimerCDSS', params: pam });
+      this.$router.push({
+        name: 'AddDisclaimerCDSS',
+        params: Object.assign(pam, { options: this.options })
+      });
+    },
+    toEditDiscl(row) {
+      const pam = this.searched
+        ? {
+            currentPage: this.currentPage,
+            filter: this.filter
+          }
+        : { currentPage: this.currentPage };
+      this.$router.push({
+        name: 'AddDisclaimerCDSS',
+        params: Object.assign(pam, { info: row, options: this.options })
+      });
+    },
+    filterDatas() {
+      this.currentPage = 1;
+      this.getDataList();
+    },
+    getDataList(isTurnPage) {
+      const param = 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
+        .getDisclaimerPagesCDSS(param)
+        .then(res => {
+          loading.close();
+          if (res.data.code == '0') {
+            const data = res.data.data;
+            this.list = data.records;
+            this.cacheData[param.current] = data.records;
+            this.total = data.total;
+            if (this.inCurrentPage !== undefined) {
+              this.currentPage = this.inCurrentPage;
+              this.inCurrentPage = undefined;
+            }
+          }
+        })
+        .catch(error => {
+          console.log(error);
+        });
+    },
+    getDetail(item) {
+      this.$router.push({
+        name: 'DisclaimerDetailCDSS',
+        params: { info: item, options: this.options }
+      });
+    },
+    getFilterItems(isTurnPage) {
+      //翻页时筛选条件没点确定则清空
+      if (isTurnPage && !this.searched) {
+        this.filter.title = '';
+      }
+      const param = {
+        title: this.filter.title.trim(),
+        current: this.inCurrentPage || 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(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(() => {});
+    },
+    showDelDialog(item) {
+      // 启用状态下不能删除
+      if (item.status == 1) {
+        return;
+      }
+      this.showConfirmDialog('是否删除该免责声明?', () => {
+        api
+          .cancelDisclaimerInformationsCDSS({ id: item.id })
+          .then(res => {
+            if (res.data.code == '0') {
+              if (!this.searched) {
+                //未点确认时清空搜索条件
+                this.filter = {
+                  title: ''
+                };
+              }
+              this.warning(res.data.msg || '操作成功', 'success');
+              this.getDataList();
+            } else {
+              this.warning(res.data.msg);
+            }
+          })
+          .catch(error => {
+            this.warning(error);
+          });
+      });
+    },
+    toOpen(item) {
+      console.log(1231321, item);
+      // status=0停用,status=1启用
+      if (item.status == 0) {
+        this.showConfirmDialog('是否启用该免责声明?', () => {
+          api
+            .startDisclaimerInformationsCDSS({ id: item.id })
+            .then(res => {
+              console.log(res, '============================');
+              return;
+              if (res.data.code == 0) {
+                //恢复成功后跳转到筛选条件的首页
+                this.currentPage = 1;
+                this.$message({
+                  type: 'success',
+                  message: res.data.msg || '启用成功'
+                });
+                this.getDataList();
+              }
+            })
+            .catch(error => {
+              this.warning(error);
+            });
+        });
+      }
+    },
+    toClose(item) {
+      if (item.status == 1) {
+        this.showConfirmDialog('是否停用该免责声明?', () => {
+          api
+            .endDisclaimerInformationsCDSS({ id: item.id })
+            .then(res => {
+              if (res.data.code == 0) {
+                this.$message({
+                  type: 'success',
+                  message: res.data.msg || '停用成功'
+                });
+                this.getDataList();
+              }
+            })
+            .catch(error => {
+              this.warning(error);
+            });
+        });
+      }
+    }
+  }
+};
+</script>
+
+<style lang="less" scoped>
+@import '../../../less/admin.less';
+.delete {
+  color: red !important;
+}
+.forbid {
+  color: #bfbfbf !important;
+}
 </style>

+ 62 - 0
src/components/cdssManage/disclaimer/DisclaimerDetail.vue

@@ -0,0 +1,62 @@
+<template>
+  <div>
+    <crumbs title="免责声明维护-详情" linkTo="DisclaimerCDSS"></crumbs>
+    <div class="contents">
+      <div class="deptbox">
+        <p class="titl">标题</p>
+        <p>{{data.title}}</p>
+        <p class="titl marg">内容</p>
+        <p v-html="data.description">{{data.description}}</p>
+        <p class="titl marg">归属</p>
+        <p>{{renderDisclaimerCode(data)}}</p>
+      </div>
+    </div>
+  </div>
+</template>
+<script type="text/javascript">
+export default {
+  name: 'DisclaimerDetailCDSS',
+  data() {
+    return {
+      data: {
+        options: []
+      }
+    };
+  },
+  created() {
+    // console.log(this.$route.params.options);
+    this.options = this.$route.params.options;
+    this.data = this.$route.params.info;
+  },
+  methods: {
+    renderDisclaimerCode(row) {
+      let showInfo = '';
+      this.options &&
+        this.options.forEach(item => {
+          if (item.key == row.disclaimerCode) {
+            showInfo = item.name;
+          }
+        });
+
+      return showInfo;
+    }
+  }
+};
+</script>
+<style lang="less" scoped>
+@import '../../../less/admin.less';
+.deptbox {
+  // width: 100%;
+  background: #fff;
+  padding: 20px 20px 30px;
+  font-size: 14px;
+  // color: #545455;
+  text-align: left;
+  .titl {
+    font-weight: bold;
+  }
+  .marg {
+    margin-top: 20px;
+  }
+}
+</style>

+ 5 - 5
src/components/cdssManage/version/AddVersion.vue

@@ -45,7 +45,7 @@
   </div>
 </template>
 <script type="text/javascript">
-  import api from '@api/icss.js';
+  import api from '@api/cdss.js';
   import VersionDesc from './VersionDesc.vue';
   export default {
     name:'AddVersionCDSS',
@@ -151,7 +151,7 @@
             if(this.id && !this.copy){//修改
               const param = Object.assign({},this.form,{id:this.id})
               this.saveDisable = true  //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
-              api.updateVersInfo(param).then((res)=>{
+              api.updateVersionInfoAllsCDSS(param).then((res)=>{
                 if(res.data.code==0){
                   this.$message({
                     message:"修改成功",
@@ -159,7 +159,7 @@
                   });
                   //返回带搜索条件的首页
                   this.$router.push({
-                    name: 'VersionInfo',
+                    name: 'VersionCDSS',
                     params: Object.assign({}, this.$route.params, {currentPage: 1})
                   });
                 }else{
@@ -186,14 +186,14 @@
               const params = Object.assign({},this.form,{'versionDetail':copyDetail});
               // api.addVersInfo(this.form).then((res)=>{
               this.saveDisable = true  //提交保存按钮不可点击,返回结果时才可点击,防止频繁发送请求
-              api.addVersInfo(params).then((res)=>{
+              api.saveVersionInfoAllsCDSS(params).then((res)=>{
                 if(res.data.code==0){
                   this.$message({
                     message:"添加成功",
                     type:'success'
                   })
                   // this.$router.push({path: 'LT-GBBXXWH-BBXXWH'});
-                  this.$router.push({name: 'VersionInfo'});
+                  this.$router.push({name: 'VersionCDSS'});
                 }else{
                   this.$message({
                     message:res.data.msg,

+ 374 - 359
src/components/cdssManage/version/VersionDesc.vue

@@ -1,316 +1,329 @@
 <template>
   <div class="version-desc">
-    <el-table v-if="list&&list.length>0" 
-              :data="list"
-              border
-              style="width: 100%">
-        <el-table-column
-                type="index"
-                :index="indexMethod"
-                label="编号"
-                width="60">
-        </el-table-column>
-        <el-table-column
-                v-if="!isCopy"
-                prop="gmtCreate"
-                label="建立时间"
-                :show-overflow-tooltip="true">
-        </el-table-column>
-        <el-table-column
-                prop="title"
-                label="标题">
-        </el-table-column>
-        <el-table-column
-                v-if="!isCopy"
-                prop="modifierid"
-                label="操作人">
-        </el-table-column>
-        <el-table-column v-if="isFirst"
-                label="操作">
-            <template slot-scope="scope">
-                <el-button type="text" size="small" @click="toEditDesc(scope.row,scope.$index)">修改</el-button>
-                <span style="margin:0 3px;">|</span>
-                <el-button type="text" size="small" class="delete" @click="showDelDialog(scope.row,scope.row.id,scope.$index)">删除</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 v-if="list&&list.length>0" :data="list" border style="width: 100%">
+      <el-table-column type="index" :index="indexMethod" label="编号" width="60"></el-table-column>
+      <el-table-column v-if="!isCopy" prop="gmtCreate" label="建立时间" :show-overflow-tooltip="true"></el-table-column>
+      <el-table-column prop="title" label="标题"></el-table-column>
+      <el-table-column v-if="!isCopy" prop="modifierid" label="操作人"></el-table-column>
+      <el-table-column v-if="isFirst" label="操作">
+        <template slot-scope="scope">
+          <el-button type="text" size="small" @click="toEditDesc(scope.row,scope.$index)">修改</el-button>
+          <span style="margin:0 3px;">|</span>
+          <el-button
+            type="text"
+            size="small"
+            class="delete"
+            @click="showDelDialog(scope.row,scope.row.id,scope.$index)"
+          >删除</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 v-if="isFirst" class="disclButn1" 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}}
-            <span v-if="tip" class="tip">(&lt;br /&gt;代表换行符,如果需要可在需要处输入)</span>
-            <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="31"></el-input>
-          </el-form-item>
-          <el-form-item label="内容:" prop="description" class="discDesc">
-            <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="501" @keydown.native="contentInp"></el-input>
-          </el-form-item>
-          <el-button class="disclButn1" size="small" type="primary" :disabled="confirmDisable" @click="comfirn('form')">确定</el-button>
-          <!-- <el-button class="disclButn can" size="small" type="primary" @click="cancel">取消</el-button> -->
+      <el-form
+        ref="form"
+        :model="form"
+        :rules="showDesc?{}:rules"
+        label-width="65px"
+        class="add-desc-form"
+      >
+        <p class="top">
+          {{minTitle}}
+          <span v-if="tip" class="tip">(&lt;br /&gt;代表换行符,如果需要可在需要处输入)</span>
+          <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="31"></el-input>
+        </el-form-item>
+        <el-form-item label="内容:" prop="description" class="discDesc">
+          <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="501"
+            @keydown.native="contentInp"
+          ></el-input>
+        </el-form-item>
+        <el-button
+          class="disclButn1"
+          size="small"
+          type="primary"
+          :disabled="confirmDisable"
+          @click="comfirn('form')"
+        >确定</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.title = value.substr(0, 30);
-           this.$message({
-             showClose: true,
-             type: 'warning',
-             message: '标题已超过最大限制30字'
-           })
-        }
-        callback();
-      };
-      const descVaild = (rule,value,callback) => {
-        if(!value){
-          return callback(new Error('请输入内容'));
-        }
-        if (value.length > 500) {
-           this.form.description = value.substr(0, 500);
-           this.$message({
-             showClose: true,
-             type: 'warning',
-             message: '内容已超过最大限制500字'
-           })
-        }
-        callback();
+import api from '@api/cdss.js';
+export default {
+  name: 'VersionDesc',
+  data() {
+    const titleVaild = (rule, value, callback) => {
+      if (!value) {
+        return callback(new Error('请输入标题'));
       }
-      return{
-        list:[],//版本说明列表
-        form:{
-          title:'',
-          description:''
-        },
-        rules: {
-          title:[
-            { required: true, validator: titleVaild, trigger: [ 'change'] },
-            { required: true, message: '请输入标题', trigger: ['blur', 'change'] }
-          ],
-          description:[
-            { required: true, validator: descVaild, trigger: [ 'change'] },
-            { required: true, message: '请输入内容', trigger: ['blur', 'change'] }
-          ]
-        },
-        minTitle:'',
-        showBox:false,
-        modiId:null,
-        showDesc:false,
-        tip:true,
-        modiIndex:null,
-        confirmDisable: false
+      if (value.length > 30) {
+        this.form.title = value.substr(0, 30);
+        this.$message({
+          showClose: true,
+          type: 'warning',
+          message: '标题已超过最大限制30字'
+        });
+      }
+      callback();
+    };
+    const descVaild = (rule, value, callback) => {
+      if (!value) {
+        return callback(new Error('请输入内容'));
+      }
+      if (value.length > 500) {
+        this.form.description = value.substr(0, 500);
+        this.$message({
+          showClose: true,
+          type: 'warning',
+          message: '内容已超过最大限制500字'
+        });
+      }
+      callback();
+    };
+    return {
+      list: [], //版本说明列表
+      form: {
+        title: '',
+        description: ''
+      },
+      rules: {
+        title: [
+          { required: true, validator: titleVaild, trigger: ['change'] },
+          { required: true, message: '请输入标题', trigger: ['blur', 'change'] }
+        ],
+        description: [
+          { required: true, validator: descVaild, trigger: ['change'] },
+          { required: true, message: '请输入内容', trigger: ['blur', 'change'] }
+        ]
+      },
+      minTitle: '',
+      showBox: false,
+      modiId: null,
+      showDesc: false,
+      tip: true,
+      modiIndex: null,
+      confirmDisable: false
+    };
+  },
+  created() {
+    // if(this.versionId){
+    //   this.getList();
+    // }
+  },
+  mounted() {
+    this.list = JSON.parse(JSON.stringify(this.detail));
+  },
+  props: ['detail', 'versionId', 'isFirst', 'isCopy'],
+  methods: {
+    // 按回车添加换行<br />
+    contentInp(e) {
+      if (e.keyCode == 13) {
+        this.form.description += '<br />';
       }
     },
-    created(){
-      // if(this.versionId){
-      //   this.getList();
-      // }
+    //用于修改时及时更新明细信息,若用本地信息,建立时间和操作人无法及时更新。
+    getList() {
+      api.getDetailByIdCDSS({ id: this.versionId }).then(res => {
+        const result = res.data;
+        if (result.code == 0) {
+          this.list = result.data;
+        } else {
+          this.$message({
+            message: result.msg,
+            type: 'warning'
+          });
+        }
+      });
     },
-    mounted(){
-      this.list = JSON.parse(JSON.stringify(this.detail));
+    indexMethod(index) {
+      return index + 1;
     },
-    props:['detail','versionId','isFirst','isCopy'],
-    methods:{
-      // 按回车添加换行<br />
-      contentInp(e){
-        if(e.keyCode==13){
-          this.form.description += '<br />'
-        }
-      },
-      //用于修改时及时更新明细信息,若用本地信息,建立时间和操作人无法及时更新。
-      getList(){
-        api.getVersionDetlInfo({id:this.versionId}).then((res)=>{
-          const result = res.data;
-          if(result.code==0){
-            this.list = result.data;
-          }else{
-            this.$message({
-              message:result.msg,
-              type:'warning'
-            });
-          }
-        })
-      },
-      indexMethod(index) {
-        return index + 1;
-      },
-      toEditDesc(item,index){//修改备注
-        this.minTitle='修改说明';
-        this.showBox = true;
-        this.form.title = item.title;
-        this.form.description = item.description;
-        this.modiId = item.id;
-        this.modiIndex = index;
-      },
-      addDesc(){//添加备注
-        this.minTitle='添加说明';
-        this.showBox = true;
-      },
-      comfirn(form){//记得清空modiId
-        /*if(!this.form.title.trim() || !this.form.description.trim()){
+    toEditDesc(item, index) {
+      //修改备注
+      this.minTitle = '修改说明';
+      this.showBox = true;
+      this.form.title = item.title;
+      this.form.description = item.description;
+      this.modiId = item.id;
+      this.modiIndex = index;
+    },
+    addDesc() {
+      //添加备注
+      this.minTitle = '添加说明';
+      this.showBox = true;
+    },
+    comfirn(form) {
+      //记得清空modiId
+      /*if(!this.form.title.trim() || !this.form.description.trim()){
           this.$message({
             message:'请填写相关信息',
             type:'warning'
           });
           return
         }*/
-        this.$refs[form].validate((valid) => {
-          if (valid) {
-              // 修改--直接调修改接口;复制--新增
-            this.confirmDisable = true
-            if(this.modiId){//修改
-              if(!this.isCopy){
-                const param = {
-                  title:this.form.title,
-                  description:this.form.description,
-                  detailId:this.modiId
-                }
-                api.modiVersionInfo(param).then((res)=>{
-                   this.confirmDisable = false
-                  if(res.data.code==0){
-                    this.$message({
-                      message:"修改成功",
-                      type:'success'
-                    })
-                    this.getList();
-                    /*for(let i in this.list){
+      this.$refs[form].validate(valid => {
+        if (valid) {
+          // 修改--直接调修改接口;复制--新增
+          this.confirmDisable = true;
+          if (this.modiId) {
+            //修改
+            if (!this.isCopy) {
+              const param = {
+                title: this.form.title,
+                description: this.form.description,
+                detailId: this.modiId
+              };
+              api.updateVersionDetailsCDSS(param).then(res => {
+                this.confirmDisable = false;
+                if (res.data.code == 0) {
+                  this.$message({
+                    message: '修改成功',
+                    type: 'success'
+                  });
+                  this.getList();
+                  /*for(let i in this.list){
                       if(this.list[i].id==this.modiId){
                         this.list[i].title=this.form.title;
                         this.list[i].description=this.form.description;
                       }
                     }*/
-                   
-                    this.reset();
-                  }else{
-                    this.$message({
-                      message:res.data.msg,
-                      type:'warning'
-                    });
-                  }
-                })
-              }else{
-                for(let i in this.list){
-                  if(this.list[i].id==this.modiId){
-                    this.list[i].title=this.form.title;
-                    this.list[i].description=this.form.description;
-                  }
+
+                  this.reset();
+                } else {
+                  this.$message({
+                    message: res.data.msg,
+                    type: 'warning'
+                  });
+                }
+              });
+            } else {
+              for (let i in this.list) {
+                if (this.list[i].id == this.modiId) {
+                  this.list[i].title = this.form.title;
+                  this.list[i].description = this.form.description;
                 }
-                this.$emit('func',this.list);//向父组件传明细
-                this.reset();
               }
-              
-            }else if(this.showDesc){//明细
+              this.$emit('func', this.list); //向父组件传明细
               this.reset();
-            }else{//添加
-              const item = {
-                description: this.form.description,
-                title: this.form.title,
-              }
-              if(!this.isCopy && this.versionId){
-                const params = {
-                  versionDetail: [
-                    item
-                  ],
-                  versionInfoId: this.versionId
-                }
-                api.addVersionInfo(params).then((res)=>{
-                   this.confirmDisable = false
-                  if(res.data.code==0){
-                    this.$message({
-                      message:"添加成功",
-                      type:'success'
-                    })
-                    this.getList();
-                    /*this.list.push(item);*/
-                    this.reset();
-                  }else{
-                    this.$message({
-                      message:res.data.msg,
-                      type:'warning'
-                    });
-                  }
-                })
-              }else{//仅添加到本地list
-                this.confirmDisable = false
-                if(this.modiIndex !==null){
-                  this.list[this.modiIndex].description = this.form.description;
-                  this.list[this.modiIndex].title = this.form.title;
-                }else{
-                  this.list.push(item);
-                }
-                this.$emit('func',this.list);
-                this.reset();
-              } 
             }
-            // this.reset();
+          } else if (this.showDesc) {
+            //明细
+            this.confirmDisable = false;
+            this.reset();
           } else {
-            return false;
+            //添加
+            const item = {
+              description: this.form.description,
+              title: this.form.title
+            };
+            if (!this.isCopy && this.versionId) {
+              const params = {
+                versionDetail: [item],
+                versionInfoId: this.versionId
+              };
+              api.addVersionDetailsCDSS(params).then(res => {
+                this.confirmDisable = false;
+                if (res.data.code == 0) {
+                  this.$message({
+                    message: '添加成功',
+                    type: 'success'
+                  });
+                  this.getList();
+                  /*this.list.push(item);*/
+                  this.reset();
+                } else {
+                  this.$message({
+                    message: res.data.msg,
+                    type: 'warning'
+                  });
+                }
+              });
+            } else {
+              //仅添加到本地list
+              this.confirmDisable = false;
+              if (this.modiIndex !== null) {
+                this.list[this.modiIndex].description = this.form.description;
+                this.list[this.modiIndex].title = this.form.title;
+              } else {
+                this.list.push(item);
+              }
+              this.$emit('func', this.list);
+              this.reset();
+            }
           }
-        }); 
-           
-      },
-      reset(){//关闭弹窗复原数据
-        this.showBox = false;
-        this.showDesc = false;
-        this.form.title = "";
-        this.form.description = "";
-        this.modiId = null;
-        this.minTitle= "";
-        this.tip = true;
-        this.modiIndex = null;
-      },
-      cancel(){
-        this.reset();
-      },
-      getDetail(item){//明细
-        this.minTitle='说明明细';
-        this.tip = false;
-        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(() => {
+          // this.reset();
+        } else {
+          return false;
+        }
+      });
+    },
+    reset() {
+      //关闭弹窗复原数据
+      this.showBox = false;
+      this.showDesc = false;
+      this.form.title = '';
+      this.form.description = '';
+      this.modiId = null;
+      this.minTitle = '';
+      this.tip = true;
+      this.modiIndex = null;
+    },
+    cancel() {
+      this.reset();
+    },
+    getDetail(item) {
+      //明细
+      this.minTitle = '说明明细';
+      this.tip = false;
+      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(item,id,index){
-        console.log('cancel',item,id,index)
-        this.showConfirmDialog('是否删除该版本说明?',()=>{
-          if(!this.isCopy&&id){
-            api.delVersionInfo({id}).then((res)=>{
-              if(res.data.code=='0'){
-                this.warning(res.data.msg||'操作成功','success');
+        })
+        .catch(() => {});
+    },
+    showDelDialog(item, id, index) {
+      console.log('cancel', item, id, index);
+      this.showConfirmDialog('是否删除该版本说明?', () => {
+        if (!this.isCopy && id) {
+          api
+            .cancelVersionDetailsCDSS({ id })
+            .then(res => {
+              if (res.data.code == '0') {
+                this.warning(res.data.msg || '操作成功', 'success');
                 this.getList();
                 /*let newList = JSON.parse(JSON.stringify(this.list));
                 for(let i in newList){
@@ -318,94 +331,96 @@
                     this.list.splice(i,1);
                   }
                 }*/
-              }else{
+              } else {
                 this.warning(res.data.msg);
               }
-            }).catch((error)=>{
-              this.warning(error);
             })
-          }else{
-            let newList = JSON.parse(JSON.stringify(this.list));
-            for(let i in newList){
-              if(id && newList[i].id==id){
-                this.list.splice(i,1);
-              }else {//新增的没有id
-                this.list.splice(index,1);
-              }
+            .catch(error => {
+              this.warning(error);
+            });
+        } else {
+          let newList = JSON.parse(JSON.stringify(this.list));
+          for (let i in newList) {
+            if (id && newList[i].id == id) {
+              this.list.splice(i, 1);
+            } else {
+              //新增的没有id
+              this.list.splice(index, 1);
             }
-            this.$emit('func',this.list);
           }
-          
-        });
-      },
-    },
-    watch:{
-      list:function(newVal,oldVal){
-        return newVal;
-      }
+          this.$emit('func', this.list);
+        }
+      });
+    }
+  },
+  watch: {
+    list: function(newVal, oldVal) {
+      return newVal;
     }
   }
+};
 </script>
 <style lang="less" >
-  @import "../../../less/admin.less";
-  .disclButn1{
-    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;
+@import '../../../less/admin.less';
+.disclButn1 {
+  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: 15%;
+  left: 50%;
+  // margin-top: -143px;
+  margin-left: -340px;
+  background: #fff;
+  padding: 20px;
+  max-height: 660px;
+  overflow-y: auto;
+}
+.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;
-    top: 15%;
-    left: 50%;
-    // margin-top: -143px;
-    margin-left: -340px;
-    background: #fff;
-    padding: 20px;
-    max-height: 660px;
-    overflow-y: auto;
-  }
-  .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;
-  }
-  .version-desc .el-table__body-wrapper{
-    max-height: 340px;
-    overflow-y: auto;
-  }
-  .version-desc .el-table th{
-    padding: 0px;
-  }
-  .tip{
-    font-weight: normal;
-    font-size: 13px;
-    color:#22ccc8;
+    right: 5px;
   }
+}
+.can,
+.can:hover {
+  background: #9b9b9b;
+  border-color: #9b9b9b;
+}
+.cont {
+  text-align: left;
+}
+.version-desc .el-table__body-wrapper {
+  max-height: 340px;
+  overflow-y: auto;
+}
+.version-desc .el-table th {
+  padding: 0px;
+}
+.tip {
+  font-weight: normal;
+  font-size: 13px;
+  color: #22ccc8;
+}
 </style>

+ 2 - 0
src/routes.js

@@ -180,6 +180,7 @@ import AddVersionCDSS from '@components/cdssManage/version/AddVersion.vue';  //C
 import VersionDetailCDSS from '@components/cdssManage/version/VersionDetail.vue';  //CDSS版本信息维护--新增编辑
 import DisclaimerCDSS from '@components/cdssManage/disclaimer/Disclaimer.vue';  //免责声明维护
 import AddDisclaimerCDSS from '@components/cdssManage/disclaimer/AddDisclaimer.vue';  //免责声明维护--新增编辑
+import DisclaimerDetailCDSS from '@components/cdssManage/disclaimer/DisclaimerDetail.vue';  //免责声明维护--详情
 
 export default [
   {
@@ -414,6 +415,7 @@ export default [
       { path: 'LT-CDSSSJWH-BBWHDETAIL', component: VersionDetailCDSS, name: 'VersionDetailCDSS' }, //CDSS版本信息维护--详情
       { path: 'LT-CDSSSJWH-MZSMWH', component: DisclaimerCDSS, name: 'DisclaimerCDSS' }, //免责声明维护
       { path: 'LT-CDSSSJWH-MZSMWHEDIT', component: AddDisclaimerCDSS, name: 'AddDisclaimerCDSS' }, //免责声明维护--新增编辑
+      { path: 'LT-CDSSSJWH-MZSMWHDETAIL', component: DisclaimerDetailCDSS, name: 'DisclaimerDetailCDSS' }, //免责声明维护--新增编辑