Selaa lähdekoodia

Merge branch 'master' of http://git.shengws.com/csx/Vue_New

XMLWAN 5 vuotta sitten
vanhempi
commit
58add9dc03

+ 1 - 1
config/dev.env.js Näytä tiedosto

@@ -7,7 +7,7 @@ module.exports = {
7 7
   NODE_ENV: '"development"',
8 8
   ENV_CONFIG: '"dev"',
9 9
   BASE_API: '"http://api.xt.test.sgjyun.com"', // //http://api.xt.test.sgjyun.com http://112.74.16.180:9527,////'"http://localhost:9529"',
10
-  //BASE_API:'"http://localhost:9531"',
10
+  // BASE_API:'"http://localhost:9531"',
11 11
   SSO_HOST: '"http://testsso.sgjyun.com"',
12 12
   SRCM_HOST: '"http://test1.sgjyun.com"',
13 13
   XT_HOST: '"http://xt.test.sgjyun.com"',

+ 1 - 1
config/index.js Näytä tiedosto

@@ -20,7 +20,7 @@ module.exports = {
20 20
     // host: 'xt.test.sgjyun.com',
21 21
     // host: 'xt.kuyicloud.com',
22 22
     host: 'xt.test.sgjyun.com',
23
-    //host:'localhost',
23
+    // host:'localhost',
24 24
     port: 9528, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
25 25
     autoOpenBrowser: true,
26 26
     errorOverlay: true,

+ 5 - 1
src/lang/zh.js Näytä tiedosto

@@ -170,7 +170,11 @@ export default {
170 170
     remind_print: '排版提醒打印',
171 171
     system_prescription: '透析方案',
172 172
     integration_config: '集成配置',
173
-    his_config: 'HIS集成配置'
173
+    his_config: 'HIS集成配置',
174
+
175
+    slow:"慢病管理",
176
+    scrm:'SCRM',
177
+    shop:"分销商城",
174 178
   },
175 179
   navbar: {
176 180
     logOut: '退出登录',

+ 6 - 0
src/router/index.js Näytä tiedosto

@@ -17,6 +17,9 @@ import org from './modules/org'
17 17
 import systems from './modules/systems'
18 18
 import data_upload from './modules/data_upload'
19 19
 import integration from './modules/integration'
20
+import slow from './modules/slow'
21
+import scrm from './modules/scrm'
22
+import shop from './modules/shop'
20 23
 
21 24
 
22 25
 
@@ -104,6 +107,9 @@ var _asy_router_map = [
104 107
   device,
105 108
   org,
106 109
   data_upload,
110
+  slow,
111
+  scrm,
112
+  shop,
107 113
   integration,
108 114
   systems,
109 115
 ]

+ 17 - 0
src/router/modules/scrm.js Näytä tiedosto

@@ -0,0 +1,17 @@
1
+import Layout from '@/views/layout/Layout'
2
+
3
+export default {
4
+  path: '/scrm',
5
+  component: Layout,
6
+  redirct: 'noredirect',
7
+//   hidden:true,
8
+  children: [{
9
+    path: process.env.SRCM_HOST,
10
+    name: 'scrm',
11
+    meta: {
12
+      title: 'scrm',
13
+      other:true,
14
+      noCache: true
15
+    }
16
+  }]
17
+}

+ 16 - 0
src/router/modules/shop.js Näytä tiedosto

@@ -0,0 +1,16 @@
1
+import Layout from '@/views/layout/Layout'
2
+
3
+export default {
4
+  path: '/shop',
5
+  component: Layout,
6
+  redirct: 'noredirect',
7
+  children: [{
8
+    path: process.env.MIRCO_MALL_HOST,
9
+    name: 'shop',
10
+    meta: {
11
+      title: 'shop',
12
+      other:true,
13
+      noCache: true
14
+    }
15
+  }]
16
+}

+ 16 - 0
src/router/modules/slow.js Näytä tiedosto

@@ -0,0 +1,16 @@
1
+import Layout from '@/views/layout/Layout'
2
+
3
+export default {
4
+  path: '/slow',
5
+  component: Layout,
6
+  redirct: 'noredirect',
7
+  children: [{
8
+    path: 'process.env.CDM_HOST',
9
+    name: 'slow',
10
+    meta: {
11
+      title: 'slow',
12
+      other:true,
13
+      noCache: true
14
+    }
15
+  }]
16
+}

+ 2 - 2
src/store/modules/xt_permission.js Näytä tiedosto

@@ -43,7 +43,7 @@ function xt_filterAsyncRouter(routers) {
43 43
 function setupRouters(urls) {
44 44
   // console.log(urls)
45 45
   xt_asyncRouterMap.forEach(router => {
46
-    // console.log(router.path)
46
+    console.log(router)
47 47
     if (Object.prototype.toString.call(router.children) === '[object Array]') {
48 48
       router.hidden = true
49 49
       router.children.forEach(c_router => {
@@ -61,7 +61,7 @@ function setupRouters(urls) {
61 61
     } else {
62 62
       router.hidden = true
63 63
       if (IndexOf(urls, router.path) !== -1) {
64
-        // console.log('router show : ' + router.path)
64
+        console.log('router show : ' + router.path)
65 65
       // if (urls.indexOf(router.path) !== -1) {
66 66
         router.hidden = false
67 67
       }

+ 81 - 6
src/store/modules/xt_user.js Näytä tiedosto

@@ -214,9 +214,47 @@ const xt_user = {
214 214
             mall_role_exist: infoJSON.mall_role_exist
215 215
           })
216 216
 
217
-          commit('SET_URLFORS', {
218
-            urlfors: infoJSON.urlfors
219
-          })
217
+          
218
+          let urlfors = infoJSON.urlfors
219
+          if(infoJSON.cdm_role_exist == true){
220
+            console.log("有")
221
+            urlfors.push("/slow")
222
+            this.commit('SET_URLFORS', {
223
+              urlfors: urlfors
224
+            })
225
+          }else{
226
+            this.commit('SET_URLFORS', {
227
+              urlfors: infoJSON.urlfors
228
+            })
229
+          }
230
+
231
+          if(infoJSON.scrm_role_exist == true){
232
+            urlfors.push("/scrm")
233
+            this.commit('SET_URLFORS', {
234
+              urlfors: urlfors
235
+            })
236
+          }else{
237
+            this.commit('SET_URLFORS', {
238
+              urlfors: infoJSON.urlfors
239
+            })
240
+          }
241
+
242
+          if(infoJSON.mall_role_exist == true){
243
+            console.log("有")
244
+            urlfors.push("/shop")
245
+            this.commit('SET_URLFORS', {
246
+              urlfors: urlfors
247
+            })
248
+          }else{
249
+            this.commit('SET_URLFORS', {
250
+              urlfors: infoJSON.urlfors
251
+            })
252
+          }
253
+          console.log(222222222222,infoJSON)
254
+          
255
+          // commit('SET_URLFORS', {
256
+          //   urlfors: infoJSON.urlfors
257
+          // })
220 258
 
221 259
           resolve(infoJSON.user.user_id)
222 260
         } else {
@@ -237,9 +275,46 @@ const xt_user = {
237 275
                 mall_role_exist: data.mall_role_exist
238 276
               })
239 277
 
240
-              this.commit('SET_URLFORS', {
241
-                urlfors: data.urlfors
242
-              })
278
+              let urlfors = data.urlfors
279
+              if(data.cdm_role_exist == true){
280
+                console.log("有")
281
+                urlfors.push("/slow")
282
+                this.commit('SET_URLFORS', {
283
+                  urlfors: urlfors
284
+                })
285
+              }else{
286
+                this.commit('SET_URLFORS', {
287
+                  urlfors: data.urlfors
288
+                })
289
+              }
290
+
291
+              if(data.scrm_role_exist == true){
292
+                urlfors.push("/scrm")
293
+                this.commit('SET_URLFORS', {
294
+                  urlfors: urlfors
295
+                })
296
+              }else{
297
+                this.commit('SET_URLFORS', {
298
+                  urlfors: data.urlfors
299
+                })
300
+              }
301
+
302
+              if(data.mall_role_exist == true){
303
+                console.log("有")
304
+                urlfors.push("/shop")
305
+                this.commit('SET_URLFORS', {
306
+                  urlfors: urlfors
307
+                })
308
+              }else{
309
+                this.commit('SET_URLFORS', {
310
+                  urlfors: data.urlfors
311
+                })
312
+              }
313
+              
314
+
315
+              // this.commit('SET_URLFORS', {
316
+              //   urlfors: data.urlfors
317
+              // })
243 318
 
244 319
               commit('SET_FILEDS', {
245 320
                 fileds: data.fileds

+ 18 - 2
src/views/layout/components/Sidebar/SidebarItem.vue Näytä tiedosto

@@ -8,7 +8,7 @@
8 8
       "
9 9
       @click="onClick(item)"
10 10
     >
11
-      <router-link :to="resolvePath(onlyOneChild.path)">
11
+      <router-link v-if="!onlyOneChild.meta.other" :to="resolvePath(onlyOneChild.path)">
12 12
         <el-menu-item
13 13
           :index="resolvePath(onlyOneChild.path)"
14 14
           :class="{ 'submenu-title-noDropdown': !isNest }"
@@ -23,6 +23,20 @@
23 23
           >{{ generateTitle(onlyOneChild.meta.title) }}</span>
24 24
         </el-menu-item>
25 25
       </router-link>
26
+      <a v-else :href="onlyOneChild.path" target="_blank">
27
+        <el-menu-item
28
+          :index="resolvePath(onlyOneChild.path)"
29
+          :class="{ 'submenu-title-noDropdown': !isNest }"
30
+        >
31
+          <i v-if="onlyOneChild.name == 'slow'" class="icon iconfont icon-manbing-xuanzhong" style="margin-right:4px"></i>
32
+          <i v-if="onlyOneChild.name == 'scrm'" class="icon iconfont icon-pengyou" style="margin-right:4px"></i>
33
+          <i v-if="onlyOneChild.name == 'shop'" class="icon iconfont icon-service_fill" style="margin-right:4px"></i>
34
+          <span
35
+            v-if="onlyOneChild.meta && onlyOneChild.meta.title"
36
+            slot="title"
37
+          >{{ generateTitle(onlyOneChild.meta.title) }}</span>
38
+        </el-menu-item>
39
+      </a>
26 40
     </div>
27 41
 
28 42
     <div v-else>
@@ -187,7 +201,9 @@ export default {
187 201
       return true;
188 202
     }
189 203
   },
190
-  created() {}
204
+  created() {
205
+    console.log(1111111111,this.permission_routers)
206
+  }
191 207
 };
192 208
 </script>
193 209
 

+ 2 - 2
src/views/layout/components/Sidebar/index.vue Näytä tiedosto

@@ -37,7 +37,7 @@
37 37
         :index="index"
38 38
         @a="b"
39 39
       ></sidebar-item>
40
-     <el-menu-item v-if="this.$store.getters.xt_user.cdm_role_exist" index="100">
40
+     <!-- <el-menu-item v-if="this.$store.getters.xt_user.cdm_role_exist" index="100">
41 41
       <a :href="CDMWebsit()">
42 42
         <i class="icon iconfont icon-manbing-xuanzhong" style="margin-right:4px"></i>
43 43
         <span
@@ -60,7 +60,7 @@
60 60
             slot="title"
61 61
           >分销商城</span>
62 62
         </a>
63
-      </el-menu-item>
63
+      </el-menu-item> -->
64 64
     </el-menu>
65 65
 
66 66
   </el-scrollbar>

+ 3 - 3
src/xt_pages/dialysis/batch_print/batch_print_order_other.vue Näytä tiedosto

@@ -975,13 +975,13 @@
975 975
                               v-if="
976 976
                                 setAdminUserES(
977 977
                                   record.assessment_before_dislysis,
978
-                                  'modifier'
978
+                                  'creater'
979 979
                                 ) == ''
980 980
                               "
981 981
                               >{{
982 982
                                 getAdminUser(
983 983
                                   record.assessment_before_dislysis,
984
-                                  "modifier"
984
+                                  "creater"
985 985
                                 )
986 986
                               }}</span
987 987
                             >
@@ -990,7 +990,7 @@
990 990
                               :src="
991 991
                                 setAdminUserES(
992 992
                                   record.assessment_before_dislysis,
993
-                                  'modifier'
993
+                                  'creater'
994 994
                                 )
995 995
                               "
996 996
                               alt

+ 25 - 25
src/xt_pages/dialysis/batch_print/batch_print_order_other_one.vue Näytä tiedosto

@@ -939,31 +939,31 @@
939 939
                             </div>
940 940
                           </td>
941 941
                           <td>
942
-                            <!--<span-->
943
-                              <!--v-if="-->
944
-                                <!--setAdminUserES(-->
945
-                                  <!--record.assessment_before_dislysis,-->
946
-                                  <!--'creater'-->
947
-                                <!--) == ''-->
948
-                              <!--"-->
949
-                              <!--&gt;{{-->
950
-                                <!--getAdminUser(-->
951
-                                  <!--record.assessment_before_dislysis,-->
952
-                                  <!--"creater"-->
953
-                                <!--)-->
954
-                              <!--}}</span-->
955
-                            <!--&gt;-->
956
-                            <!--<img-->
957
-                              <!--class="es-img"-->
958
-                              <!--:src="-->
959
-                                <!--setAdminUserES(-->
960
-                                  <!--record.assessment_before_dislysis,-->
961
-                                  <!--'creater'-->
962
-                                <!--)-->
963
-                              <!--"-->
964
-                              <!--alt=""-->
965
-                              <!--srcset=""-->
966
-                              <!--v-else-->
942
+                            <span
943
+                              v-if="
944
+                                setAdminUserES(
945
+                                  record.assessment_before_dislysis,
946
+                                  'creater'
947
+                                ) == ''
948
+                              "
949
+                              >{{
950
+                                getAdminUser(
951
+                                  record.assessment_before_dislysis,
952
+                                  "creater"
953
+                                )
954
+                              }}</span
955
+                            >
956
+                            <img
957
+                              class="es-img"
958
+                              :src="
959
+                                setAdminUserES(
960
+                                  record.assessment_before_dislysis,
961
+                                  'creater'
962
+                                )
963
+                              "
964
+                              alt=""
965
+                              srcset=""
966
+                              v-else
967 967
                             />
968 968
                           </td>
969 969
                         </tr>

+ 11 - 11
src/xt_pages/dialysis/template/dialysisPrintOrderTwo.vue Näytä tiedosto

@@ -697,17 +697,17 @@
697 697
                         </div>
698 698
                       </td>
699 699
                       <td>
700
-                        <!--<span-->
701
-                          <!--v-if="setAdminUserES(predialysis.modifier) == ''"-->
702
-                          <!--&gt;{{ getAdminUser(predialysis.modifier) }}</span-->
703
-                        <!--&gt;-->
704
-                        <!--<img-->
705
-                          <!--class="es-img"-->
706
-                          <!--:src="setAdminUserES(predialysis.modifier)"-->
707
-                          <!--alt=""-->
708
-                          <!--srcset=""-->
709
-                          <!--v-else-->
710
-                        <!--/>-->
700
+                        <span
701
+                          v-if="setAdminUserES(predialysis.creater) == ''"
702
+                          >{{ getAdminUser(predialysis.creater) }}</span
703
+                        >
704
+                        <img
705
+                          class="es-img"
706
+                          :src="setAdminUserES(predialysis.creater)"
707
+                          alt=""
708
+                          srcset=""
709
+                          v-else
710
+                        />
711 711
                       </td>
712 712
                     </tr>
713 713
 

+ 308 - 371
src/xt_pages/user/inspection.vue Näytä tiedosto

@@ -4,30 +4,10 @@
4 4
     <div class="patient-app-container app-container" v-loading="pageLoading" element-loading-text="拼命加载中">
5 5
       <el-row :gutter="20">
6 6
         <el-col :span="7">
7
-          <el-table
8
-            :header-cell-style="{
9
-              backgroundColor: 'rgb(245, 247, 250)',
10
-              color: '#606266'
11
-            }"
12
-            :row-style="{ color: '#303133' }"
13
-            :data="projects"
14
-            border
15
-            style="width: 100%"
16
-            highlight-current-row
17
-            @current-change="handleCurrentChange"
18
-            ref="singleTable"
19
-          >
7
+          <el-table :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)', color: '#606266' }" :row-style="{ color: '#303133' }" :data="projects"  border style="width: 100%" highlight-current-row  @current-change="handleCurrentChange" ref="singleTable"  >
20 8
             <el-table-column label="检验检查项目" align="center">
21
-              <el-table-column
22
-                prop="project_name"
23
-                label="检验项目"
24
-                align="center">
25
-              </el-table-column>
26
-              <el-table-column
27
-                prop="count"
28
-                label="次数"
29
-                width="80"
30
-                align="center">
9
+              <el-table-column prop="project_name" label="检验项目" align="center"> </el-table-column>
10
+              <el-table-column prop="count" label="次数"  width="80"  align="center">
31 11
               </el-table-column>
32 12
             </el-table-column>
33 13
           </el-table>
@@ -41,71 +21,35 @@
41 21
           <div class="filter-container" >
42 22
             <el-button class="filter-item" type="text" style="color:#000">{{itemName}} <span v-if="itemDate">(检查日期:{{itemDate}})</span></el-button>
43 23
           </div>
44
-          <el-table
45
-            :header-cell-style="{
46
-              backgroundColor: 'rgb(245, 247, 250)',
47
-              color: '#606266'
48
-            }"
49
-            :row-style="{ color: '#303133' }"
50
-            :data="items"
51
-            border
52
-            style="width: 100%"
53
-            id="user-inspection-order"
54
-          >
55
-            <el-table-column
56
-              prop="item_name"
57
-              label="检验项目"
58
-              align="center"
59
-              min-width="180">
24
+          <el-table :header-cell-style="{ backgroundColor: 'rgb(245, 247, 250)', color: '#606266'  }"  :row-style="{ color: '#303133' }" :data="items"  border  style="width: 100%"  id="user-inspection-order" >
25
+            <el-table-column prop="item_name" label="检验项目" align="center" min-width="180">
60 26
               <template slot-scope="scope">
61 27
                 {{scope.row.item_name}} {{scope.row.item_name_addition}}
62 28
               </template>
63 29
             </el-table-column>
64
-            <el-table-column
65
-              prop="name"
66
-              label="结果"
67
-              align="center"
68
-              min-width="80">
30
+            <el-table-column prop="name" label="结果" align="center" min-width="80">
69 31
               <template slot-scope="scope">
70 32
                 <span>{{scope.row.value}}</span>
71 33
                 <span v-if="scope.row.range_type==1">{{scope.row.value_direction}}</span>
72 34
               </template>
73 35
             </el-table-column>
74
-            <el-table-column
75
-              prop="address"
76
-              label="参考值"
77
-              align="center"
78
-              min-width="120">
36
+            <el-table-column prop="address" label="参考值" align="center" min-width="120">
79 37
               <template slot-scope="scope">
80 38
                 <span v-if="scope.row.range_type==1">{{scope.row.range_min}}~{{scope.row.range_max}}</span>
81 39
                 <span v-else>{{scope.row.range_value}}</span>
82 40
               </template>
83 41
             </el-table-column>
84
-            <el-table-column
85
-              prop="unit"
86
-              label="单位"
87
-              align="center"
88
-              min-width="80">
42
+            <el-table-column prop="unit" label="单位"  align="center"  min-width="80">
89 43
             </el-table-column>
90 44
           </el-table>
91
-          <el-pagination
92
-          align="right"
93
-            @current-change="handleCurrentChangePage"
94
-            :current-page="queryParams.page"
95
-            :page-size="1"
96
-            background
97
-            style="margin-top:20px;"
98
-            layout="total, prev, pager, next, jumper"
99
-            :total="total">
45
+          <el-pagination align="right"  @current-change="handleCurrentChangePage" :current-page="queryParams.page" :page-size="1"  background style="margin-top:20px;" layout="total, prev, pager, next, jumper" :total="total">
100 46
           </el-pagination>
101 47
         </el-col>
102 48
       </el-row>
103 49
     </div>
104 50
 
105 51
     <el-dialog :title="formTitle" :visible.sync="dialogFormVisible" width="1000px" id="user-inspection-form" v-loading="formLoading">
106
-
107 52
       <el-form :model="form"  ref="form" label-position="top">
108
-
109 53
         <el-row >
110 54
           <el-col :span="24" v-if="form.formItem[0].project_id == 14">
111 55
             <el-form-item label="传染病周期提醒: " >
@@ -173,447 +117,440 @@
173 117
 </template>
174 118
 
175 119
 <script>
176
-import PatientSidebar from "./components/PatientSidebar";
177
-import {fetchInspectionReference,CreatePatientInspection,fetchPatientInspections,EditPatientInspection,DeletePatientInspection} from "@/api/inspection";
178
-import {uParseTime,isPositiveNumber} from "@/utils/tools";
120
+import PatientSidebar from './components/PatientSidebar'
121
+import { fetchInspectionReference, CreatePatientInspection, fetchPatientInspections, EditPatientInspection, DeletePatientInspection } from '@/api/inspection'
122
+import { uParseTime, isPositiveNumber } from '@/utils/tools'
179 123
 
180 124
 export default {
181
-  name: "Inspection",
125
+  name: 'Inspection',
182 126
   components: { PatientSidebar },
183 127
   data() {
184 128
     return {
185
-      total:0,
186
-      pageLoading:true,
187
-      itemLoading:false,
188
-      formLoading:false,
189
-      itemDate:'',
129
+      total: 0,
130
+      pageLoading: true,
131
+      itemLoading: false,
132
+      formLoading: false,
133
+      itemDate: '',
190 134
       patientID: 0,
191
-      panelClass: "patient-app-container",
135
+      panelClass: 'patient-app-container',
192 136
       patientInfo: {
193 137
         id: 0
194 138
       },
195
-      itemName:'请选择项目',
196
-      formTitle:'',
197
-      dialogFormVisible:false,
198
-      patient_info:null,
199
-      form:{
200
-        remind_cycle:'',
201
-        method:'add',
202
-        project_id:0,
203
-        inspect_date:'',
204
-        formItem:[
205
-          {id:0, value:''},
139
+      itemName: '请选择项目',
140
+      formTitle: '',
141
+      dialogFormVisible: false,
142
+      patient_info: null,
143
+      form: {
144
+        remind_cycle: '',
145
+        method: 'add',
146
+        project_id: 0,
147
+        inspect_date: '',
148
+        formItem: [
149
+          { id: 0, value: '' }
206 150
         ]
207 151
       },
208
-      formItem:[],
209
-      items:[],
210
-      inspections:[],
211
-      inspectionsMap:{},
212
-      projects:[],
213
-      project:null,
214
-      queryParams:{
215
-        patient:0,
216
-        project_id:0,
217
-        page:1
218
-      },
219
-    };
152
+      formItem: [],
153
+      items: [],
154
+      inspections: [],
155
+      inspectionsMap: {},
156
+      projects: [],
157
+      project: null,
158
+      queryParams: {
159
+        patient: 0,
160
+        project_id: 0,
161
+        page: 1
162
+      }
163
+    }
220 164
   },
221
-  methods:{
222
-    deleteInspection(){
223
-
224
-      if(this.project == null || this.itemDate == "") {
225
-        this.$message.error("请先选择删除删除的记录");
226
-        return false;
165
+  methods: {
166
+    deleteInspection() {
167
+      if (this.project == null || this.itemDate == '') {
168
+        this.$message.error('请先选择删除删除的记录')
169
+        return false
227 170
       }
228 171
 
229 172
       this.$confirm('确认删除此记录?', '删除', {
230
-          confirmButtonText: '确定',
231
-          cancelButtonText: '取消',
232
-          type: 'warning'
173
+        confirmButtonText: '确定',
174
+        cancelButtonText: '取消',
175
+        type: 'warning'
233 176
       }).then(() => {
234
-        var params = {patient: this.patientID, date: this.itemDate, project_id: this.project.project_id};
235
-          DeletePatientInspection(params).then(response=>{
236
-              if(response.data.state==0) {
237
-                  this.$message.error(response.data.msg);
238
-                  return false;
239
-              }else {
240
-                this.$notify({
241
-                    title: "成功",
242
-                    message: "删除成功",
243
-                    type: "success",
244
-                    duration: 2000
245
-                });
246
-
247
-                for( var index in this.projects) {
248
-                  if (this.projects[index].project_id == params.project_id) {
249
-                    this.projects[index].count --;
250
-                    break;
251
-                  }
252
-                }
253
-                this.total -=1;
254
-                this.itemDate = "";
255
-                this.items = [];
256
-                if(this.total > 0) {
257
-                  this.queryParams.page = 1;
258
-                  this.fetchPatientInspections(this.queryParams);
259
-                }
177
+        var params = { patient: this.patientID, date: this.itemDate, project_id: this.project.project_id }
178
+        DeletePatientInspection(params).then(response => {
179
+          if (response.data.state == 0) {
180
+            this.$message.error(response.data.msg)
181
+            return false
182
+          } else {
183
+            this.$notify({
184
+              title: '成功',
185
+              message: '删除成功',
186
+              type: 'success',
187
+              duration: 2000
188
+            })
189
+
190
+            for (var index in this.projects) {
191
+              if (this.projects[index].project_id == params.project_id) {
192
+                this.projects[index].count--
193
+                break
260 194
               }
261
-          });
262
-      }).catch(() => { });
195
+            }
196
+            this.total -= 1
197
+            this.itemDate = ''
198
+            this.items = []
199
+            if (this.total > 0) {
200
+              this.queryParams.page = 1
201
+              this.fetchPatientInspections(this.queryParams)
202
+            }
203
+          }
204
+        })
205
+      }).catch(() => { })
263 206
     },
264
-    openEdit(){
265
-      if(this.project == null) {
266
-        this.$message.error("请先选择项目");
267
-        return false;
207
+    openEdit() {
208
+      if (this.project == null) {
209
+        this.$message.error('请先选择项目')
210
+        return false
268 211
       }
269 212
 
270
-      this.form.method = "edit";
271
-      this.formTitle = "修改" + this.project.project_name;
272
-      this.form.project_id = this.project.project_id;
273
-      this.form.inspect_date = this.itemDate;
213
+      this.form.method = 'edit'
214
+      this.formTitle = '修改' + this.project.project_name
215
+      this.form.project_id = this.project.project_id
216
+      this.form.inspect_date = this.itemDate
274 217
       this.form.remind_cycle = this.patient_info.remind_cycle
275 218
       console.log(this.form.remind_cycle)
276 219
 
277
-      this.form.formItem = [];
278
-      for(var index in this.project.inspection_reference){
220
+      this.form.formItem = []
221
+      for (var index in this.project.inspection_reference) {
279 222
         this.form.formItem.push({
280
-          id:  (this.project.inspection_reference[index].id in this.inspectionsMap)? this.inspectionsMap[this.project.inspection_reference[index].id].id:0,
223
+          id: (this.project.inspection_reference[index].id in this.inspectionsMap) ? this.inspectionsMap[this.project.inspection_reference[index].id].id : 0,
281 224
           project_id: this.project.inspection_reference[index].project_id,
282 225
           project_name: this.project.inspection_reference[index].project_name,
283 226
           item_id: this.project.inspection_reference[index].id,
284 227
           item: this.project.inspection_reference[index].item,
285 228
           item_name: this.project.inspection_reference[index].item_name,
286 229
           range_type: this.project.inspection_reference[index].range_type,
287
-          value:(this.project.inspection_reference[index].id in this.inspectionsMap)? this.inspectionsMap[this.project.inspection_reference[index].id].inspect_value:"",
288
-          select_options: this.project.inspection_reference[index].range_options.split(","),
289
-          unit: this.project.inspection_reference[index].unit,
290
-        });
230
+          value: (this.project.inspection_reference[index].id in this.inspectionsMap) ? this.inspectionsMap[this.project.inspection_reference[index].id].inspect_value : '',
231
+          select_options: this.project.inspection_reference[index].range_options.split(','),
232
+          unit: this.project.inspection_reference[index].unit
233
+        })
291 234
       }
292 235
 
293
-      console.log( this.form.formItem)
294
-
295
-      this.dialogFormVisible = true;
236
+      console.log(this.form.formItem)
296 237
 
238
+      this.dialogFormVisible = true
297 239
     },
298
-    openNew(){
299
-      if(this.project == null) {
300
-        this.$message.error("请先选择项目");
301
-        return false;
240
+    openNew() {
241
+      if (this.project == null) {
242
+        this.$message.error('请先选择项目')
243
+        return false
302 244
       }
303
-      this.form.method = "add";
304
-      this.formTitle = "新增" + this.project.project_name;
305
-      this.form.project_id = this.project.project_id;
245
+      this.form.method = 'add'
246
+      this.formTitle = '新增' + this.project.project_name
247
+      this.form.project_id = this.project.project_id
306 248
       this.form.remind_cycle = this.patient_info.remind_cycle
307 249
 
308
-      var today = new Date();
309
-      this.form.inspect_date = uParseTime(today, '{y}-{m}-{d}');
310
-      this.form.formItem = [];
311
-      for(var index in this.project.inspection_reference){
250
+      var today = new Date()
251
+      this.form.inspect_date = uParseTime(today, '{y}-{m}-{d}')
252
+      this.form.formItem = []
253
+      for (var index in this.project.inspection_reference) {
312 254
         // var formItem = this.project.inspection_reference[index];
313 255
         // formItem["value"] = '';
314 256
         // if (formItem.range_type==2) {
315 257
         //   formItem["select_options"] = formItem.range_options.split(",");
316 258
         // }
317 259
         this.form.formItem.push({
318
-          id:    0,
260
+          id: 0,
319 261
           project_id: this.project.inspection_reference[index].project_id,
320 262
           project_name: this.project.inspection_reference[index].project_name,
321 263
           item_id: this.project.inspection_reference[index].id,
322 264
           item: this.project.inspection_reference[index].item,
323 265
           item_name: this.project.inspection_reference[index].item_name,
324 266
           range_type: this.project.inspection_reference[index].range_type,
325
-          value:'',
326
-          select_options: this.project.inspection_reference[index].range_options.split(","),
327
-          unit: this.project.inspection_reference[index].unit,
328
-        });
267
+          value: '',
268
+          select_options: this.project.inspection_reference[index].range_options.split(','),
269
+          unit: this.project.inspection_reference[index].unit
270
+        })
329 271
       }
330 272
 
331
-      this.dialogFormVisible = true;
273
+      this.dialogFormVisible = true
332 274
     },
333
-    submitEdit(formName){
275
+    submitEdit(formName) {
334 276
       this.$refs[formName].validate((valid) => {
335 277
         if (valid) {
336
-          this.formLoading = true;
337
-          if (this.form.formItem.length==0) {
338
-            this.$message.error("未填写项目");
339
-            return false;
278
+          this.formLoading = true
279
+          if (this.form.formItem.length == 0) {
280
+            this.$message.error('未填写项目')
281
+            return false
340 282
           }
341
-          for( var index in this.form.formItem) {
342
-            this.form.formItem[index].value = '' + this.form.formItem[index].value;
283
+          for (var index in this.form.formItem) {
284
+            this.form.formItem[index].value = '' + this.form.formItem[index].value
343 285
           }
344 286
 
345
-
346
-
347
-
348
-          EditPatientInspection(this.patientID, this.form,this.form.remind_cycle).then(response=>{
349
-            if (response.data.state==1) {
287
+          EditPatientInspection(this.patientID, this.form, this.form.remind_cycle).then(response => {
288
+            if (response.data.state == 1) {
350 289
               this.$notify({
351
-                title: "成功",
352
-                message: "修改成功",
353
-                type: "success",
290
+                title: '成功',
291
+                message: '修改成功',
292
+                type: 'success',
354 293
                 duration: 2000
355
-              });
294
+              })
356 295
               this.patient_info.remind_cycle = response.data.data.remind_cycle
357
-              this.itemDate = this.form.inspect_date;
358
-              this.items=[];
359
-              var inspections = response.data.data.inspections;
360
-              this.inspections = response.data.data.inspections;
361
-              if (inspections==null) {
362
-                this.inspections = [];
363
-                return false;
296
+              this.itemDate = this.form.inspect_date
297
+              this.items = []
298
+              var inspections = response.data.data.inspections
299
+              this.inspections = response.data.data.inspections
300
+              if (inspections == null) {
301
+                this.inspections = []
302
+                return false
364 303
               }
365
-              var inspectionsMap = {};
366
-              this.inspectionsMap = {};
304
+              var inspectionsMap = {}
305
+              this.inspectionsMap = {}
367 306
               for (var index in inspections) {
368
-                inspectionsMap[inspections[index].item_id] = inspections[index];
369
-                this.inspectionsMap[inspections[index].item_id] = inspections[index];
307
+                inspectionsMap[inspections[index].item_id] = inspections[index]
308
+                this.inspectionsMap[inspections[index].item_id] = inspections[index]
370 309
               }
371
-              var items = this.project.inspection_reference;
372
-              for(var index in items) {
310
+              var items = this.project.inspection_reference
311
+              for (var index in items) {
373 312
                 if (items[index].id in inspectionsMap) {
374
-                  var item = {};
375
-                  for(var key in items[index]) {
376
-                    item[key] = items[index][key];
313
+                  var item = {}
314
+                  for (var key in items[index]) {
315
+                    item[key] = items[index][key]
377 316
                   }
378
-                  item.value = inspectionsMap[items[index].id].inspect_value;
379
-                  item.value_direction = "";
380
-                  if (item.range_type==1) {
381
-                    var value = parseFloat(item.value);
382
-                    var range_min = parseFloat(item.range_min);
383
-                    var range_max = parseFloat(item.range_max);
317
+                  item.value = inspectionsMap[items[index].id].inspect_value
318
+                  item.value_direction = ''
319
+                  if (item.range_type == 1) {
320
+                    var value = parseFloat(item.value)
321
+                    var range_min = parseFloat(item.range_min)
322
+                    var range_max = parseFloat(item.range_max)
384 323
                     if (value < range_min) {
385
-                      item.value_direction = "↓";
386
-                    }else if (value > range_max) {
387
-                      item.value_direction = "↑";
324
+                      item.value_direction = '↓'
325
+                    } else if (value > range_max) {
326
+                      item.value_direction = '↑'
388 327
                     }
389 328
                   }
390
-                  this.items.push(item);
329
+                  this.items.push(item)
391 330
                 }
392 331
               }
393 332
 
394
-              this.resetForm(formName);
395
-              this.dialogFormVisible = false;
396
-
397
-            }else {
398
-              this.$message.error(response.data.msg);
399
-              return false;
333
+              this.resetForm(formName)
334
+              this.dialogFormVisible = false
335
+            } else {
336
+              this.$message.error(response.data.msg)
337
+              return false
400 338
             }
401
-          }).catch(v=>{
402
-            this.$message.error(v);
403
-            return false;
404
-          });
405
-          this.formLoading = false;
406
-          return false;
339
+          }).catch(v => {
340
+            this.$message.error(v)
341
+            return false
342
+          })
343
+          this.formLoading = false
344
+          return false
407 345
         } else {
408
-          return false;
346
+          return false
409 347
         }
410
-      });
348
+      })
411 349
     },
412
-    submitNew(formName){
350
+    submitNew(formName) {
413 351
       this.$refs[formName].validate((valid) => {
414 352
         if (valid) {
415
-          this.formLoading = true;
416
-          if (this.form.formItem.length==0) {
417
-            this.$message.error("未填写项目");
418
-            return false;
353
+          this.formLoading = true
354
+          if (this.form.formItem.length == 0) {
355
+            this.$message.error('未填写项目')
356
+            return false
419 357
           }
420
-          for( var index in this.form.formItem) {
421
-            this.form.formItem[index].value = '' + this.form.formItem[index].value;
358
+          for (var index in this.form.formItem) {
359
+            this.form.formItem[index].value = '' + this.form.formItem[index].value
422 360
           }
423
-          CreatePatientInspection(this.patientID, this.form, this.form.remind_cycle).then(response=>{
424
-            if (response.data.state==1) {
361
+          CreatePatientInspection(this.patientID, this.form, this.form.remind_cycle).then(response => {
362
+            if (response.data.state == 1) {
425 363
               this.$notify({
426
-                title: "成功",
427
-                message: "新增成功",
428
-                type: "success",
364
+                title: '成功',
365
+                message: '新增成功',
366
+                type: 'success',
429 367
                 duration: 2000
430
-              });
368
+              })
431 369
               // this.form.remind_reycle = response.data.data.remind_reycc
432 370
               this.patient_info.remind_cycle = response.data.data.remind_cycle
433
-              console.log( this.patient_info.remind_cycle)
371
+              console.log(this.patient_info.remind_cycle)
434 372
 
435
-              this.itemDate = this.form.inspect_date;
436
-              this.items=[];
437
-              for( var index in this.projects) {
373
+              this.itemDate = this.form.inspect_date
374
+              this.items = []
375
+              for (var index in this.projects) {
438 376
                 if (this.projects[index].project_id == this.form.project_id) {
439
-                  this.projects[index].count ++;
440
-                  break;
377
+                  this.projects[index].count++
378
+                  break
441 379
                 }
442 380
               }
443
-              this.total +=1;
444
-              var inspections = response.data.data.inspections;
445
-              this.inspections = response.data.data.inspections;
446
-              if (inspections==null) {
447
-                this.inspections = [];
448
-                return false;
381
+              this.total += 1
382
+              var inspections = response.data.data.inspections
383
+              this.inspections = response.data.data.inspections
384
+              if (inspections == null) {
385
+                this.inspections = []
386
+                return false
449 387
               }
450
-              var inspectionsMap = {};
451
-              this.inspectionsMap = {};
388
+              var inspectionsMap = {}
389
+              this.inspectionsMap = {}
452 390
               for (var index in inspections) {
453
-                inspectionsMap[inspections[index].item_id] = inspections[index];
454
-                this.inspectionsMap[inspections[index].item_id] = inspections[index];
391
+                inspectionsMap[inspections[index].item_id] = inspections[index]
392
+                this.inspectionsMap[inspections[index].item_id] = inspections[index]
455 393
               }
456
-              var items = this.project.inspection_reference;
457
-              for(var index in items) {
394
+              var items = this.project.inspection_reference
395
+              for (var index in items) {
458 396
                 if (items[index].id in inspectionsMap) {
459
-                  var item = {};
460
-                  for(var key in items[index]) {
461
-                    item[key] = items[index][key];
397
+                  var item = {}
398
+                  for (var key in items[index]) {
399
+                    item[key] = items[index][key]
462 400
                   }
463
-                  item.value = inspectionsMap[items[index].id].inspect_value;
464
-                  item.value_direction = "";
465
-                  if (item.range_type==1) {
466
-                    var value = parseFloat(item.value);
467
-                    var range_min = parseFloat(item.range_min);
468
-                    var range_max = parseFloat(item.range_max);
401
+                  item.value = inspectionsMap[items[index].id].inspect_value
402
+                  item.value_direction = ''
403
+                  if (item.range_type == 1) {
404
+                    var value = parseFloat(item.value)
405
+                    var range_min = parseFloat(item.range_min)
406
+                    var range_max = parseFloat(item.range_max)
469 407
                     if (value < range_min) {
470
-                      item.value_direction = "↓";
471
-                    }else if (value > range_max) {
472
-                      item.value_direction = "↑";
408
+                      item.value_direction = '↓'
409
+                    } else if (value > range_max) {
410
+                      item.value_direction = '↑'
473 411
                     }
474 412
                   }
475
-                  this.items.push(item);
413
+                  this.items.push(item)
476 414
                 }
477 415
               }
478 416
 
479
-              this.resetForm(formName);
480
-              this.dialogFormVisible = false;
481
-
482
-
483
-              this.queryParams.patient = this.patientID;
484
-              this.queryParams.project_id = this.project.project_id;
485
-              this.queryParams.page = 1;
486
-              this.total = 0;
487
-              this.fetchPatientInspections(this.queryParams);
488
-
489
-
490
-            }else {
491
-              this.$message.error(response.data.msg);
492
-              return false;
417
+              this.resetForm(formName)
418
+              this.dialogFormVisible = false
419
+
420
+              this.queryParams.patient = this.patientID
421
+              this.queryParams.project_id = this.project.project_id
422
+              this.queryParams.page = 1
423
+              this.total = 0
424
+              this.fetchPatientInspections(this.queryParams)
425
+            } else {
426
+              this.$message.error(response.data.msg)
427
+              return false
493 428
             }
494
-          }).catch(v=>{
495
-            this.$message.error(v);
496
-            return false;
497
-          });
498
-          this.formLoading = false;
499
-          return false;
429
+          }).catch(v => {
430
+            this.$message.error(v)
431
+            return false
432
+          })
433
+          this.formLoading = false
434
+          return false
500 435
         } else {
501
-          return false;
436
+          return false
502 437
         }
503
-      });
504
-
438
+      })
505 439
     },
506
-    fetchInspectionReference(){
507
-      fetchInspectionReference(this.patientID).then(response=>{
508
-        if(response.data.state==1) {
509
-          var reference = response.data.data.reference;
510
-          var patient_info = response.data.data.patient_info;
511
-          this.projects = reference;
512
-          this.patient_info = patient_info;
513
-          this.pageLoading = false;
440
+    fetchInspectionReference() {
441
+      fetchInspectionReference(this.patientID).then(response => {
442
+        if (response.data.state == 1) {
443
+          var reference = response.data.data.reference
444
+          var patient_info = response.data.data.patient_info
445
+          this.projects = reference
446
+          this.patient_info = patient_info
447
+          this.pageLoading = false
514 448
           this.form.remind_cycle = this.patient_info.remind_cycle
515
-        }else {
516
-          this.$message.error(response.data.msg);
517
-          return false;
449
+        } else {
450
+          this.$message.error(response.data.msg)
451
+          return false
518 452
         }
519
-      }).catch(v=>{
520
-      });
453
+      }).catch(v => {
454
+      })
521 455
     },
522 456
     setCurrent(row) {
523
-      this.$refs.singleTable.setCurrentRow(row);
457
+      this.$refs.singleTable.setCurrentRow(row)
524 458
     },
525 459
     resetForm(formName) {
526
-      this.$refs[formName].resetFields();
460
+      this.$refs[formName].resetFields()
527 461
     },
528 462
     handleCurrentChange(row) {
529
-      this.itemDate = '';
530
-      this.form.method = 'add';
531
-      if(typeof(row)=="undefined" || row==null) {
532
-        this.project = null;
533
-        this.items = [];
534
-        this.itemName='请选择项目';
535
-      }else {
536
-        this.itemLoading = true;
537
-        this.project = row;
538
-        this.items = row.inspection_reference;
539
-        this.itemName=row.project_name;
540
-
541
-        this.queryParams.patient = this.patientID;
542
-        this.queryParams.project_id = this.project.project_id;
543
-        this.queryParams.page = 1;
544
-        this.total = 0;
545
-        this.fetchPatientInspections(this.queryParams);
463
+      this.itemDate = ''
464
+      this.form.method = 'add'
465
+      if (typeof (row) === 'undefined' || row == null) {
466
+        this.project = null
467
+        this.items = []
468
+        this.itemName = '请选择项目'
469
+      } else {
470
+        this.itemLoading = true
471
+        this.project = row
472
+        this.items = row.inspection_reference
473
+        this.itemName = row.project_name
474
+
475
+        this.queryParams.patient = this.patientID
476
+        this.queryParams.project_id = this.project.project_id
477
+        this.queryParams.page = 1
478
+        this.total = 0
479
+        this.fetchPatientInspections(this.queryParams)
546 480
       }
547 481
     },
548 482
 
549 483
     handleCurrentChangePage(val) {
550
-        this.itemLoading = true;
551
-      this.queryParams.page = val;
552
-      this.fetchPatientInspections(this.queryParams);
484
+      this.itemLoading = true
485
+      this.queryParams.page = val
486
+      this.fetchPatientInspections(this.queryParams)
553 487
     },
554
-    fetchPatientInspections(params){
555
-      this.items = [];
556
-      fetchPatientInspections(params).then(response=>{
557
-        if(response.data.state==1) {
558
-          var inspections = response.data.data.inspections;
559
-          this.total = response.data.data.total;
560
-          this.itemDate = response.data.data.date;
561
-          this.inspections = response.data.data.inspections;
562
-          if (inspections==null) {
563
-            this.inspections = [];
564
-            return false;
488
+    fetchPatientInspections(params) {
489
+      this.items = []
490
+      fetchPatientInspections(params).then(response => {
491
+        if (response.data.state == 1) {
492
+          var inspections = response.data.data.inspections
493
+          this.total = response.data.data.total
494
+          this.itemDate = response.data.data.date
495
+          this.inspections = response.data.data.inspections
496
+          if (inspections == null) {
497
+            this.inspections = []
498
+            return false
565 499
           }
566
-          var inspectionsMap = {};
567
-          this.inspectionsMap = {};
500
+          var inspectionsMap = {}
501
+          this.inspectionsMap = {}
568 502
           for (var index in inspections) {
569
-            inspectionsMap[inspections[index].item_id] = inspections[index];
570
-            this.inspectionsMap[inspections[index].item_id] = inspections[index];
503
+            inspectionsMap[inspections[index].item_id] = inspections[index]
504
+            this.inspectionsMap[inspections[index].item_id] = inspections[index]
571 505
           }
572
-          var items = this.project.inspection_reference;
573
-          for(var index in items) {
574
-            if (items[index].id in inspectionsMap) {
575
-              var item = {};
576
-              for(var key in items[index]) {
577
-                item[key] = items[index][key];
506
+          var items = this.project.inspection_reference
507
+          for (var index in items) {
508
+            if (items[index].id in inspectionsMap || items[index].item_id in inspectionsMap) {
509
+              var item = {}
510
+              for (var key in items[index]) {
511
+                item[key] = items[index][key]
578 512
               }
579
-              item.value = inspectionsMap[items[index].id].inspect_value;
580
-              item.value_direction = "";
581
-              if (item.range_type==1) {
582
-                var value = parseFloat(item.value);
583
-                var range_min = parseFloat(item.range_min);
584
-                var range_max = parseFloat(item.range_max);
513
+              if (item.item_id > 0) {
514
+                item.value = inspectionsMap[items[index].item_id].inspect_value
515
+              } else {
516
+                item.value = inspectionsMap[items[index].id].inspect_value
517
+              }
518
+              item.value_direction = ''
519
+              if (item.range_type == 1) {
520
+                var value = parseFloat(item.value)
521
+                var range_min = parseFloat(item.range_min)
522
+                var range_max = parseFloat(item.range_max)
585 523
                 if (value < range_min) {
586
-                  item.value_direction = "↓";
524
+                  item.value_direction = '↓'
587 525
                 } else if (value > range_max) {
588
-                  item.value_direction = "↑";
526
+                  item.value_direction = '↑'
589 527
                 }
590 528
               }
591
-              this.items.push(item);
529
+              this.items.push(item)
592 530
             }
593 531
           }
594 532
           console.log(this.items)
595
-
596 533
         }
597
-      }).catch(v=>{});
534
+      }).catch(v => {})
598 535
       setTimeout(() => {
599
-        this.itemLoading = false;
600
-      }, 1000);
601
-    },
536
+        this.itemLoading = false
537
+      }, 1000)
538
+    }
602 539
   },
603 540
   created() {
604
-    const id = this.$route.query && this.$route.query.id;
605
-    this.patientID = parseInt(id);
541
+    const id = this.$route.query && this.$route.query.id
542
+    this.patientID = parseInt(id)
606 543
     if (isNaN(this.patientID) || this.patientID <= 0) {
607 544
       this.$notify.error({
608
-        title: "错误",
609
-        message: "无效的id"
610
-      });
611
-      this.$router.push("/patients/patients");
545
+        title: '错误',
546
+        message: '无效的id'
547
+      })
548
+      this.$router.push('/patients/patients')
612 549
     }
613 550
 
614
-    this.fetchInspectionReference();
551
+    this.fetchInspectionReference()
615 552
   }
616
-};
553
+}
617 554
 </script>
618 555
 
619 556
 <style>