|
@@ -0,0 +1,306 @@
|
|
|
+<template>
|
|
|
+ <div>
|
|
|
+ <crumbs :title="title" :param="$route.params" linkTo="RecordInput"></crumbs>
|
|
|
+ <div class="contents">
|
|
|
+ <div class="content ">
|
|
|
+ <el-form ref="form" :label-position="labelPosition" label-width="90px" class="add-record-form clearfix" :model="form">
|
|
|
+ <div class="contentBox clearfix">
|
|
|
+ <div class="left fl clearfix">
|
|
|
+ <el-form-item label="病例信息:" prop="recordInfo">
|
|
|
+ <el-input
|
|
|
+ v-model="form.recordInfo"
|
|
|
+ type="textarea"
|
|
|
+ :rows="20"
|
|
|
+ placeholder="请输入内容">
|
|
|
+ </el-input>
|
|
|
+ </el-form-item>
|
|
|
+ </div>
|
|
|
+ <div class="right fr clearfix">
|
|
|
+ <el-select v-model="form.casesId" placeholder="请选择" @change="changeSelectCase">
|
|
|
+ <el-option
|
|
|
+ v-for="item in caseLIst"
|
|
|
+ :key="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ :value="item.id">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+ <div class="casesEntryList">
|
|
|
+ <el-checkbox-group v-model="form.checkedcasesEntrys" >
|
|
|
+ <el-checkbox v-for=" casesEntry in casesEntryList" :label="casesEntry.id" :key="casesEntry.id">{{casesEntry.name}}</el-checkbox>
|
|
|
+ </el-checkbox-group>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ <p class="oper">
|
|
|
+ <el-button style="margin-right: 30px" size="small" type="primary" @click="confirm('form')">确定</el-button>
|
|
|
+ <el-button size="small" @click="cancel">取消</el-button>
|
|
|
+ </p>
|
|
|
+ </el-form>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script type="text/javascript">
|
|
|
+ import api from '@api/records.js';
|
|
|
+ export default {
|
|
|
+ name:'AddRecord',
|
|
|
+ data(){
|
|
|
+ return{
|
|
|
+ // data:{},
|
|
|
+ labelPosition:'left',
|
|
|
+ /*zybljlList:[
|
|
|
+ {name:'aaa',content:'333333'},
|
|
|
+ {name:'vvv',content:'333sa'}
|
|
|
+ ],*/
|
|
|
+ caseLIst:[],
|
|
|
+ casesEntryList:[],
|
|
|
+ title:'病历录入-添加病例',
|
|
|
+ form:{
|
|
|
+ recordInfo:'',
|
|
|
+ casesId:'',
|
|
|
+ checkedcasesEntrys:[]
|
|
|
+ },
|
|
|
+ id:null,
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created(){
|
|
|
+
|
|
|
+
|
|
|
+ const { isEdit, data } = this.$route.params;
|
|
|
+ if(isEdit) {
|
|
|
+ this.titleText = '修改病例';
|
|
|
+ this.id= data.id
|
|
|
+ this.form.casesId = data.qcInputcasesMapping[0].casesId
|
|
|
+ this.form.recordInfo = data.text
|
|
|
+ let checkedcasesEntrys = []
|
|
|
+ this.getRecordInpModule().then(()=>{
|
|
|
+ this.changeSelectCase(this.form.casesId)
|
|
|
+ for(let i = 0; i < data.qcInputcasesMapping.length; i++) {
|
|
|
+ checkedcasesEntrys.push(data.qcInputcasesMapping[i].casesEntryId)
|
|
|
+ }
|
|
|
+ this.form.checkedcasesEntrys = checkedcasesEntrys
|
|
|
+ })
|
|
|
+
|
|
|
+ console.log( this.form.checkedcasesEntrys)
|
|
|
+
|
|
|
+ }else {
|
|
|
+ this.getRecordInpModule()
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ methods:{
|
|
|
+ getRecordInpModule(){
|
|
|
+ return api.getRecordInpModule({}).then((res)=>{
|
|
|
+ const result = res.data;
|
|
|
+ if(result.code==0){
|
|
|
+ this.caseLIst = result.data
|
|
|
+ }else{
|
|
|
+ this.$message({
|
|
|
+ message:result.msg,
|
|
|
+ type:'warning'
|
|
|
+ });
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ changeSelectCase(value){
|
|
|
+
|
|
|
+ this.form.checkedcasesEntrys = []
|
|
|
+ this.casesEntryList = this.caseLIst.filter(item => item.id === value)[0].qcCasesEntry
|
|
|
+ },
|
|
|
+ cancel(){
|
|
|
+ this.$router.push({
|
|
|
+ name: 'RecordInput',
|
|
|
+ params: Object.assign({}, this.$route.params)
|
|
|
+ });
|
|
|
+ },
|
|
|
+ confirm(form){
|
|
|
+ const {recordInfo, casesId, checkedcasesEntrys} = this.form
|
|
|
+ if(!recordInfo) {
|
|
|
+ this.warning('请输入病例信息')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(casesId === '') {
|
|
|
+ this.warning('请选择模块ID')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ if(!checkedcasesEntrys.length) {
|
|
|
+ this.warning('请选择条目')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let qcInputMappingSaveVO = [];
|
|
|
+ for(let i = 0; i < checkedcasesEntrys.length; i++) {
|
|
|
+ qcInputMappingSaveVO.push({
|
|
|
+ casesEntryId: checkedcasesEntrys[i],
|
|
|
+ casesId: casesId,
|
|
|
+ pass: 0
|
|
|
+ })
|
|
|
+ }
|
|
|
+ let param = {
|
|
|
+ text: recordInfo,
|
|
|
+ qcInputMappingSaveVO,
|
|
|
+ }
|
|
|
+ if(this.id){
|
|
|
+ param = Object.assign(param,{id: this.id})
|
|
|
+ }
|
|
|
+ api.addRecordInp(param).then((res)=>{
|
|
|
+ if(res.data.code==0){
|
|
|
+ if(this.id){
|
|
|
+ this.warning('修改成功', 'success')
|
|
|
+ }else{
|
|
|
+ this.warning('添加成功', 'success')
|
|
|
+ }
|
|
|
+
|
|
|
+ //返回带搜索条件的首页
|
|
|
+ this.$router.push({
|
|
|
+ name: 'RecordInput',
|
|
|
+ // params: Object.assign({}, this.$route.params)
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ this.warning(res.data.msg)
|
|
|
+
|
|
|
+ }
|
|
|
+ })
|
|
|
+ /*if(!this.form.name.trim() || !this.form.refreshTime.trim()){
|
|
|
+ this.$message({
|
|
|
+ message:'请填写相关内容',
|
|
|
+ type:'warning'
|
|
|
+ });
|
|
|
+ return
|
|
|
+ }*/
|
|
|
+ /*this.$refs[form].validate((valid) => {
|
|
|
+ if (valid) {*/
|
|
|
+ // if(id){//修改
|
|
|
+ // const param = Object.assign({},this.form,{basyid:this.basyid,brzyid:this.brzyid});
|
|
|
+ // api.saveRecord(param).then((res)=>{
|
|
|
+ // if(res.data.code==0){
|
|
|
+ // this.$message({
|
|
|
+ // message:"修改成功",
|
|
|
+ // type:'success'
|
|
|
+ // });
|
|
|
+ // //返回带搜索条件的首页
|
|
|
+ // this.$router.push({
|
|
|
+ // name: 'RecordManager',
|
|
|
+ // params: Object.assign({}, this.$route.params)
|
|
|
+ // });
|
|
|
+ // }else{
|
|
|
+ // this.$message({
|
|
|
+ // message:res.data.msg,
|
|
|
+ // type:'warning'
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }else{//添加
|
|
|
+ // // 复制时把list多余字段过滤掉,如id等
|
|
|
+ // const detail = this.list;
|
|
|
+ // let copyDetail=[];
|
|
|
+ // let item={};
|
|
|
+ // if(detail && detail.length>0){
|
|
|
+ // for(let i=0; i<detail.length; i++){
|
|
|
+ // item.title = detail[i].title;
|
|
|
+ // item.description = detail[i].description;
|
|
|
+ // copyDetail.push(item);
|
|
|
+ // item={};
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // const params = Object.assign({},this.form);
|
|
|
+ // // api.addVersInfo(this.form).then((res)=>{
|
|
|
+ // api.saveRecord(params).then((res)=>{
|
|
|
+ // if(res.data.code==0){
|
|
|
+ // this.$message({
|
|
|
+ // message:"添加成功",
|
|
|
+ // type:'success'
|
|
|
+ // })
|
|
|
+ // // this.$router.push({path: 'LT-GBBXXWH-BBXXWH'});
|
|
|
+ // this.$router.push({name: 'RecordManager'});
|
|
|
+ // }else{
|
|
|
+ // this.$message({
|
|
|
+ // message:res.data.msg,
|
|
|
+ // type:'warning'
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ /*} else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ });*/
|
|
|
+ },
|
|
|
+ warning(msg,type){
|
|
|
+ this.$message({
|
|
|
+ showClose: true,
|
|
|
+ message:msg,
|
|
|
+ type:type||'warning'
|
|
|
+ })
|
|
|
+ },
|
|
|
+ }
|
|
|
+ }
|
|
|
+</script>
|
|
|
+<style lang="less">
|
|
|
+ @import "../../less/admin.less";
|
|
|
+ .content{
|
|
|
+ background: #fff;
|
|
|
+ padding: 20px 20px 50px;
|
|
|
+ color: #545455;
|
|
|
+ min-width: 980px;
|
|
|
+ position: relative;
|
|
|
+ .left,.right{
|
|
|
+ width: 50%;
|
|
|
+ height: 450px;
|
|
|
+ }
|
|
|
+ .right{
|
|
|
+ width: 45%;
|
|
|
+ margin-left: 5%;
|
|
|
+ .el-select{
|
|
|
+ width: 80%;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .casesEntryList{
|
|
|
+ margin-top: 20px;
|
|
|
+ padding: 10px 0;
|
|
|
+ width: 80%;
|
|
|
+ border: 1px solid #dcdfe6;
|
|
|
+ height: 350px;
|
|
|
+ overflow-y: auto;
|
|
|
+ .el-checkbox{
|
|
|
+ position: relative;
|
|
|
+ display: block;
|
|
|
+ width: calc(100% - 60px);
|
|
|
+ margin-left: 30px;
|
|
|
+ line-height: 30px;
|
|
|
+ .el-checkbox__input{
|
|
|
+ position: absolute;
|
|
|
+ top: 9px;
|
|
|
+ }
|
|
|
+ .el-checkbox__label{
|
|
|
+ padding: 0 0 0 20px;
|
|
|
+ white-space: normal;
|
|
|
+ line-height: 30px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .short-inp{
|
|
|
+ width: 200px;
|
|
|
+ }
|
|
|
+ .sub-title{
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 16px;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ }
|
|
|
+ .oper{
|
|
|
+ padding-right: 80px;
|
|
|
+ text-align: right;
|
|
|
+ }
|
|
|
+ .treatments{
|
|
|
+ .el-input{
|
|
|
+ width:200px;
|
|
|
+ display: inline-block;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+</style>
|