Browse Source

常见症状详情和修改

zhangxc 6 years ago
parent
commit
2639ce7119

+ 3 - 0
src/api/icss.js

@@ -105,6 +105,9 @@ export default {
     addCommonSymptom(param) {
     addCommonSymptom(param) {
         return axios.post(urls.addCommonSymptom, param)
         return axios.post(urls.addCommonSymptom, param)
     },
     },
+    getCommonSymptomById(param) {
+        return axios.post(urls.getCommonSymptomById, param)
+    },
     delCommonSymptom(param) {
     delCommonSymptom(param) {
         return axios.post(urls.delCommonSymptom, param)
         return axios.post(urls.delCommonSymptom, param)
     },
     },

+ 27 - 12
src/components/icss/AddCommonSymptom.vue

@@ -4,21 +4,21 @@
         <div class="groupTitle"><i
         <div class="groupTitle"><i
             class="el-icon-back"
             class="el-icon-back"
             @click="back"
             @click="back"
-        ></i> 常见症状维护系统--添加科室常见症状</div>
+        ></i> 常见症状维护系统--{{titleText}}</div>
         <el-form :model="form" ref="ruleForm" :rules="rules" class="addDepartForm">
         <el-form :model="form" ref="ruleForm" :rules="rules" class="addDepartForm">
             <el-form-item label="选择科室" prop="department">
             <el-form-item label="选择科室" prop="department">
-                <el-select v-model="form.department" placeholder="请添加科室" @change="changeDept" class="selectDepart">
+                <el-select :disabled="isEdit || isDetail" v-model="form.department" placeholder="请添加科室" @change="changeDept" class="selectDepart">
                     <el-option v-for="item in departList" :key="item.id" :label="item.name" :value="item.id"></el-option>
                     <el-option v-for="item in departList" :key="item.id" :label="item.name" :value="item.id"></el-option>
                 </el-select>
                 </el-select>
             </el-form-item>
             </el-form-item>
              <el-form-item label="选择类型" prop="type">
              <el-form-item label="选择类型" prop="type">
-                <el-select v-model="form.type" placeholder="请选择类型"  @change="changeType" class="selectDepart">
+                <el-select :disabled="isEdit || isDetail" v-model="form.type" placeholder="请选择类型"  @change="changeType" class="selectDepart">
                     <el-option v-for="item in typeList" :key="item.type" :label="item.typeName" :value="item.type"></el-option>
                     <el-option v-for="item in typeList" :key="item.type" :label="item.typeName" :value="item.type"></el-option>
                 </el-select>
                 </el-select>
             </el-form-item>
             </el-form-item>
         </el-form>
         </el-form>
         <div class="symptomList">
         <div class="symptomList">
-            <div class="bottomPartLeft fl">
+            <div class="bottomPartLeft fl" v-if="!isDetail">
                 
                 
                 <p class="symptomPoolTitle">症状池</p>
                 <p class="symptomPoolTitle">症状池</p>
                 <div class="symptomPool">
                 <div class="symptomPool">
@@ -45,7 +45,7 @@
                 </div>
                 </div>
 
 
             </div>
             </div>
-            <div class="bottomPartMid fl">
+            <div class="bottomPartMid fl" v-if="!isDetail">
                 <p><span class="el-icon-arrow-right" @click="toRightList"></span></p>
                 <p><span class="el-icon-arrow-right" @click="toRightList"></span></p>
                 <p><span class="el-icon-arrow-left" @click="toLeftList"></span></p>
                 <p><span class="el-icon-arrow-left" @click="toLeftList"></span></p>
             </div>
             </div>
@@ -56,14 +56,14 @@
                             v-for="(item,index) in rightTagsList" 
                             v-for="(item,index) in rightTagsList" 
                             :key='item.id'
                             :key='item.id'
                             :style="index === selectRightTagIndex?styles:null"
                             :style="index === selectRightTagIndex?styles:null"
-                            @click='selectRightTag(index)'
+                            @click='isDetail ? "":selectRightTag(index)'
                         >   
                         >   
                             <p v-if="item.tagName" class="tagName  ellipsis" :title="'[ '+item.tagName+' ]'">{{item.tagName}} </p>
                             <p v-if="item.tagName" class="tagName  ellipsis" :title="'[ '+item.tagName+' ]'">{{item.tagName}} </p>
                         </li>
                         </li>
                     </ul>
                     </ul>
 
 
             </div>
             </div>
-            <div class="bottomPartMid fl">
+            <div class="bottomPartMid fl" v-if="!isDetail">
                 <p><span class="el-icon-arrow-up" @click="toUp"></span></p>
                 <p><span class="el-icon-arrow-up" @click="toUp"></span></p>
                 <p><span class="el-icon-arrow-down" @click="toDown"></span></p>
                 <p><span class="el-icon-arrow-down" @click="toDown"></span></p>
             </div>
             </div>
@@ -93,9 +93,12 @@
                 department: '',
                 department: '',
                 type:''
                 type:''
             },
             },
+            titleText: '添加科室常见症状',
             departList: [],
             departList: [],
             typeList:[],
             typeList:[],
             searchVal: '',
             searchVal: '',
+            isEdit: false,
+            isDetail: false,
             leftTagsList:[],
             leftTagsList:[],
             rightTagsList:[],
             rightTagsList:[],
             selectLeftTagsList: [],
             selectLeftTagsList: [],
@@ -108,7 +111,19 @@
     created(){
     created(){
         const { isEdit, isDetail, data } = this.$route.params;
         const { isEdit, isDetail, data } = this.$route.params;
         if(isEdit || isDetail) {
         if(isEdit || isDetail) {
+            if(isEdit) {
+                this.titleText = '修改科室常见症状'
+            } else {
+                this.titleText = '科室常见症状详情'
+            }
             this.isEdit = isEdit
             this.isEdit = isEdit
+            this.isDetail = isDetail
+            this.rightTagsList = data.data
+            this.departList.push({name: data.name, id: data.id})
+            this.typeList.push({typeName: data.typeName, type: data.type})
+            this.form.department =data.id
+            this.form.type =data.type
+            this.getSymptomList()
             
             
         } else {
         } else {
             this.getDepartmentList()
             this.getDepartmentList()
@@ -152,7 +167,6 @@
             })
             })
         },
         },
         changeDept() {
         changeDept() {
-            console.log('asdasfdgag',this.departList)
             this.form.type = ''
             this.form.type = ''
             this.typeList = this.departList.filter(item => this.form.department == item.id)[0].typeDTOList
             this.typeList = this.departList.filter(item => this.form.department == item.id)[0].typeDTOList
             this.clearData()
             this.clearData()
@@ -181,15 +195,16 @@
         toRightList(){
         toRightList(){
             this.rightTagsList.push(...this.selectLeftTagsList);
             this.rightTagsList.push(...this.selectLeftTagsList);
             this.selectLeftTagsList = [];
             this.selectLeftTagsList = [];
-            this.selectRightTagsList = [];
+            this.selectRightTagIndex = -1;
             this.getSymptomList()
             this.getSymptomList()
         },
         },
         toLeftList(){
         toLeftList(){
-            for(let i = 0; i < this.selectRightTagsList.length; i++) {
-                this.rightTagsList = this.rightTagsList.filter(item => item.id !== this.selectRightTagsList[i].id)
+            if(this.selectRightTagIndex == -1) {
+                return
             }
             }
+            this.rightTagsList.splice(this.selectRightTagIndex, 1)
             this.selectLeftTagsList = [];
             this.selectLeftTagsList = [];
-            this.selectRightTagsList = [];
+            this.selectRightTagIndex = -1;
             this.getSymptomList()
             this.getSymptomList()
 
 
         },
         },

+ 14 - 8
src/components/icss/AddPhysicalExamTemp.vue

@@ -4,7 +4,7 @@
         <div class="groupTitle"><i
         <div class="groupTitle"><i
             class="el-icon-back"
             class="el-icon-back"
             @click="back"
             @click="back"
-        ></i> 查体模板维护系统--添加模板</div>
+        ></i> 查体模板维护系统--{{titleText}}</div>
         <el-form :model="form" ref="ruleForm" :rules="rules" class="addDepartForm">
         <el-form :model="form" ref="ruleForm" :rules="rules" class="addDepartForm">
             <el-form-item label="模板归属:"  >
             <el-form-item label="模板归属:"  >
                <span>查体</span>
                <span>查体</span>
@@ -49,8 +49,8 @@
             </div>
             </div>
             <div class="bottomPartRight fl">
             <div class="bottomPartRight fl">
                 <p class="symptomPoolTitle">查体模板: 
                 <p class="symptomPoolTitle">查体模板: 
-                    <span class="el-icon-arrow-right arrowIcon" @click="toDown"></span>
-                    <span class="el-icon-arrow-left arrowIcon" @click="toUp"></span> 
+                    <span v-if="!isDetail" class="el-icon-arrow-right arrowIcon" @click="toDown"></span>
+                    <span v-if="!isDetail" class="el-icon-arrow-left arrowIcon" @click="toUp"></span> 
                 </p>
                 </p>
                 <ul class="tagList operationPool">
                 <ul class="tagList operationPool">
                         <li class = "tagItem fl"
                         <li class = "tagItem fl"
@@ -89,6 +89,7 @@
             form: {
             form: {
                 department: '',
                 department: '',
             },
             },
+            titleText: '添加模板',
             departList: [],
             departList: [],
             searchVal: '',
             searchVal: '',
             leftTagsList:[],
             leftTagsList:[],
@@ -105,6 +106,11 @@
     created(){
     created(){
         const { isEdit, isDetail, data } = this.$route.params;
         const { isEdit, isDetail, data } = this.$route.params;
         if(isEdit || isDetail) {
         if(isEdit || isDetail) {
+            if(isEdit) {
+                this.titleText = '修改模板'
+            } else {
+                this.titleText = '模板详情'
+            }
             const { id, name } = data
             const { id, name } = data
             this.isEdit = isEdit
             this.isEdit = isEdit
             this.isDetail = isDetail
             this.isDetail = isDetail
@@ -176,16 +182,16 @@
         toRightList(){
         toRightList(){
             this.rightTagsList.push(...this.selectLeftTagsList);
             this.rightTagsList.push(...this.selectLeftTagsList);
             this.selectLeftTagsList = [];
             this.selectLeftTagsList = [];
-            this.selectRightTagsList = [];
+            this.selectRightTagIndex = -1;
             this.getTagList()
             this.getTagList()
-            console.log('rightTagsList', this.rightTagsList)
         },
         },
         toLeftList(){
         toLeftList(){
-            for(let i = 0; i < this.selectRightTagsList.length; i++) {
-                this.rightTagsList = this.rightTagsList.filter(item => item.id !== this.selectRightTagsList[i].id)
+            if(this.selectRightTagIndex == -1) {
+                return
             }
             }
+            this.rightTagsList.splice(this.selectRightTagIndex, 1)
             this.selectLeftTagsList = [];
             this.selectLeftTagsList = [];
-            this.selectRightTagsList = [];
+            this.selectRightTagIndex = -1;
             this.getTagList()
             this.getTagList()
 
 
         },
         },

+ 9 - 21
src/components/icss/CommonSymptom.vue

@@ -102,15 +102,20 @@
     },
     },
     methods: {
     methods: {
       toEditProduct(row){
       toEditProduct(row){
-        const param = {
+       
+        this.getCommonSymptomById('isEdit',row)
+
+      },
+      getCommonSymptomById(type, row) {
+         const param = {
             "deptId": row.id,
             "deptId": row.id,
             "type": row.type
             "type": row.type
         }
         }
         api.getCommonSymptomById(param).then((res)=>{
         api.getCommonSymptomById(param).then((res)=>{
             const {code,data,msg} = res.data;
             const {code,data,msg} = res.data;
             if(code=='0'){
             if(code=='0'){
-                const item = Object.assign({},row,data);
-                this.$router.push({name:'AddCommonSymptom',params:{isEdit:true,data:item}});
+                const item = Object.assign({},row,{data: data});
+                this.$router.push({name:'AddCommonSymptom',params:{[type]:true,data:item}});
             }else{
             }else{
                 this.$message({
                 this.$message({
                 message: msg,
                 message: msg,
@@ -118,7 +123,6 @@
                 });
                 });
             }
             }
         });
         });
-
       },
       },
       filterDatas(){
       filterDatas(){
         this.currentPage = 1;
         this.currentPage = 1;
@@ -131,7 +135,6 @@
         // };
         // };
         api.commonSymptomList(param).then((res) => {
         api.commonSymptomList(param).then((res) => {
           if (res.data.code == '0') {
           if (res.data.code == '0') {
-            console.log('commonSymptomList', res)
             const data = res.data.data;
             const data = res.data.data;
             this.list = data.records;
             this.list = data.records;
             this.total = data.total;
             this.total = data.total;
@@ -141,22 +144,7 @@
         });
         });
       },
       },
       getDetailList(row) {
       getDetailList(row) {
-        const param = {
-            "deptId": row.id,
-            "type": row.type
-        }
-        api.getCommonSymptomById(param).then((res)=>{
-            const {code,data,msg} = res.data;
-            if(code=='0'){
-                const item = Object.assign({},row,data);
-                this.$router.push({name:'AddCommonSymptom',params:{isEdit:true,data:item}});
-            }else{
-                this.$message({
-                message: msg,
-                type: 'warning'
-                });
-            }
-        });
+         this.getCommonSymptomById('isDetail',row)
       },
       },
       getFilterItems() {
       getFilterItems() {
         const param = {
         const param = {

+ 7 - 21
src/components/icss/PhysicalExamTemplate.vue

@@ -97,12 +97,15 @@
     },
     },
     methods: {
     methods: {
       toEditProduct(row){
       toEditProduct(row){
-        api.getPhysicalExamTempByDepId({deptId:row.id}).then((res)=>{
+        this.getPhysicalExamTempByDepId('isEdit', row)
+      },
+      getPhysicalExamTempByDepId(type, row) {
+        const param = {'deptId': row.id,};
+        api.getPhysicalExamTempByDepId(param).then((res)=>{
             const {code,data,msg} = res.data;
             const {code,data,msg} = res.data;
             if(code=='0'){
             if(code=='0'){
                 const item = Object.assign({},row,data);
                 const item = Object.assign({},row,data);
-                console.log('item', item)
-                this.$router.push({name:'AddPhysicalExamTemp',params:{isEdit:true,data:item}});
+                this.$router.push({name:'AddPhysicalExamTemp',params:{[type]:true,data:item}});
             }else{
             }else{
                 this.$message({
                 this.$message({
                 message: msg,
                 message: msg,
@@ -111,10 +114,6 @@
             }
             }
         });
         });
 
 
-        // this.$router.push({
-        //   name:'AddPhysicalExamTemp',
-        //   params: {info:row}
-        // })
       },
       },
       filterDatas(){
       filterDatas(){
         this.currentPage = 1;
         this.currentPage = 1;
@@ -127,7 +126,6 @@
         // };
         // };
         api.getPhysicalExamTempList(param).then((res) => {
         api.getPhysicalExamTempList(param).then((res) => {
           if (res.data.code == '0') {
           if (res.data.code == '0') {
-            console.log('PhysicalExamTempList', res)
             const data = res.data.data;
             const data = res.data.data;
             this.list = data.records;
             this.list = data.records;
             this.total = data.total;
             this.total = data.total;
@@ -137,19 +135,7 @@
         });
         });
       },
       },
       getDetailList(row) {
       getDetailList(row) {
-        const param = {'deptId': row.id,};
-        api.getPhysicalExamTempByDepId(param).then((res)=>{
-            const {code,data,msg} = res.data;
-            if(code=='0'){
-                const item = Object.assign({},row,data);
-                this.$router.push({name:'AddPhysicalExamTemp',params:{isDetail:true,data:item}});
-            }else{
-                this.$message({
-                message: msg,
-                type: 'warning'
-                });
-            }
-        });
+         this.getPhysicalExamTempByDepId('isDetail', row)
       },
       },
       getFilterItems() {
       getFilterItems() {
         const param = {
         const param = {